@nylas/react 1.0.2-canary.2 → 1.1.0-canary.10

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 (145) hide show
  1. package/dist/add-circle-icon_21.entry-125b87a0.js +1719 -0
  2. package/dist/add-circle-icon_21.entry-1a699a29.cjs +1 -0
  3. package/dist/{archive-icon_7.entry-0e34d6e7.js → archive-icon_7.entry-70efea56.js} +13 -13
  4. package/dist/{archive-icon_7.entry-052ac074.cjs → archive-icon_7.entry-a69d3d98.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-93f21385.cjs → arrow-icon.entry-0a07d7cc.cjs} +1 -1
  6. package/dist/{arrow-icon.entry-2afd9ea9.js → arrow-icon.entry-c9230436.js} +1 -1
  7. package/dist/{bold-icon_3.entry-88ce1d25.js → bold-icon_3.entry-54ff7799.js} +7 -7
  8. package/dist/bold-icon_3.entry-f7df4331.cjs +1 -0
  9. package/dist/{calendar-cancel-icon.entry-574c8aa4.cjs → calendar-cancel-icon.entry-71cc68e2.cjs} +1 -1
  10. package/dist/{calendar-cancel-icon.entry-e9c692fa.js → calendar-cancel-icon.entry-e5157332.js} +1 -1
  11. package/dist/{calendar-check-icon_2.entry-b0476bca.cjs → calendar-check-icon_2.entry-f02bf0fe.cjs} +1 -1
  12. package/dist/{calendar-check-icon_2.entry-d461c713.js → calendar-check-icon_2.entry-f75ef95e.js} +1 -1
  13. package/dist/{calendar-icon.entry-1ca202a4.js → calendar-icon.entry-67aa69f5.js} +1 -1
  14. package/dist/{calendar-icon.entry-98936e6d.cjs → calendar-icon.entry-a164e957.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-7687ca7a.cjs +1 -0
  16. package/dist/chevron-icon_3.entry-81c68946.js +117 -0
  17. package/dist/{close-icon.entry-8d6e9816.cjs → close-icon.entry-147b4d47.cjs} +1 -1
  18. package/dist/{close-icon.entry-37e8361f.js → close-icon.entry-3325a08e.js} +1 -1
  19. package/dist/{constants-b6bf6671-49a0f1f2.js → constants-f34b9c6e-21ac1910.js} +11 -2
  20. package/dist/{constants-b6bf6671-27e2557d.cjs → constants-f34b9c6e-99030371.cjs} +2 -2
  21. package/dist/{document-refresh-icon.entry-faea08ce.js → document-refresh-icon.entry-1b076630.js} +1 -1
  22. package/dist/{document-refresh-icon.entry-fcb33921.cjs → document-refresh-icon.entry-dea23e07.cjs} +1 -1
  23. package/dist/elements/index.d.ts +8 -0
  24. package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-83c23e9b.cjs} +1 -1
  25. package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-c69d1f8a.js} +1 -1
  26. package/dist/focus-visible-e8093c16-3082af2c.cjs +1 -0
  27. package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-a6aff071.js} +5 -3
  28. package/dist/{forward-icon_6.entry-8da1f65d.js → forward-icon_6.entry-55fce1ca.js} +9 -11
  29. package/dist/forward-icon_6.entry-59c7a975.cjs +3 -0
  30. package/dist/{globe-icon.entry-4720304b.js → globe-icon.entry-25145785.js} +1 -1
  31. package/dist/{globe-icon.entry-90a0b9c9.cjs → globe-icon.entry-904f180f.cjs} +1 -1
  32. package/dist/google-logo-icon_4.entry-1f7b9522.js +387 -0
  33. package/dist/google-logo-icon_4.entry-feb7a561.cjs +1 -0
  34. package/dist/index-5f0940e0.cjs +37 -0
  35. package/dist/index-fd39ea9d.js +4042 -0
  36. package/dist/index.d.ts +4 -2
  37. package/dist/index.es-be19d2df-9ba9a7a6.cjs +7 -0
  38. package/dist/{index-10914bc1-346f04fa.js → index.es-be19d2df-ff4f0a10.js} +945 -1041
  39. package/dist/{info-icon_2.entry-9307db18.js → info-icon_2.entry-0e2105da.js} +3 -3
  40. package/dist/{info-icon_2.entry-81e95048.cjs → info-icon_2.entry-808e6516.cjs} +1 -1
  41. package/dist/loading-icon.entry-17efa7ca.cjs +1 -0
  42. package/dist/loading-icon.entry-a3b845bf.js +15 -0
  43. package/dist/{mailbox-store-e721b17c-cf9a43dd.js → mailbox-store-76540d24-5f0d1dff.js} +121 -59
  44. package/dist/mailbox-store-76540d24-ad0e366a.cjs +1 -0
  45. package/dist/{nylas-additional-participants.entry-1653dec7.js → nylas-additional-participants.entry-4120ea2e.js} +13 -15
  46. package/dist/nylas-additional-participants.entry-7e2446cb.cjs +1 -0
  47. package/dist/nylas-booked-event-card_10.entry-44812e35.cjs +1 -0
  48. package/dist/{nylas-booked-event-card_10.entry-aa971e8a.js → nylas-booked-event-card_10.entry-5e87b199.js} +294 -273
  49. package/dist/nylas-custom-booking-flow.entry-cbff44c8.js +106 -0
  50. package/dist/nylas-custom-booking-flow.entry-da5e66bb.cjs +1 -0
  51. package/dist/{nylas-form-card.entry-c4e78f88.js → nylas-form-card.entry-1c608edd.js} +13 -15
  52. package/dist/nylas-form-card.entry-2e629e36.cjs +1 -0
  53. package/dist/nylas-if-state.entry-2c0d8724.js +94 -0
  54. package/dist/nylas-if-state.entry-61771f3d.cjs +1 -0
  55. package/dist/{nylas-list-folders.entry-995fa819.js → nylas-list-folders.entry-d6e085b0.js} +6 -8
  56. package/dist/nylas-list-folders.entry-fa8e8ce9.cjs +1 -0
  57. package/dist/{nylas-list-threads.entry-21466eb3.js → nylas-list-threads.entry-4dd2de0a.js} +5 -7
  58. package/dist/nylas-list-threads.entry-99fc0baa.cjs +1 -0
  59. package/dist/nylas-login.entry-0ec0813c.cjs +1 -0
  60. package/dist/nylas-login.entry-6730e226.js +73 -0
  61. package/dist/{nylas-mailbox-pagination.entry-02d40186.js → nylas-mailbox-pagination.entry-5310880c.js} +7 -9
  62. package/dist/nylas-mailbox-pagination.entry-e3e52f42.cjs +1 -0
  63. package/dist/{nylas-mailbox-toolbar-button.entry-dbad44b4.js → nylas-mailbox-toolbar-button.entry-028075db.js} +15 -17
  64. package/dist/nylas-mailbox-toolbar-button.entry-4c377337.cjs +1 -0
  65. package/dist/nylas-mailbox.entry-87304850.cjs +1 -0
  66. package/dist/nylas-mailbox.entry-ab92780c.js +134 -0
  67. package/dist/nylas-provider.entry-3fb60fe4.cjs +1 -0
  68. package/dist/{nylas-provider.entry-bbee8c99.js → nylas-provider.entry-678a9fe7.js} +48 -58
  69. package/dist/nylas-scheduler-editor.entry-a0de0ae6.js +2269 -0
  70. package/dist/nylas-scheduler-editor.entry-cf19391e.cjs +7 -0
  71. package/dist/nylas-scheduling.entry-d8bb2648.cjs +1 -0
  72. package/dist/nylas-scheduling.entry-e38c3870.js +248 -0
  73. package/dist/nylas-threads-refresh.entry-79c8a061.cjs +1 -0
  74. package/dist/{nylas-threads-refresh.entry-414d8740.js → nylas-threads-refresh.entry-fcb2175f.js} +2 -4
  75. package/dist/{nylas-threads-search.entry-a19dc90f.js → nylas-threads-search.entry-7565bdf8.js} +13 -15
  76. package/dist/nylas-threads-search.entry-f2d5d0fb.cjs +1 -0
  77. package/dist/{nylas-view-thread.entry-38149162.js → nylas-view-thread.entry-1772e0c4.js} +10 -12
  78. package/dist/nylas-view-thread.entry-6a2ccece.cjs +1 -0
  79. package/dist/{people-icon.entry-4b682757.cjs → people-icon.entry-3218a267.cjs} +1 -1
  80. package/dist/{people-icon.entry-5c244c8d.js → people-icon.entry-bc2c70cf.js} +5 -5
  81. package/dist/play-icon_2.entry-450a7fa6.cjs +1 -0
  82. package/dist/play-icon_2.entry-b4dc4e6d.js +25 -0
  83. package/dist/react.cjs +1 -1
  84. package/dist/react.js +88 -78
  85. package/dist/{refresh-icon.entry-59fff3d4.cjs → refresh-icon.entry-030dda82.cjs} +1 -1
  86. package/dist/{refresh-icon.entry-63456c9a.js → refresh-icon.entry-d30c7264.js} +5 -5
  87. package/dist/register-component-83e24412-0b25de7f.cjs +1 -0
  88. package/dist/{register-component-d056a880-f3003d6c.js → register-component-83e24412-35c484c4.js} +37 -33
  89. package/dist/scheduler-config-store-ec3b6190-6d8cef0f.cjs +1 -0
  90. package/dist/scheduler-config-store-ec3b6190-d5edbae5.js +23 -0
  91. package/dist/scheduler-store-8ca9003d-38cca5ba.js +321 -0
  92. package/dist/scheduler-store-8ca9003d-c2aa3522.cjs +1 -0
  93. package/dist/time-period-selector.entry-b366ba86.js +76 -0
  94. package/dist/time-period-selector.entry-b3d04e93.cjs +1 -0
  95. package/dist/{translate-icon.entry-1784c18e.cjs → translate-icon.entry-03ab2513.cjs} +1 -1
  96. package/dist/{translate-icon.entry-35999e70.js → translate-icon.entry-b3c21ae9.js} +5 -5
  97. package/dist/warning-icon.entry-602d459b.js +15 -0
  98. package/dist/{warning-icon.entry-3a702d1d.cjs → warning-icon.entry-65ecfdf0.cjs} +1 -1
  99. package/package.json +3 -3
  100. package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
  101. package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
  102. package/dist/add-circle-icon_18.entry-b66b6343.cjs +0 -1
  103. package/dist/add-circle-icon_18.entry-f86ae88d.js +0 -1527
  104. package/dist/auth-store-69ac49c7-5a0bbb90.cjs +0 -1
  105. package/dist/auth-store-69ac49c7-cbfda055.js +0 -66
  106. package/dist/bold-icon_3.entry-8f55a9e7.cjs +0 -1
  107. package/dist/chevron-icon_3.entry-830f52c2.js +0 -105
  108. package/dist/chevron-icon_3.entry-f7801467.cjs +0 -1
  109. package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
  110. package/dist/forward-icon_6.entry-c4b37cb1.cjs +0 -3
  111. package/dist/index-10914bc1-c8c3a2f3.cjs +0 -7
  112. package/dist/index-457dcf0b.cjs +0 -30
  113. package/dist/index-ce40ad47.js +0 -1570
  114. package/dist/loading-icon.entry-06d37ef0.cjs +0 -1
  115. package/dist/loading-icon.entry-dc518df4.js +0 -15
  116. package/dist/mailbox-store-e721b17c-4e97e07d.cjs +0 -1
  117. package/dist/nylas-additional-participants.entry-ff8bf378.cjs +0 -1
  118. package/dist/nylas-booked-event-card_10.entry-06bc3c51.cjs +0 -1
  119. package/dist/nylas-editor-tabs.entry-49b5a3ab.cjs +0 -1
  120. package/dist/nylas-editor-tabs.entry-9d0959bf.js +0 -181
  121. package/dist/nylas-form-card.entry-69d2095b.cjs +0 -1
  122. package/dist/nylas-if-state_3.entry-2eb3f385.js +0 -293
  123. package/dist/nylas-if-state_3.entry-5baf6d6f.cjs +0 -1
  124. package/dist/nylas-list-folders.entry-3b24d92d.cjs +0 -1
  125. package/dist/nylas-list-threads.entry-fda42ded.cjs +0 -1
  126. package/dist/nylas-mailbox-pagination.entry-9dcd4901.cjs +0 -1
  127. package/dist/nylas-mailbox-toolbar-button.entry-d1099fab.cjs +0 -1
  128. package/dist/nylas-provider.entry-78e2fa30.cjs +0 -1
  129. package/dist/nylas-scheduler-editor.entry-550d3c59.cjs +0 -1
  130. package/dist/nylas-scheduler-editor.entry-8f7ecf3b.js +0 -111
  131. package/dist/nylas-scheduling.entry-22b5ad07.js +0 -236
  132. package/dist/nylas-scheduling.entry-30a63738.cjs +0 -1
  133. package/dist/nylas-threads-refresh.entry-05258b36.cjs +0 -1
  134. package/dist/nylas-threads-search.entry-ff21fc65.cjs +0 -1
  135. package/dist/nylas-view-thread.entry-5da81e99.cjs +0 -1
  136. package/dist/play-icon_2.entry-ccdc6b9c.cjs +0 -1
  137. package/dist/play-icon_2.entry-f36d6d55.js +0 -25
  138. package/dist/register-component-d056a880-2be11c56.cjs +0 -1
  139. package/dist/scheduler-config-store-4d035001-0256b40c.cjs +0 -1
  140. package/dist/scheduler-config-store-4d035001-db9dc78a.js +0 -33
  141. package/dist/scheduler-store-0fbe642c-14466305.js +0 -293
  142. package/dist/scheduler-store-0fbe642c-410fdbf4.cjs +0 -1
  143. package/dist/utils-0cd66d04-89ab163d.js +0 -2111
  144. package/dist/utils-0cd66d04-94b9c3b6.cjs +0 -8
  145. package/dist/warning-icon.entry-73de08c3.js +0 -15
