@nylas/react 1.1.0-canary.20 → 1.1.0-canary.21
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/add-circle-icon_2.entry-29cc2385.cjs +1 -0
- package/dist/add-circle-icon_2.entry-b8d6df60.js +69 -0
- package/dist/{archive-icon_7.entry-2f418a3e.js → archive-icon_7.entry-3830776a.js} +18 -18
- package/dist/{archive-icon_7.entry-eb90a353.cjs → archive-icon_7.entry-afaef817.cjs} +1 -1
- package/dist/{arrow-icon.entry-753eb942.js → arrow-icon.entry-19f00716.js} +1 -1
- package/dist/{arrow-icon.entry-ac5e1a47.cjs → arrow-icon.entry-460cdd9f.cjs} +1 -1
- package/dist/{bold-icon_3.entry-4fff7400.cjs → bold-icon_3.entry-1893eeec.cjs} +1 -1
- package/dist/{bold-icon_3.entry-18507c82.js → bold-icon_3.entry-80abafbb.js} +3 -3
- package/dist/button-component.entry-36137536.js +16 -0
- package/dist/button-component.entry-b78dc39e.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +10 -0
- package/dist/{calendar-agenda-fill-icon_35.entry-db989ce0.js → calendar-agenda-fill-icon_40.entry-f19d6ad7.js} +1469 -1076
- package/dist/{calendar-cancel-icon.entry-d2e10dfc.cjs → calendar-cancel-icon.entry-0d83ee82.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-31caeae1.js → calendar-cancel-icon.entry-1fae00c5.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-7f67c003.js → calendar-check-icon_2.entry-159c38af.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-d32551e9.cjs → calendar-check-icon_2.entry-e01c9028.cjs} +1 -1
- package/dist/{calendar-icon.entry-f3f1c623.cjs → calendar-icon.entry-2e701aab.cjs} +1 -1
- package/dist/{calendar-icon.entry-6e89816b.js → calendar-icon.entry-3af9cb76.js} +1 -1
- package/dist/checkbox-component_2.entry-5eee51f6.js +56 -0
- package/dist/checkbox-component_2.entry-9ff2c85b.cjs +1 -0
- package/dist/checkmark-icon.entry-0749b942.js +15 -0
- package/dist/checkmark-icon.entry-f96f1117.cjs +1 -0
- package/dist/{chevron-icon_3.entry-2e20a83e.js → chevron-icon_3.entry-2e9eebbc.js} +10 -10
- package/dist/{chevron-icon_3.entry-3be68846.cjs → chevron-icon_3.entry-c3989df2.cjs} +1 -1
- package/dist/clock-icon_4.entry-9395d0cb.js +45 -0
- package/dist/clock-icon_4.entry-d4563931.cjs +1 -0
- package/dist/close-icon.entry-cf9f0a69.js +15 -0
- package/dist/close-icon.entry-e24af309.cjs +1 -0
- package/dist/{constants-7ce66b44-3952e81c.js → constants-67de2eec-b17f5b96.js} +37 -17
- package/dist/{constants-7ce66b44-a6b777d4.cjs → constants-67de2eec-e3b50fc6.cjs} +5 -5
- package/dist/{copy-icon_4.entry-187edab9.js → copy-icon_3.entry-7b276fa2.js} +9 -19
- package/dist/copy-icon_3.entry-7de3667f.cjs +1 -0
- package/dist/document-refresh-icon.entry-582ac233.cjs +1 -0
- package/dist/{document-refresh-icon.entry-9d7900d7.js → document-refresh-icon.entry-6dd65cb6.js} +2 -2
- package/dist/elements/index.d.ts +8 -0
- package/dist/{elements-dc5b338e-edf63aa6.cjs → elements-dc5b338e-158dce67.cjs} +1 -1
- package/dist/{elements-dc5b338e-e6271e48.js → elements-dc5b338e-5e8a704b.js} +1 -1
- package/dist/{focus-visible-e8093c16-84e41b3b.cjs → focus-visible-e8093c16-5883a317.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-4c45967c.js → focus-visible-e8093c16-9d88e8ee.js} +1 -1
- package/dist/{forward-icon_6.entry-4cb6eb63.cjs → forward-icon_6.entry-a59dada5.cjs} +3 -3
- package/dist/{forward-icon_6.entry-949d0cfb.js → forward-icon_6.entry-acdf04ad.js} +7 -7
- package/dist/{globe-icon.entry-04b35395.js → globe-icon.entry-389c0391.js} +2 -2
- package/dist/{globe-icon.entry-741f8ad4.cjs → globe-icon.entry-eef27331.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-e9be320c.cjs +1 -0
- package/dist/google-logo-icon_4.entry-eae19fc8.js +637 -0
- package/dist/index-53420959-82a5306f.cjs +1 -0
- package/dist/index-53420959-9b1699ec.js +5 -0
- package/dist/{index-6d9eeb53-8b16e3b5.cjs → index-6d9eeb53-15c69801.cjs} +1 -1
- package/dist/{index-6d9eeb53-b15263de.js → index-6d9eeb53-c70fc8a7.js} +2 -2
- package/dist/index-db48e0b6.cjs +42 -0
- package/dist/index-f8317a8e.js +7638 -0
- package/dist/{index.es-9cc0eb3c-e6c5dd2d.js → index.es-b16d0cf5-386496a9.js} +1 -1
- package/dist/{index.es-9cc0eb3c-2e0f7d11.cjs → index.es-b16d0cf5-d7f30c4a.cjs} +1 -1
- package/dist/{info-icon_2.entry-c3468951.cjs → info-icon_2.entry-63914227.cjs} +1 -1
- package/dist/{info-icon_2.entry-d0270899.js → info-icon_2.entry-97d75550.js} +5 -5
- package/dist/input-dropdown.entry-4d29246a.js +132 -0
- package/dist/input-dropdown.entry-629d7b54.cjs +1 -0
- package/dist/loading-icon.entry-2f15a09f.cjs +1 -0
- package/dist/loading-icon.entry-fc9bc740.js +15 -0
- package/dist/{mailbox-store-64b4ef7c-c609ac6d.cjs → mailbox-store-f11de360-02a6de93.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-7c793d9a.js → mailbox-store-f11de360-d781fd36.js} +2 -2
- package/dist/{multi-select-dropdown.entry-f298ca2c.cjs → multi-select-dropdown.entry-68fcca98.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-2ca73c71.js → multi-select-dropdown.entry-8e14e9af.js} +2 -2
- package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-2b01df7e.js → nylas-booked-event-card_10.entry-9487941d.js} +357 -316
- package/dist/{nylas-custom-booking-flow.entry-66beff43.js → nylas-custom-booking-flow.entry-0e16973b.js} +32 -32
- package/dist/{nylas-custom-booking-flow.entry-05b9522a.cjs → nylas-custom-booking-flow.entry-338b0a8f.cjs} +1 -1
- package/dist/nylas-form-card.entry-ca669dea.cjs +1 -0
- package/dist/{nylas-form-card.entry-3de9f477.js → nylas-form-card.entry-ccfa5692.js} +10 -10
- package/dist/{nylas-if-state.entry-a0689083.js → nylas-if-state.entry-93935670.js} +2 -2
- package/dist/{nylas-if-state.entry-a734df46.cjs → nylas-if-state.entry-faa11bb6.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-4fb9d4c2.js → nylas-list-folders.entry-14fc1fe8.js} +4 -4
- package/dist/{nylas-list-folders.entry-74a56187.cjs → nylas-list-folders.entry-e7e179ea.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-9a6d4c33.js → nylas-list-threads.entry-2118b146.js} +3 -3
- package/dist/{nylas-list-threads.entry-0addc621.cjs → nylas-list-threads.entry-3f52fc06.cjs} +1 -1
- package/dist/{nylas-login.entry-beb6e0d9.js → nylas-login.entry-87a902d6.js} +7 -7
- package/dist/{nylas-login.entry-bdac29c0.cjs → nylas-login.entry-915f0284.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-c5d07bbe.cjs → nylas-mailbox-pagination.entry-9aa8a606.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-1d71850a.js → nylas-mailbox-pagination.entry-eedbf796.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-882c97a0.js → nylas-mailbox-toolbar-button.entry-40b75810.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-7d9d6293.cjs → nylas-mailbox-toolbar-button.entry-ba5b826e.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-d810adba.js → nylas-mailbox.entry-179e5a5c.js} +3 -3
- package/dist/{nylas-mailbox.entry-94eb97ec.cjs → nylas-mailbox.entry-31de7f8f.cjs} +1 -1
- package/dist/{nylas-provider.entry-5a4bb86e.cjs → nylas-provider.entry-46fe01b6.cjs} +1 -1
- package/dist/{nylas-provider.entry-fcaf9e1c.js → nylas-provider.entry-7b70bbdc.js} +36 -36
- package/dist/{nylas-scheduler-editor.entry-30597812.cjs → nylas-scheduler-editor.entry-76b68f66.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-1ca566d3.js → nylas-scheduler-editor.entry-f1f80de1.js} +7 -10
- package/dist/{nylas-scheduling.entry-aefefe3d.js → nylas-scheduling.entry-31d13205.js} +83 -70
- package/dist/nylas-scheduling.entry-3ce8c52f.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-a85222e2.js → nylas-threads-refresh.entry-a3ea46aa.js} +2 -2
- package/dist/{nylas-threads-refresh.entry-f3b9fdf2.cjs → nylas-threads-refresh.entry-c9f9db8c.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-b1bf455b.js → nylas-threads-search.entry-01482ddf.js} +8 -8
- package/dist/{nylas-threads-search.entry-2c8ac7dc.cjs → nylas-threads-search.entry-a4ab0d47.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-3a34b29b.cjs → nylas-time-window-picker.entry-5a3bb0b7.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-6d664a05.js → nylas-time-window-picker.entry-5f063b2b.js} +18 -18
- package/dist/{nylas-view-thread.entry-bf6cab2a.cjs → nylas-view-thread.entry-82e78b82.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-ddcb042f.js → nylas-view-thread.entry-cb057b9e.js} +6 -6
- package/dist/person-icon.entry-3e30c63c.js +15 -0
- package/dist/person-icon.entry-78cdc7f9.cjs +1 -0
- package/dist/play-icon_2.entry-4fb1938c.cjs +1 -0
- package/dist/play-icon_2.entry-71eaad5c.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +116 -108
- package/dist/{refresh-icon.entry-99761cb6.cjs → refresh-icon.entry-3570353d.cjs} +1 -1
- package/dist/{refresh-icon.entry-0fdcb7af.js → refresh-icon.entry-db85d14d.js} +4 -4
- package/dist/{register-component-a5a9ca5d-ddae10b3.js → register-component-b2a51b20-8a262dcf.js} +1 -1
- package/dist/{register-component-a5a9ca5d-4439e573.cjs → register-component-b2a51b20-9a913603.cjs} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-b774bfee.cjs → scheduler-config-store-9ccfba4d-6806e3cb.cjs} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-84025740.js → scheduler-config-store-9ccfba4d-a6745ccc.js} +1 -1
- package/dist/{scheduler-store-8a400448-8ab7b63e.js → scheduler-store-db06b30a-1e63b67f.js} +119 -116
- package/dist/scheduler-store-db06b30a-d5e6b6c3.cjs +1 -0
- package/dist/{textarea-component.entry-359e4665.cjs → textarea-component.entry-be870b8f.cjs} +1 -1
- package/dist/{textarea-component.entry-193d29fd.js → textarea-component.entry-f5f402a1.js} +4 -4
- package/dist/time-period-selector.entry-d1a8470b.js +93 -0
- package/dist/time-period-selector.entry-fc7d61c6.cjs +1 -0
- package/dist/{translate-icon.entry-32ec36de.cjs → translate-icon.entry-3ae0ddae.cjs} +1 -1
- package/dist/{translate-icon.entry-22a3e72e.js → translate-icon.entry-b91a0449.js} +2 -2
- package/dist/{warning-icon.entry-b8d483e1.cjs → warning-icon.entry-54127f45.cjs} +1 -1
- package/dist/{warning-icon.entry-8d9b59c0.js → warning-icon.entry-acdc811b.js} +5 -5
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-5cefae99.js +0 -25
- package/dist/add-circle-icon_2.entry-85523420.cjs +0 -1
- package/dist/button-component_4.entry-3c508e3b.js +0 -115
- package/dist/button-component_4.entry-f8ab53dc.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_35.entry-b56841a0.cjs +0 -7
- package/dist/clock-icon_2.entry-074eb053.cjs +0 -1
- package/dist/clock-icon_2.entry-bc938936.js +0 -25
- package/dist/copy-icon_4.entry-f704b2f1.cjs +0 -1
- package/dist/document-refresh-icon.entry-ea0e1ab9.cjs +0 -1
- package/dist/google-logo-icon_4.entry-8e87cf66.cjs +0 -1
- package/dist/google-logo-icon_4.entry-f50de25f.js +0 -598
- package/dist/index-53420959-507f0a27.js +0 -5
- package/dist/index-53420959-e6c2e510.cjs +0 -1
- package/dist/index-a4831dfe.cjs +0 -42
- package/dist/index-a68236be.js +0 -5011
- package/dist/input-dropdown_2.entry-2485dcc3.cjs +0 -1
- package/dist/input-dropdown_2.entry-2cd6cfc7.js +0 -220
- package/dist/loading-icon.entry-5ed52afe.cjs +0 -1
- package/dist/loading-icon.entry-96d9d1be.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-97977ac7.cjs +0 -1
- package/dist/nylas-form-card.entry-3e1331c9.cjs +0 -1
- package/dist/nylas-scheduling.entry-00c418c8.cjs +0 -1
- package/dist/play-icon_2.entry-4f316c3d.cjs +0 -1
- package/dist/play-icon_2.entry-d55a018a.js +0 -25
- package/dist/scheduler-store-8a400448-eaa566fa.cjs +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { R as
|
|
3
|
-
import { T as
|
|
4
|
-
import { s as
|
|
5
|
-
import "./index-53420959-
|
|
1
|
+
import { r as v, c as h, d, h as a, k as l, n as Y, H as y, g as X, m as W, C as re, D as le, E as C, G as ce, I as de, J as B, F as fe } from "./index-f8317a8e.js";
|
|
2
|
+
import { R as w } from "./register-component-b2a51b20-8a262dcf.js";
|
|
3
|
+
import { T as E, L as J, g as be, a as U } from "./constants-67de2eec-b17f5b96.js";
|
|
4
|
+
import { s as S } from "./index-6d9eeb53-c70fc8a7.js";
|
|
5
|
+
import "./index-53420959-9b1699ec.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
const he = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ue = he;
|
|
9
|
+
var pe = function(e, t, i, o) {
|
|
10
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
11
11
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
12
|
-
n = Reflect.decorate(e, t, i,
|
|
12
|
+
n = Reflect.decorate(e, t, i, o);
|
|
13
13
|
else
|
|
14
|
-
for (var
|
|
15
|
-
(r = e[
|
|
16
|
-
return
|
|
17
|
-
},
|
|
14
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
15
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
16
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
17
|
+
}, z = function(e, t) {
|
|
18
18
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
19
19
|
return Reflect.metadata(e, t);
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const K = class {
|
|
22
22
|
constructor(e) {
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
const t = new Date(this.selectedTimeslot.start_time), i = (n = (
|
|
23
|
+
v(this, e), this.cancelBookingButtonClicked = h(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = h(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = h(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = h(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
24
|
+
var s, n;
|
|
25
|
+
const t = new Date(this.selectedTimeslot.start_time), i = (n = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : n.min_cancellation_notice;
|
|
26
26
|
t.getTime() - i * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
27
27
|
error: {
|
|
28
28
|
title: "Cancellation Error",
|
|
@@ -43,7 +43,7 @@ const W = class {
|
|
|
43
43
|
default:
|
|
44
44
|
return "";
|
|
45
45
|
}
|
|
46
|
-
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0, this.isLoading = void 0;
|
|
46
|
+
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0, this.isLoading = void 0, this.selectedLanguage = navigator.language;
|
|
47
47
|
}
|
|
48
48
|
connectedCallback() {
|
|
49
49
|
}
|
|
@@ -56,16 +56,16 @@ const W = class {
|
|
|
56
56
|
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.');
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
var e, t, i,
|
|
60
|
-
return a(
|
|
59
|
+
var e, t, i, o, s, n, r, c, p, u, f, b, m, k, g, x, _, q, A, Z, G, V;
|
|
60
|
+
return a(y, { key: "58765b8d8fb8630b0893d6c6e86fd87745885e4b", part: "nbec" }, a("sp-theme", { key: "c7086efdc3ad76d17ab76c21acdd7b8fcf6841d3", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "dbcd53b07cbedc5ec351febea9f6f0d795319e73", class: "booked-event-timezone" }, a("globe-icon", { key: "869433a367eedb9c80f8a4787e16473e96a5286a" }), E[this.selectedTimezone]), a("div", { key: "98daca2ef441eee475178a7e59d193dde4caa189", class: "event-card-wrapper", part: "nbec__card" }, a("div", { key: "6e9758b8fcc0e281dca625c6693e245d420fdcc6", class: "calendar-icon" }, a("calendar-check-icon", { key: "8aa83e62a30306cc86ae234147d8c6eb680ef61c" })), a("div", { key: "8e9f3395b241755c0264611d363f0d639370f6de", class: "booked-event-header" }, a("h2", { key: "0eff7c4489ea882b89575b95e4626e0f2bcf9487", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${l.t("bookingRescheduled")}` : `${l.t("bookingConfirmed")}`, "!"), a("div", { key: "c839174adae518ef5f036a3e29e82860714113d1", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((t = this.getOrganizer(this.eventInfo)) == null ? void 0 : t.email), " & ", ((o = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : o.name) || ((n = (s = this.bookingInfo) == null ? void 0 : s.primaryParticipant) == null ? void 0 : n.email))), a("sp-divider", { key: "8257b8c3f930b385f007962d3318d6aa77399489" }), a("div", { key: "9f13c453b1c981108299708db70ebec0be7d58cc", class: "booking-date-time" }, a("checkmark-circle-icon", { key: "9c51212fc00559af74215b88ae4b6c2ad6902ce5" }), a("h3", { key: "a52656d258ee10cf85b61b9fbe9b469482ff9cef" }, l.t("bookingDateAndTimeHeader")), a("p", { key: "3791d36b2d1ef8568e0b87d5b8d64548a40537fe" }, (r = this.selectedTimeslot) != null && r.start_time ? Y(new Date((c = this.selectedTimeslot) == null ? void 0 : c.start_time).toLocaleDateString(J[this.selectedLanguage], { dateStyle: "full" })) : "-", " ", a("br", { key: "15e586a111f8fa6d812a17d04fb9a6ce0ca84f19" }), new Date((p = this.selectedTimeslot) == null ? void 0 : p.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((u = this.selectedTimeslot) == null ? void 0 : u.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), a("div", { key: "ab4f73ea904bae1978b9f6bcef5048a3f3625e9e", class: "booking-participants" }), a("sp-divider", { key: "d7de8473998bd24742533951e13a5d1893b06758" }), a("div", { key: "ad81fbb94ee37b773dfed28ac91afc2c7b099fe8", class: {
|
|
61
61
|
footer: !0,
|
|
62
|
-
"no-footer": ((
|
|
63
|
-
"no-template-cols": ((
|
|
64
|
-
} }, !((
|
|
62
|
+
"no-footer": ((b = (f = this.configSettings) == null ? void 0 : f.scheduler) == null ? void 0 : b.hide_cancellation_options) && ((k = (m = this.configSettings) == null ? void 0 : m.scheduler) == null ? void 0 : k.hide_rescheduling_options),
|
|
63
|
+
"no-template-cols": ((x = (g = this.configSettings) == null ? void 0 : g.scheduler) == null ? void 0 : x.hide_cancellation_options) || ((q = (_ = this.configSettings) == null ? void 0 : _.scheduler) == null ? void 0 : q.hide_rescheduling_options)
|
|
64
|
+
} }, !((Z = (A = this.configSettings) == null ? void 0 : A.scheduler) != null && Z.hide_cancellation_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${l.t("cancelBookingButton")}`), !((V = (G = this.configSettings) == null ? void 0 : G.scheduler) != null && V.hide_rescheduling_options) && a("sp-button", { variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, `${l.t("rescheduleBookingButton")}`)))));
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
pe([
|
|
68
|
+
w({
|
|
69
69
|
name: "nylas-booked-event-card",
|
|
70
70
|
stateToProps: /* @__PURE__ */ new Map([
|
|
71
71
|
["scheduler.bookingInfo", "bookingInfo"],
|
|
@@ -73,6 +73,7 @@ de([
|
|
|
73
73
|
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
74
74
|
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
75
75
|
["scheduler.isLoading", "isLoading"],
|
|
76
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
76
77
|
["scheduler.configSettings", "configSettings"]
|
|
77
78
|
]),
|
|
78
79
|
eventToProps: {
|
|
@@ -80,43 +81,43 @@ de([
|
|
|
80
81
|
t.scheduler.setCancel(e.detail.bookingId);
|
|
81
82
|
},
|
|
82
83
|
rescheduleButtonClicked: async (e, t) => {
|
|
83
|
-
const i = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler:
|
|
84
|
-
|
|
84
|
+
const i = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: o } = e.detail;
|
|
85
|
+
o && (!i || "error" in i) && o(i);
|
|
85
86
|
}
|
|
86
87
|
},
|
|
87
88
|
fireRegisterEvent: !0
|
|
88
89
|
}),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
],
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
var
|
|
96
|
-
var
|
|
90
|
+
z("design:type", Function),
|
|
91
|
+
z("design:paramtypes", []),
|
|
92
|
+
z("design:returntype", void 0)
|
|
93
|
+
], K.prototype, "render", null);
|
|
94
|
+
K.style = ue;
|
|
95
|
+
const me = ':host{display:block;height:100%;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}.guest-email-input{position:relative;display:flex;width:100%}', ye = me;
|
|
96
|
+
var ge = function(e, t, i, o) {
|
|
97
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
97
98
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
98
|
-
n = Reflect.decorate(e, t, i,
|
|
99
|
+
n = Reflect.decorate(e, t, i, o);
|
|
99
100
|
else
|
|
100
|
-
for (var
|
|
101
|
-
(r = e[
|
|
102
|
-
return
|
|
103
|
-
},
|
|
101
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
102
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
103
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
104
|
+
}, I = function(e, t) {
|
|
104
105
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
105
106
|
return Reflect.metadata(e, t);
|
|
106
107
|
};
|
|
107
|
-
const
|
|
108
|
+
const T = /^[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])?)*$/, Q = class {
|
|
108
109
|
constructor(e) {
|
|
109
|
-
|
|
110
|
+
v(this, e), this.nameChanged = h(this, "nameChanged", 7), this.emailChanged = h(this, "emailChanged", 7), this.backButtonClicked = h(this, "backButtonClicked", 7), this.detailsConfirmed = h(this, "detailsConfirmed", 7), this.bookingFormError = h(this, "bookingFormError", 7), this.bookingFormSubmitted = h(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, i) => {
|
|
110
111
|
this.resetGuestEmailError(t);
|
|
111
|
-
const
|
|
112
|
-
|
|
112
|
+
const o = [...this.guestEmails];
|
|
113
|
+
o[t] = S(i), this.guestEmails = [...o];
|
|
113
114
|
}, this.handleGuestBlur = (t, i) => {
|
|
114
115
|
if (this.resetGuestEmailError(t), i === "") {
|
|
115
|
-
this.guestEmailErrors[t] = "
|
|
116
|
+
this.guestEmailErrors[t] = l.t("fieldRequired", { field: l.t("email") });
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
|
-
if (!
|
|
119
|
-
this.guestEmailErrors[t] = "
|
|
119
|
+
if (!T.test(i)) {
|
|
120
|
+
this.guestEmailErrors[t] = l.t("invalidInputFormat", { field: l.t("email") });
|
|
120
121
|
return;
|
|
121
122
|
}
|
|
122
123
|
this.handleGuestChange(t, i);
|
|
@@ -124,57 +125,57 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
124
125
|
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
125
126
|
}, this.removeGuestButtonClickHandler = (t, i) => {
|
|
126
127
|
t.preventDefault(), this.resetGuestEmailError(i);
|
|
127
|
-
const
|
|
128
|
-
|
|
128
|
+
const o = [...this.guestEmails];
|
|
129
|
+
o.splice(i, 1), this.guestEmails = [...o];
|
|
129
130
|
}, this.handleBackButtonClicked = () => {
|
|
130
131
|
this.backButtonClicked.emit();
|
|
131
132
|
}, this.bookButtonClickedHandler = async (t) => {
|
|
132
|
-
var
|
|
133
|
+
var c, p, u, f, b, m, k;
|
|
133
134
|
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
134
135
|
return;
|
|
135
136
|
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
|
|
137
|
+
const o = this.name || ((p = (c = this.bookingInfo) == null ? void 0 : c.primaryParticipant) == null ? void 0 : p.name), s = this.email || ((f = (u = this.bookingInfo) == null ? void 0 : u.primaryParticipant) == null ? void 0 : f.email);
|
|
138
|
+
if (!o || o === "") {
|
|
139
|
+
this.isNameValid = !1, this.validationError.name = l.t("fieldRequired", { field: l.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
139
140
|
title: "Booking form error",
|
|
140
141
|
description: "Name is required"
|
|
141
142
|
});
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
|
-
if (!
|
|
145
|
-
this.isEmailValid = !1, this.validationError.email = "Email is required", this.bookingFormError.emit({
|
|
145
|
+
if (!s || s === "") {
|
|
146
|
+
this.isEmailValid = !1, this.validationError.email = l.t("fieldRequired", { field: l.t("email") }) || "Email is required", this.bookingFormError.emit({
|
|
146
147
|
title: "Booking form error",
|
|
147
148
|
description: "Email is required"
|
|
148
149
|
});
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
|
-
if (!
|
|
152
|
-
this.isEmailValid = !1, this.validationError.email = "
|
|
152
|
+
if (!T.test(s)) {
|
|
153
|
+
this.isEmailValid = !1, this.validationError.email = l.t("invalidInputFormat", { field: l.t("email") }), this.bookingFormError.emit({
|
|
153
154
|
title: "Booking form error",
|
|
154
|
-
description: "Invalid email"
|
|
155
|
+
description: l.t("invalidInputFormat", { field: l.t("email") }) || "Invalid email"
|
|
155
156
|
});
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
159
|
let n = [];
|
|
159
160
|
if (this.guestEmails.length > 0) {
|
|
160
|
-
let
|
|
161
|
-
if (this.guestEmails.forEach((
|
|
162
|
-
|
|
163
|
-
}),
|
|
161
|
+
let g = !1;
|
|
162
|
+
if (this.guestEmails.forEach((x, _) => {
|
|
163
|
+
x === "" ? (g = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [_]: l.t("fieldRequired", { field: l.t("email") }) }) : T.test(x) || (g = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [_]: l.t("invalidInputFormat", { field: l.t("email") }) });
|
|
164
|
+
}), g) {
|
|
164
165
|
this.bookingFormError.emit({
|
|
165
166
|
title: "Booking form error",
|
|
166
|
-
description: "Invalid guest email"
|
|
167
|
+
description: l.t("invalidInputFormat", { field: l.t("guestEmail") }) || "Invalid guest email"
|
|
167
168
|
});
|
|
168
169
|
return;
|
|
169
170
|
}
|
|
170
|
-
n = this.guestEmails.map((
|
|
171
|
+
n = this.guestEmails.map((x) => ({ name: x.trim(), email: x.trim() }));
|
|
171
172
|
} else
|
|
172
|
-
(
|
|
173
|
-
const r = ((
|
|
173
|
+
(b = this.bookingInfo) != null && b.guests && (n = (m = this.bookingInfo) == null ? void 0 : m.guests);
|
|
174
|
+
const r = ((k = this.bookingInfo) == null ? void 0 : k.additionalFields) || [];
|
|
174
175
|
this.detailsConfirmed.emit({
|
|
175
176
|
primaryParticipant: {
|
|
176
|
-
name:
|
|
177
|
-
email:
|
|
177
|
+
name: o,
|
|
178
|
+
email: s
|
|
178
179
|
},
|
|
179
180
|
guests: n,
|
|
180
181
|
additionalFields: { ...r, ...this.additionalFields }
|
|
@@ -195,10 +196,10 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
195
196
|
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
196
197
|
}
|
|
197
198
|
changeName(e) {
|
|
198
|
-
this.isNameValid = !0, this.validationError.name = "", this.name =
|
|
199
|
+
this.isNameValid = !0, this.validationError.name = "", this.name = S(e), this.nameChanged.emit(e);
|
|
199
200
|
}
|
|
200
201
|
changeEmail(e) {
|
|
201
|
-
this.isEmailValid = !0, this.validationError.email = "", this.email =
|
|
202
|
+
this.isEmailValid = !0, this.validationError.email = "", this.email = S(e), this.emailChanged.emit(e);
|
|
202
203
|
}
|
|
203
204
|
resetGuestEmailError(e) {
|
|
204
205
|
const t = { ...this.guestEmailErrors };
|
|
@@ -244,40 +245,40 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
244
245
|
this.updateAdditionalFields(e.detail.label || e.detail.name, e.detail.value);
|
|
245
246
|
}
|
|
246
247
|
render() {
|
|
247
|
-
var e, t, i,
|
|
248
|
-
return a(
|
|
249
|
-
error: !!this.guestEmailErrors[
|
|
250
|
-
} }, "
|
|
248
|
+
var e, t, i, o, s, n, r, c, p;
|
|
249
|
+
return a(y, { key: "0f726af583bf4c9534be20348bd307c1bfd57282" }, a("form", { key: "c5f22c64c9d91c3ebdba8959bcad37eb1a775b32", onSubmit: (u) => this.bookButtonClickedHandler(u), noValidate: !0 }, a("div", { key: "df3aef2b8be265e80e1ebd7b9c5d4daddde7e61c", class: "nylas-booking-form" }, a("div", { key: "f4883e505c5e4402864548e784e03a210720da0a", class: "input-wrapper" }, a("input-component", { key: "311df417f2f91ad65c32a61e11853b78e57cc5d9", label: l.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: l.t("namePlaceholder"), type: "text", required: !0, requiredError: l.t("fieldRequired", { field: l.t("name") }), patternError: l.t("invalidInputFormat", { field: l.t("name") }), part: "nbf__input-textfield" })), a("div", { key: "bcc2b1ffb2b52b70bc4c0ae6b11d1f0dfc45cede", class: "input-wrapper" }, a("input-component", { key: "03d00ab3874a6638eb1781a30c2d9addede43243", label: l.t("email"), name: "email", id: "email", pattern: T, defaultValue: ((o = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : o.email) || this.email, placeholder: l.t("emailPlaceholder"), type: "email", required: !0, requiredError: l.t("fieldRequired", { field: l.t("email") }), patternError: l.t("invalidInputFormat", { field: l.t("email") }), part: "nbf__input-textfield" })), ((n = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : n.hide_additional_guests) !== !0 && a("div", { class: "input-wrapper" }, this.guestEmails.map((u, f) => a("div", { class: "input-wrapper button-wrapper" }, a("label", { class: {
|
|
250
|
+
error: !!this.guestEmailErrors[f]
|
|
251
|
+
} }, l.t("guestEmail")), a("div", { class: "guest-email-input" }, a("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
|
|
251
252
|
"guest-email": !0,
|
|
252
|
-
error: !!this.guestEmailErrors[
|
|
253
|
-
}, placeholder: "
|
|
253
|
+
error: !!this.guestEmailErrors[f]
|
|
254
|
+
}, placeholder: l.t("guestEmailPlaceholder"), value: u, "data-index": f, part: "nbf__input-textfield", onBlur: (b) => {
|
|
254
255
|
var m;
|
|
255
|
-
return this.handleGuestBlur(
|
|
256
|
-
}, onInput: (
|
|
256
|
+
return this.handleGuestBlur(f, (m = b.target) == null ? void 0 : m.value);
|
|
257
|
+
}, onInput: (b) => {
|
|
257
258
|
var m;
|
|
258
|
-
return this.handleGuestChange(
|
|
259
|
-
} }), a("button-component", { variant: "basic", onClick: (
|
|
259
|
+
return this.handleGuestChange(f, (m = b.target) == null ? void 0 : m.value);
|
|
260
|
+
} }), a("button-component", { variant: "basic", onClick: (b) => this.removeGuestButtonClickHandler(b, f), class: {
|
|
260
261
|
"remove-guest": !0,
|
|
261
|
-
error: !!this.guestEmailErrors[
|
|
262
|
-
} }, a("close-icon", null))), a("p", { class: "help-text" }, this.guestEmailErrors[
|
|
263
|
-
var m,
|
|
264
|
-
const
|
|
265
|
-
switch (
|
|
262
|
+
error: !!this.guestEmailErrors[f]
|
|
263
|
+
} }, a("close-icon", null))), a("p", { class: "help-text" }, this.guestEmailErrors[f]))), a("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (u) => this.addGuestButtonClickedHandler(u) }, a("div", { class: "button-content" }, a("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${l.t("addAnotherGuest")}` : `${l.t("addGuest")}`))), (p = Object.entries(((c = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : c.additional_fields) || {})) == null ? void 0 : p.sort((u, f) => u[1].order - f[1].order).map((u) => {
|
|
264
|
+
var m, k;
|
|
265
|
+
const f = u[1], b = f.label;
|
|
266
|
+
switch (f.type) {
|
|
266
267
|
case "dropdown":
|
|
267
|
-
return a("div", { class: "input-wrapper" }, a("select-dropdown", { label:
|
|
268
|
+
return a("div", { class: "input-wrapper" }, a("select-dropdown", { label: b, name: b, id: b, withSearch: !1, options: (m = f.options) == null ? void 0 : m.map((g) => ({ value: g, label: g })), required: f.required, part: "nbf__input-textfield" }));
|
|
268
269
|
case "checkbox":
|
|
269
|
-
return a("div", { class: "input-wrapper" }, a("checkbox-component", { label:
|
|
270
|
+
return a("div", { class: "input-wrapper" }, a("checkbox-component", { label: b, name: b, id: b, required: f.required, part: "nbf__input-textfield" }));
|
|
270
271
|
case "radio_button":
|
|
271
|
-
return a("div", { class: "input-wrapper" }, a("radio-button-group", { label:
|
|
272
|
+
return a("div", { class: "input-wrapper" }, a("radio-button-group", { label: b, name: b, id: b, options: (k = f.options) == null ? void 0 : k.map((g) => ({ value: g, label: g })), required: f.required, part: "nbf__input-textfield" }));
|
|
272
273
|
case "multi_line_text":
|
|
273
|
-
return a("div", { class: "input-wrapper" }, a("textarea-component", { label:
|
|
274
|
+
return a("div", { class: "input-wrapper" }, a("textarea-component", { label: b, name: b, id: b, required: f.required, part: "nbf__input-textfield" }));
|
|
274
275
|
default:
|
|
275
|
-
return a("div", { class: "input-wrapper" }, a("input-component", { label:
|
|
276
|
+
return a("div", { class: "input-wrapper" }, a("input-component", { label: b, name: b, id: b, type: f.type, requiredError: l.t("fieldRequired", { field: b }), required: f.required, part: "nbf__input-textfield" }));
|
|
276
277
|
}
|
|
277
|
-
}), a("slot", { key: "
|
|
278
|
+
}), a("slot", { key: "2233da0ce56579adcd221931cac452361405f55d", name: "custom-booking-form" })), a("div", { key: "aaeecd6bebb400adebb0825de1937fa6e1ee5cc5", class: "cta" }, a("sp-button", { key: "890ea225bc8ebefbd8083023fbe90de349a35a37", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, a("slot", { key: "938f64d011d2a5200df950a783160b1468ef8cd6", name: "booking-form-back-label" }, `${l.t("backButton")}`)), a("sp-button", { key: "6aa902ab70c3093861496bb35393aac1c51fcf02", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && a("loading-icon", { slot: "icon" }), a("slot", { key: "984e3d60ca65be4f8b5da8ac66891b63eb1a130c", name: "booking-form-book-label" }, `${l.t("bookNowButton")}`)))));
|
|
278
279
|
}
|
|
279
280
|
get host() {
|
|
280
|
-
return
|
|
281
|
+
return X(this);
|
|
281
282
|
}
|
|
282
283
|
static get watchers() {
|
|
283
284
|
return {
|
|
@@ -285,8 +286,8 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
285
286
|
};
|
|
286
287
|
}
|
|
287
288
|
};
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
ge([
|
|
290
|
+
w({
|
|
290
291
|
name: "nylas-booking-form",
|
|
291
292
|
stateToProps: /* @__PURE__ */ new Map([
|
|
292
293
|
["scheduler.isLoading", "isLoading"],
|
|
@@ -307,52 +308,52 @@ he([
|
|
|
307
308
|
},
|
|
308
309
|
fireRegisterEvent: !0
|
|
309
310
|
}),
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
],
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
var
|
|
317
|
-
var
|
|
311
|
+
I("design:type", Function),
|
|
312
|
+
I("design:paramtypes", []),
|
|
313
|
+
I("design:returntype", void 0)
|
|
314
|
+
], Q.prototype, "render", null);
|
|
315
|
+
Q.style = ye;
|
|
316
|
+
const ve = ':host{display:block;width:400px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', ke = ve;
|
|
317
|
+
var xe = function(e, t, i, o) {
|
|
318
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
318
319
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
319
|
-
n = Reflect.decorate(e, t, i,
|
|
320
|
+
n = Reflect.decorate(e, t, i, o);
|
|
320
321
|
else
|
|
321
|
-
for (var
|
|
322
|
-
(r = e[
|
|
323
|
-
return
|
|
324
|
-
},
|
|
322
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
323
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
324
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
325
|
+
}, R = function(e, t) {
|
|
325
326
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
326
327
|
return Reflect.metadata(e, t);
|
|
327
328
|
};
|
|
328
|
-
const
|
|
329
|
+
const ee = class {
|
|
329
330
|
constructor(e) {
|
|
330
331
|
var t, i;
|
|
331
|
-
|
|
332
|
+
v(this, e), this.goBackButtonClicked = h(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = h(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = h(this, "cancelBookedEventError", 7), this.cancelBookingFormError = h(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
332
333
|
this.goBackButtonClicked.emit();
|
|
333
|
-
}, this.handleSubmitCancelBooking = (
|
|
334
|
-
var r,
|
|
335
|
-
if (
|
|
336
|
-
this.cancellationError =
|
|
334
|
+
}, this.handleSubmitCancelBooking = (o) => {
|
|
335
|
+
var r, c, p;
|
|
336
|
+
if (o.preventDefault(), !this.cancellationReason) {
|
|
337
|
+
this.cancellationError = l.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: l.t("cancelBokingFormError"), description: l.t("cancellationErrorMessage") });
|
|
337
338
|
return;
|
|
338
339
|
}
|
|
339
|
-
const
|
|
340
|
-
if (this.selectedTimeslot &&
|
|
340
|
+
const s = (c = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : c.min_cancellation_notice;
|
|
341
|
+
if (this.selectedTimeslot && s && new Date((p = this.selectedTimeslot) == null ? void 0 : p.start_time).getTime() - s * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
341
342
|
this.cancelBookedEventError.emit({
|
|
342
343
|
error: {
|
|
343
|
-
title: "
|
|
344
|
-
message:
|
|
344
|
+
title: l.t("cancellationErrorTitle"),
|
|
345
|
+
message: l.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: s })
|
|
345
346
|
}
|
|
346
347
|
});
|
|
347
348
|
return;
|
|
348
349
|
}
|
|
349
350
|
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
350
|
-
const n = (
|
|
351
|
-
this.cancelBookedEventError.emit(
|
|
351
|
+
const n = (u) => {
|
|
352
|
+
this.cancelBookedEventError.emit(u);
|
|
352
353
|
};
|
|
353
354
|
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: n });
|
|
354
|
-
}, this.handleOnChangeCancellationReason = (
|
|
355
|
-
this.cancellationError = "", this.cancellationReason =
|
|
355
|
+
}, this.handleOnChangeCancellationReason = (o) => {
|
|
356
|
+
this.cancellationError = "", this.cancellationReason = o.target.value;
|
|
356
357
|
}, this.cancelBookingId = void 0, this.configSettings = void 0, this.selectedTimeslot = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((i = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : i.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
357
358
|
}
|
|
358
359
|
configSettingsChangedHandler(e) {
|
|
@@ -372,7 +373,8 @@ const Y = class {
|
|
|
372
373
|
d("[nylas-cancel-booking-form] Component disconnected");
|
|
373
374
|
}
|
|
374
375
|
render() {
|
|
375
|
-
|
|
376
|
+
var e, t;
|
|
377
|
+
return a(y, { key: "7f64e29eb7a6baa0056b7c5316697c3b6a773b68", part: "ncec" }, a("sp-theme", { key: "b4911d0629e6b10843f7b30e84419b21a0d9dfb0", theme: "spectrum", scale: "medium" }, a("div", { key: "b84646eeba42f5a7cfefc62b82e17d46d535d280", class: "nylas-cancel-booking-form", part: "ncec__card" }, a("div", { key: "038acc8592e4080df2286a4c1918668f6a5f4571", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "5f7bf66cb161b22b7348f6cd8c424ff2f4df0477" })), a("h3", { key: "7143c9c6ff265a07a2b36b8de260203ef9c76d83", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, l.t("cancelBookingTitle")), a("div", { key: "1c7db06b3caba284cf8920e53cf1e10a941eb012", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${l.t("cancelBookingMessage")}`), a("form", { key: "a4182027971ec26beb33ba8426a454e2727cdbb4", onSubmit: this.handleSubmitCancelBooking }, a("sp-field-label", { key: "38789eecfce2fe11b29eeae67f28c8c78db11800", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, l.t("reasonForCancellation"), " ", a("span", { key: "37378fdfe659aee8bd317ba38bfb93104cde7d61", class: "required" }, "*")), a("sp-textfield", { key: "085941cfb9c633f0cd16e0f6a2389109dd87e353", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, a("sp-help-text", { key: "17a1638b23232748e4d6d9052537401195f8cb9c", slot: "negative-help-text" }, this.cancellationError)), a("sp-button", { key: "d2e4ac11779a936de1876cd537ebec05aa8f1d5e", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, l.t("cancelBookingButton")), a("sp-button", { key: "f0144a7b0e0703525a16ee38dfd69d568611264b", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, l.t("goBackButton"))))));
|
|
376
378
|
}
|
|
377
379
|
static get watchers() {
|
|
378
380
|
return {
|
|
@@ -380,8 +382,8 @@ const Y = class {
|
|
|
380
382
|
};
|
|
381
383
|
}
|
|
382
384
|
};
|
|
383
|
-
|
|
384
|
-
|
|
385
|
+
xe([
|
|
386
|
+
w({
|
|
385
387
|
name: "nylas-cancel-booking-form",
|
|
386
388
|
stateToProps: /* @__PURE__ */ new Map([
|
|
387
389
|
["scheduler.configSettings", "configSettings"],
|
|
@@ -389,33 +391,33 @@ ue([
|
|
|
389
391
|
]),
|
|
390
392
|
eventToProps: {
|
|
391
393
|
cancelBookingFormSubmitted: async (e, t) => {
|
|
392
|
-
const i = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason), { errorHandler:
|
|
393
|
-
|
|
394
|
+
const i = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason), { errorHandler: o } = e.detail;
|
|
395
|
+
o && (!i || "error" in i) && o(i);
|
|
394
396
|
}
|
|
395
397
|
},
|
|
396
398
|
fireRegisterEvent: !0
|
|
397
399
|
}),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
],
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
var
|
|
405
|
-
var
|
|
400
|
+
R("design:type", Function),
|
|
401
|
+
R("design:paramtypes", []),
|
|
402
|
+
R("design:returntype", void 0)
|
|
403
|
+
], ee.prototype, "render", null);
|
|
404
|
+
ee.style = ke;
|
|
405
|
+
const Ce = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', we = Ce;
|
|
406
|
+
var _e = function(e, t, i, o) {
|
|
407
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
406
408
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
407
|
-
n = Reflect.decorate(e, t, i,
|
|
409
|
+
n = Reflect.decorate(e, t, i, o);
|
|
408
410
|
else
|
|
409
|
-
for (var
|
|
410
|
-
(r = e[
|
|
411
|
-
return
|
|
412
|
-
},
|
|
411
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
412
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
413
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
414
|
+
}, F = function(e, t) {
|
|
413
415
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
414
416
|
return Reflect.metadata(e, t);
|
|
415
417
|
};
|
|
416
|
-
const
|
|
418
|
+
const te = class {
|
|
417
419
|
constructor(e) {
|
|
418
|
-
|
|
420
|
+
v(this, e), this.closeCancelEventCardClicked = h(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = h(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
419
421
|
this.isClosing = !0;
|
|
420
422
|
const t = (i) => {
|
|
421
423
|
this.cancelledEventCardError.emit(i), this.isClosing = !1;
|
|
@@ -437,98 +439,101 @@ const X = class {
|
|
|
437
439
|
}
|
|
438
440
|
render() {
|
|
439
441
|
var e, t;
|
|
440
|
-
return a(
|
|
442
|
+
return a(y, { key: "4ca9efad903a4f5e5191c4f88e06c68fe1880ffa", part: "ncec" }, a("sp-theme", { key: "11e09ce97c73cc8daa5db44fea110397cfe30b3c", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "edeecdfaf22ca6261d104066dd05c0d90c3049a0", class: "nylas-cancelled-event-card", part: "ncec__card" }, a("div", { key: "cc181bcc94b5d43de70fb5a597a668255741a098", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, a("calendar-cancel-icon", { key: "7b9affac586b1e009a27d84a13aa95d3b5734dd6" })), a("h3", { key: "a8234ca699117963cf27a40e10a17fefea199eef", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, l.t("bookingCancelledTitle"), "!"), a("div", { key: "8f1df6a7a3eacf9e7387a4976ab874225904cd08", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, l.t("bookingCancelledMessage"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), a("div", { key: "1d5c50356fc2053a11a9caed28e527da6ddb3251", class: "nylas-cancelled-event-card__cta" }, a("sp-button", { key: "c5ea9f54908e3ff23ddd42076282aae9d5aa5c7a", variant: "secondary", treatment: "outline", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${l.t("closingButton")}...` : `${l.t("closeButton")}`)))));
|
|
441
443
|
}
|
|
442
444
|
};
|
|
443
|
-
|
|
444
|
-
|
|
445
|
+
_e([
|
|
446
|
+
w({
|
|
445
447
|
name: "nylas-cancelled-event-card",
|
|
446
448
|
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
447
449
|
eventToProps: {
|
|
448
450
|
closeCancelEventCardClicked: async (e, t) => {
|
|
449
|
-
const i = await t.scheduler.resetCancel(), { errorHandler:
|
|
450
|
-
|
|
451
|
+
const i = await t.scheduler.resetCancel(), { errorHandler: o } = e.detail;
|
|
452
|
+
o && (!i || "error" in i) && o(i);
|
|
451
453
|
}
|
|
452
454
|
},
|
|
453
455
|
fireRegisterEvent: !0
|
|
454
456
|
}),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
],
|
|
459
|
-
|
|
460
|
-
const P = /* @__PURE__ */ new Date(),
|
|
461
|
-
function
|
|
462
|
-
function
|
|
457
|
+
F("design:type", Function),
|
|
458
|
+
F("design:paramtypes", []),
|
|
459
|
+
F("design:returntype", void 0)
|
|
460
|
+
], te.prototype, "render", null);
|
|
461
|
+
te.style = we;
|
|
462
|
+
const P = /* @__PURE__ */ new Date(), M = /* @__PURE__ */ new Date();
|
|
463
|
+
function L(e, t, i, o) {
|
|
464
|
+
function s(n) {
|
|
463
465
|
return e(n = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+n)), n;
|
|
464
466
|
}
|
|
465
|
-
return
|
|
466
|
-
const r =
|
|
467
|
-
return n - r <
|
|
468
|
-
},
|
|
467
|
+
return s.floor = (n) => (e(n = /* @__PURE__ */ new Date(+n)), n), s.ceil = (n) => (e(n = new Date(n - 1)), t(n, 1), e(n), n), s.round = (n) => {
|
|
468
|
+
const r = s(n), c = s.ceil(n);
|
|
469
|
+
return n - r < c - n ? r : c;
|
|
470
|
+
}, s.offset = (n, r) => (t(n = /* @__PURE__ */ new Date(+n), r == null ? 1 : Math.floor(r)), n), s.range = (n, r, c) => {
|
|
469
471
|
const p = [];
|
|
470
|
-
if (n =
|
|
472
|
+
if (n = s.ceil(n), c = c == null ? 1 : Math.floor(c), !(n < r) || !(c > 0))
|
|
471
473
|
return p;
|
|
472
|
-
let
|
|
474
|
+
let u;
|
|
473
475
|
do
|
|
474
|
-
p.push(
|
|
475
|
-
while (
|
|
476
|
+
p.push(u = /* @__PURE__ */ new Date(+n)), t(n, c), e(n);
|
|
477
|
+
while (u < n && n < r);
|
|
476
478
|
return p;
|
|
477
|
-
},
|
|
479
|
+
}, s.filter = (n) => L((r) => {
|
|
478
480
|
if (r >= r)
|
|
479
481
|
for (; e(r), !n(r); )
|
|
480
482
|
r.setTime(r - 1);
|
|
481
|
-
}, (r,
|
|
483
|
+
}, (r, c) => {
|
|
482
484
|
if (r >= r)
|
|
483
|
-
if (
|
|
484
|
-
for (; ++
|
|
485
|
+
if (c < 0)
|
|
486
|
+
for (; ++c <= 0; )
|
|
485
487
|
for (; t(r, -1), !n(r); )
|
|
486
488
|
;
|
|
487
489
|
else
|
|
488
|
-
for (; --
|
|
490
|
+
for (; --c >= 0; )
|
|
489
491
|
for (; t(r, 1), !n(r); )
|
|
490
492
|
;
|
|
491
|
-
}), i && (
|
|
493
|
+
}), i && (s.count = (n, r) => (P.setTime(+n), M.setTime(+r), e(P), e(M), Math.floor(i(P, M))), s.every = (n) => (n = Math.floor(n), !isFinite(n) || !(n > 0) ? null : n > 1 ? s.filter(o ? (r) => o(r) % n === 0 : (r) => s.count(0, r) % n === 0) : s)), s;
|
|
492
494
|
}
|
|
493
|
-
const
|
|
495
|
+
const Ee = 1e3, ae = Ee * 60, Te = ae * 60, D = Te * 24, j = L(
|
|
494
496
|
(e) => e.setHours(0, 0, 0, 0),
|
|
495
497
|
(e, t) => e.setDate(e.getDate() + t),
|
|
496
|
-
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) *
|
|
498
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * ae) / D,
|
|
497
499
|
(e) => e.getDate() - 1
|
|
498
500
|
);
|
|
499
|
-
|
|
501
|
+
L((e) => {
|
|
500
502
|
e.setUTCHours(0, 0, 0, 0);
|
|
501
503
|
}, (e, t) => {
|
|
502
504
|
e.setUTCDate(e.getUTCDate() + t);
|
|
503
|
-
}, (e, t) => (t - e) /
|
|
504
|
-
|
|
505
|
+
}, (e, t) => (t - e) / D, (e) => e.getUTCDate() - 1);
|
|
506
|
+
L((e) => {
|
|
505
507
|
e.setUTCHours(0, 0, 0, 0);
|
|
506
508
|
}, (e, t) => {
|
|
507
509
|
e.setUTCDate(e.getUTCDate() + t);
|
|
508
|
-
}, (e, t) => (t - e) /
|
|
509
|
-
const
|
|
510
|
-
var
|
|
511
|
-
var
|
|
510
|
+
}, (e, t) => (t - e) / D, (e) => Math.floor(e / D));
|
|
511
|
+
const De = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', Le = De;
|
|
512
|
+
var Be = function(e, t, i, o) {
|
|
513
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
512
514
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
513
|
-
n = Reflect.decorate(e, t, i,
|
|
515
|
+
n = Reflect.decorate(e, t, i, o);
|
|
514
516
|
else
|
|
515
|
-
for (var
|
|
516
|
-
(r = e[
|
|
517
|
-
return
|
|
518
|
-
},
|
|
517
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
518
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
519
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
520
|
+
}, N = function(e, t) {
|
|
519
521
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
520
522
|
return Reflect.metadata(e, t);
|
|
521
523
|
};
|
|
522
|
-
const
|
|
524
|
+
const ne = class {
|
|
523
525
|
constructor(e) {
|
|
524
|
-
|
|
526
|
+
v(this, e), this.dateSelected = h(this, "dateSelected", 7), this.monthChanged = h(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = 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;
|
|
525
527
|
}
|
|
526
528
|
configSettingsChanged(e) {
|
|
527
|
-
var
|
|
528
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (
|
|
529
|
+
var s;
|
|
530
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.available_days_in_future;
|
|
529
531
|
if (i === void 0)
|
|
530
532
|
return;
|
|
531
|
-
|
|
533
|
+
W(/* @__PURE__ */ new Date(), i).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
534
|
+
}
|
|
535
|
+
selectedLanguageChanged(e) {
|
|
536
|
+
l.changeLanguage(e);
|
|
532
537
|
}
|
|
533
538
|
connectedCallback() {
|
|
534
539
|
}
|
|
@@ -537,84 +542,94 @@ const K = class {
|
|
|
537
542
|
componentWillLoad() {
|
|
538
543
|
}
|
|
539
544
|
getDates() {
|
|
540
|
-
const e =
|
|
545
|
+
const e = re(this.month), t = le(this.month);
|
|
541
546
|
return j.range(j.offset(t, -t.getDay()), j.offset(e, 7 - e.getDay()));
|
|
542
547
|
}
|
|
543
548
|
selectDate(e) {
|
|
544
549
|
this.dateSelected.emit(e);
|
|
545
550
|
}
|
|
546
551
|
changeMonth(e) {
|
|
547
|
-
var
|
|
552
|
+
var s, n;
|
|
548
553
|
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
549
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (n = (
|
|
550
|
-
|
|
554
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), i = (n = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : n.available_days_in_future;
|
|
555
|
+
W(/* @__PURE__ */ new Date(), i).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
551
556
|
}
|
|
552
557
|
isSelected(e, t, i) {
|
|
553
|
-
return e && t &&
|
|
558
|
+
return e && t && C(e, t) && i && (i == null ? void 0 : i.length) > 0;
|
|
554
559
|
}
|
|
555
560
|
isDisabled(e, t) {
|
|
556
|
-
return e && (t == null ? void 0 : t.find((i) =>
|
|
561
|
+
return e && (t == null ? void 0 : t.find((i) => C(i, e))) === void 0;
|
|
557
562
|
}
|
|
558
563
|
render() {
|
|
559
|
-
var e, t, i,
|
|
560
|
-
return a(
|
|
564
|
+
var e, t, i, o, s;
|
|
565
|
+
return a(y, { key: "b9352b7200decd122387246dfe84ffa03d8548f7", part: "ndp" }, a("div", { key: "f5e97afdd1f9e56323ec9a6f03c3d03f4f0b9752", class: "nylas-date-picker" }, a("div", { key: "f7b357631c4a8e49b5e2155744cc862c3f5686b2", class: "title", part: "'ndp__title" }, ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) && a("h1", null, a("person-icon", null), ((o = (i = this.configSettings) == null ? void 0 : i.organizer) == null ? void 0 : o.name) || "Organizer"), a("p", { key: "ccaeb9dcb6c26a8debdf1517e7f6c4a38535d7e8" }, a("clock-icon", { key: "00991681f820c8d9cb5aac8d3fffdefd84a7ff8c" }), this.eventDuration ? ce(this.eventDuration) : `- ${l.t("time.minutes")}`)), a("div", { key: "cf9d074f2616969892a4b1993bc812f3a88cc30e", class: "header flex-row" }, a("h2", { key: "e419a9019e07540c61d6348d83ffb1b18dc6ab49", part: "ndp__month-header" }, a("strong", { key: "0b579d2821c676edad234e89a0f76b2625506002" }, de(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), a("div", { key: "1c54a274075b10933e683b7c94def7b9a9c026bb", class: "pagination" }, a("button", { key: "77625a1039d9397d80d9223b9f70589cccd092e2", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((s = this.selectableDates) != null && s.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, a("chevron-icon", { key: "52723491a9e3ce61acb280aba55193c1ce11447f" })), a("button", { key: "71a728afda92fee35e1da058c0241f26f46cb837", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, a("chevron-icon", { key: "af862e5450421ae1be319f6a3a9b393cb08b3e5a" })))), a("div", { key: "4edef52ad8c2bd98fc1a249fe28a3029c4a290c9", class: "dates" }, [
|
|
566
|
+
l.t("days.sunday"),
|
|
567
|
+
l.t("days.monday"),
|
|
568
|
+
l.t("days.tuesday"),
|
|
569
|
+
l.t("days.wednesday"),
|
|
570
|
+
l.t("days.thursday"),
|
|
571
|
+
l.t("days.friday"),
|
|
572
|
+
l.t("days.saturday")
|
|
573
|
+
].map((n) => a("div", { class: "day", part: "ndp__day" }, n)), this.dates.map((n, r) => {
|
|
561
574
|
var p;
|
|
562
|
-
const
|
|
575
|
+
const c = this.isDisabled(n, this.selectableDates);
|
|
563
576
|
return this.isLoading ? a("button", { disabled: !0, class: {
|
|
564
577
|
"date day-skeleton": !0,
|
|
565
|
-
"current-month":
|
|
578
|
+
"current-month": B(n, this.month)
|
|
566
579
|
}, style: { animationDelay: `${r * 20}ms` }, part: "ndp__date" }, n.getDate()) : a("button", { class: {
|
|
567
580
|
date: !0,
|
|
568
|
-
selected: !!(this.selectedDate &&
|
|
569
|
-
"current-day":
|
|
570
|
-
"current-month":
|
|
571
|
-
}, "aria-lang": n.toLocaleDateString(void 0, { dateStyle: "full" }), disabled:
|
|
581
|
+
selected: !!(this.selectedDate && C(n, this.selectedDate) && this.selectableDates && ((p = this.selectableDates) == null ? void 0 : p.length) > 0),
|
|
582
|
+
"current-day": C(n, /* @__PURE__ */ new Date()),
|
|
583
|
+
"current-month": B(n, this.month)
|
|
584
|
+
}, "aria-lang": n.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: c, onClick: () => this.selectDate(n), part: `ndp__date ${this.isSelected(n, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${C(n, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${B(n, this.month) ? "ndp__date--current-month" : ""}` }, n.getDate());
|
|
572
585
|
}))));
|
|
573
586
|
}
|
|
574
587
|
static get watchers() {
|
|
575
588
|
return {
|
|
576
|
-
configSettings: ["configSettingsChanged"]
|
|
589
|
+
configSettings: ["configSettingsChanged"],
|
|
590
|
+
selectedLanguage: ["selectedLanguageChanged"]
|
|
577
591
|
};
|
|
578
592
|
}
|
|
579
593
|
};
|
|
580
|
-
|
|
581
|
-
|
|
594
|
+
Be([
|
|
595
|
+
w({
|
|
582
596
|
name: "nylas-date-picker",
|
|
583
597
|
stateToProps: /* @__PURE__ */ new Map([
|
|
584
598
|
["scheduler.selectableDates", "selectableDates"],
|
|
585
599
|
["scheduler.selectedDate", "selectedDate"],
|
|
586
600
|
["scheduler.isLoading", "isLoading"],
|
|
587
601
|
["scheduler.configSettings", "configSettings"],
|
|
588
|
-
["scheduler.eventDuration", "eventDuration"]
|
|
602
|
+
["scheduler.eventDuration", "eventDuration"],
|
|
603
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
589
604
|
]),
|
|
590
605
|
eventToProps: {
|
|
591
606
|
dateSelected: async (e, t) => {
|
|
592
|
-
t.scheduler.selectDate(e.detail);
|
|
607
|
+
d("nylas-date-picker", "dateSelected", e.detail), t.scheduler.selectDate(e.detail);
|
|
593
608
|
}
|
|
594
609
|
},
|
|
595
610
|
fireRegisterEvent: !0
|
|
596
611
|
}),
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
],
|
|
601
|
-
|
|
602
|
-
const
|
|
603
|
-
var
|
|
604
|
-
var
|
|
612
|
+
N("design:type", Function),
|
|
613
|
+
N("design:paramtypes", []),
|
|
614
|
+
N("design:returntype", void 0)
|
|
615
|
+
], ne.prototype, "render", null);
|
|
616
|
+
ne.style = Le;
|
|
617
|
+
const Se = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;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}', ze = Se;
|
|
618
|
+
var Ie = function(e, t, i, o) {
|
|
619
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
605
620
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
606
|
-
n = Reflect.decorate(e, t, i,
|
|
621
|
+
n = Reflect.decorate(e, t, i, o);
|
|
607
622
|
else
|
|
608
|
-
for (var
|
|
609
|
-
(r = e[
|
|
610
|
-
return
|
|
611
|
-
},
|
|
623
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
624
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
625
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
626
|
+
}, O = function(e, t) {
|
|
612
627
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
613
628
|
return Reflect.metadata(e, t);
|
|
614
629
|
};
|
|
615
|
-
const
|
|
630
|
+
const ie = class {
|
|
616
631
|
constructor(e) {
|
|
617
|
-
|
|
632
|
+
v(this, e), this.timezoneChanged = h(this, "timezoneChanged", 7), this.languageChanged = h(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
618
633
|
}
|
|
619
634
|
connectedCallback() {
|
|
620
635
|
}
|
|
@@ -633,38 +648,38 @@ const Q = class {
|
|
|
633
648
|
t === "timezone" ? this.changeTimezone(i) : t === "language" && this.changeLanguage(i);
|
|
634
649
|
}
|
|
635
650
|
getTimezoneLabelHTML(e) {
|
|
636
|
-
const t =
|
|
651
|
+
const t = be(e);
|
|
637
652
|
return a("span", { class: "timezone-label", style: {
|
|
638
653
|
display: "flex",
|
|
639
654
|
alignItems: "center",
|
|
640
655
|
justifyContent: "space-between",
|
|
641
656
|
width: "-webkit-fill-available"
|
|
642
|
-
} },
|
|
657
|
+
} }, E[e], " ", a("span", { class: "timezone-offset", style: {
|
|
643
658
|
fontSize: "14px",
|
|
644
659
|
fontWeight: "400",
|
|
645
660
|
color: "var(--nylas-base-500)"
|
|
646
661
|
} }, t));
|
|
647
662
|
}
|
|
648
663
|
render() {
|
|
649
|
-
const e = Object.keys(
|
|
664
|
+
const e = Object.keys(E).map((i) => ({
|
|
650
665
|
labelHTML: this.getTimezoneLabelHTML(i),
|
|
651
|
-
label:
|
|
666
|
+
label: E[i],
|
|
652
667
|
value: i
|
|
653
|
-
})), t = Object.keys(
|
|
654
|
-
label:
|
|
668
|
+
})), t = Object.keys(U).map((i) => ({
|
|
669
|
+
label: U[i],
|
|
655
670
|
value: i
|
|
656
671
|
}));
|
|
657
|
-
return a(
|
|
672
|
+
return a(y, { key: "8f8d20420b4bc34e48cd48b2f78f66bc01bae8f8" }, a("div", { key: "bb24d8978ae671cac3b063ace059da9932e638cd", class: "nylas-locale-switch" }, a("div", { key: "4c93f5c209c64e573f1eebdef7c6a9dea1049a08", class: {
|
|
658
673
|
"select-wrapper": !0,
|
|
659
674
|
timezone: !0
|
|
660
|
-
} }, a("select-dropdown", { key: "
|
|
675
|
+
} }, a("select-dropdown", { key: "6dc7c793fbf3d8a3724f957dd0a3512034ec9689", name: "timezone", options: e, defaultSelectedOption: e.find((i) => i.value == this.selectedTimezone) }, a("span", { key: "afbd26c2bd09b94220801c575152773c4ba37c06", slot: "select-icon" }, a("globe-icon", { key: "5ca8b25e1cd2f21445c4431aa5dd3cafda67a5ce", width: "20", height: "20" })))), a("div", { key: "a4171de1a022cfdfd722acf37eff0fb6cf1e876a", class: {
|
|
661
676
|
"select-wrapper": !0,
|
|
662
677
|
language: !0
|
|
663
|
-
} }, a("select-dropdown", { key: "
|
|
678
|
+
} }, a("select-dropdown", { key: "9c3a988489bf572d267a920eb7fbd5cda7401c66", name: "language", options: t, defaultSelectedOption: t.find((i) => i.value == this.selectedLanguage) }, a("span", { key: "45b3b18c932b6a42f927dc769b0eba5327ddc639", slot: "select-icon" }, a("translate-icon", { key: "6081367bbd4d711fdd79418a14921924358f3b2a", width: "20", height: "20" }))))));
|
|
664
679
|
}
|
|
665
680
|
};
|
|
666
|
-
|
|
667
|
-
|
|
681
|
+
Ie([
|
|
682
|
+
w({
|
|
668
683
|
name: "nylas-locale-switch",
|
|
669
684
|
stateToProps: /* @__PURE__ */ new Map([
|
|
670
685
|
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
@@ -673,84 +688,104 @@ De([
|
|
|
673
688
|
eventToProps: {
|
|
674
689
|
timezoneChanged: async (e, t) => {
|
|
675
690
|
t.scheduler.selectTimezone(e.detail);
|
|
691
|
+
},
|
|
692
|
+
languageChanged: async (e, t) => {
|
|
693
|
+
t.scheduler.selectLanguage(e.detail);
|
|
676
694
|
}
|
|
677
695
|
},
|
|
678
696
|
fireRegisterEvent: !0
|
|
679
697
|
}),
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
],
|
|
684
|
-
|
|
685
|
-
const
|
|
698
|
+
O("design:type", Function),
|
|
699
|
+
O("design:paramtypes", []),
|
|
700
|
+
O("design:returntype", void 0)
|
|
701
|
+
], ie.prototype, "render", null);
|
|
702
|
+
ie.style = ze;
|
|
703
|
+
const Re = ".sc-nylas-logo-h{display:flex}", Fe = Re, Pe = class {
|
|
686
704
|
constructor(e) {
|
|
687
|
-
|
|
705
|
+
v(this, e), this.width = "69", this.height = "24";
|
|
688
706
|
}
|
|
689
707
|
render() {
|
|
690
|
-
return a("svg", { key: "
|
|
708
|
+
return a("svg", { key: "d94208aba4b4b420ac701a1604ed632e6732b579", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("g", { key: "9949b845be600b88ced63927410620e3a7e8c451", "clip-path": "url(#clip0_455_3543)" }, a("path", { key: "005f15418d0615e1169778bdeb92909d2b730dcd", 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" }), a("path", { key: "70646aa8a47a9a5d38cf1e5e658e1c89ddbd31e4", 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" }), a("path", { key: "006521383f94e611566911192a2afa7a5c20f878", 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" }), a("path", { key: "ad51835222b7ea130aa405e800a2b54a562d0c59", 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" }), a("path", { key: "1e908974d30f1799651c288bd6c3833ed03de72e", 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" }), a("path", { key: "5e8bc1a09662dc361bc72da2fb8220f340b09354", 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" }), a("path", { key: "5053aafa53fb73f356492a871f2e880c877bb832", 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" }), a("path", { key: "dbd9ac30c3dc491457f2219a30a5dd0975914b90", 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" })), a("defs", { key: "48f1a43d1ae03bd6dabdc1245f439416a45a74bc" }, a("clipPath", { key: "79baeef53cf45d73f29b1757bf57f0b09fef2064", id: "clip0_455_3543" }, a("rect", { key: "6ed7056ab99c55ebad6e736b712d68b837706ad3", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
691
709
|
}
|
|
692
710
|
};
|
|
693
|
-
|
|
694
|
-
const
|
|
711
|
+
Pe.style = Fe;
|
|
712
|
+
const Me = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', je = Me, Ne = class {
|
|
695
713
|
constructor(e) {
|
|
696
|
-
|
|
714
|
+
v(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
697
715
|
}
|
|
698
716
|
onError(e) {
|
|
699
|
-
d(`[nylas-notification] Error: ${e.detail.title}`), this.handleNotification(e);
|
|
717
|
+
d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
700
718
|
}
|
|
701
719
|
onWarning(e) {
|
|
702
|
-
d(`[nylas-notification] Warning: ${e.detail.title}`), this.handleNotification(e);
|
|
720
|
+
d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
703
721
|
}
|
|
704
722
|
onInfo(e) {
|
|
705
|
-
d(`[nylas-notification] Info: ${e.detail.title}`), this.handleNotification(e);
|
|
723
|
+
d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
706
724
|
}
|
|
707
725
|
onSuccess(e) {
|
|
708
|
-
d(`[nylas-notification] Success: ${e.detail.title}`), this.handleNotification(e);
|
|
726
|
+
d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
727
|
+
}
|
|
728
|
+
isChildOf(e) {
|
|
729
|
+
let t = this.host.parentNode;
|
|
730
|
+
for (; t; ) {
|
|
731
|
+
if (t === e)
|
|
732
|
+
return !0;
|
|
733
|
+
t instanceof ShadowRoot ? t = t.host : t = t.parentNode;
|
|
734
|
+
}
|
|
735
|
+
return !1;
|
|
709
736
|
}
|
|
710
737
|
handleNotification(e) {
|
|
738
|
+
const t = e.detail.host;
|
|
711
739
|
if (e.defaultPrevented) {
|
|
712
740
|
d("[nylas-notification] Event default prevented");
|
|
713
741
|
return;
|
|
714
742
|
}
|
|
743
|
+
if (t && !this.isChildOf(t)) {
|
|
744
|
+
d("[nylas-notification] Host not a parent");
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
715
747
|
if (this.ttl === 0) {
|
|
716
748
|
d("[nylas-notification] TTL is 0");
|
|
717
749
|
return;
|
|
718
750
|
}
|
|
719
|
-
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.category)) {
|
|
751
|
+
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
|
|
720
752
|
d("[nylas-notification] Category not allowed");
|
|
721
753
|
return;
|
|
722
754
|
}
|
|
723
|
-
if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
|
|
724
|
-
const
|
|
755
|
+
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
756
|
+
const i = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
725
757
|
window.setTimeout(() => {
|
|
726
|
-
this.notifications = this.notifications.filter((
|
|
727
|
-
},
|
|
758
|
+
this.notifications = this.notifications.filter((o) => o.id !== e.detail.notification.id);
|
|
759
|
+
}, i);
|
|
728
760
|
}
|
|
729
761
|
}
|
|
730
762
|
dismissNotification(e) {
|
|
731
763
|
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
732
764
|
}
|
|
733
765
|
render() {
|
|
734
|
-
return a(
|
|
766
|
+
return a(y, { key: "ee48c545da38b0e35683c6e10db257a32768ab40" }, a(fe, { key: "9be932f6b0cd05dcf8fd459221f5b422524e737c" }, this.notifications.map((e) => a("div", { class: `notif ${e.type}`, key: e.id }, a("div", { class: "content" }, a("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && a("warning-icon", null)), a("span", { class: "message" }, a("span", { class: "title" }, e.title), e.description && a("span", { class: "description" }, e.description))), a("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, a("close-icon", null)))), a("slot", { key: "637bdccb78964fd1f60c7a6f0177cc62af5c9750" })));
|
|
767
|
+
}
|
|
768
|
+
get host() {
|
|
769
|
+
return X(this);
|
|
735
770
|
}
|
|
736
771
|
};
|
|
737
|
-
|
|
738
|
-
const
|
|
739
|
-
var
|
|
740
|
-
var
|
|
772
|
+
Ne.style = je;
|
|
773
|
+
const Oe = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", $e = Oe;
|
|
774
|
+
var He = function(e, t, i, o) {
|
|
775
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
741
776
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
742
|
-
n = Reflect.decorate(e, t, i,
|
|
777
|
+
n = Reflect.decorate(e, t, i, o);
|
|
743
778
|
else
|
|
744
|
-
for (var
|
|
745
|
-
(r = e[
|
|
746
|
-
return
|
|
747
|
-
},
|
|
779
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
780
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
781
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
782
|
+
}, $ = function(e, t) {
|
|
748
783
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
749
784
|
return Reflect.metadata(e, t);
|
|
750
785
|
};
|
|
751
|
-
const
|
|
786
|
+
const oe = class {
|
|
752
787
|
constructor(e) {
|
|
753
|
-
|
|
788
|
+
v(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.startTime = "", this.endTime = "";
|
|
754
789
|
}
|
|
755
790
|
connectedCallback() {
|
|
756
791
|
}
|
|
@@ -767,7 +802,7 @@ const ee = class {
|
|
|
767
802
|
}
|
|
768
803
|
render() {
|
|
769
804
|
var e;
|
|
770
|
-
return a(
|
|
805
|
+
return a(y, { key: "55ab9cebd5baeac59dba0ec7fe3509cd0ef40ce7", part: "nsec" }, a("sp-theme", { key: "e15dcd0501f243dcad1541ede4d536081d92c3b1", theme: "spectrum", color: "dark", scale: "medium" }, a("div", { key: "0a4350fd792aeee0b8d3b89c44dd609ef59ac122", class: "event-card", part: "nsec__card" }, a("div", { key: "612c20fe95645bc37a23b10b70709e17809add79", class: "calendar-icon", part: "nsec__icon" }, a("calendar-icon", { key: "a10a8a934b5a7fd105a92dc28019901f2feca428" })), a("div", { key: "77c8c0bcedc344699301068bc84ae332f260a4ed", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? Y((e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(J[this.selectedLanguage || navigator.language], { dateStyle: "full" })) : "-"), a("div", { key: "a2c12447ce3b6516dd88779a2817b0296b9f2834", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), a("div", { key: "ac22403e4e8ba6db1e434f49d5970abbcc774cf9", class: "event-timezone", part: "nsec__timezone" }, a("globe-icon", { key: "81651ea2aa387979eca6669e66cf550a2c91a20b" }), E[this.selectedTimezone])));
|
|
771
806
|
}
|
|
772
807
|
static get watchers() {
|
|
773
808
|
return {
|
|
@@ -775,44 +810,61 @@ const ee = class {
|
|
|
775
810
|
};
|
|
776
811
|
}
|
|
777
812
|
};
|
|
778
|
-
|
|
779
|
-
|
|
813
|
+
He([
|
|
814
|
+
w({
|
|
780
815
|
name: "nylas-selected-event-card",
|
|
781
816
|
stateToProps: /* @__PURE__ */ new Map([
|
|
782
817
|
["scheduler.selectedDate", "selectedDate"],
|
|
783
818
|
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
784
|
-
["scheduler.selectedTimezone", "selectedTimezone"]
|
|
819
|
+
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
820
|
+
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
785
821
|
]),
|
|
786
822
|
eventToProps: {},
|
|
787
823
|
fireRegisterEvent: !0
|
|
788
824
|
}),
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
],
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
var
|
|
796
|
-
var
|
|
825
|
+
$("design:type", Function),
|
|
826
|
+
$("design:paramtypes", []),
|
|
827
|
+
$("design:returntype", void 0)
|
|
828
|
+
], oe.prototype, "render", null);
|
|
829
|
+
oe.style = $e;
|
|
830
|
+
const qe = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Ae = qe;
|
|
831
|
+
var Ze = function(e, t, i, o) {
|
|
832
|
+
var s = arguments.length, n = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, i) : o, r;
|
|
797
833
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
798
|
-
n = Reflect.decorate(e, t, i,
|
|
834
|
+
n = Reflect.decorate(e, t, i, o);
|
|
799
835
|
else
|
|
800
|
-
for (var
|
|
801
|
-
(r = e[
|
|
802
|
-
return
|
|
836
|
+
for (var c = e.length - 1; c >= 0; c--)
|
|
837
|
+
(r = e[c]) && (n = (s < 3 ? r(n) : s > 3 ? r(t, i, n) : r(t, i)) || n);
|
|
838
|
+
return s > 3 && n && Object.defineProperty(t, i, n), n;
|
|
803
839
|
}, H = function(e, t) {
|
|
804
840
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
805
841
|
return Reflect.metadata(e, t);
|
|
806
842
|
};
|
|
807
|
-
const
|
|
843
|
+
const se = class {
|
|
808
844
|
constructor(e) {
|
|
809
|
-
|
|
845
|
+
v(this, e), this.timeslotSelected = h(this, "timeslotSelected", 7), this.timeslotConfirmed = h(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, i) => {
|
|
810
846
|
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", i), this.timeslotConfirmed.emit(i);
|
|
811
847
|
}, this.handleMouseEnter = (t) => {
|
|
812
848
|
this.hoveredTimeslotIndex = t;
|
|
813
849
|
}, this.handleMouseLeave = () => {
|
|
814
850
|
this.hoveredTimeslotIndex = -1;
|
|
815
|
-
}, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
851
|
+
}, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
852
|
+
}
|
|
853
|
+
selectedLanguageChanged(e) {
|
|
854
|
+
l.changeLanguage(e);
|
|
855
|
+
}
|
|
856
|
+
selectedDateChanged(e) {
|
|
857
|
+
var t;
|
|
858
|
+
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
859
|
+
const i = (t = this.availability) == null ? void 0 : t.filter((o) => C(o.start_time, e)).map((o) => o);
|
|
860
|
+
this.times = i || [];
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
availabilityChanged(e) {
|
|
864
|
+
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
865
|
+
const t = e == null ? void 0 : e.filter((i) => this.selectedDate && C(i.start_time, this.selectedDate)).map((i) => i);
|
|
866
|
+
this.times = t || [];
|
|
867
|
+
}
|
|
816
868
|
}
|
|
817
869
|
connectedCallback() {
|
|
818
870
|
}
|
|
@@ -820,7 +872,7 @@ const te = class {
|
|
|
820
872
|
}
|
|
821
873
|
async componentWillLoad() {
|
|
822
874
|
var t;
|
|
823
|
-
const e = (t = this.availability) == null ? void 0 : t.filter((i) => this.selectedDate &&
|
|
875
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((i) => this.selectedDate && C(i.start_time, this.selectedDate)).map((i) => i);
|
|
824
876
|
this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
825
877
|
}
|
|
826
878
|
async componentDidLoad() {
|
|
@@ -844,43 +896,32 @@ const te = class {
|
|
|
844
896
|
});
|
|
845
897
|
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
846
898
|
}
|
|
847
|
-
selectedDateChanged(e) {
|
|
848
|
-
var t;
|
|
849
|
-
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
850
|
-
const i = (t = this.availability) == null ? void 0 : t.filter((s) => x(s.start_time, e)).map((s) => s);
|
|
851
|
-
this.times = i || [];
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
availabilityChanged(e) {
|
|
855
|
-
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
856
|
-
const t = e == null ? void 0 : e.filter((i) => this.selectedDate && x(i.start_time, this.selectedDate)).map((i) => i);
|
|
857
|
-
this.times = t || [];
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
899
|
render() {
|
|
861
|
-
return this.isLoading ? a(
|
|
862
|
-
var i,
|
|
863
|
-
return a("button", { part: `ntp__timeslot ${((
|
|
900
|
+
return this.isLoading ? a(y, null, a("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => a("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? a(y, null, a("div", { class: "empty" }, a("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? a(y, null, a("div", { class: "empty" }, a("span", null, "No time slots available for selected date"))) : this.selectedDate ? a(y, { part: "ntp" }, a("div", { class: "time-picker-wrapper" }, a("div", { class: "timeslots" }, this.times.map((e, t) => {
|
|
901
|
+
var i, o, s, n;
|
|
902
|
+
return a("button", { part: `ntp__timeslot ${((o = (i = this.selectedTimeslot) == null ? void 0 : i.start_time) == null ? void 0 : o.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
864
903
|
time: !0,
|
|
865
|
-
selected: typeof this.selectedTimeslot < "u" && ((n = (
|
|
904
|
+
selected: typeof this.selectedTimeslot < "u" && ((n = (s = this.selectedTimeslot) == null ? void 0 : s.start_time) == null ? void 0 : n.getTime()) === e.start_time.getTime()
|
|
866
905
|
}, onClick: () => this.onClickSelectTime(e, t), onMouseEnter: () => this.handleMouseEnter(t), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == t || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, t) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
|
|
867
|
-
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, "
|
|
906
|
+
})), this.selectedTimeslot && a("div", { class: "footer" }, a("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, a("slot", { name: "timeslot-picker-cta-label" }, l.t("nextButton")), " ")))) : a(y, null);
|
|
868
907
|
}
|
|
869
908
|
static get watchers() {
|
|
870
909
|
return {
|
|
910
|
+
selectedLanguage: ["selectedLanguageChanged"],
|
|
871
911
|
selectedDate: ["selectedDateChanged"],
|
|
872
912
|
availability: ["availabilityChanged"]
|
|
873
913
|
};
|
|
874
914
|
}
|
|
875
915
|
};
|
|
876
|
-
|
|
877
|
-
|
|
916
|
+
Ze([
|
|
917
|
+
w({
|
|
878
918
|
name: "nylas-timeslot-picker",
|
|
879
919
|
stateToProps: /* @__PURE__ */ new Map([
|
|
880
920
|
["scheduler.selectedDate", "selectedDate"],
|
|
881
921
|
["scheduler.availability", "availability"],
|
|
882
922
|
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
883
923
|
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
924
|
+
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
884
925
|
["scheduler.isLoading", "isLoading"]
|
|
885
926
|
]),
|
|
886
927
|
eventToProps: {
|
|
@@ -896,17 +937,17 @@ Oe([
|
|
|
896
937
|
H("design:type", Function),
|
|
897
938
|
H("design:paramtypes", []),
|
|
898
939
|
H("design:returntype", void 0)
|
|
899
|
-
],
|
|
900
|
-
|
|
940
|
+
], se.prototype, "render", null);
|
|
941
|
+
se.style = Ae;
|
|
901
942
|
export {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
943
|
+
K as nylas_booked_event_card,
|
|
944
|
+
Q as nylas_booking_form,
|
|
945
|
+
ee as nylas_cancel_booking_form,
|
|
946
|
+
te as nylas_cancelled_event_card,
|
|
947
|
+
ne as nylas_date_picker,
|
|
948
|
+
ie as nylas_locale_switch,
|
|
949
|
+
Pe as nylas_logo,
|
|
950
|
+
Ne as nylas_notification,
|
|
951
|
+
oe as nylas_selected_event_card,
|
|
952
|
+
se as nylas_timeslot_picker
|
|
912
953
|
};
|