@nylas/react 2.0.0 → 2.0.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.
- package/dist/abstract-provider-bdb7d9b4-12a95387.cjs +1 -0
- package/dist/abstract-provider-bdb7d9b4-22cf4a74.js +187 -0
- package/dist/add-circle-icon_2.entry-0ff79148.js +26 -0
- package/dist/add-circle-icon_2.entry-d56f519c.cjs +1 -0
- package/dist/archive-icon.entry-6ab120ff.cjs +1 -0
- package/dist/archive-icon.entry-aaff46ec.js +16 -0
- package/dist/arrow-icon.entry-d57cf44f.cjs +1 -0
- package/dist/{arrow-icon.entry-9414299f.js → arrow-icon.entry-d8fcbc1f.js} +5 -5
- package/dist/{bold-icon.entry-c781e9c1.cjs → bold-icon.entry-0f23543d.cjs} +1 -1
- package/dist/{bold-icon.entry-b72aed9f.js → bold-icon.entry-e48075a4.js} +2 -2
- package/dist/{button-component_2.entry-73f76545.cjs → button-component_2.entry-3d622397.cjs} +1 -1
- package/dist/{button-component_2.entry-36e49459.js → button-component_2.entry-5db80bec.js} +9 -9
- package/dist/calendar-agenda-fill-icon_36.entry-75d7cd5b.cjs +6 -0
- package/dist/{calendar-agenda-fill-icon_36.entry-efa7ad26.js → calendar-agenda-fill-icon_36.entry-78fc2e0d.js} +823 -804
- package/dist/{calendar-cancel-icon.entry-0f739a8a.js → calendar-cancel-icon.entry-8b43441c.js} +5 -5
- package/dist/{calendar-cancel-icon.entry-01c388eb.cjs → calendar-cancel-icon.entry-9546c7c3.cjs} +1 -1
- package/dist/calendar-check-icon.entry-4e6abda7.js +16 -0
- package/dist/calendar-check-icon.entry-a03b249a.cjs +1 -0
- package/dist/{calendar-icon.entry-f197396d.js → calendar-icon.entry-5b622c12.js} +2 -2
- package/dist/{calendar-icon.entry-9743e0b7.cjs → calendar-icon.entry-cd4b0ec4.cjs} +1 -1
- package/dist/checkbox-component_2.entry-82f4b1f2.js +115 -0
- package/dist/checkbox-component_2.entry-c9c8a87d.cjs +1 -0
- package/dist/checkbox-group_4.entry-5a4f0ed2.cjs +28 -0
- package/dist/{nylas-event-calendar_3.entry-9abd46c2.js → checkbox-group_4.entry-b2a5b2b2.js} +1038 -923
- package/dist/checkmark-circle-icon.entry-30582af4.js +16 -0
- package/dist/checkmark-circle-icon.entry-9617301c.cjs +1 -0
- package/dist/{checkmark-icon_15.entry-5c09cff5.js → checkmark-icon_15.entry-01536ed2.js} +48 -48
- package/dist/{checkmark-icon_15.entry-35dd97b7.cjs → checkmark-icon_15.entry-c5eaad9b.cjs} +2 -2
- package/dist/{chevron-icon_3.entry-e0608b7c.cjs → chevron-icon_3.entry-26f14744.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-4a72f211.js → chevron-icon_3.entry-517447a6.js} +16 -16
- package/dist/{clock-icon_4.entry-202ce025.cjs → clock-icon_4.entry-5351318c.cjs} +1 -1
- package/dist/{clock-icon_4.entry-0afe79c2.js → clock-icon_4.entry-7ea1274d.js} +8 -8
- package/dist/{customParseFormat-d1de5ed0-65a0bba3.cjs → customParseFormat-f0d21eb3-769d6bf2.cjs} +1 -1
- package/dist/{customParseFormat-d1de5ed0-c0ef002d.js → customParseFormat-f0d21eb3-904f1e57.js} +1 -1
- package/dist/{delete-icon.entry-580bfcc9.js → delete-icon.entry-02e44ba1.js} +2 -2
- package/dist/{delete-icon.entry-762ac892.cjs → delete-icon.entry-64b61f5c.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-4e0f0c61.cjs → document-refresh-icon.entry-2f599a22.cjs} +1 -1
- package/dist/document-refresh-icon.entry-fcaa84ad.js +16 -0
- package/dist/{feedbackSync-172f942c-42124493.js → feedbackSync-b9c9e719-b54b3268.js} +811 -798
- package/dist/{feedbackSync-172f942c-62f72bd2.cjs → feedbackSync-b9c9e719-bee3fea1.cjs} +26 -26
- package/dist/{folder-icon.entry-2694e253.cjs → folder-icon.entry-55c123dc.cjs} +1 -1
- package/dist/{folder-icon.entry-54c3cc66.js → folder-icon.entry-f4862c1b.js} +4 -4
- package/dist/{forward-icon.entry-5e540f05.js → forward-icon.entry-4a41e94f.js} +2 -2
- package/dist/{forward-icon.entry-f07102d8.cjs → forward-icon.entry-82719382.cjs} +1 -1
- package/dist/{globe-icon_2.entry-14a4c168.cjs → globe-icon_2.entry-3f0e408e.cjs} +1 -1
- package/dist/{globe-icon_2.entry-aaceb196.js → globe-icon_2.entry-8f5c79b2.js} +20 -20
- package/dist/google-logo-icon_6.entry-9c91c3d4.cjs +2 -0
- package/dist/{google-logo-icon_6.entry-00d40db2.js → google-logo-icon_6.entry-b331ab60.js} +682 -488
- package/dist/{google-meet-icon_5.entry-6c20e149.cjs → google-meet-icon_5.entry-e3d44d56.cjs} +1 -1
- package/dist/{google-meet-icon_5.entry-f1f05903.js → google-meet-icon_5.entry-eb9f7d93.js} +14 -14
- package/dist/inbox-icon.entry-a385095d.js +16 -0
- package/dist/inbox-icon.entry-fa9085cd.cjs +1 -0
- package/dist/index-ad781fbc.js +24639 -0
- package/dist/index-dc6efb5e.cjs +118 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.es-ccb2a286-9a2c0934.cjs +7 -0
- package/dist/index.es-ccb2a286-dfa2bfbe.js +2724 -0
- package/dist/{info-icon_2.entry-bbcefb9a.cjs → info-icon_2.entry-9f32753b.cjs} +1 -1
- package/dist/{info-icon_2.entry-b3b313ab.js → info-icon_2.entry-c18a111e.js} +3 -3
- package/dist/{input-component.entry-401b9ba5.js → input-component.entry-eae64f46.js} +12 -12
- package/dist/{input-component.entry-ec8e8e7c.cjs → input-component.entry-ff9e04c9.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-c37f392c.js → input-dropdown_2.entry-1b55ef0c.js} +3 -3
- package/dist/{input-dropdown_2.entry-8cb11601.cjs → input-dropdown_2.entry-67d6d292.cjs} +1 -1
- package/dist/italic-icon.entry-4266a817.js +16 -0
- package/dist/{italic-icon.entry-6675558a.cjs → italic-icon.entry-843feb2b.cjs} +1 -1
- package/dist/{elements → lib/elements}/index.d.ts +1 -1
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/main.d.ts +0 -0
- package/dist/lib/notetaker/CalendarSync/CalendarSync.d.ts +37 -0
- package/dist/lib/notetaker/CalendarSync/CalendarSync.spec.d.ts +0 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +31 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.spec.d.ts +1 -0
- package/dist/lib/notetaker/Transcript/Transcript.d.ts +23 -0
- package/dist/lib/notetaker/Transcript/Transcript.spec.d.ts +0 -0
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +22 -0
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.spec.d.ts +1 -0
- package/dist/lib/notetaker/index.d.ts +9 -0
- package/dist/lib/notetaker/lib/constants.d.ts +12 -0
- package/dist/lib/notetaker/lib/http-client.d.ts +2 -0
- package/dist/lib/notetaker/lib/primitives.d.ts +66 -0
- package/dist/lib/notetaker/lib/store.d.ts +7 -0
- package/dist/lib/notetaker/types.d.ts +42 -0
- package/dist/multi-select-dropdown.entry-854265ef.js +121 -0
- package/dist/multi-select-dropdown.entry-ca9acf75.cjs +1 -0
- package/dist/nylas-booked-event-card_11.entry-8d3e2019.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-e7464ae7.js → nylas-booked-event-card_11.entry-ccf30d91.js} +515 -549
- package/dist/{nylas-form-card.entry-a3186807.js → nylas-form-card.entry-481ede48.js} +3 -3
- package/dist/{nylas-form-card.entry-cbb00fba.cjs → nylas-form-card.entry-58162c72.cjs} +1 -1
- package/dist/nylas-notification_2.entry-7d3ed3b0.js +85 -0
- package/dist/nylas-notification_2.entry-dffa3ff6.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-9744694a.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-7b188a38.js → nylas-scheduler-editor.entry-aa079dff.js} +160 -136
- package/dist/nylas-scheduling.entry-7441979c.js +988 -0
- package/dist/nylas-scheduling.entry-b1fcb48f.cjs +1 -0
- package/dist/{person-icon.entry-d2856f08.js → person-icon.entry-23a69633.js} +7 -7
- package/dist/{person-icon.entry-8998fdb8.cjs → person-icon.entry-acf4d22b.cjs} +1 -1
- package/dist/play-icon.entry-4e7884d4.js +16 -0
- package/dist/{play-icon.entry-99eb969b.cjs → play-icon.entry-aa088180.cjs} +1 -1
- package/dist/{radio-button-group.entry-bc3b12fd.js → radio-button-group.entry-243d7988.js} +2 -2
- package/dist/{radio-button-group.entry-d66edd04.cjs → radio-button-group.entry-cea225c8.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +135 -126
- package/dist/{refresh-icon.entry-99d1982d.cjs → refresh-icon.entry-96cb008f.cjs} +1 -1
- package/dist/{refresh-icon.entry-d6df8b1c.js → refresh-icon.entry-d1603555.js} +2 -2
- package/dist/{register-component-62d792d4-448b6a43.js → register-component-9d4ceee5-46f58baf.js} +1 -1
- package/dist/{register-component-62d792d4-c6e7d129.cjs → register-component-9d4ceee5-6fabc42c.cjs} +1 -1
- package/dist/{reply-all-icon.entry-d7c44139.cjs → reply-all-icon.entry-537f7718.cjs} +1 -1
- package/dist/{reply-all-icon.entry-7ebf01a0.js → reply-all-icon.entry-6fae7288.js} +2 -2
- package/dist/{reply-icon.entry-058c00e8.cjs → reply-icon.entry-72fa6e4c.cjs} +1 -1
- package/dist/{reply-icon.entry-d1622d85.js → reply-icon.entry-ae114e35.js} +5 -5
- package/dist/sent-icon.entry-30a6ac17.cjs +1 -0
- package/dist/sent-icon.entry-b10d5e26.js +16 -0
- package/dist/spam-icon.entry-357aa525.cjs +1 -0
- package/dist/spam-icon.entry-bed45849.js +16 -0
- package/dist/{star-icon.entry-98b80645.js → star-icon.entry-010349a5.js} +4 -4
- package/dist/{star-icon.entry-4db13fdb.cjs → star-icon.entry-53c85ebb.cjs} +1 -1
- package/dist/{stop-icon.entry-0290fd30.js → stop-icon.entry-18f650bf.js} +2 -2
- package/dist/{stop-icon.entry-9d7b53fd.cjs → stop-icon.entry-20af3bf5.cjs} +1 -1
- package/dist/style.css +1 -0
- package/dist/test/vitest.setup.d.ts +0 -0
- package/dist/{textarea-component.entry-9b474ab5.cjs → textarea-component.entry-b19642f1.cjs} +1 -1
- package/dist/{textarea-component.entry-a62c257b.js → textarea-component.entry-e6120440.js} +2 -2
- package/dist/{toggle-switch.entry-e423b793.js → toggle-switch.entry-32b0e964.js} +4 -4
- package/dist/{toggle-switch.entry-5dbfcd48.cjs → toggle-switch.entry-becdda2c.cjs} +1 -1
- package/dist/{translate-icon.entry-60c55a2e.js → translate-icon.entry-2308a8e4.js} +4 -4
- package/dist/{translate-icon.entry-f82fa6fc.cjs → translate-icon.entry-7cb7a479.cjs} +1 -1
- package/dist/trash-fill-icon.entry-7f410c82.js +16 -0
- package/dist/trash-fill-icon.entry-c70b9326.cjs +1 -0
- package/dist/{underline-icon.entry-0807a43d.cjs → underline-icon.entry-23f478f3.cjs} +1 -1
- package/dist/{underline-icon.entry-40028bc6.js → underline-icon.entry-58ef1a9f.js} +2 -2
- package/package.json +41 -17
- package/dist/add-circle-icon_2.entry-8a1c55bc.cjs +0 -1
- package/dist/add-circle-icon_2.entry-b4bbcfee.js +0 -26
- package/dist/archive-icon.entry-a2492cf3.js +0 -16
- package/dist/archive-icon.entry-e48d2356.cjs +0 -1
- package/dist/arrow-icon.entry-b1ecb2aa.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_36.entry-e9b92e0e.cjs +0 -6
- package/dist/calendar-check-icon_2.entry-5febbadf.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-dfb0036d.js +0 -26
- package/dist/checkbox-component.entry-1aa5782f.cjs +0 -1
- package/dist/checkbox-component.entry-72a6aa72.js +0 -43
- package/dist/document-refresh-icon.entry-e500b4e3.js +0 -16
- package/dist/google-logo-icon_6.entry-fa76ffe3.cjs +0 -2
- package/dist/inbox-icon.entry-9a4628f2.cjs +0 -1
- package/dist/inbox-icon.entry-aa78ba8c.js +0 -16
- package/dist/index-1e75512f.cjs +0 -57
- package/dist/index-e8380973.js +0 -18492
- package/dist/index.es-fc8588de-034ead51.cjs +0 -7
- package/dist/index.es-fc8588de-c943eef6.js +0 -2908
- package/dist/italic-icon.entry-0e85d0d9.js +0 -16
- package/dist/multi-select-dropdown_2.entry-3eecf18a.js +0 -193
- package/dist/multi-select-dropdown_2.entry-e37c501d.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-fddc9ab8.cjs +0 -1
- package/dist/nylas-event-calendar_3.entry-e6669bbf.cjs +0 -11
- package/dist/nylas-scheduler-editor.entry-5c92901a.cjs +0 -2
- package/dist/nylas-scheduling.entry-970240f6.cjs +0 -1
- package/dist/nylas-scheduling.entry-e9929b03.js +0 -968
- package/dist/play-icon.entry-f949a80f.js +0 -16
- package/dist/sent-icon.entry-6c604512.cjs +0 -1
- package/dist/sent-icon.entry-fe12bc2f.js +0 -16
- package/dist/spam-icon.entry-45e5292e.cjs +0 -1
- package/dist/spam-icon.entry-b97c7709.js +0 -16
- package/dist/trash-fill-icon.entry-095caae3.cjs +0 -1
- package/dist/trash-fill-icon.entry-825055fd.js +0 -16
- package/dist/warning-icon.entry-24e37759.js +0 -16
- package/dist/warning-icon.entry-fce7c14f.cjs +0 -1
- /package/dist/{elements → lib/elements}/react-component-lib/createComponent.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/createOverlayComponent.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/index.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/interfaces.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/attachProps.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/case.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/dev.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/index.d.ts +0 -0
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { r as w, a as f, b as d, h as
|
|
2
|
-
import { R as
|
|
3
|
-
import { c as S, T as
|
|
1
|
+
import { r as w, a as f, i, b as d, h as o, m as we, w as xe, H as k, g as E, x as ve, y as Fe, d as ae, u as Oe, t as Me, l as Ce, z as F, A as He, C as $e, D as O, E as Ne, G as Ae, I as qe, J as N } from "./index-ad781fbc.js";
|
|
2
|
+
import { R as L } from "./register-component-9d4ceee5-46f58baf.js";
|
|
3
|
+
import { c as S, T as j, a as _e } from "./constants-f51538ef-e0a5f026.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
const Ze = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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:16px;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%}', Ge = Ze;
|
|
8
|
-
var We = function(e,
|
|
9
|
-
var
|
|
8
|
+
var We = function(e, a, n, l) {
|
|
9
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
10
10
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
|
|
11
|
+
t = Reflect.decorate(e, a, n, l);
|
|
12
12
|
else
|
|
13
13
|
for (var c = e.length - 1; c >= 0; c--)
|
|
14
|
-
(
|
|
15
|
-
return
|
|
16
|
-
}, A = function(e,
|
|
14
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
15
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
16
|
+
}, A = function(e, a) {
|
|
17
17
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(e,
|
|
18
|
+
return Reflect.metadata(e, a);
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const Te = class {
|
|
21
21
|
constructor(e) {
|
|
22
22
|
w(this, e), this.cancelBookingButtonClicked = f(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = f(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = f(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = f(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
23
|
+
var r, t;
|
|
24
|
+
const a = new Date(this.selectedTimeslot.start_time), n = (t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.min_cancellation_notice;
|
|
25
|
+
if (!n) {
|
|
26
26
|
this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
a.getTime() - n * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
30
30
|
error: {
|
|
31
31
|
title: "Cancellation Error",
|
|
32
|
-
message: `You cannot cancel the booking within ${
|
|
32
|
+
message: `You cannot cancel the booking within ${n} minutes of the event.`
|
|
33
33
|
}
|
|
34
34
|
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
35
35
|
}, this.handleRescheduleButtonClicked = () => {
|
|
36
|
-
const
|
|
37
|
-
this.rescheduleBookedEventError.emit(
|
|
36
|
+
const a = (n) => {
|
|
37
|
+
this.rescheduleBookedEventError.emit(n);
|
|
38
38
|
};
|
|
39
|
-
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler:
|
|
40
|
-
}, this.getPaticipantType = (
|
|
41
|
-
switch (
|
|
39
|
+
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: a });
|
|
40
|
+
}, this.getPaticipantType = (a) => {
|
|
41
|
+
switch (a) {
|
|
42
42
|
case "host":
|
|
43
43
|
return "Host";
|
|
44
44
|
case "you":
|
|
@@ -51,6 +51,9 @@ const xe = class {
|
|
|
51
51
|
themeConfigChanged(e) {
|
|
52
52
|
this.applyThemeConfig(e);
|
|
53
53
|
}
|
|
54
|
+
selectedLanguageChangedHandler(e, a) {
|
|
55
|
+
e !== a && i.changeLanguage(e);
|
|
56
|
+
}
|
|
54
57
|
connectedCallback() {
|
|
55
58
|
}
|
|
56
59
|
disconnectedCallback() {
|
|
@@ -59,41 +62,42 @@ const xe = class {
|
|
|
59
62
|
d("[nylas-booked-event-card] Component will load");
|
|
60
63
|
}
|
|
61
64
|
async componentDidLoad() {
|
|
62
|
-
var
|
|
65
|
+
var n, l;
|
|
63
66
|
d("[nylas-booked-event-card] Component did load"), 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.'), 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.'), this.applyThemeConfig(this.themeConfig);
|
|
64
|
-
const e = S[this.selectedLanguage || "en"],
|
|
67
|
+
const e = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(e, {
|
|
65
68
|
hour: "2-digit",
|
|
66
69
|
minute: "2-digit",
|
|
67
70
|
timeZone: this.selectedTimezone,
|
|
68
71
|
hour12: this.hour12
|
|
69
72
|
});
|
|
70
|
-
this.startTime =
|
|
73
|
+
this.startTime = a.format((n = this.selectedTimeslot) == null ? void 0 : n.start_time), this.endTime = a.format((l = this.selectedTimeslot) == null ? void 0 : l.end_time);
|
|
71
74
|
}
|
|
72
75
|
applyThemeConfig(e) {
|
|
73
76
|
if (e)
|
|
74
|
-
for (const [
|
|
75
|
-
this.host.style.setProperty(`${
|
|
77
|
+
for (const [a, n] of Object.entries(e))
|
|
78
|
+
this.host.style.setProperty(`${a}`, n);
|
|
76
79
|
}
|
|
77
80
|
render() {
|
|
78
|
-
var
|
|
79
|
-
const e = (
|
|
80
|
-
return
|
|
81
|
+
var n, l, r, t, s, c, g, h, C, x, B, D, u, m, T, R;
|
|
82
|
+
const e = (n = this.configSettings) == null ? void 0 : n.booking_type, a = e && e !== "booking";
|
|
83
|
+
return o(k, { key: "0762e32091a5674187788413717366b6213a28fd", part: "nbec" }, o("div", { key: "9cb934481989459e30f9fc718e20855f0f186027", class: "nylas-booked-event-card" }, o("div", { key: "e7b810785f800f82f0c73eaa665cd56bb9406c85", class: "booked-event-timezone" }, o("globe-icon", { key: "3c29fd04b4fc90e0a6583285cbf872ec840ec0d6" }), j[this.selectedTimezone]), o("div", { key: "e7f4406d8c3b110d84cb1d99e5ab8db89954e2f4", class: "event-card-wrapper", part: "nbec__card" }, o("div", { key: "c656687daf9b51190341d35db6c338a9a61df3a2", class: "calendar-icon" }, o("calendar-check-icon", { key: "e1f5cdfa288db54a537f4250d65e2ab0279fb84e" })), o("div", { key: "50e125630023b8dd19d537d20374f9a5464a1547", class: "booked-event-header" }, o("h2", { key: "24e6e52952321065ee1e63c34d55cd1891edeafc", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${i.t("bookingRescheduled")}` : a && !this.isLoading ? `${i.t("bookingSent")}` : `${i.t("bookingConfirmed")}`, "!"), o("div", { key: "cb07bf7f3685624f2b50bcba569399ba084ab00d", class: "card-description", part: "nbec__description" }, a ? i.t("bookingSentDescription") : o("span", null, i.t("bookingConfirmedDescription")))), o("div", { key: "bceb86109e1a9ae6f2c1d98e0267e7f73d763aae", class: "booking-date-time" }, o("checkmark-circle-icon", { key: "0e6fdd3cb183e4d00c6c31fe368eefb01d0465d8" }), o("h3", { key: "c7561d2be55109d69650aa41bb6d356018e1973b" }, i.t("bookingDateAndTimeHeader")), o("p", { key: "31818a7c4a89014438b7af5e722f49728918cc27" }, (l = this.selectedTimeslot) != null && l.start_time ? we(xe((r = this.selectedTimeslot) == null ? void 0 : r.start_time, this.selectedTimezone, S[this.selectedLanguage])) : "-", " ", o("br", { key: "7fcd531af1cea5464ab08f9043aabb4cde0a91db" }), this.startTime, " - ", this.endTime)), o("div", { key: "8d2d827677bf300ad2b0f4dc2c28ac3777971af1", class: "booking-participants" }), !a && o("div", { class: "button-container" }, o("div", { class: {
|
|
81
84
|
footer: !0,
|
|
82
|
-
"no-footer": ((
|
|
83
|
-
"no-template-cols": !!((
|
|
84
|
-
} }, !((m = (
|
|
85
|
+
"no-footer": ((s = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : s.hide_cancellation_options) && ((g = (c = this.configSettings) == null ? void 0 : c.scheduler) == null ? void 0 : g.hide_rescheduling_options) || ((h = this.configSettings) == null ? void 0 : h.booking_type) === "organizer-confirmation",
|
|
86
|
+
"no-template-cols": !!((x = (C = this.configSettings) == null ? void 0 : C.scheduler) != null && x.hide_cancellation_options) || !!((D = (B = this.configSettings) == null ? void 0 : B.scheduler) != null && D.hide_rescheduling_options)
|
|
87
|
+
} }, !((m = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && m.hide_cancellation_options) && o("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${i.t("cancelBookingButton")}`), !((R = (T = this.configSettings) == null ? void 0 : T.scheduler) != null && R.hide_rescheduling_options) && o("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, disabled: this.isLoading, part: "nbec__button-outline nbec__reschedule-cta" }, `${i.t("rescheduleBookingButton")}`))))));
|
|
85
88
|
}
|
|
86
89
|
get host() {
|
|
87
|
-
return
|
|
90
|
+
return E(this);
|
|
88
91
|
}
|
|
89
92
|
static get watchers() {
|
|
90
93
|
return {
|
|
91
|
-
themeConfig: ["themeConfigChanged"]
|
|
94
|
+
themeConfig: ["themeConfigChanged"],
|
|
95
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
92
96
|
};
|
|
93
97
|
}
|
|
94
98
|
};
|
|
95
99
|
We([
|
|
96
|
-
|
|
100
|
+
L({
|
|
97
101
|
name: "nylas-booked-event-card",
|
|
98
102
|
stateToProps: /* @__PURE__ */ new Map([
|
|
99
103
|
["scheduler.bookingInfo", "bookingInfo"],
|
|
@@ -107,17 +111,17 @@ We([
|
|
|
107
111
|
["scheduler.hour12", "hour12"]
|
|
108
112
|
]),
|
|
109
113
|
eventToProps: {
|
|
110
|
-
cancelBookingButtonClicked: async (e,
|
|
111
|
-
|
|
114
|
+
cancelBookingButtonClicked: async (e, a) => {
|
|
115
|
+
a.scheduler.setCancel(e.detail.bookingId);
|
|
112
116
|
},
|
|
113
|
-
rescheduleButtonClicked: async (e,
|
|
114
|
-
const
|
|
115
|
-
l && (!
|
|
117
|
+
rescheduleButtonClicked: async (e, a) => {
|
|
118
|
+
const n = await a.scheduler.setReschedule(e.detail.bookingId), { errorHandler: l } = e.detail;
|
|
119
|
+
l && (!n || "error" in n) && l(n);
|
|
116
120
|
},
|
|
117
|
-
rescheduleBookedEventError: async (e,
|
|
121
|
+
rescheduleBookedEventError: async (e, a) => {
|
|
118
122
|
d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
|
|
119
123
|
},
|
|
120
|
-
cancelBookedEventValidationError: async (e,
|
|
124
|
+
cancelBookedEventValidationError: async (e, a) => {
|
|
121
125
|
d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
|
|
122
126
|
}
|
|
123
127
|
},
|
|
@@ -126,51 +130,51 @@ We([
|
|
|
126
130
|
A("design:type", Function),
|
|
127
131
|
A("design:paramtypes", []),
|
|
128
132
|
A("design:returntype", void 0)
|
|
129
|
-
],
|
|
130
|
-
|
|
133
|
+
], Te.prototype, "render", null);
|
|
134
|
+
Te.style = Ge;
|
|
131
135
|
const Ue = ':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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}.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}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%}multi-select-dropdown::part(msd_dropdown-label){margin-bottom:4px}multi-select-dropdown::part(msd_dropdown_error){font-size:16px}multi-select-dropdown::part(msd_dropdown-button){height:52px;border-color:var(--nylas-base-300)}multi-select-dropdown::part(msd_dropdown-button--error){border-width:2px;border-color:var(--nylas-error)}', Ye = Ue;
|
|
132
|
-
var Xe = function(e,
|
|
133
|
-
var
|
|
136
|
+
var Xe = function(e, a, n, l) {
|
|
137
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
134
138
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
135
|
-
|
|
139
|
+
t = Reflect.decorate(e, a, n, l);
|
|
136
140
|
else
|
|
137
141
|
for (var c = e.length - 1; c >= 0; c--)
|
|
138
|
-
(
|
|
139
|
-
return
|
|
140
|
-
}, q = function(e,
|
|
142
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
143
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
144
|
+
}, q = function(e, a) {
|
|
141
145
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
142
|
-
return Reflect.metadata(e,
|
|
146
|
+
return Reflect.metadata(e, a);
|
|
143
147
|
};
|
|
144
|
-
const
|
|
148
|
+
const M = /^[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])?)*$/, Ee = class {
|
|
145
149
|
constructor(e) {
|
|
146
|
-
w(this, e), this.nameChanged = f(this, "nameChanged", 7), this.emailChanged = f(this, "emailChanged", 7), this.backButtonClicked = f(this, "backButtonClicked", 7), this.detailsConfirmed = f(this, "detailsConfirmed", 7), this.bookingFormError = f(this, "bookingFormError", 7), this.bookingFormSubmitted = f(this, "bookingFormSubmitted", 7), this.handleGuestChange = (
|
|
147
|
-
this.resetGuestEmailError(
|
|
150
|
+
w(this, e), this.nameChanged = f(this, "nameChanged", 7), this.emailChanged = f(this, "emailChanged", 7), this.backButtonClicked = f(this, "backButtonClicked", 7), this.detailsConfirmed = f(this, "detailsConfirmed", 7), this.bookingFormError = f(this, "bookingFormError", 7), this.bookingFormSubmitted = f(this, "bookingFormSubmitted", 7), this.handleGuestChange = (a, n) => {
|
|
151
|
+
this.resetGuestEmailError(a);
|
|
148
152
|
const l = [...this.guestEmails];
|
|
149
|
-
l[
|
|
150
|
-
}, this.handleGuestBlur = (
|
|
151
|
-
if (this.resetGuestEmailError(
|
|
152
|
-
this.guestEmailErrors[
|
|
153
|
+
l[a] = ve(n), this.guestEmails = [...l];
|
|
154
|
+
}, this.handleGuestBlur = (a, n) => {
|
|
155
|
+
if (this.resetGuestEmailError(a), n === "") {
|
|
156
|
+
this.guestEmailErrors[a] = i.t("fieldRequired", { field: i.t("email") });
|
|
153
157
|
return;
|
|
154
158
|
}
|
|
155
|
-
if (
|
|
156
|
-
this.guestEmailErrors[
|
|
159
|
+
if (!M.test(n)) {
|
|
160
|
+
this.guestEmailErrors[a] = i.t("invalidInputFormat", { field: i.t("email") });
|
|
157
161
|
return;
|
|
158
162
|
}
|
|
159
|
-
this.handleGuestChange(
|
|
160
|
-
}, this.addGuestButtonClickedHandler = (
|
|
161
|
-
|
|
162
|
-
}, this.removeGuestButtonClickHandler = (
|
|
163
|
-
|
|
163
|
+
this.handleGuestChange(a, n);
|
|
164
|
+
}, this.addGuestButtonClickedHandler = (a) => {
|
|
165
|
+
a.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
166
|
+
}, this.removeGuestButtonClickHandler = (a, n) => {
|
|
167
|
+
a.preventDefault(), this.resetGuestEmailError(n);
|
|
164
168
|
const l = [...this.guestEmails];
|
|
165
|
-
l.splice(
|
|
166
|
-
}, this.handleBackButtonClicked = (
|
|
167
|
-
|
|
168
|
-
}, this.bookButtonClickedHandler = async (
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
169
|
+
l.splice(n, 1), this.guestEmails = [...l];
|
|
170
|
+
}, this.handleBackButtonClicked = (a) => {
|
|
171
|
+
a.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
|
|
172
|
+
}, this.bookButtonClickedHandler = async (a) => {
|
|
173
|
+
var h, C, x, B, D;
|
|
174
|
+
if (a.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
171
175
|
return;
|
|
172
176
|
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
173
|
-
const l = this.name,
|
|
177
|
+
const l = this.name, r = this.email;
|
|
174
178
|
if (!l || l === "") {
|
|
175
179
|
this.isNameValid = !1, this.validationError.name = i.t("fieldRequired", { field: i.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
176
180
|
title: "Booking form error",
|
|
@@ -178,53 +182,53 @@ const $ = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
178
182
|
});
|
|
179
183
|
return;
|
|
180
184
|
}
|
|
181
|
-
if (!
|
|
185
|
+
if (!r || r === "") {
|
|
182
186
|
this.isEmailValid = !1, this.validationError.email = i.t("fieldRequired", { field: i.t("email") }) || "Email is required", this.bookingFormError.emit({
|
|
183
187
|
title: "Booking form error",
|
|
184
188
|
description: "Email is required"
|
|
185
189
|
});
|
|
186
190
|
return;
|
|
187
191
|
}
|
|
188
|
-
if (
|
|
192
|
+
if (!M.test(r)) {
|
|
189
193
|
this.isEmailValid = !1, this.validationError.email = i.t("invalidInputFormat", { field: i.t("email") }), this.bookingFormError.emit({
|
|
190
194
|
title: "Booking form error",
|
|
191
195
|
description: i.t("invalidInputFormat", { field: i.t("email") }) || "Invalid email"
|
|
192
196
|
});
|
|
193
197
|
return;
|
|
194
198
|
}
|
|
195
|
-
let
|
|
199
|
+
let t = [];
|
|
196
200
|
if (this.guestEmails.length > 0) {
|
|
197
|
-
let
|
|
198
|
-
if (this.guestEmails.forEach((m,
|
|
199
|
-
m === "" ? (
|
|
200
|
-
}),
|
|
201
|
+
let u = !1;
|
|
202
|
+
if (this.guestEmails.forEach((m, T) => {
|
|
203
|
+
m === "" ? (u = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [T]: i.t("fieldRequired", { field: i.t("email") }) }) : M.test(m) || (u = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [T]: i.t("invalidInputFormat", { field: i.t("email") }) });
|
|
204
|
+
}), u) {
|
|
201
205
|
this.bookingFormError.emit({
|
|
202
206
|
title: "Booking form error",
|
|
203
207
|
description: i.t("invalidInputFormat", { field: i.t("guestEmail") }) || "Invalid guest email"
|
|
204
208
|
});
|
|
205
209
|
return;
|
|
206
210
|
}
|
|
207
|
-
|
|
211
|
+
t = this.guestEmails.map((m) => ({ name: m.trim(), email: m.trim() }));
|
|
208
212
|
}
|
|
209
|
-
const
|
|
210
|
-
(
|
|
211
|
-
|
|
212
|
-
}), Object.entries(c).forEach(([
|
|
213
|
-
if (!(
|
|
214
|
-
const
|
|
215
|
-
|
|
213
|
+
const s = {}, c = ((C = (h = this.configSettings) == null ? void 0 : h.scheduler) == null ? void 0 : C.additional_fields) || {}, g = ((B = (x = this.configSettings) == null ? void 0 : x.booking) == null ? void 0 : B.additional_fields) || {};
|
|
214
|
+
(D = this.bookingInfo) != null && D.additionalFields && Object.entries(this.bookingInfo.additionalFields).forEach(([u, m]) => {
|
|
215
|
+
u in c && typeof m.value < "u" && (s[u] = m.value);
|
|
216
|
+
}), Object.entries(c).forEach(([u, m]) => {
|
|
217
|
+
if (!(u in s)) {
|
|
218
|
+
const T = g[u] || m.default || "";
|
|
219
|
+
s[u] = T;
|
|
216
220
|
}
|
|
217
221
|
}), this.detailsConfirmed.emit({
|
|
218
222
|
primaryParticipant: {
|
|
219
223
|
name: l,
|
|
220
|
-
email:
|
|
224
|
+
email: r
|
|
221
225
|
},
|
|
222
|
-
guests:
|
|
223
|
-
additionalFields: { ...
|
|
226
|
+
guests: t,
|
|
227
|
+
additionalFields: { ...s, ...this.additionalFields }
|
|
224
228
|
});
|
|
225
|
-
}, this.updateAdditionalFields = (
|
|
226
|
-
this.additionalFields && (this.additionalFields[
|
|
227
|
-
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1, this.firstRender = !0;
|
|
229
|
+
}, this.updateAdditionalFields = (a, n) => {
|
|
230
|
+
this.additionalFields && (this.additionalFields[a] = n);
|
|
231
|
+
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedLanguage = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.namePatternError = "", this.nameRequiredError = "", this.emailPatternError = "", this.emailRequiredError = "", this.validationError = { name: "", email: "" }, this.backButtonLoading = !1, this.firstRender = !0;
|
|
228
232
|
}
|
|
229
233
|
connectedCallback() {
|
|
230
234
|
}
|
|
@@ -241,17 +245,20 @@ const $ = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
241
245
|
this.firstRender && this.applyThemeConfig(this.themeConfig);
|
|
242
246
|
}
|
|
243
247
|
bookingInfoChangedHandler(e) {
|
|
244
|
-
e && e.primaryParticipant && (this.name = e.primaryParticipant.name || this.name, this.email = e.primaryParticipant.email || this.email), e != null && e.guests && Array.isArray(e.guests) && (this.guestEmails = e.guests.map((
|
|
248
|
+
e && e.primaryParticipant && (this.name = e.primaryParticipant.name || this.name, this.email = e.primaryParticipant.email || this.email), e != null && e.guests && Array.isArray(e.guests) && (this.guestEmails = e.guests.map((a) => a.email));
|
|
245
249
|
}
|
|
246
250
|
configSettingsChangedHandler(e) {
|
|
247
|
-
var
|
|
248
|
-
!((
|
|
251
|
+
var a, n, l, r, t, s, c, g, h, C;
|
|
252
|
+
!((n = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) != null && n.name) && e && ((r = (l = e.booking) == null ? void 0 : l.guest) != null && r.name) && (this.name = e.booking.guest.name || this.name), !((s = (t = this.bookingInfo) == null ? void 0 : t.primaryParticipant) != null && s.email) && e && ((g = (c = e.booking) == null ? void 0 : c.guest) != null && g.email) && (this.email = e.booking.guest.email || this.email), !((h = this.bookingInfo) != null && h.guests) && ((C = e == null ? void 0 : e.booking) != null && C.additional_guests) && Array.isArray(e.booking.additional_guests) && (this.guestEmails = e.booking.additional_guests.map((x) => x.email));
|
|
249
253
|
}
|
|
250
254
|
themeConfigChanged(e) {
|
|
251
255
|
this.applyThemeConfig(e);
|
|
252
256
|
}
|
|
257
|
+
selectedLanguageChangedHandler(e, a) {
|
|
258
|
+
e !== a && (i.changeLanguage(e), this.namePatternError = i.t("invalidInputFormat", { field: i.t("name") }), this.nameRequiredError = i.t("fieldRequired", { field: i.t("name") }), this.emailPatternError = i.t("invalidInputFormat", { field: i.t("email") }), this.emailRequiredError = i.t("fieldRequired", { field: i.t("email") }));
|
|
259
|
+
}
|
|
253
260
|
iterateFormComponents() {
|
|
254
|
-
const e = this.formRef,
|
|
261
|
+
const e = this.formRef, a = [
|
|
255
262
|
"input-component",
|
|
256
263
|
"button-component",
|
|
257
264
|
"select-dropdown",
|
|
@@ -260,35 +267,35 @@ const $ = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
260
267
|
"textarea-component",
|
|
261
268
|
"nylas-date-component",
|
|
262
269
|
"multi-select-dropdown"
|
|
263
|
-
],
|
|
270
|
+
], n = [];
|
|
264
271
|
if (e) {
|
|
265
|
-
const l = (
|
|
266
|
-
Array.from(
|
|
267
|
-
const
|
|
268
|
-
|
|
272
|
+
const l = (r) => {
|
|
273
|
+
Array.from(r.children).forEach((t) => {
|
|
274
|
+
const s = t.tagName.toLowerCase();
|
|
275
|
+
a.includes(s) && n.push(t), l(t);
|
|
269
276
|
});
|
|
270
277
|
};
|
|
271
278
|
l(e);
|
|
272
279
|
}
|
|
273
|
-
return
|
|
280
|
+
return n;
|
|
274
281
|
}
|
|
275
282
|
applyThemeConfig(e) {
|
|
276
283
|
if (e)
|
|
277
|
-
for (const [
|
|
278
|
-
this.host.style.setProperty(`${
|
|
279
|
-
var
|
|
280
|
-
|
|
284
|
+
for (const [a, n] of Object.entries(e))
|
|
285
|
+
this.host.style.setProperty(`${a}`, n), this.iterateFormComponents().forEach((r) => {
|
|
286
|
+
var t;
|
|
287
|
+
r.style.setProperty(`${a}`, n), (t = r.shadowRoot) == null || t.host.style.setProperty(`${a}`, n);
|
|
281
288
|
});
|
|
282
289
|
}
|
|
283
290
|
changeName(e) {
|
|
284
|
-
this.isNameValid = !0, this.validationError.name = "", this.name =
|
|
291
|
+
this.isNameValid = !0, this.validationError.name = "", this.name = Fe(e), this.nameChanged.emit(e);
|
|
285
292
|
}
|
|
286
293
|
changeEmail(e) {
|
|
287
|
-
this.isEmailValid = !0, this.validationError.email = "", this.email =
|
|
294
|
+
this.isEmailValid = !0, this.validationError.email = "", this.email = ve(e), this.emailChanged.emit(e);
|
|
288
295
|
}
|
|
289
296
|
resetGuestEmailError(e) {
|
|
290
|
-
const
|
|
291
|
-
delete
|
|
297
|
+
const a = { ...this.guestEmailErrors };
|
|
298
|
+
delete a[e], this.guestEmailErrors = { ...a };
|
|
292
299
|
}
|
|
293
300
|
nylasFormInputChangedHandler(e) {
|
|
294
301
|
switch (e.detail.name) {
|
|
@@ -328,8 +335,8 @@ const $ = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
328
335
|
});
|
|
329
336
|
return;
|
|
330
337
|
}
|
|
331
|
-
const
|
|
332
|
-
this.updateAdditionalFields(e.detail.name,
|
|
338
|
+
const a = e.detail.value.toString();
|
|
339
|
+
this.updateAdditionalFields(e.detail.name, a);
|
|
333
340
|
}
|
|
334
341
|
switchToggledHandler(e) {
|
|
335
342
|
this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
|
|
@@ -344,63 +351,64 @@ const $ = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
344
351
|
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
345
352
|
}
|
|
346
353
|
render() {
|
|
347
|
-
var
|
|
348
|
-
const e = !!((
|
|
349
|
-
return
|
|
354
|
+
var a, n, l, r, t, s, c, g, h, C, x, B, D, u, m, T, R, ne, te, oe, le;
|
|
355
|
+
const e = !!((a = this.selectedTimeslot) != null && a.event_id) && !!((n = this.selectedTimeslot) != null && n.capacity);
|
|
356
|
+
return o(k, { key: "6659bdd250a39e69ecd8a4468b4f5bf5f3ced414" }, o("form", { key: "ee7e0b97a449cdb18fa474bb5950ebc34922265d", onSubmit: (_) => this.bookButtonClickedHandler(_), ref: (_) => this.formRef = _, noValidate: !0 }, o("div", { key: "b59b81ef1c13449b1e49608ef6faeebbce3fef4d", class: "nylas-booking-form", part: "nbf" }, o("div", { key: "cf75db4476ff5f8b013cbd349038a5945b9aecb0", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "9d5e5e2a2b3a64542bf7df48c0d4dc04bab2a468", label: i.t("name"), name: "name", id: "name", defaultValue: ((r = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : r.name) || ((c = (s = (t = this.configSettings) == null ? void 0 : t.booking) == null ? void 0 : s.guest) == null ? void 0 : c.name) || this.name, placeholder: i.t("namePlaceholder"), type: "text", readOnly: ((h = (g = this.bookingInfo) == null ? void 0 : g.primaryParticipant) == null ? void 0 : h.nameReadOnly) || !1, required: !0, requiredError: this.nameRequiredError, patternError: this.namePatternError, part: "nbf__input-textfield" })), o("div", { key: "d51c1ba6f352aaf611c04efd567d12df03adda6c", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "4fd09b511fd35c732fce53dba8d85d9f1f3e7dfd", label: i.t("email"), name: "email", id: "email", pattern: M, defaultValue: ((x = (C = this.bookingInfo) == null ? void 0 : C.primaryParticipant) == null ? void 0 : x.email) || ((u = (D = (B = this.configSettings) == null ? void 0 : B.booking) == null ? void 0 : D.guest) == null ? void 0 : u.email) || this.email, placeholder: i.t("emailPlaceholder"), type: "email", readOnly: ((T = (m = this.bookingInfo) == null ? void 0 : m.primaryParticipant) == null ? void 0 : T.emailReadOnly) || !1, required: !0, requiredError: this.emailRequiredError, patternError: this.emailPatternError, part: "nbf__input-textfield" })), ((ne = (R = this.configSettings) == null ? void 0 : R.scheduler) == null ? void 0 : ne.hide_additional_guests) !== !0 && o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((_, y) => o("div", { class: "input-wrapper button-wrapper" }, o("label", { class: {
|
|
350
357
|
error: !!this.guestEmailErrors[y]
|
|
351
|
-
} }, i.t("guestEmail")),
|
|
358
|
+
} }, i.t("guestEmail")), o("div", { class: "guest-email-input" }, o("input", { type: "email", id: `guest-email-${y}`, maxLength: 100, class: {
|
|
352
359
|
"guest-email": !0,
|
|
353
360
|
error: !!this.guestEmailErrors[y]
|
|
354
|
-
}, placeholder: i.t("guestEmailPlaceholder"), value: _, "data-index": y, part: "nbf__input-textfield", onBlur: (
|
|
355
|
-
var
|
|
356
|
-
return this.handleGuestBlur(y, (
|
|
357
|
-
}, onInput: (
|
|
358
|
-
var
|
|
359
|
-
return this.handleGuestChange(y, (
|
|
360
|
-
} }),
|
|
361
|
+
}, placeholder: i.t("guestEmailPlaceholder"), value: _, "data-index": y, part: "nbf__input-textfield", onBlur: (p) => {
|
|
362
|
+
var b;
|
|
363
|
+
return this.handleGuestBlur(y, (b = p.target) == null ? void 0 : b.value);
|
|
364
|
+
}, onInput: (p) => {
|
|
365
|
+
var b;
|
|
366
|
+
return this.handleGuestChange(y, (b = p.target) == null ? void 0 : b.value);
|
|
367
|
+
} }), o("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (p) => this.removeGuestButtonClickHandler(p, y), class: {
|
|
361
368
|
"remove-guest": !0,
|
|
362
369
|
error: !!this.guestEmailErrors[y]
|
|
363
|
-
} },
|
|
364
|
-
var
|
|
365
|
-
const y = _[1],
|
|
370
|
+
} }, o("close-icon", null))), o("p", { class: "help-text" }, this.guestEmailErrors[y]))), !e && o("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (_) => this.addGuestButtonClickedHandler(_) }, o("div", { class: "button-content" }, o("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${i.t("addAnotherGuest")}` : `${i.t("addGuest")}`))), (le = Object.entries(((oe = (te = this.configSettings) == null ? void 0 : te.scheduler) == null ? void 0 : oe.additional_fields) || {})) == null ? void 0 : le.sort((_, y) => _[1].order - y[1].order).map((_) => {
|
|
371
|
+
var re, se, ie, ce, de, fe, ye, be, he, ge, ue, me, pe, ke;
|
|
372
|
+
const y = _[1], p = y.label, b = _[0], v = ((ie = (se = (re = this.bookingInfo) == null ? void 0 : re.additionalFields) == null ? void 0 : se[b]) == null ? void 0 : ie.value) || ((fe = (de = (ce = this.configSettings) == null ? void 0 : ce.booking) == null ? void 0 : de.additional_fields) == null ? void 0 : fe[b]) || y.default || "", z = ((he = (be = (ye = this.bookingInfo) == null ? void 0 : ye.additionalFields) == null ? void 0 : be[b]) == null ? void 0 : he.readOnly) || !1;
|
|
366
373
|
switch (y.type) {
|
|
367
374
|
case "dropdown":
|
|
368
|
-
return
|
|
375
|
+
return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("select-dropdown", { label: p, name: b, id: b, readOnly: z, withSearch: !1, emptyValue: i.t("nylasBookingCalendarPicker.selectOptionLabel"), defaultSelectedOption: v ? { value: v, label: v } : void 0, options: [
|
|
369
376
|
{ value: "", label: i.t("nylasBookingCalendarPicker.selectOptionLabel") },
|
|
370
377
|
...((ge = y.options) == null ? void 0 : ge.map((I) => ({ value: I, label: I }))) || []
|
|
371
|
-
], required: y.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
|
|
378
|
+
], required: y.required, errorMessage: i.t("fieldRequired", { field: p }), exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
|
|
372
379
|
case "checkbox":
|
|
373
|
-
return
|
|
380
|
+
return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("checkbox-component", { readOnly: z, label: p, name: b, id: b, checked: v === "true", required: y.required, part: "nbf__checkbox-component" }));
|
|
374
381
|
case "radio_button":
|
|
375
|
-
return
|
|
382
|
+
return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("radio-button-group", { label: p, name: b, id: b, readOnly: z, defaultSelectedValue: v && ((ue = y.options) != null && ue.includes(v)) ? v : ((me = y.options) == null ? void 0 : me[0]) || "", options: (pe = y.options) == null ? void 0 : pe.map((I) => ({ value: I, label: I })), required: y.required, part: "nbf__radio-button-group" }));
|
|
376
383
|
case "multi_line_text":
|
|
377
|
-
return
|
|
384
|
+
return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("textarea-component", { readOnly: z, label: p, defaultValue: v, name: b, id: b, required: y.required, part: "nbf__textarea-component" }));
|
|
378
385
|
case "date":
|
|
379
|
-
return
|
|
386
|
+
return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("nylas-date-component", { readOnly: z, label: p, defaultValue: v, name: b, id: b, required: y.required, part: "nbf__date-component" }));
|
|
380
387
|
case "multi_select": {
|
|
381
|
-
const I = (
|
|
382
|
-
return
|
|
388
|
+
const I = (v == null ? void 0 : v.split(",").map((P) => P.trim())) || [];
|
|
389
|
+
return o("div", null, o("multi-select-dropdown", { label: p, name: b, id: b, readOnly: z, selectAtLeastOneOptionLabel: i.t("selectOneOrMoreOptions"), multipleOptionsSelectedLabel: i.t("multipleOptionsSelected"), options: (ke = y.options) == null ? void 0 : ke.map((P) => ({ value: P, label: P, selected: I.includes(P) })), required: y.required, exportparts: "msd_dropdown: nbf__ms_dropdown, msd_dropdown-label: nbf__ms_dropdown-label, msd_dropdown-button: nbf__ms_dropdown-button, msd_dropdown-content: nbf__ms_dropdown-content, msd_dropdown_error: nbf__ms_dropdown_error, msd_dropdown-button--error: nbf__ms_dropdown-button--error" }));
|
|
383
390
|
}
|
|
384
391
|
case "metadata":
|
|
385
392
|
return null;
|
|
386
393
|
default:
|
|
387
|
-
return
|
|
394
|
+
return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { label: p, name: b, id: b, type: y.type, readOnly: z, defaultValue: v || "", requiredError: i.t("fieldRequired", { field: p }), patternError: i.t("invalidInputFormat", { field: p }), required: y.required, part: "nbf__input-textfield" }));
|
|
388
395
|
}
|
|
389
|
-
})),
|
|
396
|
+
})), o("div", { key: "903b248bb07920e75736ff3b38c142cfd9748c3e", class: "cta" }, o("button-component", { key: "967df15c0a3ce75d07f5b78a3511f0412f8e8d1d", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, o("slot", { key: "c552facf14ba5ddecbf85f32b6976d2a19c74364", name: "booking-form-back-label" }, `${i.t("backButton")}`)), o("button-component", { key: "a07f122b3f9b4b89c049e868e71c993be0eb2da4", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, o("slot", { key: "91884303152748e6cdf080e32d1b78eab1fdd975", name: "booking-form-book-label" }, `${i.t("bookNowButton")}`)))));
|
|
390
397
|
}
|
|
391
398
|
get host() {
|
|
392
|
-
return
|
|
399
|
+
return E(this);
|
|
393
400
|
}
|
|
394
401
|
static get watchers() {
|
|
395
402
|
return {
|
|
396
403
|
bookingInfo: ["bookingInfoChangedHandler"],
|
|
397
404
|
configSettings: ["configSettingsChangedHandler"],
|
|
398
|
-
themeConfig: ["themeConfigChanged"]
|
|
405
|
+
themeConfig: ["themeConfigChanged"],
|
|
406
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
399
407
|
};
|
|
400
408
|
}
|
|
401
409
|
};
|
|
402
410
|
Xe([
|
|
403
|
-
|
|
411
|
+
L({
|
|
404
412
|
name: "nylas-booking-form",
|
|
405
413
|
stateToProps: /* @__PURE__ */ new Map([
|
|
406
414
|
["scheduler.isLoading", "isLoading"],
|
|
@@ -408,25 +416,26 @@ Xe([
|
|
|
408
416
|
["scheduler.eventInfo", "eventInfo"],
|
|
409
417
|
["scheduler.configSettings", "configSettings"],
|
|
410
418
|
["scheduler.themeConfig", "themeConfig"],
|
|
411
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"]
|
|
419
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
420
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
412
421
|
]),
|
|
413
422
|
eventToProps: {
|
|
414
|
-
backButtonClicked: async (e,
|
|
415
|
-
|
|
423
|
+
backButtonClicked: async (e, a) => {
|
|
424
|
+
a.scheduler.toggleAdditionalData(!1);
|
|
416
425
|
},
|
|
417
|
-
nameChanged: async (e,
|
|
418
|
-
|
|
426
|
+
nameChanged: async (e, a) => {
|
|
427
|
+
a.scheduler.setParticipantName(e.detail);
|
|
419
428
|
},
|
|
420
|
-
emailChanged: async (e,
|
|
421
|
-
|
|
429
|
+
emailChanged: async (e, a) => {
|
|
430
|
+
a.scheduler.setParticipantEmail(e.detail);
|
|
422
431
|
},
|
|
423
|
-
detailsConfirmed: async (e,
|
|
432
|
+
detailsConfirmed: async (e, a) => {
|
|
424
433
|
d("nylas-booking-form", "detailsConfirmed", e.detail);
|
|
425
434
|
},
|
|
426
|
-
bookingFormSubmitted: async (e,
|
|
435
|
+
bookingFormSubmitted: async (e, a) => {
|
|
427
436
|
d("nylas-booking-form", "bookingFormSubmitted", e.detail);
|
|
428
437
|
},
|
|
429
|
-
bookingFormError: async (e,
|
|
438
|
+
bookingFormError: async (e, a) => {
|
|
430
439
|
d("nylas-booking-form", "bookingFormError", e.detail);
|
|
431
440
|
}
|
|
432
441
|
},
|
|
@@ -435,56 +444,59 @@ Xe([
|
|
|
435
444
|
q("design:type", Function),
|
|
436
445
|
q("design:paramtypes", []),
|
|
437
446
|
q("design:returntype", void 0)
|
|
438
|
-
],
|
|
439
|
-
|
|
447
|
+
], Ee.prototype, "render", null);
|
|
448
|
+
Ee.style = Ye;
|
|
440
449
|
const Je = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;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:16px;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}', Ke = Je;
|
|
441
|
-
var Qe = function(e,
|
|
442
|
-
var
|
|
450
|
+
var Qe = function(e, a, n, l) {
|
|
451
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
443
452
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
444
|
-
|
|
453
|
+
t = Reflect.decorate(e, a, n, l);
|
|
445
454
|
else
|
|
446
455
|
for (var c = e.length - 1; c >= 0; c--)
|
|
447
|
-
(
|
|
448
|
-
return
|
|
449
|
-
}, Z = function(e,
|
|
456
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
457
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
458
|
+
}, Z = function(e, a) {
|
|
450
459
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
451
|
-
return Reflect.metadata(e,
|
|
460
|
+
return Reflect.metadata(e, a);
|
|
452
461
|
};
|
|
453
|
-
const
|
|
462
|
+
const Le = class {
|
|
454
463
|
constructor(e) {
|
|
455
|
-
var
|
|
464
|
+
var a, n;
|
|
456
465
|
w(this, e), this.goBackButtonClicked = f(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = f(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = f(this, "triggerValidation", 7), this.cancelBookedEventError = f(this, "cancelBookedEventError", 7), this.cancelBookingFormError = f(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
457
466
|
this.goBackButtonClicked.emit();
|
|
458
467
|
}, this.handleSubmitCancelBooking = (l) => {
|
|
459
|
-
var
|
|
468
|
+
var s, c, g;
|
|
460
469
|
if (this.triggerValidation.emit({}), l.preventDefault(), !this.cancellationReason) {
|
|
461
470
|
this.cancellationError = i.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: i.t("cancelBokingFormError"), description: i.t("cancellationErrorMessage") });
|
|
462
471
|
return;
|
|
463
472
|
}
|
|
464
|
-
const
|
|
465
|
-
if (this.selectedTimeslot &&
|
|
473
|
+
const r = (c = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : c.min_cancellation_notice;
|
|
474
|
+
if (this.selectedTimeslot && r && new Date((g = this.selectedTimeslot) == null ? void 0 : g.start_time).getTime() - r * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
466
475
|
this.cancelBookedEventError.emit({
|
|
467
476
|
error: {
|
|
468
477
|
title: i.t("cancellationErrorTitle"),
|
|
469
|
-
message: i.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice:
|
|
478
|
+
message: i.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: r })
|
|
470
479
|
}
|
|
471
480
|
});
|
|
472
481
|
return;
|
|
473
482
|
}
|
|
474
483
|
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
475
|
-
const
|
|
476
|
-
this.cancelBookedEventError.emit(
|
|
484
|
+
const t = (h) => {
|
|
485
|
+
this.cancelBookedEventError.emit(h);
|
|
477
486
|
};
|
|
478
|
-
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler:
|
|
479
|
-
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((
|
|
487
|
+
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: t }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: t });
|
|
488
|
+
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedLanguage = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((n = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
480
489
|
}
|
|
481
490
|
configSettingsChangedHandler(e) {
|
|
482
|
-
var
|
|
483
|
-
this.cancellationPolicy = ((
|
|
491
|
+
var a;
|
|
492
|
+
this.cancellationPolicy = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
484
493
|
}
|
|
485
494
|
themeConfigChanged(e) {
|
|
486
495
|
this.applyThemeConfig(e);
|
|
487
496
|
}
|
|
497
|
+
selectedLanguageChangedHandler(e, a) {
|
|
498
|
+
e !== a && i.changeLanguage(e);
|
|
499
|
+
}
|
|
488
500
|
connectedCallback() {
|
|
489
501
|
d("[nylas-cancel-booking-form] Component connected");
|
|
490
502
|
}
|
|
@@ -498,30 +510,31 @@ const Ee = class {
|
|
|
498
510
|
d("[nylas-cancel-booking-form] Component disconnected");
|
|
499
511
|
}
|
|
500
512
|
applyThemeConfig(e) {
|
|
501
|
-
var
|
|
513
|
+
var a;
|
|
502
514
|
if (e)
|
|
503
|
-
for (const [
|
|
504
|
-
this.host.style.setProperty(`${
|
|
515
|
+
for (const [n, l] of Object.entries(e))
|
|
516
|
+
this.host.style.setProperty(`${n}`, l), (a = this.textareaRef) == null || a.style.setProperty(`${n}`, l);
|
|
505
517
|
}
|
|
506
518
|
handleNylasFormInputChanged(e) {
|
|
507
519
|
this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
|
|
508
520
|
}
|
|
509
521
|
render() {
|
|
510
|
-
var e,
|
|
511
|
-
return
|
|
522
|
+
var e, a;
|
|
523
|
+
return o(k, { key: "3b22e6567ab54d6f2cb568d75fee896a643da4c8", part: "ncbf" }, o("div", { key: "f046c04a7e3960a64e7da64c9a65a76566224f7d", class: "nylas-cancel-booking-form", part: "ncbf__card" }, o("div", { key: "a979e7bea8d4ec498f52d06843d81f48720a0c8c", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, o("calendar-cancel-icon", { key: "85015b6f8078d9159f348ddf323f31dec8f705d4" })), o("h3", { key: "78ecd8321eb0a3c12abef90033d8244ffbfee674", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, i.t("cancelBookingTitle")), o("div", { key: "524ca54afd1054d39d732fc17af3d75ce7586eae", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (a = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && a.cancellation_policy ? this.cancellationPolicy : `${i.t("cancelBookingMessage")}`), o("form", { key: "997e3b3723ac23316214682b8f03714d22c73271", onSubmit: this.handleSubmitCancelBooking }, o("textarea-component", { key: "dd909a7998a66404c9ca4a0a880c65b8f38274d6", id: "cancel-reason", name: "cancel-reason", ref: (n) => this.textareaRef = n, required: !0, label: i.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), o("div", { key: "8a2331c8d00f1c6df904c3758fd5adcbb0a7095f", class: "footer" }, o("button-component", { key: "dd16407657ac2e6e181a213d172364d66466d2ad", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, i.t("cancelBookingButton")), !!this.eventInfo && o("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, i.t("goBackButton"))))));
|
|
512
524
|
}
|
|
513
525
|
get host() {
|
|
514
|
-
return
|
|
526
|
+
return E(this);
|
|
515
527
|
}
|
|
516
528
|
static get watchers() {
|
|
517
529
|
return {
|
|
518
530
|
configSettings: ["configSettingsChangedHandler"],
|
|
519
|
-
themeConfig: ["themeConfigChanged"]
|
|
531
|
+
themeConfig: ["themeConfigChanged"],
|
|
532
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
520
533
|
};
|
|
521
534
|
}
|
|
522
535
|
};
|
|
523
536
|
Qe([
|
|
524
|
-
|
|
537
|
+
L({
|
|
525
538
|
name: "nylas-cancel-booking-form",
|
|
526
539
|
stateToProps: /* @__PURE__ */ new Map([
|
|
527
540
|
["scheduler.configSettings", "configSettings"],
|
|
@@ -530,30 +543,31 @@ Qe([
|
|
|
530
543
|
["scheduler.isLoading", "isLoading"],
|
|
531
544
|
["scheduler.cancelBookingId", "cancelBookingId"],
|
|
532
545
|
["scheduler.rejectBookingId", "rejectBookingId"],
|
|
533
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
546
|
+
["scheduler.themeConfig", "themeConfig"],
|
|
547
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
534
548
|
]),
|
|
535
549
|
eventToProps: {
|
|
536
|
-
cancelBookingFormSubmitted: async (e,
|
|
537
|
-
const { action:
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
540
|
-
l && (!
|
|
541
|
-
} else if (
|
|
542
|
-
const
|
|
550
|
+
cancelBookingFormSubmitted: async (e, a) => {
|
|
551
|
+
const { action: n, errorHandler: l } = e.detail;
|
|
552
|
+
if (n === "cancel") {
|
|
553
|
+
const r = await a.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
|
|
554
|
+
l && (!r || "error" in r) && l(r);
|
|
555
|
+
} else if (n === "reject") {
|
|
556
|
+
const r = await a.scheduler.updateBooking({
|
|
543
557
|
bookingId: e.detail.bookingId,
|
|
544
558
|
status: "cancelled",
|
|
545
559
|
reason: e.detail.reason
|
|
546
560
|
});
|
|
547
|
-
l && (!
|
|
561
|
+
l && (!r || "error" in r) && l(r);
|
|
548
562
|
}
|
|
549
563
|
},
|
|
550
|
-
goBackButtonClicked: async (e,
|
|
551
|
-
d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail),
|
|
564
|
+
goBackButtonClicked: async (e, a) => {
|
|
565
|
+
d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), a.scheduler.goBack();
|
|
552
566
|
},
|
|
553
|
-
cancelBookedEventError: async (e,
|
|
567
|
+
cancelBookedEventError: async (e, a) => {
|
|
554
568
|
d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
|
|
555
569
|
},
|
|
556
|
-
cancelBookingFormError: async (e,
|
|
570
|
+
cancelBookingFormError: async (e, a) => {
|
|
557
571
|
d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
|
|
558
572
|
}
|
|
559
573
|
},
|
|
@@ -562,30 +576,33 @@ Qe([
|
|
|
562
576
|
Z("design:type", Function),
|
|
563
577
|
Z("design:paramtypes", []),
|
|
564
578
|
Z("design:returntype", void 0)
|
|
565
|
-
],
|
|
566
|
-
|
|
567
|
-
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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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%}',
|
|
568
|
-
var
|
|
569
|
-
var
|
|
579
|
+
], Le.prototype, "render", null);
|
|
580
|
+
Le.style = Ke;
|
|
581
|
+
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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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%}', ea = Ve;
|
|
582
|
+
var aa = function(e, a, n, l) {
|
|
583
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
570
584
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
571
|
-
|
|
585
|
+
t = Reflect.decorate(e, a, n, l);
|
|
572
586
|
else
|
|
573
587
|
for (var c = e.length - 1; c >= 0; c--)
|
|
574
|
-
(
|
|
575
|
-
return
|
|
576
|
-
}, G = function(e,
|
|
588
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
589
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
590
|
+
}, G = function(e, a) {
|
|
577
591
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
578
|
-
return Reflect.metadata(e,
|
|
592
|
+
return Reflect.metadata(e, a);
|
|
579
593
|
};
|
|
580
594
|
const Be = class {
|
|
581
595
|
constructor(e) {
|
|
582
596
|
w(this, e), this.closeCancelEventCardClicked = f(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = f(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
583
597
|
this.isClosing = !0;
|
|
584
|
-
const
|
|
585
|
-
this.cancelledEventCardError.emit(
|
|
598
|
+
const a = (n) => {
|
|
599
|
+
this.cancelledEventCardError.emit(n), this.isClosing = !1;
|
|
586
600
|
};
|
|
587
|
-
this.closeCancelEventCardClicked.emit({ errorHandler:
|
|
588
|
-
}, this.configSettings = void 0, this.themeConfig = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
|
|
601
|
+
this.closeCancelEventCardClicked.emit({ errorHandler: a });
|
|
602
|
+
}, this.configSettings = void 0, this.themeConfig = void 0, this.selectedLanguage = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
|
|
603
|
+
}
|
|
604
|
+
selectedLanguageChangedHandler(e, a) {
|
|
605
|
+
e !== a && i.changeLanguage(e);
|
|
589
606
|
}
|
|
590
607
|
themeConfigChanged(e) {
|
|
591
608
|
this.applyThemeConfig(e);
|
|
@@ -604,36 +621,37 @@ const Be = class {
|
|
|
604
621
|
}
|
|
605
622
|
applyThemeConfig(e) {
|
|
606
623
|
if (e)
|
|
607
|
-
for (const [
|
|
608
|
-
this.host.style.setProperty(`${
|
|
624
|
+
for (const [a, n] of Object.entries(e))
|
|
625
|
+
this.host.style.setProperty(`${a}`, n);
|
|
609
626
|
}
|
|
610
627
|
render() {
|
|
611
|
-
var e,
|
|
612
|
-
return
|
|
628
|
+
var e, a;
|
|
629
|
+
return o(k, { key: "bde7d46555a6f6033089f6d49f853df1a7cd0dab", part: "ncec" }, o("div", { key: "a1be2ed4bead0b89572565d00ace39f9a3c0a50d", class: "nylas-cancelled-event-card", part: "ncec__card" }, o("div", { key: "e963d4ab8e599fac8809b3d264602cfc2954064a", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-cancel-icon", { key: "5cccb2a26d77253b99ed377366e312f114406d03" })), o("h3", { key: "9fed1c485eafff15e04d5a36c58488cc337de9e9", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, i.t("bookingCancelledTitle"), "!"), o("div", { key: "081f5d0b0615663c0e79aea7b70ea602375f9547", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, i.t("bookingCancelledMessage"), " ", ((a = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : a.name) || i.t("bookingCancelledMessage_theParticipants"), "."), o("div", { key: "697fbb9cccb9c665d35769f44ae16ff7a2a8ad36", class: "nylas-cancelled-event-card__cta" }, o("button-component", { key: "e4f77128ff98787aca19549e51406d5d88b6fe1a", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
|
|
613
630
|
}
|
|
614
631
|
get host() {
|
|
615
|
-
return
|
|
632
|
+
return E(this);
|
|
616
633
|
}
|
|
617
634
|
static get watchers() {
|
|
618
635
|
return {
|
|
636
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
619
637
|
themeConfig: ["themeConfigChanged"]
|
|
620
638
|
};
|
|
621
639
|
}
|
|
622
640
|
};
|
|
623
|
-
|
|
624
|
-
|
|
641
|
+
aa([
|
|
642
|
+
L({
|
|
625
643
|
name: "nylas-cancelled-event-card",
|
|
626
644
|
stateToProps: /* @__PURE__ */ new Map([
|
|
627
645
|
["scheduler.configSettings", "configSettings"],
|
|
628
646
|
["scheduler.themeConfig", "themeConfig"],
|
|
629
|
-
["scheduler.
|
|
647
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
630
648
|
]),
|
|
631
649
|
eventToProps: {
|
|
632
|
-
closeCancelEventCardClicked: async (e,
|
|
633
|
-
const
|
|
634
|
-
l && (!
|
|
650
|
+
closeCancelEventCardClicked: async (e, a) => {
|
|
651
|
+
const n = await a.scheduler.resetCancel(), { errorHandler: l } = e.detail;
|
|
652
|
+
l && (!n || "error" in n) && l(n);
|
|
635
653
|
},
|
|
636
|
-
cancelledEventCardError: async (e,
|
|
654
|
+
cancelledEventCardError: async (e, a) => {
|
|
637
655
|
d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
|
|
638
656
|
}
|
|
639
657
|
},
|
|
@@ -643,33 +661,36 @@ nn([
|
|
|
643
661
|
G("design:paramtypes", []),
|
|
644
662
|
G("design:returntype", void 0)
|
|
645
663
|
], Be.prototype, "render", null);
|
|
646
|
-
Be.style =
|
|
647
|
-
const
|
|
648
|
-
var
|
|
649
|
-
var
|
|
664
|
+
Be.style = ea;
|
|
665
|
+
const na = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}', ta = na;
|
|
666
|
+
var oa = function(e, a, n, l) {
|
|
667
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
650
668
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
651
|
-
|
|
669
|
+
t = Reflect.decorate(e, a, n, l);
|
|
652
670
|
else
|
|
653
671
|
for (var c = e.length - 1; c >= 0; c--)
|
|
654
|
-
(
|
|
655
|
-
return
|
|
656
|
-
}, W = function(e,
|
|
672
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
673
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
674
|
+
}, W = function(e, a) {
|
|
657
675
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
658
|
-
return Reflect.metadata(e,
|
|
676
|
+
return Reflect.metadata(e, a);
|
|
659
677
|
};
|
|
660
678
|
const De = class {
|
|
661
679
|
constructor(e) {
|
|
662
680
|
w(this, e), this.closeConfirmEventCardClicked = f(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = f(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
|
|
663
681
|
this.isClosing = !0;
|
|
664
|
-
const
|
|
665
|
-
this.confirmedEventCardError.emit(
|
|
682
|
+
const a = (n) => {
|
|
683
|
+
this.confirmedEventCardError.emit(n), this.isClosing = !1;
|
|
666
684
|
};
|
|
667
|
-
this.closeConfirmEventCardClicked.emit({ errorHandler:
|
|
668
|
-
}, this.configSettings = void 0, this.themeConfig = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
|
|
685
|
+
this.closeConfirmEventCardClicked.emit({ errorHandler: a });
|
|
686
|
+
}, this.configSettings = void 0, this.themeConfig = void 0, this.selectedLanguage = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
|
|
669
687
|
}
|
|
670
688
|
themeConfigChanged(e) {
|
|
671
689
|
this.applyThemeConfig(e);
|
|
672
690
|
}
|
|
691
|
+
selectedLanguageChangedHandler(e, a) {
|
|
692
|
+
e !== a && i.changeLanguage(e);
|
|
693
|
+
}
|
|
673
694
|
connectedCallback() {
|
|
674
695
|
d("[nylas-confirmed-event-card] Component connected");
|
|
675
696
|
}
|
|
@@ -684,33 +705,35 @@ const De = class {
|
|
|
684
705
|
}
|
|
685
706
|
applyThemeConfig(e) {
|
|
686
707
|
if (e)
|
|
687
|
-
for (const [
|
|
688
|
-
this.host.style.setProperty(`${
|
|
708
|
+
for (const [a, n] of Object.entries(e))
|
|
709
|
+
this.host.style.setProperty(`${a}`, n);
|
|
689
710
|
}
|
|
690
711
|
render() {
|
|
691
|
-
var e,
|
|
692
|
-
return
|
|
712
|
+
var e, a;
|
|
713
|
+
return o(k, { key: "196444e0b93a298fd4107589a7ffbba19895fe05", part: "ncec" }, o("div", { key: "a421437ec16e3354d51a0eed4e31c7c0de557278", class: "nylas-confirmed-event-card", part: "ncec__card" }, o("div", { key: "0da3ba5fcff4b46951adf128d4d4e6493860d56c", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-check-icon", { key: "a02d08a2367f962607651557eaa5fb7b9d8b75cf" })), o("h3", { key: "0494ca0a842a597bbc40cd3c720d2faf10d6b103", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, i.t("confirmedEventCardTitle"), "!"), o("div", { key: "4473fce54b8ad6176286f84cbd5554c8323312f0", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, i.t("confirmedEventCardDescription"), " ", ((a = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : a.name) || "the participants", "."), o("div", { key: "c0c17c8bccb4bc4b017a4a6aba62cdd48ebeea5a", class: "nylas-confirmed-event-card__cta" }, o("button-component", { key: "1dcb13cff4958b4549125c5457c9ab1e05078316", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
|
|
693
714
|
}
|
|
694
715
|
get host() {
|
|
695
|
-
return
|
|
716
|
+
return E(this);
|
|
696
717
|
}
|
|
697
718
|
static get watchers() {
|
|
698
719
|
return {
|
|
699
|
-
themeConfig: ["themeConfigChanged"]
|
|
720
|
+
themeConfig: ["themeConfigChanged"],
|
|
721
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
700
722
|
};
|
|
701
723
|
}
|
|
702
724
|
};
|
|
703
|
-
|
|
704
|
-
|
|
725
|
+
oa([
|
|
726
|
+
L({
|
|
705
727
|
name: "nylas-confirmed-event-card",
|
|
706
728
|
stateToProps: /* @__PURE__ */ new Map([
|
|
707
729
|
["scheduler.configSettings", "configSettings"],
|
|
708
|
-
["scheduler.themeConfig", "themeConfig"]
|
|
730
|
+
["scheduler.themeConfig", "themeConfig"],
|
|
731
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
709
732
|
]),
|
|
710
733
|
eventToProps: {
|
|
711
|
-
closeConfirmEventCardClicked: async (e,
|
|
712
|
-
const
|
|
713
|
-
l && (!
|
|
734
|
+
closeConfirmEventCardClicked: async (e, a) => {
|
|
735
|
+
const n = await a.scheduler.resetConfirm(), { errorHandler: l } = e.detail;
|
|
736
|
+
l && (!n || "error" in n) && l(n);
|
|
714
737
|
}
|
|
715
738
|
},
|
|
716
739
|
fireRegisterEvent: !0
|
|
@@ -719,81 +742,81 @@ on([
|
|
|
719
742
|
W("design:paramtypes", []),
|
|
720
743
|
W("design:returntype", void 0)
|
|
721
744
|
], De.prototype, "render", null);
|
|
722
|
-
De.style =
|
|
745
|
+
De.style = ta;
|
|
723
746
|
const U = /* @__PURE__ */ new Date(), Y = /* @__PURE__ */ new Date();
|
|
724
|
-
function
|
|
725
|
-
function
|
|
726
|
-
return e(
|
|
727
|
-
}
|
|
728
|
-
return
|
|
729
|
-
const
|
|
730
|
-
return
|
|
731
|
-
},
|
|
747
|
+
function $(e, a, n, l) {
|
|
748
|
+
function r(t) {
|
|
749
|
+
return e(t = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+t)), t;
|
|
750
|
+
}
|
|
751
|
+
return r.floor = (t) => (e(t = /* @__PURE__ */ new Date(+t)), t), r.ceil = (t) => (e(t = new Date(t - 1)), a(t, 1), e(t), t), r.round = (t) => {
|
|
752
|
+
const s = r(t), c = r.ceil(t);
|
|
753
|
+
return t - s < c - t ? s : c;
|
|
754
|
+
}, r.offset = (t, s) => (a(t = /* @__PURE__ */ new Date(+t), s == null ? 1 : Math.floor(s)), t), r.range = (t, s, c) => {
|
|
732
755
|
const g = [];
|
|
733
|
-
if (
|
|
756
|
+
if (t = r.ceil(t), c = c == null ? 1 : Math.floor(c), !(t < s) || !(c > 0))
|
|
734
757
|
return g;
|
|
735
|
-
let
|
|
758
|
+
let h;
|
|
736
759
|
do
|
|
737
|
-
g.push(
|
|
738
|
-
while (
|
|
760
|
+
g.push(h = /* @__PURE__ */ new Date(+t)), a(t, c), e(t);
|
|
761
|
+
while (h < t && t < s);
|
|
739
762
|
return g;
|
|
740
|
-
},
|
|
741
|
-
if (
|
|
742
|
-
for (; e(
|
|
743
|
-
|
|
744
|
-
}, (
|
|
745
|
-
if (
|
|
763
|
+
}, r.filter = (t) => $((s) => {
|
|
764
|
+
if (s >= s)
|
|
765
|
+
for (; e(s), !t(s); )
|
|
766
|
+
s.setTime(s - 1);
|
|
767
|
+
}, (s, c) => {
|
|
768
|
+
if (s >= s)
|
|
746
769
|
if (c < 0)
|
|
747
770
|
for (; ++c <= 0; )
|
|
748
|
-
for (;
|
|
771
|
+
for (; a(s, -1), !t(s); )
|
|
749
772
|
;
|
|
750
773
|
else
|
|
751
774
|
for (; --c >= 0; )
|
|
752
|
-
for (;
|
|
775
|
+
for (; a(s, 1), !t(s); )
|
|
753
776
|
;
|
|
754
|
-
}),
|
|
777
|
+
}), n && (r.count = (t, s) => (U.setTime(+t), Y.setTime(+s), e(U), e(Y), Math.floor(n(U, Y))), r.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? r.filter(l ? (s) => l(s) % t === 0 : (s) => r.count(0, s) % t === 0) : r)), r;
|
|
755
778
|
}
|
|
756
|
-
const
|
|
779
|
+
const la = 1e3, ze = la * 60, ra = ze * 60, H = ra * 24, X = $(
|
|
757
780
|
(e) => e.setHours(0, 0, 0, 0),
|
|
758
|
-
(e,
|
|
759
|
-
(e,
|
|
781
|
+
(e, a) => e.setDate(e.getDate() + a),
|
|
782
|
+
(e, a) => (a - e - (a.getTimezoneOffset() - e.getTimezoneOffset()) * ze) / H,
|
|
760
783
|
(e) => e.getDate() - 1
|
|
761
784
|
);
|
|
762
|
-
|
|
785
|
+
$((e) => {
|
|
763
786
|
e.setUTCHours(0, 0, 0, 0);
|
|
764
|
-
}, (e,
|
|
765
|
-
e.setUTCDate(e.getUTCDate() +
|
|
766
|
-
}, (e,
|
|
767
|
-
|
|
787
|
+
}, (e, a) => {
|
|
788
|
+
e.setUTCDate(e.getUTCDate() + a);
|
|
789
|
+
}, (e, a) => (a - e) / H, (e) => e.getUTCDate() - 1);
|
|
790
|
+
$((e) => {
|
|
768
791
|
e.setUTCHours(0, 0, 0, 0);
|
|
769
|
-
}, (e,
|
|
770
|
-
e.setUTCDate(e.getUTCDate() +
|
|
771
|
-
}, (e,
|
|
772
|
-
const
|
|
773
|
-
var
|
|
774
|
-
var
|
|
792
|
+
}, (e, a) => {
|
|
793
|
+
e.setUTCDate(e.getUTCDate() + a);
|
|
794
|
+
}, (e, a) => (a - e) / H, (e) => Math.floor(e / H));
|
|
795
|
+
const sa = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{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);color:var(--nylas-base-800)}.title h1{max-width:376px;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: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{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)}', ia = sa;
|
|
796
|
+
var ca = function(e, a, n, l) {
|
|
797
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
775
798
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
776
|
-
|
|
799
|
+
t = Reflect.decorate(e, a, n, l);
|
|
777
800
|
else
|
|
778
801
|
for (var c = e.length - 1; c >= 0; c--)
|
|
779
|
-
(
|
|
780
|
-
return
|
|
781
|
-
}, J = function(e,
|
|
802
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
803
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
804
|
+
}, J = function(e, a) {
|
|
782
805
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
783
|
-
return Reflect.metadata(e,
|
|
806
|
+
return Reflect.metadata(e, a);
|
|
784
807
|
};
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
const
|
|
808
|
+
ae.extend(Oe);
|
|
809
|
+
ae.extend(Me);
|
|
810
|
+
const Ie = class {
|
|
788
811
|
constructor(e) {
|
|
789
812
|
w(this, e), this.dateSelected = f(this, "dateSelected", 7), this.monthChanged = f(this, "monthChanged", 7), this.selectableDates = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1, this.selectableDatesTimezone = [];
|
|
790
813
|
}
|
|
791
814
|
configSettingsChanged(e) {
|
|
792
|
-
var
|
|
793
|
-
const
|
|
794
|
-
if (
|
|
815
|
+
var r;
|
|
816
|
+
const a = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (r = e == null ? void 0 : e.scheduler) == null ? void 0 : r.available_days_in_future;
|
|
817
|
+
if (n === void 0)
|
|
795
818
|
return;
|
|
796
|
-
|
|
819
|
+
Ce(/* @__PURE__ */ new Date(), n).getTime() < a.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
797
820
|
}
|
|
798
821
|
selectedLanguageChanged(e) {
|
|
799
822
|
i.changeLanguage(e);
|
|
@@ -804,9 +827,9 @@ const Le = class {
|
|
|
804
827
|
selectedDateChanged(e) {
|
|
805
828
|
(!e || !F(e, this.month)) && (this.month = e || /* @__PURE__ */ new Date()), this.dates = this.getDates();
|
|
806
829
|
}
|
|
807
|
-
convertDatesToTimezone(e,
|
|
808
|
-
return !e || e.length === 0 ? [] : e.map((
|
|
809
|
-
const l =
|
|
830
|
+
convertDatesToTimezone(e, a) {
|
|
831
|
+
return !e || e.length === 0 ? [] : e.map((n) => {
|
|
832
|
+
const l = ae(n).tz(a);
|
|
810
833
|
return new Date(l.year(), l.month(), l.date());
|
|
811
834
|
});
|
|
812
835
|
}
|
|
@@ -827,31 +850,31 @@ const Le = class {
|
|
|
827
850
|
}
|
|
828
851
|
applyThemeConfig(e) {
|
|
829
852
|
if (e)
|
|
830
|
-
for (const [
|
|
831
|
-
this.host.style.setProperty(`${
|
|
853
|
+
for (const [a, n] of Object.entries(e))
|
|
854
|
+
this.host.style.setProperty(`${a}`, n);
|
|
832
855
|
}
|
|
833
856
|
getDates() {
|
|
834
|
-
const e =
|
|
835
|
-
return X.range(X.offset(
|
|
857
|
+
const e = He(this.month), a = $e(this.month);
|
|
858
|
+
return X.range(X.offset(a, -a.getDay()), X.offset(e, 7 - e.getDay()));
|
|
836
859
|
}
|
|
837
860
|
selectDate(e) {
|
|
838
861
|
this.dateSelected.emit(e);
|
|
839
862
|
}
|
|
840
863
|
changeMonth(e) {
|
|
841
|
-
var
|
|
864
|
+
var r, t;
|
|
842
865
|
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
843
|
-
const
|
|
844
|
-
|
|
866
|
+
const a = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.available_days_in_future;
|
|
867
|
+
Ce(/* @__PURE__ */ new Date(), n).getTime() < a.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
845
868
|
}
|
|
846
|
-
isSelected(e,
|
|
847
|
-
return e &&
|
|
869
|
+
isSelected(e, a, n) {
|
|
870
|
+
return e && a && O(e, a) && n && (n == null ? void 0 : n.length) > 0;
|
|
848
871
|
}
|
|
849
872
|
isDisabled(e) {
|
|
850
|
-
return !e || !this.selectableDatesTimezone || this.selectableDatesTimezone.length === 0 ? !0 : !this.selectableDatesTimezone.some((
|
|
873
|
+
return !e || !this.selectableDatesTimezone || this.selectableDatesTimezone.length === 0 ? !0 : !this.selectableDatesTimezone.some((a) => e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate());
|
|
851
874
|
}
|
|
852
875
|
render() {
|
|
853
|
-
var e,
|
|
854
|
-
return
|
|
876
|
+
var e, a, n, l, r, t;
|
|
877
|
+
return o(k, { key: "ecd613f2fec98a00bbb10ac6363097ebede0185d", part: "ndp" }, o("div", { key: "33bb461fca297b69b85ab9f8d17cddb51593dde8", class: "nylas-date-picker" }, o("div", { key: "4da1d51d7bb36838923263563c2f6b1331542fda", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? o("h1", null, (a = this.configSettings) == null ? void 0 : a.name) : ((l = (n = this.configSettings) == null ? void 0 : n.organizer) == null ? void 0 : l.name) && o("h1", null, o("person-icon", null), ((t = (r = this.configSettings) == null ? void 0 : r.organizer) == null ? void 0 : t.name) || "Organizer"), o("p", { key: "8ad906a6b34220b4d35f8dcd1c642d14c3f7293a" }, o("clock-icon", { key: "11d2b21b9ba5fb9a31f9694fc2eaa417b6743957" }), this.eventDuration ? Ne(this.eventDuration) : `- ${i.t("time.minutes")}`)), o("div", { key: "676de20b5616fdbb439567ca27f972040a086b70", class: "header flex-row" }, o("h2", { key: "aa60c555eb8bd7b3ef1ee033b8fc1b74f5a78cdb", part: "ndp__month-header" }, o("strong", { key: "7661ad8cf3c91063617a953aba02c74202910803" }, Ae(this.month.toLocaleDateString("en-US", { month: "long" }).toLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), o("div", { key: "dc4087fff602efe458a75b542cf845e6c1599532", class: "pagination" }, o("button", { key: "34754cf95f2645641597a82b66805e1d92e8122d", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, o("chevron-icon", { key: "376aba646a4910ab430ec239f6ccab083df41334" })), o("button", { key: "01e5e39d56246416bc9270f6a0c2d32202db339a", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, o("chevron-icon", { key: "492223b45186485d55e403a16d75e08c25a070f5" })))), o("div", { key: "c506414f7ae93d4b995054afa18a313ce02c2ca6", class: "dates" }, [
|
|
855
878
|
i.t("days.sunday"),
|
|
856
879
|
i.t("days.monday"),
|
|
857
880
|
i.t("days.tuesday"),
|
|
@@ -859,22 +882,22 @@ const Le = class {
|
|
|
859
882
|
i.t("days.thursday"),
|
|
860
883
|
i.t("days.friday"),
|
|
861
884
|
i.t("days.saturday")
|
|
862
|
-
].map((
|
|
863
|
-
var
|
|
864
|
-
const g = this.isDisabled(
|
|
865
|
-
return this.isLoading ?
|
|
885
|
+
].map((s) => o("div", { class: "day", part: "ndp__day" }, s)), this.dates.map((s, c) => {
|
|
886
|
+
var h;
|
|
887
|
+
const g = this.isDisabled(s);
|
|
888
|
+
return this.isLoading ? o("button", { disabled: !0, class: {
|
|
866
889
|
"date day-skeleton": !0,
|
|
867
|
-
"current-month": F(
|
|
868
|
-
}, style: { animationDelay: `${c * 20}ms` }, part: "ndp__date ndp__date--disabled" },
|
|
890
|
+
"current-month": F(s, this.month)
|
|
891
|
+
}, style: { animationDelay: `${c * 20}ms` }, part: "ndp__date ndp__date--disabled" }, s.getDate()) : o("button", { class: {
|
|
869
892
|
date: !0,
|
|
870
|
-
selected: !!(this.selectedDate && O(
|
|
871
|
-
"current-day": O(
|
|
872
|
-
"current-month": F(
|
|
873
|
-
}, "aria-label":
|
|
893
|
+
selected: !!(this.selectedDate && O(s, this.selectedDate) && this.selectableDates && ((h = this.selectableDates) == null ? void 0 : h.length) > 0),
|
|
894
|
+
"current-day": O(s, /* @__PURE__ */ new Date()),
|
|
895
|
+
"current-month": F(s, this.month)
|
|
896
|
+
}, "aria-label": s.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: g, onClick: () => this.selectDate(s), part: `ndp__date ${this.isSelected(s, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${O(s, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${F(s, this.month) ? "ndp__date--current-month" : ""}` }, s.getDate());
|
|
874
897
|
}))));
|
|
875
898
|
}
|
|
876
899
|
get host() {
|
|
877
|
-
return
|
|
900
|
+
return E(this);
|
|
878
901
|
}
|
|
879
902
|
static get watchers() {
|
|
880
903
|
return {
|
|
@@ -887,8 +910,8 @@ const Le = class {
|
|
|
887
910
|
};
|
|
888
911
|
}
|
|
889
912
|
};
|
|
890
|
-
|
|
891
|
-
|
|
913
|
+
ca([
|
|
914
|
+
L({
|
|
892
915
|
name: "nylas-date-picker",
|
|
893
916
|
stateToProps: /* @__PURE__ */ new Map([
|
|
894
917
|
["scheduler.selectableDates", "selectableDates"],
|
|
@@ -901,10 +924,10 @@ dn([
|
|
|
901
924
|
["scheduler.selectedTimezone", "selectedTimezone"]
|
|
902
925
|
]),
|
|
903
926
|
eventToProps: {
|
|
904
|
-
dateSelected: async (e,
|
|
905
|
-
d("nylas-date-picker", "dateSelected", e.detail),
|
|
927
|
+
dateSelected: async (e, a) => {
|
|
928
|
+
d("nylas-date-picker", "dateSelected", e.detail), a.scheduler.selectDate(e.detail);
|
|
906
929
|
},
|
|
907
|
-
monthChanged: async (e,
|
|
930
|
+
monthChanged: async (e, a) => {
|
|
908
931
|
d("nylas-date-picker", "monthChanged", e.detail);
|
|
909
932
|
}
|
|
910
933
|
},
|
|
@@ -913,25 +936,25 @@ dn([
|
|
|
913
936
|
J("design:type", Function),
|
|
914
937
|
J("design:paramtypes", []),
|
|
915
938
|
J("design:returntype", void 0)
|
|
916
|
-
],
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
var
|
|
920
|
-
var
|
|
939
|
+
], Ie.prototype, "render", null);
|
|
940
|
+
Ie.style = ia;
|
|
941
|
+
const da = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button-selected-label){max-width:80px}select-dropdown::part(sd_dropdown-content){width:100%;max-width:none}}', fa = da;
|
|
942
|
+
var ya = function(e, a, n, l) {
|
|
943
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
921
944
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
922
|
-
|
|
945
|
+
t = Reflect.decorate(e, a, n, l);
|
|
923
946
|
else
|
|
924
947
|
for (var c = e.length - 1; c >= 0; c--)
|
|
925
|
-
(
|
|
926
|
-
return
|
|
927
|
-
}, K = function(e,
|
|
948
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
949
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
950
|
+
}, K = function(e, a) {
|
|
928
951
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
929
|
-
return Reflect.metadata(e,
|
|
952
|
+
return Reflect.metadata(e, a);
|
|
930
953
|
};
|
|
931
|
-
const
|
|
954
|
+
const Se = class {
|
|
932
955
|
constructor(e) {
|
|
933
|
-
var
|
|
934
|
-
w(this, e), this.timezoneChanged = f(this, "timezoneChanged", 7), this.languageChanged = f(this, "languageChanged", 7), this.themeConfig = void 0, this.bookingInfo = void 0, this.selectedTimezone = ((
|
|
956
|
+
var a, n;
|
|
957
|
+
w(this, e), this.timezoneChanged = f(this, "timezoneChanged", 7), this.languageChanged = f(this, "languageChanged", 7), this.themeConfig = void 0, this.bookingInfo = void 0, this.selectedTimezone = ((a = this.bookingInfo) == null ? void 0 : a.timezone) || Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = ((n = this.bookingInfo) == null ? void 0 : n.language) || navigator.language, this.searchPlaceholder = i.t("search");
|
|
935
958
|
}
|
|
936
959
|
themeConfigChanged(e) {
|
|
937
960
|
this.applyThemeConfig(e);
|
|
@@ -946,14 +969,14 @@ const Ie = class {
|
|
|
946
969
|
componentWillLoad() {
|
|
947
970
|
}
|
|
948
971
|
componentDidLoad() {
|
|
949
|
-
var e,
|
|
950
|
-
d("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig), this.bookingInfo && ((e = this.bookingInfo) != null && e.timezone) && this.changeTimezone(this.bookingInfo.timezone), this.bookingInfo && ((
|
|
972
|
+
var e, a;
|
|
973
|
+
d("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig), this.bookingInfo && ((e = this.bookingInfo) != null && e.timezone) && this.changeTimezone(this.bookingInfo.timezone), this.bookingInfo && ((a = this.bookingInfo) != null && a.language) && this.changeLanguage(this.bookingInfo.language);
|
|
951
974
|
}
|
|
952
975
|
applyThemeConfig(e) {
|
|
953
|
-
var
|
|
976
|
+
var a, n;
|
|
954
977
|
if (e)
|
|
955
|
-
for (const [l,
|
|
956
|
-
this.host.style.setProperty(`${l}`,
|
|
978
|
+
for (const [l, r] of Object.entries(e))
|
|
979
|
+
this.host.style.setProperty(`${l}`, r), (a = this.timezoneRef) == null || a.style.setProperty(`${l}`, r), (n = this.languageRef) == null || n.style.setProperty(`${l}`, r);
|
|
957
980
|
}
|
|
958
981
|
changeTimezone(e) {
|
|
959
982
|
this.selectedTimezone = e, this.timezoneChanged.emit(e);
|
|
@@ -962,41 +985,41 @@ const Ie = class {
|
|
|
962
985
|
this.selectedLanguage = e, i.changeLanguage(e), this.searchPlaceholder = i.t("search"), this.languageChanged.emit(e);
|
|
963
986
|
}
|
|
964
987
|
nylasFormDropdownChangedHandler(e) {
|
|
965
|
-
const { name:
|
|
966
|
-
|
|
988
|
+
const { name: a, value: n } = e.detail;
|
|
989
|
+
a === "timezone" ? this.changeTimezone(n) : a === "language" && this.changeLanguage(n);
|
|
967
990
|
}
|
|
968
991
|
getTimezoneLabelHTML(e) {
|
|
969
|
-
const
|
|
970
|
-
return
|
|
992
|
+
const a = qe(e);
|
|
993
|
+
return o("span", { class: "timezone-label", style: {
|
|
971
994
|
display: "flex",
|
|
972
995
|
alignItems: "center",
|
|
973
996
|
justifyContent: "space-between",
|
|
974
997
|
width: "-webkit-fill-available"
|
|
975
|
-
} },
|
|
998
|
+
} }, j[e], " ", o("span", { class: "timezone-offset", style: {
|
|
976
999
|
fontSize: "14px",
|
|
977
1000
|
fontWeight: "400",
|
|
978
1001
|
color: "var(--nylas-base-500)"
|
|
979
|
-
} },
|
|
1002
|
+
} }, a));
|
|
980
1003
|
}
|
|
981
1004
|
render() {
|
|
982
|
-
const e = Object.keys(
|
|
983
|
-
labelHTML: this.getTimezoneLabelHTML(
|
|
984
|
-
label:
|
|
985
|
-
value:
|
|
986
|
-
})),
|
|
987
|
-
label:
|
|
988
|
-
value:
|
|
1005
|
+
const e = Object.keys(j).map((n) => ({
|
|
1006
|
+
labelHTML: this.getTimezoneLabelHTML(n),
|
|
1007
|
+
label: j[n],
|
|
1008
|
+
value: n
|
|
1009
|
+
})), a = Object.keys(_e).map((n) => ({
|
|
1010
|
+
label: _e[n],
|
|
1011
|
+
value: n
|
|
989
1012
|
}));
|
|
990
|
-
return
|
|
1013
|
+
return o(k, { key: "db7685f65c4d6311437f51b90c8ff2d6f2bfdefb" }, o("div", { key: "41fe4d870125fec3f1b92de2f3b37a0c53e79541", class: "nylas-locale-switch", part: "nls" }, o("div", { key: "f3613e5625ce5755ed4c9a52ff74430c5065277a", class: {
|
|
991
1014
|
"select-wrapper": !0,
|
|
992
1015
|
timezone: !0
|
|
993
|
-
}, part: "nls__timezone" },
|
|
1016
|
+
}, part: "nls__timezone" }, o("select-dropdown", { key: "65a17c585133197a0832f2f67165439aefaf0b78", name: "timezone", searchPlaceholder: this.searchPlaceholder, options: e, ref: (n) => this.timezoneRef = n, defaultSelectedOption: e.find((n) => n.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" }, o("span", { key: "4dcc3bb5f4e2f67d3ded45fc0501dc4cf14b32b4", slot: "select-icon" }, o("globe-icon", { key: "3e1d39db5640d61cb60259228dad1790fc4dc06a", width: "20", height: "20" })))), o("div", { key: "56808c49426922453fbae3393fdf2a1866c6e517", class: {
|
|
994
1017
|
"select-wrapper": !0,
|
|
995
1018
|
language: !0
|
|
996
|
-
}, part: "nls__language" },
|
|
1019
|
+
}, part: "nls__language" }, o("select-dropdown", { key: "fde4a71e21e8f252c764dc3b7feee0092ba0d47e", name: "language", searchPlaceholder: this.searchPlaceholder, options: a, ref: (n) => this.languageRef = n, defaultSelectedOption: a.find((n) => n.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" }, o("span", { key: "b3b824079c7a7c9d82b8e6f12b7f8c765a502e85", slot: "select-icon" }, o("translate-icon", { key: "eda7d67fb6e01b93d000f2c4fe44ec86c5afb113", width: "20", height: "20" }))))));
|
|
997
1020
|
}
|
|
998
1021
|
get host() {
|
|
999
|
-
return
|
|
1022
|
+
return E(this);
|
|
1000
1023
|
}
|
|
1001
1024
|
static get watchers() {
|
|
1002
1025
|
return {
|
|
@@ -1005,8 +1028,8 @@ const Ie = class {
|
|
|
1005
1028
|
};
|
|
1006
1029
|
}
|
|
1007
1030
|
};
|
|
1008
|
-
|
|
1009
|
-
|
|
1031
|
+
ya([
|
|
1032
|
+
L({
|
|
1010
1033
|
name: "nylas-locale-switch",
|
|
1011
1034
|
stateToProps: /* @__PURE__ */ new Map([
|
|
1012
1035
|
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
@@ -1015,11 +1038,11 @@ bn([
|
|
|
1015
1038
|
["scheduler.themeConfig", "themeConfig"]
|
|
1016
1039
|
]),
|
|
1017
1040
|
eventToProps: {
|
|
1018
|
-
timezoneChanged: async (e,
|
|
1019
|
-
d("nylas-locale-switch", "timezoneChanged", e.detail),
|
|
1041
|
+
timezoneChanged: async (e, a) => {
|
|
1042
|
+
d("nylas-locale-switch", "timezoneChanged", e.detail), a.scheduler.selectTimezone(e.detail);
|
|
1020
1043
|
},
|
|
1021
|
-
languageChanged: async (e,
|
|
1022
|
-
d("nylas-locale-switch", "languageChanged", e.detail),
|
|
1044
|
+
languageChanged: async (e, a) => {
|
|
1045
|
+
d("nylas-locale-switch", "languageChanged", e.detail), a.scheduler.selectLanguage(e.detail);
|
|
1023
1046
|
}
|
|
1024
1047
|
},
|
|
1025
1048
|
fireRegisterEvent: !0
|
|
@@ -1027,99 +1050,38 @@ bn([
|
|
|
1027
1050
|
K("design:type", Function),
|
|
1028
1051
|
K("design:paramtypes", []),
|
|
1029
1052
|
K("design:returntype", void 0)
|
|
1030
|
-
],
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1053
|
+
], Se.prototype, "render", null);
|
|
1054
|
+
Se.style = fa;
|
|
1055
|
+
const ba = ".sc-nylas-logo-h{display:flex}", ha = ba, ga = class {
|
|
1033
1056
|
constructor(e) {
|
|
1034
1057
|
w(this, e), this.width = "69", this.height = "24";
|
|
1035
1058
|
}
|
|
1036
1059
|
render() {
|
|
1037
|
-
return
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
pn.style = gn;
|
|
1041
|
-
const mn = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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}', un = mn, kn = class {
|
|
1042
|
-
constructor(e) {
|
|
1043
|
-
w(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
1044
|
-
}
|
|
1045
|
-
onError(e) {
|
|
1046
|
-
d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1047
|
-
}
|
|
1048
|
-
onWarning(e) {
|
|
1049
|
-
d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1050
|
-
}
|
|
1051
|
-
onInfo(e) {
|
|
1052
|
-
d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1053
|
-
}
|
|
1054
|
-
onSuccess(e) {
|
|
1055
|
-
d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
1056
|
-
}
|
|
1057
|
-
isChildOf(e) {
|
|
1058
|
-
let n = this.host.parentNode;
|
|
1059
|
-
for (; n; ) {
|
|
1060
|
-
if (n === e)
|
|
1061
|
-
return !0;
|
|
1062
|
-
n instanceof ShadowRoot ? n = n.host : n = n.parentNode;
|
|
1063
|
-
}
|
|
1064
|
-
return !1;
|
|
1065
|
-
}
|
|
1066
|
-
handleNotification(e) {
|
|
1067
|
-
const n = e.detail.host;
|
|
1068
|
-
if (e.defaultPrevented) {
|
|
1069
|
-
d("[nylas-notification] Event default prevented");
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
if (n && !this.isChildOf(n)) {
|
|
1073
|
-
d("[nylas-notification] Host not a parent");
|
|
1074
|
-
return;
|
|
1075
|
-
}
|
|
1076
|
-
if (this.ttl === 0) {
|
|
1077
|
-
d("[nylas-notification] TTL is 0");
|
|
1078
|
-
return;
|
|
1079
|
-
}
|
|
1080
|
-
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
|
|
1081
|
-
d("[nylas-notification] Category not allowed");
|
|
1082
|
-
return;
|
|
1083
|
-
}
|
|
1084
|
-
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
1085
|
-
const a = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
1086
|
-
window.setTimeout(() => {
|
|
1087
|
-
this.notifications = this.notifications.filter((l) => l.id !== e.detail.notification.id);
|
|
1088
|
-
}, a);
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
dismissNotification(e) {
|
|
1092
|
-
this.notifications = this.notifications.filter((n) => n.id !== e);
|
|
1093
|
-
}
|
|
1094
|
-
render() {
|
|
1095
|
-
return t(k, { key: "3bcf8226966db8fc4f5d6f6c88f47637126ec2d1" }, t(qe, { key: "5f7b27276edb525702fe9d87385149b5840964fe" }, this.notifications.map((e) => t("div", { class: `notif ${e.type}`, key: e.id }, t("div", { class: "content" }, t("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && t("warning-icon", null)), t("span", { class: "message" }, t("span", { class: "title" }, e.title), e.description && t("span", { class: "description" }, e.description))), t("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, t("close-icon", null)))), t("slot", { key: "32efc485b78942fd295304d5a3456e2e7a399aa4" })));
|
|
1096
|
-
}
|
|
1097
|
-
get host() {
|
|
1098
|
-
return T(this);
|
|
1060
|
+
return o("svg", { key: "f7f75a001b5803b86e20a4182f698c8e2cc78626", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, o("g", { key: "598ddfe99d47a94219dc69eba23eb27ba52d804f", "clip-path": "url(#clip0_455_3543)" }, o("path", { key: "e0147cab60318decf95d8c1972745cc937308ca2", 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" }), o("path", { key: "4091ae464be62a143707e179d6dfdff33707b08b", 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" }), o("path", { key: "baa5b2f692ddca4ca6aa2f5ad0fabee82202236d", 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" }), o("path", { key: "cb6bedcc0d1d177a041261cd9ce12c1164e15ee1", 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" }), o("path", { key: "a4144622dceefb0721da599e0b6f76c832d0d28f", 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" }), o("path", { key: "da90a0efd8801f8a856da4f96d49b3eebef08e23", 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" }), o("path", { key: "470f66bd945477a677417aa3ace2811c5b73439f", 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" }), o("path", { key: "3c88e8c71a3cf3c0f77e9373a1734e14cf9d98ba", 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" })), o("defs", { key: "de5f6196af8d363ed1b681443bd7364bc9325de9" }, o("clipPath", { key: "0ee3553f8c66417f8cd13dac5af6d61057a0ef0a", id: "clip0_455_3543" }, o("rect", { key: "ca1b98034d9b17db1e1cf47e980c72a0a0b8ae29", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
1099
1061
|
}
|
|
1100
1062
|
};
|
|
1101
|
-
|
|
1102
|
-
const
|
|
1103
|
-
var
|
|
1104
|
-
var
|
|
1063
|
+
ga.style = ha;
|
|
1064
|
+
const ua = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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:16px;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)}', ma = ua;
|
|
1065
|
+
var pa = function(e, a, n, l) {
|
|
1066
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
1105
1067
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1106
|
-
|
|
1068
|
+
t = Reflect.decorate(e, a, n, l);
|
|
1107
1069
|
else
|
|
1108
1070
|
for (var c = e.length - 1; c >= 0; c--)
|
|
1109
|
-
(
|
|
1110
|
-
return
|
|
1111
|
-
}, Q = function(e,
|
|
1071
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
1072
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
1073
|
+
}, Q = function(e, a) {
|
|
1112
1074
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1113
|
-
return Reflect.metadata(e,
|
|
1075
|
+
return Reflect.metadata(e, a);
|
|
1114
1076
|
};
|
|
1115
|
-
const
|
|
1077
|
+
const Re = class {
|
|
1116
1078
|
constructor(e) {
|
|
1117
1079
|
w(this, e), this.rejectBookingButtonClicked = f(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = f(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = f(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
1118
1080
|
this.action = "confirm";
|
|
1119
|
-
const
|
|
1120
|
-
this.confirmBookingError.emit(
|
|
1081
|
+
const a = (n) => {
|
|
1082
|
+
this.confirmBookingError.emit(n);
|
|
1121
1083
|
};
|
|
1122
|
-
this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler:
|
|
1084
|
+
this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: a });
|
|
1123
1085
|
}, this.handleRejectBookingButtonClicked = () => {
|
|
1124
1086
|
this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
|
|
1125
1087
|
}, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.organizerConfirmationBookingId = void 0, this.selectedLanguage = navigator.language, this.action = null;
|
|
@@ -1127,6 +1089,9 @@ const Se = class {
|
|
|
1127
1089
|
themeConfigChanged(e) {
|
|
1128
1090
|
this.applyThemeConfig(e);
|
|
1129
1091
|
}
|
|
1092
|
+
selectedLanguageChangedHandler(e, a) {
|
|
1093
|
+
e !== a && i.changeLanguage(e);
|
|
1094
|
+
}
|
|
1130
1095
|
connectedCallback() {
|
|
1131
1096
|
}
|
|
1132
1097
|
disconnectedCallback() {
|
|
@@ -1139,31 +1104,29 @@ const Se = class {
|
|
|
1139
1104
|
}
|
|
1140
1105
|
applyThemeConfig(e) {
|
|
1141
1106
|
if (e)
|
|
1142
|
-
for (const [
|
|
1143
|
-
this.host.style.setProperty(`${
|
|
1107
|
+
for (const [a, n] of Object.entries(e))
|
|
1108
|
+
this.host.style.setProperty(`${a}`, n);
|
|
1144
1109
|
}
|
|
1145
1110
|
async resetAction() {
|
|
1146
1111
|
this.action = null;
|
|
1147
1112
|
}
|
|
1148
1113
|
render() {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
"no-footer": !!((n = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && n.hide_cancellation_options) && !!((l = (a = this.configSettings) == null ? void 0 : a.scheduler) != null && l.hide_rescheduling_options),
|
|
1153
|
-
"no-template-cols": !!((o = (s = this.configSettings) == null ? void 0 : s.scheduler) != null && o.hide_cancellation_options) || !!((c = (r = this.configSettings) == null ? void 0 : r.scheduler) != null && c.hide_rescheduling_options)
|
|
1154
|
-
} }, !((b = (g = this.configSettings) == null ? void 0 : g.scheduler) != null && b.hide_cancellation_options) && t("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${i.t("rejectBookingButton")}`), !((C = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && C.hide_rescheduling_options) && t("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${i.t("confirmBookingButton")}`))));
|
|
1114
|
+
return o(k, { key: "685c64fd73ed2cd97647ddabb84201e0f79ea8cf", part: "nmcc" }, o("div", { key: "70e4b4ae0a3b4df1ced7f0629baf088786e10da7", class: "event-card-wrapper", part: "nmccc__card" }, o("div", { key: "4bab8a23c09d2c73fd57c3fd320ddc60bcd4ad3f", class: "calendar-icon" }, o("calendar-check-icon", { key: "20a288c36cdf0532b4fb8520e25057e05bbb9c67" })), o("div", { key: "23fd0069fe2805be74da6b1fb9c0b2a90a41f004", class: "booked-event-header" }, o("h2", { key: "ebf3b7a83f62844fc7afcb34d80b7a19162424bf", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${i.t("bookingPendingTitle")}!`)), o("div", { key: "5b1736ec457c881496302a1e62cd8ebe6695c1dc", class: "manage-booking-description" }, o("p", { key: "97199b19d7bc741afe565733fa112fbc66308c75" }, i.t("bookingPendingnDescription"))), o("div", { key: "e305f35b16ec685bb9af4cb9f66d5e43db4edf9b", class: {
|
|
1115
|
+
footer: !0
|
|
1116
|
+
} }, o("button-component", { key: "a25bdb447e29fc415f0381a8ba73a36937fd9435", variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${i.t("rejectBookingButton")}`), o("button-component", { key: "ac814b5239c359decd43506b7981ac8d975d5416", variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${i.t("confirmBookingButton")}`))));
|
|
1155
1117
|
}
|
|
1156
1118
|
get host() {
|
|
1157
|
-
return
|
|
1119
|
+
return E(this);
|
|
1158
1120
|
}
|
|
1159
1121
|
static get watchers() {
|
|
1160
1122
|
return {
|
|
1161
|
-
themeConfig: ["themeConfigChanged"]
|
|
1123
|
+
themeConfig: ["themeConfigChanged"],
|
|
1124
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1162
1125
|
};
|
|
1163
1126
|
}
|
|
1164
1127
|
};
|
|
1165
|
-
|
|
1166
|
-
|
|
1128
|
+
pa([
|
|
1129
|
+
L({
|
|
1167
1130
|
name: "nylas-organizer-confirmation-card",
|
|
1168
1131
|
stateToProps: /* @__PURE__ */ new Map([
|
|
1169
1132
|
["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
|
|
@@ -1173,15 +1136,15 @@ _n([
|
|
|
1173
1136
|
["scheduler.themeConfig", "themeConfig"]
|
|
1174
1137
|
]),
|
|
1175
1138
|
eventToProps: {
|
|
1176
|
-
rejectBookingButtonClicked: async (e,
|
|
1177
|
-
|
|
1139
|
+
rejectBookingButtonClicked: async (e, a) => {
|
|
1140
|
+
a.scheduler.setReject(e.detail.bookingId);
|
|
1178
1141
|
},
|
|
1179
|
-
confirmBookingButtonClicked: async (e,
|
|
1180
|
-
const { host:
|
|
1142
|
+
confirmBookingButtonClicked: async (e, a) => {
|
|
1143
|
+
const { host: n } = e.detail, l = await a.scheduler.updateBooking({
|
|
1181
1144
|
bookingId: e.detail.bookingId,
|
|
1182
1145
|
status: "confirmed"
|
|
1183
|
-
}), { errorHandler:
|
|
1184
|
-
|
|
1146
|
+
}), { errorHandler: r } = e.detail;
|
|
1147
|
+
r && (!l || "error" in l) && r(l), await n.resetAction();
|
|
1185
1148
|
}
|
|
1186
1149
|
},
|
|
1187
1150
|
fireRegisterEvent: !0
|
|
@@ -1189,28 +1152,31 @@ _n([
|
|
|
1189
1152
|
Q("design:type", Function),
|
|
1190
1153
|
Q("design:paramtypes", []),
|
|
1191
1154
|
Q("design:returntype", void 0)
|
|
1192
|
-
],
|
|
1193
|
-
|
|
1194
|
-
const
|
|
1195
|
-
var
|
|
1196
|
-
var
|
|
1155
|
+
], Re.prototype, "render", null);
|
|
1156
|
+
Re.style = ma;
|
|
1157
|
+
const ka = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;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;gap:4px;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}}', va = ka;
|
|
1158
|
+
var Ca = function(e, a, n, l) {
|
|
1159
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
1197
1160
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1198
|
-
|
|
1161
|
+
t = Reflect.decorate(e, a, n, l);
|
|
1199
1162
|
else
|
|
1200
1163
|
for (var c = e.length - 1; c >= 0; c--)
|
|
1201
|
-
(
|
|
1202
|
-
return
|
|
1203
|
-
}, V = function(e,
|
|
1164
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
1165
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
1166
|
+
}, V = function(e, a) {
|
|
1204
1167
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1205
|
-
return Reflect.metadata(e,
|
|
1168
|
+
return Reflect.metadata(e, a);
|
|
1206
1169
|
};
|
|
1207
|
-
const
|
|
1170
|
+
const Pe = class {
|
|
1208
1171
|
constructor(e) {
|
|
1209
1172
|
w(this, e), this.themeConfig = void 0, this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.hour12 = void 0, this.startTime = "", this.endTime = "";
|
|
1210
1173
|
}
|
|
1211
1174
|
themeConfigChanged(e) {
|
|
1212
1175
|
this.applyThemeConfig(e);
|
|
1213
1176
|
}
|
|
1177
|
+
selectedLanguageChangedHandler(e, a) {
|
|
1178
|
+
e !== a && i.changeLanguage(e);
|
|
1179
|
+
}
|
|
1214
1180
|
connectedCallback() {
|
|
1215
1181
|
}
|
|
1216
1182
|
disconnectedCallback() {
|
|
@@ -1219,36 +1185,37 @@ const Re = class {
|
|
|
1219
1185
|
d("[nylas-selected-event-card] Component will load");
|
|
1220
1186
|
}
|
|
1221
1187
|
async componentDidLoad() {
|
|
1222
|
-
var
|
|
1188
|
+
var n, l;
|
|
1223
1189
|
d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.'), this.applyThemeConfig(this.themeConfig);
|
|
1224
|
-
const e = S[this.selectedLanguage || "en"],
|
|
1190
|
+
const e = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(e, {
|
|
1225
1191
|
hour: "2-digit",
|
|
1226
1192
|
minute: "2-digit",
|
|
1227
1193
|
timeZone: this.selectedTimezone,
|
|
1228
1194
|
hour12: this.hour12
|
|
1229
1195
|
});
|
|
1230
|
-
this.startTime =
|
|
1196
|
+
this.startTime = a.format(new Date((n = this.selectedTimeslot) == null ? void 0 : n.start_time)), this.endTime = a.format(new Date((l = this.selectedTimeslot) == null ? void 0 : l.end_time));
|
|
1231
1197
|
}
|
|
1232
1198
|
applyThemeConfig(e) {
|
|
1233
1199
|
if (e)
|
|
1234
|
-
for (const [
|
|
1235
|
-
this.host.style.setProperty(`${
|
|
1200
|
+
for (const [a, n] of Object.entries(e))
|
|
1201
|
+
this.host.style.setProperty(`${a}`, n);
|
|
1236
1202
|
}
|
|
1237
1203
|
render() {
|
|
1238
1204
|
var e;
|
|
1239
|
-
return
|
|
1205
|
+
return o(k, { key: "94fd07366e885e81fb62049c5a44fe6679897aba", part: "nsec" }, o("div", { key: "8ca223250ff59a898eae64b4eaf1ad24e690d3a7", class: "event-card", part: "nsec__card" }, o("div", { key: "77c0fbd4495f0811e5bb05ea95f59d4b2bad90af", class: "calendar-icon", part: "nsec__icon" }, o("calendar-icon", { key: "3c1a395ec15145153c3d0d4b4986aea9a7943ddf" })), o("div", { key: "1c5ed82612ce165f89bd240b21482c916dbf166b", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? we(xe((e = this.selectedTimeslot) == null ? void 0 : e.start_time, this.selectedTimezone, S[this.selectedLanguage || "en"])) : "-"), o("div", { key: "e62af1aba1c260d178f1cc95f3405e94448cdf29", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), o("div", { key: "6eea1eca90bde0bb49a747ad8ed3a5ca57971db4", class: "event-timezone", part: "nsec__timezone" }, o("globe-icon", { key: "feac1b95d2177a39f84648ec0e8356026ebc9ef7" }), j[this.selectedTimezone]));
|
|
1240
1206
|
}
|
|
1241
1207
|
get host() {
|
|
1242
|
-
return
|
|
1208
|
+
return E(this);
|
|
1243
1209
|
}
|
|
1244
1210
|
static get watchers() {
|
|
1245
1211
|
return {
|
|
1246
|
-
themeConfig: ["themeConfigChanged"]
|
|
1212
|
+
themeConfig: ["themeConfigChanged"],
|
|
1213
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1247
1214
|
};
|
|
1248
1215
|
}
|
|
1249
1216
|
};
|
|
1250
|
-
|
|
1251
|
-
|
|
1217
|
+
Ca([
|
|
1218
|
+
L({
|
|
1252
1219
|
name: "nylas-selected-event-card",
|
|
1253
1220
|
stateToProps: /* @__PURE__ */ new Map([
|
|
1254
1221
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -1264,27 +1231,27 @@ Tn([
|
|
|
1264
1231
|
V("design:type", Function),
|
|
1265
1232
|
V("design:paramtypes", []),
|
|
1266
1233
|
V("design:returntype", void 0)
|
|
1267
|
-
],
|
|
1268
|
-
|
|
1269
|
-
const
|
|
1270
|
-
var
|
|
1271
|
-
var
|
|
1234
|
+
], Pe.prototype, "render", null);
|
|
1235
|
+
Pe.style = va;
|
|
1236
|
+
const _a = ':host{display:block;height:calc(100% - 48px);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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)}.time .time-label{display:flex;flex-direction:column;align-items:center;gap:4px}.time .time-label span.spots{font-size:14px;font-family:var(--nylas-font-family);font-weight:400;color:var(--nylas-base-600)}.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)}', wa = _a;
|
|
1237
|
+
var xa = function(e, a, n, l) {
|
|
1238
|
+
var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
|
|
1272
1239
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1273
|
-
|
|
1240
|
+
t = Reflect.decorate(e, a, n, l);
|
|
1274
1241
|
else
|
|
1275
1242
|
for (var c = e.length - 1; c >= 0; c--)
|
|
1276
|
-
(
|
|
1277
|
-
return
|
|
1278
|
-
}, ee = function(e,
|
|
1243
|
+
(s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
|
|
1244
|
+
return r > 3 && t && Object.defineProperty(a, n, t), t;
|
|
1245
|
+
}, ee = function(e, a) {
|
|
1279
1246
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1280
|
-
return Reflect.metadata(e,
|
|
1247
|
+
return Reflect.metadata(e, a);
|
|
1281
1248
|
};
|
|
1282
1249
|
const je = class {
|
|
1283
1250
|
constructor(e) {
|
|
1284
|
-
w(this, e), this.timeslotSelected = f(this, "timeslotSelected", 7), this.timeslotConfirmed = f(this, "timeslotConfirmed", 7), this.validateTimeslotError = f(this, "validateTimeslotError", 7), this.handleConfirmedTimeslot = async (
|
|
1285
|
-
|
|
1286
|
-
}, this.handleMouseEnter = (
|
|
1287
|
-
this.hoveredTimeslotIndex =
|
|
1251
|
+
w(this, e), this.timeslotSelected = f(this, "timeslotSelected", 7), this.timeslotConfirmed = f(this, "timeslotConfirmed", 7), this.validateTimeslotError = f(this, "validateTimeslotError", 7), this.handleConfirmedTimeslot = async (a, n) => {
|
|
1252
|
+
a.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", n), n && this.timeslotConfirmed.emit({ timeslot: n, host: this.host });
|
|
1253
|
+
}, this.handleMouseEnter = (a) => {
|
|
1254
|
+
this.hoveredTimeslotIndex = a;
|
|
1288
1255
|
}, this.handleMouseLeave = () => {
|
|
1289
1256
|
this.hoveredTimeslotIndex = -1;
|
|
1290
1257
|
}, this.availability = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = /* @__PURE__ */ new Date(), this.selectedLanguage = void 0, this.hour12 = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
@@ -1293,16 +1260,16 @@ const je = class {
|
|
|
1293
1260
|
i.changeLanguage(e);
|
|
1294
1261
|
}
|
|
1295
1262
|
selectedDateChanged(e) {
|
|
1296
|
-
var
|
|
1263
|
+
var a;
|
|
1297
1264
|
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
1298
|
-
const
|
|
1299
|
-
this.times =
|
|
1265
|
+
const n = (a = this.availability) == null ? void 0 : a.filter((l) => N(l.start_time, e, this.selectedTimezone)).map((l) => l);
|
|
1266
|
+
this.times = n || [];
|
|
1300
1267
|
}
|
|
1301
1268
|
}
|
|
1302
1269
|
availabilityChanged(e) {
|
|
1303
1270
|
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
1304
|
-
const
|
|
1305
|
-
this.times =
|
|
1271
|
+
const a = e == null ? void 0 : e.filter((n) => this.selectedDate && N(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
|
|
1272
|
+
this.times = a || [];
|
|
1306
1273
|
}
|
|
1307
1274
|
}
|
|
1308
1275
|
themeConfigChanged(e) {
|
|
@@ -1316,22 +1283,22 @@ const je = class {
|
|
|
1316
1283
|
d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
1317
1284
|
}
|
|
1318
1285
|
async componentDidLoad() {
|
|
1319
|
-
var
|
|
1286
|
+
var a;
|
|
1320
1287
|
d("[nylas-timeslot-picker] Component did load");
|
|
1321
|
-
const e = (
|
|
1288
|
+
const e = (a = this.availability) == null ? void 0 : a.filter((n) => this.selectedDate && N(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
|
|
1322
1289
|
this.times = e || [], this.applyThemeConfig(this.themeConfig);
|
|
1323
1290
|
}
|
|
1324
1291
|
applyThemeConfig(e) {
|
|
1325
1292
|
if (e)
|
|
1326
|
-
for (const [
|
|
1327
|
-
this.host.style.setProperty(`${
|
|
1293
|
+
for (const [a, n] of Object.entries(e))
|
|
1294
|
+
this.host.style.setProperty(`${a}`, n);
|
|
1328
1295
|
}
|
|
1329
|
-
getTimeslotId(e,
|
|
1330
|
-
const
|
|
1331
|
-
return `${
|
|
1296
|
+
getTimeslotId(e, a) {
|
|
1297
|
+
const n = new Date(e.start_time), l = e.event_id;
|
|
1298
|
+
return `${n.toLocaleDateString()}-${a}${l ? `-${l}` : ""}`;
|
|
1332
1299
|
}
|
|
1333
|
-
onClickSelectTime(e,
|
|
1334
|
-
d("[nylas-timeslot-picker] Time selected", e,
|
|
1300
|
+
onClickSelectTime(e, a) {
|
|
1301
|
+
d("[nylas-timeslot-picker] Time selected", e, a), this.selectedTimeslotIndex = this.getTimeslotId(e, a), this.timeslotSelected.emit({
|
|
1335
1302
|
start_time: e.start_time,
|
|
1336
1303
|
end_time: e.end_time,
|
|
1337
1304
|
emails: e.emails,
|
|
@@ -1341,39 +1308,39 @@ const je = class {
|
|
|
1341
1308
|
calendar_id: e == null ? void 0 : e.calendar_id
|
|
1342
1309
|
});
|
|
1343
1310
|
}
|
|
1344
|
-
async emitValidateTimeslotError(e,
|
|
1345
|
-
this.validateTimeslotError.emit({ error: e, type:
|
|
1311
|
+
async emitValidateTimeslotError(e, a) {
|
|
1312
|
+
this.validateTimeslotError.emit({ error: e, type: a });
|
|
1346
1313
|
}
|
|
1347
1314
|
getTimeSlotLabel(e) {
|
|
1348
|
-
const
|
|
1315
|
+
const a = S[this.selectedLanguage || "en"], n = new Intl.DateTimeFormat(a, {
|
|
1349
1316
|
hour: "2-digit",
|
|
1350
1317
|
minute: "2-digit",
|
|
1351
1318
|
timeZone: this.selectedTimezone,
|
|
1352
1319
|
hour12: this.hour12
|
|
1353
1320
|
});
|
|
1354
|
-
return `${
|
|
1321
|
+
return `${n.format(e.start_time)} - ${n.format(e.end_time)}`;
|
|
1355
1322
|
}
|
|
1356
1323
|
render() {
|
|
1357
1324
|
const e = S[this.selectedLanguage || "en"];
|
|
1358
1325
|
if (this.isLoading)
|
|
1359
|
-
return
|
|
1326
|
+
return o(k, null, o("div", { class: "loading" }, new Array(6).fill(0).map((n, l) => o("div", { class: "timeslot-skeleton", style: { animationDelay: `${l * 20}ms` } }))));
|
|
1360
1327
|
if (this.availability && this.availability.length === 0)
|
|
1361
|
-
return
|
|
1362
|
-
const
|
|
1363
|
-
const l = (
|
|
1364
|
-
return !(l && !
|
|
1328
|
+
return o(k, null, o("div", { class: "empty" }, o("span", null, "No dates available")));
|
|
1329
|
+
const a = this.times.filter((n) => {
|
|
1330
|
+
const l = (n == null ? void 0 : n.event_id) || (n == null ? void 0 : n.master_id), r = typeof (n == null ? void 0 : n.capacity) == "number" && (n == null ? void 0 : n.capacity) > 0;
|
|
1331
|
+
return !(l && !r);
|
|
1365
1332
|
});
|
|
1366
|
-
return (!this.times || this.times.length === 0 ||
|
|
1367
|
-
var
|
|
1368
|
-
const
|
|
1369
|
-
return
|
|
1333
|
+
return (!this.times || this.times.length === 0 || a.length === 0) && this.selectedDate ? o(k, null, o("div", { class: "empty" }, o("span", null, "No time slots available for selected date"))) : this.selectedDate ? o(k, { part: "ntp" }, o("div", { class: "time-picker-wrapper", part: "ntp__time-picker-wrapper" }, o("div", { class: "timeslots", part: "ntp__timeslots" }, a.map((n, l) => {
|
|
1334
|
+
var s, c;
|
|
1335
|
+
const r = typeof (n == null ? void 0 : n.capacity) == "number" && (n == null ? void 0 : n.capacity) > 0, t = this.selectedTimeslotIndex == this.getTimeslotId(n, l);
|
|
1336
|
+
return o("button", { part: `ntp__timeslot ${((c = (s = this.selectedTimeslot) == null ? void 0 : s.start_time) == null ? void 0 : c.getTime()) === n.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, class: {
|
|
1370
1337
|
time: !0,
|
|
1371
|
-
selected: typeof this.selectedTimeslot < "u" &&
|
|
1372
|
-
}, onClick: () => this.onClickSelectTime(
|
|
1373
|
-
})), this.selectedTimeslot &&
|
|
1338
|
+
selected: typeof this.selectedTimeslot < "u" && t
|
|
1339
|
+
}, onClick: () => this.onClickSelectTime(n, l), onMouseEnter: () => this.handleMouseEnter(l), onMouseLeave: () => this.handleMouseLeave() }, o("div", { class: "time-label", part: "ntp__time-label" }, this.hoveredTimeslotIndex == l || t ? this.getTimeSlotLabel(n) : n.start_time.toLocaleTimeString(e, { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone, hour12: this.hour12 }), o("span", { class: "spots" }, r ? i.t("spotsLeft", { count: n == null ? void 0 : n.capacity }) : null)));
|
|
1340
|
+
})), this.selectedTimeslot && o("div", { class: "footer" }, o("button-component", { variant: "primary", onClick: (n) => this.handleConfirmedTimeslot(n, this.selectedTimeslot), part: "ntp__button-primary" }, o("slot", { name: "timeslot-picker-cta-label" }, i.t("nextButton")))))) : o(k, null);
|
|
1374
1341
|
}
|
|
1375
1342
|
get host() {
|
|
1376
|
-
return
|
|
1343
|
+
return E(this);
|
|
1377
1344
|
}
|
|
1378
1345
|
static get watchers() {
|
|
1379
1346
|
return {
|
|
@@ -1384,8 +1351,8 @@ const je = class {
|
|
|
1384
1351
|
};
|
|
1385
1352
|
}
|
|
1386
1353
|
};
|
|
1387
|
-
|
|
1388
|
-
|
|
1354
|
+
xa([
|
|
1355
|
+
L({
|
|
1389
1356
|
name: "nylas-timeslot-picker",
|
|
1390
1357
|
stateToProps: /* @__PURE__ */ new Map([
|
|
1391
1358
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -1398,23 +1365,23 @@ Dn([
|
|
|
1398
1365
|
["scheduler.hour12", "hour12"]
|
|
1399
1366
|
]),
|
|
1400
1367
|
eventToProps: {
|
|
1401
|
-
timeslotSelected: async (e,
|
|
1402
|
-
d("nylas-timeslot-picker", "timeslotSelected", e.detail),
|
|
1368
|
+
timeslotSelected: async (e, a) => {
|
|
1369
|
+
d("nylas-timeslot-picker", "timeslotSelected", e.detail), a.scheduler.selectTime(e.detail);
|
|
1403
1370
|
},
|
|
1404
|
-
timeslotConfirmed: async (e,
|
|
1405
|
-
var
|
|
1371
|
+
timeslotConfirmed: async (e, a) => {
|
|
1372
|
+
var r;
|
|
1406
1373
|
d("nylas-timeslot-picker", "timeslotConfirmed", e.detail);
|
|
1407
|
-
const { timeslot:
|
|
1408
|
-
if (
|
|
1409
|
-
const
|
|
1410
|
-
if (
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1374
|
+
const { timeslot: n, host: l } = e.detail;
|
|
1375
|
+
if (n && (n != null && n.event_id) && (n != null && n.capacity)) {
|
|
1376
|
+
const t = await a.scheduler.validateGroupEventTimeslot(n);
|
|
1377
|
+
if (t && "error" in t) {
|
|
1378
|
+
const s = ((r = t.error) == null ? void 0 : r.message) || "An error occurred while validating the timeslot";
|
|
1379
|
+
s === "Event is full" ? l.emitValidateTimeslotError(s, "info") : l.emitValidateTimeslotError(s, "error");
|
|
1413
1380
|
}
|
|
1414
1381
|
} else
|
|
1415
|
-
|
|
1382
|
+
a.scheduler.toggleAdditionalData(!0);
|
|
1416
1383
|
},
|
|
1417
|
-
validateTimeslotError: async (e,
|
|
1384
|
+
validateTimeslotError: async (e, a) => {
|
|
1418
1385
|
d("nylas-timeslot-picker", "validateTimeslotError", e.detail);
|
|
1419
1386
|
}
|
|
1420
1387
|
},
|
|
@@ -1424,18 +1391,17 @@ Dn([
|
|
|
1424
1391
|
ee("design:paramtypes", []),
|
|
1425
1392
|
ee("design:returntype", void 0)
|
|
1426
1393
|
], je.prototype, "render", null);
|
|
1427
|
-
je.style =
|
|
1394
|
+
je.style = wa;
|
|
1428
1395
|
export {
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1396
|
+
Te as nylas_booked_event_card,
|
|
1397
|
+
Ee as nylas_booking_form,
|
|
1398
|
+
Le as nylas_cancel_booking_form,
|
|
1432
1399
|
Be as nylas_cancelled_event_card,
|
|
1433
1400
|
De as nylas_confirmed_event_card,
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
Re as nylas_selected_event_card,
|
|
1401
|
+
Ie as nylas_date_picker,
|
|
1402
|
+
Se as nylas_locale_switch,
|
|
1403
|
+
ga as nylas_logo,
|
|
1404
|
+
Re as nylas_organizer_confirmation_card,
|
|
1405
|
+
Pe as nylas_selected_event_card,
|
|
1440
1406
|
je as nylas_timeslot_picker
|
|
1441
1407
|
};
|