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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/add-circle-icon_22.entry-8d0ac489.cjs +1 -0
  2. package/dist/add-circle-icon_22.entry-da31fa71.js +1733 -0
  3. package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-7aad8104.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-bc2418f7.js} +20 -20
  5. package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-6eba68a9.cjs} +1 -1
  6. package/dist/arrow-icon.entry-9a932082.js +15 -0
  7. package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-5f7e3755.js} +4 -4
  8. package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-db17d481.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-1ff7845a.js} +4 -4
  10. package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-a5141f82.cjs} +1 -1
  11. package/dist/calendar-check-icon_2.entry-c3add652.cjs +1 -0
  12. package/dist/calendar-check-icon_2.entry-d7421059.js +25 -0
  13. package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-4458997f.js} +2 -2
  14. package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-445d624a.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-8961e6bb.cjs +1 -0
  16. package/dist/chevron-icon_3.entry-f7f3d487.js +117 -0
  17. package/dist/close-icon.entry-6dd5ff0a.js +15 -0
  18. package/dist/close-icon.entry-ebc527c5.cjs +1 -0
  19. package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
  20. package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
  21. package/dist/document-refresh-icon.entry-298b2133.cjs +1 -0
  22. package/dist/document-refresh-icon.entry-bdc323b5.js +15 -0
  23. package/dist/elements/index.d.ts +31 -2
  24. package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-15208ea9.cjs} +3 -3
  25. package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-62759373.js} +127 -127
  26. package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-9e082178.js} +4 -4
  27. package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-c8302bf5.cjs} +1 -1
  28. package/dist/google-logo-icon_3.entry-0c095209.js +258 -0
  29. package/dist/google-logo-icon_3.entry-f8433ff9.cjs +1 -0
  30. package/dist/index-0f3bd8df.js +1824 -0
  31. package/dist/index-7a55dc33.cjs +30 -0
  32. package/dist/index.d.ts +3 -1
  33. package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
  34. package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
  35. package/dist/info-icon_2.entry-73106882.js +34 -0
  36. package/dist/info-icon_2.entry-ca224a3b.cjs +1 -0
  37. package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-012644b7.js} +4 -4
  38. package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-f9f5e66f.cjs} +1 -1
  39. package/dist/mailbox-store-bb21512c-045c3ea0.cjs +1 -0
  40. package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-615660ef.js} +17 -16
  41. package/dist/nylas-additional-participants.entry-a50ef8e2.cjs +1 -0
  42. package/dist/nylas-additional-participants.entry-db85836a.js +83 -0
  43. package/dist/nylas-booked-event-card_10.entry-b49b2369.js +784 -0
  44. package/dist/nylas-booked-event-card_10.entry-fccb783c.cjs +1 -0
  45. package/dist/nylas-form-card.entry-090a4d3b.js +56 -0
  46. package/dist/nylas-form-card.entry-f5230005.cjs +1 -0
  47. package/dist/nylas-if-state.entry-7924dde0.js +96 -0
  48. package/dist/nylas-if-state.entry-ff9c9a85.cjs +1 -0
  49. package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-9dd96530.js} +9 -8
  50. package/dist/nylas-list-folders.entry-dbfc2cf8.cjs +1 -0
  51. package/dist/nylas-list-threads.entry-6bcc0328.cjs +1 -0
  52. package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-b435eaae.js} +5 -4
  53. package/dist/nylas-login.entry-1623d309.cjs +1 -0
  54. package/dist/nylas-login.entry-97350c76.js +75 -0
  55. package/dist/nylas-mailbox-pagination.entry-1776eb16.cjs +1 -0
  56. package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-ceef8be2.js} +4 -3
  57. package/dist/nylas-mailbox-toolbar-button.entry-7d3f79b9.cjs +1 -0
  58. package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-e6b3d3a4.js} +11 -10
  59. package/dist/nylas-mailbox.entry-06d8014a.js +136 -0
  60. package/dist/nylas-mailbox.entry-ae8da6ff.cjs +1 -0
  61. package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-8b9c2b69.js} +46 -33
  62. package/dist/nylas-provider.entry-97c9e272.cjs +1 -0
  63. package/dist/nylas-scheduler-editor.entry-c3791787.js +2181 -0
  64. package/dist/nylas-scheduler-editor.entry-f6cf1cd9.cjs +7 -0
  65. package/dist/nylas-scheduling.entry-08ae840a.cjs +1 -0
  66. package/dist/nylas-scheduling.entry-6380509a.js +237 -0
  67. package/dist/nylas-threads-refresh.entry-246e6d77.cjs +1 -0
  68. package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-eaee86fb.js} +6 -5
  69. package/dist/nylas-threads-search.entry-42a2acb1.cjs +1 -0
  70. package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7e12758e.js} +15 -14
  71. package/dist/nylas-view-thread.entry-78e6927a.cjs +1 -0
  72. package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-b936e76a.js} +5 -4
  73. package/dist/people-icon.entry-5c8ee696.js +15 -0
  74. package/dist/people-icon.entry-bcf848c0.cjs +1 -0
  75. package/dist/play-icon_2.entry-356e63cc.js +25 -0
  76. package/dist/play-icon_2.entry-92e78f1b.cjs +1 -0
  77. package/dist/react.cjs +1 -1
  78. package/dist/react.js +92 -61
  79. package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-77f0c377.js} +2 -2
  80. package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-bec053b6.cjs} +1 -1
  81. package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-0fdb18dc.js} +2 -2
  82. package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-f58bf25b.cjs} +1 -1
  83. package/dist/scheduler-config-store-51ee4f42-ce3a9b0e.cjs +1 -0
  84. package/dist/scheduler-config-store-51ee4f42-e02895da.js +14 -0
  85. package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-3ba2480c.js} +100 -95
  86. package/dist/scheduler-store-72116723-db9d91f6.cjs +1 -0
  87. package/dist/time-period-selector.entry-decd251b.js +78 -0
  88. package/dist/time-period-selector.entry-f25fad77.cjs +1 -0
  89. package/dist/translate-icon.entry-cac02c46.js +15 -0
  90. package/dist/translate-icon.entry-dd5b707c.cjs +1 -0
  91. package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
  92. package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
  93. package/dist/warning-icon.entry-370b9cf0.js +15 -0
  94. package/dist/warning-icon.entry-8af8a742.cjs +1 -0
  95. package/package.json +7 -4
  96. package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
  97. package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
  98. package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
  99. package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
  100. package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
  101. package/dist/chevron-icon.entry-58366662.cjs +0 -1
  102. package/dist/chevron-icon.entry-5e11cef5.js +0 -15
  103. package/dist/close-icon_2.entry-011d9cf4.js +0 -25
  104. package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
  105. package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
  106. package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
  107. package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
  108. package/dist/duration-bddc4a13-179ce826.js +0 -41
  109. package/dist/index-3b6f5cd5.cjs +0 -30
  110. package/dist/index-630f4e87.js +0 -1498
  111. package/dist/index-b30d446a-cbbef925.cjs +0 -7
  112. package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
  113. package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
  114. package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
  115. package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
  116. package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
  117. package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
  118. package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
  119. package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
  120. package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
  121. package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
  122. package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
  123. package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
  124. package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
  125. package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
  126. package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
  127. package/dist/play-icon_2.entry-ed5877e3.js +0 -25
  128. package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
  129. package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
  130. package/dist/search-icon_3.entry-292138c3.js +0 -101
  131. package/dist/search-icon_3.entry-8e555357.cjs +0 -1
  132. package/dist/utils-5074a070-ce33ee6b.js +0 -119
  133. package/dist/utils-5074a070-d5ba6add.cjs +0 -2