@@ -1,4 +1,4 @@
1
- import { r as e, h as o, g as n } from "./index-ce40ad47.js";
1
+ import { r as e, h as o, g as n } from "./index-fd39ea9d.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const a = ".sc-info-icon-h{display:flex}", i = a, s = class {
@@ -6,7 +6,7 @@ const a = ".sc-info-icon-h{display:flex}", i = a, s = class {
6
6
  e(this, t), this.width = "14", this.height = "14";
7
7
  }
8
8
  render() {
9
- return o("svg", { key: "f53c8bccce25f788d59548b73637616b8f680fd5", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, o("path", { key: "6bdf7329b72807db1901acd6552b8779d0c05d14", fill: "currentColor", d: "M6.5 5.5C6.77614 5.5 7 5.72386 7 6V9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9V6C6 5.72386 6.22386 5.5 6.5 5.5ZM6.50001 4.74907C6.91369 4.74907 7.24905 4.41371 7.24905 4.00003C7.24905 3.58635 6.91369 3.251 6.50001 3.251C6.08633 3.251 5.75098 3.58635 5.75098 4.00003C5.75098 4.41371 6.08633 4.74907 6.50001 4.74907ZM0.5 6.5C0.5 3.18629 3.18629 0.5 6.5 0.5C9.81371 0.5 12.5 3.18629 12.5 6.5C12.5 9.81371 9.81371 12.5 6.5 12.5C3.18629 12.5 0.5 9.81371 0.5 6.5ZM6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5Z" }));
9
+ return o("svg", { key: "6f050e856e1f4cbade2935875bd35a8df6fd5c1c", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, o("path", { key: "f96fc4aa622802adc7ba1dc0fe014bd67405f75a", fill: "currentColor", d: "M6.5 5.5C6.77614 5.5 7 5.72386 7 6V9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9V6C6 5.72386 6.22386 5.5 6.5 5.5ZM6.50001 4.74907C6.91369 4.74907 7.24905 4.41371 7.24905 4.00003C7.24905 3.58635 6.91369 3.251 6.50001 3.251C6.08633 3.251 5.75098 3.58635 5.75098 4.00003C5.75098 4.41371 6.08633 4.74907 6.50001 4.74907ZM0.5 6.5C0.5 3.18629 3.18629 0.5 6.5 0.5C9.81371 0.5 12.5 3.18629 12.5 6.5C12.5 9.81371 9.81371 12.5 6.5 12.5C3.18629 12.5 0.5 9.81371 0.5 6.5ZM6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5Z" }));
10
10
  }
11
11
  };
12
12
  s.style = i;
@@ -21,7 +21,7 @@ const r = '.tooltip-container{position:relative;display:flex;--nylas-primary:#25
21
21
  t.target.nextElementSibling.style.visibility = "hidden", t.target.nextElementSibling.style.opacity = "0";
22
22
  }
