@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,1457 @@
|
|
|
1
|
+
import { r as K, h as n, c as m, d as b, i as p, s as ue, v as ae, H as oe, g as se, F as he, j as Xe } from "./index-04630615.js";
|
|
2
|
+
import { R as ie } from "./register-component-504a1cbb-5f986d7f.js";
|
|
3
|
+
import { C as F, D as Ne, e as et, c as tt } from "./constants-f5ba52b9-40ab2ded.js";
|
|
4
|
+
import { i as Me, a as Ge, c as Ae, b as je, f as $e } from "./feedbackSync-47d13bb0-5608d680.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
const nt = ".sc-google-logo-icon-h{display:flex}", at = nt, ot = class {
|
|
9
|
+
constructor(e) {
|
|
10
|
+
K(this, e), this.width = "24", this.height = "24";
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return n("svg", { key: "6a2c621ba5bde80fe3adc8427ad0d94df265a2fc", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "87acb19eeb19382c6063360f92c7554039ad2c87", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "3d6abcc6b7755164cd3037df0529793becefce72", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), n("path", { key: "b7961a5e8c0e93b3d8996cf40b845d7741335229", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), n("path", { key: "32a135d689dc72b3a0fc597dea20f88290c1f6ae", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), n("path", { key: "74518d77b48b593df3085f600d38b99abfe368bb", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), n("defs", { key: "0c69b9fad17f8891565bdb5162822cd3c44f6ca0" }, n("clipPath", { key: "3c645b8c42436ad0664b38ce08b42404f4fa541b", id: "clip0_959_12452" }, n("rect", { key: "f6f7b93e206bce48be1739a1b8ae8bc2e8242357", width: 24, height: 24, fill: "white" }))));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
ot.style = at;
|
|
17
|
+
const st = ".sc-microsoft-logo-icon-h{display:flex}", it = st, rt = class {
|
|
18
|
+
constructor(e) {
|
|
19
|
+
K(this, e), this.width = "22", this.height = "22";
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return n("svg", { key: "43e12d49816520a670de91afdb1cfd1136ba6a8e", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "08c5a9b3a6d34bf5900e6149bf0f732e8fb1f51f", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "ae3d52d82f9727d53a675d17c76eaf82c3d545ac", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "b42837c53c4c0bfc7bbf5676bc82c83e1f3af391", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "eec316af4193848e15630e680e357e4c313c6b6c", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
rt.style = it;
|
|
26
|
+
var u;
|
|
27
|
+
(function(e) {
|
|
28
|
+
e.EventInfo = "eventInfo", e.Availability = "availability", e.BookingOptions = "bookingOptions", e.Communications = "communications", e.Participants = "participants", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles";
|
|
29
|
+
})(u || (u = {}));
|
|
30
|
+
function lt({ id: e, formState: t, activeTab: a }, s) {
|
|
31
|
+
return n(
|
|
32
|
+
he,
|
|
33
|
+
null,
|
|
34
|
+
n(
|
|
35
|
+
"div",
|
|
36
|
+
{ key: `event-info-${e}`, class: { hide: a !== u.EventInfo } },
|
|
37
|
+
n(
|
|
38
|
+
"nylas-event-info",
|
|
39
|
+
null,
|
|
40
|
+
n(
|
|
41
|
+
"div",
|
|
42
|
+
{ slot: "inputs" },
|
|
43
|
+
n("nylas-event-title", { name: "title", exportparts: "net, net__title, net__dropdown-content" }),
|
|
44
|
+
n("nylas-event-duration", { name: "duration", exportparts: "ned, ned__error, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
45
|
+
n("nylas-event-location", { name: "location", exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
46
|
+
n("nylas-event-description", { name: "description", exportparts: "nedesc, nedesc__textarea" })
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
),
|
|
50
|
+
n(
|
|
51
|
+
"div",
|
|
52
|
+
{ key: `availability-${e}`, class: { hide: a !== u.Availability } },
|
|
53
|
+
n("nylas-participant-booking-calendars", { participants: t.participants, name: "participant-booking-calendars", exportparts: "npbc, npbc__header, npbc__content, npbc__participant-container, npbc__participant-title" }),
|
|
54
|
+
n("nylas-connected-calendars", { participants: t.participants, name: "connected-calendars", exportparts: "nccals, nccals__header, nccals__content, nccals__container, nccals__title, nccals__toggle-container, npbc__participant-toggle-container" }),
|
|
55
|
+
n("nylas-availability-picker", { name: "availability", exportparts: "nap, nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
|
|
56
|
+
),
|
|
57
|
+
n(
|
|
58
|
+
"div",
|
|
59
|
+
{ key: `booking-options-${e}`, class: { hide: a !== u.BookingOptions } },
|
|
60
|
+
n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
61
|
+
n(
|
|
62
|
+
"nylas-custom-booking-flow",
|
|
63
|
+
{ exportparts: "ncbflow, ncbflow__header, ncbflow__title, ncbflow__content" },
|
|
64
|
+
n(
|
|
65
|
+
"div",
|
|
66
|
+
{ slot: "inputs" },
|
|
67
|
+
n("nylas-booking-confirmation-type", { name: "confirmation-type", exportparts: "nbct, nbct__header, nbct__dropdown, nbct__dropdown-button, nbct__dropdown-content" }),
|
|
68
|
+
n("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
|
|
69
|
+
)
|
|
70
|
+
),
|
|
71
|
+
n("nylas-buffer-time", { name: "buffer-time", exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
|
|
72
|
+
n(
|
|
73
|
+
"nylas-event-limits",
|
|
74
|
+
null,
|
|
75
|
+
n(
|
|
76
|
+
"div",
|
|
77
|
+
{ slot: "inputs" },
|
|
78
|
+
n("nylas-min-booking-notice", { name: "min-booking-notice", exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
|
|
79
|
+
n("nylas-limit-future-bookings", { name: "limit-future-bookings", exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
80
|
+
n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
81
|
+
n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
n("nylas-timeslot-interval", { name: "timeslot-interval", exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
85
|
+
n("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
86
|
+
),
|
|
87
|
+
n(
|
|
88
|
+
"div",
|
|
89
|
+
{ key: `communications-${e}`, class: { hide: a !== u.Communications } },
|
|
90
|
+
n("nylas-disable-emails", { name: "disable-emails", exportparts: "nde, nde__toggle-label, nde_toggle-input, nde_toggle-slider" }),
|
|
91
|
+
!(t != null && t.disableEmails) && n(
|
|
92
|
+
he,
|
|
93
|
+
null,
|
|
94
|
+
n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
|
|
95
|
+
n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
|
|
96
|
+
)
|
|
97
|
+
),
|
|
98
|
+
n(
|
|
99
|
+
"div",
|
|
100
|
+
{ key: `participants-${e}`, class: { hide: a !== u.Participants } },
|
|
101
|
+
n("nylas-additional-participants", { name: "participants", exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
|
|
102
|
+
n("nylas-participants-custom-availability", { participants: t.participants, name: "participant-custom-availability", exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
|
|
103
|
+
),
|
|
104
|
+
n(
|
|
105
|
+
"div",
|
|
106
|
+
{ key: `page-styles-${e}`, class: { hide: a !== u.PageStyles } },
|
|
107
|
+
n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
108
|
+
n("nylas-page-name", { name: "page-name", exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
|
|
109
|
+
n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
|
|
110
|
+
),
|
|
111
|
+
n(
|
|
112
|
+
"div",
|
|
113
|
+
{ key: `booking-form-${e}`, class: { hide: a !== u.BookingForm } },
|
|
114
|
+
n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
const dt = '.sc-nylas-editor-tabs-h{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}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column;height:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:calc(100% - 80px);display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{border-right:none}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;text-align:left;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:last-of-type{margin-bottom:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto;overflow-x:hidden}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}button-component#report-issue.sc-nylas-editor-tabs{width:auto}nylas-feedback-form.sc-nylas-editor-tabs{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', ct = dt;
|
|
119
|
+
var pt = function(e, t, a, s) {
|
|
120
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
121
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
122
|
+
o = Reflect.decorate(e, t, a, s);
|
|
123
|
+
else
|
|
124
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
125
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
126
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
127
|
+
}, de = function(e, t) {
|
|
128
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
129
|
+
return Reflect.metadata(e, t);
|
|
130
|
+
};
|
|
131
|
+
const Je = class {
|
|
132
|
+
constructor(e) {
|
|
133
|
+
K(this, e), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = m(this, "schedulerConfigCreated", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = m(this, "schedulerEditorFormUpdated", 7), this.formSubmissionHandler = async (t) => {
|
|
134
|
+
var fe, ye, ge, me, _e, ve, we, ke, Ce, xe, Se, Ee, Te, Fe, Le, Pe, Oe;
|
|
135
|
+
t.preventDefault();
|
|
136
|
+
const a = await this.formSubmitted.emit();
|
|
137
|
+
if (b("[nylas-editor-tabs]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
|
|
138
|
+
this.error = this.formRef.validationMessage || p.t("fixFormErrors");
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
142
|
+
const i = this.updateFormState();
|
|
143
|
+
b("[nylas-editor-tabs]", "formState", i);
|
|
144
|
+
const { title: o, description: l, duration: r, availability: d, bookingCalendar: c, location: h, bookingType: C, buffer: L, availableDaysInFuture: B, minCancellationNotice: H, minBookingNotice: P, cancellationPolicy: z, timeslotInterval: x, additionalGuestsHidden: U, hideCancellationOptions: D, hideReschedulingOptions: I, participants: S, participantOpenHours: v, additionalFields: g, participantCalendars: _, conferencing: G, participantBookingCalendars: k, reminders: O, emailTemplate: $, redirectUrl: Z, availabilityMethod: R, slug: N, appearance: A, name: q, disableEmails: W } = i, w = ((ye = (fe = this.selectedConfiguration) == null ? void 0 : fe.participants) == null ? void 0 : ye.find((f) => f.is_organizer)) || (S == null ? void 0 : S.find((f) => f.is_organizer)), j = _ && (w != null && w.email) ? _[w == null ? void 0 : w.email] : [], E = ((ge = w == null ? void 0 : w.booking) == null ? void 0 : ge.calendar_id) || c, T = r ? parseInt(r) : 30, M = S && (S == null ? void 0 : S.length) > 0 ? S : [
|
|
145
|
+
{
|
|
146
|
+
name: (w == null ? void 0 : w.name) ?? ((me = this.currentUser) == null ? void 0 : me.name) ?? "",
|
|
147
|
+
email: (w == null ? void 0 : w.email) ?? ((_e = this.currentUser) == null ? void 0 : _e.email) ?? "",
|
|
148
|
+
is_organizer: !0,
|
|
149
|
+
timezone: (d == null ? void 0 : d.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
150
|
+
availability: {
|
|
151
|
+
calendar_ids: c && c !== "" ? [c] : ["primary"],
|
|
152
|
+
open_hours: []
|
|
153
|
+
},
|
|
154
|
+
booking: {
|
|
155
|
+
calendar_id: c && c !== "" ? c : "primary"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
let J = R || (((ke = (we = (ve = this.selectedConfiguration) == null ? void 0 : ve.availability) == null ? void 0 : we.availability_rules) == null ? void 0 : ke.availability_method) ?? "collective");
|
|
160
|
+
this.selectedEventType && this.selectedEventType !== F.group && (J = this.selectedEventType === F.one_on_one ? F.collective : this.selectedEventType), console.log("availabilityMethodSelected", J);
|
|
161
|
+
const Q = {
|
|
162
|
+
...((Ce = this.selectedConfiguration) == null ? void 0 : Ce.id) && { id: this.selectedConfiguration.id },
|
|
163
|
+
version: ((xe = this.selectedConfiguration) == null ? void 0 : xe.version) ?? "1.0.0",
|
|
164
|
+
slug: N,
|
|
165
|
+
name: q,
|
|
166
|
+
availability: {
|
|
167
|
+
duration_minutes: T,
|
|
168
|
+
interval_minutes: (x == null ? void 0 : x.interval) ?? T,
|
|
169
|
+
round_to: x == null ? void 0 : x.roundTo,
|
|
170
|
+
availability_rules: {
|
|
171
|
+
availability_method: J,
|
|
172
|
+
buffer: L || { before: 0, after: 0 },
|
|
173
|
+
default_open_hours: (d == null ? void 0 : d.openHours) ?? ((Te = (Ee = (Se = this.selectedConfiguration) == null ? void 0 : Se.availability) == null ? void 0 : Ee.availability_rules) == null ? void 0 : Te.default_open_hours) ?? Ne,
|
|
174
|
+
round_robin_group_id: ((Pe = (Le = (Fe = this.selectedConfiguration) == null ? void 0 : Fe.availability) == null ? void 0 : Le.availability_rules) == null ? void 0 : Pe.round_robin_group_id) ?? ""
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
participants: [
|
|
178
|
+
...M ? M.map((f) => {
|
|
179
|
+
var Be, He, ze, Ue, De, Ie;
|
|
180
|
+
let Y = (d == null ? void 0 : d.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
181
|
+
if ((Be = v == null ? void 0 : v[f.email]) != null && Be.length && (Y = (ze = (He = v == null ? void 0 : v[f.email]) == null ? void 0 : He[0]) == null ? void 0 : ze.timezone), f.is_organizer) {
|
|
182
|
+
const Re = k != null && k[f.email] ? k == null ? void 0 : k[f.email] : E || "primary", le = _ != null && _[f.email] ? _ == null ? void 0 : _[f.email] : j != null && j.length ? j : ["primary"], Qe = le.length === 1 && le[0] === "primary";
|
|
183
|
+
return {
|
|
184
|
+
name: f.name ?? "",
|
|
185
|
+
email: f.email,
|
|
186
|
+
is_organizer: !0,
|
|
187
|
+
timezone: Y,
|
|
188
|
+
availability: {
|
|
189
|
+
calendar_ids: Qe ? [Re] : le,
|
|
190
|
+
open_hours: (v == null ? void 0 : v[f.email]) ?? ((Ue = f.availability) == null ? void 0 : Ue.open_hours) ?? []
|
|
191
|
+
},
|
|
192
|
+
booking: {
|
|
193
|
+
calendar_id: Re
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const X = k != null && k[f.email] ? { calendar_id: k == null ? void 0 : k[f.email] } : (f == null ? void 0 : f.booking) ?? void 0, re = (_ == null ? void 0 : _[f.email]) ?? ((De = f.availability) == null ? void 0 : De.calendar_ids) ?? ["primary"], Ke = re.length === 1 && re[0] === "primary";
|
|
198
|
+
return {
|
|
199
|
+
...f,
|
|
200
|
+
timezone: Y,
|
|
201
|
+
availability: f.availability ? {
|
|
202
|
+
calendar_ids: Ke && typeof X < "u" ? [X == null ? void 0 : X.calendar_id] : re,
|
|
203
|
+
open_hours: (v == null ? void 0 : v[f.email]) ?? ((Ie = f.availability) == null ? void 0 : Ie.open_hours) ?? []
|
|
204
|
+
} : void 0,
|
|
205
|
+
booking: X
|
|
206
|
+
};
|
|
207
|
+
}) : []
|
|
208
|
+
],
|
|
209
|
+
event_booking: {
|
|
210
|
+
title: (o == null ? void 0 : o.toString()) ?? "",
|
|
211
|
+
description: (l == null ? void 0 : l.toString()) ?? "",
|
|
212
|
+
location: (h == null ? void 0 : h.toString()) ?? "",
|
|
213
|
+
booking_type: (C == null ? void 0 : C.toString()) ?? "booking",
|
|
214
|
+
timezone: (d == null ? void 0 : d.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
215
|
+
conferencing: G,
|
|
216
|
+
reminders: O,
|
|
217
|
+
disable_emails: typeof W == "boolean" ? W : !1
|
|
218
|
+
},
|
|
219
|
+
scheduler: {
|
|
220
|
+
cancellation_policy: z ?? "",
|
|
221
|
+
available_days_in_future: B ?? 30,
|
|
222
|
+
min_cancellation_notice: H ?? 0,
|
|
223
|
+
min_booking_notice: P ?? 60,
|
|
224
|
+
hide_additional_guests: U ?? !1,
|
|
225
|
+
hide_cancellation_options: D ?? !1,
|
|
226
|
+
hide_rescheduling_options: I ?? !1,
|
|
227
|
+
additional_fields: g,
|
|
228
|
+
email_template: $,
|
|
229
|
+
confirmation_redirect_url: Z
|
|
230
|
+
},
|
|
231
|
+
appearance: A
|
|
232
|
+
}, ee = ue(this.selectedConfiguration, Q || {}), V = this.action === "create" ? ee : Q;
|
|
233
|
+
this.isConfigRoundRobin(V) && (V.participants = V.participants.map((f) => ({ ...f, is_organizer: void 0 })));
|
|
234
|
+
const te = (f) => {
|
|
235
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
236
|
+
this.changesSaved = !1;
|
|
237
|
+
}, 5e3);
|
|
238
|
+
}, ne = this.checkForBookingFormErrors(V), qe = ((Oe = this.configurations) == null ? void 0 : Oe.find((f) => {
|
|
239
|
+
var Y;
|
|
240
|
+
return f.id === ((Y = this.selectedConfiguration) == null ? void 0 : Y.id);
|
|
241
|
+
})) || {}, Ye = this.checkForOrganizerConfirmationError(ue(V, qe));
|
|
242
|
+
ne || Ye || this.schedulerConfigChanged.emit({ config: V, resetLoadingState: te, action: this.action, host: this.host });
|
|
243
|
+
}, this.isConfigRoundRobin = (t) => {
|
|
244
|
+
var a, s, i, o;
|
|
245
|
+
return ((s = (a = t == null ? void 0 : t.availability) == null ? void 0 : a.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((o = (i = t.availability) == null ? void 0 : i.availability_rules) == null ? void 0 : o.availability_method) === "max-fairness";
|
|
246
|
+
}, this.checkForOrganizerConfirmationError = (t) => {
|
|
247
|
+
var l, r;
|
|
248
|
+
let a = !1, s = "";
|
|
249
|
+
const i = ((l = t.event_booking) == null ? void 0 : l.booking_type) === "organizer-confirmation", o = (r = t.scheduler) == null ? void 0 : r.organizer_confirmation_url;
|
|
250
|
+
return i && !o && (s += "Organizer confirmation URL is required when using organizer confirmation booking type.", a = !0), a && (this.isLoading = !1, this.host.setError(new Error(s))), a;
|
|
251
|
+
}, this.checkForBookingFormErrors = (t) => {
|
|
252
|
+
var o;
|
|
253
|
+
let a = !1, s = "";
|
|
254
|
+
const i = (o = t.scheduler) == null ? void 0 : o.additional_fields;
|
|
255
|
+
return i && (s = p.t("nylasEditorTabs.bookingFormError"), Object.entries(i).forEach((l) => {
|
|
256
|
+
const r = l[1];
|
|
257
|
+
if (r.label === "") {
|
|
258
|
+
s += p.t("nylasEditorTabs.bookingFormError_label", { type: r.type }), a = !0;
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (r.options) {
|
|
262
|
+
for (const d of r.options)
|
|
263
|
+
if (d.trim() === "") {
|
|
264
|
+
s += p.t("nylasEditorTabs.bookingFormError_option", { label: r.label, type: r.type }), a = !0;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
})), a && (this.isLoading = !1, this.host.setError(new Error(s))), a;
|
|
269
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = u.EventInfo, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
270
|
+
}
|
|
271
|
+
configChangedHandler(e) {
|
|
272
|
+
b("[nylas-editor-tabs]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
|
|
273
|
+
...this.getFormStateFromConfig(e)
|
|
274
|
+
}, e != null && e.id ? this.action = "edit" : this.action = "create";
|
|
275
|
+
}
|
|
276
|
+
userChangedHandler(e) {
|
|
277
|
+
b("[nylas-editor-tabs]", "userChangedHandler", e), e && (this.formState = {
|
|
278
|
+
...this.getFormStateFromConfig(this.selectedConfiguration)
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
selectedLanguageChangedHandler(e, t) {
|
|
282
|
+
e !== t && (p.changeLanguage(e), this.error && (this.error = p.t("fixFormErrors")));
|
|
283
|
+
}
|
|
284
|
+
async schedulerConfigCreatedEventHandler(e) {
|
|
285
|
+
return this.schedulerConfigCreated.emit(e);
|
|
286
|
+
}
|
|
287
|
+
async setError(e) {
|
|
288
|
+
this.error = e.message;
|
|
289
|
+
}
|
|
290
|
+
connectedCallback() {
|
|
291
|
+
b("[nylas-editor-tabs]", "connectedCallback");
|
|
292
|
+
}
|
|
293
|
+
componentWillLoad() {
|
|
294
|
+
b("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
295
|
+
}
|
|
296
|
+
componentDidLoad() {
|
|
297
|
+
var t, a;
|
|
298
|
+
b("[nylas-editor-tabs]", "componentDidLoad"), this.enableUserFeedback && !Me() && Ge({
|
|
299
|
+
dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
|
|
300
|
+
release: "1.4.0",
|
|
301
|
+
integrations: (s) => [
|
|
302
|
+
...s.filter((i) => !1),
|
|
303
|
+
$e({
|
|
304
|
+
colorScheme: "system",
|
|
305
|
+
autoInject: !1
|
|
306
|
+
})
|
|
307
|
+
],
|
|
308
|
+
autoSessionTracking: !1,
|
|
309
|
+
beforeSend: () => null
|
|
310
|
+
}), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
|
|
311
|
+
const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
|
|
312
|
+
e && (this.activeTab = e);
|
|
313
|
+
}
|
|
314
|
+
disconnectedCallback() {
|
|
315
|
+
b("[nylas-editor-tabs]", "disconnectedCallback");
|
|
316
|
+
}
|
|
317
|
+
handleValueChanged(e) {
|
|
318
|
+
b("[nylas-editor-tabs]", "handleValueChanged", e);
|
|
319
|
+
const { name: t, value: a } = e.detail;
|
|
320
|
+
console.log("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, this.error = "", et.includes(t) && (this.hasUnsavedChanges = !0), this.schedulerEditorFormUpdated.emit({
|
|
321
|
+
value: e.detail.value,
|
|
322
|
+
name: e.detail.name
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
feedbackModalClosedHandler() {
|
|
326
|
+
this.showFeedbackModal = !1;
|
|
327
|
+
}
|
|
328
|
+
feedbackSubmittedHandler(e) {
|
|
329
|
+
var s, i, o, l, r, d;
|
|
330
|
+
const a = {
|
|
331
|
+
eventId: Ae("Scheduler Editor User Feedback", {
|
|
332
|
+
extra: {
|
|
333
|
+
configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
|
|
334
|
+
slug: (i = this.selectedConfiguration) == null ? void 0 : i.slug
|
|
335
|
+
}
|
|
336
|
+
}),
|
|
337
|
+
message: e.detail.feedback
|
|
338
|
+
};
|
|
339
|
+
je(a, {
|
|
340
|
+
includeReplay: !0,
|
|
341
|
+
captureContext: {
|
|
342
|
+
tags: {
|
|
343
|
+
"nylas-web-element": "nylas-scheduler-editor",
|
|
344
|
+
"nylas-web-element-version": "1.4.0",
|
|
345
|
+
"nylas-config-id": (o = this.selectedConfiguration) == null ? void 0 : o.id,
|
|
346
|
+
"nylas-slug": (l = this.selectedConfiguration) == null ? void 0 : l.slug,
|
|
347
|
+
"host-url": window.location.href
|
|
348
|
+
},
|
|
349
|
+
extra: {
|
|
350
|
+
configId: (r = this.selectedConfiguration) == null ? void 0 : r.id,
|
|
351
|
+
slug: (d = this.selectedConfiguration) == null ? void 0 : d.slug
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}), this.showFeedbackModal = !1;
|
|
355
|
+
}
|
|
356
|
+
getFormStateFromConfig(e) {
|
|
357
|
+
var a, s, i, o, l, r, d, c, h, C, L, B, H, P, z, x, U, D, I, S, v, g, _, G, k, O, $, Z, R, N, A, q, W, w, j;
|
|
358
|
+
let t = (a = e == null ? void 0 : e.participants) == null ? void 0 : a.find((E) => E.is_organizer);
|
|
359
|
+
return !t && ((i = (s = e == null ? void 0 : e.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : i.availability_method) !== "collective" && (t = (o = e == null ? void 0 : e.participants) == null ? void 0 : o.find((E) => {
|
|
360
|
+
var T;
|
|
361
|
+
return E.email === ((T = this.currentUser) == null ? void 0 : T.email);
|
|
362
|
+
}), t && (t.is_organizer = !0)), e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
|
|
363
|
+
title: ((l = e == null ? void 0 : e.event_booking) == null ? void 0 : l.title) ?? "",
|
|
364
|
+
description: ((r = e == null ? void 0 : e.event_booking) == null ? void 0 : r.description) ?? "",
|
|
365
|
+
duration: ((c = (d = e == null ? void 0 : e.availability) == null ? void 0 : d.duration_minutes) == null ? void 0 : c.toString()) ?? "30",
|
|
366
|
+
availability: {
|
|
367
|
+
timezone: ((h = e == null ? void 0 : e.event_booking) == null ? void 0 : h.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
368
|
+
openHours: ((L = (C = e == null ? void 0 : e.availability) == null ? void 0 : C.availability_rules) == null ? void 0 : L.default_open_hours) ?? Ne
|
|
369
|
+
},
|
|
370
|
+
additionalFields: ((B = e == null ? void 0 : e.scheduler) == null ? void 0 : B.additional_fields) ?? {},
|
|
371
|
+
conferencing: ((H = e == null ? void 0 : e.event_booking) == null ? void 0 : H.conferencing) ?? {},
|
|
372
|
+
calendarIds: ((P = t == null ? void 0 : t.availability) == null ? void 0 : P.calendar_ids) ?? [],
|
|
373
|
+
participants: (e == null ? void 0 : e.participants) ?? [],
|
|
374
|
+
bookingCalendar: ((z = t == null ? void 0 : t.booking) == null ? void 0 : z.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
|
|
375
|
+
location: ((x = e == null ? void 0 : e.event_booking) == null ? void 0 : x.location) ?? "",
|
|
376
|
+
bookingType: ((U = e == null ? void 0 : e.event_booking) == null ? void 0 : U.booking_type) ?? "booking",
|
|
377
|
+
buffer: ((I = (D = e == null ? void 0 : e.availability) == null ? void 0 : D.availability_rules) == null ? void 0 : I.buffer) ?? { before: 0, after: 0 },
|
|
378
|
+
cancellationPolicy: ((S = e == null ? void 0 : e.scheduler) == null ? void 0 : S.cancellation_policy) ?? "",
|
|
379
|
+
availableDaysInFuture: ((v = e == null ? void 0 : e.scheduler) == null ? void 0 : v.available_days_in_future) ?? 30,
|
|
380
|
+
minCancellationNotice: ((g = e == null ? void 0 : e.scheduler) == null ? void 0 : g.min_cancellation_notice) ?? 0,
|
|
381
|
+
minBookingNotice: ((_ = e == null ? void 0 : e.scheduler) == null ? void 0 : _.min_booking_notice) ?? 60,
|
|
382
|
+
timeslotInterval: {
|
|
383
|
+
interval: ((G = e == null ? void 0 : e.availability) == null ? void 0 : G.interval_minutes) ?? ((k = e == null ? void 0 : e.availability) == null ? void 0 : k.duration_minutes),
|
|
384
|
+
roundTo: (O = e == null ? void 0 : e.availability) == null ? void 0 : O.round_to
|
|
385
|
+
},
|
|
386
|
+
additionalGuestsHidden: (($ = e == null ? void 0 : e.scheduler) == null ? void 0 : $.hide_additional_guests) ?? !1,
|
|
387
|
+
hideCancellationOptions: ((Z = e == null ? void 0 : e.scheduler) == null ? void 0 : Z.hide_cancellation_options) ?? !1,
|
|
388
|
+
hideReschedulingOptions: ((R = e == null ? void 0 : e.scheduler) == null ? void 0 : R.hide_rescheduling_options) ?? !1,
|
|
389
|
+
participantBookingCalendars: ((N = e == null ? void 0 : e.participants) == null ? void 0 : N.reduce((E, T) => {
|
|
390
|
+
var M, J;
|
|
391
|
+
return (M = T.booking) != null && M.calendar_id && (E[T.email] = (J = T.booking) == null ? void 0 : J.calendar_id), E;
|
|
392
|
+
})) ?? {},
|
|
393
|
+
participantCalendars: ((A = e == null ? void 0 : e.participants) == null ? void 0 : A.reduce((E, T) => {
|
|
394
|
+
var M;
|
|
395
|
+
return E[T.email] = (M = T.availability) == null ? void 0 : M.calendar_ids, E;
|
|
396
|
+
}, {})) ?? {},
|
|
397
|
+
reminders: (q = e == null ? void 0 : e.event_booking) == null ? void 0 : q.reminders,
|
|
398
|
+
emailTemplate: (W = e == null ? void 0 : e.scheduler) == null ? void 0 : W.email_template,
|
|
399
|
+
redirectUrl: (w = e == null ? void 0 : e.scheduler) == null ? void 0 : w.confirmation_redirect_url,
|
|
400
|
+
slug: e == null ? void 0 : e.slug,
|
|
401
|
+
appearance: e == null ? void 0 : e.appearance,
|
|
402
|
+
name: e == null ? void 0 : e.name,
|
|
403
|
+
disableEmails: (j = e == null ? void 0 : e.event_booking) == null ? void 0 : j.disable_emails
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
setFormState(e, t) {
|
|
407
|
+
switch (t) {
|
|
408
|
+
case "title":
|
|
409
|
+
this.formState.title = e.toString();
|
|
410
|
+
break;
|
|
411
|
+
case "description":
|
|
412
|
+
this.formState.description = e.toString();
|
|
413
|
+
break;
|
|
414
|
+
case "duration":
|
|
415
|
+
this.formState.duration = e.toString();
|
|
416
|
+
break;
|
|
417
|
+
case "availability":
|
|
418
|
+
this.formState.availability = JSON.parse(e.toString());
|
|
419
|
+
break;
|
|
420
|
+
case "participants":
|
|
421
|
+
this.formState.participants = JSON.parse(e.toString());
|
|
422
|
+
break;
|
|
423
|
+
case "booking-calendar":
|
|
424
|
+
this.formState.bookingCalendar = e.toString();
|
|
425
|
+
break;
|
|
426
|
+
case "participant-booking-calendars":
|
|
427
|
+
this.formState.participantBookingCalendars = JSON.parse(e.toString());
|
|
428
|
+
break;
|
|
429
|
+
case "location":
|
|
430
|
+
this.formState.location = e.toString();
|
|
431
|
+
break;
|
|
432
|
+
case "conference":
|
|
433
|
+
this.formState.conferencing = JSON.parse(e.toString());
|
|
434
|
+
break;
|
|
435
|
+
case "confirmation-type":
|
|
436
|
+
this.formState.bookingType = e.toString();
|
|
437
|
+
break;
|
|
438
|
+
case "buffer-time":
|
|
439
|
+
this.formState.buffer = JSON.parse(e.toString());
|
|
440
|
+
break;
|
|
441
|
+
case "limit-future-bookings":
|
|
442
|
+
this.formState.availableDaysInFuture = parseInt(e.toString());
|
|
443
|
+
break;
|
|
444
|
+
case "min-cancellation-notice":
|
|
445
|
+
this.formState.minCancellationNotice = parseInt(e.toString());
|
|
446
|
+
break;
|
|
447
|
+
case "min-booking-notice":
|
|
448
|
+
this.formState.minBookingNotice = parseInt(e.toString());
|
|
449
|
+
break;
|
|
450
|
+
case "cancellation-policy":
|
|
451
|
+
this.formState.cancellationPolicy = e.toString();
|
|
452
|
+
break;
|
|
453
|
+
case "timeslot-interval":
|
|
454
|
+
this.formState.timeslotInterval = JSON.parse(e.toString());
|
|
455
|
+
break;
|
|
456
|
+
case "customize-booking-settings": {
|
|
457
|
+
const a = JSON.parse(e.toString());
|
|
458
|
+
this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
case "participant-custom-availability": {
|
|
462
|
+
const a = JSON.parse(e.toString());
|
|
463
|
+
this.formState.participantOpenHours = a;
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
case "additional-fields":
|
|
467
|
+
this.formState.additionalFields = JSON.parse(e.toString());
|
|
468
|
+
break;
|
|
469
|
+
case "connected-calendars":
|
|
470
|
+
this.formState.participantCalendars = JSON.parse(e.toString());
|
|
471
|
+
break;
|
|
472
|
+
case "confirmation-email-template":
|
|
473
|
+
this.formState.emailTemplate = JSON.parse(e.toString());
|
|
474
|
+
break;
|
|
475
|
+
case "disable-emails":
|
|
476
|
+
this.formState.disableEmails = JSON.parse(e.toString());
|
|
477
|
+
break;
|
|
478
|
+
case "reminder-overrides":
|
|
479
|
+
this.formState.reminders = JSON.parse(e.toString());
|
|
480
|
+
break;
|
|
481
|
+
case "confirmation-redirect":
|
|
482
|
+
this.formState.redirectUrl = e.toString();
|
|
483
|
+
break;
|
|
484
|
+
case "availability-method":
|
|
485
|
+
this.formState.availabilityMethod = e.toString();
|
|
486
|
+
break;
|
|
487
|
+
case "custom-event-slug":
|
|
488
|
+
console.debug("custom-event-slug", e), this.formState.slug = JSON.parse(e.toString());
|
|
489
|
+
break;
|
|
490
|
+
case "page-styling":
|
|
491
|
+
this.formState.appearance = JSON.parse(e.toString());
|
|
492
|
+
break;
|
|
493
|
+
case "page-name":
|
|
494
|
+
this.formState.name = JSON.parse(e.toString());
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
this.schedulerEditorFormUpdated.emit({
|
|
498
|
+
value: e,
|
|
499
|
+
name: t
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
updateFormState() {
|
|
503
|
+
return new FormData(this.formRef).forEach((t, a) => {
|
|
504
|
+
this.setFormState(t, a);
|
|
505
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
506
|
+
}
|
|
507
|
+
setActiveTab(e, t) {
|
|
508
|
+
e.preventDefault(), this.updateFormState(), this.activeTab = t;
|
|
509
|
+
}
|
|
510
|
+
hideTab(e) {
|
|
511
|
+
var t;
|
|
512
|
+
return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
|
|
513
|
+
}
|
|
514
|
+
onFeedbackClick(e) {
|
|
515
|
+
e.preventDefault(), this.showFeedbackModal = !0;
|
|
516
|
+
}
|
|
517
|
+
render() {
|
|
518
|
+
var e, t;
|
|
519
|
+
return b("[nylas-editor-tabs]", "render", this.formState), n(oe, { key: "e95f2bd5f97b5d577952da0b5702d7a1a54a568c" }, n("form", { key: "73a6e5fc488f80fd36eef19dc9708d62d701fc3d", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (a) => this.formRef = a, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: u.EventInfo, class: { tab: !0, active: this.activeTab == u.EventInfo, hide: this.hideTab(u.EventInfo) }, part: "editortab__event-info net__tab-event-info", onClick: (a) => this.setActiveTab(a, u.EventInfo) }, n("calendar-info-icon", { width: "16", height: "16" }), p.t("eventInfoTab")), n("button", { name: u.Availability, class: { tab: !0, active: this.activeTab == u.Availability, hide: this.hideTab(u.Availability) }, part: "editortab__availability net__tab-availability", onClick: (a) => this.setActiveTab(a, u.Availability) }, n("calendar-patterns-icon", { width: "16", height: "16" }), p.t("availabilityTab")), n("button", { name: u.Participants, class: { tab: !0, active: this.activeTab == u.Participants, hide: this.hideTab(u.Participants) }, part: "editortab__participants net__tab-participants", onClick: (a) => this.setActiveTab(a, u.Participants) }, n("people-icon", { width: "16", height: "16" }), p.t("participantsTab")), n("button", { name: u.BookingOptions, class: { tab: !0, active: this.activeTab == u.BookingOptions, hide: this.hideTab(u.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (a) => this.setActiveTab(a, u.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), p.t("bookingOptionsTab")), n("button", { name: u.BookingForm, class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab(u.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (a) => this.setActiveTab(a, u.BookingForm) }, this.activeTab == u.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), p.t("bookingFormTab")), n("button", { name: u.Communications, class: { tab: !0, active: this.activeTab == "communications", hide: this.hideTab(u.Communications) }, onClick: (a) => this.setActiveTab(a, u.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == u.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), p.t("communicationsTab")), n("button", { name: u.PageStyles, class: { tab: !0, active: this.activeTab == "pageStyles", hide: this.hideTab(u.PageStyles) }, onClick: (a) => this.setActiveTab(a, u.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == u.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), p.t("pageStylesTab"))), n("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, n(lt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: p }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "751c322048b878002cbbe7f39dd899d1e505efc9", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "71f44ae411409a94ded7a9d5414bf7855b07d528", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (a) => this.onFeedbackClick(a) }, n("feedback-icon", null))), n("div", { key: "efdb7492b0bbc309550e79af2a9ac616c3cbb2d3", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "458f75a80780339f7e6cc51fd43fd44936866714", class: {
|
|
520
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
521
|
+
"saved-changes": this.changesSaved,
|
|
522
|
+
error: this.error !== "",
|
|
523
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
524
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? p.t("unsavedChangesLabel") : this.error == "" && this.changesSaved ? `${p.t("changesSavedLabel")}!` : ""), this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
525
|
+
a.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(ae(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
526
|
+
}, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "ccd64c6bc03139fe2f0b1a2f4409f34fd6ae1115", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
527
|
+
a.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
528
|
+
}, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, p.t("backButton")), n("button-component", { key: "1611922427370603133e91748d625f9367f7c069", type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.isLoading ? n("span", null, p.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${p.t("createButtonText")}` : `${p.t("saveChangesButtonText")}`)))), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
529
|
+
}
|
|
530
|
+
get host() {
|
|
531
|
+
return se(this);
|
|
532
|
+
}
|
|
533
|
+
static get watchers() {
|
|
534
|
+
return {
|
|
535
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
536
|
+
currentUser: ["userChangedHandler"],
|
|
537
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
pt([
|
|
542
|
+
ie({
|
|
543
|
+
name: "nylas-editor-tabs",
|
|
544
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
545
|
+
["schedulerConfig.calendars", "calendars"],
|
|
546
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
547
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
548
|
+
["schedulerConfig.configurations", "configurations"],
|
|
549
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
550
|
+
["schedulerConfig.selectedEventType", "selectedEventType"]
|
|
551
|
+
]),
|
|
552
|
+
eventToProps: {
|
|
553
|
+
schedulerConfigChanged: async (e, t) => {
|
|
554
|
+
const { resetLoadingState: a, host: s, action: i, config: o } = e.detail, l = (r) => {
|
|
555
|
+
const [d, c] = r;
|
|
556
|
+
!d && c ? s.setError(c) : d && !c && i === "create" && (s.schedulerConfigCreatedEventHandler({ config: d, action: i, host: s }), t.schedulerConfigStore.set("selectedEventType", void 0)), a && a(e);
|
|
557
|
+
};
|
|
558
|
+
if (i === "edit") {
|
|
559
|
+
const r = await t.schedulerConfig.updateConfiguration(o);
|
|
560
|
+
l(r);
|
|
561
|
+
} else {
|
|
562
|
+
const r = await t.schedulerConfig.createConfiguration(o);
|
|
563
|
+
l(r);
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
cancelButtonClick: async (e, t) => {
|
|
567
|
+
t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
|
|
568
|
+
},
|
|
569
|
+
previewButtonClicked: async (e, t) => {
|
|
570
|
+
b("[nylas-editor-tabs]", "previewButtonClicked", t);
|
|
571
|
+
},
|
|
572
|
+
formSubmitted: async (e, t) => {
|
|
573
|
+
b("[nylas-editor-tabs]", "formSubmitted", t);
|
|
574
|
+
},
|
|
575
|
+
schedulerEditorFormUpdated: async (e, t) => {
|
|
576
|
+
b("[nylas-editor-tabs]", "schedulerEditorFormUpdated", e);
|
|
577
|
+
},
|
|
578
|
+
schedulerConfigCreated: async (e, t) => {
|
|
579
|
+
b("[nylas-editor-tabs]", "schedulerConfigCreated", e);
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
localPropsToProp: /* @__PURE__ */ new Map([
|
|
583
|
+
["schedulerPreviewLink", "schedulerPreviewLink"],
|
|
584
|
+
["enableUserFeedback", "enableUserFeedback"],
|
|
585
|
+
["hideEditorTabs", "hideEditorTabs"]
|
|
586
|
+
]),
|
|
587
|
+
fireRegisterEvent: !0
|
|
588
|
+
}),
|
|
589
|
+
de("design:type", Function),
|
|
590
|
+
de("design:paramtypes", []),
|
|
591
|
+
de("design:returntype", void 0)
|
|
592
|
+
], Je.prototype, "render", null);
|
|
593
|
+
Je.style = ct;
|
|
594
|
+
var y;
|
|
595
|
+
(function(e) {
|
|
596
|
+
e.BookingOptions = "bookingOptions", e.Communications = "communications", e.BookingForm = "bookingForm", e.PageStyles = "pageStyles", e.CalendarView = "calendarView";
|
|
597
|
+
})(y || (y = {}));
|
|
598
|
+
function bt({ id: e, activeTab: t, i18next: a }, s) {
|
|
599
|
+
return n(
|
|
600
|
+
he,
|
|
601
|
+
null,
|
|
602
|
+
t === y.CalendarView && n(
|
|
603
|
+
"div",
|
|
604
|
+
{ key: `calendar-view-${e}`, class: { hide: t !== y.CalendarView, "calendar-view": !0 } },
|
|
605
|
+
n("nylas-event-calendar", null)
|
|
606
|
+
),
|
|
607
|
+
n(
|
|
608
|
+
"div",
|
|
609
|
+
{ key: `booking-options-${e}`, class: { hide: t !== y.BookingOptions } },
|
|
610
|
+
n("nylas-scheduling-method", { name: "availability-method", readOnly: !0, exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
611
|
+
n(
|
|
612
|
+
"nylas-event-limits",
|
|
613
|
+
null,
|
|
614
|
+
n(
|
|
615
|
+
"div",
|
|
616
|
+
{ slot: "inputs" },
|
|
617
|
+
n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
618
|
+
n("nylas-cancellation-policy", { name: "cancellation-policy", exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
619
|
+
)
|
|
620
|
+
),
|
|
621
|
+
n("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
622
|
+
),
|
|
623
|
+
n(
|
|
624
|
+
"div",
|
|
625
|
+
{ key: `communications-${e}`, class: { hide: t !== y.Communications } },
|
|
626
|
+
n(
|
|
627
|
+
"div",
|
|
628
|
+
{ class: "tab-header" },
|
|
629
|
+
n("h3", null, a.t("eventCommunicationsTitle")),
|
|
630
|
+
n("p", null, a.t("eventCommunicationsDescription"))
|
|
631
|
+
),
|
|
632
|
+
n("nylas-confirmation-email", { name: "confirmation-email-template", exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
|
|
633
|
+
n("nylas-reminder-emails", { name: "reminder-overrides", exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nrt, nrt__number-dropdown, nrt__number-dropdown-button, nrt__number-dropdown-content, nrt__period-dropdown, nrt__period-dropdown-button, nrt__period-dropdown-content, nrt__time-period-selector" })
|
|
634
|
+
),
|
|
635
|
+
n(
|
|
636
|
+
"div",
|
|
637
|
+
{ key: `page-styles-${e}`, class: { hide: t !== y.PageStyles } },
|
|
638
|
+
n("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
639
|
+
n("nylas-page-name", { name: "page-name", exportparts: "npn, npn__body, npn__header, npn__drawer-toggle--container, npn__input-textfield" }),
|
|
640
|
+
n("nylas-page-styling", { name: "page-styling", exportparts: "nps, nps__header, nps__drawer-toggle--container, nps__body, nps__title-input-textfield, nps__company-logo-input-textfield, nps__color-picker, nps__color-picker-button, nps__color-picker-button-label, nps__color-picker-selected-label, nps__submit-button-label-input-textfield, nps__message-textarea" }, s)
|
|
641
|
+
),
|
|
642
|
+
n(
|
|
643
|
+
"div",
|
|
644
|
+
{ key: `booking-form-${e}`, class: { hide: t !== y.BookingForm } },
|
|
645
|
+
n("nylas-booking-form-config", { name: "additional-fields", exportparts: "nbfc, nbfc__header, nbfc__add_field, nbfc__add_field-button, nbfc__add_field-content, nbfc__static_fields, nbfc__additional_fields, nbfc__form-field, nbfc__form-field-header, nbfc__form-field-content" })
|
|
646
|
+
)
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
const ut = '.sc-nylas-editor-tabs-group-h{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}.scheduler-editor.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;height:inherit;position:relative}.scheduler-editor.sc-nylas-editor-tabs-group div.return-to-calendar-view.sc-nylas-editor-tabs-group{display:flex;border-bottom:1px solid var(--nylas-base-200)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:grid;grid-template-columns:minmax(224px, 25%) 1fr;height:auto;overflow-y:auto;min-height:calc(100% - 80px - 48px)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group{display:table-column-group;height:auto;min-height:calc(100% - 80px - 196px - 48px)}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group{border-right:none}}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group{display:flex;align-items:center;text-align:left;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.sc-nylas-editor-tabs-group:last-of-type{margin-bottom:0.25rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.active.sc-nylas-editor-tabs-group{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tabs.sc-nylas-editor-tabs-group .tab.hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group{max-width:692px;overflow-y:auto;overflow-x:hidden}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .hide.sc-nylas-editor-tabs-group{display:none}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .calendar-view.sc-nylas-editor-tabs-group{position:absolute;top:0;left:0;height:calc(100% - 80px);width:-webkit-fill-available;background:var(--nylas-base-0)}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group{width:inherit}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-info.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group,.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group nylas-event-limits.sc-nylas-editor-tabs-group div[slot=inputs].sc-nylas-editor-tabs-group{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group h3.sc-nylas-editor-tabs-group{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs-group .form-contents.sc-nylas-editor-tabs-group .tab-content.sc-nylas-editor-tabs-group .tab-header.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs-group{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group{flex-direction:column;height:auto;z-index:2}}.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .preview.sc-nylas-editor-tabs-group{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{display:flex;gap:16px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group{width:100%}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group .footer-buttons__row.sc-nylas-editor-tabs-group button-component[title=Preview].sc-nylas-editor-tabs-group{width:48px}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.sc-nylas-editor-tabs-group{max-width:524px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.unsaved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.saved-changes.sc-nylas-editor-tabs-group{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error.sc-nylas-editor-tabs-group{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group p.error-full-width.sc-nylas-editor-tabs-group{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button-component.sc-nylas-editor-tabs-group{width:100%}}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs-group .buttons.sc-nylas-editor-tabs-group button.sc-nylas-editor-tabs-group span.sc-nylas-editor-tabs-group{display:flex;align-items:center;justify-content:center;gap:0.5rem}button-component#report-issue.sc-nylas-editor-tabs-group{width:auto}nylas-feedback-form.sc-nylas-editor-tabs-group{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', ht = ut;
|
|
650
|
+
var ft = function(e, t, a, s) {
|
|
651
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
652
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
653
|
+
o = Reflect.decorate(e, t, a, s);
|
|
654
|
+
else
|
|
655
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
656
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
657
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
658
|
+
}, ce = function(e, t) {
|
|
659
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
660
|
+
return Reflect.metadata(e, t);
|
|
661
|
+
};
|
|
662
|
+
const Ve = class {
|
|
663
|
+
constructor(e) {
|
|
664
|
+
K(this, e), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.schedulerConfigCreated = m(this, "schedulerConfigCreated", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = m(this, "schedulerEditorFormUpdated", 7), this.groupEventCreateTriggered = m(this, "groupEventCreateTriggered", 7), this.groupEventUpdateTriggered = m(this, "groupEventUpdateTriggered", 7), this.groupEventDeleteTriggered = m(this, "groupEventDeleteTriggered", 7), this.groupEventImportTriggered = m(this, "groupEventImportTriggered", 7), this.saveGroupEventChangesError = m(this, "saveGroupEventChangesError", 7), this.formSubmissionHandler = async (t) => {
|
|
665
|
+
var W, w, j, E, T, M, J, Q, ee, V, te;
|
|
666
|
+
t.preventDefault();
|
|
667
|
+
const a = await this.formSubmitted.emit();
|
|
668
|
+
if (b("[nylas-editor-tabs-group]", "formSubmissionHandler", a), !this.formRef.checkValidity() || a.defaultPrevented) {
|
|
669
|
+
this.error = this.formRef.validationMessage || "Please fix the form errors.";
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
673
|
+
const i = this.updateFormState();
|
|
674
|
+
b("[nylas-editor-tabs-group]", "formState", i);
|
|
675
|
+
const { title: o, description: l, bookingCalendar: r, location: d, bookingType: c, minCancellationNotice: h, cancellationPolicy: C, hideCancellationOptions: L, hideReschedulingOptions: B, additionalFields: H, conferencing: P, reminders: z, emailTemplate: x, redirectUrl: U, slug: D, appearance: I, name: S, eventCapacity: v, eventTimeslot: g, participants: _ } = i, G = {
|
|
676
|
+
...((W = this.selectedConfiguration) == null ? void 0 : W.id) && { id: this.selectedConfiguration.id },
|
|
677
|
+
slug: D,
|
|
678
|
+
name: S,
|
|
679
|
+
type: this.selectedEventType === F.group ? F.group : void 0,
|
|
680
|
+
scheduler: {
|
|
681
|
+
cancellation_policy: C ?? "",
|
|
682
|
+
min_cancellation_notice: h ?? 0,
|
|
683
|
+
hide_cancellation_options: L ?? !1,
|
|
684
|
+
hide_rescheduling_options: B ?? !1,
|
|
685
|
+
additional_fields: H,
|
|
686
|
+
email_template: x,
|
|
687
|
+
confirmation_redirect_url: U
|
|
688
|
+
},
|
|
689
|
+
appearance: I,
|
|
690
|
+
group_booking: {
|
|
691
|
+
booking_type: c || "booking",
|
|
692
|
+
disable_emails: !1,
|
|
693
|
+
reminders: z,
|
|
694
|
+
conferencing: P,
|
|
695
|
+
calendar_id: r || "primary",
|
|
696
|
+
default_capacity: v || 10
|
|
697
|
+
}
|
|
698
|
+
}, k = ue(this.selectedConfiguration, G || {}), O = this.action === "create" ? k : G;
|
|
699
|
+
delete O.availability, delete O.participants, delete O.event_booking;
|
|
700
|
+
const $ = (ne) => {
|
|
701
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
702
|
+
this.changesSaved = !1;
|
|
703
|
+
}, 3e3);
|
|
704
|
+
};
|
|
705
|
+
if (this.checkForBookingFormErrors(O))
|
|
706
|
+
return;
|
|
707
|
+
const R = {
|
|
708
|
+
name: ((w = this.currentUser) == null ? void 0 : w.name) ?? ((j = this.currentUser) == null ? void 0 : j.email) ?? "",
|
|
709
|
+
email: ((E = this.currentUser) == null ? void 0 : E.email) ?? ""
|
|
710
|
+
}, N = ((T = this.calendars) == null ? void 0 : T.find((ne) => ne.is_primary)) ?? ((M = this.calendars) == null ? void 0 : M[0]), A = [{ ...R, is_organizer: !0 }], q = (J = this.selectedConfiguration) != null && J.id ? void 0 : {
|
|
711
|
+
title: o,
|
|
712
|
+
description: l,
|
|
713
|
+
location: P ? void 0 : d,
|
|
714
|
+
conferencing: d ? void 0 : P,
|
|
715
|
+
when: {
|
|
716
|
+
start_time: ((Q = g == null ? void 0 : g.when) == null ? void 0 : Q.start_time) ?? 0,
|
|
717
|
+
end_time: ((ee = g == null ? void 0 : g.when) == null ? void 0 : ee.end_time) ?? 0,
|
|
718
|
+
start_timezone: ((V = g == null ? void 0 : g.when) == null ? void 0 : V.start_timezone) ?? "",
|
|
719
|
+
end_timezone: ((te = g == null ? void 0 : g.when) == null ? void 0 : te.end_timezone) ?? ""
|
|
720
|
+
},
|
|
721
|
+
rrule: (g == null ? void 0 : g.recurrence) ?? [],
|
|
722
|
+
calendar_id: r || (N == null ? void 0 : N.id) || "primary",
|
|
723
|
+
participants: _ != null && _.length ? _ : A,
|
|
724
|
+
organizer: R,
|
|
725
|
+
capacity: v || 10
|
|
726
|
+
};
|
|
727
|
+
this.schedulerConfigChanged.emit({ groupEvent: q || void 0, config: O, resetLoadingState: $, action: this.action, host: this.host });
|
|
728
|
+
}, this.checkForBookingFormErrors = (t) => {
|
|
729
|
+
var o;
|
|
730
|
+
let a = !1, s = "";
|
|
731
|
+
const i = (o = t.scheduler) == null ? void 0 : o.additional_fields;
|
|
732
|
+
return i && (s = "Booking form error: ", Object.entries(i).forEach((l) => {
|
|
733
|
+
const r = l[1];
|
|
734
|
+
if (r.label === "") {
|
|
735
|
+
s += `Label is required for field of type ${r.type}.`, a = !0;
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
if (r.options) {
|
|
739
|
+
for (const d of r.options)
|
|
740
|
+
if (d.trim() === "") {
|
|
741
|
+
s += `Empty option detected inside ${r.label} of type ${r.type}.`, a = !0;
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
})), a && (this.isLoading = !1, this.host.setError(new Error(s))), a;
|
|
746
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.configurations = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.enableUserFeedback = !0, this.selectedLanguage = void 0, this.selectedEventType = void 0, this.selectedGroupEvent = void 0, this.action = "create", this.showFeedbackModal = !1, this.activeTab = y.CalendarView, this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
747
|
+
}
|
|
748
|
+
configChangedHandler(e) {
|
|
749
|
+
b("[nylas-editor-tabs-group]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
|
|
750
|
+
...this.getFormStateFromConfig(e)
|
|
751
|
+
}, e != null && e.id ? this.action = "edit" : this.action = "create";
|
|
752
|
+
}
|
|
753
|
+
selectedGroupEventChangedHandler(e) {
|
|
754
|
+
var t, a, s, i, o, l, r, d, c, h, C, L, B, H, P, z, x, U, D, I, S, v, g, _, G, k, O, $, Z, R, N;
|
|
755
|
+
b("[nylas-editor-tabs-group]", "selectedGroupEventChangedHandler", e, this.selectedConfiguration), this.formState = {
|
|
756
|
+
...this.formState,
|
|
757
|
+
title: (a = (t = this.selectedGroupEvent) == null ? void 0 : t.event) == null ? void 0 : a.title,
|
|
758
|
+
description: (i = (s = this.selectedGroupEvent) == null ? void 0 : s.event) == null ? void 0 : i.description,
|
|
759
|
+
location: (l = (o = this.selectedGroupEvent) == null ? void 0 : o.event) == null ? void 0 : l.location,
|
|
760
|
+
conferencing: (d = (r = this.selectedGroupEvent) == null ? void 0 : r.event) == null ? void 0 : d.conferencing,
|
|
761
|
+
eventCapacity: (h = (c = this.selectedGroupEvent) == null ? void 0 : c.group_event_info) == null ? void 0 : h.capacity,
|
|
762
|
+
participants: (B = (L = (C = this.selectedGroupEvent) == null ? void 0 : C.group_event_info) == null ? void 0 : L.participants) == null ? void 0 : B.map((A) => ({
|
|
763
|
+
name: A.name,
|
|
764
|
+
email: A.email,
|
|
765
|
+
is_organizer: !!A.is_organizer,
|
|
766
|
+
timezone: ""
|
|
767
|
+
})),
|
|
768
|
+
eventTimeslot: (P = (H = this.selectedGroupEvent) == null ? void 0 : H.event) != null && P.when ? {
|
|
769
|
+
when: {
|
|
770
|
+
start_time: (U = (x = (z = this.selectedGroupEvent) == null ? void 0 : z.event) == null ? void 0 : x.when) == null ? void 0 : U.start_time,
|
|
771
|
+
end_time: (S = (I = (D = this.selectedGroupEvent) == null ? void 0 : D.event) == null ? void 0 : I.when) == null ? void 0 : S.end_time,
|
|
772
|
+
start_timezone: (_ = (g = (v = this.selectedGroupEvent) == null ? void 0 : v.event) == null ? void 0 : g.when) == null ? void 0 : _.start_timezone,
|
|
773
|
+
end_timezone: (O = (k = (G = this.selectedGroupEvent) == null ? void 0 : G.event) == null ? void 0 : k.when) == null ? void 0 : O.end_timezone
|
|
774
|
+
},
|
|
775
|
+
recurrence: (Z = ($ = this.selectedGroupEvent) == null ? void 0 : $.group_event_info) != null && Z.rrule ? (N = (R = this.selectedGroupEvent) == null ? void 0 : R.group_event_info) == null ? void 0 : N.rrule : []
|
|
776
|
+
} : void 0
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
userChangedHandler(e) {
|
|
780
|
+
b("[nylas-editor-tabs-group]", "userChangedHandler", e), e && (this.formState = {
|
|
781
|
+
...this.getFormStateFromConfig(this.selectedConfiguration)
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
selectedLanguageChangedHandler(e, t) {
|
|
785
|
+
e !== t && p.changeLanguage(e);
|
|
786
|
+
}
|
|
787
|
+
async schedulerConfigCreatedEventHandler(e) {
|
|
788
|
+
return this.schedulerConfigCreated.emit(e);
|
|
789
|
+
}
|
|
790
|
+
async setError(e) {
|
|
791
|
+
this.error = e.message;
|
|
792
|
+
}
|
|
793
|
+
async resetError() {
|
|
794
|
+
this.error = "";
|
|
795
|
+
}
|
|
796
|
+
connectedCallback() {
|
|
797
|
+
b("[nylas-editor-tabs-group]", "connectedCallback");
|
|
798
|
+
}
|
|
799
|
+
componentWillLoad() {
|
|
800
|
+
b("[nylas-editor-tabs-group]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
801
|
+
}
|
|
802
|
+
componentDidLoad() {
|
|
803
|
+
var t, a, s;
|
|
804
|
+
b("[nylas-editor-tabs-group]", "componentDidLoad"), this.enableUserFeedback && !Me() && Ge({
|
|
805
|
+
dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
|
|
806
|
+
release: "1.4.0",
|
|
807
|
+
integrations: (i) => [
|
|
808
|
+
...i.filter((o) => !1),
|
|
809
|
+
$e({
|
|
810
|
+
colorScheme: "system",
|
|
811
|
+
autoInject: !1
|
|
812
|
+
})
|
|
813
|
+
],
|
|
814
|
+
autoSessionTracking: !1,
|
|
815
|
+
beforeSend: () => null
|
|
816
|
+
}), (t = this.selectedConfiguration) != null && t.id && this.configChangedHandler(this.selectedConfiguration);
|
|
817
|
+
const e = (a = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : a.name;
|
|
818
|
+
e && ((s = this.hideEditorTabs) != null && s.includes(this.activeTab)) && (this.activeTab = e), this.updateFormState();
|
|
819
|
+
}
|
|
820
|
+
disconnectedCallback() {
|
|
821
|
+
b("[nylas-editor-tabs-group]", "disconnectedCallback");
|
|
822
|
+
}
|
|
823
|
+
handleValueChanged(e) {
|
|
824
|
+
b("[nylas-editor-tabs-group]", "handleValueChanged", e);
|
|
825
|
+
const { name: t, value: a } = e.detail;
|
|
826
|
+
console.log("name", t, "value", a), this.setFormState(a, t), this.formState = { ...this.formState }, tt.includes(t) && (this.hasUnsavedChanges = !0), this.error = "", this.schedulerEditorFormUpdated.emit({
|
|
827
|
+
value: e.detail.value,
|
|
828
|
+
name: e.detail.name
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
feedbackModalClosedHandler() {
|
|
832
|
+
this.showFeedbackModal = !1;
|
|
833
|
+
}
|
|
834
|
+
feedbackSubmittedHandler(e) {
|
|
835
|
+
var s, i;
|
|
836
|
+
const a = {
|
|
837
|
+
eventId: Ae("Scheduler Editor User Feedback"),
|
|
838
|
+
message: e.detail.feedback
|
|
839
|
+
};
|
|
840
|
+
je(a, {
|
|
841
|
+
includeReplay: !0,
|
|
842
|
+
captureContext: {
|
|
843
|
+
tags: {
|
|
844
|
+
"nylas-web-element": "nylas-scheduler-editor",
|
|
845
|
+
"nylas-web-element-version": "1.4.0"
|
|
846
|
+
},
|
|
847
|
+
extra: {
|
|
848
|
+
configId: (s = this.selectedConfiguration) == null ? void 0 : s.id,
|
|
849
|
+
slug: (i = this.selectedConfiguration) == null ? void 0 : i.slug
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}), this.showFeedbackModal = !1;
|
|
853
|
+
}
|
|
854
|
+
importGroupEventHandler(e) {
|
|
855
|
+
var t;
|
|
856
|
+
this.groupEventImportTriggered.emit({ groupEvent: e.detail, configId: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "", host: this.host });
|
|
857
|
+
}
|
|
858
|
+
saveGroupEventChangesHandler(e) {
|
|
859
|
+
var s, i, o, l, r, d, c;
|
|
860
|
+
b("saveGroupEventChangesHandler", e.detail, this.selectedGroupEvent);
|
|
861
|
+
const t = this.formRef.checkValidity(), a = this.getGroupEventDetailsFromFormState();
|
|
862
|
+
if (this.resetError(), a.title || this.setError(new Error("Event title is required.")), (!((s = a.when) != null && s.start_time) || !((i = a.when) != null && i.end_time)) && this.setError(new Error("Event time is required.")), (o = a.participants) != null && o.length || this.setError(new Error("Participants are required.")), (l = a.participants) != null && l.length && ((r = a.participants) != null && r.some((h) => !h.email)) && this.setError(new Error("Participant email is required.")), this.error !== "" || !t) {
|
|
863
|
+
this.saveGroupEventChangesError.emit({
|
|
864
|
+
error: this.error ?? "An error occurred while saving changes.",
|
|
865
|
+
configId: ((d = this.selectedConfiguration) == null ? void 0 : d.id) ?? "",
|
|
866
|
+
host: this.host
|
|
867
|
+
});
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
this.groupEventUpdateTriggered.emit({
|
|
871
|
+
groupEvent: a,
|
|
872
|
+
chosenOption: e.detail.action,
|
|
873
|
+
configId: ((c = this.selectedConfiguration) == null ? void 0 : c.id) ?? "",
|
|
874
|
+
host: this.host
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
deleteGroupEventHandler(e) {
|
|
878
|
+
var a;
|
|
879
|
+
b("deleteGroupEventHandler", e.detail);
|
|
880
|
+
const t = this.getGroupEventDetailsFromFormState();
|
|
881
|
+
this.groupEventDeleteTriggered.emit({
|
|
882
|
+
groupEvent: t,
|
|
883
|
+
chosenOption: e.detail.action,
|
|
884
|
+
configId: ((a = this.selectedConfiguration) == null ? void 0 : a.id) ?? "",
|
|
885
|
+
host: this.host
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
createGroupEventHandler(e) {
|
|
889
|
+
var o, l, r, d, c, h;
|
|
890
|
+
const t = e.detail, a = {
|
|
891
|
+
name: ((o = this.currentUser) == null ? void 0 : o.name) ?? ((l = this.currentUser) == null ? void 0 : l.email) ?? "",
|
|
892
|
+
email: ((r = this.currentUser) == null ? void 0 : r.email) ?? ""
|
|
893
|
+
}, s = ((d = this.calendars) == null ? void 0 : d.find((C) => C.is_primary)) ?? ((c = this.calendars) == null ? void 0 : c[0]), i = {
|
|
894
|
+
title: t.title,
|
|
895
|
+
description: t.description,
|
|
896
|
+
location: t.conferencing ? void 0 : t.location,
|
|
897
|
+
participants: t.participants,
|
|
898
|
+
organizer: a,
|
|
899
|
+
conferencing: t.location ? void 0 : t.conferencing,
|
|
900
|
+
when: t.eventTimeslot.when,
|
|
901
|
+
rrule: t.eventTimeslot.recurrence,
|
|
902
|
+
calendar_id: (s == null ? void 0 : s.id) || "primary",
|
|
903
|
+
capacity: t.eventCapacity
|
|
904
|
+
};
|
|
905
|
+
this.groupEventCreateTriggered.emit({ groupEvent: i, configId: ((h = this.selectedConfiguration) == null ? void 0 : h.id) ?? "", host: this.host });
|
|
906
|
+
}
|
|
907
|
+
getGroupEventDetailsFromFormState() {
|
|
908
|
+
var C, L, B, H, P, z, x, U, D;
|
|
909
|
+
const e = ((C = this.calendars) == null ? void 0 : C.find((I) => I.is_primary)) ?? ((L = this.calendars) == null ? void 0 : L[0]), t = {
|
|
910
|
+
name: ((B = this.currentUser) == null ? void 0 : B.name) ?? ((H = this.currentUser) == null ? void 0 : H.email) ?? "",
|
|
911
|
+
email: ((P = this.currentUser) == null ? void 0 : P.email) ?? ""
|
|
912
|
+
}, a = [{ ...t, is_organizer: !0 }], { title: s, description: i, bookingCalendar: o, location: l, conferencing: r, eventCapacity: d, eventTimeslot: c, participants: h } = this.formState;
|
|
913
|
+
return {
|
|
914
|
+
title: s,
|
|
915
|
+
description: i,
|
|
916
|
+
location: r ? void 0 : l,
|
|
917
|
+
conferencing: l ? void 0 : r,
|
|
918
|
+
when: {
|
|
919
|
+
start_time: ((z = c == null ? void 0 : c.when) == null ? void 0 : z.start_time) ?? 0,
|
|
920
|
+
end_time: ((x = c == null ? void 0 : c.when) == null ? void 0 : x.end_time) ?? 0,
|
|
921
|
+
start_timezone: ((U = c == null ? void 0 : c.when) == null ? void 0 : U.start_timezone) ?? "",
|
|
922
|
+
end_timezone: ((D = c == null ? void 0 : c.when) == null ? void 0 : D.end_timezone) ?? ""
|
|
923
|
+
},
|
|
924
|
+
rrule: (c == null ? void 0 : c.recurrence) ?? [],
|
|
925
|
+
calendar_id: o || (e == null ? void 0 : e.id) || "primary",
|
|
926
|
+
participants: h != null && h.length ? h : a,
|
|
927
|
+
organizer: t,
|
|
928
|
+
capacity: d || 10
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
getFormStateFromConfig(e) {
|
|
932
|
+
var t, a, s, i, o, l, r, d, c, h;
|
|
933
|
+
return e != null && e.appearance && console.info("Appearance settings have been returned from the given configuration; please remember to grab them from the configSettingsLoaded event and apply them as desired."), {
|
|
934
|
+
additionalFields: ((t = e == null ? void 0 : e.scheduler) == null ? void 0 : t.additional_fields) ?? {},
|
|
935
|
+
bookingType: ((a = e == null ? void 0 : e.group_booking) == null ? void 0 : a.booking_type) ?? "booking",
|
|
936
|
+
cancellationPolicy: ((s = e == null ? void 0 : e.scheduler) == null ? void 0 : s.cancellation_policy) ?? "",
|
|
937
|
+
minCancellationNotice: ((i = e == null ? void 0 : e.scheduler) == null ? void 0 : i.min_cancellation_notice) ?? 0,
|
|
938
|
+
hideCancellationOptions: ((o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.hide_cancellation_options) ?? !1,
|
|
939
|
+
hideReschedulingOptions: ((l = e == null ? void 0 : e.scheduler) == null ? void 0 : l.hide_rescheduling_options) ?? !1,
|
|
940
|
+
reminders: (r = e == null ? void 0 : e.group_booking) == null ? void 0 : r.reminders,
|
|
941
|
+
emailTemplate: (d = e == null ? void 0 : e.scheduler) == null ? void 0 : d.email_template,
|
|
942
|
+
redirectUrl: (c = e == null ? void 0 : e.scheduler) == null ? void 0 : c.confirmation_redirect_url,
|
|
943
|
+
slug: e == null ? void 0 : e.slug,
|
|
944
|
+
appearance: e == null ? void 0 : e.appearance,
|
|
945
|
+
name: e == null ? void 0 : e.name,
|
|
946
|
+
bookingCalendar: (h = e == null ? void 0 : e.group_booking) == null ? void 0 : h.calendar_id
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
setFormState(e, t) {
|
|
950
|
+
switch (t) {
|
|
951
|
+
case "title":
|
|
952
|
+
this.formState.title = e.toString();
|
|
953
|
+
break;
|
|
954
|
+
case "description":
|
|
955
|
+
this.formState.description = e.toString();
|
|
956
|
+
break;
|
|
957
|
+
case "location":
|
|
958
|
+
this.formState.location = e.toString();
|
|
959
|
+
break;
|
|
960
|
+
case "conference":
|
|
961
|
+
this.formState.conferencing = JSON.parse(e.toString());
|
|
962
|
+
break;
|
|
963
|
+
case "confirmation-type":
|
|
964
|
+
this.formState.bookingType = e.toString();
|
|
965
|
+
break;
|
|
966
|
+
case "min-cancellation-notice":
|
|
967
|
+
this.formState.minCancellationNotice = parseInt(e.toString());
|
|
968
|
+
break;
|
|
969
|
+
case "cancellation-policy":
|
|
970
|
+
this.formState.cancellationPolicy = e.toString();
|
|
971
|
+
break;
|
|
972
|
+
case "customize-booking-settings": {
|
|
973
|
+
const a = JSON.parse(e.toString());
|
|
974
|
+
this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
|
|
975
|
+
break;
|
|
976
|
+
}
|
|
977
|
+
case "booking-calendar":
|
|
978
|
+
this.formState.bookingCalendar = e.toString();
|
|
979
|
+
break;
|
|
980
|
+
case "event-capacity":
|
|
981
|
+
this.formState.eventCapacity = parseInt(String(e));
|
|
982
|
+
break;
|
|
983
|
+
case "additional-fields":
|
|
984
|
+
this.formState.additionalFields = JSON.parse(e.toString());
|
|
985
|
+
break;
|
|
986
|
+
case "confirmation-email-template":
|
|
987
|
+
this.formState.emailTemplate = JSON.parse(e.toString());
|
|
988
|
+
break;
|
|
989
|
+
case "reminder-overrides":
|
|
990
|
+
this.formState.reminders = JSON.parse(e.toString());
|
|
991
|
+
break;
|
|
992
|
+
case "confirmation-redirect":
|
|
993
|
+
this.formState.redirectUrl = e.toString();
|
|
994
|
+
break;
|
|
995
|
+
case "custom-event-slug":
|
|
996
|
+
console.debug("custom-event-slug", e), this.formState.slug = JSON.parse(e.toString());
|
|
997
|
+
break;
|
|
998
|
+
case "page-styling":
|
|
999
|
+
this.formState.appearance = JSON.parse(e.toString());
|
|
1000
|
+
break;
|
|
1001
|
+
case "page-name":
|
|
1002
|
+
this.formState.name = JSON.parse(e.toString());
|
|
1003
|
+
break;
|
|
1004
|
+
case "participants": {
|
|
1005
|
+
const a = JSON.parse(e.toString());
|
|
1006
|
+
this.formState.participants = a.map((s) => ({
|
|
1007
|
+
name: s.name,
|
|
1008
|
+
email: s.email,
|
|
1009
|
+
is_organizer: s.is_organizer
|
|
1010
|
+
}));
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
case "event-timeslot":
|
|
1014
|
+
this.formState.eventTimeslot = JSON.parse(e.toString());
|
|
1015
|
+
break;
|
|
1016
|
+
}
|
|
1017
|
+
this.schedulerEditorFormUpdated.emit({
|
|
1018
|
+
value: e,
|
|
1019
|
+
name: t
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
updateFormState() {
|
|
1023
|
+
return new FormData(this.formRef).forEach((t, a) => {
|
|
1024
|
+
this.setFormState(t, a);
|
|
1025
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
1026
|
+
}
|
|
1027
|
+
setActiveTab(e, t) {
|
|
1028
|
+
e.preventDefault(), this.updateFormState(), this.activeTab = t;
|
|
1029
|
+
}
|
|
1030
|
+
hideTab(e) {
|
|
1031
|
+
var t;
|
|
1032
|
+
return ((t = this.hideEditorTabs) == null ? void 0 : t.includes(e)) || !1;
|
|
1033
|
+
}
|
|
1034
|
+
onFeedbackClick(e) {
|
|
1035
|
+
e.preventDefault(), this.showFeedbackModal = !0;
|
|
1036
|
+
}
|
|
1037
|
+
render() {
|
|
1038
|
+
var e, t;
|
|
1039
|
+
return b("[nylas-editor-tabs-group]", "render", this.formState), n(oe, { key: "afdf097ad3a673c5290d560773673f555319dcfb" }, n("form", { key: "7f7e51ad07c4b8f2c95a546fa847f4b14f002b15", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (a) => this.formRef = a, noValidate: !0 }, this.mode === "app" ? n("div", { class: "return-to-calendar-view", part: "editor__return-to-calendar-view net__return-to-calendar-view" }, n("button-component", { id: "return-to-calendar-view-button", variant: "invisible", part: "nset__header__back-button", type: "button", onClick: (a) => {
|
|
1040
|
+
this.setActiveTab(a, y.CalendarView);
|
|
1041
|
+
} }, n("chevron-icon", { width: "16", height: "16" }), n("span", null, "Return to Calendar view"))) : null, this.mode === "app" ? n("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, n("div", { class: "tabs", part: "editor__tabs net__tabs" }, n("button", { name: y.BookingOptions, class: { tab: !0, active: this.activeTab == y.BookingOptions, hide: this.hideTab(y.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: (a) => this.setActiveTab(a, y.BookingOptions) }, n("flow-icon", { width: "16", height: "16" }), p.t("bookingOptionsTab")), n("button", { name: y.BookingForm, class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab(y.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: (a) => this.setActiveTab(a, y.BookingForm) }, this.activeTab == y.BookingForm ? n("calendar-agenda-fill-icon", { width: "16", height: "16" }) : n("calendar-agenda-icon", { width: "16", height: "16" }), p.t("bookingFormTab")), n("button", { name: y.Communications, class: { tab: !0, active: this.activeTab == "communications", hide: this.hideTab(y.Communications) }, onClick: (a) => this.setActiveTab(a, y.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == y.Communications ? n("envelope-fill-icon", { width: "16", height: "16" }) : n("envelope-icon", { width: "16", height: "16" }), p.t("communicationsTab")), n("button", { name: y.PageStyles, class: { tab: !0, active: this.activeTab == "pageStyles", hide: this.hideTab(y.PageStyles) }, onClick: (a) => this.setActiveTab(a, y.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == y.PageStyles ? n("paintbrush-fill-icon", { width: "16", height: "16" }) : n("paintbrush-icon", { width: "16", height: "16" }), p.t("pageStylesTab"))), n("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, n(bt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new", i18next: p }))) : n("div", { class: "composable", key: (t = this.selectedConfiguration) == null ? void 0 : t.id }, n("slot", null)), n("div", { key: "922210f9a184ff3ddb83630db4ae6ee1d9dd2944", class: "footer", part: "editor__footer net__footer" }, n("div", { key: "5d8a938c31b831833ebe3030fee8da39acb12edb", class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && n("button-component", { title: "Share your feedback", id: "report-issue", variant: "basic", onClick: (a) => this.onFeedbackClick(a) }, n("feedback-icon", null)), this.activeTab === y.CalendarView && n("button-component", { title: "Go to page settings", id: "page-settings", variant: "basic", onClick: (a) => this.setActiveTab(a, y.BookingOptions) }, "Page settings")), n("div", { key: "07889582bf417de6ccc1ce5a74f2a1c39559f9c0", class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, n("p", { key: "ad80bbca9db6703743093ca6fee0bb3a949e66c6", class: {
|
|
1042
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
1043
|
+
"saved-changes": this.changesSaved,
|
|
1044
|
+
error: this.error !== "",
|
|
1045
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
1046
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved && this.activeTab !== y.CalendarView ? p.t("unsavedChangesLabel") : this.error == "" && this.changesSaved ? `${p.t("changesSavedLabel")}!` : ""), n("div", { key: "a53e7d929f8e0cdaf36d2e43e98b8703cd6f2379", class: "footer-buttons__row" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { title: "Preview", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
1047
|
+
a.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(ae(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
1048
|
+
}, variant: "basic" }, n("eye-icon", null)), n("button-component", { key: "9c048ca1576e4bd508461a172f3ffdfafcf39698", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
1049
|
+
a.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
1050
|
+
}, variant: "basic", part: "editor__footer-cancel net__footer-cancel" }, p.t("backButton")), n("button-component", { key: "778f71bc70660a4e279db51a56fda244966a5694", type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, this.isLoading ? n("span", null, p.t("savingButtonText"), n("loading-icon", null), " ") : this.action === "create" ? `${p.t("createButtonText")}` : `${p.t("saveChangesButtonText")}`))))), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
1051
|
+
}
|
|
1052
|
+
get host() {
|
|
1053
|
+
return se(this);
|
|
1054
|
+
}
|
|
1055
|
+
static get watchers() {
|
|
1056
|
+
return {
|
|
1057
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
1058
|
+
selectedGroupEvent: ["selectedGroupEventChangedHandler"],
|
|
1059
|
+
currentUser: ["userChangedHandler"],
|
|
1060
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
ft([
|
|
1065
|
+
ie({
|
|
1066
|
+
name: "nylas-editor-tabs-group",
|
|
1067
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1068
|
+
["schedulerConfig.calendars", "calendars"],
|
|
1069
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
1070
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
1071
|
+
["schedulerConfig.configurations", "configurations"],
|
|
1072
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
1073
|
+
["schedulerConfig.selectedEventType", "selectedEventType"],
|
|
1074
|
+
["schedulerConfig.selectedGroupEvent", "selectedGroupEvent"]
|
|
1075
|
+
]),
|
|
1076
|
+
eventToProps: {
|
|
1077
|
+
schedulerConfigChanged: async (e, t) => {
|
|
1078
|
+
const { resetLoadingState: a, host: s, action: i, config: o, groupEvent: l } = e.detail, r = (d) => {
|
|
1079
|
+
const [c, h] = d;
|
|
1080
|
+
!c && h ? s.setError(h) : c && !h && i === "create" && s.schedulerConfigCreatedEventHandler({ config: c, action: i, host: s });
|
|
1081
|
+
};
|
|
1082
|
+
if (i === "edit") {
|
|
1083
|
+
const d = await t.schedulerConfig.updateConfiguration(o);
|
|
1084
|
+
r(d), a && a(e);
|
|
1085
|
+
} else {
|
|
1086
|
+
const d = await t.schedulerConfig.createConfiguration(o);
|
|
1087
|
+
r(d);
|
|
1088
|
+
const [c, h] = d, C = c == null ? void 0 : c.id;
|
|
1089
|
+
if (C && l) {
|
|
1090
|
+
const L = await t.schedulerConfig.createGroupEvent(l, C);
|
|
1091
|
+
r(L);
|
|
1092
|
+
}
|
|
1093
|
+
a && a(e);
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
cancelButtonClick: async (e, t) => {
|
|
1097
|
+
t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0), t.schedulerConfigStore.set("selectedGroupEvent", void 0), t.schedulerConfigStore.set("groupEvents", []);
|
|
1098
|
+
},
|
|
1099
|
+
previewButtonClicked: async (e, t) => {
|
|
1100
|
+
b("[nylas-editor-tabs-group]", "previewButtonClicked", t);
|
|
1101
|
+
},
|
|
1102
|
+
formSubmitted: async (e, t) => {
|
|
1103
|
+
b("[nylas-editor-tabs-group]", "formSubmitted", t);
|
|
1104
|
+
},
|
|
1105
|
+
schedulerEditorFormUpdated: async (e, t) => {
|
|
1106
|
+
b("[nylas-editor-tabs-group]", "schedulerEditorFormUpdated", e);
|
|
1107
|
+
},
|
|
1108
|
+
schedulerConfigCreated: async (e, t) => {
|
|
1109
|
+
b("[nylas-editor-tabs-group]", "schedulerConfigCreated", e);
|
|
1110
|
+
},
|
|
1111
|
+
groupEventUpdateTriggered: async (e, t) => {
|
|
1112
|
+
const { groupEvent: a, host: s, chosenOption: i, configId: o } = e.detail, l = await t.schedulerConfig.updateGroupEvent(a, i, o), [r, d] = l;
|
|
1113
|
+
!r && d && s.setError(d);
|
|
1114
|
+
},
|
|
1115
|
+
groupEventDeleteTriggered: async (e, t) => {
|
|
1116
|
+
const { groupEvent: a, chosenOption: s, configId: i, host: o } = e.detail, l = await t.schedulerConfig.deleteGroupEvent(a, s, i), [r, d] = l;
|
|
1117
|
+
!r && d && o.setError(d);
|
|
1118
|
+
},
|
|
1119
|
+
groupEventCreateTriggered: async (e, t) => {
|
|
1120
|
+
const { groupEvent: a, configId: s, host: i } = e.detail, o = await t.schedulerConfig.createGroupEvent(a, s), [l, r] = o;
|
|
1121
|
+
!l && r && i.setError(r);
|
|
1122
|
+
},
|
|
1123
|
+
groupEventImportTriggered: async (e, t) => {
|
|
1124
|
+
const { groupEvent: a, configId: s, host: i } = e.detail, o = await t.schedulerConfig.importGroupEvent([a], s), [l, r] = o;
|
|
1125
|
+
if (!l && r && i.setError(r), l && l.import_failed && l.import_failed.length > 0) {
|
|
1126
|
+
const d = l.import_failed.map((c) => c.reason).join(`
|
|
1127
|
+
`);
|
|
1128
|
+
i.setError(new Error(d)), setTimeout(() => {
|
|
1129
|
+
i.resetError();
|
|
1130
|
+
}, 5e3);
|
|
1131
|
+
}
|
|
1132
|
+
},
|
|
1133
|
+
saveGroupEventChangesError: async (e, t) => {
|
|
1134
|
+
const { error: a, host: s } = e.detail;
|
|
1135
|
+
b("[nylas-editor-tabs-group]", "saveGroupEventChangesError", a, s);
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
localPropsToProp: /* @__PURE__ */ new Map([
|
|
1139
|
+
["schedulerPreviewLink", "schedulerPreviewLink"],
|
|
1140
|
+
["enableUserFeedback", "enableUserFeedback"],
|
|
1141
|
+
["hideEditorTabs", "hideEditorTabs"]
|
|
1142
|
+
]),
|
|
1143
|
+
fireRegisterEvent: !0
|
|
1144
|
+
}),
|
|
1145
|
+
ce("design:type", Function),
|
|
1146
|
+
ce("design:paramtypes", []),
|
|
1147
|
+
ce("design:returntype", void 0)
|
|
1148
|
+
], Ve.prototype, "render", null);
|
|
1149
|
+
Ve.style = ht;
|
|
1150
|
+
const yt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--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}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:16px;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;flex-direction:column;position:relative;overflow-y:hidden}.configurations .table-container{overflow-y:auto;flex:1}@media screen and (max-width: 768px){.configurations .table-container{min-height:624px}}.configurations .table-container table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations .table-container table.no-configurations{height:100%}.configurations .table-container table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations .table-container table tr.hide{display:none}.configurations .table-container table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations .table-container table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations .table-container table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations .table-container table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations .table-container table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations .table-container table th,.configurations .table-container table td{text-align:left;padding:1rem;font-family:inherit}.configurations .table-container table .actions{display:flex;justify-content:flex-end;gap:1rem;text-align:right}@media screen and (max-width: 768px){.configurations .table-container table .actions{flex-direction:column;gap:0.5rem}}.configurations .table-container table .actions select-dropdown.last::part(sd_dropdown-content){bottom:54px}.configurations .table-container table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations .table-container table .title{max-width:96px}}.configurations .table-container table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations .table-container table .title div.config-event-title{font-weight:600}.configurations .table-container table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:white;width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .pagination button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}.card-wrapper{position:absolute;top:0;left:0;height:calc(100% + 4rem);width:-webkit-fill-available;width:-moz-available;width:fill-available;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.card-wrapper{justify-content:start;height:100%}}.card-modal{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);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-modal{width:auto;border-radius:0px}}.description.title-desc{margin-bottom:2rem}.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)}', gt = yt;
|
|
1151
|
+
var mt = function(e, t, a, s) {
|
|
1152
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
1153
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1154
|
+
o = Reflect.decorate(e, t, a, s);
|
|
1155
|
+
else
|
|
1156
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1157
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
1158
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
1159
|
+
}, pe = function(e, t) {
|
|
1160
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1161
|
+
return Reflect.metadata(e, t);
|
|
1162
|
+
};
|
|
1163
|
+
const Ze = class {
|
|
1164
|
+
constructor(e) {
|
|
1165
|
+
K(this, e), this.initListConfigurations = m(this, "initListConfigurations", 7), this.createButtonClick = m(this, "createButtonClick", 7), this.editButtonClick = m(this, "editButtonClick", 7), this.deleteButtonClick = m(this, "deleteButtonClick", 7), this.configurations = [], this.selectedLanguage = void 0, this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1, this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1;
|
|
1166
|
+
}
|
|
1167
|
+
listConfigurationsNextCursorChangedHandler(e, t) {
|
|
1168
|
+
if (!e || e === t) {
|
|
1169
|
+
e === null && (this.disableNextPageButton = !0);
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
this.disableNextPageButton = !1, this.currentCursor = e;
|
|
1173
|
+
}
|
|
1174
|
+
selectedLanguageChangedHandler(e, t) {
|
|
1175
|
+
e !== t && p.changeLanguage(e);
|
|
1176
|
+
}
|
|
1177
|
+
connectedCallback() {
|
|
1178
|
+
b("[nylas-list-configurations]", "connectedCallback");
|
|
1179
|
+
}
|
|
1180
|
+
componentWillLoad() {
|
|
1181
|
+
b("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
1182
|
+
}
|
|
1183
|
+
componentDidLoad() {
|
|
1184
|
+
b("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
|
|
1185
|
+
host: this.host
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
disconnectedCallback() {
|
|
1189
|
+
b("[nylas-list-configurations]", "disconnectedCallback");
|
|
1190
|
+
}
|
|
1191
|
+
async handleNylasFormDropdownChanged(e) {
|
|
1192
|
+
var i;
|
|
1193
|
+
b("[nylas-list-configurations]", "handleNylasFormDropdownChanged", e.detail);
|
|
1194
|
+
const { value: t } = e.detail, [a, s] = t.split("-");
|
|
1195
|
+
switch (e.preventDefault(), a) {
|
|
1196
|
+
case "delete":
|
|
1197
|
+
this.deleteConfigurationId = (i = this.configurations[s]) == null ? void 0 : i.id;
|
|
1198
|
+
break;
|
|
1199
|
+
case "preview":
|
|
1200
|
+
window.open(ae(this.schedulerPreviewLink, this.configurations[s]), "_blank");
|
|
1201
|
+
break;
|
|
1202
|
+
case "copy":
|
|
1203
|
+
await navigator.clipboard.writeText(ae(this.schedulerPreviewLink, this.configurations[s]));
|
|
1204
|
+
break;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
async registerCallback() {
|
|
1208
|
+
this.initListConfigurations.emit({
|
|
1209
|
+
host: this.host
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
async getState() {
|
|
1213
|
+
return this.state;
|
|
1214
|
+
}
|
|
1215
|
+
async setState(e) {
|
|
1216
|
+
this.state = e;
|
|
1217
|
+
}
|
|
1218
|
+
async setError(e) {
|
|
1219
|
+
this.error = e;
|
|
1220
|
+
}
|
|
1221
|
+
async hideDeleteConfirmation() {
|
|
1222
|
+
this.deleteConfigurationId = "", this.showDeleteButtonLoading = !1;
|
|
1223
|
+
}
|
|
1224
|
+
closeModal(e) {
|
|
1225
|
+
e.preventDefault(), this.deleteConfigurationId = "";
|
|
1226
|
+
}
|
|
1227
|
+
handleConfirmDeleteButtonClicked(e) {
|
|
1228
|
+
e.preventDefault(), this.showDeleteButtonLoading = !0;
|
|
1229
|
+
const t = this.configurations.find((a) => a.id === this.deleteConfigurationId);
|
|
1230
|
+
t && (t != null && t.id) && this.deleteButtonClick.emit({ host: this.host, configuration: t });
|
|
1231
|
+
}
|
|
1232
|
+
getDurationString(e) {
|
|
1233
|
+
if (!e)
|
|
1234
|
+
return "—";
|
|
1235
|
+
const t = Math.floor(e / 60), a = e % 60;
|
|
1236
|
+
return `${t || ""} ${t ? `${t > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
|
|
1237
|
+
}
|
|
1238
|
+
getActionLabelHTML(e) {
|
|
1239
|
+
const t = {
|
|
1240
|
+
display: "inline-flex",
|
|
1241
|
+
alignItems: "center",
|
|
1242
|
+
gap: "0.5rem"
|
|
1243
|
+
}, a = {
|
|
1244
|
+
color: "var(--nylas-error)"
|
|
1245
|
+
};
|
|
1246
|
+
switch (e) {
|
|
1247
|
+
case "preview":
|
|
1248
|
+
return n("span", { style: t }, n("eye-icon", { width: "16", height: "16" }), p.t("nylasListConfigurations.previewButtonText"));
|
|
1249
|
+
case "copy":
|
|
1250
|
+
return n("span", { style: t }, n("copy-icon", { width: "16", height: "16" }), p.t("nylasListConfigurations.copyLinkButtonText"));
|
|
1251
|
+
case "delete":
|
|
1252
|
+
return n("span", { style: { ...t, ...a } }, n("delete-icon", { width: "15", height: "17" }), p.t("nylasListConfigurations.deleteButtonText"));
|
|
1253
|
+
default:
|
|
1254
|
+
return "";
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
previousPageClickedHandler() {
|
|
1258
|
+
if (this.previousCursors.length === 0)
|
|
1259
|
+
return;
|
|
1260
|
+
this.currentCursor = this.previousCursors.pop() || null;
|
|
1261
|
+
const e = this.previousCursors[this.previousCursors.length - 1] || void 0;
|
|
1262
|
+
this.initListConfigurations.emit({
|
|
1263
|
+
host: this.host,
|
|
1264
|
+
cursor: e
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
nextPageClickedHandler() {
|
|
1268
|
+
this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
|
|
1269
|
+
host: this.host,
|
|
1270
|
+
cursor: this.currentCursor
|
|
1271
|
+
}));
|
|
1272
|
+
}
|
|
1273
|
+
render() {
|
|
1274
|
+
var e;
|
|
1275
|
+
return n(oe, null, n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, p.t("allSchedulingPages")), n("p", null, p.t("createAndManageSchedulingPages"))), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
|
|
1276
|
+
this.createButtonClick.emit(this.host);
|
|
1277
|
+
} }, p.t("createNewSchedulingPageButtonText")))), n("div", { class: "configurations" }, n("div", { class: "table-container" }, n("table", { class: {
|
|
1278
|
+
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
1279
|
+
} }, n("tr", { class: {
|
|
1280
|
+
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
1281
|
+
} }, n("th", null, p.t("pageTitle")), n("th", null, p.t("durationTitle")), n("th", null)), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, p.t("loading"), "..."), n("p", null, p.t("loadingPagesDescription"))))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("calendar-icon", { width: "48", height: "48" }), n("h3", null, p.t("noSchedulingPages")), n("p", null, p.t("createFirstSchedulingPage")), n("button-component", { part: "nlc__create-new-cta", clickHandler: () => {
|
|
1282
|
+
this.createButtonClick.emit(this.host);
|
|
1283
|
+
} }, p.t("createNewSchedulingPageButtonText"))))), this.state !== "loading" && ((e = this.configurations) == null ? void 0 : e.map((t, a) => {
|
|
1284
|
+
var l, r, d, c;
|
|
1285
|
+
const s = (a === this.configurations.length - 1 || a === this.configurations.length - 2) && this.configurations.length > 3, i = t, o = t;
|
|
1286
|
+
return n("tr", { key: t == null ? void 0 : t.id }, n("td", null, n("div", { class: "title" }, n("div", { class: "config-event-title", title: (l = o == null ? void 0 : o.event_booking) == null ? void 0 : l.title }, ((r = o == null ? void 0 : o.event_booking) == null ? void 0 : r.title) || (i == null ? void 0 : i.name)), n("div", { class: "config-event-description" }, (d = o == null ? void 0 : o.event_booking) == null ? void 0 : d.description))), n("td", null, n("div", { class: "duration" }, this.getDurationString((c = o == null ? void 0 : o.availability) == null ? void 0 : c.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { variant: "basic", key: `edit-${a}`, clickHandler: (h) => {
|
|
1287
|
+
h.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
1288
|
+
} }, n("edit-icon", { width: "16", height: "16" }), p.t("editSchedulingPageButtonText")), n("select-dropdown", { class: {
|
|
1289
|
+
last: s
|
|
1290
|
+
}, name: "actions", options: [
|
|
1291
|
+
{ value: `preview-${a}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
|
|
1292
|
+
{ value: `copy-${a}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
|
|
1293
|
+
{ value: `delete-${a}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
|
|
1294
|
+
], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" }))));
|
|
1295
|
+
})))), n("div", { class: "pagination" }, n("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, n("chevron-icon", null)), n("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, n("chevron-icon", null)))), this.state === "error" && n("div", { class: "error-container" }, n("p", { class: "error" }, this.error)), !!this.deleteConfigurationId && n("div", { class: "card-wrapper" }, n("div", { class: "card-modal" }, n("div", { class: "close-button" }, n("button-component", { tooltip: "Close", id: "close", variant: "invisible", onClick: (t) => this.closeModal(t), part: "nfbf__close-button" }, n("close-icon", null))), n("div", { class: "header" }, n("h2", { slot: "card-title", part: "nfbf__title" }, p.t("deleteSchedulingPageTitle"))), n("div", { class: "description title-desc" }, n("p", null, p.t("deleteSchedulingPageDescription"))), n("div", { class: {
|
|
1296
|
+
footer: !0
|
|
1297
|
+
} }, n("button-component", { variant: "basic", onClick: (t) => this.closeModal(t), part: "nfbf__button-outline nfbf__cancel-cta" }, `${p.t("deleteSchedulingPageCancelButton")}`), n("button-component", { variant: "destructive", onClick: (t) => this.handleConfirmDeleteButtonClicked(t), disabled: this.showDeleteButtonLoading, isLoading: this.showDeleteButtonLoading, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${p.t("deleteSchedulingPageConfirmButton")}`)))));
|
|
1298
|
+
}
|
|
1299
|
+
get host() {
|
|
1300
|
+
return se(this);
|
|
1301
|
+
}
|
|
1302
|
+
static get watchers() {
|
|
1303
|
+
return {
|
|
1304
|
+
listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"],
|
|
1305
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
mt([
|
|
1310
|
+
ie({
|
|
1311
|
+
name: "nylas-list-configurations",
|
|
1312
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1313
|
+
["schedulerConfig.configurations", "configurations"],
|
|
1314
|
+
["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"],
|
|
1315
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"]
|
|
1316
|
+
]),
|
|
1317
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
1318
|
+
eventToProps: {
|
|
1319
|
+
initListConfigurations: async (e, t) => {
|
|
1320
|
+
const { host: a, cursor: s } = e.detail;
|
|
1321
|
+
await a.setState("loading");
|
|
1322
|
+
const [i, o] = await t.schedulerConfig.getConfigurations(s);
|
|
1323
|
+
if (!i && o && o.message) {
|
|
1324
|
+
await a.setState("error"), await a.setError(o.message);
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
await a.setState("loaded");
|
|
1328
|
+
},
|
|
1329
|
+
createButtonClick: async (e, t) => {
|
|
1330
|
+
var a;
|
|
1331
|
+
t.schedulerConfigStore.resetSelectedConfiguration(), (a = t.schedulerConfigStore.state.experimentalFeatures) != null && a.group_events ? t.schedulerConfigStore.state.action = "create-select" : t.schedulerConfigStore.state.action = "create";
|
|
1332
|
+
},
|
|
1333
|
+
deleteButtonClick: async (e, t) => {
|
|
1334
|
+
const { host: a, configuration: s } = e.detail, [i, o] = await t.schedulerConfig.deleteConfiguration(s.id);
|
|
1335
|
+
!i && o && o.message && (await a.setState("error"), await a.setError(o.message)), await a.hideDeleteConfirmation();
|
|
1336
|
+
},
|
|
1337
|
+
editButtonClick: async (e, t) => {
|
|
1338
|
+
const { configuration: a } = e.detail;
|
|
1339
|
+
if (t.schedulerConfigStore.state.selectedConfiguration = a, a.type === "group") {
|
|
1340
|
+
const { startTime: s, endTime: i } = Xe((/* @__PURE__ */ new Date()).toISOString(), "week");
|
|
1341
|
+
t.schedulerConfigStore.state.calendarViewDateRange = {
|
|
1342
|
+
start_time: s.toString(),
|
|
1343
|
+
end_time: i.toString()
|
|
1344
|
+
};
|
|
1345
|
+
const [o, l] = await t.schedulerConfig.getGroupEvents(a.id);
|
|
1346
|
+
if (!o && l && l.message)
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
t.schedulerConfigStore.state.action = "edit";
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1352
|
+
fireRegisterEvent: !0
|
|
1353
|
+
}),
|
|
1354
|
+
pe("design:type", Function),
|
|
1355
|
+
pe("design:paramtypes", []),
|
|
1356
|
+
pe("design:returntype", void 0)
|
|
1357
|
+
], Ze.prototype, "render", null);
|
|
1358
|
+
Ze.style = gt;
|
|
1359
|
+
const _t = ':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}.nylas-select-event-type{height:inherit;overflow-y:auto}.nylas-select-event-type div.header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200)}.nylas-select-event-type div.header h2{font-size:18px;padding:0 24px;line-height:24px;margin:0;font-weight:600;color:var(--nylas-base-800)}.nylas-select-event-type div.header button-component button{background:transparent;border:none;cursor:pointer}.nylas-select-event-type div.header button-component button:hover,.nylas-select-event-type div.header button-component button:active{color:var(--nylas-primary);background-color:transparent}.nylas-select-event-type div.header button-component button:disabled{cursor:not-allowed}.nylas-select-event-type div.content{padding:40px}.nylas-select-event-type div.content h3{margin:0 0 32px 0;font-size:18px;line-height:24px;font-weight:600}.nylas-select-event-type div.content div.event-type{display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option{padding:16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-3x);width:inherit;cursor:pointer;display:flex;flex-direction:column;gap:8px}.nylas-select-event-type div.content div.event-type div.event-type-option h4{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--nylas-base-900)}.nylas-select-event-type div.content div.event-type div.event-type-option p{margin:0;font-size:14px;line-height:21px;font-weight:400;color:var(--nylas-base-800)}', vt = _t;
|
|
1360
|
+
var wt = function(e, t, a, s) {
|
|
1361
|
+
var i = arguments.length, o = i < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, l;
|
|
1362
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1363
|
+
o = Reflect.decorate(e, t, a, s);
|
|
1364
|
+
else
|
|
1365
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1366
|
+
(l = e[r]) && (o = (i < 3 ? l(o) : i > 3 ? l(t, a, o) : l(t, a)) || o);
|
|
1367
|
+
return i > 3 && o && Object.defineProperty(t, a, o), o;
|
|
1368
|
+
}, be = function(e, t) {
|
|
1369
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1370
|
+
return Reflect.metadata(e, t);
|
|
1371
|
+
};
|
|
1372
|
+
const We = class {
|
|
1373
|
+
constructor(e) {
|
|
1374
|
+
K(this, e), this.returnToAllSchedulingPagesEvent = m(this, "returnToAllSchedulingPagesEvent", 7), this.createEventTypeSelected = m(this, "createEventTypeSelected", 7), this.participantOptions = void 0, this.name = "select-event-type", this.selectedLanguage = void 0;
|
|
1375
|
+
}
|
|
1376
|
+
connectedCallback() {
|
|
1377
|
+
b("nylas-select-event-type", "connectedCallback");
|
|
1378
|
+
}
|
|
1379
|
+
disconnectedCallback() {
|
|
1380
|
+
b("nylas-select-event-type", "disconnectedCallback");
|
|
1381
|
+
}
|
|
1382
|
+
componentWillLoad() {
|
|
1383
|
+
b("nylas-select-event-type", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1384
|
+
}
|
|
1385
|
+
componentDidLoad() {
|
|
1386
|
+
b("nylas-select-event-type", "componentDidLoad");
|
|
1387
|
+
}
|
|
1388
|
+
elementNameChangedHandler(e) {
|
|
1389
|
+
b("nylas-select-event-type", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1390
|
+
}
|
|
1391
|
+
selectedLanguageChangedHandler(e, t) {
|
|
1392
|
+
e !== t && p.changeLanguage(e);
|
|
1393
|
+
}
|
|
1394
|
+
render() {
|
|
1395
|
+
var i;
|
|
1396
|
+
const e = [
|
|
1397
|
+
{ label: "1:1", value: F.one_on_one, description: "Allows 1:1 bookings" },
|
|
1398
|
+
{ label: "Collective", value: F.collective, description: "Allows n:1 bookings with additional participants" },
|
|
1399
|
+
{
|
|
1400
|
+
label: "Round-Robin Maximize Fairness",
|
|
1401
|
+
value: F.max_fairness,
|
|
1402
|
+
description: "Rotates through the list of participants you select, displaying the participant with the fewest recent bookings."
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
label: "Round-Robin Maximize Availability",
|
|
1406
|
+
value: F.max_availability,
|
|
1407
|
+
description: "Rotates through the list of participants you select, prioritizing participants with the fewest recent bookings, but making as many time-slots available as possible."
|
|
1408
|
+
},
|
|
1409
|
+
{ label: "Group / Class", value: F.group, description: "These are events which generally have one organizer and multiple participants" }
|
|
1410
|
+
], t = this.participantOptions && ((i = this.participantOptions) == null ? void 0 : i.length) > 0 && !!this.participantOptions[0].email && !!this.participantOptions[0].name && !!this.participantOptions[0].calendars && this.participantOptions[0].calendars.length > 0, a = [F.collective, F.max_availability, F.max_fairness], s = [F.one_on_one, F.group];
|
|
1411
|
+
return n(oe, { key: "f8de37755eeddad5bdd36cb5229213eb3ae5f0cd" }, n("div", { key: "b6c0dccb737ee275cae88aa030521ddcde46d758", class: "nylas-select-event-type", part: "nset" }, n("div", { key: "ab264f22893e7fbe43c40bca12a9897383fe9d64", class: "header", part: "nset__header" }, n("h2", { key: "e8a251f5654f716467316a812ae0aabbd173c0d1" }, "Create an event"), n("button-component", { key: "c57df15963b506ab167a9778930386a55904830f", variant: "invisible", part: "nset__header__back-button", onClick: (o) => {
|
|
1412
|
+
this.returnToAllSchedulingPagesEvent.emit();
|
|
1413
|
+
} }, n("chevron-icon", { key: "fbd0d135903087f8d48a197bfc06f2435167c290", width: "16", height: "16" }), n("span", { key: "d49121b7b0261fcba804f31e770781f296d28e05" }, "Return to all scheduling pages"))), n("div", { key: "f5d4421e8840a639d9dd812d599bc2048d7e1774", class: "content", part: "nset__content" }, n("h3", { key: "b381ae1a30075b6a63edce11591915733ce649d1" }, "Event type"), n("div", { key: "2b835b7b62096c4e8146c90716c0eae9264162db", class: "event-type", part: "nset__content__event-type" }, e.filter((o) => s.includes(o.value) || t && a.includes(o.value)).map((o) => n("div", { class: "event-type-option", onClick: (l) => {
|
|
1414
|
+
this.createEventTypeSelected.emit({ eventType: o.value });
|
|
1415
|
+
}, part: `nset__content__event-type-option-${o.value}` }, n("h4", null, o.label), n("p", null, o.description)))))));
|
|
1416
|
+
}
|
|
1417
|
+
get host() {
|
|
1418
|
+
return se(this);
|
|
1419
|
+
}
|
|
1420
|
+
static get watchers() {
|
|
1421
|
+
return {
|
|
1422
|
+
name: ["elementNameChangedHandler"],
|
|
1423
|
+
selectedLanguage: ["selectedLanguageChangedHandler"]
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
wt([
|
|
1428
|
+
ie({
|
|
1429
|
+
name: "nylas-select-event-type",
|
|
1430
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1431
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
1432
|
+
["schedulerConfig.additionalParticipants", "participantOptions"]
|
|
1433
|
+
]),
|
|
1434
|
+
eventToProps: {
|
|
1435
|
+
returnToAllSchedulingPagesEvent: async (e, t) => {
|
|
1436
|
+
t.schedulerConfigStore.state.action = null, t.schedulerConfigStore.set("selectedEventType", void 0);
|
|
1437
|
+
},
|
|
1438
|
+
createEventTypeSelected: async (e, t) => {
|
|
1439
|
+
const { eventType: a } = e.detail;
|
|
1440
|
+
t.schedulerConfigStore.state.action = "create", t.schedulerConfigStore.state.selectedEventType = a;
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1443
|
+
fireRegisterEvent: !0
|
|
1444
|
+
}),
|
|
1445
|
+
be("design:type", Function),
|
|
1446
|
+
be("design:paramtypes", []),
|
|
1447
|
+
be("design:returntype", void 0)
|
|
1448
|
+
], We.prototype, "render", null);
|
|
1449
|
+
We.style = vt;
|
|
1450
|
+
export {
|
|
1451
|
+
ot as google_logo_icon,
|
|
1452
|
+
rt as microsoft_logo_icon,
|
|
1453
|
+
Je as nylas_editor_tabs,
|
|
1454
|
+
Ve as nylas_editor_tabs_group,
|
|
1455
|
+
Ze as nylas_list_configurations,
|
|
1456
|
+
We as nylas_select_event_type
|
|
1457
|
+
};
|