@@ -0,0 +1,30 @@
1
+ "use strict";var In=Object.defineProperty;var Rn=(e,t,n)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ee=(e,t,n)=>(Rn(e,typeof t!="symbol"?t+"":t,n),n);const D=require("react");require("react-dom");const _n="nylas-web-elements",kt={allRenderFn:!0,appendChildSlotFix:!1,asyncLoading:!0,asyncQueue:!1,attachStyles:!0,cloneNodeFix:!1,cmpDidLoad:!0,cmpDidRender:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpShouldUpdate:!1,cmpWillLoad:!0,cmpWillRender:!0,cmpWillUpdate:!0,connectedCallback:!0,constructableCSS:!0,cssAnnotations:!0,devTools:!1,disconnectedCallback:!0,element:!1,event:!0,experimentalScopedSlotChanges:!1,experimentalSlotFixes:!1,formAssociated:!0,hasRenderFn:!0,hostListener:!0,hostListenerTarget:!0,hostListenerTargetBody:!0,hostListenerTargetDocument:!0,hostListenerTargetParent:!1,hostListenerTargetWindow:!0,hotModuleReplacement:!1,hydrateClientSide:!1,hydrateServerSide:!1,hydratedAttribute:!1,hydratedClass:!0,initializeNextTick:!1,invisiblePrehydration:!0,isDebug:!1,isDev:!1,isTesting:!1,lazyLoad:!0,lifecycle:!0,lifecycleDOMEvents:!1,member:!0,method:!0,mode:!1,observeAttribute:!0,profile:!1,prop:!0,propBoolean:!0,propMutable:!0,propNumber:!0,propString:!0,reflect:!1,scoped:!0,scopedSlotTextContentFix:!1,scriptDataOpts:!1,shadowDelegatesFocus:!1,shadowDom:!0,slot:!0,slotChildNodesFix:!1,slotRelocation:!0,state:!0,style:!0,svg:!0,taskQueue:!0,transformTagName:!1,updatable:!0,vdomAttribute:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomPropOrAttr:!0,vdomRef:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,vdomXlink:!1,watchCallback:!0};let J,Te,fe,wt=!1,le=!1,Oe=!1,L=!1,Pe=null,Ie=!1;const q=(e,t="")=>()=>{},Nn=(e,t)=>()=>{},On="{visibility:hidden}.hydrated{visibility:inherit}",Tt="slot-fb{display:contents}slot-fb[hidden]{display:none}",xn=["formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"],lt={},Ln="http://www.w3.org/2000/svg",An="http://www.w3.org/1999/xhtml",Dn=e=>e!=null,xe=e=>(e=typeof e,e==="object"||e==="function");function Pt(e){var t,n,s;return(s=(n=(t=e.head)===null||t===void 0?void 0:t.querySelector('meta[name="csp-nonce"]'))===null||n===void 0?void 0:n.getAttribute("content"))!==null&&s!==void 0?s:void 0}const Le=(e,t,...n)=>{let s=null,r=null,c=null,a=!1,l=!1;const i=[],f=g=>{for(let y=0;y<g.length;y++)s=g[y],Array.isArray(s)?f(s):s!=null&&typeof s!="boolean"&&((a=typeof e!="function"&&!xe(s))&&(s=String(s)),a&&l?i[i.length-1].$text$+=s:i.push(a?ce(null,s):s),l=a)};if(f(n),t){t.key&&(r=t.key),t.name&&(c=t.name);{const g=t.className||t.class;g&&(t.class=typeof g!="object"?g:Object.keys(g).filter(y=>g[y]).join(" "))}}if(typeof e=="function")return e(t===null?{}:t,i,jn);const h=ce(e,null);return h.$attrs$=t,i.length>0&&(h.$children$=i),h.$key$=r,h.$name$=c,h},ce=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return n.$attrs$=null,n.$key$=null,n.$name$=null,n},It={},Fn=e=>e&&e.$tag$===It,jn={forEach:(e,t)=>e.map(ct).forEach(t),map:(e,t)=>e.map(ct).map(t).map(Hn)},ct=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),Hn=e=>{if(typeof e.vtag=="function"){const n=Object.assign({},e.vattrs);return e.vkey&&(n.key=e.vkey),e.vname&&(n.name=e.vname),Le(e.vtag,n,...e.vchildren||[])}const t=ce(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},Mn=(e,t)=>e!=null&&!xe(e)?t&4?e==="false"?!1:e===""||!!e:t&2?parseFloat(e):t&1?String(e):e:e,Rt=e=>F(e).$hostElement$,Bn=(e,t,n)=>{const s=Rt(e);return{emit:r=>_t(s,t,{bubbles:!!(n&4),composed:!!(n&2),cancelable:!!(n&1),detail:r})}},_t=(e,t,n)=>{const s=R.ce(t,n);return e.dispatchEvent(s),s},dt=new WeakMap,qn=(e,t,n)=>{let s=ue.get(e);$o&&n?(s=s||new CSSStyleSheet,typeof s=="string"?s=t:s.replaceSync(t)):s=t,ue.set(e,s)},Un=(e,t,n)=>{var s;const r=Nt(t),c=ue.get(r);if(e=e.nodeType===11?e:O,c)if(typeof c=="string"){e=e.head||e;let a=dt.get(e),l;if(a||dt.set(e,a=new Set),!a.has(r)){{l=O.createElement("style"),l.innerHTML=c;const i=(s=R.$nonce$)!==null&&s!==void 0?s:Pt(O);i!=null&&l.setAttribute("nonce",i),e.insertBefore(l,e.querySelector("link"))}t.$flags$&4&&(l.innerHTML+=Tt),a&&a.add(r)}}else e.adoptedStyleSheets.includes(c)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,c]);return r},Wn=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,s=t.$flags$,r=q("attachStyles",t.$tagName$),c=Un(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);s&10&&(n["s-sc"]=c,n.classList.add(c+"-h"),s&2&&n.classList.add(c+"-s")),r()},Nt=(e,t)=>"sc-"+e.$tagName$,ut=(e,t,n,s,r,c)=>{if(n!==s){let a=$t(e,t),l=t.toLowerCase();if(t==="class"){const i=e.classList,f=ft(n),h=ft(s);i.remove(...f.filter(g=>g&&!h.includes(g))),i.add(...h.filter(g=>g&&!f.includes(g)))}else if(t==="style"){for(const i in n)(!s||s[i]==null)&&(i.includes("-")?e.style.removeProperty(i):e.style[i]="");for(const i in s)(!n||s[i]!==n[i])&&(i.includes("-")?e.style.setProperty(i,s[i]):e.style[i]=s[i])}else if(t!=="key")if(t==="ref")s&&s(e);else if(!a&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):$t(te,l)?t=l.slice(2):t=l[2]+t.slice(3),n||s){const i=t.endsWith(Ot);t=t.replace(Yn,""),n&&R.rel(e,t,n,i),s&&R.ael(e,t,s,i)}}else{const i=xe(s);if((a||i&&s!==null)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{const f=s??"";t==="list"?a=!1:(n==null||e[t]!=f)&&(e[t]=f)}}catch{}s==null||s===!1?(s!==!1||e.getAttribute(t)==="")&&e.removeAttribute(t):(!a||c&4||r)&&!i&&(s=s===!0?"":s,e.setAttribute(t,s))}}},zn=/\s/,ft=e=>e?e.split(zn):[],Ot="Capture",Yn=new RegExp(Ot+"$"),xt=(e,t,n,s)=>{const r=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,c=e&&e.$attrs$||lt,a=t.$attrs$||lt;for(s in c)s in a||ut(r,s,c[s],void 0,n,t.$flags$);for(s in a)ut(r,s,c[s],a[s],n,t.$flags$)},de=(e,t,n,s)=>{const r=t.$children$[n];let c=0,a,l,i;if(wt||(Oe=!0,r.$tag$==="slot"&&(J&&s.classList.add(J+"-s"),r.$flags$|=r.$children$?2:1)),r.$text$!==null)a=r.$elm$=O.createTextNode(r.$text$);else if(r.$flags$&1)a=r.$elm$=O.createTextNode("");else{if(L||(L=r.$tag$==="svg"),a=r.$elm$=O.createElementNS(L?Ln:An,r.$flags$&2?"slot-fb":r.$tag$),L&&r.$tag$==="foreignObject"&&(L=!1),xt(null,r,L),Dn(J)&&a["s-si"]!==J&&a.classList.add(a["s-si"]=J),r.$children$)for(c=0;c<r.$children$.length;++c)l=de(e,r,c,a),l&&a.appendChild(l);r.$tag$==="svg"?L=!1:a.tagName==="foreignObject"&&(L=!0)}return a["s-hn"]=fe,r.$flags$&3&&(a["s-sr"]=!0,a["s-cr"]=Te,a["s-sn"]=r.$name$||"",i=e&&e.$children$&&e.$children$[n],i&&i.$tag$===r.$tag$&&e.$elm$&&ee(e.$elm$,!1)),a},ee=(e,t)=>{R.$flags$|=1;const n=e.childNodes;for(let s=n.length-1;s>=0;s--){const r=n[s];r["s-hn"]!==fe&&r["s-ol"]&&(Dt(r).insertBefore(r,Ae(r)),r["s-ol"].remove(),r["s-ol"]=void 0,r["s-sh"]=void 0,Oe=!0),t&&ee(r,t)}R.$flags$&=-2},Lt=(e,t,n,s,r,c)=>{let a=e["s-cr"]&&e["s-cr"].parentNode||e,l;for(a.shadowRoot&&a.tagName===fe&&(a=a.shadowRoot);r<=c;++r)s[r]&&(l=de(null,n,r,e),l&&(s[r].$elm$=l,a.insertBefore(l,Ae(t))))},At=(e,t,n)=>{for(let s=t;s<=n;++s){const r=e[s];if(r){const c=r.$elm$;Ht(r),c&&(le=!0,c["s-ol"]?c["s-ol"].remove():ee(c,!0),c.remove())}}},Gn=(e,t,n,s,r=!1)=>{let c=0,a=0,l=0,i=0,f=t.length-1,h=t[0],g=t[f],y=s.length-1,S=s[0],m=s[y],$,C;for(;c<=f&&a<=y;)if(h==null)h=t[++c];else if(g==null)g=t[--f];else if(S==null)S=s[++a];else if(m==null)m=s[--y];else if(ie(h,S,r))K(h,S,r),h=t[++c],S=s[++a];else if(ie(g,m,r))K(g,m,r),g=t[--f],m=s[--y];else if(ie(h,m,r))(h.$tag$==="slot"||m.$tag$==="slot")&&ee(h.$elm$.parentNode,!1),K(h,m,r),e.insertBefore(h.$elm$,g.$elm$.nextSibling),h=t[++c],m=s[--y];else if(ie(g,S,r))(h.$tag$==="slot"||m.$tag$==="slot")&&ee(g.$elm$.parentNode,!1),K(g,S,r),e.insertBefore(g.$elm$,h.$elm$),g=t[--f],S=s[++a];else{for(l=-1,i=c;i<=f;++i)if(t[i]&&t[i].$key$!==null&&t[i].$key$===S.$key$){l=i;break}l>=0?(C=t[l],C.$tag$!==S.$tag$?$=de(t&&t[a],n,l,e):(K(C,S,r),t[l]=void 0,$=C.$elm$),S=s[++a]):($=de(t&&t[a],n,a,e),S=s[++a]),$&&Dt(h.$elm$).insertBefore($,Ae(h.$elm$))}c>f?Lt(e,s[y+1]==null?null:s[y+1].$elm$,n,s,a,y):a>y&&At(t,c,f)},ie=(e,t,n=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:n?!0:e.$key$===t.$key$:!1,Ae=e=>e&&e["s-ol"]||e,Dt=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,K=(e,t,n=!1)=>{const s=t.$elm$=e.$elm$,r=e.$children$,c=t.$children$,a=t.$tag$,l=t.$text$;let i;l===null?(L=a==="svg"?!0:a==="foreignObject"?!1:L,a==="slot"||xt(e,t,L),r!==null&&c!==null?Gn(s,r,t,c,n):c!==null?(e.$text$!==null&&(s.textContent=""),Lt(s,null,t,c,0,c.length-1)):r!==null&&At(r,0,r.length-1),L&&a==="svg"&&(L=!1)):(i=s["s-cr"])?i.parentNode.textContent=l:e.$text$!==l&&(s.data=l)},Ft=e=>{const t=e.childNodes;for(const n of t)if(n.nodeType===1){if(n["s-sr"]){const s=n["s-sn"];n.hidden=!1;for(const r of t)if(r!==n){if(r["s-hn"]!==n["s-hn"]||s!==""){if(r.nodeType===1&&(s===r.getAttribute("slot")||s===r["s-sn"])){n.hidden=!0;break}}else if(r.nodeType===1||r.nodeType===3&&r.textContent.trim()!==""){n.hidden=!0;break}}}Ft(n)}},M=[],jt=e=>{let t,n,s;for(const r of e.childNodes){if(r["s-sr"]&&(t=r["s-cr"])&&t.parentNode){n=t.parentNode.childNodes;const c=r["s-sn"];for(s=n.length-1;s>=0;s--)if(t=n[s],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==r["s-hn"]&&!kt.experimentalSlotFixes)if(ht(t,c)){let a=M.find(l=>l.$nodeToRelocate$===t);le=!0,t["s-sn"]=t["s-sn"]||c,a?(a.$nodeToRelocate$["s-sh"]=r["s-hn"],a.$slotRefNode$=r):(t["s-sh"]=r["s-hn"],M.push({$slotRefNode$:r,$nodeToRelocate$:t})),t["s-sr"]&&M.map(l=>{ht(l.$nodeToRelocate$,t["s-sn"])&&(a=M.find(i=>i.$nodeToRelocate$===t),a&&!l.$slotRefNode$&&(l.$slotRefNode$=a.$slotRefNode$))})}else M.some(a=>a.$nodeToRelocate$===t)||M.push({$nodeToRelocate$:t})}r.nodeType===1&&jt(r)}},ht=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",Ht=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(Ht)},Jn=(e,t,n=!1)=>{var s,r,c,a;const l=e.$hostElement$,i=e.$cmpMeta$,f=e.$vnode$||ce(null,null),h=Fn(t)?t:Le(null,null,t);if(fe=l.tagName,n&&h.$attrs$)for(const g of Object.keys(h.$attrs$))l.hasAttribute(g)&&!["key","ref","style","class"].includes(g)&&(h.$attrs$[g]=l[g]);h.$tag$=null,h.$flags$|=4,e.$vnode$=h,h.$elm$=f.$elm$=l.shadowRoot||l,J=l["s-sc"],Te=l["s-cr"],wt=(i.$flags$&1)!==0,le=!1,K(f,h,n);{if(R.$flags$|=1,Oe){jt(h.$elm$);for(const g of M){const y=g.$nodeToRelocate$;if(!y["s-ol"]){const S=O.createTextNode("");S["s-nr"]=y,y.parentNode.insertBefore(y["s-ol"]=S,y)}}for(const g of M){const y=g.$nodeToRelocate$,S=g.$slotRefNode$;if(S){const m=S.parentNode;let $=S.nextSibling;{let C=(s=y["s-ol"])===null||s===void 0?void 0:s.previousSibling;for(;C;){let E=(r=C["s-nr"])!==null&&r!==void 0?r:null;if(E&&E["s-sn"]===y["s-sn"]&&m===E.parentNode&&(E=E.nextSibling,!E||!E["s-nr"])){$=E;break}C=C.previousSibling}}(!$&&m!==y.parentNode||y.nextSibling!==$)&&y!==$&&(!y["s-hn"]&&y["s-ol"]&&(y["s-hn"]=y["s-ol"].parentNode.nodeName),m.insertBefore(y,$),y.nodeType===1&&(y.hidden=(c=y["s-ih"])!==null&&c!==void 0?c:!1))}else y.nodeType===1&&(n&&(y["s-ih"]=(a=y.hidden)!==null&&a!==void 0?a:!1),y.hidden=!0)}}le&&Ft(h.$elm$),R.$flags$&=-2,M.length=0}Te=void 0},Mt=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(n=>e.$onRenderResolve$=n))},he=(e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return Mt(e,e.$ancestorComponent$),bo(()=>Kn(e,t))},Kn=(e,t)=>{const n=q("scheduleUpdate",e.$cmpMeta$.$tagName$),s=e.$lazyInstance$;let r;return t?(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map(([c,a])=>B(s,c,a)),e.$queuedListeners$=void 0),r=B(s,"componentWillLoad")):r=B(s,"componentWillUpdate"),r=pt(r,()=>B(s,"componentWillRender")),n(),pt(r,()=>Qn(e,s,t))},pt=(e,t)=>Xn(e)?e.then(t):t(),Xn=e=>e instanceof Promise||e&&e.then&&typeof e.then=="function",Qn=async(e,t,n)=>{var s;const r=e.$hostElement$,c=q("update",e.$cmpMeta$.$tagName$),a=r["s-rc"];n&&Wn(e);const l=q("render",e.$cmpMeta$.$tagName$);Zn(e,t,r,n),a&&(a.map(i=>i()),r["s-rc"]=void 0),l(),c();{const i=(s=r["s-p"])!==null&&s!==void 0?s:[],f=()=>Vn(e);i.length===0?f():(Promise.all(i).then(f),e.$flags$|=4,i.length=0)}},Zn=(e,t,n,s)=>{try{Pe=t,t=t.render(),e.$flags$&=-17,e.$flags$|=2,Jn(e,t,s)}catch(r){b(r,e.$hostElement$)}return Pe=null,null},gt=()=>Pe,Vn=e=>{const t=e.$cmpMeta$.$tagName$,n=e.$hostElement$,s=q("postUpdate",t),r=e.$lazyInstance$,c=e.$ancestorComponent$;B(r,"componentDidRender"),e.$flags$&64?(B(r,"componentDidUpdate"),s()):(e.$flags$|=64,qt(n),B(r,"componentDidLoad"),s(),e.$onReadyResolve$(n),c||Bt()),e.$onInstanceResolve$(n),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&Fe(()=>he(e,!1)),e.$flags$&=-517},yt=e=>{{const t=F(e),n=t.$hostElement$.isConnected;return n&&(t.$flags$&18)===2&&he(t,!1),n}},Bt=e=>{qt(O.documentElement),Fe(()=>_t(te,"appload",{detail:{namespace:_n}}))},B=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(s){b(s)}},qt=e=>e.classList.add("hydrated"),eo=(e,t)=>F(e).$instanceValues$.get(t),to=(e,t,n,s)=>{const r=F(e),c=r.$hostElement$,a=r.$instanceValues$.get(t),l=r.$flags$,i=r.$lazyInstance$;n=Mn(n,s.$members$[t][0]);const f=Number.isNaN(a)&&Number.isNaN(n),h=n!==a&&!f;if((!(l&8)||a===void 0)&&h&&(r.$instanceValues$.set(t,n),i)){if(s.$watchers$&&l&128){const g=s.$watchers$[t];g&&g.map(y=>{try{i[y](n,a,t)}catch(S){b(S,c)}})}(l&18)===2&&he(r,!1)}},Ut=(e,t,n)=>{var s;const r=e.prototype;if(t.$flags$&64&&n&1&&xn.forEach(c=>Object.defineProperty(r,c,{value(...a){const l=F(this),i=l.$lazyInstance$;if(!i)l.$onReadyPromise$.then(f=>{const h=f[c];typeof h=="function"&&h.call(f,...a)});else{const f=i[c];typeof f=="function"&&f.call(i,...a)}}})),t.$members$){e.watchers&&(t.$watchers$=e.watchers);const c=Object.entries(t.$members$);if(c.map(([a,[l]])=>{l&31||n&2&&l&32?Object.defineProperty(r,a,{get(){return eo(this,a)},set(i){to(this,a,i,t)},configurable:!0,enumerable:!0}):n&1&&l&64&&Object.defineProperty(r,a,{value(...i){var f;const h=F(this);return(f=h==null?void 0:h.$onInstancePromise$)===null||f===void 0?void 0:f.then(()=>{var g;return(g=h.$lazyInstance$)===null||g===void 0?void 0:g[a](...i)})}})}),n&1){const a=new Map;r.attributeChangedCallback=function(l,i,f){R.jmp(()=>{var h;const g=a.get(l);if(this.hasOwnProperty(g))f=this[g],delete this[g];else{if(r.hasOwnProperty(g)&&typeof this[g]=="number"&&this[g]==f)return;if(g==null){const y=F(this),S=y==null?void 0:y.$flags$;if(S&&!(S&8)&&S&128&&f!==i){const m=y.$lazyInstance$,$=(h=t.$watchers$)===null||h===void 0?void 0:h[l];$==null||$.forEach(C=>{m[C]!=null&&m[C].call(m,f,i,l)})}return}}this[g]=f===null&&typeof this[g]=="boolean"?!1:f})},e.observedAttributes=Array.from(new Set([...Object.keys((s=t.$watchers$)!==null&&s!==void 0?s:{}),...c.filter(([l,i])=>i[0]&15).map(([l,i])=>{const f=i[1]||l;return a.set(f,l),f})]))}}return e},no=async(e,t,n,s)=>{let r;if(!(t.$flags$&32)){t.$flags$|=32;{if(r=go(n),r.then){const i=Nn();r=await r,i()}r.isProxied||(n.$watchers$=r.watchers,Ut(r,n,2),r.isProxied=!0);const l=q("createInstance",n.$tagName$);t.$flags$|=8;try{new r(t)}catch(i){b(i)}t.$flags$&=-9,t.$flags$|=128,l(),Re(t.$lazyInstance$)}if(r.style){let l=r.style;const i=Nt(n);if(!ue.has(i)){const f=q("registerStyles",n.$tagName$);qn(i,l,!!(n.$flags$&1)),f()}}}const c=t.$ancestorComponent$,a=()=>he(t,!0);c&&c["s-rc"]?c["s-rc"].push(a):a()},Re=e=>{B(e,"connectedCallback")},oo=e=>{if(!(R.$flags$&1)){const t=F(e),n=t.$cmpMeta$,s=q("connectedCallback",n.$tagName$);if(t.$flags$&1)Wt(e,t,n.$listeners$),t!=null&&t.$lazyInstance$?Re(t.$lazyInstance$):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>Re(t.$lazyInstance$));else{t.$flags$|=1,n.$flags$&12&&ro(e);{let r=e;for(;r=r.parentNode||r.host;)if(r["s-p"]){Mt(t,t.$ancestorComponent$=r);break}}n.$members$&&Object.entries(n.$members$).map(([r,[c]])=>{if(c&31&&e.hasOwnProperty(r)){const a=e[r];delete e[r],e[r]=a}}),no(e,t,n)}s()}},ro=e=>{const t=e["s-cr"]=O.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},mt=e=>{B(e,"disconnectedCallback")},so=async e=>{if(!(R.$flags$&1)){const t=F(e);t.$rmListeners$&&(t.$rmListeners$.map(n=>n()),t.$rmListeners$=void 0),t!=null&&t.$lazyInstance$?mt(t.$lazyInstance$):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>mt(t.$lazyInstance$))}},ao=(e,t={})=>{var n;const s=q(),r=[],c=t.exclude||[],a=te.customElements,l=O.head,i=l.querySelector("meta[charset]"),f=O.createElement("style"),h=[];let g,y=!0;Object.assign(R,t),R.$resourcesUrl$=new URL(t.resourcesUrl||"./",O.baseURI).href;let S=!1;if(e.map(m=>{m[1].map($=>{var C;const E={$flags$:$[0],$tagName$:$[1],$members$:$[2],$listeners$:$[3]};E.$flags$&4&&(S=!0),E.$members$=$[2],E.$listeners$=$[3],E.$watchers$=(C=$[4])!==null&&C!==void 0?C:{};const P=E.$tagName$,W=class extends HTMLElement{constructor(z){super(z),z=this,po(z,E),E.$flags$&1&&z.attachShadow({mode:"open"})}connectedCallback(){g&&(clearTimeout(g),g=null),y?h.push(this):R.jmp(()=>oo(this))}disconnectedCallback(){R.jmp(()=>so(this))}componentOnReady(){return F(this).$onReadyPromise$}};E.$flags$&64&&(W.formAssociated=!0),E.$lazyBundleId$=m[0],!c.includes(P)&&!a.get(P)&&(r.push(P),a.define(P,Ut(W,E,1)))})}),S&&(f.innerHTML+=Tt),f.innerHTML+=r+On,f.innerHTML.length){f.setAttribute("data-styles","");const m=(n=R.$nonce$)!==null&&n!==void 0?n:Pt(O);m!=null&&f.setAttribute("nonce",m),l.insertBefore(f,i?i.nextSibling:l.firstChild)}y=!1,h.length?h.map(m=>m.connectedCallback()):R.jmp(()=>g=setTimeout(Bt,30)),s()},io=(e,t)=>t,Wt=(e,t,n,s)=>{n&&n.map(([r,c,a])=>{const l=co(e,r),i=lo(t,a),f=uo(r);R.ael(l,c,i,f),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>R.rel(l,c,i,f))})},lo=(e,t)=>n=>{try{e.$flags$&256?e.$lazyInstance$[t](n):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}catch(s){b(s)}},co=(e,t)=>t&4?O:t&8?te:t&16?O.body:e,uo=e=>yo?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0,fo=e=>R.$nonce$=e,De=new WeakMap,F=e=>De.get(e),ho=(e,t)=>De.set(t.$lazyInstance$=e,t),po=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise(s=>n.$onInstanceResolve$=s),n.$onReadyPromise$=new Promise(s=>n.$onReadyResolve$=s),e["s-p"]=[],e["s-rc"]=[],Wt(e,n,t.$listeners$),De.set(e,n)},$t=(e,t)=>t in e,b=(e,t)=>(0,console.error)(e,t),Se=new Map,go=(e,t,n)=>{const s=e.$tagName$.replace(/-/g,"_"),r=e.$lazyBundleId$,c=Se.get(r);if(c)return c[s];if(!n||!kt.hotModuleReplacement){const a=l=>(Se.set(r,l),l[s]);switch(r){case"document-refresh-icon":return Promise.resolve().then(()=>require("./document-refresh-icon.entry-298b2133.cjs")).then(a,b);case"nylas-additional-participants":return Promise.resolve().then(()=>require("./nylas-additional-participants.entry-a50ef8e2.cjs")).then(a,b);case"nylas-if-state":return Promise.resolve().then(()=>require("./nylas-if-state.entry-ff9c9a85.cjs")).then(a,b);case"nylas-list-folders":return Promise.resolve().then(()=>require("./nylas-list-folders.entry-dbfc2cf8.cjs")).then(a,b);case"nylas-list-threads":return Promise.resolve().then(()=>require("./nylas-list-threads.entry-6bcc0328.cjs")).then(a,b);case"nylas-login":return Promise.resolve().then(()=>require("./nylas-login.entry-1623d309.cjs")).then(a,b);case"nylas-mailbox":return Promise.resolve().then(()=>require("./nylas-mailbox.entry-ae8da6ff.cjs")).then(a,b);case"nylas-mailbox-pagination":return Promise.resolve().then(()=>require("./nylas-mailbox-pagination.entry-1776eb16.cjs")).then(a,b);case"nylas-mailbox-toolbar-button":return Promise.resolve().then(()=>require("./nylas-mailbox-toolbar-button.entry-7d3f79b9.cjs")).then(a,b);case"nylas-provider":return Promise.resolve().then(()=>require("./nylas-provider.entry-97c9e272.cjs")).then(a,b);case"nylas-scheduler-editor":return Promise.resolve().then(()=>require("./nylas-scheduler-editor.entry-f6cf1cd9.cjs")).then(a,b);case"nylas-scheduling":return Promise.resolve().then(()=>require("./nylas-scheduling.entry-08ae840a.cjs")).then(a,b);case"nylas-threads-refresh":return Promise.resolve().then(()=>require("./nylas-threads-refresh.entry-246e6d77.cjs")).then(a,b);case"nylas-threads-search":return Promise.resolve().then(()=>require("./nylas-threads-search.entry-42a2acb1.cjs")).then(a,b);case"nylas-view-thread":return Promise.resolve().then(()=>require("./nylas-view-thread.entry-78e6927a.cjs")).then(a,b);case"people-icon":return Promise.resolve().then(()=>require("./people-icon.entry-bcf848c0.cjs")).then(a,b);case"archive-icon_7":return Promise.resolve().then(()=>require("./archive-icon_7.entry-7aad8104.cjs")).then(a,b);case"arrow-icon":return Promise.resolve().then(()=>require("./arrow-icon.entry-6eba68a9.cjs")).then(a,b);case"forward-icon_6":return Promise.resolve().then(()=>require("./forward-icon_6.entry-15208ea9.cjs")).then(a,b);case"google-logo-icon_3":return Promise.resolve().then(()=>require("./google-logo-icon_3.entry-f8433ff9.cjs")).then(a,b);case"nylas-booked-event-card_10":return Promise.resolve().then(()=>require("./nylas-booked-event-card_10.entry-fccb783c.cjs")).then(a,b);case"bold-icon_3":return Promise.resolve().then(()=>require("./bold-icon_3.entry-db17d481.cjs")).then(a,b);case"add-circle-icon_22":return Promise.resolve().then(()=>require("./add-circle-icon_22.entry-8d0ac489.cjs")).then(a,b);case"calendar-check-icon_2":return Promise.resolve().then(()=>require("./calendar-check-icon_2.entry-c3add652.cjs")).then(a,b);case"play-icon_2":return Promise.resolve().then(()=>require("./play-icon_2.entry-92e78f1b.cjs")).then(a,b);case"refresh-icon":return Promise.resolve().then(()=>require("./refresh-icon.entry-bec053b6.cjs")).then(a,b);case"translate-icon":return Promise.resolve().then(()=>require("./translate-icon.entry-dd5b707c.cjs")).then(a,b);case"warning-icon":return Promise.resolve().then(()=>require("./warning-icon.entry-8af8a742.cjs")).then(a,b);case"calendar-cancel-icon":return Promise.resolve().then(()=>require("./calendar-cancel-icon.entry-a5141f82.cjs")).then(a,b);case"calendar-icon":return Promise.resolve().then(()=>require("./calendar-icon.entry-445d624a.cjs")).then(a,b);case"time-period-selector":return Promise.resolve().then(()=>require("./time-period-selector.entry-f25fad77.cjs")).then(a,b);case"nylas-form-card":return Promise.resolve().then(()=>require("./nylas-form-card.entry-f5230005.cjs")).then(a,b);case"loading-icon":return Promise.resolve().then(()=>require("./loading-icon.entry-f9f5e66f.cjs")).then(a,b);case"globe-icon":return Promise.resolve().then(()=>require("./globe-icon.entry-c8302bf5.cjs")).then(a,b);case"close-icon":return Promise.resolve().then(()=>require("./close-icon.entry-ebc527c5.cjs")).then(a,b);case"info-icon_2":return Promise.resolve().then(()=>require("./info-icon_2.entry-ca224a3b.cjs")).then(a,b);case"chevron-icon_3":return Promise.resolve().then(()=>require("./chevron-icon_3.entry-8961e6bb.cjs")).then(a,b)}}return import(`./${r}.entry.js`).then(a=>(Se.set(r,a),a[s]),b)},ue=new Map,te=typeof window<"u"?window:{},O=te.document||{head:{}},R={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,s)=>e.addEventListener(t,n,s),rel:(e,t,n,s)=>e.removeEventListener(t,n,s),ce:(e,t)=>new CustomEvent(e,t)},yo=(()=>{let e=!1;try{O.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch{}return e})(),mo=e=>Promise.resolve(e),$o=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),vt=[],zt=[],vo=(e,t)=>n=>{e.push(n),Ie||(Ie=!0,t&&R.$flags$&4?Fe(_e):R.raf(_e))},bt=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(n){b(n)}e.length=0},_e=()=>{bt(vt),bt(zt),(Ie=vt.length>0)&&R.raf(_e)},Fe=e=>mo().then(e),bo=vo(zt,!0),Co=(e,t,n)=>{const s=e.get(t);s?s.includes(n)||s.push(n):e.set(t,[n])},Eo=(e,t)=>{let n;return(...s)=>{n&&clearTimeout(n),n=setTimeout(()=>{n=0,e(...s)},t)}},So=e=>!("isConnected"in e)||e.isConnected,Ct=Eo(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(So))},2e3),ko=()=>{if(typeof gt!="function")return{};const e=new Map;return{dispose:()=>e.clear(),get:t=>{const n=gt();n&&Co(e,t,n)},set:t=>{const n=e.get(t);n&&e.set(t,n.filter(yt)),Ct(e)},reset:()=>{e.forEach(t=>t.forEach(yt)),Ct(e)}}},ke=e=>typeof e=="function"?e():e,wo=(e,t=(n,s)=>n!==s)=>{const n=ke(e);let s=new Map(Object.entries(n??{}));const r={dispose:[],get:[],set:[],reset:[]},c=()=>{var m;s=new Map(Object.entries((m=ke(e))!==null&&m!==void 0?m:{})),r.reset.forEach($=>$())},a=()=>{r.dispose.forEach(m=>m()),c()},l=m=>(r.get.forEach($=>$(m)),s.get(m)),i=(m,$)=>{const C=s.get(m);t($,C,m)&&(s.set(m,$),r.set.forEach(E=>E(m,$,C)))},f=typeof Proxy>"u"?{}:new Proxy(n,{get(m,$){return l($)},ownKeys(m){return Array.from(s.keys())},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},has(m,$){return s.has($)},set(m,$,C){return i($,C),!0}}),h=(m,$)=>(r[m].push($),()=>{To(r[m],$)});return{state:f,get:l,set:i,on:h,onChange:(m,$)=>{const C=h("set",(P,W)=>{P===m&&$(W)}),E=h("reset",()=>$(ke(e)[m]));return()=>{C(),E()}},use:(...m)=>{const $=m.reduce((C,E)=>(E.set&&C.push(h("set",E.set)),E.get&&C.push(h("get",E.get)),E.reset&&C.push(h("reset",E.reset)),E.dispose&&C.push(h("dispose",E.dispose)),C),[]);return()=>$.forEach(C=>C())},dispose:a,reset:c,forceUpdate:m=>{const $=s.get(m);r.set.forEach(C=>C(m,$,$))}}},To=(e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},Yt=(e,t)=>{const n=wo(e,t);return n.use(ko()),n};class Po{constructor(t){this.session=t}setActiveGrantId(t){this.activeGrantId=t}async request({method:t,path:n,body:s,headers:r}){return this.session.fetch(`grants/me/${n}`,{method:t,headers:r?new Headers(r):void 0,body:s,...this.session.isMultiAccount()&&this.activeGrantId?{grant_id:this.activeGrantId}:{}})}async currentUser(){const t=this.session.isMultiAccount()?this.activeGrantId:void 0,n=await this.session.getProfile(t);return n?{id:n.sub,email:n.email,name:n.name}:null}async authenticationUrl(t){return this.session.auth(t||{})}}Yt({});function Io(){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 n=function(){try{var s=new URL("b","http://a");return s.pathname="c%20d",s.href==="http://a/c%20d"&&s.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||!n()||typeof WeakMap>"u")&&e.push(Promise.resolve().then(()=>require("./core-js-38e53e34.cjs")))}return Promise.all(e)}async function Ro(){await Promise.resolve().then(()=>require("./elements-dc5b338e-81a0319c.cjs"))}const _o=Ro,Gt=(e,t)=>{if(!(typeof window>"u"))return _o(),ao(JSON.parse('[["nylas-scheduler-editor",[[1,"nylas-scheduler-editor",{"configurationId":[1,"configuration-id"],"nylasApiRequest":[16],"nylasSessionsConfig":[16],"eventOverrides":[16],"defaultSchedulerConfigStoreState":[16],"mode":[1],"automaticComponentRegistration":[32],"store":[64],"schedulerConnector":[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"]],{"configurationId":["configurationIdChanged"]}]]],["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"],"nylasBranding":[4,"nylas-branding"],"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]}]]],["document-refresh-icon",[[2,"document-refresh-icon",{"width":[1],"height":[1]}]]],["nylas-if-state",[[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"]}]]],["nylas-list-threads",[[1,"nylas-list-threads",{"threads":[16],"isAuthenticated":[4,"is-authenticated"],"tokenInfo":[16],"state":[1],"showCheckbox":[4,"show-checkbox"]}]]],["nylas-login",[[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]}]]],["nylas-mailbox",[[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"]]]]],["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]}]]],["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]}]]],["time-period-selector",[[2,"time-period-selector",{"timePeriods":[16],"defaultSelectedPeriod":[1,"default-selected-period"],"defaultSelectedNumber":[2,"default-selected-number"],"selectedPeriod":[32],"selectedNumber":[32],"numberOptions":[32],"timePeriodOptions":[32]},[[0,"selectedOptionChanged","selectedOptionChangedHandler"]],{"defaultSelectedPeriod":["defaultSelectedPeriodChangedHandler"],"defaultSelectedNumber":["defaultSelectedNumberChangedHandler"],"timePeriods":["timePeriodsChangedHandler"]}]]],["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]}]]],["nylas-form-card",[[65,"nylas-form-card"]]],["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"],"pluralizedLabel":[1,"pluralized-label"],"selectedOption":[32],"isOpen":[32],"searchValue":[32],"filteredOptions":[32],"ariaActivedescendant":[32]},[[6,"click","handleOutsideClick"]],{"options":["optionsChangedHandler"],"defaultSelectedOption":["defaultSelectedOptionChangedHandler"]}],[2,"search-icon",{"width":[1],"height":[1]}],[2,"chevron-icon",{"width":[1],"height":[1]}]]],["add-circle-icon_22",[[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-limit-future-bookings",{"availableDaysInFuture":[2,"available-days-in-future"],"name":[1],"selectedNumber":[32],"selectedPeriod":[32]},[[0,"timePeriodChanged","timePeriodChangedHandler"]],{"name":["elementNameChangedHandler"],"availableDaysInFuture":["availableDaysInFutureChanged"]}],[65,"nylas-min-cancellation-notice",{"minCancellationNotice":[2,"min-cancellation-notice"],"name":[1],"selectedNumber":[32],"selectedPeriod":[32]},[[0,"timePeriodChanged","timePeriodChangedHandler"]],{"name":["elementNameChangedHandler"],"availableDaysInFuture":["availableDaysInFutureChanged"]}],[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"],[65,"nylas-event-limits"],[6,"button-component",{"variant":[1],"disabled":[4],"type":[1],"clickHandler":[16],"mouseOverHandler":[16],"mouseOutHandler":[16],"focusHandler":[16],"blurHandler":[16]}],[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"]}]]],["google-logo-icon_3",[[2,"nylas-editor-tabs",{"calendars":[16],"config":[16],"currentUser":[16],"action":[32],"activeTab":[32],"isLoading":[32],"hasUnsavedChanges":[32],"changesSaved":[32],"formState":[32]},[[0,"valueChanged","handleValueChanged"]],{"config":["configChangedHandler"]}],[2,"google-logo-icon",{"width":[1],"height":[1]}],[2,"microsoft-logo-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]}]]],["globe-icon",[[2,"globe-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"]}]]],["info-icon_2",[[2,"info-icon",{"width":[1],"height":[1]}],[1,"tooltip-component",{"position":[1]}]]]]'),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 Ne={exports:{}},Z={};/**
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 Et;function No(){if(Et)return Z;Et=1;var e=D,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(l,i,f){var h,g={},y=null,S=null;f!==void 0&&(y=""+f),i.key!==void 0&&(y=""+i.key),i.ref!==void 0&&(S=i.ref);for(h in i)s.call(i,h)&&!c.hasOwnProperty(h)&&(g[h]=i[h]);if(l&&l.defaultProps)for(h in i=l.defaultProps,i)g[h]===void 0&&(g[h]=i[h]);return{$$typeof:t,type:l,key:y,ref:S,props:g,_owner:r.current}}return Z.Fragment=n,Z.jsx=a,Z.jsxs=a,Z}var V={};/**
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 St;function Oo(){return St||(St=1,process.env.NODE_ENV!=="production"&&function(){var e=D,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),m=Symbol.iterator,$="@@iterator";function C(o){if(o===null||typeof o!="object")return null;var d=m&&o[m]||o[$];return typeof d=="function"?d:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(o){{for(var d=arguments.length,p=new Array(d>1?d-1:0),v=1;v<d;v++)p[v-1]=arguments[v];W("error",o,p)}}function W(o,d,p){{var v=E.ReactDebugCurrentFrame,T=v.getStackAddendum();T!==""&&(d+="%s",p=p.concat([T]));var I=p.map(function(w){return String(w)});I.unshift("Warning: "+d),Function.prototype.apply.call(console[o],console,I)}}var z=!1,Xt=!1,Qt=!1,Zt=!1,Vt=!1,je;je=Symbol.for("react.module.reference");function en(o){return!!(typeof o=="string"||typeof o=="function"||o===s||o===c||Vt||o===r||o===f||o===h||Zt||o===S||z||Xt||Qt||typeof o=="object"&&o!==null&&(o.$$typeof===y||o.$$typeof===g||o.$$typeof===a||o.$$typeof===l||o.$$typeof===i||o.$$typeof===je||o.getModuleId!==void 0))}function tn(o,d,p){var v=o.displayName;if(v)return v;var T=d.displayName||d.name||"";return T!==""?p+"("+T+")":p}function He(o){return o.displayName||"Context"}function j(o){if(o==null)return null;if(typeof o.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case s:return"Fragment";case n:return"Portal";case c:return"Profiler";case r:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var d=o;return He(d)+".Consumer";case a:var p=o;return He(p._context)+".Provider";case i:return tn(o,o.render,"ForwardRef");case g:var v=o.displayName||null;return v!==null?v:j(o.type)||"Memo";case y:{var T=o,I=T._payload,w=T._init;try{return j(w(I))}catch{return null}}}return null}var U=Object.assign,X=0,Me,Be,qe,Ue,We,ze,Ye;function Ge(){}Ge.__reactDisabledLog=!0;function nn(){{if(X===0){Me=console.log,Be=console.info,qe=console.warn,Ue=console.error,We=console.group,ze=console.groupCollapsed,Ye=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Ge,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}X++}}function on(){{if(X--,X===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},o,{value:Me}),info:U({},o,{value:Be}),warn:U({},o,{value:qe}),error:U({},o,{value:Ue}),group:U({},o,{value:We}),groupCollapsed:U({},o,{value:ze}),groupEnd:U({},o,{value:Ye})})}X<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=E.ReactCurrentDispatcher,ge;function ne(o,d,p){{if(ge===void 0)try{throw Error()}catch(T){var v=T.stack.trim().match(/\n( *(at )?)/);ge=v&&v[1]||""}return`
18
+ `+ge+o}}var ye=!1,oe;{var rn=typeof WeakMap=="function"?WeakMap:Map;oe=new rn}function Je(o,d){if(!o||ye)return"";{var p=oe.get(o);if(p!==void 0)return p}var v;ye=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var I;I=pe.current,pe.current=null,nn();try{if(d){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(H){v=H}Reflect.construct(o,[],w)}else{try{w.call()}catch(H){v=H}o.call(w.prototype)}}else{try{throw Error()}catch(H){v=H}o()}}catch(H){if(H&&v&&typeof H.stack=="string"){for(var k=H.stack.split(`
19
+ `),x=v.stack.split(`
20
+ `),_=k.length-1,N=x.length-1;_>=1&&N>=0&&k[_]!==x[N];)N--;for(;_>=1&&N>=0;_--,N--)if(k[_]!==x[N]){if(_!==1||N!==1)do if(_--,N--,N<0||k[_]!==x[N]){var A=`
21
+ `+k[_].replace(" at new "," at ");return o.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",o.displayName)),typeof o=="function"&&oe.set(o,A),A}while(_>=1&&N>=0);break}}}finally{ye=!1,pe.current=I,on(),Error.prepareStackTrace=T}var G=o?o.displayName||o.name:"",it=G?ne(G):"";return typeof o=="function"&&oe.set(o,it),it}function sn(o,d,p){return Je(o,!1)}function an(o){var d=o.prototype;return!!(d&&d.isReactComponent)}function re(o,d,p){if(o==null)return"";if(typeof o=="function")return Je(o,an(o));if(typeof o=="string")return ne(o);switch(o){case f:return ne("Suspense");case h:return ne("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case i:return sn(o.render);case g:return re(o.type,d,p);case y:{var v=o,T=v._payload,I=v._init;try{return re(I(T),d,p)}catch{}}}return""}var se=Object.prototype.hasOwnProperty,Ke={},Xe=E.ReactDebugCurrentFrame;function ae(o){if(o){var d=o._owner,p=re(o.type,o._source,d?d.type:null);Xe.setExtraStackFrame(p)}else Xe.setExtraStackFrame(null)}function ln(o,d,p,v,T){{var I=Function.call.bind(se);for(var w in o)if(I(o,w)){var k=void 0;try{if(typeof o[w]!="function"){var x=Error((v||"React class")+": "+p+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}k=o[w](d,w,v,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){k=_}k&&!(k instanceof Error)&&(ae(T),P("%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).",v||"React class",p,w,typeof k),ae(null)),k instanceof Error&&!(k.message in Ke)&&(Ke[k.message]=!0,ae(T),P("Failed %s type: %s",p,k.message),ae(null))}}}var cn=Array.isArray;function me(o){return cn(o)}function dn(o){{var d=typeof Symbol=="function"&&Symbol.toStringTag,p=d&&o[Symbol.toStringTag]||o.constructor.name||"Object";return p}}function un(o){try{return Qe(o),!1}catch{return!0}}function Qe(o){return""+o}function Ze(o){if(un(o))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dn(o)),Qe(o)}var Q=E.ReactCurrentOwner,fn={key:!0,ref:!0,__self:!0,__source:!0},Ve,et,$e;$e={};function hn(o){if(se.call(o,"ref")){var d=Object.getOwnPropertyDescriptor(o,"ref").get;if(d&&d.isReactWarning)return!1}return o.ref!==void 0}function pn(o){if(se.call(o,"key")){var d=Object.getOwnPropertyDescriptor(o,"key").get;if(d&&d.isReactWarning)return!1}return o.key!==void 0}function gn(o,d){if(typeof o.ref=="string"&&Q.current&&d&&Q.current.stateNode!==d){var p=j(Q.current.type);$e[p]||(P('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',j(Q.current.type),o.ref),$e[p]=!0)}}function yn(o,d){{var p=function(){Ve||(Ve=!0,P("%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)",d))};p.isReactWarning=!0,Object.defineProperty(o,"key",{get:p,configurable:!0})}}function mn(o,d){{var p=function(){et||(et=!0,P("%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)",d))};p.isReactWarning=!0,Object.defineProperty(o,"ref",{get:p,configurable:!0})}}var $n=function(o,d,p,v,T,I,w){var k={$$typeof:t,type:o,key:d,ref:p,props:w,_owner:I};return k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(k,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(k,"_source",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k};function vn(o,d,p,v,T){{var I,w={},k=null,x=null;p!==void 0&&(Ze(p),k=""+p),pn(d)&&(Ze(d.key),k=""+d.key),hn(d)&&(x=d.ref,gn(d,T));for(I in d)se.call(d,I)&&!fn.hasOwnProperty(I)&&(w[I]=d[I]);if(o&&o.defaultProps){var _=o.defaultProps;for(I in _)w[I]===void 0&&(w[I]=_[I])}if(k||x){var N=typeof o=="function"?o.displayName||o.name||"Unknown":o;k&&yn(w,N),x&&mn(w,N)}return $n(o,k,x,T,v,Q.current,w)}}var ve=E.ReactCurrentOwner,tt=E.ReactDebugCurrentFrame;function Y(o){if(o){var d=o._owner,p=re(o.type,o._source,d?d.type:null);tt.setExtraStackFrame(p)}else tt.setExtraStackFrame(null)}var be;be=!1;function Ce(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function nt(){{if(ve.current){var o=j(ve.current.type);if(o)return`
22
+
23
+ Check the render method of \``+o+"`."}return""}}function bn(o){{if(o!==void 0){var d=o.fileName.replace(/^.*[\\\/]/,""),p=o.lineNumber;return`
24
+
25
+ Check your code at `+d+":"+p+"."}return""}}var ot={};function Cn(o){{var d=nt();if(!d){var p=typeof o=="string"?o:o.displayName||o.name;p&&(d=`
26
+
27
+ Check the top-level render call using <`+p+">.")}return d}}function rt(o,d){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var p=Cn(d);if(ot[p])return;ot[p]=!0;var v="";o&&o._owner&&o._owner!==ve.current&&(v=" It was passed a child from "+j(o._owner.type)+"."),Y(o),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,v),Y(null)}}function st(o,d){{if(typeof o!="object")return;if(me(o))for(var p=0;p<o.length;p++){var v=o[p];Ce(v)&&rt(v,d)}else if(Ce(o))o._store&&(o._store.validated=!0);else if(o){var T=C(o);if(typeof T=="function"&&T!==o.entries)for(var I=T.call(o),w;!(w=I.next()).done;)Ce(w.value)&&rt(w.value,d)}}}function En(o){{var d=o.type;if(d==null||typeof d=="string")return;var p;if(typeof d=="function")p=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===i||d.$$typeof===g))p=d.propTypes;else return;if(p){var v=j(d);ln(p,o.props,"prop",v,o)}else if(d.PropTypes!==void 0&&!be){be=!0;var T=j(d);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Sn(o){{for(var d=Object.keys(o.props),p=0;p<d.length;p++){var v=d[p];if(v!=="children"&&v!=="key"){Y(o),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),Y(null);break}}o.ref!==null&&(Y(o),P("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}function at(o,d,p,v,T,I){{var w=en(o);if(!w){var k="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(k+=" 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=bn(T);x?k+=x:k+=nt();var _;o===null?_="null":me(o)?_="array":o!==void 0&&o.$$typeof===t?(_="<"+(j(o.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):_=typeof o,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,k)}var N=vn(o,d,p,T,I);if(N==null)return N;if(w){var A=d.children;if(A!==void 0)if(v)if(me(A)){for(var G=0;G<A.length;G++)st(A[G],o);Object.freeze&&Object.freeze(A)}else P("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 st(A,o)}return o===s?Sn(N):En(N),N}}function kn(o,d,p){return at(o,d,p,!0)}function wn(o,d,p){return at(o,d,p,!1)}var Tn=wn,Pn=kn;V.Fragment=s,V.jsx=Tn,V.jsxs=Pn}()),V}process.env.NODE_ENV==="production"?Ne.exports=No():Ne.exports=Oo();var xo=Ne.exports;const Lo=e=>e.toLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(""),Jt=e=>e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`),Ao=(e,t,n={})=>{if(e instanceof Element){const s=Do(e.classList,t,n);s!==""&&(e.className=s),Object.keys(t).forEach(r=>{if(!(r==="children"||r==="style"||r==="ref"||r==="class"||r==="className"||r==="forwardedRef"))if(r.indexOf("on")===0&&r[2]===r[2].toUpperCase()){const c=r.substring(2),a=c[0].toLowerCase()+c.substring(1);Kt(a)||jo(e,a,t[r])}else e[r]=t[r],typeof t[r]==="string"&&e.setAttribute(Jt(r),t[r])})}},Do=(e,t,n)=>{const s=t.className||t.class,r=n.className||n.class,c=we(e),a=we(s?s.split(" "):[]),l=we(r?r.split(" "):[]),i=[];return c.forEach(f=>{a.has(f)?(i.push(f),a.delete(f)):l.has(f)||i.push(f)}),a.forEach(f=>i.push(f)),i.join(" ")},Fo=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 Kt=e=>{if(typeof document>"u")return!0;{const t="on"+Fo(e);let n=t in document;if(!n){const s=document.createElement("div");s.setAttribute(t,"return;"),n=typeof s[t]=="function"}return n}},jo=(e,t,n)=>{const s=e.__events||(e.__events={}),r=s[t];r&&e.removeEventListener(t,r),e.addEventListener(t,s[t]=function(a){n&&n.call(this,a)})},we=e=>{const t=new Map;return e.forEach(n=>t.set(n,n)),t},Ho=(e,t)=>{typeof e=="function"?e(t):e!=null&&(e.current=t)},Mo=(...e)=>t=>{e.forEach(n=>{Ho(n,t)})},Bo=(e,t)=>{const n=(s,r)=>xo.jsx(e,{...s,forwardedRef:r});return n.displayName=t,D.forwardRef(n)},u=(e,t,n,s)=>{s!==void 0&&s();const r=Lo(e),c=class extends D.Component{constructor(l){super(l);Ee(this,"componentEl");Ee(this,"setComponentElRef",l=>{this.componentEl=l})}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(l){Ao(this.componentEl,this.props,l)}render(){const{children:l,forwardedRef:i,style:f,className:h,ref:g,...y}=this.props;let S=Object.keys(y).reduce(($,C)=>{const E=y[C];if(C.indexOf("on")===0&&C[2]===C[2].toUpperCase()){const P=C.substring(2).toLowerCase();typeof document<"u"&&Kt(P)&&($[C]=E)}else{const P=typeof E;(P==="string"||P==="boolean"||P==="number")&&($[Jt(C)]=E)}return $},{});n&&(S=n(this.props,S));const m={...S,ref:Mo(i,this.setComponentElRef),style:f};return D.createElement(e,m,l)}static get displayName(){return r}};return t&&(c.contextType=t),Bo(c,r)};Gt();const qo=u("add-circle-icon"),Uo=u("archive-icon"),Wo=u("arrow-icon"),zo=u("bold-icon"),Yo=u("button-component"),Go=u("calendar-cancel-icon"),Jo=u("calendar-check-icon"),Ko=u("calendar-icon"),Xo=u("calendar-info-icon"),Qo=u("calendar-patterns-icon"),Zo=u("checkmark-circle-icon"),Vo=u("chevron-icon"),er=u("close-icon"),tr=u("document-refresh-icon"),nr=u("flow-icon"),or=u("folder-icon"),rr=u("forward-icon"),sr=u("globe-icon"),ar=u("google-logo-icon"),ir=u("inbox-icon"),lr=u("info-icon"),cr=u("italic-icon"),dr=u("loading-icon"),ur=u("location-icon"),fr=u("location-off-icon"),hr=u("microsoft-logo-icon"),pr=u("multi-select-dropdown"),gr=u("nylas-additional-participants"),yr=u("nylas-availability-picker"),mr=u("nylas-booked-event-card"),$r=u("nylas-booking-calendar-picker"),vr=u("nylas-booking-form"),br=u("nylas-buffer-time"),Cr=u("nylas-calendar-picker"),Er=u("nylas-cancel-booking-form"),Sr=u("nylas-cancelled-event-card"),kr=u("nylas-composer"),wr=u("nylas-custom-booking-flow"),Tr=u("nylas-date-picker"),Pr=u("nylas-editor-tabs"),Ir=u("nylas-event-description"),Rr=u("nylas-event-duration"),_r=u("nylas-event-info"),Nr=u("nylas-event-limits"),Or=u("nylas-event-title"),xr=u("nylas-form-card"),Lr=u("nylas-if-state"),Ar=u("nylas-limit-future-bookings"),Dr=u("nylas-list-folders"),Fr=u("nylas-list-threads"),jr=u("nylas-locale-switch"),Hr=u("nylas-location-component"),Mr=u("nylas-login"),Br=u("nylas-logo"),qr=u("nylas-mailbox"),Ur=u("nylas-mailbox-pagination"),Wr=u("nylas-mailbox-toolbar-button"),zr=u("nylas-min-cancellation-notice"),Yr=u("nylas-notification"),Gr=u("nylas-provider"),Jr=u("nylas-scheduler-editor"),Kr=u("nylas-scheduling"),Xr=u("nylas-selected-event-card"),Qr=u("nylas-summarize-message-button"),Zr=u("nylas-threads-refresh"),Vr=u("nylas-threads-search"),es=u("nylas-time-window-picker"),ts=u("nylas-timeslot-picker"),ns=u("nylas-view-email"),os=u("nylas-view-thread"),rs=u("people-icon"),ss=u("play-icon"),as=u("refresh-icon"),is=u("reply-all-icon"),ls=u("reply-icon"),cs=u("search-icon"),ds=u("select-dropdown"),us=u("sent-icon"),fs=u("spam-icon"),hs=u("star-icon"),ps=u("stop-icon"),gs=u("time-period-selector"),ys=u("tooltip-component"),ms=u("translate-icon"),$s=u("trash-icon"),vs=u("underline-icon"),bs=u("warning-icon");function Cs(){const[,e]=D.useReducer(r=>r+1,0),t=D.useRef(),n=D.useRef(null),s=D.useRef(null);return D.useEffect(()=>{t.current&&(n.current||t.current.getNylasMailboxConnector().then(r=>{r&&(n.current=r,s.current=n.current.nylasAuthStore,r.nylasAuthStore.on("set",e),e())}))},[]),[t,s.current]}exports.AddCircleIcon=qo;exports.ArchiveIcon=Uo;exports.ArrowIcon=Wo;exports.BoldIcon=zo;exports.ButtonComponent=Yo;exports.CalendarCancelIcon=Go;exports.CalendarCheckIcon=Jo;exports.CalendarIcon=Ko;exports.CalendarInfoIcon=Xo;exports.CalendarPatternsIcon=Qo;exports.CheckmarkCircleIcon=Zo;exports.ChevronIcon=Vo;exports.CloseIcon=er;exports.DocumentRefreshIcon=tr;exports.FlowIcon=nr;exports.FolderIcon=or;exports.ForwardIcon=rr;exports.Fragment=io;exports.GlobeIcon=sr;exports.GoogleLogoIcon=ar;exports.Host=It;exports.InboxIcon=ir;exports.InfoIcon=lr;exports.ItalicIcon=cr;exports.LoadingIcon=dr;exports.LocationIcon=ur;exports.LocationOffIcon=fr;exports.MicrosoftLogoIcon=hr;exports.MultiSelectDropdown=pr;exports.NylasAdditionalParticipants=gr;exports.NylasAvailabilityPicker=yr;exports.NylasBookedEventCard=mr;exports.NylasBookingCalendarPicker=$r;exports.NylasBookingForm=vr;exports.NylasBufferTime=br;exports.NylasCalendarPicker=Cr;exports.NylasCancelBookingForm=Er;exports.NylasCancelledEventCard=Sr;exports.NylasComposer=kr;exports.NylasCustomBookingFlow=wr;exports.NylasDatePicker=Tr;exports.NylasEditorTabs=Pr;exports.NylasEventDescription=Ir;exports.NylasEventDuration=Rr;exports.NylasEventInfo=_r;exports.NylasEventLimits=Nr;exports.NylasEventTitle=Or;exports.NylasFormCard=xr;exports.NylasIdentityRequestWrapper=Po;exports.NylasIfState=Lr;exports.NylasLimitFutureBookings=Ar;exports.NylasListFolders=Dr;exports.NylasListThreads=Fr;exports.NylasLocaleSwitch=jr;exports.NylasLocationComponent=Hr;exports.NylasLogin=Mr;exports.NylasLogo=Br;exports.NylasMailbox=qr;exports.NylasMailboxPagination=Ur;exports.NylasMailboxToolbarButton=Wr;exports.NylasMinCancellationNotice=zr;exports.NylasNotification=Yr;exports.NylasProvider=Gr;exports.NylasSchedulerEditor=Jr;exports.NylasScheduling=Kr;exports.NylasSelectedEventCard=Xr;exports.NylasSummarizeMessageButton=Qr;exports.NylasThreadsRefresh=Zr;exports.NylasThreadsSearch=Vr;exports.NylasTimeWindowPicker=es;exports.NylasTimeslotPicker=ts;exports.NylasViewEmail=ns;exports.NylasViewThread=os;exports.PeopleIcon=rs;exports.PlayIcon=ss;exports.RefreshIcon=as;exports.ReplyAllIcon=is;exports.ReplyIcon=ls;exports.SearchIcon=cs;exports.SelectDropdown=ds;exports.SentIcon=us;exports.SpamIcon=fs;exports.StarIcon=hs;exports.StopIcon=ps;exports.TimePeriodSelector=gs;exports.TooltipComponent=ys;exports.TranslateIcon=ms;exports.TrashIcon=$s;exports.UnderlineIcon=vs;exports.WarningIcon=bs;exports.applyPolyfills=Io;exports.createEvent=Bn;exports.createStore=Yt;exports.defineCustomElements=Gt;exports.getElement=Rt;exports.h=Le;exports.registerInstance=ho;exports.setNonce=fo;exports.useNylasMailboxElement=Cs;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
- export { applyPolyfills, defineCustomElements } from '@nylas/web-elements/loader';
2
+ import { NylasIdentityRequestWrapper } from '@nylas/web-elements';
3
+ export { applyPolyfills, defineCustomElements, setNonce } from '@nylas/web-elements/loader';
4
+ export { NylasIdentityRequestWrapper };
3
5
  export * from './elements/index';
4
6
  export declare function useNylasMailboxElement(): readonly [import("react").MutableRefObject<HTMLNylasMailboxElement | undefined>, import("@nylas/web-elements").ObservableMap<import("@nylas/web-elements").NylasAuthStoreState> | null];
@@ -0,0 +1,7 @@
1
+ "use strict";const T=require("./utils-c00bdc3c-94b9c3b6.cjs");class rr{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 c=this.eventOverrides;console.log("eventOverrides",c,e.name,i),i==null||i.forEach((h,l)=>{var v;const d=this.nylasConnector,f=async y=>{T.debug(`[${this.hostTagName}] Handling "${e.name}" prop "${String(l)}" event.`,{event:y}),l in c&&(T.debug(`[${this.hostTagName}] Found event override for "${String(l)}" event. Calling override.`),await c[l](y,d)),y.defaultPrevented||await h(y,d)},m=e.element.dataset.nylasId;m&&!this.eventListenerRegistrations.has(m)&&this.eventListenerRegistrations.set(m,[]),m&&((v=this.eventListenerRegistrations.get(m))==null||v.push([a,l,f])),T.debug(`[${this.hostTagName}] Setting "${e.name}" event "${String(l)}" to automcially call NylasConnector method.`);const p=T.formatEventName(l.toString());T.debug(`[${this.hostTagName}] Adding event listener for "${p}" on "${a.tagName}"`),a.addEventListener(p,f)}),r==null||r.forEach((h,l)=>{var v,y,g,b;const[d,f]=l.split("."),p=this.getStore(d).state[f];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),(v=this.propStateRegistrations.get(d))!=null&&v.has(f)?(b=(g=this.propStateRegistrations.get(d))==null?void 0:g.get(f))==null||b.push({elementId:a.dataset.nylasId,propKey:h}):(y=this.propStateRegistrations.get(d))==null||y.set(f,[{elementId:a.dataset.nylasId,propKey:h}]),a[h.toString()]=p,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${l}" value.`,{stateValue:p})}),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,l)=>{const d=this.getStore(l);a[h.toString()]=d,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${l}" 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,l;const a=(h=this.propStateRegistrations.get(i))==null?void 0:h.get(u),c=a==null?void 0:a.filter(d=>d.elementId!==n);c&&((l=this.propStateRegistrations.get(i))==null||l.set(u,c))})});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 c;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=((c=e.propStateRegistrations.get(n))==null?void 0:c.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:l})=>{const d=u[h];if(!d){T.debug(`[${e.hostTagName}] Component "${h}" not found. Skipping.`,{component:d});return}const m=e.getStore(n).state[s];d.element[l.toString()]=m,T.debug(`[${e.hostTagName}] Setting "${d.name}" prop "${l.toString()}" to "${s.toString()}" value.`,{stateValue:m})})}})})}get hostTagName(){var e,n;return((n=(e=this.host)==null?void 0:e.tagName)==null?void 0:n.toLowerCase())??"nylas-provider"}}class sr extends rr{}const Sn=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};var ir=Object.defineProperty,or=(t,e,n)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ut=(t,e,n)=>(or(t,typeof e!="symbol"?e+"":e,n),n),En=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(En||{});const ar=t=>"error"in t;class ur extends Error{constructor(e){super(e==null?void 0:e.message),ut(this,"apiError"),this.name="NylasAPIError",this.stack=new Error().stack,this.apiError=e}}async function hn(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 K=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Sn,$=Object.keys,M=Array.isArray;function U(t,e){return typeof e!="object"||$(e).forEach(function(n){t[n]=e[n]}),t}typeof Promise>"u"||K.Promise||(K.Promise=Promise);const Be=Object.getPrototypeOf,lr={}.hasOwnProperty;function z(t,e){return lr.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 Pn=Object.defineProperty;function ee(t,e,n,r){Pn(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 cr=Object.getOwnPropertyDescriptor;function Jt(t,e){let n;return cr(t,e)||(n=Be(t))&&Jt(n,e)}const hr=[].slice;function lt(t,e,n){return hr.call(t,e,n)}function Cn(t,e){return e(t)}function Ie(t){if(!t)throw new Error("Assertion Failed")}function Tn(t){K.setImmediate?setImmediate(t):setTimeout(t,0)}function An(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?M(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?M(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function On(t){var e={};for(var n in t)z(t,n)&&(e[n]=t[n]);return e}const dr=[].concat;function In(t){return dr.apply([],t)}const Kn="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(In([8,16,32,64].map(t=>["Int","Uint","Float"].map(e=>e+t+"Array")))).filter(t=>K[t]),fr=Kn.map(t=>K[t]);An(Kn,t=>[t,!0]);let se=null;function We(t){se=typeof WeakMap<"u"&&new WeakMap;const e=Ct(t);return se=null,e}function Ct(t){if(!t||typeof t!="object")return t;let e=se&&se.get(t);if(e)return e;if(M(t)){e=[],se&&se.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(Ct(t[n]))}else if(fr.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]=Ct(t[s]))}return e}const{toString:pr}={};function Tt(t){return pr.call(t).slice(8,-1)}const At=typeof Symbol<"u"?Symbol.iterator:"@@iterator",mr=typeof At=="symbol"?function(t){var e;return t!=null&&(e=t[At])&&e.apply(t)}:function(){return null},_e={};function J(t){var e,n,r,s;if(arguments.length===1){if(M(t))return t.slice();if(this===_e&&typeof t=="string")return[t];if(s=mr(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 Zt=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 jn(t,e){G=t,Rn=e}var Rn=()=>!0;const gr=!new Error("").stack;function Pe(){if(gr)try{throw new Error}catch(t){return t}return new Error}function Ot(t,e){var n=t.stack;return n?(e=e||0,n.indexOf(t.name)===0&&(e+=(t.name+t.message).split(`
2
+ `).length),n.split(`
3
+ `).slice(e).filter(Rn).map(r=>`
4
+ `+r).join("")):""}var Nn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],en=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Nn),yr={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 $n(t,e){return t+". Errors: "+Object.keys(e).map(n=>e[n].toString()).filter((n,r,s)=>s.indexOf(n)===r).join(`
5
+ `)}function ct(t,e,n,r){this._e=Pe(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=$n(t,e)}function je(t,e){this._e=Pe(),this.name="BulkError",this.failures=Object.keys(e).map(n=>e[n]),this.failuresByPos=e,this.message=$n(t,e)}ke(xe).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Ot(this._e,2))}},toString:function(){return this.name+": "+this.message}}),ke(ct).from(xe),ke(je).from(xe);var tn=en.reduce((t,e)=>(t[e]=e+"Error",t),{});const vr=xe;var C=en.reduce((t,e)=>{var n=e+"Error";function r(s,i){this._e=Pe(),this.name=n,s?typeof s=="string"?(this.message=`${s}${i?`
6
+ `+i:""}`,this.inner=i||null):typeof s=="object"&&(this.message=`${s.name} ${s.message}`,this.inner=s):(this.message=yr[e]||n,this.inner=null)}return ke(r).from(vr),t[e]=r,t},{});C.Syntax=SyntaxError,C.Type=TypeError,C.Range=RangeError;var dn=Nn.reduce((t,e)=>(t[e+"Error"]=C[e],t),{}),tt=en.reduce((t,e)=>(["Syntax","Type","Range"].indexOf(e)===-1&&(t[e+"Error"]=C[e]),t),{});function I(){}function Fe(t){return t}function br(t,e){return t==null||t===Fe?e:function(n){return e(t(n))}}function me(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function wr(t,e){return t===I?e:function(){var n=t.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var i=e.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?me(r,this.onsuccess):r),s&&(this.onerror=this.onerror?me(s,this.onerror):s),i!==void 0?i:n}}function _r(t,e){return t===I?e:function(){t.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?me(n,this.onsuccess):n),r&&(this.onerror=this.onerror?me(r,this.onerror):r)}}function kr(t,e){return t===I?e:function(n){var r=t.apply(this,arguments);U(n,r);var s=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=e.apply(this,arguments);return s&&(this.onsuccess=this.onsuccess?me(s,this.onsuccess):s),i&&(this.onerror=this.onerror?me(i,this.onerror):i),r===void 0?o===void 0?void 0:o:U(r,o)}}function xr(t,e){return t===I?e:function(){return e.apply(this,arguments)!==!1&&t.apply(this,arguments)}}function nn(t,e){return t===I?e:function(){var n=t.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,s=arguments.length,i=new Array(s);s--;)i[s]=arguments[s];return n.then(function(){return e.apply(r,i)})}return e.apply(this,arguments)}}tt.ModifyError=ct,tt.DexieError=xe,tt.BulkError=je;var Me={};const Dn=100,[It,ht,Kt]=typeof Promise>"u"?[]:(()=>{let t=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[t,Be(t),t];const e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,Be(e),t]})(),Bn=ht&&ht.then,nt=It&&It.constructor,rn=!!Kt;var jt=!1,Sr=Kt?()=>{Kt.then(Ye)}:K.setImmediate?setImmediate.bind(null,Ye):K.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver(()=>{Ye(),t=null}).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(Ye,0)},Re=function(t,e){Ke.push([t,e]),dt&&(Sr(),dt=!1)},Rt=!0,dt=!0,de=[],rt=[],Nt=null,$t=Fe,Se={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:mn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(t=>{try{mn(t[0],t[1])}catch{}})}},P=Se,Ke=[],fe=0,st=[];function S(t){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=I,this._lib=!1;var e=this._PSD=P;if(G&&(this._stackHolder=Pe(),this._prev=null,this._numPrev=0),typeof t!="function"){if(t!==Me)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Bt(this,this._value))}this._state=null,this._value=null,++e.ref,Mn(this,t)}const Dt={get:function(){var t=P,e=ft;function n(r,s){var i=!t.global&&(t!==P||e!==ft);const o=i&&!ne();var u=new S((a,c)=>{sn(this,new Fn(pt(r,t,i,o),pt(s,t,i,o),a,c,t))});return G&&Un(u,this),u}return n.prototype=Me,n},set:function(t){ee(this,"then",t&&t.prototype===Me?Dt:{get:function(){return t},set:Dt.set})}};function Fn(t,e,n,r,s){this.onFulfilled=typeof t=="function"?t:null,this.onRejected=typeof e=="function"?e:null,this.resolve=n,this.reject=r,this.psd=s}function Mn(t,e){try{e(n=>{if(t._state===null){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&ze();n&&typeof n.then=="function"?Mn(t,(s,i)=>{n instanceof S?n._then(s,i):n.then(s,i)}):(t._state=!0,t._value=n,qn(t)),r&&He()}},Bt.bind(null,t))}catch(n){Bt(t,n)}}function Bt(t,e){if(rt.push(e),t._state===null){var n=t._lib&&ze();e=$t(e),t._state=!1,t._value=e,G&&e!==null&&typeof e=="object"&&!e._promise&&function(r,s,i){try{r.apply(null,i)}catch(o){s&&s(o)}}(()=>{var r=Jt(e,"stack");e._promise=t,ee(e,"stack",{get:()=>jt?r&&(r.get?r.get.apply(e):r.value):t.stack})}),function(r){de.some(s=>s._value===r._value)||de.push(r)}(t),qn(t),n&&He()}}function qn(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)sn(t,e[n]);var s=t._PSD;--s.ref||s.finalize(),fe===0&&(++fe,Re(()=>{--fe==0&&on()},[]))}function sn(t,e){if(t._state!==null){var n=t._state?e.onFulfilled:e.onRejected;if(n===null)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++fe,Re(Er,[n,t,e])}else t._listeners.push(e)}function Er(t,e,n){try{Nt=e;var r,s=e._value;e._state?r=t(s):(rt.length&&(rt=[]),r=t(s),rt.indexOf(s)===-1&&function(i){for(var o=de.length;o;)if(de[--o]._value===i._value)return void de.splice(o,1)}(e)),n.resolve(r)}catch(i){n.reject(i)}finally{Nt=null,--fe==0&&on(),--n.psd.ref||n.psd.finalize()}}function Ln(t,e,n){if(e.length===n)return e;var r="";if(t._state===!1){var s,i,o=t._value;o!=null?(s=o.name||"Error",i=o.message||o,r=Ot(o,0)):(s=o,i=""),e.push(s+(i?": "+i:"")+r)}return G&&((r=Ot(t._stackHolder,2))&&e.indexOf(r)===-1&&e.push(r),t._prev&&Ln(t._prev,e,n)),e}function Un(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)}function Ye(){ze()&&He()}function ze(){var t=Rt;return Rt=!1,dt=!1,t}function He(){var t,e,n;do for(;Ke.length>0;)for(t=Ke,Ke=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}while(Ke.length>0);Rt=!0,dt=!0}function on(){var t=de;de=[],t.forEach(r=>{r._PSD.onunhandled.call(null,r._value,r)});for(var e=st.slice(0),n=e.length;n;)e[--n]()}function Ge(t){return new S(Me,!1,t)}function j(t,e){var n=P;return function(){var r=ze(),s=P;try{return ae(n,!0),t.apply(this,arguments)}catch(i){e&&e(i)}finally{ae(s,!1),r&&He()}}}Ee(S.prototype,{then:Dt,_then:function(t,e){sn(this,new Fn(null,null,t,e,P))},catch:function(t){if(arguments.length===1)return this.then(null,t);var e=arguments[0],n=arguments[1];return typeof e=="function"?this.then(null,r=>r instanceof e?n(r):Ge(r)):this.then(null,r=>r&&r.name===e?n(r):Ge(r))},finally:function(t){return this.then(e=>(t(),e),e=>(t(),Ge(e)))},stack:{get:function(){if(this._stack)return this._stack;try{jt=!0;var t=Ln(this,[],20).join(`
7
+ From previous: `);return this._state!==null&&(this._stack=t),t}finally{jt=!1}}},timeout:function(t,e){return t<1/0?new S((n,r)=>{var s=setTimeout(()=>r(new C.Timeout(e)),t);this.then(n,r).finally(clearTimeout.bind(null,s))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&ee(S.prototype,Symbol.toStringTag,"Dexie.Promise"),Se.env=Vn(),Ee(S,{all:function(){var t=J.apply(null,arguments).map(Xe);return new S(function(e,n){t.length===0&&e([]);var r=t.length;t.forEach((s,i)=>S.resolve(s).then(o=>{t[i]=o,--r||e(t)},n))})},resolve:t=>{if(t instanceof S)return t;if(t&&typeof t.then=="function")return new S((n,r)=>{t.then(n,r)});var e=new S(Me,!0,t);return Un(e,Nt),e},reject:Ge,race:function(){var t=J.apply(null,arguments).map(Xe);return new S((e,n)=>{t.map(r=>S.resolve(r).then(e,n))})},PSD:{get:()=>P,set:t=>P=t},totalEchoes:{get:()=>ft},newPSD:oe,usePSD:Te,scheduler:{get:()=>Re,set:t=>{Re=t}},rejectionMapper:{get:()=>$t,set:t=>{$t=t}},follow:(t,e)=>new S((n,r)=>oe((s,i)=>{var o=P;o.unhandleds=[],o.onunhandled=i,o.finalize=me(function(){(function(u){function a(){u(),st.splice(st.indexOf(a),1)}st.push(a),++fe,Re(()=>{--fe==0&&on()},[])})(()=>{this.unhandleds.length===0?s():i(this.unhandleds[0])})},o.finalize),t()},e,n,r))}),nt&&(nt.allSettled&&ee(S,"allSettled",function(){const t=J.apply(null,arguments).map(Xe);return new S(e=>{t.length===0&&e([]);let n=t.length;const r=new Array(n);t.forEach((s,i)=>S.resolve(s).then(o=>r[i]={status:"fulfilled",value:o},o=>r[i]={status:"rejected",reason:o}).then(()=>--n||e(r)))})}),nt.any&&typeof AggregateError<"u"&&ee(S,"any",function(){const t=J.apply(null,arguments).map(Xe);return new S((e,n)=>{t.length===0&&n(new AggregateError([]));let r=t.length;const s=new Array(r);t.forEach((i,o)=>S.resolve(i).then(u=>e(u),u=>{s[o]=u,--r||n(new AggregateError(s))}))})}));const F={awaits:0,echoes:0,id:0};var Pr=0,it=[],wt=0,ft=0,Cr=0;function oe(t,e,n,r){var s=P,i=Object.create(s);i.parent=s,i.ref=0,i.global=!1,i.id=++Cr;var o=Se.env;i.env=rn?{Promise:S,PromiseProp:{value:S,configurable:!0,writable:!0},all:S.all,race:S.race,allSettled:S.allSettled,any:S.any,resolve:S.resolve,reject:S.reject,nthen:fn(o.nthen,i),gthen:fn(o.gthen,i)}:{},e&&U(i,e),++s.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=Te(i,t,n,r);return i.ref===0&&i.finalize(),u}function Ce(){return F.id||(F.id=++Pr),++F.awaits,F.echoes+=Dn,F.id}function ne(){return!!F.awaits&&(--F.awaits==0&&(F.id=0),F.echoes=F.awaits*Dn,!0)}function Xe(t){return F.echoes&&t&&t.constructor===nt?(Ce(),t.then(e=>(ne(),e),e=>(ne(),D(e)))):t}function Tr(t){++ft,F.echoes&&--F.echoes!=0||(F.echoes=F.id=0),it.push(P),ae(t,!0)}function Ar(){var t=it[it.length-1];it.pop(),ae(t,!1)}function ae(t,e){var n=P;if((e?!F.echoes||wt++&&t===P:!wt||--wt&&t===P)||Wn(e?Tr.bind(null,t):Ar),t!==P&&(P=t,n===Se&&(Se.env=Vn()),rn)){var r=Se.env.Promise,s=t.env;ht.then=s.nthen,r.prototype.then=s.gthen,(n.global||t.global)&&(Object.defineProperty(K,"Promise",s.PromiseProp),r.all=s.all,r.race=s.race,r.resolve=s.resolve,r.reject=s.reject,s.allSettled&&(r.allSettled=s.allSettled),s.any&&(r.any=s.any))}}function Vn(){var t=K.Promise;return rn?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(K,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:ht.then,gthen:t.prototype.then}:{}}function Te(t,e,n,r,s){var i=P;try{return ae(t,!0),e(n,r,s)}finally{ae(i,!1)}}function Wn(t){Bn.call(It,t)}function pt(t,e,n,r){return typeof t!="function"?t:function(){var s=P;n&&Ce(),ae(e,!0);try{return t.apply(this,arguments)}finally{ae(s,!1),r&&Wn(ne)}}}function fn(t,e){return function(n,r){return t.call(this,pt(n,e),pt(r,e))}}(""+Bn).indexOf("[native code]")===-1&&(Ce=ne=I);const pn="unhandledrejection";function mn(t,e){var n;try{n=e.onuncatched(t)}catch{}if(n!==!1)try{var r,s={promise:e,reason:t};if(K.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(pn,!0,!0),U(r,s)):K.CustomEvent&&U(r=new CustomEvent(pn,{detail:s}),s),r&&K.dispatchEvent&&(dispatchEvent(r),!K.PromiseRejectionEvent&&K.onunhandledrejection))try{K.onunhandledrejection(r)}catch{}G&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${t.stack||t}`)}catch{}}var D=S.reject;function Ft(t,e,n,r){if(t.idbdb&&(t._state.openComplete||P.letThrough||t._vip)){var s=t._createTransaction(e,n,t._dbSchema);try{s.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===tn.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>Ft(t,e,n,r))):D(i)}return s._promise(e,(i,o)=>oe(()=>(P.trans=s,r(i,o,s)))).then(i=>s._completion.then(()=>i))}if(t._state.openComplete)return D(new C.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return D(new C.DatabaseClosed);t.open().catch(I)}return t._state.dbReadyPromise.then(()=>Ft(t,e,n,r))}const gn="3.2.4",he=String.fromCharCode(65535),Mt=-1/0,X="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",zn="String expected.",Ne=[],yt=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Or=yt,Ir=yt,Hn=t=>!/(dexie\.js|dexie\.min\.js)/.test(t),vt="__dbnames",_t="readonly",kt="readwrite";function ge(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e}const Yn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Qe(t){return typeof t!="string"||/\./.test(t)?e=>e:e=>(e[t]===void 0&&t in e&&delete(e=We(e))[t],e)}class Kr{_trans(e,n,r){const s=this._tx||P.trans,i=this.name;function o(a,c,h){if(!h.schema[i])throw new C.NotFound("Table "+i+" not part of transaction");return n(h.idbtrans,h)}const u=ze();try{return s&&s.db===this.db?s===P.trans?s._promise(e,o,r):oe(()=>s._promise(e,o,r),{trans:s,transless:P.transless||P}):Ft(this.db,e,[this.name],o)}finally{u&&He()}}get(e,n){return e&&e.constructor===Object?this.where(e).first(n):this._trans("readonly",r=>this.core.get({trans:r,key:e}).then(s=>this.hook.reading.fire(s))).then(n)}where(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(M(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const n=$(e);if(n.length===1)return this.where(n[0]).equals(e[n[0]]);const r=this.schema.indexes.concat(this.schema.primKey).filter(c=>c.compound&&n.every(h=>c.keyPath.indexOf(h)>=0)&&c.keyPath.every(h=>n.indexOf(h)>=0))[0];if(r&&this.db._maxKey!==he)return this.where(r.name).equals(r.keyPath.map(c=>e[c]));!r&&G&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);const{idxByName:s}=this.schema,i=this.db._deps.indexedDB;function o(c,h){try{return i.cmp(c,h)===0}catch{return!1}}const[u,a]=n.reduce(([c,h],l)=>{const d=s[l],f=e[l];return[c||d,c||!d?ge(h,d&&d.multi?m=>{const p=te(m,l);return M(p)&&p.some(v=>o(f,v))}:m=>o(f,te(m,l))):h]},[null,null]);return u?this.where(u.name).equals(e[u.keyPath]).filter(a):r?this.filter(a):this.where(n).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,M(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const n=r=>{if(!r)return r;const s=Object.create(e.prototype);for(var i in r)if(z(r,i))try{s[i]=r[i]}catch{}return s};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),e}defineClass(){return this.mapToClass(function(e){U(this,e)})}add(e,n){const{auto:r,keyPath:s}=this.schema.primKey;let i=e;return s&&r&&(i=Qe(s)(e)),this._trans("readwrite",o=>this.core.mutate({trans:o,type:"add",keys:n!=null?[n]:null,values:[i]})).then(o=>o.numFailures?S.reject(o.failures[0]):o.lastResult).then(o=>{if(s)try{H(e,s,o)}catch{}return o})}update(e,n){if(typeof e!="object"||M(e))return this.where(":id").equals(e).modify(n);{const r=te(e,this.schema.primKey.keyPath);if(r===void 0)return D(new C.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?$(n).forEach(s=>{H(e,s,n[s])}):n(e,{value:e,primKey:r})}catch{}return this.where(":id").equals(r).modify(n)}}put(e,n){const{auto:r,keyPath:s}=this.schema.primKey;let i=e;return s&&r&&(i=Qe(s)(e)),this._trans("readwrite",o=>this.core.mutate({trans:o,type:"put",values:[i],keys:n!=null?[n]:null})).then(o=>o.numFailures?S.reject(o.failures[0]):o.lastResult).then(o=>{if(s)try{H(e,s,o)}catch{}return o})}delete(e){return this._trans("readwrite",n=>this.core.mutate({trans:n,type:"delete",keys:[e]})).then(n=>n.numFailures?S.reject(n.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:Yn})).then(e=>e.numFailures?S.reject(e.failures[0]):void 0)}bulkGet(e){return this._trans("readonly",n=>this.core.getMany({keys:e,trans:n}).then(r=>r.map(s=>this.hook.reading.fire(s))))}bulkAdd(e,n,r){const s=Array.isArray(n)?n:void 0,i=(r=r||(s?void 0:n))?r.allKeys:void 0;return this._trans("readwrite",o=>{const{auto:u,keyPath:a}=this.schema.primKey;if(a&&s)throw new C.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(s&&s.length!==e.length)throw new C.InvalidArgument("Arguments objects and keys must have the same length");const c=e.length;let h=a&&u?e.map(Qe(a)):e;return this.core.mutate({trans:o,type:"add",keys:s,values:h,wantResults:i}).then(({numFailures:l,results:d,lastResult:f,failures:m})=>{if(l===0)return i?d:f;throw new je(`${this.name}.bulkAdd(): ${l} of ${c} operations failed`,m)})})}bulkPut(e,n,r){const s=Array.isArray(n)?n:void 0,i=(r=r||(s?void 0:n))?r.allKeys:void 0;return this._trans("readwrite",o=>{const{auto:u,keyPath:a}=this.schema.primKey;if(a&&s)throw new C.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(s&&s.length!==e.length)throw new C.InvalidArgument("Arguments objects and keys must have the same length");const c=e.length;let h=a&&u?e.map(Qe(a)):e;return this.core.mutate({trans:o,type:"put",keys:s,values:h,wantResults:i}).then(({numFailures:l,results:d,lastResult:f,failures:m})=>{if(l===0)return i?d:f;throw new je(`${this.name}.bulkPut(): ${l} of ${c} operations failed`,m)})})}bulkDelete(e){const n=e.length;return this._trans("readwrite",r=>this.core.mutate({trans:r,type:"delete",keys:e})).then(({numFailures:r,lastResult:s,failures:i})=>{if(r===0)return s;throw new je(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`,i)})}}function $e(t){var e={},n=function(o,u){if(u){for(var a=arguments.length,c=new Array(a-1);--a;)c[a-1]=arguments[a];return e[o].subscribe.apply(null,c),t}if(typeof o=="string")return e[o]};n.addEventType=i;for(var r=1,s=arguments.length;r<s;++r)i(arguments[r]);return n;function i(o,u,a){if(typeof o!="object"){var c;u||(u=xr),a||(a=I);var h={subscribers:[],fire:a,subscribe:function(l){h.subscribers.indexOf(l)===-1&&(h.subscribers.push(l),h.fire=u(h.fire,l))},unsubscribe:function(l){h.subscribers=h.subscribers.filter(function(d){return d!==l}),h.fire=h.subscribers.reduce(u,a)}};return e[o]=n[o]=h,h}$(c=o).forEach(function(l){var d=c[l];if(M(d))i(l,c[l][0],c[l][1]);else{if(d!=="asap")throw new C.InvalidArgument("Invalid event config");var f=i(l,Fe,function(){for(var m=arguments.length,p=new Array(m);m--;)p[m]=arguments[m];f.subscribers.forEach(function(v){Tn(function(){v.apply(null,p)})})})}})}}function Oe(t,e){return ke(e).from({prototype:t}),e}function be(t,e){return!(t.filter||t.algorithm||t.or)&&(e?t.justLimit:!t.replayFilter)}function xt(t,e){t.filter=ge(t.filter,e)}function St(t,e,n){var r=t.replayFilter;t.replayFilter=r?()=>ge(r(),e()):e,t.justLimit=n&&!r}function ot(t,e){if(t.isPrimKey)return e.primaryKey;const n=e.getIndexByKeyPath(t.index);if(!n)throw new C.Schema("KeyPath "+t.index+" on object store "+e.name+" is not indexed");return n}function yn(t,e,n){const r=ot(t,e.schema);return e.openCursor({trans:n,values:!t.keysOnly,reverse:t.dir==="prev",unique:!!t.unique,query:{index:r,range:t.range}})}function Je(t,e,n,r){const s=t.replayFilter?ge(t.filter,t.replayFilter()):t.filter;if(t.or){const i={},o=(u,a,c)=>{if(!s||s(a,c,d=>a.stop(d),d=>a.fail(d))){var h=a.primaryKey,l=""+h;l==="[object ArrayBuffer]"&&(l=""+new Uint8Array(h)),z(i,l)||(i[l]=!0,e(u,a,c))}};return Promise.all([t.or._iterate(o,n),vn(yn(t,r,n),t.algorithm,o,!t.keysOnly&&t.valueMapper)])}return vn(yn(t,r,n),ge(t.algorithm,s),e,!t.keysOnly&&t.valueMapper)}function vn(t,e,n,r){var s=j(r?(i,o,u)=>n(r(i),o,u):n);return t.then(i=>{if(i)return i.start(()=>{var o=()=>i.continue();e&&!e(i,u=>o=u,u=>{i.stop(u),o=I},u=>{i.fail(u),o=I})||s(i.value,i,u=>o=u),o()})})}function L(t,e){try{const n=bn(t),r=bn(e);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return t>e?1:t<e?-1:0;case"binary":return function(s,i){const o=s.length,u=i.length,a=o<u?o:u;for(let c=0;c<a;++c)if(s[c]!==i[c])return s[c]<i[c]?-1:1;return o===u?0:o<u?-1:1}(wn(t),wn(e));case"Array":return function(s,i){const o=s.length,u=i.length,a=o<u?o:u;for(let c=0;c<a;++c){const h=L(s[c],i[c]);if(h!==0)return h}return o===u?0:o<u?-1:1}(t,e)}}catch{}return NaN}function bn(t){const e=typeof t;if(e!=="object")return e;if(ArrayBuffer.isView(t))return"binary";const n=Tt(t);return n==="ArrayBuffer"?"binary":n}function wn(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}class jr{_read(e,n){var r=this._ctx;return r.error?r.table._trans(null,D.bind(null,r.error)):r.table._trans("readonly",e).then(n)}_write(e){var n=this._ctx;return n.error?n.table._trans(null,D.bind(null,n.error)):n.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var n=this._ctx;n.algorithm=ge(n.algorithm,e)}_iterate(e,n){return Je(this._ctx,e,n,this._ctx.table.core)}clone(e){var n=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&U(r,e),n._ctx=r,n}raw(){return this._ctx.valueMapper=null,this}each(e){var n=this._ctx;return this._read(r=>Je(n,e,r,n.table.core))}count(e){return this._read(n=>{const r=this._ctx,s=r.table.core;if(be(r,!0))return s.count({trans:n,query:{index:ot(r,s.schema),range:r.range}}).then(o=>Math.min(o,r.limit));var i=0;return Je(r,()=>(++i,!1),n,s).then(()=>i)}).then(e)}sortBy(e,n){const r=e.split(".").reverse(),s=r[0],i=r.length-1;function o(c,h){return h?o(c[r[h]],h-1):c[s]}var u=this._ctx.dir==="next"?1:-1;function a(c,h){var l=o(c,i),d=o(h,i);return l<d?-u:l>d?u:0}return this.toArray(function(c){return c.sort(a)}).then(n)}toArray(e){return this._read(n=>{var r=this._ctx;if(r.dir==="next"&&be(r,!0)&&r.limit>0){const{valueMapper:s}=r,i=ot(r,r.table.core.schema);return r.table.core.query({trans:n,limit:r.limit,values:!0,query:{index:i,range:r.range}}).then(({result:o})=>s?o.map(s):o)}{const s=[];return Je(r,i=>s.push(i),n,r.table.core).then(()=>s)}},e)}offset(e){var n=this._ctx;return e<=0||(n.offset+=e,be(n)?St(n,()=>{var r=e;return(s,i)=>r===0||(r===1?(--r,!1):(i(()=>{s.advance(r),r=0}),!1))}):St(n,()=>{var r=e;return()=>--r<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),St(this._ctx,()=>{var n=e;return function(r,s,i){return--n<=0&&s(i),n>=0}},!0),this}until(e,n){return xt(this._ctx,function(r,s,i){return!e(r.value)||(s(i),n)}),this}first(e){return this.limit(1).toArray(function(n){return n[0]}).then(e)}last(e){return this.reverse().first(e)}filter(e){var n,r;return xt(this._ctx,function(s){return e(s.value)}),n=this._ctx,r=e,n.isMatch=ge(n.isMatch,r),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,s){e(s.key,s)})}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,s){e(s.primaryKey,s)})}keys(e){var n=this._ctx;n.keysOnly=!n.isMatch;var r=[];return this.each(function(s,i){r.push(i.key)}).then(function(){return r}).then(e)}primaryKeys(e){var n=this._ctx;if(n.dir==="next"&&be(n,!0)&&n.limit>0)return this._read(s=>{var i=ot(n,n.table.core.schema);return n.table.core.query({trans:s,values:!1,limit:n.limit,query:{index:i,range:n.range}})}).then(({result:s})=>s).then(e);n.keysOnly=!n.isMatch;var r=[];return this.each(function(s,i){r.push(i.primaryKey)}).then(function(){return r}).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys(function(n){return n[0]}).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,n=e.index&&e.table.schema.idxByName[e.index];if(!n||!n.multi)return this;var r={};return xt(this._ctx,function(s){var i=s.primaryKey.toString(),o=z(r,i);return r[i]=!0,!o}),this}modify(e){var n=this._ctx;return this._write(r=>{var s;if(typeof e=="function")s=e;else{var i=$(e),o=i.length;s=function(p){for(var v=!1,y=0;y<o;++y){var g=i[y],b=e[g];te(p,g)!==b&&(H(p,g,b),v=!0)}return v}}const u=n.table.core,{outbound:a,extractKey:c}=u.schema.primaryKey,h=this.db._options.modifyChunkSize||200,l=[];let d=0;const f=[],m=(p,v)=>{const{failures:y,numFailures:g}=v;d+=p-g;for(let b of $(y))l.push(y[b])};return this.clone().primaryKeys().then(p=>{const v=y=>{const g=Math.min(h,p.length-y);return u.getMany({trans:r,keys:p.slice(y,y+g),cache:"immutable"}).then(b=>{const x=[],E=[],k=a?[]:null,w=[];for(let _=0;_<g;++_){const R=b[_],O={value:We(R),primKey:p[y+_]};s.call(O,O.value,O)!==!1&&(O.value==null?w.push(p[y+_]):a||L(c(R),c(O.value))===0?(E.push(O.value),a&&k.push(p[y+_])):(w.push(p[y+_]),x.push(O.value)))}const A=be(n)&&n.limit===1/0&&(typeof e!="function"||e===Et)&&{index:n.index,range:n.range};return Promise.resolve(x.length>0&&u.mutate({trans:r,type:"add",values:x}).then(_=>{for(let R in _.failures)w.splice(parseInt(R),1);m(x.length,_)})).then(()=>(E.length>0||A&&typeof e=="object")&&u.mutate({trans:r,type:"put",keys:k,values:E,criteria:A,changeSpec:typeof e!="function"&&e}).then(_=>m(E.length,_))).then(()=>(w.length>0||A&&e===Et)&&u.mutate({trans:r,type:"delete",keys:w,criteria:A}).then(_=>m(w.length,_))).then(()=>p.length>y+g&&v(y+h))})};return v(0).then(()=>{if(l.length>0)throw new ct("Error modifying one or more objects",l,d,f);return p.length})})})}delete(){var e=this._ctx,n=e.range;return be(e)&&(e.isPrimKey&&!Ir||n.type===3)?this._write(r=>{const{primaryKey:s}=e.table.core.schema,i=n;return e.table.core.count({trans:r,query:{index:s,range:i}}).then(o=>e.table.core.mutate({trans:r,type:"deleteRange",range:i}).then(({failures:u,lastResult:a,results:c,numFailures:h})=>{if(h)throw new ct("Could not delete some values",Object.keys(u).map(l=>u[l]),o-h);return o-h}))}):this.modify(Et)}}const Et=(t,e)=>e.value=null;function Rr(t,e){return t<e?-1:t===e?0:1}function Nr(t,e){return t>e?-1:t===e?0:1}function W(t,e,n){var r=t instanceof Xn?new t.Collection(t):t;return r._ctx.error=n?new n(e):new TypeError(e),r}function we(t){return new t.Collection(t,()=>Gn("")).limit(0)}function $r(t,e,n,r,s,i){for(var o=Math.min(t.length,r.length),u=-1,a=0;a<o;++a){var c=e[a];if(c!==r[a])return s(t[a],n[a])<0?t.substr(0,a)+n[a]+n.substr(a+1):s(t[a],r[a])<0?t.substr(0,a)+r[a]+n.substr(a+1):u>=0?t.substr(0,u)+e[u]+n.substr(u+1):null;s(t[a],c)<0&&(u=a)}return o<r.length&&i==="next"?t+n.substr(t.length):o<t.length&&i==="prev"?t.substr(0,n.length):u<0?null:t.substr(0,u)+r[u]+n.substr(u+1)}function Ze(t,e,n,r){var s,i,o,u,a,c,h,l=n.length;if(!n.every(p=>typeof p=="string"))return W(t,zn);function d(p){s=function(y){return y==="next"?g=>g.toUpperCase():g=>g.toLowerCase()}(p),i=function(y){return y==="next"?g=>g.toLowerCase():g=>g.toUpperCase()}(p),o=p==="next"?Rr:Nr;var v=n.map(function(y){return{lower:i(y),upper:s(y)}}).sort(function(y,g){return o(y.lower,g.lower)});u=v.map(function(y){return y.upper}),a=v.map(function(y){return y.lower}),c=p,h=p==="next"?"":r}d("next");var f=new t.Collection(t,()=>re(u[0],a[l-1]+r));f._ondirectionchange=function(p){d(p)};var m=0;return f._addAlgorithm(function(p,v,y){var g=p.key;if(typeof g!="string")return!1;var b=i(g);if(e(b,a,m))return!0;for(var x=null,E=m;E<l;++E){var k=$r(g,b,u[E],a[E],o,c);k===null&&x===null?m=E+1:(x===null||o(x,k)>0)&&(x=k)}return v(x!==null?function(){p.continue(x+h)}:y),!1}),f}function re(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}}function Gn(t){return{type:1,lower:t,upper:t}}class Xn{get Collection(){return this._ctx.table.db.Collection}between(e,n,r,s){r=r!==!1,s=s===!0;try{return this._cmp(e,n)>0||this._cmp(e,n)===0&&(r||s)&&(!r||!s)?we(this):new this.Collection(this,()=>re(e,n,!r,!s))}catch{return W(this,X)}}equals(e){return e==null?W(this,X):new this.Collection(this,()=>Gn(e))}above(e){return e==null?W(this,X):new this.Collection(this,()=>re(e,void 0,!0))}aboveOrEqual(e){return e==null?W(this,X):new this.Collection(this,()=>re(e,void 0,!1))}below(e){return e==null?W(this,X):new this.Collection(this,()=>re(void 0,e,!1,!0))}belowOrEqual(e){return e==null?W(this,X):new this.Collection(this,()=>re(void 0,e))}startsWith(e){return typeof e!="string"?W(this,zn):this.between(e,e+he,!0,!0)}startsWithIgnoreCase(e){return e===""?this.startsWith(e):Ze(this,(n,r)=>n.indexOf(r[0])===0,[e],he)}equalsIgnoreCase(e){return Ze(this,(n,r)=>n===r[0],[e],"")}anyOfIgnoreCase(){var e=J.apply(_e,arguments);return e.length===0?we(this):Ze(this,(n,r)=>r.indexOf(n)!==-1,e,"")}startsWithAnyOfIgnoreCase(){var e=J.apply(_e,arguments);return e.length===0?we(this):Ze(this,(n,r)=>r.some(s=>n.indexOf(s)===0),e,he)}anyOf(){const e=J.apply(_e,arguments);let n=this._cmp;try{e.sort(n)}catch{return W(this,X)}if(e.length===0)return we(this);const r=new this.Collection(this,()=>re(e[0],e[e.length-1]));r._ondirectionchange=i=>{n=i==="next"?this._ascending:this._descending,e.sort(n)};let s=0;return r._addAlgorithm((i,o,u)=>{const a=i.key;for(;n(a,e[s])>0;)if(++s,s===e.length)return o(u),!1;return n(a,e[s])===0||(o(()=>{i.continue(e[s])}),!1)}),r}notEqual(e){return this.inAnyRange([[Mt,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=J.apply(_e,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return W(this,X)}const n=e.reduce((r,s)=>r?r.concat([[r[r.length-1][1],s]]):[[Mt,s]],null);return n.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,n){const r=this._cmp,s=this._ascending,i=this._descending,o=this._min,u=this._max;if(e.length===0)return we(this);if(!e.every(g=>g[0]!==void 0&&g[1]!==void 0&&s(g[0],g[1])<=0))return W(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",C.InvalidArgument);const a=!n||n.includeLowers!==!1,c=n&&n.includeUppers===!0;let h,l=s;function d(g,b){return l(g[0],b[0])}try{h=e.reduce(function(g,b){let x=0,E=g.length;for(;x<E;++x){const k=g[x];if(r(b[0],k[1])<0&&r(b[1],k[0])>0){k[0]=o(k[0],b[0]),k[1]=u(k[1],b[1]);break}}return x===E&&g.push(b),g},[]),h.sort(d)}catch{return W(this,X)}let f=0;const m=c?g=>s(g,h[f][1])>0:g=>s(g,h[f][1])>=0,p=a?g=>i(g,h[f][0])>0:g=>i(g,h[f][0])>=0;let v=m;const y=new this.Collection(this,()=>re(h[0][0],h[h.length-1][1],!a,!c));return y._ondirectionchange=g=>{g==="next"?(v=m,l=s):(v=p,l=i),h.sort(d)},y._addAlgorithm((g,b,x)=>{for(var E=g.key;v(E);)if(++f,f===h.length)return b(x),!1;return!!function(k){return!m(k)&&!p(k)}(E)||(this._cmp(E,h[f][1])===0||this._cmp(E,h[f][0])===0||b(()=>{l===s?g.continue(h[f][0]):g.continue(h[f][1])}),!1)}),y}startsWithAnyOf(){const e=J.apply(_e,arguments);return e.every(n=>typeof n=="string")?e.length===0?we(this):this.inAnyRange(e.map(n=>[n,n+he])):W(this,"startsWithAnyOf() only works with strings")}}function Y(t){return j(function(e){return qe(e),t(e.target.error),!1})}function qe(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}const Le="storagemutated",ie="x-storagemutated-1",ue=$e(null,Le);class Dr{_lock(){return Ie(!P.global),++this._reculock,this._reculock!==1||P.global||(P.lockOwnerFor=this),this}_unlock(){if(Ie(!P.global),--this._reculock==0)for(P.global||(P.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Te(e[1],e[0])}catch{}}return this}_locked(){return this._reculock&&P.lockOwnerFor!==this}create(e){if(!this.mode)return this;const n=this.db.idbdb,r=this.db._state.dbOpenError;if(Ie(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new C.DatabaseClosed(r);case"MissingAPIError":throw new C.MissingAPI(r.message,r);default:throw new C.OpenFailed(r)}if(!this.active)throw new C.TransactionInactive;return Ie(this._completion._state===null),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=j(s=>{qe(s),this._reject(e.error)}),e.onabort=j(s=>{qe(s),this.active&&this._reject(new C.Abort(e.error)),this.active=!1,this.on("abort").fire(s)}),e.oncomplete=j(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&ue.storagemutated.fire(e.mutatedParts)}),this}_promise(e,n,r){if(e==="readwrite"&&this.mode!=="readwrite")return D(new C.ReadOnly("Transaction is readonly"));if(!this.active)return D(new C.TransactionInactive);if(this._locked())return new S((i,o)=>{this._blockedFuncs.push([()=>{this._promise(e,n,r).then(i,o)},P])});if(r)return oe(()=>{var i=new S((o,u)=>{this._lock();const a=n(o,u,this);a&&a.then&&a.then(o,u)});return i.finally(()=>this._unlock()),i._lib=!0,i});var s=new S((i,o)=>{var u=n(i,o,this);u&&u.then&&u.then(i,o)});return s._lib=!0,s}_root(){return this.parent?this.parent._root():this}waitFor(e){var n=this._root();const r=S.resolve(e);if(n._waitingFor)n._waitingFor=n._waitingFor.then(()=>r);else{n._waitingFor=r,n._waitingQueue=[];var s=n.idbtrans.objectStore(n.storeNames[0]);(function o(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(s.get(-1/0).onsuccess=o)})()}var i=n._waitingFor;return new S((o,u)=>{r.then(a=>n._waitingQueue.push(j(o.bind(null,a))),a=>n._waitingQueue.push(j(u.bind(null,a)))).finally(()=>{n._waitingFor===i&&(n._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new C.Abort))}table(e){const n=this._memoizedTables||(this._memoizedTables={});if(z(n,e))return n[e];const r=this.schema[e];if(!r)throw new C.NotFound("Table "+e+" not part of transaction");const s=new this.db.Table(e,r,this);return s.core=this.db.core.table(e),n[e]=s,s}}function qt(t,e,n,r,s,i,o){return{name:t,keyPath:e,unique:n,multi:r,auto:s,compound:i,src:(n&&!o?"&":"")+(r?"*":"")+(s?"++":"")+Qn(e)}}function Qn(t){return typeof t=="string"?t:t?"["+[].join.call(t,"+")+"]":""}function Jn(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:An(n,r=>[r.name,r])}}let Ue=t=>{try{return t.only([[]]),Ue=()=>[[]],[[]]}catch{return Ue=()=>he,he}};function Lt(t){return t==null?()=>{}:typeof t=="string"?function(e){return e.split(".").length===1?n=>n[e]:n=>te(n,e)}(t):e=>te(e,t)}function _n(t){return[].slice.call(t)}let Br=0;function De(t){return t==null?":id":typeof t=="string"?t:`[${t.join("+")}]`}function Fr(t,e,n){function r(a){if(a.type===3)return null;if(a.type===4)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:c,upper:h,lowerOpen:l,upperOpen:d}=a;return c===void 0?h===void 0?null:e.upperBound(h,!!d):h===void 0?e.lowerBound(c,!!l):e.bound(c,h,!!l,!!d)}const{schema:s,hasGetAll:i}=function(a,c){const h=_n(a.objectStoreNames);return{schema:{name:a.name,tables:h.map(l=>c.objectStore(l)).map(l=>{const{keyPath:d,autoIncrement:f}=l,m=M(d),p=d==null,v={},y={name:l.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:p,compound:m,keyPath:d,autoIncrement:f,unique:!0,extractKey:Lt(d)},indexes:_n(l.indexNames).map(g=>l.index(g)).map(g=>{const{name:b,unique:x,multiEntry:E,keyPath:k}=g,w={name:b,compound:M(k),keyPath:k,unique:x,multiEntry:E,extractKey:Lt(k)};return v[De(k)]=w,w}),getIndexByKeyPath:g=>v[De(g)]};return v[":id"]=y.primaryKey,d!=null&&(v[De(d)]=y.primaryKey),y})},hasGetAll:h.length>0&&"getAll"in c.objectStore(h[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,n),o=s.tables.map(a=>function(c){const h=c.name;return{name:h,schema:c,mutate:function({trans:l,type:d,keys:f,values:m,range:p}){return new Promise((v,y)=>{v=j(v);const g=l.objectStore(h),b=g.keyPath==null,x=d==="put"||d==="add";if(!x&&d!=="delete"&&d!=="deleteRange")throw new Error("Invalid operation type: "+d);const{length:E}=f||m||{length:1};if(f&&m&&f.length!==m.length)throw new Error("Given keys array must have same length as given values array.");if(E===0)return v({numFailures:0,failures:{},results:[],lastResult:void 0});let k;const w=[],A=[];let _=0;const R=q=>{++_,qe(q)};if(d==="deleteRange"){if(p.type===4)return v({numFailures:_,failures:A,results:[],lastResult:void 0});p.type===3?w.push(k=g.clear()):w.push(k=g.delete(r(p)))}else{const[q,B]=x?b?[m,f]:[m,null]:[f,null];if(x)for(let N=0;N<E;++N)w.push(k=B&&B[N]!==void 0?g[d](q[N],B[N]):g[d](q[N])),k.onerror=R;else for(let N=0;N<E;++N)w.push(k=g[d](q[N])),k.onerror=R}const O=q=>{const B=q.target.result;w.forEach((N,ye)=>N.error!=null&&(A[ye]=N.error)),v({numFailures:_,failures:A,results:d==="delete"?f:w.map(N=>N.result),lastResult:B})};k.onerror=q=>{R(q),O(q)},k.onsuccess=O})},getMany:({trans:l,keys:d})=>new Promise((f,m)=>{f=j(f);const p=l.objectStore(h),v=d.length,y=new Array(v);let g,b=0,x=0;const E=w=>{const A=w.target;y[A._pos]=A.result,++x===b&&f(y)},k=Y(m);for(let w=0;w<v;++w)d[w]!=null&&(g=p.get(d[w]),g._pos=w,g.onsuccess=E,g.onerror=k,++b);b===0&&f(y)}),get:({trans:l,key:d})=>new Promise((f,m)=>{f=j(f);const p=l.objectStore(h).get(d);p.onsuccess=v=>f(v.target.result),p.onerror=Y(m)}),query:function(l){return d=>new Promise((f,m)=>{f=j(f);const{trans:p,values:v,limit:y,query:g}=d,b=y===1/0?void 0:y,{index:x,range:E}=g,k=p.objectStore(h),w=x.isPrimaryKey?k:k.index(x.name),A=r(E);if(y===0)return f({result:[]});if(l){const _=v?w.getAll(A,b):w.getAllKeys(A,b);_.onsuccess=R=>f({result:R.target.result}),_.onerror=Y(m)}else{let _=0;const R=v||!("openKeyCursor"in w)?w.openCursor(A):w.openKeyCursor(A),O=[];R.onsuccess=q=>{const B=R.result;return B?(O.push(v?B.value:B.primaryKey),++_===y?f({result:O}):void B.continue()):f({result:O})},R.onerror=Y(m)}})}(i),openCursor:function({trans:l,values:d,query:f,reverse:m,unique:p}){return new Promise((v,y)=>{v=j(v);const{index:g,range:b}=f,x=l.objectStore(h),E=g.isPrimaryKey?x:x.index(g.name),k=m?p?"prevunique":"prev":p?"nextunique":"next",w=d||!("openKeyCursor"in E)?E.openCursor(r(b),k):E.openKeyCursor(r(b),k);w.onerror=Y(y),w.onsuccess=j(A=>{const _=w.result;if(!_)return void v(null);_.___id=++Br,_.done=!1;const R=_.continue.bind(_);let O=_.continuePrimaryKey;O&&(O=O.bind(_));const q=_.advance.bind(_),B=()=>{throw new Error("Cursor not stopped")};_.trans=l,_.stop=_.continue=_.continuePrimaryKey=_.advance=()=>{throw new Error("Cursor not started")},_.fail=j(y),_.next=function(){let N=1;return this.start(()=>N--?this.continue():this.stop()).then(()=>this)},_.start=N=>{const ye=new Promise((V,le)=>{V=j(V),w.onerror=Y(le),_.fail=le,_.stop=Ae=>{_.stop=_.continue=_.continuePrimaryKey=_.advance=B,V(Ae)}}),ve=()=>{if(w.result)try{N()}catch(V){_.fail(V)}else _.done=!0,_.start=()=>{throw new Error("Cursor behind last entry")},_.stop()};return w.onsuccess=j(V=>{w.onsuccess=ve,ve()}),_.continue=R,_.continuePrimaryKey=O,_.advance=q,ve(),ye},v(_)},y)})},count({query:l,trans:d}){const{index:f,range:m}=l;return new Promise((p,v)=>{const y=d.objectStore(h),g=f.isPrimaryKey?y:y.index(f.name),b=r(m),x=b?g.count(b):g.count();x.onsuccess=j(E=>p(E.target.result)),x.onerror=Y(v)})}}}(a)),u={};return o.forEach(a=>u[a.name]=a),{stack:"dbcore",transaction:t.transaction.bind(t),table(a){if(!u[a])throw new Error(`Table '${a}' not found`);return u[a]},MIN_KEY:-1/0,MAX_KEY:Ue(e),schema:s}}function Ut({_novip:t},e){const n=e.db,r=function(s,i,{IDBKeyRange:o,indexedDB:u},a){return{dbcore:function(c,h){return h.reduce((l,{create:d})=>({...l,...d(l)}),c)}(Fr(i,o,a),s.dbcore)}}(t._middlewares,n,t._deps,e);t.core=r.dbcore,t.tables.forEach(s=>{const i=s.name;t.core.schema.tables.some(o=>o.name===i)&&(s.core=t.core.table(i),t[i]instanceof t.Table&&(t[i].core=s.core))})}function mt({_novip:t},e,n,r){n.forEach(s=>{const i=r[s];e.forEach(o=>{const u=Jt(o,s);(!u||"value"in u&&u.value===void 0)&&(o===t.Transaction.prototype||o instanceof t.Transaction?ee(o,s,{get(){return this.table(s)},set(a){Pn(this,s,{value:a,writable:!0,configurable:!0,enumerable:!0})}}):o[s]=new t.Table(s,i))})})}function Vt({_novip:t},e){e.forEach(n=>{for(let r in n)n[r]instanceof t.Table&&delete n[r]})}function Mr(t,e){return t._cfg.version-e._cfg.version}function qr(t,e,n,r){const s=t._dbSchema,i=t._createTransaction("readwrite",t._storeNames,s);i.create(n),i._completion.catch(r);const o=i._reject.bind(i),u=P.transless||P;oe(()=>{P.trans=i,P.transless=u,e===0?($(s).forEach(a=>{Pt(n,a,s[a].primKey,s[a].indexes)}),Ut(t,n),S.follow(()=>t.on.populate.fire(i)).catch(o)):function({_novip:a},c,h,l){const d=[],f=a._versions;let m=a._dbSchema=zt(a,a.idbdb,l),p=!1;const v=f.filter(g=>g._cfg.version>=c);function y(){return d.length?S.resolve(d.shift()(h.idbtrans)).then(y):S.resolve()}return v.forEach(g=>{d.push(()=>{const b=m,x=g._cfg.dbschema;Ht(a,b,l),Ht(a,x,l),m=a._dbSchema=x;const E=Zn(b,x);E.add.forEach(w=>{Pt(l,w[0],w[1].primKey,w[1].indexes)}),E.change.forEach(w=>{if(w.recreate)throw new C.Upgrade("Not yet support for changing primary key");{const A=l.objectStore(w.name);w.add.forEach(_=>Wt(A,_)),w.change.forEach(_=>{A.deleteIndex(_.name),Wt(A,_)}),w.del.forEach(_=>A.deleteIndex(_))}});const k=g._cfg.contentUpgrade;if(k&&g._cfg.version>c){Ut(a,l),h._memoizedTables={},p=!0;let w=On(x);E.del.forEach(O=>{w[O]=b[O]}),Vt(a,[a.Transaction.prototype]),mt(a,[a.Transaction.prototype],$(w),w),h.schema=w;const A=Zt(k);let _;A&&Ce();const R=S.follow(()=>{if(_=k(h),_&&A){var O=ne.bind(null,null);_.then(O,O)}});return _&&typeof _.then=="function"?S.resolve(_):R.then(()=>_)}}),d.push(b=>{(!p||!Or)&&function(x,E){[].slice.call(E.db.objectStoreNames).forEach(k=>x[k]==null&&E.db.deleteObjectStore(k))}(g._cfg.dbschema,b),Vt(a,[a.Transaction.prototype]),mt(a,[a.Transaction.prototype],a._storeNames,a._dbSchema),h.schema=a._dbSchema})}),y().then(()=>{var g,b;b=l,$(g=m).forEach(x=>{b.db.objectStoreNames.contains(x)||Pt(b,x,g[x].primKey,g[x].indexes)})})}(t,e,i,n).catch(o)})}function Zn(t,e){const n={del:[],add:[],change:[]};let r;for(r in t)e[r]||n.del.push(r);for(r in e){const s=t[r],i=e[r];if(s){const o={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(s.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||s.primKey.auto!==i.primKey.auto&&!yt)o.recreate=!0,n.change.push(o);else{const u=s.idxByName,a=i.idxByName;let c;for(c in u)a[c]||o.del.push(c);for(c in a){const h=u[c],l=a[c];h?h.src!==l.src&&o.change.push(l):o.add.push(l)}(o.del.length>0||o.add.length>0||o.change.length>0)&&n.change.push(o)}}else n.add.push([r,i])}return n}function Pt(t,e,n,r){const s=t.db.createObjectStore(e,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(i=>Wt(s,i)),s}function Wt(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function zt(t,e,n){const r={};return lt(e.objectStoreNames,0).forEach(s=>{const i=n.objectStore(s);let o=i.keyPath;const u=qt(Qn(o),o||"",!1,!1,!!i.autoIncrement,o&&typeof o!="string",!0),a=[];for(let h=0;h<i.indexNames.length;++h){const l=i.index(i.indexNames[h]);o=l.keyPath;var c=qt(l.name,o,!!l.unique,!!l.multiEntry,!1,o&&typeof o!="string",!1);a.push(c)}r[s]=Jn(s,u,a)}),r}function Ht({_novip:t},e,n){const r=n.db.objectStoreNames;for(let s=0;s<r.length;++s){const i=r[s],o=n.objectStore(i);t._hasGetAll="getAll"in o;for(let u=0;u<o.indexNames.length;++u){const a=o.indexNames[u],c=o.index(a).keyPath,h=typeof c=="string"?c:"["+lt(c).join("+")+"]";if(e[i]){const l=e[i].idxByName[h];l&&(l.name=a,delete e[i].idxByName[h],e[i].idxByName[a]=l)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&K.WorkerGlobalScope&&K instanceof K.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(t._hasGetAll=!1)}class Lr{_parseStoresSpec(e,n){$(e).forEach(r=>{if(e[r]!==null){var s=e[r].split(",").map((o,u)=>{const a=(o=o.trim()).replace(/([&*]|\+\+)/g,""),c=/^\[/.test(a)?a.match(/^\[(.*)\]$/)[1].split("+"):a;return qt(a,c||null,/\&/.test(o),/\*/.test(o),/\+\+/.test(o),M(c),u===0)}),i=s.shift();if(i.multi)throw new C.Schema("Primary key cannot be multi-valued");s.forEach(o=>{if(o.auto)throw new C.Schema("Only primary key can be marked as autoIncrement (++)");if(!o.keyPath)throw new C.Schema("Index must have a name and cannot be an empty string")}),n[r]=Jn(r,i,s)}})}stores(e){const n=this.db;this._cfg.storesSource=this._cfg.storesSource?U(this._cfg.storesSource,e):e;const r=n._versions,s={};let i={};return r.forEach(o=>{U(s,o._cfg.storesSource),i=o._cfg.dbschema={},o._parseStoresSpec(s,i)}),n._dbSchema=i,Vt(n,[n._allTables,n,n.Transaction.prototype]),mt(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],$(i),i),n._storeNames=$(i),this}upgrade(e){return this._cfg.contentUpgrade=nn(this._cfg.contentUpgrade||I,e),this}}function an(t,e){let n=t._dbNamesDB;return n||(n=t._dbNamesDB=new pe(vt,{addons:[],indexedDB:t,IDBKeyRange:e}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function un(t){return t&&typeof t.databases=="function"}function Yt(t){return oe(function(){return P.letThrough=!0,t()})}function Ur(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()}).finally(function(){return clearInterval(t)}):Promise.resolve()}function Vr(t){const e=t._state,{indexedDB:n}=t._deps;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then(()=>e.dbOpenError?D(e.dbOpenError):t);G&&(e.openCanceller._stackHolder=Pe()),e.isBeingOpened=!0,e.dbOpenError=null,e.openComplete=!1;const r=e.openCanceller;function s(){if(e.openCanceller!==r)throw new C.DatabaseClosed("db.open() was cancelled")}let i=e.dbReadyResolve,o=null,u=!1;return S.race([r,(typeof navigator>"u"?S.resolve():Ur()).then(()=>new S((a,c)=>{if(s(),!n)throw new C.MissingAPI;const h=t.name,l=e.autoSchema?n.open(h):n.open(h,Math.round(10*t.verno));if(!l)throw new C.MissingAPI;l.onerror=Y(c),l.onblocked=j(t._fireOnBlocked),l.onupgradeneeded=j(d=>{if(o=l.transaction,e.autoSchema&&!t._options.allowEmptyDB){l.onerror=qe,o.abort(),l.result.close();const m=n.deleteDatabase(h);m.onsuccess=m.onerror=j(()=>{c(new C.NoSuchDatabase(`Database ${h} doesnt exist`))})}else{o.onerror=Y(c);var f=d.oldVersion>Math.pow(2,62)?0:d.oldVersion;u=f<1,t._novip.idbdb=l.result,qr(t,f/10,o,c)}},c),l.onsuccess=j(()=>{o=null;const d=t._novip.idbdb=l.result,f=lt(d.objectStoreNames);if(f.length>0)try{const p=d.transaction((m=f).length===1?m[0]:m,"readonly");e.autoSchema?function({_novip:v},y,g){v.verno=y.version/10;const b=v._dbSchema=zt(0,y,g);v._storeNames=lt(y.objectStoreNames,0),mt(v,[v._allTables],$(b),b)}(t,d,p):(Ht(t,t._dbSchema,p),function(v,y){const g=Zn(zt(0,v.idbdb,y),v._dbSchema);return!(g.add.length||g.change.some(b=>b.add.length||b.change.length))}(t,p)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Ut(t,p)}catch{}var m;Ne.push(t),d.onversionchange=j(p=>{e.vcFired=!0,t.on("versionchange").fire(p)}),d.onclose=j(p=>{t.on("close").fire(p)}),u&&function({indexedDB:p,IDBKeyRange:v},y){!un(p)&&y!==vt&&an(p,v).put({name:y}).catch(I)}(t._deps,h),a()},c)}))]).then(()=>(s(),e.onReadyBeingFired=[],S.resolve(Yt(()=>t.on.ready.fire(t.vip))).then(function a(){if(e.onReadyBeingFired.length>0){let c=e.onReadyBeingFired.reduce(nn,I);return e.onReadyBeingFired=[],S.resolve(Yt(()=>c(t.vip))).then(a)}}))).finally(()=>{e.onReadyBeingFired=null,e.isBeingOpened=!1}).then(()=>t).catch(a=>{e.dbOpenError=a;try{o&&o.abort()}catch{}return r===e.openCanceller&&t._close(),D(a)}).finally(()=>{e.openComplete=!0,i()})}function Gt(t){var e=i=>t.next(i),n=s(e),r=s(i=>t.throw(i));function s(i){return o=>{var u=i(o),a=u.value;return u.done?a:a&&typeof a.then=="function"?a.then(n,r):M(a)?Promise.all(a).then(n,r):n(a)}}return s(e)()}function Wr(t,e,n){var r=arguments.length;if(r<2)throw new C.InvalidArgument("Too few arguments");for(var s=new Array(r-1);--r;)s[r-1]=arguments[r];return n=s.pop(),[t,In(s),n]}function er(t,e,n,r,s){return S.resolve().then(()=>{const i=P.transless||P,o=t._createTransaction(e,n,t._dbSchema,r),u={trans:o,transless:i};if(r)o.idbtrans=r.idbtrans;else try{o.create(),t._state.PR1398_maxLoop=3}catch(l){return l.name===tn.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>er(t,e,n,null,s))):D(l)}const a=Zt(s);let c;a&&Ce();const h=S.follow(()=>{if(c=s.call(o,o),c)if(a){var l=ne.bind(null,null);c.then(l,l)}else typeof c.next=="function"&&typeof c.throw=="function"&&(c=Gt(c))},u);return(c&&typeof c.then=="function"?S.resolve(c).then(l=>o.active?l:D(new C.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):h.then(()=>c)).then(l=>(r&&o._resolve(),o._completion.then(()=>l))).catch(l=>(o._reject(l),D(l)))})}function et(t,e,n){const r=M(t)?t.slice():[t];for(let s=0;s<n;++s)r.push(e);return r}const zr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return{...t,table(e){const n=t.table(e),{schema:r}=n,s={},i=[];function o(c,h,l){const d=De(c),f=s[d]=s[d]||[],m=c==null?0:typeof c=="string"?1:c.length,p=h>0,v={...l,isVirtual:p,keyTail:h,keyLength:m,extractKey:Lt(c),unique:!p&&l.unique};return f.push(v),v.isPrimaryKey||i.push(v),m>1&&o(m===2?c[0]:c.slice(0,m-1),h+1,l),f.sort((y,g)=>y.keyTail-g.keyTail),v}const u=o(r.primaryKey.keyPath,0,r.primaryKey);s[":id"]=[u];for(const c of r.indexes)o(c.keyPath,0,c);function a(c){const h=c.query.index;return h.isVirtual?{...c,query:{index:h,range:(l=c.query.range,d=h.keyTail,{type:l.type===1?2:l.type,lower:et(l.lower,l.lowerOpen?t.MAX_KEY:t.MIN_KEY,d),lowerOpen:!0,upper:et(l.upper,l.upperOpen?t.MIN_KEY:t.MAX_KEY,d),upperOpen:!0})}}:c;var l,d}return{...n,schema:{...r,primaryKey:u,indexes:i,getIndexByKeyPath:function(c){const h=s[De(c)];return h&&h[0]}},count:c=>n.count(a(c)),query:c=>n.query(a(c)),openCursor(c){const{keyTail:h,isVirtual:l,keyLength:d}=c.query.index;return l?n.openCursor(a(c)).then(f=>f&&function(m){return Object.create(m,{continue:{value:function(p){p!=null?m.continue(et(p,c.reverse?t.MAX_KEY:t.MIN_KEY,h)):c.unique?m.continue(m.key.slice(0,d).concat(c.reverse?t.MIN_KEY:t.MAX_KEY,h)):m.continue()}},continuePrimaryKey:{value(p,v){m.continuePrimaryKey(et(p,t.MAX_KEY,h),v)}},primaryKey:{get:()=>m.primaryKey},key:{get(){const p=m.key;return d===1?p[0]:p.slice(0,d)}},value:{get:()=>m.value}})}(f)):n.openCursor(c)}}}}}};function ln(t,e,n,r){return n=n||{},r=r||"",$(t).forEach(s=>{if(z(e,s)){var i=t[s],o=e[s];if(typeof i=="object"&&typeof o=="object"&&i&&o){const u=Tt(i);u!==Tt(o)?n[r+s]=e[s]:u==="Object"?ln(i,o,n,r+s+"."):i!==o&&(n[r+s]=e[s])}else i!==o&&(n[r+s]=e[s])}else n[r+s]=void 0}),$(e).forEach(s=>{z(t,s)||(n[r+s]=e[s])}),n}const Hr={stack:"dbcore",name:"HooksMiddleware",level:2,create:t=>({...t,table(e){const n=t.table(e),{primaryKey:r}=n.schema;return{...n,mutate(s){const i=P.trans,{deleting:o,creating:u,updating:a}=i.table(e).hook;switch(s.type){case"add":if(u.fire===I)break;return i._promise("readwrite",()=>c(s),!0);case"put":if(u.fire===I&&a.fire===I)break;return i._promise("readwrite",()=>c(s),!0);case"delete":if(o.fire===I)break;return i._promise("readwrite",()=>c(s),!0);case"deleteRange":if(o.fire===I)break;return i._promise("readwrite",()=>function(l){return h(l.trans,l.range,1e4)}(s),!0)}return n.mutate(s);function c(l){const d=P.trans,f=l.keys||function(m,p){return p.type==="delete"?p.keys:p.keys||p.values.map(m.extractKey)}(r,l);if(!f)throw new Error("Keys missing");return(l=l.type==="add"||l.type==="put"?{...l,keys:f}:{...l}).type!=="delete"&&(l.values=[...l.values]),l.keys&&(l.keys=[...l.keys]),function(m,p,v){return p.type==="add"?Promise.resolve([]):m.getMany({trans:p.trans,keys:v,cache:"immutable"})}(n,l,f).then(m=>{const p=f.map((v,y)=>{const g=m[y],b={onerror:null,onsuccess:null};if(l.type==="delete")o.fire.call(b,v,g,d);else if(l.type==="add"||g===void 0){const x=u.fire.call(b,v,l.values[y],d);v==null&&x!=null&&(v=x,l.keys[y]=v,r.outbound||H(l.values[y],r.keyPath,v))}else{const x=ln(g,l.values[y]),E=a.fire.call(b,x,v,g,d);if(E){const k=l.values[y];Object.keys(E).forEach(w=>{z(k,w)?k[w]=E[w]:H(k,w,E[w])})}}return b});return n.mutate(l).then(({failures:v,results:y,numFailures:g,lastResult:b})=>{for(let x=0;x<f.length;++x){const E=y?y[x]:f[x],k=p[x];E==null?k.onerror&&k.onerror(v[x]):k.onsuccess&&k.onsuccess(l.type==="put"&&m[x]?l.values[x]:E)}return{failures:v,results:y,numFailures:g,lastResult:b}}).catch(v=>(p.forEach(y=>y.onerror&&y.onerror(v)),Promise.reject(v)))})}function h(l,d,f){return n.query({trans:l,values:!1,query:{index:r,range:d},limit:f}).then(({result:m})=>c({type:"delete",keys:m,trans:l}).then(p=>p.numFailures>0?Promise.reject(p.failures[0]):m.length<f?{failures:[],numFailures:0,lastResult:void 0}:h(l,{...d,lower:m[m.length-1],lowerOpen:!0},f)))}}}}})};function tr(t,e,n){try{if(!e||e.keys.length<t.length)return null;const r=[];for(let s=0,i=0;s<e.keys.length&&i<t.length;++s)L(e.keys[s],t[i])===0&&(r.push(n?We(e.values[s]):e.values[s]),++i);return r.length===t.length?r:null}catch{return null}}const Yr={stack:"dbcore",level:-1,create:t=>({table:e=>{const n=t.table(e);return{...n,getMany:r=>{if(!r.cache)return n.getMany(r);const s=tr(r.keys,r.trans._cache,r.cache==="clone");return s?S.resolve(s):n.getMany(r).then(i=>(r.trans._cache={keys:r.keys,values:r.cache==="clone"?We(i):i},i))},mutate:r=>(r.type!=="add"&&(r.trans._cache=null),n.mutate(r))}}})};function cn(t){return!("from"in t)}const Q=function(t,e){if(!this){const n=new Q;return t&&"d"in t&&U(n,t),n}U(this,arguments.length?{d:1,from:t,to:arguments.length>1?e:t}:{d:0})};function Ve(t,e,n){const r=L(e,n);if(isNaN(r))return;if(r>0)throw RangeError();if(cn(t))return U(t,{from:e,to:n,d:1});const s=t.l,i=t.r;if(L(n,t.from)<0)return s?Ve(s,e,n):t.l={from:e,to:n,d:1,l:null,r:null},kn(t);if(L(e,t.to)>0)return i?Ve(i,e,n):t.r={from:e,to:n,d:1,l:null,r:null},kn(t);L(e,t.from)<0&&(t.from=e,t.l=null,t.d=i?i.d+1:1),L(n,t.to)>0&&(t.to=n,t.r=null,t.d=t.l?t.l.d+1:1);const o=!t.r;s&&!t.l&&gt(t,s),i&&o&&gt(t,i)}function gt(t,e){cn(e)||function n(r,{from:s,to:i,l:o,r:u}){Ve(r,s,i),o&&n(r,o),u&&n(r,u)}(t,e)}function Gr(t,e){const n=Xt(e);let r=n.next();if(r.done)return!1;let s=r.value;const i=Xt(t);let o=i.next(s.from),u=o.value;for(;!r.done&&!o.done;){if(L(u.from,s.to)<=0&&L(u.to,s.from)>=0)return!0;L(s.from,u.from)<0?s=(r=n.next(u.from)).value:u=(o=i.next(s.from)).value}return!1}function Xt(t){let e=cn(t)?null:{s:0,n:t};return{next(n){const r=arguments.length>0;for(;e;)switch(e.s){case 0:if(e.s=1,r)for(;e.n.l&&L(n,e.n.from)<0;)e={up:e,n:e.n.l,s:1};else for(;e.n.l;)e={up:e,n:e.n.l,s:1};case 1:if(e.s=2,!r||L(n,e.n.to)<=0)return{value:e.n,done:!1};case 2:if(e.n.r){e.s=3,e={up:e,n:e.n.r,s:0};continue}case 3:e=e.up}return{done:!0}}}}function kn(t){var e,n;const r=(((e=t.r)===null||e===void 0?void 0:e.d)||0)-(((n=t.l)===null||n===void 0?void 0:n.d)||0),s=r>1?"r":r<-1?"l":"";if(s){const i=s==="r"?"l":"r",o={...t},u=t[s];t.from=u.from,t.to=u.to,t[s]=u[s],o[s]=u[i],t[i]=o,o.d=xn(o)}t.d=xn(t)}function xn({r:t,l:e}){return(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}Ee(Q.prototype,{add(t){return gt(this,t),this},addKey(t){return Ve(this,t,t),this},addKeys(t){return t.forEach(e=>Ve(this,e,e)),this},[At](){return Xt(this)}});const Xr={stack:"dbcore",level:0,create:t=>{const e=t.schema.name,n=new Q(t.MIN_KEY,t.MAX_KEY);return{...t,table:r=>{const s=t.table(r),{schema:i}=s,{primaryKey:o}=i,{extractKey:u,outbound:a}=o,c={...s,mutate:d=>{const f=d.trans,m=f.mutatedParts||(f.mutatedParts={}),p=k=>{const w=`idb://${e}/${r}/${k}`;return m[w]||(m[w]=new Q)},v=p(""),y=p(":dels"),{type:g}=d;let[b,x]=d.type==="deleteRange"?[d.range]:d.type==="delete"?[d.keys]:d.values.length<50?[[],d.values]:[];const E=d.trans._cache;return s.mutate(d).then(k=>{if(M(b)){g!=="delete"&&(b=k.results),v.addKeys(b);const w=tr(b,E);w||g==="add"||y.addKeys(b),(w||x)&&function(A,_,R,O){function q(B){const N=A(B.name||"");function ye(V){return V!=null?B.extractKey(V):null}const ve=V=>B.multiEntry&&M(V)?V.forEach(le=>N.addKey(le)):N.addKey(V);(R||O).forEach((V,le)=>{const Ae=R&&ye(R[le]),bt=O&&ye(O[le]);L(Ae,bt)!==0&&(Ae!=null&&ve(Ae),bt!=null&&ve(bt))})}_.indexes.forEach(q)}(p,i,w,x)}else if(b){const w={from:b.lower,to:b.upper};y.add(w),v.add(w)}else v.add(n),y.add(n),i.indexes.forEach(w=>p(w.name).add(n));return k})}},h=({query:{index:d,range:f}})=>{var m,p;return[d,new Q((m=f.lower)!==null&&m!==void 0?m:t.MIN_KEY,(p=f.upper)!==null&&p!==void 0?p:t.MAX_KEY)]},l={get:d=>[o,new Q(d.key)],getMany:d=>[o,new Q().addKeys(d.keys)],count:h,query:h,openCursor:h};return $(l).forEach(d=>{c[d]=function(f){const{subscr:m}=P;if(m){const p=x=>{const E=`idb://${e}/${r}/${x}`;return m[E]||(m[E]=new Q)},v=p(""),y=p(":dels"),[g,b]=l[d](f);if(p(g.name||"").add(b),!g.isPrimaryKey){if(d!=="count"){const x=d==="query"&&a&&f.values&&s.query({...f,values:!1});return s[d].apply(this,arguments).then(E=>{if(d==="query"){if(a&&f.values)return x.then(({result:w})=>(v.addKeys(w),E));const k=f.values?E.result.map(u):E.result;f.values?v.addKeys(k):y.addKeys(k)}else if(d==="openCursor"){const k=E,w=f.values;return k&&Object.create(k,{key:{get:()=>(y.addKey(k.primaryKey),k.key)},primaryKey:{get(){const A=k.primaryKey;return y.addKey(A),A}},value:{get:()=>(w&&v.addKey(k.primaryKey),k.value)}})}return E})}y.add(n)}}return s[d].apply(this,arguments)}}),c}}}};class pe{constructor(e,n){this._middlewares={},this.verno=0;const r=pe.dependencies;this._options=n={addons:pe.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...n},this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:s}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:I,dbReadyPromise:null,cancelOpen:I,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var o;i.dbReadyPromise=new S(u=>{i.dbReadyResolve=u}),i.openCanceller=new S((u,a)=>{i.cancelOpen=a}),this._state=i,this.name=e,this.on=$e(this,"populate","blocked","versionchange","close",{ready:[nn,I]}),this.on.ready.subscribe=Cn(this.on.ready.subscribe,u=>(a,c)=>{pe.vip(()=>{const h=this._state;if(h.openComplete)h.dbOpenError||S.resolve().then(a),c&&u(a);else if(h.onReadyBeingFired)h.onReadyBeingFired.push(a),c&&u(a);else{u(a);const l=this;c||u(function d(){l.on.ready.unsubscribe(a),l.on.ready.unsubscribe(d)})}})}),this.Collection=(o=this,Oe(jr.prototype,function(u,a){this.db=o;let c=Yn,h=null;if(a)try{c=a()}catch(m){h=m}const l=u._ctx,d=l.table,f=d.hook.reading.fire;this._ctx={table:d,index:l.index,isPrimKey:!l.index||d.schema.primKey.keyPath&&l.index===d.schema.primKey.name,range:c,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:h,or:l.or,valueMapper:f!==Fe?f:null}})),this.Table=function(u){return Oe(Kr.prototype,function(a,c,h){this.db=u,this._tx=h,this.name=a,this.schema=c,this.hook=u._allTables[a]?u._allTables[a].hook:$e(null,{creating:[wr,I],reading:[br,Fe],updating:[kr,I],deleting:[_r,I]})})}(this),this.Transaction=function(u){return Oe(Dr.prototype,function(a,c,h,l,d){this.db=u,this.mode=a,this.storeNames=c,this.schema=h,this.chromeTransactionDurability=l,this.idbtrans=null,this.on=$e(this,"complete","error","abort"),this.parent=d||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new S((f,m)=>{this._resolve=f,this._reject=m}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},f=>{var m=this.active;return this.active=!1,this.on.error.fire(f),this.parent?this.parent._reject(f):m&&this.idbtrans&&this.idbtrans.abort(),D(f)})})}(this),this.Version=function(u){return Oe(Lr.prototype,function(a){this.db=u,this._cfg={version:a,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(u){return Oe(Xn.prototype,function(a,c,h){this.db=u,this._ctx={table:a,index:c===":id"?null:c,or:h};const l=u._deps.indexedDB;if(!l)throw new C.MissingAPI;this._cmp=this._ascending=l.cmp.bind(l),this._descending=(d,f)=>l.cmp(f,d),this._max=(d,f)=>l.cmp(d,f)>0?d:f,this._min=(d,f)=>l.cmp(d,f)<0?d:f,this._IDBKeyRange=u._deps.IDBKeyRange})}(this),this.on("versionchange",u=>{u.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",u=>{!u.newVersion||u.newVersion<u.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${u.oldVersion/10}`)}),this._maxKey=Ue(n.IDBKeyRange),this._createTransaction=(u,a,c,h)=>new this.Transaction(u,a,c,this._options.chromeTransactionDurability,h),this._fireOnBlocked=u=>{this.on("blocked").fire(u),Ne.filter(a=>a.name===this.name&&a!==this&&!a._state.vcFired).map(a=>a.on("versionchange").fire(u))},this.use(zr),this.use(Hr),this.use(Xr),this.use(Yr),this.vip=Object.create(this,{_vip:{value:!0}}),s.forEach(u=>u(this))}version(e){if(isNaN(e)||e<.1)throw new C.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new C.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const n=this._versions;var r=n.filter(s=>s._cfg.version===e)[0];return r||(r=new this.Version(e),n.push(r),n.sort(Mr),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||P.letThrough||this._vip)?e():new S((n,r)=>{if(this._state.openComplete)return r(new C.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void r(new C.DatabaseClosed);this.open().catch(I)}this._state.dbReadyPromise.then(n,r)}).then(e)}use({stack:e,create:n,level:r,name:s}){s&&this.unuse({stack:e,name:s});const i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:n,level:r??10,name:s}),i.sort((o,u)=>o.level-u.level),this}unuse({stack:e,name:n,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(s=>r?s.create!==r:!!n&&s.name!==n)),this}open(){return Vr(this)}_close(){const e=this._state,n=Ne.indexOf(this);if(n>=0&&Ne.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}e.dbReadyPromise=new S(r=>{e.dbReadyResolve=r}),e.openCanceller=new S((r,s)=>{e.cancelOpen=s})}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new C.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,n=this._state;return new S((r,s)=>{const i=()=>{this.close();var o=this._deps.indexedDB.deleteDatabase(this.name);o.onsuccess=j(()=>{(function({indexedDB:u,IDBKeyRange:a},c){!un(u)&&c!==vt&&an(u,a).delete(c).catch(I)})(this._deps,this.name),r()}),o.onerror=Y(s),o.onblocked=this._fireOnBlocked};if(e)throw new C.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()})}backendDB(){return this.idbdb}isOpen(){return this.idbdb!==null}hasBeenClosed(){const e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"}hasFailed(){return this._state.dbOpenError!==null}dynamicallyOpened(){return this._state.autoSchema}get tables(){return $(this._allTables).map(e=>this._allTables[e])}transaction(){const e=Wr.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,n,r){let s=P.trans;s&&s.db===this&&e.indexOf("!")===-1||(s=null);const i=e.indexOf("?")!==-1;let o,u;e=e.replace("!","").replace("?","");try{if(u=n.map(c=>{var h=c instanceof this.Table?c.name:c;if(typeof h!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return h}),e=="r"||e===_t)o=_t;else{if(e!="rw"&&e!=kt)throw new C.InvalidArgument("Invalid transaction mode: "+e);o=kt}if(s){if(s.mode===_t&&o===kt){if(!i)throw new C.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");s=null}s&&u.forEach(c=>{if(s&&s.storeNames.indexOf(c)===-1){if(!i)throw new C.SubTransaction("Table "+c+" not included in parent transaction.");s=null}}),i&&s&&!s.active&&(s=null)}}catch(c){return s?s._promise(null,(h,l)=>{l(c)}):D(c)}const a=er.bind(null,this,o,u,s,r);return s?s._promise(o,a,"lock"):P.trans?Te(P.transless,()=>this._whenReady(a)):this._whenReady(a)}table(e){if(!z(this._allTables,e))throw new C.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Qr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class Jr{constructor(e){this._subscribe=e}subscribe(e,n,r){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:n,complete:r})}[Qr](){return this}}function nr(t,e){return $(e).forEach(n=>{gt(t[n]||(t[n]=new Q),e[n])}),t}function Zr(t){let e,n=!1;const r=new Jr(s=>{const i=Zt(t);let o=!1,u={},a={};const c={get closed(){return o},unsubscribe:()=>{o=!0,ue.storagemutated.unsubscribe(f)}};s.start&&s.start(c);let h=!1,l=!1;function d(){return $(a).some(p=>u[p]&&Gr(u[p],a[p]))}const f=p=>{nr(u,p),d()&&m()},m=()=>{if(h||o)return;u={};const p={},v=function(y){i&&Ce();const g=()=>oe(t,{subscr:y,trans:null}),b=P.trans?Te(P.transless,g):g();return i&&b.then(ne,ne),b}(p);l||(ue(Le,f),l=!0),h=!0,Promise.resolve(v).then(y=>{n=!0,e=y,h=!1,o||(d()?m():(u={},a=p,s.next&&s.next(y)))},y=>{h=!1,n=!1,s.error&&s.error(y),c.unsubscribe()})};return m(),c});return r.hasValue=()=>n,r.getValue=()=>e,r}let Qt;try{Qt={indexedDB:K.indexedDB||K.mozIndexedDB||K.webkitIndexedDB||K.msIndexedDB,IDBKeyRange:K.IDBKeyRange||K.webkitIDBKeyRange}}catch{Qt={indexedDB:null,IDBKeyRange:null}}const ce=pe;function at(t){let e=Z;try{Z=!0,ue.storagemutated.fire(t)}finally{Z=e}}Ee(ce,{...tt,delete:t=>new ce(t,{addons:[]}).delete(),exists:t=>new ce(t,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(t){try{return function({indexedDB:e,IDBKeyRange:n}){return un(e)?Promise.resolve(e.databases()).then(r=>r.map(s=>s.name).filter(s=>s!==vt)):an(e,n).toCollection().primaryKeys()}(ce.dependencies).then(t)}catch{return D(new C.MissingAPI)}},defineClass:()=>function(t){U(this,t)},ignoreTransaction:t=>P.trans?Te(P.transless,t):t(),vip:Yt,async:function(t){return function(){try{var e=Gt(t.apply(this,arguments));return e&&typeof e.then=="function"?e:S.resolve(e)}catch(n){return D(n)}}},spawn:function(t,e,n){try{var r=Gt(t.apply(n,e||[]));return r&&typeof r.then=="function"?r:S.resolve(r)}catch(s){return D(s)}},currentTransaction:{get:()=>P.trans||null},waitFor:function(t,e){const n=S.resolve(typeof t=="function"?ce.ignoreTransaction(t):t).timeout(e||6e4);return P.trans?P.trans.waitFor(n):n},Promise:S,debug:{get:()=>G,set:t=>{jn(t,t==="dexie"?()=>!0:Hn)}},derive:ke,extend:U,props:Ee,override:Cn,Events:$e,on:ue,liveQuery:Zr,extendObservabilitySet:nr,getByKeyPath:te,setByKeyPath:H,delByKeyPath:function(t,e){typeof e=="string"?H(t,e,void 0):"length"in e&&[].map.call(e,function(n){H(t,n,void 0)})},shallowClone:On,deepClone:We,getObjectDiff:ln,cmp:L,asap:Tn,minKey:Mt,addons:[],connections:Ne,errnames:tn,dependencies:Qt,semVer:gn,version:gn.split(".").map(t=>parseInt(t)).reduce((t,e,n)=>t+e/Math.pow(10,2*n))}),ce.maxKey=Ue(ce.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(ue(Le,t=>{if(!Z){let e;yt?(e=document.createEvent("CustomEvent"),e.initCustomEvent(ie,!0,!0,t)):e=new CustomEvent(ie,{detail:t}),Z=!0,dispatchEvent(e),Z=!1}}),addEventListener(ie,({detail:t})=>{Z||at(t)}));let Z=!1;if(typeof BroadcastChannel<"u"){const t=new BroadcastChannel(ie);typeof t.unref=="function"&&t.unref(),ue(Le,e=>{Z||t.postMessage(e)}),t.onmessage=e=>{e.data&&at(e.data)}}else if(typeof self<"u"&&typeof navigator<"u"){ue(Le,e=>{try{Z||(typeof localStorage<"u"&&localStorage.setItem(ie,JSON.stringify({trig:Math.random(),changedParts:e})),typeof self.clients=="object"&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(n=>n.postMessage({type:ie,changedParts:e})))}catch{}}),typeof addEventListener<"u"&&addEventListener("storage",e=>{if(e.key===ie){const n=JSON.parse(e.newValue);n&&at(n.changedParts)}});const t=self.document&&navigator.serviceWorker;t&&t.addEventListener("message",function({data:e}){e&&e.type===ie&&at(e.changedParts)})}S.rejectionMapper=function(t,e){if(!t||t instanceof xe||t instanceof TypeError||t instanceof SyntaxError||!t.name||!dn[t.name])return t;var n=new dn[t.name](e||t.message,t);return"stack"in t&&ee(n,"stack",{get:function(){return this.inner.stack}}),n},jn(G,Hn);class es extends pe{constructor(){super("NylasAuthDatabase"),ut(this,"grant"),ut(this,"pkce"),this.version(1).stores({grant:"++id,token",pkce:"++id,codeVerifier"}),this.grant=this.table("grant"),this.pkce=this.table("pkce")}}class ts{constructor(){ut(this,"theDB"),this.theDB=new es}async setCodeVerifier(e){await this.theDB.pkce.put({id:1,codeVerifier:e},1)}async getCodeVerifier(){const[e]=await this.theDB.pkce.toArray();return e?e.codeVerifier:null}async getTokenInfo(){const e=await this.theDB.grant.get(1);return e?e.token:null}async setTokenInfo(e){await this.theDB.grant.put({id:1,token:e},1)}async reset(){await this.theDB.grant.clear()}}function ns(t){const e="NylasAuth";if(!t)throw new Error("NylasAuth requires a config object");let n=null;if(t.storageType==="indexeddb"&&(n=new ts),!n)throw new Error("NylasAuth requires a storage object");const r=[{type:"read-only",value:"https://www.googleapis.com/auth/gmail.readonly"},{type:"modify",value:"https://www.googleapis.com/auth/gmail.modify"},{type:"compose",value:"https://www.googleapis.com/auth/gmail.compose"},{type:"insert",value:"https://www.googleapis.com/auth/gmail.insert"},{type:"labels",value:"https://www.googleapis.com/auth/gmail.labels"},{type:"metadata",value:"https://www.googleapis.com/auth/gmail.metadata"},{type:"settings.basic",value:"https://www.googleapis.com/auth/gmail.settings.basic"},{type:"settings.sharing",value:"https://www.googleapis.com/auth/gmail.settings.sharing"}],s=[{type:"read-only",value:"https://outlook.office.com/mail.read"},{type:"modify",value:"https://outlook.office.com/mail.readwrite"},{type:"send",value:"https://outlook.office.com/mail.send"},{type:"offline",value:"offline_access"}];async function i(o,u,a,c=!0,h,l){const d=await(n==null?void 0:n.getTokenInfo()),f=new URL(o,h??t.apiUri),m=new Headers;m.append("Accept","application/json"),m.append("Content-Type","application/json"),m.append("User-Agent",e),d&&m.append("Authorization",`Bearer ${d.access_token}`);const p=await fetch(f.toString(),{method:u||"GET",headers:m,mode:"cors",referrer:location.origin,body:a?JSON.stringify(a):void 0,...l||{}});return c?await p.json():p.body}return{config:t,async getHostedAuthRedirectURL(o=t.defaultScopes,u,a){const c=await hn(Math.random().toString()),h=await hn(c);await(n==null?void 0:n.setCodeVerifier(c));const l=new URL(`${t.apiUri}/v3/connect/auth`);return l.searchParams.set("client_id",t.clientId),l.searchParams.set("response_type","code"),l.searchParams.set("scope",o.join(" ")),l.searchParams.set("redirect_uri",t.redirectURI),l.searchParams.set("access_type","offline"),l.searchParams.set("code_challenge",h),l.searchParams.set("code_challenge_method","S256"),l.searchParams.set("options","rotate_refresh_token"),a&&l.searchParams.set("provider",a),u&&l.searchParams.set("login_hint",u),l.toString()},nylasAPIRequest:i,async exchangeAuthCodeForTokenInfo(o){if(!o)return null;const u=await(n==null?void 0:n.getCodeVerifier()),a=await this.nylasAPIRequest("/v3/connect/token","POST",{code:o,client_id:t.clientId,grant_type:"authorization_code",redirect_uri:t.redirectURI,code_verifier:u});return"error"in a||await(n==null?void 0:n.setTokenInfo(a)),a},async nylasDownloadFileRequest(o,u="GET",a){const c=await(n==null?void 0:n.getTokenInfo()),h=new URL(o,t.apiUri),l=new Headers;return l.append("Accept","application/json"),l.append("Content-Type","application/octet-stream"),l.append("User-Agent",e),c&&l.append("Authorization",`Bearer ${c.access_token}`),(await fetch(h.toString(),{method:u,headers:l,mode:"cors",referrer:location.origin,body:a?JSON.stringify(a):void 0})).blob()},async logout(){const o=await(n==null?void 0:n.getTokenInfo());o&&await this.nylasAPIRequest(`/v3/connect/revoke?token=${o.access_token}`,"POST"),await(n==null?void 0:n.reset())},async isAuthenticated(){return!!await(n==null?void 0:n.getTokenInfo())},async getTokenInfo(){const o=await(n==null?void 0:n.getTokenInfo());if(!o)return null;const{access_token:u,...a}=o;return a},async isAccessTokenValid(){const o=await(n==null?void 0:n.getTokenInfo());return o?"data"in await this.nylasAPIRequest(`/v3/connect/tokeninfo?id_token=${o.id_token}`,"GET"):!1},async refreshAccessToken(){const o=await(n==null?void 0:n.getTokenInfo());if(!o)return null;const u=await this.nylasAPIRequest("/v3/connect/token","POST",{client_id:t.clientId,grant_type:"refresh_token",refresh_token:o.refresh_token});return"error"in u||await(n==null?void 0:n.setTokenInfo(u)),u},async hasScopeByType(o="email",u){const a=await(n==null?void 0:n.getTokenInfo());if(!a)return!1;const c=a.scope.toLowerCase().split(" ");let h=[];const l=Array.isArray(u)?u:[u];return o==="email"&&(h=[...s,...r].filter(d=>l.includes(d.type))),h.every(d=>c.includes(d.value))},async hasScope(o){const u=await(n==null?void 0:n.getTokenInfo());if(!u)return!1;const a=u.scope.toLowerCase().split(" ");return(Array.isArray(o)?o:[o]).some(c=>a.includes(c.toLowerCase()))}}}exports.NylasBaseProvider=sr;exports.Xr=ar;exports.Zr=ur;exports.es=ns;exports.global$1=Sn;exports.nr=En;