@nylas/react 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/connect.js +1 -0
  2. package/dist/cjs/elements.js +1 -0
  3. package/dist/cjs/index.js +1 -0
  4. package/dist/cjs/notetaker.js +62 -0
  5. package/dist/cjs/utils.js +11 -0
  6. package/dist/connect.d.ts +1 -0
  7. package/dist/elements.d.ts +1 -0
  8. package/dist/es/connect.js +279 -0
  9. package/dist/es/elements.js +1319 -0
  10. package/dist/es/index.js +281 -0
  11. package/dist/es/notetaker.js +5784 -0
  12. package/dist/es/utils.js +12396 -0
  13. package/dist/lib/connect/types.d.ts +1 -1
  14. package/dist/lib/connect/useNylasConnect.d.ts +2 -2
  15. package/dist/lib/connect.d.ts +1 -0
  16. package/dist/lib/elements/components.d.ts +975 -0
  17. package/dist/lib/elements.d.ts +1 -0
  18. package/dist/lib/index.d.ts +3 -6
  19. package/dist/lib/notetaker.d.ts +1 -0
  20. package/dist/lib/utils.d.ts +2 -0
  21. package/dist/notetaker.d.ts +1 -0
  22. package/dist/utils.d.ts +1 -0
  23. package/package.json +36 -16
  24. package/dist/add-circle-icon_2.entry-8c3bb0bb.cjs +0 -1
  25. package/dist/add-circle-icon_2.entry-a3daf6c4.js +0 -28
  26. package/dist/archive-icon.entry-46ad0ff3.cjs +0 -1
  27. package/dist/archive-icon.entry-d5141486.js +0 -18
  28. package/dist/arrow-icon.entry-1b89ce78.js +0 -18
  29. package/dist/arrow-icon.entry-f696de4f.cjs +0 -1
  30. package/dist/bold-icon.entry-7827cd4e.cjs +0 -1
  31. package/dist/bold-icon.entry-c117b4cf.js +0 -18
  32. package/dist/button-component_2.entry-8cd4c5f3.cjs +0 -1
  33. package/dist/button-component_2.entry-e68caa9b.js +0 -29
  34. package/dist/calendar-agenda-fill-icon_37.entry-52bdc8b3.js +0 -5234
  35. package/dist/calendar-agenda-fill-icon_37.entry-8c592cfa.cjs +0 -6
  36. package/dist/calendar-cancel-icon.entry-7facfa05.cjs +0 -1
  37. package/dist/calendar-cancel-icon.entry-f5f1d499.js +0 -18
  38. package/dist/calendar-check-icon.entry-55320137.js +0 -18
  39. package/dist/calendar-check-icon.entry-72108702.cjs +0 -1
  40. package/dist/calendar-icon.entry-afea361e.js +0 -18
  41. package/dist/calendar-icon.entry-f5c6730f.cjs +0 -1
  42. package/dist/checkbox-component.entry-5722d263.cjs +0 -1
  43. package/dist/checkbox-component.entry-89fa6edd.js +0 -54
  44. package/dist/checkbox-group_4.entry-30e8af17.cjs +0 -28
  45. package/dist/checkbox-group_4.entry-51f03009.js +0 -10014
  46. package/dist/checkmark-circle-icon.entry-ae11049d.cjs +0 -1
  47. package/dist/checkmark-circle-icon.entry-dfe67e22.js +0 -18
  48. package/dist/checkmark-icon_15.entry-4c3979db.js +0 -1415
  49. package/dist/checkmark-icon_15.entry-e59c0f53.cjs +0 -5
  50. package/dist/chevron-icon_3.entry-1f3c3ca6.js +0 -159
  51. package/dist/chevron-icon_3.entry-ea791750.cjs +0 -1
  52. package/dist/clock-icon_4.entry-172fed74.cjs +0 -1
  53. package/dist/clock-icon_4.entry-78878cb8.js +0 -48
  54. package/dist/constants-f51538ef-cd2a67c4.cjs +0 -1
  55. package/dist/constants-f51538ef-e0a5f026.js +0 -876
  56. package/dist/customParseFormat-b5d95b34-a6b6fcba.cjs +0 -1
  57. package/dist/customParseFormat-b5d95b34-ce80820c.js +0 -135
  58. package/dist/delete-icon.entry-a8c0bf03.cjs +0 -1
  59. package/dist/delete-icon.entry-cebdc90f.js +0 -18
  60. package/dist/document-refresh-icon.entry-2d9a529d.cjs +0 -1
  61. package/dist/document-refresh-icon.entry-8780a2b8.js +0 -18
  62. package/dist/feedbackSync-92220b42-fbebe1f9.cjs +0 -448
  63. package/dist/feedbackSync-92220b42-fd5f5610.js +0 -6048
  64. package/dist/folder-icon.entry-3e61ccca.cjs +0 -1
  65. package/dist/folder-icon.entry-6ffd5191.js +0 -18
  66. package/dist/forward-icon.entry-c7d88db8.cjs +0 -1
  67. package/dist/forward-icon.entry-c9c4bf5b.js +0 -18
  68. package/dist/globe-icon.entry-0b93cab8.cjs +0 -1
  69. package/dist/globe-icon.entry-7c0dca7b.js +0 -18
  70. package/dist/google-logo-icon_6.entry-deef91ee.js +0 -1765
  71. package/dist/google-logo-icon_6.entry-e25ce3e7.cjs +0 -2
  72. package/dist/google-meet-icon_5.entry-214347f0.cjs +0 -1
  73. package/dist/google-meet-icon_5.entry-f8b5a92a.js +0 -58
  74. package/dist/inbox-icon.entry-873062c3.js +0 -18
  75. package/dist/inbox-icon.entry-f08f2fd5.cjs +0 -1
  76. package/dist/index-025be398.js +0 -7187
  77. package/dist/index-c510313d-1318f67a.js +0 -289
  78. package/dist/index-c510313d-b0508eee.cjs +0 -1
  79. package/dist/index-f42fe591.cjs +0 -65
  80. package/dist/index.es-488bc919-d02dd50a.cjs +0 -7
  81. package/dist/index.es-488bc919-ea63a7e9.js +0 -2724
  82. package/dist/info-icon_2.entry-442b9097.cjs +0 -1
  83. package/dist/info-icon_2.entry-60fb8648.js +0 -37
  84. package/dist/input-component.entry-5898a52e.js +0 -96
  85. package/dist/input-component.entry-7274fd28.cjs +0 -1
  86. package/dist/input-dropdown_2.entry-4534436c.js +0 -255
  87. package/dist/input-dropdown_2.entry-9b72f637.cjs +0 -1
  88. package/dist/italic-icon.entry-62052cd8.js +0 -18
  89. package/dist/italic-icon.entry-9bdbbd37.cjs +0 -1
  90. package/dist/lib/elements/index.d.ts +0 -133
  91. package/dist/lib/elements/react-component-lib/createComponent.d.ts +0 -10
  92. package/dist/lib/elements/react-component-lib/createOverlayComponent.d.ts +0 -21
  93. package/dist/lib/elements/react-component-lib/index.d.ts +0 -2
  94. package/dist/lib/elements/react-component-lib/interfaces.d.ts +0 -29
  95. package/dist/lib/elements/react-component-lib/utils/attachProps.d.ts +0 -9
  96. package/dist/lib/elements/react-component-lib/utils/case.d.ts +0 -2
  97. package/dist/lib/elements/react-component-lib/utils/dev.d.ts +0 -2
  98. package/dist/lib/elements/react-component-lib/utils/index.d.ts +0 -10
  99. package/dist/multi-select-dropdown.entry-77752d46.cjs +0 -1
  100. package/dist/multi-select-dropdown.entry-9c9d05c1.js +0 -133
  101. package/dist/nylas-booked-event-card_11.entry-32b2e9f1.js +0 -1410
  102. package/dist/nylas-booked-event-card_11.entry-4aba5146.cjs +0 -1
  103. package/dist/nylas-date-component_2.entry-6b058796.cjs +0 -1
  104. package/dist/nylas-date-component_2.entry-a869519f.js +0 -310
  105. package/dist/nylas-form-card.entry-5390459f.js +0 -75
  106. package/dist/nylas-form-card.entry-c2f34d73.cjs +0 -1
  107. package/dist/nylas-notification_2.entry-054392cf.cjs +0 -1
  108. package/dist/nylas-notification_2.entry-f46e88e5.js +0 -88
  109. package/dist/nylas-scheduler-editor.entry-40a48f47.js +0 -1854
  110. package/dist/nylas-scheduler-editor.entry-e29fdf07.cjs +0 -2
  111. package/dist/nylas-scheduling.entry-115b1752.js +0 -1002
  112. package/dist/nylas-scheduling.entry-79cb1d9c.cjs +0 -1
  113. package/dist/person-icon.entry-2cae306c.cjs +0 -1
  114. package/dist/person-icon.entry-fd668b89.js +0 -18
  115. package/dist/play-icon.entry-7fc3c0fd.js +0 -18
  116. package/dist/play-icon.entry-9989a520.cjs +0 -1
  117. package/dist/radio-button-group.entry-03385b5f.cjs +0 -1
  118. package/dist/radio-button-group.entry-9df82cd0.js +0 -58
  119. package/dist/react.cjs +0 -1
  120. package/dist/react.js +0 -164
  121. package/dist/refresh-icon.entry-310954ba.cjs +0 -1
  122. package/dist/refresh-icon.entry-c56e5623.js +0 -18
  123. package/dist/register-component-3acd57e7-5a79a90a.cjs +0 -1
  124. package/dist/register-component-3acd57e7-cb09c05e.js +0 -110
  125. package/dist/reply-all-icon.entry-32e0e000.js +0 -18
  126. package/dist/reply-all-icon.entry-68388f97.cjs +0 -1
  127. package/dist/reply-icon.entry-3ac2e736.js +0 -18
  128. package/dist/reply-icon.entry-e616a9a4.cjs +0 -1
  129. package/dist/sent-icon.entry-0622ed04.js +0 -18
  130. package/dist/sent-icon.entry-543eb3c4.cjs +0 -1
  131. package/dist/spam-icon.entry-74bcfd4f.js +0 -18
  132. package/dist/spam-icon.entry-e341ee3e.cjs +0 -1
  133. package/dist/star-icon.entry-864d2bf9.js +0 -18
  134. package/dist/star-icon.entry-c90d40f6.cjs +0 -1
  135. package/dist/stop-icon.entry-835908c5.js +0 -18
  136. package/dist/stop-icon.entry-ffc46b42.cjs +0 -1
  137. package/dist/textarea-component.entry-6adcf6a6.js +0 -58
  138. package/dist/textarea-component.entry-dae8eb5c.cjs +0 -1
  139. package/dist/toggle-switch.entry-5ee29867.cjs +0 -1
  140. package/dist/toggle-switch.entry-ff2ccb75.js +0 -51
  141. package/dist/translate-icon.entry-372dd808.js +0 -18
  142. package/dist/translate-icon.entry-5606067d.cjs +0 -1
  143. package/dist/trash-fill-icon.entry-01b4379e.js +0 -18
  144. package/dist/trash-fill-icon.entry-daed6c0a.cjs +0 -1
  145. package/dist/underline-icon.entry-2020ee64.cjs +0 -1
  146. package/dist/underline-icon.entry-464b900d.js +0 -18
  147. package/dist/utils-31933f5d-15041585.js +0 -17878
  148. package/dist/utils-31933f5d-1d4c81ab.cjs +0 -54