23
23
  render() {
24
- return o("div", { key: "46a9b12ea82e91115247b73a9a9533e5c0e147f6", class: "tooltip-container" }, o("span", { key: "dbc4f00337ac428733b2f16b853aab46df850a5a", class: "info-icon", tabindex: "0", onFocus: this.showTooltip.bind(this), onBlur: this.hideTooltip.bind(this) }, o("slot", { key: "599c7a8691a185424981d79c10af3d16b643c4ca", name: "tooltip-icon" }, "i")), o("span", { key: "0ddd2b67fbb31b934a1b114c439fa71297653a25", class: `tooltip-content ${this.position}` }, o("slot", { key: "35057ecec77ae5bf60ab64c661d442ec759b7c00", name: "tooltip-content" }, "This is a help text.")));
24
+ return o("div", { key: "e5f137458d3664942d02b31f221b3b5ae2bd9658", class: "tooltip-container" }, o("span", { key: "4838a8e46e43d2f490c81381c3759142868ce45c", class: "info-icon", tabindex: "0", onFocus: this.showTooltip.bind(this), onBlur: this.hideTooltip.bind(this) }, o("slot", { key: "a4864cffceabaf3bf353647733add76685ac1581", name: "tooltip-icon" }, "i")), o("span", { key: "15cbc68f4e0e07bddff0e7adbb76fd6ffce4b9a4", class: `tooltip-content ${this.position}` }, o("slot", { key: "836a48731f8a24bc4ecbbb097a514ca263dfc887", name: "tooltip-content" }, "This is a help text.")));
25
25
  }
26
26
  get el() {
27
27
  return n(this);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-457dcf0b.cjs");require("react");require("react-dom");const i=".sc-info-icon-h{display:flex}",a=i,o=class{constructor(e){t.registerInstance(this,e),this.width="14",this.height="14"}render(){return t.h("svg",{key:"f53c8bccce25f788d59548b73637616b8f680fd5",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"6bdf7329b72807db1901acd6552b8779d0c05d14",fill:"currentColor",d:"M6.5 5.5C6.77614 5.5 7 5.72386 7 6V9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9V6C6 5.72386 6.22386 5.5 6.5 5.5ZM6.50001 4.74907C6.91369 4.74907 7.24905 4.41371 7.24905 4.00003C7.24905 3.58635 6.91369 3.251 6.50001 3.251C6.08633 3.251 5.75098 3.58635 5.75098 4.00003C5.75098 4.41371 6.08633 4.74907 6.50001 4.74907ZM0.5 6.5C0.5 3.18629 3.18629 0.5 6.5 0.5C9.81371 0.5 12.5 3.18629 12.5 6.5C12.5 9.81371 9.81371 12.5 6.5 12.5C3.18629 12.5 0.5 9.81371 0.5 6.5ZM6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5Z"}))}};o.style=a;const s='.tooltip-container{position:relative;display:flex;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.tooltip-content{visibility:hidden;background-color:var(--nylas-base-800);color:var(--nylas-base-0);text-align:left;border-radius:6px;padding:5px 0;position:absolute;z-index:1;opacity:0;transition:opacity 0.3s;padding:0.5rem 1rem;max-width:200px;width:max-content}.tooltip-content.top{bottom:0;left:0;margin-bottom:1.25rem;transform:translateX(-50%)}.tooltip-content.right{top:50%;left:0%;margin-left:1.25rem;transform:translateY(-50%)}.tooltip-content.bottom{top:0;left:0;margin-top:1.25rem;transform:translateX(-50%)}.tooltip-content.left{top:50%;right:0%;margin-right:1.25rem;transform:translateY(-50%)}.tooltip-container:hover .tooltip-content,.tooltip-container:focus-within .tooltip-content{visibility:visible;opacity:1}.tooltip-content::after{content:"";position:absolute;top:-0.75rem;left:50%;transform:rotate(180deg);border-width:6px;border-style:solid;border-color:black transparent transparent transparent}.tooltip-content.top::after{top:100%;left:50%;transform:rotate(0deg)}.tooltip-content.bottom::after{top:-0.75rem;left:50%;transform:rotate(180deg)}.tooltip-content.left::after{top:47.5%;left:100%;transform:rotate(270deg)}.tooltip-content.right::after{top:47.5%;left:-0.75rem;transform:rotate(90deg)}',r=s,n=class{constructor(e){t.registerInstance(this,e),this.position="bottom"}showTooltip(e){e.target.nextElementSibling.style.visibility="visible",e.target.nextElementSibling.style.opacity="1"}hideTooltip(e){e.target.nextElementSibling.style.visibility="hidden",e.target.nextElementSibling.style.opacity="0"}render(){return t.h("div",{key:"46a9b12ea82e91115247b73a9a9533e5c0e147f6",class:"tooltip-container"},t.h("span",{key:"dbc4f00337ac428733b2f16b853aab46df850a5a",class:"info-icon",tabindex:"0",onFocus:this.showTooltip.bind(this),onBlur:this.hideTooltip.bind(this)},t.h("slot",{key:"599c7a8691a185424981d79c10af3d16b643c4ca",name:"tooltip-icon"},"i")),t.h("span",{key:"0ddd2b67fbb31b934a1b114c439fa71297653a25",class:`tooltip-content ${this.position}`},t.h("slot",{key:"35057ecec77ae5bf60ab64c661d442ec759b7c00",name:"tooltip-content"},"This is a help text.")))}get el(){return t.getElement(this)}};n.style=r;exports.info_icon=o;exports.tooltip_component=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-5f0940e0.cjs");require("react");require("react-dom");const i=".sc-info-icon-h{display:flex}",a=i,o=class{constructor(e){t.registerInstance(this,e),this.width="14",this.height="14"}render(){return t.h("svg",{key:"6f050e856e1f4cbade2935875bd35a8df6fd5c1c",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"f96fc4aa622802adc7ba1dc0fe014bd67405f75a",fill:"currentColor",d:"M6.5 5.5C6.77614 5.5 7 5.72386 7 6V9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9V6C6 5.72386 6.22386 5.5 6.5 5.5ZM6.50001 4.74907C6.91369 4.74907 7.24905 4.41371 7.24905 4.00003C7.24905 3.58635 6.91369 3.251 6.50001 3.251C6.08633 3.251 5.75098 3.58635 5.75098 4.00003C5.75098 4.41371 6.08633 4.74907 6.50001 4.74907ZM0.5 6.5C0.5 3.18629 3.18629 0.5 6.5 0.5C9.81371 0.5 12.5 3.18629 12.5 6.5C12.5 9.81371 9.81371 12.5 6.5 12.5C3.18629 12.5 0.5 9.81371 0.5 6.5ZM6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5Z"}))}};o.style=a;const s='.tooltip-container{position:relative;display:flex;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.tooltip-content{visibility:hidden;background-color:var(--nylas-base-800);color:var(--nylas-base-0);text-align:left;border-radius:6px;padding:5px 0;position:absolute;z-index:1;opacity:0;transition:opacity 0.3s;padding:0.5rem 1rem;max-width:200px;width:max-content}.tooltip-content.top{bottom:0;left:0;margin-bottom:1.25rem;transform:translateX(-50%)}.tooltip-content.right{top:50%;left:0%;margin-left:1.25rem;transform:translateY(-50%)}.tooltip-content.bottom{top:0;left:0;margin-top:1.25rem;transform:translateX(-50%)}.tooltip-content.left{top:50%;right:0%;margin-right:1.25rem;transform:translateY(-50%)}.tooltip-container:hover .tooltip-content,.tooltip-container:focus-within .tooltip-content{visibility:visible;opacity:1}.tooltip-content::after{content:"";position:absolute;top:-0.75rem;left:50%;transform:rotate(180deg);border-width:6px;border-style:solid;border-color:black transparent transparent transparent}.tooltip-content.top::after{top:100%;left:50%;transform:rotate(0deg)}.tooltip-content.bottom::after{top:-0.75rem;left:50%;transform:rotate(180deg)}.tooltip-content.left::after{top:47.5%;left:100%;transform:rotate(270deg)}.tooltip-content.right::after{top:47.5%;left:-0.75rem;transform:rotate(90deg)}',r=s,n=class{constructor(e){t.registerInstance(this,e),this.position="bottom"}showTooltip(e){e.target.nextElementSibling.style.visibility="visible",e.target.nextElementSibling.style.opacity="1"}hideTooltip(e){e.target.nextElementSibling.style.visibility="hidden",e.target.nextElementSibling.style.opacity="0"}render(){return t.h("div",{key:"e5f137458d3664942d02b31f221b3b5ae2bd9658",class:"tooltip-container"},t.h("span",{key:"4838a8e46e43d2f490c81381c3759142868ce45c",class:"info-icon",tabindex:"0",onFocus:this.showTooltip.bind(this),onBlur:this.hideTooltip.bind(this)},t.h("slot",{key:"a4864cffceabaf3bf353647733add76685ac1581",name:"tooltip-icon"},"i")),t.h("span",{key:"15cbc68f4e0e07bddff0e7adbb76fd6ffce4b9a4",class:`tooltip-content ${this.position}`},t.h("slot",{key:"836a48731f8a24bc4ecbbb097a514ca263dfc887",name:"tooltip-content"},"This is a help text.")))}get el(){return t.getElement(this)}};n.style=r;exports.info_icon=o;exports.tooltip_component=n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-5f0940e0.cjs");require("react");require("react-dom");const i=".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}",n=i,t=class{constructor(a){e.registerInstance(this,a),this.width="15",this.height="15"}render(){return e.h("div",{key:"20e081b4657135796ba486fe3b3ba4eb7e24df55",class:"wave"},e.h("div",{key:"ba8f7cd30e8dbdc4ca5fae882662563661948493",class:"dot"}),e.h("div",{key:"57edfc7797ee57ab9ae22fef20a5abcb84c3bc6b",class:"dot"}),e.h("div",{key:"c56c73301414ebaf6b66112dd3745d7e72f11508",class:"dot"}))}};t.style=n;exports.loading_icon=t;
