@nylas/react 1.0.0-prealpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +22 -0
- package/README.md +3 -0
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +1 -0
- package/dist/_commonjsHelpers-57e89916-af061c86.js +19 -0
- package/dist/archive-icon_7.entry-53aede1b.js +75 -0
- package/dist/archive-icon_7.entry-8c90815a.cjs +1 -0
- package/dist/arrow-icon.entry-2867f4fb.js +15 -0
- package/dist/arrow-icon.entry-a2f53919.cjs +1 -0
- package/dist/bold-icon_3.entry-ad806730.js +35 -0
- package/dist/bold-icon_3.entry-e0bc6774.cjs +1 -0
- package/dist/calendar-cancel-icon.entry-546b7bd4.cjs +1 -0
- package/dist/calendar-cancel-icon.entry-74051835.js +15 -0
- package/dist/calendar-check-icon_3.entry-42bab0b4.js +35 -0
- package/dist/calendar-check-icon_3.entry-f5846fee.cjs +1 -0
- package/dist/calendar-icon.entry-25474b1e.cjs +1 -0
- package/dist/calendar-icon.entry-c751873f.js +15 -0
- package/dist/chevron-icon.entry-60842fb6.js +15 -0
- package/dist/chevron-icon.entry-97e4621e.cjs +1 -0
- package/dist/close-icon_2.entry-aa015993.cjs +1 -0
- package/dist/close-icon_2.entry-ef03bd27.js +25 -0
- package/dist/core-js-38e53e34.cjs +4 -0
- package/dist/core-js-a9d3b6e1.js +3297 -0
- package/dist/document-refresh-icon.entry-b27207eb.js +15 -0
- package/dist/document-refresh-icon.entry-ca2ef29e.cjs +1 -0
- package/dist/dom-68f08be9.cjs +15 -0
- package/dist/dom-86e17616.js +664 -0
- package/dist/duration-bddc4a13-05d3e3e2.cjs +1 -0
- package/dist/duration-bddc4a13-179ce826.js +41 -0
- package/dist/elements/index.d.ts +56 -0
- package/dist/elements/react-component-lib/createComponent.d.ts +10 -0
- package/dist/elements/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/dist/elements/react-component-lib/index.d.ts +2 -0
- package/dist/elements/react-component-lib/interfaces.d.ts +29 -0
- package/dist/elements/react-component-lib/utils/attachProps.d.ts +9 -0
- package/dist/elements/react-component-lib/utils/case.d.ts +2 -0
- package/dist/elements/react-component-lib/utils/dev.d.ts +2 -0
- package/dist/elements/react-component-lib/utils/index.d.ts +10 -0
- package/dist/elements-60ebdb01-24595598.cjs +16494 -0
- package/dist/elements-60ebdb01-5d144002.js +27455 -0
- package/dist/flow-40ff9cea-6f8c30e2.cjs +9 -0
- package/dist/flow-40ff9cea-ee70fdf5.js +505 -0
- package/dist/focus-visible-e8093c16-28fc08a0.js +82 -0
- package/dist/focus-visible-e8093c16-f380b705.cjs +1 -0
- package/dist/forward-icon_6.entry-725d1be4.cjs +3 -0
- package/dist/forward-icon_6.entry-dc8f7235.js +955 -0
- package/dist/globe-icon.entry-796d3f48.js +15 -0
- package/dist/globe-icon.entry-918cfd35.cjs +1 -0
- package/dist/index-29d0e781.cjs +30 -0
- package/dist/index-2b85580a-bfc3ceac.cjs +7 -0
- package/dist/index-2b85580a-f9211f23.js +3238 -0
- package/dist/index-4f65b6f9.js +1489 -0
- package/dist/index.d.ts +4 -0
- package/dist/loading-icon.entry-8e49fab0.js +15 -0
- package/dist/loading-icon.entry-b2534e3e.cjs +1 -0
- package/dist/mailbox-store-0019772c-06d31a90.js +380 -0
- package/dist/mailbox-store-0019772c-d1254c5c.cjs +1 -0
- package/dist/nylas-booked-event-card_9.entry-d995d7cb.js +4567 -0
- package/dist/nylas-booked-event-card_9.entry-ea02f083.cjs +148 -0
- package/dist/nylas-if-state_3.entry-ce816adb.js +291 -0
- package/dist/nylas-if-state_3.entry-e8c831b7.cjs +1 -0
- package/dist/nylas-list-folders.entry-8134344b.js +121 -0
- package/dist/nylas-list-folders.entry-de8cca60.cjs +1 -0
- package/dist/nylas-list-threads.entry-1367fe30.js +71 -0
- package/dist/nylas-list-threads.entry-93b70a1a.cjs +1 -0
- package/dist/nylas-mailbox-pagination.entry-568ac217.js +102 -0
- package/dist/nylas-mailbox-pagination.entry-6bb0ee37.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-9214b283.js +83 -0
- package/dist/nylas-mailbox-toolbar-button.entry-d4ad5c15.cjs +1 -0
- package/dist/nylas-open-hours-picker.entry-109f13f5.js +186 -0
- package/dist/nylas-open-hours-picker.entry-2c19643f.cjs +1 -0
- package/dist/nylas-provider.entry-2cfe5f0e.js +134 -0
- package/dist/nylas-provider.entry-87fa9276.cjs +1 -0
- package/dist/nylas-scheduler.entry-6ec8e574.js +195 -0
- package/dist/nylas-scheduler.entry-b41cbf99.cjs +1 -0
- package/dist/nylas-threads-refresh.entry-6d61a689.cjs +1 -0
- package/dist/nylas-threads-refresh.entry-9111a403.js +75 -0
- package/dist/nylas-threads-search.entry-03073490.cjs +1 -0
- package/dist/nylas-threads-search.entry-2124f663.js +70 -0
- package/dist/nylas-view-thread.entry-4ecbcd78.cjs +1 -0
- package/dist/nylas-view-thread.entry-fe51c1f6.js +204 -0
- package/dist/play-icon_2.entry-8e156535.js +25 -0
- package/dist/play-icon_2.entry-cf1cbc8d.cjs +1 -0
- package/dist/property-0065dde7-83dc9cc4.cjs +23 -0
- package/dist/property-0065dde7-c57b8fa3.js +589 -0
- package/dist/react.cjs +1 -0
- package/dist/react.js +62 -0
- package/dist/refresh-icon.entry-4ddd53b0.js +15 -0
- package/dist/refresh-icon.entry-9f24e833.cjs +1 -0
- package/dist/register-component-55376f31-5eaf8954.js +105 -0
- package/dist/register-component-55376f31-8d6ddee4.cjs +1 -0
- package/dist/scheduler-store-5a39585a-117668e3.js +173 -0
- package/dist/scheduler-store-5a39585a-2c848bec.cjs +1 -0
- package/dist/translate-icon.entry-0cd24de4.cjs +1 -0
- package/dist/translate-icon.entry-db2cdf1d.js +15 -0
- package/dist/utils-5074a070-ce33ee6b.js +119 -0
- package/dist/utils-5074a070-d5ba6add.cjs +2 -0
- package/package.json +47 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r as e, h as C } from "./index-4f65b6f9.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const o = ".sc-globe-icon-h{display:flex}", s = o, i = class {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
e(this, t), this.width = "16", this.height = "16";
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return C("svg", { key: "81b372fb35acad3083b0c55e6008506a67ed1c2d", xmlns: "http://www.w3.org/2000/svg", width: this.width, height: this.height, viewBox: "0 0 16 16", fill: "none" }, C("path", { key: "1a04560040321d73a460eeffc0c3174d8853337a", d: "M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z", fill: "currentColor" }));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
i.style = s;
|
|
13
|
+
export {
|
|
14
|
+
i as globe_icon
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-29d0e781.cjs");require("react");require("react-dom");const i=".sc-globe-icon-h{display:flex}",o=i,C=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"81b372fb35acad3083b0c55e6008506a67ed1c2d",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},e.h("path",{key:"1a04560040321d73a460eeffc0c3174d8853337a",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};C.style=o;exports.globe_icon=C;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";var un=Object.defineProperty;var fn=(e,t,s)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ve=(e,t,s)=>(fn(e,typeof t!="symbol"?t+"":t,s),s);const N=require("react");require("react-dom");function dn(){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 s=function(){try{var r=new URL("b","http://a");return r.pathname="c%20d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}};(typeof Object.assign!="function"||!Object.entries||!Array.prototype.find||!Array.prototype.includes||!String.prototype.startsWith||!String.prototype.endsWith||t.NodeList&&!t.NodeList.prototype.forEach||!t.fetch||!s()||typeof WeakMap>"u")&&e.push(Promise.resolve().then(()=>require("./core-js-38e53e34.cjs")))}return Promise.all(e)}const hn="nylas-web-elements";let se,Pe,L=!1,Ee=null,Se=!1;const F=(e,t="")=>()=>{},pn=(e,t)=>()=>{},$n="{visibility:hidden}.hydrated{visibility:inherit}",ht="slot-fb{display:contents}slot-fb[hidden]{display:none}",tt={},yn="http://www.w3.org/2000/svg",gn="http://www.w3.org/1999/xhtml",vn=e=>e!=null,Te=e=>(e=typeof e,e==="object"||e==="function");function pt(e){var t,s,r;return(r=(s=(t=e.head)===null||t===void 0?void 0:t.querySelector('meta[name="csp-nonce"]'))===null||s===void 0?void 0:s.getAttribute("content"))!==null&&r!==void 0?r:void 0}const _e=(e,t,...s)=>{let r=null,o=null,l=!1,a=!1;const u=[],c=p=>{for(let h=0;h<p.length;h++)r=p[h],Array.isArray(r)?c(r):r!=null&&typeof r!="boolean"&&((l=typeof e!="function"&&!Te(r))&&(r=String(r)),l&&a?u[u.length-1].$text$+=r:u.push(l?oe(null,r):r),a=l)};if(c(s),t){t.key&&(o=t.key);{const p=t.className||t.class;p&&(t.class=typeof p!="object"?p:Object.keys(p).filter(h=>p[h]).join(" "))}}if(typeof e=="function")return e(t===null?{}:t,u,bn);const d=oe(e,null);return d.$attrs$=t,u.length>0&&(d.$children$=u),d.$key$=o,d},oe=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s},$t={},mn=e=>e&&e.$tag$===$t,bn={forEach:(e,t)=>e.map(nt).forEach(t),map:(e,t)=>e.map(nt).map(t).map(En)},nt=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),En=e=>{if(typeof e.vtag=="function"){const s=Object.assign({},e.vattrs);return e.vkey&&(s.key=e.vkey),e.vname&&(s.name=e.vname),_e(e.vtag,s,...e.vchildren||[])}const t=oe(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},Sn=(e,t)=>e!=null&&!Te(e)?t&4?e==="false"?!1:e===""||!!e:t&2?parseFloat(e):t&1?String(e):e:e,yt=e=>q(e).$hostElement$,wn=(e,t,s)=>{const r=yt(e);return{emit:o=>gt(r,t,{bubbles:!!(s&4),composed:!!(s&2),cancelable:!!(s&1),detail:o})}},gt=(e,t,s)=>{const r=x.ce(t,s);return e.dispatchEvent(r),r},rt=new WeakMap,Cn=(e,t,s)=>{let r=ie.get(e);Vn&&s?(r=r||new CSSStyleSheet,typeof r=="string"?r=t:r.replaceSync(t)):r=t,ie.set(e,r)},kn=(e,t,s)=>{var r;const o=vt(t),l=ie.get(o);if(e=e.nodeType===11?e:A,l)if(typeof l=="string"){e=e.head||e;let a=rt.get(e),u;if(a||rt.set(e,a=new Set),!a.has(o)){{u=A.createElement("style"),u.innerHTML=l;const c=(r=x.$nonce$)!==null&&r!==void 0?r:pt(A);c!=null&&u.setAttribute("nonce",c),e.insertBefore(u,e.querySelector("link"))}t.$flags$&4&&(u.innerHTML+=ht),a&&a.add(o)}}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return o},Pn=e=>{const t=e.$cmpMeta$,s=e.$hostElement$,r=t.$flags$,o=F("attachStyles",t.$tagName$),l=kn(s.shadowRoot?s.shadowRoot:s.getRootNode(),t);r&10&&(s["s-sc"]=l,s.classList.add(l+"-h"),r&2&&s.classList.add(l+"-s")),o()},vt=(e,t)=>"sc-"+e.$tagName$,st=(e,t,s,r,o,l)=>{if(s!==r){let a=lt(e,t),u=t.toLowerCase();if(t==="class"){const c=e.classList,d=ot(s),p=ot(r);c.remove(...d.filter(h=>h&&!p.includes(h))),c.add(...p.filter(h=>h&&!d.includes(h)))}else if(t==="style"){for(const c in s)(!r||r[c]==null)&&(c.includes("-")?e.style.removeProperty(c):e.style[c]="");for(const c in r)(!s||r[c]!==s[c])&&(c.includes("-")?e.style.setProperty(c,r[c]):e.style[c]=r[c])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!a&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):lt(Q,u)?t=u.slice(2):t=u[2]+t.slice(3),s||r){const c=t.endsWith(mt);t=t.replace(_n,""),s&&x.rel(e,t,s,c),r&&x.ael(e,t,r,c)}}else{const c=Te(r);if((a||c&&r!==null)&&!o)try{if(e.tagName.includes("-"))e[t]=r;else{const d=r??"";t==="list"?a=!1:(s==null||e[t]!=d)&&(e[t]=d)}}catch{}r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&e.removeAttribute(t):(!a||l&4||o)&&!c&&(r=r===!0?"":r,e.setAttribute(t,r))}}},Tn=/\s/,ot=e=>e?e.split(Tn):[],mt="Capture",_n=new RegExp(mt+"$"),bt=(e,t,s,r)=>{const o=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,l=e&&e.$attrs$||tt,a=t.$attrs$||tt;for(r in l)r in a||st(o,r,l[r],void 0,s,t.$flags$);for(r in a)st(o,r,l[r],a[r],s,t.$flags$)},ae=(e,t,s,r)=>{const o=t.$children$[s];let l=0,a,u;if(o.$text$!==null)a=o.$elm$=A.createTextNode(o.$text$);else{if(L||(L=o.$tag$==="svg"),a=o.$elm$=A.createElementNS(L?yn:gn,o.$tag$),L&&o.$tag$==="foreignObject"&&(L=!1),bt(null,o,L),vn(se)&&a["s-si"]!==se&&a.classList.add(a["s-si"]=se),o.$children$)for(l=0;l<o.$children$.length;++l)u=ae(e,o,l),u&&a.appendChild(u);o.$tag$==="svg"?L=!1:a.tagName==="foreignObject"&&(L=!0)}return a["s-hn"]=Pe,a},Et=(e,t,s,r,o,l)=>{let a=e,u;for(a.shadowRoot&&a.tagName===Pe&&(a=a.shadowRoot);o<=l;++o)r[o]&&(u=ae(null,s,o),u&&(r[o].$elm$=u,a.insertBefore(u,t)))},St=(e,t,s)=>{for(let r=t;r<=s;++r){const o=e[r];if(o){const l=o.$elm$;wt(o),l&&l.remove()}}},Rn=(e,t,s,r,o=!1)=>{let l=0,a=0,u=0,c=0,d=t.length-1,p=t[0],h=t[d],S=r.length-1,b=r[0],k=r[S],P,T;for(;l<=d&&a<=S;)if(p==null)p=t[++l];else if(h==null)h=t[--d];else if(b==null)b=r[++a];else if(k==null)k=r[--S];else if(re(p,b,o))z(p,b,o),p=t[++l],b=r[++a];else if(re(h,k,o))z(h,k,o),h=t[--d],k=r[--S];else if(re(p,k,o))z(p,k,o),e.insertBefore(p.$elm$,h.$elm$.nextSibling),p=t[++l],k=r[--S];else if(re(h,b,o))z(h,b,o),e.insertBefore(h.$elm$,p.$elm$),h=t[--d],b=r[++a];else{for(u=-1,c=l;c<=d;++c)if(t[c]&&t[c].$key$!==null&&t[c].$key$===b.$key$){u=c;break}u>=0?(T=t[u],T.$tag$!==b.$tag$?P=ae(t&&t[a],s,u):(z(T,b,o),t[u]=void 0,P=T.$elm$),b=r[++a]):(P=ae(t&&t[a],s,a),b=r[++a]),P&&p.$elm$.parentNode.insertBefore(P,p.$elm$)}l>d?Et(e,r[S+1]==null?null:r[S+1].$elm$,s,r,a,S):a>S&&St(t,l,d)},re=(e,t,s=!1)=>e.$tag$===t.$tag$?s?!0:e.$key$===t.$key$:!1,z=(e,t,s=!1)=>{const r=t.$elm$=e.$elm$,o=e.$children$,l=t.$children$,a=t.$tag$,u=t.$text$;u===null?(L=a==="svg"?!0:a==="foreignObject"?!1:L,a==="slot"||bt(e,t,L),o!==null&&l!==null?Rn(r,o,t,l,s):l!==null?(e.$text$!==null&&(r.textContent=""),Et(r,null,t,l,0,l.length-1)):o!==null&&St(o,0,o.length-1),L&&a==="svg"&&(L=!1)):e.$text$!==u&&(r.data=u)},wt=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(wt)},In=(e,t,s=!1)=>{const r=e.$hostElement$,o=e.$vnode$||oe(null,null),l=mn(t)?t:_e(null,null,t);if(Pe=r.tagName,s&&l.$attrs$)for(const a of Object.keys(l.$attrs$))r.hasAttribute(a)&&!["key","ref","style","class"].includes(a)&&(l.$attrs$[a]=r[a]);l.$tag$=null,l.$flags$|=4,e.$vnode$=l,l.$elm$=o.$elm$=r.shadowRoot||r,se=r["s-sc"],z(o,l,s)},Ct=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(s=>e.$onRenderResolve$=s))},le=(e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return Ct(e,e.$ancestorComponent$),tr(()=>xn(e,t))},xn=(e,t)=>{const s=F("scheduleUpdate",e.$cmpMeta$.$tagName$),r=e.$lazyInstance$;let o;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map(([l,a])=>Y(r,l,a)),e.$queuedListeners$=void 0),o=Y(r,"componentWillLoad")),o=at(o,()=>Y(r,"componentWillRender")),s(),at(o,()=>Ln(e,r,t))},at=(e,t)=>On(e)?e.then(t):t(),On=e=>e instanceof Promise||e&&e.then&&typeof e.then=="function",Ln=async(e,t,s)=>{var r;const o=e.$hostElement$,l=F("update",e.$cmpMeta$.$tagName$),a=o["s-rc"];s&&Pn(e);const u=F("render",e.$cmpMeta$.$tagName$);jn(e,t,o,s),a&&(a.map(c=>c()),o["s-rc"]=void 0),u(),l();{const c=(r=o["s-p"])!==null&&r!==void 0?r:[],d=()=>Nn(e);c.length===0?d():(Promise.all(c).then(d),e.$flags$|=4,c.length=0)}},jn=(e,t,s,r)=>{try{Ee=t,t=t.render(),e.$flags$&=-17,e.$flags$|=2,In(e,t,r)}catch(o){m(o,e.$hostElement$)}return Ee=null,null},An=()=>Ee,Nn=e=>{const t=e.$cmpMeta$.$tagName$,s=e.$hostElement$,r=F("postUpdate",t),o=e.$lazyInstance$,l=e.$ancestorComponent$;e.$flags$&64?r():(e.$flags$|=64,Pt(s),Y(o,"componentDidLoad"),r(),e.$onReadyResolve$(s),l||kt()),e.$onInstanceResolve$(s),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&Ie(()=>le(e,!1)),e.$flags$&=-517},Dn=e=>{{const t=q(e),s=t.$hostElement$.isConnected;return s&&(t.$flags$&18)===2&&le(t,!1),s}},kt=e=>{Pt(A.documentElement),Ie(()=>gt(Q,"appload",{detail:{namespace:hn}}))},Y=(e,t,s)=>{if(e&&e[t])try{return e[t](s)}catch(r){m(r)}},Pt=e=>e.classList.add("hydrated"),Mn=(e,t)=>q(e).$instanceValues$.get(t),Fn=(e,t,s,r)=>{const o=q(e),l=o.$hostElement$,a=o.$instanceValues$.get(t),u=o.$flags$,c=o.$lazyInstance$;s=Sn(s,r.$members$[t][0]);const d=Number.isNaN(a)&&Number.isNaN(s),p=s!==a&&!d;if((!(u&8)||a===void 0)&&p&&(o.$instanceValues$.set(t,s),c)){if(r.$watchers$&&u&128){const h=r.$watchers$[t];h&&h.map(S=>{try{c[S](s,a,t)}catch(b){m(b,l)}})}(u&18)===2&&le(o,!1)}},Tt=(e,t,s)=>{var r;const o=e.prototype;if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const l=Object.entries(t.$members$);if(l.map(([a,[u]])=>{u&31||s&2&&u&32?Object.defineProperty(o,a,{get(){return Mn(this,a)},set(c){Fn(this,a,c,t)},configurable:!0,enumerable:!0}):s&1&&u&64&&Object.defineProperty(o,a,{value(...c){var d;const p=q(this);return(d=p==null?void 0:p.$onInstancePromise$)===null||d===void 0?void 0:d.then(()=>{var h;return(h=p.$lazyInstance$)===null||h===void 0?void 0:h[a](...c)})}})}),s&1){const a=new Map;o.attributeChangedCallback=function(u,c,d){x.jmp(()=>{var p;const h=a.get(u);if(this.hasOwnProperty(h))d=this[h],delete this[h];else{if(o.hasOwnProperty(h)&&typeof this[h]=="number"&&this[h]==d)return;if(h==null){const S=q(this),b=S==null?void 0:S.$flags$;if(b&&!(b&8)&&b&128&&d!==c){const k=S.$lazyInstance$,P=(p=t.$watchers$)===null||p===void 0?void 0:p[u];P==null||P.forEach(T=>{k[T]!=null&&k[T].call(k,d,c,u)})}return}}this[h]=d===null&&typeof this[h]=="boolean"?!1:d})},e.observedAttributes=Array.from(new Set([...Object.keys((r=t.$watchers$)!==null&&r!==void 0?r:{}),...l.filter(([u,c])=>c[0]&15).map(([u,c])=>{const d=c[1]||u;return a.set(d,u),d})]))}}return e},qn=async(e,t,s,r)=>{let o;if(!(t.$flags$&32)){t.$flags$|=32;{if(o=Kn(s),o.then){const c=pn();o=await o,c()}o.isProxied||(s.$watchers$=o.watchers,Tt(o,s,2),o.isProxied=!0);const u=F("createInstance",s.$tagName$);t.$flags$|=8;try{new o(t)}catch(c){m(c)}t.$flags$&=-9,t.$flags$|=128,u(),we(t.$lazyInstance$)}if(o.style){let u=o.style;const c=vt(s);if(!ie.has(c)){const d=F("registerStyles",s.$tagName$);Cn(c,u,!!(s.$flags$&1)),d()}}}const l=t.$ancestorComponent$,a=()=>le(t,!0);l&&l["s-rc"]?l["s-rc"].push(a):a()},we=e=>{Y(e,"connectedCallback")},Un=e=>{if(!(x.$flags$&1)){const t=q(e),s=t.$cmpMeta$,r=F("connectedCallback",s.$tagName$);if(t.$flags$&1)_t(e,t,s.$listeners$),t!=null&&t.$lazyInstance$?we(t.$lazyInstance$):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>we(t.$lazyInstance$));else{t.$flags$|=1;{let o=e;for(;o=o.parentNode||o.host;)if(o["s-p"]){Ct(t,t.$ancestorComponent$=o);break}}s.$members$&&Object.entries(s.$members$).map(([o,[l]])=>{if(l&31&&e.hasOwnProperty(o)){const a=e[o];delete e[o],e[o]=a}}),qn(e,t,s)}r()}},it=e=>{Y(e,"disconnectedCallback")},Hn=async e=>{if(!(x.$flags$&1)){const t=q(e);t.$rmListeners$&&(t.$rmListeners$.map(s=>s()),t.$rmListeners$=void 0),t!=null&&t.$lazyInstance$?it(t.$lazyInstance$):t!=null&&t.$onReadyPromise$&&t.$onReadyPromise$.then(()=>it(t.$lazyInstance$))}},Wn=(e,t={})=>{var s;const r=F(),o=[],l=t.exclude||[],a=Q.customElements,u=A.head,c=u.querySelector("meta[charset]"),d=A.createElement("style"),p=[];let h,S=!0;Object.assign(x,t),x.$resourcesUrl$=new URL(t.resourcesUrl||"./",A.baseURI).href;let b=!1;if(e.map(k=>{k[1].map(P=>{var T;const R={$flags$:P[0],$tagName$:P[1],$members$:P[2],$listeners$:P[3]};R.$flags$&4&&(b=!0),R.$members$=P[2],R.$listeners$=P[3],R.$watchers$=(T=P[4])!==null&&T!==void 0?T:{};const C=R.$tagName$,ce=class extends HTMLElement{constructor(H){super(H),H=this,Xn(H,R),R.$flags$&1&&H.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),S?p.push(this):x.jmp(()=>Un(this))}disconnectedCallback(){x.jmp(()=>Hn(this))}componentOnReady(){return q(this).$onReadyPromise$}};R.$lazyBundleId$=k[0],!l.includes(C)&&!a.get(C)&&(o.push(C),a.define(C,Tt(ce,R,1)))})}),b&&(d.innerHTML+=ht),d.innerHTML+=o+$n,d.innerHTML.length){d.setAttribute("data-styles","");const k=(s=x.$nonce$)!==null&&s!==void 0?s:pt(A);k!=null&&d.setAttribute("nonce",k),u.insertBefore(d,c?c.nextSibling:u.firstChild)}S=!1,p.length?p.map(k=>k.connectedCallback()):x.jmp(()=>h=setTimeout(kt,30)),r()},Bn=(e,t)=>t,_t=(e,t,s,r)=>{s&&s.map(([o,l,a])=>{const u=Yn(e,o),c=zn(t,a),d=Gn(o);x.ael(u,l,c,d),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>x.rel(u,l,c,d))})},zn=(e,t)=>s=>{try{e.$flags$&256?e.$lazyInstance$[t](s):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,s])}catch(r){m(r)}},Yn=(e,t)=>t&8?Q:t&16?A.body:e,Gn=e=>Qn?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0,Re=new WeakMap,q=e=>Re.get(e),Jn=(e,t)=>Re.set(t.$lazyInstance$=e,t),Xn=(e,t)=>{const s={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return s.$onInstancePromise$=new Promise(r=>s.$onInstanceResolve$=r),s.$onReadyPromise$=new Promise(r=>s.$onReadyResolve$=r),e["s-p"]=[],e["s-rc"]=[],_t(e,s,t.$listeners$),Re.set(e,s)},lt=(e,t)=>t in e,m=(e,t)=>(0,console.error)(e,t),me=new Map,Kn=(e,t,s)=>{const r=e.$tagName$.replace(/-/g,"_"),o=e.$lazyBundleId$,l=me.get(o);if(l)return l[r];if(!s||!BUILD.hotModuleReplacement){const a=u=>(me.set(o,u),u[r]);switch(o){case"nylas-if-state_3":return Promise.resolve().then(()=>require("./nylas-if-state_3.entry-e8c831b7.cjs")).then(a,m);case"document-refresh-icon":return Promise.resolve().then(()=>require("./document-refresh-icon.entry-ca2ef29e.cjs")).then(a,m);case"nylas-list-folders":return Promise.resolve().then(()=>require("./nylas-list-folders.entry-de8cca60.cjs")).then(a,m);case"nylas-list-threads":return Promise.resolve().then(()=>require("./nylas-list-threads.entry-93b70a1a.cjs")).then(a,m);case"nylas-mailbox-pagination":return Promise.resolve().then(()=>require("./nylas-mailbox-pagination.entry-6bb0ee37.cjs")).then(a,m);case"nylas-mailbox-toolbar-button":return Promise.resolve().then(()=>require("./nylas-mailbox-toolbar-button.entry-d4ad5c15.cjs")).then(a,m);case"nylas-open-hours-picker":return Promise.resolve().then(()=>require("./nylas-open-hours-picker.entry-2c19643f.cjs")).then(a,m);case"nylas-provider":return Promise.resolve().then(()=>require("./nylas-provider.entry-87fa9276.cjs")).then(a,m);case"nylas-scheduler":return Promise.resolve().then(()=>require("./nylas-scheduler.entry-b41cbf99.cjs")).then(a,m);case"nylas-threads-refresh":return Promise.resolve().then(()=>require("./nylas-threads-refresh.entry-6d61a689.cjs")).then(a,m);case"nylas-threads-search":return Promise.resolve().then(()=>require("./nylas-threads-search.entry-03073490.cjs")).then(a,m);case"nylas-view-thread":return Promise.resolve().then(()=>require("./nylas-view-thread.entry-4ecbcd78.cjs")).then(a,m);case"archive-icon_7":return Promise.resolve().then(()=>require("./archive-icon_7.entry-8c90815a.cjs")).then(a,m);case"arrow-icon":return Promise.resolve().then(()=>require("./arrow-icon.entry-a2f53919.cjs")).then(a,m);case"forward-icon_6":return Promise.resolve().then(()=>require("./forward-icon_6.entry-725d1be4.cjs")).then(a,m);case"nylas-booked-event-card_9":return Promise.resolve().then(()=>require("./nylas-booked-event-card_9.entry-ea02f083.cjs")).then(a,m);case"bold-icon_3":return Promise.resolve().then(()=>require("./bold-icon_3.entry-e0bc6774.cjs")).then(a,m);case"calendar-cancel-icon":return Promise.resolve().then(()=>require("./calendar-cancel-icon.entry-546b7bd4.cjs")).then(a,m);case"calendar-check-icon_3":return Promise.resolve().then(()=>require("./calendar-check-icon_3.entry-f5846fee.cjs")).then(a,m);case"calendar-icon":return Promise.resolve().then(()=>require("./calendar-icon.entry-25474b1e.cjs")).then(a,m);case"close-icon_2":return Promise.resolve().then(()=>require("./close-icon_2.entry-aa015993.cjs")).then(a,m);case"play-icon_2":return Promise.resolve().then(()=>require("./play-icon_2.entry-cf1cbc8d.cjs")).then(a,m);case"refresh-icon":return Promise.resolve().then(()=>require("./refresh-icon.entry-9f24e833.cjs")).then(a,m);case"translate-icon":return Promise.resolve().then(()=>require("./translate-icon.entry-0cd24de4.cjs")).then(a,m);case"chevron-icon":return Promise.resolve().then(()=>require("./chevron-icon.entry-97e4621e.cjs")).then(a,m);case"globe-icon":return Promise.resolve().then(()=>require("./globe-icon.entry-918cfd35.cjs")).then(a,m);case"loading-icon":return Promise.resolve().then(()=>require("./loading-icon.entry-b2534e3e.cjs")).then(a,m)}}return import(`./${o}.entry.js`).then(a=>(me.set(o,a),a[r]),m)},ie=new Map,Q=typeof window<"u"?window:{},A=Q.document||{head:{}},x={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,r)=>e.addEventListener(t,s,r),rel:(e,t,s,r)=>e.removeEventListener(t,s,r),ce:(e,t)=>new CustomEvent(e,t)},Qn=(()=>{let e=!1;try{A.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch{}return e})(),Zn=e=>Promise.resolve(e),Vn=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),ct=[],Rt=[],er=(e,t)=>s=>{e.push(s),Se||(Se=!0,t&&x.$flags$&4?Ie(Ce):x.raf(Ce))},ut=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(s){m(s)}e.length=0},Ce=()=>{ut(ct),ut(Rt),(Se=ct.length>0)&&x.raf(Ce)},Ie=e=>Zn().then(e),tr=er(Rt,!0);async function nr(){await Promise.resolve().then(()=>require("./elements-60ebdb01-24595598.cjs"))}const rr=nr,sr=(e,t)=>{if(!(typeof window>"u"))return rr(),Wn([["nylas-scheduler",[[1,"nylas-scheduler",{mode:[1],defaultSchedulerStoreState:[16],sessionId:[1,"session-id"],schedulerApiUrl:[1,"scheduler-api-url"],bookingInfo:[16],rescheduleId:[1,"reschedule-id"],eventOverrides:[16],loadingState:[16],themeConfig:[16],automaticComponentRegistration:[32],selectedDateLabel:[32],getNylasSchedulerStore:[64],getNylasSchedulerConnector:[64],getRef:[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"],[0,"monthChanged","monthChangedHandler"],[0,"detailsConfirmed","bookButtonClickedHandler"],[0,"cancelButtonClicked","cancelButtonClickedHandler"],[0,"dateSelected","selectedDateChanged"]],{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-mailbox-pagination",[[1,"nylas-mailbox-pagination",{state:[1],hasNextPage:[4,"has-next-page"],hasPreviousPage:[4,"has-previous-page"],scrollTarget:[1,"scroll-target"],mobileOnlyInfiniteScroll:[4,"mobile-only-infinite-scroll"],mobileViewPortWidth:[2,"mobile-view-port-width"],nextPage:[64],previousPage:[64]},[[9,"scroll","handlePageScroll"]]]]],["nylas-threads-refresh",[[1,"nylas-threads-refresh",{start:[32],state:[32],pulling:[32],updateState:[64]}]]],["nylas-if-state_3",[[1,"nylas-if-state",{state:[1],isStateSet:[4,"is-state-set"],isBoolean:[4,"is-boolean"],getStore:[16],transition:[1],show:[32],classes:[32]},null,{getStore:["onGetStoreChange"]}],[1,"nylas-login",{isAuthenticated:[4,"is-authenticated"],nylasConnector:[16],scopes:[16],loginMethod:[1,"login-method"],companyName:[1,"company-name"],logoUrl:[1,"logo-url"],logoWidth:[1,"logo-width"],providers:[1],buttonText:[1,"button-text"],email:[32]}],[1,"nylas-mailbox",{automaticComponentRegistration:[4,"automatic-component-registration"],eventOverrides:[16],authConfig:[16],defaultAuthStoreState:[16],defaultMailboxStoreState:[16],getMailboxStore:[64],getAuthStore:[64],getNylasAuth:[64],getNylasMailboxConnector:[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"]]]]],["document-refresh-icon",[[2,"document-refresh-icon",{width:[1],height:[1]}]]],["nylas-list-threads",[[1,"nylas-list-threads",{threads:[16],isAuthenticated:[4,"is-authenticated"],tokenInfo:[16],state:[1],showCheckbox:[4,"show-checkbox"]}]]],["nylas-mailbox-toolbar-button",[[1,"nylas-mailbox-toolbar-button",{method:[1],dataState:[1,"data-state"],iconOnly:[4,"icon-only"],mailboxConnector:[16]}]]],["nylas-open-hours-picker",[[1,"nylas-open-hours-picker",{openHours:[16],startTime:[1040],endTime:[1040],stepMinutes:[2,"step-minutes"],dragThreshold:[2,"drag-threshold"],mobileViewPortWidth:[2,"mobile-view-port-width"],intervalMinutes:[32],times:[32],availableTimes:[32],draggingStartDate:[32],draggingEndDate:[32],inverse:[32],isMobile:[32]},[[9,"resize","onResize"]],{openHours:["whenOpenHoursChanged"],availableTimes:["availableTimesChanged"],inverse:["inverseChanged"]}]]],["nylas-provider",[[1,"nylas-provider",{authConfig:[16],eventOverrides:[16],automaticComponentRegistration:[4,"automatic-component-registration"],getNylasAuth:[64],getNylasConnector:[64],getMailboxStore:[64],getAuthStore:[64],getNylasSchedulerStore:[64]},[[0,"registerComponent","registerComponentHandler"],[0,"unregisterComponent","unregisterComponentHandler"]]]]],["nylas-threads-search",[[1,"nylas-threads-search",{query:[1],internalQuery:[32]},null,{query:["onQueryChange"]}]]],["arrow-icon",[[2,"arrow-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]}]]],["refresh-icon",[[2,"refresh-icon",{width:[1],height:[1]}]]],["translate-icon",[[2,"translate-icon",{width:[1],height:[1]}]]],["close-icon_2",[[2,"close-icon",{width:[1],height:[1]}],[2,"warning-icon",{width:[1],height:[1]}]]],["play-icon_2",[[2,"play-icon",{width:[1],height:[1]}],[2,"stop-icon",{width:[1],height:[1]}]]],["chevron-icon",[[2,"chevron-icon",{width:[1],height:[1]}]]],["globe-icon",[[2,"globe-icon",{width:[1],height:[1]}]]],["loading-icon",[[1,"loading-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]}]]],["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]}]]],["calendar-check-icon_3",[[2,"calendar-check-icon",{width:[1],height:[1]}],[2,"checkmark-circle-icon",{width:[1],height:[1]}],[2,"people-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]}]]],["nylas-booked-event-card_9",[[1,"nylas-booked-event-card",{eventInfo:[16],bookingFlow:[1,"booking-flow"],bookingInfo:[8,"booking-info"]}],[1,"nylas-locale-switch",{selectedTimezone:[1025,"selected-timezone"],selectedLanguage:[1025,"selected-language"]}],[1,"nylas-notification",{ttl:[2],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",{bookedEventLoading:[4,"booked-event-loading"],bookedEventError:[8,"booked-event-error"],bookingInfo:[8,"booking-info"],eventInfo:[16],name:[32],email:[32],guestEmails:[32],isNameValid:[32],isEmailValid:[32]},null,{bookingInfo:["bookingInfoChangedHandler"]}],[1,"nylas-cancelled-event-card",{cancelledEvent:[16]}],[1,"nylas-date-picker",{selectableDates:[16],selectedDate:[16],loadingState:[8,"loading-state"],month:[32],dates:[32]}],[2,"nylas-logo",{width:[1],height:[1]}],[1,"nylas-timeslot-picker",{selectedDate:[16],availability:[16],selectedTimeslot:[16],loadingState:[16],selectedTimezone:[1,"selected-timezone"],times:[32],hoveredTimeslotIndex:[32],selectedTimeslotIndex:[32]},null,{selectedDate:["selectedDateChanged"],availability:["availabilityChanged"]}]]]],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 ke={exports:{}},X={};/**
|
|
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 ft;function or(){if(ft)return X;ft=1;var e=N,t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function a(u,c,d){var p,h={},S=null,b=null;d!==void 0&&(S=""+d),c.key!==void 0&&(S=""+c.key),c.ref!==void 0&&(b=c.ref);for(p in c)r.call(c,p)&&!l.hasOwnProperty(p)&&(h[p]=c[p]);if(u&&u.defaultProps)for(p in c=u.defaultProps,c)h[p]===void 0&&(h[p]=c[p]);return{$$typeof:t,type:u,key:S,ref:b,props:h,_owner:o.current}}return X.Fragment=s,X.jsx=a,X.jsxs=a,X}var K={};/**
|
|
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 dt;function ar(){return dt||(dt=1,process.env.NODE_ENV!=="production"&&function(){var e=N,t=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),k=Symbol.iterator,P="@@iterator";function T(n){if(n===null||typeof n!="object")return null;var i=k&&n[k]||n[P];return typeof i=="function"?i:null}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(n){{for(var i=arguments.length,f=new Array(i>1?i-1:0),y=1;y<i;y++)f[y-1]=arguments[y];ce("error",n,f)}}function ce(n,i,f){{var y=R.ReactDebugCurrentFrame,E=y.getStackAddendum();E!==""&&(i+="%s",f=f.concat([E]));var w=f.map(function(v){return String(v)});w.unshift("Warning: "+i),Function.prototype.apply.call(console[n],console,w)}}var H=!1,Ot=!1,Lt=!1,jt=!1,At=!1,xe;xe=Symbol.for("react.module.reference");function Nt(n){return!!(typeof n=="string"||typeof n=="function"||n===r||n===l||At||n===o||n===d||n===p||jt||n===b||H||Ot||Lt||typeof n=="object"&&n!==null&&(n.$$typeof===S||n.$$typeof===h||n.$$typeof===a||n.$$typeof===u||n.$$typeof===c||n.$$typeof===xe||n.getModuleId!==void 0))}function Dt(n,i,f){var y=n.displayName;if(y)return y;var E=i.displayName||i.name||"";return E!==""?f+"("+E+")":f}function Oe(n){return n.displayName||"Context"}function D(n){if(n==null)return null;if(typeof n.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case r:return"Fragment";case s:return"Portal";case l:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case p:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case u:var i=n;return Oe(i)+".Consumer";case a:var f=n;return Oe(f._context)+".Provider";case c:return Dt(n,n.render,"ForwardRef");case h:var y=n.displayName||null;return y!==null?y:D(n.type)||"Memo";case S:{var E=n,w=E._payload,v=E._init;try{return D(v(w))}catch{return null}}}return null}var U=Object.assign,G=0,Le,je,Ae,Ne,De,Me,Fe;function qe(){}qe.__reactDisabledLog=!0;function Mt(){{if(G===0){Le=console.log,je=console.info,Ae=console.warn,Ne=console.error,De=console.group,Me=console.groupCollapsed,Fe=console.groupEnd;var n={configurable:!0,enumerable:!0,value:qe,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}G++}}function Ft(){{if(G--,G===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},n,{value:Le}),info:U({},n,{value:je}),warn:U({},n,{value:Ae}),error:U({},n,{value:Ne}),group:U({},n,{value:De}),groupCollapsed:U({},n,{value:Me}),groupEnd:U({},n,{value:Fe})})}G<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=R.ReactCurrentDispatcher,fe;function Z(n,i,f){{if(fe===void 0)try{throw Error()}catch(E){var y=E.stack.trim().match(/\n( *(at )?)/);fe=y&&y[1]||""}return`
|
|
18
|
+
`+fe+n}}var de=!1,V;{var qt=typeof WeakMap=="function"?WeakMap:Map;V=new qt}function Ue(n,i){if(!n||de)return"";{var f=V.get(n);if(f!==void 0)return f}var y;de=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var w;w=ue.current,ue.current=null,Mt();try{if(i){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(M){y=M}Reflect.construct(n,[],v)}else{try{v.call()}catch(M){y=M}n.call(v.prototype)}}else{try{throw Error()}catch(M){y=M}n()}}catch(M){if(M&&y&&typeof M.stack=="string"){for(var g=M.stack.split(`
|
|
19
|
+
`),O=y.stack.split(`
|
|
20
|
+
`),_=g.length-1,I=O.length-1;_>=1&&I>=0&&g[_]!==O[I];)I--;for(;_>=1&&I>=0;_--,I--)if(g[_]!==O[I]){if(_!==1||I!==1)do if(_--,I--,I<0||g[_]!==O[I]){var j=`
|
|
21
|
+
`+g[_].replace(" at new "," at ");return n.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",n.displayName)),typeof n=="function"&&V.set(n,j),j}while(_>=1&&I>=0);break}}}finally{de=!1,ue.current=w,Ft(),Error.prepareStackTrace=E}var B=n?n.displayName||n.name:"",et=B?Z(B):"";return typeof n=="function"&&V.set(n,et),et}function Ut(n,i,f){return Ue(n,!1)}function Ht(n){var i=n.prototype;return!!(i&&i.isReactComponent)}function ee(n,i,f){if(n==null)return"";if(typeof n=="function")return Ue(n,Ht(n));if(typeof n=="string")return Z(n);switch(n){case d:return Z("Suspense");case p:return Z("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case c:return Ut(n.render);case h:return ee(n.type,i,f);case S:{var y=n,E=y._payload,w=y._init;try{return ee(w(E),i,f)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,He={},We=R.ReactDebugCurrentFrame;function ne(n){if(n){var i=n._owner,f=ee(n.type,n._source,i?i.type:null);We.setExtraStackFrame(f)}else We.setExtraStackFrame(null)}function Wt(n,i,f,y,E){{var w=Function.call.bind(te);for(var v in n)if(w(n,v)){var g=void 0;try{if(typeof n[v]!="function"){var O=Error((y||"React class")+": "+f+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}g=n[v](i,v,y,f,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){g=_}g&&!(g instanceof Error)&&(ne(E),C("%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).",y||"React class",f,v,typeof g),ne(null)),g instanceof Error&&!(g.message in He)&&(He[g.message]=!0,ne(E),C("Failed %s type: %s",f,g.message),ne(null))}}}var Bt=Array.isArray;function he(n){return Bt(n)}function zt(n){{var i=typeof Symbol=="function"&&Symbol.toStringTag,f=i&&n[Symbol.toStringTag]||n.constructor.name||"Object";return f}}function Yt(n){try{return Be(n),!1}catch{return!0}}function Be(n){return""+n}function ze(n){if(Yt(n))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",zt(n)),Be(n)}var J=R.ReactCurrentOwner,Gt={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ge,pe;pe={};function Jt(n){if(te.call(n,"ref")){var i=Object.getOwnPropertyDescriptor(n,"ref").get;if(i&&i.isReactWarning)return!1}return n.ref!==void 0}function Xt(n){if(te.call(n,"key")){var i=Object.getOwnPropertyDescriptor(n,"key").get;if(i&&i.isReactWarning)return!1}return n.key!==void 0}function Kt(n,i){if(typeof n.ref=="string"&&J.current&&i&&J.current.stateNode!==i){var f=D(J.current.type);pe[f]||(C('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',D(J.current.type),n.ref),pe[f]=!0)}}function Qt(n,i){{var f=function(){Ye||(Ye=!0,C("%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)",i))};f.isReactWarning=!0,Object.defineProperty(n,"key",{get:f,configurable:!0})}}function Zt(n,i){{var f=function(){Ge||(Ge=!0,C("%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)",i))};f.isReactWarning=!0,Object.defineProperty(n,"ref",{get:f,configurable:!0})}}var Vt=function(n,i,f,y,E,w,v){var g={$$typeof:t,type:n,key:i,ref:f,props:v,_owner:w};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function en(n,i,f,y,E){{var w,v={},g=null,O=null;f!==void 0&&(ze(f),g=""+f),Xt(i)&&(ze(i.key),g=""+i.key),Jt(i)&&(O=i.ref,Kt(i,E));for(w in i)te.call(i,w)&&!Gt.hasOwnProperty(w)&&(v[w]=i[w]);if(n&&n.defaultProps){var _=n.defaultProps;for(w in _)v[w]===void 0&&(v[w]=_[w])}if(g||O){var I=typeof n=="function"?n.displayName||n.name||"Unknown":n;g&&Qt(v,I),O&&Zt(v,I)}return Vt(n,g,O,E,y,J.current,v)}}var $e=R.ReactCurrentOwner,Je=R.ReactDebugCurrentFrame;function W(n){if(n){var i=n._owner,f=ee(n.type,n._source,i?i.type:null);Je.setExtraStackFrame(f)}else Je.setExtraStackFrame(null)}var ye;ye=!1;function ge(n){return typeof n=="object"&&n!==null&&n.$$typeof===t}function Xe(){{if($e.current){var n=D($e.current.type);if(n)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+n+"`."}return""}}function tn(n){{if(n!==void 0){var i=n.fileName.replace(/^.*[\\\/]/,""),f=n.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+i+":"+f+"."}return""}}var Ke={};function nn(n){{var i=Xe();if(!i){var f=typeof n=="string"?n:n.displayName||n.name;f&&(i=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+f+">.")}return i}}function Qe(n,i){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var f=nn(i);if(Ke[f])return;Ke[f]=!0;var y="";n&&n._owner&&n._owner!==$e.current&&(y=" It was passed a child from "+D(n._owner.type)+"."),W(n),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',f,y),W(null)}}function Ze(n,i){{if(typeof n!="object")return;if(he(n))for(var f=0;f<n.length;f++){var y=n[f];ge(y)&&Qe(y,i)}else if(ge(n))n._store&&(n._store.validated=!0);else if(n){var E=T(n);if(typeof E=="function"&&E!==n.entries)for(var w=E.call(n),v;!(v=w.next()).done;)ge(v.value)&&Qe(v.value,i)}}}function rn(n){{var i=n.type;if(i==null||typeof i=="string")return;var f;if(typeof i=="function")f=i.propTypes;else if(typeof i=="object"&&(i.$$typeof===c||i.$$typeof===h))f=i.propTypes;else return;if(f){var y=D(i);Wt(f,n.props,"prop",y,n)}else if(i.PropTypes!==void 0&&!ye){ye=!0;var E=D(i);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof i.getDefaultProps=="function"&&!i.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sn(n){{for(var i=Object.keys(n.props),f=0;f<i.length;f++){var y=i[f];if(y!=="children"&&y!=="key"){W(n),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),W(null);break}}n.ref!==null&&(W(n),C("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Ve(n,i,f,y,E,w){{var v=Nt(n);if(!v){var g="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(g+=" 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 O=tn(E);O?g+=O:g+=Xe();var _;n===null?_="null":he(n)?_="array":n!==void 0&&n.$$typeof===t?(_="<"+(D(n.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):_=typeof n,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,g)}var I=en(n,i,f,E,w);if(I==null)return I;if(v){var j=i.children;if(j!==void 0)if(y)if(he(j)){for(var B=0;B<j.length;B++)Ze(j[B],n);Object.freeze&&Object.freeze(j)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ze(j,n)}return n===r?sn(I):rn(I),I}}function on(n,i,f){return Ve(n,i,f,!0)}function an(n,i,f){return Ve(n,i,f,!1)}var ln=an,cn=on;K.Fragment=r,K.jsx=ln,K.jsxs=cn}()),K}process.env.NODE_ENV==="production"?ke.exports=or():ke.exports=ar();var ir=ke.exports;const lr=e=>e.toLowerCase().split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(""),It=e=>e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`),cr=(e,t,s={})=>{if(e instanceof Element){const r=ur(e.classList,t,s);r!==""&&(e.className=r),Object.keys(t).forEach(o=>{if(!(o==="children"||o==="style"||o==="ref"||o==="class"||o==="className"||o==="forwardedRef"))if(o.indexOf("on")===0&&o[2]===o[2].toUpperCase()){const l=o.substring(2),a=l[0].toLowerCase()+l.substring(1);xt(a)||dr(e,a,t[o])}else e[o]=t[o],typeof t[o]==="string"&&e.setAttribute(It(o),t[o])})}},ur=(e,t,s)=>{const r=t.className||t.class,o=s.className||s.class,l=be(e),a=be(r?r.split(" "):[]),u=be(o?o.split(" "):[]),c=[];return l.forEach(d=>{a.has(d)?(c.push(d),a.delete(d)):u.has(d)||c.push(d)}),a.forEach(d=>c.push(d)),c.join(" ")},fr=e=>{switch(e){case"doubleclick":return"dblclick"}return e};/**
|
|
28
|
+
* Checks if an event is supported in the current execution environment.
|
|
29
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
30
|
+
*/const xt=e=>{if(typeof document>"u")return!0;{const t="on"+fr(e);let s=t in document;if(!s){const r=document.createElement("div");r.setAttribute(t,"return;"),s=typeof r[t]=="function"}return s}},dr=(e,t,s)=>{const r=e.__events||(e.__events={}),o=r[t];o&&e.removeEventListener(t,o),e.addEventListener(t,r[t]=function(a){s&&s.call(this,a)})},be=e=>{const t=new Map;return e.forEach(s=>t.set(s,s)),t},hr=(e,t)=>{typeof e=="function"?e(t):e!=null&&(e.current=t)},pr=(...e)=>t=>{e.forEach(s=>{hr(s,t)})},$r=(e,t)=>{const s=(r,o)=>ir.jsx(e,{...r,forwardedRef:o});return s.displayName=t,N.forwardRef(s)},$=(e,t,s,r)=>{r!==void 0&&r();const o=lr(e),l=class extends N.Component{constructor(u){super(u);ve(this,"componentEl");ve(this,"setComponentElRef",u=>{this.componentEl=u})}componentDidMount(){this.componentDidUpdate(this.props)}componentDidUpdate(u){cr(this.componentEl,this.props,u)}render(){const{children:u,forwardedRef:c,style:d,className:p,ref:h,...S}=this.props;let b=Object.keys(S).reduce((P,T)=>{const R=S[T];if(T.indexOf("on")===0&&T[2]===T[2].toUpperCase()){const C=T.substring(2).toLowerCase();typeof document<"u"&&xt(C)&&(P[T]=R)}else{const C=typeof R;(C==="string"||C==="boolean"||C==="number")&&(P[It(T)]=R)}return P},{});s&&(b=s(this.props,b));const k={...b,ref:pr(c,this.setComponentElRef),style:d};return N.createElement(e,k,u)}static get displayName(){return o}};return t&&(l.contextType=t),$r(l,o)},yr=$("archive-icon"),gr=$("arrow-icon"),vr=$("bold-icon"),mr=$("calendar-cancel-icon"),br=$("calendar-check-icon"),Er=$("calendar-icon"),Sr=$("checkmark-circle-icon"),wr=$("chevron-icon"),Cr=$("close-icon"),kr=$("document-refresh-icon"),Pr=$("folder-icon"),Tr=$("forward-icon"),_r=$("globe-icon"),Rr=$("inbox-icon"),Ir=$("italic-icon"),xr=$("loading-icon"),Or=$("nylas-booked-event-card"),Lr=$("nylas-booking-form"),jr=$("nylas-cancelled-event-card"),Ar=$("nylas-composer"),Nr=$("nylas-date-picker"),Dr=$("nylas-if-state"),Mr=$("nylas-list-folders"),Fr=$("nylas-list-threads"),qr=$("nylas-locale-switch"),Ur=$("nylas-login"),Hr=$("nylas-logo"),Wr=$("nylas-mailbox"),Br=$("nylas-mailbox-pagination"),zr=$("nylas-mailbox-toolbar-button"),Yr=$("nylas-notification"),Gr=$("nylas-open-hours-picker"),Jr=$("nylas-provider"),Xr=$("nylas-scheduler"),Kr=$("nylas-selected-event-card"),Qr=$("nylas-summarize-message-button"),Zr=$("nylas-threads-refresh"),Vr=$("nylas-threads-search"),es=$("nylas-timeslot-picker"),ts=$("nylas-view-email"),ns=$("nylas-view-thread"),rs=$("people-icon"),ss=$("play-icon"),os=$("refresh-icon"),as=$("reply-all-icon"),is=$("reply-icon"),ls=$("sent-icon"),cs=$("spam-icon"),us=$("star-icon"),fs=$("stop-icon"),ds=$("translate-icon"),hs=$("trash-icon"),ps=$("underline-icon"),$s=$("warning-icon");function ys(){const[,e]=N.useReducer(o=>o+1,0),t=N.useRef(),s=N.useRef(null),r=N.useRef(null);return N.useEffect(()=>{t.current&&(s.current||t.current.getNylasMailboxConnector().then(o=>{o&&(s.current=o,r.current=s.current.nylasAuthStore,o.nylasAuthStore.on("set",e),e())}))},[]),[t,r.current]}exports.ArchiveIcon=yr;exports.ArrowIcon=gr;exports.BoldIcon=vr;exports.CalendarCancelIcon=mr;exports.CalendarCheckIcon=br;exports.CalendarIcon=Er;exports.CheckmarkCircleIcon=Sr;exports.ChevronIcon=wr;exports.CloseIcon=Cr;exports.DocumentRefreshIcon=kr;exports.FolderIcon=Pr;exports.ForwardIcon=Tr;exports.Fragment=Bn;exports.GlobeIcon=_r;exports.Host=$t;exports.InboxIcon=Rr;exports.ItalicIcon=Ir;exports.LoadingIcon=xr;exports.NylasBookedEventCard=Or;exports.NylasBookingForm=Lr;exports.NylasCancelledEventCard=jr;exports.NylasComposer=Ar;exports.NylasDatePicker=Nr;exports.NylasIfState=Dr;exports.NylasListFolders=Mr;exports.NylasListThreads=Fr;exports.NylasLocaleSwitch=qr;exports.NylasLogin=Ur;exports.NylasLogo=Hr;exports.NylasMailbox=Wr;exports.NylasMailboxPagination=Br;exports.NylasMailboxToolbarButton=zr;exports.NylasNotification=Yr;exports.NylasOpenHoursPicker=Gr;exports.NylasProvider=Jr;exports.NylasScheduler=Xr;exports.NylasSelectedEventCard=Kr;exports.NylasSummarizeMessageButton=Qr;exports.NylasThreadsRefresh=Zr;exports.NylasThreadsSearch=Vr;exports.NylasTimeslotPicker=es;exports.NylasViewEmail=ts;exports.NylasViewThread=ns;exports.PeopleIcon=rs;exports.PlayIcon=ss;exports.RefreshIcon=os;exports.ReplyAllIcon=as;exports.ReplyIcon=is;exports.SentIcon=ls;exports.SpamIcon=cs;exports.StarIcon=us;exports.StopIcon=fs;exports.TranslateIcon=ds;exports.TrashIcon=hs;exports.UnderlineIcon=ps;exports.WarningIcon=$s;exports.applyPolyfills=dn;exports.createEvent=wn;exports.defineCustomElements=sr;exports.forceUpdate=Dn;exports.getElement=yt;exports.getRenderingRef=An;exports.h=_e;exports.registerInstance=Jn;exports.useNylasMailboxElement=ys;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const T=require("./utils-5074a070-d5ba6add.cjs"),Ye=require("./index-29d0e781.cjs");class ir{constructor(e,n,r=!0,s){this.automaticComponentRegistration=!0,this.registeredComponents={},this.propStateRegistrations=new Map,this.eventListenerRegistrations=new Map,this.host=e,this.stores=n,this.automaticComponentRegistration=r,this.eventOverrides=s,T.debug(`[${this.hostTagName}] Initializing (abstract) provider.`,{eventOverrides:s}),this.registerComponent=this.registerComponent.bind(this),this.getStore=this.getStore.bind(this),Object.keys(this.stores).forEach(i=>{this.propStateRegistrations.set(i,new Map)})}async componentWillLoad(e){T.debug(`[${this.hostTagName}] Will load`),this.setupStoreListeners(),this.nylasConnector=e;const n=Array.from(this.host.querySelectorAll("*")).filter(r=>r.tagName.toLowerCase().startsWith("nylas-"));T.debug(`[${this.hostTagName}] Found ${n.length} child component(s).`,{childComponents:n}),n.forEach(r=>{const s=r;if(!s){T.debug(`[~${this.hostTagName}] Component ${s.tagName} does not have a name. Skipping.`);return}if(!s.registerNylasComponent){T.debug(`[~${this.hostTagName}] Component ${s.tagName} is not a component that can be registered. Skipping.`,{component:s});return}const i={element:s,name:s.tagName.toLowerCase(),getStoresToProp:s.getStoresToProp,storeToProps:s.storeToProps,stateToProps:s.stateToProps,authToProp:s.authToProp,eventToProps:s.eventToProps,connectorToProp:s.connectorToProp};this.registerComponent(i)})}async componentDidLoad(){T.debug(`[${this.hostTagName}] Did load`)}async componentDisconnected(){Object.values(this.stores).forEach(e=>{e.dispose()})}async registerComponentHandler(e){if(e.stopPropagation(),!this.automaticComponentRegistration){T.debug(`[${this.hostTagName}] Automatic component registration disabled. Skipping registration of ${e.detail.name}.`);return}this.registerComponent(e.detail)}async unregisterComponentHandler(e){if(e.stopPropagation(),!this.automaticComponentRegistration){T.debug(`[${this.hostTagName}] Automatic component registration disabled. Skipping unregistration of ${e.detail.name}.`);return}this.unregisterComponent(e.detail)}registerComponent(e){T.debug(`[${this.hostTagName}] Registering component ${e.name}.`);const n=e.element.dataset.nylasId;if(n&&this.registeredComponents[n]){T.debug(`[${this.hostTagName}] Component ${e.name} already registered. Skipping.`);return}const{stateToProps:r,getStoresToProp:s,eventToProps:i,storeToProps:o,connectorToProp:u,element:a}=e;a.dataset.nylasId=T.uniqueID(),this.registeredComponents[a.dataset.nylasId]=e;const l=this.eventOverrides;i==null||i.forEach((h,c)=>{var y;const d=this.nylasConnector,g=async m=>{T.debug(`[${this.hostTagName}] Handling "${e.name}" prop "${String(c)}" event.`,{eventOverrides:l}),c in l&&(T.debug(`[${this.hostTagName}] Found event override for "${String(c)}" event. Calling override.`),await l[c](m,d)),m.defaultPrevented||await h(m,d)},p=e.element.dataset.nylasId;p&&!this.eventListenerRegistrations.has(p)&&this.eventListenerRegistrations.set(p,[]),p&&((y=this.eventListenerRegistrations.get(p))==null||y.push([a,c,g])),T.debug(`[${this.hostTagName}] Setting "${e.name}" event "${String(c)}" to automcially call NylasConnector method.`);const f=T.formatEventName(c.toString());T.debug(`[${this.hostTagName}] Adding event listener for "${f}" on "${a.tagName}"`),a.addEventListener(f,g)}),r==null||r.forEach((h,c)=>{var y,m,v,b;const[d,g]=c.split("."),f=this.getStore(d).state[g];if(!a.dataset.nylasId){T.debug(`[${this.hostTagName}] Component "${e.name}" not registered. Skipping.`,{component:e});return}this.propStateRegistrations.has(d)||this.propStateRegistrations.set(d,new Map),(y=this.propStateRegistrations.get(d))!=null&&y.has(g)?(b=(v=this.propStateRegistrations.get(d))==null?void 0:v.get(g))==null||b.push({elementId:a.dataset.nylasId,propKey:h}):(m=this.propStateRegistrations.get(d))==null||m.set(g,[{elementId:a.dataset.nylasId,propKey:h}]),a[h.toString()]=f,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" value.`,{stateValue:f})}),s&&(a[s==null?void 0:s.toString()]=this.getStore,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)),o==null||o.forEach((h,c)=>{const d=this.getStore(c);a[h.toString()]=d,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "${c}" store.`,{store:d})}),u&&(a[u==null?void 0:u.toString()]=this.nylasConnector,T.debug(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`,{connectorToProp:u})),T.debug(`[${this.hostTagName}] Component ${e.name} registered.`)}unregisterComponent(e){T.debug(`[${this.hostTagName}] Unregistering component ${e.name}.`);const n=e.element.dataset.nylasId;if(!n){T.debug(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);return}if(this.registeredComponents[n]){T.debug(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);return}this.propStateRegistrations.forEach((s,i)=>{s.forEach((o,u)=>{var h,c;const a=(h=this.propStateRegistrations.get(i))==null?void 0:h.get(u),l=a==null?void 0:a.filter(d=>d.elementId!==n);l&&((c=this.propStateRegistrations.get(i))==null||c.set(u,l))})});const r=this.eventListenerRegistrations.get(n);r==null||r.forEach(([s,i,o])=>{const u=T.formatEventName(i.toString());T.debug(`[${this.hostTagName}] Removing event listener for "${u}" on "${s.tagName}"`),s.removeEventListener(u,o)}),delete this.registeredComponents[n]}getStore(e){const n=this.stores[e];if(!n)throw new Error(`[${this.hostTagName}] Store "${e.toString()}" not found.`);return n}async setupStoreListeners(){const e=this;Object.entries(this.stores).forEach(([n,r])=>{T.debug(`[${e.hostTagName}] Listening for changes in "${n}" store.`),r.use({set(s,i,o){var l;if(T.debug(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" changed`,{newValue:i,oldValue:o}),i===o){T.debug(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" unchanged. Skipping.`);return}const u=e.registeredComponents;if(!u){T.debug(`[${e.hostTagName}] No registered components found. Skipping.`);return}const a=((l=e.propStateRegistrations.get(n))==null?void 0:l.get(s.toString()))||[];T.debug(`[${e.hostTagName}] Found ${a.length} prop(s) registered for "${s.toString()}" store.`,{props:a,propStateRegistrations:e.propStateRegistrations}),a.forEach(({elementId:h,propKey:c})=>{const d=u[h];if(!d){T.debug(`[${e.hostTagName}] Component "${h}" not found. Skipping.`,{component:d});return}const p=e.getStore(n).state[s];d.element[c.toString()]=p,T.debug(`[${e.hostTagName}] Setting "${d.name}" prop "${c.toString()}" to "${s.toString()}" value.`,{stateValue:p})})}})})}get hostTagName(){var e,n;return((n=(e=this.host)==null?void 0:e.tagName)==null?void 0:n.toLowerCase())??"nylas-provider"}}class or extends ir{}var ar=Object.defineProperty,ur=(t,e,n)=>e in t?ar(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ct=(t,e,n)=>(ur(t,typeof e!="symbol"?e+"":e,n),n),Cn=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(Cn||{});const cr=t=>"error"in t;class lr extends Error{constructor(e){super(e==null?void 0:e.message),ct(this,"apiError"),this.name="NylasAPIError",this.stack=new Error().stack,this.apiError=e}}async function fn(t){const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e),r=Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("");return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const R=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$=Object.keys,F=Array.isArray;function U(t,e){return typeof e!="object"||$(e).forEach(function(n){t[n]=e[n]}),t}typeof Promise>"u"||R.Promise||(R.Promise=Promise);const Be=Object.getPrototypeOf,hr={}.hasOwnProperty;function z(t,e){return hr.call(t,e)}function Ee(t,e){typeof e=="function"&&(e=e(Be(t))),(typeof Reflect>"u"?$:Reflect.ownKeys)(e).forEach(n=>{ee(t,n,e[n])})}const Tn=Object.defineProperty;function ee(t,e,n,r){Tn(t,e,U(n&&z(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function ke(t){return{from:function(e){return t.prototype=Object.create(e.prototype),ee(t.prototype,"constructor",t),{extend:Ee.bind(null,t.prototype)}}}}const dr=Object.getOwnPropertyDescriptor;function en(t,e){let n;return dr(t,e)||(n=Be(t))&&en(n,e)}const fr=[].slice;function lt(t,e,n){return fr.call(t,e,n)}function An(t,e){return e(t)}function Ie(t){if(!t)throw new Error("Assertion Failed")}function On(t){R.setImmediate?setImmediate(t):setTimeout(t,0)}function In(t,e){return t.reduce((n,r,s)=>{var i=e(r,s);return i&&(n[i[0]]=i[1]),n},{})}function te(t,e){if(z(t,e))return t[e];if(!e)return t;if(typeof e!="string"){for(var n=[],r=0,s=e.length;r<s;++r){var i=te(t,e[r]);n.push(i)}return n}var o=e.indexOf(".");if(o!==-1){var u=t[e.substr(0,o)];return u===void 0?void 0:te(u,e.substr(o+1))}}function H(t,e,n){if(t&&e!==void 0&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if(typeof e!="string"&&"length"in e){Ie(typeof n!="string"&&"length"in n);for(var r=0,s=e.length;r<s;++r)H(t,e[r],n[r])}else{var i=e.indexOf(".");if(i!==-1){var o=e.substr(0,i),u=e.substr(i+1);if(u==="")n===void 0?F(t)&&!isNaN(parseInt(o))?t.splice(o,1):delete t[o]:t[o]=n;else{var a=t[o];a&&z(t,o)||(a=t[o]={}),H(a,u,n)}}else n===void 0?F(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function Rn(t){var e={};for(var n in t)z(t,n)&&(e[n]=t[n]);return e}const pr=[].concat;function Kn(t){return pr.apply([],t)}const jn="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Kn([8,16,32,64].map(t=>["Int","Uint","Float"].map(e=>e+t+"Array")))).filter(t=>R[t]),gr=jn.map(t=>R[t]);In(jn,t=>[t,!0]);let se=null;function We(t){se=typeof WeakMap<"u"&&new WeakMap;const e=At(t);return se=null,e}function At(t){if(!t||typeof t!="object")return t;let e=se&&se.get(t);if(e)return e;if(F(t)){e=[],se&&se.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(At(t[n]))}else if(gr.indexOf(t.constructor)>=0)e=t;else{const i=Be(t);for(var s in e=i===Object.prototype?{}:Object.create(i),se&&se.set(t,e),t)z(t,s)&&(e[s]=At(t[s]))}return e}const{toString:mr}={};function Ot(t){return mr.call(t).slice(8,-1)}const It=typeof Symbol<"u"?Symbol.iterator:"@@iterator",yr=typeof It=="symbol"?function(t){var e;return t!=null&&(e=t[It])&&e.apply(t)}:function(){return null},_e={};function J(t){var e,n,r,s;if(arguments.length===1){if(F(t))return t.slice();if(this===_e&&typeof t=="string")return[t];if(s=yr(t)){for(n=[];!(r=s.next()).done;)n.push(r.value);return n}if(t==null)return[t];if(typeof(e=t.length)=="number"){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n}const tn=typeof Symbol<"u"?t=>t[Symbol.toStringTag]==="AsyncFunction":()=>!1;var G=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Dn(t,e){G=t,$n=e}var $n=()=>!0;const vr=!new Error("").stack;function Pe(){if(vr)try{throw new Error}catch(t){return t}return new Error}function Rt(t,e){var n=t.stack;return n?(e=e||0,n.indexOf(t.name)===0&&(e+=(t.name+t.message).split(`
|
|
2
|
+
`).length),n.split(`
|
|
3
|
+
`).slice(e).filter($n).map(r=>`
|
|
4
|
+
`+r).join("")):""}var Nn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],nn=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Nn),br={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function xe(t,e){this._e=Pe(),this.name=t,this.message=e}function Bn(t,e){return t+". Errors: "+Object.keys(e).map(n=>e[n].toString()).filter((n,r,s)=>s.indexOf(n)===r).join(`
|
|
5
|
+
`)}function ht(t,e,n,r){this._e=Pe(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=Bn(t,e)}function Ke(t,e){this._e=Pe(),this.name="BulkError",this.failures=Object.keys(e).map(n=>e[n]),this.failuresByPos=e,this.message=Bn(t,e)}ke(xe).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Rt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),ke(ht).from(xe),ke(Ke).from(xe);var rn=nn.reduce((t,e)=>(t[e]=e+"Error",t),{});const wr=xe;var C=nn.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=br[e]||n,this.inner=null)}return ke(r).from(wr),t[e]=r,t},{});C.Syntax=SyntaxError,C.Type=TypeError,C.Range=RangeError;var pn=Nn.reduce((t,e)=>(t[e+"Error"]=C[e],t),{}),nt=nn.reduce((t,e)=>(["Syntax","Type","Range"].indexOf(e)===-1&&(t[e+"Error"]=C[e]),t),{});function I(){}function Me(t){return t}function _r(t,e){return t==null||t===Me?e:function(n){return e(t(n))}}function ge(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function kr(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?ge(r,this.onsuccess):r),s&&(this.onerror=this.onerror?ge(s,this.onerror):s),i!==void 0?i:n}}function xr(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?ge(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ge(r,this.onerror):r)}}function Sr(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?ge(s,this.onsuccess):s),i&&(this.onerror=this.onerror?ge(i,this.onerror):i),r===void 0?o===void 0?void 0:o:U(r,o)}}function Er(t,e){return t===I?e:function(){return e.apply(this,arguments)!==!1&&t.apply(this,arguments)}}function sn(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)}}nt.ModifyError=ht,nt.DexieError=xe,nt.BulkError=Ke;var Fe={};const Mn=100,[Kt,dt,jt]=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]})(),Fn=dt&&dt.then,rt=Kt&&Kt.constructor,on=!!jt;var Dt=!1,Pr=jt?()=>{jt.then(Ge)}:R.setImmediate?setImmediate.bind(null,Ge):R.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver(()=>{Ge(),t=null}).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(Ge,0)},je=function(t,e){Re.push([t,e]),ft&&(Pr(),ft=!1)},$t=!0,ft=!0,de=[],st=[],Nt=null,Bt=Me,Se={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:yn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(t=>{try{yn(t[0],t[1])}catch{}})}},P=Se,Re=[],fe=0,it=[];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!==Fe)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Ft(this,this._value))}this._state=null,this._value=null,++e.ref,Ln(this,t)}const Mt={get:function(){var t=P,e=pt;function n(r,s){var i=!t.global&&(t!==P||e!==pt);const o=i&&!ne();var u=new S((a,l)=>{an(this,new qn(gt(r,t,i,o),gt(s,t,i,o),a,l,t))});return G&&Wn(u,this),u}return n.prototype=Fe,n},set:function(t){ee(this,"then",t&&t.prototype===Fe?Mt:{get:function(){return t},set:Mt.set})}};function qn(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 Ln(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"?Ln(t,(s,i)=>{n instanceof S?n._then(s,i):n.then(s,i)}):(t._state=!0,t._value=n,Un(t)),r&&He()}},Ft.bind(null,t))}catch(n){Ft(t,n)}}function Ft(t,e){if(st.push(e),t._state===null){var n=t._lib&&ze();e=Bt(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=en(e,"stack");e._promise=t,ee(e,"stack",{get:()=>Dt?r&&(r.get?r.get.apply(e):r.value):t.stack})}),function(r){de.some(s=>s._value===r._value)||de.push(r)}(t),Un(t),n&&He()}}function Un(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)an(t,e[n]);var s=t._PSD;--s.ref||s.finalize(),fe===0&&(++fe,je(()=>{--fe==0&&un()},[]))}function an(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,je(Cr,[n,t,e])}else t._listeners.push(e)}function Cr(t,e,n){try{Nt=e;var r,s=e._value;e._state?r=t(s):(st.length&&(st=[]),r=t(s),st.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&&un(),--n.psd.ref||n.psd.finalize()}}function Vn(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=Rt(o,0)):(s=o,i=""),e.push(s+(i?": "+i:"")+r)}return G&&((r=Rt(t._stackHolder,2))&&e.indexOf(r)===-1&&e.push(r),t._prev&&Vn(t._prev,e,n)),e}function Wn(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)}function Ge(){ze()&&He()}function ze(){var t=$t;return $t=!1,ft=!1,t}function He(){var t,e,n;do for(;Re.length>0;)for(t=Re,Re=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}while(Re.length>0);$t=!0,ft=!0}function un(){var t=de;de=[],t.forEach(r=>{r._PSD.onunhandled.call(null,r._value,r)});for(var e=it.slice(0),n=e.length;n;)e[--n]()}function Xe(t){return new S(Fe,!1,t)}function K(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:Mt,_then:function(t,e){an(this,new qn(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):Xe(r)):this.then(null,r=>r&&r.name===e?n(r):Xe(r))},finally:function(t){return this.then(e=>(t(),e),e=>(t(),Xe(e)))},stack:{get:function(){if(this._stack)return this._stack;try{Dt=!0;var t=Vn(this,[],20).join(`
|
|
7
|
+
From previous: `);return this._state!==null&&(this._stack=t),t}finally{Dt=!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=zn(),Ee(S,{all:function(){var t=J.apply(null,arguments).map(Qe);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(Fe,!0,t);return Wn(e,Nt),e},reject:Xe,race:function(){var t=J.apply(null,arguments).map(Qe);return new S((e,n)=>{t.map(r=>S.resolve(r).then(e,n))})},PSD:{get:()=>P,set:t=>P=t},totalEchoes:{get:()=>pt},newPSD:oe,usePSD:Te,scheduler:{get:()=>je,set:t=>{je=t}},rejectionMapper:{get:()=>Bt,set:t=>{Bt=t}},follow:(t,e)=>new S((n,r)=>oe((s,i)=>{var o=P;o.unhandleds=[],o.onunhandled=i,o.finalize=ge(function(){(function(u){function a(){u(),it.splice(it.indexOf(a),1)}it.push(a),++fe,je(()=>{--fe==0&&un()},[])})(()=>{this.unhandleds.length===0?s():i(this.unhandleds[0])})},o.finalize),t()},e,n,r))}),rt&&(rt.allSettled&&ee(S,"allSettled",function(){const t=J.apply(null,arguments).map(Qe);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)))})}),rt.any&&typeof AggregateError<"u"&&ee(S,"any",function(){const t=J.apply(null,arguments).map(Qe);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 M={awaits:0,echoes:0,id:0};var Tr=0,ot=[],_t=0,pt=0,Ar=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=++Ar;var o=Se.env;i.env=on?{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:gn(o.nthen,i),gthen:gn(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 M.id||(M.id=++Tr),++M.awaits,M.echoes+=Mn,M.id}function ne(){return!!M.awaits&&(--M.awaits==0&&(M.id=0),M.echoes=M.awaits*Mn,!0)}function Qe(t){return M.echoes&&t&&t.constructor===rt?(Ce(),t.then(e=>(ne(),e),e=>(ne(),N(e)))):t}function Or(t){++pt,M.echoes&&--M.echoes!=0||(M.echoes=M.id=0),ot.push(P),ae(t,!0)}function Ir(){var t=ot[ot.length-1];ot.pop(),ae(t,!1)}function ae(t,e){var n=P;if((e?!M.echoes||_t++&&t===P:!_t||--_t&&t===P)||Hn(e?Or.bind(null,t):Ir),t!==P&&(P=t,n===Se&&(Se.env=zn()),on)){var r=Se.env.Promise,s=t.env;dt.then=s.nthen,r.prototype.then=s.gthen,(n.global||t.global)&&(Object.defineProperty(R,"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 zn(){var t=R.Promise;return on?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(R,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:dt.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 Hn(t){Fn.call(Kt,t)}function gt(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&&Hn(ne)}}}function gn(t,e){return function(n,r){return t.call(this,gt(n,e),gt(r,e))}}(""+Fn).indexOf("[native code]")===-1&&(Ce=ne=I);const mn="unhandledrejection";function yn(t,e){var n;try{n=e.onuncatched(t)}catch{}if(n!==!1)try{var r,s={promise:e,reason:t};if(R.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(mn,!0,!0),U(r,s)):R.CustomEvent&&U(r=new CustomEvent(mn,{detail:s}),s),r&&R.dispatchEvent&&(dispatchEvent(r),!R.PromiseRejectionEvent&&R.onunhandledrejection))try{R.onunhandledrejection(r)}catch{}G&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${t.stack||t}`)}catch{}}var N=S.reject;function qt(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===rn.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>qt(t,e,n,r))):N(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 N(new C.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return N(new C.DatabaseClosed);t.open().catch(I)}return t._state.dbReadyPromise.then(()=>qt(t,e,n,r))}const vn="3.2.4",he=String.fromCharCode(65535),Lt=-1/0,X="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Yn="String expected.",De=[],vt=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Rr=vt,Kr=vt,Gn=t=>!/(dexie\.js|dexie\.min\.js)/.test(t),bt="__dbnames",kt="readonly",xt="readwrite";function me(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e}const Xn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Je(t){return typeof t!="string"||/\./.test(t)?e=>e:e=>(e[t]===void 0&&t in e&&delete(e=We(e))[t],e)}class jr{_trans(e,n,r){const s=this._tx||P.trans,i=this.name;function o(a,l,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}):qt(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(F(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(l=>l.compound&&n.every(h=>l.keyPath.indexOf(h)>=0)&&l.keyPath.every(h=>n.indexOf(h)>=0))[0];if(r&&this.db._maxKey!==he)return this.where(r.name).equals(r.keyPath.map(l=>e[l]));!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(l,h){try{return i.cmp(l,h)===0}catch{return!1}}const[u,a]=n.reduce(([l,h],c)=>{const d=s[c],g=e[c];return[l||d,l||!d?me(h,d&&d.multi?p=>{const f=te(p,c);return F(f)&&f.some(y=>o(g,y))}:p=>o(g,te(p,c))):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,F(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=Je(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"||F(e))return this.where(":id").equals(e).modify(n);{const r=te(e,this.schema.primKey.keyPath);if(r===void 0)return N(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=Je(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:Xn})).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 l=e.length;let h=a&&u?e.map(Je(a)):e;return this.core.mutate({trans:o,type:"add",keys:s,values:h,wantResults:i}).then(({numFailures:c,results:d,lastResult:g,failures:p})=>{if(c===0)return i?d:g;throw new Ke(`${this.name}.bulkAdd(): ${c} of ${l} operations failed`,p)})})}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 l=e.length;let h=a&&u?e.map(Je(a)):e;return this.core.mutate({trans:o,type:"put",keys:s,values:h,wantResults:i}).then(({numFailures:c,results:d,lastResult:g,failures:p})=>{if(c===0)return i?d:g;throw new Ke(`${this.name}.bulkPut(): ${c} of ${l} operations failed`,p)})})}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 Ke(`${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,l=new Array(a-1);--a;)l[a-1]=arguments[a];return e[o].subscribe.apply(null,l),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 l;u||(u=Er),a||(a=I);var h={subscribers:[],fire:a,subscribe:function(c){h.subscribers.indexOf(c)===-1&&(h.subscribers.push(c),h.fire=u(h.fire,c))},unsubscribe:function(c){h.subscribers=h.subscribers.filter(function(d){return d!==c}),h.fire=h.subscribers.reduce(u,a)}};return e[o]=n[o]=h,h}$(l=o).forEach(function(c){var d=l[c];if(F(d))i(c,l[c][0],l[c][1]);else{if(d!=="asap")throw new C.InvalidArgument("Invalid event config");var g=i(c,Me,function(){for(var p=arguments.length,f=new Array(p);p--;)f[p]=arguments[p];g.subscribers.forEach(function(y){On(function(){y.apply(null,f)})})})}})}}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 St(t,e){t.filter=me(t.filter,e)}function Et(t,e,n){var r=t.replayFilter;t.replayFilter=r?()=>me(r(),e()):e,t.justLimit=n&&!r}function at(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 bn(t,e,n){const r=at(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 Ze(t,e,n,r){const s=t.replayFilter?me(t.filter,t.replayFilter()):t.filter;if(t.or){const i={},o=(u,a,l)=>{if(!s||s(a,l,d=>a.stop(d),d=>a.fail(d))){var h=a.primaryKey,c=""+h;c==="[object ArrayBuffer]"&&(c=""+new Uint8Array(h)),z(i,c)||(i[c]=!0,e(u,a,l))}};return Promise.all([t.or._iterate(o,n),wn(bn(t,r,n),t.algorithm,o,!t.keysOnly&&t.valueMapper)])}return wn(bn(t,r,n),me(t.algorithm,s),e,!t.keysOnly&&t.valueMapper)}function wn(t,e,n,r){var s=K(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=_n(t),r=_n(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 l=0;l<a;++l)if(s[l]!==i[l])return s[l]<i[l]?-1:1;return o===u?0:o<u?-1:1}(kn(t),kn(e));case"Array":return function(s,i){const o=s.length,u=i.length,a=o<u?o:u;for(let l=0;l<a;++l){const h=L(s[l],i[l]);if(h!==0)return h}return o===u?0:o<u?-1:1}(t,e)}}catch{}return NaN}function _n(t){const e=typeof t;if(e!=="object")return e;if(ArrayBuffer.isView(t))return"binary";const n=Ot(t);return n==="ArrayBuffer"?"binary":n}function kn(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}class Dr{_read(e,n){var r=this._ctx;return r.error?r.table._trans(null,N.bind(null,r.error)):r.table._trans("readonly",e).then(n)}_write(e){var n=this._ctx;return n.error?n.table._trans(null,N.bind(null,n.error)):n.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var n=this._ctx;n.algorithm=me(n.algorithm,e)}_iterate(e,n){return Ze(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=>Ze(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:at(r,s.schema),range:r.range}}).then(o=>Math.min(o,r.limit));var i=0;return Ze(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(l,h){return h?o(l[r[h]],h-1):l[s]}var u=this._ctx.dir==="next"?1:-1;function a(l,h){var c=o(l,i),d=o(h,i);return c<d?-u:c>d?u:0}return this.toArray(function(l){return l.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=at(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 Ze(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)?Et(n,()=>{var r=e;return(s,i)=>r===0||(r===1?(--r,!1):(i(()=>{s.advance(r),r=0}),!1))}):Et(n,()=>{var r=e;return()=>--r<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Et(this._ctx,()=>{var n=e;return function(r,s,i){return--n<=0&&s(i),n>=0}},!0),this}until(e,n){return St(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 St(this._ctx,function(s){return e(s.value)}),n=this._ctx,r=e,n.isMatch=me(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=at(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 St(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(f){for(var y=!1,m=0;m<o;++m){var v=i[m],b=e[v];te(f,v)!==b&&(H(f,v,b),y=!0)}return y}}const u=n.table.core,{outbound:a,extractKey:l}=u.schema.primaryKey,h=this.db._options.modifyChunkSize||200,c=[];let d=0;const g=[],p=(f,y)=>{const{failures:m,numFailures:v}=y;d+=f-v;for(let b of $(m))c.push(m[b])};return this.clone().primaryKeys().then(f=>{const y=m=>{const v=Math.min(h,f.length-m);return u.getMany({trans:r,keys:f.slice(m,m+v),cache:"immutable"}).then(b=>{const x=[],E=[],k=a?[]:null,w=[];for(let _=0;_<v;++_){const j=b[_],O={value:We(j),primKey:f[m+_]};s.call(O,O.value,O)!==!1&&(O.value==null?w.push(f[m+_]):a||L(l(j),l(O.value))===0?(E.push(O.value),a&&k.push(f[m+_])):(w.push(f[m+_]),x.push(O.value)))}const A=be(n)&&n.limit===1/0&&(typeof e!="function"||e===Pt)&&{index:n.index,range:n.range};return Promise.resolve(x.length>0&&u.mutate({trans:r,type:"add",values:x}).then(_=>{for(let j in _.failures)w.splice(parseInt(j),1);p(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(_=>p(E.length,_))).then(()=>(w.length>0||A&&e===Pt)&&u.mutate({trans:r,type:"delete",keys:w,criteria:A}).then(_=>p(w.length,_))).then(()=>f.length>m+v&&y(m+h))})};return y(0).then(()=>{if(c.length>0)throw new ht("Error modifying one or more objects",c,d,g);return f.length})})})}delete(){var e=this._ctx,n=e.range;return be(e)&&(e.isPrimKey&&!Kr||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:l,numFailures:h})=>{if(h)throw new ht("Could not delete some values",Object.keys(u).map(c=>u[c]),o-h);return o-h}))}):this.modify(Pt)}}const Pt=(t,e)=>e.value=null;function $r(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 Jn?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,()=>Qn("")).limit(0)}function Br(t,e,n,r,s,i){for(var o=Math.min(t.length,r.length),u=-1,a=0;a<o;++a){var l=e[a];if(l!==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],l)<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 et(t,e,n,r){var s,i,o,u,a,l,h,c=n.length;if(!n.every(f=>typeof f=="string"))return W(t,Yn);function d(f){s=function(m){return m==="next"?v=>v.toUpperCase():v=>v.toLowerCase()}(f),i=function(m){return m==="next"?v=>v.toLowerCase():v=>v.toUpperCase()}(f),o=f==="next"?$r:Nr;var y=n.map(function(m){return{lower:i(m),upper:s(m)}}).sort(function(m,v){return o(m.lower,v.lower)});u=y.map(function(m){return m.upper}),a=y.map(function(m){return m.lower}),l=f,h=f==="next"?"":r}d("next");var g=new t.Collection(t,()=>re(u[0],a[c-1]+r));g._ondirectionchange=function(f){d(f)};var p=0;return g._addAlgorithm(function(f,y,m){var v=f.key;if(typeof v!="string")return!1;var b=i(v);if(e(b,a,p))return!0;for(var x=null,E=p;E<c;++E){var k=Br(v,b,u[E],a[E],o,l);k===null&&x===null?p=E+1:(x===null||o(x,k)>0)&&(x=k)}return y(x!==null?function(){f.continue(x+h)}:m),!1}),g}function re(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}}function Qn(t){return{type:1,lower:t,upper:t}}class Jn{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,()=>Qn(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,Yn):this.between(e,e+he,!0,!0)}startsWithIgnoreCase(e){return e===""?this.startsWith(e):et(this,(n,r)=>n.indexOf(r[0])===0,[e],he)}equalsIgnoreCase(e){return et(this,(n,r)=>n===r[0],[e],"")}anyOfIgnoreCase(){var e=J.apply(_e,arguments);return e.length===0?we(this):et(this,(n,r)=>r.indexOf(n)!==-1,e,"")}startsWithAnyOfIgnoreCase(){var e=J.apply(_e,arguments);return e.length===0?we(this):et(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([[Lt,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]]):[[Lt,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(v=>v[0]!==void 0&&v[1]!==void 0&&s(v[0],v[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,l=n&&n.includeUppers===!0;let h,c=s;function d(v,b){return c(v[0],b[0])}try{h=e.reduce(function(v,b){let x=0,E=v.length;for(;x<E;++x){const k=v[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&&v.push(b),v},[]),h.sort(d)}catch{return W(this,X)}let g=0;const p=l?v=>s(v,h[g][1])>0:v=>s(v,h[g][1])>=0,f=a?v=>i(v,h[g][0])>0:v=>i(v,h[g][0])>=0;let y=p;const m=new this.Collection(this,()=>re(h[0][0],h[h.length-1][1],!a,!l));return m._ondirectionchange=v=>{v==="next"?(y=p,c=s):(y=f,c=i),h.sort(d)},m._addAlgorithm((v,b,x)=>{for(var E=v.key;y(E);)if(++g,g===h.length)return b(x),!1;return!!function(k){return!p(k)&&!f(k)}(E)||(this._cmp(E,h[g][1])===0||this._cmp(E,h[g][0])===0||b(()=>{c===s?v.continue(h[g][0]):v.continue(h[g][1])}),!1)}),m}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 K(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 Mr{_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=K(s=>{qe(s),this._reject(e.error)}),e.onabort=K(s=>{qe(s),this.active&&this._reject(new C.Abort(e.error)),this.active=!1,this.on("abort").fire(s)}),e.oncomplete=K(()=>{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 N(new C.ReadOnly("Transaction is readonly"));if(!this.active)return N(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(K(o.bind(null,a))),a=>n._waitingQueue.push(K(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 Ut(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?"++":"")+Zn(e)}}function Zn(t){return typeof t=="string"?t:t?"["+[].join.call(t,"+")+"]":""}function er(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:In(n,r=>[r.name,r])}}let Ue=t=>{try{return t.only([[]]),Ue=()=>[[]],[[]]}catch{return Ue=()=>he,he}};function Vt(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 xn(t){return[].slice.call(t)}let Fr=0;function Ne(t){return t==null?":id":typeof t=="string"?t:`[${t.join("+")}]`}function qr(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:l,upper:h,lowerOpen:c,upperOpen:d}=a;return l===void 0?h===void 0?null:e.upperBound(h,!!d):h===void 0?e.lowerBound(l,!!c):e.bound(l,h,!!c,!!d)}const{schema:s,hasGetAll:i}=function(a,l){const h=xn(a.objectStoreNames);return{schema:{name:a.name,tables:h.map(c=>l.objectStore(c)).map(c=>{const{keyPath:d,autoIncrement:g}=c,p=F(d),f=d==null,y={},m={name:c.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:f,compound:p,keyPath:d,autoIncrement:g,unique:!0,extractKey:Vt(d)},indexes:xn(c.indexNames).map(v=>c.index(v)).map(v=>{const{name:b,unique:x,multiEntry:E,keyPath:k}=v,w={name:b,compound:F(k),keyPath:k,unique:x,multiEntry:E,extractKey:Vt(k)};return y[Ne(k)]=w,w}),getIndexByKeyPath:v=>y[Ne(v)]};return y[":id"]=m.primaryKey,d!=null&&(y[Ne(d)]=m.primaryKey),m})},hasGetAll:h.length>0&&"getAll"in l.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(l){const h=l.name;return{name:h,schema:l,mutate:function({trans:c,type:d,keys:g,values:p,range:f}){return new Promise((y,m)=>{y=K(y);const v=c.objectStore(h),b=v.keyPath==null,x=d==="put"||d==="add";if(!x&&d!=="delete"&&d!=="deleteRange")throw new Error("Invalid operation type: "+d);const{length:E}=g||p||{length:1};if(g&&p&&g.length!==p.length)throw new Error("Given keys array must have same length as given values array.");if(E===0)return y({numFailures:0,failures:{},results:[],lastResult:void 0});let k;const w=[],A=[];let _=0;const j=q=>{++_,qe(q)};if(d==="deleteRange"){if(f.type===4)return y({numFailures:_,failures:A,results:[],lastResult:void 0});f.type===3?w.push(k=v.clear()):w.push(k=v.delete(r(f)))}else{const[q,B]=x?b?[p,g]:[p,null]:[g,null];if(x)for(let D=0;D<E;++D)w.push(k=B&&B[D]!==void 0?v[d](q[D],B[D]):v[d](q[D])),k.onerror=j;else for(let D=0;D<E;++D)w.push(k=v[d](q[D])),k.onerror=j}const O=q=>{const B=q.target.result;w.forEach((D,ye)=>D.error!=null&&(A[ye]=D.error)),y({numFailures:_,failures:A,results:d==="delete"?g:w.map(D=>D.result),lastResult:B})};k.onerror=q=>{j(q),O(q)},k.onsuccess=O})},getMany:({trans:c,keys:d})=>new Promise((g,p)=>{g=K(g);const f=c.objectStore(h),y=d.length,m=new Array(y);let v,b=0,x=0;const E=w=>{const A=w.target;m[A._pos]=A.result,++x===b&&g(m)},k=Y(p);for(let w=0;w<y;++w)d[w]!=null&&(v=f.get(d[w]),v._pos=w,v.onsuccess=E,v.onerror=k,++b);b===0&&g(m)}),get:({trans:c,key:d})=>new Promise((g,p)=>{g=K(g);const f=c.objectStore(h).get(d);f.onsuccess=y=>g(y.target.result),f.onerror=Y(p)}),query:function(c){return d=>new Promise((g,p)=>{g=K(g);const{trans:f,values:y,limit:m,query:v}=d,b=m===1/0?void 0:m,{index:x,range:E}=v,k=f.objectStore(h),w=x.isPrimaryKey?k:k.index(x.name),A=r(E);if(m===0)return g({result:[]});if(c){const _=y?w.getAll(A,b):w.getAllKeys(A,b);_.onsuccess=j=>g({result:j.target.result}),_.onerror=Y(p)}else{let _=0;const j=y||!("openKeyCursor"in w)?w.openCursor(A):w.openKeyCursor(A),O=[];j.onsuccess=q=>{const B=j.result;return B?(O.push(y?B.value:B.primaryKey),++_===m?g({result:O}):void B.continue()):g({result:O})},j.onerror=Y(p)}})}(i),openCursor:function({trans:c,values:d,query:g,reverse:p,unique:f}){return new Promise((y,m)=>{y=K(y);const{index:v,range:b}=g,x=c.objectStore(h),E=v.isPrimaryKey?x:x.index(v.name),k=p?f?"prevunique":"prev":f?"nextunique":"next",w=d||!("openKeyCursor"in E)?E.openCursor(r(b),k):E.openKeyCursor(r(b),k);w.onerror=Y(m),w.onsuccess=K(A=>{const _=w.result;if(!_)return void y(null);_.___id=++Fr,_.done=!1;const j=_.continue.bind(_);let O=_.continuePrimaryKey;O&&(O=O.bind(_));const q=_.advance.bind(_),B=()=>{throw new Error("Cursor not stopped")};_.trans=c,_.stop=_.continue=_.continuePrimaryKey=_.advance=()=>{throw new Error("Cursor not started")},_.fail=K(m),_.next=function(){let D=1;return this.start(()=>D--?this.continue():this.stop()).then(()=>this)},_.start=D=>{const ye=new Promise((V,ce)=>{V=K(V),w.onerror=Y(ce),_.fail=ce,_.stop=Ae=>{_.stop=_.continue=_.continuePrimaryKey=_.advance=B,V(Ae)}}),ve=()=>{if(w.result)try{D()}catch(V){_.fail(V)}else _.done=!0,_.start=()=>{throw new Error("Cursor behind last entry")},_.stop()};return w.onsuccess=K(V=>{w.onsuccess=ve,ve()}),_.continue=j,_.continuePrimaryKey=O,_.advance=q,ve(),ye},y(_)},m)})},count({query:c,trans:d}){const{index:g,range:p}=c;return new Promise((f,y)=>{const m=d.objectStore(h),v=g.isPrimaryKey?m:m.index(g.name),b=r(p),x=b?v.count(b):v.count();x.onsuccess=K(E=>f(E.target.result)),x.onerror=Y(y)})}}}(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 Wt({_novip:t},e){const n=e.db,r=function(s,i,{IDBKeyRange:o,indexedDB:u},a){return{dbcore:function(l,h){return h.reduce((c,{create:d})=>({...c,...d(c)}),l)}(qr(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=en(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){Tn(this,s,{value:a,writable:!0,configurable:!0,enumerable:!0})}}):o[s]=new t.Table(s,i))})})}function zt({_novip:t},e){e.forEach(n=>{for(let r in n)n[r]instanceof t.Table&&delete n[r]})}function Lr(t,e){return t._cfg.version-e._cfg.version}function Ur(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=>{Ct(n,a,s[a].primKey,s[a].indexes)}),Wt(t,n),S.follow(()=>t.on.populate.fire(i)).catch(o)):function({_novip:a},l,h,c){const d=[],g=a._versions;let p=a._dbSchema=Yt(a,a.idbdb,c),f=!1;const y=g.filter(v=>v._cfg.version>=l);function m(){return d.length?S.resolve(d.shift()(h.idbtrans)).then(m):S.resolve()}return y.forEach(v=>{d.push(()=>{const b=p,x=v._cfg.dbschema;Gt(a,b,c),Gt(a,x,c),p=a._dbSchema=x;const E=tr(b,x);E.add.forEach(w=>{Ct(c,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=c.objectStore(w.name);w.add.forEach(_=>Ht(A,_)),w.change.forEach(_=>{A.deleteIndex(_.name),Ht(A,_)}),w.del.forEach(_=>A.deleteIndex(_))}});const k=v._cfg.contentUpgrade;if(k&&v._cfg.version>l){Wt(a,c),h._memoizedTables={},f=!0;let w=Rn(x);E.del.forEach(O=>{w[O]=b[O]}),zt(a,[a.Transaction.prototype]),mt(a,[a.Transaction.prototype],$(w),w),h.schema=w;const A=tn(k);let _;A&&Ce();const j=S.follow(()=>{if(_=k(h),_&&A){var O=ne.bind(null,null);_.then(O,O)}});return _&&typeof _.then=="function"?S.resolve(_):j.then(()=>_)}}),d.push(b=>{(!f||!Rr)&&function(x,E){[].slice.call(E.db.objectStoreNames).forEach(k=>x[k]==null&&E.db.deleteObjectStore(k))}(v._cfg.dbschema,b),zt(a,[a.Transaction.prototype]),mt(a,[a.Transaction.prototype],a._storeNames,a._dbSchema),h.schema=a._dbSchema})}),m().then(()=>{var v,b;b=c,$(v=p).forEach(x=>{b.db.objectStoreNames.contains(x)||Ct(b,x,v[x].primKey,v[x].indexes)})})}(t,e,i,n).catch(o)})}function tr(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&&!vt)o.recreate=!0,n.change.push(o);else{const u=s.idxByName,a=i.idxByName;let l;for(l in u)a[l]||o.del.push(l);for(l in a){const h=u[l],c=a[l];h?h.src!==c.src&&o.change.push(c):o.add.push(c)}(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 Ct(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=>Ht(s,i)),s}function Ht(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function Yt(t,e,n){const r={};return lt(e.objectStoreNames,0).forEach(s=>{const i=n.objectStore(s);let o=i.keyPath;const u=Ut(Zn(o),o||"",!1,!1,!!i.autoIncrement,o&&typeof o!="string",!0),a=[];for(let h=0;h<i.indexNames.length;++h){const c=i.index(i.indexNames[h]);o=c.keyPath;var l=Ut(c.name,o,!!c.unique,!!c.multiEntry,!1,o&&typeof o!="string",!1);a.push(l)}r[s]=er(s,u,a)}),r}function Gt({_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],l=o.index(a).keyPath,h=typeof l=="string"?l:"["+lt(l).join("+")+"]";if(e[i]){const c=e[i].idxByName[h];c&&(c.name=a,delete e[i].idxByName[h],e[i].idxByName[a]=c)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&R.WorkerGlobalScope&&R instanceof R.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(t._hasGetAll=!1)}class Vr{_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,""),l=/^\[/.test(a)?a.match(/^\[(.*)\]$/)[1].split("+"):a;return Ut(a,l||null,/\&/.test(o),/\*/.test(o),/\+\+/.test(o),F(l),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]=er(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,zt(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=sn(this._cfg.contentUpgrade||I,e),this}}function cn(t,e){let n=t._dbNamesDB;return n||(n=t._dbNamesDB=new pe(bt,{addons:[],indexedDB:t,IDBKeyRange:e}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function ln(t){return t&&typeof t.databases=="function"}function Xt(t){return oe(function(){return P.letThrough=!0,t()})}function Wr(){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 zr(t){const e=t._state,{indexedDB:n}=t._deps;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then(()=>e.dbOpenError?N(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():Wr()).then(()=>new S((a,l)=>{if(s(),!n)throw new C.MissingAPI;const h=t.name,c=e.autoSchema?n.open(h):n.open(h,Math.round(10*t.verno));if(!c)throw new C.MissingAPI;c.onerror=Y(l),c.onblocked=K(t._fireOnBlocked),c.onupgradeneeded=K(d=>{if(o=c.transaction,e.autoSchema&&!t._options.allowEmptyDB){c.onerror=qe,o.abort(),c.result.close();const p=n.deleteDatabase(h);p.onsuccess=p.onerror=K(()=>{l(new C.NoSuchDatabase(`Database ${h} doesnt exist`))})}else{o.onerror=Y(l);var g=d.oldVersion>Math.pow(2,62)?0:d.oldVersion;u=g<1,t._novip.idbdb=c.result,Ur(t,g/10,o,l)}},l),c.onsuccess=K(()=>{o=null;const d=t._novip.idbdb=c.result,g=lt(d.objectStoreNames);if(g.length>0)try{const f=d.transaction((p=g).length===1?p[0]:p,"readonly");e.autoSchema?function({_novip:y},m,v){y.verno=m.version/10;const b=y._dbSchema=Yt(0,m,v);y._storeNames=lt(m.objectStoreNames,0),mt(y,[y._allTables],$(b),b)}(t,d,f):(Gt(t,t._dbSchema,f),function(y,m){const v=tr(Yt(0,y.idbdb,m),y._dbSchema);return!(v.add.length||v.change.some(b=>b.add.length||b.change.length))}(t,f)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Wt(t,f)}catch{}var p;De.push(t),d.onversionchange=K(f=>{e.vcFired=!0,t.on("versionchange").fire(f)}),d.onclose=K(f=>{t.on("close").fire(f)}),u&&function({indexedDB:f,IDBKeyRange:y},m){!ln(f)&&m!==bt&&cn(f,y).put({name:m}).catch(I)}(t._deps,h),a()},l)}))]).then(()=>(s(),e.onReadyBeingFired=[],S.resolve(Xt(()=>t.on.ready.fire(t.vip))).then(function a(){if(e.onReadyBeingFired.length>0){let l=e.onReadyBeingFired.reduce(sn,I);return e.onReadyBeingFired=[],S.resolve(Xt(()=>l(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(),N(a)}).finally(()=>{e.openComplete=!0,i()})}function Qt(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):F(a)?Promise.all(a).then(n,r):n(a)}}return s(e)()}function Hr(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,Kn(s),n]}function nr(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(c){return c.name===rn.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>nr(t,e,n,null,s))):N(c)}const a=tn(s);let l;a&&Ce();const h=S.follow(()=>{if(l=s.call(o,o),l)if(a){var c=ne.bind(null,null);l.then(c,c)}else typeof l.next=="function"&&typeof l.throw=="function"&&(l=Qt(l))},u);return(l&&typeof l.then=="function"?S.resolve(l).then(c=>o.active?c:N(new C.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):h.then(()=>l)).then(c=>(r&&o._resolve(),o._completion.then(()=>c))).catch(c=>(o._reject(c),N(c)))})}function tt(t,e,n){const r=F(t)?t.slice():[t];for(let s=0;s<n;++s)r.push(e);return r}const Yr={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(l,h,c){const d=Ne(l),g=s[d]=s[d]||[],p=l==null?0:typeof l=="string"?1:l.length,f=h>0,y={...c,isVirtual:f,keyTail:h,keyLength:p,extractKey:Vt(l),unique:!f&&c.unique};return g.push(y),y.isPrimaryKey||i.push(y),p>1&&o(p===2?l[0]:l.slice(0,p-1),h+1,c),g.sort((m,v)=>m.keyTail-v.keyTail),y}const u=o(r.primaryKey.keyPath,0,r.primaryKey);s[":id"]=[u];for(const l of r.indexes)o(l.keyPath,0,l);function a(l){const h=l.query.index;return h.isVirtual?{...l,query:{index:h,range:(c=l.query.range,d=h.keyTail,{type:c.type===1?2:c.type,lower:tt(c.lower,c.lowerOpen?t.MAX_KEY:t.MIN_KEY,d),lowerOpen:!0,upper:tt(c.upper,c.upperOpen?t.MIN_KEY:t.MAX_KEY,d),upperOpen:!0})}}:l;var c,d}return{...n,schema:{...r,primaryKey:u,indexes:i,getIndexByKeyPath:function(l){const h=s[Ne(l)];return h&&h[0]}},count:l=>n.count(a(l)),query:l=>n.query(a(l)),openCursor(l){const{keyTail:h,isVirtual:c,keyLength:d}=l.query.index;return c?n.openCursor(a(l)).then(g=>g&&function(p){return Object.create(p,{continue:{value:function(f){f!=null?p.continue(tt(f,l.reverse?t.MAX_KEY:t.MIN_KEY,h)):l.unique?p.continue(p.key.slice(0,d).concat(l.reverse?t.MIN_KEY:t.MAX_KEY,h)):p.continue()}},continuePrimaryKey:{value(f,y){p.continuePrimaryKey(tt(f,t.MAX_KEY,h),y)}},primaryKey:{get:()=>p.primaryKey},key:{get(){const f=p.key;return d===1?f[0]:f.slice(0,d)}},value:{get:()=>p.value}})}(g)):n.openCursor(l)}}}}}};function hn(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=Ot(i);u!==Ot(o)?n[r+s]=e[s]:u==="Object"?hn(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 Gr={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",()=>l(s),!0);case"put":if(u.fire===I&&a.fire===I)break;return i._promise("readwrite",()=>l(s),!0);case"delete":if(o.fire===I)break;return i._promise("readwrite",()=>l(s),!0);case"deleteRange":if(o.fire===I)break;return i._promise("readwrite",()=>function(c){return h(c.trans,c.range,1e4)}(s),!0)}return n.mutate(s);function l(c){const d=P.trans,g=c.keys||function(p,f){return f.type==="delete"?f.keys:f.keys||f.values.map(p.extractKey)}(r,c);if(!g)throw new Error("Keys missing");return(c=c.type==="add"||c.type==="put"?{...c,keys:g}:{...c}).type!=="delete"&&(c.values=[...c.values]),c.keys&&(c.keys=[...c.keys]),function(p,f,y){return f.type==="add"?Promise.resolve([]):p.getMany({trans:f.trans,keys:y,cache:"immutable"})}(n,c,g).then(p=>{const f=g.map((y,m)=>{const v=p[m],b={onerror:null,onsuccess:null};if(c.type==="delete")o.fire.call(b,y,v,d);else if(c.type==="add"||v===void 0){const x=u.fire.call(b,y,c.values[m],d);y==null&&x!=null&&(y=x,c.keys[m]=y,r.outbound||H(c.values[m],r.keyPath,y))}else{const x=hn(v,c.values[m]),E=a.fire.call(b,x,y,v,d);if(E){const k=c.values[m];Object.keys(E).forEach(w=>{z(k,w)?k[w]=E[w]:H(k,w,E[w])})}}return b});return n.mutate(c).then(({failures:y,results:m,numFailures:v,lastResult:b})=>{for(let x=0;x<g.length;++x){const E=m?m[x]:g[x],k=f[x];E==null?k.onerror&&k.onerror(y[x]):k.onsuccess&&k.onsuccess(c.type==="put"&&p[x]?c.values[x]:E)}return{failures:y,results:m,numFailures:v,lastResult:b}}).catch(y=>(f.forEach(m=>m.onerror&&m.onerror(y)),Promise.reject(y)))})}function h(c,d,g){return n.query({trans:c,values:!1,query:{index:r,range:d},limit:g}).then(({result:p})=>l({type:"delete",keys:p,trans:c}).then(f=>f.numFailures>0?Promise.reject(f.failures[0]):p.length<g?{failures:[],numFailures:0,lastResult:void 0}:h(c,{...d,lower:p[p.length-1],lowerOpen:!0},g)))}}}}})};function rr(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 Xr={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=rr(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 dn(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(dn(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},Sn(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},Sn(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&&yt(t,s),i&&o&&yt(t,i)}function yt(t,e){dn(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 Qr(t,e){const n=Jt(e);let r=n.next();if(r.done)return!1;let s=r.value;const i=Jt(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 Jt(t){let e=dn(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 Sn(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=En(o)}t.d=En(t)}function En({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 yt(this,t),this},addKey(t){return Ve(this,t,t),this},addKeys(t){return t.forEach(e=>Ve(this,e,e)),this},[It](){return Jt(this)}});const Jr={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,l={...s,mutate:d=>{const g=d.trans,p=g.mutatedParts||(g.mutatedParts={}),f=k=>{const w=`idb://${e}/${r}/${k}`;return p[w]||(p[w]=new Q)},y=f(""),m=f(":dels"),{type:v}=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(F(b)){v!=="delete"&&(b=k.results),y.addKeys(b);const w=rr(b,E);w||v==="add"||m.addKeys(b),(w||x)&&function(A,_,j,O){function q(B){const D=A(B.name||"");function ye(V){return V!=null?B.extractKey(V):null}const ve=V=>B.multiEntry&&F(V)?V.forEach(ce=>D.addKey(ce)):D.addKey(V);(j||O).forEach((V,ce)=>{const Ae=j&&ye(j[ce]),wt=O&&ye(O[ce]);L(Ae,wt)!==0&&(Ae!=null&&ve(Ae),wt!=null&&ve(wt))})}_.indexes.forEach(q)}(f,i,w,x)}else if(b){const w={from:b.lower,to:b.upper};m.add(w),y.add(w)}else y.add(n),m.add(n),i.indexes.forEach(w=>f(w.name).add(n));return k})}},h=({query:{index:d,range:g}})=>{var p,f;return[d,new Q((p=g.lower)!==null&&p!==void 0?p:t.MIN_KEY,(f=g.upper)!==null&&f!==void 0?f:t.MAX_KEY)]},c={get:d=>[o,new Q(d.key)],getMany:d=>[o,new Q().addKeys(d.keys)],count:h,query:h,openCursor:h};return $(c).forEach(d=>{l[d]=function(g){const{subscr:p}=P;if(p){const f=x=>{const E=`idb://${e}/${r}/${x}`;return p[E]||(p[E]=new Q)},y=f(""),m=f(":dels"),[v,b]=c[d](g);if(f(v.name||"").add(b),!v.isPrimaryKey){if(d!=="count"){const x=d==="query"&&a&&g.values&&s.query({...g,values:!1});return s[d].apply(this,arguments).then(E=>{if(d==="query"){if(a&&g.values)return x.then(({result:w})=>(y.addKeys(w),E));const k=g.values?E.result.map(u):E.result;g.values?y.addKeys(k):m.addKeys(k)}else if(d==="openCursor"){const k=E,w=g.values;return k&&Object.create(k,{key:{get:()=>(m.addKey(k.primaryKey),k.key)},primaryKey:{get(){const A=k.primaryKey;return m.addKey(A),A}},value:{get:()=>(w&&y.addKey(k.primaryKey),k.value)}})}return E})}m.add(n)}}return s[d].apply(this,arguments)}}),l}}}};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:[sn,I]}),this.on.ready.subscribe=An(this.on.ready.subscribe,u=>(a,l)=>{pe.vip(()=>{const h=this._state;if(h.openComplete)h.dbOpenError||S.resolve().then(a),l&&u(a);else if(h.onReadyBeingFired)h.onReadyBeingFired.push(a),l&&u(a);else{u(a);const c=this;l||u(function d(){c.on.ready.unsubscribe(a),c.on.ready.unsubscribe(d)})}})}),this.Collection=(o=this,Oe(Dr.prototype,function(u,a){this.db=o;let l=Xn,h=null;if(a)try{l=a()}catch(p){h=p}const c=u._ctx,d=c.table,g=d.hook.reading.fire;this._ctx={table:d,index:c.index,isPrimKey:!c.index||d.schema.primKey.keyPath&&c.index===d.schema.primKey.name,range:l,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:h,or:c.or,valueMapper:g!==Me?g:null}})),this.Table=function(u){return Oe(jr.prototype,function(a,l,h){this.db=u,this._tx=h,this.name=a,this.schema=l,this.hook=u._allTables[a]?u._allTables[a].hook:$e(null,{creating:[kr,I],reading:[_r,Me],updating:[Sr,I],deleting:[xr,I]})})}(this),this.Transaction=function(u){return Oe(Mr.prototype,function(a,l,h,c,d){this.db=u,this.mode=a,this.storeNames=l,this.schema=h,this.chromeTransactionDurability=c,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((g,p)=>{this._resolve=g,this._reject=p}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},g=>{var p=this.active;return this.active=!1,this.on.error.fire(g),this.parent?this.parent._reject(g):p&&this.idbtrans&&this.idbtrans.abort(),N(g)})})}(this),this.Version=function(u){return Oe(Vr.prototype,function(a){this.db=u,this._cfg={version:a,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(u){return Oe(Jn.prototype,function(a,l,h){this.db=u,this._ctx={table:a,index:l===":id"?null:l,or:h};const c=u._deps.indexedDB;if(!c)throw new C.MissingAPI;this._cmp=this._ascending=c.cmp.bind(c),this._descending=(d,g)=>c.cmp(g,d),this._max=(d,g)=>c.cmp(d,g)>0?d:g,this._min=(d,g)=>c.cmp(d,g)<0?d:g,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,l,h)=>new this.Transaction(u,a,l,this._options.chromeTransactionDurability,h),this._fireOnBlocked=u=>{this.on("blocked").fire(u),De.filter(a=>a.name===this.name&&a!==this&&!a._state.vcFired).map(a=>a.on("versionchange").fire(u))},this.use(Yr),this.use(Gr),this.use(Jr),this.use(Xr),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(Lr),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 zr(this)}_close(){const e=this._state,n=De.indexOf(this);if(n>=0&&De.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=K(()=>{(function({indexedDB:u,IDBKeyRange:a},l){!ln(u)&&l!==bt&&cn(u,a).delete(l).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=Hr.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(l=>{var h=l instanceof this.Table?l.name:l;if(typeof h!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return h}),e=="r"||e===kt)o=kt;else{if(e!="rw"&&e!=xt)throw new C.InvalidArgument("Invalid transaction mode: "+e);o=xt}if(s){if(s.mode===kt&&o===xt){if(!i)throw new C.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");s=null}s&&u.forEach(l=>{if(s&&s.storeNames.indexOf(l)===-1){if(!i)throw new C.SubTransaction("Table "+l+" not included in parent transaction.");s=null}}),i&&s&&!s.active&&(s=null)}}catch(l){return s?s._promise(null,(h,c)=>{c(l)}):N(l)}const a=nr.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 Zr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class es{constructor(e){this._subscribe=e}subscribe(e,n,r){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:n,complete:r})}[Zr](){return this}}function sr(t,e){return $(e).forEach(n=>{yt(t[n]||(t[n]=new Q),e[n])}),t}function ts(t){let e,n=!1;const r=new es(s=>{const i=tn(t);let o=!1,u={},a={};const l={get closed(){return o},unsubscribe:()=>{o=!0,ue.storagemutated.unsubscribe(g)}};s.start&&s.start(l);let h=!1,c=!1;function d(){return $(a).some(f=>u[f]&&Qr(u[f],a[f]))}const g=f=>{sr(u,f),d()&&p()},p=()=>{if(h||o)return;u={};const f={},y=function(m){i&&Ce();const v=()=>oe(t,{subscr:m,trans:null}),b=P.trans?Te(P.transless,v):v();return i&&b.then(ne,ne),b}(f);c||(ue(Le,g),c=!0),h=!0,Promise.resolve(y).then(m=>{n=!0,e=m,h=!1,o||(d()?p():(u={},a=f,s.next&&s.next(m)))},m=>{h=!1,n=!1,s.error&&s.error(m),l.unsubscribe()})};return p(),l});return r.hasValue=()=>n,r.getValue=()=>e,r}let Zt;try{Zt={indexedDB:R.indexedDB||R.mozIndexedDB||R.webkitIndexedDB||R.msIndexedDB,IDBKeyRange:R.IDBKeyRange||R.webkitIDBKeyRange}}catch{Zt={indexedDB:null,IDBKeyRange:null}}const le=pe;function ut(t){let e=Z;try{Z=!0,ue.storagemutated.fire(t)}finally{Z=e}}Ee(le,{...nt,delete:t=>new le(t,{addons:[]}).delete(),exists:t=>new le(t,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(t){try{return function({indexedDB:e,IDBKeyRange:n}){return ln(e)?Promise.resolve(e.databases()).then(r=>r.map(s=>s.name).filter(s=>s!==bt)):cn(e,n).toCollection().primaryKeys()}(le.dependencies).then(t)}catch{return N(new C.MissingAPI)}},defineClass:()=>function(t){U(this,t)},ignoreTransaction:t=>P.trans?Te(P.transless,t):t(),vip:Xt,async:function(t){return function(){try{var e=Qt(t.apply(this,arguments));return e&&typeof e.then=="function"?e:S.resolve(e)}catch(n){return N(n)}}},spawn:function(t,e,n){try{var r=Qt(t.apply(n,e||[]));return r&&typeof r.then=="function"?r:S.resolve(r)}catch(s){return N(s)}},currentTransaction:{get:()=>P.trans||null},waitFor:function(t,e){const n=S.resolve(typeof t=="function"?le.ignoreTransaction(t):t).timeout(e||6e4);return P.trans?P.trans.waitFor(n):n},Promise:S,debug:{get:()=>G,set:t=>{Dn(t,t==="dexie"?()=>!0:Gn)}},derive:ke,extend:U,props:Ee,override:An,Events:$e,on:ue,liveQuery:ts,extendObservabilitySet:sr,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:Rn,deepClone:We,getObjectDiff:hn,cmp:L,asap:On,minKey:Lt,addons:[],connections:De,errnames:rn,dependencies:Zt,semVer:vn,version:vn.split(".").map(t=>parseInt(t)).reduce((t,e,n)=>t+e/Math.pow(10,2*n))}),le.maxKey=Ue(le.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(ue(Le,t=>{if(!Z){let e;vt?(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||ut(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&&ut(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&&ut(n.changedParts)}});const t=self.document&&navigator.serviceWorker;t&&t.addEventListener("message",function({data:e}){e&&e.type===ie&&ut(e.changedParts)})}S.rejectionMapper=function(t,e){if(!t||t instanceof xe||t instanceof TypeError||t instanceof SyntaxError||!t.name||!pn[t.name])return t;var n=new pn[t.name](e||t.message,t);return"stack"in t&&ee(n,"stack",{get:function(){return this.inner.stack}}),n},Dn(G,Gn);class ns extends pe{constructor(){super("NylasAuthDatabase"),ct(this,"grant"),ct(this,"pkce"),this.version(1).stores({grant:"++id,token",pkce:"++id,codeVerifier"}),this.grant=this.table("grant"),this.pkce=this.table("pkce")}}class rs{constructor(){ct(this,"theDB"),this.theDB=new ns}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 ss(t){const e="NylasAuth";if(!t)throw new Error("NylasAuth requires a config object");let n=null;if(t.storageType==="indexeddb"&&(n=new rs),!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,l=!0,h,c){const d=await(n==null?void 0:n.getTokenInfo()),g=new URL(o,h??t.apiUri),p=new Headers;p.append("Accept","application/json"),p.append("Content-Type","application/json"),p.append("User-Agent",e),d&&p.append("Authorization",`Bearer ${d.access_token}`);const f=await fetch(g.toString(),{method:u||"GET",headers:p,mode:"cors",referrer:location.origin,body:a?JSON.stringify(a):void 0,...c||{}});return l?await f.json():f.body}return{config:t,async getHostedAuthRedirectURL(o=t.defaultScopes,u,a){const l=await fn(Math.random().toString()),h=await fn(l);await(n==null?void 0:n.setCodeVerifier(l));const c=new URL(`${t.apiUri}/v3/connect/auth`);return c.searchParams.set("client_id",t.clientId),c.searchParams.set("response_type","code"),c.searchParams.set("scope",o.join(" ")),c.searchParams.set("redirect_uri",t.redirectURI),c.searchParams.set("access_type","offline"),c.searchParams.set("code_challenge",h),c.searchParams.set("code_challenge_method","S256"),c.searchParams.set("options","rotate_refresh_token"),a&&c.searchParams.set("provider",a),u&&c.searchParams.set("login_hint",u),c.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 l=await(n==null?void 0:n.getTokenInfo()),h=new URL(o,t.apiUri),c=new Headers;return c.append("Accept","application/json"),c.append("Content-Type","application/octet-stream"),c.append("User-Agent",e),l&&c.append("Authorization",`Bearer ${l.access_token}`),(await fetch(h.toString(),{method:u,headers:c,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 l=a.scope.toLowerCase().split(" ");let h=[];const c=Array.isArray(u)?u:[u];return o==="email"&&(h=[...s,...r].filter(d=>c.includes(d.type))),h.every(d=>l.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(l=>a.includes(l.toLowerCase()))}}}const is=(t,e,n)=>{const r=t.get(e);r?r.includes(n)||r.push(n):t.set(e,[n])},os=(t,e)=>{let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{n=0,t(...r)},e)}},as=t=>!("isConnected"in t)||t.isConnected,Pn=os(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(as))},2e3),us=()=>{if(typeof Ye.getRenderingRef!="function")return{};const t=new Map;return{dispose:()=>t.clear(),get:e=>{const n=Ye.getRenderingRef();n&&is(t,e,n)},set:e=>{const n=t.get(e);n&&t.set(e,n.filter(Ye.forceUpdate)),Pn(t)},reset:()=>{t.forEach(e=>e.forEach(Ye.forceUpdate)),Pn(t)}}},Tt=t=>typeof t=="function"?t():t,cs=(t,e=(n,r)=>n!==r)=>{const n=Tt(t);let r=new Map(Object.entries(n??{}));const s={dispose:[],get:[],set:[],reset:[]},i=()=>{var p;r=new Map(Object.entries((p=Tt(t))!==null&&p!==void 0?p:{})),s.reset.forEach(f=>f())},o=()=>{s.dispose.forEach(p=>p()),i()},u=p=>(s.get.forEach(f=>f(p)),r.get(p)),a=(p,f)=>{const y=r.get(p);e(f,y,p)&&(r.set(p,f),s.set.forEach(m=>m(p,f,y)))},l=typeof Proxy>"u"?{}:new Proxy(n,{get(p,f){return u(f)},ownKeys(p){return Array.from(r.keys())},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},has(p,f){return r.has(f)},set(p,f,y){return a(f,y),!0}}),h=(p,f)=>(s[p].push(f),()=>{ls(s[p],f)});return{state:l,get:u,set:a,on:h,onChange:(p,f)=>{const y=h("set",(v,b)=>{v===p&&f(b)}),m=h("reset",()=>f(Tt(t)[p]));return()=>{y(),m()}},use:(...p)=>{const f=p.reduce((y,m)=>(m.set&&y.push(h("set",m.set)),m.get&&y.push(h("get",m.get)),m.reset&&y.push(h("reset",m.reset)),m.dispose&&y.push(h("dispose",m.dispose)),y),[]);return()=>f.forEach(y=>y())},dispose:o,reset:i,forceUpdate:p=>{const f=r.get(p);s.set.forEach(y=>y(p,f,f))}}},ls=(t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)},hs=(t,e)=>{const n=cs(t,e);return n.use(us()),n};exports.NylasBaseProvider=or;exports.Xr=cr;exports.Zr=lr;exports.createStore=hs;exports.es=ss;exports.nr=Cn;
|