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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/add-circle-icon_21.entry-125b87a0.js +1719 -0
  2. package/dist/add-circle-icon_21.entry-1a699a29.cjs +1 -0
  3. package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-70efea56.js} +19 -19
  4. package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-a69d3d98.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-0a07d7cc.cjs} +1 -1
  6. package/dist/{arrow-icon.entry-8b2e96a6.js → arrow-icon.entry-c9230436.js} +2 -2
  7. package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-54ff7799.js} +4 -4
  8. package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-f7df4331.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-71cc68e2.cjs} +1 -1
  10. package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-e5157332.js} +5 -5
  11. package/dist/calendar-check-icon_2.entry-f02bf0fe.cjs +1 -0
  12. package/dist/calendar-check-icon_2.entry-f75ef95e.js +25 -0
  13. package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-67aa69f5.js} +5 -5
  14. package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-a164e957.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-7687ca7a.cjs +1 -0
  16. package/dist/chevron-icon_3.entry-81c68946.js +117 -0
  17. package/dist/close-icon.entry-147b4d47.cjs +1 -0
  18. package/dist/close-icon.entry-3325a08e.js +15 -0
  19. package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-f34b9c6e-21ac1910.js} +1665 -2374
  20. package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-f34b9c6e-99030371.cjs} +6 -6
  21. package/dist/{document-refresh-icon.entry-9083a2e9.js → document-refresh-icon.entry-1b076630.js} +5 -5
  22. package/dist/document-refresh-icon.entry-dea23e07.cjs +1 -0
  23. package/dist/elements/index.d.ts +32 -2
  24. package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-83c23e9b.cjs} +1 -1
  25. package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-c69d1f8a.js} +1 -1
  26. package/dist/focus-visible-e8093c16-3082af2c.cjs +1 -0
  27. package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-a6aff071.js} +5 -3
  28. package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-55fce1ca.js} +83 -85
  29. package/dist/forward-icon_6.entry-59c7a975.cjs +3 -0
  30. package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-25145785.js} +4 -4
  31. package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-904f180f.cjs} +1 -1
  32. package/dist/google-logo-icon_4.entry-1f7b9522.js +387 -0
  33. package/dist/google-logo-icon_4.entry-feb7a561.cjs +1 -0
  34. package/dist/index-5f0940e0.cjs +37 -0
  35. package/dist/index-fd39ea9d.js +4042 -0
  36. package/dist/index.d.ts +3 -1
  37. package/dist/index.es-be19d2df-9ba9a7a6.cjs +7 -0
  38. package/dist/{index-b30d446a-a90f84b2.js → index.es-be19d2df-ff4f0a10.js} +945 -1041
  39. package/dist/info-icon_2.entry-0e2105da.js +34 -0
  40. package/dist/info-icon_2.entry-808e6516.cjs +1 -0
  41. package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-17efa7ca.cjs} +1 -1
  42. package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-a3b845bf.js} +2 -2
  43. package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-76540d24-5f0d1dff.js} +2 -2
  44. package/dist/mailbox-store-76540d24-ad0e366a.cjs +1 -0
  45. package/dist/nylas-additional-participants.entry-4120ea2e.js +81 -0
  46. package/dist/nylas-additional-participants.entry-7e2446cb.cjs +1 -0
  47. package/dist/nylas-booked-event-card_10.entry-44812e35.cjs +1 -0
  48. package/dist/nylas-booked-event-card_10.entry-5e87b199.js +805 -0
  49. package/dist/nylas-custom-booking-flow.entry-cbff44c8.js +106 -0
  50. package/dist/nylas-custom-booking-flow.entry-da5e66bb.cjs +1 -0
  51. package/dist/nylas-form-card.entry-1c608edd.js +54 -0
  52. package/dist/nylas-form-card.entry-2e629e36.cjs +1 -0
  53. package/dist/nylas-if-state.entry-2c0d8724.js +94 -0
  54. package/dist/nylas-if-state.entry-61771f3d.cjs +1 -0
  55. package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-d6e085b0.js} +10 -11
  56. package/dist/nylas-list-folders.entry-fa8e8ce9.cjs +1 -0
  57. package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-4dd2de0a.js} +5 -6
  58. package/dist/nylas-list-threads.entry-99fc0baa.cjs +1 -0
  59. package/dist/nylas-login.entry-0ec0813c.cjs +1 -0
  60. package/dist/nylas-login.entry-6730e226.js +73 -0
  61. package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-5310880c.js} +7 -8
  62. package/dist/nylas-mailbox-pagination.entry-e3e52f42.cjs +1 -0
  63. package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-028075db.js} +15 -16
  64. package/dist/nylas-mailbox-toolbar-button.entry-4c377337.cjs +1 -0
  65. package/dist/nylas-mailbox.entry-87304850.cjs +1 -0
  66. package/dist/nylas-mailbox.entry-ab92780c.js +134 -0
  67. package/dist/nylas-provider.entry-3fb60fe4.cjs +1 -0
  68. package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-678a9fe7.js} +40 -29
  69. package/dist/nylas-scheduler-editor.entry-a0de0ae6.js +2269 -0
  70. package/dist/nylas-scheduler-editor.entry-cf19391e.cjs +7 -0
  71. package/dist/nylas-scheduling.entry-d8bb2648.cjs +1 -0
  72. package/dist/nylas-scheduling.entry-e38c3870.js +248 -0
  73. package/dist/nylas-threads-refresh.entry-79c8a061.cjs +1 -0
  74. package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-fcb2175f.js} +4 -5
  75. package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7565bdf8.js} +4 -5
  76. package/dist/nylas-threads-search.entry-f2d5d0fb.cjs +1 -0
  77. package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-1772e0c4.js} +10 -11
  78. package/dist/nylas-view-thread.entry-6a2ccece.cjs +1 -0
  79. package/dist/people-icon.entry-3218a267.cjs +1 -0
  80. package/dist/people-icon.entry-bc2c70cf.js +15 -0
  81. package/dist/play-icon_2.entry-450a7fa6.cjs +1 -0
  82. package/dist/play-icon_2.entry-b4dc4e6d.js +25 -0
  83. package/dist/react.cjs +1 -1
  84. package/dist/react.js +94 -62
  85. package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-030dda82.cjs} +1 -1
  86. package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-d30c7264.js} +5 -5
  87. package/dist/register-component-83e24412-0b25de7f.cjs +1 -0
  88. package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-83e24412-35c484c4.js} +37 -33
  89. package/dist/scheduler-config-store-ec3b6190-6d8cef0f.cjs +1 -0
  90. package/dist/scheduler-config-store-ec3b6190-d5edbae5.js +23 -0
  91. package/dist/scheduler-store-8ca9003d-38cca5ba.js +321 -0
  92. package/dist/scheduler-store-8ca9003d-c2aa3522.cjs +1 -0
  93. package/dist/time-period-selector.entry-b366ba86.js +76 -0
  94. package/dist/time-period-selector.entry-b3d04e93.cjs +1 -0
  95. package/dist/translate-icon.entry-03ab2513.cjs +1 -0
  96. package/dist/translate-icon.entry-b3c21ae9.js +15 -0
  97. package/dist/warning-icon.entry-602d459b.js +15 -0
  98. package/dist/warning-icon.entry-65ecfdf0.cjs +1 -0
  99. package/package.json +7 -4
  100. package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
  101. package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
  102. package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
  103. package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
  104. package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
  105. package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
  106. package/dist/chevron-icon.entry-58366662.cjs +0 -1
  107. package/dist/chevron-icon.entry-5e11cef5.js +0 -15
  108. package/dist/close-icon_2.entry-011d9cf4.js +0 -25
  109. package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
  110. package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
  111. package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
  112. package/dist/duration-bddc4a13-179ce826.js +0 -41
  113. package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
  114. package/dist/forward-icon_6.entry-3345af84.cjs +0 -3
  115. package/dist/index-3b6f5cd5.cjs +0 -30
  116. package/dist/index-630f4e87.js +0 -1498
  117. package/dist/index-b30d446a-cbbef925.cjs +0 -7
  118. package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
  119. package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
  120. package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
  121. package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
  122. package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
  123. package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
  124. package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
  125. package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
  126. package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
  127. package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
  128. package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
  129. package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
  130. package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
  131. package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
  132. package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
  133. package/dist/play-icon_2.entry-ed5877e3.js +0 -25
  134. package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
  135. package/dist/register-component-152c6ad2-0df7215b.cjs +0 -1
  136. package/dist/scheduler-store-7d48e682-0c0c3991.js +0 -289
  137. package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
  138. package/dist/search-icon_3.entry-292138c3.js +0 -101
  139. package/dist/search-icon_3.entry-8e555357.cjs +0 -1
  140. package/dist/utils-5074a070-ce33ee6b.js +0 -119
  141. package/dist/utils-5074a070-d5ba6add.cjs +0 -2
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-5f0940e0.cjs"),bn=require("./register-component-83e24412-0b25de7f.cjs");require("react");require("react-dom");const yn=".sc-forward-icon-h{display:flex}",En=yn,St=class{constructor(t){o.registerInstance(this,t),this.width="15",this.height="15"}render(){return o.h("svg",{key:"c3c406f225989a53006d7deef67a2dd8dd3d5d81",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},o.h("path",{key:"be9eae8233d00a07dd1501d7daf45f51d6049908",d:"m1246.246 64-90.496 90.496 477.952 477.952h-590.848C467.878 632.448.038 1100.416.038 1675.392v109.056h128v-109.056c0-504.576 410.368-914.944 914.816-914.944h590.848l-477.952 478.08 90.496 90.496 632.448-632.576L1246.246 64Z","fill-rule":"evenodd"}))}};St.style=En;const Tn=':host{display:grid;color:var(--nylas-color-primary-900)}.editor{position:relative;display:block;max-height:300px;overflow:auto;padding:1rem;border:1px solid var(--nylas-color-primary-300)}.editor blockquote{visibility:hidden;overflow:hidden;position:relative;transition:height 0.3s ease;margin:0}.editor blockquote::before{content:"...";visibility:visible;opacity:1;position:absolute;top:0;left:0;background-color:var(--nylas-color-primary-300);width:20px;text-align:center;color:var(--nylas-color-primary-800);vertical-align:middle;display:flex;justify-content:center;align-items:center;align-self:center;cursor:pointer}.editor .collapsed{height:20px}.editor .expanded{visibility:visible;opacity:1;height:auto;margin:0px 0px 0px 0.8ex;border-left:1px solid var(--nylas-color-primary-300);padding-left:1rem}.editor .expanded::before{display:none;}.buttons{display:flex;margin-top:1rem;justify-content:space-between}.buttons sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}.buttons sp-button:hover{background-color:var(--nylas-color-primary-500)}.buttons sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}.buttons sp-button chevron-icon{display:inline-block}.buttons .close{justify-self:end}.toolbar{position:absolute;display:none;background-color:var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);z-index:1}.toolbar sp-button{border:0}',An=Tn,Ct=class{constructor(t){o.registerInstance(this,t),this.close=o.createEvent(this,"close",7),this.send=o.createEvent(this,"send",7),this.closeComposer=i=>{this.close.emit(i)},this.sendComposer=i=>{var l;if(!this.editorEl){o.debug("no editor element");return}const f=this.editorEl.querySelector(".message-body");if(!f){o.debug("no message body");return}this.message&&(this.send.emit({message:this.message,replyBody:((l=f.querySelector(".message-body"))==null?void 0:l.innerHTML)||""}),this.close.emit(i),this.editorEl.innerHTML="")},this.message=void 0,this.viewEmailElement=void 0}connectedCallback(){}disconnectedCallback(){this.editorEl&&(this.editorEl.innerHTML="")}componentWillLoad(){}async componentDidLoad(){if(this.message&&this.watchBody(this.message),!this.editorEl){o.debug("[connectedCallback] no editor element");return}if(!this.toolbarEl){o.debug("[connectedCallback] no toolbar element");return}const t=this.editorEl,i=this.toolbarEl;t.addEventListener("mouseup",f=>{var B;const l=(B=this.host.shadowRoot)==null?void 0:B.getSelection();if(!l){o.debug("no selection");return}const p=l.getRangeAt(0),a=l.toString();if(!a){i.style.display="none";return}const m=t.querySelector(".message-body");if(!m){o.debug("no message body");return}const c=p.commonAncestorContainer.parentElement;if(!c)return;const E=m.getBoundingClientRect();o.debug("messageBodyRect",{messageBodyRect:E});const A=c.getBoundingClientRect();o.debug("foundRect",{foundRect:A});const le=(c.childNodes[0].textContent||"").indexOf(a),W=window.getComputedStyle(c).fontSize,j=parseInt(W.replace("px",""),10),te=A.top-E.top-i.clientHeight,be=le*(1/j)*100;i.style.top=`${te}px`,i.style.left=`${be}px`,i.style.display="block"})}watchBody(t){var a;if(!this.editorEl){o.debug("no editor element");return}this.editorEl.querySelectorAll(".message-body").forEach(m=>m.remove());const i=document.createElement("div");i.classList.add("message-body");const f=document.createElement("p");f.innerHTML="&nbsp;",i.appendChild(f);const l=document.createElement("br");i.appendChild(l);const p=document.createElement("div");if(p.classList.add("reply-text"),p.innerText=`On ${new Date(t.date*1e3).toLocaleDateString(void 0,{dateStyle:"full"})} <${(a=t.from)==null?void 0:a.map(m=>m.name||m.email).join(", ")}> wrote:`,i.appendChild(p),t.body){const m=document.createElement("html");m.innerHTML=t.body;const r=document.createElement("blockquote");r.classList.add("collapsed"),r.classList.add("gmail_quote"),r.innerHTML=m.innerHTML,i.appendChild(r),o.debug("replyContainer",{replyContainer:r})}this.editorEl.appendChild(i),this.editorEl.querySelectorAll("blockquote.collapsed").forEach(m=>{m.addEventListener("click",function(r){r.preventDefault();const c=r.target;c.classList.remove("collapsed"),c.classList.add("expanded")},{once:!0})}),this.editorEl.focus()}render(){return o.h(o.Host,{key:"8d7f9c145099757c2a8dc48f1d2a223831f82cda"},o.h("sp-theme",{key:"e92e457e86701838f55d97b3f2c1c0f70f14bf59",scale:"medium",color:"dark"},o.h("div",{key:"50eba2b6ee0c84d8eeb392385872604b74b11025",class:"editor",contentEditable:!0,ref:t=>this.editorEl=t},o.h("div",{key:"38bdd2ec58e62699e2c604b1b2c586cb5ecf105a",class:"toolbar",ref:t=>this.toolbarEl=t,contentEditable:!1},o.h("sp-button",{key:"6415e5f9910a2d9798e7c85162329f359e500aeb",quiet:!0,onClick:()=>document.execCommand("bold")},o.h("div",{key:"e03cfe0f5736836f64aa350165fa519508e212f7",slot:"icon"},o.h("bold-icon",{key:"1ad03230cff2f0843d6da22153716c3818ed04f7"})),o.h("div",{key:"d90c50aff88b9ac7774d6792b91ea3ced21f4419",slot:"label"},"Bold")),o.h("sp-button",{key:"466621fcdf2e8e1e85b613bba82b948ed2177a88",quiet:!0,onClick:()=>document.execCommand("underline")},o.h("div",{key:"6be0737cf685b02f3ee8ef7c34fd18674793af00",slot:"icon"},o.h("underline-icon",{key:"278b1b79d3aec25ab2c2181c3e5c631063b04e29"})),o.h("div",{key:"169d3039815082e208eb476b4490181f7eb54ee6",slot:"label"},"Underline")),o.h("sp-button",{key:"92c20b2d03b709f08c63af3a1e88b10e407243d7",quiet:!0,onClick:()=>document.execCommand("italic")},o.h("div",{key:"67eb3d5b5a2118d90bfb81c7b51d52c41b5ab2a2",slot:"icon"},o.h("italic-icon",{key:"35ac96f9ff3f3f0c38c7e486092f42dc9451eb63"})),o.h("div",{key:"f29fe84363cca6e178a3651a1c8e56929ebb3e32",slot:"label"},"Italic")))),o.h("div",{key:"3d89b191642ab291fc338ffd66be16fe999950b1",class:"buttons"},o.h("sp-button",{key:"f78c122acf4c69c788d411d2dcfd49649c99919e",onClick:this.sendComposer,class:"send"},"Send"),o.h("sp-button",{key:"b46873c911cb796e9af22eb7d19bf6e1cd2cd1be",onClick:this.closeComposer,class:"close"},"Close"))))}get host(){return o.getElement(this)}static get watchers(){return{message:["watchBody"]}}};Ct.style=An;const _n=":host{display:block}sp-button{padding:0;border:0;border-radius:var(--nylas-border-radius);min-block-size:50%;min-inline-size:2rem;background-color:var(--nylas-color-primary-300);fill:var(--nylas-color-primary-800)}sp-button:hover{background-color:var(--nylas-color-primary-400)}.summarize-button.stopped{animation:none}.summarize-button.playing{animation:pulse 2s infinite}.summarize-button.loading{display:flex;align-content:center;height:1.5rem;width:2rem;vertical-align:middle;animation:pulse 2s infinite;flex-wrap:wrap}.summarize-button.loading loading-icon{--dot-color:var(--nylas-color-primary-600)}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 0 0 var(--nylas-color-primary-300)}70%{transform:scale(1.05);box-shadow:0 0 0 10px rgba(255, 69, 0, 0)}100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255, 69, 0, 0)}}@keyframes wave{0%{transform:translateX(0)}50%{transform:translateX(100%)}100%{transform:translateX(0)}}",wn=_n;var vn=function(t,i,f,l){var p=arguments.length,a=p<3?i:l===null?l=Object.getOwnPropertyDescriptor(i,f):l,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,i,f,l);else for(var r=t.length-1;r>=0;r--)(m=t[r])&&(a=(p<3?m(a):p>3?m(i,f,a):m(i,f))||a);return p>3&&a&&Object.defineProperty(i,f,a),a},Fe=function(t,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,i)};const Be=class{constructor(t){o.registerInstance(this,t),this.summarize=o.createEvent(this,"summarize",7),this.abortController=new AbortController,this.onClick=async i=>{var f,l;i.preventDefault(),i.stopPropagation(),this.state==="stopped"?this.message&&(this.abortController=new AbortController,this.summarize.emit({abortController:this.abortController,playAudio:this.playAudio,message:this.message,updateState:this.updateState}).defaultPrevented||(o.debug("[nylas-summarize-message-button] Default event not prevented, summarizing message"),this.audioRef&&(await this.audioRef.play().then(()=>{var a;return(a=this.audioRef)==null?void 0:a.pause()}).catch(a=>console.error("Error playing audio:",a)),await this.audioRef.play().catch(a=>console.error("Error playing audio:",a))))):this.state==="playing"?((f=this.abortController)==null||f.abort(),(l=this.audioRef)==null||l.pause()):this.state="stopped"},this.message=void 0,this.state="stopped",this.playAudio=this.playAudio.bind(this),this.updateState=this.updateState.bind(this)}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){o.debug("[nylas-summarize-message-button] Component will load")}async componentDidLoad(){o.debug("[nylas-summarize-message-button] Component did load")}async updateState(t){this.state=t}async playAudio(t){if(!this.audioRef){this.state="stopped";return}if(!t){this.state="stopped";return}const i=this.audioRef;if(!("MediaSource"in window)){const r=await t;if(r==null)throw new Error("ReadableStream not yet supported in this browser.");const c=r.getReader(),E=[];await this.readChunk(c,E);const A=new Blob(E,{type:"audio/mpeg"}),M=URL.createObjectURL(A);i.src=M;return}const f=new MediaSource;let l,p=!1;i.src=URL.createObjectURL(f),f.addEventListener("sourceopen",a);async function a(){l=f.addSourceBuffer("audio/mpeg"),l.addEventListener("updateend",m);const r=await t;if(r==null)throw new Error("ReadableStream not yet supported in this browser.");const c=r.getReader(),E=()=>{c.read().then(({done:A,value:M})=>{if(A){p=!0;return}l.updating||l.appendBuffer(M),E()}).catch(A=>{console.error("Error while fetching and appending chunks:",A)})};E(),i.paused&&i.play().catch(A=>console.error("Error playing audio:",A))}function m(){if(p){f.endOfStream(),f.removeEventListener("sourceopen",a),f.removeEventListener("sourceclose",()=>{o.debug("[nylas-summarize-message-button] Source closed")}),l.removeEventListener("updateend",m);return}}}async readChunk(t,i){return t.read().then(({done:f,value:l})=>f?i:(i.push(l),this.readChunk(t,i)))}render(){return o.h(o.Host,{key:"09d693158ce9480c000957afe31566d47f6fb5f2"},o.h("sp-theme",{key:"21f246783a3d5786c1cee8f438e89947ee5f574d",scale:"medium",color:"dark"},o.h("sp-button",{key:"7ef9c60895da162d3b521ddc7c070ff463e51094",label:"Summarize email","icon-only":!0,onClickCapture:this.onClick,class:{"summarize-button":!0,stopped:this.state==="stopped",loading:this.state==="loading",playing:this.state==="playing"}},this.state==="stopped"&&o.h("play-icon",null),this.state==="loading"&&o.h("loading-icon",null),this.state==="playing"&&o.h("stop-icon",null)),o.h("audio",{key:"7481ceeb62b6eb21c627d0e04be0e0e7a9e986ec",ref:t=>this.audioRef=t,autoPlay:!0,onPlaying:()=>this.state="playing",onPause:()=>this.state="stopped",onEnded:()=>{this.state="stopped",o.debug("[nylas-summarize-message-button] Audio ended")}})))}};vn([bn.RegisterComponent({name:"nylas-summarize-message-button",eventToProps:{summarize:async(t,i)=>{const{playAudio:f,updateState:l,abortController:p,message:a}=t.detail,m=o.htmlToPlainText(a.body||"");await l("loading");try{const r=await i.messages.summarizeText(m),c=i.messages.textToSpeech(r,p);await f(c)}catch(r){await l("stopped"),console.error("Error summarizing message:",r)}}},fireRegisterEvent:!0}),Fe("design:type",Function),Fe("design:paramtypes",[]),Fe("design:returntype",void 0)],Be.prototype,"render",null);Be.style=wn;function I(t){return!window.matchMedia("(prefers-color-scheme: dark)").matches||!t?t:t==="transparent"?"color":t.startsWith("#")?Sn(t):t.startsWith("rgb")?Lt(t):t.startsWith("hsl")?Cn(t):Ln(t)?Rn(t):t}function Sn(t){t.length<7&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const i=(255-parseInt(t.slice(1,3),16)).toString(16).padStart(2,"0"),f=(255-parseInt(t.slice(3,5),16)).toString(16).padStart(2,"0"),l=(255-parseInt(t.slice(5,7),16)).toString(16).padStart(2,"0");return`#${i}${f}${l}`}function Lt(t){var a;const i=(a=t.match(/\d+/g))==null?void 0:a.map(Number);if(!i)return t;const[f,l,p]=i;return`rgb(${255-f}, ${255-l}, ${255-p})`}function Cn(t){var a;const i=(a=t.match(/\d+\.?\d*/g))==null?void 0:a.map(Number);if(!i)return t;const[f,l,p]=i;return`hsl(${f}, ${l}%, ${100-p}%)`}function Ln(t){return/^[a-z]+$/i.test(t)}function Rn(t){return Lt(kn(t))}function kn(t){return t.toLowerCase()==="red"?"rgb(255, 0, 0)":"rgb(0, 0, 0)"}function vt(t){if(t instanceof HTMLStyleElement){let i=t.textContent;if(i){i=i.replaceAll(/@media\s*\(prefers-color-scheme:\s*(dark|light)\)\s*\{([^}]+)\}/g,"");const f=i.matchAll(/border-color:\s*([^;]+)/g);if(f)for(const r of f){const[c,E]=r,A=c.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");i=i.replaceAll(A,c.replace(E,I(E)))}const l=i.matchAll(/border:\s*([^;]+)/g);if(l)for(const r of l){const c=r[0].trim(),E=c.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),[A,M,P]=r[1].split(" ");i=i.replaceAll(E,c.replace(P,I(P)))}const p=i.matchAll(/background-color:\s*([^;]+)/g);if(p)for(const r of p){const[c,E]=r,A=c.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");i=i.replaceAll(A,c.replace(E,I(E))),o.debug("backgroundColor",{fullMatch:c,replace:c.replace(E,I(E)),color:E,invertColor:I(E)})}const a=i.matchAll(/background:\s*([^;]+)/g);if(a)for(const r of a){const c=r[0].trim(),E=c.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),[A,M,P]=r[1].split(" ");i=i.replaceAll(E,c.replace(P,I(P)))}const m=i.matchAll(/color:\s*([^;]+)/g);if(m)for(const r of m){const[c,E]=r,A=c.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");i=i.replaceAll(A,c.replace(E,I(E)))}t.textContent=i}}if(t instanceof HTMLElement){const i=window.getComputedStyle(t),f=i.color||t.style.color,l=i.backgroundColor||t.style.backgroundColor,p=i.borderColor||t.style.borderColor;f&&!l?t.style.color="":f&&l?(t.style.color=I(f),t.style.backgroundColor=I(l),o.debug("element",t),o.debug("computedStyle.color",f),o.debug("computedStyle.backgroundColor",l),o.debug("invertColor(color)",I(f)),o.debug("invertColor(backgroundColor)",I(l))):!f&&l&&(t.style.backgroundColor=""),p&&(o.debug("borderColor",p),t.style.borderColor=I(p)),t.hasAttribute("bgcolor")&&t.removeAttribute("bgcolor")}}function Mn(t){vt(t),t.querySelectorAll("*").forEach(f=>vt(f))}var Rt={exports:{}};/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */(function(t,i){(function(f,l){t.exports=l()})(o.commonjsGlobal,function(){const{entries:f,setPrototypeOf:l,isFrozen:p,getPrototypeOf:a,getOwnPropertyDescriptor:m}=Object;let{freeze:r,seal:c,create:E}=Object,{apply:A,construct:M}=typeof Reflect<"u"&&Reflect;r||(r=function(d){return d}),c||(c=function(d){return d}),A||(A=function(d,y,g){return d.apply(y,g)}),M||(M=function(d,y){return new d(...y)});const P=O(Array.prototype.forEach),le=O(Array.prototype.pop),W=O(Array.prototype.push),j=O(String.prototype.toLowerCase),te=O(String.prototype.toString),be=O(String.prototype.match),B=O(String.prototype.replace),xt=O(String.prototype.indexOf),Dt=O(String.prototype.trim),D=O(RegExp.prototype.test),ne=Ot(TypeError);function O(b){return function(d){for(var y=arguments.length,g=new Array(y>1?y-1:0),R=1;R<y;R++)g[R-1]=arguments[R];return A(b,d,g)}}function Ot(b){return function(){for(var d=arguments.length,y=new Array(d),g=0;g<d;g++)y[g]=arguments[g];return M(b,y)}}function h(b,d){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j;l&&l(b,null);let g=d.length;for(;g--;){let R=d[g];if(typeof R=="string"){const z=y(R);z!==R&&(p(d)||(d[g]=z),R=z)}b[R]=!0}return b}function It(b){for(let d=0;d<b.length;d++)m(b,d)===void 0&&(b[d]=null);return b}function G(b){const d=E(null);for(const[y,g]of f(b))m(b,y)!==void 0&&(Array.isArray(g)?d[y]=It(g):g&&typeof g=="object"&&g.constructor===Object?d[y]=G(g):d[y]=g);return d}function ce(b,d){for(;b!==null;){const g=m(b,d);if(g){if(g.get)return O(g.get);if(typeof g.value=="function")return O(g.value)}b=a(b)}function y(g){return console.warn("fallback value for",g),null}return y}const We=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ye=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ee=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Pt=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Te=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ut=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ge=r(["#text"]),qe=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Ae=r(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$e=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),de=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zt=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ft=c(/<%[\w\W]*|[\w\W]*%>/gm),Ht=c(/\${[\w\W]*}/gm),Bt=c(/^data-[\-\w.\u00B7-\uFFFF]/),Wt=c(/^aria-[\-\w]+$/),Ye=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gt=c(/^(?:\w+script|data):/i),qt=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),je=c(/^html$/i);var Xe=Object.freeze({__proto__:null,MUSTACHE_EXPR:zt,ERB_EXPR:Ft,TMPLIT_EXPR:Ht,DATA_ATTR:Bt,ARIA_ATTR:Wt,IS_ALLOWED_URI:Ye,IS_SCRIPT_OR_DATA:Gt,ATTR_WHITESPACE:qt,DOCTYPE_NAME:je});const $t=function(){return typeof window>"u"?null:window},Yt=function(d,y){if(typeof d!="object"||typeof d.createPolicy!="function")return null;let g=null;const R="data-tt-policy-suffix";y&&y.hasAttribute(R)&&(g=y.getAttribute(R));const z="dompurify"+(g?"#"+g:"");try{return d.createPolicy(z,{createHTML(X){return X},createScriptURL(X){return X}})}catch{return console.warn("TrustedTypes policy "+z+" could not be created."),null}};function Ve(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t();const d=u=>Ve(u);if(d.version="3.0.8",d.removed=[],!b||!b.document||b.document.nodeType!==9)return d.isSupported=!1,d;let{document:y}=b;const g=y,R=g.currentScript,{DocumentFragment:z,HTMLTemplateElement:X,Node:_e,Element:Ze,NodeFilter:we,NamedNodeMap:Xt=b.NamedNodeMap||b.MozNamedAttrMap,HTMLFormElement:Vt,DOMParser:Zt,trustedTypes:ue}=b,fe=Ze.prototype,Kt=ce(fe,"cloneNode"),Qt=ce(fe,"nextSibling"),Jt=ce(fe,"childNodes"),ve=ce(fe,"parentNode");if(typeof X=="function"){const u=y.createElement("template");u.content&&u.content.ownerDocument&&(y=u.content.ownerDocument)}let k,oe="";const{implementation:Se,createNodeIterator:en,createDocumentFragment:tn,getElementsByTagName:nn}=y,{importNode:on}=g;let U={};d.isSupported=typeof f=="function"&&typeof ve=="function"&&Se&&Se.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ce,ERB_EXPR:Le,TMPLIT_EXPR:Re,DATA_ATTR:rn,ARIA_ATTR:an,IS_SCRIPT_OR_DATA:sn,ATTR_WHITESPACE:Ke}=Xe;let{IS_ALLOWED_URI:Qe}=Xe,w=null;const Je=h({},[...We,...ye,...Ee,...Te,...Ge]);let v=null;const et=h({},[...qe,...Ae,...$e,...de]);let _=Object.seal(E(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,ke=null,tt=!0,Me=!0,nt=!1,ot=!0,V=!1,q=!1,Ne=!1,xe=!1,Z=!1,me=!1,pe=!1,it=!0,rt=!1;const ln="user-content-";let De=!0,re=!1,K={},Q=null;const at=h({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let st=null;const lt=h({},["audio","video","img","source","image","track"]);let Oe=null;const ct=h({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",F="http://www.w3.org/1999/xhtml";let J=F,Ie=!1,Pe=null;const cn=h({},[he,ge,F],te);let ae=null;const dn=["application/xhtml+xml","text/html"],un="text/html";let S=null,ee=null;const fn=y.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},Ue=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ee&&ee===e)){if((!e||typeof e!="object")&&(e={}),e=G(e),ae=dn.indexOf(e.PARSER_MEDIA_TYPE)===-1?un:e.PARSER_MEDIA_TYPE,S=ae==="application/xhtml+xml"?te:j,w="ALLOWED_TAGS"in e?h({},e.ALLOWED_TAGS,S):Je,v="ALLOWED_ATTR"in e?h({},e.ALLOWED_ATTR,S):et,Pe="ALLOWED_NAMESPACES"in e?h({},e.ALLOWED_NAMESPACES,te):cn,Oe="ADD_URI_SAFE_ATTR"in e?h(G(ct),e.ADD_URI_SAFE_ATTR,S):ct,st="ADD_DATA_URI_TAGS"in e?h(G(lt),e.ADD_DATA_URI_TAGS,S):lt,Q="FORBID_CONTENTS"in e?h({},e.FORBID_CONTENTS,S):at,ie="FORBID_TAGS"in e?h({},e.FORBID_TAGS,S):{},ke="FORBID_ATTR"in e?h({},e.FORBID_ATTR,S):{},K="USE_PROFILES"in e?e.USE_PROFILES:!1,tt=e.ALLOW_ARIA_ATTR!==!1,Me=e.ALLOW_DATA_ATTR!==!1,nt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ot=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=e.SAFE_FOR_TEMPLATES||!1,q=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,me=e.RETURN_DOM_FRAGMENT||!1,pe=e.RETURN_TRUSTED_TYPE||!1,xe=e.FORCE_BODY||!1,it=e.SANITIZE_DOM!==!1,rt=e.SANITIZE_NAMED_PROPS||!1,De=e.KEEP_CONTENT!==!1,re=e.IN_PLACE||!1,Qe=e.ALLOWED_URI_REGEXP||Ye,J=e.NAMESPACE||F,_=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(_.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),V&&(Me=!1),me&&(Z=!0),K&&(w=h({},Ge),v=[],K.html===!0&&(h(w,We),h(v,qe)),K.svg===!0&&(h(w,ye),h(v,Ae),h(v,de)),K.svgFilters===!0&&(h(w,Ee),h(v,Ae),h(v,de)),K.mathMl===!0&&(h(w,Te),h(v,$e),h(v,de))),e.ADD_TAGS&&(w===Je&&(w=G(w)),h(w,e.ADD_TAGS,S)),e.ADD_ATTR&&(v===et&&(v=G(v)),h(v,e.ADD_ATTR,S)),e.ADD_URI_SAFE_ATTR&&h(Oe,e.ADD_URI_SAFE_ATTR,S),e.FORBID_CONTENTS&&(Q===at&&(Q=G(Q)),h(Q,e.FORBID_CONTENTS,S)),De&&(w["#text"]=!0),q&&h(w,["html","head","body"]),w.table&&(h(w,["tbody"]),delete ie.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=e.TRUSTED_TYPES_POLICY,oe=k.createHTML("")}else k===void 0&&(k=Yt(ue,R)),k!==null&&typeof oe=="string"&&(oe=k.createHTML(""));r&&r(e),ee=e}},ut=h({},["mi","mo","mn","ms","mtext"]),ft=h({},["foreignobject","desc","title","annotation-xml"]),mn=h({},["title","style","font","a","script"]),mt=h({},[...ye,...Ee,...Pt]),pt=h({},[...Te,...Ut]),pn=function(e){let n=ve(e);(!n||!n.tagName)&&(n={namespaceURI:J,tagName:"template"});const s=j(e.tagName),T=j(n.tagName);return Pe[e.namespaceURI]?e.namespaceURI===ge?n.namespaceURI===F?s==="svg":n.namespaceURI===he?s==="svg"&&(T==="annotation-xml"||ut[T]):!!mt[s]:e.namespaceURI===he?n.namespaceURI===F?s==="math":n.namespaceURI===ge?s==="math"&&ft[T]:!!pt[s]:e.namespaceURI===F?n.namespaceURI===ge&&!ft[T]||n.namespaceURI===he&&!ut[T]?!1:!pt[s]&&(mn[s]||!mt[s]):!!(ae==="application/xhtml+xml"&&Pe[e.namespaceURI]):!1},$=function(e){W(d.removed,{element:e});try{e.parentNode.removeChild(e)}catch{e.remove()}},ze=function(e,n){try{W(d.removed,{attribute:n.getAttributeNode(e),from:n})}catch{W(d.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e==="is"&&!v[e])if(Z||me)try{$(n)}catch{}else try{n.setAttribute(e,"")}catch{}},ht=function(e){let n=null,s=null;if(xe)e="<remove></remove>"+e;else{const L=be(e,/^[\r\n\t ]+/);s=L&&L[0]}ae==="application/xhtml+xml"&&J===F&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const T=k?k.createHTML(e):e;if(J===F)try{n=new Zt().parseFromString(T,ae)}catch{}if(!n||!n.documentElement){n=Se.createDocument(J,"template",null);try{n.documentElement.innerHTML=Ie?oe:T}catch{}}const C=n.body||n.documentElement;return e&&s&&C.insertBefore(y.createTextNode(s),C.childNodes[0]||null),J===F?nn.call(n,q?"html":"body")[0]:q?n.documentElement:C},gt=function(e){return en.call(e.ownerDocument||e,e,we.SHOW_ELEMENT|we.SHOW_COMMENT|we.SHOW_TEXT,null)},hn=function(e){return e instanceof Vt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Xt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},bt=function(e){return typeof _e=="function"&&e instanceof _e},H=function(e,n,s){U[e]&&P(U[e],T=>{T.call(d,n,s,ee)})},yt=function(e){let n=null;if(H("beforeSanitizeElements",e,null),hn(e))return $(e),!0;const s=S(e.nodeName);if(H("uponSanitizeElement",e,{tagName:s,allowedTags:w}),e.hasChildNodes()&&!bt(e.firstElementChild)&&D(/<[/\w]/g,e.innerHTML)&&D(/<[/\w]/g,e.textContent))return $(e),!0;if(!w[s]||ie[s]){if(!ie[s]&&Tt(s)&&(_.tagNameCheck instanceof RegExp&&D(_.tagNameCheck,s)||_.tagNameCheck instanceof Function&&_.tagNameCheck(s)))return!1;if(De&&!Q[s]){const T=ve(e)||e.parentNode,C=Jt(e)||e.childNodes;if(C&&T){const L=C.length;for(let N=L-1;N>=0;--N)T.insertBefore(Kt(C[N],!0),Qt(e))}}return $(e),!0}return e instanceof Ze&&!pn(e)||(s==="noscript"||s==="noembed"||s==="noframes")&&D(/<\/no(script|embed|frames)/i,e.innerHTML)?($(e),!0):(V&&e.nodeType===3&&(n=e.textContent,P([Ce,Le,Re],T=>{n=B(n,T," ")}),e.textContent!==n&&(W(d.removed,{element:e.cloneNode()}),e.textContent=n)),H("afterSanitizeElements",e,null),!1)},Et=function(e,n,s){if(it&&(n==="id"||n==="name")&&(s in y||s in fn))return!1;if(!(Me&&!ke[n]&&D(rn,n))){if(!(tt&&D(an,n))){if(!v[n]||ke[n]){if(!(Tt(e)&&(_.tagNameCheck instanceof RegExp&&D(_.tagNameCheck,e)||_.tagNameCheck instanceof Function&&_.tagNameCheck(e))&&(_.attributeNameCheck instanceof RegExp&&D(_.attributeNameCheck,n)||_.attributeNameCheck instanceof Function&&_.attributeNameCheck(n))||n==="is"&&_.allowCustomizedBuiltInElements&&(_.tagNameCheck instanceof RegExp&&D(_.tagNameCheck,s)||_.tagNameCheck instanceof Function&&_.tagNameCheck(s))))return!1}else if(!Oe[n]){if(!D(Qe,B(s,Ke,""))){if(!((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&xt(s,"data:")===0&&st[e])){if(!(nt&&!D(sn,B(s,Ke,"")))){if(s)return!1}}}}}}return!0},Tt=function(e){return e.indexOf("-")>0},At=function(e){H("beforeSanitizeAttributes",e,null);const{attributes:n}=e;if(!n)return;const s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:v};let T=n.length;for(;T--;){const C=n[T],{name:L,namespaceURI:N,value:Y}=C,se=S(L);let x=L==="value"?Y:Dt(Y);if(s.attrName=se,s.attrValue=x,s.keepAttr=!0,s.forceKeepAttr=void 0,H("uponSanitizeAttribute",e,s),x=s.attrValue,s.forceKeepAttr||(ze(L,e),!s.keepAttr))continue;if(!ot&&D(/\/>/i,x)){ze(L,e);continue}V&&P([Ce,Le,Re],wt=>{x=B(x,wt," ")});const _t=S(e.nodeName);if(Et(_t,se,x)){if(rt&&(se==="id"||se==="name")&&(ze(L,e),x=ln+x),k&&typeof ue=="object"&&typeof ue.getAttributeType=="function"&&!N)switch(ue.getAttributeType(_t,se)){case"TrustedHTML":{x=k.createHTML(x);break}case"TrustedScriptURL":{x=k.createScriptURL(x);break}}try{N?e.setAttributeNS(N,L,x):e.setAttribute(L,x),le(d.removed)}catch{}}}H("afterSanitizeAttributes",e,null)},gn=function u(e){let n=null;const s=gt(e);for(H("beforeSanitizeShadowDOM",e,null);n=s.nextNode();)H("uponSanitizeShadowNode",n,null),!yt(n)&&(n.content instanceof z&&u(n.content),At(n));H("afterSanitizeShadowDOM",e,null)};return d.sanitize=function(u){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,s=null,T=null,C=null;if(Ie=!u,Ie&&(u="<!-->"),typeof u!="string"&&!bt(u))if(typeof u.toString=="function"){if(u=u.toString(),typeof u!="string")throw ne("dirty is not a string, aborting")}else throw ne("toString is not a function");if(!d.isSupported)return u;if(Ne||Ue(e),d.removed=[],typeof u=="string"&&(re=!1),re){if(u.nodeName){const Y=S(u.nodeName);if(!w[Y]||ie[Y])throw ne("root node is forbidden and cannot be sanitized in-place")}}else if(u instanceof _e)n=ht("<!---->"),s=n.ownerDocument.importNode(u,!0),s.nodeType===1&&s.nodeName==="BODY"||s.nodeName==="HTML"?n=s:n.appendChild(s);else{if(!Z&&!V&&!q&&u.indexOf("<")===-1)return k&&pe?k.createHTML(u):u;if(n=ht(u),!n)return Z?null:pe?oe:""}n&&xe&&$(n.firstChild);const L=gt(re?u:n);for(;T=L.nextNode();)yt(T)||(T.content instanceof z&&gn(T.content),At(T));if(re)return u;if(Z){if(me)for(C=tn.call(n.ownerDocument);n.firstChild;)C.appendChild(n.firstChild);else C=n;return(v.shadowroot||v.shadowrootmode)&&(C=on.call(g,C,!0)),C}let N=q?n.outerHTML:n.innerHTML;return q&&w["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&D(je,n.ownerDocument.doctype.name)&&(N="<!DOCTYPE "+n.ownerDocument.doctype.name+`>
2
+ `+N),V&&P([Ce,Le,Re],Y=>{N=B(N,Y," ")}),k&&pe?k.createHTML(N):N},d.setConfig=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ue(u),Ne=!0},d.clearConfig=function(){ee=null,Ne=!1},d.isValidAttribute=function(u,e,n){ee||Ue({});const s=S(u),T=S(e);return Et(s,T,n)},d.addHook=function(u,e){typeof e=="function"&&(U[u]=U[u]||[],W(U[u],e))},d.removeHook=function(u){if(U[u])return le(U[u])},d.removeHooks=function(u){U[u]&&(U[u]=[])},d.removeAllHooks=function(){U={}},d}var jt=Ve();return jt})})(Rt);const He=Rt.exports,Nn=":host{display:inline-grid;overflow:hidden;width:100%}.view-email{width:100%}.view-email div.gmail_quote{display:none;color:var(--nylas-color-primary-400)}.view-email div.gmail_quote.show{display:block}.view-email blockquote{border-color:var(--nylas-color-primary-500) !important}.view-email .nylas-view-email-toggle-button{display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);border:0;border-radius:2px;font-size:14px;font-weight:500;line-height:1.5;transition:all 0.2s ease-in-out}.view-email .nylas-view-email-toggle-button:hover{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600)}",xn=Nn;He.addHook("afterSanitizeAttributes",function(t){"target"in t&&(t.setAttribute("target","_blank"),t.setAttribute("rel","noopener"))});const kt=class{constructor(t){o.registerInstance(this,t),this.htmlElement=document.createElement("html"),this.setBody=i=>{var p;this.state="loading",this.styles=[],this.hoistedFontURLs=new Map,this.sanitizedBody="",document.querySelectorAll(".nylas-view-email-font").forEach(a=>{a.remove()}),(this.message?o.detectIfMessageIsHTML(this.message):o.detectHTMLOrPlainText(i))||(i=`<html><body>${o.parsePlainTextToHTML(i)}</body></html>`),this.htmlElement.innerHTML=i,this.detectDarkMode&&Mn(this.htmlElement),this.htmlElement.querySelectorAll("link").forEach(a=>{if(console.debug(`[nylas-view-email] Hoisting link: ${a.getAttribute("href")}`),a.getAttribute("rel")==="stylesheet"&&a.getAttribute("href")){const m=a.getAttribute("href");if(m){const r=new URL(m,window.location.href);(r.protocol==="https:"||r.protocol==="http:")&&this.hoistedFontURLs.set(r.href,r.href)}}}),this.htmlElement.querySelectorAll("style").forEach(a=>{a.innerHTML.split(`
3
+ `).forEach(m=>{const r=m.match(/@import url\((.*)\)/);if(r){const c=new URL(r[1],window.location.href);(c.protocol==="https:"||c.protocol==="http:")&&this.hoistedFontURLs.set(c.href,c.href)}}),a.innerHTML=a.innerHTML.replace("body",":host"),this.styles.push(a),a.remove()}),this.htmlElement.querySelectorAll("a").forEach(a=>{a.setAttribute("target","_blank")});const l=this.htmlElement.querySelector(".gmail_quote");if(l){const a=document.createElement("button");a.classList.add("nylas-view-email-toggle-button"),a.setAttribute("aria-label","Show quoted text"),a.innerText="...",(p=l.parentElement)==null||p.insertBefore(a,l)}this.sanitizedBody=He.sanitize(this.htmlElement.innerHTML),this.hoistedFontURLs.forEach((a,m)=>{const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",a),r.classList.add("nylas-view-email-font"),document.head.appendChild(r)}),this.state="ready"},this.handleMobileSize=()=>{var f,l,p,a;const i=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0);if(i<=768){const m=(f=this.viewEmailElement)==null?void 0:f.getBoundingClientRect();if(m&&this.viewEmailElement&&this.parent&&m.width>i){const r=this.parent,c=r==null?void 0:r.getBoundingClientRect();o.debug("Parent width:",c==null?void 0:c.width,"Parent height:",c==null?void 0:c.height),o.debug("Parent client width:",r.clientWidth,"Parent client height:",r.clientHeight);const E=c.width/m.width,A=c.height/m.height,M=Math.min(E,A);o.debug("Scale:",M),this.viewEmailElement.style.setProperty("transform",`scale(${M})`),this.viewEmailElement.style.setProperty("transform-origin","top left"),this.viewEmailElement.style.setProperty("height",`${m.height*M}px`)}}else(l=this.viewEmailElement)==null||l.style.removeProperty("transform"),(p=this.viewEmailElement)==null||p.style.removeProperty("transform-origin"),(a=this.viewEmailElement)==null||a.style.removeProperty("height")},this.message=void 0,this.parent=void 0,this.attachments=[],this.detectDarkMode=!0,this.state="loading",this.sanitizedBody="",this.styles=[],this.viewEmailElement=void 0,this.hoistedFontURLs=new Map}connectedCallback(){}disconnectedCallback(){o.debug("[nylas-view-email] Component disconnected"),this.state="loading",this.styles=[],this.hoistedFontURLs=new Map,this.sanitizedBody="",document.querySelectorAll(".nylas-view-email-font").forEach(t=>{t.remove()})}async componentWillLoad(){var t;o.debug("[nylas-view-email] component loaded"),this.setBody(((t=this.message)==null?void 0:t.body)??"")}async componentDidLoad(){o.debug("[nylas-view-thread] Component did load"),this.handleMobileSize()}async messageChanged(){var t;o.debug("[nylas-view-thread] Message changed",{message:this.message}),this.setBody(((t=this.message)==null?void 0:t.body)??"")}handleScroll(){this.handleMobileSize()}viewEmailElementChanged(){var i;const t=(i=this.viewEmailElement)==null?void 0:i.querySelectorAll(".nylas-view-email-toggle-button");t&&t.forEach(f=>{f.addEventListener("click",()=>{var p;const l=(p=this.viewEmailElement)==null?void 0:p.querySelector(".gmail_quote");l&&l.classList.toggle("show")})})}render(){return console.debug("[nylas-view-email] render",{hoistedFontURLs:this.hoistedFontURLs}),o.h(o.Host,{key:"fe606c06674789e63156056d8b71a5cb2202cf47"},this.state==="loading"&&o.h("div",null,"Loading..."),this.state==="ready"&&o.h(o.Fragment,null,this.styles.map(t=>o.h("style",null,He.sanitize(t.innerHTML))),o.h("div",{class:"view-email",part:"view-email",innerHTML:this.sanitizedBody,ref:t=>this.viewEmailElement=t})))}get host(){return o.getElement(this)}static get watchers(){return{message:["messageChanged"],viewEmailElement:["viewEmailElementChanged"]}}};kt.style=xn;const Dn=".sc-reply-all-icon-h{display:flex}",On=Dn,Mt=class{constructor(t){o.registerInstance(this,t),this.width="15",this.height="15"}render(){return o.h("svg",{key:"2baf5fdfb4309e039a9a4e66ecacbf4481c2d7ca",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},o.h("path",{key:"d7f1586f9af096cb3a1876b681ba408387899788",d:"m1030.975 188 81.249 81.249-429.228 429.228h300.747c516.223 0 936.257 420.034 936.257 936.257v98.028h-114.92v-98.028c0-452.901-368.436-821.337-821.337-821.337H682.996l429.228 429.229-81.25 81.248-567.936-567.937L1030.975 188Zm-463.038.011 81.249 81.25-486.688 486.688 486.688 486.688-81.249 81.249L0 755.949 567.937 188.01Z","fill-rule":"evenodd"}))}};Mt.style=On;const In=".sc-reply-icon-h{display:flex}",Pn=In,Nt=class{constructor(t){o.registerInstance(this,t),this.width="15",this.height="15"}render(){return o.h("svg",{key:"07034b975afd3fa950dec8be4e28c16775b5a49e",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},o.h("path",{key:"5601b12fa1dde6412985fa2f701eeb3f9e2b07b4",d:"M835.942 632.563H244.966l478.08-478.08-90.496-90.496L-.026 696.563 632.55 1329.14l90.496-90.496-478.08-478.08h590.976c504.448 0 914.816 410.368 914.816 914.816v109.184h128V1675.38c0-574.976-467.84-1042.816-1042.816-1042.816","fill-rule":"evenodd"}))}};Nt.style=Pn;exports.forward_icon=St;exports.nylas_composer=Ct;exports.nylas_summarize_message_button=Be;exports.nylas_view_email=kt;exports.reply_all_icon=Mt;exports.reply_icon=Nt;
@@ -1,12 +1,12 @@
1
- import { r as t, h as C } from "./index-630f4e87.js";
1
+ import { r as e, h as C } from "./index-fd39ea9d.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const o = ".sc-globe-icon-h{display:flex}", s = o, i = class {
5
- constructor(e) {
6
- t(this, e), this.width = "16", this.height = "16";
5
+ constructor(t) {
6
+ e(this, t), this.width = "16", this.height = "16";
7
7
  }
8
8
  render() {
9
- return C("svg", { key: "40c238dae79b6c837926f797a13f07c9378eeeac", xmlns: "http://www.w3.org/2000/svg", width: this.width, height: this.height, viewBox: "0 0 16 16", fill: "none" }, C("path", { key: "b332e53dace690161725dee143c3682bc9039fa4", d: "M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z", fill: "currentColor" }));
9
+ return C("svg", { key: "f5143e3cb40a90ae9f1d944bfc452b7074d67582", xmlns: "http://www.w3.org/2000/svg", width: this.width, height: this.height, viewBox: "0 0 16 16", fill: "none" }, C("path", { key: "f43a8401af32f5ddaa3e325a32371c858716145b", d: "M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z", fill: "currentColor" }));
10
10
  }
11
11
  };
12
12
  i.style = s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-3b6f5cd5.cjs");require("react");require("react-dom");const i=".sc-globe-icon-h{display:flex}",c=i,C=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"40c238dae79b6c837926f797a13f07c9378eeeac",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},e.h("path",{key:"b332e53dace690161725dee143c3682bc9039fa4",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};C.style=c;exports.globe_icon=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-5f0940e0.cjs");require("react");require("react-dom");const i=".sc-globe-icon-h{display:flex}",o=i,C=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"f5143e3cb40a90ae9f1d944bfc452b7074d67582",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},e.h("path",{key:"f43a8401af32f5ddaa3e325a32371c858716145b",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};C.style=o;exports.globe_icon=C;
@@ -0,0 +1,387 @@
1
+ import { r as L, h as e, c as p, v as $, d as f, w as Z, H as z, g as q } from "./index-fd39ea9d.js";
2
+ import { R as W } from "./register-component-83e24412-35c484c4.js";
3
+ import { D as K } from "./constants-f34b9c6e-21ac1910.js";
4
+ import "react";
5
+ import "react-dom";
6
+ const Q = ".sc-google-logo-icon-h{display:flex}", X = Q, Y = class {
7
+ constructor(n) {
8
+ L(this, n), this.width = "24", this.height = "24";
9
+ }
10
+ render() {
11
+ return e("svg", { key: "2445589627197f9af06e10891e1772c17b140c0a", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "b84ea9a0cc741b646d9a63113404d34c5e155fc8", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "9c774266fb43cf807ea64846b71eb27c6272b17d", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), e("path", { key: "ff0fe8133c31fc75ecf3e9fedecbbaef2e35dd54", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), e("path", { key: "5851b3de9ee71263668f65e2e86f0dfab3039c83", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), e("path", { key: "2a79a335e1b8d03747b5f879a75deb5544e5cf63", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), e("defs", { key: "f3b4d8d363cc9ac066b92de2354b9210d7190b46" }, e("clipPath", { key: "270b05e06d87d998c7525254f4f2ae3d5a0ab835", id: "clip0_959_12452" }, e("rect", { key: "de0df984a8f12ccdd0c655968c4f8b2049996968", width: 24, height: 24, fill: "white" }))));
12
+ }
13
+ };
14
+ Y.style = X;
15
+ const tt = ".sc-microsoft-logo-icon-h{display:flex}", et = tt, nt = class {
16
+ constructor(n) {
17
+ L(this, n), this.width = "22", this.height = "22";
18
+ }
19
+ render() {
20
+ return e("svg", { key: "de39bfb3167fbd60d21025e74c1bc19cdd7d4dc9", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "0f80864e892ff36e6e76ef03f5f36d62007d99ee", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "ab0e85f803a3cf2e32055ebeff1b0705edebe048", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "b6359dcb76ade260f2a9e9bdf1be21ba84b77b79", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "cf38a555c09aaef94a15fd26b0951e2642eaad6d", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
21
+ }
22
+ };
23
+ nt.style = et;
24
+ function at({ id: n, formState: t, activeTab: a, calendars: r }) {
25
+ var s;
26
+ switch (a) {
27
+ case "eventInfo":
28
+ const i = t.title, l = t.description, o = parseInt(t.duration), d = t.location;
29
+ return e(
30
+ "div",
31
+ { key: n },
32
+ e(
33
+ "nylas-event-info",
34
+ null,
35
+ e(
36
+ "div",
37
+ { slot: "inputs" },
38
+ e("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
39
+ e("nylas-event-duration", { name: "duration", eventDurationMinutes: o, exportparts: "ned, ned__input, ned__dropdown, ned__dropdown-button, ned__dropdown-content" }),
40
+ e("nylas-location-component", { name: "location", eventLocation: d, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
41
+ e("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
42
+ )
43
+ )
44
+ );
45
+ case "availability":
46
+ const b = t.availability.openHours, h = t.availability.timezone ? t.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, u = (s = t.participants) == null ? void 0 : s.find((c) => c.is_organizer), y = (u == null ? void 0 : u.email) ?? "primary", g = t.calendarIds.length > 0 ? t.calendarIds : [y], m = t.bookingCalendar == "primary" ? y : t.bookingCalendar;
47
+ return e(
48
+ "div",
49
+ { key: n },
50
+ e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: r ?? [], defaultBookingCalendar: m, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
51
+ e("nylas-calendar-picker", { name: "calendars", calendars: r ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
52
+ e("nylas-availability-picker", { name: "availability", openHours: b, defaultTimezone: h, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
53
+ );
54
+ case "bookingOptions":
55
+ return e(
56
+ "div",
57
+ { key: n },
58
+ e("nylas-buffer-time", { name: "buffer-time", buffer: t.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
59
+ e(
60
+ "nylas-event-limits",
61
+ null,
62
+ e(
63
+ "div",
64
+ { slot: "inputs" },
65
+ e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: t.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
66
+ e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: t.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" })
67
+ )
68
+ )
69
+ );
70
+ }
71
+ }
72
+ const it = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', st = it;
73
+ var ot = function(n, t, a, r) {
74
+ var s = arguments.length, i = s < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, l;
75
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
76
+ i = Reflect.decorate(n, t, a, r);
77
+ else
78
+ for (var o = n.length - 1; o >= 0; o--)
79
+ (l = n[o]) && (i = (s < 3 ? l(i) : s > 3 ? l(t, a, i) : l(t, a)) || i);
80
+ return s > 3 && i && Object.defineProperty(t, a, i), i;
81
+ }, D = function(n, t) {
82
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
83
+ return Reflect.metadata(n, t);
84
+ };
85
+ const G = class {
86
+ constructor(n) {
87
+ L(this, n), this.schedulerConfigChanged = p(this, "schedulerConfigChanged", 7), this.cancelButtonClick = p(this, "cancelButtonClick", 7), this.formSubmitted = p(this, "formSubmitted", 7), this.previewButtonClicked = p(this, "previewButtonClicked", 7), this.setError = (t) => {
88
+ this.error = t.message;
89
+ }, this.formSubmissionHandler = async (t) => {
90
+ var w, C, S, T, B, F, I, E, R, P, O, j, A, V, M, N;
91
+ if (t.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
92
+ return;
93
+ this.isLoading = !0, this.hasUnsavedChanges = !1;
94
+ const r = this.updateFormState(), { title: s, description: i, duration: l, availability: o, calendarIds: d, bookingCalendar: b, location: h, bookingType: u, buffer: y, availableDaysInFuture: g, minCancellationNotice: m } = r, c = (C = (w = this.selectedConfiguration) == null ? void 0 : w.participants) == null ? void 0 : C.find((U) => U.is_organizer), v = {
95
+ ...((S = this.selectedConfiguration) == null ? void 0 : S.id) && { id: this.selectedConfiguration.id },
96
+ version: ((T = this.selectedConfiguration) == null ? void 0 : T.version) ?? "1.0.0",
97
+ availability: {
98
+ duration_minutes: l ? parseInt(l) : 0,
99
+ availability_rules: {
100
+ availability_method: ((I = (F = (B = this.selectedConfiguration) == null ? void 0 : B.availability) == null ? void 0 : F.availability_rules) == null ? void 0 : I.availability_method) ?? "collective",
101
+ buffer: y || { before: 0, after: 0 },
102
+ default_open_hours: ((P = (R = (E = this.selectedConfiguration) == null ? void 0 : E.availability) == null ? void 0 : R.availability_rules) == null ? void 0 : P.default_open_hours) ?? K,
103
+ round_robin_group_id: ((A = (j = (O = this.selectedConfiguration) == null ? void 0 : O.availability) == null ? void 0 : j.availability_rules) == null ? void 0 : A.round_robin_group_id) ?? ""
104
+ }
105
+ },
106
+ participants: [
107
+ {
108
+ name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((V = this.currentUser) == null ? void 0 : V.name) ?? ((M = this.currentUser) == null ? void 0 : M.email) ?? "",
109
+ email: (c == null ? void 0 : c.email) ?? ((N = this.currentUser) == null ? void 0 : N.email) ?? "",
110
+ is_organizer: !0,
111
+ availability: {
112
+ calendar_ids: d != null && d.length ? d : ["primary"],
113
+ open_hours: (o == null ? void 0 : o.openHours) ?? []
114
+ },
115
+ booking: {
116
+ calendar_id: b && b !== "" ? b : "primary"
117
+ }
118
+ }
119
+ ],
120
+ event_booking: {
121
+ title: (s == null ? void 0 : s.toString()) ?? "",
122
+ description: (i == null ? void 0 : i.toString()) ?? "",
123
+ location: (h == null ? void 0 : h.toString()) ?? "",
124
+ booking_type: (u == null ? void 0 : u.toString()) ?? "booking",
125
+ timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
126
+ },
127
+ scheduler: {
128
+ available_days_in_future: g ?? 30,
129
+ min_cancellation_notice: m ?? 0
130
+ }
131
+ }, _ = $(v, this.selectedConfiguration);
132
+ _.requires_session_auth = this.defaultRequiresSessionAuth;
133
+ const k = this.action === "create" ? _ : v, x = (U) => {
134
+ this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
135
+ this.changesSaved = !1;
136
+ }, 5e3);
137
+ };
138
+ this.schedulerConfigChanged.emit({ config: k, resetLoadingState: x, setError: this.setError, action: this.action });
139
+ }, this.calendars = void 0, this.selectedConfiguration = void 0, this.defaultRequiresSessionAuth = !0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
140
+ }
141
+ configChangedHandler(n) {
142
+ f("[nylas-editor-tabs]", "configChangedHandler", n, this.selectedConfiguration), this.formState = {
143
+ ...this.getFormStateFromConfig(n)
144
+ }, n.id ? this.action = "edit" : this.action = "create";
145
+ }
146
+ connectedCallback() {
147
+ f("[nylas-editor-tabs]", "connectedCallback");
148
+ }
149
+ componentWillLoad() {
150
+ f("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
151
+ }
152
+ componentDidLoad() {
153
+ f("[nylas-editor-tabs]", "componentDidLoad");
154
+ }
155
+ disconnectedCallback() {
156
+ f("[nylas-editor-tabs]", "disconnectedCallback");
157
+ }
158
+ handleValueChanged(n) {
159
+ f("[nylas-editor-tabs]", "handleValueChanged", n);
160
+ const { name: t, value: a } = n.detail;
161
+ this.formState = { ...this.formState, [t]: a }, this.hasUnsavedChanges = !0, this.error = "";
162
+ }
163
+ getFormStateFromConfig(n) {
164
+ var a, r, s, i, l, o, d, b, h, u, y, g, m, c, v, _, k, x, w, C;
165
+ const t = (a = n == null ? void 0 : n.participants) == null ? void 0 : a.find((S) => S.is_organizer);
166
+ return {
167
+ title: ((r = n == null ? void 0 : n.event_booking) == null ? void 0 : r.title) ?? "",
168
+ description: ((s = n == null ? void 0 : n.event_booking) == null ? void 0 : s.description) ?? "",
169
+ duration: ((l = (i = n == null ? void 0 : n.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "10",
170
+ availability: {
171
+ timezone: ((o = n == null ? void 0 : n.event_booking) == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
172
+ open_hours: ((d = t == null ? void 0 : t.availability) == null ? void 0 : d.open_hours) ?? void 0
173
+ },
174
+ calendarIds: ((b = t == null ? void 0 : t.availability) == null ? void 0 : b.calendar_ids) ?? [],
175
+ participants: (n == null ? void 0 : n.participants) ?? [],
176
+ bookingCalendar: ((h = t == null ? void 0 : t.booking) == null ? void 0 : h.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
177
+ location: ((y = (u = this.selectedConfiguration) == null ? void 0 : u.event_booking) == null ? void 0 : y.location) ?? "",
178
+ bookingType: ((m = (g = this.selectedConfiguration) == null ? void 0 : g.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
179
+ buffer: ((_ = (v = (c = this.selectedConfiguration) == null ? void 0 : c.availability) == null ? void 0 : v.availability_rules) == null ? void 0 : _.buffer) ?? { before: 0, after: 0 },
180
+ availableDaysInFuture: ((x = (k = this.selectedConfiguration) == null ? void 0 : k.scheduler) == null ? void 0 : x.available_days_in_future) ?? 30,
181
+ minCancellationNotice: ((C = (w = this.selectedConfiguration) == null ? void 0 : w.scheduler) == null ? void 0 : C.min_cancellation_notice) ?? 0
182
+ };
183
+ }
184
+ updateFormState() {
185
+ return new FormData(this.formRef).forEach((t, a) => {
186
+ switch (a) {
187
+ case "title":
188
+ this.formState.title = t.toString();
189
+ break;
190
+ case "description":
191
+ this.formState.description = t.toString();
192
+ break;
193
+ case "duration":
194
+ this.formState.duration = t.toString();
195
+ break;
196
+ case "availability":
197
+ this.formState.availability = JSON.parse(t.toString());
198
+ break;
199
+ case "participants":
200
+ this.formState.participants = JSON.parse(t.toString());
201
+ break;
202
+ case "calendars":
203
+ this.formState.calendarIds = t.toString().split(",");
204
+ break;
205
+ case "booking-calendar":
206
+ this.formState.bookingCalendar = t.toString();
207
+ break;
208
+ case "location":
209
+ this.formState.location = t.toString();
210
+ break;
211
+ case "booking-type":
212
+ this.formState.bookingType = t.toString();
213
+ break;
214
+ case "buffer-time":
215
+ this.formState.buffer = JSON.parse(t.toString());
216
+ break;
217
+ case "limit-future-bookings":
218
+ this.formState.availableDaysInFuture = parseInt(t.toString());
219
+ break;
220
+ case "min-cancellation-notice":
221
+ this.formState.minCancellationNotice = parseInt(t.toString());
222
+ break;
223
+ }
224
+ }), this.formState = { ...this.formState }, this.formState;
225
+ }
226
+ setActiveTab(n, t) {
227
+ n.preventDefault(), this.updateFormState(), this.activeTab = t;
228
+ }
229
+ render() {
230
+ var n;
231
+ return f("[nylas-editor-tabs]", "render", this.formState), e(z, { key: "1b22e2152ebb021ef1b5a8bc7b84d34742d8b141" }, e("form", { key: "0e3a7c3b9a058ff4abc759b6891b7f4d1e8075ef", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (t) => this.formRef = t, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (t) => this.setActiveTab(t, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), e("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (t) => this.setActiveTab(t, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (t) => this.setActiveTab(t, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking Options")), e("div", { class: "tab-content" }, e(at, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((n = this.selectedConfiguration) == null ? void 0 : n.id) ?? "new" }))) : e("slot", null), e("div", { key: "33093cefafa2ff596a2b6e00e5ed994319065f53", class: "footer" }, e("div", { key: "ffbea04fe503c6f6482c3eaae7f87bac173ad9b9", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (t) => {
232
+ t.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(Z(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
233
+ }, variant: "basic" }, "Preview")), e("div", { key: "88a229d932ab65f90da5fc64f5c09ab8ae4bcae8", class: "buttons" }, e("p", { key: "8e2c76b956e7291775dc3515b4fffa7b77e1fe6c", class: {
234
+ "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
235
+ "saved-changes": this.changesSaved,
236
+ error: this.error !== "",
237
+ "error-full-width": this.error !== "" && this.action === "create"
238
+ } }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "e90b955a86235e50227d5655225860e427e1e6c8", type: "button", disabled: this.isLoading, clickHandler: (t) => {
239
+ t.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
240
+ }, variant: "basic" }, "Cancel"), e("button-component", { key: "da69635d229d324cb7ae5019037a9cf431f71125", type: "submit", disabled: this.isLoading }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
241
+ }
242
+ get host() {
243
+ return q(this);
244
+ }
245
+ static get watchers() {
246
+ return {
247
+ selectedConfiguration: ["configChangedHandler"]
248
+ };
249
+ }
250
+ };
251
+ ot([
252
+ W({
253
+ name: "nylas-editor-tabs",
254
+ stateToProps: /* @__PURE__ */ new Map([
255
+ ["schedulerConfig.calendars", "calendars"],
256
+ ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
257
+ ["schedulerConfig.currentUser", "currentUser"]
258
+ ]),
259
+ eventToProps: {
260
+ schedulerConfigChanged: async (n, t) => {
261
+ const { resetLoadingState: a, setError: r, action: s, config: i } = n.detail, l = (o) => {
262
+ const [d, b] = o;
263
+ !d && b && r && r(b), a && a(n);
264
+ };
265
+ if (s === "edit") {
266
+ const o = await t.schedulerConfig.updateConfiguration(i);
267
+ l(o);
268
+ } else {
269
+ const o = await t.schedulerConfig.createConfiguration(i);
270
+ l(o);
271
+ }
272
+ },
273
+ cancelButtonClick: async (n, t) => {
274
+ t.schedulerConfigStore.state.action = null;
275
+ }
276
+ },
277
+ localPropsToProp: /* @__PURE__ */ new Map([
278
+ ["schedulerPreviewLink", "schedulerPreviewLink"],
279
+ ["defaultRequiresSessionAuth", "defaultRequiresSessionAuth"]
280
+ ]),
281
+ fireRegisterEvent: !0
282
+ }),
283
+ D("design:type", Function),
284
+ D("design:paramtypes", []),
285
+ D("design:returntype", void 0)
286
+ ], G.prototype, "render", null);
287
+ G.style = st;
288
+ const rt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}', lt = rt;
289
+ var ct = function(n, t, a, r) {
290
+ var s = arguments.length, i = s < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, l;
291
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
292
+ i = Reflect.decorate(n, t, a, r);
293
+ else
294
+ for (var o = n.length - 1; o >= 0; o--)
295
+ (l = n[o]) && (i = (s < 3 ? l(i) : s > 3 ? l(t, a, i) : l(t, a)) || i);
296
+ return s > 3 && i && Object.defineProperty(t, a, i), i;
297
+ }, H = function(n, t) {
298
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
299
+ return Reflect.metadata(n, t);
300
+ };
301
+ const J = class {
302
+ constructor(n) {
303
+ L(this, n), this.initListConfigurations = p(this, "initListConfigurations", 7), this.createButtonClick = p(this, "createButtonClick", 7), this.editButtonClick = p(this, "editButtonClick", 7), this.deleteButtonClick = p(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "";
304
+ }
305
+ connectedCallback() {
306
+ f("[nylas-list-configurations]", "connectedCallback");
307
+ }
308
+ componentWillLoad() {
309
+ f("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
310
+ }
311
+ componentDidLoad() {
312
+ f("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
313
+ }
314
+ disconnectedCallback() {
315
+ f("[nylas-list-configurations]", "disconnectedCallback");
316
+ }
317
+ async getState() {
318
+ return this.state;
319
+ }
320
+ async setState(n) {
321
+ this.state = n;
322
+ }
323
+ async setError(n) {
324
+ this.error = n;
325
+ }
326
+ render() {
327
+ return e(z, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All scheduling pages"), e("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { clickHandler: () => {
328
+ this.createButtonClick.emit(this.host);
329
+ } }, "Create new"))), e("div", { class: "configurations" }, e("table", { class: {
330
+ "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
331
+ } }, e("tr", { class: {
332
+ hide: this.state === "loading" || this.configurations && this.configurations.length === 0
333
+ } }, e("th", null, "Scheduling page event title"), e("th", null, "Duration"), e("th", { class: "actions-header" }, "Actions")), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { clickHandler: () => {
334
+ this.createButtonClick.emit(this.host);
335
+ } }, "Create new")))), this.state !== "loading" && this.configurations.map((n) => e("tr", { key: n.id }, e("td", null, e("div", { class: "title" }, e("span", { class: "config-event-title" }, n.event_booking.title), e("span", { class: "config-event-description" }, n.event_booking.description))), e("td", null, e("div", null, n.availability.duration_minutes, " mins")), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", clickHandler: (t) => {
336
+ t.preventDefault(), window.open(Z(this.schedulerPreviewLink, n), "_blank");
337
+ } }, "Preview"), e("button-component", { variant: "basic", clickHandler: (t) => {
338
+ t.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: n });
339
+ } }, "Edit"), e("button-component", { variant: "basic", clickHandler: (t) => {
340
+ t.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: n });
341
+ } }, "Delete"))))))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
342
+ }
343
+ get host() {
344
+ return q(this);
345
+ }
346
+ };
347
+ ct([
348
+ W({
349
+ name: "nylas-list-configurations",
350
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
351
+ localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
352
+ eventToProps: {
353
+ initListConfigurations: async (n, t) => {
354
+ const a = n.detail;
355
+ await a.setState("loading");
356
+ const [r, s] = await t.schedulerConfig.getConfigurations();
357
+ if (!r && s && s.message) {
358
+ await a.setState("error"), await a.setError(s.message);
359
+ return;
360
+ }
361
+ await a.setState("loaded");
362
+ },
363
+ createButtonClick: async (n, t) => {
364
+ t.schedulerConfigStore.resetSelectedConfiguration(), t.schedulerConfigStore.state.action = "create";
365
+ },
366
+ deleteButtonClick: async (n, t) => {
367
+ const { host: a, configuration: r } = n.detail, [s, i] = await t.schedulerConfig.deleteConfiguration(r.id);
368
+ !s && i && i.message && (await a.setState("error"), await a.setError(i.message));
369
+ },
370
+ editButtonClick: async (n, t) => {
371
+ const { configuration: a } = n.detail;
372
+ t.schedulerConfigStore.state.selectedConfiguration = a, t.schedulerConfigStore.state.action = "edit";
373
+ }
374
+ },
375
+ fireRegisterEvent: !0
376
+ }),
377
+ H("design:type", Function),
378
+ H("design:paramtypes", []),
379
+ H("design:returntype", void 0)
380
+ ], J.prototype, "render", null);
381
+ J.style = lt;
382
+ export {
383
+ Y as google_logo_icon,
384
+ nt as microsoft_logo_icon,
385
+ G as nylas_editor_tabs,
386
+ J as nylas_list_configurations
387
+ };