@@ -0,0 +1,15 @@
1
+ import { r as t, h as e } from "./index-fd39ea9d.js";
2
+ import "react";
3
+ import "react-dom";
4
+ const i = ".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}", n = i, o = class {
5
+ constructor(a) {
6
+ t(this, a), this.width = "15", this.height = "15";
7
+ }
8
+ render() {
9
+ return e("div", { key: "20e081b4657135796ba486fe3b3ba4eb7e24df55", class: "wave" }, e("div", { key: "ba8f7cd30e8dbdc4ca5fae882662563661948493", class: "dot" }), e("div", { key: "57edfc7797ee57ab9ae22fef20a5abcb84c3bc6b", class: "dot" }), e("div", { key: "c56c73301414ebaf6b66112dd3745d7e72f11508", class: "dot" }));
10
+ }
11
+ };
12
+ o.style = n;
13
+ export {
14
+ o as loading_icon
15
+ };
@@ -1,11 +1,57 @@
1
- import { c as m, X as l, Z as u } from "./index-10914bc1-346f04fa.js";
2
- import { d as n } from "./utils-0cd66d04-89ab163d.js";
1
+ import { d as o, e as f } from "./index-fd39ea9d.js";
2
+ import { X as u, Z as d } from "./index.es-be19d2df-ff4f0a10.js";
3
3
  class S {
4
+ constructor(t, e) {
5
+ this.nylasAuth = t, this.nylasAuthStore = e;
6
+ }
7
+ async validateSession() {
8
+ const t = await this.isAccessTokenValid();
9
+ if (!t)
10
+ this.logout();
11
+ else {
12
+ let e = await this.nylasAuth.getTokenInfo();
13
+ if (e) {
14
+ const a = Math.floor(Date.now() / 1e3);
15
+ if (e.expires_in && e.expires_in - a < 3e5 && (o("[NylasAuthConnectorMixin] Refreshing access token"), e = await this.nylasAuth.refreshAccessToken(), !e)) {
16
+ o("[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out."), this.logout();
17
+ return;
18
+ }
19
+ this.nylasAuthStore.state.tokenInfo = e;
20
+ }
21
+ }
22
+ this.nylasAuthStore.state.isAuthenticated = t;
23
+ }
24
+ async isAuthenticated() {
25
+ return this.nylasAuth.isAuthenticated();
26
+ }
27
+ async getTokenInfo() {
28
+ return this.nylasAuth.getTokenInfo();
29
+ }
30
+ async isAccessTokenValid() {
31
+ return this.nylasAuth.isAccessTokenValid();
32
+ }
33
+ async logout() {
34
+ await this.nylasAuth.logout();
35
+ }
36
+ async getHostedAuthRedirectURL(t, e, s) {
37
+ return this.nylasAuth.getHostedAuthRedirectURL(t, e, s);
38
+ }
39
+ async manageHostedAuthCodeExchange(t) {
40
+ const s = new URL(t).searchParams.get("code");
41
+ if (s) {
42
+ const a = await this.nylasAuth.exchangeAuthCodeForTokenInfo(s);
43
+ if (a)
44
+ return this.nylasAuthStore.state.tokenInfo = a, this.nylasAuthStore.state.isAuthenticated = !0, a;
45
+ }
46
+ return null;
47
+ }
48
+ }
49
+ class A {
4
50
  constructor(t, e, s) {
5
51
  this.nylasAuth = t, this.nylasAuthStore = e, this.nylasMailboxStore = s;
6
52
  }
7
53
  async getMessages() {
8
- var o;
54
+ var n;
9
55
  if (!this.nylasAuthStore.state.isAuthenticated)
10
56
  throw new Error("Not authenticated");
11
57
  if (!this.nylasAuth.hasScopeByType("email", ["read-only", "modify"]))
@@ -13,12 +59,12 @@ class S {
13
59
  this.nylasMailboxStore.state.state = "loading";
14
60
  const t = this.nylasMailboxStore.state.messgeQueryParams, e = new URLSearchParams();
15
61
  for (const i in t) {
16
- const h = (o = t[i]) == null ? void 0 : o.toString();
17
- h && e.append(i, h);
62
+ const l = (n = t[i]) == null ? void 0 : n.toString();
63
+ l && e.append(i, l);
18
64
  }
19
65
  const s = `/v3/grants/me/messages?${e.toString()}`, a = await this.nylasAuth.nylasAPIRequest(s);
20
- if (l(a))
21
- throw new u(a.error);
66
+ if (u(a))
67
+ throw new d(a.error);
22
68
  const r = a.data;
23
69
  return this.nylasMailboxStore.state.messages = r, this.nylasMailboxStore.state.state = "ready", r;
24
70
  }
@@ -28,8 +74,8 @@ class S {
28
74
  if (!this.nylasAuth.hasScopeByType("email", ["read-only", "modify"]))
29
75
  throw new Error("Missing message:read-only scope");
30
76
  const e = await this.nylasAuth.nylasAPIRequest(`/v3/grants/me/messages?thread_id=${t}&fields=include_headers`);
31
- if (l(e))
32
- throw new u(e.error);
77
+ if (u(e))
78
+ throw new d(e.error);
33
79
  const s = e.data;
34
80
  return this.nylasMailboxStore.state.messages = s, s;
35
81
  }
@@ -55,8 +101,8 @@ class S {
55
101
  body: t
56
102
  }
57
103
  }, !0, this.nylasAuth.config.elementsApiUri);
58
- if (l(e))
59
- throw new u(e.error);
104
+ if (u(e))
105
+ throw new d(e.error);
60
106
  return e.data.summary;
61
107
  }
62
108
  async textToSpeech(t, e) {
@@ -71,12 +117,12 @@ class S {
71
117
  });
72
118
  }
73
119
  }
