@nylas/react 1.3.5 → 1.4.0
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-6e8e4e1e.cjs +1 -0
- package/dist/add-circle-icon_2.entry-dbad9a3b.js +26 -0
- package/dist/archive-icon.entry-21f532af.cjs +1 -0
- package/dist/archive-icon.entry-802f7877.js +16 -0
- package/dist/{arrow-icon.entry-fa9584cf.js → arrow-icon.entry-e3dec626.js} +3 -2
- package/dist/arrow-icon.entry-e9af732a.cjs +1 -0
- package/dist/{bold-icon.entry-ac6a4956.js → bold-icon.entry-0492ff02.js} +3 -2
- package/dist/bold-icon.entry-1a2be28a.cjs +1 -0
- package/dist/button-component_2.entry-f0c7f894.cjs +1 -0
- package/dist/{button-component_2.entry-caf33abf.js → button-component_2.entry-fea9bd3d.js} +10 -9
- package/dist/calendar-agenda-fill-icon_36.entry-70681da2.cjs +6 -0
- package/dist/calendar-agenda-fill-icon_36.entry-c85d6a79.js +4642 -0
- package/dist/calendar-cancel-icon.entry-237b8c9e.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-02015d74.js → calendar-cancel-icon.entry-e7dd5b8f.js} +6 -5
- package/dist/calendar-check-icon_2.entry-a868e0bc.cjs +1 -0
- package/dist/{calendar-check-icon_2.entry-2f7dc236.js → calendar-check-icon_2.entry-c7f47fc8.js} +10 -9
- package/dist/calendar-icon.entry-071eb30d.cjs +1 -0
- package/dist/{calendar-icon.entry-70ac9bd6.js → calendar-icon.entry-324de624.js} +6 -5
- package/dist/checkbox-component.entry-0f9970cc.js +43 -0
- package/dist/checkbox-component.entry-5bcf4b08.cjs +1 -0
- package/dist/checkmark-icon_15.entry-7776e533.cjs +5 -0
- package/dist/checkmark-icon_15.entry-98377585.js +1337 -0
- package/dist/chevron-icon_3.entry-526b4b85.cjs +1 -0
- package/dist/chevron-icon_3.entry-ec66260c.js +148 -0
- package/dist/{clock-icon_4.entry-af5301d7.js → clock-icon_4.entry-4fa47996.js} +19 -18
- package/dist/clock-icon_4.entry-66d15f7c.cjs +1 -0
- package/dist/{constants-f6e79ab7-24392f9e.js → constants-f5ba52b9-40ab2ded.js} +121 -30
- package/dist/constants-f5ba52b9-a0866d2f.cjs +1 -0
- package/dist/customParseFormat-39eacb44-45ade322.cjs +1 -0
- package/dist/customParseFormat-39eacb44-eeffe2bb.js +135 -0
- package/dist/delete-icon.entry-540aa2bb.cjs +1 -0
- package/dist/{delete-icon.entry-00cb3ee8.js → delete-icon.entry-95d01eb8.js} +7 -6
- package/dist/document-refresh-icon.entry-b82d5da8.js +16 -0
- package/dist/document-refresh-icon.entry-c467f082.cjs +1 -0
- package/dist/elements/index.d.ts +11 -0
- package/dist/{feedbackSync-547e51ee-bcaf691c.js → feedbackSync-47d13bb0-5608d680.js} +1 -1
- package/dist/{feedbackSync-547e51ee-9b572309.cjs → feedbackSync-47d13bb0-9f249f33.cjs} +1 -1
- package/dist/folder-icon.entry-4d48c2ee.cjs +1 -0
- package/dist/{folder-icon.entry-60b3eda5.js → folder-icon.entry-cb0dc63d.js} +5 -4
- package/dist/forward-icon.entry-5aa01f53.js +16 -0
- package/dist/forward-icon.entry-d04aaf6d.cjs +1 -0
- package/dist/globe-icon_2.entry-87e29cdf.cjs +1 -0
- package/dist/globe-icon_2.entry-c7ae78cc.js +200 -0
- package/dist/google-logo-icon_6.entry-80a6bfa3.js +1457 -0
- package/dist/google-logo-icon_6.entry-a8b6efc0.cjs +2 -0
- package/dist/google-meet-icon_5.entry-26d667b6.cjs +1 -0
- package/dist/google-meet-icon_5.entry-4e71c83b.js +56 -0
- package/dist/inbox-icon.entry-60a82bfc.cjs +1 -0
- package/dist/inbox-icon.entry-77e4e17b.js +16 -0
- package/dist/index-04630615.js +17580 -0
- package/dist/index-3d1f13d6.cjs +57 -0
- package/dist/index.d.ts +1 -3
- package/dist/{index.es-2d849a15-2d84f7a5.cjs → index.es-1fdb1e36-830a422f.cjs} +6 -6
- package/dist/{index.es-2d849a15-4eb8e180.js → index.es-1fdb1e36-fbdb04fa.js} +818 -804
- package/dist/info-icon_2.entry-34800b66.cjs +1 -0
- package/dist/info-icon_2.entry-3c483f61.js +35 -0
- package/dist/input-component.entry-ea4016fe.js +84 -0
- package/dist/input-component.entry-f7ccf3d6.cjs +1 -0
- package/dist/input-dropdown_2.entry-c7730cf8.js +231 -0
- package/dist/input-dropdown_2.entry-d4024d2f.cjs +1 -0
- package/dist/italic-icon.entry-6e0805ab.js +16 -0
- package/dist/italic-icon.entry-8127c2ee.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-49d6f0e7.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-d749999d.js +187 -0
- package/dist/notebook-store-b61693cd-7a5576e7.js +14 -0
- package/dist/notebook-store-b61693cd-84de36d2.cjs +5 -0
- package/dist/nylas-booked-event-card_12.entry-29337b10.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-3fcfd6f9.js +1418 -0
- package/dist/nylas-call-summary.entry-38aed89a.js +16 -0
- package/dist/nylas-call-summary.entry-e9adcb93.cjs +1 -0
- package/dist/nylas-event-calendar_3.entry-48f656e5.cjs +6 -0
- package/dist/nylas-event-calendar_3.entry-62d1f1f5.js +9693 -0
- package/dist/nylas-form-card.entry-3828ccb1.js +58 -0
- package/dist/nylas-form-card.entry-b900b46e.cjs +1 -0
- package/dist/{nylas-if-state.entry-beef8af6.js → nylas-if-state.entry-2810dcf5.js} +4 -3
- package/dist/nylas-if-state.entry-92af0a51.cjs +1 -0
- package/dist/nylas-key-points.entry-977a6fae.js +29 -0
- package/dist/nylas-key-points.entry-de658637.cjs +1 -0
- package/dist/nylas-login.entry-4a6c11e6.cjs +1 -0
- package/dist/{nylas-login.entry-1661cbd4.js → nylas-login.entry-8101d3d0.js} +4 -3
- package/dist/nylas-provider.entry-b7ac25f5.cjs +1 -0
- package/dist/{nylas-provider.entry-1f140378.js → nylas-provider.entry-c054d68a.js} +6 -5
- package/dist/nylas-scheduler-editor.entry-1538950d.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-f184f72e.js → nylas-scheduler-editor.entry-e35fad5c.js} +530 -272
- package/dist/nylas-scheduling.entry-360b978c.js +439 -0
- package/dist/nylas-scheduling.entry-92351cd2.cjs +1 -0
- package/dist/nylas-transcript.entry-4d973027.cjs +6 -0
- package/dist/nylas-transcript.entry-81e2c821.js +128 -0
- package/dist/nylas-video-player.entry-60268c07.js +39 -0
- package/dist/nylas-video-player.entry-f3c2b073.cjs +1 -0
- package/dist/nylas-video-preview.entry-12e05e4d.cjs +1 -0
- package/dist/nylas-video-preview.entry-320421b6.js +16 -0
- package/dist/{person-icon.entry-f9ca9147.js → person-icon.entry-8533209c.js} +8 -7
- package/dist/person-icon.entry-967ad730.cjs +1 -0
- package/dist/play-icon.entry-15ee8568.js +16 -0
- package/dist/play-icon.entry-7b1fd79d.cjs +1 -0
- package/dist/radio-button-group.entry-24cb342f.cjs +1 -0
- package/dist/radio-button-group.entry-53dcf16c.js +47 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +133 -123
- package/dist/refresh-icon.entry-0486ae54.cjs +1 -0
- package/dist/{refresh-icon.entry-7886041f.js → refresh-icon.entry-f3320971.js} +7 -6
- package/dist/{register-component-677d8d2b-0113766e.js → register-component-504a1cbb-5f986d7f.js} +1 -1
- package/dist/{register-component-677d8d2b-4738af1d.cjs → register-component-504a1cbb-89124fd8.cjs} +1 -1
- package/dist/{reply-all-icon.entry-fdd0058e.js → reply-all-icon.entry-006fd1fb.js} +6 -5
- package/dist/reply-all-icon.entry-2cea1a40.cjs +1 -0
- package/dist/reply-icon.entry-bd252aed.cjs +1 -0
- package/dist/reply-icon.entry-d27166a1.js +16 -0
- package/dist/scheduler-config-store-d6729d8d-4a2defea.cjs +1 -0
- package/dist/{scheduler-config-store-ed4a8dfd-012dcf85.js → scheduler-config-store-d6729d8d-63e34849.js} +4 -1
- package/dist/scheduler-store-baf100ed-5c5d3aa5.cjs +1 -0
- package/dist/scheduler-store-baf100ed-81b183dc.js +533 -0
- package/dist/sent-icon.entry-bf101068.js +16 -0
- package/dist/sent-icon.entry-ee434395.cjs +1 -0
- package/dist/spam-icon.entry-11016b63.cjs +1 -0
- package/dist/spam-icon.entry-5193f9c6.js +16 -0
- package/dist/star-icon.entry-0e269252.cjs +1 -0
- package/dist/{star-icon.entry-501083c1.js → star-icon.entry-9c7449f3.js} +6 -5
- package/dist/stop-icon.entry-2ac11166.js +16 -0
- package/dist/stop-icon.entry-86412c9f.cjs +1 -0
- package/dist/textarea-component.entry-27717409.cjs +1 -0
- package/dist/textarea-component.entry-9df3fa96.js +39 -0
- package/dist/toggle-switch.entry-9623e2b2.cjs +1 -0
- package/dist/toggle-switch.entry-a5ddfad9.js +34 -0
- package/dist/translate-icon.entry-e0617680.cjs +1 -0
- package/dist/{translate-icon.entry-676a4150.js → translate-icon.entry-f22293e6.js} +5 -4
- package/dist/trash-fill-icon.entry-0275f657.cjs +1 -0
- package/dist/trash-fill-icon.entry-2616c5df.js +16 -0
- package/dist/{underline-icon.entry-3513c5ef.js → underline-icon.entry-1110dcb1.js} +5 -4
- package/dist/underline-icon.entry-d54b06ab.cjs +1 -0
- package/dist/warning-icon.entry-6d390ab7.cjs +1 -0
- package/dist/{warning-icon.entry-6e723597.js → warning-icon.entry-9a6e7913.js} +8 -7
- package/package.json +11 -3
- package/dist/add-circle-icon.entry-00c87903.js +0 -15
- package/dist/add-circle-icon.entry-640d2b46.cjs +0 -1
- package/dist/archive-icon.entry-5b209336.cjs +0 -1
- package/dist/archive-icon.entry-e8a39eda.js +0 -15
- package/dist/arrow-icon.entry-a25b7b7e.cjs +0 -1
- package/dist/bold-icon.entry-d837c73d.cjs +0 -1
- package/dist/button-component_2.entry-1471422a.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_53.entry-094bd4b9.cjs +0 -6
- package/dist/calendar-agenda-fill-icon_53.entry-6d7f9c79.js +0 -5757
- package/dist/calendar-cancel-icon.entry-42d3d226.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-45aacd91.cjs +0 -1
- package/dist/calendar-icon.entry-90d67b03.cjs +0 -1
- package/dist/checkbox-component_3.entry-231b2254.cjs +0 -1
- package/dist/checkbox-component_3.entry-7270533c.js +0 -153
- package/dist/chevron-icon_3.entry-3c95cc88.js +0 -147
- package/dist/chevron-icon_3.entry-ead3d4c8.cjs +0 -1
- package/dist/clock-icon_4.entry-b50cce70.cjs +0 -1
- package/dist/close-icon.entry-04008446.cjs +0 -1
- package/dist/close-icon.entry-0a4105c9.js +0 -15
- package/dist/constants-f6e79ab7-23d7236b.cjs +0 -1
- package/dist/copy-icon.entry-312ff230.js +0 -15
- package/dist/copy-icon.entry-74f8ebcd.cjs +0 -1
- package/dist/core-js-38e53e34.cjs +0 -4
- package/dist/core-js-a9d3b6e1.js +0 -3297
- package/dist/delete-icon.entry-b61a6706.cjs +0 -1
- package/dist/document-refresh-icon.entry-1c985b1e.js +0 -15
- package/dist/document-refresh-icon.entry-27ff5cb2.cjs +0 -1
- package/dist/dom-68f08be9.cjs +0 -15
- package/dist/dom-86e17616.js +0 -664
- package/dist/folder-icon.entry-c32a6e15.cjs +0 -1
- package/dist/forward-icon.entry-5f9a7639.js +0 -15
- package/dist/forward-icon.entry-8cd805dc.cjs +0 -1
- package/dist/globe-icon.entry-21a80591.cjs +0 -1
- package/dist/globe-icon.entry-397727e1.js +0 -15
- package/dist/google-logo-icon_4.entry-42e87368.cjs +0 -1
- package/dist/google-logo-icon_4.entry-6ccf8379.js +0 -778
- package/dist/inbox-icon.entry-1e448b4b.js +0 -15
- package/dist/inbox-icon.entry-50605b1d.cjs +0 -1
- package/dist/index-594c8e7b.js +0 -16763
- package/dist/index-cfb93df6.cjs +0 -81
- package/dist/info-icon_2.entry-65e0023f.js +0 -34
- package/dist/info-icon_2.entry-e7b86847.cjs +0 -1
- package/dist/input-color-picker.entry-37d2fb66.js +0 -48
- package/dist/input-color-picker.entry-aabfe638.cjs +0 -1
- package/dist/input-component.entry-51f6da14.cjs +0 -1
- package/dist/input-component.entry-c07d92b1.js +0 -70
- package/dist/input-dropdown_2.entry-20fb0552.cjs +0 -1
- package/dist/input-dropdown_2.entry-90c08f10.js +0 -228
- package/dist/italic-icon.entry-8e5599ff.js +0 -15
- package/dist/italic-icon.entry-ee10a040.cjs +0 -1
- package/dist/multi-select-dropdown.entry-656d2791.cjs +0 -1
- package/dist/multi-select-dropdown.entry-c143becc.js +0 -116
- package/dist/nylas-booked-event-card_12.entry-4974ffe6.js +0 -1332
- package/dist/nylas-booked-event-card_12.entry-669bb872.cjs +0 -1
- package/dist/nylas-form-card.entry-42e718e2.js +0 -57
- package/dist/nylas-form-card.entry-55d3909c.cjs +0 -1
- package/dist/nylas-if-state.entry-4de782b7.cjs +0 -1
- package/dist/nylas-login.entry-d6b80abe.cjs +0 -1
- package/dist/nylas-provider.entry-d5495e1a.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-bebe4e7d.cjs +0 -2
- package/dist/nylas-scheduling.entry-21c04831.cjs +0 -1
- package/dist/nylas-scheduling.entry-c335ad21.js +0 -415
- package/dist/nylas-time-window-picker_2.entry-9e0dd470.js +0 -336
- package/dist/nylas-time-window-picker_2.entry-a2651ee7.cjs +0 -1
- package/dist/person-icon.entry-21946944.cjs +0 -1
- package/dist/play-icon.entry-b27fcb18.cjs +0 -1
- package/dist/play-icon.entry-dbfed5e8.js +0 -15
- package/dist/refresh-icon.entry-9d94a60b.cjs +0 -1
- package/dist/reply-all-icon.entry-f0e0a5c4.cjs +0 -1
- package/dist/reply-icon.entry-0a42fb2c.cjs +0 -1
- package/dist/reply-icon.entry-a8d2b0f8.js +0 -15
- package/dist/scheduler-config-store-ed4a8dfd-a16d5c62.cjs +0 -1
- package/dist/scheduler-store-92eb8804-bc68a43a.js +0 -487
- package/dist/scheduler-store-92eb8804-c3deee73.cjs +0 -1
- package/dist/sent-icon.entry-c3f84a59.cjs +0 -1
- package/dist/sent-icon.entry-e047f087.js +0 -15
- package/dist/spam-icon.entry-55d01416.js +0 -15
- package/dist/spam-icon.entry-671eb165.cjs +0 -1
- package/dist/star-icon.entry-4dcae472.cjs +0 -1
- package/dist/stop-icon.entry-130a28b2.js +0 -15
- package/dist/stop-icon.entry-ed949255.cjs +0 -1
- package/dist/textarea-component.entry-65dd740a.cjs +0 -1
- package/dist/textarea-component.entry-efae9031.js +0 -37
- package/dist/translate-icon.entry-2591baf8.cjs +0 -1
- package/dist/trash-fill-icon.entry-5b373be7.js +0 -15
- package/dist/trash-fill-icon.entry-c411d0e0.cjs +0 -1
- package/dist/underline-icon.entry-6bf14476.cjs +0 -1
- package/dist/warning-icon.entry-719a094d.cjs +0 -1
|
@@ -0,0 +1,1337 @@
|
|
|
1
|
+
import { r as b, h as s, c as m, g as x, d, T as V, H as w, i as c, y as H, U as S, P as q, V as M } from "./index-04630615.js";
|
|
2
|
+
import { R as C } from "./register-component-504a1cbb-5f986d7f.js";
|
|
3
|
+
import { g as k, P as L, h as J } from "./constants-f5ba52b9-40ab2ded.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const G = ".sc-checkmark-icon-h{display:flex}", X = G, Q = class {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
b(this, e), this.width = "18", this.height = "14";
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return s("svg", { key: "9f2ef9310a166f784507fd99e6449c515a96f3ac", width: this.width, height: this.height, viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "748719ddc2fc511cf16073d4de5ea64a75b616b0", d: "M1.53033 7.46967C1.23744 7.17678 0.762563 7.17678 0.46967 7.46967C0.176777 7.76256 0.176777 8.23744 0.46967 8.53033L4.96967 13.0303C5.26256 13.3232 5.73744 13.3232 6.03033 13.0303L17.0303 2.03033C17.3232 1.73744 17.3232 1.26256 17.0303 0.96967C16.7374 0.676777 16.2626 0.676777 15.9697 0.96967L5.5 11.4393L1.53033 7.46967Z", fill: "#293056" }));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
Q.style = X;
|
|
16
|
+
const Y = ".sc-copy-icon-h{display:flex}", ee = Y, te = class {
|
|
17
|
+
constructor(e) {
|
|
18
|
+
b(this, e), this.width = "16", this.height = "16";
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return s("svg", { key: "6df601eb70e375eee48dde40e40e0acb18528216", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "f26ded593d4d0202c92a739851bd51fad8d04810", d: "M4 0.75C2.89543 0.75 2 1.64543 2 2.75V12.75C2 13.8546 2.89543 14.75 4 14.75H10C11.1046 14.75 12 13.8546 12 12.75V2.75C12 1.64543 11.1046 0.75 10 0.75H4ZM3 2.75C3 2.19772 3.44772 1.75 4 1.75H10C10.5523 1.75 11 2.19772 11 2.75V12.75C11 13.3023 10.5523 13.75 10 13.75H4C3.44772 13.75 3 13.3023 3 12.75V2.75ZM0 4.75001C0 4.00973 0.402199 3.36339 1 3.01758V13.25C1 14.6307 2.11929 15.75 3.5 15.75H9.73244C9.38663 16.3478 8.74028 16.75 8 16.75H3.5C1.567 16.75 0 15.183 0 13.25V4.75001Z", fill: "currentColor" }));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
te.style = ee;
|
|
25
|
+
const ne = ".sc-dragable-icon-h{display:flex}", ae = ne, oe = class {
|
|
26
|
+
constructor(e) {
|
|
27
|
+
b(this, e), this.width = "20", this.height = "20";
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return s("svg", { key: "46dfe8b0dee0c2d5d79a32ed646d3967b7f627f2", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "10321343368e069dd9d663a03309d29a7744953b", d: "M15.5 18C16.3284 18 17 18.6716 17 19.5C17 20.3284 16.3284 21 15.5 21C14.6716 21 14 20.3284 14 19.5C14 18.6716 14.6716 18 15.5 18ZM8.5 18C9.32843 18 10 18.6716 10 19.5C10 20.3284 9.32843 21 8.5 21C7.67157 21 7 20.3284 7 19.5C7 18.6716 7.67157 18 8.5 18ZM15.5 11C16.3284 11 17 11.6716 17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11ZM8.5 11C9.32843 11 10 11.6716 10 12.5C10 13.3284 9.32843 14 8.5 14C7.67157 14 7 13.3284 7 12.5C7 11.6716 7.67157 11 8.5 11ZM15.5 4C16.3284 4 17 4.67157 17 5.5C17 6.32843 16.3284 7 15.5 7C14.6716 7 14 6.32843 14 5.5C14 4.67157 14.6716 4 15.5 4ZM8.5 4C9.32843 4 10 4.67157 10 5.5C10 6.32843 9.32843 7 8.5 7C7.67157 7 7 6.32843 7 5.5C7 4.67157 7.67157 4 8.5 4Z", fill: "currentColor" }));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
oe.style = ae;
|
|
34
|
+
const le = ".sc-eye-icon-h{display:flex}", se = le, ie = class {
|
|
35
|
+
constructor(e) {
|
|
36
|
+
b(this, e), this.width = "17", this.height = "10";
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return s("svg", { key: "a8fe2828182a26d753bdc72405496b8e96a5576d", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "4458663d2507b9b3aa25ba6c243bda9c5408980b", d: "M1.75909 6.60214C2.44254 3.32689 5.29437 1 8.50002 1C11.7057 1 14.5574 3.32688 15.2409 6.60215C15.2974 6.87246 15.5622 7.04587 15.8325 6.98946C16.1029 6.93304 16.2763 6.66817 16.2199 6.39785C15.4425 2.67312 12.1934 0 8.50002 0C4.8066 0 1.55742 2.67311 0.780175 6.39786C0.723767 6.66818 0.897177 6.93305 1.1675 6.98946C1.43782 7.04587 1.70268 6.87246 1.75909 6.60214ZM8.5 3C6.567 3 5 4.567 5 6.5C5 8.433 6.567 10 8.5 10C10.433 10 12 8.433 12 6.5C12 4.567 10.433 3 8.5 3ZM6 6.5C6 5.11929 7.11929 4 8.5 4C9.88071 4 11 5.11929 11 6.5C11 7.88071 9.88071 9 8.5 9C7.11929 9 6 7.88071 6 6.5Z", fill: "currentColor" }));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
ie.style = se;
|
|
43
|
+
const re = ".sc-feedback-icon-h{display:flex}", ce = re, de = class {
|
|
44
|
+
constructor(e) {
|
|
45
|
+
b(this, e), this.width = "11", this.height = "14";
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return s("svg", { key: "c3dd87b3177b8154f344548d108a00f9a1017736", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "38fb63f78cf6d3920fad1c80b27362b81bdb079a", d: "M0.5 8.875C0.5 8.875 1.125 8.25 3 8.25C4.875 8.25 6.125 9.5 8 9.5C9.875 9.5 10.5 8.875 10.5 8.875V1.375C10.5 1.375 9.875 2 8 2C6.125 2 4.875 0.75 3 0.75C1.125 0.75 0.5 1.375 0.5 1.375V8.875ZM0.5 8.875V13.25", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
de.style = ce;
|
|
52
|
+
const fe = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.color-picker-container{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available;padding-left:0;gap:0;overflow:hidden}.color-picker-container:focus{outline-color:var(--nylas-primary)}.color-picker-container.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.color-picker-container.error::placeholder{font-weight:400}.color-picker-container::placeholder{color:var(--nylas-base-300)}.color-picker-container input{display:flex;align-items:center;height:100%;appearance:none;border:none;border-right:1px solid var(--nylas-base-200);background:transparent}.color-picker-container input::-webkit-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container input::-moz-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container.error{border:1px solid var(--nylas-error)}.color-picker-container:hover,.color-picker-container:active{outline:1px solid var(--nylas-primary)}.color-picker-container:active{outline:2px solid var(--nylas-primary)}.color-picker-container label{width:100%}.labelBtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;width:100%;gap:0.5rem;background:transparent;border:none}.labelBtn.error{border:1px solid var(--nylas-error)}.labelBtn.focus{background:transparent}.labelBtn:hover,.labelBtn:active{outline:1px solid var(--nylas-primary)}.labelBtn span.chevron{display:flex;align-self:center}.labelBtn span.open{transform:rotate(90deg)}.labelBtn span.closed{transform:rotate(270deg)}.labelBtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.labelBtn span.selected-option{max-width:124px;font-size:16px}}', pe = fe, ye = class {
|
|
53
|
+
constructor(e) {
|
|
54
|
+
b(this, e), this.nylasFormDropdownChanged = m(this, "nylasFormDropdownChanged", 7), this.componentType = "color-picker", this.name = void 0, this.defaultSelectedColor = void 0, this.selectedColor = this.defaultSelectedColor, this.isOpen = !1, this.ariaActivedescendant = "", this.errorMessage = "";
|
|
55
|
+
}
|
|
56
|
+
componentWillLoad() {
|
|
57
|
+
this.selectedColor = this.defaultSelectedColor, this.el.setAttribute("component-type", this.componentType);
|
|
58
|
+
}
|
|
59
|
+
handleFocus() {
|
|
60
|
+
this.isOpen = !0;
|
|
61
|
+
}
|
|
62
|
+
handleBlur() {
|
|
63
|
+
this.isOpen = !1;
|
|
64
|
+
}
|
|
65
|
+
handleInput(e) {
|
|
66
|
+
this.selectedColor = e.target.value;
|
|
67
|
+
}
|
|
68
|
+
handleChange(e) {
|
|
69
|
+
this.selectedColor = e.target.value, this.nylasFormDropdownChanged.emit({
|
|
70
|
+
value: this.selectedColor,
|
|
71
|
+
name: this.name,
|
|
72
|
+
error: this.errorMessage
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
handleKeyDown(e) {
|
|
76
|
+
var t;
|
|
77
|
+
(e.code === "Enter" || e.code === "Space") && (e.preventDefault(), (t = this.inputRef) == null || t.click());
|
|
78
|
+
}
|
|
79
|
+
handleOutsideClick(e) {
|
|
80
|
+
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return s("div", { key: "081086e3c3877d0f9027a6862a6e0a3c53e70051", class: "color-picker-container", part: "icp_color-picker", tabindex: "0", onKeyDown: (e) => this.handleKeyDown(e) }, s("input", { key: "0bb1c2162f840c3438c334bc09741a35d5d97b42", type: "color", ref: (e) => this.inputRef = e, id: this.name, name: this.name, value: this.selectedColor, tabindex: "-1", onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e), onKeyDown: (e) => this.handleKeyDown(e) }), s("label", { key: "d063c26dd52948dc40b14d3f93443ac30eb173e3", part: "icp_color-picker-button", htmlFor: this.name, class: { labelBtn: !0, open: this.isOpen, error: !!this.errorMessage }, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name }, s("span", { key: "f0898da0abc4de14ee84cd8414fca3ef4f05fb38", class: "selected-option", part: "icp_color-picker-button-selected-label" }, this.selectedColor || "Select a color"), s("span", { key: "d998216f68ef77fa672c4435d275ffae4b656a49", class: {
|
|
84
|
+
open: this.isOpen,
|
|
85
|
+
closed: !this.isOpen,
|
|
86
|
+
chevron: !0
|
|
87
|
+
}, "aria-hidden": "true" }, s("chevron-icon", { key: "589c6052482633ae22ab1132536201b0a6b73fe2", width: "16", height: "16" })), this.errorMessage && s("span", { class: "error help-text" }, this.errorMessage)));
|
|
88
|
+
}
|
|
89
|
+
get el() {
|
|
90
|
+
return x(this);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
ye.style = pe;
|
|
94
|
+
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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.logo-container{display:flex;flex-direction:row;gap:2rem}.logo-container .input-container{flex:1}.logo-container .input-container span.error-message{color:var(--nylas-error)}.logo-container .logo{display:flex;justify-content:center;align-items:center;width:200px;height:100px;border:var(--nylas-base-200) solid 1px;border-radius:var(--nylas-border-radius-2x);overflow:hidden;padding:10px}.logo-container .logo img{max-height:100%;max-width:100%;object-fit:contain;object-position:center}', ue = he;
|
|
95
|
+
var be = function(e, t, a, l) {
|
|
96
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
97
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
98
|
+
o = Reflect.decorate(e, t, a, l);
|
|
99
|
+
else
|
|
100
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
101
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
102
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
103
|
+
}, O = function(e, t) {
|
|
104
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
105
|
+
return Reflect.metadata(e, t);
|
|
106
|
+
};
|
|
107
|
+
const z = class {
|
|
108
|
+
constructor(e) {
|
|
109
|
+
b(this, e), this.nylasFormInputImageUrlInvalid = m(this, "nylasFormInputImageUrlInvalid", 7), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.componentType = "image-url", this.imageUrl = "", this.errorMessage = "", this.name = "input-image-url", this.currentImageUrl = this.imageUrl, this.error = "";
|
|
110
|
+
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
d("nylas-image-input", "connectedCallback");
|
|
113
|
+
}
|
|
114
|
+
disconnectedCallback() {
|
|
115
|
+
d("nylas-image-input", "disconnectedCallback");
|
|
116
|
+
}
|
|
117
|
+
componentWillLoad() {
|
|
118
|
+
d("nylas-image-input", "componentWillLoad"), this.host.setAttribute("name", this.name), this.host.setAttribute("component-type", this.componentType);
|
|
119
|
+
}
|
|
120
|
+
componentDidLoad() {
|
|
121
|
+
d("nylas-image-input", "componentDidLoad"), this.currentImageUrl = this.imageUrl, this.setImage(this.imageUrl, !1);
|
|
122
|
+
}
|
|
123
|
+
componentWillUpdate() {
|
|
124
|
+
d("nylas-image-input", "componentWillUpdate");
|
|
125
|
+
}
|
|
126
|
+
componentDidUpdate() {
|
|
127
|
+
d("nylas-image-input", "componentDidUpdate");
|
|
128
|
+
}
|
|
129
|
+
componentWillRender() {
|
|
130
|
+
d("nylas-image-input", "componentWillRender");
|
|
131
|
+
}
|
|
132
|
+
componentDidRender() {
|
|
133
|
+
d("nylas-image-input", "componentDidRender");
|
|
134
|
+
}
|
|
135
|
+
elementNameChangedHandler(e) {
|
|
136
|
+
d("nylas-image-input", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
137
|
+
}
|
|
138
|
+
errorMessageChangedHandler(e) {
|
|
139
|
+
d("nylas-image-input", "errorMessageChangedHandler", e), this.error && (this.error = e);
|
|
140
|
+
}
|
|
141
|
+
async nylasFormInputChangedHandler(e) {
|
|
142
|
+
const { name: t, value: a } = e.detail;
|
|
143
|
+
t === this.name && this.setImage(a);
|
|
144
|
+
}
|
|
145
|
+
async nylasFormInputBlurHandler(e) {
|
|
146
|
+
const { name: t, value: a } = e.detail;
|
|
147
|
+
t === this.name && this.setImage(a);
|
|
148
|
+
}
|
|
149
|
+
setImage(e, t = !0) {
|
|
150
|
+
this.error = "", V(e).then(() => {
|
|
151
|
+
this.currentImageUrl = e, this.internals.setValidity({}), this.internals.setFormValue(this.currentImageUrl, this.name), t && this.valueChanged.emit({ value: this.currentImageUrl, name: this.name });
|
|
152
|
+
}).catch(() => {
|
|
153
|
+
this.error = this.errorMessage || "Invalid image URL.", this.nylasFormInputImageUrlInvalid.emit({ value: this.error, name: this.name }), typeof this.internals.setValidity == "function" && this.internals.setValidity({ customError: !0 }, this.error);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
render() {
|
|
157
|
+
return s(w, { key: "4f40a383b04b54040c53a2deb4bd401d8984cfce" }, s("div", { key: "c470c5fe3a6b2e72d5e2395542b3be59d3cfee24", class: "logo-container" }, s("div", { key: "9982ebfc4113457f044df87560921ecf693687e1", class: "input-container" }, s("input-component", { key: "ecceb63da6e50c59292cedf2ef6bf9f611130b1c", name: this.name, id: this.name, type: "text", required: !1, exportparts: "ic_input: iiu__logo-input-textfield", defaultValue: this.imageUrl ?? "" }), this.error && s("span", { class: "error-message" }, this.error)), this.currentImageUrl && !this.error && s("div", { class: "logo" }, s("img", { src: this.currentImageUrl, alt: "Logo" }))));
|
|
158
|
+
}
|
|
159
|
+
static get formAssociated() {
|
|
160
|
+
return !0;
|
|
161
|
+
}
|
|
162
|
+
get host() {
|
|
163
|
+
return x(this);
|
|
164
|
+
}
|
|
165
|
+
static get watchers() {
|
|
166
|
+
return {
|
|
167
|
+
name: ["elementNameChangedHandler"],
|
|
168
|
+
errorMessage: ["errorMessageChangedHandler"]
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
be([
|
|
173
|
+
C({
|
|
174
|
+
name: "nylas-image-input",
|
|
175
|
+
eventToProps: {
|
|
176
|
+
valueChanged: async (e, t) => {
|
|
177
|
+
const { valueChanged: a } = e.detail;
|
|
178
|
+
a && a(e);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
O("design:type", Function),
|
|
183
|
+
O("design:paramtypes", []),
|
|
184
|
+
O("design:returntype", void 0)
|
|
185
|
+
], z.prototype, "render", null);
|
|
186
|
+
z.style = ue;
|
|
187
|
+
const ge = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-additional-participants__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_group label span.org-as-participant{width:max-content}.nylas-additional-participants__error{color:var(--nylas-error);font-size:14px;font-family:var(--nylas-font-family);font-weight:400;line-height:16px;margin:0;text-align:left}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper.error{border-color:var(--nylas-error)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;border-left:1px solid var(--nylas-base-300);background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{border:none}.nylas-additional-participants__input{flex:1;display:flex;justify-content:space-between}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__input input-dropdown{width:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown){width:100%;height:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown-input){height:100%;border-radius:var(--nylas-border-radius-2x);border:none;border-top-right-radius:initial;border-bottom-right-radius:initial;padding-left:16px}.nylas-additional-participants__input input-component::part(ic__input){background:var(--nylas-base-50)}.nylas-additional-participants__input input-component::part(ic__label){font-size:14px}.nylas-additional-participants__input input-component div.required-input{display:flex;gap:4px}.nylas-additional-participants__input input-component div.required-input label{display:flex;gap:4px;align-items:center}.nylas-additional-participants__input input-component div.required-input label tooltip-component#organizer_participant_tooltip::part(tc__content){left:-84px}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}', me = ge;
|
|
188
|
+
var ve = function(e, t, a, l) {
|
|
189
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
190
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
191
|
+
o = Reflect.decorate(e, t, a, l);
|
|
192
|
+
else
|
|
193
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
194
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
195
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
196
|
+
}, I = function(e, t) {
|
|
197
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
198
|
+
return Reflect.metadata(e, t);
|
|
199
|
+
};
|
|
200
|
+
const N = class {
|
|
201
|
+
constructor(e) {
|
|
202
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "participants", this.selectedConfiguration = void 0, this.currentUser = void 0, this.currentUserCalendars = void 0, this.participantOptions = void 0, this.eventParticipants = void 0, this.roundRobinConfig = void 0, this.selectedLanguage = void 0, this.participants = this.eventParticipants ?? [], this.participantErrors = {}, this.includeOrganizerAsParticipant = !0, this.isRoundRobinConfig = !1, this.error = "";
|
|
203
|
+
}
|
|
204
|
+
elementNameChangedHandler(e) {
|
|
205
|
+
d("nylas-additional-participants", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
206
|
+
}
|
|
207
|
+
selectedConfigurationAndCurrentUserChangedHandler(e, t, a) {
|
|
208
|
+
d("nylas-additional-participants", "selectedConfigurationAndCurrentUserChangedHandler", e, this.currentUser), a === "selectedConfiguration" ? this.updateState(e, this.currentUser, !1) : a === "currentUser" && this.updateState(this.selectedConfiguration, e, !1);
|
|
209
|
+
}
|
|
210
|
+
selectedLanguageChangedHandler(e, t) {
|
|
211
|
+
e !== t && (c.changeLanguage(e), this.error && (this.error = c.t("nylasAdditionalParticipants.error")));
|
|
212
|
+
}
|
|
213
|
+
connectedCallback() {
|
|
214
|
+
d("nylas-additional-participants", "connectedCallback");
|
|
215
|
+
}
|
|
216
|
+
componentWillLoad() {
|
|
217
|
+
d("nylas-additional-participants", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
218
|
+
}
|
|
219
|
+
componentDidLoad() {
|
|
220
|
+
d("nylas-additional-participants", "componentDidLoad"), this.selectedConfiguration ? this.updateState(this.selectedConfiguration, this.currentUser, !1) : this.eventParticipants && (this.participants = this.eventParticipants || [], this.isRoundRobinConfig = this.roundRobinConfig || !1, this.updateFormValue(!0));
|
|
221
|
+
}
|
|
222
|
+
disconnectedCallback() {
|
|
223
|
+
d("nylas-additional-participants", "disconnectedCallback");
|
|
224
|
+
}
|
|
225
|
+
updateState(e, t, a = !0) {
|
|
226
|
+
var l, r, o, n;
|
|
227
|
+
this.isRoundRobinConfig = (r = (l = e == null ? void 0 : e.availability) == null ? void 0 : l.availability_rules) != null && r.availability_method ? ((n = (o = e == null ? void 0 : e.availability) == null ? void 0 : o.availability_rules) == null ? void 0 : n.availability_method) !== "collective" : !1, this.participants = (e == null ? void 0 : e.participants) || this.eventParticipants || [], this.includeOrganizerAsParticipant = !!(this.isRoundRobinConfig && this.participants.find((i) => i.email === (t == null ? void 0 : t.email))), this.updateOrganizerAsParticipant(a);
|
|
228
|
+
}
|
|
229
|
+
get isInternalsAvailable() {
|
|
230
|
+
return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
|
|
231
|
+
}
|
|
232
|
+
onInputOptionChanged(e) {
|
|
233
|
+
var r;
|
|
234
|
+
d("nylas-additional-participants", "onInputOptionChanged");
|
|
235
|
+
const t = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, a = e.detail.name, l = (r = this.participantOptions) == null ? void 0 : r.find((o) => o.email === e.detail.value);
|
|
236
|
+
if (!l && this.isRoundRobinConfig) {
|
|
237
|
+
this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, "For round robin configuration, participant should be selected from the dropdown."), this.participantErrors[a] = "For round robin page, participant should be selected from the dropdown.", this.participants[a].is_valid = !1, this.participants = [...this.participants];
|
|
238
|
+
return;
|
|
239
|
+
} else if (!l && !t.test(e.detail.value)) {
|
|
240
|
+
this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, "Please enter a valid email address"), this.participantErrors[a] = "Please enter a valid email address", this.participants[a].is_valid = !1, this.participants = [...this.participants];
|
|
241
|
+
return;
|
|
242
|
+
} else
|
|
243
|
+
this.participantErrors[a] = "", this.participants[a].is_valid = !0, this.isInternalsAvailable && this.internals.setValidity({});
|
|
244
|
+
this.participants[a].email = e.detail.value, this.participants[a].availability = l && l.calendars[0].id ? { calendar_ids: [l.calendars[0].id] } : void 0, this.participants[a].booking = l && this.isRoundRobinConfig && l.calendars[0].id ? { calendar_id: l.calendars[0].id } : void 0, this.participants[a].name = (l == null ? void 0 : l.name) || e.detail.value, this.participants = [...this.participants], this.updateFormValue();
|
|
245
|
+
}
|
|
246
|
+
updateOrganizerAsParticipant(e = !0) {
|
|
247
|
+
var a, l, r, o, n, i, f;
|
|
248
|
+
const t = this.participants.find((p) => {
|
|
249
|
+
var h;
|
|
250
|
+
return p.email === ((h = this.currentUser) == null ? void 0 : h.email);
|
|
251
|
+
});
|
|
252
|
+
if (this.isRoundRobinConfig && !t && ((a = this.currentUser) != null && a.email)) {
|
|
253
|
+
const p = ((r = (l = this.currentUserCalendars) == null ? void 0 : l.find((h) => h.is_primary)) == null ? void 0 : r.id) || ((n = (o = this.currentUserCalendars) == null ? void 0 : o[0]) == null ? void 0 : n.id) || "primary";
|
|
254
|
+
this.participants = [
|
|
255
|
+
{
|
|
256
|
+
name: (i = this.currentUser) == null ? void 0 : i.name,
|
|
257
|
+
email: (f = this.currentUser) == null ? void 0 : f.email,
|
|
258
|
+
is_organizer: !0,
|
|
259
|
+
availability: {
|
|
260
|
+
calendar_ids: [p]
|
|
261
|
+
},
|
|
262
|
+
booking: {
|
|
263
|
+
calendar_id: p
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
...this.participants
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
this.updateFormValue(e);
|
|
270
|
+
}
|
|
271
|
+
addParticipant() {
|
|
272
|
+
d("nylas-additional-participants", "addParticipant"), this.participants = [...this.participants, { name: "", email: "", is_organizer: !1 }], this.updateFormValue();
|
|
273
|
+
}
|
|
274
|
+
removeParticipant(e) {
|
|
275
|
+
d("nylas-additional-participants", "removeParticipant"), this.participants = this.participants.filter((t, a) => a !== e), this.updateFormValue();
|
|
276
|
+
}
|
|
277
|
+
updateFormValue(e = !0) {
|
|
278
|
+
d("nylas-additional-participants", "updateFormValue");
|
|
279
|
+
const t = this.isRoundRobinConfig ? this.includeOrganizerAsParticipant ? this.participants : this.participants.filter((a) => !a.is_organizer) : this.participants;
|
|
280
|
+
t.length === 0 ? (this.error = c.t("nylasAdditionalParticipants.error"), this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, this.error)) : (this.isInternalsAvailable && this.internals.setValidity({}), this.error = "", this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(t), this.name), e && this.valueChanged.emit({ value: JSON.stringify(t), name: this.name }));
|
|
281
|
+
}
|
|
282
|
+
getArrayDifference(e, t) {
|
|
283
|
+
return e.filter((l) => !t.some((r) => l.email === r.email)).map((l) => ({ value: l.email, label: l.email }));
|
|
284
|
+
}
|
|
285
|
+
render() {
|
|
286
|
+
return s(w, { key: "835a3f39c0e7a67bc6d340bfa5c3cc62145678e8", part: "nadtnlpart" }, s("nylas-form-card", { key: "1cf1984b29bd7c1647ce9e127d8fc4ddf095cf01", exportparts: "nfc, nfc__header" }, s("h3", { key: "b46bd33729b18b983f0df47ae7a676ae96267ce2", slot: "header-title", class: "nylas-additional-participants__title", part: "nadtnlpart__title" }, c.t("nylasAdditionalParticipants.headerTitle")), s("p", { key: "1e47838d94814bc7ecfd037b0f270cf823ed1f8e", slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nadtnlpart__subtitle" }, c.t("nylasAdditionalParticipants.headerSubTitle")), s("div", { key: "ab0382b540df100fb2249a434dc47e22680fbd92", slot: "content", class: "nylas-additional-participants__content", part: "nadtnlpart__content" }, s("div", { key: "622be51eeabd507a90a5517c04b8348c4cf45f49" }, this.participants.map((e, t) => s("div", { class: "nylas-additional-participants__input_group", part: "nadtnlpart__input_group" }, !e.is_organizer && s("label", null, `${c.t("nylasAdditionalParticipants.participant")} ${t}`), s("div", { part: "nadtnlpart__input_wrapper", class: {
|
|
287
|
+
"nylas-additional-participants__input_wrapper": !0,
|
|
288
|
+
"nylas-additional-participants__input_wrapper_organizer": (e == null ? void 0 : e.is_organizer) === !0,
|
|
289
|
+
"nylas-additional-participants__input_wrapper_invalid": e.is_valid === !1,
|
|
290
|
+
error: e.is_valid === !1
|
|
291
|
+
} }, s("div", { class: { "nylas-additional-participants__input": !0, organizer: (e == null ? void 0 : e.is_organizer) === !0 }, part: "nadtnlpart__input" }, e.is_organizer ? s("input-component", { class: "label-input", name: `${t}`, key: t, label: c.t("nylasAdditionalParticipants.organizer"), required: !1, readOnly: e.is_organizer, defaultValue: e.email }, this.isRoundRobinConfig && s("div", { class: "required-input", slot: "additional-input" }, s("input", { type: "checkbox", name: "organizer_participant", id: "organizer_participant", onClick: () => {
|
|
292
|
+
this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant, this.updateFormValue();
|
|
293
|
+
}, checked: this.includeOrganizerAsParticipant }), s("label", { htmlFor: "organizer_participant", "aria-label": "Include as participant" }, s("span", { class: "org-as-participant", part: "nadtnlpart__org-as-participant" }, c.t("nylasAdditionalParticipants.organizerAsParticipant")), s("tooltip-component", { id: "organizer_participant_tooltip" }, s("info-icon", { slot: "tooltip-icon" }), s("span", { slot: "tooltip-content" }, s("strong", null, c.t("nylasAdditionalParticipants.tooltip.includeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.includeOrganizerDesc"), " ", s("br", null), s("strong", null, c.t("nylasAdditionalParticipants.tooltip.excludeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.excludeOrganizerDesc")))))) : s("input-dropdown", { id: `${t}`, name: `${t}`, filterable: !0, inputValue: e.email, options: this.getArrayDifference(this.participantOptions || [], this.participants) }), !e.is_organizer && s("button", { onClick: () => this.removeParticipant(t), part: "nadtnlpart__remove-participant" }, s("close-icon", null)))), !e.is_valid && s("p", { class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.participantErrors[t]))), s("p", { key: "e67268bf9788935342f6f922b82d2af94bc1a84c", class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.error)), s("button", { key: "d322c6e1dc4fb91c40c28e36f0f25b389794780d", class: "nylas-additional-participants__add", part: "nadtnlpart__add-participant", onClick: () => this.addParticipant() }, s("add-circle-icon", { key: "a749d64c83f5427db7e3c602b8da83e35b1c110c" }), " ", s("span", { key: "dc81ad7e804cac41479b6669138ea8ca56d1a3d5" }, this.participants.length > 1 ? c.t("nylasAdditionalParticipants.addParticipant", { context: "next" }) : c.t("nylasAdditionalParticipants.addParticipant", { context: "first" }))))));
|
|
294
|
+
}
|
|
295
|
+
static get formAssociated() {
|
|
296
|
+
return !0;
|
|
297
|
+
}
|
|
298
|
+
get host() {
|
|
299
|
+
return x(this);
|
|
300
|
+
}
|
|
301
|
+
static get watchers() {
|
|
302
|
+
return {
|
|
303
|
+
name: ["elementNameChangedHandler"],
|
|
304
|
+
currentUser: ["selectedConfigurationAndCurrentUserChangedHandler"],
|
|
305
|
+
selectedConfiguration: ["selectedConfigurationAndCurrentUserChangedHandler"],
|
|
306
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
ve([
|
|
311
|
+
C({
|
|
312
|
+
name: "nylas-additional-participants",
|
|
313
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
314
|
+
["schedulerConfig.additionalParticipants", "participantOptions"],
|
|
315
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
316
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
317
|
+
["schedulerConfig.calendars", "currentUserCalendars"],
|
|
318
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"]
|
|
319
|
+
]),
|
|
320
|
+
eventToProps: {},
|
|
321
|
+
fireRegisterEvent: !0
|
|
322
|
+
}),
|
|
323
|
+
I("design:type", Function),
|
|
324
|
+
I("design:paramtypes", []),
|
|
325
|
+
I("design:returntype", void 0)
|
|
326
|
+
], N.prototype, "render", null);
|
|
327
|
+
N.style = me;
|
|
328
|
+
const xe = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-description{display:flex;flex-direction:column;gap:4px;position:relative}.nylas-event-description label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description label span.label-icon{margin-left:4px}.nylas-event-description label span.label-icon tooltip-component{display:flex}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;border:1px solid var(--nylas-base-200)}.nylas-event-description textarea::-webkit-resizer{display:none}.nylas-event-description div.event-description{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);white-space:nowrap;scrollbar-width:thin;min-height:50px;overflow-y:auto;white-space:pre-wrap;line-height:1.5;}.nylas-event-description div.event-description::-webkit-scrollbar{width:6px;height:6px}.nylas-event-description div.event-description.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-description span.add-additional-fields{display:flex;align-items:center;gap:8px}.nylas-event-description span.add-additional-fields button-component button{height:35px}.nylas-event-description span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-description span.help-text span.label-icon{display:inline-block}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-description .highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:2px 5px;margin-left:4px;margin-bottom:4px;display:inline-block;vertical-align:baseline}.nylas-event-description .token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;margin-top:28px;overflow:auto;z-index:1;border-radius:4px;position:absolute;bottom:108px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.nylas-event-description .token-options{right:0;width:325px;max-width:unset}}.nylas-event-description .token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.nylas-event-description .token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.nylas-event-description .token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.nylas-event-description .token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.nylas-event-description .token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.nylas-event-description .token-options ul li:hover,.nylas-event-description .token-options ul li:focus,.nylas-event-description .token-options ul li:active,.nylas-event-description .token-options ul li.active{background-color:var(--nylas-base-100)}.nylas-event-description .token-options ul li:hover .token-label .token,.nylas-event-description .token-options ul li:focus .token-label .token,.nylas-event-description .token-options ul li:active .token-label .token,.nylas-event-description .token-options ul li.active .token-label .token{color:var(--nylas-primary)}.nylas-event-description .token-options .selected{background-color:var(--nylas-base-100)}', ke = xe;
|
|
329
|
+
var we = function(e, t, a, l) {
|
|
330
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
331
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
332
|
+
o = Reflect.decorate(e, t, a, l);
|
|
333
|
+
else
|
|
334
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
335
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
336
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
337
|
+
}, A = function(e, t) {
|
|
338
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
339
|
+
return Reflect.metadata(e, t);
|
|
340
|
+
};
|
|
341
|
+
const B = class {
|
|
342
|
+
constructor(e) {
|
|
343
|
+
var t, a, l, r;
|
|
344
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventDescription = (a = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : a.description, this.name = "description", this.selectedLanguage = void 0, this.hideAutoPopulateButton = !1, this.description = this.eventDescription || ((r = (l = this.selectedConfiguration) == null ? void 0 : l.event_booking) == null ? void 0 : r.description) || "", this.showTokens = !1, this.availableTokens = k.map((o) => ({
|
|
345
|
+
label: o.token,
|
|
346
|
+
value: o.value,
|
|
347
|
+
labelHTML: o
|
|
348
|
+
})), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.additionalFieldTokens = [];
|
|
349
|
+
}
|
|
350
|
+
elementNameChangedHandler(e) {
|
|
351
|
+
d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
352
|
+
}
|
|
353
|
+
selectedConfigurationChangedHandler(e) {
|
|
354
|
+
var o, n;
|
|
355
|
+
d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
|
|
356
|
+
const t = ((o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.description) || this.eventDescription || "", a = ((n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.additional_fields) || {}, r = (Object.keys(a) || []).map((i) => ({
|
|
357
|
+
token: `$${i}`,
|
|
358
|
+
value: `\${${i}}`,
|
|
359
|
+
description: a[i].label || ""
|
|
360
|
+
}));
|
|
361
|
+
this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
|
|
362
|
+
label: i.token,
|
|
363
|
+
value: i.value,
|
|
364
|
+
labelHTML: i
|
|
365
|
+
})), this.filteredTokens = [...this.availableTokens], this.description = t, t && this.updateEventDescriptionFromProp(t);
|
|
366
|
+
}
|
|
367
|
+
selectedLanguageChangedHandler(e, t) {
|
|
368
|
+
if (e === t)
|
|
369
|
+
return;
|
|
370
|
+
c.changeLanguage(e);
|
|
371
|
+
const a = {
|
|
372
|
+
$invitee: "invitee",
|
|
373
|
+
$invitee_email: "inviteeEmail",
|
|
374
|
+
$duration: "duration"
|
|
375
|
+
};
|
|
376
|
+
this.availableTokens = this.availableTokens.map((l) => (a[l.label] && (l.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${a[l.label]}`)), l)), this.filteredTokens = [...this.availableTokens];
|
|
377
|
+
}
|
|
378
|
+
connectedCallback() {
|
|
379
|
+
d("nylas-event-description", "connectedCallback");
|
|
380
|
+
}
|
|
381
|
+
componentWillLoad() {
|
|
382
|
+
d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
383
|
+
}
|
|
384
|
+
componentDidLoad() {
|
|
385
|
+
d("nylas-event-description", "componentDidLoad"), this.selectedConfiguration ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.description = this.eventDescription || "", this.updateEventDescriptionFromProp(this.description));
|
|
386
|
+
}
|
|
387
|
+
disconnectedCallback() {
|
|
388
|
+
d("nylas-event-description", "disconnectedCallback");
|
|
389
|
+
}
|
|
390
|
+
valueChangedHandler(e) {
|
|
391
|
+
const { name: t, value: a } = e.detail, l = a || {};
|
|
392
|
+
if (t === "additional-fields") {
|
|
393
|
+
const o = (Object.keys(l) || []).map((n) => ({
|
|
394
|
+
token: `$${n}`,
|
|
395
|
+
value: `\${${n}}`,
|
|
396
|
+
description: l[n].label || ""
|
|
397
|
+
}));
|
|
398
|
+
this.additionalFieldTokens = [...o], this.availableTokens = [...k, ...o].map((n) => ({
|
|
399
|
+
label: n.token,
|
|
400
|
+
value: n.value,
|
|
401
|
+
labelHTML: n
|
|
402
|
+
})), this.filteredTokens = [...this.availableTokens];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
updateEventDescriptionFromProp(e) {
|
|
406
|
+
d("nylas-event-description", "updateEventDescriptionFromProp", e);
|
|
407
|
+
const t = e || this.description;
|
|
408
|
+
this.descriptionRef && (this.descriptionRef.innerHTML = this.highlightTokens(t));
|
|
409
|
+
}
|
|
410
|
+
highlightTokens(e) {
|
|
411
|
+
let t = e;
|
|
412
|
+
return [...k, ...this.additionalFieldTokens].forEach((a) => {
|
|
413
|
+
const l = a.value, r = new RegExp(`(\\${l})(?!\\w)`, "g");
|
|
414
|
+
t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
|
|
415
|
+
}), t;
|
|
416
|
+
}
|
|
417
|
+
getCurrentSelectionForBrowser() {
|
|
418
|
+
var l, r, o;
|
|
419
|
+
const e = (n, i, f, p) => {
|
|
420
|
+
const h = n.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
|
|
421
|
+
return {
|
|
422
|
+
focusOffset: i,
|
|
423
|
+
dollarIndex: y,
|
|
424
|
+
lastWord: u,
|
|
425
|
+
currentText: h,
|
|
426
|
+
node: f,
|
|
427
|
+
allSelected: p
|
|
428
|
+
};
|
|
429
|
+
}, t = (n) => {
|
|
430
|
+
var i, f;
|
|
431
|
+
return n.anchorOffset === 0 && n.focusOffset === ((f = (i = n.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : f.length);
|
|
432
|
+
};
|
|
433
|
+
switch (M()) {
|
|
434
|
+
case "Chrome": {
|
|
435
|
+
const n = (l = this.host.shadowRoot) == null ? void 0 : l.getSelection(), i = n == null ? void 0 : n.focusNode, f = (i == null ? void 0 : i.nodeValue) || "", p = n && t(n);
|
|
436
|
+
return e(f, (n == null ? void 0 : n.focusOffset) || -1, i, p);
|
|
437
|
+
}
|
|
438
|
+
case "Firefox": {
|
|
439
|
+
const n = document.getSelection(), i = ((r = n == null ? void 0 : n.anchorNode) == null ? void 0 : r.nodeValue) || "", f = n && t(n);
|
|
440
|
+
return e(i, (n == null ? void 0 : n.focusOffset) || -1, n == null ? void 0 : n.anchorNode, f);
|
|
441
|
+
}
|
|
442
|
+
case "Safari": {
|
|
443
|
+
const n = window.getSelection(), i = n == null ? void 0 : n.getComposedRanges(this.host.shadowRoot)[0], f = ((o = i == null ? void 0 : i.startContainer) == null ? void 0 : o.nodeValue) || "", p = n && t(n);
|
|
444
|
+
return e(f, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, p);
|
|
445
|
+
}
|
|
446
|
+
default:
|
|
447
|
+
return console.warn("Browser not supported"), null;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
handleChange(e) {
|
|
451
|
+
let t = e.target.textContent || "";
|
|
452
|
+
t = H(t);
|
|
453
|
+
const a = this.getCurrentSelectionForBrowser();
|
|
454
|
+
if (!a) {
|
|
455
|
+
this.updateEventDescription(t), this.resetDropdown();
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
const { focusOffset: l, dollarIndex: r, lastWord: o, currentText: n } = a;
|
|
459
|
+
if (r === -1 || l < r) {
|
|
460
|
+
this.updateEventDescription(t), this.resetDropdown();
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
o.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
|
|
464
|
+
$value: o,
|
|
465
|
+
fullText: n,
|
|
466
|
+
index: r,
|
|
467
|
+
focusOffset: l
|
|
468
|
+
}, this.populateSuggestionsDropdown(o)) : this.resetDropdown(), this.updateEventDescription(t);
|
|
469
|
+
}
|
|
470
|
+
handleInputKeyDown(e) {
|
|
471
|
+
var a, l, r, o;
|
|
472
|
+
const t = this.getCurrentSelectionForBrowser();
|
|
473
|
+
if (t != null && t.allSelected && !S(e) && (this.descriptionRef.innerHTML = ""), e.key === "Enter") {
|
|
474
|
+
e.preventDefault();
|
|
475
|
+
const n = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
|
|
476
|
+
if (n)
|
|
477
|
+
n.click(), this.ariaActivedescendant = "";
|
|
478
|
+
else {
|
|
479
|
+
const i = t == null ? void 0 : t.node, f = (t == null ? void 0 : t.focusOffset) || 0;
|
|
480
|
+
if (!i || f === -1 || this.descriptionRef.childNodes.length === 0) {
|
|
481
|
+
const p = document.createTextNode(`
|
|
482
|
+
`);
|
|
483
|
+
this.descriptionRef.insertBefore(p, this.descriptionRef.firstChild);
|
|
484
|
+
const h = document.createRange();
|
|
485
|
+
h.setStart(p, 1), h.collapse(!0);
|
|
486
|
+
const y = window.getSelection();
|
|
487
|
+
y == null || y.removeAllRanges(), y == null || y.addRange(h);
|
|
488
|
+
} else if (i.nodeType === Node.TEXT_NODE) {
|
|
489
|
+
const p = i.nodeValue || "", h = p.slice(0, f) + `
|
|
490
|
+
` + p.slice(f);
|
|
491
|
+
i.nodeValue = h;
|
|
492
|
+
const y = document.createRange();
|
|
493
|
+
y.setStart(i, f + 1), y.collapse(!0);
|
|
494
|
+
const u = window.getSelection();
|
|
495
|
+
u == null || u.removeAllRanges(), u == null || u.addRange(y);
|
|
496
|
+
}
|
|
497
|
+
this.descriptionRef.focus();
|
|
498
|
+
}
|
|
499
|
+
} else if (e.key === "ArrowDown") {
|
|
500
|
+
this.showTokens && e.preventDefault();
|
|
501
|
+
const n = (l = this.host.shadowRoot) == null ? void 0 : l.getElementById(this.ariaActivedescendant);
|
|
502
|
+
if (n) {
|
|
503
|
+
const i = n.nextElementSibling;
|
|
504
|
+
i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
505
|
+
} else
|
|
506
|
+
this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
507
|
+
} else if (e.key === "ArrowUp") {
|
|
508
|
+
this.showTokens && e.preventDefault();
|
|
509
|
+
const n = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
|
|
510
|
+
if (n) {
|
|
511
|
+
const i = n.previousElementSibling;
|
|
512
|
+
i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
513
|
+
} else
|
|
514
|
+
this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
515
|
+
} else if (e.key === "Escape")
|
|
516
|
+
e.preventDefault(), this.resetDropdown();
|
|
517
|
+
else if (e.key === "Backspace" || e.key === "Delete") {
|
|
518
|
+
const n = (o = t == null ? void 0 : t.node) == null ? void 0 : o.parentNode;
|
|
519
|
+
t != null && t.currentText.startsWith("${") && n && n.nodeName === "SPAN" && (e.preventDefault(), n.removeChild(t.node), n.remove(), this.resetDropdown()), (this.descriptionRef.textContent === "" || t != null && t.allSelected) && (this.descriptionRef.innerHTML = "", this.updateEventDescription(""));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
selectOption(e, t) {
|
|
523
|
+
var T;
|
|
524
|
+
e.preventDefault();
|
|
525
|
+
const a = this.currentWord.fullText, l = this.currentWord.$value;
|
|
526
|
+
let r = this.descriptionRef.firstChild, o = null;
|
|
527
|
+
for (; r; ) {
|
|
528
|
+
if (r.nodeType === 3) {
|
|
529
|
+
const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", E = a.replace(/[\u200B-\u200D\uFEFF]/g, "");
|
|
530
|
+
if (v.includes(E)) {
|
|
531
|
+
o = r;
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
r = r.nextSibling;
|
|
536
|
+
}
|
|
537
|
+
if (!o)
|
|
538
|
+
return;
|
|
539
|
+
const n = o.textContent || "", i = n.indexOf(l), f = n.substring(0, i), p = n.substring(i + l.length), h = document.createTextNode(f), y = document.createRange(), u = document.createElement("span");
|
|
540
|
+
u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
|
|
541
|
+
const _ = document.createTextNode(p);
|
|
542
|
+
if (p !== "")
|
|
543
|
+
o.replaceWith(h, u, _), y.setStart(_, 1);
|
|
544
|
+
else {
|
|
545
|
+
const v = document.createTextNode("");
|
|
546
|
+
o.replaceWith(h, u, v), y.setStart(v, 1);
|
|
547
|
+
}
|
|
548
|
+
this.resetDropdown(), this.descriptionRef.focus();
|
|
549
|
+
const g = window.getSelection();
|
|
550
|
+
y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventDescription(this.descriptionRef.textContent || "");
|
|
551
|
+
}
|
|
552
|
+
populateSuggestionsDropdown(e = "") {
|
|
553
|
+
this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
|
|
554
|
+
}
|
|
555
|
+
get isInternalsAvailable() {
|
|
556
|
+
return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
|
|
557
|
+
}
|
|
558
|
+
updateEventDescription(e) {
|
|
559
|
+
var a;
|
|
560
|
+
const t = e.replace(/ +/g, " ");
|
|
561
|
+
this.isInternalsAvailable && ((a = this.internals) == null || a.setFormValue(t, this.name)), this.valueChanged.emit({ value: t, name: this.name });
|
|
562
|
+
}
|
|
563
|
+
resetDropdown() {
|
|
564
|
+
this.showTokens = !1, this.ariaActivedescendant = "";
|
|
565
|
+
}
|
|
566
|
+
getLabelHTML(e) {
|
|
567
|
+
return s("div", { class: "token-label" }, s("span", { class: "token" }, e.token), s("span", { class: "description" }, e.description));
|
|
568
|
+
}
|
|
569
|
+
handleAddAdditionalFields() {
|
|
570
|
+
if (this.additionalFieldTokens.length === 0)
|
|
571
|
+
return;
|
|
572
|
+
const e = this.descriptionRef.innerHTML, t = "--- Additional Fields ---", a = "--- End Additional Fields ---", l = e.indexOf(t), r = e.indexOf(a);
|
|
573
|
+
let o = t + `
|
|
574
|
+
`;
|
|
575
|
+
this.additionalFieldTokens.forEach((i) => {
|
|
576
|
+
o += `${i.description}: ${i.value}
|
|
577
|
+
`;
|
|
578
|
+
}), o += a;
|
|
579
|
+
let n;
|
|
580
|
+
l !== -1 && r !== -1 ? n = e.substring(0, l) + o + e.substring(r + a.length) : n = e + o, this.updateEventDescriptionFromProp(n), this.updateEventDescription(n);
|
|
581
|
+
}
|
|
582
|
+
render() {
|
|
583
|
+
var e;
|
|
584
|
+
return s(w, { key: "1b66d58870fa13561c3637a8ecba82ee97d20887" }, s("div", { key: "dd40eefb081978dd40764976c88398a267ca890a", class: "nylas-event-description", part: "nedesc" }, s("label", { key: "b5d2500eff59628f77b1b5e2ca17c60f05906989", htmlFor: "description" }, c.t("nylasEventDescription.headerTitle"), s("span", { key: "cf6a4cbb90b6ae8315d52dd461860c14db0cba0c", class: "label-icon" }, s("tooltip-component", { key: "c3f753433c9a56c1d7e61408e126ee1c2586ce30" }, s("info-icon", { key: "1fe8a397ad85863dcfb1343813704a95b8f34157", slot: "tooltip-icon" }), s("span", { key: "fc6a3b1ca674988fae9ae26221833e26751f28db", slot: "tooltip-content" }, c.t("nylasEventDescription.tooltip.desc"))))), s("div", { key: "64dc59e2f3b8d5a90a55539c0f94f557f72291c2", id: "event-description", class: { "event-description": !0 }, part: "nedesc__textarea", contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t), ref: (t) => this.descriptionRef = t }), this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && s("div", { class: "token-options", part: "nedesc__dropdown-content" }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => s("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (a) => this.selectOption(a, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), s("span", { key: "7bd87929746ab364de2f88f398af8f8302d4fc01", class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.description") }), " ", s("code", { key: "27f271b94c3839ef5dfcddb21967c1cf5804b13d" }, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), s("span", { key: "7dfd03addbfbeed55f7904333b7a3e550244a0a2", class: "label-icon" }, s("tooltip-component", { key: "274b1fba18dd5b2b1a5a3db4607e91f3dacd9945" }, s("info-icon", { key: "02bc9f53e88a755f6e8b62112d13b5d181f4816c", slot: "tooltip-icon", width: "13", height: "13" }), s("span", { key: "0ec0e0706791ed734f628dfa62111027702a180c", slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", s("code", { key: "606646c8ca4a0a56f29c65e60100ea920ddea9bf" }, "${invitee}"))))), !this.hideAutoPopulateButton && s("span", { class: "add-additional-fields" }, s("button-component", { variant: "basic", onClick: () => this.handleAddAdditionalFields() }, c.t("nylasEventDescription.addAdditionalFields.buttonText")), s("span", { class: "label-icon" }, s("tooltip-component", null, s("info-icon", { slot: "tooltip-icon" }), s("span", { slot: "tooltip-content" }, c.t("nylasEventDescription.addAdditionalFields.tooltip.desc"), " ", s("code", null, "${invitee}")))))));
|
|
585
|
+
}
|
|
586
|
+
static get formAssociated() {
|
|
587
|
+
return !0;
|
|
588
|
+
}
|
|
589
|
+
get host() {
|
|
590
|
+
return x(this);
|
|
591
|
+
}
|
|
592
|
+
static get watchers() {
|
|
593
|
+
return {
|
|
594
|
+
name: ["elementNameChangedHandler"],
|
|
595
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
596
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
we([
|
|
601
|
+
C({
|
|
602
|
+
name: "nylas-event-description",
|
|
603
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
604
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
605
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"]
|
|
606
|
+
]),
|
|
607
|
+
eventToProps: {},
|
|
608
|
+
fireRegisterEvent: !0
|
|
609
|
+
}),
|
|
610
|
+
A("design:type", Function),
|
|
611
|
+
A("design:paramtypes", []),
|
|
612
|
+
A("design:returntype", void 0)
|
|
613
|
+
], B.prototype, "render", null);
|
|
614
|
+
B.style = ke;
|
|
615
|
+
const Ce = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-info__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-info__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', _e = Ce;
|
|
616
|
+
var Te = function(e, t, a, l) {
|
|
617
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
618
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
619
|
+
o = Reflect.decorate(e, t, a, l);
|
|
620
|
+
else
|
|
621
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
622
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
623
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
624
|
+
}, D = function(e, t) {
|
|
625
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
626
|
+
return Reflect.metadata(e, t);
|
|
627
|
+
};
|
|
628
|
+
const U = class {
|
|
629
|
+
constructor(e) {
|
|
630
|
+
b(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedLanguage = void 0;
|
|
631
|
+
}
|
|
632
|
+
selectedLanguageChangedHandler(e, t) {
|
|
633
|
+
e !== t && c.changeLanguage(e);
|
|
634
|
+
}
|
|
635
|
+
connectedCallback() {
|
|
636
|
+
d("nylas-event-info", "connectedCallback");
|
|
637
|
+
}
|
|
638
|
+
componentWillLoad() {
|
|
639
|
+
d("nylas-event-info", "componentWillLoad");
|
|
640
|
+
}
|
|
641
|
+
componentDidLoad() {
|
|
642
|
+
d("nylas-event-info", "componentDidLoad"), q(["inputs"], this.el);
|
|
643
|
+
}
|
|
644
|
+
disconnectedCallback() {
|
|
645
|
+
d("nylas-event-info", "disconnectedCallback");
|
|
646
|
+
}
|
|
647
|
+
render() {
|
|
648
|
+
return s(w, { key: "475a54dbcaf8ecbe0804192273f991ff9466c45c" }, s("nylas-form-card", { key: "fe5d05a93dfc2b75a618ca6320fca31fa4854268", exportparts: "nfc__header: nei__header" }, s("h1", { key: "41e2eeee13b9e39ee3b1cf0c3f265a1f7cab2be7", slot: "header-title", class: "nylas-event-info__title", part: "nei__title" }, c.t("nylasEventInfo.headerTitle")), s("div", { key: "ea8d3eed98accb83eaf2d3dc11399984d95d1d79", slot: "content", class: "nylas-event-info__content" }, s("slot", { key: "4add92095594ba316cd5ee3a05e6d95ca7720ba9", name: "inputs" }))));
|
|
649
|
+
}
|
|
650
|
+
static get formAssociated() {
|
|
651
|
+
return !0;
|
|
652
|
+
}
|
|
653
|
+
get el() {
|
|
654
|
+
return x(this);
|
|
655
|
+
}
|
|
656
|
+
static get watchers() {
|
|
657
|
+
return {
|
|
658
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
Te([
|
|
663
|
+
C({
|
|
664
|
+
name: "nylas-event-info",
|
|
665
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedLanguage", "selectedLanguage"]]),
|
|
666
|
+
eventToProps: {},
|
|
667
|
+
fireRegisterEvent: !0
|
|
668
|
+
}),
|
|
669
|
+
D("design:type", Function),
|
|
670
|
+
D("design:paramtypes", []),
|
|
671
|
+
D("design:returntype", void 0)
|
|
672
|
+
], U.prototype, "render", null);
|
|
673
|
+
U.style = _e;
|
|
674
|
+
const Le = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-location{display:flex;flex-direction:column;gap:4px;font-family:var(--nylas-font-family)}.nylas-event-location label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-location label span.label-icon{margin-left:4px}.nylas-event-location label span.label-icon tooltip-component{display:flex}.nylas-event-location span[slot=select-icon]{border-right:1px solid var(--nylas-base-200);padding:16px 0.75rem 16px 0.5rem;border-radius:var(--nylas-border-radius-2x);border-bottom-right-radius:0;border-top-right-radius:0;height:20px}.nylas-event-location div.location-input{display:grid;grid-template-columns:auto 1fr;width:100%;gap:0.5rem}@media screen and (max-width: 768px){.nylas-event-location div.location-input{grid-template-columns:1fr}}.nylas-event-location div.location-input input{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}.nylas-event-location select-dropdown{width:208px}@media screen and (max-width: 768px){.nylas-event-location select-dropdown{width:100%}}.nylas-event-location select-dropdown::part(sd_dropdown){width:100%}.nylas-event-location select-dropdown::part(sd_dropdown-content){left:calc(35px + 0.5rem)}.nylas-event-location select-dropdown::part(sd_dropdown-button){display:flex;justify-content:space-between;width:100%;border:1px solid var(--nylas-base-200);padding:0 0.5rem}.nylas-event-location select-dropdown::part(sd_dropdown-button-selected-label){display:inline-flex;align-self:center;padding:14px 0;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Ee = Le;
|
|
675
|
+
var Oe = function(e, t, a, l) {
|
|
676
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
677
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
678
|
+
o = Reflect.decorate(e, t, a, l);
|
|
679
|
+
else
|
|
680
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
681
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
682
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
683
|
+
}, P = function(e, t) {
|
|
684
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
685
|
+
return Reflect.metadata(e, t);
|
|
686
|
+
};
|
|
687
|
+
const W = class {
|
|
688
|
+
constructor(e) {
|
|
689
|
+
var t;
|
|
690
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "location", this.currentUser = void 0, this.userProvider = void 0, this.eventConferencing = void 0, this.conferenceProviders = void 0, this.selectedConfiguration = void 0, this.eventLocation = void 0, this.selectedLanguage = void 0, this.location = this.eventLocation ?? "", this.grantId = this.eventConferencing ? this.setDefaultGrantID(this.eventConferencing) : "", this.selectedLocationOption = void 0, this.userProviderState = this.userProvider ?? ((t = this.currentUser) == null ? void 0 : t.provider) ?? "", this.locationOptions = [
|
|
691
|
+
{ value: "none", label: c.t("nylasEventLocation.conferenceOptions.none"), labelHTML: this.getLabelHTML("none") },
|
|
692
|
+
{ value: "custom", label: c.t("nylasEventLocation.conferenceOptions.custom"), labelHTML: this.getLabelHTML("custom") }
|
|
693
|
+
];
|
|
694
|
+
}
|
|
695
|
+
elementNameChangedHandler(e) {
|
|
696
|
+
d("nylas-event-location", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
697
|
+
}
|
|
698
|
+
selectedConfigurationChangedHandler(e) {
|
|
699
|
+
var l, r;
|
|
700
|
+
d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
|
|
701
|
+
const t = ((l = e == null ? void 0 : e.event_booking) == null ? void 0 : l.location) || this.eventLocation, a = ((r = e == null ? void 0 : e.event_booking) == null ? void 0 : r.conferencing) || this.eventConferencing;
|
|
702
|
+
a != null && a.provider ? (this.selectedLocationOption = this.setDefaultLocationOption(a, t ?? ""), this.grantId = this.setDefaultGrantID(a), this.location = t || "") : t ? (this.selectedLocationOption = t ? "custom" : "none", this.location = t) : (this.selectedLocationOption = "none", this.location = "");
|
|
703
|
+
}
|
|
704
|
+
currentUserChangedHandler(e) {
|
|
705
|
+
d("nylas-custom-booking-flow", "currentUserChangedHandler", e), e != null && e.provider && (this.userProviderState = e == null ? void 0 : e.provider, this.setLocationOptionsForProvider(this.userProviderState));
|
|
706
|
+
}
|
|
707
|
+
conferenceProvidersChanged(e) {
|
|
708
|
+
e != null && e.zoom && !this.locationOptions.some((t) => t.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
|
|
709
|
+
}
|
|
710
|
+
selectedLanguageChangedHandler(e, t) {
|
|
711
|
+
if (e === t)
|
|
712
|
+
return;
|
|
713
|
+
c.changeLanguage(e), this.locationOptions.map((l) => l.value).forEach((l) => {
|
|
714
|
+
const r = this.locationOptions.findIndex((o) => o.value === l);
|
|
715
|
+
this.locationOptions[r].label = c.t(`nylasEventLocation.conferenceOptions.${l}`), this.locationOptions[r].labelHTML = this.getLabelHTML(l);
|
|
716
|
+
}), this.locationOptions = [...this.locationOptions];
|
|
717
|
+
}
|
|
718
|
+
connectedCallback() {
|
|
719
|
+
d("nylas-event-location", "connectedCallback");
|
|
720
|
+
}
|
|
721
|
+
componentWillLoad() {
|
|
722
|
+
d("nylas-event-location", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
723
|
+
}
|
|
724
|
+
componentDidLoad() {
|
|
725
|
+
var t, a, l, r;
|
|
726
|
+
d("nylas-event-location", "componentDidLoad"), (t = this.selectedConfiguration) != null && t.event_booking ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.selectedLocationOption = this.setDefaultLocationOption(this.eventConferencing || null, this.eventLocation ?? ""), this.location = this.eventLocation ?? ""), this.userProviderState = this.userProvider ?? ((a = this.currentUser) == null ? void 0 : a.provider) ?? "", this.setLocationOptionsForProvider(this.userProviderState);
|
|
727
|
+
const e = (l = this.internals) == null ? void 0 : l.form;
|
|
728
|
+
if (e) {
|
|
729
|
+
const o = new FormData(e);
|
|
730
|
+
o.set("conference", this.getConferencePayload()), o.set(this.name, this.location);
|
|
731
|
+
}
|
|
732
|
+
(r = this.conferenceProviders) != null && r.zoom && !this.locationOptions.some((o) => o.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
|
|
733
|
+
}
|
|
734
|
+
disconnectedCallback() {
|
|
735
|
+
d("nylas-event-location", "disconnectedCallback");
|
|
736
|
+
}
|
|
737
|
+
getConferencePayload() {
|
|
738
|
+
var a;
|
|
739
|
+
if (this.selectedLocationOption === "custom" || this.selectedLocationOption === "none")
|
|
740
|
+
return JSON.stringify(null);
|
|
741
|
+
const e = (a = this.conferenceProviders) == null ? void 0 : a[this.selectedLocationOption], t = {
|
|
742
|
+
provider: L[this.selectedLocationOption],
|
|
743
|
+
autocreate: e ? {
|
|
744
|
+
conf_grant_id: e
|
|
745
|
+
} : {}
|
|
746
|
+
};
|
|
747
|
+
return JSON.stringify(t);
|
|
748
|
+
}
|
|
749
|
+
nylasFormDropdownChangedHandler(e) {
|
|
750
|
+
var a, l, r;
|
|
751
|
+
this.selectedLocationOption = e.detail.value;
|
|
752
|
+
let t;
|
|
753
|
+
switch (this.selectedLocationOption) {
|
|
754
|
+
case "none": {
|
|
755
|
+
this.location = "", this.setFormValue("", this.name), this.valueChanged.emit({ value: "", name: this.name }), this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
758
|
+
case "custom": {
|
|
759
|
+
this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
case "google": {
|
|
763
|
+
this.location = "", this.setFormValue("", this.name);
|
|
764
|
+
const o = (a = this.conferenceProviders) == null ? void 0 : a.google;
|
|
765
|
+
t = {
|
|
766
|
+
provider: L.google,
|
|
767
|
+
autocreate: o ? {
|
|
768
|
+
conf_grant_id: o
|
|
769
|
+
} : {}
|
|
770
|
+
}, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
case "microsoft": {
|
|
774
|
+
this.location = "", this.setFormValue("", this.name);
|
|
775
|
+
const o = (l = this.conferenceProviders) == null ? void 0 : l.microsoft;
|
|
776
|
+
t = {
|
|
777
|
+
provider: L.microsoft,
|
|
778
|
+
autocreate: o ? {
|
|
779
|
+
conf_grant_id: o
|
|
780
|
+
} : {}
|
|
781
|
+
}, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
case "zoom": {
|
|
785
|
+
this.location = "", this.setFormValue("", this.name);
|
|
786
|
+
const o = (r = this.conferenceProviders) == null ? void 0 : r.zoom;
|
|
787
|
+
t = {
|
|
788
|
+
provider: L.zoom,
|
|
789
|
+
autocreate: o ? {
|
|
790
|
+
conf_grant_id: o
|
|
791
|
+
} : {}
|
|
792
|
+
}, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
setLocationOptionsForProvider(e) {
|
|
798
|
+
switch (e) {
|
|
799
|
+
case "google":
|
|
800
|
+
this.locationOptions.some((t) => t.value === "google") || this.locationOptions.push({ value: "google", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("google") });
|
|
801
|
+
break;
|
|
802
|
+
case "microsoft":
|
|
803
|
+
this.locationOptions.some((t) => t.value === "microsoft") || this.locationOptions.push({ value: "microsoft", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("microsoft") });
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
setDefaultLocationOption(e, t) {
|
|
808
|
+
return e != null && (e == null ? void 0 : e.provider) != null ? J[e == null ? void 0 : e.provider] : t ? "custom" : "none";
|
|
809
|
+
}
|
|
810
|
+
setDefaultGrantID(e) {
|
|
811
|
+
var t;
|
|
812
|
+
return e != null && (e == null ? void 0 : e.autocreate) != null ? (t = e == null ? void 0 : e.autocreate) == null ? void 0 : t.conf_grant_id : "";
|
|
813
|
+
}
|
|
814
|
+
setFormValue(e, t) {
|
|
815
|
+
typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
|
|
816
|
+
}
|
|
817
|
+
handleChange(e) {
|
|
818
|
+
const t = H(e.target.value);
|
|
819
|
+
this.location = t, this.setFormValue(t, this.name), this.valueChanged.emit({ value: t, name: this.name });
|
|
820
|
+
}
|
|
821
|
+
getIcon(e) {
|
|
822
|
+
switch (e) {
|
|
823
|
+
case "none":
|
|
824
|
+
return s("location-off-icon", null);
|
|
825
|
+
case "custom":
|
|
826
|
+
return s("location-icon", null);
|
|
827
|
+
case "google":
|
|
828
|
+
return s("google-meet-icon", null);
|
|
829
|
+
case "microsoft":
|
|
830
|
+
return s("microsoft-teams-icon", null);
|
|
831
|
+
case "zoom":
|
|
832
|
+
return s("zoom-icon", null);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
getLabelHTML(e) {
|
|
836
|
+
return s("span", { class: "location-label", style: {
|
|
837
|
+
display: "flex",
|
|
838
|
+
alignItems: "center",
|
|
839
|
+
gap: "16px",
|
|
840
|
+
width: "-webkit-fill-available"
|
|
841
|
+
} }, this.getIcon(e), s("span", { class: "location-text", style: {
|
|
842
|
+
fontSize: "14px",
|
|
843
|
+
fontWeight: "400"
|
|
844
|
+
} }, c.t(`nylasEventLocation.conferenceOptions.${e}`)));
|
|
845
|
+
}
|
|
846
|
+
render() {
|
|
847
|
+
const e = typeof this.selectedLocationOption < "u" ? this.locationOptions.find((t) => t.value == this.selectedLocationOption) : null;
|
|
848
|
+
return s(w, { key: "1d9a46868fa6c2af6b85392ca5760201ebbc4602" }, s("div", { key: "5d976b003745b7b1e3f3f4e89e825c86b02fbd54", class: "nylas-event-location", part: "nel" }, s("label", { key: "0449fe176f1170a67752c3cf975b3bd7cb9a396b", htmlFor: "location" }, c.t("nylasEventLocation.headerTitle"), s("span", { key: "3bb40caf92a6bac0ff062424e6390fdedff08982", class: "label-icon" }, s("tooltip-component", { key: "528eb815be88a37f367777fc95c95146b2e58689" }, s("info-icon", { key: "2581db4df71c22386dbf5ad59907a1608d85bae3", slot: "tooltip-icon" }), s("span", { key: "067b161a26d284b590e042b25bf6ec598883293b", slot: "tooltip-content" }, c.t("nylasEventLocation.tooltip.desc"))))), s("div", { key: "8759dd8077c2a3122c5d0b34d3299b196da9021e", class: "location-input" }, s("select-dropdown", { key: "334f059eed1d62ad4a821f068bc6504f1e5985df", withSearch: !1, name: "location", options: this.locationOptions, defaultSelectedOption: e, exportparts: "sd_dropdown: nel__dropdown, sd_dropdown-button: nel__dropdown-button, sd_dropdown-content: nel__dropdown-content" }, s("span", { key: "23a1ed65088d20e5c9bc580aef57850c20aea4bf", slot: "select-icon" }, this.getIcon(this.selectedLocationOption))), this.selectedLocationOption === "custom" && s("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (t) => this.handleChange(t) }))));
|
|
849
|
+
}
|
|
850
|
+
static get formAssociated() {
|
|
851
|
+
return !0;
|
|
852
|
+
}
|
|
853
|
+
get host() {
|
|
854
|
+
return x(this);
|
|
855
|
+
}
|
|
856
|
+
static get watchers() {
|
|
857
|
+
return {
|
|
858
|
+
name: ["elementNameChangedHandler"],
|
|
859
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
860
|
+
currentUser: ["currentUserChangedHandler"],
|
|
861
|
+
conferenceProviders: ["conferenceProvidersChanged"],
|
|
862
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
Oe([
|
|
867
|
+
C({
|
|
868
|
+
name: "nylas-event-location",
|
|
869
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
870
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
871
|
+
["schedulerConfig.conferenceProviders", "conferenceProviders"],
|
|
872
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
873
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"]
|
|
874
|
+
]),
|
|
875
|
+
eventToProps: {},
|
|
876
|
+
fireRegisterEvent: !0
|
|
877
|
+
}),
|
|
878
|
+
P("design:type", Function),
|
|
879
|
+
P("design:paramtypes", []),
|
|
880
|
+
P("design:returntype", void 0)
|
|
881
|
+
], W.prototype, "render", null);
|
|
882
|
+
W.style = Ee;
|
|
883
|
+
const Ie = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:scroll;white-space:nowrap;scrollbar-width:thin}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-title span.help-text span.label-icon{display:inline-block}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}', Ae = Ie;
|
|
884
|
+
var De = function(e, t, a, l) {
|
|
885
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
886
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
887
|
+
o = Reflect.decorate(e, t, a, l);
|
|
888
|
+
else
|
|
889
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
890
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
891
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
892
|
+
}, $ = function(e, t) {
|
|
893
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
894
|
+
return Reflect.metadata(e, t);
|
|
895
|
+
};
|
|
896
|
+
const j = class {
|
|
897
|
+
constructor(e) {
|
|
898
|
+
var t, a;
|
|
899
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventTitle = (a = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : a.title, this.name = "title", this.selectedLanguage = void 0, this.showTokens = !1, this.availableTokens = k.map((l) => ({
|
|
900
|
+
label: l.token,
|
|
901
|
+
value: l.value,
|
|
902
|
+
labelHTML: l
|
|
903
|
+
})), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.configEventTitle = "", this.additionalFieldTokens = [];
|
|
904
|
+
}
|
|
905
|
+
elementNameChangedHandler(e) {
|
|
906
|
+
d("[nylas-event-title]", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
907
|
+
}
|
|
908
|
+
ariaActivedescendantChangedHandler(e) {
|
|
909
|
+
var t, a;
|
|
910
|
+
if (d("[nylas-event-title]", "ariaActivedescendantChangedHandler", e), e !== "") {
|
|
911
|
+
const l = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
|
|
912
|
+
l == null || l.classList.add("active");
|
|
913
|
+
} else {
|
|
914
|
+
const l = (a = this.host.shadowRoot) == null ? void 0 : a.querySelectorAll(".token-options li.active");
|
|
915
|
+
l == null || l.forEach((r) => r.classList.remove("active"));
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
configChangedHandler(e) {
|
|
919
|
+
var o, n;
|
|
920
|
+
const t = (o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.title, a = ((n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.additional_fields) || {}, r = (Object.keys(a) || []).map((i) => ({
|
|
921
|
+
token: `$${i}`,
|
|
922
|
+
value: `\${${i}}`,
|
|
923
|
+
description: a[i].label || ""
|
|
924
|
+
}));
|
|
925
|
+
this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
|
|
926
|
+
label: i.token,
|
|
927
|
+
value: i.value,
|
|
928
|
+
labelHTML: i
|
|
929
|
+
})), this.filteredTokens = [...this.availableTokens], t && (this.configEventTitle = t, this.updateEventTitleFromProp(t));
|
|
930
|
+
}
|
|
931
|
+
selectedLanguageChangedHandler(e, t) {
|
|
932
|
+
if (e === t)
|
|
933
|
+
return;
|
|
934
|
+
c.changeLanguage(e);
|
|
935
|
+
const a = {
|
|
936
|
+
$invitee: "invitee",
|
|
937
|
+
$invitee_email: "inviteeEmail",
|
|
938
|
+
$duration: "duration"
|
|
939
|
+
};
|
|
940
|
+
this.availableTokens = this.availableTokens.map((l) => (a[l.label] && (l.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${a[l.label]}`)), l)), this.filteredTokens = [...this.availableTokens];
|
|
941
|
+
}
|
|
942
|
+
connectedCallback() {
|
|
943
|
+
d("[nylas-event-title]", "connectedCallback");
|
|
944
|
+
}
|
|
945
|
+
componentWillLoad() {
|
|
946
|
+
d("[nylas-event-title]", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
947
|
+
}
|
|
948
|
+
componentDidLoad() {
|
|
949
|
+
var t, a, l, r;
|
|
950
|
+
d("[nylas-event-title]", "componentDidLoad");
|
|
951
|
+
let e = this.eventTitle || this.configEventTitle;
|
|
952
|
+
(a = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) != null && a.title && (e = (r = (l = this.selectedConfiguration) == null ? void 0 : l.event_booking) == null ? void 0 : r.title), e && (this.updateEventTitleFromProp(e), this.updateEventTitle(e, !0));
|
|
953
|
+
}
|
|
954
|
+
disconnectedCallback() {
|
|
955
|
+
d("[nylas-event-title]", "disconnectedCallback");
|
|
956
|
+
}
|
|
957
|
+
formSubmittedHandler(e) {
|
|
958
|
+
var t, a;
|
|
959
|
+
d("[nylas-event-title]", "formSubmittedHandler", e), (a = (t = this.internals) == null ? void 0 : t.validity) != null && a.valid ? this.validationError = "" : this.validationError = "eventTitleRequired";
|
|
960
|
+
}
|
|
961
|
+
valueChangedHandler(e) {
|
|
962
|
+
const { name: t, value: a } = e.detail, l = a || {};
|
|
963
|
+
if (t === "additional-fields") {
|
|
964
|
+
const o = (Object.keys(l) || []).map((n) => ({
|
|
965
|
+
token: `$${n}`,
|
|
966
|
+
value: `\${${n}}`,
|
|
967
|
+
description: l[n].label || ""
|
|
968
|
+
}));
|
|
969
|
+
this.additionalFieldTokens = [...o], this.availableTokens = [...k, ...o].map((n) => ({
|
|
970
|
+
label: n.token,
|
|
971
|
+
value: n.value,
|
|
972
|
+
labelHTML: n
|
|
973
|
+
})), this.filteredTokens = [...this.availableTokens];
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
updateEventTitleFromProp(e) {
|
|
977
|
+
var a, l, r;
|
|
978
|
+
d("[nylas-event-title]", "eventTitleChangedHandler", e);
|
|
979
|
+
const t = e || this.configEventTitle;
|
|
980
|
+
this.titleRef && (this.titleRef.innerHTML = this.highlightTokens(t), typeof this.internals.setValidity == "function" && (!t || t === "" ? (this.titleRef.focus(), (a = this.internals) == null || a.setValidity({ customError: !0 }, "Event title is required", this.titleRef)) : ((l = this.internals) == null || l.setValidity({ customError: !1 }), this.isInternalsAvailable && ((r = this.internals) == null || r.setFormValue(t, this.name)))));
|
|
981
|
+
}
|
|
982
|
+
highlightTokens(e) {
|
|
983
|
+
let t = e;
|
|
984
|
+
return [...k, ...this.additionalFieldTokens].forEach((a) => {
|
|
985
|
+
const l = a.value, r = new RegExp(`(\\${l})(?!\\w)`, "g");
|
|
986
|
+
t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
|
|
987
|
+
}), t;
|
|
988
|
+
}
|
|
989
|
+
getCurrentSelectionForBrowser() {
|
|
990
|
+
var l, r, o;
|
|
991
|
+
const e = (n, i, f, p) => {
|
|
992
|
+
const h = n.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
|
|
993
|
+
return {
|
|
994
|
+
focusOffset: i,
|
|
995
|
+
dollarIndex: y,
|
|
996
|
+
lastWord: u,
|
|
997
|
+
currentText: h,
|
|
998
|
+
node: f,
|
|
999
|
+
allSelected: p
|
|
1000
|
+
};
|
|
1001
|
+
}, t = (n) => {
|
|
1002
|
+
var i, f;
|
|
1003
|
+
return n.anchorOffset === 0 && n.focusOffset === ((f = (i = n.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : f.length);
|
|
1004
|
+
};
|
|
1005
|
+
switch (M()) {
|
|
1006
|
+
case "Chrome": {
|
|
1007
|
+
const n = (l = this.host.shadowRoot) == null ? void 0 : l.getSelection(), i = n == null ? void 0 : n.focusNode, f = (i == null ? void 0 : i.nodeValue) || "", p = n && t(n);
|
|
1008
|
+
return e(f, (n == null ? void 0 : n.focusOffset) || -1, i, p);
|
|
1009
|
+
}
|
|
1010
|
+
case "Firefox": {
|
|
1011
|
+
const n = document.getSelection(), i = ((r = n == null ? void 0 : n.anchorNode) == null ? void 0 : r.nodeValue) || "", f = n && t(n);
|
|
1012
|
+
return e(i, (n == null ? void 0 : n.focusOffset) || -1, n == null ? void 0 : n.anchorNode, f);
|
|
1013
|
+
}
|
|
1014
|
+
case "Safari": {
|
|
1015
|
+
const n = window.getSelection(), i = n == null ? void 0 : n.getComposedRanges(this.host.shadowRoot)[0], f = ((o = i == null ? void 0 : i.startContainer) == null ? void 0 : o.nodeValue) || "", p = n && t(n);
|
|
1016
|
+
return e(f, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, p);
|
|
1017
|
+
}
|
|
1018
|
+
default:
|
|
1019
|
+
return console.warn("Browser not supported"), null;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
handleChange(e) {
|
|
1023
|
+
let t = e.target.textContent || "";
|
|
1024
|
+
t = H(t);
|
|
1025
|
+
const a = this.getCurrentSelectionForBrowser();
|
|
1026
|
+
if (!a) {
|
|
1027
|
+
this.updateEventTitle(t), this.resetDropdown();
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
const { focusOffset: l, dollarIndex: r, lastWord: o, currentText: n } = a;
|
|
1031
|
+
if (r === -1 || l < r) {
|
|
1032
|
+
this.updateEventTitle(t), this.resetDropdown();
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
o.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
|
|
1036
|
+
$value: o,
|
|
1037
|
+
fullText: n,
|
|
1038
|
+
index: r,
|
|
1039
|
+
focusOffset: l
|
|
1040
|
+
}, this.populateSuggestionsDropdown(o)) : this.resetDropdown(), this.updateEventTitle(t);
|
|
1041
|
+
}
|
|
1042
|
+
handleInputKeyDown(e) {
|
|
1043
|
+
var a, l, r, o, n;
|
|
1044
|
+
const t = this.getCurrentSelectionForBrowser();
|
|
1045
|
+
if (t != null && t.allSelected && !S(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
|
|
1046
|
+
e.preventDefault();
|
|
1047
|
+
const i = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
|
|
1048
|
+
i && (i.click(), this.ariaActivedescendant = "");
|
|
1049
|
+
} else if (e.key === "ArrowDown") {
|
|
1050
|
+
e.preventDefault();
|
|
1051
|
+
const i = (l = this.host.shadowRoot) == null ? void 0 : l.getElementById(this.ariaActivedescendant);
|
|
1052
|
+
if (i) {
|
|
1053
|
+
const f = i.nextElementSibling;
|
|
1054
|
+
f ? this.ariaActivedescendant = f.id : this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
1055
|
+
} else
|
|
1056
|
+
this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
1057
|
+
} else if (e.key === "ArrowUp") {
|
|
1058
|
+
e.preventDefault();
|
|
1059
|
+
const i = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
|
|
1060
|
+
if (i) {
|
|
1061
|
+
const f = i.previousElementSibling;
|
|
1062
|
+
f ? this.ariaActivedescendant = f.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
1063
|
+
} else
|
|
1064
|
+
this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
1065
|
+
} else if (e.key === "Escape")
|
|
1066
|
+
e.preventDefault(), this.resetDropdown();
|
|
1067
|
+
else if (e.key === "Backspace" || e.key === "Delete") {
|
|
1068
|
+
const i = (o = t == null ? void 0 : t.node) == null ? void 0 : o.parentNode;
|
|
1069
|
+
t != null && t.currentText.startsWith("${") && i && i.nodeName === "SPAN" && (e.preventDefault(), i.removeChild(t.node), i.remove(), this.resetDropdown(), this.updateEventTitle(((n = this.titleRef) == null ? void 0 : n.textContent) || "")), (this.titleRef.textContent === "" || t != null && t.allSelected) && (this.titleRef.innerHTML = "", this.updateEventTitle(""));
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
selectOption(e, t) {
|
|
1073
|
+
var T;
|
|
1074
|
+
e.preventDefault();
|
|
1075
|
+
const a = this.currentWord.fullText, l = this.currentWord.$value;
|
|
1076
|
+
let r = this.titleRef.firstChild, o = null;
|
|
1077
|
+
for (; r; ) {
|
|
1078
|
+
if (r.nodeType === 3) {
|
|
1079
|
+
const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", E = a.replace(/[\u200B-\u200D\uFEFF]/g, "");
|
|
1080
|
+
if (v.includes(E)) {
|
|
1081
|
+
o = r;
|
|
1082
|
+
break;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
r = r.nextSibling;
|
|
1086
|
+
}
|
|
1087
|
+
if (!o)
|
|
1088
|
+
return;
|
|
1089
|
+
const n = o.textContent || "", i = n.indexOf(l), f = n.substring(0, i), p = n.substring(i + l.length), h = document.createTextNode(f), y = document.createRange(), u = document.createElement("span");
|
|
1090
|
+
u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
|
|
1091
|
+
const _ = document.createTextNode(p);
|
|
1092
|
+
if (p !== "")
|
|
1093
|
+
o.replaceWith(h, u, _), y.setStart(_, 1);
|
|
1094
|
+
else {
|
|
1095
|
+
const v = document.createTextNode("");
|
|
1096
|
+
o.replaceWith(h, u, v), y.setStart(v, 1);
|
|
1097
|
+
}
|
|
1098
|
+
this.resetDropdown(), this.titleRef.focus();
|
|
1099
|
+
const g = window.getSelection();
|
|
1100
|
+
y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventTitle(this.titleRef.textContent || "");
|
|
1101
|
+
}
|
|
1102
|
+
populateSuggestionsDropdown(e = "") {
|
|
1103
|
+
this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
|
|
1104
|
+
}
|
|
1105
|
+
get isInternalsAvailable() {
|
|
1106
|
+
return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
|
|
1107
|
+
}
|
|
1108
|
+
updateEventTitle(e, t = !1) {
|
|
1109
|
+
var l, r, o;
|
|
1110
|
+
const a = e.replace(/ +/g, " ");
|
|
1111
|
+
a === "" || /^[\s]*$/.test(a) ? (this.validationError = "eventTitleRequired", this.isInternalsAvailable && ((l = this.internals) == null || l.setValidity({ customError: !0 }, "Event title is required", this.titleRef))) : (this.validationError = "", this.isInternalsAvailable && ((r = this.internals) == null || r.setValidity({ customError: !1 }))), this.isInternalsAvailable && ((o = this.internals) == null || o.setFormValue(a, this.name)), t || this.valueChanged.emit({ value: a, name: this.name });
|
|
1112
|
+
}
|
|
1113
|
+
resetDropdown() {
|
|
1114
|
+
this.showTokens = !1, this.ariaActivedescendant = "";
|
|
1115
|
+
}
|
|
1116
|
+
getLabelHTML(e) {
|
|
1117
|
+
return s("div", { class: "token-label" }, s("span", { class: "token" }, e.token), s("span", { class: "description" }, e.description));
|
|
1118
|
+
}
|
|
1119
|
+
render() {
|
|
1120
|
+
var e;
|
|
1121
|
+
return s(w, { key: "77727ef052ef96fd01f44629fef5529637ab9512" }, s("div", { key: "c155a7c80a37361d3764c87307603c9224a1acf3", class: "nylas-event-title", part: "net" }, s("label", { key: "167ce5894b815c0ba0af599c4d25567a65e7fe6a", htmlFor: "title" }, c.t("nylasEventTitle.headerTitle"), s("span", { key: "f6ef51b14e683622ad43979bcea199c58d78fd29", class: "required" }, "*")), s("div", { key: "2f4039d517d45b52422197766ba9db0b09a5f903", class: {
|
|
1122
|
+
title: !0,
|
|
1123
|
+
error: this.validationError !== ""
|
|
1124
|
+
}, part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && s("div", { class: "token-options", part: "net__dropdown-content" }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => s("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (a) => this.selectOption(a, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), s("span", { key: "336b58f03f6f13957ab0b62f2f98e95e2980bc13", class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.title") }), " ", s("code", { key: "7069beaf38ab7a2a67f6de371b2544d45b26146b" }, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), s("span", { key: "6b588508b38540c7d072f9e3c01c8e555669af2c", class: "label-icon" }, s("tooltip-component", { key: "bbd2bcff01569fb91c87d78d36eb3c5b0163d73a" }, s("info-icon", { key: "0cbf47b89468838847282e729db536f8df63098c", slot: "tooltip-icon" }), s("span", { key: "cb5a50ecd92b837fead8d1e08ceff2387173ea60", slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", s("code", { key: "22c5e150dfe201cc0d7bd3dd995db94ebd759f31" }, "${invitee}"))))), this.validationError != "" && s("span", { class: "error-message" }, c.t(`nylasEventTitle.${this.validationError}`))));
|
|
1125
|
+
}
|
|
1126
|
+
static get formAssociated() {
|
|
1127
|
+
return !0;
|
|
1128
|
+
}
|
|
1129
|
+
get host() {
|
|
1130
|
+
return x(this);
|
|
1131
|
+
}
|
|
1132
|
+
static get watchers() {
|
|
1133
|
+
return {
|
|
1134
|
+
name: ["elementNameChangedHandler"],
|
|
1135
|
+
ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
|
|
1136
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
1137
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
De([
|
|
1142
|
+
C({
|
|
1143
|
+
name: "nylas-event-title",
|
|
1144
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1145
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
1146
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"]
|
|
1147
|
+
]),
|
|
1148
|
+
eventToProps: {},
|
|
1149
|
+
fireRegisterEvent: !0
|
|
1150
|
+
}),
|
|
1151
|
+
$("design:type", Function),
|
|
1152
|
+
$("design:paramtypes", []),
|
|
1153
|
+
$("design:returntype", void 0)
|
|
1154
|
+
], j.prototype, "render", null);
|
|
1155
|
+
j.style = Ae;
|
|
1156
|
+
const Pe = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.card-wrapper{background:var(--nylas-base-0);display:flex;flex-direction:column;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;padding:32px;width:562px;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){.card-wrapper{width:100%;border-radius:0px}}.header{overflow-wrap:anywhere;display:flex;flex-direction:column;font-size:16px;font-weight:400}.header h2{color:var(--nylas-base-900);font-size:24px;font-weight:600;text-align:left;margin:0}.description.title-desc{margin-bottom:2rem}.description.footer-desc{margin-top:2rem}.description.footer-desc a{color:var(--nylas-primary);text-decoration:none}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;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)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', $e = Pe;
|
|
1157
|
+
var Fe = function(e, t, a, l) {
|
|
1158
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
1159
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1160
|
+
o = Reflect.decorate(e, t, a, l);
|
|
1161
|
+
else
|
|
1162
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
1163
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
1164
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
1165
|
+
}, F = function(e, t) {
|
|
1166
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1167
|
+
return Reflect.metadata(e, t);
|
|
1168
|
+
};
|
|
1169
|
+
const Z = class {
|
|
1170
|
+
constructor(e) {
|
|
1171
|
+
b(this, e), this.feedbackModalClosed = m(this, "feedbackModalClosed", 7), this.feedbackSubmitted = m(this, "feedbackSubmitted", 7), this.triggerValidation = m(this, "triggerValidation", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
1172
|
+
this.triggerValidation.emit().defaultPrevented || this.feedbackSubmitted.emit({ feedback: this.feedbackMessage });
|
|
1173
|
+
}, this.themeConfig = void 0, this.feedbackMessage = "";
|
|
1174
|
+
}
|
|
1175
|
+
connectedCallback() {
|
|
1176
|
+
}
|
|
1177
|
+
disconnectedCallback() {
|
|
1178
|
+
}
|
|
1179
|
+
async componentWillLoad() {
|
|
1180
|
+
d("[nylas-feedback-form] Component will load");
|
|
1181
|
+
}
|
|
1182
|
+
async componentDidLoad() {
|
|
1183
|
+
d("[nylas-feedback-form] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
1184
|
+
}
|
|
1185
|
+
applyThemeConfig(e) {
|
|
1186
|
+
if (e)
|
|
1187
|
+
for (const [t, a] of Object.entries(e))
|
|
1188
|
+
this.host.style.setProperty(`${t}`, a);
|
|
1189
|
+
}
|
|
1190
|
+
handleFormInputChanged(e) {
|
|
1191
|
+
d("[nylas-feedback-form] Form input changed"), e.detail.value && (this.triggerValidation.emit(), e.detail.name === "feedback" && (this.feedbackMessage = e.detail.value));
|
|
1192
|
+
}
|
|
1193
|
+
closeModal(e) {
|
|
1194
|
+
e.preventDefault(), e.stopImmediatePropagation(), this.feedbackModalClosed.emit();
|
|
1195
|
+
}
|
|
1196
|
+
render() {
|
|
1197
|
+
return s(w, { key: "ccc60c0b34b1c9516f6f12d984026f9ccb832cb6", part: "nfbf" }, s("div", { key: "084c2e2813f769006bf2375bbbe7fbf8759c52d0", class: "card-wrapper", part: "nfbfc__card" }, s("div", { key: "c0267b2273f7939b46b77b29c61f1e07167894ad", class: "close-button" }, s("button-component", { key: "b512bfb8c3fe6bf66dbe4bbe73dd7eadca1f1584", tooltip: "Close", id: "close", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__close-button" }, s("close-icon", { key: "d5249055a1f9fbc4669b7f97dccf3a4b0ba79f19" }))), s("div", { key: "44d48e9f33f8335837ea3ec029d7af111f819c49", class: "header" }, s("h2", { key: "deceb8ba28d0aaad4474e199c9a033dc899dd1b0", slot: "card-title", part: "nfbf__title" }, c.t("feedbackFormTitle"))), s("div", { key: "b62b992cb2d87d6c165fac6b0b6ed9eb980f8b3b", class: "description title-desc" }, s("p", { key: "163c7941aab851ae6e5947066bf830e29673d578" }, c.t("feedbackFormDescription"))), s("textarea-component", { key: "6ce1ed4b951cac69884cee8c3543cf448dd9f692", label: c.t("feedbackMessageLabel"), required: !0, maxLength: 500, part: "nfbf__description", name: "feedback", placeholder: c.t("feedbackMessagePlaceholder") }), s("div", { key: "931a632127e9f50995ffec53eee26cffdfa0fe41", class: "description footer-desc" }, s("p", { key: "8ea59fac6743a0f151d550e1dec48559bff26ec1" }, "By sending this report, you agree to Nylas’ access to the data necessary to respond to this issue, subject to Nylas’", " ", s("a", { key: "3324f7bfd5018229eec043d02003c619b7364cf7", href: "https://www.nylas.com/privacy-policy/", target: "_blank", rel: "nofollow noreferrer noopener" }, "Privacy Policy"), ".")), s("div", { key: "75476fceee9f6d0b2448346c9648134247326a51", class: {
|
|
1198
|
+
footer: !0
|
|
1199
|
+
} }, s("button-component", { key: "43c66ecfcd88222a25c973c94e807fe8ae0896eb", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__button-outline nfbf__cancel-cta" }, `${c.t("feedbackModalCloseButton")}`), s("button-component", { key: "6162b5d049973d8f2bd8b9b6e7a38e27da47f5c2", variant: "primary", onClick: this.handleConfirmBookingButtonClicked, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${c.t("feedbackModalSubmitButton")}`))));
|
|
1200
|
+
}
|
|
1201
|
+
get host() {
|
|
1202
|
+
return x(this);
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
Fe([
|
|
1206
|
+
C({
|
|
1207
|
+
name: "nylas-feedback-form",
|
|
1208
|
+
stateToProps: /* @__PURE__ */ new Map([]),
|
|
1209
|
+
eventToProps: {
|
|
1210
|
+
feedbackSubmitted: async (e, t) => {
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
1214
|
+
fireRegisterEvent: !0
|
|
1215
|
+
}),
|
|
1216
|
+
F("design:type", Function),
|
|
1217
|
+
F("design:paramtypes", []),
|
|
1218
|
+
F("design:returntype", void 0)
|
|
1219
|
+
], Z.prototype, "render", null);
|
|
1220
|
+
Z.style = $e;
|
|
1221
|
+
const Re = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-reminder-time{display:flex;flex-direction:column;gap:4px}.nylas-reminder-time label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-reminder-time label span.required{color:var(--nylas-error, #cc4841)}.nylas-reminder-time label span.label-icon{margin-left:4px}.nylas-reminder-time label span.label-icon tooltip-component{display:flex}.nylas-reminder-time__wrapper{display:flex;align-items:center;justify-content:flex-end;gap:0.5rem}.nylas-reminder-time__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-input){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:14px 16px;width:50px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-content){width:100%;min-width:unset;height:160px}.nylas-reminder-time__wrapper select-dropdown{width:120px}@media screen and (max-width: 768px){.nylas-reminder-time__wrapper select-dropdown{width:100%}}.nylas-reminder-time__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200)}', He = Re;
|
|
1222
|
+
var Se = function(e, t, a, l) {
|
|
1223
|
+
var r = arguments.length, o = r < 3 ? t : l === null ? l = Object.getOwnPropertyDescriptor(t, a) : l, n;
|
|
1224
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1225
|
+
o = Reflect.decorate(e, t, a, l);
|
|
1226
|
+
else
|
|
1227
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
1228
|
+
(n = e[i]) && (o = (r < 3 ? n(o) : r > 3 ? n(t, a, o) : n(t, a)) || o);
|
|
1229
|
+
return r > 3 && o && Object.defineProperty(t, a, o), o;
|
|
1230
|
+
}, R = function(e, t) {
|
|
1231
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1232
|
+
return Reflect.metadata(e, t);
|
|
1233
|
+
};
|
|
1234
|
+
const K = class {
|
|
1235
|
+
constructor(e) {
|
|
1236
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "reminder-time", this.eventReminderTimeMinutes = void 0, this.selectedLanguage = void 0, this.selectedNumber = void 0, this.selectedPeriod = void 0, this.errorState = !1;
|
|
1237
|
+
}
|
|
1238
|
+
elementNameChangedHandler(e) {
|
|
1239
|
+
d("nylas-reminder-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1240
|
+
}
|
|
1241
|
+
eventReminderTimeMinutesChangedHandler(e, t) {
|
|
1242
|
+
d("nylas-reminder-time", "eventReminderTimeMinutesChangedHandler", e), this.updateNumberAndPeriodFromMinutes(e), this.isInternalsAvailable && this.internals.setFormValue(e == null ? void 0 : e.toString(), this.name);
|
|
1243
|
+
}
|
|
1244
|
+
selectedLanguageChangedHandler(e, t) {
|
|
1245
|
+
e !== t && c.changeLanguage(e);
|
|
1246
|
+
}
|
|
1247
|
+
connectedCallback() {
|
|
1248
|
+
d("nylas-reminder-time", "connectedCallback");
|
|
1249
|
+
}
|
|
1250
|
+
componentWillLoad() {
|
|
1251
|
+
d("nylas-reminder-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1252
|
+
}
|
|
1253
|
+
componentDidLoad() {
|
|
1254
|
+
d("nylas-reminder-time", "componentDidLoad"), this.updateNumberAndPeriodFromMinutes(this.eventReminderTimeMinutes || 30);
|
|
1255
|
+
}
|
|
1256
|
+
disconnectedCallback() {
|
|
1257
|
+
d("nylas-reminder-time", "disconnectedCallback");
|
|
1258
|
+
}
|
|
1259
|
+
nylasSuggestReminderMinutesHandler(e) {
|
|
1260
|
+
const { minutes: t } = e.detail;
|
|
1261
|
+
this.errorState = !1, this.valueChanged.emit({ value: t.toString(), name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(t.toString(), this.name), this.updateNumberAndPeriodFromMinutes(t + 7), setTimeout(() => {
|
|
1262
|
+
this.updateNumberAndPeriodFromMinutes(t);
|
|
1263
|
+
}, 10);
|
|
1264
|
+
}
|
|
1265
|
+
timePeriodChangedHandler(e) {
|
|
1266
|
+
const { number: t, period: a } = e.detail;
|
|
1267
|
+
let l;
|
|
1268
|
+
const r = 60, o = r * 24, n = o * 7, i = o * 30;
|
|
1269
|
+
a === "minute" ? l = t : a === "hour" ? l = t * r : a === "day" ? l = t * o : a === "week" ? l = t * n : a === "month" ? l = t * i : l = 0, this.errorState = l % 5 !== 0, this.valueChanged.emit({ value: l, name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(l.toString(), this.name);
|
|
1270
|
+
}
|
|
1271
|
+
updateNumberAndPeriodFromMinutes(e) {
|
|
1272
|
+
let o, n;
|
|
1273
|
+
e === 0 ? (o = 0, n = "minute") : e >= 43200 && e % 43200 === 0 ? (o = Math.floor(e / 43200), n = "month") : e >= 10080 && e % 10080 === 0 ? (o = Math.floor(e / 10080), n = "week") : e >= 1440 && e % 1440 === 0 ? (o = Math.floor(e / 1440), n = "day") : e >= 60 && e % 60 === 0 ? (o = Math.floor(e / 60), n = "hour") : (o = e, n = "minute"), this.selectedNumber = o, this.selectedPeriod = n;
|
|
1274
|
+
}
|
|
1275
|
+
get isInternalsAvailable() {
|
|
1276
|
+
return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
|
|
1277
|
+
}
|
|
1278
|
+
render() {
|
|
1279
|
+
const e = typeof this.selectedNumber == "number" && typeof this.selectedPeriod == "string";
|
|
1280
|
+
return s(w, { key: "3a59e54603cffb1facab36a2db0d329ddd5b2522" }, s("div", { key: "ef8ad3bf56fd2dd08fa9b4dc118a3b15ac4aa2bf", class: "nylas-reminder-time", part: "nrt" }, s("div", { key: "5e43dab8a9b4a601e146163640b99f800e45cec1", class: "nylas-reminder-time__wrapper" }, e && s("time-period-selector", { id: "limit-future-bookings", part: "nrt__time-period-selector", hasError: this.errorState, timePeriods: [
|
|
1281
|
+
{ value: "minute", label: c.t("timeDuration", { context: "minute" }) },
|
|
1282
|
+
{ value: "hour", label: c.t("timeDuration", { context: "hour" }) },
|
|
1283
|
+
{ value: "day", label: c.t("timePeriod", { context: "day" }) }
|
|
1284
|
+
], exportparts: "tps__number-dropdown: nrt__number-dropdown, tps__number-dropdown-button: nrt__number-dropdown-button, tps__number-dropdown-content: nrt__number-dropdown-content, tps__period-dropdown: nrt__period-dropdown, tps__period-dropdown-button: nrt__period-dropdown-button, tps__period-dropdown-content: nrt__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod }))));
|
|
1285
|
+
}
|
|
1286
|
+
static get formAssociated() {
|
|
1287
|
+
return !0;
|
|
1288
|
+
}
|
|
1289
|
+
get host() {
|
|
1290
|
+
return x(this);
|
|
1291
|
+
}
|
|
1292
|
+
static get watchers() {
|
|
1293
|
+
return {
|
|
1294
|
+
name: ["elementNameChangedHandler"],
|
|
1295
|
+
eventReminderTimeMinutes: ["eventReminderTimeMinutesChangedHandler"],
|
|
1296
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
Se([
|
|
1301
|
+
C({
|
|
1302
|
+
name: "nylas-reminder-time",
|
|
1303
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedLanguage", "selectedLanguage"]]),
|
|
1304
|
+
eventToProps: {},
|
|
1305
|
+
fireRegisterEvent: !0
|
|
1306
|
+
}),
|
|
1307
|
+
R("design:type", Function),
|
|
1308
|
+
R("design:paramtypes", []),
|
|
1309
|
+
R("design:returntype", void 0)
|
|
1310
|
+
], K.prototype, "render", null);
|
|
1311
|
+
K.style = He;
|
|
1312
|
+
const Me = ".sc-trash-icon-h{display:flex}", ze = Me, Ne = class {
|
|
1313
|
+
constructor(e) {
|
|
1314
|
+
b(this, e), this.width = "20", this.height = "21";
|
|
1315
|
+
}
|
|
1316
|
+
render() {
|
|
1317
|
+
return s("svg", { key: "cfa0d7c9557f9037658e8e90119b2541a6bbe004", width: this.width, height: this.height, viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "5b0b891bef23a81ee453b1044b269ddc4c45b9d3", d: "M10 0.25C11.733 0.25 13.1492 1.60645 13.2449 3.31558L13.25 3.5H18.5C18.9142 3.5 19.25 3.83579 19.25 4.25C19.25 4.6297 18.9678 4.94349 18.6018 4.99315L18.5 5H17.704L16.4239 18.0192C16.2912 19.3683 15.1984 20.41 13.8626 20.4945L13.6871 20.5H6.31293C4.95734 20.5 3.81365 19.5145 3.59883 18.1934L3.57614 18.0192L2.295 5H1.5C1.1203 5 0.806509 4.71785 0.756847 4.35177L0.75 4.25C0.75 3.8703 1.03215 3.55651 1.39823 3.50685L1.5 3.5H6.75C6.75 1.70507 8.20507 0.25 10 0.25ZM16.197 5H3.802L5.06893 17.8724C5.12768 18.4696 5.60033 18.9343 6.18585 18.9936L6.31293 19H13.6871C14.2872 19 14.7959 18.5751 14.9123 17.9982L14.9311 17.8724L16.197 5ZM11.75 7.75C12.1297 7.75 12.4435 8.03215 12.4932 8.39823L12.5 8.5V15.5C12.5 15.9142 12.1642 16.25 11.75 16.25C11.3703 16.25 11.0565 15.9678 11.0068 15.6018L11 15.5V8.5C11 8.08579 11.3358 7.75 11.75 7.75ZM8.25 7.75C8.6297 7.75 8.94349 8.03215 8.99315 8.39823L9 8.5V15.5C9 15.9142 8.66421 16.25 8.25 16.25C7.8703 16.25 7.55651 15.9678 7.50685 15.6018L7.5 15.5V8.5C7.5 8.08579 7.83579 7.75 8.25 7.75ZM10 1.75C9.08183 1.75 8.32881 2.45711 8.2558 3.35647L8.25 3.5H11.75C11.75 2.5335 10.9665 1.75 10 1.75Z", fill: "currentColor" }));
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1320
|
+
Ne.style = ze;
|
|
1321
|
+
export {
|
|
1322
|
+
Q as checkmark_icon,
|
|
1323
|
+
te as copy_icon,
|
|
1324
|
+
oe as dragable_icon,
|
|
1325
|
+
ie as eye_icon,
|
|
1326
|
+
de as feedback_icon,
|
|
1327
|
+
ye as input_color_picker,
|
|
1328
|
+
z as input_image_url,
|
|
1329
|
+
N as nylas_additional_participants,
|
|
1330
|
+
B as nylas_event_description,
|
|
1331
|
+
U as nylas_event_info,
|
|
1332
|
+
W as nylas_event_location,
|
|
1333
|
+
j as nylas_event_title,
|
|
1334
|
+
Z as nylas_feedback_form,
|
|
1335
|
+
K as nylas_reminder_time,
|
|
1336
|
+
Ne as trash_icon
|
|
1337
|
+
};
|