@nylas/react 1.0.1-prealpha1 → 1.0.2-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_18.entry-b66b6343.cjs +1 -0
- package/dist/add-circle-icon_18.entry-f86ae88d.js +1527 -0
- package/dist/{archive-icon_7.entry-baecb43c.cjs → archive-icon_7.entry-052ac074.cjs} +1 -1
- package/dist/{archive-icon_7.entry-9f3eca2c.js → archive-icon_7.entry-0e34d6e7.js} +15 -15
- package/dist/{arrow-icon.entry-a3b36218.js → arrow-icon.entry-2afd9ea9.js} +2 -2
- package/dist/{arrow-icon.entry-9ab0c414.cjs → arrow-icon.entry-93f21385.cjs} +1 -1
- package/dist/auth-store-69ac49c7-5a0bbb90.cjs +1 -0
- package/dist/auth-store-69ac49c7-cbfda055.js +66 -0
- package/dist/{bold-icon_3.entry-b0d81839.js → bold-icon_3.entry-88ce1d25.js} +8 -8
- package/dist/bold-icon_3.entry-8f55a9e7.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-8f498984.cjs → calendar-cancel-icon.entry-574c8aa4.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0d07e33c.js → calendar-cancel-icon.entry-e9c692fa.js} +5 -5
- package/dist/calendar-check-icon_2.entry-b0476bca.cjs +1 -0
- package/dist/calendar-check-icon_2.entry-d461c713.js +25 -0
- package/dist/{calendar-icon.entry-e5f20598.js → calendar-icon.entry-1ca202a4.js} +5 -5
- package/dist/{calendar-icon.entry-219efd7a.cjs → calendar-icon.entry-98936e6d.cjs} +1 -1
- package/dist/chevron-icon_3.entry-830f52c2.js +105 -0
- package/dist/chevron-icon_3.entry-f7801467.cjs +1 -0
- package/dist/close-icon.entry-37e8361f.js +15 -0
- package/dist/close-icon.entry-8d6e9816.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-27efa654.cjs → constants-b6bf6671-27e2557d.cjs} +6 -6
- package/dist/{nylas-booked-event-card_10.entry-f2481a57.js → constants-b6bf6671-49a0f1f2.js} +1656 -2374
- package/dist/{document-refresh-icon.entry-89ad42fa.js → document-refresh-icon.entry-faea08ce.js} +5 -5
- package/dist/document-refresh-icon.entry-fcb33921.cjs +1 -0
- package/dist/elements/index.d.ts +24 -2
- package/dist/{forward-icon_6.entry-0a6dff18.js → forward-icon_6.entry-8da1f65d.js} +82 -82
- package/dist/{forward-icon_6.entry-ce725f05.cjs → forward-icon_6.entry-c4b37cb1.cjs} +3 -3
- package/dist/{globe-icon.entry-71414bc6.js → globe-icon.entry-4720304b.js} +4 -4
- package/dist/{globe-icon.entry-a0c9599a.cjs → globe-icon.entry-90a0b9c9.cjs} +1 -1
- package/dist/{index-b30d446a-e0eaccad.js → index-10914bc1-346f04fa.js} +3 -3
- package/dist/{index-b30d446a-3d69a3cc.cjs → index-10914bc1-c8c3a2f3.cjs} +1 -1
- package/dist/index-457dcf0b.cjs +30 -0
- package/dist/index-ce40ad47.js +1570 -0
- package/dist/index.d.ts +1 -1
- package/dist/info-icon_2.entry-81e95048.cjs +1 -0
- package/dist/info-icon_2.entry-9307db18.js +34 -0
- package/dist/loading-icon.entry-06d37ef0.cjs +1 -0
- package/dist/loading-icon.entry-dc518df4.js +15 -0
- package/dist/mailbox-store-e721b17c-4e97e07d.cjs +1 -0
- package/dist/{mailbox-store-19f0c6c9-23a4e72f.js → mailbox-store-e721b17c-cf9a43dd.js} +59 -121
- package/dist/nylas-additional-participants.entry-1653dec7.js +83 -0
- package/dist/nylas-additional-participants.entry-ff8bf378.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-06bc3c51.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-aa971e8a.js +784 -0
- package/dist/nylas-editor-tabs.entry-49b5a3ab.cjs +1 -0
- package/dist/nylas-editor-tabs.entry-9d0959bf.js +181 -0
- package/dist/nylas-form-card.entry-69d2095b.cjs +1 -0
- package/dist/nylas-form-card.entry-c4e78f88.js +56 -0
- package/dist/{nylas-if-state_3.entry-d805d4c6.js → nylas-if-state_3.entry-2eb3f385.js} +12 -10
- package/dist/nylas-if-state_3.entry-5baf6d6f.cjs +1 -0
- package/dist/nylas-list-folders.entry-3b24d92d.cjs +1 -0
- package/dist/{nylas-list-folders.entry-472bd255.js → nylas-list-folders.entry-995fa819.js} +9 -8
- package/dist/{nylas-list-threads.entry-f3266bf7.js → nylas-list-threads.entry-21466eb3.js} +7 -6
- package/dist/nylas-list-threads.entry-fda42ded.cjs +1 -0
- package/dist/{nylas-mailbox-pagination.entry-bd0d3bda.js → nylas-mailbox-pagination.entry-02d40186.js} +4 -3
- package/dist/nylas-mailbox-pagination.entry-9dcd4901.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-d1099fab.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-9641b5cd.js → nylas-mailbox-toolbar-button.entry-dbad44b4.js} +10 -9
- package/dist/nylas-provider.entry-78e2fa30.cjs +1 -0
- package/dist/nylas-provider.entry-bbee8c99.js +155 -0
- package/dist/nylas-scheduler-editor.entry-550d3c59.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-8f7ecf3b.js +111 -0
- package/dist/nylas-scheduling.entry-22b5ad07.js +236 -0
- package/dist/nylas-scheduling.entry-30a63738.cjs +1 -0
- package/dist/nylas-threads-refresh.entry-05258b36.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-7d567ed1.js → nylas-threads-refresh.entry-414d8740.js} +6 -5
- package/dist/{nylas-threads-search.entry-c881d54b.js → nylas-threads-search.entry-a19dc90f.js} +14 -13
- package/dist/nylas-threads-search.entry-ff21fc65.cjs +1 -0
- package/dist/{nylas-view-thread.entry-d8de6c83.js → nylas-view-thread.entry-38149162.js} +5 -4
- package/dist/nylas-view-thread.entry-5da81e99.cjs +1 -0
- package/dist/people-icon.entry-4b682757.cjs +1 -0
- package/dist/people-icon.entry-5c244c8d.js +15 -0
- package/dist/play-icon_2.entry-ccdc6b9c.cjs +1 -0
- package/dist/play-icon_2.entry-f36d6d55.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +79 -57
- package/dist/{refresh-icon.entry-3e0aef26.cjs → refresh-icon.entry-59fff3d4.cjs} +1 -1
- package/dist/{refresh-icon.entry-9563850b.js → refresh-icon.entry-63456c9a.js} +2 -2
- package/dist/{register-component-152c6ad2-b0d34c36.cjs → register-component-d056a880-2be11c56.cjs} +1 -1
- package/dist/{register-component-152c6ad2-418db864.js → register-component-d056a880-f3003d6c.js} +2 -2
- package/dist/scheduler-config-store-4d035001-0256b40c.cjs +1 -0
- package/dist/scheduler-config-store-4d035001-db9dc78a.js +33 -0
- package/dist/{scheduler-store-7d48e682-39104219.js → scheduler-store-0fbe642c-14466305.js} +99 -95
- package/dist/scheduler-store-0fbe642c-410fdbf4.cjs +1 -0
- package/dist/translate-icon.entry-1784c18e.cjs +1 -0
- package/dist/translate-icon.entry-35999e70.js +15 -0
- package/dist/utils-0cd66d04-89ab163d.js +2111 -0
- package/dist/utils-0cd66d04-94b9c3b6.cjs +8 -0
- package/dist/warning-icon.entry-3a702d1d.cjs +1 -0
- package/dist/warning-icon.entry-73de08c3.js +15 -0
- package/package.json +7 -4
- package/dist/add-circle-icon.entry-4b8debfa.js +0 -15
- package/dist/add-circle-icon.entry-c5fdaa6f.cjs +0 -1
- package/dist/bold-icon_3.entry-50406bc7.cjs +0 -1
- package/dist/calendar-check-icon_3.entry-5415e916.cjs +0 -1
- package/dist/calendar-check-icon_3.entry-cfb612c6.js +0 -35
- package/dist/chevron-icon.entry-3c709061.cjs +0 -1
- package/dist/chevron-icon.entry-f5d5d1b1.js +0 -15
- package/dist/close-icon_2.entry-eca351c4.js +0 -25
- package/dist/close-icon_2.entry-fa4f6d3e.cjs +0 -1
- package/dist/document-refresh-icon.entry-3a29a6e6.cjs +0 -1
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/index-586a4206.cjs +0 -30
- package/dist/index-98d3a4da.js +0 -1498
- package/dist/loading-icon.entry-15debb7d.js +0 -15
- package/dist/loading-icon.entry-d2680046.cjs +0 -1
- package/dist/mailbox-store-19f0c6c9-9a3ef58a.cjs +0 -1
- package/dist/nylas-if-state_3.entry-6c0bf8eb.cjs +0 -1
- package/dist/nylas-list-folders.entry-cc04a07e.cjs +0 -1
- package/dist/nylas-list-threads.entry-795c5a2b.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-f701fd83.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-b9d6a3c8.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-42942946.js +0 -186
- package/dist/nylas-open-hours-picker.entry-aa103daf.cjs +0 -1
- package/dist/nylas-provider.entry-5bb55b2d.cjs +0 -1
- package/dist/nylas-provider.entry-b94198a1.js +0 -134
- package/dist/nylas-scheduler.entry-3b7cb841.js +0 -230
- package/dist/nylas-scheduler.entry-ea6fb146.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-4002608b.cjs +0 -1
- package/dist/nylas-threads-search.entry-556f1219.cjs +0 -1
- package/dist/nylas-view-thread.entry-6faf1b51.cjs +0 -1
- package/dist/play-icon_2.entry-2e21b8b9.cjs +0 -1
- package/dist/play-icon_2.entry-cae94826.js +0 -25
- package/dist/scheduler-store-7d48e682-449277d4.cjs +0 -1
- package/dist/search-icon_3.entry-9b027cfc.cjs +0 -1
- package/dist/search-icon_3.entry-e36548ec.js +0 -101
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-586a4206.cjs"),y=require("./utils-5074a070-d5ba6add.cjs"),yn=require("./register-component-152c6ad2-b0d34c36.cjs"),En=require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");require("react");require("react-dom");const Tn=".sc-forward-icon-h{display:flex}",An=Tn,Ct=class{constructor(t){m.registerInstance(this,t),this.width="15",this.height="15"}render(){return m.h("svg",{key:"f6f2a0745a4ea7849081d7ac5d0244ee69d087b7",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},m.h("path",{key:"484a8d3299af5b6a48929d894214027e3c273fe4",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"}))}};Ct.style=An;const _n=':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}',wn=_n,Lt=class{constructor(t){m.registerInstance(this,t),this.close=m.createEvent(this,"close",7),this.send=m.createEvent(this,"send",7),this.closeComposer=o=>{this.close.emit(o)},this.sendComposer=o=>{var s;if(!this.editorEl){y.debug("no editor element");return}const u=this.editorEl.querySelector(".message-body");if(!u){y.debug("no message body");return}this.message&&(this.send.emit({message:this.message,replyBody:((s=u.querySelector(".message-body"))==null?void 0:s.innerHTML)||""}),this.close.emit(o),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){y.debug("[connectedCallback] no editor element");return}if(!this.toolbarEl){y.debug("[connectedCallback] no toolbar element");return}const t=this.editorEl,o=this.toolbarEl;t.addEventListener("mouseup",u=>{var W;const s=(W=this.host.shadowRoot)==null?void 0:W.getSelection();if(!s){y.debug("no selection");return}const p=s.getRangeAt(0),r=s.toString();if(!r){o.style.display="none";return}const f=t.querySelector(".message-body");if(!f){y.debug("no message body");return}const l=p.commonAncestorContainer.parentElement;if(!l)return;const T=f.getBoundingClientRect();y.debug("messageBodyRect",{messageBodyRect:T});const _=l.getBoundingClientRect();y.debug("foundRect",{foundRect:_});const ce=(l.childNodes[0].textContent||"").indexOf(r),q=window.getComputedStyle(l).fontSize,X=parseInt(q.replace("px",""),10),ne=_.top-T.top-o.clientHeight,ye=ce*(1/X)*100;o.style.top=`${ne}px`,o.style.left=`${ye}px`,o.style.display="block"})}watchBody(t){var r;if(!this.editorEl){y.debug("no editor element");return}this.editorEl.querySelectorAll(".message-body").forEach(f=>f.remove());const o=document.createElement("div");o.classList.add("message-body");const u=document.createElement("p");u.innerHTML=" ",o.appendChild(u);const s=document.createElement("br");o.appendChild(s);const p=document.createElement("div");if(p.classList.add("reply-text"),p.innerText=`On ${new Date(t.date*1e3).toLocaleDateString(void 0,{dateStyle:"full"})} <${(r=t.from)==null?void 0:r.map(f=>f.name||f.email).join(", ")}> wrote:`,o.appendChild(p),t.body){const f=document.createElement("html");f.innerHTML=t.body;const i=document.createElement("blockquote");i.classList.add("collapsed"),i.classList.add("gmail_quote"),i.innerHTML=f.innerHTML,o.appendChild(i),y.debug("replyContainer",{replyContainer:i})}this.editorEl.appendChild(o),this.editorEl.querySelectorAll("blockquote.collapsed").forEach(f=>{f.addEventListener("click",function(i){i.preventDefault();const l=i.target;l.classList.remove("collapsed"),l.classList.add("expanded")},{once:!0})}),this.editorEl.focus()}render(){return m.h(m.Host,{key:"b25497b478659d675aadb91a6b7e147ff6e5e9b8"},m.h("sp-theme",{key:"dd88253135657e6cda8daf8e71635c16d736a317",scale:"medium",color:"dark"},m.h("div",{key:"f23ecbde8bda95328796f60bc5612cedd30cd488",class:"editor",contentEditable:!0,ref:t=>this.editorEl=t},m.h("div",{key:"871c357e3c095fe2237d228bbaaeb1f5247734b3",class:"toolbar",ref:t=>this.toolbarEl=t,contentEditable:!1},m.h("sp-button",{key:"626560dcbd264b9572be5f7d69268186c8b1a0f6",quiet:!0,onClick:()=>document.execCommand("bold")},m.h("div",{key:"d83785d23518d539064405eb657d9291f76436be",slot:"icon"},m.h("bold-icon",{key:"ce45db34d019a60e3955a3a32335447ae1e27b14"})),m.h("div",{key:"9f05672f538617fbaca46e8287f7e2ebc0909816",slot:"label"},"Bold")),m.h("sp-button",{key:"2906871fa67987ab87a7619b7bb0b9ee09b3dca8",quiet:!0,onClick:()=>document.execCommand("underline")},m.h("div",{key:"b75c2a77ed80693f66b6bddcc9c7af13c474bd7d",slot:"icon"},m.h("underline-icon",{key:"733d5dd3fa2906c9ad4e6a212c3282315290f0bb"})),m.h("div",{key:"f59da34a2ef65a4339a5e5770acd41e1e4c0d4b1",slot:"label"},"Underline")),m.h("sp-button",{key:"5654719682fe352f5a060e1a947d52686dcbb91c",quiet:!0,onClick:()=>document.execCommand("italic")},m.h("div",{key:"650498d94ec07f8fd43d305637f189336aaac2a1",slot:"icon"},m.h("italic-icon",{key:"8f03281a56c6b35f17b7a7f5f10285f3be87d757"})),m.h("div",{key:"03ba08b7ffb8023b44bbd7a107f8767e7430a692",slot:"label"},"Italic")))),m.h("div",{key:"19cd7d52d3f24a440a6b4ae6beb75a680403d94d",class:"buttons"},m.h("sp-button",{key:"dfe307499781aa00e03de3316043a4d47bf349a5",onClick:this.sendComposer,class:"send"},"Send"),m.h("sp-button",{key:"c8d6a72d27723f1c2ac789d0a03d22b14ebfdec6",onClick:this.closeComposer,class:"close"},"Close"))))}get host(){return m.getElement(this)}static get watchers(){return{message:["watchBody"]}}};Lt.style=wn;const vn=":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)}}",Sn=vn;var Cn=function(t,o,u,s){var p=arguments.length,r=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,u):s,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,o,u,s);else for(var i=t.length-1;i>=0;i--)(f=t[i])&&(r=(p<3?f(r):p>3?f(o,u,r):f(o,u))||r);return p>3&&r&&Object.defineProperty(o,u,r),r},Fe=function(t,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,o)};const We=class{constructor(t){m.registerInstance(this,t),this.summarize=m.createEvent(this,"summarize",7),this.abortController=new AbortController,this.onClick=async o=>{var u,s;o.preventDefault(),o.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||(y.debug("[nylas-summarize-message-button] Default event not prevented, summarizing message"),this.audioRef&&(await this.audioRef.play().then(()=>{var r;return(r=this.audioRef)==null?void 0:r.pause()}).catch(r=>console.error("Error playing audio:",r)),await this.audioRef.play().catch(r=>console.error("Error playing audio:",r))))):this.state==="playing"?((u=this.abortController)==null||u.abort(),(s=this.audioRef)==null||s.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(){y.debug("[nylas-summarize-message-button] Component will load")}async componentDidLoad(){y.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 o=this.audioRef;if(!("MediaSource"in window)){const i=await t;if(i==null)throw new Error("ReadableStream not yet supported in this browser.");const l=i.getReader(),T=[];await this.readChunk(l,T);const _=new Blob(T,{type:"audio/mpeg"}),N=URL.createObjectURL(_);o.src=N;return}const u=new MediaSource;let s,p=!1;o.src=URL.createObjectURL(u),u.addEventListener("sourceopen",r);async function r(){s=u.addSourceBuffer("audio/mpeg"),s.addEventListener("updateend",f);const i=await t;if(i==null)throw new Error("ReadableStream not yet supported in this browser.");const l=i.getReader(),T=()=>{l.read().then(({done:_,value:N})=>{if(_){p=!0;return}s.updating||s.appendBuffer(N),T()}).catch(_=>{console.error("Error while fetching and appending chunks:",_)})};T(),o.paused&&o.play().catch(_=>console.error("Error playing audio:",_))}function f(){if(p){u.endOfStream(),u.removeEventListener("sourceopen",r),u.removeEventListener("sourceclose",()=>{y.debug("[nylas-summarize-message-button] Source closed")}),s.removeEventListener("updateend",f);return}}}async readChunk(t,o){return t.read().then(({done:u,value:s})=>u?o:(o.push(s),this.readChunk(t,o)))}render(){return m.h(m.Host,{key:"052c49f7b564274561da89404b06b490b993b1f0"},m.h("sp-theme",{key:"55b4965642873d51c445b4db4eac17119d6e0568",scale:"medium",color:"dark"},m.h("sp-button",{key:"c7bf00d3570f9129cdb3005d0e0877c95cb75466",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"&&m.h("play-icon",null),this.state==="loading"&&m.h("loading-icon",null),this.state==="playing"&&m.h("stop-icon",null)),m.h("audio",{key:"489a2f36807bf74313ca4ce0cdfe84682a614a34",ref:t=>this.audioRef=t,autoPlay:!0,onPlaying:()=>this.state="playing",onPause:()=>this.state="stopped",onEnded:()=>{this.state="stopped",y.debug("[nylas-summarize-message-button] Audio ended")}})))}};Cn([yn.RegisterComponent({name:"nylas-summarize-message-button",eventToProps:{summarize:async(t,o)=>{const{playAudio:u,updateState:s,abortController:p,message:r}=t.detail,f=y.htmlToPlainText(r.body||"");await s("loading");try{const i=await o.messages.summarizeText(f),l=o.messages.textToSpeech(i,p);await u(l)}catch(i){await s("stopped"),console.error("Error summarizing message:",i)}}},fireRegisterEvent:!0}),Fe("design:type",Function),Fe("design:paramtypes",[]),Fe("design:returntype",void 0)],We.prototype,"render",null);We.style=Sn;function P(t){return!window.matchMedia("(prefers-color-scheme: dark)").matches||!t?t:t==="transparent"?"color":t.startsWith("#")?Ln(t):t.startsWith("rgb")?Rt(t):t.startsWith("hsl")?Rn(t):kn(t)?Mn(t):t}function Ln(t){t.length<7&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const o=(255-parseInt(t.slice(1,3),16)).toString(16).padStart(2,"0"),u=(255-parseInt(t.slice(3,5),16)).toString(16).padStart(2,"0"),s=(255-parseInt(t.slice(5,7),16)).toString(16).padStart(2,"0");return`#${o}${u}${s}`}function Rt(t){var r;const o=(r=t.match(/\d+/g))==null?void 0:r.map(Number);if(!o)return t;const[u,s,p]=o;return`rgb(${255-u}, ${255-s}, ${255-p})`}function Rn(t){var r;const o=(r=t.match(/\d+\.?\d*/g))==null?void 0:r.map(Number);if(!o)return t;const[u,s,p]=o;return`hsl(${u}, ${s}%, ${100-p}%)`}function kn(t){return/^[a-z]+$/i.test(t)}function Mn(t){return Rt(Nn(t))}function Nn(t){return t.toLowerCase()==="red"?"rgb(255, 0, 0)":"rgb(0, 0, 0)"}function St(t){if(t instanceof HTMLStyleElement){let o=t.textContent;if(o){o=o.replaceAll(/@media\s*\(prefers-color-scheme:\s*(dark|light)\)\s*\{([^}]+)\}/g,"");const u=o.matchAll(/border-color:\s*([^;]+)/g);if(u)for(const i of u){const[l,T]=i,_=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");o=o.replaceAll(_,l.replace(T,P(T)))}const s=o.matchAll(/border:\s*([^;]+)/g);if(s)for(const i of s){const l=i[0].trim(),T=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),[_,N,U]=i[1].split(" ");o=o.replaceAll(T,l.replace(U,P(U)))}const p=o.matchAll(/background-color:\s*([^;]+)/g);if(p)for(const i of p){const[l,T]=i,_=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");o=o.replaceAll(_,l.replace(T,P(T))),y.debug("backgroundColor",{fullMatch:l,replace:l.replace(T,P(T)),color:T,invertColor:P(T)})}const r=o.matchAll(/background:\s*([^;]+)/g);if(r)for(const i of r){const l=i[0].trim(),T=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),[_,N,U]=i[1].split(" ");o=o.replaceAll(T,l.replace(U,P(U)))}const f=o.matchAll(/color:\s*([^;]+)/g);if(f)for(const i of f){const[l,T]=i,_=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");o=o.replaceAll(_,l.replace(T,P(T)))}t.textContent=o}}if(t instanceof HTMLElement){const o=window.getComputedStyle(t),u=o.color||t.style.color,s=o.backgroundColor||t.style.backgroundColor,p=o.borderColor||t.style.borderColor;u&&!s?t.style.color="":u&&s?(t.style.color=P(u),t.style.backgroundColor=P(s),y.debug("element",t),y.debug("computedStyle.color",u),y.debug("computedStyle.backgroundColor",s),y.debug("invertColor(color)",P(u)),y.debug("invertColor(backgroundColor)",P(s))):!u&&s&&(t.style.backgroundColor=""),p&&(y.debug("borderColor",p),t.style.borderColor=P(p)),t.hasAttribute("bgcolor")&&t.removeAttribute("bgcolor")}}function xn(t){St(t),t.querySelectorAll("*").forEach(u=>St(u))}var kt={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,o){(function(u,s){t.exports=s()})(En.commonjsGlobal,function(){const{entries:u,setPrototypeOf:s,isFrozen:p,getPrototypeOf:r,getOwnPropertyDescriptor:f}=Object;let{freeze:i,seal:l,create:T}=Object,{apply:_,construct:N}=typeof Reflect<"u"&&Reflect;i||(i=function(c){return c}),l||(l=function(c){return c}),_||(_=function(c,E,g){return c.apply(E,g)}),N||(N=function(c,E){return new c(...E)});const U=I(Array.prototype.forEach),ce=I(Array.prototype.pop),q=I(Array.prototype.push),X=I(String.prototype.toLowerCase),ne=I(String.prototype.toString),ye=I(String.prototype.match),W=I(String.prototype.replace),Dt=I(String.prototype.indexOf),Ot=I(String.prototype.trim),O=I(RegExp.prototype.test),oe=It(TypeError);function I(b){return function(c){for(var E=arguments.length,g=new Array(E>1?E-1:0),k=1;k<E;k++)g[k-1]=arguments[k];return _(b,c,g)}}function It(b){return function(){for(var c=arguments.length,E=new Array(c),g=0;g<c;g++)E[g]=arguments[g];return N(b,E)}}function h(b,c){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X;s&&s(b,null);let g=c.length;for(;g--;){let k=c[g];if(typeof k=="string"){const H=E(k);H!==k&&(p(c)||(c[g]=H),k=H)}b[k]=!0}return b}function Pt(b){for(let c=0;c<b.length;c++)f(b,c)===void 0&&(b[c]=null);return b}function G(b){const c=T(null);for(const[E,g]of u(b))f(b,E)!==void 0&&(Array.isArray(g)?c[E]=Pt(g):g&&typeof g=="object"&&g.constructor===Object?c[E]=G(g):c[E]=g);return c}function de(b,c){for(;b!==null;){const g=f(b,c);if(g){if(g.get)return I(g.get);if(typeof g.value=="function")return I(g.value)}b=r(b)}function E(g){return console.warn("fallback value for",g),null}return E}const qe=i(["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"]),Ee=i(["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"]),Te=i(["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"]),Ut=i(["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"]),Ae=i(["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"]),zt=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ge=i(["#text"]),$e=i(["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"]),_e=i(["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"]),Ye=i(["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"]),ue=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ht=l(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ft=l(/<%[\w\W]*|[\w\W]*%>/gm),Bt=l(/\${[\w\W]*}/gm),Wt=l(/^data-[\-\w.\u00B7-\uFFFF]/),qt=l(/^aria-[\-\w]+$/),je=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gt=l(/^(?:\w+script|data):/i),$t=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xe=l(/^html$/i);var Ve=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ht,ERB_EXPR:Ft,TMPLIT_EXPR:Bt,DATA_ATTR:Wt,ARIA_ATTR:qt,IS_ALLOWED_URI:je,IS_SCRIPT_OR_DATA:Gt,ATTR_WHITESPACE:$t,DOCTYPE_NAME:Xe});const Yt=function(){return typeof window>"u"?null:window},jt=function(c,E){if(typeof c!="object"||typeof c.createPolicy!="function")return null;let g=null;const k="data-tt-policy-suffix";E&&E.hasAttribute(k)&&(g=E.getAttribute(k));const H="dompurify"+(g?"#"+g:"");try{return c.createPolicy(H,{createHTML(V){return V},createScriptURL(V){return V}})}catch{return console.warn("TrustedTypes policy "+H+" could not be created."),null}};function Ze(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yt();const c=d=>Ze(d);if(c.version="3.0.8",c.removed=[],!b||!b.document||b.document.nodeType!==9)return c.isSupported=!1,c;let{document:E}=b;const g=E,k=g.currentScript,{DocumentFragment:H,HTMLTemplateElement:V,Node:we,Element:Ke,NodeFilter:ve,NamedNodeMap:Vt=b.NamedNodeMap||b.MozNamedAttrMap,HTMLFormElement:Zt,DOMParser:Kt,trustedTypes:me}=b,fe=Ke.prototype,Qt=de(fe,"cloneNode"),Jt=de(fe,"nextSibling"),en=de(fe,"childNodes"),Se=de(fe,"parentNode");if(typeof V=="function"){const d=E.createElement("template");d.content&&d.content.ownerDocument&&(E=d.content.ownerDocument)}let M,ie="";const{implementation:Ce,createNodeIterator:tn,createDocumentFragment:nn,getElementsByTagName:on}=E,{importNode:rn}=g;let z={};c.isSupported=typeof u=="function"&&typeof Se=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Le,ERB_EXPR:Re,TMPLIT_EXPR:ke,DATA_ATTR:an,ARIA_ATTR:sn,IS_SCRIPT_OR_DATA:ln,ATTR_WHITESPACE:Qe}=Ve;let{IS_ALLOWED_URI:Je}=Ve,v=null;const et=h({},[...qe,...Ee,...Te,...Ae,...Ge]);let S=null;const tt=h({},[...$e,..._e,...Ye,...ue]);let w=Object.seal(T(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}})),re=null,Me=null,nt=!0,Ne=!0,ot=!1,it=!0,Z=!1,$=!1,xe=!1,De=!1,K=!1,pe=!1,he=!1,rt=!0,at=!1;const cn="user-content-";let Oe=!0,ae=!1,Q={},J=null;const st=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 lt=null;const ct=h({},["audio","video","img","source","image","track"]);let Ie=null;const dt=h({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",be="http://www.w3.org/2000/svg",F="http://www.w3.org/1999/xhtml";let ee=F,Pe=!1,Ue=null;const dn=h({},[ge,be,F],ne);let se=null;const un=["application/xhtml+xml","text/html"],mn="text/html";let C=null,te=null;const fn=E.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},ze=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(te&&te===e)){if((!e||typeof e!="object")&&(e={}),e=G(e),se=un.indexOf(e.PARSER_MEDIA_TYPE)===-1?mn:e.PARSER_MEDIA_TYPE,C=se==="application/xhtml+xml"?ne:X,v="ALLOWED_TAGS"in e?h({},e.ALLOWED_TAGS,C):et,S="ALLOWED_ATTR"in e?h({},e.ALLOWED_ATTR,C):tt,Ue="ALLOWED_NAMESPACES"in e?h({},e.ALLOWED_NAMESPACES,ne):dn,Ie="ADD_URI_SAFE_ATTR"in e?h(G(dt),e.ADD_URI_SAFE_ATTR,C):dt,lt="ADD_DATA_URI_TAGS"in e?h(G(ct),e.ADD_DATA_URI_TAGS,C):ct,J="FORBID_CONTENTS"in e?h({},e.FORBID_CONTENTS,C):st,re="FORBID_TAGS"in e?h({},e.FORBID_TAGS,C):{},Me="FORBID_ATTR"in e?h({},e.FORBID_ATTR,C):{},Q="USE_PROFILES"in e?e.USE_PROFILES:!1,nt=e.ALLOW_ARIA_ATTR!==!1,Ne=e.ALLOW_DATA_ATTR!==!1,ot=e.ALLOW_UNKNOWN_PROTOCOLS||!1,it=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=e.SAFE_FOR_TEMPLATES||!1,$=e.WHOLE_DOCUMENT||!1,K=e.RETURN_DOM||!1,pe=e.RETURN_DOM_FRAGMENT||!1,he=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,rt=e.SANITIZE_DOM!==!1,at=e.SANITIZE_NAMED_PROPS||!1,Oe=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,Je=e.ALLOWED_URI_REGEXP||je,ee=e.NAMESPACE||F,w=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(w.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(Ne=!1),pe&&(K=!0),Q&&(v=h({},Ge),S=[],Q.html===!0&&(h(v,qe),h(S,$e)),Q.svg===!0&&(h(v,Ee),h(S,_e),h(S,ue)),Q.svgFilters===!0&&(h(v,Te),h(S,_e),h(S,ue)),Q.mathMl===!0&&(h(v,Ae),h(S,Ye),h(S,ue))),e.ADD_TAGS&&(v===et&&(v=G(v)),h(v,e.ADD_TAGS,C)),e.ADD_ATTR&&(S===tt&&(S=G(S)),h(S,e.ADD_ATTR,C)),e.ADD_URI_SAFE_ATTR&&h(Ie,e.ADD_URI_SAFE_ATTR,C),e.FORBID_CONTENTS&&(J===st&&(J=G(J)),h(J,e.FORBID_CONTENTS,C)),Oe&&(v["#text"]=!0),$&&h(v,["html","head","body"]),v.table&&(h(v,["tbody"]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw oe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw oe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=e.TRUSTED_TYPES_POLICY,ie=M.createHTML("")}else M===void 0&&(M=jt(me,k)),M!==null&&typeof ie=="string"&&(ie=M.createHTML(""));i&&i(e),te=e}},mt=h({},["mi","mo","mn","ms","mtext"]),ft=h({},["foreignobject","desc","title","annotation-xml"]),pn=h({},["title","style","font","a","script"]),pt=h({},[...Ee,...Te,...Ut]),ht=h({},[...Ae,...zt]),hn=function(e){let n=Se(e);(!n||!n.tagName)&&(n={namespaceURI:ee,tagName:"template"});const a=X(e.tagName),A=X(n.tagName);return Ue[e.namespaceURI]?e.namespaceURI===be?n.namespaceURI===F?a==="svg":n.namespaceURI===ge?a==="svg"&&(A==="annotation-xml"||mt[A]):!!pt[a]:e.namespaceURI===ge?n.namespaceURI===F?a==="math":n.namespaceURI===be?a==="math"&&ft[A]:!!ht[a]:e.namespaceURI===F?n.namespaceURI===be&&!ft[A]||n.namespaceURI===ge&&!mt[A]?!1:!ht[a]&&(pn[a]||!pt[a]):!!(se==="application/xhtml+xml"&&Ue[e.namespaceURI]):!1},Y=function(e){q(c.removed,{element:e});try{e.parentNode.removeChild(e)}catch{e.remove()}},He=function(e,n){try{q(c.removed,{attribute:n.getAttributeNode(e),from:n})}catch{q(c.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e==="is"&&!S[e])if(K||pe)try{Y(n)}catch{}else try{n.setAttribute(e,"")}catch{}},gt=function(e){let n=null,a=null;if(De)e="<remove></remove>"+e;else{const R=ye(e,/^[\r\n\t ]+/);a=R&&R[0]}se==="application/xhtml+xml"&&ee===F&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const A=M?M.createHTML(e):e;if(ee===F)try{n=new Kt().parseFromString(A,se)}catch{}if(!n||!n.documentElement){n=Ce.createDocument(ee,"template",null);try{n.documentElement.innerHTML=Pe?ie:A}catch{}}const L=n.body||n.documentElement;return e&&a&&L.insertBefore(E.createTextNode(a),L.childNodes[0]||null),ee===F?on.call(n,$?"html":"body")[0]:$?n.documentElement:L},bt=function(e){return tn.call(e.ownerDocument||e,e,ve.SHOW_ELEMENT|ve.SHOW_COMMENT|ve.SHOW_TEXT,null)},gn=function(e){return e instanceof Zt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Vt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},yt=function(e){return typeof we=="function"&&e instanceof we},B=function(e,n,a){z[e]&&U(z[e],A=>{A.call(c,n,a,te)})},Et=function(e){let n=null;if(B("beforeSanitizeElements",e,null),gn(e))return Y(e),!0;const a=C(e.nodeName);if(B("uponSanitizeElement",e,{tagName:a,allowedTags:v}),e.hasChildNodes()&&!yt(e.firstElementChild)&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return Y(e),!0;if(!v[a]||re[a]){if(!re[a]&&At(a)&&(w.tagNameCheck instanceof RegExp&&O(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a)))return!1;if(Oe&&!J[a]){const A=Se(e)||e.parentNode,L=en(e)||e.childNodes;if(L&&A){const R=L.length;for(let x=R-1;x>=0;--x)A.insertBefore(Qt(L[x],!0),Jt(e))}}return Y(e),!0}return e instanceof Ke&&!hn(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&O(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y(e),!0):(Z&&e.nodeType===3&&(n=e.textContent,U([Le,Re,ke],A=>{n=W(n,A," ")}),e.textContent!==n&&(q(c.removed,{element:e.cloneNode()}),e.textContent=n)),B("afterSanitizeElements",e,null),!1)},Tt=function(e,n,a){if(rt&&(n==="id"||n==="name")&&(a in E||a in fn))return!1;if(!(Ne&&!Me[n]&&O(an,n))){if(!(nt&&O(sn,n))){if(!S[n]||Me[n]){if(!(At(e)&&(w.tagNameCheck instanceof RegExp&&O(w.tagNameCheck,e)||w.tagNameCheck instanceof Function&&w.tagNameCheck(e))&&(w.attributeNameCheck instanceof RegExp&&O(w.attributeNameCheck,n)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(n))||n==="is"&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&O(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a))))return!1}else if(!Ie[n]){if(!O(Je,W(a,Qe,""))){if(!((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&Dt(a,"data:")===0&<[e])){if(!(ot&&!O(ln,W(a,Qe,"")))){if(a)return!1}}}}}}return!0},At=function(e){return e.indexOf("-")>0},_t=function(e){B("beforeSanitizeAttributes",e,null);const{attributes:n}=e;if(!n)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:S};let A=n.length;for(;A--;){const L=n[A],{name:R,namespaceURI:x,value:j}=L,le=C(R);let D=R==="value"?j:Ot(j);if(a.attrName=le,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,B("uponSanitizeAttribute",e,a),D=a.attrValue,a.forceKeepAttr||(He(R,e),!a.keepAttr))continue;if(!it&&O(/\/>/i,D)){He(R,e);continue}Z&&U([Le,Re,ke],vt=>{D=W(D,vt," ")});const wt=C(e.nodeName);if(Tt(wt,le,D)){if(at&&(le==="id"||le==="name")&&(He(R,e),D=cn+D),M&&typeof me=="object"&&typeof me.getAttributeType=="function"&&!x)switch(me.getAttributeType(wt,le)){case"TrustedHTML":{D=M.createHTML(D);break}case"TrustedScriptURL":{D=M.createScriptURL(D);break}}try{x?e.setAttributeNS(x,R,D):e.setAttribute(R,D),ce(c.removed)}catch{}}}B("afterSanitizeAttributes",e,null)},bn=function d(e){let n=null;const a=bt(e);for(B("beforeSanitizeShadowDOM",e,null);n=a.nextNode();)B("uponSanitizeShadowNode",n,null),!Et(n)&&(n.content instanceof H&&d(n.content),_t(n));B("afterSanitizeShadowDOM",e,null)};return c.sanitize=function(d){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,a=null,A=null,L=null;if(Pe=!d,Pe&&(d="<!-->"),typeof d!="string"&&!yt(d))if(typeof d.toString=="function"){if(d=d.toString(),typeof d!="string")throw oe("dirty is not a string, aborting")}else throw oe("toString is not a function");if(!c.isSupported)return d;if(xe||ze(e),c.removed=[],typeof d=="string"&&(ae=!1),ae){if(d.nodeName){const j=C(d.nodeName);if(!v[j]||re[j])throw oe("root node is forbidden and cannot be sanitized in-place")}}else if(d instanceof we)n=gt("<!---->"),a=n.ownerDocument.importNode(d,!0),a.nodeType===1&&a.nodeName==="BODY"||a.nodeName==="HTML"?n=a:n.appendChild(a);else{if(!K&&!Z&&!$&&d.indexOf("<")===-1)return M&&he?M.createHTML(d):d;if(n=gt(d),!n)return K?null:he?ie:""}n&&De&&Y(n.firstChild);const R=bt(ae?d:n);for(;A=R.nextNode();)Et(A)||(A.content instanceof H&&bn(A.content),_t(A));if(ae)return d;if(K){if(pe)for(L=nn.call(n.ownerDocument);n.firstChild;)L.appendChild(n.firstChild);else L=n;return(S.shadowroot||S.shadowrootmode)&&(L=rn.call(g,L,!0)),L}let x=$?n.outerHTML:n.innerHTML;return $&&v["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&O(Xe,n.ownerDocument.doctype.name)&&(x="<!DOCTYPE "+n.ownerDocument.doctype.name+`>
|
|
2
|
-
`+x),Z&&U([Le,Re,ke],j=>{x=W(x,j," ")}),M&&he?M.createHTML(x):x},c.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ze(d),xe=!0},c.clearConfig=function(){te=null,xe=!1},c.isValidAttribute=function(d,e,n){te||ze({});const a=C(d),A=C(e);return Tt(a,A,n)},c.addHook=function(d,e){typeof e=="function"&&(z[d]=z[d]||[],q(z[d],e))},c.removeHook=function(d){if(z[d])return ce(z[d])},c.removeHooks=function(d){z[d]&&(z[d]=[])},c.removeAllHooks=function(){z={}},c}var Xt=Ze();return Xt})})(kt);const Be=kt.exports,Dn=":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)}",On=Dn;Be.addHook("afterSanitizeAttributes",function(t){"target"in t&&(t.setAttribute("target","_blank"),t.setAttribute("rel","noopener"))});const Mt=class{constructor(t){
|
|
3
|
-
`).forEach(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index-457dcf0b.cjs"),y=require("./utils-0cd66d04-94b9c3b6.cjs"),yn=require("./register-component-d056a880-2be11c56.cjs"),En=require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");require("react");require("react-dom");const Tn=".sc-forward-icon-h{display:flex}",An=Tn,Ct=class{constructor(t){f.registerInstance(this,t),this.width="15",this.height="15"}render(){return f.h("svg",{key:"c3c406f225989a53006d7deef67a2dd8dd3d5d81",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},f.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"}))}};Ct.style=An;const _n=':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}',wn=_n,Lt=class{constructor(t){f.registerInstance(this,t),this.close=f.createEvent(this,"close",7),this.send=f.createEvent(this,"send",7),this.closeComposer=o=>{this.close.emit(o)},this.sendComposer=o=>{var s;if(!this.editorEl){y.debug("no editor element");return}const u=this.editorEl.querySelector(".message-body");if(!u){y.debug("no message body");return}this.message&&(this.send.emit({message:this.message,replyBody:((s=u.querySelector(".message-body"))==null?void 0:s.innerHTML)||""}),this.close.emit(o),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){y.debug("[connectedCallback] no editor element");return}if(!this.toolbarEl){y.debug("[connectedCallback] no toolbar element");return}const t=this.editorEl,o=this.toolbarEl;t.addEventListener("mouseup",u=>{var W;const s=(W=this.host.shadowRoot)==null?void 0:W.getSelection();if(!s){y.debug("no selection");return}const p=s.getRangeAt(0),r=s.toString();if(!r){o.style.display="none";return}const m=t.querySelector(".message-body");if(!m){y.debug("no message body");return}const l=p.commonAncestorContainer.parentElement;if(!l)return;const T=m.getBoundingClientRect();y.debug("messageBodyRect",{messageBodyRect:T});const _=l.getBoundingClientRect();y.debug("foundRect",{foundRect:_});const ce=(l.childNodes[0].textContent||"").indexOf(r),q=window.getComputedStyle(l).fontSize,X=parseInt(q.replace("px",""),10),ne=_.top-T.top-o.clientHeight,ye=ce*(1/X)*100;o.style.top=`${ne}px`,o.style.left=`${ye}px`,o.style.display="block"})}watchBody(t){var r;if(!this.editorEl){y.debug("no editor element");return}this.editorEl.querySelectorAll(".message-body").forEach(m=>m.remove());const o=document.createElement("div");o.classList.add("message-body");const u=document.createElement("p");u.innerHTML=" ",o.appendChild(u);const s=document.createElement("br");o.appendChild(s);const p=document.createElement("div");if(p.classList.add("reply-text"),p.innerText=`On ${new Date(t.date*1e3).toLocaleDateString(void 0,{dateStyle:"full"})} <${(r=t.from)==null?void 0:r.map(m=>m.name||m.email).join(", ")}> wrote:`,o.appendChild(p),t.body){const m=document.createElement("html");m.innerHTML=t.body;const i=document.createElement("blockquote");i.classList.add("collapsed"),i.classList.add("gmail_quote"),i.innerHTML=m.innerHTML,o.appendChild(i),y.debug("replyContainer",{replyContainer:i})}this.editorEl.appendChild(o),this.editorEl.querySelectorAll("blockquote.collapsed").forEach(m=>{m.addEventListener("click",function(i){i.preventDefault();const l=i.target;l.classList.remove("collapsed"),l.classList.add("expanded")},{once:!0})}),this.editorEl.focus()}render(){return f.h(f.Host,{key:"bf89c512a7bebc2d438c8ace6c36ddfdc70f4e9b"},f.h("sp-theme",{key:"20b57ce48fa2069c2d047a10d4756d0c4b931bb2",scale:"medium",color:"dark"},f.h("div",{key:"e89832859052769d38acf7d8297888b9146f5f30",class:"editor",contentEditable:!0,ref:t=>this.editorEl=t},f.h("div",{key:"4ab0148ad491259a14b280ac21f8b650f1ec3897",class:"toolbar",ref:t=>this.toolbarEl=t,contentEditable:!1},f.h("sp-button",{key:"6426f50ff6e3f98d6b65aebb99e5ed528dd03817",quiet:!0,onClick:()=>document.execCommand("bold")},f.h("div",{key:"38be22cd82acf14e31801e65f5190e07cb1bc124",slot:"icon"},f.h("bold-icon",{key:"c965237b13c0bf358f0937a27da3be305fbb94d3"})),f.h("div",{key:"935c3961fc590ee88cdc0d351704d078f179e692",slot:"label"},"Bold")),f.h("sp-button",{key:"51572cf863ce03a6814e4f2b5090ba899abce298",quiet:!0,onClick:()=>document.execCommand("underline")},f.h("div",{key:"b55f65bd672b467eff478ddac04907f8d1a8fc8b",slot:"icon"},f.h("underline-icon",{key:"c1251e0fd863dab56c1127dcfe650995da054ae7"})),f.h("div",{key:"63a575566653d4957a3fe51cb877b5d7418086c2",slot:"label"},"Underline")),f.h("sp-button",{key:"d678867388f1c0e8bec34cb2a4cc5f0158d3b327",quiet:!0,onClick:()=>document.execCommand("italic")},f.h("div",{key:"e6add93a87877e6701cd2877573e0c63c55c0ae6",slot:"icon"},f.h("italic-icon",{key:"fa5ad4323cd0cf31cb2d8a7c93ec2171fa776586"})),f.h("div",{key:"26c7f9d97e786c9e8e7e7e8b8d27dcfd2a5b0e50",slot:"label"},"Italic")))),f.h("div",{key:"367b9de03c23d6bb5e96f6d6e49f0d549eb92e37",class:"buttons"},f.h("sp-button",{key:"4e3e6a5ad05b285e68b2ef26fcebac1e54a71be2",onClick:this.sendComposer,class:"send"},"Send"),f.h("sp-button",{key:"e2444f4a64d500032fa90b6c539afa8e2567cb72",onClick:this.closeComposer,class:"close"},"Close"))))}get host(){return f.getElement(this)}static get watchers(){return{message:["watchBody"]}}};Lt.style=wn;const vn=":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)}}",Sn=vn;var Cn=function(t,o,u,s){var p=arguments.length,r=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,u):s,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,o,u,s);else for(var i=t.length-1;i>=0;i--)(m=t[i])&&(r=(p<3?m(r):p>3?m(o,u,r):m(o,u))||r);return p>3&&r&&Object.defineProperty(o,u,r),r},Fe=function(t,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,o)};const We=class{constructor(t){f.registerInstance(this,t),this.summarize=f.createEvent(this,"summarize",7),this.abortController=new AbortController,this.onClick=async o=>{var u,s;o.preventDefault(),o.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||(y.debug("[nylas-summarize-message-button] Default event not prevented, summarizing message"),this.audioRef&&(await this.audioRef.play().then(()=>{var r;return(r=this.audioRef)==null?void 0:r.pause()}).catch(r=>console.error("Error playing audio:",r)),await this.audioRef.play().catch(r=>console.error("Error playing audio:",r))))):this.state==="playing"?((u=this.abortController)==null||u.abort(),(s=this.audioRef)==null||s.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(){y.debug("[nylas-summarize-message-button] Component will load")}async componentDidLoad(){y.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 o=this.audioRef;if(!("MediaSource"in window)){const i=await t;if(i==null)throw new Error("ReadableStream not yet supported in this browser.");const l=i.getReader(),T=[];await this.readChunk(l,T);const _=new Blob(T,{type:"audio/mpeg"}),N=URL.createObjectURL(_);o.src=N;return}const u=new MediaSource;let s,p=!1;o.src=URL.createObjectURL(u),u.addEventListener("sourceopen",r);async function r(){s=u.addSourceBuffer("audio/mpeg"),s.addEventListener("updateend",m);const i=await t;if(i==null)throw new Error("ReadableStream not yet supported in this browser.");const l=i.getReader(),T=()=>{l.read().then(({done:_,value:N})=>{if(_){p=!0;return}s.updating||s.appendBuffer(N),T()}).catch(_=>{console.error("Error while fetching and appending chunks:",_)})};T(),o.paused&&o.play().catch(_=>console.error("Error playing audio:",_))}function m(){if(p){u.endOfStream(),u.removeEventListener("sourceopen",r),u.removeEventListener("sourceclose",()=>{y.debug("[nylas-summarize-message-button] Source closed")}),s.removeEventListener("updateend",m);return}}}async readChunk(t,o){return t.read().then(({done:u,value:s})=>u?o:(o.push(s),this.readChunk(t,o)))}render(){return f.h(f.Host,{key:"09d693158ce9480c000957afe31566d47f6fb5f2"},f.h("sp-theme",{key:"21f246783a3d5786c1cee8f438e89947ee5f574d",scale:"medium",color:"dark"},f.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"&&f.h("play-icon",null),this.state==="loading"&&f.h("loading-icon",null),this.state==="playing"&&f.h("stop-icon",null)),f.h("audio",{key:"7481ceeb62b6eb21c627d0e04be0e0e7a9e986ec",ref:t=>this.audioRef=t,autoPlay:!0,onPlaying:()=>this.state="playing",onPause:()=>this.state="stopped",onEnded:()=>{this.state="stopped",y.debug("[nylas-summarize-message-button] Audio ended")}})))}};Cn([yn.RegisterComponent({name:"nylas-summarize-message-button",eventToProps:{summarize:async(t,o)=>{const{playAudio:u,updateState:s,abortController:p,message:r}=t.detail,m=y.htmlToPlainText(r.body||"");await s("loading");try{const i=await o.messages.summarizeText(m),l=o.messages.textToSpeech(i,p);await u(l)}catch(i){await s("stopped"),console.error("Error summarizing message:",i)}}},fireRegisterEvent:!0}),Fe("design:type",Function),Fe("design:paramtypes",[]),Fe("design:returntype",void 0)],We.prototype,"render",null);We.style=Sn;function P(t){return!window.matchMedia("(prefers-color-scheme: dark)").matches||!t?t:t==="transparent"?"color":t.startsWith("#")?Ln(t):t.startsWith("rgb")?Rt(t):t.startsWith("hsl")?Rn(t):kn(t)?Mn(t):t}function Ln(t){t.length<7&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const o=(255-parseInt(t.slice(1,3),16)).toString(16).padStart(2,"0"),u=(255-parseInt(t.slice(3,5),16)).toString(16).padStart(2,"0"),s=(255-parseInt(t.slice(5,7),16)).toString(16).padStart(2,"0");return`#${o}${u}${s}`}function Rt(t){var r;const o=(r=t.match(/\d+/g))==null?void 0:r.map(Number);if(!o)return t;const[u,s,p]=o;return`rgb(${255-u}, ${255-s}, ${255-p})`}function Rn(t){var r;const o=(r=t.match(/\d+\.?\d*/g))==null?void 0:r.map(Number);if(!o)return t;const[u,s,p]=o;return`hsl(${u}, ${s}%, ${100-p}%)`}function kn(t){return/^[a-z]+$/i.test(t)}function Mn(t){return Rt(Nn(t))}function Nn(t){return t.toLowerCase()==="red"?"rgb(255, 0, 0)":"rgb(0, 0, 0)"}function St(t){if(t instanceof HTMLStyleElement){let o=t.textContent;if(o){o=o.replaceAll(/@media\s*\(prefers-color-scheme:\s*(dark|light)\)\s*\{([^}]+)\}/g,"");const u=o.matchAll(/border-color:\s*([^;]+)/g);if(u)for(const i of u){const[l,T]=i,_=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");o=o.replaceAll(_,l.replace(T,P(T)))}const s=o.matchAll(/border:\s*([^;]+)/g);if(s)for(const i of s){const l=i[0].trim(),T=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),[_,N,U]=i[1].split(" ");o=o.replaceAll(T,l.replace(U,P(U)))}const p=o.matchAll(/background-color:\s*([^;]+)/g);if(p)for(const i of p){const[l,T]=i,_=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");o=o.replaceAll(_,l.replace(T,P(T))),y.debug("backgroundColor",{fullMatch:l,replace:l.replace(T,P(T)),color:T,invertColor:P(T)})}const r=o.matchAll(/background:\s*([^;]+)/g);if(r)for(const i of r){const l=i[0].trim(),T=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),[_,N,U]=i[1].split(" ");o=o.replaceAll(T,l.replace(U,P(U)))}const m=o.matchAll(/color:\s*([^;]+)/g);if(m)for(const i of m){const[l,T]=i,_=l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");o=o.replaceAll(_,l.replace(T,P(T)))}t.textContent=o}}if(t instanceof HTMLElement){const o=window.getComputedStyle(t),u=o.color||t.style.color,s=o.backgroundColor||t.style.backgroundColor,p=o.borderColor||t.style.borderColor;u&&!s?t.style.color="":u&&s?(t.style.color=P(u),t.style.backgroundColor=P(s),y.debug("element",t),y.debug("computedStyle.color",u),y.debug("computedStyle.backgroundColor",s),y.debug("invertColor(color)",P(u)),y.debug("invertColor(backgroundColor)",P(s))):!u&&s&&(t.style.backgroundColor=""),p&&(y.debug("borderColor",p),t.style.borderColor=P(p)),t.hasAttribute("bgcolor")&&t.removeAttribute("bgcolor")}}function xn(t){St(t),t.querySelectorAll("*").forEach(u=>St(u))}var kt={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,o){(function(u,s){t.exports=s()})(En.commonjsGlobal,function(){const{entries:u,setPrototypeOf:s,isFrozen:p,getPrototypeOf:r,getOwnPropertyDescriptor:m}=Object;let{freeze:i,seal:l,create:T}=Object,{apply:_,construct:N}=typeof Reflect<"u"&&Reflect;i||(i=function(c){return c}),l||(l=function(c){return c}),_||(_=function(c,E,g){return c.apply(E,g)}),N||(N=function(c,E){return new c(...E)});const U=I(Array.prototype.forEach),ce=I(Array.prototype.pop),q=I(Array.prototype.push),X=I(String.prototype.toLowerCase),ne=I(String.prototype.toString),ye=I(String.prototype.match),W=I(String.prototype.replace),Dt=I(String.prototype.indexOf),Ot=I(String.prototype.trim),O=I(RegExp.prototype.test),oe=It(TypeError);function I(b){return function(c){for(var E=arguments.length,g=new Array(E>1?E-1:0),k=1;k<E;k++)g[k-1]=arguments[k];return _(b,c,g)}}function It(b){return function(){for(var c=arguments.length,E=new Array(c),g=0;g<c;g++)E[g]=arguments[g];return N(b,E)}}function h(b,c){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X;s&&s(b,null);let g=c.length;for(;g--;){let k=c[g];if(typeof k=="string"){const H=E(k);H!==k&&(p(c)||(c[g]=H),k=H)}b[k]=!0}return b}function Pt(b){for(let c=0;c<b.length;c++)m(b,c)===void 0&&(b[c]=null);return b}function G(b){const c=T(null);for(const[E,g]of u(b))m(b,E)!==void 0&&(Array.isArray(g)?c[E]=Pt(g):g&&typeof g=="object"&&g.constructor===Object?c[E]=G(g):c[E]=g);return c}function de(b,c){for(;b!==null;){const g=m(b,c);if(g){if(g.get)return I(g.get);if(typeof g.value=="function")return I(g.value)}b=r(b)}function E(g){return console.warn("fallback value for",g),null}return E}const qe=i(["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"]),Ee=i(["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"]),Te=i(["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"]),Ut=i(["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"]),Ae=i(["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"]),zt=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ge=i(["#text"]),$e=i(["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"]),_e=i(["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"]),Ye=i(["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"]),ue=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ht=l(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ft=l(/<%[\w\W]*|[\w\W]*%>/gm),Bt=l(/\${[\w\W]*}/gm),Wt=l(/^data-[\-\w.\u00B7-\uFFFF]/),qt=l(/^aria-[\-\w]+$/),je=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gt=l(/^(?:\w+script|data):/i),$t=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xe=l(/^html$/i);var Ve=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ht,ERB_EXPR:Ft,TMPLIT_EXPR:Bt,DATA_ATTR:Wt,ARIA_ATTR:qt,IS_ALLOWED_URI:je,IS_SCRIPT_OR_DATA:Gt,ATTR_WHITESPACE:$t,DOCTYPE_NAME:Xe});const Yt=function(){return typeof window>"u"?null:window},jt=function(c,E){if(typeof c!="object"||typeof c.createPolicy!="function")return null;let g=null;const k="data-tt-policy-suffix";E&&E.hasAttribute(k)&&(g=E.getAttribute(k));const H="dompurify"+(g?"#"+g:"");try{return c.createPolicy(H,{createHTML(V){return V},createScriptURL(V){return V}})}catch{return console.warn("TrustedTypes policy "+H+" could not be created."),null}};function Ze(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yt();const c=d=>Ze(d);if(c.version="3.0.8",c.removed=[],!b||!b.document||b.document.nodeType!==9)return c.isSupported=!1,c;let{document:E}=b;const g=E,k=g.currentScript,{DocumentFragment:H,HTMLTemplateElement:V,Node:we,Element:Ke,NodeFilter:ve,NamedNodeMap:Vt=b.NamedNodeMap||b.MozNamedAttrMap,HTMLFormElement:Zt,DOMParser:Kt,trustedTypes:fe}=b,me=Ke.prototype,Qt=de(me,"cloneNode"),Jt=de(me,"nextSibling"),en=de(me,"childNodes"),Se=de(me,"parentNode");if(typeof V=="function"){const d=E.createElement("template");d.content&&d.content.ownerDocument&&(E=d.content.ownerDocument)}let M,ie="";const{implementation:Ce,createNodeIterator:tn,createDocumentFragment:nn,getElementsByTagName:on}=E,{importNode:rn}=g;let z={};c.isSupported=typeof u=="function"&&typeof Se=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Le,ERB_EXPR:Re,TMPLIT_EXPR:ke,DATA_ATTR:an,ARIA_ATTR:sn,IS_SCRIPT_OR_DATA:ln,ATTR_WHITESPACE:Qe}=Ve;let{IS_ALLOWED_URI:Je}=Ve,v=null;const et=h({},[...qe,...Ee,...Te,...Ae,...Ge]);let S=null;const tt=h({},[...$e,..._e,...Ye,...ue]);let w=Object.seal(T(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}})),re=null,Me=null,nt=!0,Ne=!0,ot=!1,it=!0,Z=!1,$=!1,xe=!1,De=!1,K=!1,pe=!1,he=!1,rt=!0,at=!1;const cn="user-content-";let Oe=!0,ae=!1,Q={},J=null;const st=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 lt=null;const ct=h({},["audio","video","img","source","image","track"]);let Ie=null;const dt=h({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",be="http://www.w3.org/2000/svg",F="http://www.w3.org/1999/xhtml";let ee=F,Pe=!1,Ue=null;const dn=h({},[ge,be,F],ne);let se=null;const un=["application/xhtml+xml","text/html"],fn="text/html";let C=null,te=null;const mn=E.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},ze=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(te&&te===e)){if((!e||typeof e!="object")&&(e={}),e=G(e),se=un.indexOf(e.PARSER_MEDIA_TYPE)===-1?fn:e.PARSER_MEDIA_TYPE,C=se==="application/xhtml+xml"?ne:X,v="ALLOWED_TAGS"in e?h({},e.ALLOWED_TAGS,C):et,S="ALLOWED_ATTR"in e?h({},e.ALLOWED_ATTR,C):tt,Ue="ALLOWED_NAMESPACES"in e?h({},e.ALLOWED_NAMESPACES,ne):dn,Ie="ADD_URI_SAFE_ATTR"in e?h(G(dt),e.ADD_URI_SAFE_ATTR,C):dt,lt="ADD_DATA_URI_TAGS"in e?h(G(ct),e.ADD_DATA_URI_TAGS,C):ct,J="FORBID_CONTENTS"in e?h({},e.FORBID_CONTENTS,C):st,re="FORBID_TAGS"in e?h({},e.FORBID_TAGS,C):{},Me="FORBID_ATTR"in e?h({},e.FORBID_ATTR,C):{},Q="USE_PROFILES"in e?e.USE_PROFILES:!1,nt=e.ALLOW_ARIA_ATTR!==!1,Ne=e.ALLOW_DATA_ATTR!==!1,ot=e.ALLOW_UNKNOWN_PROTOCOLS||!1,it=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=e.SAFE_FOR_TEMPLATES||!1,$=e.WHOLE_DOCUMENT||!1,K=e.RETURN_DOM||!1,pe=e.RETURN_DOM_FRAGMENT||!1,he=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,rt=e.SANITIZE_DOM!==!1,at=e.SANITIZE_NAMED_PROPS||!1,Oe=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,Je=e.ALLOWED_URI_REGEXP||je,ee=e.NAMESPACE||F,w=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(w.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(Ne=!1),pe&&(K=!0),Q&&(v=h({},Ge),S=[],Q.html===!0&&(h(v,qe),h(S,$e)),Q.svg===!0&&(h(v,Ee),h(S,_e),h(S,ue)),Q.svgFilters===!0&&(h(v,Te),h(S,_e),h(S,ue)),Q.mathMl===!0&&(h(v,Ae),h(S,Ye),h(S,ue))),e.ADD_TAGS&&(v===et&&(v=G(v)),h(v,e.ADD_TAGS,C)),e.ADD_ATTR&&(S===tt&&(S=G(S)),h(S,e.ADD_ATTR,C)),e.ADD_URI_SAFE_ATTR&&h(Ie,e.ADD_URI_SAFE_ATTR,C),e.FORBID_CONTENTS&&(J===st&&(J=G(J)),h(J,e.FORBID_CONTENTS,C)),Oe&&(v["#text"]=!0),$&&h(v,["html","head","body"]),v.table&&(h(v,["tbody"]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw oe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw oe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=e.TRUSTED_TYPES_POLICY,ie=M.createHTML("")}else M===void 0&&(M=jt(fe,k)),M!==null&&typeof ie=="string"&&(ie=M.createHTML(""));i&&i(e),te=e}},ft=h({},["mi","mo","mn","ms","mtext"]),mt=h({},["foreignobject","desc","title","annotation-xml"]),pn=h({},["title","style","font","a","script"]),pt=h({},[...Ee,...Te,...Ut]),ht=h({},[...Ae,...zt]),hn=function(e){let n=Se(e);(!n||!n.tagName)&&(n={namespaceURI:ee,tagName:"template"});const a=X(e.tagName),A=X(n.tagName);return Ue[e.namespaceURI]?e.namespaceURI===be?n.namespaceURI===F?a==="svg":n.namespaceURI===ge?a==="svg"&&(A==="annotation-xml"||ft[A]):!!pt[a]:e.namespaceURI===ge?n.namespaceURI===F?a==="math":n.namespaceURI===be?a==="math"&&mt[A]:!!ht[a]:e.namespaceURI===F?n.namespaceURI===be&&!mt[A]||n.namespaceURI===ge&&!ft[A]?!1:!ht[a]&&(pn[a]||!pt[a]):!!(se==="application/xhtml+xml"&&Ue[e.namespaceURI]):!1},Y=function(e){q(c.removed,{element:e});try{e.parentNode.removeChild(e)}catch{e.remove()}},He=function(e,n){try{q(c.removed,{attribute:n.getAttributeNode(e),from:n})}catch{q(c.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e==="is"&&!S[e])if(K||pe)try{Y(n)}catch{}else try{n.setAttribute(e,"")}catch{}},gt=function(e){let n=null,a=null;if(De)e="<remove></remove>"+e;else{const R=ye(e,/^[\r\n\t ]+/);a=R&&R[0]}se==="application/xhtml+xml"&&ee===F&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const A=M?M.createHTML(e):e;if(ee===F)try{n=new Kt().parseFromString(A,se)}catch{}if(!n||!n.documentElement){n=Ce.createDocument(ee,"template",null);try{n.documentElement.innerHTML=Pe?ie:A}catch{}}const L=n.body||n.documentElement;return e&&a&&L.insertBefore(E.createTextNode(a),L.childNodes[0]||null),ee===F?on.call(n,$?"html":"body")[0]:$?n.documentElement:L},bt=function(e){return tn.call(e.ownerDocument||e,e,ve.SHOW_ELEMENT|ve.SHOW_COMMENT|ve.SHOW_TEXT,null)},gn=function(e){return e instanceof Zt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Vt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},yt=function(e){return typeof we=="function"&&e instanceof we},B=function(e,n,a){z[e]&&U(z[e],A=>{A.call(c,n,a,te)})},Et=function(e){let n=null;if(B("beforeSanitizeElements",e,null),gn(e))return Y(e),!0;const a=C(e.nodeName);if(B("uponSanitizeElement",e,{tagName:a,allowedTags:v}),e.hasChildNodes()&&!yt(e.firstElementChild)&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return Y(e),!0;if(!v[a]||re[a]){if(!re[a]&&At(a)&&(w.tagNameCheck instanceof RegExp&&O(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a)))return!1;if(Oe&&!J[a]){const A=Se(e)||e.parentNode,L=en(e)||e.childNodes;if(L&&A){const R=L.length;for(let x=R-1;x>=0;--x)A.insertBefore(Qt(L[x],!0),Jt(e))}}return Y(e),!0}return e instanceof Ke&&!hn(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&O(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y(e),!0):(Z&&e.nodeType===3&&(n=e.textContent,U([Le,Re,ke],A=>{n=W(n,A," ")}),e.textContent!==n&&(q(c.removed,{element:e.cloneNode()}),e.textContent=n)),B("afterSanitizeElements",e,null),!1)},Tt=function(e,n,a){if(rt&&(n==="id"||n==="name")&&(a in E||a in mn))return!1;if(!(Ne&&!Me[n]&&O(an,n))){if(!(nt&&O(sn,n))){if(!S[n]||Me[n]){if(!(At(e)&&(w.tagNameCheck instanceof RegExp&&O(w.tagNameCheck,e)||w.tagNameCheck instanceof Function&&w.tagNameCheck(e))&&(w.attributeNameCheck instanceof RegExp&&O(w.attributeNameCheck,n)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(n))||n==="is"&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&O(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a))))return!1}else if(!Ie[n]){if(!O(Je,W(a,Qe,""))){if(!((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&Dt(a,"data:")===0&<[e])){if(!(ot&&!O(ln,W(a,Qe,"")))){if(a)return!1}}}}}}return!0},At=function(e){return e.indexOf("-")>0},_t=function(e){B("beforeSanitizeAttributes",e,null);const{attributes:n}=e;if(!n)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:S};let A=n.length;for(;A--;){const L=n[A],{name:R,namespaceURI:x,value:j}=L,le=C(R);let D=R==="value"?j:Ot(j);if(a.attrName=le,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,B("uponSanitizeAttribute",e,a),D=a.attrValue,a.forceKeepAttr||(He(R,e),!a.keepAttr))continue;if(!it&&O(/\/>/i,D)){He(R,e);continue}Z&&U([Le,Re,ke],vt=>{D=W(D,vt," ")});const wt=C(e.nodeName);if(Tt(wt,le,D)){if(at&&(le==="id"||le==="name")&&(He(R,e),D=cn+D),M&&typeof fe=="object"&&typeof fe.getAttributeType=="function"&&!x)switch(fe.getAttributeType(wt,le)){case"TrustedHTML":{D=M.createHTML(D);break}case"TrustedScriptURL":{D=M.createScriptURL(D);break}}try{x?e.setAttributeNS(x,R,D):e.setAttribute(R,D),ce(c.removed)}catch{}}}B("afterSanitizeAttributes",e,null)},bn=function d(e){let n=null;const a=bt(e);for(B("beforeSanitizeShadowDOM",e,null);n=a.nextNode();)B("uponSanitizeShadowNode",n,null),!Et(n)&&(n.content instanceof H&&d(n.content),_t(n));B("afterSanitizeShadowDOM",e,null)};return c.sanitize=function(d){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,a=null,A=null,L=null;if(Pe=!d,Pe&&(d="<!-->"),typeof d!="string"&&!yt(d))if(typeof d.toString=="function"){if(d=d.toString(),typeof d!="string")throw oe("dirty is not a string, aborting")}else throw oe("toString is not a function");if(!c.isSupported)return d;if(xe||ze(e),c.removed=[],typeof d=="string"&&(ae=!1),ae){if(d.nodeName){const j=C(d.nodeName);if(!v[j]||re[j])throw oe("root node is forbidden and cannot be sanitized in-place")}}else if(d instanceof we)n=gt("<!---->"),a=n.ownerDocument.importNode(d,!0),a.nodeType===1&&a.nodeName==="BODY"||a.nodeName==="HTML"?n=a:n.appendChild(a);else{if(!K&&!Z&&!$&&d.indexOf("<")===-1)return M&&he?M.createHTML(d):d;if(n=gt(d),!n)return K?null:he?ie:""}n&&De&&Y(n.firstChild);const R=bt(ae?d:n);for(;A=R.nextNode();)Et(A)||(A.content instanceof H&&bn(A.content),_t(A));if(ae)return d;if(K){if(pe)for(L=nn.call(n.ownerDocument);n.firstChild;)L.appendChild(n.firstChild);else L=n;return(S.shadowroot||S.shadowrootmode)&&(L=rn.call(g,L,!0)),L}let x=$?n.outerHTML:n.innerHTML;return $&&v["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&O(Xe,n.ownerDocument.doctype.name)&&(x="<!DOCTYPE "+n.ownerDocument.doctype.name+`>
|
|
2
|
+
`+x),Z&&U([Le,Re,ke],j=>{x=W(x,j," ")}),M&&he?M.createHTML(x):x},c.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ze(d),xe=!0},c.clearConfig=function(){te=null,xe=!1},c.isValidAttribute=function(d,e,n){te||ze({});const a=C(d),A=C(e);return Tt(a,A,n)},c.addHook=function(d,e){typeof e=="function"&&(z[d]=z[d]||[],q(z[d],e))},c.removeHook=function(d){if(z[d])return ce(z[d])},c.removeHooks=function(d){z[d]&&(z[d]=[])},c.removeAllHooks=function(){z={}},c}var Xt=Ze();return Xt})})(kt);const Be=kt.exports,Dn=":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)}",On=Dn;Be.addHook("afterSanitizeAttributes",function(t){"target"in t&&(t.setAttribute("target","_blank"),t.setAttribute("rel","noopener"))});const Mt=class{constructor(t){f.registerInstance(this,t),this.htmlElement=document.createElement("html"),this.setBody=o=>{var p;this.state="loading",this.styles=[],this.hoistedFontURLs=new Map,this.sanitizedBody="",document.querySelectorAll(".nylas-view-email-font").forEach(r=>{r.remove()}),(this.message?y.detectIfMessageIsHTML(this.message):y.detectHTMLOrPlainText(o))||(o=`<html><body>${y.parsePlainTextToHTML(o)}</body></html>`),this.htmlElement.innerHTML=o,this.detectDarkMode&&xn(this.htmlElement),this.htmlElement.querySelectorAll("link").forEach(r=>{if(console.debug(`[nylas-view-email] Hoisting link: ${r.getAttribute("href")}`),r.getAttribute("rel")==="stylesheet"&&r.getAttribute("href")){const m=r.getAttribute("href");if(m){const i=new URL(m,window.location.href);(i.protocol==="https:"||i.protocol==="http:")&&this.hoistedFontURLs.set(i.href,i.href)}}}),this.htmlElement.querySelectorAll("style").forEach(r=>{r.innerHTML.split(`
|
|
3
|
+
`).forEach(m=>{const i=m.match(/@import url\((.*)\)/);if(i){const l=new URL(i[1],window.location.href);(l.protocol==="https:"||l.protocol==="http:")&&this.hoistedFontURLs.set(l.href,l.href)}}),r.innerHTML=r.innerHTML.replace("body",":host"),this.styles.push(r),r.remove()}),this.htmlElement.querySelectorAll("a").forEach(r=>{r.setAttribute("target","_blank")});const s=this.htmlElement.querySelector(".gmail_quote");if(s){const r=document.createElement("button");r.classList.add("nylas-view-email-toggle-button"),r.setAttribute("aria-label","Show quoted text"),r.innerText="...",(p=s.parentElement)==null||p.insertBefore(r,s)}this.sanitizedBody=Be.sanitize(this.htmlElement.innerHTML),this.hoistedFontURLs.forEach((r,m)=>{const i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",r),i.classList.add("nylas-view-email-font"),document.head.appendChild(i)}),this.state="ready"},this.handleMobileSize=()=>{var u,s,p,r;const o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0);if(o<=768){const m=(u=this.viewEmailElement)==null?void 0:u.getBoundingClientRect();if(m&&this.viewEmailElement&&this.parent&&m.width>o){const i=this.parent,l=i==null?void 0:i.getBoundingClientRect();y.debug("Parent width:",l==null?void 0:l.width,"Parent height:",l==null?void 0:l.height),y.debug("Parent client width:",i.clientWidth,"Parent client height:",i.clientHeight);const T=l.width/m.width,_=l.height/m.height,N=Math.min(T,_);y.debug("Scale:",N),this.viewEmailElement.style.setProperty("transform",`scale(${N})`),this.viewEmailElement.style.setProperty("transform-origin","top left"),this.viewEmailElement.style.setProperty("height",`${m.height*N}px`)}}else(s=this.viewEmailElement)==null||s.style.removeProperty("transform"),(p=this.viewEmailElement)==null||p.style.removeProperty("transform-origin"),(r=this.viewEmailElement)==null||r.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(){y.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;y.debug("[nylas-view-email] component loaded"),this.setBody(((t=this.message)==null?void 0:t.body)??"")}async componentDidLoad(){y.debug("[nylas-view-thread] Component did load"),this.handleMobileSize()}async messageChanged(){var t;y.debug("[nylas-view-thread] Message changed",{message:this.message}),this.setBody(((t=this.message)==null?void 0:t.body)??"")}handleScroll(){this.handleMobileSize()}viewEmailElementChanged(){var o;const t=(o=this.viewEmailElement)==null?void 0:o.querySelectorAll(".nylas-view-email-toggle-button");t&&t.forEach(u=>{u.addEventListener("click",()=>{var p;const s=(p=this.viewEmailElement)==null?void 0:p.querySelector(".gmail_quote");s&&s.classList.toggle("show")})})}render(){return console.debug("[nylas-view-email] render",{hoistedFontURLs:this.hoistedFontURLs}),f.h(f.Host,{key:"775312a84231b72dea1236b793bb241966e4ce75"},this.state==="loading"&&f.h("div",null,"Loading..."),this.state==="ready"&&f.h(f.Fragment,null,this.styles.map(t=>f.h("style",null,Be.sanitize(t.innerHTML))),f.h("div",{class:"view-email",part:"view-email",innerHTML:this.sanitizedBody,ref:t=>this.viewEmailElement=t})))}get host(){return f.getElement(this)}static get watchers(){return{message:["messageChanged"],viewEmailElement:["viewEmailElementChanged"]}}};Mt.style=On;const In=".sc-reply-all-icon-h{display:flex}",Pn=In,Nt=class{constructor(t){f.registerInstance(this,t),this.width="15",this.height="15"}render(){return f.h("svg",{key:"0a4fcd5d01b49a9acbede9cf5927f33bc622415c",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},f.h("path",{key:"78a04b55275bbf6fc433df906946526fc3aeac0e",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"}))}};Nt.style=Pn;const Un=".sc-reply-icon-h{display:flex}",zn=Un,xt=class{constructor(t){f.registerInstance(this,t),this.width="15",this.height="15"}render(){return f.h("svg",{key:"0f7f56a9b5e1d57a1b6c5b279fe8178bfe91d2fc",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},f.h("path",{key:"5a2c46491f3652e56c892ad1efb7619eb10a0d15",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"}))}};xt.style=zn;exports.forward_icon=Ct;exports.nylas_composer=Lt;exports.nylas_summarize_message_button=We;exports.nylas_view_email=Mt;exports.reply_all_icon=Nt;exports.reply_icon=xt;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as e, h as C } from "./index-ce40ad47.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(
|
|
6
|
-
|
|
5
|
+
constructor(t) {
|
|
6
|
+
e(this, t), this.width = "16", this.height = "16";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return C("svg", { key: "
|
|
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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-457dcf0b.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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as T, u as or,
|
|
2
|
-
import { a as fn, f as pn } from "./index-
|
|
1
|
+
import { d as T, u as or, c as dn } from "./utils-0cd66d04-89ab163d.js";
|
|
2
|
+
import { a as fn, f as pn } from "./index-ce40ad47.js";
|
|
3
3
|
class ar {
|
|
4
4
|
constructor(e, n, r = !0, s) {
|
|
5
5
|
this.automaticComponentRegistration = !0, this.registeredComponents = {}, this.propStateRegistrations = /* @__PURE__ */ new Map(), this.eventListenerRegistrations = /* @__PURE__ */ new Map(), this.host = e, this.stores = n, this.automaticComponentRegistration = r, this.eventOverrides = s, T(`[${this.hostTagName}] Initializing (abstract) provider.`, { eventOverrides: s }), this.registerComponent = this.registerComponent.bind(this), this.getStore = this.getStore.bind(this), Object.keys(this.stores).forEach((i) => {
|
|
@@ -64,7 +64,7 @@ class ar {
|
|
|
64
64
|
const { stateToProps: r, getStoresToProp: s, eventToProps: i, storeToProps: o, connectorToProp: u, element: a } = e;
|
|
65
65
|
a.dataset.nylasId = or(), this.registeredComponents[a.dataset.nylasId] = e;
|
|
66
66
|
const l = this.eventOverrides;
|
|
67
|
-
i == null || i.forEach((h, c) => {
|
|
67
|
+
console.log("eventOverrides", l, e.name, i), i == null || i.forEach((h, c) => {
|
|
68
68
|
var y;
|
|
69
69
|
const d = this.nylasConnector, m = async (g) => {
|
|
70
70
|
T(`[${this.hostTagName}] Handling "${e.name}" prop "${String(c)}" event.`, { event: g }), c in l && (T(`[${this.hostTagName}] Found event override for "${String(c)}" event. Calling override.`), await l[c](g, d)), g.defaultPrevented || await h(g, d);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const T=require("./utils-5074a070-d5ba6add.cjs"),Ye=require("./index-586a4206.cjs");class ir{constructor(e,n,r=!0,s){this.automaticComponentRegistration=!0,this.registeredComponents={},this.propStateRegistrations=new Map,this.eventListenerRegistrations=new Map,this.host=e,this.stores=n,this.automaticComponentRegistration=r,this.eventOverrides=s,T.debug(`[${this.hostTagName}] Initializing (abstract) provider.`,{eventOverrides:s}),this.registerComponent=this.registerComponent.bind(this),this.getStore=this.getStore.bind(this),Object.keys(this.stores).forEach(i=>{this.propStateRegistrations.set(i,new Map)})}async componentWillLoad(e){T.debug(`[${this.hostTagName}] Will load`),this.setupStoreListeners(),this.nylasConnector=e;const n=Array.from(this.host.querySelectorAll("*")).filter(r=>r.tagName.toLowerCase().startsWith("nylas-"));T.debug(`[${this.hostTagName}] Found ${n.length} child component(s).`,{childComponents:n}),n.forEach(r=>{const s=r;if(!s){T.debug(`[~${this.hostTagName}] Component ${s.tagName} does not have a name. Skipping.`);return}if(!s.registerNylasComponent){T.debug(`[~${this.hostTagName}] Component ${s.tagName} is not a component that can be registered. Skipping.`,{component:s});return}const i={element:s,name:s.tagName.toLowerCase(),getStoresToProp:s.getStoresToProp,storeToProps:s.storeToProps,stateToProps:s.stateToProps,authToProp:s.authToProp,eventToProps:s.eventToProps,connectorToProp:s.connectorToProp};this.registerComponent(i)})}async componentDidLoad(){T.debug(`[${this.hostTagName}] Did load`)}async componentDisconnected(){Object.values(this.stores).forEach(e=>{e.dispose()})}async registerComponentHandler(e){if(e.stopPropagation(),!this.automaticComponentRegistration){T.debug(`[${this.hostTagName}] Automatic component registration disabled. Skipping registration of ${e.detail.name}.`);return}this.registerComponent(e.detail)}async unregisterComponentHandler(e){if(e.stopPropagation(),!this.automaticComponentRegistration){T.debug(`[${this.hostTagName}] Automatic component registration disabled. Skipping unregistration of ${e.detail.name}.`);return}this.unregisterComponent(e.detail)}registerComponent(e){T.debug(`[${this.hostTagName}] Registering component ${e.name}.`);const n=e.element.dataset.nylasId;if(n&&this.registeredComponents[n]){T.debug(`[${this.hostTagName}] Component ${e.name} already registered. Skipping.`);return}const{stateToProps:r,getStoresToProp:s,eventToProps:i,storeToProps:o,connectorToProp:u,element:a}=e;a.dataset.nylasId=T.uniqueID(),this.registeredComponents[a.dataset.nylasId]=e;const l=this.eventOverrides;i==null||i.forEach((h,c)=>{var y;const d=this.nylasConnector,g=async m=>{T.debug(`[${this.hostTagName}] Handling "${e.name}" prop "${String(c)}" event.`,{event:m}),c in l&&(T.debug(`[${this.hostTagName}] Found event override for "${String(c)}" event. Calling override.`),await l[c](m,d)),m.defaultPrevented||await h(m,d)},p=e.element.dataset.nylasId;p&&!this.eventListenerRegistrations.has(p)&&this.eventListenerRegistrations.set(p,[]),p&&((y=this.eventListenerRegistrations.get(p))==null||y.push([a,c,g])),T.debug(`[${this.hostTagName}] Setting "${e.name}" event "${String(c)}" to automcially call NylasConnector method.`);const f=T.formatEventName(c.toString());T.debug(`[${this.hostTagName}] Adding event listener for "${f}" on "${a.tagName}"`),a.addEventListener(f,g)}),r==null||r.forEach((h,c)=>{var y,m,v,b;const[d,g]=c.split("."),f=this.getStore(d).state[g];if(!a.dataset.nylasId){T.debug(`[${this.hostTagName}] Component "${e.name}" not registered. Skipping.`,{component:e});return}this.propStateRegistrations.has(d)||this.propStateRegistrations.set(d,new Map),(y=this.propStateRegistrations.get(d))!=null&&y.has(g)?(b=(v=this.propStateRegistrations.get(d))==null?void 0:v.get(g))==null||b.push({elementId:a.dataset.nylasId,propKey:h}):(m=this.propStateRegistrations.get(d))==null||m.set(g,[{elementId:a.dataset.nylasId,propKey:h}]),a[h.toString()]=f,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" value.`,{stateValue:f})}),s&&(a[s==null?void 0:s.toString()]=this.getStore,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)),o==null||o.forEach((h,c)=>{const d=this.getStore(c);a[h.toString()]=d,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" store.`,{store:d})}),u&&(a[u==null?void 0:u.toString()]=this.nylasConnector,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`,{connectorToProp:u})),T.debug(`[${this.hostTagName}] Component ${e.name} registered.`)}unregisterComponent(e){T.debug(`[${this.hostTagName}] Unregistering component ${e.name}.`);const n=e.element.dataset.nylasId;if(!n){T.debug(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);return}if(this.registeredComponents[n]){T.debug(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);return}this.propStateRegistrations.forEach((s,i)=>{s.forEach((o,u)=>{var h,c;const a=(h=this.propStateRegistrations.get(i))==null?void 0:h.get(u),l=a==null?void 0:a.filter(d=>d.elementId!==n);l&&((c=this.propStateRegistrations.get(i))==null||c.set(u,l))})});const r=this.eventListenerRegistrations.get(n);r==null||r.forEach(([s,i,o])=>{const u=T.formatEventName(i.toString());T.debug(`[${this.hostTagName}] Removing event listener for "${u}" on "${s.tagName}"`),s.removeEventListener(u,o)}),delete this.registeredComponents[n]}getStore(e){const n=this.stores[e];if(!n)throw new Error(`[${this.hostTagName}] Store "${e.toString()}" not found.`);return n}async setupStoreListeners(){const e=this;Object.entries(this.stores).forEach(([n,r])=>{T.debug(`[${e.hostTagName}] Listening for changes in "${n}" store.`),r.use({set(s,i,o){var l;if(T.debug(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" changed`,{newValue:i,oldValue:o}),i===o){T.debug(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" unchanged. Skipping.`);return}const u=e.registeredComponents;if(!u){T.debug(`[${e.hostTagName}] No registered components found. Skipping.`);return}const a=((l=e.propStateRegistrations.get(n))==null?void 0:l.get(s.toString()))||[];T.debug(`[${e.hostTagName}] Found ${a.length} prop(s) registered for "${s.toString()}" store.`,{props:a,propStateRegistrations:e.propStateRegistrations}),a.forEach(({elementId:h,propKey:c})=>{const d=u[h];if(!d){T.debug(`[${e.hostTagName}] Component "${h}" not found. Skipping.`,{component:d});return}const p=e.getStore(n).state[s];d.element[c.toString()]=p,T.debug(`[${e.hostTagName}] Setting "${d.name}" prop "${c.toString()}" to "${s.toString()}" value.`,{stateValue:p})})}})})}get hostTagName(){var e,n;return((n=(e=this.host)==null?void 0:e.tagName)==null?void 0:n.toLowerCase())??"nylas-provider"}}class or extends ir{}var ar=Object.defineProperty,ur=(t,e,n)=>e in t?ar(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ct=(t,e,n)=>(ur(t,typeof e!="symbol"?e+"":e,n),n),Cn=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(Cn||{});const cr=t=>"error"in t;class lr extends Error{constructor(e){super(e==null?void 0:e.message),ct(this,"apiError"),this.name="NylasAPIError",this.stack=new Error().stack,this.apiError=e}}async function fn(t){const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e),r=Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("");return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const R=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$=Object.keys,F=Array.isArray;function U(t,e){return typeof e!="object"||$(e).forEach(function(n){t[n]=e[n]}),t}typeof Promise>"u"||R.Promise||(R.Promise=Promise);const Be=Object.getPrototypeOf,hr={}.hasOwnProperty;function z(t,e){return hr.call(t,e)}function Ee(t,e){typeof e=="function"&&(e=e(Be(t))),(typeof Reflect>"u"?$:Reflect.ownKeys)(e).forEach(n=>{ee(t,n,e[n])})}const Tn=Object.defineProperty;function ee(t,e,n,r){Tn(t,e,U(n&&z(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function ke(t){return{from:function(e){return t.prototype=Object.create(e.prototype),ee(t.prototype,"constructor",t),{extend:Ee.bind(null,t.prototype)}}}}const dr=Object.getOwnPropertyDescriptor;function en(t,e){let n;return dr(t,e)||(n=Be(t))&&en(n,e)}const fr=[].slice;function lt(t,e,n){return fr.call(t,e,n)}function An(t,e){return e(t)}function Ie(t){if(!t)throw new Error("Assertion Failed")}function On(t){R.setImmediate?setImmediate(t):setTimeout(t,0)}function In(t,e){return t.reduce((n,r,s)=>{var i=e(r,s);return i&&(n[i[0]]=i[1]),n},{})}function te(t,e){if(z(t,e))return t[e];if(!e)return t;if(typeof e!="string"){for(var n=[],r=0,s=e.length;r<s;++r){var i=te(t,e[r]);n.push(i)}return n}var o=e.indexOf(".");if(o!==-1){var u=t[e.substr(0,o)];return u===void 0?void 0:te(u,e.substr(o+1))}}function H(t,e,n){if(t&&e!==void 0&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if(typeof e!="string"&&"length"in e){Ie(typeof n!="string"&&"length"in n);for(var r=0,s=e.length;r<s;++r)H(t,e[r],n[r])}else{var i=e.indexOf(".");if(i!==-1){var o=e.substr(0,i),u=e.substr(i+1);if(u==="")n===void 0?F(t)&&!isNaN(parseInt(o))?t.splice(o,1):delete t[o]:t[o]=n;else{var a=t[o];a&&z(t,o)||(a=t[o]={}),H(a,u,n)}}else n===void 0?F(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function Rn(t){var e={};for(var n in t)z(t,n)&&(e[n]=t[n]);return e}const pr=[].concat;function Kn(t){return pr.apply([],t)}const jn="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Kn([8,16,32,64].map(t=>["Int","Uint","Float"].map(e=>e+t+"Array")))).filter(t=>R[t]),gr=jn.map(t=>R[t]);In(jn,t=>[t,!0]);let se=null;function We(t){se=typeof WeakMap<"u"&&new WeakMap;const e=At(t);return se=null,e}function At(t){if(!t||typeof t!="object")return t;let e=se&&se.get(t);if(e)return e;if(F(t)){e=[],se&&se.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(At(t[n]))}else if(gr.indexOf(t.constructor)>=0)e=t;else{const i=Be(t);for(var s in e=i===Object.prototype?{}:Object.create(i),se&&se.set(t,e),t)z(t,s)&&(e[s]=At(t[s]))}return e}const{toString:mr}={};function Ot(t){return mr.call(t).slice(8,-1)}const It=typeof Symbol<"u"?Symbol.iterator:"@@iterator",yr=typeof It=="symbol"?function(t){var e;return t!=null&&(e=t[It])&&e.apply(t)}:function(){return null},_e={};function J(t){var e,n,r,s;if(arguments.length===1){if(F(t))return t.slice();if(this===_e&&typeof t=="string")return[t];if(s=yr(t)){for(n=[];!(r=s.next()).done;)n.push(r.value);return n}if(t==null)return[t];if(typeof(e=t.length)=="number"){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n}const tn=typeof Symbol<"u"?t=>t[Symbol.toStringTag]==="AsyncFunction":()=>!1;var G=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Dn(t,e){G=t,$n=e}var $n=()=>!0;const vr=!new Error("").stack;function Pe(){if(vr)try{throw new Error}catch(t){return t}return new Error}function Rt(t,e){var n=t.stack;return n?(e=e||0,n.indexOf(t.name)===0&&(e+=(t.name+t.message).split(`
|
|
1
|
+
"use strict";const T=require("./utils-0cd66d04-94b9c3b6.cjs"),Ye=require("./index-457dcf0b.cjs");class ir{constructor(e,n,r=!0,s){this.automaticComponentRegistration=!0,this.registeredComponents={},this.propStateRegistrations=new Map,this.eventListenerRegistrations=new Map,this.host=e,this.stores=n,this.automaticComponentRegistration=r,this.eventOverrides=s,T.debug(`[${this.hostTagName}] Initializing (abstract) provider.`,{eventOverrides:s}),this.registerComponent=this.registerComponent.bind(this),this.getStore=this.getStore.bind(this),Object.keys(this.stores).forEach(i=>{this.propStateRegistrations.set(i,new Map)})}async componentWillLoad(e){T.debug(`[${this.hostTagName}] Will load`),this.setupStoreListeners(),this.nylasConnector=e;const n=Array.from(this.host.querySelectorAll("*")).filter(r=>r.tagName.toLowerCase().startsWith("nylas-"));T.debug(`[${this.hostTagName}] Found ${n.length} child component(s).`,{childComponents:n}),n.forEach(r=>{const s=r;if(!s){T.debug(`[~${this.hostTagName}] Component ${s.tagName} does not have a name. Skipping.`);return}if(!s.registerNylasComponent){T.debug(`[~${this.hostTagName}] Component ${s.tagName} is not a component that can be registered. Skipping.`,{component:s});return}const i={element:s,name:s.tagName.toLowerCase(),getStoresToProp:s.getStoresToProp,storeToProps:s.storeToProps,stateToProps:s.stateToProps,authToProp:s.authToProp,eventToProps:s.eventToProps,connectorToProp:s.connectorToProp};this.registerComponent(i)})}async componentDidLoad(){T.debug(`[${this.hostTagName}] Did load`)}async componentDisconnected(){Object.values(this.stores).forEach(e=>{e.dispose()})}async registerComponentHandler(e){if(e.stopPropagation(),!this.automaticComponentRegistration){T.debug(`[${this.hostTagName}] Automatic component registration disabled. Skipping registration of ${e.detail.name}.`);return}this.registerComponent(e.detail)}async unregisterComponentHandler(e){if(e.stopPropagation(),!this.automaticComponentRegistration){T.debug(`[${this.hostTagName}] Automatic component registration disabled. Skipping unregistration of ${e.detail.name}.`);return}this.unregisterComponent(e.detail)}registerComponent(e){T.debug(`[${this.hostTagName}] Registering component ${e.name}.`);const n=e.element.dataset.nylasId;if(n&&this.registeredComponents[n]){T.debug(`[${this.hostTagName}] Component ${e.name} already registered. Skipping.`);return}const{stateToProps:r,getStoresToProp:s,eventToProps:i,storeToProps:o,connectorToProp:u,element:a}=e;a.dataset.nylasId=T.uniqueID(),this.registeredComponents[a.dataset.nylasId]=e;const l=this.eventOverrides;console.log("eventOverrides",l,e.name,i),i==null||i.forEach((h,c)=>{var y;const d=this.nylasConnector,g=async m=>{T.debug(`[${this.hostTagName}] Handling "${e.name}" prop "${String(c)}" event.`,{event:m}),c in l&&(T.debug(`[${this.hostTagName}] Found event override for "${String(c)}" event. Calling override.`),await l[c](m,d)),m.defaultPrevented||await h(m,d)},p=e.element.dataset.nylasId;p&&!this.eventListenerRegistrations.has(p)&&this.eventListenerRegistrations.set(p,[]),p&&((y=this.eventListenerRegistrations.get(p))==null||y.push([a,c,g])),T.debug(`[${this.hostTagName}] Setting "${e.name}" event "${String(c)}" to automcially call NylasConnector method.`);const f=T.formatEventName(c.toString());T.debug(`[${this.hostTagName}] Adding event listener for "${f}" on "${a.tagName}"`),a.addEventListener(f,g)}),r==null||r.forEach((h,c)=>{var y,m,v,b;const[d,g]=c.split("."),f=this.getStore(d).state[g];if(!a.dataset.nylasId){T.debug(`[${this.hostTagName}] Component "${e.name}" not registered. Skipping.`,{component:e});return}this.propStateRegistrations.has(d)||this.propStateRegistrations.set(d,new Map),(y=this.propStateRegistrations.get(d))!=null&&y.has(g)?(b=(v=this.propStateRegistrations.get(d))==null?void 0:v.get(g))==null||b.push({elementId:a.dataset.nylasId,propKey:h}):(m=this.propStateRegistrations.get(d))==null||m.set(g,[{elementId:a.dataset.nylasId,propKey:h}]),a[h.toString()]=f,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" value.`,{stateValue:f})}),s&&(a[s==null?void 0:s.toString()]=this.getStore,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)),o==null||o.forEach((h,c)=>{const d=this.getStore(c);a[h.toString()]=d,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" store.`,{store:d})}),u&&(a[u==null?void 0:u.toString()]=this.nylasConnector,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`,{connectorToProp:u})),T.debug(`[${this.hostTagName}] Component ${e.name} registered.`)}unregisterComponent(e){T.debug(`[${this.hostTagName}] Unregistering component ${e.name}.`);const n=e.element.dataset.nylasId;if(!n){T.debug(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);return}if(this.registeredComponents[n]){T.debug(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);return}this.propStateRegistrations.forEach((s,i)=>{s.forEach((o,u)=>{var h,c;const a=(h=this.propStateRegistrations.get(i))==null?void 0:h.get(u),l=a==null?void 0:a.filter(d=>d.elementId!==n);l&&((c=this.propStateRegistrations.get(i))==null||c.set(u,l))})});const r=this.eventListenerRegistrations.get(n);r==null||r.forEach(([s,i,o])=>{const u=T.formatEventName(i.toString());T.debug(`[${this.hostTagName}] Removing event listener for "${u}" on "${s.tagName}"`),s.removeEventListener(u,o)}),delete this.registeredComponents[n]}getStore(e){const n=this.stores[e];if(!n)throw new Error(`[${this.hostTagName}] Store "${e.toString()}" not found.`);return n}async setupStoreListeners(){const e=this;Object.entries(this.stores).forEach(([n,r])=>{T.debug(`[${e.hostTagName}] Listening for changes in "${n}" store.`),r.use({set(s,i,o){var l;if(T.debug(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" changed`,{newValue:i,oldValue:o}),i===o){T.debug(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" unchanged. Skipping.`);return}const u=e.registeredComponents;if(!u){T.debug(`[${e.hostTagName}] No registered components found. Skipping.`);return}const a=((l=e.propStateRegistrations.get(n))==null?void 0:l.get(s.toString()))||[];T.debug(`[${e.hostTagName}] Found ${a.length} prop(s) registered for "${s.toString()}" store.`,{props:a,propStateRegistrations:e.propStateRegistrations}),a.forEach(({elementId:h,propKey:c})=>{const d=u[h];if(!d){T.debug(`[${e.hostTagName}] Component "${h}" not found. Skipping.`,{component:d});return}const p=e.getStore(n).state[s];d.element[c.toString()]=p,T.debug(`[${e.hostTagName}] Setting "${d.name}" prop "${c.toString()}" to "${s.toString()}" value.`,{stateValue:p})})}})})}get hostTagName(){var e,n;return((n=(e=this.host)==null?void 0:e.tagName)==null?void 0:n.toLowerCase())??"nylas-provider"}}class or extends ir{}var ar=Object.defineProperty,ur=(t,e,n)=>e in t?ar(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ct=(t,e,n)=>(ur(t,typeof e!="symbol"?e+"":e,n),n),Cn=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(Cn||{});const cr=t=>"error"in t;class lr extends Error{constructor(e){super(e==null?void 0:e.message),ct(this,"apiError"),this.name="NylasAPIError",this.stack=new Error().stack,this.apiError=e}}async function fn(t){const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e),r=Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("");return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const R=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$=Object.keys,F=Array.isArray;function U(t,e){return typeof e!="object"||$(e).forEach(function(n){t[n]=e[n]}),t}typeof Promise>"u"||R.Promise||(R.Promise=Promise);const Be=Object.getPrototypeOf,hr={}.hasOwnProperty;function z(t,e){return hr.call(t,e)}function Ee(t,e){typeof e=="function"&&(e=e(Be(t))),(typeof Reflect>"u"?$:Reflect.ownKeys)(e).forEach(n=>{ee(t,n,e[n])})}const Tn=Object.defineProperty;function ee(t,e,n,r){Tn(t,e,U(n&&z(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function ke(t){return{from:function(e){return t.prototype=Object.create(e.prototype),ee(t.prototype,"constructor",t),{extend:Ee.bind(null,t.prototype)}}}}const dr=Object.getOwnPropertyDescriptor;function en(t,e){let n;return dr(t,e)||(n=Be(t))&&en(n,e)}const fr=[].slice;function lt(t,e,n){return fr.call(t,e,n)}function An(t,e){return e(t)}function Ie(t){if(!t)throw new Error("Assertion Failed")}function On(t){R.setImmediate?setImmediate(t):setTimeout(t,0)}function In(t,e){return t.reduce((n,r,s)=>{var i=e(r,s);return i&&(n[i[0]]=i[1]),n},{})}function te(t,e){if(z(t,e))return t[e];if(!e)return t;if(typeof e!="string"){for(var n=[],r=0,s=e.length;r<s;++r){var i=te(t,e[r]);n.push(i)}return n}var o=e.indexOf(".");if(o!==-1){var u=t[e.substr(0,o)];return u===void 0?void 0:te(u,e.substr(o+1))}}function H(t,e,n){if(t&&e!==void 0&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if(typeof e!="string"&&"length"in e){Ie(typeof n!="string"&&"length"in n);for(var r=0,s=e.length;r<s;++r)H(t,e[r],n[r])}else{var i=e.indexOf(".");if(i!==-1){var o=e.substr(0,i),u=e.substr(i+1);if(u==="")n===void 0?F(t)&&!isNaN(parseInt(o))?t.splice(o,1):delete t[o]:t[o]=n;else{var a=t[o];a&&z(t,o)||(a=t[o]={}),H(a,u,n)}}else n===void 0?F(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function Rn(t){var e={};for(var n in t)z(t,n)&&(e[n]=t[n]);return e}const pr=[].concat;function Kn(t){return pr.apply([],t)}const jn="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Kn([8,16,32,64].map(t=>["Int","Uint","Float"].map(e=>e+t+"Array")))).filter(t=>R[t]),gr=jn.map(t=>R[t]);In(jn,t=>[t,!0]);let se=null;function We(t){se=typeof WeakMap<"u"&&new WeakMap;const e=At(t);return se=null,e}function At(t){if(!t||typeof t!="object")return t;let e=se&&se.get(t);if(e)return e;if(F(t)){e=[],se&&se.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(At(t[n]))}else if(gr.indexOf(t.constructor)>=0)e=t;else{const i=Be(t);for(var s in e=i===Object.prototype?{}:Object.create(i),se&&se.set(t,e),t)z(t,s)&&(e[s]=At(t[s]))}return e}const{toString:mr}={};function Ot(t){return mr.call(t).slice(8,-1)}const It=typeof Symbol<"u"?Symbol.iterator:"@@iterator",yr=typeof It=="symbol"?function(t){var e;return t!=null&&(e=t[It])&&e.apply(t)}:function(){return null},_e={};function J(t){var e,n,r,s;if(arguments.length===1){if(F(t))return t.slice();if(this===_e&&typeof t=="string")return[t];if(s=yr(t)){for(n=[];!(r=s.next()).done;)n.push(r.value);return n}if(t==null)return[t];if(typeof(e=t.length)=="number"){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n}const tn=typeof Symbol<"u"?t=>t[Symbol.toStringTag]==="AsyncFunction":()=>!1;var G=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Dn(t,e){G=t,$n=e}var $n=()=>!0;const vr=!new Error("").stack;function Pe(){if(vr)try{throw new Error}catch(t){return t}return new Error}function Rt(t,e){var n=t.stack;return n?(e=e||0,n.indexOf(t.name)===0&&(e+=(t.name+t.message).split(`
|
|
2
2
|
`).length),n.split(`
|
|
3
3
|
`).slice(e).filter($n).map(r=>`
|
|
4
4
|
`+r).join("")):""}var Nn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],nn=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Nn),br={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function xe(t,e){this._e=Pe(),this.name=t,this.message=e}function Bn(t,e){return t+". Errors: "+Object.keys(e).map(n=>e[n].toString()).filter((n,r,s)=>s.indexOf(n)===r).join(`
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";var un=Object.defineProperty;var fn=(e,t,o)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var $e=(e,t,o)=>(fn(e,typeof t!="symbol"?t+"":t,o),o);const j=require("react");require("react-dom");function hn(){var e=[];if(typeof window<"u"){var t=window;(!t.customElements||t.Element&&(!t.Element.prototype.closest||!t.Element.prototype.matches||!t.Element.prototype.remove||!t.Element.prototype.getRootNode))&&e.push(Promise.resolve().then(()=>require("./dom-68f08be9.cjs")));var o=function(){try{var r=new URL("b","http://a");return r.pathname="c%20d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}};(typeof Object.assign!="function"||!Object.entries||!Array.prototype.find||!Array.prototype.includes||!String.prototype.startsWith||!String.prototype.endsWith||t.NodeList&&!t.NodeList.prototype.forEach||!t.fetch||!o()||typeof WeakMap>"u")&&e.push(Promise.resolve().then(()=>require("./core-js-38e53e34.cjs")))}return Promise.all(e)}const pn="nylas-web-elements";let se,Te,N=!1,Ee=null,Ce=!1;const M=(e,t="")=>()=>{},yn=(e,t)=>()=>{},gn="{visibility:hidden}.hydrated{visibility:inherit}",ht="slot-fb{display:contents}slot-fb[hidden]{display:none}",mn=["formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"],tt={},$n="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml",bn=e=>e!=null,Pe=e=>(e=typeof e,e==="object"||e==="function");function pt(e){var t,o,r;return(r=(o=(t=e.head)===null||t===void 0?void 0:t.querySelector('meta[name="csp-nonce"]'))===null||o===void 0?void 0:o.getAttribute("content"))!==null&&r!==void 0?r:void 0}const Ie=(e,t,...o)=>{let r=null,s=null,i=!1,a=!1;const d=[],c=p=>{for(let y=0;y<p.length;y++)r=p[y],Array.isArray(r)?c(r):r!=null&&typeof r!="boolean"&&((i=typeof e!="function"&&!Pe(r))&&(r=String(r)),i&&a?d[d.length-1].$text$+=r:d.push(i?ae(null,r):r),a=i)};if(c(o),t){t.key&&(s=t.key);{const p=t.className||t.class;p&&(t.class=typeof p!="object"?p:Object.keys(p).filter(y=>p[y]).join(" "))}}if(typeof e=="function")return e(t===null?{}:t,d,Cn);const f=ae(e,null);return f.$attrs$=t,d.length>0&&(f.$children$=d),f.$key$=s,f},ae=(e,t)=>{const o={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return o.$attrs$=null,o.$key$=null,o},yt={},En=e=>e&&e.$tag$===yt,Cn={forEach:(e,t)=>e.map(nt).forEach(t),map:(e,t)=>e.map(nt).map(t).map(Sn)},nt=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),Sn=e=>{if(typeof e.vtag=="function"){const o=Object.assign({},e.vattrs);return e.vkey&&(o.key=e.vkey),e.vname&&(o.name=e.vname),Ie(e.vtag,o,...e.vchildren||[])}const t=ae(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},kn=(e,t)=>e!=null&&!Pe(e)?t&4?e==="false"?!1:e===""||!!e:t&2?parseFloat(e):t&1?String(e):e:e,gt=e=>D(e).$hostElement$,wn=(e,t,o)=>{const r=gt(e);return{emit:s=>mt(r,t,{bubbles:!!(o&4),composed:!!(o&2),cancelable:!!(o&1),detail:s})}},mt=(e,t,o)=>{const r=O.ce(t,o);return e.dispatchEvent(r),r},rt=new WeakMap,Tn=(e,t,o)=>{let r=le.get(e);tr&&o?(r=r||new CSSStyleSheet,typeof r=="string"?r=t:r.replaceSync(t)):r=t,le.set(e,r)},Pn=(e,t,o)=>{var r;const s=$t(t),i=le.get(s);if(e=e.nodeType===11?e:L,i)if(typeof i=="string"){e=e.head||e;let a=rt.get(e),d;if(a||rt.set(e,a=new Set),!a.has(s)){{d=L.createElement("style"),d.innerHTML=i;const c=(r=O.$nonce$)!==null&&r!==void 0?r:pt(L);c!=null&&d.setAttribute("nonce",c),e.insertBefore(d,e.querySelector("link"))}t.$flags$&4&&(d.innerHTML+=ht),a&&a.add(s)}}else e.adoptedStyleSheets.includes(i)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,i]);return s},In=e=>{const t=e.$cmpMeta$,o=e.$hostElement$,r=t.$flags$,s=M("attachStyles",t.$tagName$),i=Pn(o.shadowRoot?o.shadowRoot:o.getRootNode(),t);r&10&&(o["s-sc"]=i,o.classList.add(i+"-h"),r&2&&o.classList.add(i+"-s")),s()},$t=(e,t)=>"sc-"+e.$tagName$,ot=(e,t,o,r,s,i)=>{if(o!==r){let a=lt(e,t),d=t.toLowerCase();if(t==="class"){const c=e.classList,f=st(o),p=st(r);c.remove(...f.filter(y=>y&&!p.includes(y))),c.add(...p.filter(y=>y&&!f.includes(y)))}else if(t==="style"){for(const c in o)(!r||r[c]==null)&&(c.includes("-")?e.style.removeProperty(c):e.style[c]="");for(const c in r)(!o||r[c]!==o[c])&&(c.includes("-")?e.style.setProperty(c,r[c]):e.style[c]=r[c])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!a&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):lt(Q,d)?t=d.slice(2):t=d[2]+t.slice(3),o||r){const c=t.endsWith(vt);t=t.replace(Rn,""),o&&O.rel(e,t,o,c),r&&O.ael(e,t,r,c)}}else{const c=Pe(r);if((a||c&&r!==null)&&!s)try{if(e.tagName.includes("-"))e[t]=r;else{const f=r??"";t==="list"?a=!1:(o==null||e[t]!=f)&&(e[t]=f)}}catch{}r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&e.removeAttribute(t):(!a||i&4||s)&&!c&&(r=r===!0?"":r,e.setAttribute(t,r))}}},_n=/\s/,st=e=>e?e.split(_n):[],vt="Capture",Rn=new RegExp(vt+"$"),bt=(e,t,o,r)=>{const s=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||tt,a=t.$attrs$||tt;for(r in i)r in a||ot(s,r,i[r],void 0,o,t.$flags$);for(r in a)ot(s,r,i[r],a[r],o,t.$flags$)},ie=(e,t,o,r)=>{const s=t.$children$[o];let i=0,a,d;if(s.$text$!==null)a=s.$elm$=L.createTextNode(s.$text$);else{if(N||(N=s.$tag$==="svg"),a=s.$elm$=L.createElementNS(N?$n:vn,s.$tag$),N&&s.$tag$==="foreignObject"&&(N=!1),bt(null,s,N),bn(se)&&a["s-si"]!==se&&a.classList.add(a["s-si"]=se),s.$children$)for(i=0;i<s.$children$.length;++i)d=ie(e,s,i),d&&a.appendChild(d);s.$tag$==="svg"?N=!1:a.tagName==="foreignObject"&&(N=!0)}return a["s-hn"]=Te,a},Et=(e,t,o,r,s,i)=>{let a=e,d;for(a.shadowRoot&&a.tagName===Te&&(a=a.shadowRoot);s<=i;++s)r[s]&&(d=ie(null,o,s),d&&(r[s].$elm$=d,a.insertBefore(d,t)))},Ct=(e,t,o)=>{for(let r=t;r<=o;++r){const s=e[r];if(s){const i=s.$elm$;St(s),i&&i.remove()}}},On=(e,t,o,r,s=!1)=>{let i=0,a=0,d=0,c=0,f=t.length-1,p=t[0],y=t[f],C=r.length-1,b=r[0],w=r[C],T,P;for(;i<=f&&a<=C;)if(p==null)p=t[++i];else if(y==null)y=t[--f];else if(b==null)b=r[++a];else if(w==null)w=r[--C];else if(oe(p,b,s))Y(p,b,s),p=t[++i],b=r[++a];else if(oe(y,w,s))Y(y,w,s),y=t[--f],w=r[--C];else if(oe(p,w,s))Y(p,w,s),e.insertBefore(p.$elm$,y.$elm$.nextSibling),p=t[++i],w=r[--C];else if(oe(y,b,s))Y(y,b,s),e.insertBefore(y.$elm$,p.$elm$),y=t[--f],b=r[++a];else{for(d=-1,c=i;c<=f;++c)if(t[c]&&t[c].$key$!==null&&t[c].$key$===b.$key$){d=c;break}d>=0?(P=t[d],P.$tag$!==b.$tag$?T=ie(t&&t[a],o,d):(Y(P,b,s),t[d]=void 0,T=P.$elm$),b=r[++a]):(T=ie(t&&t[a],o,a),b=r[++a]),T&&p.$elm$.parentNode.insertBefore(T,p.$elm$)}i>f?Et(e,r[C+1]==null?null:r[C+1].$elm$,o,r,a,C):a>C&&Ct(t,i,f)},oe=(e,t,o=!1)=>e.$tag$===t.$tag$?o?!0:e.$key$===t.$key$:!1,Y=(e,t,o=!1)=>{const r=t.$elm$=e.$elm$,s=e.$children$,i=t.$children$,a=t.$tag$,d=t.$text$;d===null?(N=a==="svg"?!0:a==="foreignObject"?!1:N,a==="slot"||bt(e,t,N),s!==null&&i!==null?On(r,s,t,i,o):i!==null?(e.$text$!==null&&(r.textContent=""),Et(r,null,t,i,0,i.length-1)):s!==null&&Ct(s,0,s.length-1),N&&a==="svg"&&(N=!1)):e.$text$!==d&&(r.data=d)},St=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(St)},xn=(e,t,o=!1)=>{const r=e.$hostElement$,s=e.$vnode$||ae(null,null),i=En(t)?t:Ie(null,null,t);if(Te=r.tagName,o&&i.$attrs$)for(const a of Object.keys(i.$attrs$))r.hasAttribute(a)&&!["key","ref","style","class"].includes(a)&&(i.$attrs$[a]=r[a]);i.$tag$=null,i.$flags$|=4,e.$vnode$=i,i.$elm$=s.$elm$=r.shadowRoot||r,se=r["s-sc"],Y(s,i,o)},kt=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(o=>e.$onRenderResolve$=o))},ce=(e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return kt(e,e.$ancestorComponent$),rr(()=>Nn(e,t))},Nn=(e,t)=>{const o=M("scheduleUpdate",e.$cmpMeta$.$tagName$),r=e.$lazyInstance$;let s;return t?(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map(([i,a])=>q(r,i,a)),e.$queuedListeners$=void 0),s=q(r,"componentWillLoad")):s=q(r,"componentWillUpdate"),s=at(s,()=>q(r,"componentWillRender")),o(),at(s,()=>An(e,r,t))},at=(e,t)=>Ln(e)?e.then(t):t(),Ln=e=>e instanceof Promise||e&&e.then&&typeof e.then=="function",An=async(e,t,o)=>{var r;const s=e.$hostElement$,i=M("update",e.$cmpMeta$.$tagName$),a=s["s-rc"];o&&In(e);const d=M("render",e.$cmpMeta$.$tagName$);jn(e,t,s,o),a&&(a.map(c=>c()),s["s-rc"]=void 0),d(),i();{const c=(r=s["s-p"])!==null&&r!==void 0?r:[],f=()=>Fn(e);c.length===0?f():(Promise.all(c).then(f),e.$flags$|=4,c.length=0)}},jn=(e,t,o,r)=>{try{Ee=t,t=t.render(),e.$flags$&=-17,e.$flags$|=2,xn(e,t,r)}catch(s){m(s,e.$hostElement$)}return Ee=null,null},Dn=()=>Ee,Fn=e=>{const t=e.$cmpMeta$.$tagName$,o=e.$hostElement$,r=M("postUpdate",t),s=e.$lazyInstance$,i=e.$ancestorComponent$;q(s,"componentDidRender"),e.$flags$&64?(q(s,"componentDidUpdate"),r()):(e.$flags$|=64,Tt(o),q(s,"componentDidLoad"),r(),e.$onReadyResolve$(o),i||wt()),e.$onInstanceResolve$(o),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&Re(()=>ce(e,!1)),e.$flags$&=-517},Hn=e=>{{const t=D(e),o=t.$hostElement$.isConnected;return o&&(t.$flags$&18)===2&&ce(t,!1),o}},wt=e=>{Tt(L.documentElement),Re(()=>mt(Q,"appload",{detail:{namespace:pn}}))},q=(e,t,o)=>{if(e&&e[t])try{return e[t](o)}catch(r){m(r)}},Tt=e=>e.classList.add("hydrated"),qn=(e,t)=>D(e).$instanceValues$.get(t),Mn=(e,t,o,r)=>{const s=D(e),i=s.$hostElement$,a=s.$instanceValues$.get(t),d=s.$flags$,c=s.$lazyInstance$;o=kn(o,r.$members$[t][0]);const f=Number.isNaN(a)&&Number.isNaN(o),p=o!==a&&!f;if((!(d&8)||a===void 0)&&p&&(s.$instanceValues$.set(t,o),c)){if(r.$watchers$&&d&128){const y=r.$watchers$[t];y&&y.map(C=>{try{c[C](o,a,t)}catch(b){m(b,i)}})}(d&18)===2&&ce(s,!1)}},Pt=(e,t,o)=>{var r;const s=e.prototype;if(t.$flags$&64&&o&1&&mn.forEach(i=>Object.defineProperty(s,i,{value(...a){const d=D(this),c=d.$lazyInstance$;if(!c)d.$onReadyPromise$.then(f=>{const p=f[i];typeof p=="function"&&p.call(f,...a)});else{const f=c[i];typeof f=="function"&&f.call(c,...a)}}})),t.$members$){e.watchers&&(t.$watchers$=e.watchers);const i=Object.entries(t.$members$);if(i.map(([a,[d]])=>{d&31||o&2&&d&32?Object.defineProperty(s,a,{get(){return qn(this,a)},set(c){Mn(this,a,c,t)},configurable:!0,enumerable:!0}):o&1&&d&64&&Object.defineProperty(s,a,{value(...c){var f;const p=D(this);return(f=p==null?void 0:p.$onInstancePromise$)===null||f===void 0?void 0:f.then(()=>{var y;return(y=p.$lazyInstance$)===null||y===void 0?void 0:y[a](...c)})}})}),o&1){const a=new Map;s.attributeChangedCallback=function(d,c,f){O.jmp(()=>{var p;const y=a.get(d);if(this.hasOwnProperty(y))f=this[y],delete this[y];else{if(s.hasOwnProperty(y)&&typeof this[y]=="number"&&this[y]==f)return;if(y==null){const C=D(this),b=C==null?void 0:C.$flags$;if(b&&!(b&8)&&b&128&&f!==c){const w=C.$lazyInstance$,T=(p=t.$watchers$)===null||p===void 0?void 0:p[d];T==null||T.forEach(P=>{w[P]!=null&&w[P].call(w,f,c,d)})}return}}this[y]=f===null&&typeof this[y]=="boolean"?!1:f})},e.observedAttributes=Array.from(new Set([...Object.keys((r=t.$watchers$)!==null&&r!==void 0?r:{}),...i.filter(([d,c])=>c[0]&15).map(([d,c])=>{const f=c[1]||d;return a.set(f,d),f})]))}}return e},Bn=async(e,t,o,r)=>{let s;if(!(t.$flags$&32)){t.$flags$|=32;{if(s=Zn(o),s.then){const c=yn();s=await s,c()}s.isProxied||(o.$watchers$=s.watchers,Pt(s,o,2),s.isProxied=!0);const d=M("createInstance",o.$tagName$);t.$flags$|=8;try{new s(t)}catch(c){m(c)}t.$flags$&=-9,t.$flags$|=128,d(),Se(t.$lazyInstance$)}if(s.style){let d=s.style;const c=$t(o);if(!le.has(c)){const f=M("registerStyles",o.$tagName$);Tn(c,d,!!(o.$flags$&1)),f()}}}const i=t.$ancestorComponent$,a=()=>ce(t,!0);i&&i["s-rc"]?i["s-rc"].push(a):a()},Se=e=>{q(e,"connectedCallback")},Un=e=>{if(!(O.$flags$&1)){const t=D(e),o=t.$cmpMeta$,r=M("connectedCallback",o.$tagName$);if(t.$flags$&1)It(e,t,o.$listeners$),t!=null&&t.$lazyInstance$?Se(t.$lazyInstance$):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>Se(t.$lazyInstance$));else{t.$flags$|=1;{let s=e;for(;s=s.parentNode||s.host;)if(s["s-p"]){kt(t,t.$ancestorComponent$=s);break}}o.$members$&&Object.entries(o.$members$).map(([s,[i]])=>{if(i&31&&e.hasOwnProperty(s)){const a=e[s];delete e[s],e[s]=a}}),Bn(e,t,o)}r()}},it=e=>{q(e,"disconnectedCallback")},Wn=async e=>{if(!(O.$flags$&1)){const t=D(e);t.$rmListeners$&&(t.$rmListeners$.map(o=>o()),t.$rmListeners$=void 0),t!=null&&t.$lazyInstance$?it(t.$lazyInstance$):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>it(t.$lazyInstance$))}},zn=(e,t={})=>{var o;const r=M(),s=[],i=t.exclude||[],a=Q.customElements,d=L.head,c=d.querySelector("meta[charset]"),f=L.createElement("style"),p=[];let y,C=!0;Object.assign(O,t),O.$resourcesUrl$=new URL(t.resourcesUrl||"./",L.baseURI).href;let b=!1;if(e.map(w=>{w[1].map(T=>{var P;const I={$flags$:T[0],$tagName$:T[1],$members$:T[2],$listeners$:T[3]};I.$flags$&4&&(b=!0),I.$members$=T[2],I.$listeners$=T[3],I.$watchers$=(P=T[4])!==null&&P!==void 0?P:{};const k=I.$tagName$,Z=class extends HTMLElement{constructor(U){super(U),U=this,Qn(U,I),I.$flags$&1&&U.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),C?p.push(this):O.jmp(()=>Un(this))}disconnectedCallback(){O.jmp(()=>Wn(this))}componentOnReady(){return D(this).$onReadyPromise$}};I.$flags$&64&&(Z.formAssociated=!0),I.$lazyBundleId$=w[0],!i.includes(k)&&!a.get(k)&&(s.push(k),a.define(k,Pt(Z,I,1)))})}),b&&(f.innerHTML+=ht),f.innerHTML+=s+gn,f.innerHTML.length){f.setAttribute("data-styles","");const w=(o=O.$nonce$)!==null&&o!==void 0?o:pt(L);w!=null&&f.setAttribute("nonce",w),d.insertBefore(f,c?c.nextSibling:d.firstChild)}C=!1,p.length?p.map(w=>w.connectedCallback()):O.jmp(()=>y=setTimeout(wt,30)),r()},Yn=(e,t)=>t,It=(e,t,o,r)=>{o&&o.map(([s,i,a])=>{const d=Jn(e,s),c=Gn(t,a),f=Kn(s);O.ael(d,i,c,f),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>O.rel(d,i,c,f))})},Gn=(e,t)=>o=>{try{e.$flags$&256?e.$lazyInstance$[t](o):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,o])}catch(r){m(r)}},Jn=(e,t)=>t&4?L:t&8?Q:t&16?L.body:e,Kn=e=>Vn?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0,_e=new WeakMap,D=e=>_e.get(e),Xn=(e,t)=>_e.set(t.$lazyInstance$=e,t),Qn=(e,t)=>{const o={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return o.$onInstancePromise$=new Promise(r=>o.$onInstanceResolve$=r),o.$onReadyPromise$=new Promise(r=>o.$onReadyResolve$=r),e["s-p"]=[],e["s-rc"]=[],It(e,o,t.$listeners$),_e.set(e,o)},lt=(e,t)=>t in e,m=(e,t)=>(0,console.error)(e,t),ve=new Map,Zn=(e,t,o)=>{const r=e.$tagName$.replace(/-/g,"_"),s=e.$lazyBundleId$,i=ve.get(s);if(i)return i[r];if(!o||!BUILD.hotModuleReplacement){const a=d=>(ve.set(s,d),d[r]);switch(s){case"nylas-if-state_3":return Promise.resolve().then(()=>require("./nylas-if-state_3.entry-5baf6d6f.cjs")).then(a,m);case"document-refresh-icon":return Promise.resolve().then(()=>require("./document-refresh-icon.entry-fcb33921.cjs")).then(a,m);case"nylas-additional-participants":return Promise.resolve().then(()=>require("./nylas-additional-participants.entry-ff8bf378.cjs")).then(a,m);case"nylas-list-folders":return Promise.resolve().then(()=>require("./nylas-list-folders.entry-3b24d92d.cjs")).then(a,m);case"nylas-list-threads":return Promise.resolve().then(()=>require("./nylas-list-threads.entry-fda42ded.cjs")).then(a,m);case"nylas-mailbox-pagination":return Promise.resolve().then(()=>require("./nylas-mailbox-pagination.entry-9dcd4901.cjs")).then(a,m);case"nylas-mailbox-toolbar-button":return Promise.resolve().then(()=>require("./nylas-mailbox-toolbar-button.entry-d1099fab.cjs")).then(a,m);case"nylas-provider":return Promise.resolve().then(()=>require("./nylas-provider.entry-78e2fa30.cjs")).then(a,m);case"nylas-scheduler-editor":return Promise.resolve().then(()=>require("./nylas-scheduler-editor.entry-550d3c59.cjs")).then(a,m);case"nylas-scheduling":return Promise.resolve().then(()=>require("./nylas-scheduling.entry-30a63738.cjs")).then(a,m);case"nylas-threads-refresh":return Promise.resolve().then(()=>require("./nylas-threads-refresh.entry-05258b36.cjs")).then(a,m);case"nylas-threads-search":return Promise.resolve().then(()=>require("./nylas-threads-search.entry-ff21fc65.cjs")).then(a,m);case"nylas-view-thread":return Promise.resolve().then(()=>require("./nylas-view-thread.entry-5da81e99.cjs")).then(a,m);case"people-icon":return Promise.resolve().then(()=>require("./people-icon.entry-4b682757.cjs")).then(a,m);case"archive-icon_7":return Promise.resolve().then(()=>require("./archive-icon_7.entry-052ac074.cjs")).then(a,m);case"arrow-icon":return Promise.resolve().then(()=>require("./arrow-icon.entry-93f21385.cjs")).then(a,m);case"forward-icon_6":return Promise.resolve().then(()=>require("./forward-icon_6.entry-c4b37cb1.cjs")).then(a,m);case"nylas-booked-event-card_10":return Promise.resolve().then(()=>require("./nylas-booked-event-card_10.entry-06bc3c51.cjs")).then(a,m);case"nylas-editor-tabs":return Promise.resolve().then(()=>require("./nylas-editor-tabs.entry-49b5a3ab.cjs")).then(a,m);case"bold-icon_3":return Promise.resolve().then(()=>require("./bold-icon_3.entry-8f55a9e7.cjs")).then(a,m);case"calendar-check-icon_2":return Promise.resolve().then(()=>require("./calendar-check-icon_2.entry-b0476bca.cjs")).then(a,m);case"add-circle-icon_18":return Promise.resolve().then(()=>require("./add-circle-icon_18.entry-b66b6343.cjs")).then(a,m);case"play-icon_2":return Promise.resolve().then(()=>require("./play-icon_2.entry-ccdc6b9c.cjs")).then(a,m);case"refresh-icon":return Promise.resolve().then(()=>require("./refresh-icon.entry-59fff3d4.cjs")).then(a,m);case"translate-icon":return Promise.resolve().then(()=>require("./translate-icon.entry-1784c18e.cjs")).then(a,m);case"warning-icon":return Promise.resolve().then(()=>require("./warning-icon.entry-3a702d1d.cjs")).then(a,m);case"calendar-cancel-icon":return Promise.resolve().then(()=>require("./calendar-cancel-icon.entry-574c8aa4.cjs")).then(a,m);case"calendar-icon":return Promise.resolve().then(()=>require("./calendar-icon.entry-98936e6d.cjs")).then(a,m);case"nylas-form-card":return Promise.resolve().then(()=>require("./nylas-form-card.entry-69d2095b.cjs")).then(a,m);case"loading-icon":return Promise.resolve().then(()=>require("./loading-icon.entry-06d37ef0.cjs")).then(a,m);case"globe-icon":return Promise.resolve().then(()=>require("./globe-icon.entry-90a0b9c9.cjs")).then(a,m);case"close-icon":return Promise.resolve().then(()=>require("./close-icon.entry-8d6e9816.cjs")).then(a,m);case"info-icon_2":return Promise.resolve().then(()=>require("./info-icon_2.entry-81e95048.cjs")).then(a,m);case"chevron-icon_3":return Promise.resolve().then(()=>require("./chevron-icon_3.entry-f7801467.cjs")).then(a,m)}}return import(`./${s}.entry.js`).then(a=>(ve.set(s,a),a[r]),m)},le=new Map,Q=typeof window<"u"?window:{},L=Q.document||{head:{}},O={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,o,r)=>e.addEventListener(t,o,r),rel:(e,t,o,r)=>e.removeEventListener(t,o,r),ce:(e,t)=>new CustomEvent(e,t)},Vn=(()=>{let e=!1;try{L.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch{}return e})(),er=e=>Promise.resolve(e),tr=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),ct=[],_t=[],nr=(e,t)=>o=>{e.push(o),Ce||(Ce=!0,t&&O.$flags$&4?Re(ke):O.raf(ke))},dt=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(o){m(o)}e.length=0},ke=()=>{dt(ct),dt(_t),(Ce=ct.length>0)&&O.raf(ke)},Re=e=>er().then(e),rr=nr(_t,!0);async function or(){await Promise.resolve().then(()=>require("./elements-dc5b338e-81a0319c.cjs"))}const sr=or,Rt=(e,t)=>{if(!(typeof window>"u"))return sr(),zn(JSON.parse('[["nylas-scheduler-editor",[[1,"nylas-scheduler-editor",{"authConfig":[16],"eventOverrides":[16],"defaultAuthStoreState":[16],"defaultSchedulerConfigStoreState":[16],"mode":[1],"automaticComponentRegistration":[32],"loggedInUser":[32]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"]]]]],["nylas-scheduling",[[1,"nylas-scheduling",{"mode":[1],"defaultSchedulerState":[16],"sessionId":[1,"session-id"],"schedulerApiUrl":[1,"scheduler-api-url"],"bookingInfo":[16],"rescheduleBookingId":[1,"reschedule-booking-id"],"cancelBookingId":[1,"cancel-booking-id"],"configId":[1,"config-id"],"eventOverrides":[16],"isLoading":[4,"is-loading"],"themeConfig":[16],"showNotification":[4,"show-notification"],"automaticComponentRegistration":[32],"selectedDateLabel":[32],"getNylasSchedulerStore":[64],"getNylasSchedulerConnector":[64],"getRef":[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"],[0,"monthChanged","monthChangedHandler"],[0,"detailsConfirmed","bookButtonClickedHandler"],[0,"dateSelected","dateSelectedHandler"],[0,"cancelBookedEventError","cancelBookedEventErrorHandler"],[0,"rescheduleBookedEventError","rescheduleBookedEventErrorHandler"]],{"bookingInfo":["bookingInfoChanged"]}]]],["nylas-view-thread",[[1,"nylas-view-thread",{"draft":[16],"thread":[16],"messages":[16],"attachments":[16],"state":[32],"internalMessages":[32],"showAllEmails":[32],"showComposer":[32]},null,{"thread":["threadChanged"],"messages":["updateInternalMessages"]}]]],["nylas-list-folders",[[1,"nylas-list-folders",{"folders":[16],"selectedFolder":[1,"selected-folder"],"defaultFolders":[32],"otherFolders":[32]},null,{"folders":["watchFolders"]}]]],["nylas-additional-participants",[[65,"nylas-additional-participants",{"name":[1],"eventParticipants":[16],"participants":[32],"participantsValid":[32]},null,{"name":["elementNameChangedHandler"]}]]],["nylas-mailbox-pagination",[[1,"nylas-mailbox-pagination",{"state":[1],"hasNextPage":[4,"has-next-page"],"hasPreviousPage":[4,"has-previous-page"],"scrollTarget":[1,"scroll-target"],"mobileOnlyInfiniteScroll":[4,"mobile-only-infinite-scroll"],"mobileViewPortWidth":[2,"mobile-view-port-width"],"nextPage":[64],"previousPage":[64]},[[9,"scroll","handlePageScroll"]]]]],["nylas-threads-refresh",[[1,"nylas-threads-refresh",{"start":[32],"state":[32],"pulling":[32],"updateState":[64]}]]],["nylas-if-state_3",[[1,"nylas-if-state",{"state":[1],"isStateSet":[4,"is-state-set"],"isBoolean":[4,"is-boolean"],"getStore":[16],"transition":[1],"show":[32],"classes":[32]},null,{"getStore":["onGetStoreChange"]}],[1,"nylas-login",{"isAuthenticated":[4,"is-authenticated"],"nylasConnector":[16],"scopes":[16],"loginMethod":[1,"login-method"],"companyName":[1,"company-name"],"logoUrl":[1,"logo-url"],"logoWidth":[1,"logo-width"],"providers":[1],"buttonText":[1,"button-text"],"email":[32]}],[1,"nylas-mailbox",{"automaticComponentRegistration":[4,"automatic-component-registration"],"eventOverrides":[16],"authConfig":[16],"defaultAuthStoreState":[16],"defaultMailboxStoreState":[16],"getMailboxStore":[64],"getAuthStore":[64],"getNylasAuth":[64],"getNylasMailboxConnector":[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"]]]]],["document-refresh-icon",[[2,"document-refresh-icon",{"width":[1],"height":[1]}]]],["nylas-list-threads",[[1,"nylas-list-threads",{"threads":[16],"isAuthenticated":[4,"is-authenticated"],"tokenInfo":[16],"state":[1],"showCheckbox":[4,"show-checkbox"]}]]],["nylas-mailbox-toolbar-button",[[1,"nylas-mailbox-toolbar-button",{"method":[1],"dataState":[1,"data-state"],"iconOnly":[4,"icon-only"],"mailboxConnector":[16]}]]],["nylas-provider",[[1,"nylas-provider",{"authConfig":[16],"eventOverrides":[16],"automaticComponentRegistration":[4,"automatic-component-registration"],"getNylasAuth":[64],"getNylasConnector":[64],"getMailboxStore":[64],"getAuthStore":[64],"getNylasSchedulerStore":[64],"getNylasSchedulerConfigStore":[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"]]]]],["nylas-threads-search",[[1,"nylas-threads-search",{"query":[1],"internalQuery":[32]},null,{"query":["onQueryChange"]}]]],["people-icon",[[2,"people-icon",{"width":[1],"height":[1]}]]],["nylas-form-card",[[65,"nylas-form-card"]]],["globe-icon",[[2,"globe-icon",{"width":[1],"height":[1]}]]],["info-icon_2",[[2,"info-icon",{"width":[1],"height":[1]}],[1,"tooltip-component",{"position":[1]}]]],["nylas-editor-tabs",[[1,"nylas-editor-tabs",{"calendars":[16],"config":[16],"activeTab":[32],"isLoading":[32],"hasUnsavedChanges":[32],"changesSaved":[32],"formState":[32]},[[0,"valueChanged","handleValueChanged"]],{"config":["configChangedHandler"]}]]],["arrow-icon",[[2,"arrow-icon",{"width":[1],"height":[1]}]]],["refresh-icon",[[2,"refresh-icon",{"width":[1],"height":[1]}]]],["translate-icon",[[2,"translate-icon",{"width":[1],"height":[1]}]]],["warning-icon",[[2,"warning-icon",{"width":[1],"height":[1]}]]],["calendar-cancel-icon",[[2,"calendar-cancel-icon",{"width":[1],"height":[1]}]]],["calendar-icon",[[2,"calendar-icon",{"width":[1],"height":[1]}]]],["calendar-check-icon_2",[[2,"calendar-check-icon",{"width":[1],"height":[1]}],[2,"checkmark-circle-icon",{"width":[1],"height":[1]}]]],["play-icon_2",[[2,"play-icon",{"width":[1],"height":[1]}],[2,"stop-icon",{"width":[1],"height":[1]}]]],["bold-icon_3",[[2,"bold-icon",{"width":[1],"height":[1]}],[2,"italic-icon",{"width":[1],"height":[1]}],[2,"underline-icon",{"width":[1],"height":[1]}]]],["loading-icon",[[1,"loading-icon",{"width":[1],"height":[1]}]]],["forward-icon_6",[[1,"nylas-composer",{"message":[16],"viewEmailElement":[16]},null,{"message":["watchBody"]}],[1,"nylas-summarize-message-button",{"message":[16],"state":[32],"updateState":[64],"playAudio":[64]}],[2,"forward-icon",{"width":[1],"height":[1]}],[1,"nylas-view-email",{"message":[16],"parent":[16],"attachments":[16],"detectDarkMode":[4,"detect-dark-mode"],"state":[32],"sanitizedBody":[32],"styles":[32],"viewEmailElement":[32],"hoistedFontURLs":[32]},[[9,"resize","handleScroll"]],{"message":["messageChanged"],"viewEmailElement":["viewEmailElementChanged"]}],[2,"reply-all-icon",{"width":[1],"height":[1]}],[2,"reply-icon",{"width":[1],"height":[1]}]]],["archive-icon_7",[[2,"archive-icon",{"width":[1],"height":[1]}],[2,"folder-icon",{"width":[1],"height":[1]}],[2,"inbox-icon",{"width":[1],"height":[1]}],[2,"sent-icon",{"width":[1],"height":[1]}],[2,"spam-icon",{"width":[1],"height":[1]}],[2,"star-icon",{"width":[1],"height":[1]}],[2,"trash-icon",{"width":[1],"height":[1]}]]],["close-icon",[[2,"close-icon",{"width":[1],"height":[1]}]]],["chevron-icon_3",[[1,"select-dropdown",{"name":[1],"options":[16],"defaultSelectedOption":[16],"withSearch":[4,"with-search"],"selectedOption":[32],"isOpen":[32],"searchValue":[32],"filteredOptions":[32],"ariaActivedescendant":[32]},[[6,"click","handleOutsideClick"]]],[2,"search-icon",{"width":[1],"height":[1]}],[2,"chevron-icon",{"width":[1],"height":[1]}]]],["nylas-booked-event-card_10",[[1,"nylas-locale-switch",{"selectedTimezone":[1025,"selected-timezone"],"selectedLanguage":[1025,"selected-language"]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]]],[1,"nylas-booked-event-card",{"eventInfo":[16],"rescheduleBookingId":[1,"reschedule-booking-id"],"bookingInfo":[8,"booking-info"],"selectedTimezone":[1,"selected-timezone"],"selectedTimeslot":[16]}],[1,"nylas-notification",{"ttl":[8],"allowedCategories":[16],"notifications":[32]},[[16,"nylasSchedulerError","onError"],[16,"nylasSchedulerWarning","onWarning"],[16,"nylasSchedulerInfo","onInfo"],[16,"nylasSchedulerSuccess","onSuccess"]]],[1,"nylas-selected-event-card",{"selectedDate":[16],"selectedTimeslot":[16],"selectedTimezone":[1,"selected-timezone"],"startTime":[32],"endTime":[32]},null,{"selectedTimeslot":["handleSelectedTimeslotChange"]}],[1,"nylas-booking-form",{"isLoading":[4,"is-loading"],"bookingInfo":[8,"booking-info"],"eventInfo":[16],"name":[32],"email":[32],"guestEmails":[32],"guestEmailErrors":[32],"isNameValid":[32],"isEmailValid":[32],"validationError":[32]},null,{"bookingInfo":["bookingInfoChangedHandler"]}],[1,"nylas-cancel-booking-form",{"cancelBookingId":[1,"cancel-booking-id"],"cancellationReason":[32],"cancellationError":[32]}],[1,"nylas-cancelled-event-card",{"cancelledEventInfo":[16]}],[1,"nylas-date-picker",{"selectableDates":[16],"selectedDate":[16],"isLoading":[4,"is-loading"],"month":[32],"dates":[32]}],[2,"nylas-logo",{"width":[1],"height":[1]}],[1,"nylas-timeslot-picker",{"selectedDate":[16],"availability":[16],"selectedTimeslot":[16],"isLoading":[4,"loading-state"],"selectedTimezone":[1,"selected-timezone"],"times":[32],"hoveredTimeslotIndex":[32],"selectedTimeslotIndex":[32]},null,{"selectedDate":["selectedDateChanged"],"availability":["availabilityChanged"]}]]],["add-circle-icon_18",[[65,"nylas-availability-picker",{"openHours":[16],"name":[1],"defaultTimezone":[1,"default-timezone"],"schedule":[32],"timezone":[32],"overlapDays":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"name":["elementNameChangedHandler"],"schedule":["scheduleChanged"]}],[65,"nylas-location-component",{"eventLocation":[1,"event-location"],"name":[1],"location":[32],"selectedLocationOption":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"name":["elementNameChangedHandler"],"eventLocation":["eventLocationChangedHandler"]}],[65,"nylas-booking-calendar-picker",{"calendars":[16],"name":[1],"defaultBookingCalendar":[1,"default-booking-calendar"],"selectedCalendar":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"name":["elementNameChangedHandler"]}],[65,"nylas-calendar-picker",{"calendars":[16],"organizerEmail":[1,"organizer-email"],"name":[1],"defaultSelectedCalendars":[16],"selectedCalendars":[32]},[[0,"selectedOptionsChanged","selectedOptionsChangedHandler"]],{"name":["elementNameChangedHandler"]}],[65,"nylas-custom-booking-flow",{"name":[1],"bookingType":[1,"booking-type"],"selectedBookingType":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"name":["elementNameChangedHandler"]}],[65,"nylas-event-duration",{"name":[1],"eventDurationMinutes":[2,"event-duration-minutes"],"duration":[32],"durationMinutes":[32],"durationIncrement":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"name":["elementNameChangedHandler"],"durationMinutes":["durationMinutesChangedHandler"]}],[65,"nylas-buffer-time",{"name":[1],"buffer":[16],"selectedBeforeBufferTime":[32],"selectedAfterBufferTime":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"name":["elementNameChangedHandler"]}],[65,"nylas-event-description",{"eventDescription":[1,"event-description"],"name":[1],"description":[32]},null,{"name":["elementNameChangedHandler"]}],[65,"nylas-event-title",{"eventTitle":[1,"event-title"],"name":[1],"showTokens":[32],"availableTokens":[32],"filteredTokens":[32],"ariaActivedescendant":[32],"currentWord":[32]},null,{"name":["elementNameChangedHandler"],"ariaActivedescendant":["ariaActivedescendantChangedHandler"]}],[65,"nylas-event-info"],[2,"calendar-info-icon",{"width":[1],"height":[1]}],[2,"calendar-patterns-icon",{"width":[1],"height":[1]}],[2,"flow-icon",{"width":[1],"height":[1]}],[1,"multi-select-dropdown",{"name":[1],"label":[1],"options":[16],"availableOptions":[32],"isOpen":[32],"ariaActivedescendant":[32],"shouldFocusFirstOption":[32]},[[6,"click","handleOutsideClick"]]],[2,"add-circle-icon",{"width":[1],"height":[1]}],[2,"location-icon",{"width":[1],"height":[1]}],[2,"location-off-icon",{"width":[1],"height":[1]}],[1,"nylas-time-window-picker",{"time":[1],"minimumStartTime":[1,"minimum-start-time"],"placeholder":[1],"setTime":[16],"name":[1],"hasError":[4,"has-error"],"setFormError":[16],"err":[32],"showTimes":[32],"ariaActivedescendant":[32],"times":[32],"shouldAutoScroll":[32]},[[4,"click","handleOutsideClick"]],{"minimumStartTime":["minimumStartTimeChangedHandler"]}]]]]'),t)};(function(){if(typeof window<"u"&&window.Reflect!==void 0&&window.customElements!==void 0){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}})();var we={exports:{}},K={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ut;function ar(){if(ut)return K;ut=1;var e=j,t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(d,c,f){var p,y={},C=null,b=null;f!==void 0&&(C=""+f),c.key!==void 0&&(C=""+c.key),c.ref!==void 0&&(b=c.ref);for(p in c)r.call(c,p)&&!i.hasOwnProperty(p)&&(y[p]=c[p]);if(d&&d.defaultProps)for(p in c=d.defaultProps,c)y[p]===void 0&&(y[p]=c[p]);return{$$typeof:t,type:d,key:C,ref:b,props:y,_owner:s.current}}return K.Fragment=o,K.jsx=a,K.jsxs=a,K}var X={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ft;function ir(){return ft||(ft=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w=Symbol.iterator,T="@@iterator";function P(n){if(n===null||typeof n!="object")return null;var l=w&&n[w]||n[T];return typeof l=="function"?l:null}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(n){{for(var l=arguments.length,h=new Array(l>1?l-1:0),g=1;g<l;g++)h[g-1]=arguments[g];Z("error",n,h)}}function Z(n,l,h){{var g=I.ReactDebugCurrentFrame,E=g.getStackAddendum();E!==""&&(l+="%s",h=h.concat([E]));var S=h.map(function(v){return String(v)});S.unshift("Warning: "+l),Function.prototype.apply.call(console[n],console,S)}}var U=!1,Nt=!1,Lt=!1,At=!1,jt=!1,Oe;Oe=Symbol.for("react.module.reference");function Dt(n){return!!(typeof n=="string"||typeof n=="function"||n===r||n===i||jt||n===s||n===f||n===p||At||n===b||U||Nt||Lt||typeof n=="object"&&n!==null&&(n.$$typeof===C||n.$$typeof===y||n.$$typeof===a||n.$$typeof===d||n.$$typeof===c||n.$$typeof===Oe||n.getModuleId!==void 0))}function Ft(n,l,h){var g=n.displayName;if(g)return g;var E=l.displayName||l.name||"";return E!==""?h+"("+E+")":h}function xe(n){return n.displayName||"Context"}function F(n){if(n==null)return null;if(typeof n.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case r:return"Fragment";case o:return"Portal";case i:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case d:var l=n;return xe(l)+".Consumer";case a:var h=n;return xe(h._context)+".Provider";case c:return Ft(n,n.render,"ForwardRef");case y:var g=n.displayName||null;return g!==null?g:F(n.type)||"Memo";case C:{var E=n,S=E._payload,v=E._init;try{return F(v(S))}catch{return null}}}return null}var B=Object.assign,G=0,Ne,Le,Ae,je,De,Fe,He;function qe(){}qe.__reactDisabledLog=!0;function Ht(){{if(G===0){Ne=console.log,Le=console.info,Ae=console.warn,je=console.error,De=console.group,Fe=console.groupCollapsed,He=console.groupEnd;var n={configurable:!0,enumerable:!0,value:qe,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}G++}}function qt(){{if(G--,G===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},n,{value:Ne}),info:B({},n,{value:Le}),warn:B({},n,{value:Ae}),error:B({},n,{value:je}),group:B({},n,{value:De}),groupCollapsed:B({},n,{value:Fe}),groupEnd:B({},n,{value:He})})}G<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=I.ReactCurrentDispatcher,ue;function V(n,l,h){{if(ue===void 0)try{throw Error()}catch(E){var g=E.stack.trim().match(/\n( *(at )?)/);ue=g&&g[1]||""}return`
|
|
18
|
+
`+ue+n}}var fe=!1,ee;{var Mt=typeof WeakMap=="function"?WeakMap:Map;ee=new Mt}function Me(n,l){if(!n||fe)return"";{var h=ee.get(n);if(h!==void 0)return h}var g;fe=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=de.current,de.current=null,Ht();try{if(l){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(H){g=H}Reflect.construct(n,[],v)}else{try{v.call()}catch(H){g=H}n.call(v.prototype)}}else{try{throw Error()}catch(H){g=H}n()}}catch(H){if(H&&g&&typeof H.stack=="string"){for(var $=H.stack.split(`
|
|
19
|
+
`),x=g.stack.split(`
|
|
20
|
+
`),_=$.length-1,R=x.length-1;_>=1&&R>=0&&$[_]!==x[R];)R--;for(;_>=1&&R>=0;_--,R--)if($[_]!==x[R]){if(_!==1||R!==1)do if(_--,R--,R<0||$[_]!==x[R]){var A=`
|
|
21
|
+
`+$[_].replace(" at new "," at ");return n.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",n.displayName)),typeof n=="function"&&ee.set(n,A),A}while(_>=1&&R>=0);break}}}finally{fe=!1,de.current=S,qt(),Error.prepareStackTrace=E}var z=n?n.displayName||n.name:"",et=z?V(z):"";return typeof n=="function"&&ee.set(n,et),et}function Bt(n,l,h){return Me(n,!1)}function Ut(n){var l=n.prototype;return!!(l&&l.isReactComponent)}function te(n,l,h){if(n==null)return"";if(typeof n=="function")return Me(n,Ut(n));if(typeof n=="string")return V(n);switch(n){case f:return V("Suspense");case p:return V("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case c:return Bt(n.render);case y:return te(n.type,l,h);case C:{var g=n,E=g._payload,S=g._init;try{return te(S(E),l,h)}catch{}}}return""}var ne=Object.prototype.hasOwnProperty,Be={},Ue=I.ReactDebugCurrentFrame;function re(n){if(n){var l=n._owner,h=te(n.type,n._source,l?l.type:null);Ue.setExtraStackFrame(h)}else Ue.setExtraStackFrame(null)}function Wt(n,l,h,g,E){{var S=Function.call.bind(ne);for(var v in n)if(S(n,v)){var $=void 0;try{if(typeof n[v]!="function"){var x=Error((g||"React class")+": "+h+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}$=n[v](l,v,g,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){$=_}$&&!($ instanceof Error)&&(re(E),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",g||"React class",h,v,typeof $),re(null)),$ instanceof Error&&!($.message in Be)&&(Be[$.message]=!0,re(E),k("Failed %s type: %s",h,$.message),re(null))}}}var zt=Array.isArray;function he(n){return zt(n)}function Yt(n){{var l=typeof Symbol=="function"&&Symbol.toStringTag,h=l&&n[Symbol.toStringTag]||n.constructor.name||"Object";return h}}function Gt(n){try{return We(n),!1}catch{return!0}}function We(n){return""+n}function ze(n){if(Gt(n))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Yt(n)),We(n)}var J=I.ReactCurrentOwner,Jt={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ge,pe;pe={};function Kt(n){if(ne.call(n,"ref")){var l=Object.getOwnPropertyDescriptor(n,"ref").get;if(l&&l.isReactWarning)return!1}return n.ref!==void 0}function Xt(n){if(ne.call(n,"key")){var l=Object.getOwnPropertyDescriptor(n,"key").get;if(l&&l.isReactWarning)return!1}return n.key!==void 0}function Qt(n,l){if(typeof n.ref=="string"&&J.current&&l&&J.current.stateNode!==l){var h=F(J.current.type);pe[h]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(J.current.type),n.ref),pe[h]=!0)}}function Zt(n,l){{var h=function(){Ye||(Ye=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};h.isReactWarning=!0,Object.defineProperty(n,"key",{get:h,configurable:!0})}}function Vt(n,l){{var h=function(){Ge||(Ge=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};h.isReactWarning=!0,Object.defineProperty(n,"ref",{get:h,configurable:!0})}}var en=function(n,l,h,g,E,S,v){var $={$$typeof:t,type:n,key:l,ref:h,props:v,_owner:S};return $._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty($,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty($,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$};function tn(n,l,h,g,E){{var S,v={},$=null,x=null;h!==void 0&&(ze(h),$=""+h),Xt(l)&&(ze(l.key),$=""+l.key),Kt(l)&&(x=l.ref,Qt(l,E));for(S in l)ne.call(l,S)&&!Jt.hasOwnProperty(S)&&(v[S]=l[S]);if(n&&n.defaultProps){var _=n.defaultProps;for(S in _)v[S]===void 0&&(v[S]=_[S])}if($||x){var R=typeof n=="function"?n.displayName||n.name||"Unknown":n;$&&Zt(v,R),x&&Vt(v,R)}return en(n,$,x,E,g,J.current,v)}}var ye=I.ReactCurrentOwner,Je=I.ReactDebugCurrentFrame;function W(n){if(n){var l=n._owner,h=te(n.type,n._source,l?l.type:null);Je.setExtraStackFrame(h)}else Je.setExtraStackFrame(null)}var ge;ge=!1;function me(n){return typeof n=="object"&&n!==null&&n.$$typeof===t}function Ke(){{if(ye.current){var n=F(ye.current.type);if(n)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+n+"`."}return""}}function nn(n){{if(n!==void 0){var l=n.fileName.replace(/^.*[\\\/]/,""),h=n.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+l+":"+h+"."}return""}}var Xe={};function rn(n){{var l=Ke();if(!l){var h=typeof n=="string"?n:n.displayName||n.name;h&&(l=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+h+">.")}return l}}function Qe(n,l){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var h=rn(l);if(Xe[h])return;Xe[h]=!0;var g="";n&&n._owner&&n._owner!==ye.current&&(g=" It was passed a child from "+F(n._owner.type)+"."),W(n),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,g),W(null)}}function Ze(n,l){{if(typeof n!="object")return;if(he(n))for(var h=0;h<n.length;h++){var g=n[h];me(g)&&Qe(g,l)}else if(me(n))n._store&&(n._store.validated=!0);else if(n){var E=P(n);if(typeof E=="function"&&E!==n.entries)for(var S=E.call(n),v;!(v=S.next()).done;)me(v.value)&&Qe(v.value,l)}}}function on(n){{var l=n.type;if(l==null||typeof l=="string")return;var h;if(typeof l=="function")h=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===c||l.$$typeof===y))h=l.propTypes;else return;if(h){var g=F(l);Wt(h,n.props,"prop",g,n)}else if(l.PropTypes!==void 0&&!ge){ge=!0;var E=F(l);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sn(n){{for(var l=Object.keys(n.props),h=0;h<l.length;h++){var g=l[h];if(g!=="children"&&g!=="key"){W(n),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),W(null);break}}n.ref!==null&&(W(n),k("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Ve(n,l,h,g,E,S){{var v=Dt(n);if(!v){var $="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&($+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=nn(E);x?$+=x:$+=Ke();var _;n===null?_="null":he(n)?_="array":n!==void 0&&n.$$typeof===t?(_="<"+(F(n.type)||"Unknown")+" />",$=" Did you accidentally export a JSX literal instead of a component?"):_=typeof n,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,$)}var R=tn(n,l,h,E,S);if(R==null)return R;if(v){var A=l.children;if(A!==void 0)if(g)if(he(A)){for(var z=0;z<A.length;z++)Ze(A[z],n);Object.freeze&&Object.freeze(A)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ze(A,n)}return n===r?sn(R):on(R),R}}function an(n,l,h){return Ve(n,l,h,!0)}function ln(n,l,h){return Ve(n,l,h,!1)}var cn=ln,dn=an;X.Fragment=r,X.jsx=cn,X.jsxs=dn}()),X}process.env.NODE_ENV==="production"?we.exports=ar():we.exports=ir();var lr=we.exports;const cr=e=>e.toLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(""),Ot=e=>e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`),dr=(e,t,o={})=>{if(e instanceof Element){const r=ur(e.classList,t,o);r!==""&&(e.className=r),Object.keys(t).forEach(s=>{if(!(s==="children"||s==="style"||s==="ref"||s==="class"||s==="className"||s==="forwardedRef"))if(s.indexOf("on")===0&&s[2]===s[2].toUpperCase()){const i=s.substring(2),a=i[0].toLowerCase()+i.substring(1);xt(a)||hr(e,a,t[s])}else e[s]=t[s],typeof t[s]==="string"&&e.setAttribute(Ot(s),t[s])})}},ur=(e,t,o)=>{const r=t.className||t.class,s=o.className||o.class,i=be(e),a=be(r?r.split(" "):[]),d=be(s?s.split(" "):[]),c=[];return i.forEach(f=>{a.has(f)?(c.push(f),a.delete(f)):d.has(f)||c.push(f)}),a.forEach(f=>c.push(f)),c.join(" ")},fr=e=>{switch(e){case"doubleclick":return"dblclick"}return e};/**
|
|
28
|
+
* Checks if an event is supported in the current execution environment.
|
|
29
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
30
|
+
*/const xt=e=>{if(typeof document>"u")return!0;{const t="on"+fr(e);let o=t in document;if(!o){const r=document.createElement("div");r.setAttribute(t,"return;"),o=typeof r[t]=="function"}return o}},hr=(e,t,o)=>{const r=e.__events||(e.__events={}),s=r[t];s&&e.removeEventListener(t,s),e.addEventListener(t,r[t]=function(a){o&&o.call(this,a)})},be=e=>{const t=new Map;return e.forEach(o=>t.set(o,o)),t},pr=(e,t)=>{typeof e=="function"?e(t):e!=null&&(e.current=t)},yr=(...e)=>t=>{e.forEach(o=>{pr(o,t)})},gr=(e,t)=>{const o=(r,s)=>lr.jsx(e,{...r,forwardedRef:s});return o.displayName=t,j.forwardRef(o)},u=(e,t,o,r)=>{r!==void 0&&r();const s=cr(e),i=class extends j.Component{constructor(d){super(d);$e(this,"componentEl");$e(this,"setComponentElRef",d=>{this.componentEl=d})}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(d){dr(this.componentEl,this.props,d)}render(){const{children:d,forwardedRef:c,style:f,className:p,ref:y,...C}=this.props;let b=Object.keys(C).reduce((T,P)=>{const I=C[P];if(P.indexOf("on")===0&&P[2]===P[2].toUpperCase()){const k=P.substring(2).toLowerCase();typeof document<"u"&&xt(k)&&(T[P]=I)}else{const k=typeof I;(k==="string"||k==="boolean"||k==="number")&&(T[Ot(P)]=I)}return T},{});o&&(b=o(this.props,b));const w={...b,ref:yr(c,this.setComponentElRef),style:f};return j.createElement(e,w,d)}static get displayName(){return s}};return t&&(i.contextType=t),gr(i,s)};Rt();const mr=u("add-circle-icon"),$r=u("archive-icon"),vr=u("arrow-icon"),br=u("bold-icon"),Er=u("calendar-cancel-icon"),Cr=u("calendar-check-icon"),Sr=u("calendar-icon"),kr=u("calendar-info-icon"),wr=u("calendar-patterns-icon"),Tr=u("checkmark-circle-icon"),Pr=u("chevron-icon"),Ir=u("close-icon"),_r=u("document-refresh-icon"),Rr=u("flow-icon"),Or=u("folder-icon"),xr=u("forward-icon"),Nr=u("globe-icon"),Lr=u("inbox-icon"),Ar=u("info-icon"),jr=u("italic-icon"),Dr=u("loading-icon"),Fr=u("location-icon"),Hr=u("location-off-icon"),qr=u("multi-select-dropdown"),Mr=u("nylas-additional-participants"),Br=u("nylas-availability-picker"),Ur=u("nylas-booked-event-card"),Wr=u("nylas-booking-calendar-picker"),zr=u("nylas-booking-form"),Yr=u("nylas-buffer-time"),Gr=u("nylas-calendar-picker"),Jr=u("nylas-cancel-booking-form"),Kr=u("nylas-cancelled-event-card"),Xr=u("nylas-composer"),Qr=u("nylas-custom-booking-flow"),Zr=u("nylas-date-picker"),Vr=u("nylas-editor-tabs"),eo=u("nylas-event-description"),to=u("nylas-event-duration"),no=u("nylas-event-info"),ro=u("nylas-event-title"),oo=u("nylas-form-card"),so=u("nylas-if-state"),ao=u("nylas-list-folders"),io=u("nylas-list-threads"),lo=u("nylas-locale-switch"),co=u("nylas-location-component"),uo=u("nylas-login"),fo=u("nylas-logo"),ho=u("nylas-mailbox"),po=u("nylas-mailbox-pagination"),yo=u("nylas-mailbox-toolbar-button"),go=u("nylas-notification"),mo=u("nylas-provider"),$o=u("nylas-scheduler-editor"),vo=u("nylas-scheduling"),bo=u("nylas-selected-event-card"),Eo=u("nylas-summarize-message-button"),Co=u("nylas-threads-refresh"),So=u("nylas-threads-search"),ko=u("nylas-time-window-picker"),wo=u("nylas-timeslot-picker"),To=u("nylas-view-email"),Po=u("nylas-view-thread"),Io=u("people-icon"),_o=u("play-icon"),Ro=u("refresh-icon"),Oo=u("reply-all-icon"),xo=u("reply-icon"),No=u("search-icon"),Lo=u("select-dropdown"),Ao=u("sent-icon"),jo=u("spam-icon"),Do=u("star-icon"),Fo=u("stop-icon"),Ho=u("tooltip-component"),qo=u("translate-icon"),Mo=u("trash-icon"),Bo=u("underline-icon"),Uo=u("warning-icon");function Wo(){const[,e]=j.useReducer(s=>s+1,0),t=j.useRef(),o=j.useRef(null),r=j.useRef(null);return j.useEffect(()=>{t.current&&(o.current||t.current.getNylasMailboxConnector().then(s=>{s&&(o.current=s,r.current=o.current.nylasAuthStore,s.nylasAuthStore.on("set",e),e())}))},[]),[t,r.current]}exports.AddCircleIcon=mr;exports.ArchiveIcon=$r;exports.ArrowIcon=vr;exports.BoldIcon=br;exports.CalendarCancelIcon=Er;exports.CalendarCheckIcon=Cr;exports.CalendarIcon=Sr;exports.CalendarInfoIcon=kr;exports.CalendarPatternsIcon=wr;exports.CheckmarkCircleIcon=Tr;exports.ChevronIcon=Pr;exports.CloseIcon=Ir;exports.DocumentRefreshIcon=_r;exports.FlowIcon=Rr;exports.FolderIcon=Or;exports.ForwardIcon=xr;exports.Fragment=Yn;exports.GlobeIcon=Nr;exports.Host=yt;exports.InboxIcon=Lr;exports.InfoIcon=Ar;exports.ItalicIcon=jr;exports.LoadingIcon=Dr;exports.LocationIcon=Fr;exports.LocationOffIcon=Hr;exports.MultiSelectDropdown=qr;exports.NylasAdditionalParticipants=Mr;exports.NylasAvailabilityPicker=Br;exports.NylasBookedEventCard=Ur;exports.NylasBookingCalendarPicker=Wr;exports.NylasBookingForm=zr;exports.NylasBufferTime=Yr;exports.NylasCalendarPicker=Gr;exports.NylasCancelBookingForm=Jr;exports.NylasCancelledEventCard=Kr;exports.NylasComposer=Xr;exports.NylasCustomBookingFlow=Qr;exports.NylasDatePicker=Zr;exports.NylasEditorTabs=Vr;exports.NylasEventDescription=eo;exports.NylasEventDuration=to;exports.NylasEventInfo=no;exports.NylasEventTitle=ro;exports.NylasFormCard=oo;exports.NylasIfState=so;exports.NylasListFolders=ao;exports.NylasListThreads=io;exports.NylasLocaleSwitch=lo;exports.NylasLocationComponent=co;exports.NylasLogin=uo;exports.NylasLogo=fo;exports.NylasMailbox=ho;exports.NylasMailboxPagination=po;exports.NylasMailboxToolbarButton=yo;exports.NylasNotification=go;exports.NylasProvider=mo;exports.NylasSchedulerEditor=$o;exports.NylasScheduling=vo;exports.NylasSelectedEventCard=bo;exports.NylasSummarizeMessageButton=Eo;exports.NylasThreadsRefresh=Co;exports.NylasThreadsSearch=So;exports.NylasTimeWindowPicker=ko;exports.NylasTimeslotPicker=wo;exports.NylasViewEmail=To;exports.NylasViewThread=Po;exports.PeopleIcon=Io;exports.PlayIcon=_o;exports.RefreshIcon=Ro;exports.ReplyAllIcon=Oo;exports.ReplyIcon=xo;exports.SearchIcon=No;exports.SelectDropdown=Lo;exports.SentIcon=Ao;exports.SpamIcon=jo;exports.StarIcon=Do;exports.StopIcon=Fo;exports.TooltipComponent=Ho;exports.TranslateIcon=qo;exports.TrashIcon=Mo;exports.UnderlineIcon=Bo;exports.WarningIcon=Uo;exports.applyPolyfills=hn;exports.createEvent=wn;exports.defineCustomElements=Rt;exports.forceUpdate=Hn;exports.getElement=gt;exports.getRenderingRef=Dn;exports.h=Ie;exports.registerInstance=Xn;exports.useNylasMailboxElement=Wo;
|