74
- class x {
120
+ class T {
75
121
  constructor(t, e, s, a) {
76
122
  this.nylasAuth = t, this.nylasAuthStore = e, this.nylasMailboxStore = s, this.router = a;
77
123
  }
78
124
  async getThreads(t, e = "overwrite", s = !0) {
79
- var c;
125
+ var y;
80
126
  if (!this.nylasAuthStore.state.isAuthenticated)
81
127
  throw new Error("Not authenticated");
82
128
  if (!this.nylasAuth.hasScopeByType("email", ["read-only", "modify"]))
@@ -84,42 +130,42 @@ class x {
84
130
  s && (this.nylasMailboxStore.state.state = "loading");
85
131
  const a = t || this.nylasMailboxStore.state.threadsQueryParams, r = new URLSearchParams();
86
132
  for (const g in a) {
87
- const y = (c = a[g]) == null ? void 0 : c.toString();
88
- typeof y < "u" && y !== null && r.append(g, y);
133
+ const c = (y = a[g]) == null ? void 0 : y.toString();
134
+ typeof c < "u" && c !== null && r.append(g, c);
89
135
  }
90
136
  a.search_query_native ? this.router.navigate(`/?query=${a.search_query_native}`, !0) : this.nylasMailboxStore.state.threadsQueryParams.search_query_native && !a.search_query_native && this.router.navigate("/", !0), a.page_token || (this.nylasMailboxStore.state.previousThreadPageTokens = []), this.nylasMailboxStore.state.threadsQueryParams = a;
91
- const o = `/v3/grants/me/threads?${r.toString()}`, i = await this.nylasAuth.nylasAPIRequest(o);
92
- if (l(i))
93
- throw new u(i.error);
94
- const h = i.data;
137
+ const n = `/v3/grants/me/threads?${r.toString()}`, i = await this.nylasAuth.nylasAPIRequest(n);
138
+ if (u(i))
139
+ throw new d(i.error);
140
+ const l = i.data;
95
141
  switch (e) {
96
142
  case "prepend":
97
- this.nylasMailboxStore.state.threads = [...h, ...this.nylasMailboxStore.state.threads];
143
+ this.nylasMailboxStore.state.threads = [...l, ...this.nylasMailboxStore.state.threads];
98
144
  break;
99
145
  case "append":
100
- this.nylasMailboxStore.state.threads = [...this.nylasMailboxStore.state.threads, ...h];
146
+ this.nylasMailboxStore.state.threads = [...this.nylasMailboxStore.state.threads, ...l];
101
147
  break;
102
148
  case "overwrite":
103
149
  default:
104
- this.nylasMailboxStore.state.threads = h;
150
+ this.nylasMailboxStore.state.threads = l;
105
151
  break;
106
152
  }
107
- return i.next_cursor ? this.nylasMailboxStore.state.nextThreadPageToken = i.next_cursor : this.nylasMailboxStore.state.nextThreadPageToken = null, s && (this.nylasMailboxStore.state.state = "ready"), h;
153
+ return i.next_cursor ? this.nylasMailboxStore.state.nextThreadPageToken = i.next_cursor : this.nylasMailboxStore.state.nextThreadPageToken = null, s && (this.nylasMailboxStore.state.state = "ready"), l;
108
154
  }
109
155
  async getThread(t) {
110
156
  if (!this.nylasAuthStore.state.isAuthenticated)
111
157
  throw new Error("Not authenticated");
112
158
  if (!this.nylasAuth.hasScopeByType("email", ["read-only", "modify"]))
113
159
  throw new Error("Missing thread:read-only scope");
114
- const e = this.nylasMailboxStore.state.threads.find((o) => o.id === t);
160
+ const e = this.nylasMailboxStore.state.threads.find((n) => n.id === t);
115
161
  if (e)
116
162
  return e;
117
163
  this.nylasMailboxStore.state.state = "loading";
118
164
  const s = `/v3/grants/me/threads/${t}`, a = await this.nylasAuth.nylasAPIRequest(s);
119
- if (l(a))
120
- throw new u(a.error);
165
+ if (u(a))
166
+ throw new d(a.error);
121
167
  const r = a.data;
122
- return this.nylasMailboxStore.state.threads = this.nylasMailboxStore.state.threads.map((o) => o.id === r.id ? r : o), this.nylasMailboxStore.state.state = "ready", r;
168
+ return this.nylasMailboxStore.state.threads = this.nylasMailboxStore.state.threads.map((n) => n.id === r.id ? r : n), this.nylasMailboxStore.state.state = "ready", r;
123
169
  }
124
170
  async nextThreadPage(t = "overwrite", e = !0) {
125
171
  if (!this.nylasMailboxStore.state.nextThreadPageToken)
@@ -154,7 +200,7 @@ class x {
154
200
  }
155
201
  async selectThread(t) {
156
202
  this.router.navigate(`/thread/${t.id}`, !0), this.nylasMailboxStore.state.selectedThread = t, t.unread && this.markThreadAsRead(t).catch((e) => {
157
- n("Error marking thread as read", e);
203
+ o("Error marking thread as read", e);
158
204
  });
159
205
  }
160
206
  async markThreadAsRead(t) {
@@ -166,13 +212,13 @@ class x {
166
212
  if (!this.nylasAuth.hasScopeByType("email", "modify"))
167
213
  throw new Error("Missing thread:modify scope");
168
214
  const s = `/v3/grants/me/threads/${t.id}`, a = await this.nylasAuth.nylasAPIRequest(s, "PUT", e);
169
- if (l(a))
170
- throw new u(a.error);
215
+ if (u(a))
216
+ throw new d(a.error);
171
217
  const r = a.data;
172
- return this.nylasMailboxStore.state.threads = this.nylasMailboxStore.state.threads.map((o) => o.id === r.id ? r : o), this.nylasMailboxStore.state.selectedThread = r, r;
218
+ return this.nylasMailboxStore.state.threads = this.nylasMailboxStore.state.threads.map((n) => n.id === r.id ? r : n), this.nylasMailboxStore.state.selectedThread = r, r;
173
219
  }
174
220
  }
175
- class T {
221
+ class x {
176
222
  constructor(t, e, s) {
177
223
  this.nylasAuth = t, this.nylasAuthStore = e, this.nylasMailboxStore = s;
178
224
  }
@@ -183,8 +229,8 @@ class T {
183
229
  throw new Error("Missing thread:read-only scope");
184
230
  this.nylasMailboxStore.state.state = "loading";
185
231
  const t = "/v3/grants/me/folders", e = await this.nylasAuth.nylasAPIRequest(t);
186
- if (l(e))
187
- throw new u(e.error);
232
+ if (u(e))
233
+ throw new d(e.error);
188
234
  const s = e.data;
189
235
  return this.nylasMailboxStore.state.folders = s, this.nylasMailboxStore.state.state = "ready", s;
190
236
  }
@@ -195,76 +241,76 @@ class T {
195
241
  };
196
242
  }
197
243
  }
198
- class w extends Event {
244
+ class m extends Event {
199
245
  constructor(t, e) {
200
246
  super(t, e), this.oldURL = e.oldURL, this.newURL = e.newURL;
201
247
  }
202
248
  }
203
249
  class P {
204
250
  constructor() {
205
- this.routeChangeListeners = [], n("HashRouter constructor");
251
+ this.routeChangeListeners = [], o("HashRouter constructor");
206
252
  }
207
253
  destroy() {
208
- n("HashRouter destroy"), window.removeEventListener("hashchange", this.onRouteChange.bind(this));
254
+ o("HashRouter destroy"), window.removeEventListener("hashchange", this.onRouteChange.bind(this));
209
255
  }
210
256
  init() {
211
- if (n("HashRouter init"), window.addEventListener("hashchange", this.onRouteChange.bind(this)), typeof HashChangeEvent < "u") {
257
+ if (o("HashRouter init"), window.addEventListener("hashchange", this.onRouteChange.bind(this)), typeof HashChangeEvent < "u") {
212
258
  const t = new HashChangeEvent("hashchange", { oldURL: "", newURL: window.location.href });
213
259
  this.onRouteChange(t);
214
260
  } else {
215
- const t = new w("hashchange", { oldURL: "", newURL: window.location.href });
261
+ const t = new m("hashchange", { oldURL: "", newURL: window.location.href });
216
262
  this.onRouteChange(t);
217
263
  }
218
264
  }
219
265
  addRouteChangeListener(t, e) {
220
- n("HashRouter addRouteChangeListener"), this.routeChangeListeners.push([t, e]);
266
+ o("HashRouter addRouteChangeListener"), this.routeChangeListeners.push([t, e]);
221
267
  }
222
268
  navigate(t, e) {
223
- if (n("HashRouter navigate"), e)
269
+ if (o("HashRouter navigate"), e)
224
270
  return window.history.pushState(null, "", `#${t}`);
225
271
  window.location.hash = t;
226
272
  }
227
273
  setRoute(t) {
228
- n("HashRouter setRoute"), window.location.hash = t;
274
+ o("HashRouter setRoute"), window.location.hash = t;
229
275
  }
230
276
  matchRoute(t, e) {
231
277
  const s = t.split("/"), a = e.split("/");
232
- if (n(`HashRouter matchRoute route=${t} path=${e}`, { routeParts: s, pathParts: a }), s[1] === "" && a[0] === "")
278
+ if (o(`HashRouter matchRoute route=${t} path=${e}`, { routeParts: s, pathParts: a }), s[1] === "" && a[0] === "")
233
279
  return !0;
234
280
  if (s.length !== a.length)
235
281
  return !1;
236
282
  for (let r = 0; r < s.length; r++) {
237
- const o = s[r], i = a[r];
238
- if (!o.startsWith(":") && o !== i)
283
+ const n = s[r], i = a[r];
284
+ if (!n.startsWith(":") && n !== i)
239
285
  return !1;
240
286
  }
241
287
  return !0;
242
288
  }
243
289
  getRouteParams(t) {
244
- n("HashRouter getRouteParams");
290
+ o("HashRouter getRouteParams");
245
291
  const e = {}, s = t.split("/"), a = window.location.hash.split("/");
246
- return s.forEach((r, o) => {
292
+ return s.forEach((r, n) => {
247
293
  if (r.startsWith(":")) {
248
294
  const i = r.substring(1);
249
- e[i] = a[o];
295
+ e[i] = a[n];
250
296
  }
251
297
  }), e;
252
298
  }
253
299
  getRouteWithParams(t, e) {
254
- n("HashRouter getRouteWithParams");
300
+ o("HashRouter getRouteWithParams");
255
301
  let s = t;
256
302
  return Object.keys(e).forEach((a) => {
257
303
  s = s.replace(`:${a}`, e[a]);
258
304
  }), s;
259
305
  }
260
306
  getRoute() {
261
- return n("HashRouter getRoute"), window.location.hash;
307
+ return o("HashRouter getRoute"), window.location.hash;
262
308
  }
263
309
  onRouteChange(t) {
264
310
  this.routeChangeListeners.forEach(async ([e, s]) => {
265
311
  const a = t.newURL.indexOf("#") === -1 ? "" : t.newURL.substring(t.newURL.indexOf("#") + 1);
266
- if (n(`HashRouter onRouteChange route=${e} path=${a}`, { event: t }), !this.matchRoute(e, a)) {
267
- n(`HashRouter onRouteChange route=${e} path=${a} does not match`);
312
+ if (o(`HashRouter onRouteChange route=${e} path=${a}`, { event: t }), !this.matchRoute(e, a)) {
313
+ o(`HashRouter onRouteChange route=${e} path=${a} does not match`);
268
314
  return;
269
315
  }
270
316
  const r = this.getRouteParams(e);
@@ -272,10 +318,24 @@ class P {
272
318
  });
273
319
  }
274
320
  getBasePath() {
275
- return n("HashRouter getBasePath"), "";
321
+ return o("HashRouter getBasePath"), "";
276
322
  }
277
323
  }
278
- function b(d = {}) {
324
+ function b(h = {}) {
325
+ const t = {
326
+ isAuthenticated: !1,
327
+ tokenInfo: null,
328
+ state: "ready",
329
+ ...h
330
+ }, e = f(t);
331
+ return e.reset = () => {
332
+ for (const s in t) {
333
+ const a = t[s];
334
+ e.set(s, a);
335
+ }
336
+ }, e;
337
+ }
338
+ function M(h = {}) {
279
339
  const t = {
280
340
  state: "ready",
281
341
  messages: [],
@@ -294,8 +354,8 @@ function b(d = {}) {
294
354
  messgeQueryParams: {
295
355
  fields: "include_headers"
296
356
  },
297
- ...d
298
- }, e = m({ ...t });
357
+ ...h
358
+ }, e = f({ ...t });
299
359
  return e.onChange("nextThreadPageToken", (s) => {
300
360
  e.set("hasNextThreadPage", s !== null);
301
361
  }), e.onChange("previousThreadPageTokens", (s) => {
@@ -312,7 +372,9 @@ function b(d = {}) {
312
372
  export {
313
373
  b as C,
314
374
  P as H,
315
- x as N,
316
- S as a,
317
- T as b
375
+ S as N,
376
+ M as a,
377
+ T as b,
378
+ A as c,
379
+ x as d
318
380
  };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("./index-5f0940e0.cjs"),i=require("./index.es-be19d2df-9ba9a7a6.cjs");class g{constructor(t,e){this.nylasAuth=t,this.nylasAuthStore=e}async validateSession(){const t=await this.isAccessTokenValid();if(!t)this.logout();else{let e=await this.nylasAuth.getTokenInfo();if(e){const a=Math.floor(Date.now()/1e3);if(e.expires_in&&e.expires_in-a<3e5&&(n.debug("[NylasAuthConnectorMixin] Refreshing access token"),e=await this.nylasAuth.refreshAccessToken(),!e)){n.debug("[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out."),this.logout();return}this.nylasAuthStore.state.tokenInfo=e}}this.nylasAuthStore.state.isAuthenticated=t}async isAuthenticated(){return this.nylasAuth.isAuthenticated()}async getTokenInfo(){return this.nylasAuth.getTokenInfo()}async isAccessTokenValid(){return this.nylasAuth.isAccessTokenValid()}async logout(){await this.nylasAuth.logout()}async getHostedAuthRedirectURL(t,e,s){return this.nylasAuth.getHostedAuthRedirectURL(t,e,s)}async manageHostedAuthCodeExchange(t){const s=new URL(t).searchParams.get("code");if(s){const a=await this.nylasAuth.exchangeAuthCodeForTokenInfo(s);if(a)return this.nylasAuthStore.state.tokenInfo=a,this.nylasAuthStore.state.isAuthenticated=!0,a}return null}}class f{constructor(t,e,s){this.nylasAuth=t,this.nylasAuthStore=e,this.nylasMailboxStore=s}async getMessages(){var o;if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing message:read-only scope");this.nylasMailboxStore.state.state="loading";const t=this.nylasMailboxStore.state.messgeQueryParams,e=new URLSearchParams;for(const h in t){const u=(o=t[h])==null?void 0:o.toString();u&&e.append(h,u)}const s=`/v3/grants/me/messages?${e.toString()}`,a=await this.nylasAuth.nylasAPIRequest(s);if(i.Xr(a))throw new i.Zr(a.error);const r=a.data;return this.nylasMailboxStore.state.messages=r,this.nylasMailboxStore.state.state="ready",r}async getThreadMessages(t){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing message:read-only scope");const e=await this.nylasAuth.nylasAPIRequest(`/v3/grants/me/messages?thread_id=${t}&fields=include_headers`);if(i.Xr(e))throw new i.Zr(e.error);const s=e.data;return this.nylasMailboxStore.state.messages=s,s}downloadMessageAttachments(t){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing message:read-only scope");const e=[],s=t.attachments||[];for(const a of s){const r=this.nylasAuth.nylasDownloadFileRequest(`/v3/grants/me/attachments/${a.id}?message_id=${t.id}`);e.push(r)}return e}async summarizeText(t){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing message:read-only scope");const e=await this.nylasAuth.nylasAPIRequest("/v3/grants/me/mailbox/summarize","POST",{message:{body:t}},!0,this.nylasAuth.config.elementsApiUri);if(i.Xr(e))throw new i.Zr(e.error);return e.data.summary}async textToSpeech(t,e){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing message:read-only scope");return this.nylasAuth.nylasAPIRequest("/v3/grants/me/mailbox/tts","POST",{text:t},!1,this.nylasAuth.config.elementsApiUri,{...e?{signal:e==null?void 0:e.signal}:{}})}}class w{constructor(t,e,s,a){this.nylasAuth=t,this.nylasAuthStore=e,this.nylasMailboxStore=s,this.router=a}async getThreads(t,e="overwrite",s=!0){var c;if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing thread:read-only scope");s&&(this.nylasMailboxStore.state.state="loading");const a=t||this.nylasMailboxStore.state.threadsQueryParams,r=new URLSearchParams;for(const y in a){const d=(c=a[y])==null?void 0:c.toString();typeof d<"u"&&d!==null&&r.append(y,d)}a.search_query_native?this.router.navigate(`/?query=${a.search_query_native}`,!0):this.nylasMailboxStore.state.threadsQueryParams.search_query_native&&!a.search_query_native&&this.router.navigate("/",!0),a.page_token||(this.nylasMailboxStore.state.previousThreadPageTokens=[]),this.nylasMailboxStore.state.threadsQueryParams=a;const o=`/v3/grants/me/threads?${r.toString()}`,h=await this.nylasAuth.nylasAPIRequest(o);if(i.Xr(h))throw new i.Zr(h.error);const u=h.data;switch(e){case"prepend":this.nylasMailboxStore.state.threads=[...u,...this.nylasMailboxStore.state.threads];break;case"append":this.nylasMailboxStore.state.threads=[...this.nylasMailboxStore.state.threads,...u];break;case"overwrite":default:this.nylasMailboxStore.state.threads=u;break}return h.next_cursor?this.nylasMailboxStore.state.nextThreadPageToken=h.next_cursor:this.nylasMailboxStore.state.nextThreadPageToken=null,s&&(this.nylasMailboxStore.state.state="ready"),u}async getThread(t){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing thread:read-only scope");const e=this.nylasMailboxStore.state.threads.find(o=>o.id===t);if(e)return e;this.nylasMailboxStore.state.state="loading";const s=`/v3/grants/me/threads/${t}`,a=await this.nylasAuth.nylasAPIRequest(s);if(i.Xr(a))throw new i.Zr(a.error);const r=a.data;return this.nylasMailboxStore.state.threads=this.nylasMailboxStore.state.threads.map(o=>o.id===r.id?r:o),this.nylasMailboxStore.state.state="ready",r}async nextThreadPage(t="overwrite",e=!0){if(!this.nylasMailboxStore.state.nextThreadPageToken)throw new Error("No next page token");this.nylasMailboxStore.state.previousThreadPageTokens=Array.from(new Set([...this.nylasMailboxStore.state.previousThreadPageTokens,this.nylasMailboxStore.state.threadsQueryParams.page_token??null]));const s=this.nylasMailboxStore.state.nextThreadPageToken;return this.getThreads({...this.nylasMailboxStore.state.threadsQueryParams,page_token:s},t,e)}async previousThreadPage(t="overwrite",e=!0){if(!this.nylasMailboxStore.state.previousThreadPageTokens.length)throw new Error("No previous page token");const s=[...this.nylasMailboxStore.state.previousThreadPageTokens],a=s.pop();return this.nylasMailboxStore.state.previousThreadPageTokens=s,this.getThreads({...this.nylasMailboxStore.state.threadsQueryParams,page_token:a??void 0},t,e)}updateThreadQueryParams(t){this.nylasMailboxStore.state.threadsQueryParams={...this.nylasMailboxStore.state.threadsQueryParams,...t}}back(){this.router.navigate("/",!0),this.nylasMailboxStore.state.selectedThread=null}unSelectThread(){this.nylasMailboxStore.state.selectedThread=null}async selectThread(t){this.router.navigate(`/thread/${t.id}`,!0),this.nylasMailboxStore.state.selectedThread=t,t.unread&&this.markThreadAsRead(t).catch(e=>{n.debug("Error marking thread as read",e)})}async markThreadAsRead(t){return this.updateThread(t,{unread:!1})}async updateThread(t,e){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email","modify"))throw new Error("Missing thread:modify scope");const s=`/v3/grants/me/threads/${t.id}`,a=await this.nylasAuth.nylasAPIRequest(s,"PUT",e);if(i.Xr(a))throw new i.Zr(a.error);const r=a.data;return this.nylasMailboxStore.state.threads=this.nylasMailboxStore.state.threads.map(o=>o.id===r.id?r:o),this.nylasMailboxStore.state.selectedThread=r,r}}class m{constructor(t,e,s){this.nylasAuth=t,this.nylasAuthStore=e,this.nylasMailboxStore=s}async getFolders(){if(!this.nylasAuthStore.state.isAuthenticated)throw new Error("Not authenticated");if(!this.nylasAuth.hasScopeByType("email",["read-only","modify"]))throw new Error("Missing thread:read-only scope");this.nylasMailboxStore.state.state="loading";const t="/v3/grants/me/folders",e=await this.nylasAuth.nylasAPIRequest(t);if(i.Xr(e))throw new i.Zr(e.error);const s=e.data;return this.nylasMailboxStore.state.folders=s,this.nylasMailboxStore.state.state="ready",s}async selectFolder(t){this.nylasMailboxStore.state.threadsQueryParams={in:t.id,...this.nylasMailboxStore.state.threadsQueryParams||{}}}}class p extends Event{constructor(t,e){super(t,e),this.oldURL=e.oldURL,this.newURL=e.newURL}}class S{constructor(){this.routeChangeListeners=[],n.debug("HashRouter constructor")}destroy(){n.debug("HashRouter destroy"),window.removeEventListener("hashchange",this.onRouteChange.bind(this))}init(){if(n.debug("HashRouter init"),window.addEventListener("hashchange",this.onRouteChange.bind(this)),typeof HashChangeEvent<"u"){const t=new HashChangeEvent("hashchange",{oldURL:"",newURL:window.location.href});this.onRouteChange(t)}else{const t=new p("hashchange",{oldURL:"",newURL:window.location.href});this.onRouteChange(t)}}addRouteChangeListener(t,e){n.debug("HashRouter addRouteChangeListener"),this.routeChangeListeners.push([t,e])}navigate(t,e){if(n.debug("HashRouter navigate"),e)return window.history.pushState(null,"",`#${t}`);window.location.hash=t}setRoute(t){n.debug("HashRouter setRoute"),window.location.hash=t}matchRoute(t,e){const s=t.split("/"),a=e.split("/");if(n.debug(`HashRouter matchRoute route=${t} path=${e}`,{routeParts:s,pathParts:a}),s[1]===""&&a[0]==="")return!0;if(s.length!==a.length)return!1;for(let r=0;r<s.length;r++){const o=s[r],h=a[r];if(!o.startsWith(":")&&o!==h)return!1}return!0}getRouteParams(t){n.debug("HashRouter getRouteParams");const e={},s=t.split("/"),a=window.location.hash.split("/");return s.forEach((r,o)=>{if(r.startsWith(":")){const h=r.substring(1);e[h]=a[o]}}),e}getRouteWithParams(t,e){n.debug("HashRouter getRouteWithParams");let s=t;return Object.keys(e).forEach(a=>{s=s.replace(`:${a}`,e[a])}),s}getRoute(){return n.debug("HashRouter getRoute"),window.location.hash}onRouteChange(t){this.routeChangeListeners.forEach(async([e,s])=>{const a=t.newURL.indexOf("#")===-1?"":t.newURL.substring(t.newURL.indexOf("#")+1);if(n.debug(`HashRouter onRouteChange route=${e} path=${a}`,{event:t}),!this.matchRoute(e,a)){n.debug(`HashRouter onRouteChange route=${e} path=${a} does not match`);return}const r=this.getRouteParams(e);await s(e,a,r)})}getBasePath(){return n.debug("HashRouter getBasePath"),""}}function A(l={}){const t={isAuthenticated:!1,tokenInfo:null,state:"ready",...l},e=n.createStore(t);return e.reset=()=>{for(const s in t){const a=t[s];e.set(s,a)}},e}function x(l={}){const t={state:"ready",messages:[],threads:[],folders:[],selectedThread:null,nextThreadPageToken:null,previousThreadPageTokens:[],searchQuery:"",hasNextThreadPage:!1,hasPreviousThreadPage:!1,selectedFolder:"inbox",threadsQueryParams:{in:"inbox"},messgeQueryParams:{fields:"include_headers"},...l},e=n.createStore({...t});return e.onChange("nextThreadPageToken",s=>{e.set("hasNextThreadPage",s!==null)}),e.onChange("previousThreadPageTokens",s=>{e.set("hasPreviousThreadPage",s.length>0)}),e.onChange("threadsQueryParams",s=>{e.set("selectedFolder",s.in||"inbox"),e.set("searchQuery",s.search_query_native||"")}),e.reset=()=>{for(const s in t){const a=t[s];e.set(s,a)}},e}exports.CreateNylasAuthStore=A;exports.CreateNylasMailboxStore=x;exports.HashRouter=S;exports.NylasAuthConnector=g;exports.NylasFoldersConnector=m;exports.NylasMessagesConnector=f;exports.NylasThreadsConnector=w;
@@ -1,19 +1,17 @@
1
- import { r as y, h as i, H as b, g as f } from "./index-ce40ad47.js";
2
- import { R as _ } from "./register-component-d056a880-f3003d6c.js";
3
- import { d as n } from "./utils-0cd66d04-89ab163d.js";
1
+ import { r as y, d as n, h as i, H as f, g as _ } from "./index-fd39ea9d.js";
2
+ import { R as u } from "./register-component-83e24412-35c484c4.js";
4
3
  import "react";
5
4
  import "react-dom";
6
- import "./_commonjsHelpers-57e89916-af061c86.js";
7
- const u = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);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-nylas-base-600-aaa, #3e4784);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__block{display:flex;justify-content:space-between;gap:0.5rem}.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-nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--Nylas-base-Nylas-base-300, #b3b8d8)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{background:var(--Nylas-base-Nylas-base-50, #f8f9fc)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--Nylas-base-Nylas-base-300, #b3b8d8)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__input_wrapper_invalid{border:1px solid var(--nylas-error, #cc4841);color:var(--Nylas-base-Nylas-base-400, #717bbc)}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}', m = u;
5
+ const b = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{background:var(--nylas-base-50)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--nylas-base-300)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}', m = b;
8
6
  var h = function(a, t, e, r) {
9
7
  var l = arguments.length, s = l < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, e) : r, p;
10
8
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
11
9
  s = Reflect.decorate(a, t, e, r);
12
10
  else
13
- for (var d = a.length - 1; d >= 0; d--)
14
- (p = a[d]) && (s = (l < 3 ? p(s) : l > 3 ? p(t, e, s) : p(t, e)) || s);
11
+ for (var o = a.length - 1; o >= 0; o--)
12
+ (p = a[o]) && (s = (l < 3 ? p(s) : l > 3 ? p(t, e, s) : p(t, e)) || s);
15
13
  return l > 3 && s && Object.defineProperty(t, e, s), s;
16
- }, o = function(a, t) {
14
+ }, d = function(a, t) {
17
15
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
18
16
  return Reflect.metadata(a, t);
19
17
  };
@@ -51,15 +49,15 @@ const c = class {
51
49
  this.participants[t].is_valid = r, this.internals.setFormValue(JSON.stringify(this.participants), "participants");
52
50
  }
53
51
  render() {
54
- return i(b, { key: "f7e9e11d09521eaaca5a7c0f617bb89d2d63b1c4" }, i("nylas-form-card", { key: "58e42cf68f3e5dc8d76a5c29be28332506c4ac02" }, i("h3", { key: "df04fd60229abedc20d18611012b3b4d119ec17a", slot: "header-title", class: "nylas-additional-participants__title" }, "Additional participants"), i("p", { key: "794d5d650ee886a3d985f87b3ea46527dcae8e6a", slot: "header-subtitle", class: "nylas-additional-participants__subtitle" }, "Add anyone else who would be joining for this event."), i("div", { key: "acf2f231f0c18f8389c7618e7b301d94aa819c2e", slot: "content", class: "nylas-additional-participants__content" }, i("div", { key: "ed87166cfc0f33f515c780412a71a6b7dccbd61b" }, this.participants.map((a, t) => i("div", { class: "nylas-additional-participants__input_group" }, i("label", null, a.is_organizer ? "Organizer" : `Participant ${t}`), i("div", { class: `nylas-additional-participants__input_wrapper ${a.is_organizer && "nylas-additional-participants__input_wrapper_organizer"} ${a.is_valid === !1 && "nylas-additional-participants__input_wrapper_invalid"}` }, i("div", { class: "nylas-additional-participants__input" }, i("input", { type: "text", value: a.email, onInput: (e) => {
52
+ return i(f, { key: "2cee2dd98939f98fdfc950f609fce3f6045ced9f" }, i("nylas-form-card", { key: "e587c19e99fa1b40c9d876123fd50cde51e8882c" }, i("h3", { key: "6c4a90291f5918e98d62e03b599619ff4f345391", slot: "header-title", class: "nylas-additional-participants__title", part: "nap__title" }, "Additional participants"), i("p", { key: "ad4fac5ca4cdb1430f889c723215d9a1538a266f", slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nap__subtitle" }, "Add anyone else who would be joining for this event."), i("div", { key: "80b29a9b1275363dac86274be18cc52210e59de7", slot: "content", class: "nylas-additional-participants__content" }, i("div", { key: "5adf8a7d2be8c780dbc5859b8b634efc114536c2" }, this.participants.map((a, t) => i("div", { class: "nylas-additional-participants__input_group", part: "nap__input_group" }, i("label", null, a.is_organizer ? "Organizer" : `Participant ${t}`), i("div", { part: "nap__input_wrapper", class: `nylas-additional-participants__input_wrapper ${a.is_organizer && "nylas-additional-participants__input_wrapper_organizer"} ${a.is_valid === !1 && "nylas-additional-participants__input_wrapper_invalid"}` }, i("div", { class: "nylas-additional-participants__input", part: "nap__input" }, i("input", { type: "text", value: a.email, onInput: (e) => {
55
53
  this.onParticipantChange(e, t);
56
- }, readOnly: a.is_organizer, onBlur: () => this.validate(a.email, t) })), !a.is_organizer && i("button", { onClick: () => this.removeParticipant(a.email) }, i("close-icon", null)))))))));
54
+ }, readOnly: a.is_organizer, onBlur: () => this.validate(a.email, t) })), !a.is_organizer && i("button", { onClick: () => this.removeParticipant(a.email), part: "nap__remove-participant" }, i("close-icon", null)))))))));
57
55
  }
