@nylas/react 1.3.1 → 1.3.2

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 (125) hide show
  1. package/dist/{add-circle-icon.entry-d8358e3f.js → add-circle-icon.entry-0ea05c5b.js} +1 -1
  2. package/dist/{add-circle-icon.entry-606d3096.cjs → add-circle-icon.entry-10f2c319.cjs} +1 -1
  3. package/dist/{archive-icon.entry-e8ce8c7d.cjs → archive-icon.entry-7eeea6f4.cjs} +1 -1
  4. package/dist/{archive-icon.entry-8c6d31f2.js → archive-icon.entry-a0af58f2.js} +1 -1
  5. package/dist/{arrow-icon.entry-d950ddce.js → arrow-icon.entry-7fd7c18e.js} +1 -1
  6. package/dist/{arrow-icon.entry-13d23d01.cjs → arrow-icon.entry-954f2ba8.cjs} +1 -1
  7. package/dist/{bold-icon.entry-5382fea2.js → bold-icon.entry-690ecac8.js} +1 -1
  8. package/dist/{bold-icon.entry-12072568.cjs → bold-icon.entry-e970c498.cjs} +1 -1
  9. package/dist/{button-component_2.entry-4aa63891.js → button-component_2.entry-b57d03fc.js} +1 -1
  10. package/dist/{button-component_2.entry-d34ed360.cjs → button-component_2.entry-b7d39903.cjs} +1 -1
  11. package/dist/{calendar-agenda-fill-icon_54.entry-50c9ed7b.js → calendar-agenda-fill-icon_53.entry-7792b45c.js} +432 -442
  12. package/dist/calendar-agenda-fill-icon_53.entry-89e5ac45.cjs +9 -0
  13. package/dist/{calendar-cancel-icon.entry-64ea7038.js → calendar-cancel-icon.entry-5757c056.js} +1 -1
  14. package/dist/{calendar-cancel-icon.entry-b13aa245.cjs → calendar-cancel-icon.entry-8cd02237.cjs} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-9cbe60a8.cjs → calendar-check-icon_2.entry-4f59d206.cjs} +1 -1
  16. package/dist/{calendar-check-icon_2.entry-935310fc.js → calendar-check-icon_2.entry-6864b9d5.js} +1 -1
  17. package/dist/{calendar-icon.entry-0c560a35.cjs → calendar-icon.entry-0b1edb49.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-2448eea2.js → calendar-icon.entry-3798880d.js} +1 -1
  19. package/dist/checkbox-component_3.entry-10293364.cjs +1 -0
  20. package/dist/checkbox-component_3.entry-3d9fa7b5.js +140 -0
  21. package/dist/{chevron-icon_3.entry-1f72ef71.js → chevron-icon_3.entry-43e83594.js} +11 -11
  22. package/dist/{chevron-icon_3.entry-da1751d2.cjs → chevron-icon_3.entry-a5175d87.cjs} +1 -1
  23. package/dist/{clock-icon_4.entry-4502c9f0.js → clock-icon_4.entry-219733d8.js} +1 -1
  24. package/dist/{clock-icon_4.entry-b87aaaa9.cjs → clock-icon_4.entry-76751b46.cjs} +1 -1
  25. package/dist/{close-icon.entry-e96749ed.js → close-icon.entry-286fc5ca.js} +1 -1
  26. package/dist/{close-icon.entry-92e93293.cjs → close-icon.entry-cecd3cdd.cjs} +1 -1
  27. package/dist/{constants-24eca8c9-922dc05c.js → constants-54af2051-767e8462.js} +12 -0
  28. package/dist/{constants-24eca8c9-d0d9f3ec.cjs → constants-54af2051-a3596673.cjs} +1 -1
  29. package/dist/{copy-icon.entry-7c958d7c.js → copy-icon.entry-121dd297.js} +1 -1
  30. package/dist/{copy-icon.entry-19bb7d2f.cjs → copy-icon.entry-d4835d9a.cjs} +1 -1
  31. package/dist/{delete-icon.entry-41c7d463.cjs → delete-icon.entry-14249f70.cjs} +1 -1
  32. package/dist/{delete-icon.entry-59c9ca04.js → delete-icon.entry-497ac8a2.js} +1 -1
  33. package/dist/{document-refresh-icon.entry-afc75ddb.cjs → document-refresh-icon.entry-c0eacb66.cjs} +1 -1
  34. package/dist/{document-refresh-icon.entry-c32cda4f.js → document-refresh-icon.entry-f265bb1b.js} +1 -1
  35. package/dist/elements/index.d.ts +1 -0
  36. package/dist/{feedbackSync-b4015b72-0785986b.js → feedbackSync-e5cb0245-d84015c5.js} +1 -1
  37. package/dist/{feedbackSync-b4015b72-d343d411.cjs → feedbackSync-e5cb0245-ea7ddac9.cjs} +1 -1
  38. package/dist/{folder-icon.entry-5dcf707b.js → folder-icon.entry-d22b3e80.js} +1 -1
  39. package/dist/{folder-icon.entry-61ccaddd.cjs → folder-icon.entry-e4806f0a.cjs} +1 -1
  40. package/dist/{forward-icon.entry-3d598cb4.cjs → forward-icon.entry-42b98c73.cjs} +1 -1
  41. package/dist/{forward-icon.entry-5a156d37.js → forward-icon.entry-b6711af7.js} +1 -1
  42. package/dist/{globe-icon.entry-a88502ce.cjs → globe-icon.entry-18605371.cjs} +1 -1
  43. package/dist/{globe-icon.entry-99e8bebf.js → globe-icon.entry-4c5d6be0.js} +1 -1
  44. package/dist/google-logo-icon_4.entry-007f2813.cjs +1 -0
  45. package/dist/{google-logo-icon_4.entry-531021bd.js → google-logo-icon_4.entry-c3bae7b7.js} +176 -168
  46. package/dist/{inbox-icon.entry-6eadce9b.cjs → inbox-icon.entry-02c59267.cjs} +1 -1
  47. package/dist/{inbox-icon.entry-b2a2f48e.js → inbox-icon.entry-ae4383af.js} +1 -1
  48. package/dist/{index-13a43508.js → index-ad112f6a.js} +166 -161
  49. package/dist/{index-7dbf0ae7.cjs → index-bbbc79ad.cjs} +17 -17
  50. package/dist/{index.es-aa323594-17c2a3f6.js → index.es-e9d66a9b-62be34ce.js} +214 -211
  51. package/dist/{index.es-aa323594-84331fa3.cjs → index.es-e9d66a9b-a29322e0.cjs} +5 -5
  52. package/dist/{info-icon_2.entry-c6e650c4.js → info-icon_2.entry-3f143408.js} +5 -5
  53. package/dist/{info-icon_2.entry-f53d81e5.cjs → info-icon_2.entry-d10f1df5.cjs} +1 -1
  54. package/dist/{input-color-picker.entry-16fa8456.cjs → input-color-picker.entry-45caaa1d.cjs} +1 -1
  55. package/dist/{input-color-picker.entry-cd398537.js → input-color-picker.entry-8ce41f49.js} +1 -1
  56. package/dist/{input-component.entry-74b63249.cjs → input-component.entry-37b106dc.cjs} +1 -1
  57. package/dist/{input-component.entry-b471f023.js → input-component.entry-6db98fb0.js} +1 -1
  58. package/dist/{input-dropdown.entry-32b4b8be.cjs → input-dropdown.entry-1a2cdf40.cjs} +1 -1
  59. package/dist/{input-dropdown.entry-14e1f6cb.js → input-dropdown.entry-ec3d04ad.js} +1 -1
  60. package/dist/{italic-icon.entry-8a1a7568.js → italic-icon.entry-36d1e644.js} +1 -1
  61. package/dist/{italic-icon.entry-c9ae0186.cjs → italic-icon.entry-b5e4eec9.cjs} +1 -1
  62. package/dist/{multi-select-dropdown.entry-58b860a0.cjs → multi-select-dropdown.entry-00e43a89.cjs} +1 -1
  63. package/dist/{multi-select-dropdown.entry-bc4901aa.js → multi-select-dropdown.entry-6f22740f.js} +1 -1
  64. package/dist/nylas-booked-event-card_12.entry-4f115674.cjs +1 -0
  65. package/dist/{nylas-booked-event-card_12.entry-fbdb2f3d.js → nylas-booked-event-card_12.entry-cb6b2ce6.js} +270 -265
  66. package/dist/{nylas-form-card.entry-aa1d5aca.js → nylas-form-card.entry-07e46491.js} +11 -11
  67. package/dist/{nylas-form-card.entry-7e9a0cf1.cjs → nylas-form-card.entry-e2749723.cjs} +1 -1
  68. package/dist/{nylas-if-state.entry-96914d61.cjs → nylas-if-state.entry-88e01248.cjs} +1 -1
  69. package/dist/{nylas-if-state.entry-5e30f6b3.js → nylas-if-state.entry-e34c5cbb.js} +2 -2
  70. package/dist/{nylas-login.entry-e52648da.js → nylas-login.entry-a30bbd87.js} +3 -3
  71. package/dist/{nylas-login.entry-e26689b0.cjs → nylas-login.entry-ab50ca6a.cjs} +1 -1
  72. package/dist/{nylas-provider.entry-ac669351.js → nylas-provider.entry-070f8090.js} +5 -5
  73. package/dist/{nylas-provider.entry-9d43f4f0.cjs → nylas-provider.entry-7f4a1520.cjs} +1 -1
  74. package/dist/{nylas-scheduler-editor.entry-9655ce2e.js → nylas-scheduler-editor.entry-23e68865.js} +3 -3
  75. package/dist/{nylas-scheduler-editor.entry-0f1370d9.cjs → nylas-scheduler-editor.entry-287ca230.cjs} +2 -2
  76. package/dist/{nylas-scheduling.entry-14d4cd69.js → nylas-scheduling.entry-19fca55a.js} +8 -8
  77. package/dist/{nylas-scheduling.entry-ab10f8a4.cjs → nylas-scheduling.entry-c882ee9a.cjs} +1 -1
  78. package/dist/nylas-time-window-picker_2.entry-3d24eec4.js +336 -0
  79. package/dist/nylas-time-window-picker_2.entry-9a216230.cjs +1 -0
  80. package/dist/{person-icon.entry-40b5a8c5.js → person-icon.entry-a6d86572.js} +1 -1
  81. package/dist/{person-icon.entry-a45918af.cjs → person-icon.entry-b26a199b.cjs} +1 -1
  82. package/dist/{play-icon.entry-c5757946.cjs → play-icon.entry-5fc66fe6.cjs} +1 -1
  83. package/dist/{play-icon.entry-b2315f8c.js → play-icon.entry-87939760.js} +1 -1
  84. package/dist/react.cjs +1 -1
  85. package/dist/react.js +73 -72
  86. package/dist/{refresh-icon.entry-b9afd192.cjs → refresh-icon.entry-3a8ae0f6.cjs} +1 -1
  87. package/dist/{refresh-icon.entry-37d038f8.js → refresh-icon.entry-820111be.js} +1 -1
  88. package/dist/{register-component-555477e7-42247763.js → register-component-5d7bcc15-35e4a5a0.js} +12 -12
  89. package/dist/{register-component-555477e7-ecafba1c.cjs → register-component-5d7bcc15-d9900fbc.cjs} +1 -1
  90. package/dist/{reply-all-icon.entry-89fd0e10.js → reply-all-icon.entry-5fbf1103.js} +1 -1
  91. package/dist/{reply-all-icon.entry-07a6783a.cjs → reply-all-icon.entry-864494e2.cjs} +1 -1
  92. package/dist/{reply-icon.entry-a53a6fc4.js → reply-icon.entry-7c136d06.js} +1 -1
  93. package/dist/{reply-icon.entry-8cddb112.cjs → reply-icon.entry-93084ffd.cjs} +1 -1
  94. package/dist/{scheduler-config-store-ed4a8dfd-733c6442.cjs → scheduler-config-store-ed4a8dfd-b2986359.cjs} +1 -1
  95. package/dist/{scheduler-config-store-ed4a8dfd-656579e3.js → scheduler-config-store-ed4a8dfd-f7f53255.js} +1 -1
  96. package/dist/{scheduler-store-c37aa5ca-0484b074.cjs → scheduler-store-20151a77-2dfd28c2.cjs} +1 -1
  97. package/dist/{scheduler-store-c37aa5ca-c9752707.js → scheduler-store-20151a77-4f7ffb6f.js} +2 -2
  98. package/dist/{sent-icon.entry-b740a32d.cjs → sent-icon.entry-18afc1f9.cjs} +1 -1
  99. package/dist/{sent-icon.entry-6ac749b3.js → sent-icon.entry-60f1b814.js} +1 -1
  100. package/dist/{spam-icon.entry-78cec025.cjs → spam-icon.entry-9d41427e.cjs} +1 -1
  101. package/dist/{spam-icon.entry-872ff1e4.js → spam-icon.entry-b580b108.js} +1 -1
  102. package/dist/{star-icon.entry-57246dc1.js → star-icon.entry-7cbe5a81.js} +1 -1
  103. package/dist/{star-icon.entry-ab9ad7df.cjs → star-icon.entry-8792026f.cjs} +1 -1
  104. package/dist/{stop-icon.entry-f79dce49.cjs → stop-icon.entry-5b605364.cjs} +1 -1
  105. package/dist/{stop-icon.entry-5054fa33.js → stop-icon.entry-ae629874.js} +1 -1
  106. package/dist/{textarea-component.entry-2967dd82.cjs → textarea-component.entry-2dae13db.cjs} +1 -1
  107. package/dist/{textarea-component.entry-15c9a676.js → textarea-component.entry-fa87a032.js} +2 -2
  108. package/dist/{time-period-selector.entry-9226fd08.js → time-period-selector.entry-0de79682.js} +2 -2
  109. package/dist/{time-period-selector.entry-a53c94c2.cjs → time-period-selector.entry-b1f5523b.cjs} +1 -1
  110. package/dist/{translate-icon.entry-52939fa4.js → translate-icon.entry-07e9c2cf.js} +1 -1
  111. package/dist/{translate-icon.entry-f4dcc479.cjs → translate-icon.entry-22ef3602.cjs} +1 -1
  112. package/dist/{trash-fill-icon.entry-b9ab3cfc.js → trash-fill-icon.entry-81ee0fdf.js} +1 -1
  113. package/dist/{trash-fill-icon.entry-7f4ddaf5.cjs → trash-fill-icon.entry-d332cf5d.cjs} +1 -1
  114. package/dist/{underline-icon.entry-c8142970.js → underline-icon.entry-dce1c48b.js} +1 -1
  115. package/dist/{underline-icon.entry-e9959c5c.cjs → underline-icon.entry-e381e3d2.cjs} +1 -1
  116. package/dist/{warning-icon.entry-00426457.js → warning-icon.entry-76d03910.js} +1 -1
  117. package/dist/{warning-icon.entry-98c0d003.cjs → warning-icon.entry-b55e52d0.cjs} +1 -1
  118. package/package.json +3 -3
  119. package/dist/calendar-agenda-fill-icon_54.entry-33d08f1a.cjs +0 -9
  120. package/dist/checkbox-component_2.entry-1e3afb3a.cjs +0 -1
  121. package/dist/checkbox-component_2.entry-ec5e75fb.js +0 -79
  122. package/dist/google-logo-icon_4.entry-9a7790d2.cjs +0 -1
  123. package/dist/nylas-booked-event-card_12.entry-f64eecaa.cjs +0 -1
  124. package/dist/nylas-time-window-picker.entry-a2f71121.js +0 -316
  125. package/dist/nylas-time-window-picker.entry-dfbd975e.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-7dbf0ae7.cjs"),D=require("./index.es-aa323594-84331fa3.cjs"),B=require("./scheduler-store-c37aa5ca-0484b074.cjs"),N=require("./constants-24eca8c9-d0d9f3ec.cjs"),E=require("./feedbackSync-b4015b72-d343d411.cjs");require("react");require("react-dom");class W{constructor({schedulerAPIURL:t,nylasSchedulerStore:i,sessionId:a,configId:o,slug:r,clientId:d}){if(!t)throw new Error("schedulerAPIURL is required");if(!i)throw new Error("nylasSchedulerStore is required");if(!a&&!o&&!(r||d))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");t==="/"&&(t=new URL(window.location.href).origin),this.configId=o,this.sessionId=a,this.schedulerAPIURL=t,this.nylasSchedulerStore=i,this.slug=r,this.clientId=d}init(){e.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new B.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const I=(n,t)=>{const i=n.isLoading,a=n.showNotification,o=n.nylasBranding;return e.h(e.Fragment,null,a&&e.h("nylas-notification",null),i&&e.h("div",{class:"loading"},e.h("div",{class:"left"},e.h("div",{class:"skeleton"})),e.h("div",{class:"right"},e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}))),!i&&t,e.h("div",{class:"footer"},o&&e.h("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",e.h("span",{class:"sr-only"},"Nylas"),e.h("nylas-logo",{"aria-hidden":!0}))))},M=(n,t)=>e.h("div",{class:"message-banner"},t),$=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}',G=$,j={title:e.instance.t("genericErrorTitle"),type:D.nr.Error,category:B.ErrorCategory.Component},H=class{constructor(n){e.registerInstance(this,n),this.init=e.createEvent(this,"init",7),this.schedulerWillLoad=e.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=e.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=e.createEvent(this,"nylasSchedulerError",7),this.configSettingsLoaded=e.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=e.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=e.createEvent(this,"bookedEventInfo",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.enableUserFeedback=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||`${e.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language,this.showFeedbackModal=!1,this.bookingInfoConfirmed=null}connectedCallback(){e.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var o,r;e.debug("[nylas-scheduler] Component will load"),this.enableUserFeedback&&!E.isInitialized()&&E.init({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:"1.3.1",integrations:d=>[...d.filter(s=>!1),E.feedbackSyncIntegration({colorScheme:"system",autoInject:!1})],autoSessionTracking:!1,beforeSend:()=>null});const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:B.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,...this.defaultSchedulerState})},this.baseProvider=new D.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let t;if(this.rescheduleBookingRef){const[d,s,c]=e.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=d,this.stores.scheduler.set("rescheduleBookingId",s),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.cancelBookingRef){const[d,s,c]=e.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=d,this.stores.scheduler.set("cancelBookingId",s),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.organizerConfirmationBookingRef){const[d,s,c]=e.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=d,this.stores.scheduler.set("organizerConfirmationBookingId",s),this.stores.scheduler.set("organizerConfirmationSalt",c),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s,salt:c})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(t,this.nylasSchedulerConnector),t.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const i=(o=this.baseProvider)==null?void 0:o.getStore("scheduler");this.nylasSchedulerConnector=new W({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:i});const a=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(a,this.nylasSchedulerConnector),a.defaultPrevented)||((r=this.baseProvider)==null||r.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var c,b,m,g,h,f,p,C;(c=this.baseProvider)==null||c.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const t=await((b=this.nylasSchedulerConnector)==null?void 0:b.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t==null?void 0:t.error)},host:this.host});return}else{"data"in t&&((m=t.data)!=null&&m.appearance)&&console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");const u=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(u,this.nylasSchedulerConnector),u.defaultPrevented))return}const i=(g=this.baseProvider)==null?void 0:g.getStore("scheduler"),a=(f=(h=i==null?void 0:i.get("configSettings"))==null?void 0:h.scheduler)==null?void 0:f.available_days_in_future,o=i==null?void 0:i.get("selectedTimeslot");if(o&&(o!=null&&o.start_time)){if(!this.isTimeslotValid(o))return;if(i!=null&&i.get("showBookingForm")){i==null||i.set("selectedDate",o.start_time);return}}const r=i==null?void 0:i.get("selectedDate"),d=i==null?void 0:i.get("availability");let s;if(!(d&&d.length>0)){if(r){const{startTime:u,endTime:v,endTimeForAvailableDaysInFuture:k}=this.validateAvailableDaysInFuture(r,a||30);r.getTime()<k*1e3&&(s=await((C=this.nylasSchedulerConnector)==null?void 0:C.scheduler.getAvailability(u,v)))}else{const u=new Date,{startTime:v,endTime:k,endTimeForAvailableDaysInFuture:T}=this.validateAvailableDaysInFuture(u,a||30);u.getTime()<T*1e3&&(s=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.getAvailability(v,k)))}if((!s||"error"in s)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(s==null?void 0:s.error)},host:this.host}),!r){let u=new Date;const v=i==null?void 0:i.get("availability").find(k=>new Date(k.start_time)>new Date);v&&(u=v.start_time),i==null||i.set("selectedDate",u)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var t;(t=this.stores)==null||t.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("rescheduleBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}cancelBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("cancelBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}organizerConfirmationBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("organizerConfirmationBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}localizationChanged(n){n&&Object.keys(n).forEach(t=>{t in N.LANGUAGE_CODE&&(e.instance.addResourceBundle(t,"translation",n[t],!1,!0),this.language=this.language)})}themeConfigChanged(n){var t,i;(i=(t=this.baseProvider)==null?void 0:t.getStore("scheduler"))==null||i.set("themeConfig",n),this.applyThemeConfig(n)}languageChanged(n){const t=n.detail;this.language=t,e.instance.changeLanguage(t)}async registerComponentHandler(n){var t;(t=this.baseProvider)==null||t.registerComponent(n.detail)}async unregisterComponentHandler(n){var t;(t=this.baseProvider)==null||t.unregisterComponent(n.detail)}async monthChangedHandler(n){var d,s,c,b,m,g,h;const t=n.detail,i=(b=(c=(s=(d=this.nylasSchedulerConnector)==null?void 0:d.schedulerStore)==null?void 0:s.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:b.available_days_in_future,{startTime:a,endTime:o,endTimeForAvailableDaysInFuture:r}=this.validateAvailableDaysInFuture(t,i||30);if(!n.defaultPrevented&&a<r&&t.getTime()<r*1e3){const f=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.getAvailability(a,o));(!f||"error"in f)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(f==null?void 0:f.error)},host:this.host});const p=(g=this.stores)==null?void 0:g.scheduler.get("selectableDates");p&&p.length>0&&((h=this.stores)==null||h.scheduler.set("selectedDate",p[0]))}}mapToBookingData(n){var d,s,c;const t=(d=this.stores)==null?void 0:d.scheduler.get("selectedTimeslot"),i=(s=this.stores)==null?void 0:s.scheduler.get("selectedLanguage"),a=(c=this.stores)==null?void 0:c.scheduler.get("selectedTimezone"),o=t!=null&&t.start_time?new Date(t==null?void 0:t.start_time).getTime()/1e3:"",r=t!=null&&t.end_time?new Date(t==null?void 0:t.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:{...n.primaryParticipant},additional_fields:{...n.additionalFields},start_time:o,end_time:r,email_language:i,timezone:a}}async bookButtonClickedHandler(n){var c,b,m,g;if(n.defaultPrevented)return;const t=n.detail,i=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const o=(b=(c=this.nylasSchedulerConnector)==null?void 0:c.schedulerStore)==null?void 0:b.get("rescheduleBookingId");if(o){const h=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.rescheduleBooking(o,t));(!h||"error"in h)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(h==null?void 0:h.error)},host:this.host});const f=h==null?void 0:h.data,p=this.bookedEventInfo.emit({...h,data:{...f,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(p,this.nylasSchedulerConnector);return}const r=await((g=this.nylasSchedulerConnector)==null?void 0:g.scheduler.bookTimeslot(t));(!r||"error"in r)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r==null?void 0:r.error)},host:this.host});const d=r==null?void 0:r.data,s=this.bookedEventInfo.emit({...r,data:{...d,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(s,this.nylasSchedulerConnector)}dateSelectedHandler(n){const t=n.detail;this.selectedDateLabel=t?t.toLocaleDateString(void 0,{dateStyle:"full"}):`${e.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=!1}feedbackSubmittedHandler(n){const i={eventId:E.captureMessage("Scheduling Page User Feedback"),message:n.detail.feedback};E.captureFeedback(i,{includeReplay:!0,captureContext:{tags:{"nylas-web-element":"nylas-schduling","nylas-web-element-version":"1.3.1"},extra:{configId:this.configurationId,slug:this.slug}}}),this.showFeedbackModal=!1}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||j.title,category:(n==null?void 0:n.category)||j.category,type:D.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=e.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=e.instance.t("sessionIdRequiredErrorMessage")+" "+e.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:e.instance.t("schedulingComponentErrorTitle"),category:B.ErrorCategory.Component,type:D.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:e.instance.t("invalidTimeslotErrorTitle"),category:B.ErrorCategory.Component,type:D.nr.Error,description:e.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,t){const i=new Date,a=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,o=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,r=Math.floor(e.addDaysToCurrentDate(i,t).getTime()/1e3),d=Math.min(r,o);return{startTime:a<i.getTime()/1e3?Math.floor(i.getTime()/1e3):a,endTime:d,endTimeForAvailableDaysInFuture:r}}applyThemeConfig(n){if(n)for(const[t,i]of Object.entries(n))this.host.style.setProperty(`${t}`,i)}onFeedbackClick(n){n.preventDefault(),this.showFeedbackModal=!0}redirectToCustomUrl(n){window.location.assign(n)}render(){var p,C,u,v,k,T,S,z,O,R;const n=this.mode==="app",t=(p=this.baseProvider)==null?void 0:p.getStore("scheduler"),i=t==null?void 0:t.get("eventInfo"),a=t==null?void 0:t.get("showBookingForm"),o=t==null?void 0:t.get("cancelledEventInfo"),r=t==null?void 0:t.get("cancelBookingId"),d=t==null?void 0:t.get("selectedTimeslot"),s=t==null?void 0:t.get("rescheduleBookingId"),c=t==null?void 0:t.get("organizerConfirmationBookingId"),b=t==null?void 0:t.get("rejectBookingId"),m=t==null?void 0:t.get("confirmedEventInfo"),g=(t==null?void 0:t.get("nylasBranding"))||this.nylasBranding,h=t==null?void 0:t.get("selectedDate"),f=(u=(C=t==null?void 0:t.get("configSettings"))==null?void 0:C.scheduler)==null?void 0:u.confirmation_redirect_url;if(this.selectedDateLabel=h&&this.language?e.capitalizeFirstLetter(h.toLocaleDateString(N.LANGUAGE_CODE_MAP[this.language],{dateStyle:"full"})):`${e.instance.t("noDateSelected")}`,n&&(r||b)&&!o)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e.h("nylas-cancel-booking-form",{selectedTimeslot:d,cancelBookingId:r,rejectBookingId:b,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&c)return e.h(e.Host,null,e.h(I,null,e.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:c,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&o)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e.h("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&m)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e.h("nylas-confirmed-event-card",{confirmedEventInfo:m,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&i&&f){const l=(v=this.bookingInfoConfirmed)==null?void 0:v.primaryParticipant,w=((k=this.bookingInfoConfirmed)==null?void 0:k.additionalFields)||{};if(this.bookingInfo&&typeof((T=this.bookingInfo)==null?void 0:T.additionalFields)<"u"){const x=this.bookingInfo.additionalFields;Object.keys(x).forEach(L=>{!w[L]&&(x!=null&&x[L])&&(w[L]=x[L].value)})}const _=(S=this.stores)==null?void 0:S.scheduler.get("selectedTimeslot"),P=(z=this.stores)==null?void 0:z.scheduler.get("selectedTimezone"),U=(O=this.stores)==null?void 0:O.scheduler.get("selectedLanguage"),F=(R=this.stores)==null?void 0:R.scheduler.get("configSettings"),A=this.configurationId?this.configurationId:F==null?void 0:F.configuration_id,q=window.location.search,y=new URLSearchParams(q);y.set("booking_id",i.booking_id),l!=null&&l.name&&y.set("name",l.name),l!=null&&l.email&&y.set("email",l.email),_!=null&&_.start_time&&y.set("start_time",(new Date(_.start_time).getTime()/1e3).toString()),_!=null&&_.end_time&&y.set("end_time",(new Date(_.end_time).getTime()/1e3).toString()),P&&y.set("tz",P),U&&y.set("language",U),w&&y.set("additional_values",JSON.stringify(w)),this.slug&&y.set("page_slug",this.slug),A&&y.set("config_id",A),this.redirectToCustomUrl(`${f}?${y.toString()}`);return}if(n&&i)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"booked-event-page",part:"booked-event-page"},e.h("nylas-booked-event-card",{selectedTimeslot:d,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&(!i||s)&&!a){const l=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},s&&e.h(M,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"select-date-page",part:"select-date-page"},e.h("div",{class:"left-panel"},e.h("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e.h("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e.h("div",{class:`right-panel ${s?"reschedule":""}`},e.h("h2",null,e.h("calendar-icon",null),e.h("span",{id:"selectedDate"},this.selectedDateLabel)),e.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},l&&e.h("span",{slot:"timeslot-picker-cta-label"},e.h("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:w=>this.onFeedbackClick(w)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null))}return n&&!i&&a?e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},s&&e.h(M,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"additional-data-page",part:"additional-data-page"},e.h("div",{class:"left-panel"},e.h("div",{class:"wrapper"},e.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e.h("div",{class:`right-panel ${s?"reschedule":""}`},e.h("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null)):e.h(e.Host,null,e.h("slot",null))}get host(){return e.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};H.style=G;exports.nylas_scheduling=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bbbc79ad.cjs"),D=require("./index.es-e9d66a9b-a29322e0.cjs"),B=require("./scheduler-store-20151a77-2dfd28c2.cjs"),N=require("./constants-54af2051-a3596673.cjs"),E=require("./feedbackSync-e5cb0245-ea7ddac9.cjs");require("react");require("react-dom");class W{constructor({schedulerAPIURL:t,nylasSchedulerStore:i,sessionId:a,configId:o,slug:r,clientId:d}){if(!t)throw new Error("schedulerAPIURL is required");if(!i)throw new Error("nylasSchedulerStore is required");if(!a&&!o&&!(r||d))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");t==="/"&&(t=new URL(window.location.href).origin),this.configId=o,this.sessionId=a,this.schedulerAPIURL=t,this.nylasSchedulerStore=i,this.slug=r,this.clientId=d}init(){e.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new B.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const I=(n,t)=>{const i=n.isLoading,a=n.showNotification,o=n.nylasBranding;return e.h(e.Fragment,null,a&&e.h("nylas-notification",null),i&&e.h("div",{class:"loading"},e.h("div",{class:"left"},e.h("div",{class:"skeleton"})),e.h("div",{class:"right"},e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}))),!i&&t,e.h("div",{class:"footer"},o&&e.h("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",e.h("span",{class:"sr-only"},"Nylas"),e.h("nylas-logo",{"aria-hidden":!0}))))},M=(n,t)=>e.h("div",{class:"message-banner"},t),$=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0;height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}',G=$,j={title:e.instance.t("genericErrorTitle"),type:D.nr.Error,category:B.ErrorCategory.Component},H=class{constructor(n){e.registerInstance(this,n),this.init=e.createEvent(this,"init",7),this.schedulerWillLoad=e.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=e.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=e.createEvent(this,"nylasSchedulerError",7),this.configSettingsLoaded=e.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=e.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=e.createEvent(this,"bookedEventInfo",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.enableUserFeedback=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||`${e.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language,this.showFeedbackModal=!1,this.bookingInfoConfirmed=null}connectedCallback(){e.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var o,r;e.debug("[nylas-scheduler] Component will load"),this.enableUserFeedback&&!E.isInitialized()&&E.init({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:"1.3.2",integrations:d=>[...d.filter(s=>!1),E.feedbackSyncIntegration({colorScheme:"system",autoInject:!1})],autoSessionTracking:!1,beforeSend:()=>null});const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:B.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,...this.defaultSchedulerState})},this.baseProvider=new D.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let t;if(this.rescheduleBookingRef){const[d,s,c]=e.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=d,this.stores.scheduler.set("rescheduleBookingId",s),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.cancelBookingRef){const[d,s,c]=e.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=d,this.stores.scheduler.set("cancelBookingId",s),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s})}else if(this.organizerConfirmationBookingRef){const[d,s,c]=e.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=d,this.stores.scheduler.set("organizerConfirmationBookingId",s),this.stores.scheduler.set("organizerConfirmationSalt",c),t=this.bookingRefExtracted.emit({configurationId:d,bookingId:s,salt:c})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(t,this.nylasSchedulerConnector),t.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const i=(o=this.baseProvider)==null?void 0:o.getStore("scheduler");this.nylasSchedulerConnector=new W({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:i});const a=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(a,this.nylasSchedulerConnector),a.defaultPrevented)||((r=this.baseProvider)==null||r.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var c,b,m,g,h,f,p,C;(c=this.baseProvider)==null||c.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const t=await((b=this.nylasSchedulerConnector)==null?void 0:b.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t==null?void 0:t.error)},host:this.host});return}else{"data"in t&&((m=t.data)!=null&&m.appearance)&&console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");const u=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(u,this.nylasSchedulerConnector),u.defaultPrevented))return}const i=(g=this.baseProvider)==null?void 0:g.getStore("scheduler"),a=(f=(h=i==null?void 0:i.get("configSettings"))==null?void 0:h.scheduler)==null?void 0:f.available_days_in_future,o=i==null?void 0:i.get("selectedTimeslot");if(o&&(o!=null&&o.start_time)){if(!this.isTimeslotValid(o))return;if(i!=null&&i.get("showBookingForm")){i==null||i.set("selectedDate",o.start_time);return}}const r=i==null?void 0:i.get("selectedDate"),d=i==null?void 0:i.get("availability");let s;if(!(d&&d.length>0)){if(r){const{startTime:u,endTime:v,endTimeForAvailableDaysInFuture:k}=this.validateAvailableDaysInFuture(r,a||30);r.getTime()<k*1e3&&(s=await((C=this.nylasSchedulerConnector)==null?void 0:C.scheduler.getAvailability(u,v)))}else{const u=new Date,{startTime:v,endTime:k,endTimeForAvailableDaysInFuture:T}=this.validateAvailableDaysInFuture(u,a||30);u.getTime()<T*1e3&&(s=await((p=this.nylasSchedulerConnector)==null?void 0:p.scheduler.getAvailability(v,k)))}if((!s||"error"in s)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(s==null?void 0:s.error)},host:this.host}),!r){let u=new Date;const v=i==null?void 0:i.get("availability").find(k=>new Date(k.start_time)>new Date);v&&(u=v.start_time),i==null||i.set("selectedDate",u)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var t;(t=this.stores)==null||t.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("rescheduleBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}cancelBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("cancelBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}organizerConfirmationBookingRefChanged(n){var t,i;if(n){const[a,o]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("organizerConfirmationBookingId",o),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}localizationChanged(n){n&&Object.keys(n).forEach(t=>{t in N.LANGUAGE_CODE&&e.instance.addResourceBundle(t,"translation",n[t],!1,!0)})}themeConfigChanged(n){var t,i;(i=(t=this.baseProvider)==null?void 0:t.getStore("scheduler"))==null||i.set("themeConfig",n),this.applyThemeConfig(n)}languageChanged(n){const t=n.detail;this.language=t,e.instance.changeLanguage(t)}async registerComponentHandler(n){var t;(t=this.baseProvider)==null||t.registerComponent(n.detail)}async unregisterComponentHandler(n){var t;(t=this.baseProvider)==null||t.unregisterComponent(n.detail)}async monthChangedHandler(n){var d,s,c,b,m,g,h;const t=n.detail,i=(b=(c=(s=(d=this.nylasSchedulerConnector)==null?void 0:d.schedulerStore)==null?void 0:s.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:b.available_days_in_future,{startTime:a,endTime:o,endTimeForAvailableDaysInFuture:r}=this.validateAvailableDaysInFuture(t,i||30);if(!n.defaultPrevented&&a<r&&t.getTime()<r*1e3){const f=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.getAvailability(a,o));(!f||"error"in f)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(f==null?void 0:f.error)},host:this.host});const p=(g=this.stores)==null?void 0:g.scheduler.get("selectableDates");p&&p.length>0&&((h=this.stores)==null||h.scheduler.set("selectedDate",p[0]))}}mapToBookingData(n){var d,s,c;const t=(d=this.stores)==null?void 0:d.scheduler.get("selectedTimeslot"),i=(s=this.stores)==null?void 0:s.scheduler.get("selectedLanguage"),a=(c=this.stores)==null?void 0:c.scheduler.get("selectedTimezone"),o=t!=null&&t.start_time?new Date(t==null?void 0:t.start_time).getTime()/1e3:"",r=t!=null&&t.end_time?new Date(t==null?void 0:t.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:{...n.primaryParticipant},additional_fields:{...n.additionalFields},start_time:o,end_time:r,email_language:i,timezone:a}}async bookButtonClickedHandler(n){var c,b,m,g;if(n.defaultPrevented)return;const t=n.detail,i=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const o=(b=(c=this.nylasSchedulerConnector)==null?void 0:c.schedulerStore)==null?void 0:b.get("rescheduleBookingId");if(o){const h=await((m=this.nylasSchedulerConnector)==null?void 0:m.scheduler.rescheduleBooking(o,t));(!h||"error"in h)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(h==null?void 0:h.error)},host:this.host});const f=h==null?void 0:h.data,p=this.bookedEventInfo.emit({...h,data:{...f,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(p,this.nylasSchedulerConnector);return}const r=await((g=this.nylasSchedulerConnector)==null?void 0:g.scheduler.bookTimeslot(t));(!r||"error"in r)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r==null?void 0:r.error)},host:this.host});const d=r==null?void 0:r.data,s=this.bookedEventInfo.emit({...r,data:{...d,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(s,this.nylasSchedulerConnector)}dateSelectedHandler(n){const t=n.detail;this.selectedDateLabel=t?t.toLocaleDateString(void 0,{dateStyle:"full"}):`${e.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=!1}feedbackSubmittedHandler(n){const i={eventId:E.captureMessage("Scheduling Page User Feedback"),message:n.detail.feedback};E.captureFeedback(i,{includeReplay:!0,captureContext:{tags:{"nylas-web-element":"nylas-schduling","nylas-web-element-version":"1.3.2"},extra:{configId:this.configurationId,slug:this.slug}}}),this.showFeedbackModal=!1}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||j.title,category:(n==null?void 0:n.category)||j.category,type:D.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=e.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=e.instance.t("sessionIdRequiredErrorMessage")+" "+e.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:e.instance.t("schedulingComponentErrorTitle"),category:B.ErrorCategory.Component,type:D.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:e.instance.t("invalidTimeslotErrorTitle"),category:B.ErrorCategory.Component,type:D.nr.Error,description:e.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,t){const i=new Date,a=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,o=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,r=Math.floor(e.addDaysToCurrentDate(i,t).getTime()/1e3),d=Math.min(r,o);return{startTime:a<i.getTime()/1e3?Math.floor(i.getTime()/1e3):a,endTime:d,endTimeForAvailableDaysInFuture:r}}applyThemeConfig(n){if(n)for(const[t,i]of Object.entries(n))this.host.style.setProperty(`${t}`,i)}onFeedbackClick(n){n.preventDefault(),this.showFeedbackModal=!0}redirectToCustomUrl(n){window.location.assign(n)}render(){var p,C,u,v,k,T,S,z,O,R;const n=this.mode==="app",t=(p=this.baseProvider)==null?void 0:p.getStore("scheduler"),i=t==null?void 0:t.get("eventInfo"),a=t==null?void 0:t.get("showBookingForm"),o=t==null?void 0:t.get("cancelledEventInfo"),r=t==null?void 0:t.get("cancelBookingId"),d=t==null?void 0:t.get("selectedTimeslot"),s=t==null?void 0:t.get("rescheduleBookingId"),c=t==null?void 0:t.get("organizerConfirmationBookingId"),b=t==null?void 0:t.get("rejectBookingId"),m=t==null?void 0:t.get("confirmedEventInfo"),g=(t==null?void 0:t.get("nylasBranding"))||this.nylasBranding,h=t==null?void 0:t.get("selectedDate"),f=(u=(C=t==null?void 0:t.get("configSettings"))==null?void 0:C.scheduler)==null?void 0:u.confirmation_redirect_url;if(this.selectedDateLabel=h&&this.language?e.capitalizeFirstLetter(h.toLocaleDateString(N.LANGUAGE_CODE_MAP[this.language],{dateStyle:"full"})):`${e.instance.t("noDateSelected")}`,n&&(r||b)&&!o)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e.h("nylas-cancel-booking-form",{selectedTimeslot:d,cancelBookingId:r,rejectBookingId:b,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&c)return e.h(e.Host,null,e.h(I,null,e.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:c,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&o)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e.h("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&m)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e.h("nylas-confirmed-event-card",{confirmedEventInfo:m,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&i&&f){const l=(v=this.bookingInfoConfirmed)==null?void 0:v.primaryParticipant,w=((k=this.bookingInfoConfirmed)==null?void 0:k.additionalFields)||{};if(this.bookingInfo&&typeof((T=this.bookingInfo)==null?void 0:T.additionalFields)<"u"){const x=this.bookingInfo.additionalFields;Object.keys(x).forEach(L=>{!w[L]&&(x!=null&&x[L])&&(w[L]=x[L].value)})}const _=(S=this.stores)==null?void 0:S.scheduler.get("selectedTimeslot"),P=(z=this.stores)==null?void 0:z.scheduler.get("selectedTimezone"),U=(O=this.stores)==null?void 0:O.scheduler.get("selectedLanguage"),F=(R=this.stores)==null?void 0:R.scheduler.get("configSettings"),A=this.configurationId?this.configurationId:F==null?void 0:F.configuration_id,q=window.location.search,y=new URLSearchParams(q);y.set("booking_id",i.booking_id),l!=null&&l.name&&y.set("name",l.name),l!=null&&l.email&&y.set("email",l.email),_!=null&&_.start_time&&y.set("start_time",(new Date(_.start_time).getTime()/1e3).toString()),_!=null&&_.end_time&&y.set("end_time",(new Date(_.end_time).getTime()/1e3).toString()),P&&y.set("tz",P),U&&y.set("language",U),w&&y.set("additional_values",JSON.stringify(w)),this.slug&&y.set("page_slug",this.slug),A&&y.set("config_id",A),this.redirectToCustomUrl(`${f}?${y.toString()}`);return}if(n&&i)return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"booked-event-page",part:"booked-event-page"},e.h("nylas-booked-event-card",{selectedTimeslot:d,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&(!i||s)&&!a){const l=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},s&&e.h(M,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"select-date-page",part:"select-date-page"},e.h("div",{class:"left-panel"},e.h("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e.h("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e.h("div",{class:`right-panel ${s?"reschedule":""}`},e.h("h2",null,e.h("calendar-icon",null),e.h("span",{id:"selectedDate"},this.selectedDateLabel)),e.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},l&&e.h("span",{slot:"timeslot-picker-cta-label"},e.h("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:w=>this.onFeedbackClick(w)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null))}return n&&!i&&a?e.h(e.Host,null,e.h(I,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},s&&e.h(M,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"additional-data-page",part:"additional-data-page"},e.h("div",{class:"left-panel"},e.h("div",{class:"wrapper"},e.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e.h("div",{class:`right-panel ${s?"reschedule":""}`},e.h("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:l=>this.onFeedbackClick(l)},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null)):e.h(e.Host,null,e.h("slot",null))}get host(){return e.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};H.style=G;exports.nylas_scheduling=H;
@@ -0,0 +1,336 @@
1
+ import { b as oe, Q as Y, r as q, c as U, R as Z, S as B, T as G, U as Q, h as f, H as le, g as he } from "./index-ad112f6a.js";
2
+ import "react";
3
+ import "react-dom";
4
+ var J = { exports: {} };
5
+ (function(e, t) {
6
+ (function(n, i) {
7
+ e.exports = i();
8
+ })(oe, function() {
9
+ var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, i = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, a = /\d\d/, o = /\d\d?/, x = /\d*[^-_:/,()\s\d]+/, v = {}, V = function(s) {
10
+ return (s = +s) + (s > 68 ? 1900 : 2e3);
11
+ }, d = function(s) {
12
+ return function(r) {
13
+ this[s] = +r;
14
+ };
15
+ }, X = [/[+-]\d\d:?(\d\d)?|Z/, function(s) {
16
+ (this.zone || (this.zone = {})).offset = function(r) {
17
+ if (!r || r === "Z")
18
+ return 0;
19
+ var l = r.match(/([+-]|\d\d)/g), h = 60 * l[1] + (+l[2] || 0);
20
+ return h === 0 ? 0 : l[0] === "+" ? -h : h;
21
+ }(s);
22
+ }], F = function(s) {
23
+ var r = v[s];
24
+ return r && (r.indexOf ? r : r.s.concat(r.f));
25
+ }, j = function(s, r) {
26
+ var l, h = v.meridiem;
27
+ if (h) {
28
+ for (var p = 1; p <= 24; p += 1)
29
+ if (s.indexOf(h(p, 0, r)) > -1) {
30
+ l = p > 12;
31
+ break;
32
+ }
33
+ } else
34
+ l = s === (r ? "pm" : "PM");
35
+ return l;
36
+ }, ee = { A: [x, function(s) {
37
+ this.afternoon = j(s, !1);
38
+ }], a: [x, function(s) {
39
+ this.afternoon = j(s, !0);
40
+ }], S: [/\d/, function(s) {
41
+ this.milliseconds = 100 * +s;
42
+ }], SS: [a, function(s) {
43
+ this.milliseconds = 10 * +s;
44
+ }], SSS: [/\d{3}/, function(s) {
45
+ this.milliseconds = +s;
46
+ }], s: [o, d("seconds")], ss: [o, d("seconds")], m: [o, d("minutes")], mm: [o, d("minutes")], H: [o, d("hours")], h: [o, d("hours")], HH: [o, d("hours")], hh: [o, d("hours")], D: [o, d("day")], DD: [a, d("day")], Do: [x, function(s) {
47
+ var r = v.ordinal, l = s.match(/\d+/);
48
+ if (this.day = l[0], r)
49
+ for (var h = 1; h <= 31; h += 1)
50
+ r(h).replace(/\[|\]/g, "") === s && (this.day = h);
51
+ }], M: [o, d("month")], MM: [a, d("month")], MMM: [x, function(s) {
52
+ var r = F("months"), l = (F("monthsShort") || r.map(function(h) {
53
+ return h.slice(0, 3);
54
+ })).indexOf(s) + 1;
55
+ if (l < 1)
56
+ throw new Error();
57
+ this.month = l % 12 || l;
58
+ }], MMMM: [x, function(s) {
59
+ var r = F("months").indexOf(s) + 1;
60
+ if (r < 1)
61
+ throw new Error();
62
+ this.month = r % 12 || r;
63
+ }], Y: [/[+-]?\d+/, d("year")], YY: [a, function(s) {
64
+ this.year = V(s);
65
+ }], YYYY: [/\d{4}/, d("year")], Z: X, ZZ: X };
66
+ function te(s) {
67
+ var r, l;
68
+ r = s, l = v && v.formats;
69
+ for (var h = (s = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(I, w, u) {
70
+ var c = u && u.toUpperCase();
71
+ return w || l[u] || n[u] || l[c].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(k, T, C) {
72
+ return T || C.slice(1);
73
+ });
74
+ })).match(i), p = h.length, b = 0; b < p; b += 1) {
75
+ var L = h[b], S = ee[L], y = S && S[0], g = S && S[1];
76
+ h[b] = g ? { regex: y, parser: g } : L.replace(/^\[|\]$/g, "");
77
+ }
78
+ return function(I) {
79
+ for (var w = {}, u = 0, c = 0; u < p; u += 1) {
80
+ var k = h[u];
81
+ if (typeof k == "string")
82
+ c += k.length;
83
+ else {
84
+ var T = k.regex, C = k.parser, E = I.slice(c), M = T.exec(E)[0];
85
+ C.call(w, M), I = I.replace(M, "");
86
+ }
87
+ }
88
+ return function(D) {
89
+ var m = D.afternoon;
90
+ if (m !== void 0) {
91
+ var A = D.hours;
92
+ m ? A < 12 && (D.hours += 12) : A === 12 && (D.hours = 0), delete D.afternoon;
93
+ }
94
+ }(w), w;
95
+ };
96
+ }
97
+ return function(s, r, l) {
98
+ l.p.customParseFormat = !0, s && s.parseTwoDigitYear && (V = s.parseTwoDigitYear);
99
+ var h = r.prototype, p = h.parse;
100
+ h.parse = function(b) {
101
+ var L = b.date, S = b.utc, y = b.args;
102
+ this.$u = S;
103
+ var g = y[1];
104
+ if (typeof g == "string") {
105
+ var I = y[2] === !0, w = y[3] === !0, u = I || w, c = y[2];
106
+ w && (c = y[2]), v = this.$locale(), !I && c && (v = l.Ls[c]), this.$d = function(E, M, D) {
107
+ try {
108
+ if (["x", "X"].indexOf(M) > -1)
109
+ return new Date((M === "X" ? 1e3 : 1) * E);
110
+ var m = te(M)(E), A = m.year, O = m.month, ie = m.day, se = m.hours, ne = m.minutes, ae = m.seconds, re = m.milliseconds, N = m.zone, P = /* @__PURE__ */ new Date(), _ = ie || (A || O ? 1 : P.getDate()), z = A || P.getFullYear(), $ = 0;
111
+ A && !O || ($ = O > 0 ? O - 1 : P.getMonth());
112
+ var H = se || 0, K = ne || 0, R = ae || 0, W = re || 0;
113
+ return N ? new Date(Date.UTC(z, $, _, H, K, R, W + 60 * N.offset * 1e3)) : D ? new Date(Date.UTC(z, $, _, H, K, R, W)) : new Date(z, $, _, H, K, R, W);
114
+ } catch {
115
+ return /* @__PURE__ */ new Date("");
116
+ }
117
+ }(L, g, S), this.init(), c && c !== !0 && (this.$L = this.locale(c).$L), u && L != this.format(g) && (this.$d = /* @__PURE__ */ new Date("")), v = {};
118
+ } else if (g instanceof Array)
119
+ for (var k = g.length, T = 1; T <= k; T += 1) {
120
+ y[1] = g[T - 1];
121
+ var C = l.apply(this, y);
122
+ if (C.isValid()) {
123
+ this.$d = C.$d, this.$L = C.$L, this.init();
124
+ break;
125
+ }
126
+ T === k && (this.$d = /* @__PURE__ */ new Date(""));
127
+ }
128
+ else
129
+ p.call(this, b);
130
+ };
131
+ };
132
+ });
133
+ })(J);
134
+ const de = J.exports, ce = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;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:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}', me = ce;
135
+ Y.extend(de);
136
+ const fe = class {
137
+ constructor(e) {
138
+ q(this, e), this.timeChange = U(this, "timeChange", 7), this.formError = U(this, "formError", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.name = void 0, this.hasError = !1, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
139
+ }
140
+ handleOutsideClick(e) {
141
+ !e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
142
+ }
143
+ minimumStartTimeChangedHandler() {
144
+ if (this.minimumStartTime) {
145
+ let e = Y().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
146
+ this.minimumStartTime.slice(-2).toLowerCase() === "pm" && parseInt(this.minimumStartTime) !== 12 ? e = e.add(12, "hour") : this.minimumStartTime.slice(-2).toLowerCase() === "am" && parseInt(this.minimumStartTime) === 12 && (e = e.subtract(12, "hour")), this.times = this.generateTimes();
147
+ const t = Y(this.times[0].value, "hh:mma");
148
+ Y(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.formError.emit({
149
+ key: this.el.id,
150
+ message: "Invalid"
151
+ }));
152
+ }
153
+ }
154
+ componentDidRender() {
155
+ if (this.showTimes && this.shouldAutoScroll) {
156
+ const e = Z(this.time), t = this.times.findIndex((n) => n.value === e);
157
+ t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
158
+ return;
159
+ }
160
+ }
161
+ handleTimeChange(e, t) {
162
+ const n = t.split(":");
163
+ n[0] === "00" && n[1].slice(-2) == "pm" && (this.err = "Invalid", this.formError.emit({
164
+ key: this.el.id,
165
+ message: "Invalid"
166
+ })), B(t) ? (this.err = "", this.formError.emit({
167
+ key: this.el.id,
168
+ message: ""
169
+ })) : (this.err = "Invalid", this.formError.emit({
170
+ key: this.el.id,
171
+ message: "Invalid"
172
+ })), this.timeChange.emit({
173
+ key: this.el.id,
174
+ value: t
175
+ });
176
+ }
177
+ handleTimeAutocomplete(e) {
178
+ var n;
179
+ const t = (n = e.target) == null ? void 0 : n.value;
180
+ if (!B(t)) {
181
+ this.err = "Invalid", this.formError.emit({
182
+ key: this.el.id,
183
+ message: "Invalid"
184
+ });
185
+ return;
186
+ }
187
+ if (t === "") {
188
+ const i = G().format("hh:mma");
189
+ this.timeChange.emit({
190
+ key: this.el.id,
191
+ value: i
192
+ });
193
+ return;
194
+ }
195
+ if (!Q(t)) {
196
+ const i = Z(t);
197
+ this.timeChange.emit({
198
+ key: this.el.id,
199
+ value: i
200
+ });
201
+ return;
202
+ }
203
+ this.timeChange.emit({
204
+ key: this.el.id,
205
+ value: t
206
+ });
207
+ }
208
+ handleOnInput(e) {
209
+ var n;
210
+ const t = (n = e.target) == null ? void 0 : n.value;
211
+ if (B(t)) {
212
+ if (t === "") {
213
+ const i = G().format("hh:mma"), a = this.times.findIndex((o) => o.value === i);
214
+ a > -1 && this.scrollToViewWithinParent(a);
215
+ return;
216
+ }
217
+ if (!Q(t)) {
218
+ const i = Z(t), a = this.times.findIndex((o) => o.value === i);
219
+ a > -1 && this.scrollToViewWithinParent(a);
220
+ return;
221
+ }
222
+ }
223
+ }
224
+ generateTimes() {
225
+ const e = [];
226
+ let t = Y().set("hour", 0).set("minute", 0).set("second", 0);
227
+ this.minimumStartTime && (t = Y(this.minimumStartTime, "hh:mma"));
228
+ const n = t.endOf("day").diff(t, "minutes"), i = Math.round(n / 15);
229
+ for (let a = 0; a < i + 1; a++) {
230
+ const o = t.add(a * 15, "minute");
231
+ if (a == i && o.format("hh:mma").includes("am"))
232
+ break;
233
+ e.push({ id: a, value: o.format("hh:mma") });
234
+ }
235
+ return e;
236
+ }
237
+ handleComboboxKeyDown(e) {
238
+ if (e.key === "ArrowDown") {
239
+ if (e.preventDefault(), !this.showTimes) {
240
+ this.showTimes = !0, this.shouldAutoScroll = !0;
241
+ return;
242
+ }
243
+ if (this.ariaActivedescendant === "")
244
+ this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
245
+ else {
246
+ const t = this.times.findIndex((i) => i.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
247
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
248
+ }
249
+ } else if (e.key === "ArrowUp")
250
+ if (e.preventDefault(), this.ariaActivedescendant === "")
251
+ this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
252
+ else {
253
+ const t = this.times.findIndex((i) => i.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
254
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
255
+ }
256
+ else
257
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
258
+ }
259
+ handleListboxKeydown(e) {
260
+ const t = this.times, n = t.findIndex((i) => i.id.toString() === this.ariaActivedescendant);
261
+ if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
262
+ e.preventDefault();
263
+ const i = n + 1 < t.length ? n + 1 : 0;
264
+ this.ariaActivedescendant = t[i].id.toString(), this.focusOption(i);
265
+ } else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
266
+ e.preventDefault();
267
+ const i = n - 1 >= 0 ? n - 1 : t.length - 1;
268
+ this.ariaActivedescendant = t[i].id.toString(), this.focusOption(i);
269
+ } else if (e.key === "Enter") {
270
+ if (e.preventDefault(), this.ariaActivedescendant) {
271
+ const i = t[n];
272
+ this.handleTimeChange(e, i.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
273
+ }
274
+ } else
275
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
276
+ }
277
+ scrollToViewWithinParent(e) {
278
+ var x;
279
+ const t = this.times[e], n = (x = this.el.shadowRoot) == null ? void 0 : x.getElementById(t.id.toString()), i = this.timeMenu;
280
+ this.ariaActivedescendant = t.id.toString();
281
+ const a = n.getBoundingClientRect(), o = i.getBoundingClientRect();
282
+ a.top < o.top ? i.scrollTop -= o.top - a.top : a.bottom > o.bottom && (i.scrollTop += a.bottom - o.bottom), a.left < o.left ? i.scrollLeft -= o.left - a.left : a.right > o.right && (i.scrollLeft += a.right - o.right);
283
+ }
284
+ focusOption(e) {
285
+ var a;
286
+ const t = this.times[e];
287
+ if (!t)
288
+ return;
289
+ const n = t.id.toString(), i = (a = this.el.shadowRoot) == null ? void 0 : a.getElementById(n);
290
+ i && (i.focus(), i.scrollIntoView({ behavior: "smooth", block: "nearest" }));
291
+ }
292
+ render() {
293
+ return f(le, { key: "c0d6314d7f4b6c2fea1697756554364145440dd2" }, f("div", { key: "d6d729bdab1bdafaced55b31dfdfdefbbe77b698", class: "time-picker", part: "time-picker" }, f("input", { key: "6923f9f6948a59e94ea202bb5bcefb8b1cbba9f6", type: "text", name: this.name, id: this.name, part: "time-input", class: {
294
+ "time-input": !0,
295
+ error: !!this.err || this.hasError
296
+ }, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
297
+ this.showTimes = !this.showTimes, this.shouldAutoScroll = !0;
298
+ }, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && f("div", { class: "invalid-time-icon" }), this.showTimes && f("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, f("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => f("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
299
+ focused: this.ariaActivedescendant === e.id.toString()
300
+ }, onClick: (t) => {
301
+ this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
302
+ }, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && f("p", { class: "error", id: "email-error" }, this.err)));
303
+ }
304
+ get el() {
305
+ return he(this);
306
+ }
307
+ static get watchers() {
308
+ return {
309
+ minimumStartTime: ["minimumStartTimeChangedHandler"]
310
+ };
311
+ }
312
+ };
313
+ fe.style = me;
314
+ const ue = '.switch{--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;display:inline-block;height:34px;position:relative;width:60px}.switch input{display:none}.slider{background-color:var(--nylas-base-300);bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:0.4s}.slider:before{background-color:var(--nylas-base-0);bottom:4px;content:"";height:32px;left:4px;position:absolute;transition:0.4s;width:32px}input:checked+.slider{background-color:var(--nylas-success)}input:checked+.slider:before{transform:translateX(32px)}.slider.round{border-radius:35px;width:72px;height:40px}.slider.round:before{border-radius:50%}', pe = ue, be = class {
315
+ constructor(e) {
316
+ q(this, e), this.nylasFormSwitchToggled = U(this, "nylasFormSwitchToggled", 7), this.name = "toggle-switch", this.checked = !1, this.label = "", this.isChecked = this.checked;
317
+ }
318
+ componentWillLoad() {
319
+ this.isChecked = this.checked;
320
+ }
321
+ toggleCheck() {
322
+ this.isChecked = !this.isChecked, this.nylasFormSwitchToggled.emit({
323
+ checked: this.isChecked,
324
+ name: this.name,
325
+ label: this.label
326
+ });
327
+ }
328
+ render() {
329
+ return f("label", { key: "58015f47a5e227e8d9274761d317eaa7e95a9e1c", class: "switch", part: "ts_label" }, f("input", { key: "db6158a12d8fee36fcbbf3ee356768f9995971ed", type: "checkbox", part: "ts_input", name: this.name, checked: this.isChecked, onChange: () => this.toggleCheck() }), f("div", { key: "8e8b0eb635db66afb7e41b1ef312c3769edbf8b7", class: "slider round", part: "ts_slider" }));
330
+ }
331
+ };
332
+ be.style = pe;
333
+ export {
334
+ fe as nylas_time_window_picker,
335
+ be as toggle_switch
336
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-bbbc79ad.cjs");require("react");require("react-dom");var V={exports:{}};(function(e,t){(function(a,i){e.exports=i()})(n.commonjsGlobal,function(){var a={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,l=/\d\d?/,v=/\d*[^-_:/,()\s\d]+/,x={},R=function(s){return(s=+s)+(s>68?1900:2e3)},c=function(s){return function(o){this[s]=+o}},W=[/[+-]\d\d:?(\d\d)?|Z/,function(s){(this.zone||(this.zone={})).offset=function(o){if(!o||o==="Z")return 0;var h=o.match(/([+-]|\d\d)/g),d=60*h[1]+(+h[2]||0);return d===0?0:h[0]==="+"?-d:d}(s)}],O=function(s){var o=x[s];return o&&(o.indexOf?o:o.s.concat(o.f))},Z=function(s,o){var h,d=x.meridiem;if(d){for(var p=1;p<=24;p+=1)if(s.indexOf(d(p,0,o))>-1){h=p>12;break}}else h=s===(o?"pm":"PM");return h},N={A:[v,function(s){this.afternoon=Z(s,!1)}],a:[v,function(s){this.afternoon=Z(s,!0)}],S:[/\d/,function(s){this.milliseconds=100*+s}],SS:[r,function(s){this.milliseconds=10*+s}],SSS:[/\d{3}/,function(s){this.milliseconds=+s}],s:[l,c("seconds")],ss:[l,c("seconds")],m:[l,c("minutes")],mm:[l,c("minutes")],H:[l,c("hours")],h:[l,c("hours")],HH:[l,c("hours")],hh:[l,c("hours")],D:[l,c("day")],DD:[r,c("day")],Do:[v,function(s){var o=x.ordinal,h=s.match(/\d+/);if(this.day=h[0],o)for(var d=1;d<=31;d+=1)o(d).replace(/\[|\]/g,"")===s&&(this.day=d)}],M:[l,c("month")],MM:[r,c("month")],MMM:[v,function(s){var o=O("months"),h=(O("monthsShort")||o.map(function(d){return d.slice(0,3)})).indexOf(s)+1;if(h<1)throw new Error;this.month=h%12||h}],MMMM:[v,function(s){var o=O("months").indexOf(s)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(s){this.year=R(s)}],YYYY:[/\d{4}/,c("year")],Z:W,ZZ:W};function X(s){var o,h;o=s,h=x&&x.formats;for(var d=(s=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(I,w,f){var m=f&&f.toUpperCase();return w||h[f]||a[f]||h[m].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(k,T,M){return T||M.slice(1)})})).match(i),p=d.length,b=0;b<p;b+=1){var Y=d[b],S=N[Y],y=S&&S[0],g=S&&S[1];d[b]=g?{regex:y,parser:g}:Y.replace(/^\[|\]$/g,"")}return function(I){for(var w={},f=0,m=0;f<p;f+=1){var k=d[f];if(typeof k=="string")m+=k.length;else{var T=k.regex,M=k.parser,L=I.slice(m),D=T.exec(L)[0];M.call(w,D),I=I.replace(D,"")}}return function(C){var u=C.afternoon;if(u!==void 0){var A=C.hours;u?A<12&&(C.hours+=12):A===12&&(C.hours=0),delete C.afternoon}}(w),w}}return function(s,o,h){h.p.customParseFormat=!0,s&&s.parseTwoDigitYear&&(R=s.parseTwoDigitYear);var d=o.prototype,p=d.parse;d.parse=function(b){var Y=b.date,S=b.utc,y=b.args;this.$u=S;var g=y[1];if(typeof g=="string"){var I=y[2]===!0,w=y[3]===!0,f=I||w,m=y[2];w&&(m=y[2]),x=this.$locale(),!I&&m&&(x=h.Ls[m]),this.$d=function(L,D,C){try{if(["x","X"].indexOf(D)>-1)return new Date((D==="X"?1e3:1)*L);var u=X(D)(L),A=u.year,E=u.month,G=u.day,J=u.hours,Q=u.minutes,ee=u.seconds,te=u.milliseconds,B=u.zone,$=new Date,P=G||(A||E?1:$.getDate()),_=A||$.getFullYear(),F=0;A&&!E||(F=E>0?E-1:$.getMonth());var z=J||0,j=Q||0,H=ee||0,K=te||0;return B?new Date(Date.UTC(_,F,P,z,j,H,K+60*B.offset*1e3)):C?new Date(Date.UTC(_,F,P,z,j,H,K)):new Date(_,F,P,z,j,H,K)}catch{return new Date("")}}(Y,g,S),this.init(),m&&m!==!0&&(this.$L=this.locale(m).$L),f&&Y!=this.format(g)&&(this.$d=new Date("")),x={}}else if(g instanceof Array)for(var k=g.length,T=1;T<=k;T+=1){y[1]=g[T-1];var M=h.apply(this,y);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}T===k&&(this.$d=new Date(""))}else p.call(this,b)}}})})(V);const ie=V.exports,se=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;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:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}',ne=se;n.dayjs.extend(ie);const U=class{constructor(e){n.registerInstance(this,e),this.timeChange=n.createEvent(this,"timeChange",7),this.formError=n.createEvent(this,"formError",7),this.time=void 0,this.minimumStartTime=null,this.placeholder="hh:mmam/pm",this.name=void 0,this.hasError=!1,this.err="",this.showTimes=!1,this.ariaActivedescendant="",this.times=this.generateTimes(),this.shouldAutoScroll=!1}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.showTimes&&(this.showTimes=!1)}minimumStartTimeChangedHandler(){if(this.minimumStartTime){let e=n.dayjs().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4,-2)));this.minimumStartTime.slice(-2).toLowerCase()==="pm"&&parseInt(this.minimumStartTime)!==12?e=e.add(12,"hour"):this.minimumStartTime.slice(-2).toLowerCase()==="am"&&parseInt(this.minimumStartTime)===12&&(e=e.subtract(12,"hour")),this.times=this.generateTimes();const t=n.dayjs(this.times[0].value,"hh:mma");n.dayjs(this.time,"hh:mma").isBefore(t)&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"}))}}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=n.autocompleteTimeFormat(this.time),t=this.times.findIndex(a=>a.value===e);t>-1&&(this.shouldAutoScroll=!1,this.scrollToViewWithinParent(t));return}}handleTimeChange(e,t){const a=t.split(":");a[0]==="00"&&a[1].slice(-2)=="pm"&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),n.validateTimeFormatInput(t)?(this.err="",this.formError.emit({key:this.el.id,message:""})):(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),this.timeChange.emit({key:this.el.id,value:t})}handleTimeAutocomplete(e){var a;const t=(a=e.target)==null?void 0:a.value;if(!n.validateTimeFormatInput(t)){this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"});return}if(t===""){const i=n.roundToNearest15Minutes().format("hh:mma");this.timeChange.emit({key:this.el.id,value:i});return}if(!n.validateExactTimeFormat(t)){const i=n.autocompleteTimeFormat(t);this.timeChange.emit({key:this.el.id,value:i});return}this.timeChange.emit({key:this.el.id,value:t})}handleOnInput(e){var a;const t=(a=e.target)==null?void 0:a.value;if(n.validateTimeFormatInput(t)){if(t===""){const i=n.roundToNearest15Minutes().format("hh:mma"),r=this.times.findIndex(l=>l.value===i);r>-1&&this.scrollToViewWithinParent(r);return}if(!n.validateExactTimeFormat(t)){const i=n.autocompleteTimeFormat(t),r=this.times.findIndex(l=>l.value===i);r>-1&&this.scrollToViewWithinParent(r);return}}}generateTimes(){const e=[];let t=n.dayjs().set("hour",0).set("minute",0).set("second",0);this.minimumStartTime&&(t=n.dayjs(this.minimumStartTime,"hh:mma"));const a=t.endOf("day").diff(t,"minutes"),i=Math.round(a/15);for(let r=0;r<i+1;r++){const l=t.add(r*15,"minute");if(r==i&&l.format("hh:mma").includes("am"))break;e.push({id:r,value:l.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){if(e.preventDefault(),!this.showTimes){this.showTimes=!0,this.shouldAutoScroll=!0;return}if(this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[0].id.toString(),this.focusOption(0);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),a=t+1<this.times.length?t+1:0;this.ariaActivedescendant=this.times[a].id.toString(),this.focusOption(a)}}else if(e.key==="ArrowUp")if(e.preventDefault(),this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[this.times.length-1].id.toString(),this.focusOption(this.times.length-1);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),a=t-1>=0?t-1:this.times.length-1;this.ariaActivedescendant=this.times[a].id.toString(),this.focusOption(a)}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}handleListboxKeydown(e){const t=this.times,a=t.findIndex(i=>i.id.toString()===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=a+1<t.length?a+1:0;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=a-1>=0?a-1:t.length-1;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="Enter"){if(e.preventDefault(),this.ariaActivedescendant){const i=t[a];this.handleTimeChange(e,i.value),this.showTimes=!1,this.ariaActivedescendant="",this.timeInput.focus()}}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}scrollToViewWithinParent(e){var v;const t=this.times[e],a=(v=this.el.shadowRoot)==null?void 0:v.getElementById(t.id.toString()),i=this.timeMenu;this.ariaActivedescendant=t.id.toString();const r=a.getBoundingClientRect(),l=i.getBoundingClientRect();r.top<l.top?i.scrollTop-=l.top-r.top:r.bottom>l.bottom&&(i.scrollTop+=r.bottom-l.bottom),r.left<l.left?i.scrollLeft-=l.left-r.left:r.right>l.right&&(i.scrollLeft+=r.right-l.right)}focusOption(e){var r;const t=this.times[e];if(!t)return;const a=t.id.toString(),i=(r=this.el.shadowRoot)==null?void 0:r.getElementById(a);i&&(i.focus(),i.scrollIntoView({behavior:"smooth",block:"nearest"}))}render(){return n.h(n.Host,{key:"c0d6314d7f4b6c2fea1697756554364145440dd2"},n.h("div",{key:"d6d729bdab1bdafaced55b31dfdfdefbbe77b698",class:"time-picker",part:"time-picker"},n.h("input",{key:"6923f9f6948a59e94ea202bb5bcefb8b1cbba9f6",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":!0,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:this.time,onClick:()=>{this.showTimes=!this.showTimes,this.shouldAutoScroll=!0},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&n.h("div",{class:"invalid-time-icon"}),this.showTimes&&n.h("div",{class:"times",part:"times",ref:e=>this.timeMenu=e},n.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map(e=>n.h("li",{tabindex:"0",key:e.id,id:e.id.toString(),class:{focused:this.ariaActivedescendant===e.id.toString()},onClick:t=>{this.handleTimeChange(t,e.value),this.showTimes=!1,this.timeInput.focus()},role:"option"},`${e.value}`)))),!this.showTimes&&this.err&&n.h("p",{class:"error",id:"email-error"},this.err)))}get el(){return n.getElement(this)}static get watchers(){return{minimumStartTime:["minimumStartTimeChangedHandler"]}}};U.style=ne;const ae='.switch{--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;display:inline-block;height:34px;position:relative;width:60px}.switch input{display:none}.slider{background-color:var(--nylas-base-300);bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:0.4s}.slider:before{background-color:var(--nylas-base-0);bottom:4px;content:"";height:32px;left:4px;position:absolute;transition:0.4s;width:32px}input:checked+.slider{background-color:var(--nylas-success)}input:checked+.slider:before{transform:translateX(32px)}.slider.round{border-radius:35px;width:72px;height:40px}.slider.round:before{border-radius:50%}',re=ae,q=class{constructor(e){n.registerInstance(this,e),this.nylasFormSwitchToggled=n.createEvent(this,"nylasFormSwitchToggled",7),this.name="toggle-switch",this.checked=!1,this.label="",this.isChecked=this.checked}componentWillLoad(){this.isChecked=this.checked}toggleCheck(){this.isChecked=!this.isChecked,this.nylasFormSwitchToggled.emit({checked:this.isChecked,name:this.name,label:this.label})}render(){return n.h("label",{key:"58015f47a5e227e8d9274761d317eaa7e95a9e1c",class:"switch",part:"ts_label"},n.h("input",{key:"db6158a12d8fee36fcbbf3ee356768f9995971ed",type:"checkbox",part:"ts_input",name:this.name,checked:this.isChecked,onChange:()=>this.toggleCheck()}),n.h("div",{key:"8e8b0eb635db66afb7e41b1ef312c3769edbf8b7",class:"slider round",part:"ts_slider"}))}};q.style=re;exports.nylas_time_window_picker=U;exports.toggle_switch=q;
@@ -1,4 +1,4 @@
1
- import { r as e, h as t } from "./index-13a43508.js";
1
+ import { r as e, h as t } from "./index-ad112f6a.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const o = ".sc-person-icon-h{display:flex}", r = o, C = class {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-7dbf0ae7.cjs");require("react");require("react-dom");const r=".sc-person-icon-h{display:flex}",i=r,t=class{constructor(s){e.registerInstance(this,s),this.width="14",this.height="16"}render(){return e.h("svg",{key:"bf77344f510a860cf3b05daea1254dbe06465bcf",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"6704d143c071b2de1ce05a823bb98ba59fbffba7",d:"M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z",fill:"currentColor"}))}};t.style=i;exports.person_icon=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const r=".sc-person-icon-h{display:flex}",i=r,t=class{constructor(s){e.registerInstance(this,s),this.width="14",this.height="16"}render(){return e.h("svg",{key:"bf77344f510a860cf3b05daea1254dbe06465bcf",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"6704d143c071b2de1ce05a823bb98ba59fbffba7",d:"M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z",fill:"currentColor"}))}};t.style=i;exports.person_icon=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-7dbf0ae7.cjs");require("react");require("react-dom");const s=".sc-play-icon-h{display:flex}",o=s,t=class{constructor(i){e.registerInstance(this,i),this.width="15",this.height="15"}render(){return e.h("svg",{key:"09672d0e495dea5c057e0459bbaf09e05c5f6d92",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"f2d1b1e318670f9dac0c53f4e6bfe209fb6bb073",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};t.style=o;exports.play_icon=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bbbc79ad.cjs");require("react");require("react-dom");const s=".sc-play-icon-h{display:flex}",o=s,t=class{constructor(i){e.registerInstance(this,i),this.width="15",this.height="15"}render(){return e.h("svg",{key:"09672d0e495dea5c057e0459bbaf09e05c5f6d92",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"f2d1b1e318670f9dac0c53f4e6bfe209fb6bb073",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};t.style=o;exports.play_icon=t;
@@ -1,4 +1,4 @@
1
- import { r as s, h as t } from "./index-13a43508.js";
1
+ import { r as s, h as t } from "./index-ad112f6a.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const o = ".sc-play-icon-h{display:flex}", i = o, r = class {
package/dist/react.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-7dbf0ae7.cjs");require("react");require("react-dom");exports.AddCircleIcon=o.AddCircleIcon;exports.ArchiveIcon=o.ArchiveIcon;exports.ArrowIcon=o.ArrowIcon;exports.BoldIcon=o.BoldIcon;exports.ButtonComponent=o.ButtonComponent;exports.CalendarAgendaFillIcon=o.CalendarAgendaFillIcon;exports.CalendarAgendaIcon=o.CalendarAgendaIcon;exports.CalendarCancelIcon=o.CalendarCancelIcon;exports.CalendarCheckIcon=o.CalendarCheckIcon;exports.CalendarIcon=o.CalendarIcon;exports.CalendarInfoIcon=o.CalendarInfoIcon;exports.CalendarPatternsIcon=o.CalendarPatternsIcon;exports.CheckboxComponent=o.CheckboxComponent;exports.CheckmarkCircleIcon=o.CheckmarkCircleIcon;exports.CheckmarkIcon=o.CheckmarkIcon;exports.ChevronIcon=o.ChevronIcon;exports.ClockIcon=o.ClockIcon;exports.CloseIcon=o.CloseIcon;exports.CopyIcon=o.CopyIcon;exports.DeleteIcon=o.DeleteIcon;exports.DocumentRefreshIcon=o.DocumentRefreshIcon;exports.DragableIcon=o.DragableIcon;exports.EditIcon=o.EditIcon;exports.EnvelopeFillIcon=o.EnvelopeFillIcon;exports.EnvelopeIcon=o.EnvelopeIcon;exports.EyeIcon=o.EyeIcon;exports.FeedbackIcon=o.FeedbackIcon;exports.FlowIcon=o.FlowIcon;exports.FolderIcon=o.FolderIcon;exports.ForwardIcon=o.ForwardIcon;exports.GlobeIcon=o.GlobeIcon;exports.GoogleLogoIcon=o.GoogleLogoIcon;exports.GoogleMeetIcon=o.GoogleMeetIcon;exports.InboxIcon=o.InboxIcon;exports.InfoIcon=o.InfoIcon;exports.InputColorPicker=o.InputColorPicker;exports.InputComponent=o.InputComponent;exports.InputDropdown=o.InputDropdown;exports.InputImageUrl=o.InputImageUrl;exports.ItalicIcon=o.ItalicIcon;exports.LoadingIcon=o.LoadingIcon;exports.LocationIcon=o.LocationIcon;exports.LocationOffIcon=o.LocationOffIcon;exports.MicrosoftLogoIcon=o.MicrosoftLogoIcon;exports.MicrosoftTeamsIcon=o.MicrosoftTeamsIcon;exports.MultiSelectDropdown=o.MultiSelectDropdown;exports.NylasAdditionalParticipants=o.NylasAdditionalParticipants;exports.NylasAvailabilityPicker=o.NylasAvailabilityPicker;exports.NylasBookedEventCard=o.NylasBookedEventCard;exports.NylasBookingCalendarPicker=o.NylasBookingCalendarPicker;exports.NylasBookingConfirmationRedirect=o.NylasBookingConfirmationRedirect;exports.NylasBookingConfirmationType=o.NylasBookingConfirmationType;exports.NylasBookingForm=o.NylasBookingForm;exports.NylasBookingFormConfig=o.NylasBookingFormConfig;exports.NylasBufferTime=o.NylasBufferTime;exports.NylasCalendarPicker=o.NylasCalendarPicker;exports.NylasCancelBookingForm=o.NylasCancelBookingForm;exports.NylasCancellationPolicy=o.NylasCancellationPolicy;exports.NylasCancelledEventCard=o.NylasCancelledEventCard;exports.NylasConfirmationEmail=o.NylasConfirmationEmail;exports.NylasConfirmedEventCard=o.NylasConfirmedEventCard;exports.NylasConnectedCalendars=o.NylasConnectedCalendars;exports.NylasCustomBookingFlow=o.NylasCustomBookingFlow;exports.NylasCustomEventSlug=o.NylasCustomEventSlug;exports.NylasCustomizeBookingSettings=o.NylasCustomizeBookingSettings;exports.NylasDatePicker=o.NylasDatePicker;exports.NylasEditorTabs=o.NylasEditorTabs;exports.NylasEventDescription=o.NylasEventDescription;exports.NylasEventDuration=o.NylasEventDuration;exports.NylasEventInfo=o.NylasEventInfo;exports.NylasEventLimits=o.NylasEventLimits;exports.NylasEventLocation=o.NylasEventLocation;exports.NylasEventTitle=o.NylasEventTitle;exports.NylasFeedbackForm=o.NylasFeedbackForm;exports.NylasFormCard=o.NylasFormCard;exports.NylasIdentityRequestWrapper=o.NylasIdentityRequestWrapper;exports.NylasIfState=o.NylasIfState;exports.NylasLimitFutureBookings=o.NylasLimitFutureBookings;exports.NylasListConfigurations=o.NylasListConfigurations;exports.NylasLocaleSwitch=o.NylasLocaleSwitch;exports.NylasLogin=o.NylasLogin;exports.NylasLogo=o.NylasLogo;exports.NylasMinBookingNotice=o.NylasMinBookingNotice;exports.NylasMinCancellationNotice=o.NylasMinCancellationNotice;exports.NylasNotification=o.NylasNotification;exports.NylasOrganizerConfirmationCard=o.NylasOrganizerConfirmationCard;exports.NylasPageName=o.NylasPageName;exports.NylasPageStyling=o.NylasPageStyling;exports.NylasParticipantBookingCalendars=o.NylasParticipantBookingCalendars;exports.NylasParticipantsCustomAvailability=o.NylasParticipantsCustomAvailability;exports.NylasProvider=o.NylasProvider;exports.NylasReminderEmails=o.NylasReminderEmails;exports.NylasReminderTime=o.NylasReminderTime;exports.NylasSchedulerEditor=o.NylasSchedulerEditor;exports.NylasScheduling=o.NylasScheduling;exports.NylasSchedulingMethod=o.NylasSchedulingMethod;exports.NylasSelectedEventCard=o.NylasSelectedEventCard;exports.NylasTimeWindowPicker=o.NylasTimeWindowPicker;exports.NylasTimeslotInterval=o.NylasTimeslotInterval;exports.NylasTimeslotPicker=o.NylasTimeslotPicker;exports.PaintbrushFillIcon=o.PaintbrushFillIcon;exports.PaintbrushIcon=o.PaintbrushIcon;exports.PeopleIcon=o.PeopleIcon;exports.PersonClipboardIcon=o.PersonClipboardIcon;exports.PersonIcon=o.PersonIcon;exports.PlayIcon=o.PlayIcon;exports.PlusIcon=o.PlusIcon;exports.RadioButtonGroup=o.RadioButtonGroup;exports.RefreshIcon=o.RefreshIcon;exports.ReplyAllIcon=o.ReplyAllIcon;exports.ReplyIcon=o.ReplyIcon;exports.SearchIcon=o.SearchIcon;exports.SelectDropdown=o.SelectDropdown;exports.SentIcon=o.SentIcon;exports.SpamIcon=o.SpamIcon;exports.StarIcon=o.StarIcon;exports.StopIcon=o.StopIcon;exports.TextareaComponent=o.TextareaComponent;exports.TimePeriodSelector=o.TimePeriodSelector;exports.ToggleSwitch=o.ToggleSwitch;exports.TooltipComponent=o.TooltipComponent;exports.TranslateIcon=o.TranslateIcon;exports.TrashFillIcon=o.TrashFillIcon;exports.TrashIcon=o.TrashIcon;exports.UnderlineIcon=o.UnderlineIcon;exports.WarningIcon=o.WarningIcon;exports.ZoomIcon=o.ZoomIcon;exports.applyPolyfills=o.applyPolyfills;exports.defineCustomElements=o.defineCustomElements;exports.setNonce=o.setNonce;exports.useNylasMailboxElement=o.useNylasMailboxElement;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-bbbc79ad.cjs");require("react");require("react-dom");exports.AddCircleIcon=o.AddCircleIcon;exports.ArchiveIcon=o.ArchiveIcon;exports.ArrowIcon=o.ArrowIcon;exports.BoldIcon=o.BoldIcon;exports.ButtonComponent=o.ButtonComponent;exports.CalendarAgendaFillIcon=o.CalendarAgendaFillIcon;exports.CalendarAgendaIcon=o.CalendarAgendaIcon;exports.CalendarCancelIcon=o.CalendarCancelIcon;exports.CalendarCheckIcon=o.CalendarCheckIcon;exports.CalendarIcon=o.CalendarIcon;exports.CalendarInfoIcon=o.CalendarInfoIcon;exports.CalendarPatternsIcon=o.CalendarPatternsIcon;exports.CheckboxComponent=o.CheckboxComponent;exports.CheckmarkCircleIcon=o.CheckmarkCircleIcon;exports.CheckmarkIcon=o.CheckmarkIcon;exports.ChevronIcon=o.ChevronIcon;exports.ClockIcon=o.ClockIcon;exports.CloseIcon=o.CloseIcon;exports.CopyIcon=o.CopyIcon;exports.DeleteIcon=o.DeleteIcon;exports.DocumentRefreshIcon=o.DocumentRefreshIcon;exports.DragableIcon=o.DragableIcon;exports.EditIcon=o.EditIcon;exports.EnvelopeFillIcon=o.EnvelopeFillIcon;exports.EnvelopeIcon=o.EnvelopeIcon;exports.EyeIcon=o.EyeIcon;exports.FeedbackIcon=o.FeedbackIcon;exports.FlowIcon=o.FlowIcon;exports.FolderIcon=o.FolderIcon;exports.ForwardIcon=o.ForwardIcon;exports.GlobeIcon=o.GlobeIcon;exports.GoogleLogoIcon=o.GoogleLogoIcon;exports.GoogleMeetIcon=o.GoogleMeetIcon;exports.InboxIcon=o.InboxIcon;exports.InfoIcon=o.InfoIcon;exports.InputColorPicker=o.InputColorPicker;exports.InputComponent=o.InputComponent;exports.InputDropdown=o.InputDropdown;exports.InputImageUrl=o.InputImageUrl;exports.ItalicIcon=o.ItalicIcon;exports.LoadingIcon=o.LoadingIcon;exports.LocationIcon=o.LocationIcon;exports.LocationOffIcon=o.LocationOffIcon;exports.MicrosoftLogoIcon=o.MicrosoftLogoIcon;exports.MicrosoftTeamsIcon=o.MicrosoftTeamsIcon;exports.MultiSelectDropdown=o.MultiSelectDropdown;exports.NylasAdditionalParticipants=o.NylasAdditionalParticipants;exports.NylasAvailabilityPicker=o.NylasAvailabilityPicker;exports.NylasBookedEventCard=o.NylasBookedEventCard;exports.NylasBookingCalendarPicker=o.NylasBookingCalendarPicker;exports.NylasBookingConfirmationRedirect=o.NylasBookingConfirmationRedirect;exports.NylasBookingConfirmationType=o.NylasBookingConfirmationType;exports.NylasBookingForm=o.NylasBookingForm;exports.NylasBookingFormConfig=o.NylasBookingFormConfig;exports.NylasBufferTime=o.NylasBufferTime;exports.NylasCalendarPicker=o.NylasCalendarPicker;exports.NylasCancelBookingForm=o.NylasCancelBookingForm;exports.NylasCancellationPolicy=o.NylasCancellationPolicy;exports.NylasCancelledEventCard=o.NylasCancelledEventCard;exports.NylasConfirmationEmail=o.NylasConfirmationEmail;exports.NylasConfirmedEventCard=o.NylasConfirmedEventCard;exports.NylasConnectedCalendars=o.NylasConnectedCalendars;exports.NylasCustomBookingFlow=o.NylasCustomBookingFlow;exports.NylasCustomEventSlug=o.NylasCustomEventSlug;exports.NylasCustomizeBookingSettings=o.NylasCustomizeBookingSettings;exports.NylasDateComponent=o.NylasDateComponent;exports.NylasDatePicker=o.NylasDatePicker;exports.NylasEditorTabs=o.NylasEditorTabs;exports.NylasEventDescription=o.NylasEventDescription;exports.NylasEventDuration=o.NylasEventDuration;exports.NylasEventInfo=o.NylasEventInfo;exports.NylasEventLimits=o.NylasEventLimits;exports.NylasEventLocation=o.NylasEventLocation;exports.NylasEventTitle=o.NylasEventTitle;exports.NylasFeedbackForm=o.NylasFeedbackForm;exports.NylasFormCard=o.NylasFormCard;exports.NylasIdentityRequestWrapper=o.NylasIdentityRequestWrapper;exports.NylasIfState=o.NylasIfState;exports.NylasLimitFutureBookings=o.NylasLimitFutureBookings;exports.NylasListConfigurations=o.NylasListConfigurations;exports.NylasLocaleSwitch=o.NylasLocaleSwitch;exports.NylasLogin=o.NylasLogin;exports.NylasLogo=o.NylasLogo;exports.NylasMinBookingNotice=o.NylasMinBookingNotice;exports.NylasMinCancellationNotice=o.NylasMinCancellationNotice;exports.NylasNotification=o.NylasNotification;exports.NylasOrganizerConfirmationCard=o.NylasOrganizerConfirmationCard;exports.NylasPageName=o.NylasPageName;exports.NylasPageStyling=o.NylasPageStyling;exports.NylasParticipantBookingCalendars=o.NylasParticipantBookingCalendars;exports.NylasParticipantsCustomAvailability=o.NylasParticipantsCustomAvailability;exports.NylasProvider=o.NylasProvider;exports.NylasReminderEmails=o.NylasReminderEmails;exports.NylasReminderTime=o.NylasReminderTime;exports.NylasSchedulerEditor=o.NylasSchedulerEditor;exports.NylasScheduling=o.NylasScheduling;exports.NylasSchedulingMethod=o.NylasSchedulingMethod;exports.NylasSelectedEventCard=o.NylasSelectedEventCard;exports.NylasTimeWindowPicker=o.NylasTimeWindowPicker;exports.NylasTimeslotInterval=o.NylasTimeslotInterval;exports.NylasTimeslotPicker=o.NylasTimeslotPicker;exports.PaintbrushFillIcon=o.PaintbrushFillIcon;exports.PaintbrushIcon=o.PaintbrushIcon;exports.PeopleIcon=o.PeopleIcon;exports.PersonClipboardIcon=o.PersonClipboardIcon;exports.PersonIcon=o.PersonIcon;exports.PlayIcon=o.PlayIcon;exports.PlusIcon=o.PlusIcon;exports.RadioButtonGroup=o.RadioButtonGroup;exports.RefreshIcon=o.RefreshIcon;exports.ReplyAllIcon=o.ReplyAllIcon;exports.ReplyIcon=o.ReplyIcon;exports.SearchIcon=o.SearchIcon;exports.SelectDropdown=o.SelectDropdown;exports.SentIcon=o.SentIcon;exports.SpamIcon=o.SpamIcon;exports.StarIcon=o.StarIcon;exports.StopIcon=o.StopIcon;exports.TextareaComponent=o.TextareaComponent;exports.TimePeriodSelector=o.TimePeriodSelector;exports.ToggleSwitch=o.ToggleSwitch;exports.TooltipComponent=o.TooltipComponent;exports.TranslateIcon=o.TranslateIcon;exports.TrashFillIcon=o.TrashFillIcon;exports.TrashIcon=o.TrashIcon;exports.UnderlineIcon=o.UnderlineIcon;exports.WarningIcon=o.WarningIcon;exports.ZoomIcon=o.ZoomIcon;exports.applyPolyfills=o.applyPolyfills;exports.defineCustomElements=o.defineCustomElements;exports.setNonce=o.setNonce;exports.useNylasMailboxElement=o.useNylasMailboxElement;