@@ -1,1415 +0,0 @@
1
- import { r as b, h as l, c as m, g as x, H as C } from "./index-025be398.js";
2
- import { R as w } from "./register-component-3acd57e7-cb09c05e.js";
3
- import { b as d, K as q, i as c, q as R, L as S, H as V, M } from "./utils-31933f5d-15041585.js";
4
- import { E as k, P as E, f as J } from "./constants-f51538ef-e0a5f026.js";
5
- import "@nylas/web-elements";
6
- import "react";
7
- import "@nylas/connect";
8
- import "react/jsx-runtime";
9
- import "react-dom";
10
- const G = ".sc-checkmark-icon-h{display:flex}", X = G, Q = class {
11
- constructor(e) {
12
- b(this, e), this.width = "18", this.height = "14";
13
- }
14
- render() {
15
- return l("svg", { key: "a739b30f83d6510e6644045ba736860eb524c838", width: this.width, height: this.height, viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "9621004de9b8789eab6f4d0616ae0ff25124fd44", d: "M1.53033 7.46967C1.23744 7.17678 0.762563 7.17678 0.46967 7.46967C0.176777 7.76256 0.176777 8.23744 0.46967 8.53033L4.96967 13.0303C5.26256 13.3232 5.73744 13.3232 6.03033 13.0303L17.0303 2.03033C17.3232 1.73744 17.3232 1.26256 17.0303 0.96967C16.7374 0.676777 16.2626 0.676777 15.9697 0.96967L5.5 11.4393L1.53033 7.46967Z", fill: "#293056" }));
16
- }
17
- };
18
- Q.style = X;
19
- const Y = ".sc-copy-icon-h{display:flex}", ee = Y, te = class {
20
- constructor(e) {
21
- b(this, e), this.width = "16", this.height = "16";
22
- }
23
- render() {
24
- return l("svg", { key: "af5249494e43163c59f43f0e21ff4a9063566023", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "d1b78a39d0dd7ce2a3823d54e2e0dbd5f260c188", d: "M4 0.75C2.89543 0.75 2 1.64543 2 2.75V12.75C2 13.8546 2.89543 14.75 4 14.75H10C11.1046 14.75 12 13.8546 12 12.75V2.75C12 1.64543 11.1046 0.75 10 0.75H4ZM3 2.75C3 2.19772 3.44772 1.75 4 1.75H10C10.5523 1.75 11 2.19772 11 2.75V12.75C11 13.3023 10.5523 13.75 10 13.75H4C3.44772 13.75 3 13.3023 3 12.75V2.75ZM0 4.75001C0 4.00973 0.402199 3.36339 1 3.01758V13.25C1 14.6307 2.11929 15.75 3.5 15.75H9.73244C9.38663 16.3478 8.74028 16.75 8 16.75H3.5C1.567 16.75 0 15.183 0 13.25V4.75001Z", fill: "currentColor" }));
25
- }
26
- };
27
- te.style = ee;
28
- const ne = ".sc-dragable-icon-h{display:flex}", ae = ne, oe = class {
29
- constructor(e) {
30
- b(this, e), this.width = "20", this.height = "20";
31
- }
32
- render() {
33
- return l("svg", { key: "e4d3ba685832139b22eb5b024479e22f2ddfc811", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "68f15598ca1251c3926a3b88adb0947f1a5b6b4a", d: "M15.5 18C16.3284 18 17 18.6716 17 19.5C17 20.3284 16.3284 21 15.5 21C14.6716 21 14 20.3284 14 19.5C14 18.6716 14.6716 18 15.5 18ZM8.5 18C9.32843 18 10 18.6716 10 19.5C10 20.3284 9.32843 21 8.5 21C7.67157 21 7 20.3284 7 19.5C7 18.6716 7.67157 18 8.5 18ZM15.5 11C16.3284 11 17 11.6716 17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11ZM8.5 11C9.32843 11 10 11.6716 10 12.5C10 13.3284 9.32843 14 8.5 14C7.67157 14 7 13.3284 7 12.5C7 11.6716 7.67157 11 8.5 11ZM15.5 4C16.3284 4 17 4.67157 17 5.5C17 6.32843 16.3284 7 15.5 7C14.6716 7 14 6.32843 14 5.5C14 4.67157 14.6716 4 15.5 4ZM8.5 4C9.32843 4 10 4.67157 10 5.5C10 6.32843 9.32843 7 8.5 7C7.67157 7 7 6.32843 7 5.5C7 4.67157 7.67157 4 8.5 4Z", fill: "currentColor" }));
34
- }
35
- };
36
- oe.style = ae;
37
- const se = ".sc-eye-icon-h{display:flex}", le = se, ie = class {
38
- constructor(e) {
39
- b(this, e), this.width = "17", this.height = "10";
40
- }
41
- render() {
42
- return l("svg", { key: "2b2a63f9602d85c9661986eb2dd8e220a02e5570", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "8609bab91f97b282d80282736ce38f895e7b6fc1", d: "M1.75909 6.60214C2.44254 3.32689 5.29437 1 8.50002 1C11.7057 1 14.5574 3.32688 15.2409 6.60215C15.2974 6.87246 15.5622 7.04587 15.8325 6.98946C16.1029 6.93304 16.2763 6.66817 16.2199 6.39785C15.4425 2.67312 12.1934 0 8.50002 0C4.8066 0 1.55742 2.67311 0.780175 6.39786C0.723767 6.66818 0.897177 6.93305 1.1675 6.98946C1.43782 7.04587 1.70268 6.87246 1.75909 6.60214ZM8.5 3C6.567 3 5 4.567 5 6.5C5 8.433 6.567 10 8.5 10C10.433 10 12 8.433 12 6.5C12 4.567 10.433 3 8.5 3ZM6 6.5C6 5.11929 7.11929 4 8.5 4C9.88071 4 11 5.11929 11 6.5C11 7.88071 9.88071 9 8.5 9C7.11929 9 6 7.88071 6 6.5Z", fill: "currentColor" }));
43
- }
44
- };
45
- ie.style = le;
46
- const re = ".sc-feedback-icon-h{display:flex}", ce = re, de = class {
47
- constructor(e) {
48
- b(this, e), this.width = "11", this.height = "14";
49
- }
50
- render() {
51
- return l("svg", { key: "0cef0443a3b22ffa2bd9be587f55175bef8557cf", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "20631452d3f3bc031b79d3337eda08143db490e4", d: "M0.5 8.875C0.5 8.875 1.125 8.25 3 8.25C4.875 8.25 6.125 9.5 8 9.5C9.875 9.5 10.5 8.875 10.5 8.875V1.375C10.5 1.375 9.875 2 8 2C6.125 2 4.875 0.75 3 0.75C1.125 0.75 0.5 1.375 0.5 1.375V8.875ZM0.5 8.875V13.25", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }));
52
- }
53
- };
54
- de.style = ce;
55
- const fe = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.color-picker-container{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available;padding-left:0;gap:0;overflow:hidden}.color-picker-container:focus{outline-color:var(--nylas-primary)}.color-picker-container.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.color-picker-container.error::placeholder{font-weight:400}.color-picker-container::placeholder{color:var(--nylas-base-300)}.color-picker-container input{display:flex;align-items:center;height:100%;appearance:none;border:none;border-right:1px solid var(--nylas-base-200);background:transparent}.color-picker-container input::-webkit-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container input::-moz-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container.error{border:1px solid var(--nylas-error)}.color-picker-container:hover,.color-picker-container:active{outline:1px solid var(--nylas-primary)}.color-picker-container:active{outline:2px solid var(--nylas-primary)}.color-picker-container label{width:100%}.labelBtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;width:100%;gap:0.5rem;background:transparent;border:none}.labelBtn.error{border:1px solid var(--nylas-error)}.labelBtn.focus{background:transparent}.labelBtn:hover,.labelBtn:active{outline:1px solid var(--nylas-primary)}.labelBtn span.chevron{display:flex;align-self:center}.labelBtn span.open{transform:rotate(90deg)}.labelBtn span.closed{transform:rotate(270deg)}.labelBtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.labelBtn span.selected-option{max-width:124px;font-size:16px}}', pe = fe, ye = class {
56
- constructor(e) {
57
- b(this, e), this.nylasFormDropdownChanged = m(this, "nylasFormDropdownChanged", 7), this.componentType = "color-picker", this.name = void 0, this.defaultSelectedColor = void 0, this.selectedColor = this.defaultSelectedColor, this.isOpen = !1, this.ariaActivedescendant = "", this.errorMessage = "";
58
- }
59
- componentWillLoad() {
60
- this.selectedColor = this.defaultSelectedColor, this.el.setAttribute("component-type", this.componentType);
61
- }
62
- handleFocus() {
63
- this.isOpen = !0;
64
- }
65
- handleBlur() {
66
- this.isOpen = !1;
67
- }
68
- handleInput(e) {
69
- this.selectedColor = e.target.value;
70
- }
71
- handleChange(e) {
72
- this.selectedColor = e.target.value, this.nylasFormDropdownChanged.emit({
73
- value: this.selectedColor,
74
- name: this.name,
75
- error: this.errorMessage
76
- });
77
- }
78
- handleKeyDown(e) {
79
- var t;
80
- (e.code === "Enter" || e.code === "Space") && (e.preventDefault(), (t = this.inputRef) == null || t.click());
81
- }
82
- handleOutsideClick(e) {
83
- !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
84
- }
85
- render() {
86
- return l("div", { key: "354f7c502fadd2c6a30619365b9939523d9cd770", class: "color-picker-container", part: "icp_color-picker", tabindex: "0", onKeyDown: (e) => this.handleKeyDown(e) }, l("input", { key: "cc5803d2e90064b15137717043581f24cf80fda3", type: "color", ref: (e) => this.inputRef = e, id: this.name, name: this.name, value: this.selectedColor, tabindex: "-1", onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e), onKeyDown: (e) => this.handleKeyDown(e) }), l("label", { key: "75e26e605a36d5a3505f41dbdad576484b14ac43", part: "icp_color-picker-button", htmlFor: this.name, class: { labelBtn: !0, open: this.isOpen, error: !!this.errorMessage }, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name }, l("span", { key: "9a321653073ef9aa8a9372e291bd04244b6dfe46", class: "selected-option", part: "icp_color-picker-button-selected-label" }, this.selectedColor || "Select a color"), l("span", { key: "62ed4fb1337b47735c823b8e164bb8bb57325ffd", class: {
87
- open: this.isOpen,
88
- closed: !this.isOpen,
89
- chevron: !0
90
- }, "aria-hidden": "true" }, l("chevron-icon", { key: "5c304ff53cfc6d3632f4fbbd8415c318301b4e38", width: "16", height: "16" })), this.errorMessage && l("span", { class: "error help-text" }, this.errorMessage)));
91
- }
92
- get el() {
93
- return x(this);
94
- }
95
- };
96
- ye.style = pe;
97
- const he = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.logo-container{display:flex;flex-direction:row;gap:2rem}.logo-container .input-container{flex:1}.logo-container .input-container span.error-message{color:var(--nylas-error)}.logo-container .logo{display:flex;justify-content:center;align-items:center;width:200px;height:100px;border:var(--nylas-base-200) solid 1px;border-radius:var(--nylas-border-radius-2x);overflow:hidden;padding:10px}.logo-container .logo img{max-height:100%;max-width:100%;object-fit:contain;object-position:center}', ue = he;
98
- var be = function(e, t, n, o) {
99
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
100
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
101
- s = Reflect.decorate(e, t, n, o);
102
- else
103
- for (var i = e.length - 1; i >= 0; i--)
104
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
105
- return r > 3 && s && Object.defineProperty(t, n, s), s;
106
- }, O = function(e, t) {
107
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
108
- return Reflect.metadata(e, t);
109
- };
110
- const N = class {
111
- constructor(e) {
112
- b(this, e), this.nylasFormInputImageUrlInvalid = m(this, "nylasFormInputImageUrlInvalid", 7), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.componentType = "image-url", this.imageUrl = "", this.themeConfig = void 0, this.errorMessage = "", this.name = "input-image-url", this.currentImageUrl = this.imageUrl, this.error = "";
113
- }
114
- connectedCallback() {
115
- d("nylas-image-input", "connectedCallback");
116
- }
117
- disconnectedCallback() {
118
- d("nylas-image-input", "disconnectedCallback");
119
- }
120
- componentWillLoad() {
121
- d("nylas-image-input", "componentWillLoad"), this.host.setAttribute("name", this.name), this.host.setAttribute("component-type", this.componentType);
122
- }
123
- componentDidLoad() {
124
- d("nylas-image-input", "componentDidLoad"), this.currentImageUrl = this.imageUrl, this.setImage(this.imageUrl, !1), this.applyThemeConfig(this.themeConfig);
125
- }
126
- componentWillUpdate() {
127
- d("nylas-image-input", "componentWillUpdate");
128
- }
129
- componentDidUpdate() {
130
- d("nylas-image-input", "componentDidUpdate");
131
- }
132
- componentWillRender() {
133
- d("nylas-image-input", "componentWillRender");
134
- }
135
- componentDidRender() {
136
- d("nylas-image-input", "componentDidRender");
137
- }
138
- elementNameChangedHandler(e) {
139
- d("nylas-image-input", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
140
- }
141
- errorMessageChangedHandler(e) {
142
- d("nylas-image-input", "errorMessageChangedHandler", e), this.error && (this.error = e);
143
- }
144
- themeConfigChangedHandler(e, t) {
145
- e !== t && this.applyThemeConfig(e);
146
- }
147
- applyThemeConfig(e) {
148
- if (e)
149
- for (const [t, n] of Object.entries(e))
150
- this.host.style.setProperty(`${t}`, n);
151
- }
152
- async nylasFormInputChangedHandler(e) {
153
- const { name: t, value: n } = e.detail;
154
- t === this.name && this.setImage(n);
155
- }
156
- async nylasFormInputBlurHandler(e) {
157
- const { name: t, value: n } = e.detail;
158
- t === this.name && this.setImage(n);
159
- }
160
- setImage(e, t = !0) {
161
- this.error = "", q(e).then(() => {
162
- this.currentImageUrl = e, this.internals.setValidity({}), this.internals.setFormValue(this.currentImageUrl, this.name), t && this.valueChanged.emit({ value: this.currentImageUrl, name: this.name });
163
- }).catch(() => {
164
- this.error = this.errorMessage || "Invalid image URL.", this.nylasFormInputImageUrlInvalid.emit({ value: this.error, name: this.name }), typeof this.internals.setValidity == "function" && this.internals.setValidity({ customError: !0 }, this.error);
165
- });
166
- }
167
- render() {
168
- return l(C, { key: "3ba309394a934b49e5fe958b2b35689db17ed25a" }, l("div", { key: "35364f7a937b885e295814931619162caf41b849", class: "logo-container" }, l("div", { key: "7b4714a223160fb8700f9ea240c96a86370360dd", class: "input-container" }, l("input-component", { key: "443b31dfa78de24cf3720bc985a0d8a723ea0f85", name: this.name, id: this.name, type: "text", required: !1, themeConfig: this.themeConfig, exportparts: "ic_input: iiu__logo-input-textfield", defaultValue: this.imageUrl ?? "" }), this.error && l("span", { class: "error-message" }, this.error)), this.currentImageUrl && !this.error && l("div", { class: "logo" }, l("img", { src: this.currentImageUrl, alt: "Logo" }))));
169
- }
170
- static get formAssociated() {
171
- return !0;
172
- }
173
- get host() {
174
- return x(this);
175
- }
176
- static get watchers() {
177
- return {
178
- name: ["elementNameChangedHandler"],
179
- errorMessage: ["errorMessageChangedHandler"],
180
- themeConfig: ["themeConfigChangedHandler"]
181
- };
182
- }
183
- };
184
- be([
185
- w({
186
- name: "nylas-image-input",
187
- eventToProps: {
188
- valueChanged: async (e, t) => {
189
- const { valueChanged: n } = e.detail;
190
- n && n(e);
191
- }
192
- }
193
- }),
194
- O("design:type", Function),
195
- O("design:paramtypes", []),
196
- O("design:returntype", void 0)
197
- ], N.prototype, "render", null);
198
- N.style = ue;
199
- const ge = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-additional-participants__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem;background-color:var(--nylas-base-25)}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_group label span.org-as-participant{width:max-content}.nylas-additional-participants__error{color:var(--nylas-error);font-size:14px;font-family:var(--nylas-font-family);font-weight:400;line-height:16px;margin:0;text-align:left}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper.error{border-color:var(--nylas-error)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;border-left:1px solid var(--nylas-base-300);background:none;cursor:pointer;color:var(--nylas-base-800)}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{border:none}.nylas-additional-participants__input{flex:1;display:flex;justify-content:space-between}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__input input-dropdown{width:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown){width:100%;height:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown-input){height:100%;border-radius:var(--nylas-border-radius-2x);border:none;border-top-right-radius:initial;border-bottom-right-radius:initial;padding-left:16px}.nylas-additional-participants__input input-component::part(ic__input){background:var(--nylas-base-50)}.nylas-additional-participants__input input-component::part(ic__label){font-size:14px}.nylas-additional-participants__input input-component div.required-input{display:flex;gap:4px}.nylas-additional-participants__input input-component div.required-input label{display:flex;gap:4px;align-items:center}.nylas-additional-participants__input input-component div.required-input label tooltip-component#organizer_participant_tooltip::part(tc__content){left:-84px}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer;color:var(--nylas-base-800)}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}', me = ge;
200
- var ve = function(e, t, n, o) {
201
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
202
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
203
- s = Reflect.decorate(e, t, n, o);
204
- else
205
- for (var i = e.length - 1; i >= 0; i--)
206
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
207
- return r > 3 && s && Object.defineProperty(t, n, s), s;
208
- }, I = function(e, t) {
209
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
210
- return Reflect.metadata(e, t);
211
- };
212
- const z = class {
213
- constructor(e) {
214
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "participants", this.selectedConfiguration = void 0, this.currentUser = void 0, this.currentUserCalendars = void 0, this.participantOptions = void 0, this.eventParticipants = void 0, this.roundRobinConfig = void 0, this.selectedLanguage = void 0, this.themeConfig = void 0, this.participants = this.eventParticipants ?? [], this.participantErrors = {}, this.includeOrganizerAsParticipant = !0, this.isRoundRobinConfig = !1, this.error = "", this.requiredError = "", this.patternError = "";
215
- }
216
- elementNameChangedHandler(e) {
217
- d("nylas-additional-participants", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
218
- }
219
- selectedConfigurationAndCurrentUserChangedHandler(e, t, n) {
220
- d("nylas-additional-participants", "selectedConfigurationAndCurrentUserChangedHandler", e, this.currentUser), n === "selectedConfiguration" ? this.updateState(e, this.currentUser, !1) : n === "currentUser" && this.updateState(this.selectedConfiguration, e, !1);
221
- }
222
- selectedLanguageChangedHandler(e, t) {
223
- e !== t && (c.changeLanguage(e), this.requiredError = c.t("fieldRequired", { field: c.t("email") }), this.patternError = c.t("invalidInputFormat", { field: c.t("email") }), this.error && (this.error = c.t("nylasAdditionalParticipants.error")));
224
- }
225
- themeConfigChangedHandler(e, t) {
226
- e !== t && this.applyThemeConfig(e);
227
- }
228
- connectedCallback() {
229
- d("nylas-additional-participants", "connectedCallback");
230
- }
231
- componentWillLoad() {
232
- d("nylas-additional-participants", "componentWillLoad"), this.host.setAttribute("name", this.name);
233
- }
234
- componentDidLoad() {
235
- d("nylas-additional-participants", "componentDidLoad"), this.selectedConfiguration ? this.updateState(this.selectedConfiguration, this.currentUser, !1) : this.eventParticipants && (this.participants = this.eventParticipants || [], this.isRoundRobinConfig = this.roundRobinConfig || !1, this.updateFormValue(!0));
236
- }
237
- disconnectedCallback() {
238
- d("nylas-additional-participants", "disconnectedCallback");
239
- }
240
- updateState(e, t, n = !0) {
241
- var o, r, s, a;
242
- this.isRoundRobinConfig = (r = (o = e == null ? void 0 : e.availability) == null ? void 0 : o.availability_rules) != null && r.availability_method ? ((a = (s = e == null ? void 0 : e.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : a.availability_method) !== "collective" : !1, this.participants = (e == null ? void 0 : e.participants) || this.eventParticipants || [], this.includeOrganizerAsParticipant = !!(this.isRoundRobinConfig && this.participants.find((i) => i.email === (t == null ? void 0 : t.email))), this.updateOrganizerAsParticipant(n);
243
- }
244
- get isInternalsAvailable() {
245
- return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
246
- }
247
- onInputOptionChanged(e) {
248
- var s, a, i, f;
249
- d("nylas-additional-participants", "onInputOptionChanged");
250
- const t = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, n = e.detail.name, o = (s = this.participantOptions) == null ? void 0 : s.find((p) => p.email === e.detail.value);
251
- if (!o && this.isRoundRobinConfig) {
252
- this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, "For round robin configuration, participant should be selected from the dropdown."), this.participantErrors[n] = "For round robin page, participant should be selected from the dropdown.", this.participants[n].is_valid = !1, this.participants = [...this.participants];
253
- return;
254
- } else if (!o && !t.test(e.detail.value)) {
255
- this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, c.t("nylasAdditionalParticipants.error_email")), this.participantErrors[n] = c.t("nylasAdditionalParticipants.error_email"), this.participants[n].is_valid = !1, this.participants = [...this.participants];
256
- return;
257
- } else
258
- this.participantErrors[n] = "", this.participants[n].is_valid = !0, this.isInternalsAvailable && this.internals.setValidity({});
259
- this.participants[n].email = e.detail.value;
260
- const r = (a = o == null ? void 0 : o.calendars) == null ? void 0 : a.find((p) => p.is_primary);
261
- this.participants[n].availability = o && (r != null && r.id) ? { calendar_ids: [r.id] } : (i = o == null ? void 0 : o.calendars[0]) != null && i.id ? { calendar_ids: [o.calendars[0].id] } : void 0, this.participants[n].booking = o && this.isRoundRobinConfig && (r != null && r.id) ? { calendar_id: r.id } : this.isRoundRobinConfig && ((f = o == null ? void 0 : o.calendars[0]) != null && f.id) ? { calendar_id: o.calendars[0].id } : void 0, this.participants[n].name = (o == null ? void 0 : o.name) || e.detail.value, this.participants = [...this.participants], this.updateFormValue();
262
- }
263
- updateOrganizerAsParticipant(e = !0) {
264
- var n, o, r, s, a, i, f;
265
- const t = this.participants.find((p) => {
266
- var h;
267
- return p.email === ((h = this.currentUser) == null ? void 0 : h.email);
268
- });
269
- if (this.isRoundRobinConfig && !t && ((n = this.currentUser) != null && n.email)) {
270
- const p = ((r = (o = this.currentUserCalendars) == null ? void 0 : o.find((h) => h.is_primary)) == null ? void 0 : r.id) || ((a = (s = this.currentUserCalendars) == null ? void 0 : s[0]) == null ? void 0 : a.id) || "primary";
271
- this.participants = [
272
- {
273
- name: (i = this.currentUser) == null ? void 0 : i.name,
274
- email: (f = this.currentUser) == null ? void 0 : f.email,
275
- is_organizer: !0,
276
- availability: {
277
- calendar_ids: [p]
278
- },
279
- booking: {
280
- calendar_id: p
281
- }
282
- },
283
- ...this.participants
284
- ];
285
- }
286
- this.updateFormValue(e);
287
- }
288
- addParticipant() {
289
- d("nylas-additional-participants", "addParticipant"), this.participants = [...this.participants, { name: "", email: "", is_organizer: !1 }], this.updateFormValue();
290
- }
291
- removeParticipant(e) {
292
- d("nylas-additional-participants", "removeParticipant"), this.participants = this.participants.filter((t, n) => n !== e), this.updateFormValue();
293
- }
294
- updateFormValue(e = !0) {
295
- d("nylas-additional-participants", "updateFormValue");
296
- const t = this.isRoundRobinConfig ? this.includeOrganizerAsParticipant ? this.participants : this.participants.filter((n) => !n.is_organizer) : this.participants;
297
- t.length === 0 ? (this.error = c.t("nylasAdditionalParticipants.error"), this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, this.error)) : (this.isInternalsAvailable && this.internals.setValidity({}), this.error = "", this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(t), this.name), e && this.valueChanged.emit({ value: JSON.stringify(t), name: this.name }));
298
- }
299
- getArrayDifference(e, t) {
300
- return e.filter((o) => !t.some((r) => o.email === r.email)).map((o) => ({ value: o.email, label: o.email }));
301
- }
302
- applyThemeConfig(e) {
303
- if (e)
304
- for (const [t, n] of Object.entries(e))
305
- this.host.style.setProperty(`${t}`, n);
306
- }
307
- render() {
308
- return l(C, { key: "8f567ae6775e709c0d2046cb0e072039e6aa22f6", part: "nadtnlpart" }, l("nylas-form-card", { key: "9797400fad8fc093f6a909270ddfa7baf192ac8d", exportparts: "nfc, nfc__header", themeConfig: this.themeConfig }, l("h3", { key: "e4a4a618db2fb686a0f307727eafb15fc67e464f", slot: "header-title", class: "nylas-additional-participants__title", part: "nadtnlpart__title" }, c.t("nylasAdditionalParticipants.headerTitle")), l("p", { key: "30fe99e55ec458a1772492d39652072b4df893c6", slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nadtnlpart__subtitle" }, c.t("nylasAdditionalParticipants.headerSubTitle")), l("div", { key: "f5fcde3ccb7493850b02ef17cbfc73e54560c045", slot: "content", class: "nylas-additional-participants__content", part: "nadtnlpart__content" }, l("div", { key: "25f5adaf1b9e1f4c2d4cc3a98e4becba334a34b0" }, this.participants.map((e, t) => l("div", { class: "nylas-additional-participants__input_group", part: "nadtnlpart__input_group" }, !e.is_organizer && l("label", null, `${c.t("nylasAdditionalParticipants.participant")} ${t}`), l("div", { part: "nadtnlpart__input_wrapper", class: {
309
- "nylas-additional-participants__input_wrapper": !0,
310
- "nylas-additional-participants__input_wrapper_organizer": (e == null ? void 0 : e.is_organizer) === !0,
311
- "nylas-additional-participants__input_wrapper_invalid": e.is_valid === !1,
312
- error: e.is_valid === !1
313
- } }, l("div", { class: { "nylas-additional-participants__input": !0, organizer: (e == null ? void 0 : e.is_organizer) === !0 }, part: "nadtnlpart__input" }, e.is_organizer ? l("input-component", { class: "label-input", name: `${t}`, key: t, label: c.t("nylasAdditionalParticipants.organizer"), required: !1, requiredError: this.requiredError, patternError: this.patternError, readOnly: e.is_organizer, defaultValue: e.email, themeConfig: this.themeConfig }, this.isRoundRobinConfig && l("div", { class: "required-input", slot: "additional-input" }, l("input", { type: "checkbox", name: "organizer_participant", id: "organizer_participant", onClick: () => {
314
- this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant, this.updateFormValue();
315
- }, checked: this.includeOrganizerAsParticipant }), l("label", { htmlFor: "organizer_participant", "aria-label": "Include as participant" }, l("span", { class: "org-as-participant", part: "nadtnlpart__org-as-participant" }, c.t("nylasAdditionalParticipants.organizerAsParticipant")), l("tooltip-component", { id: "organizer_participant_tooltip" }, l("info-icon", { slot: "tooltip-icon" }), l("span", { slot: "tooltip-content" }, l("strong", null, c.t("nylasAdditionalParticipants.tooltip.includeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.includeOrganizerDesc"), " ", l("br", null), l("strong", null, c.t("nylasAdditionalParticipants.tooltip.excludeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.excludeOrganizerDesc")))))) : l("input-dropdown", { id: `${t}`, name: `${t}`, filterable: !0, inputValue: e.email, options: this.getArrayDifference(this.participantOptions || [], this.participants), themeConfig: this.themeConfig }), !e.is_organizer && l("button", { onClick: () => this.removeParticipant(t), part: "nadtnlpart__remove-participant" }, l("close-icon", null)))), !e.is_valid && l("p", { class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.participantErrors[t]))), l("p", { key: "8878a1424302cbf36cf0a3a3a945c9a2ab63f1cd", class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.error)), l("button", { key: "ffc743095240b2b14cedab52178fcec10a5f9d40", class: "nylas-additional-participants__add", part: "nadtnlpart__add-participant", onClick: () => this.addParticipant() }, l("add-circle-icon", { key: "b7c9581fd3aa18b846ae908ca49bbfaebf3f86e0" }), " ", l("span", { key: "9ae4f72925cd53c2fef4600dd6ec806ff513e211" }, this.participants.length > 1 ? c.t("nylasAdditionalParticipants.addParticipant", { context: "next" }) : c.t("nylasAdditionalParticipants.addParticipant", { context: "first" }))))));
316
- }
317
- static get formAssociated() {
318
- return !0;
319
- }
320
- get host() {
321
- return x(this);
322
- }
323
- static get watchers() {
324
- return {
325
- name: ["elementNameChangedHandler"],
326
- currentUser: ["selectedConfigurationAndCurrentUserChangedHandler"],
327
- selectedConfiguration: ["selectedConfigurationAndCurrentUserChangedHandler"],
328
- selectedLanguage: ["selectedLanguageChangedHandler"],
329
- themeConfig: ["themeConfigChangedHandler"]
330
- };
331
- }
332
- };
333
- ve([
334
- w({
335
- name: "nylas-additional-participants",
336
- stateToProps: /* @__PURE__ */ new Map([
337
- ["schedulerConfig.additionalParticipants", "participantOptions"],
338
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
339
- ["schedulerConfig.currentUser", "currentUser"],
340
- ["schedulerConfig.calendars", "currentUserCalendars"],
341
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
342
- ["schedulerConfig.themeConfig", "themeConfig"]
343
- ]),
344
- eventToProps: {},
345
- fireRegisterEvent: !0
346
- }),
347
- I("design:type", Function),
348
- I("design:paramtypes", []),
349
- I("design:returntype", void 0)
350
- ], z.prototype, "render", null);
351
- z.style = me;
352
- const xe = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-description{display:flex;flex-direction:column;gap:4px;position:relative}.nylas-event-description label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description label span.label-icon{margin-left:4px}.nylas-event-description label span.label-icon tooltip-component{display:flex}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;border:1px solid var(--nylas-base-200)}.nylas-event-description textarea::-webkit-resizer{display:none}.nylas-event-description div.event-description{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);white-space:nowrap;scrollbar-width:thin;min-height:50px;overflow-y:auto;white-space:pre-wrap;line-height:1.5;background-color:var(--nylas-base-0);}.nylas-event-description div.event-description::-webkit-scrollbar{width:6px;height:6px}.nylas-event-description div.event-description.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-description span.add-additional-fields{display:flex;align-items:center;gap:8px}.nylas-event-description span.add-additional-fields button-component button{height:35px;background-color:var(--nylas-base-0)}.nylas-event-description span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-description span.help-text span.label-icon{display:inline-block}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-description .highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:2px 5px;margin-left:4px;margin-bottom:4px;display:inline-block;vertical-align:baseline}.nylas-event-description .token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;margin-top:28px;overflow:auto;z-index:1;border-radius:4px;position:absolute;bottom:108px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.nylas-event-description .token-options{right:0;width:325px;max-width:unset}}.nylas-event-description .token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.nylas-event-description .token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.nylas-event-description .token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.nylas-event-description .token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.nylas-event-description .token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.nylas-event-description .token-options ul li:hover,.nylas-event-description .token-options ul li:focus,.nylas-event-description .token-options ul li:active,.nylas-event-description .token-options ul li.active{background-color:var(--nylas-base-100)}.nylas-event-description .token-options ul li:hover .token-label .token,.nylas-event-description .token-options ul li:focus .token-label .token,.nylas-event-description .token-options ul li:active .token-label .token,.nylas-event-description .token-options ul li.active .token-label .token{color:var(--nylas-primary)}.nylas-event-description .token-options .selected{background-color:var(--nylas-base-100)}', ke = xe;
353
- var Ce = function(e, t, n, o) {
354
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
355
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
356
- s = Reflect.decorate(e, t, n, o);
357
- else
358
- for (var i = e.length - 1; i >= 0; i--)
359
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
360
- return r > 3 && s && Object.defineProperty(t, n, s), s;
361
- }, P = function(e, t) {
362
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
363
- return Reflect.metadata(e, t);
364
- };
365
- const B = class {
366
- constructor(e) {
367
- var t, n, o, r;
368
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventDescription = (n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.description, this.name = "description", this.selectedLanguage = void 0, this.hideAutoPopulateButton = !1, this.noTemplates = !1, this.themeConfig = void 0, this.description = this.eventDescription || ((r = (o = this.selectedConfiguration) == null ? void 0 : o.event_booking) == null ? void 0 : r.description) || "", this.showTokens = !1, this.availableTokens = k.map((s) => ({
369
- label: s.token,
370
- value: s.value,
371
- labelHTML: s
372
- })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.additionalFieldTokens = [];
373
- }
374
- elementNameChangedHandler(e) {
375
- d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
376
- }
377
- selectedConfigurationChangedHandler(e) {
378
- var s, a;
379
- d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
380
- const t = ((s = e == null ? void 0 : e.event_booking) == null ? void 0 : s.description) || this.eventDescription || "", n = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.additional_fields) || {}, r = (Object.keys(n) || []).map((i) => ({
381
- token: `$${i}`,
382
- value: `\${${i}}`,
383
- description: n[i].label || ""
384
- }));
385
- this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
386
- label: i.token,
387
- value: i.value,
388
- labelHTML: i
389
- })), this.filteredTokens = [...this.availableTokens], this.description = t, t && this.updateEventDescriptionFromProp(t);
390
- }
391
- selectedLanguageChangedHandler(e, t) {
392
- if (e === t)
393
- return;
394
- c.changeLanguage(e);
395
- const n = {
396
- $invitee: "invitee",
397
- $invitee_email: "inviteeEmail",
398
- $duration: "duration"
399
- };
400
- this.availableTokens = this.availableTokens.map((o) => (n[o.label] && (o.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${n[o.label]}`)), o)), this.filteredTokens = [...this.availableTokens];
401
- }
402
- themeConfigChangedHandler(e, t) {
403
- e !== t && this.applyThemeConfig(e);
404
- }
405
- applyThemeConfig(e) {
406
- if (e)
407
- for (const [t, n] of Object.entries(e))
408
- this.host.style.setProperty(`${t}`, n);
409
- }
410
- connectedCallback() {
411
- d("nylas-event-description", "connectedCallback");
412
- }
413
- componentWillLoad() {
414
- d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
415
- }
416
- componentDidLoad() {
417
- d("nylas-event-description", "componentDidLoad"), this.selectedConfiguration ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.description = this.eventDescription || "", this.updateEventDescriptionFromProp(this.description));
418
- }
419
- disconnectedCallback() {
420
- d("nylas-event-description", "disconnectedCallback");
421
- }
422
- valueChangedHandler(e) {
423
- const { name: t, value: n } = e.detail;
424
- if (t === "additional-fields") {
425
- const o = JSON.parse(n.toString()), s = (Object.keys(o) || []).map((a) => ({
426
- token: `$${a}`,
427
- value: `\${${a}}`,
428
- description: o[a].label || ""
429
- }));
430
- this.additionalFieldTokens = [...s], this.availableTokens = [...k, ...s].map((a) => ({
431
- label: a.token,
432
- value: a.value,
433
- labelHTML: a
434
- })), this.filteredTokens = [...this.availableTokens];
435
- }
436
- }
437
- updateEventDescriptionFromProp(e) {
438
- d("nylas-event-description", "updateEventDescriptionFromProp", e);
439
- const t = e || this.description;
440
- this.descriptionRef && (this.descriptionRef.innerHTML = this.highlightTokens(t));
441
- }
442
- highlightTokens(e) {
443
- let t = e;
444
- return [...k, ...this.additionalFieldTokens].forEach((n) => {
445
- const o = n.value, r = new RegExp(`(\\${o})(?!\\w)`, "g");
446
- t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
447
- }), t;
448
- }
449
- getCurrentSelectionForBrowser() {
450
- var o, r, s;
451
- const e = (a, i, f, p) => {
452
- const h = a.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
453
- return {
454
- focusOffset: i,
455
- dollarIndex: y,
456
- lastWord: u,
457
- currentText: h,
458
- node: f,
459
- allSelected: p
460
- };
461
- }, t = (a) => {
462
- var i, f;
463
- return a.anchorOffset === 0 && a.focusOffset === ((f = (i = a.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : f.length);
464
- };
465
- switch (M()) {
466
- case "Chrome": {
467
- const a = (o = this.host.shadowRoot) == null ? void 0 : o.getSelection(), i = a == null ? void 0 : a.focusNode, f = (i == null ? void 0 : i.nodeValue) || "", p = a && t(a);
468
- return e(f, (a == null ? void 0 : a.focusOffset) || -1, i, p);
469
- }
470
- case "Firefox": {
471
- const a = document.getSelection(), i = ((r = a == null ? void 0 : a.anchorNode) == null ? void 0 : r.nodeValue) || "", f = a && t(a);
472
- return e(i, (a == null ? void 0 : a.focusOffset) || -1, a == null ? void 0 : a.anchorNode, f);
473
- }
474
- case "Safari": {
475
- const a = window.getSelection(), i = a == null ? void 0 : a.getComposedRanges(this.host.shadowRoot)[0], f = ((s = i == null ? void 0 : i.startContainer) == null ? void 0 : s.nodeValue) || "", p = a && t(a);
476
- return e(f, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, p);
477
- }
478
- default:
479
- return console.warn("Browser not supported"), null;
480
- }
481
- }
482
- handleChange(e) {
483
- let t = e.target.textContent || "";
484
- t = R(t);
485
- const n = this.getCurrentSelectionForBrowser();
486
- if (!n) {
487
- this.updateEventDescription(t), this.resetDropdown();
488
- return;
489
- }
490
- const { focusOffset: o, dollarIndex: r, lastWord: s, currentText: a } = n;
491
- if (r === -1 || o < r) {
492
- this.updateEventDescription(t), this.resetDropdown();
493
- return;
494
- }
495
- s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
496
- $value: s,
497
- fullText: a,
498
- index: r,
499
- focusOffset: o
500
- }, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventDescription(t);
501
- }
502
- handleInputKeyDown(e) {
503
- var n, o, r, s;
504
- const t = this.getCurrentSelectionForBrowser();
505
- if (t != null && t.allSelected && !S(e) && (this.descriptionRef.innerHTML = ""), e.key === "Enter") {
506
- e.preventDefault();
507
- const a = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
508
- if (a)
509
- a.click(), this.ariaActivedescendant = "";
510
- else {
511
- const i = t == null ? void 0 : t.node, f = (t == null ? void 0 : t.focusOffset) || 0;
512
- if (!i || f === -1 || this.descriptionRef.childNodes.length === 0) {
513
- const p = document.createTextNode(`
514
- `);
515
- this.descriptionRef.insertBefore(p, this.descriptionRef.firstChild);
516
- const h = document.createRange();
517
- h.setStart(p, 1), h.collapse(!0);
518
- const y = window.getSelection();
519
- y == null || y.removeAllRanges(), y == null || y.addRange(h);
520
- } else if (i.nodeType === Node.TEXT_NODE) {
521
- const p = i.nodeValue || "", h = p.slice(0, f) + `
522
- ` + p.slice(f);
523
- i.nodeValue = h;
524
- const y = document.createRange();
525
- y.setStart(i, f + 1), y.collapse(!0);
526
- const u = window.getSelection();
527
- u == null || u.removeAllRanges(), u == null || u.addRange(y);
528
- }
529
- this.descriptionRef.focus();
530
- }
531
- } else if (e.key === "ArrowDown") {
532
- this.showTokens && e.preventDefault();
533
- const a = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
534
- if (a) {
535
- const i = a.nextElementSibling;
536
- i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[0].label;
537
- } else
538
- this.ariaActivedescendant = this.filteredTokens[0].label;
539
- } else if (e.key === "ArrowUp") {
540
- this.showTokens && e.preventDefault();
541
- const a = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
542
- if (a) {
543
- const i = a.previousElementSibling;
544
- i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
545
- } else
546
- this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
547
- } else if (e.key === "Escape")
548
- e.preventDefault(), this.resetDropdown();
549
- else if (e.key === "Backspace" || e.key === "Delete") {
550
- const a = (s = t == null ? void 0 : t.node) == null ? void 0 : s.parentNode;
551
- t != null && t.currentText.startsWith("${") && a && a.nodeName === "SPAN" && (e.preventDefault(), a.removeChild(t.node), a.remove(), this.resetDropdown()), (this.descriptionRef.textContent === "" || t != null && t.allSelected) && (this.descriptionRef.innerHTML = "", this.updateEventDescription(""));
552
- }
553
- }
554
- selectOption(e, t) {
555
- var T;
556
- e.preventDefault();
557
- const n = this.currentWord.fullText, o = this.currentWord.$value;
558
- let r = this.descriptionRef.firstChild, s = null;
559
- for (; r; ) {
560
- if (r.nodeType === 3) {
561
- const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", L = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
562
- if (v.includes(L)) {
563
- s = r;
564
- break;
565
- }
566
- }
567
- r = r.nextSibling;
568
- }
569
- if (!s)
570
- return;
571
- const a = s.textContent || "", i = a.indexOf(o), f = a.substring(0, i), p = a.substring(i + o.length), h = document.createTextNode(f), y = document.createRange(), u = document.createElement("span");
572
- u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
573
- const _ = document.createTextNode(p);
574
- if (p !== "")
575
- s.replaceWith(h, u, _), y.setStart(_, 1);
576
- else {
577
- const v = document.createTextNode("​");
578
- s.replaceWith(h, u, v), y.setStart(v, 1);
579
- }
580
- this.resetDropdown(), this.descriptionRef.focus();
581
- const g = window.getSelection();
582
- y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventDescription(this.descriptionRef.textContent || "");
583
- }
584
- populateSuggestionsDropdown(e = "") {
585
- this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
586
- }
587
- get isInternalsAvailable() {
588
- return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
589
- }
590
- updateEventDescription(e) {
591
- var n;
592
- const t = e.replace(/ +/g, " ");
593
- this.isInternalsAvailable && ((n = this.internals) == null || n.setFormValue(t, this.name)), this.valueChanged.emit({ value: t, name: this.name });
594
- }
595
- resetDropdown() {
596
- this.showTokens = !1, this.ariaActivedescendant = "";
597
- }
598
- getLabelHTML(e) {
599
- return l("div", { class: "token-label" }, l("span", { class: "token" }, e.token), l("span", { class: "description" }, e.description));
600
- }
601
- handleAddAdditionalFields() {
602
- if (this.additionalFieldTokens.length === 0)
603
- return;
604
- const e = this.descriptionRef.innerHTML, t = "--- Additional Fields ---", n = "--- End Additional Fields ---", o = e.indexOf(t), r = e.indexOf(n);
605
- let s = t + `
606
- `;
607
- this.additionalFieldTokens.forEach((i) => {
608
- s += `${i.description}: ${i.value}
609
- `;
610
- }), s += n;
611
- let a;
612
- o !== -1 && r !== -1 ? a = e.substring(0, o) + s + e.substring(r + n.length) : a = e + s, this.updateEventDescriptionFromProp(a), this.updateEventDescription(a);
613
- }
614
- render() {
615
- var e;
616
- return l(C, { key: "9ccddd8582abc61f2dddd757a4c0b421ca75718b" }, l("div", { key: "06234e9529c43410161c40ac752fa6f0413daa6b", class: "nylas-event-description", part: "nedesc" }, l("label", { key: "c908c2dbd967208f92e72fab292b32527d645d0f", htmlFor: "description" }, c.t("nylasEventDescription.headerTitle"), l("span", { key: "90f417361636dc3d35d36be47e96b9cb2075294c", class: "label-icon" }, l("tooltip-component", { key: "d1bd3235457855d341c07be94a1d865995b21dac" }, l("info-icon", { key: "0ddd3a4af6dad47dec07fb5d6e490de8b174c4c3", slot: "tooltip-icon" }), l("span", { key: "b80a0cf4324dd728e32afc689327b5fb29a59fe8", slot: "tooltip-content" }, c.t("nylasEventDescription.tooltip.desc"))))), l("div", { key: "cf413dda764a5c41faafb1d95aecd1725e40eea3", id: "event-description", class: { "event-description": !0 }, part: "nedesc__textarea", contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t), ref: (t) => this.descriptionRef = t }), !this.noTemplates && this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && l("div", { class: "token-options", part: "nedesc__dropdown-content" }, l("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => l("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (n) => this.selectOption(n, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), !this.noTemplates && l("span", { class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.description") }), " ", l("code", null, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), l("span", { class: "label-icon" }, l("tooltip-component", null, l("info-icon", { slot: "tooltip-icon", width: "13", height: "13" }), l("span", { slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", l("code", null, "${invitee}"))))), !this.noTemplates && !this.hideAutoPopulateButton && l("span", { class: "add-additional-fields" }, l("button-component", { variant: "basic", onClick: () => this.handleAddAdditionalFields() }, c.t("nylasEventDescription.addAdditionalFields.buttonText")), l("span", { class: "label-icon" }, l("tooltip-component", null, l("info-icon", { slot: "tooltip-icon" }), l("span", { slot: "tooltip-content" }, c.t("nylasEventDescription.addAdditionalFields.tooltip.desc"), " ", l("code", null, "${invitee}")))))));
617
- }
618
- static get formAssociated() {
619
- return !0;
620
- }
621
- get host() {
622
- return x(this);
623
- }
624
- static get watchers() {
625
- return {
626
- name: ["elementNameChangedHandler"],
627
- selectedConfiguration: ["selectedConfigurationChangedHandler"],
628
- selectedLanguage: ["selectedLanguageChangedHandler"],
629
- themeConfig: ["themeConfigChangedHandler"]
630
- };
631
- }
632
- };
633
- Ce([
634
- w({
635
- name: "nylas-event-description",
636
- stateToProps: /* @__PURE__ */ new Map([
637
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
638
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
639
- ["schedulerConfig.themeConfig", "themeConfig"]
640
- ]),
641
- eventToProps: {},
642
- fireRegisterEvent: !0
643
- }),
644
- P("design:type", Function),
645
- P("design:paramtypes", []),
646
- P("design:returntype", void 0)
647
- ], B.prototype, "render", null);
648
- B.style = ke;
649
- const we = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-info__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-info__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem;background-color:var(--nylas-base-25)}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', _e = we;
650
- var Te = function(e, t, n, o) {
651
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
652
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
653
- s = Reflect.decorate(e, t, n, o);
654
- else
655
- for (var i = e.length - 1; i >= 0; i--)
656
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
657
- return r > 3 && s && Object.defineProperty(t, n, s), s;
658
- }, A = function(e, t) {
659
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
660
- return Reflect.metadata(e, t);
661
- };
662
- const j = class {
663
- constructor(e) {
664
- b(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedLanguage = void 0, this.themeConfig = void 0;
665
- }
666
- selectedLanguageChangedHandler(e, t) {
667
- e !== t && c.changeLanguage(e);
668
- }
669
- themeConfigChangedHandler(e, t) {
670
- e !== t && this.applyThemeConfig(e);
671
- }
672
- applyThemeConfig(e) {
673
- if (e)
674
- for (const [t, n] of Object.entries(e))
675
- this.el.style.setProperty(`${t}`, n);
676
- }
677
- connectedCallback() {
678
- d("nylas-event-info", "connectedCallback");
679
- }
680
- componentWillLoad() {
681
- d("nylas-event-info", "componentWillLoad");
682
- }
683
- componentDidLoad() {
684
- d("nylas-event-info", "componentDidLoad"), V(["inputs"], this.el);
685
- }
686
- disconnectedCallback() {
687
- d("nylas-event-info", "disconnectedCallback");
688
- }
689
- render() {
690
- return l(C, { key: "a62edaabd2210706d4ef9f671973a40fcbcb8d52" }, l("nylas-form-card", { key: "6bfbb55c126393559f7f00587fd7b009c0c42422", exportparts: "nfc__header: nei__header" }, l("h1", { key: "b05d0fa0528248fee82584e1ac594c68d17b1b8f", slot: "header-title", class: "nylas-event-info__title", part: "nei__title" }, c.t("nylasEventInfo.headerTitle")), l("div", { key: "5a589ed5c86d6fb4327110618af4fe320840a062", slot: "content", class: "nylas-event-info__content" }, l("slot", { key: "74c8f5de152d7efce914f8968342b84b3b4d5d35", name: "inputs" }))));
691
- }
692
- static get formAssociated() {
693
- return !0;
694
- }
695
- get el() {
696
- return x(this);
697
- }
698
- static get watchers() {
699
- return {
700
- selectedLanguage: ["selectedLanguageChangedHandler"],
701
- themeConfig: ["themeConfigChangedHandler"]
702
- };
703
- }
704
- };
705
- Te([
706
- w({
707
- name: "nylas-event-info",
708
- stateToProps: /* @__PURE__ */ new Map([
709
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
710
- ["schedulerConfig.themeConfig", "themeConfig"]
711
- ]),
712
- eventToProps: {},
713
- fireRegisterEvent: !0
714
- }),
715
- A("design:type", Function),
716
- A("design:paramtypes", []),
717
- A("design:returntype", void 0)
718
- ], j.prototype, "render", null);
719
- j.style = _e;
720
- const Ee = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-location{display:flex;flex-direction:column;gap:4px;font-family:var(--nylas-font-family)}.nylas-event-location label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-location label span.label-icon{margin-left:4px}.nylas-event-location label span.label-icon tooltip-component{display:flex}.nylas-event-location span[slot=select-icon]{border-right:1px solid var(--nylas-base-200);padding:16px 0.75rem 16px 0.5rem;border-radius:var(--nylas-border-radius-2x);border-bottom-right-radius:0;border-top-right-radius:0;height:20px}.nylas-event-location div.location-input{display:grid;grid-template-columns:auto 1fr;width:100%;gap:0.5rem}@media screen and (max-width: 768px){.nylas-event-location div.location-input{grid-template-columns:1fr}}.nylas-event-location div.location-input input{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;background-color:var(--nylas-base-0);color:var(--nylas-base-900)}.nylas-event-location select-dropdown{width:208px}@media screen and (max-width: 768px){.nylas-event-location select-dropdown{width:100%}}.nylas-event-location select-dropdown::part(sd_dropdown){width:100%}.nylas-event-location select-dropdown::part(sd_dropdown-content){left:calc(35px + 0.5rem)}.nylas-event-location select-dropdown::part(sd_dropdown-button){display:flex;justify-content:space-between;width:100%;border:1px solid var(--nylas-base-200);padding:0 0.5rem}.nylas-event-location select-dropdown::part(sd_dropdown-button-selected-label){display:inline-flex;align-self:center;padding:14px 0;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Le = Ee;
721
- var Oe = function(e, t, n, o) {
722
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
723
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
724
- s = Reflect.decorate(e, t, n, o);
725
- else
726
- for (var i = e.length - 1; i >= 0; i--)
727
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
728
- return r > 3 && s && Object.defineProperty(t, n, s), s;
729
- }, $ = function(e, t) {
730
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
731
- return Reflect.metadata(e, t);
732
- };
733
- const W = class {
734
- constructor(e) {
735
- var t;
736
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "location", this.currentUser = void 0, this.userProvider = void 0, this.eventConferencing = void 0, this.conferenceProviders = void 0, this.selectedConfiguration = void 0, this.eventLocation = void 0, this.selectedLanguage = void 0, this.themeConfig = void 0, this.location = this.eventLocation ?? "", this.grantId = this.eventConferencing ? this.setDefaultGrantID(this.eventConferencing) : "", this.selectedLocationOption = void 0, this.userProviderState = this.userProvider ?? ((t = this.currentUser) == null ? void 0 : t.provider) ?? "", this.locationOptions = [
737
- { value: "none", label: c.t("nylasEventLocation.conferenceOptions.none"), labelHTML: this.getLabelHTML("none") },
738
- { value: "custom", label: c.t("nylasEventLocation.conferenceOptions.custom"), labelHTML: this.getLabelHTML("custom") }
739
- ];
740
- }
741
- elementNameChangedHandler(e) {
742
- d("nylas-event-location", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
743
- }
744
- selectedConfigurationChangedHandler(e) {
745
- var o, r;
746
- d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
747
- const t = ((o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.location) || this.eventLocation, n = ((r = e == null ? void 0 : e.event_booking) == null ? void 0 : r.conferencing) || this.eventConferencing;
748
- n != null && n.provider ? (this.selectedLocationOption = this.setDefaultLocationOption(n, t ?? ""), this.grantId = this.setDefaultGrantID(n), this.location = t || "") : t ? (this.selectedLocationOption = t ? "custom" : "none", this.location = t) : (this.selectedLocationOption = "none", this.location = "");
749
- }
750
- currentUserChangedHandler(e) {
751
- d("nylas-custom-booking-flow", "currentUserChangedHandler", e), e != null && e.provider && (this.userProviderState = e == null ? void 0 : e.provider, this.setLocationOptionsForProvider(this.userProviderState));
752
- }
753
- conferenceProvidersChanged(e) {
754
- e != null && e.zoom && !this.locationOptions.some((t) => t.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
755
- }
756
- selectedLanguageChangedHandler(e, t) {
757
- if (e === t)
758
- return;
759
- c.changeLanguage(e), this.locationOptions.map((o) => o.value).forEach((o) => {
760
- const r = this.locationOptions.findIndex((s) => s.value === o);
761
- this.locationOptions[r].label = c.t(`nylasEventLocation.conferenceOptions.${o}`), this.locationOptions[r].labelHTML = this.getLabelHTML(o);
762
- }), this.locationOptions = [...this.locationOptions];
763
- }
764
- themeConfigChangedHandler(e, t) {
765
- e !== t && this.applyThemeConfig(e);
766
- }
767
- applyThemeConfig(e) {
768
- if (e)
769
- for (const [t, n] of Object.entries(e))
770
- this.host.style.setProperty(`${t}`, n);
771
- }
772
- connectedCallback() {
773
- d("nylas-event-location", "connectedCallback");
774
- }
775
- componentWillLoad() {
776
- d("nylas-event-location", "componentWillLoad"), this.host.setAttribute("name", this.name);
777
- }
778
- componentDidLoad() {
779
- var t, n, o, r;
780
- d("nylas-event-location", "componentDidLoad"), (t = this.selectedConfiguration) != null && t.event_booking ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.selectedLocationOption = this.setDefaultLocationOption(this.eventConferencing || null, this.eventLocation ?? ""), this.location = this.eventLocation ?? ""), this.userProviderState = this.userProvider ?? ((n = this.currentUser) == null ? void 0 : n.provider) ?? "", this.setLocationOptionsForProvider(this.userProviderState);
781
- const e = (o = this.internals) == null ? void 0 : o.form;
782
- if (e) {
783
- const s = new FormData(e);
784
- s.set("conference", this.getConferencePayload()), s.set(this.name, this.location);
785
- }
786
- (r = this.conferenceProviders) != null && r.zoom && !this.locationOptions.some((s) => s.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
787
- }
788
- disconnectedCallback() {
789
- d("nylas-event-location", "disconnectedCallback");
790
- }
791
- getConferencePayload() {
792
- var n;
793
- if (this.selectedLocationOption === "custom" || this.selectedLocationOption === "none")
794
- return JSON.stringify(null);
795
- const e = (n = this.conferenceProviders) == null ? void 0 : n[this.selectedLocationOption], t = {
796
- provider: E[this.selectedLocationOption],
797
- autocreate: e ? {
798
- conf_grant_id: e
799
- } : {}
800
- };
801
- return JSON.stringify(t);
802
- }
803
- nylasFormDropdownChangedHandler(e) {
804
- var n, o, r;
805
- this.selectedLocationOption = e.detail.value;
806
- let t;
807
- switch (this.selectedLocationOption) {
808
- case "none": {
809
- this.location = "", this.setFormValue("", this.name), this.valueChanged.emit({ value: "", name: this.name }), this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
810
- break;
811
- }
812
- case "custom": {
813
- this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
814
- break;
815
- }
816
- case "google": {
817
- this.location = "", this.setFormValue("", this.name);
818
- const s = (n = this.conferenceProviders) == null ? void 0 : n.google;
819
- t = {
820
- provider: E.google,
821
- autocreate: s ? {
822
- conf_grant_id: s
823
- } : {}
824
- }, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
825
- break;
826
- }
827
- case "microsoft": {
828
- this.location = "", this.setFormValue("", this.name);
829
- const s = (o = this.conferenceProviders) == null ? void 0 : o.microsoft;
830
- t = {
831
- provider: E.microsoft,
832
- autocreate: s ? {
833
- conf_grant_id: s
834
- } : {}
835
- }, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
836
- break;
837
- }
838
- case "zoom": {
839
- this.location = "", this.setFormValue("", this.name);
840
- const s = (r = this.conferenceProviders) == null ? void 0 : r.zoom;
841
- t = {
842
- provider: E.zoom,
843
- autocreate: s ? {
844
- conf_grant_id: s
845
- } : {}
846
- }, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
847
- break;
848
- }
849
- }
850
- }
851
- setLocationOptionsForProvider(e) {
852
- switch (e) {
853
- case "google":
854
- this.locationOptions.some((t) => t.value === "google") || this.locationOptions.push({ value: "google", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("google") });
855
- break;
856
- case "microsoft":
857
- this.locationOptions.some((t) => t.value === "microsoft") || this.locationOptions.push({ value: "microsoft", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("microsoft") });
858
- break;
859
- }
860
- }
861
- setDefaultLocationOption(e, t) {
862
- return e != null && (e == null ? void 0 : e.provider) != null ? J[e == null ? void 0 : e.provider] : t ? "custom" : "none";
863
- }
864
- setDefaultGrantID(e) {
865
- var t;
866
- return e != null && (e == null ? void 0 : e.autocreate) != null ? (t = e == null ? void 0 : e.autocreate) == null ? void 0 : t.conf_grant_id : "";
867
- }
868
- setFormValue(e, t) {
869
- typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
870
- }
871
- handleChange(e) {
872
- const t = R(e.target.value);
873
- this.location = t, this.setFormValue(t, this.name), this.valueChanged.emit({ value: t, name: this.name });
874
- }
875
- getIcon(e) {
876
- switch (e) {
877
- case "none":
878
- return l("location-off-icon", null);
879
- case "custom":
880
- return l("location-icon", null);
881
- case "google":
882
- return l("google-meet-icon", null);
883
- case "microsoft":
884
- return l("microsoft-teams-icon", null);
885
- case "zoom":
886
- return l("zoom-icon", null);
887
- }
888
- }
889
- getLabelHTML(e) {
890
- return l("span", { class: "location-label", style: {
891
- display: "flex",
892
- alignItems: "center",
893
- gap: "16px",
894
- width: "-webkit-fill-available"
895
- } }, this.getIcon(e), l("span", { class: "location-text", style: {
896
- fontSize: "14px",
897
- fontWeight: "400"
898
- } }, c.t(`nylasEventLocation.conferenceOptions.${e}`)));
899
- }
900
- render() {
901
- const e = typeof this.selectedLocationOption < "u" ? this.locationOptions.find((t) => t.value == this.selectedLocationOption) : null;
902
- return l(C, { key: "40dea8ec89029dc596695a8725987a8630087938" }, l("div", { key: "dad47c8d7121d1944db1b4aaecfc3f49acb8b55d", class: "nylas-event-location", part: "nel" }, l("label", { key: "ccae6484ae7b506fab9f302463a10a3bfc85b28b", htmlFor: "location" }, c.t("nylasEventLocation.headerTitle"), l("span", { key: "15e158e30f2d7e4734b651ebc1a0499447c3cc5e", class: "label-icon" }, l("tooltip-component", { key: "2a27de9e4ce28a3de891cfa83b3fd41e3d7aa604" }, l("info-icon", { key: "9c6b96cb3923a779453e9f272221b8bed6d2a29e", slot: "tooltip-icon" }), l("span", { key: "a5447aca3cc65264f59601d6617d45ceb57aebb1", slot: "tooltip-content" }, c.t("nylasEventLocation.tooltip.desc"))))), l("div", { key: "b35c29edd2bdf321c01ffb9c34216d2200ab3b13", class: "location-input" }, l("select-dropdown", { key: "0c303b54cf2ff2f3df72b540a640fcaa5cf33784", withSearch: !1, name: "location", options: this.locationOptions, defaultSelectedOption: e, themeConfig: this.themeConfig, exportparts: "sd_dropdown: nel__dropdown, sd_dropdown-button: nel__dropdown-button, sd_dropdown-content: nel__dropdown-content" }, l("span", { key: "1174247972b83c97d09a6c9621bd049294a0aaaf", slot: "select-icon" }, this.getIcon(this.selectedLocationOption))), this.selectedLocationOption === "custom" && l("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (t) => this.handleChange(t) }))));
903
- }
904
- static get formAssociated() {
905
- return !0;
906
- }
907
- get host() {
908
- return x(this);
909
- }
910
- static get watchers() {
911
- return {
912
- name: ["elementNameChangedHandler"],
913
- selectedConfiguration: ["selectedConfigurationChangedHandler"],
914
- currentUser: ["currentUserChangedHandler"],
915
- conferenceProviders: ["conferenceProvidersChanged"],
916
- selectedLanguage: ["selectedLanguageChangedHandler"],
917
- themeConfig: ["themeConfigChangedHandler"]
918
- };
919
- }
920
- };
921
- Oe([
922
- w({
923
- name: "nylas-event-location",
924
- stateToProps: /* @__PURE__ */ new Map([
925
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
926
- ["schedulerConfig.conferenceProviders", "conferenceProviders"],
927
- ["schedulerConfig.currentUser", "currentUser"],
928
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
929
- ["schedulerConfig.themeConfig", "themeConfig"]
930
- ]),
931
- eventToProps: {},
932
- fireRegisterEvent: !0
933
- }),
934
- $("design:type", Function),
935
- $("design:paramtypes", []),
936
- $("design:returntype", void 0)
937
- ], W.prototype, "render", null);
938
- W.style = Le;
939
- const Ie = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left;color:var(--nylas-base-900)}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:auto;white-space:nowrap;scrollbar-width:thin;background-color:var(--nylas-base-0)}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-title span.help-text span.label-icon{display:inline-block}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}', Pe = Ie;
940
- var Ae = function(e, t, n, o) {
941
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
942
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
943
- s = Reflect.decorate(e, t, n, o);
944
- else
945
- for (var i = e.length - 1; i >= 0; i--)
946
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
947
- return r > 3 && s && Object.defineProperty(t, n, s), s;
948
- }, D = function(e, t) {
949
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
950
- return Reflect.metadata(e, t);
951
- };
952
- const U = class {
953
- constructor(e) {
954
- var t, n;
955
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventTitle = (n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.title, this.name = "title", this.selectedLanguage = void 0, this.noTemplates = !1, this.themeConfig = void 0, this.showTokens = !1, this.availableTokens = k.map((o) => ({
956
- label: o.token,
957
- value: o.value,
958
- labelHTML: o
959
- })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.configEventTitle = "", this.additionalFieldTokens = [];
960
- }
961
- elementNameChangedHandler(e) {
962
- d("[nylas-event-title]", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
963
- }
964
- ariaActivedescendantChangedHandler(e) {
965
- var t, n;
966
- if (d("[nylas-event-title]", "ariaActivedescendantChangedHandler", e), e !== "") {
967
- const o = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
968
- o == null || o.classList.add("active");
969
- } else {
970
- const o = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
971
- o == null || o.forEach((r) => r.classList.remove("active"));
972
- }
973
- }
974
- configChangedHandler(e) {
975
- var s, a;
976
- const t = (s = e == null ? void 0 : e.event_booking) == null ? void 0 : s.title, n = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.additional_fields) || {}, r = (Object.keys(n) || []).map((i) => ({
977
- token: `$${i}`,
978
- value: `\${${i}}`,
979
- description: n[i].label || ""
980
- }));
981
- this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
982
- label: i.token,
983
- value: i.value,
984
- labelHTML: i
985
- })), this.filteredTokens = [...this.availableTokens], t && (this.configEventTitle = t, this.updateEventTitleFromProp(t));
986
- }
987
- selectedLanguageChangedHandler(e, t) {
988
- if (e === t)
989
- return;
990
- c.changeLanguage(e);
991
- const n = {
992
- $invitee: "invitee",
993
- $invitee_email: "inviteeEmail",
994
- $duration: "duration"
995
- };
996
- this.availableTokens = this.availableTokens.map((o) => (n[o.label] && (o.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${n[o.label]}`)), o)), this.filteredTokens = [...this.availableTokens];
997
- }
998
- themeConfigChangedHandler(e, t) {
999
- e !== t && this.applyThemeConfig(e);
1000
- }
1001
- applyThemeConfig(e) {
1002
- if (e)
1003
- for (const [t, n] of Object.entries(e))
1004
- this.host.style.setProperty(`${t}`, n);
1005
- }
1006
- connectedCallback() {
1007
- d("[nylas-event-title]", "connectedCallback");
1008
- }
1009
- componentWillLoad() {
1010
- d("[nylas-event-title]", "componentWillLoad"), this.host.setAttribute("name", this.name);
1011
- }
1012
- componentDidLoad() {
1013
- var t, n, o, r;
1014
- d("[nylas-event-title]", "componentDidLoad");
1015
- let e = this.eventTitle || this.configEventTitle;
1016
- (n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) != null && n.title && (e = (r = (o = this.selectedConfiguration) == null ? void 0 : o.event_booking) == null ? void 0 : r.title), e && (this.updateEventTitleFromProp(e), this.updateEventTitle(e, !0));
1017
- }
1018
- disconnectedCallback() {
1019
- d("[nylas-event-title]", "disconnectedCallback");
1020
- }
1021
- formSubmittedHandler(e) {
1022
- var t, n;
1023
- d("[nylas-event-title]", "formSubmittedHandler", e), (n = (t = this.internals) == null ? void 0 : t.validity) != null && n.valid ? this.validationError = "" : this.validationError = "eventTitleRequired";
1024
- }
1025
- valueChangedHandler(e) {
1026
- const { name: t, value: n } = e.detail;
1027
- if (t === "additional-fields") {
1028
- const o = JSON.parse(n.toString()), s = (Object.keys(o) || []).map((a) => ({
1029
- token: `$${a}`,
1030
- value: `\${${a}}`,
1031
- description: o[a].label || ""
1032
- }));
1033
- this.additionalFieldTokens = [...s], this.availableTokens = [...k, ...s].map((a) => ({
1034
- label: a.token,
1035
- value: a.value,
1036
- labelHTML: a
1037
- })), this.filteredTokens = [...this.availableTokens];
1038
- }
1039
- }
1040
- updateEventTitleFromProp(e) {
1041
- var n, o, r;
1042
- d("[nylas-event-title]", "eventTitleChangedHandler", e);
1043
- const t = e || this.configEventTitle;
1044
- this.titleRef && (this.titleRef.innerHTML = this.highlightTokens(t), typeof this.internals.setValidity == "function" && (!t || t === "" ? (this.titleRef.focus(), (n = this.internals) == null || n.setValidity({ customError: !0 }, "Event title is required", this.titleRef)) : ((o = this.internals) == null || o.setValidity({ customError: !1 }), this.isInternalsAvailable && ((r = this.internals) == null || r.setFormValue(t, this.name)))));
1045
- }
1046
- highlightTokens(e) {
1047
- let t = e;
1048
- return [...k, ...this.additionalFieldTokens].forEach((n) => {
1049
- const o = n.value, r = new RegExp(`(\\${o})(?!\\w)`, "g");
1050
- t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
1051
- }), t;
1052
- }
1053
- getCurrentSelectionForBrowser() {
1054
- var o, r, s;
1055
- const e = (a, i, f, p) => {
1056
- const h = a.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
1057
- return {
1058
- focusOffset: i,
1059
- dollarIndex: y,
1060
- lastWord: u,
1061
- currentText: h,
1062
- node: f,
1063
- allSelected: p
1064
- };
1065
- }, t = (a) => {
1066
- var i, f;
1067
- return a.anchorOffset === 0 && a.focusOffset === ((f = (i = a.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : f.length);
1068
- };
1069
- switch (M()) {
1070
- case "Chrome": {
1071
- const a = (o = this.host.shadowRoot) == null ? void 0 : o.getSelection(), i = a == null ? void 0 : a.focusNode, f = (i == null ? void 0 : i.nodeValue) || "", p = a && t(a);
1072
- return e(f, (a == null ? void 0 : a.focusOffset) || -1, i, p);
1073
- }
1074
- case "Firefox": {
1075
- const a = document.getSelection(), i = ((r = a == null ? void 0 : a.anchorNode) == null ? void 0 : r.nodeValue) || "", f = a && t(a);
1076
- return e(i, (a == null ? void 0 : a.focusOffset) || -1, a == null ? void 0 : a.anchorNode, f);
1077
- }
1078
- case "Safari": {
1079
- const a = window.getSelection(), i = a == null ? void 0 : a.getComposedRanges(this.host.shadowRoot)[0], f = ((s = i == null ? void 0 : i.startContainer) == null ? void 0 : s.nodeValue) || "", p = a && t(a);
1080
- return e(f, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, p);
1081
- }
1082
- default:
1083
- return console.warn("Browser not supported"), null;
1084
- }
1085
- }
1086
- handleChange(e) {
1087
- let t = e.target.textContent || "";
1088
- t = R(t);
1089
- const n = this.getCurrentSelectionForBrowser();
1090
- if (!n) {
1091
- this.updateEventTitle(t), this.resetDropdown();
1092
- return;
1093
- }
1094
- const { focusOffset: o, dollarIndex: r, lastWord: s, currentText: a } = n;
1095
- if (r === -1 || o < r) {
1096
- this.updateEventTitle(t), this.resetDropdown();
1097
- return;
1098
- }
1099
- s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
1100
- $value: s,
1101
- fullText: a,
1102
- index: r,
1103
- focusOffset: o
1104
- }, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventTitle(t);
1105
- }
1106
- handleInputKeyDown(e) {
1107
- var n, o, r, s, a;
1108
- const t = this.getCurrentSelectionForBrowser();
1109
- if (t != null && t.allSelected && !S(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
1110
- e.preventDefault();
1111
- const i = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
1112
- i && (i.click(), this.ariaActivedescendant = "");
1113
- } else if (e.key === "ArrowDown") {
1114
- e.preventDefault();
1115
- const i = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
1116
- if (i) {
1117
- const f = i.nextElementSibling;
1118
- f ? this.ariaActivedescendant = f.id : this.ariaActivedescendant = this.filteredTokens[0].label;
1119
- } else
1120
- this.ariaActivedescendant = this.filteredTokens[0].label;
1121
- } else if (e.key === "ArrowUp") {
1122
- e.preventDefault();
1123
- const i = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
1124
- if (i) {
1125
- const f = i.previousElementSibling;
1126
- f ? this.ariaActivedescendant = f.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1127
- } else
1128
- this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1129
- } else if (e.key === "Escape")
1130
- e.preventDefault(), this.resetDropdown();
1131
- else if (e.key === "Backspace" || e.key === "Delete") {
1132
- const i = (s = t == null ? void 0 : t.node) == null ? void 0 : s.parentNode;
1133
- t != null && t.currentText.startsWith("${") && i && i.nodeName === "SPAN" && (e.preventDefault(), i.removeChild(t.node), i.remove(), this.resetDropdown(), this.updateEventTitle(((a = this.titleRef) == null ? void 0 : a.textContent) || "")), (this.titleRef.textContent === "" || t != null && t.allSelected) && (this.titleRef.innerHTML = "", this.updateEventTitle(""));
1134
- }
1135
- }
1136
- selectOption(e, t) {
1137
- var T;
1138
- e.preventDefault();
1139
- const n = this.currentWord.fullText, o = this.currentWord.$value;
1140
- let r = this.titleRef.firstChild, s = null;
1141
- for (; r; ) {
1142
- if (r.nodeType === 3) {
1143
- const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", L = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
1144
- if (v.includes(L)) {
1145
- s = r;
1146
- break;
1147
- }
1148
- }
1149
- r = r.nextSibling;
1150
- }
1151
- if (!s)
1152
- return;
1153
- const a = s.textContent || "", i = a.indexOf(o), f = a.substring(0, i), p = a.substring(i + o.length), h = document.createTextNode(f), y = document.createRange(), u = document.createElement("span");
1154
- u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
1155
- const _ = document.createTextNode(p);
1156
- if (p !== "")
1157
- s.replaceWith(h, u, _), y.setStart(_, 1);
1158
- else {
1159
- const v = document.createTextNode("​");
1160
- s.replaceWith(h, u, v), y.setStart(v, 1);
1161
- }
1162
- this.resetDropdown(), this.titleRef.focus();
1163
- const g = window.getSelection();
1164
- y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventTitle(this.titleRef.textContent || "");
1165
- }
1166
- populateSuggestionsDropdown(e = "") {
1167
- this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
1168
- }
1169
- get isInternalsAvailable() {
1170
- return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
1171
- }
1172
- updateEventTitle(e, t = !1) {
1173
- var o, r, s;
1174
- const n = e.replace(/ +/g, " ");
1175
- n === "" || /^[\s]*$/.test(n) ? (this.validationError = "eventTitleRequired", this.isInternalsAvailable && ((o = this.internals) == null || o.setValidity({ customError: !0 }, "Event title is required", this.titleRef))) : (this.validationError = "", this.isInternalsAvailable && ((r = this.internals) == null || r.setValidity({ customError: !1 }))), this.isInternalsAvailable && ((s = this.internals) == null || s.setFormValue(n, this.name)), t || this.valueChanged.emit({ value: n, name: this.name });
1176
- }
1177
- resetDropdown() {
1178
- this.showTokens = !1, this.ariaActivedescendant = "";
1179
- }
1180
- getLabelHTML(e) {
1181
- return l("div", { class: "token-label" }, l("span", { class: "token" }, e.token), l("span", { class: "description" }, e.description));
1182
- }
1183
- render() {
1184
- var e;
1185
- return l(C, { key: "c6da12f405f1743fad3fcdebc253943e82849e1a" }, l("div", { key: "d66fa4c93ba12409991bc981ec6e7171113872f4", class: "nylas-event-title", part: "net" }, l("label", { key: "3c77424914867eaae8e71e5d3c13f459074b8256", htmlFor: "title" }, c.t("nylasEventTitle.headerTitle"), l("span", { key: "09f56d087b243ee8832331d9bc3c83073e1d9adb", class: "required" }, "*")), l("div", { key: "ec015f8e45422cb8f6593d7bab2db7e34caf69da", class: {
1186
- title: !0,
1187
- error: this.validationError !== ""
1188
- }, part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), !this.noTemplates && this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && l("div", { class: "token-options", part: "net__dropdown-content" }, l("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => l("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (n) => this.selectOption(n, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), !this.noTemplates && l("span", { class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.title") }), " ", l("code", null, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), l("span", { class: "label-icon" }, l("tooltip-component", null, l("info-icon", { slot: "tooltip-icon" }), l("span", { slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", l("code", null, "${invitee}"))))), this.validationError != "" && l("span", { class: "error-message" }, c.t(`nylasEventTitle.${this.validationError}`))));
1189
- }
1190
- static get formAssociated() {
1191
- return !0;
1192
- }
1193
- get host() {
1194
- return x(this);
1195
- }
1196
- static get watchers() {
1197
- return {
1198
- name: ["elementNameChangedHandler"],
1199
- ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
1200
- selectedConfiguration: ["configChangedHandler"],
1201
- selectedLanguage: ["selectedLanguageChangedHandler"],
1202
- themeConfig: ["themeConfigChangedHandler"]
1203
- };
1204
- }
1205
- };
1206
- Ae([
1207
- w({
1208
- name: "nylas-event-title",
1209
- stateToProps: /* @__PURE__ */ new Map([
1210
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
1211
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1212
- ["schedulerConfig.themeConfig", "themeConfig"]
1213
- ]),
1214
- eventToProps: {},
1215
- fireRegisterEvent: !0
1216
- }),
1217
- D("design:type", Function),
1218
- D("design:paramtypes", []),
1219
- D("design:returntype", void 0)
1220
- ], U.prototype, "render", null);
1221
- U.style = Pe;
1222
- const $e = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.card-wrapper{background:var(--nylas-base-0);display:flex;flex-direction:column;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;padding:32px;width:562px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.card-wrapper{width:100%;border-radius:0px}}.header{overflow-wrap:anywhere;display:flex;flex-direction:column;font-size:16px;font-weight:400}.header h2{color:var(--nylas-base-900);font-size:24px;font-weight:600;text-align:left;margin:0}.description.title-desc{margin-bottom:2rem}.description.footer-desc{margin-top:2rem}.description.footer-desc a{color:var(--nylas-primary);text-decoration:none}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', De = $e;
1223
- var Fe = function(e, t, n, o) {
1224
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
1225
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1226
- s = Reflect.decorate(e, t, n, o);
1227
- else
1228
- for (var i = e.length - 1; i >= 0; i--)
1229
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
1230
- return r > 3 && s && Object.defineProperty(t, n, s), s;
1231
- }, F = function(e, t) {
1232
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1233
- return Reflect.metadata(e, t);
1234
- };
1235
- const K = class {
1236
- constructor(e) {
1237
- b(this, e), this.feedbackModalClosed = m(this, "feedbackModalClosed", 7), this.feedbackSubmitted = m(this, "feedbackSubmitted", 7), this.triggerValidation = m(this, "triggerValidation", 7), this.handleConfirmBookingButtonClicked = () => {
1238
- this.triggerValidation.emit().defaultPrevented || this.feedbackSubmitted.emit({ feedback: this.feedbackMessage });
1239
- }, this.themeConfig = void 0, this.feedbackMessage = "";
1240
- }
1241
- connectedCallback() {
1242
- }
1243
- disconnectedCallback() {
1244
- }
1245
- async componentWillLoad() {
1246
- d("[nylas-feedback-form] Component will load");
1247
- }
1248
- async componentDidLoad() {
1249
- d("[nylas-feedback-form] Component did load"), this.applyThemeConfig(this.themeConfig);
1250
- }
1251
- applyThemeConfig(e) {
1252
- if (e)
1253
- for (const [t, n] of Object.entries(e))
1254
- this.host.style.setProperty(`${t}`, n);
1255
- }
1256
- handleFormInputChanged(e) {
1257
- d("[nylas-feedback-form] Form input changed"), e.detail.value && (this.triggerValidation.emit(), e.detail.name === "feedback" && (this.feedbackMessage = e.detail.value));
1258
- }
1259
- closeModal(e) {
1260
- e.preventDefault(), e.stopImmediatePropagation(), this.feedbackModalClosed.emit();
1261
- }
1262
- render() {
1263
- return l(C, { key: "3dfba1b006f09a9ac9ccdd03a659784b86df25d4", part: "nfbf" }, l("div", { key: "f548f82b9689115b254815c0a6b940d1450ada04", class: "card-wrapper", part: "nfbfc__card" }, l("div", { key: "3e1be6b2ff7d6818b677f09772cde78edb4c7ef1", class: "close-button" }, l("button-component", { key: "dd98523ad84cc745f24daa400bb41753d103c3c6", tooltip: "Close", id: "close", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__close-button" }, l("close-icon", { key: "0b919c2be114e231ff8eb7121536b6c24dfb7158" }))), l("div", { key: "2c62e429a6871d1dc6a34df4fc37440e61e9e041", class: "header" }, l("h2", { key: "8c1009dc5a853bb0cbc21b64958353c95a0ca140", slot: "card-title", part: "nfbf__title" }, c.t("feedbackFormTitle"))), l("div", { key: "b16e5a7c0e3b299d6ee9a74d154aa3628e9d4d25", class: "description title-desc" }, l("p", { key: "00675ebd52e88ed101df5710b3bded1f6424c274" }, c.t("feedbackFormDescription"))), l("textarea-component", { key: "7b021701b44eb5b3ba02ee3191d3866489f4ec8a", label: c.t("feedbackMessageLabel"), required: !0, maxLength: 500, part: "nfbf__description", name: "feedback", placeholder: c.t("feedbackMessagePlaceholder") }), l("div", { key: "def91af529f167b1fac0cc078f79cec67b961a1a", class: "description footer-desc" }, l("p", { key: "ad346ef93ae4a25fd5478284ff5415eb62b54f26" }, "By sending this report, you agree to Nylas’ access to the data necessary to respond to this issue, subject to Nylas’", " ", l("a", { key: "cd6a79cf548346d92d04264c4ff7244a032c3977", href: "https://www.nylas.com/privacy-policy/", target: "_blank", rel: "nofollow noreferrer noopener" }, "Privacy Policy"), ".")), l("div", { key: "5dfee1045b6711f5cf7d15009c86c0fd9b76b137", class: {
1264
- footer: !0
1265
- } }, l("button-component", { key: "45894bd04b89365c83d7e2a07e8a62ee7c94b6c0", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__button-outline nfbf__cancel-cta" }, `${c.t("feedbackModalCloseButton")}`), l("button-component", { key: "ac586974014c3e3b6b454a8b830585b76bc1f290", variant: "primary", onClick: this.handleConfirmBookingButtonClicked, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${c.t("feedbackModalSubmitButton")}`))));
1266
- }
1267
- get host() {
1268
- return x(this);
1269
- }
1270
- };
1271
- Fe([
1272
- w({
1273
- name: "nylas-feedback-form",
1274
- stateToProps: /* @__PURE__ */ new Map([]),
1275
- eventToProps: {
1276
- feedbackSubmitted: async (e, t) => {
1277
- }
1278
- },
1279
- localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
1280
- fireRegisterEvent: !0
1281
- }),
1282
- F("design:type", Function),
1283
- F("design:paramtypes", []),
1284
- F("design:returntype", void 0)
1285
- ], K.prototype, "render", null);
1286
- K.style = De;
1287
- const He = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-reminder-time{display:flex;flex-direction:column;gap:4px}.nylas-reminder-time label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-reminder-time label span.required{color:var(--nylas-error, #cc4841)}.nylas-reminder-time label span.label-icon{margin-left:4px}.nylas-reminder-time label span.label-icon tooltip-component{display:flex}.nylas-reminder-time__wrapper{display:flex;align-items:center;justify-content:flex-end;gap:0.5rem}.nylas-reminder-time__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-reminder-time__wrapper input-dropdown{width:80px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-input){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:14px 16px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-content){width:100%;min-width:unset;height:160px}.nylas-reminder-time__wrapper select-dropdown{width:120px}@media screen and (max-width: 768px){.nylas-reminder-time__wrapper select-dropdown{width:100%}}.nylas-reminder-time__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200)}', Re = He;
1288
- var Se = function(e, t, n, o) {
1289
- var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
1290
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1291
- s = Reflect.decorate(e, t, n, o);
1292
- else
1293
- for (var i = e.length - 1; i >= 0; i--)
1294
- (a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
1295
- return r > 3 && s && Object.defineProperty(t, n, s), s;
1296
- }, H = function(e, t) {
1297
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1298
- return Reflect.metadata(e, t);
1299
- };
1300
- const Z = class {
1301
- constructor(e) {
1302
- b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "reminder-time", this.eventReminderTimeMinutes = void 0, this.selectedLanguage = void 0, this.themeConfig = void 0, this.selectedNumber = void 0, this.selectedPeriod = void 0, this.errorState = !1;
1303
- }
1304
- elementNameChangedHandler(e) {
1305
- d("nylas-reminder-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1306
- }
1307
- eventReminderTimeMinutesChangedHandler(e, t) {
1308
- d("nylas-reminder-time", "eventReminderTimeMinutesChangedHandler", e), this.updateNumberAndPeriodFromMinutes(e), this.isInternalsAvailable && this.internals.setFormValue(e == null ? void 0 : e.toString(), this.name);
1309
- }
1310
- selectedLanguageChangedHandler(e, t) {
1311
- e !== t && c.changeLanguage(e);
1312
- }
1313
- themeConfigChangedHandler(e, t) {
1314
- e !== t && this.applyThemeConfig(e);
1315
- }
1316
- connectedCallback() {
1317
- d("nylas-reminder-time", "connectedCallback");
1318
- }
1319
- componentWillLoad() {
1320
- d("nylas-reminder-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
1321
- }
1322
- componentDidLoad() {
1323
- d("nylas-reminder-time", "componentDidLoad"), this.updateNumberAndPeriodFromMinutes(this.eventReminderTimeMinutes || 30);
1324
- }
1325
- disconnectedCallback() {
1326
- d("nylas-reminder-time", "disconnectedCallback");
1327
- }
1328
- applyThemeConfig(e) {
1329
- if (e)
1330
- for (const [t, n] of Object.entries(e))
1331
- this.host.style.setProperty(`${t}`, n);
1332
- }
1333
- nylasSuggestReminderMinutesHandler(e) {
1334
- const { minutes: t } = e.detail;
1335
- this.errorState = !1, this.valueChanged.emit({ value: t.toString(), name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(t.toString(), this.name), this.updateNumberAndPeriodFromMinutes(t + 7), setTimeout(() => {
1336
- this.updateNumberAndPeriodFromMinutes(t);
1337
- }, 10);
1338
- }
1339
- timePeriodChangedHandler(e) {
1340
- const { number: t, period: n } = e.detail;
1341
- let o;
1342
- const r = 60, s = r * 24, a = s * 7, i = s * 30;
1343
- n === "minute" ? o = t : n === "hour" ? o = t * r : n === "day" ? o = t * s : n === "week" ? o = t * a : n === "month" ? o = t * i : o = 0, this.errorState = o % 5 !== 0, this.valueChanged.emit({ value: o, name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(o.toString(), this.name);
1344
- }
1345
- updateNumberAndPeriodFromMinutes(e) {
1346
- let s, a;
1347
- e === 0 ? (s = 0, a = "minute") : e >= 43200 && e % 43200 === 0 ? (s = Math.floor(e / 43200), a = "month") : e >= 10080 && e % 10080 === 0 ? (s = Math.floor(e / 10080), a = "week") : e >= 1440 && e % 1440 === 0 ? (s = Math.floor(e / 1440), a = "day") : e >= 60 && e % 60 === 0 ? (s = Math.floor(e / 60), a = "hour") : (s = e, a = "minute"), this.selectedNumber = s, this.selectedPeriod = a;
1348
- }
1349
- get isInternalsAvailable() {
1350
- return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
1351
- }
1352
- render() {
1353
- const e = typeof this.selectedNumber == "number" && typeof this.selectedPeriod == "string";
1354
- return l(C, { key: "8496d67f55d981e506f577ad20197af8438bd408" }, l("div", { key: "d92c02476f1db6fe56d3045884dd381ed899af8c", class: "nylas-reminder-time", part: "nrt" }, l("div", { key: "79b615876498bcf00f51eaf22779fb54b4c398dc", class: "nylas-reminder-time__wrapper" }, e && l("time-period-selector", { id: "limit-future-bookings", part: "nrt__time-period-selector", hasError: this.errorState, timePeriods: [
1355
- { value: "minute", label: c.t("timeDuration", { context: "minute" }) },
1356
- { value: "hour", label: c.t("timeDuration", { context: "hour" }) },
1357
- { value: "day", label: c.t("timePeriod", { context: "day" }) }
1358
- ], exportparts: "tps__number-dropdown: nrt__number-dropdown, tps__number-dropdown-button: nrt__number-dropdown-button, tps__number-dropdown-content: nrt__number-dropdown-content, tps__period-dropdown: nrt__period-dropdown, tps__period-dropdown-button: nrt__period-dropdown-button, tps__period-dropdown-content: nrt__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod, themeConfig: this.themeConfig }))));
1359
- }
1360
- static get formAssociated() {
1361
- return !0;
1362
- }
1363
- get host() {
1364
- return x(this);
1365
- }
1366
- static get watchers() {
1367
- return {
1368
- name: ["elementNameChangedHandler"],
1369
- eventReminderTimeMinutes: ["eventReminderTimeMinutesChangedHandler"],
1370
- selectedLanguage: ["selectedLanguageChangedHandler"],
1371
- themeConfig: ["themeConfigChangedHandler"]
1372
- };
1373
- }
1374
- };
1375
- Se([
1376
- w({
1377
- name: "nylas-reminder-time",
1378
- stateToProps: /* @__PURE__ */ new Map([
1379
- ["schedulerConfig.selectedLanguage", "selectedLanguage"],
1380
- ["schedulerConfig.themeConfig", "themeConfig"]
1381
- ]),
1382
- eventToProps: {},
1383
- fireRegisterEvent: !0
1384
- }),
1385
- H("design:type", Function),
1386
- H("design:paramtypes", []),
1387
- H("design:returntype", void 0)
1388
- ], Z.prototype, "render", null);
1389
- Z.style = Re;
1390
- const Me = ".sc-trash-icon-h{display:flex}", Ne = Me, ze = class {
1391
- constructor(e) {
1392
- b(this, e), this.width = "20", this.height = "21";
1393
- }
1394
- render() {
1395
- return l("svg", { key: "cd43bcf8a91abf12501571439a02652afeff0b0f", width: this.width, height: this.height, viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "2870e48a14d2a84175298a75d47e3224a10385a4", d: "M10 0.25C11.733 0.25 13.1492 1.60645 13.2449 3.31558L13.25 3.5H18.5C18.9142 3.5 19.25 3.83579 19.25 4.25C19.25 4.6297 18.9678 4.94349 18.6018 4.99315L18.5 5H17.704L16.4239 18.0192C16.2912 19.3683 15.1984 20.41 13.8626 20.4945L13.6871 20.5H6.31293C4.95734 20.5 3.81365 19.5145 3.59883 18.1934L3.57614 18.0192L2.295 5H1.5C1.1203 5 0.806509 4.71785 0.756847 4.35177L0.75 4.25C0.75 3.8703 1.03215 3.55651 1.39823 3.50685L1.5 3.5H6.75C6.75 1.70507 8.20507 0.25 10 0.25ZM16.197 5H3.802L5.06893 17.8724C5.12768 18.4696 5.60033 18.9343 6.18585 18.9936L6.31293 19H13.6871C14.2872 19 14.7959 18.5751 14.9123 17.9982L14.9311 17.8724L16.197 5ZM11.75 7.75C12.1297 7.75 12.4435 8.03215 12.4932 8.39823L12.5 8.5V15.5C12.5 15.9142 12.1642 16.25 11.75 16.25C11.3703 16.25 11.0565 15.9678 11.0068 15.6018L11 15.5V8.5C11 8.08579 11.3358 7.75 11.75 7.75ZM8.25 7.75C8.6297 7.75 8.94349 8.03215 8.99315 8.39823L9 8.5V15.5C9 15.9142 8.66421 16.25 8.25 16.25C7.8703 16.25 7.55651 15.9678 7.50685 15.6018L7.5 15.5V8.5C7.5 8.08579 7.83579 7.75 8.25 7.75ZM10 1.75C9.08183 1.75 8.32881 2.45711 8.2558 3.35647L8.25 3.5H11.75C11.75 2.5335 10.9665 1.75 10 1.75Z", fill: "currentColor" }));
1396
- }
1397
- };
1398
- ze.style = Ne;
1399
- export {
1400
- Q as checkmark_icon,
1401
- te as copy_icon,
1402
- oe as dragable_icon,
1403
- ie as eye_icon,
1404
- de as feedback_icon,
1405
- ye as input_color_picker,
1406
- N as input_image_url,
1407
- z as nylas_additional_participants,
1408
- B as nylas_event_description,
1409
- j as nylas_event_info,
1410
- W as nylas_event_location,
1411
- U as nylas_event_title,
1412
- K as nylas_feedback_form,
1413
- Z as nylas_reminder_time,
1414
- ze as trash_icon
1415
- };