58
56
  static get formAssociated() {
59
57
  return !0;
60
58
  }
61
59
  get host() {
62
- return f(this);
60
+ return _(this);
63
61
  }
64
62
  static get watchers() {
65
63
  return {
@@ -68,14 +66,14 @@ const c = class {
68
66
  }
69
67
  };
70
68
  h([
71
- _({
69
+ u({
72
70
  name: "nylas-additional-participants",
73
71
  eventToProps: {},
74
72
  fireRegisterEvent: !0
75
73
  }),
76
- o("design:type", Function),
77
- o("design:paramtypes", []),
78
- o("design:returntype", void 0)
74
+ d("design:type", Function),
75
+ d("design:paramtypes", []),
76
+ d("design:returntype", void 0)
79
77
  ], c.prototype, "render", null);
80
78
  c.style = m;
81
79
  export {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-5f0940e0.cjs"),c=require("./register-component-83e24412-0b25de7f.cjs");require("react");require("react-dom");const y=':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{background:var(--nylas-base-50)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--nylas-base-300)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}',u=y;var f=function(a,i,n,s){var r=arguments.length,e=r<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,n):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(a,i,n,s);else for(var p=a.length-1;p>=0;p--)(l=a[p])&&(e=(r<3?l(e):r>3?l(i,n,e):l(i,n))||e);return r>3&&e&&Object.defineProperty(i,n,e),e},d=function(a,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,i)};const o=class{constructor(a){t.registerInstance(this,a),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals),this.name="participants",this.eventParticipants=void 0,this.participants=this.eventParticipants??[],this.participantsValid=!0}elementNameChangedHandler(a){t.debug("nylas-additional-participants","elementNameChangedHandler",a),this.host.setAttribute("name",a)}connectedCallback(){t.debug("nylas-additional-participants","connectedCallback")}componentWillLoad(){t.debug("nylas-additional-participants","componentWillLoad"),this.host.setAttribute("name",this.name)}componentDidLoad(){t.debug("nylas-additional-participants","componentDidLoad"),this.internals.setFormValue(JSON.stringify(this.participants),"participants")}disconnectedCallback(){t.debug("nylas-additional-participants","disconnectedCallback")}onParticipantChange(a,i){t.debug("nylas-additional-participants","onParticipantChange"),this.participants[i].email=a.target.value,this.internals.setFormValue(JSON.stringify(this.participants),"participants")}addParticipant(){t.debug("nylas-additional-participants","addParticipant"),this.participants=[...this.participants,{email:"",is_organizer:!1,availability:{calendar_ids:["primary"]}}],this.internals.setFormValue(JSON.stringify(this.participants),"participants")}removeParticipant(a){t.debug("nylas-additional-participants","addParticipant"),this.participants=this.participants.filter(i=>i.email!==a),this.internals.setFormValue(JSON.stringify(this.participants),"participants")}validate(a,i){t.debug("nylas-additional-participants","validate");const s=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(a).toLowerCase());this.participants[i].is_valid=s,this.internals.setFormValue(JSON.stringify(this.participants),"participants")}render(){return t.h(t.Host,{key:"2cee2dd98939f98fdfc950f609fce3f6045ced9f"},t.h("nylas-form-card",{key:"e587c19e99fa1b40c9d876123fd50cde51e8882c"},t.h("h3",{key:"6c4a90291f5918e98d62e03b599619ff4f345391",slot:"header-title",class:"nylas-additional-participants__title",part:"nap__title"},"Additional participants"),t.h("p",{key:"ad4fac5ca4cdb1430f889c723215d9a1538a266f",slot:"header-subtitle",class:"nylas-additional-participants__subtitle",part:"nap__subtitle"},"Add anyone else who would be joining for this event."),t.h("div",{key:"80b29a9b1275363dac86274be18cc52210e59de7",slot:"content",class:"nylas-additional-participants__content"},t.h("div",{key:"5adf8a7d2be8c780dbc5859b8b634efc114536c2"},this.participants.map((a,i)=>t.h("div",{class:"nylas-additional-participants__input_group",part:"nap__input_group"},t.h("label",null,a.is_organizer?"Organizer":`Participant ${i}`),t.h("div",{part:"nap__input_wrapper",class:`nylas-additional-participants__input_wrapper ${a.is_organizer&&"nylas-additional-participants__input_wrapper_organizer"} ${a.is_valid===!1&&"nylas-additional-participants__input_wrapper_invalid"}`},t.h("div",{class:"nylas-additional-participants__input",part:"nap__input"},t.h("input",{type:"text",value:a.email,onInput:n=>{this.onParticipantChange(n,i)},readOnly:a.is_organizer,onBlur:()=>this.validate(a.email,i)})),!a.is_organizer&&t.h("button",{onClick:()=>this.removeParticipant(a.email),part:"nap__remove-participant"},t.h("close-icon",null)))))))))}static get formAssociated(){return!0}get host(){return t.getElement(this)}static get watchers(){return{name:["elementNameChangedHandler"]}}};f([c.RegisterComponent({name:"nylas-additional-participants",eventToProps:{},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],o.prototype,"render",null);o.style=u;exports.nylas_additional_participants=o;