@nylas/web-elements 1.1.0-canary.7 → 1.1.0-canary.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/add-circle-icon_22.cjs.entry.js +22 -11
- package/dist/cjs/add-circle-icon_22.cjs.entry.js.map +1 -1
- package/dist/cjs/forward-icon_6.cjs.entry.js +2 -2
- package/dist/cjs/google-logo-icon_4.cjs.entry.js +2 -2
- package/dist/cjs/index-7af03e3f.js +158 -1
- package/dist/cjs/index-c14ea8f5.js +362 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{index.es-b12b7df1.js → index.es-4a7d8d3f.js} +2 -2
- package/dist/cjs/{index.es-b12b7df1.js.map → index.es-4a7d8d3f.js.map} +1 -1
- package/dist/cjs/{index.es-0a0f2d87.js → index.es-b2cce060.js} +2 -2
- package/dist/cjs/{index.es-0a0f2d87.js.map → index.es-b2cce060.js.map} +1 -1
- package/dist/cjs/{mailbox-store-05fa3bec.js → mailbox-store-a2f858b7.js} +3 -3
- package/dist/cjs/{mailbox-store-05fa3bec.js.map → mailbox-store-a2f858b7.js.map} +1 -1
- package/dist/cjs/{mailbox-store-14531fd4.js → mailbox-store-ecceb918.js} +3 -3
- package/dist/cjs/{mailbox-store-14531fd4.js.map → mailbox-store-ecceb918.js.map} +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/nylas-additional-participants.cjs.entry.js +2 -2
- package/dist/cjs/{nylas-api-request-27c25287.js → nylas-api-request-28b4576a.js} +2 -2
- package/dist/cjs/{nylas-api-request-27c25287.js.map → nylas-api-request-28b4576a.js.map} +1 -1
- package/dist/cjs/{nylas-api-request-abdb8dd8.js → nylas-api-request-c9e0e347.js} +2 -2
- package/dist/cjs/{nylas-api-request-abdb8dd8.js.map → nylas-api-request-c9e0e347.js.map} +1 -1
- package/dist/cjs/nylas-availability-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-buffer-time.cjs.entry.js +2 -2
- package/dist/cjs/nylas-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancel-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancelled-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-composer.cjs.entry.js +1 -1
- package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js +2 -2
- package/dist/cjs/nylas-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-description.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-duration.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-info.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-limits.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-title.cjs.entry.js +22 -11
- package/dist/cjs/nylas-event-title.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-if-state.cjs.entry.js +2 -2
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +2 -2
- package/dist/cjs/nylas-list-configurations.cjs.entry.js +2 -2
- package/dist/cjs/nylas-list-folders.cjs.entry.js +2 -2
- package/dist/cjs/nylas-list-threads.cjs.entry.js +2 -2
- package/dist/cjs/nylas-locale-switch.cjs.entry.js +2 -2
- package/dist/cjs/nylas-location-component.cjs.entry.js +2 -2
- package/dist/cjs/nylas-login.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox.cjs.entry.js +3 -3
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +2 -2
- package/dist/cjs/nylas-notification.cjs.entry.js +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +4 -4
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +3 -3
- package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
- package/dist/cjs/nylas-selected-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-summarize-message-button.cjs.entry.js +2 -2
- package/dist/cjs/nylas-threads-refresh.cjs.entry.js +2 -2
- package/dist/cjs/nylas-threads-search.cjs.entry.js +2 -2
- package/dist/cjs/nylas-time-window-picker.cjs.entry.js +1 -1
- package/dist/cjs/nylas-timeslot-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-view-email.cjs.entry.js +1 -1
- package/dist/cjs/nylas-view-thread.cjs.entry.js +2 -2
- package/dist/cjs/{register-component-c8b6e907.js → register-component-7ecacf90.js} +2 -2
- package/dist/cjs/{register-component-09ebdf31.js.map → register-component-7ecacf90.js.map} +1 -1
- package/dist/cjs/{register-component-09ebdf31.js → register-component-98ab6f54.js} +2 -2
- package/dist/cjs/{register-component-c8b6e907.js.map → register-component-98ab6f54.js.map} +1 -1
- package/dist/cjs/{scheduler-store-67dc1986.js → scheduler-store-22103c86.js} +2 -2
- package/dist/cjs/{scheduler-store-0081970d.js.map → scheduler-store-22103c86.js.map} +1 -1
- package/dist/cjs/{scheduler-store-0081970d.js → scheduler-store-fad9ed7a.js} +2 -2
- package/dist/cjs/{scheduler-store-67dc1986.js.map → scheduler-store-fad9ed7a.js.map} +1 -1
- package/dist/cjs/time-period-selector.cjs.entry.js +1 -1
- package/dist/cjs/{utils-20663d54.js → utils-9fc33c77.js} +46 -1
- package/dist/cjs/utils-9fc33c77.js.map +1 -0
- package/dist/cjs/{utils-2c7f0895.js → utils-d8cfc3be.js} +46 -1
- package/dist/cjs/{utils-2c7f0895.js.map → utils-d8cfc3be.js.map} +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +21 -10
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js.map +1 -1
- package/dist/collection/utils/utils.js +44 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.es.js +1 -1
- package/dist/components/nylas-event-title2.js +21 -10
- package/dist/components/nylas-event-title2.js.map +1 -1
- package/dist/components/nylas-list-folders.js +1 -1
- package/dist/components/nylas-list-threads.js +1 -1
- package/dist/components/nylas-summarize-message-button2.js +1 -1
- package/dist/components/nylas-view-email2.js +1 -1
- package/dist/components/nylas-view-thread.js +1 -1
- package/dist/components/utils.js +45 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/add-circle-icon_22.entry.js +22 -11
- package/dist/esm/add-circle-icon_22.entry.js.map +1 -1
- package/dist/esm/forward-icon_6.entry.js +2 -2
- package/dist/esm/google-logo-icon_4.entry.js +2 -2
- package/dist/esm/index-7cb0dd3d.js +158 -1
- package/dist/esm/index-8362ce5c.js +362 -1
- package/dist/esm/{index.es-f57e612a.js → index.es-df564f87.js} +2 -2
- package/dist/esm/{index.es-f57e612a.js.map → index.es-df564f87.js.map} +1 -1
- package/dist/{nylas-web-elements/index.es-2842f8c8.js → esm/index.es-e4f027a2.js} +2 -2
- package/dist/esm/{index.es-2842f8c8.js.map → index.es-e4f027a2.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/{nylas-web-elements/mailbox-store-d48269de.js → esm/mailbox-store-5075f820.js} +3 -3
- package/dist/{nylas-web-elements/mailbox-store-d48269de.js.map → esm/mailbox-store-5075f820.js.map} +1 -1
- package/dist/esm/{mailbox-store-47fc8a1a.js → mailbox-store-69c5c5f6.js} +3 -3
- package/dist/esm/{mailbox-store-47fc8a1a.js.map → mailbox-store-69c5c5f6.js.map} +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/nylas-additional-participants.entry.js +2 -2
- package/dist/{nylas-web-elements/nylas-api-request-b085294d.js → esm/nylas-api-request-6a19db25.js} +2 -2
- package/dist/esm/{nylas-api-request-b085294d.js.map → nylas-api-request-6a19db25.js.map} +1 -1
- package/dist/esm/{nylas-api-request-8932547a.js → nylas-api-request-b49b1da6.js} +2 -2
- package/dist/esm/{nylas-api-request-8932547a.js.map → nylas-api-request-b49b1da6.js.map} +1 -1
- package/dist/esm/nylas-availability-picker.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card_10.entry.js +2 -2
- package/dist/esm/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-booking-form.entry.js +2 -2
- package/dist/esm/nylas-buffer-time.entry.js +2 -2
- package/dist/esm/nylas-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/esm/nylas-cancelled-event-card.entry.js +2 -2
- package/dist/esm/nylas-composer.entry.js +1 -1
- package/dist/esm/nylas-custom-booking-flow.entry.js +2 -2
- package/dist/esm/nylas-date-picker.entry.js +2 -2
- package/dist/esm/nylas-editor-tabs.entry.js +2 -2
- package/dist/esm/nylas-event-description.entry.js +2 -2
- package/dist/esm/nylas-event-duration.entry.js +2 -2
- package/dist/esm/nylas-event-info.entry.js +2 -2
- package/dist/esm/nylas-event-limits.entry.js +2 -2
- package/dist/esm/nylas-event-title.entry.js +22 -11
- package/dist/esm/nylas-event-title.entry.js.map +1 -1
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-if-state.entry.js +2 -2
- package/dist/esm/nylas-limit-future-bookings.entry.js +2 -2
- package/dist/esm/nylas-list-configurations.entry.js +2 -2
- package/dist/esm/nylas-list-folders.entry.js +2 -2
- package/dist/esm/nylas-list-threads.entry.js +2 -2
- package/dist/esm/nylas-locale-switch.entry.js +2 -2
- package/dist/esm/nylas-location-component.entry.js +2 -2
- package/dist/esm/nylas-login.entry.js +2 -2
- package/dist/esm/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js +2 -2
- package/dist/esm/nylas-mailbox.entry.js +3 -3
- package/dist/esm/nylas-min-cancellation-notice.entry.js +2 -2
- package/dist/esm/nylas-notification.entry.js +1 -1
- package/dist/esm/nylas-provider.entry.js +4 -4
- package/dist/esm/nylas-scheduler-editor.entry.js +3 -3
- package/dist/esm/nylas-scheduling.entry.js +3 -3
- package/dist/esm/nylas-selected-event-card.entry.js +2 -2
- package/dist/esm/nylas-summarize-message-button.entry.js +2 -2
- package/dist/esm/nylas-threads-refresh.entry.js +2 -2
- package/dist/esm/nylas-threads-search.entry.js +2 -2
- package/dist/esm/nylas-time-window-picker.entry.js +1 -1
- package/dist/esm/nylas-timeslot-picker.entry.js +2 -2
- package/dist/esm/nylas-view-email.entry.js +1 -1
- package/dist/esm/nylas-view-thread.entry.js +2 -2
- package/dist/esm/{register-component-cf5c8420.js → register-component-b9cfcbaf.js} +2 -2
- package/dist/esm/{register-component-cf5c8420.js.map → register-component-b9cfcbaf.js.map} +1 -1
- package/dist/{nylas-web-elements/register-component-e5afe237.js → esm/register-component-ff6f5df4.js} +2 -2
- package/dist/esm/{register-component-e5afe237.js.map → register-component-ff6f5df4.js.map} +1 -1
- package/dist/esm/{scheduler-store-a175fc3e.js → scheduler-store-24fd0e91.js} +2 -2
- package/dist/{nylas-web-elements/scheduler-store-66c2168c.js.map → esm/scheduler-store-24fd0e91.js.map} +1 -1
- package/dist/esm/{scheduler-store-66c2168c.js → scheduler-store-e62b2146.js} +2 -2
- package/dist/esm/{scheduler-store-66c2168c.js.map → scheduler-store-e62b2146.js.map} +1 -1
- package/dist/esm/time-period-selector.entry.js +1 -1
- package/dist/{nylas-web-elements/utils-73d8a928.js → esm/utils-3e18e0b2.js} +46 -2
- package/dist/esm/{utils-73d8a928.js.map → utils-3e18e0b2.js.map} +1 -1
- package/dist/esm/{utils-d6204242.js → utils-db11d29c.js} +46 -2
- package/dist/esm/utils-db11d29c.js.map +1 -0
- package/dist/{esm/index.es-2842f8c8.js → nylas-web-elements/index.es-e4f027a2.js} +2 -2
- package/dist/nylas-web-elements/{index.es-2842f8c8.js.map → index.es-e4f027a2.js.map} +1 -1
- package/dist/nylas-web-elements/index.esm.js +2 -2
- package/dist/{esm/mailbox-store-d48269de.js → nylas-web-elements/mailbox-store-5075f820.js} +3 -3
- package/dist/{esm/mailbox-store-d48269de.js.map → nylas-web-elements/mailbox-store-5075f820.js.map} +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js +2 -2
- package/dist/{esm/nylas-api-request-b085294d.js → nylas-web-elements/nylas-api-request-6a19db25.js} +2 -2
- package/dist/nylas-web-elements/{nylas-api-request-b085294d.js.map → nylas-api-request-6a19db25.js.map} +1 -1
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-composer.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-info.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-limits.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-title.entry.js +22 -11
- package/dist/nylas-web-elements/nylas-event-title.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-form-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-if-state.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-list-folders.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-list-threads.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-location-component.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-login.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-toolbar-button.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-notification.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-provider.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-summarize-message-button.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-threads-refresh.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-threads-search.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-email.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-view-thread.entry.js +2 -2
- package/dist/nylas-web-elements/{p-30784693.entry.js → p-074919b0.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f154a362.entry.js → p-21c3dcad.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-42791515.entry.js → p-22531c3d.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-7c55dfa0.entry.js → p-2d151de9.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3909ec3f.entry.js → p-349f07e3.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-e03b2592.entry.js → p-4154e97e.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-bbf9aff2.entry.js → p-434fcde2.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-e22aa0b0.js → p-47b99cf5.js} +2 -2
- package/dist/nylas-web-elements/{p-22e5436c.js → p-4c12e1e9.js} +2 -2
- package/dist/nylas-web-elements/{p-80d6175c.entry.js → p-5caa0f36.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-df6d54c7.entry.js → p-7614e31e.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-1d25ca06.entry.js → p-7687925d.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-75a8d077.entry.js → p-828165d3.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-cc674b3b.entry.js → p-980c32d9.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ad64c2b8.entry.js → p-a17f542c.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a628eaeb.js → p-a3b1a98c.js} +2 -2
- package/dist/nylas-web-elements/{p-41dc0d93.js → p-ad7cf473.js} +2 -2
- package/dist/nylas-web-elements/p-ad7cf473.js.map +1 -0
- package/dist/nylas-web-elements/{p-343b8684.entry.js → p-bb89e973.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-1a91cce5.entry.js → p-c529dced.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-33b940fb.entry.js → p-d5375409.entry.js} +2 -2
- package/dist/nylas-web-elements/p-da74ec1c.entry.js +2 -0
- package/dist/nylas-web-elements/p-da74ec1c.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-9ea458c3.js → p-f0250b7d.js} +2 -2
- package/dist/nylas-web-elements/{p-eaa9151b.js → p-f0f3f350.js} +2 -2
- package/dist/nylas-web-elements/{p-6110351b.entry.js → p-f3974e14.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f1f8f745.entry.js → p-f47163ac.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-665ef10b.entry.js → p-f5d17746.entry.js} +2 -2
- package/dist/{esm/register-component-e5afe237.js → nylas-web-elements/register-component-ff6f5df4.js} +2 -2
- package/dist/nylas-web-elements/{register-component-e5afe237.js.map → register-component-ff6f5df4.js.map} +1 -1
- package/dist/nylas-web-elements/{scheduler-store-66c2168c.js → scheduler-store-e62b2146.js} +2 -2
- package/dist/{esm/scheduler-store-a175fc3e.js.map → nylas-web-elements/scheduler-store-e62b2146.js.map} +1 -1
- package/dist/nylas-web-elements/time-period-selector.entry.js +1 -1
- package/dist/{esm/utils-73d8a928.js → nylas-web-elements/utils-3e18e0b2.js} +46 -2
- package/dist/nylas-web-elements/{utils-73d8a928.js.map → utils-3e18e0b2.js.map} +1 -1
- package/dist/types/components/scheduler-editor/nylas-event-title/nylas-event-title.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/utils-20663d54.js.map +0 -1
- package/dist/esm/utils-d6204242.js.map +0 -1
- package/dist/nylas-web-elements/p-2b636359.entry.js +0 -2
- package/dist/nylas-web-elements/p-2b636359.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-41dc0d93.js.map +0 -1
- /package/dist/nylas-web-elements/{p-30784693.entry.js.map → p-074919b0.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f154a362.entry.js.map → p-21c3dcad.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-42791515.entry.js.map → p-22531c3d.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-7c55dfa0.entry.js.map → p-2d151de9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3909ec3f.entry.js.map → p-349f07e3.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-e03b2592.entry.js.map → p-4154e97e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-bbf9aff2.entry.js.map → p-434fcde2.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-e22aa0b0.js.map → p-47b99cf5.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-22e5436c.js.map → p-4c12e1e9.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-80d6175c.entry.js.map → p-5caa0f36.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-df6d54c7.entry.js.map → p-7614e31e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-1d25ca06.entry.js.map → p-7687925d.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-75a8d077.entry.js.map → p-828165d3.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-cc674b3b.entry.js.map → p-980c32d9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ad64c2b8.entry.js.map → p-a17f542c.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a628eaeb.js.map → p-a3b1a98c.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-343b8684.entry.js.map → p-bb89e973.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-1a91cce5.entry.js.map → p-c529dced.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-33b940fb.entry.js.map → p-d5375409.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9ea458c3.js.map → p-f0250b7d.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-eaa9151b.js.map → p-f0f3f350.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-6110351b.entry.js.map → p-f3974e14.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f1f8f745.entry.js.map → p-f47163ac.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-665ef10b.entry.js.map → p-f5d17746.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t,u as n,g as e}from"./p-41dc0d93.js";class r{constructor(n,e,r=true,i){this.automaticComponentRegistration=true;this.registeredComponents={};this.propStateRegistrations=new Map;this.eventListenerRegistrations=new Map;this.host=n;this.stores=e;this.automaticComponentRegistration=r;this.eventOverrides=i;t(`[${this.hostTagName}] Initializing (abstract) provider.`,{eventOverrides:i});this.registerComponent=this.registerComponent.bind(this);this.getStore=this.getStore.bind(this);Object.keys(this.stores).forEach((t=>{this.propStateRegistrations.set(t,new Map)}))}async componentWillLoad(n){t(`[${this.hostTagName}] Will load`);this.setupStoreListeners();this.nylasConnector=n;const e=Array.from(this.host.querySelectorAll("*")).filter((t=>t.tagName.toLowerCase().startsWith("nylas-")));t(`[${this.hostTagName}] Found ${e.length} child component(s).`,{childComponents:e});e.forEach((n=>{const e=n;if(!e){t(`[~${this.hostTagName}] Component ${e.tagName} does not have a name. Skipping.`);return}if(!e.registerNylasComponent){t(`[~${this.hostTagName}] Component ${e.tagName} is not a component that can be registered. Skipping.`,{component:e});return}const r={element:e,name:e.tagName.toLowerCase(),getStoresToProp:e.getStoresToProp,storeToProps:e.storeToProps,stateToProps:e.stateToProps,authToProp:e.authToProp,eventToProps:e.eventToProps,connectorToProp:e.connectorToProp,localPropsToProp:e.localPropsToProp};this.registerComponent(r)}))}async componentDidLoad(){t(`[${this.hostTagName}] Did load`)}async componentDisconnected(){Object.values(this.stores).forEach((t=>{t.dispose()}))}async registerComponentHandler(n){n.stopPropagation();if(!this.automaticComponentRegistration){t(`[${this.hostTagName}] Automatic component registration disabled. Skipping registration of ${n.detail.name}.`);return}this.registerComponent(n.detail)}async unregisterComponentHandler(n){n.stopPropagation();if(!this.automaticComponentRegistration){t(`[${this.hostTagName}] Automatic component registration disabled. Skipping unregistration of ${n.detail.name}.`);return}this.unregisterComponent(n.detail)}registerComponent(r){t(`[${this.hostTagName}] Registering component ${r.name}.`);const i=r.element.dataset.nylasId;if(i&&this.registeredComponents[i]){t(`[${this.hostTagName}] Component ${r.name} already registered. Skipping.`);return}const{stateToProps:s,getStoresToProp:o,eventToProps:u,storeToProps:a,connectorToProp:c,localPropsToProp:l,element:h}=r;h.dataset.nylasId=n();this.registeredComponents[h.dataset.nylasId]=r;const f=this.eventOverrides;u?.forEach(((n,i)=>{const s=this.nylasConnector;const o=async e=>{t(`[${this.hostTagName}] Handling "${r.name}" prop "${String(i)}" event.`,{event:e});if(i in f){t(`[${this.hostTagName}] Found event override for "${String(i)}" event. Calling override.`);await f[i](e,s)}if(!e.defaultPrevented){await n(e,s)}return};const u=r.element.dataset.nylasId;if(u&&!this.eventListenerRegistrations.has(u)){this.eventListenerRegistrations.set(u,[])}if(u){this.eventListenerRegistrations.get(u)?.push([h,i,o])}t(`[${this.hostTagName}] Setting "${r.name}" event "${String(i)}" to automcially call NylasConnector method.`);const a=e(i.toString());t(`[${this.hostTagName}] Adding event listener for "${a}" on "${h.tagName}"`);h.addEventListener(a,o)}));s?.forEach(((n,e)=>{const[i,s]=e.split(".");const o=this.getStore(i);const u=o.state[s];if(!h.dataset.nylasId){t(`[${this.hostTagName}] Component "${r.name}" not registered. Skipping.`,{component:r});return}if(!this.propStateRegistrations.has(i)){this.propStateRegistrations.set(i,new Map)}if(!this.propStateRegistrations.get(i)?.has(s)){this.propStateRegistrations.get(i)?.set(s,[{elementId:h.dataset.nylasId,propKey:n}])}else{this.propStateRegistrations.get(i)?.get(s)?.push({elementId:h.dataset.nylasId,propKey:n})}h[n.toString()]=u;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to "${e}" value.`,{stateValue:u})}));l?.forEach(((n,e)=>{const i=this.host[e];h[n.toString()]=i;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to the value of "${e}" value.`,{value:e,mappedPropValue:i})}));if(o){h[o?.toString()]=this.getStore;t(`[${this.hostTagName}] Setting "${r.name}" prop "${o.toString()}" to "getStore" method.`)}a?.forEach(((n,e)=>{const i=this.getStore(e);h[n.toString()]=i;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to "${e}" store.`,{store:i})}));if(c){h[c?.toString()]=this.nylasConnector;t(`[${this.hostTagName}] Setting "${r.name}" prop "${c.toString()}" to "nylasConnector" value.`,{connectorToProp:c})}t(`[${this.hostTagName}] Component ${r.name} registered.`)}unregisterComponent(n){t(`[${this.hostTagName}] Unregistering component ${n.name}.`);const r=n.element.dataset.nylasId;if(!r){t(`[${this.hostTagName}] Component ${n.name} not registered. Skipping.`);return}if(this.registeredComponents[r]){t(`[${this.hostTagName}] Component ${n.name} not registered. Skipping.`);return}this.propStateRegistrations.forEach(((t,n)=>{t.forEach(((t,e)=>{const i=this.propStateRegistrations.get(n)?.get(e);const s=i?.filter((t=>t.elementId!==r));if(s){this.propStateRegistrations.get(n)?.set(e,s)}}))}));const i=this.eventListenerRegistrations.get(r);i?.forEach((([n,r,i])=>{const s=e(r.toString());t(`[${this.hostTagName}] Removing event listener for "${s}" on "${n.tagName}"`);n.removeEventListener(s,i)}));delete this.registeredComponents[r]}getStore(t){const n=this.stores[t];if(!n){throw new Error(`[${this.hostTagName}] Store "${t.toString()}" not found.`)}return n}async setupStoreListeners(){const n=this;Object.entries(this.stores).forEach((([e,r])=>{t(`[${n.hostTagName}] Listening for changes in "${e}" store.`);r.use({set(r,i,s){t(`[${n.hostTagName}] Store "${e}" state "${r.toString()}" changed`,{newValue:i,oldValue:s});if(i===s){t(`[${n.hostTagName}] Store "${e}" state "${r.toString()}" unchanged. Skipping.`);return}const o=n.registeredComponents;if(!o){t(`[${n.hostTagName}] No registered components found. Skipping.`);return}const u=n.propStateRegistrations.get(e)?.get(r.toString())||[];t(`[${n.hostTagName}] Found ${u.length} prop(s) registered for "${r.toString()}" store.`,{props:u,propStateRegistrations:n.propStateRegistrations});u.forEach((({elementId:i,propKey:s})=>{const u=o[i];if(!u){t(`[${n.hostTagName}] Component "${i}" not found. Skipping.`,{component:u});return}const a=n.getStore(e);const c=a.state[r];u.element[s.toString()]=c;t(`[${n.hostTagName}] Setting "${u.name}" prop "${s.toString()}" to "${r.toString()}" value.`,{stateValue:c})}))}})}))}get hostTagName(){return this.host?.tagName?.toLowerCase()??"nylas-provider"}}class i extends r{}const s=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var o=Object.defineProperty;var u=(t,n,e)=>n in t?o(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var a=(t,n,e)=>(u(t,typeof n!="symbol"?n+"":n,e),e);var c=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(c||{});const l=t=>"error"in t;class h extends Error{constructor(t){super(t==null?void 0:t.message);a(this,"apiError");this.name="NylasAPIError",this.stack=(new Error).stack,this.apiError=t}}async function f(t){const n=(new TextEncoder).encode(t),e=await crypto.subtle.digest("SHA-256",n),r=Array.from(new Uint8Array(e)).map((t=>t.toString(16).padStart(2,"0"))).join("");return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:s,y=Object.keys,p=Array.isArray;function v(t,n){return typeof n!="object"||y(n).forEach((function(e){t[e]=n[e]})),t}typeof Promise>"u"||d.Promise||(d.Promise=Promise);const w=Object.getPrototypeOf,g={}.hasOwnProperty;function m(t,n){return g.call(t,n)}function b(t,n){typeof n=="function"&&(n=n(w(t))),(typeof Reflect>"u"?y:Reflect.ownKeys)(n).forEach((e=>{$(t,e,n[e])}))}const k=Object.defineProperty;function $(t,n,e,r){k(t,n,v(e&&m(e,"get")&&typeof e.get=="function"?{get:e.get,set:e.set,configurable:!0}:{value:e,configurable:!0,writable:!0},r))}function A(t){return{from:function(n){return t.prototype=Object.create(n.prototype),$(t.prototype,"constructor",t),{extend:b.bind(null,t.prototype)}}}}const S=Object.getOwnPropertyDescriptor;function x(t,n){let e;return S(t,n)||(e=w(t))&&x(e,n)}const P=[].slice;function E(t,n,e){return P.call(t,n,e)}function C(t,n){return n(t)}function O(t){if(!t)throw new Error("Assertion Failed")}function T(t){d.setImmediate?setImmediate(t):setTimeout(t,0)}function D(t,n){return t.reduce(((t,e,r)=>{var i=n(e,r);return i&&(t[i[0]]=i[1]),t}),{})}function I(t,n){if(m(t,n))return t[n];if(!n)return t;if(typeof n!="string"){for(var e=[],r=0,i=n.length;r<i;++r){var s=I(t,n[r]);e.push(s)}return e}var o=n.indexOf(".");if(o!==-1){var u=t[n.substr(0,o)];return u===void 0?void 0:I(u,n.substr(o+1))}}function j(t,n,e){if(t&&n!==void 0&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if(typeof n!="string"&&"length"in n){O(typeof e!="string"&&"length"in e);for(var r=0,i=n.length;r<i;++r)j(t,n[r],e[r])}else{var s=n.indexOf(".");if(s!==-1){var o=n.substr(0,s),u=n.substr(s+1);if(u==="")e===void 0?p(t)&&!isNaN(parseInt(o))?t.splice(o,1):delete t[o]:t[o]=e;else{var a=t[o];a&&m(t,o)||(a=t[o]={}),j(a,u,e)}}else e===void 0?p(t)&&!isNaN(parseInt(n))?t.splice(n,1):delete t[n]:t[n]=e}}function R(t){var n={};for(var e in t)m(t,e)&&(n[e]=t[e]);return n}const K=[].concat;function B(t){return K.apply([],t)}const _="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(B([8,16,32,64].map((t=>["Int","Uint","Float"].map((n=>n+t+"Array")))))).filter((t=>d[t])),q=_.map((t=>d[t]));D(_,(t=>[t,!0]));let N=null;function M(t){N=typeof WeakMap<"u"&&new WeakMap;const n=F(t);return N=null,n}function F(t){if(!t||typeof t!="object")return t;let n=N&&N.get(t);if(n)return n;if(p(t)){n=[],N&&N.set(t,n);for(var e=0,r=t.length;e<r;++e)n.push(F(t[e]))}else if(q.indexOf(t.constructor)>=0)n=t;else{const e=w(t);for(var i in n=e===Object.prototype?{}:Object.create(e),N&&N.set(t,n),t)m(t,i)&&(n[i]=F(t[i]))}return n}const{toString:U}={};function L(t){return U.call(t).slice(8,-1)}const V=typeof Symbol<"u"?Symbol.iterator:"@@iterator",H=typeof V=="symbol"?function(t){var n;return t!=null&&(n=t[V])&&n.apply(t)}:function(){return null},W={};function G(t){var n,e,r,i;if(arguments.length===1){if(p(t))return t.slice();if(this===W&&typeof t=="string")return[t];if(i=H(t)){for(e=[];!(r=i.next()).done;)e.push(r.value);return e}if(t==null)return[t];if(typeof(n=t.length)=="number"){for(e=new Array(n);n--;)e[n]=t[n];return e}return[t]}for(n=arguments.length,e=new Array(n);n--;)e[n]=arguments[n];return e}const z=typeof Symbol<"u"?t=>t[Symbol.toStringTag]==="AsyncFunction":()=>!1;var J=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(t,n){J=t,Q=n}var Q=()=>!0;const X=!new Error("").stack;function Z(){if(X)try{throw new Error}catch(t){return t}return new Error}function tt(t,n){var e=t.stack;return e?(n=n||0,e.indexOf(t.name)===0&&(n+=(t.name+t.message).split(`\n`).length),e.split(`\n`).slice(n).filter(Q).map((t=>`\n`+t)).join("")):""}var nt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],et=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(nt),rt={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 it(t,n){this._e=Z(),this.name=t,this.message=n}function st(t,n){return t+". Errors: "+Object.keys(n).map((t=>n[t].toString())).filter(((t,n,e)=>e.indexOf(t)===n)).join(`\n`)}function ot(t,n,e,r){this._e=Z(),this.failures=n,this.failedKeys=r,this.successCount=e,this.message=st(t,n)}function ut(t,n){this._e=Z(),this.name="BulkError",this.failures=Object.keys(n).map((t=>n[t])),this.failuresByPos=n,this.message=st(t,n)}A(it).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+tt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),A(ot).from(it),A(ut).from(it);var at=et.reduce(((t,n)=>(t[n]=n+"Error",t)),{});const ct=it;var lt=et.reduce(((t,n)=>{var e=n+"Error";function r(t,r){this._e=Z(),this.name=e,t?typeof t=="string"?(this.message=`${t}${r?`\n `+r:""}`,this.inner=r||null):typeof t=="object"&&(this.message=`${t.name} ${t.message}`,this.inner=t):(this.message=rt[n]||e,this.inner=null)}return A(r).from(ct),t[n]=r,t}),{});lt.Syntax=SyntaxError,lt.Type=TypeError,lt.Range=RangeError;var ht=nt.reduce(((t,n)=>(t[n+"Error"]=lt[n],t)),{}),ft=et.reduce(((t,n)=>(["Syntax","Type","Range"].indexOf(n)===-1&&(t[n+"Error"]=lt[n]),t)),{});function dt(){}function yt(t){return t}function pt(t,n){return t==null||t===yt?n:function(e){return n(t(e))}}function vt(t,n){return function(){t.apply(this,arguments),n.apply(this,arguments)}}function wt(t,n){return t===dt?n:function(){var e=t.apply(this,arguments);e!==void 0&&(arguments[0]=e);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=n.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?vt(r,this.onsuccess):r),i&&(this.onerror=this.onerror?vt(i,this.onerror):i),s!==void 0?s:e}}function gt(t,n){return t===dt?n:function(){t.apply(this,arguments);var e=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,n.apply(this,arguments),e&&(this.onsuccess=this.onsuccess?vt(e,this.onsuccess):e),r&&(this.onerror=this.onerror?vt(r,this.onerror):r)}}function mt(t,n){return t===dt?n:function(e){var r=t.apply(this,arguments);v(e,r);var i=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var o=n.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?vt(i,this.onsuccess):i),s&&(this.onerror=this.onerror?vt(s,this.onerror):s),r===void 0?o===void 0?void 0:o:v(r,o)}}function bt(t,n){return t===dt?n:function(){return n.apply(this,arguments)!==!1&&t.apply(this,arguments)}}function kt(t,n){return t===dt?n:function(){var e=t.apply(this,arguments);if(e&&typeof e.then=="function"){for(var r=this,i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return e.then((function(){return n.apply(r,s)}))}return n.apply(this,arguments)}}ft.ModifyError=ot,ft.DexieError=it,ft.BulkError=ut;var $t={};const At=100,[St,xt,Pt]=typeof Promise>"u"?[]:(()=>{let t=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[t,w(t),t];const n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,w(n),t]})(),Et=xt&&xt.then,Ct=St&&St.constructor,Ot=!!Pt;var Tt=!1,Dt=Pt?()=>{Pt.then(tn)}:d.setImmediate?setImmediate.bind(null,tn):d.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver((()=>{tn(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(tn,0)},It=function(t,n){Ft.push([t,n]),Rt&&(Dt(),Rt=!1)},jt=!0,Rt=!0,Kt=[],Bt=[],_t=null,qt=yt,Nt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((t=>{try{Pn(t[0],t[1])}catch{}}))}},Mt=Nt,Ft=[],Ut=0,Lt=[];function Vt(t){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=dt,this._lib=!1;var n=this._PSD=Mt;if(J&&(this._stackHolder=Z(),this._prev=null,this._numPrev=0),typeof t!="function"){if(t!==$t)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&zt(this,this._value))}this._state=null,this._value=null,++n.ref,Gt(this,t)}const Ht={get:function(){var t=Mt,n=hn;function e(e,r){var i=!t.global&&(t!==Mt||n!==hn);const s=i&&!pn();var o=new Vt(((n,o)=>{Yt(this,new Wt(An(e,t,i,s),An(r,t,i,s),n,o,t))}));return J&&Zt(o,this),o}return e.prototype=$t,e},set:function(t){$(this,"then",t&&t.prototype===$t?Ht:{get:function(){return t},set:Ht.set})}};function Wt(t,n,e,r,i){this.onFulfilled=typeof t=="function"?t:null,this.onRejected=typeof n=="function"?n:null,this.resolve=e,this.reject=r,this.psd=i}function Gt(t,n){try{n((n=>{if(t._state===null){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var e=t._lib&&nn();n&&typeof n.then=="function"?Gt(t,((t,e)=>{n instanceof Vt?n._then(t,e):n.then(t,e)})):(t._state=!0,t._value=n,Jt(t)),e&&en()}}),zt.bind(null,t))}catch(n){zt(t,n)}}function zt(t,n){if(Bt.push(n),t._state===null){var e=t._lib&&nn();n=qt(n),t._state=!1,t._value=n,J&&n!==null&&typeof n=="object"&&!n._promise&&function(t,n,e){try{t.apply(null,e)}catch(t){n&&n(t)}}((()=>{var e=x(n,"stack");n._promise=t,$(n,"stack",{get:()=>Tt?e&&(e.get?e.get.apply(n):e.value):t.stack})})),function(t){Kt.some((n=>n._value===t._value))||Kt.push(t)}(t),Jt(t),e&&en()}}function Jt(t){var n=t._listeners;t._listeners=[];for(var e=0,r=n.length;e<r;++e)Yt(t,n[e]);var i=t._PSD;--i.ref||i.finalize(),Ut===0&&(++Ut,It((()=>{--Ut==0&&rn()}),[]))}function Yt(t,n){if(t._state!==null){var e=t._state?n.onFulfilled:n.onRejected;if(e===null)return(t._state?n.resolve:n.reject)(t._value);++n.psd.ref,++Ut,It(Qt,[e,t,n])}else t._listeners.push(n)}function Qt(t,n,e){try{_t=n;var r,i=n._value;n._state?r=t(i):(Bt.length&&(Bt=[]),r=t(i),Bt.indexOf(i)===-1&&function(t){for(var n=Kt.length;n;)if(Kt[--n]._value===t._value)return void Kt.splice(n,1)}(n)),e.resolve(r)}catch(t){e.reject(t)}finally{_t=null,--Ut==0&&rn(),--e.psd.ref||e.psd.finalize()}}function Xt(t,n,e){if(n.length===e)return n;var r="";if(t._state===!1){var i,s,o=t._value;o!=null?(i=o.name||"Error",s=o.message||o,r=tt(o,0)):(i=o,s=""),n.push(i+(s?": "+s:"")+r)}return J&&((r=tt(t._stackHolder,2))&&n.indexOf(r)===-1&&n.push(r),t._prev&&Xt(t._prev,n,e)),n}function Zt(t,n){var e=n?n._numPrev+1:0;e<100&&(t._prev=n,t._numPrev=e)}function tn(){nn()&&en()}function nn(){var t=jt;return jt=!1,Rt=!1,t}function en(){var t,n,e;do{for(;Ft.length>0;)for(t=Ft,Ft=[],e=t.length,n=0;n<e;++n){var r=t[n];r[0].apply(null,r[1])}}while(Ft.length>0);jt=!0,Rt=!0}function rn(){var t=Kt;Kt=[],t.forEach((t=>{t._PSD.onunhandled.call(null,t._value,t)}));for(var n=Lt.slice(0),e=n.length;e;)n[--e]()}function sn(t){return new Vt($t,!1,t)}function on(t,n){var e=Mt;return function(){var r=nn(),i=Mt;try{return mn(e,!0),t.apply(this,arguments)}catch(t){n&&n(t)}finally{mn(i,!1),r&&en()}}}b(Vt.prototype,{then:Ht,_then:function(t,n){Yt(this,new Wt(null,null,t,n,Mt))},catch:function(t){if(arguments.length===1)return this.then(null,t);var n=arguments[0],e=arguments[1];return typeof n=="function"?this.then(null,(t=>t instanceof n?e(t):sn(t))):this.then(null,(t=>t&&t.name===n?e(t):sn(t)))},finally:function(t){return this.then((n=>(t(),n)),(n=>(t(),sn(n))))},stack:{get:function(){if(this._stack)return this._stack;try{Tt=!0;var t=Xt(this,[],20).join(`\nFrom previous: `);return this._state!==null&&(this._stack=t),t}finally{Tt=!1}}},timeout:function(t,n){return t<1/0?new Vt(((e,r)=>{var i=setTimeout((()=>r(new lt.Timeout(n))),t);this.then(e,r).finally(clearTimeout.bind(null,i))})):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&$(Vt.prototype,Symbol.toStringTag,"Dexie.Promise"),Nt.env=bn(),b(Vt,{all:function(){var t=G.apply(null,arguments).map(vn);return new Vt((function(n,e){t.length===0&&n([]);var r=t.length;t.forEach(((i,s)=>Vt.resolve(i).then((e=>{t[s]=e,--r||n(t)}),e)))}))},resolve:t=>{if(t instanceof Vt)return t;if(t&&typeof t.then=="function")return new Vt(((n,e)=>{t.then(n,e)}));var n=new Vt($t,!0,t);return Zt(n,_t),n},reject:sn,race:function(){var t=G.apply(null,arguments).map(vn);return new Vt(((n,e)=>{t.map((t=>Vt.resolve(t).then(n,e)))}))},PSD:{get:()=>Mt,set:t=>Mt=t},totalEchoes:{get:()=>hn},newPSD:dn,usePSD:kn,scheduler:{get:()=>It,set:t=>{It=t}},rejectionMapper:{get:()=>qt,set:t=>{qt=t}},follow:(t,n)=>new Vt(((e,r)=>dn(((n,e)=>{var r=Mt;r.unhandleds=[],r.onunhandled=e,r.finalize=vt((function(){(function(t){function n(){t(),Lt.splice(Lt.indexOf(n),1)}Lt.push(n),++Ut,It((()=>{--Ut==0&&rn()}),[])})((()=>{this.unhandleds.length===0?n():e(this.unhandleds[0])}))}),r.finalize),t()}),n,e,r)))}),Ct&&(Ct.allSettled&&$(Vt,"allSettled",(function(){const t=G.apply(null,arguments).map(vn);return new Vt((n=>{t.length===0&&n([]);let e=t.length;const r=new Array(e);t.forEach(((t,i)=>Vt.resolve(t).then((t=>r[i]={status:"fulfilled",value:t}),(t=>r[i]={status:"rejected",reason:t})).then((()=>--e||n(r)))))}))})),Ct.any&&typeof AggregateError<"u"&&$(Vt,"any",(function(){const t=G.apply(null,arguments).map(vn);return new Vt(((n,e)=>{t.length===0&&e(new AggregateError([]));let r=t.length;const i=new Array(r);t.forEach(((t,s)=>Vt.resolve(t).then((t=>n(t)),(t=>{i[s]=t,--r||e(new AggregateError(i))}))))}))})));const un={awaits:0,echoes:0,id:0};var an=0,cn=[],ln=0,hn=0,fn=0;function dn(t,n,e,r){var i=Mt,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++fn;var o=Nt.env;s.env=Ot?{Promise:Vt,PromiseProp:{value:Vt,configurable:!0,writable:!0},all:Vt.all,race:Vt.race,allSettled:Vt.allSettled,any:Vt.any,resolve:Vt.resolve,reject:Vt.reject,nthen:Sn(o.nthen,s),gthen:Sn(o.gthen,s)}:{},n&&v(s,n),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=kn(s,t,e,r);return s.ref===0&&s.finalize(),u}function yn(){return un.id||(un.id=++an),++un.awaits,un.echoes+=At,un.id}function pn(){return!!un.awaits&&(--un.awaits==0&&(un.id=0),un.echoes=un.awaits*At,!0)}function vn(t){return un.echoes&&t&&t.constructor===Ct?(yn(),t.then((t=>(pn(),t)),(t=>(pn(),En(t))))):t}function wn(t){++hn,un.echoes&&--un.echoes!=0||(un.echoes=un.id=0),cn.push(Mt),mn(t,!0)}function gn(){var t=cn[cn.length-1];cn.pop(),mn(t,!1)}function mn(t,n){var e=Mt;if((n?!un.echoes||ln++&&t===Mt:!ln||--ln&&t===Mt)||$n(n?wn.bind(null,t):gn),t!==Mt&&(Mt=t,e===Nt&&(Nt.env=bn()),Ot)){var r=Nt.env.Promise,i=t.env;xt.then=i.nthen,r.prototype.then=i.gthen,(e.global||t.global)&&(Object.defineProperty(d,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function bn(){var t=d.Promise;return Ot?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(d,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:xt.then,gthen:t.prototype.then}:{}}function kn(t,n,e,r,i){var s=Mt;try{return mn(t,!0),n(e,r,i)}finally{mn(s,!1)}}function $n(t){Et.call(St,t)}function An(t,n,e,r){return typeof t!="function"?t:function(){var i=Mt;e&&yn(),mn(n,!0);try{return t.apply(this,arguments)}finally{mn(i,!1),r&&$n(pn)}}}function Sn(t,n){return function(e,r){return t.call(this,An(e,n),An(r,n))}}(""+Et).indexOf("[native code]")===-1&&(yn=pn=dt);const xn="unhandledrejection";function Pn(t,n){var e;try{e=n.onuncatched(t)}catch{}if(e!==!1)try{var r,i={promise:n,reason:t};if(d.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(xn,!0,!0),v(r,i)):d.CustomEvent&&v(r=new CustomEvent(xn,{detail:i}),i),r&&d.dispatchEvent&&(dispatchEvent(r),!d.PromiseRejectionEvent&&d.onunhandledrejection))try{d.onunhandledrejection(r)}catch{}J&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${t.stack||t}`)}catch{}}var En=Vt.reject;function Cn(t,n,e,r){if(t.idbdb&&(t._state.openComplete||Mt.letThrough||t._vip)){var i=t._createTransaction(n,e,t._dbSchema);try{i.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===at.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((()=>Cn(t,n,e,r)))):En(i)}return i._promise(n,((t,n)=>dn((()=>(Mt.trans=i,r(t,n,i)))))).then((t=>i._completion.then((()=>t))))}if(t._state.openComplete)return En(new lt.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return En(new lt.DatabaseClosed);t.open().catch(dt)}return t._state.dbReadyPromise.then((()=>Cn(t,n,e,r)))}const On="3.2.4",Tn=String.fromCharCode(65535),Dn=-1/0,In="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",jn="String expected.",Rn=[],Kn=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Bn=Kn,_n=Kn,qn=t=>!/(dexie\.js|dexie\.min\.js)/.test(t),Nn="__dbnames",Mn="readonly",Fn="readwrite";function Un(t,n){return t?n?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:t:n}const Ln={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Vn(t){return typeof t!="string"||/\./.test(t)?t=>t:n=>(n[t]===void 0&&t in n&&delete(n=M(n))[t],n)}class Hn{_trans(t,n,e){const r=this._tx||Mt.trans,i=this.name;function s(t,e,r){if(!r.schema[i])throw new lt.NotFound("Table "+i+" not part of transaction");return n(r.idbtrans,r)}const o=nn();try{return r&&r.db===this.db?r===Mt.trans?r._promise(t,s,e):dn((()=>r._promise(t,s,e)),{trans:r,transless:Mt.transless||Mt}):Cn(this.db,t,[this.name],s)}finally{o&&en()}}get(t,n){return t&&t.constructor===Object?this.where(t).first(n):this._trans("readonly",(n=>this.core.get({trans:n,key:t}).then((t=>this.hook.reading.fire(t))))).then(n)}where(t){if(typeof t=="string")return new this.db.WhereClause(this,t);if(p(t))return new this.db.WhereClause(this,`[${t.join("+")}]`);const n=y(t);if(n.length===1)return this.where(n[0]).equals(t[n[0]]);const e=this.schema.indexes.concat(this.schema.primKey).filter((t=>t.compound&&n.every((n=>t.keyPath.indexOf(n)>=0))&&t.keyPath.every((t=>n.indexOf(t)>=0))))[0];if(e&&this.db._maxKey!==Tn)return this.where(e.name).equals(e.keyPath.map((n=>t[n])));!e&&J&&console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function s(t,n){try{return i.cmp(t,n)===0}catch{return!1}}const[o,u]=n.reduce((([n,e],i)=>{const o=r[i],u=t[i];return[n||o,n||!o?Un(e,o&&o.multi?t=>{const n=I(t,i);return p(n)&&n.some((t=>s(u,t)))}:t=>s(u,I(t,i))):e]}),[null,null]);return o?this.where(o.name).equals(t[o.keyPath]).filter(u):e?this.filter(u):this.where(n).equals("")}filter(t){return this.toCollection().and(t)}count(t){return this.toCollection().count(t)}offset(t){return this.toCollection().offset(t)}limit(t){return this.toCollection().limit(t)}each(t){return this.toCollection().each(t)}toArray(t){return this.toCollection().toArray(t)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(t){return new this.db.Collection(new this.db.WhereClause(this,p(t)?`[${t.join("+")}]`:t))}reverse(){return this.toCollection().reverse()}mapToClass(t){this.schema.mappedClass=t;const n=n=>{if(!n)return n;const e=Object.create(t.prototype);for(var r in n)if(m(n,r))try{e[r]=n[r]}catch{}return e};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),t}defineClass(){return this.mapToClass((function(t){v(this,t)}))}add(t,n){const{auto:e,keyPath:r}=this.schema.primKey;let i=t;return r&&e&&(i=Vn(r)(t)),this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"add",keys:n!=null?[n]:null,values:[i]}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):t.lastResult)).then((n=>{if(r)try{j(t,r,n)}catch{}return n}))}update(t,n){if(typeof t!="object"||p(t))return this.where(":id").equals(t).modify(n);{const e=I(t,this.schema.primKey.keyPath);if(e===void 0)return En(new lt.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?y(n).forEach((e=>{j(t,e,n[e])})):n(t,{value:t,primKey:e})}catch{}return this.where(":id").equals(e).modify(n)}}put(t,n){const{auto:e,keyPath:r}=this.schema.primKey;let i=t;return r&&e&&(i=Vn(r)(t)),this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"put",values:[i],keys:n!=null?[n]:null}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):t.lastResult)).then((n=>{if(r)try{j(t,r,n)}catch{}return n}))}delete(t){return this._trans("readwrite",(n=>this.core.mutate({trans:n,type:"delete",keys:[t]}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):void 0))}clear(){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"deleteRange",range:Ln}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):void 0))}bulkGet(t){return this._trans("readonly",(n=>this.core.getMany({keys:t,trans:n}).then((t=>t.map((t=>this.hook.reading.fire(t)))))))}bulkAdd(t,n,e){const r=Array.isArray(n)?n:void 0,i=(e=e||(r?void 0:n))?e.allKeys:void 0;return this._trans("readwrite",(n=>{const{auto:e,keyPath:s}=this.schema.primKey;if(s&&r)throw new lt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new lt.InvalidArgument("Arguments objects and keys must have the same length");const o=t.length;let u=s&&e?t.map(Vn(s)):t;return this.core.mutate({trans:n,type:"add",keys:r,values:u,wantResults:i}).then((({numFailures:t,results:n,lastResult:e,failures:r})=>{if(t===0)return i?n:e;throw new ut(`${this.name}.bulkAdd(): ${t} of ${o} operations failed`,r)}))}))}bulkPut(t,n,e){const r=Array.isArray(n)?n:void 0,i=(e=e||(r?void 0:n))?e.allKeys:void 0;return this._trans("readwrite",(n=>{const{auto:e,keyPath:s}=this.schema.primKey;if(s&&r)throw new lt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new lt.InvalidArgument("Arguments objects and keys must have the same length");const o=t.length;let u=s&&e?t.map(Vn(s)):t;return this.core.mutate({trans:n,type:"put",keys:r,values:u,wantResults:i}).then((({numFailures:t,results:n,lastResult:e,failures:r})=>{if(t===0)return i?n:e;throw new ut(`${this.name}.bulkPut(): ${t} of ${o} operations failed`,r)}))}))}bulkDelete(t){const n=t.length;return this._trans("readwrite",(n=>this.core.mutate({trans:n,type:"delete",keys:t}))).then((({numFailures:t,lastResult:e,failures:r})=>{if(t===0)return e;throw new ut(`${this.name}.bulkDelete(): ${t} of ${n} operations failed`,r)}))}}function Wn(t){var n={},e=function(e,r){if(r){for(var i=arguments.length,s=new Array(i-1);--i;)s[i-1]=arguments[i];return n[e].subscribe.apply(null,s),t}if(typeof e=="string")return n[e]};e.addEventType=s;for(var r=1,i=arguments.length;r<i;++r)s(arguments[r]);return e;function s(t,r,i){if(typeof t!="object"){var o;r||(r=bt),i||(i=dt);var u={subscribers:[],fire:i,subscribe:function(t){u.subscribers.indexOf(t)===-1&&(u.subscribers.push(t),u.fire=r(u.fire,t))},unsubscribe:function(t){u.subscribers=u.subscribers.filter((function(n){return n!==t})),u.fire=u.subscribers.reduce(r,i)}};return n[t]=e[t]=u,u}y(o=t).forEach((function(t){var n=o[t];if(p(n))s(t,o[t][0],o[t][1]);else{if(n!=="asap")throw new lt.InvalidArgument("Invalid event config");var e=s(t,yt,(function(){for(var t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];e.subscribers.forEach((function(t){T((function(){t.apply(null,n)}))}))}))}}))}}function Gn(t,n){return A(n).from({prototype:t}),n}function zn(t,n){return!(t.filter||t.algorithm||t.or)&&(n?t.justLimit:!t.replayFilter)}function Jn(t,n){t.filter=Un(t.filter,n)}function Yn(t,n,e){var r=t.replayFilter;t.replayFilter=r?()=>Un(r(),n()):n,t.justLimit=e&&!r}function Qn(t,n){if(t.isPrimKey)return n.primaryKey;const e=n.getIndexByKeyPath(t.index);if(!e)throw new lt.Schema("KeyPath "+t.index+" on object store "+n.name+" is not indexed");return e}function Xn(t,n,e){const r=Qn(t,n.schema);return n.openCursor({trans:e,values:!t.keysOnly,reverse:t.dir==="prev",unique:!!t.unique,query:{index:r,range:t.range}})}function Zn(t,n,e,r){const i=t.replayFilter?Un(t.filter,t.replayFilter()):t.filter;if(t.or){const s={},o=(t,e,r)=>{if(!i||i(e,r,(t=>e.stop(t)),(t=>e.fail(t)))){var o=e.primaryKey,u=""+o;u==="[object ArrayBuffer]"&&(u=""+new Uint8Array(o)),m(s,u)||(s[u]=!0,n(t,e,r))}};return Promise.all([t.or._iterate(o,e),te(Xn(t,r,e),t.algorithm,o,!t.keysOnly&&t.valueMapper)])}return te(Xn(t,r,e),Un(t.algorithm,i),n,!t.keysOnly&&t.valueMapper)}function te(t,n,e,r){var i=on(r?(t,n,i)=>e(r(t),n,i):e);return t.then((t=>{if(t)return t.start((()=>{var e=()=>t.continue();n&&!n(t,(t=>e=t),(n=>{t.stop(n),e=dt}),(n=>{t.fail(n),e=dt}))||i(t.value,t,(t=>e=t)),e()}))}))}function ne(t,n){try{const e=ee(t),r=ee(n);if(e!==r)return e==="Array"?1:r==="Array"?-1:e==="binary"?1:r==="binary"?-1:e==="string"?1:r==="string"?-1:e==="Date"?1:r!=="Date"?NaN:-1;switch(e){case"number":case"Date":case"string":return t>n?1:t<n?-1:0;case"binary":return function(t,n){const e=t.length,r=n.length,i=e<r?e:r;for(let e=0;e<i;++e)if(t[e]!==n[e])return t[e]<n[e]?-1:1;return e===r?0:e<r?-1:1}(re(t),re(n));case"Array":return function(t,n){const e=t.length,r=n.length,i=e<r?e:r;for(let e=0;e<i;++e){const r=ne(t[e],n[e]);if(r!==0)return r}return e===r?0:e<r?-1:1}(t,n)}}catch{}return NaN}function ee(t){const n=typeof t;if(n!=="object")return n;if(ArrayBuffer.isView(t))return"binary";const e=L(t);return e==="ArrayBuffer"?"binary":e}function re(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}class ie{_read(t,n){var e=this._ctx;return e.error?e.table._trans(null,En.bind(null,e.error)):e.table._trans("readonly",t).then(n)}_write(t){var n=this._ctx;return n.error?n.table._trans(null,En.bind(null,n.error)):n.table._trans("readwrite",t,"locked")}_addAlgorithm(t){var n=this._ctx;n.algorithm=Un(n.algorithm,t)}_iterate(t,n){return Zn(this._ctx,t,n,this._ctx.table.core)}clone(t){var n=Object.create(this.constructor.prototype),e=Object.create(this._ctx);return t&&v(e,t),n._ctx=e,n}raw(){return this._ctx.valueMapper=null,this}each(t){var n=this._ctx;return this._read((e=>Zn(n,t,e,n.table.core)))}count(t){return this._read((t=>{const n=this._ctx,e=n.table.core;if(zn(n,!0))return e.count({trans:t,query:{index:Qn(n,e.schema),range:n.range}}).then((t=>Math.min(t,n.limit)));var r=0;return Zn(n,(()=>(++r,!1)),t,e).then((()=>r))})).then(t)}sortBy(t,n){const e=t.split(".").reverse(),r=e[0],i=e.length-1;function s(t,n){return n?s(t[e[n]],n-1):t[r]}var o=this._ctx.dir==="next"?1:-1;function u(t,n){var e=s(t,i),r=s(n,i);return e<r?-o:e>r?o:0}return this.toArray((function(t){return t.sort(u)})).then(n)}toArray(t){return this._read((t=>{var n=this._ctx;if(n.dir==="next"&&zn(n,!0)&&n.limit>0){const{valueMapper:e}=n,r=Qn(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:r,range:n.range}}).then((({result:t})=>e?t.map(e):t))}{const e=[];return Zn(n,(t=>e.push(t)),t,n.table.core).then((()=>e))}}),t)}offset(t){var n=this._ctx;return t<=0||(n.offset+=t,zn(n)?Yn(n,(()=>{var n=t;return(t,e)=>n===0||(n===1?(--n,!1):(e((()=>{t.advance(n),n=0})),!1))})):Yn(n,(()=>{var n=t;return()=>--n<0}))),this}limit(t){return this._ctx.limit=Math.min(this._ctx.limit,t),Yn(this._ctx,(()=>{var n=t;return function(t,e,r){return--n<=0&&e(r),n>=0}}),!0),this}until(t,n){return Jn(this._ctx,(function(e,r,i){return!t(e.value)||(r(i),n)})),this}first(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)}last(t){return this.reverse().first(t)}filter(t){var n,e;return Jn(this._ctx,(function(n){return t(n.value)})),n=this._ctx,e=t,n.isMatch=Un(n.isMatch,e),this}and(t){return this.filter(t)}or(t){return new this.db.WhereClause(this._ctx.table,t,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(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each((function(n,e){t(e.key,e)}))}eachUniqueKey(t){return this._ctx.unique="unique",this.eachKey(t)}eachPrimaryKey(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each((function(n,e){t(e.primaryKey,e)}))}keys(t){var n=this._ctx;n.keysOnly=!n.isMatch;var e=[];return this.each((function(t,n){e.push(n.key)})).then((function(){return e})).then(t)}primaryKeys(t){var n=this._ctx;if(n.dir==="next"&&zn(n,!0)&&n.limit>0)return this._read((t=>{var e=Qn(n,n.table.core.schema);return n.table.core.query({trans:t,values:!1,limit:n.limit,query:{index:e,range:n.range}})})).then((({result:t})=>t)).then(t);n.keysOnly=!n.isMatch;var e=[];return this.each((function(t,n){e.push(n.primaryKey)})).then((function(){return e})).then(t)}uniqueKeys(t){return this._ctx.unique="unique",this.keys(t)}firstKey(t){return this.limit(1).keys((function(t){return t[0]})).then(t)}lastKey(t){return this.reverse().firstKey(t)}distinct(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var e={};return Jn(this._ctx,(function(t){var n=t.primaryKey.toString(),r=m(e,n);return e[n]=!0,!r})),this}modify(t){var n=this._ctx;return this._write((e=>{var r;if(typeof t=="function")r=t;else{var i=y(t),s=i.length;r=function(n){for(var e=!1,r=0;r<s;++r){var o=i[r],u=t[o];I(n,o)!==u&&(j(n,o,u),e=!0)}return e}}const o=n.table.core,{outbound:u,extractKey:a}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const f=[],d=(t,n)=>{const{failures:e,numFailures:r}=n;h+=t-r;for(let t of y(e))l.push(e[t])};return this.clone().primaryKeys().then((i=>{const s=l=>{const h=Math.min(c,i.length-l);return o.getMany({trans:e,keys:i.slice(l,l+h),cache:"immutable"}).then((f=>{const y=[],p=[],v=u?[]:null,w=[];for(let t=0;t<h;++t){const n=f[t],e={value:M(n),primKey:i[l+t]};r.call(e,e.value,e)!==!1&&(e.value==null?w.push(i[l+t]):u||ne(a(n),a(e.value))===0?(p.push(e.value),u&&v.push(i[l+t])):(w.push(i[l+t]),y.push(e.value)))}const g=zn(n)&&n.limit===1/0&&(typeof t!="function"||t===se)&&{index:n.index,range:n.range};return Promise.resolve(y.length>0&&o.mutate({trans:e,type:"add",values:y}).then((t=>{for(let n in t.failures)w.splice(parseInt(n),1);d(y.length,t)}))).then((()=>(p.length>0||g&&typeof t=="object")&&o.mutate({trans:e,type:"put",keys:v,values:p,criteria:g,changeSpec:typeof t!="function"&&t}).then((t=>d(p.length,t))))).then((()=>(w.length>0||g&&t===se)&&o.mutate({trans:e,type:"delete",keys:w,criteria:g}).then((t=>d(w.length,t))))).then((()=>i.length>l+h&&s(l+c)))}))};return s(0).then((()=>{if(l.length>0)throw new ot("Error modifying one or more objects",l,h,f);return i.length}))}))}))}delete(){var t=this._ctx,n=t.range;return zn(t)&&(t.isPrimKey&&!_n||n.type===3)?this._write((e=>{const{primaryKey:r}=t.table.core.schema,i=n;return t.table.core.count({trans:e,query:{index:r,range:i}}).then((n=>t.table.core.mutate({trans:e,type:"deleteRange",range:i}).then((({failures:t,lastResult:e,results:r,numFailures:i})=>{if(i)throw new ot("Could not delete some values",Object.keys(t).map((n=>t[n])),n-i);return n-i}))))})):this.modify(se)}}const se=(t,n)=>n.value=null;function oe(t,n){return t<n?-1:t===n?0:1}function ue(t,n){return t>n?-1:t===n?0:1}function ae(t,n,e){var r=t instanceof ye?new t.Collection(t):t;return r._ctx.error=e?new e(n):new TypeError(n),r}function ce(t){return new t.Collection(t,(()=>de(""))).limit(0)}function le(t,n,e,r,i,s){for(var o=Math.min(t.length,r.length),u=-1,a=0;a<o;++a){var c=n[a];if(c!==r[a])return i(t[a],e[a])<0?t.substr(0,a)+e[a]+e.substr(a+1):i(t[a],r[a])<0?t.substr(0,a)+r[a]+e.substr(a+1):u>=0?t.substr(0,u)+n[u]+e.substr(u+1):null;i(t[a],c)<0&&(u=a)}return o<r.length&&s==="next"?t+e.substr(t.length):o<t.length&&s==="prev"?t.substr(0,e.length):u<0?null:t.substr(0,u)+r[u]+e.substr(u+1)}function he(t,n,e,r){var i,s,o,u,a,c,l,h=e.length;if(!e.every((t=>typeof t=="string")))return ae(t,jn);function f(t){i=function(t){return t==="next"?t=>t.toUpperCase():t=>t.toLowerCase()}(t),s=function(t){return t==="next"?t=>t.toLowerCase():t=>t.toUpperCase()}(t),o=t==="next"?oe:ue;var n=e.map((function(t){return{lower:s(t),upper:i(t)}})).sort((function(t,n){return o(t.lower,n.lower)}));u=n.map((function(t){return t.upper})),a=n.map((function(t){return t.lower})),c=t,l=t==="next"?"":r}f("next");var d=new t.Collection(t,(()=>fe(u[0],a[h-1]+r)));d._ondirectionchange=function(t){f(t)};var y=0;return d._addAlgorithm((function(t,e,r){var i=t.key;if(typeof i!="string")return!1;var f=s(i);if(n(f,a,y))return!0;for(var d=null,p=y;p<h;++p){var v=le(i,f,u[p],a[p],o,c);v===null&&d===null?y=p+1:(d===null||o(d,v)>0)&&(d=v)}return e(d!==null?function(){t.continue(d+l)}:r),!1})),d}function fe(t,n,e,r){return{type:2,lower:t,upper:n,lowerOpen:e,upperOpen:r}}function de(t){return{type:1,lower:t,upper:t}}class ye{get Collection(){return this._ctx.table.db.Collection}between(t,n,e,r){e=e!==!1,r=r===!0;try{return this._cmp(t,n)>0||this._cmp(t,n)===0&&(e||r)&&(!e||!r)?ce(this):new this.Collection(this,(()=>fe(t,n,!e,!r)))}catch{return ae(this,In)}}equals(t){return t==null?ae(this,In):new this.Collection(this,(()=>de(t)))}above(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(t,void 0,!0)))}aboveOrEqual(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(t,void 0,!1)))}below(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(void 0,t,!1,!0)))}belowOrEqual(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(void 0,t)))}startsWith(t){return typeof t!="string"?ae(this,jn):this.between(t,t+Tn,!0,!0)}startsWithIgnoreCase(t){return t===""?this.startsWith(t):he(this,((t,n)=>t.indexOf(n[0])===0),[t],Tn)}equalsIgnoreCase(t){return he(this,((t,n)=>t===n[0]),[t],"")}anyOfIgnoreCase(){var t=G.apply(W,arguments);return t.length===0?ce(this):he(this,((t,n)=>n.indexOf(t)!==-1),t,"")}startsWithAnyOfIgnoreCase(){var t=G.apply(W,arguments);return t.length===0?ce(this):he(this,((t,n)=>n.some((n=>t.indexOf(n)===0))),t,Tn)}anyOf(){const t=G.apply(W,arguments);let n=this._cmp;try{t.sort(n)}catch{return ae(this,In)}if(t.length===0)return ce(this);const e=new this.Collection(this,(()=>fe(t[0],t[t.length-1])));e._ondirectionchange=e=>{n=e==="next"?this._ascending:this._descending,t.sort(n)};let r=0;return e._addAlgorithm(((e,i,s)=>{const o=e.key;for(;n(o,t[r])>0;)if(++r,r===t.length)return i(s),!1;return n(o,t[r])===0||(i((()=>{e.continue(t[r])})),!1)})),e}notEqual(t){return this.inAnyRange([[Dn,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const t=G.apply(W,arguments);if(t.length===0)return new this.Collection(this);try{t.sort(this._ascending)}catch{return ae(this,In)}const n=t.reduce(((t,n)=>t?t.concat([[t[t.length-1][1],n]]):[[Dn,n]]),null);return n.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})}inAnyRange(t,n){const e=this._cmp,r=this._ascending,i=this._descending,s=this._min,o=this._max;if(t.length===0)return ce(this);if(!t.every((t=>t[0]!==void 0&&t[1]!==void 0&&r(t[0],t[1])<=0)))return ae(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",lt.InvalidArgument);const u=!n||n.includeLowers!==!1,a=n&&n.includeUppers===!0;let c,l=r;function h(t,n){return l(t[0],n[0])}try{c=t.reduce((function(t,n){let r=0,i=t.length;for(;r<i;++r){const i=t[r];if(e(n[0],i[1])<0&&e(n[1],i[0])>0){i[0]=s(i[0],n[0]),i[1]=o(i[1],n[1]);break}}return r===i&&t.push(n),t}),[]),c.sort(h)}catch{return ae(this,In)}let f=0;const d=a?t=>r(t,c[f][1])>0:t=>r(t,c[f][1])>=0,y=u?t=>i(t,c[f][0])>0:t=>i(t,c[f][0])>=0;let p=d;const v=new this.Collection(this,(()=>fe(c[0][0],c[c.length-1][1],!u,!a)));return v._ondirectionchange=t=>{t==="next"?(p=d,l=r):(p=y,l=i),c.sort(h)},v._addAlgorithm(((t,n,e)=>{for(var i=t.key;p(i);)if(++f,f===c.length)return n(e),!1;return!!function(t){return!d(t)&&!y(t)}(i)||(this._cmp(i,c[f][1])===0||this._cmp(i,c[f][0])===0||n((()=>{l===r?t.continue(c[f][0]):t.continue(c[f][1])})),!1)})),v}startsWithAnyOf(){const t=G.apply(W,arguments);return t.every((t=>typeof t=="string"))?t.length===0?ce(this):this.inAnyRange(t.map((t=>[t,t+Tn]))):ae(this,"startsWithAnyOf() only works with strings")}}function pe(t){return on((function(n){return ve(n),t(n.target.error),!1}))}function ve(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}const we="storagemutated",ge="x-storagemutated-1",me=Wn(null,we);class be{_lock(){return O(!Mt.global),++this._reculock,this._reculock!==1||Mt.global||(Mt.lockOwnerFor=this),this}_unlock(){if(O(!Mt.global),--this._reculock==0)for(Mt.global||(Mt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{kn(t[1],t[0])}catch{}}return this}_locked(){return this._reculock&&Mt.lockOwnerFor!==this}create(t){if(!this.mode)return this;const n=this.db.idbdb,e=this.db._state.dbOpenError;if(O(!this.idbtrans),!t&&!n)switch(e&&e.name){case"DatabaseClosedError":throw new lt.DatabaseClosed(e);case"MissingAPIError":throw new lt.MissingAPI(e.message,e);default:throw new lt.OpenFailed(e)}if(!this.active)throw new lt.TransactionInactive;return O(this._completion._state===null),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=on((n=>{ve(n),this._reject(t.error)})),t.onabort=on((n=>{ve(n),this.active&&this._reject(new lt.Abort(t.error)),this.active=!1,this.on("abort").fire(n)})),t.oncomplete=on((()=>{this.active=!1,this._resolve(),"mutatedParts"in t&&me.storagemutated.fire(t.mutatedParts)})),this}_promise(t,n,e){if(t==="readwrite"&&this.mode!=="readwrite")return En(new lt.ReadOnly("Transaction is readonly"));if(!this.active)return En(new lt.TransactionInactive);if(this._locked())return new Vt(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(t,n,e).then(r,i)},Mt])}));if(e)return dn((()=>{var t=new Vt(((t,e)=>{this._lock();const r=n(t,e,this);r&&r.then&&r.then(t,e)}));return t.finally((()=>this._unlock())),t._lib=!0,t}));var r=new Vt(((t,e)=>{var r=n(t,e,this);r&&r.then&&r.then(t,e)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(t){var n=this._root();const e=Vt.resolve(t);if(n._waitingFor)n._waitingFor=n._waitingFor.then((()=>e));else{n._waitingFor=e,n._waitingQueue=[];var r=n.idbtrans.objectStore(n.storeNames[0]);(function t(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(r.get(-1/0).onsuccess=t)})()}var i=n._waitingFor;return new Vt(((t,r)=>{e.then((e=>n._waitingQueue.push(on(t.bind(null,e)))),(t=>n._waitingQueue.push(on(r.bind(null,t))))).finally((()=>{n._waitingFor===i&&(n._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new lt.Abort))}table(t){const n=this._memoizedTables||(this._memoizedTables={});if(m(n,t))return n[t];const e=this.schema[t];if(!e)throw new lt.NotFound("Table "+t+" not part of transaction");const r=new this.db.Table(t,e,this);return r.core=this.db.core.table(t),n[t]=r,r}}function ke(t,n,e,r,i,s,o){return{name:t,keyPath:n,unique:e,multi:r,auto:i,compound:s,src:(e&&!o?"&":"")+(r?"*":"")+(i?"++":"")+$e(n)}}function $e(t){return typeof t=="string"?t:t?"["+[].join.call(t,"+")+"]":""}function Ae(t,n,e){return{name:t,primKey:n,indexes:e,mappedClass:null,idxByName:D(e,(t=>[t.name,t]))}}let Se=t=>{try{return t.only([[]]),Se=()=>[[]],[[]]}catch{return Se=()=>Tn,Tn}};function xe(t){return t==null?()=>{}:typeof t=="string"?function(t){return t.split(".").length===1?n=>n[t]:n=>I(n,t)}(t):n=>I(n,t)}function Pe(t){return[].slice.call(t)}let Ee=0;function Ce(t){return t==null?":id":typeof t=="string"?t:`[${t.join("+")}]`}function Oe(t,n,e){function r(t){if(t.type===3)return null;if(t.type===4)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:e,upper:r,lowerOpen:i,upperOpen:s}=t;return e===void 0?r===void 0?null:n.upperBound(r,!!s):r===void 0?n.lowerBound(e,!!i):n.bound(e,r,!!i,!!s)}const{schema:i,hasGetAll:s}=function(t,n){const e=Pe(t.objectStoreNames);return{schema:{name:t.name,tables:e.map((t=>n.objectStore(t))).map((t=>{const{keyPath:n,autoIncrement:e}=t,r=p(n),i=n==null,s={},o={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:n,autoIncrement:e,unique:!0,extractKey:xe(n)},indexes:Pe(t.indexNames).map((n=>t.index(n))).map((t=>{const{name:n,unique:e,multiEntry:r,keyPath:i}=t,o={name:n,compound:p(i),keyPath:i,unique:e,multiEntry:r,extractKey:xe(i)};return s[Ce(i)]=o,o})),getIndexByKeyPath:t=>s[Ce(t)]};return s[":id"]=o.primaryKey,n!=null&&(s[Ce(n)]=o.primaryKey),o}))},hasGetAll:e.length>0&&"getAll"in n.objectStore(e[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,e),o=i.tables.map((t=>function(t){const n=t.name;return{name:n,schema:t,mutate:function({trans:t,type:e,keys:i,values:s,range:o}){return new Promise(((u,a)=>{u=on(u);const c=t.objectStore(n),l=c.keyPath==null,h=e==="put"||e==="add";if(!h&&e!=="delete"&&e!=="deleteRange")throw new Error("Invalid operation type: "+e);const{length:f}=i||s||{length:1};if(i&&s&&i.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(f===0)return u({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const y=[],p=[];let v=0;const w=t=>{++v,ve(t)};if(e==="deleteRange"){if(o.type===4)return u({numFailures:v,failures:p,results:[],lastResult:void 0});o.type===3?y.push(d=c.clear()):y.push(d=c.delete(r(o)))}else{const[t,n]=h?l?[s,i]:[s,null]:[i,null];if(h)for(let r=0;r<f;++r)y.push(d=n&&n[r]!==void 0?c[e](t[r],n[r]):c[e](t[r])),d.onerror=w;else for(let n=0;n<f;++n)y.push(d=c[e](t[n])),d.onerror=w}const g=t=>{const n=t.target.result;y.forEach(((t,n)=>t.error!=null&&(p[n]=t.error))),u({numFailures:v,failures:p,results:e==="delete"?i:y.map((t=>t.result)),lastResult:n})};d.onerror=t=>{w(t),g(t)},d.onsuccess=g}))},getMany:({trans:t,keys:e})=>new Promise(((r,i)=>{r=on(r);const s=t.objectStore(n),o=e.length,u=new Array(o);let a,c=0,l=0;const h=t=>{const n=t.target;u[n._pos]=n.result,++l===c&&r(u)},f=pe(i);for(let t=0;t<o;++t)e[t]!=null&&(a=s.get(e[t]),a._pos=t,a.onsuccess=h,a.onerror=f,++c);c===0&&r(u)})),get:({trans:t,key:e})=>new Promise(((r,i)=>{r=on(r);const s=t.objectStore(n).get(e);s.onsuccess=t=>r(t.target.result),s.onerror=pe(i)})),query:function(t){return e=>new Promise(((i,s)=>{i=on(i);const{trans:o,values:u,limit:a,query:c}=e,l=a===1/0?void 0:a,{index:h,range:f}=c,d=o.objectStore(n),y=h.isPrimaryKey?d:d.index(h.name),p=r(f);if(a===0)return i({result:[]});if(t){const t=u?y.getAll(p,l):y.getAllKeys(p,l);t.onsuccess=t=>i({result:t.target.result}),t.onerror=pe(s)}else{let t=0;const n=u||!("openKeyCursor"in y)?y.openCursor(p):y.openKeyCursor(p),e=[];n.onsuccess=r=>{const s=n.result;return s?(e.push(u?s.value:s.primaryKey),++t===a?i({result:e}):void s.continue()):i({result:e})},n.onerror=pe(s)}}))}(s),openCursor:function({trans:t,values:e,query:i,reverse:s,unique:o}){return new Promise(((u,a)=>{u=on(u);const{index:c,range:l}=i,h=t.objectStore(n),f=c.isPrimaryKey?h:h.index(c.name),d=s?o?"prevunique":"prev":o?"nextunique":"next",y=e||!("openKeyCursor"in f)?f.openCursor(r(l),d):f.openKeyCursor(r(l),d);y.onerror=pe(a),y.onsuccess=on((n=>{const e=y.result;if(!e)return void u(null);e.___id=++Ee,e.done=!1;const r=e.continue.bind(e);let i=e.continuePrimaryKey;i&&(i=i.bind(e));const s=e.advance.bind(e),o=()=>{throw new Error("Cursor not stopped")};e.trans=t,e.stop=e.continue=e.continuePrimaryKey=e.advance=()=>{throw new Error("Cursor not started")},e.fail=on(a),e.next=function(){let t=1;return this.start((()=>t--?this.continue():this.stop())).then((()=>this))},e.start=t=>{const n=new Promise(((t,n)=>{t=on(t),y.onerror=pe(n),e.fail=n,e.stop=n=>{e.stop=e.continue=e.continuePrimaryKey=e.advance=o,t(n)}})),u=()=>{if(y.result)try{t()}catch(t){e.fail(t)}else e.done=!0,e.start=()=>{throw new Error("Cursor behind last entry")},e.stop()};return y.onsuccess=on((t=>{y.onsuccess=u,u()})),e.continue=r,e.continuePrimaryKey=i,e.advance=s,u(),n},u(e)}),a)}))},count({query:t,trans:e}){const{index:i,range:s}=t;return new Promise(((t,o)=>{const u=e.objectStore(n),a=i.isPrimaryKey?u:u.index(i.name),c=r(s),l=c?a.count(c):a.count();l.onsuccess=on((n=>t(n.target.result))),l.onerror=pe(o)}))}}}(t))),u={};return o.forEach((t=>u[t.name]=t)),{stack:"dbcore",transaction:t.transaction.bind(t),table(t){if(!u[t])throw new Error(`Table '${t}' not found`);return u[t]},MIN_KEY:-1/0,MAX_KEY:Se(n),schema:i}}function Te({_novip:t},n){const e=n.db,r=function(t,n,{IDBKeyRange:e,indexedDB:r},i){return{dbcore:function(t,n){return n.reduce(((t,{create:n})=>({...t,...n(t)})),t)}(Oe(n,e,i),t.dbcore)}}(t._middlewares,e,t._deps,n);t.core=r.dbcore,t.tables.forEach((n=>{const e=n.name;t.core.schema.tables.some((t=>t.name===e))&&(n.core=t.core.table(e),t[e]instanceof t.Table&&(t[e].core=n.core))}))}function De({_novip:t},n,e,r){e.forEach((e=>{const i=r[e];n.forEach((n=>{const r=x(n,e);(!r||"value"in r&&r.value===void 0)&&(n===t.Transaction.prototype||n instanceof t.Transaction?$(n,e,{get(){return this.table(e)},set(t){k(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):n[e]=new t.Table(e,i))}))}))}function Ie({_novip:t},n){n.forEach((n=>{for(let e in n)n[e]instanceof t.Table&&delete n[e]}))}function je(t,n){return t._cfg.version-n._cfg.version}function Re(t,n,e,r){const i=t._dbSchema,s=t._createTransaction("readwrite",t._storeNames,i);s.create(e),s._completion.catch(r);const o=s._reject.bind(s),u=Mt.transless||Mt;dn((()=>{Mt.trans=s,Mt.transless=u,n===0?(y(i).forEach((t=>{Be(e,t,i[t].primKey,i[t].indexes)})),Te(t,e),Vt.follow((()=>t.on.populate.fire(s))).catch(o)):function({_novip:t},n,e,r){const i=[],s=t._versions;let o=t._dbSchema=qe(t,t.idbdb,r),u=!1;const a=s.filter((t=>t._cfg.version>=n));function c(){return i.length?Vt.resolve(i.shift()(e.idbtrans)).then(c):Vt.resolve()}return a.forEach((s=>{i.push((()=>{const i=o,a=s._cfg.dbschema;Ne(t,i,r),Ne(t,a,r),o=t._dbSchema=a;const c=Ke(i,a);c.add.forEach((t=>{Be(r,t[0],t[1].primKey,t[1].indexes)})),c.change.forEach((t=>{if(t.recreate)throw new lt.Upgrade("Not yet support for changing primary key");{const n=r.objectStore(t.name);t.add.forEach((t=>_e(n,t))),t.change.forEach((t=>{n.deleteIndex(t.name),_e(n,t)})),t.del.forEach((t=>n.deleteIndex(t)))}}));const l=s._cfg.contentUpgrade;if(l&&s._cfg.version>n){Te(t,r),e._memoizedTables={},u=!0;let n=R(a);c.del.forEach((t=>{n[t]=i[t]})),Ie(t,[t.Transaction.prototype]),De(t,[t.Transaction.prototype],y(n),n),e.schema=n;const s=z(l);let o;s&&yn();const h=Vt.follow((()=>{if(o=l(e),o&&s){var t=pn.bind(null,null);o.then(t,t)}}));return o&&typeof o.then=="function"?Vt.resolve(o):h.then((()=>o))}})),i.push((n=>{(!u||!Bn)&&function(t,n){[].slice.call(n.db.objectStoreNames).forEach((e=>t[e]==null&&n.db.deleteObjectStore(e)))}(s._cfg.dbschema,n),Ie(t,[t.Transaction.prototype]),De(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),e.schema=t._dbSchema}))})),c().then((()=>{var t,n;n=r,y(t=o).forEach((e=>{n.db.objectStoreNames.contains(e)||Be(n,e,t[e].primKey,t[e].indexes)}))}))}(t,n,s,e).catch(o)}))}function Ke(t,n){const e={del:[],add:[],change:[]};let r;for(r in t)n[r]||e.del.push(r);for(r in n){const i=t[r],s=n[r];if(i){const t={name:r,def:s,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(s.primKey.keyPath||"")||i.primKey.auto!==s.primKey.auto&&!Kn)t.recreate=!0,e.change.push(t);else{const n=i.idxByName,r=s.idxByName;let o;for(o in n)r[o]||t.del.push(o);for(o in r){const e=n[o],i=r[o];e?e.src!==i.src&&t.change.push(i):t.add.push(i)}(t.del.length>0||t.add.length>0||t.change.length>0)&&e.change.push(t)}}else e.add.push([r,s])}return e}function Be(t,n,e,r){const i=t.db.createObjectStore(n,e.keyPath?{keyPath:e.keyPath,autoIncrement:e.auto}:{autoIncrement:e.auto});return r.forEach((t=>_e(i,t))),i}function _e(t,n){t.createIndex(n.name,n.keyPath,{unique:n.unique,multiEntry:n.multi})}function qe(t,n,e){const r={};return E(n.objectStoreNames,0).forEach((t=>{const n=e.objectStore(t);let i=n.keyPath;const s=ke($e(i),i||"",!1,!1,!!n.autoIncrement,i&&typeof i!="string",!0),o=[];for(let t=0;t<n.indexNames.length;++t){const e=n.index(n.indexNames[t]);i=e.keyPath;var u=ke(e.name,i,!!e.unique,!!e.multiEntry,!1,i&&typeof i!="string",!1);o.push(u)}r[t]=Ae(t,s,o)})),r}function Ne({_novip:t},n,e){const r=e.db.objectStoreNames;for(let i=0;i<r.length;++i){const s=r[i],o=e.objectStore(s);t._hasGetAll="getAll"in o;for(let t=0;t<o.indexNames.length;++t){const e=o.indexNames[t],r=o.index(e).keyPath,i=typeof r=="string"?r:"["+E(r).join("+")+"]";if(n[s]){const t=n[s].idxByName[i];t&&(t.name=e,delete n[s].idxByName[i],n[s].idxByName[e]=t)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&d.WorkerGlobalScope&&d instanceof d.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(t._hasGetAll=!1)}class Me{_parseStoresSpec(t,n){y(t).forEach((e=>{if(t[e]!==null){var r=t[e].split(",").map(((t,n)=>{const e=(t=t.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(e)?e.match(/^\[(.*)\]$/)[1].split("+"):e;return ke(e,r||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),p(r),n===0)})),i=r.shift();if(i.multi)throw new lt.Schema("Primary key cannot be multi-valued");r.forEach((t=>{if(t.auto)throw new lt.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new lt.Schema("Index must have a name and cannot be an empty string")})),n[e]=Ae(e,i,r)}}))}stores(t){const n=this.db;this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,t):t;const e=n._versions,r={};let i={};return e.forEach((t=>{v(r,t._cfg.storesSource),i=t._cfg.dbschema={},t._parseStoresSpec(r,i)})),n._dbSchema=i,Ie(n,[n._allTables,n,n.Transaction.prototype]),De(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],y(i),i),n._storeNames=y(i),this}upgrade(t){return this._cfg.contentUpgrade=kt(this._cfg.contentUpgrade||dt,t),this}}function Fe(t,n){let e=t._dbNamesDB;return e||(e=t._dbNamesDB=new lr(Nn,{addons:[],indexedDB:t,IDBKeyRange:n}),e.version(1).stores({dbnames:"name"})),e.table("dbnames")}function Ue(t){return t&&typeof t.databases=="function"}function Le(t){return dn((function(){return Mt.letThrough=!0,t()}))}function Ve(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(n){var e=function(){return indexedDB.databases().finally(n)};t=setInterval(e,100),e()})).finally((function(){return clearInterval(t)})):Promise.resolve()}function He(t){const n=t._state,{indexedDB:e}=t._deps;if(n.isBeingOpened||t.idbdb)return n.dbReadyPromise.then((()=>n.dbOpenError?En(n.dbOpenError):t));J&&(n.openCanceller._stackHolder=Z()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;const r=n.openCanceller;function i(){if(n.openCanceller!==r)throw new lt.DatabaseClosed("db.open() was cancelled")}let s=n.dbReadyResolve,o=null,u=!1;return Vt.race([r,(typeof navigator>"u"?Vt.resolve():Ve()).then((()=>new Vt(((r,s)=>{if(i(),!e)throw new lt.MissingAPI;const a=t.name,c=n.autoSchema?e.open(a):e.open(a,Math.round(10*t.verno));if(!c)throw new lt.MissingAPI;c.onerror=pe(s),c.onblocked=on(t._fireOnBlocked),c.onupgradeneeded=on((r=>{if(o=c.transaction,n.autoSchema&&!t._options.allowEmptyDB){c.onerror=ve,o.abort(),c.result.close();const t=e.deleteDatabase(a);t.onsuccess=t.onerror=on((()=>{s(new lt.NoSuchDatabase(`Database ${a} doesnt exist`))}))}else{o.onerror=pe(s);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=i<1,t._novip.idbdb=c.result,Re(t,i/10,o,s)}}),s),c.onsuccess=on((()=>{o=null;const e=t._novip.idbdb=c.result,i=E(e.objectStoreNames);if(i.length>0)try{const r=e.transaction((s=i).length===1?s[0]:s,"readonly");n.autoSchema?function({_novip:t},n,e){t.verno=n.version/10;const r=t._dbSchema=qe(0,n,e);t._storeNames=E(n.objectStoreNames,0),De(t,[t._allTables],y(r),r)}(t,e,r):(Ne(t,t._dbSchema,r),function(t,n){const e=Ke(qe(0,t.idbdb,n),t._dbSchema);return!(e.add.length||e.change.some((t=>t.add.length||t.change.length)))}(t,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Te(t,r)}catch{}var s;Rn.push(t),e.onversionchange=on((e=>{n.vcFired=!0,t.on("versionchange").fire(e)})),e.onclose=on((n=>{t.on("close").fire(n)})),u&&function({indexedDB:t,IDBKeyRange:n},e){!Ue(t)&&e!==Nn&&Fe(t,n).put({name:e}).catch(dt)}(t._deps,a),r()}),s)}))))]).then((()=>(i(),n.onReadyBeingFired=[],Vt.resolve(Le((()=>t.on.ready.fire(t.vip)))).then((function e(){if(n.onReadyBeingFired.length>0){let r=n.onReadyBeingFired.reduce(kt,dt);return n.onReadyBeingFired=[],Vt.resolve(Le((()=>r(t.vip)))).then(e)}}))))).finally((()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1})).then((()=>t)).catch((e=>{n.dbOpenError=e;try{o&&o.abort()}catch{}return r===n.openCanceller&&t._close(),En(e)})).finally((()=>{n.openComplete=!0,s()}))}function We(t){var n=n=>t.next(n),e=i(n),r=i((n=>t.throw(n)));function i(t){return n=>{var i=t(n),s=i.value;return i.done?s:s&&typeof s.then=="function"?s.then(e,r):p(s)?Promise.all(s).then(e,r):e(s)}}return i(n)()}function Ge(t,n,e){var r=arguments.length;if(r<2)throw new lt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return e=i.pop(),[t,B(i),e]}function ze(t,n,e,r,i){return Vt.resolve().then((()=>{const s=Mt.transless||Mt,o=t._createTransaction(n,e,t._dbSchema,r),u={trans:o,transless:s};if(r)o.idbtrans=r.idbtrans;else try{o.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===at.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((()=>ze(t,n,e,null,i)))):En(r)}const a=z(i);let c;a&&yn();const l=Vt.follow((()=>{if(c=i.call(o,o),c)if(a){var t=pn.bind(null,null);c.then(t,t)}else typeof c.next=="function"&&typeof c.throw=="function"&&(c=We(c))}),u);return(c&&typeof c.then=="function"?Vt.resolve(c).then((t=>o.active?t:En(new lt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((t=>(r&&o._resolve(),o._completion.then((()=>t))))).catch((t=>(o._reject(t),En(t))))}))}function Je(t,n,e){const r=p(t)?t.slice():[t];for(let t=0;t<e;++t)r.push(n);return r}const Ye={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return{...t,table(n){const e=t.table(n),{schema:r}=e,i={},s=[];function o(t,n,e){const r=Ce(t),u=i[r]=i[r]||[],a=t==null?0:typeof t=="string"?1:t.length,c=n>0,l={...e,isVirtual:c,keyTail:n,keyLength:a,extractKey:xe(t),unique:!c&&e.unique};return u.push(l),l.isPrimaryKey||s.push(l),a>1&&o(a===2?t[0]:t.slice(0,a-1),n+1,e),u.sort(((t,n)=>t.keyTail-n.keyTail)),l}const u=o(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[u];for(const t of r.indexes)o(t.keyPath,0,t);function a(n){const e=n.query.index;return e.isVirtual?{...n,query:{index:e,range:(r=n.query.range,i=e.keyTail,{type:r.type===1?2:r.type,lower:Je(r.lower,r.lowerOpen?t.MAX_KEY:t.MIN_KEY,i),lowerOpen:!0,upper:Je(r.upper,r.upperOpen?t.MIN_KEY:t.MAX_KEY,i),upperOpen:!0})}}:n;var r,i}return{...e,schema:{...r,primaryKey:u,indexes:s,getIndexByKeyPath:function(t){const n=i[Ce(t)];return n&&n[0]}},count:t=>e.count(a(t)),query:t=>e.query(a(t)),openCursor(n){const{keyTail:r,isVirtual:i,keyLength:s}=n.query.index;return i?e.openCursor(a(n)).then((e=>e&&function(e){return Object.create(e,{continue:{value:function(i){i!=null?e.continue(Je(i,n.reverse?t.MAX_KEY:t.MIN_KEY,r)):n.unique?e.continue(e.key.slice(0,s).concat(n.reverse?t.MIN_KEY:t.MAX_KEY,r)):e.continue()}},continuePrimaryKey:{value(n,i){e.continuePrimaryKey(Je(n,t.MAX_KEY,r),i)}},primaryKey:{get:()=>e.primaryKey},key:{get(){const t=e.key;return s===1?t[0]:t.slice(0,s)}},value:{get:()=>e.value}})}(e))):e.openCursor(n)}}}}}};function Qe(t,n,e,r){return e=e||{},r=r||"",y(t).forEach((i=>{if(m(n,i)){var s=t[i],o=n[i];if(typeof s=="object"&&typeof o=="object"&&s&&o){const t=L(s);t!==L(o)?e[r+i]=n[i]:t==="Object"?Qe(s,o,e,r+i+"."):s!==o&&(e[r+i]=n[i])}else s!==o&&(e[r+i]=n[i])}else e[r+i]=void 0})),y(n).forEach((i=>{m(t,i)||(e[r+i]=n[i])})),e}const Xe={stack:"dbcore",name:"HooksMiddleware",level:2,create:t=>({...t,table(n){const e=t.table(n),{primaryKey:r}=e.schema;return{...e,mutate(t){const i=Mt.trans,{deleting:s,creating:o,updating:u}=i.table(n).hook;switch(t.type){case"add":if(o.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"put":if(o.fire===dt&&u.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"delete":if(s.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"deleteRange":if(s.fire===dt)break;return i._promise("readwrite",(()=>function(t){return c(t.trans,t.range,1e4)}(t)),!0)}return e.mutate(t);function a(t){const n=Mt.trans,i=t.keys||function(t,n){return n.type==="delete"?n.keys:n.keys||n.values.map(t.extractKey)}(r,t);if(!i)throw new Error("Keys missing");return(t=t.type==="add"||t.type==="put"?{...t,keys:i}:{...t}).type!=="delete"&&(t.values=[...t.values]),t.keys&&(t.keys=[...t.keys]),function(t,n,e){return n.type==="add"?Promise.resolve([]):t.getMany({trans:n.trans,keys:e,cache:"immutable"})}(e,t,i).then((a=>{const c=i.map(((e,i)=>{const c=a[i],l={onerror:null,onsuccess:null};if(t.type==="delete")s.fire.call(l,e,c,n);else if(t.type==="add"||c===void 0){const s=o.fire.call(l,e,t.values[i],n);e==null&&s!=null&&(e=s,t.keys[i]=e,r.outbound||j(t.values[i],r.keyPath,e))}else{const r=Qe(c,t.values[i]),s=u.fire.call(l,r,e,c,n);if(s){const n=t.values[i];Object.keys(s).forEach((t=>{m(n,t)?n[t]=s[t]:j(n,t,s[t])}))}}return l}));return e.mutate(t).then((({failures:n,results:e,numFailures:r,lastResult:s})=>{for(let r=0;r<i.length;++r){const s=e?e[r]:i[r],o=c[r];s==null?o.onerror&&o.onerror(n[r]):o.onsuccess&&o.onsuccess(t.type==="put"&&a[r]?t.values[r]:s)}return{failures:n,results:e,numFailures:r,lastResult:s}})).catch((t=>(c.forEach((n=>n.onerror&&n.onerror(t))),Promise.reject(t))))}))}function c(t,n,i){return e.query({trans:t,values:!1,query:{index:r,range:n},limit:i}).then((({result:e})=>a({type:"delete",keys:e,trans:t}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):e.length<i?{failures:[],numFailures:0,lastResult:void 0}:c(t,{...n,lower:e[e.length-1],lowerOpen:!0},i)))))}}}}})};function Ze(t,n,e){try{if(!n||n.keys.length<t.length)return null;const r=[];for(let i=0,s=0;i<n.keys.length&&s<t.length;++i)ne(n.keys[i],t[s])===0&&(r.push(e?M(n.values[i]):n.values[i]),++s);return r.length===t.length?r:null}catch{return null}}const tr={stack:"dbcore",level:-1,create:t=>({table:n=>{const e=t.table(n);return{...e,getMany:t=>{if(!t.cache)return e.getMany(t);const n=Ze(t.keys,t.trans._cache,t.cache==="clone");return n?Vt.resolve(n):e.getMany(t).then((n=>(t.trans._cache={keys:t.keys,values:t.cache==="clone"?M(n):n},n)))},mutate:t=>(t.type!=="add"&&(t.trans._cache=null),e.mutate(t))}}})};function nr(t){return!("from"in t)}const er=function(t,n){if(!this){const n=new er;return t&&"d"in t&&v(n,t),n}v(this,arguments.length?{d:1,from:t,to:arguments.length>1?n:t}:{d:0})};function rr(t,n,e){const r=ne(n,e);if(isNaN(r))return;if(r>0)throw RangeError();if(nr(t))return v(t,{from:n,to:e,d:1});const i=t.l,s=t.r;if(ne(e,t.from)<0)return i?rr(i,n,e):t.l={from:n,to:e,d:1,l:null,r:null},ur(t);if(ne(n,t.to)>0)return s?rr(s,n,e):t.r={from:n,to:e,d:1,l:null,r:null},ur(t);ne(n,t.from)<0&&(t.from=n,t.l=null,t.d=s?s.d+1:1),ne(e,t.to)>0&&(t.to=e,t.r=null,t.d=t.l?t.l.d+1:1);const o=!t.r;i&&!t.l&&ir(t,i),s&&o&&ir(t,s)}function ir(t,n){nr(n)||function t(n,{from:e,to:r,l:i,r:s}){rr(n,e,r),i&&t(n,i),s&&t(n,s)}(t,n)}function sr(t,n){const e=or(n);let r=e.next();if(r.done)return!1;let i=r.value;const s=or(t);let o=s.next(i.from),u=o.value;for(;!r.done&&!o.done;){if(ne(u.from,i.to)<=0&&ne(u.to,i.from)>=0)return!0;ne(i.from,u.from)<0?i=(r=e.next(u.from)).value:u=(o=s.next(i.from)).value}return!1}function or(t){let n=nr(t)?null:{s:0,n:t};return{next(t){const e=arguments.length>0;for(;n;)switch(n.s){case 0:if(n.s=1,e)for(;n.n.l&&ne(t,n.n.from)<0;)n={up:n,n:n.n.l,s:1};else for(;n.n.l;)n={up:n,n:n.n.l,s:1};case 1:if(n.s=2,!e||ne(t,n.n.to)<=0)return{value:n.n,done:!1};case 2:if(n.n.r){n.s=3,n={up:n,n:n.n.r,s:0};continue}case 3:n=n.up}return{done:!0}}}}function ur(t){var n,e;const r=(((n=t.r)===null||n===void 0?void 0:n.d)||0)-(((e=t.l)===null||e===void 0?void 0:e.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const n=i==="r"?"l":"r",e={...t},r=t[i];t.from=r.from,t.to=r.to,t[i]=r[i],e[i]=r[n],t[n]=e,e.d=ar(e)}t.d=ar(t)}function ar({r:t,l:n}){return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}b(er.prototype,{add(t){return ir(this,t),this},addKey(t){return rr(this,t,t),this},addKeys(t){return t.forEach((t=>rr(this,t,t))),this},[V](){return or(this)}});const cr={stack:"dbcore",level:0,create:t=>{const n=t.schema.name,e=new er(t.MIN_KEY,t.MAX_KEY);return{...t,table:r=>{const i=t.table(r),{schema:s}=i,{primaryKey:o}=s,{extractKey:u,outbound:a}=o,c={...i,mutate:t=>{const o=t.trans,u=o.mutatedParts||(o.mutatedParts={}),a=t=>{const e=`idb://${n}/${r}/${t}`;return u[e]||(u[e]=new er)},c=a(""),l=a(":dels"),{type:h}=t;let[f,d]=t.type==="deleteRange"?[t.range]:t.type==="delete"?[t.keys]:t.values.length<50?[[],t.values]:[];const y=t.trans._cache;return i.mutate(t).then((t=>{if(p(f)){h!=="delete"&&(f=t.results),c.addKeys(f);const n=Ze(f,y);n||h==="add"||l.addKeys(f),(n||d)&&function(t,n,e,r){function i(n){const i=t(n.name||"");function s(t){return t!=null?n.extractKey(t):null}const o=t=>n.multiEntry&&p(t)?t.forEach((t=>i.addKey(t))):i.addKey(t);(e||r).forEach(((t,n)=>{const i=e&&s(e[n]),u=r&&s(r[n]);ne(i,u)!==0&&(i!=null&&o(i),u!=null&&o(u))}))}n.indexes.forEach(i)}(a,s,n,d)}else if(f){const t={from:f.lower,to:f.upper};l.add(t),c.add(t)}else c.add(e),l.add(e),s.indexes.forEach((t=>a(t.name).add(e)));return t}))}},l=({query:{index:n,range:e}})=>{var r,i;return[n,new er((r=e.lower)!==null&&r!==void 0?r:t.MIN_KEY,(i=e.upper)!==null&&i!==void 0?i:t.MAX_KEY)]},h={get:t=>[o,new er(t.key)],getMany:t=>[o,(new er).addKeys(t.keys)],count:l,query:l,openCursor:l};return y(h).forEach((t=>{c[t]=function(s){const{subscr:o}=Mt;if(o){const c=t=>{const e=`idb://${n}/${r}/${t}`;return o[e]||(o[e]=new er)},l=c(""),f=c(":dels"),[d,y]=h[t](s);if(c(d.name||"").add(y),!d.isPrimaryKey){if(t!=="count"){const n=t==="query"&&a&&s.values&&i.query({...s,values:!1});return i[t].apply(this,arguments).then((e=>{if(t==="query"){if(a&&s.values)return n.then((({result:t})=>(l.addKeys(t),e)));const t=s.values?e.result.map(u):e.result;s.values?l.addKeys(t):f.addKeys(t)}else if(t==="openCursor"){const t=e,n=s.values;return t&&Object.create(t,{key:{get:()=>(f.addKey(t.primaryKey),t.key)},primaryKey:{get(){const n=t.primaryKey;return f.addKey(n),n}},value:{get:()=>(n&&l.addKey(t.primaryKey),t.value)}})}return e}))}f.add(e)}}return i[t].apply(this,arguments)}})),c}}}};class lr{constructor(t,n){this._middlewares={},this.verno=0;const e=lr.dependencies;this._options=n={addons:lr.addons,autoOpen:!0,indexedDB:e.indexedDB,IDBKeyRange:e.IDBKeyRange,...n},this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:r}=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:dt,dbReadyPromise:null,cancelOpen:dt,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var s;i.dbReadyPromise=new Vt((t=>{i.dbReadyResolve=t})),i.openCanceller=new Vt(((t,n)=>{i.cancelOpen=n})),this._state=i,this.name=t,this.on=Wn(this,"populate","blocked","versionchange","close",{ready:[kt,dt]}),this.on.ready.subscribe=C(this.on.ready.subscribe,(t=>(n,e)=>{lr.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||Vt.resolve().then(n),e&&t(n);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(n),e&&t(n);else{t(n);const r=this;e||t((function t(){r.on.ready.unsubscribe(n),r.on.ready.unsubscribe(t)}))}}))})),this.Collection=(s=this,Gn(ie.prototype,(function(t,n){this.db=s;let e=Ln,r=null;if(n)try{e=n()}catch(t){r=t}const i=t._ctx,o=i.table,u=o.hook.reading.fire;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.index===o.schema.primKey.name,range:e,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:u!==yt?u:null}}))),this.Table=function(t){return Gn(Hn.prototype,(function(n,e,r){this.db=t,this._tx=r,this.name=n,this.schema=e,this.hook=t._allTables[n]?t._allTables[n].hook:Wn(null,{creating:[wt,dt],reading:[pt,yt],updating:[mt,dt],deleting:[gt,dt]})}))}(this),this.Transaction=function(t){return Gn(be.prototype,(function(n,e,r,i,s){this.db=t,this.mode=n,this.storeNames=e,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=Wn(this,"complete","error","abort"),this.parent=s||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 Vt(((t,n)=>{this._resolve=t,this._reject=n})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(t=>{var n=this.active;return this.active=!1,this.on.error.fire(t),this.parent?this.parent._reject(t):n&&this.idbtrans&&this.idbtrans.abort(),En(t)}))}))}(this),this.Version=function(t){return Gn(Me.prototype,(function(n){this.db=t,this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return Gn(ye.prototype,(function(n,e,r){this.db=t,this._ctx={table:n,index:e===":id"?null:e,or:r};const i=t._deps.indexedDB;if(!i)throw new lt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(t,n)=>i.cmp(n,t),this._max=(t,n)=>i.cmp(t,n)>0?t:n,this._min=(t,n)=>i.cmp(t,n)<0?t:n,this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(t=>{t.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",(t=>{!t.newVersion||t.newVersion<t.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${t.oldVersion/10}`)})),this._maxKey=Se(n.IDBKeyRange),this._createTransaction=(t,n,e,r)=>new this.Transaction(t,n,e,this._options.chromeTransactionDurability,r),this._fireOnBlocked=t=>{this.on("blocked").fire(t),Rn.filter((t=>t.name===this.name&&t!==this&&!t._state.vcFired)).map((n=>n.on("versionchange").fire(t)))},this.use(Ye),this.use(Xe),this.use(cr),this.use(tr),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((t=>t(this)))}version(t){if(isNaN(t)||t<.1)throw new lt.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new lt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);const n=this._versions;var e=n.filter((n=>n._cfg.version===t))[0];return e||(e=new this.Version(t),n.push(e),n.sort(je),e.stores({}),this._state.autoSchema=!1,e)}_whenReady(t){return this.idbdb&&(this._state.openComplete||Mt.letThrough||this._vip)?t():new Vt(((t,n)=>{if(this._state.openComplete)return n(new lt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void n(new lt.DatabaseClosed);this.open().catch(dt)}this._state.dbReadyPromise.then(t,n)})).then(t)}use({stack:t,create:n,level:e,name:r}){r&&this.unuse({stack:t,name:r});const i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:e??10,name:r}),i.sort(((t,n)=>t.level-n.level)),this}unuse({stack:t,name:n,create:e}){return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((t=>e?t.create!==e:!!n&&t.name!==n))),this}open(){return He(this)}_close(){const t=this._state,n=Rn.indexOf(this);if(n>=0&&Rn.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}t.dbReadyPromise=new Vt((n=>{t.dbReadyResolve=n})),t.openCanceller=new Vt(((n,e)=>{t.cancelOpen=e}))}close(){this._close();const t=this._state;this._options.autoOpen=!1,t.dbOpenError=new lt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}delete(){const t=arguments.length>0,n=this._state;return new Vt(((e,r)=>{const i=()=>{this.close();var t=this._deps.indexedDB.deleteDatabase(this.name);t.onsuccess=on((()=>{(function({indexedDB:t,IDBKeyRange:n},e){!Ue(t)&&e!==Nn&&Fe(t,n).delete(e).catch(dt)})(this._deps,this.name),e()})),t.onerror=pe(r),t.onblocked=this._fireOnBlocked};if(t)throw new lt.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 t=this._state.dbOpenError;return t&&t.name==="DatabaseClosed"}hasFailed(){return this._state.dbOpenError!==null}dynamicallyOpened(){return this._state.autoSchema}get tables(){return y(this._allTables).map((t=>this._allTables[t]))}transaction(){const t=Ge.apply(this,arguments);return this._transaction.apply(this,t)}_transaction(t,n,e){let r=Mt.trans;r&&r.db===this&&t.indexOf("!")===-1||(r=null);const i=t.indexOf("?")!==-1;let s,o;t=t.replace("!","").replace("?","");try{if(o=n.map((t=>{var n=t instanceof this.Table?t.name:t;if(typeof n!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return n})),t=="r"||t===Mn)s=Mn;else{if(t!="rw"&&t!=Fn)throw new lt.InvalidArgument("Invalid transaction mode: "+t);s=Fn}if(r){if(r.mode===Mn&&s===Fn){if(!i)throw new lt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&o.forEach((t=>{if(r&&r.storeNames.indexOf(t)===-1){if(!i)throw new lt.SubTransaction("Table "+t+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(t){return r?r._promise(null,((n,e)=>{e(t)})):En(t)}const u=ze.bind(null,this,s,o,r,e);return r?r._promise(s,u,"lock"):Mt.trans?kn(Mt.transless,(()=>this._whenReady(u))):this._whenReady(u)}table(t){if(!m(this._allTables,t))throw new lt.InvalidTable(`Table ${t} does not exist`);return this._allTables[t]}}const hr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class fr{constructor(t){this._subscribe=t}subscribe(t,n,e){return this._subscribe(t&&typeof t!="function"?t:{next:t,error:n,complete:e})}[hr](){return this}}function dr(t,n){return y(n).forEach((e=>{ir(t[e]||(t[e]=new er),n[e])})),t}function yr(t){let n,e=!1;const r=new fr((r=>{const i=z(t);let s=!1,o={},u={};const a={get closed(){return s},unsubscribe:()=>{s=!0,me.storagemutated.unsubscribe(f)}};r.start&&r.start(a);let c=!1,l=!1;function h(){return y(u).some((t=>o[t]&&sr(o[t],u[t])))}const f=t=>{dr(o,t),h()&&d()},d=()=>{if(c||s)return;o={};const y={},p=function(n){i&&yn();const e=()=>dn(t,{subscr:n,trans:null}),r=Mt.trans?kn(Mt.transless,e):e();return i&&r.then(pn,pn),r}(y);l||(me(we,f),l=!0),c=!0,Promise.resolve(p).then((t=>{e=!0,n=t,c=!1,s||(h()?d():(o={},u=y,r.next&&r.next(t)))}),(t=>{c=!1,e=!1,r.error&&r.error(t),a.unsubscribe()}))};return d(),a}));return r.hasValue=()=>e,r.getValue=()=>n,r}let pr;try{pr={indexedDB:d.indexedDB||d.mozIndexedDB||d.webkitIndexedDB||d.msIndexedDB,IDBKeyRange:d.IDBKeyRange||d.webkitIDBKeyRange}}catch{pr={indexedDB:null,IDBKeyRange:null}}const vr=lr;function wr(t){let n=gr;try{gr=!0,me.storagemutated.fire(t)}finally{gr=n}}b(vr,{...ft,delete:t=>new vr(t,{addons:[]}).delete(),exists:t=>new vr(t,{addons:[]}).open().then((t=>(t.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(t){try{return function({indexedDB:t,IDBKeyRange:n}){return Ue(t)?Promise.resolve(t.databases()).then((t=>t.map((t=>t.name)).filter((t=>t!==Nn)))):Fe(t,n).toCollection().primaryKeys()}(vr.dependencies).then(t)}catch{return En(new lt.MissingAPI)}},defineClass:()=>function(t){v(this,t)},ignoreTransaction:t=>Mt.trans?kn(Mt.transless,t):t(),vip:Le,async:function(t){return function(){try{var n=We(t.apply(this,arguments));return n&&typeof n.then=="function"?n:Vt.resolve(n)}catch(t){return En(t)}}},spawn:function(t,n,e){try{var r=We(t.apply(e,n||[]));return r&&typeof r.then=="function"?r:Vt.resolve(r)}catch(t){return En(t)}},currentTransaction:{get:()=>Mt.trans||null},waitFor:function(t,n){const e=Vt.resolve(typeof t=="function"?vr.ignoreTransaction(t):t).timeout(n||6e4);return Mt.trans?Mt.trans.waitFor(e):e},Promise:Vt,debug:{get:()=>J,set:t=>{Y(t,t==="dexie"?()=>!0:qn)}},derive:A,extend:v,props:b,override:C,Events:Wn,on:me,liveQuery:yr,extendObservabilitySet:dr,getByKeyPath:I,setByKeyPath:j,delByKeyPath:function(t,n){typeof n=="string"?j(t,n,void 0):"length"in n&&[].map.call(n,(function(n){j(t,n,void 0)}))},shallowClone:R,deepClone:M,getObjectDiff:Qe,cmp:ne,asap:T,minKey:Dn,addons:[],connections:Rn,errnames:at,dependencies:pr,semVer:On,version:On.split(".").map((t=>parseInt(t))).reduce(((t,n,e)=>t+n/Math.pow(10,2*e)))}),vr.maxKey=Se(vr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(me(we,(t=>{if(!gr){let n;Kn?(n=document.createEvent("CustomEvent"),n.initCustomEvent(ge,!0,!0,t)):n=new CustomEvent(ge,{detail:t}),gr=!0,dispatchEvent(n),gr=!1}})),addEventListener(ge,(({detail:t})=>{gr||wr(t)})));let gr=!1;if(typeof BroadcastChannel<"u"){const t=new BroadcastChannel(ge);typeof t.unref=="function"&&t.unref(),me(we,(n=>{gr||t.postMessage(n)})),t.onmessage=t=>{t.data&&wr(t.data)}}else if(typeof self<"u"&&typeof navigator<"u"){me(we,(t=>{try{gr||(typeof localStorage<"u"&&localStorage.setItem(ge,JSON.stringify({trig:Math.random(),changedParts:t})),typeof self.clients=="object"&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((n=>n.postMessage({type:ge,changedParts:t}))))}catch{}})),typeof addEventListener<"u"&&addEventListener("storage",(t=>{if(t.key===ge){const n=JSON.parse(t.newValue);n&&wr(n.changedParts)}}));const t=self.document&&navigator.serviceWorker;t&&t.addEventListener("message",(function({data:t}){t&&t.type===ge&&wr(t.changedParts)}))}Vt.rejectionMapper=function(t,n){if(!t||t instanceof it||t instanceof TypeError||t instanceof SyntaxError||!t.name||!ht[t.name])return t;var e=new ht[t.name](n||t.message,t);return"stack"in t&&$(e,"stack",{get:function(){return this.inner.stack}}),e},Y(J,qn);class mr extends lr{constructor(){super("NylasAuthDatabase");a(this,"grant");a(this,"pkce");this.version(1).stores({grant:"++id,token",pkce:"++id,codeVerifier"}),this.grant=this.table("grant"),this.pkce=this.table("pkce")}}class br{constructor(){a(this,"theDB");this.theDB=new mr}async setCodeVerifier(t){await this.theDB.pkce.put({id:1,codeVerifier:t},1)}async getCodeVerifier(){const[t]=await this.theDB.pkce.toArray();return t?t.codeVerifier:null}async getTokenInfo(){const t=await this.theDB.grant.get(1);return t?t.token:null}async setTokenInfo(t){await this.theDB.grant.put({id:1,token:t},1)}async reset(){await this.theDB.grant.clear()}}function kr(t){const n="NylasAuth";if(!t)throw new Error("NylasAuth requires a config object");let e=null;if(t.storageType==="indexeddb"&&(e=new br),!e)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"}],i=[{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 s(r,i,s,o=!0,u,a){const c=await(e==null?void 0:e.getTokenInfo()),l=new URL(r,u??t.apiUri),h=new Headers;h.append("Accept","application/json"),h.append("Content-Type","application/json"),h.append("User-Agent",n),c&&h.append("Authorization",`Bearer ${c.access_token}`);const f=await fetch(l.toString(),{method:i||"GET",headers:h,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0,...a||{}});return o?await f.json():f.body}return{config:t,async getHostedAuthRedirectURL(n=t.defaultScopes,r,i){const s=await f(Math.random().toString()),o=await f(s);await(e==null?void 0:e.setCodeVerifier(s));const u=new URL(`${t.apiUri}/v3/connect/auth`);return u.searchParams.set("client_id",t.clientId),u.searchParams.set("response_type","code"),u.searchParams.set("scope",n.join(" ")),u.searchParams.set("redirect_uri",t.redirectURI),u.searchParams.set("access_type","offline"),u.searchParams.set("code_challenge",o),u.searchParams.set("code_challenge_method","S256"),u.searchParams.set("options","rotate_refresh_token"),i&&u.searchParams.set("provider",i),r&&u.searchParams.set("login_hint",r),u.toString()},nylasAPIRequest:s,async exchangeAuthCodeForTokenInfo(n){if(!n)return null;const r=await(e==null?void 0:e.getCodeVerifier()),i=await this.nylasAPIRequest("/v3/connect/token","POST",{code:n,client_id:t.clientId,grant_type:"authorization_code",redirect_uri:t.redirectURI,code_verifier:r});return"error"in i||await(e==null?void 0:e.setTokenInfo(i)),i},async nylasDownloadFileRequest(r,i="GET",s){const o=await(e==null?void 0:e.getTokenInfo()),u=new URL(r,t.apiUri),a=new Headers;return a.append("Accept","application/json"),a.append("Content-Type","application/octet-stream"),a.append("User-Agent",n),o&&a.append("Authorization",`Bearer ${o.access_token}`),(await fetch(u.toString(),{method:i,headers:a,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0})).blob()},async logout(){const t=await(e==null?void 0:e.getTokenInfo());t&&await this.nylasAPIRequest(`/v3/connect/revoke?token=${t.access_token}`,"POST"),await(e==null?void 0:e.reset())},async isAuthenticated(){return!!await(e==null?void 0:e.getTokenInfo())},async getTokenInfo(){const t=await(e==null?void 0:e.getTokenInfo());if(!t)return null;const{access_token:n,...r}=t;return r},async isAccessTokenValid(){const t=await(e==null?void 0:e.getTokenInfo());return t?"data"in await this.nylasAPIRequest(`/v3/connect/tokeninfo?id_token=${t.id_token}`,"GET"):!1},async refreshAccessToken(){const n=await(e==null?void 0:e.getTokenInfo());if(!n)return null;const r=await this.nylasAPIRequest("/v3/connect/token","POST",{client_id:t.clientId,grant_type:"refresh_token",refresh_token:n.refresh_token});return"error"in r||await(e==null?void 0:e.setTokenInfo(r)),r},async hasScopeByType(t="email",n){const s=await(e==null?void 0:e.getTokenInfo());if(!s)return!1;const o=s.scope.toLowerCase().split(" ");let u=[];const a=Array.isArray(n)?n:[n];return t==="email"&&(u=[...i,...r].filter((t=>a.includes(t.type)))),u.every((t=>o.includes(t.value)))},async hasScope(t){const n=await(e==null?void 0:e.getTokenInfo());if(!n)return!1;const r=n.scope.toLowerCase().split(" ");return(Array.isArray(t)?t:[t]).some((t=>r.includes(t.toLowerCase())))}}}export{i as N,l as X,h as Z,kr as e,s as g,c as n};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{a as t,u as n,g as e}from"./p-ad7cf473.js";class r{constructor(n,e,r=true,i){this.automaticComponentRegistration=true;this.registeredComponents={};this.propStateRegistrations=new Map;this.eventListenerRegistrations=new Map;this.host=n;this.stores=e;this.automaticComponentRegistration=r;this.eventOverrides=i;t(`[${this.hostTagName}] Initializing (abstract) provider.`,{eventOverrides:i});this.registerComponent=this.registerComponent.bind(this);this.getStore=this.getStore.bind(this);Object.keys(this.stores).forEach((t=>{this.propStateRegistrations.set(t,new Map)}))}async componentWillLoad(n){t(`[${this.hostTagName}] Will load`);this.setupStoreListeners();this.nylasConnector=n;const e=Array.from(this.host.querySelectorAll("*")).filter((t=>t.tagName.toLowerCase().startsWith("nylas-")));t(`[${this.hostTagName}] Found ${e.length} child component(s).`,{childComponents:e});e.forEach((n=>{const e=n;if(!e){t(`[~${this.hostTagName}] Component ${e.tagName} does not have a name. Skipping.`);return}if(!e.registerNylasComponent){t(`[~${this.hostTagName}] Component ${e.tagName} is not a component that can be registered. Skipping.`,{component:e});return}const r={element:e,name:e.tagName.toLowerCase(),getStoresToProp:e.getStoresToProp,storeToProps:e.storeToProps,stateToProps:e.stateToProps,authToProp:e.authToProp,eventToProps:e.eventToProps,connectorToProp:e.connectorToProp,localPropsToProp:e.localPropsToProp};this.registerComponent(r)}))}async componentDidLoad(){t(`[${this.hostTagName}] Did load`)}async componentDisconnected(){Object.values(this.stores).forEach((t=>{t.dispose()}))}async registerComponentHandler(n){n.stopPropagation();if(!this.automaticComponentRegistration){t(`[${this.hostTagName}] Automatic component registration disabled. Skipping registration of ${n.detail.name}.`);return}this.registerComponent(n.detail)}async unregisterComponentHandler(n){n.stopPropagation();if(!this.automaticComponentRegistration){t(`[${this.hostTagName}] Automatic component registration disabled. Skipping unregistration of ${n.detail.name}.`);return}this.unregisterComponent(n.detail)}registerComponent(r){t(`[${this.hostTagName}] Registering component ${r.name}.`);const i=r.element.dataset.nylasId;if(i&&this.registeredComponents[i]){t(`[${this.hostTagName}] Component ${r.name} already registered. Skipping.`);return}const{stateToProps:s,getStoresToProp:o,eventToProps:u,storeToProps:a,connectorToProp:c,localPropsToProp:l,element:h}=r;h.dataset.nylasId=n();this.registeredComponents[h.dataset.nylasId]=r;const f=this.eventOverrides;u?.forEach(((n,i)=>{const s=this.nylasConnector;const o=async e=>{t(`[${this.hostTagName}] Handling "${r.name}" prop "${String(i)}" event.`,{event:e});if(i in f){t(`[${this.hostTagName}] Found event override for "${String(i)}" event. Calling override.`);await f[i](e,s)}if(!e.defaultPrevented){await n(e,s)}return};const u=r.element.dataset.nylasId;if(u&&!this.eventListenerRegistrations.has(u)){this.eventListenerRegistrations.set(u,[])}if(u){this.eventListenerRegistrations.get(u)?.push([h,i,o])}t(`[${this.hostTagName}] Setting "${r.name}" event "${String(i)}" to automcially call NylasConnector method.`);const a=e(i.toString());t(`[${this.hostTagName}] Adding event listener for "${a}" on "${h.tagName}"`);h.addEventListener(a,o)}));s?.forEach(((n,e)=>{const[i,s]=e.split(".");const o=this.getStore(i);const u=o.state[s];if(!h.dataset.nylasId){t(`[${this.hostTagName}] Component "${r.name}" not registered. Skipping.`,{component:r});return}if(!this.propStateRegistrations.has(i)){this.propStateRegistrations.set(i,new Map)}if(!this.propStateRegistrations.get(i)?.has(s)){this.propStateRegistrations.get(i)?.set(s,[{elementId:h.dataset.nylasId,propKey:n}])}else{this.propStateRegistrations.get(i)?.get(s)?.push({elementId:h.dataset.nylasId,propKey:n})}h[n.toString()]=u;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to "${e}" value.`,{stateValue:u})}));l?.forEach(((n,e)=>{const i=this.host[e];h[n.toString()]=i;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to the value of "${e}" value.`,{value:e,mappedPropValue:i})}));if(o){h[o?.toString()]=this.getStore;t(`[${this.hostTagName}] Setting "${r.name}" prop "${o.toString()}" to "getStore" method.`)}a?.forEach(((n,e)=>{const i=this.getStore(e);h[n.toString()]=i;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to "${e}" store.`,{store:i})}));if(c){h[c?.toString()]=this.nylasConnector;t(`[${this.hostTagName}] Setting "${r.name}" prop "${c.toString()}" to "nylasConnector" value.`,{connectorToProp:c})}t(`[${this.hostTagName}] Component ${r.name} registered.`)}unregisterComponent(n){t(`[${this.hostTagName}] Unregistering component ${n.name}.`);const r=n.element.dataset.nylasId;if(!r){t(`[${this.hostTagName}] Component ${n.name} not registered. Skipping.`);return}if(this.registeredComponents[r]){t(`[${this.hostTagName}] Component ${n.name} not registered. Skipping.`);return}this.propStateRegistrations.forEach(((t,n)=>{t.forEach(((t,e)=>{const i=this.propStateRegistrations.get(n)?.get(e);const s=i?.filter((t=>t.elementId!==r));if(s){this.propStateRegistrations.get(n)?.set(e,s)}}))}));const i=this.eventListenerRegistrations.get(r);i?.forEach((([n,r,i])=>{const s=e(r.toString());t(`[${this.hostTagName}] Removing event listener for "${s}" on "${n.tagName}"`);n.removeEventListener(s,i)}));delete this.registeredComponents[r]}getStore(t){const n=this.stores[t];if(!n){throw new Error(`[${this.hostTagName}] Store "${t.toString()}" not found.`)}return n}async setupStoreListeners(){const n=this;Object.entries(this.stores).forEach((([e,r])=>{t(`[${n.hostTagName}] Listening for changes in "${e}" store.`);r.use({set(r,i,s){t(`[${n.hostTagName}] Store "${e}" state "${r.toString()}" changed`,{newValue:i,oldValue:s});if(i===s){t(`[${n.hostTagName}] Store "${e}" state "${r.toString()}" unchanged. Skipping.`);return}const o=n.registeredComponents;if(!o){t(`[${n.hostTagName}] No registered components found. Skipping.`);return}const u=n.propStateRegistrations.get(e)?.get(r.toString())||[];t(`[${n.hostTagName}] Found ${u.length} prop(s) registered for "${r.toString()}" store.`,{props:u,propStateRegistrations:n.propStateRegistrations});u.forEach((({elementId:i,propKey:s})=>{const u=o[i];if(!u){t(`[${n.hostTagName}] Component "${i}" not found. Skipping.`,{component:u});return}const a=n.getStore(e);const c=a.state[r];u.element[s.toString()]=c;t(`[${n.hostTagName}] Setting "${u.name}" prop "${s.toString()}" to "${r.toString()}" value.`,{stateValue:c})}))}})}))}get hostTagName(){return this.host?.tagName?.toLowerCase()??"nylas-provider"}}class i extends r{}const s=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var o=Object.defineProperty;var u=(t,n,e)=>n in t?o(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var a=(t,n,e)=>(u(t,typeof n!="symbol"?n+"":n,e),e);var c=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(c||{});const l=t=>"error"in t;class h extends Error{constructor(t){super(t==null?void 0:t.message);a(this,"apiError");this.name="NylasAPIError",this.stack=(new Error).stack,this.apiError=t}}async function f(t){const n=(new TextEncoder).encode(t),e=await crypto.subtle.digest("SHA-256",n),r=Array.from(new Uint8Array(e)).map((t=>t.toString(16).padStart(2,"0"))).join("");return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:s,y=Object.keys,p=Array.isArray;function v(t,n){return typeof n!="object"||y(n).forEach((function(e){t[e]=n[e]})),t}typeof Promise>"u"||d.Promise||(d.Promise=Promise);const w=Object.getPrototypeOf,g={}.hasOwnProperty;function m(t,n){return g.call(t,n)}function b(t,n){typeof n=="function"&&(n=n(w(t))),(typeof Reflect>"u"?y:Reflect.ownKeys)(n).forEach((e=>{$(t,e,n[e])}))}const k=Object.defineProperty;function $(t,n,e,r){k(t,n,v(e&&m(e,"get")&&typeof e.get=="function"?{get:e.get,set:e.set,configurable:!0}:{value:e,configurable:!0,writable:!0},r))}function A(t){return{from:function(n){return t.prototype=Object.create(n.prototype),$(t.prototype,"constructor",t),{extend:b.bind(null,t.prototype)}}}}const S=Object.getOwnPropertyDescriptor;function x(t,n){let e;return S(t,n)||(e=w(t))&&x(e,n)}const P=[].slice;function E(t,n,e){return P.call(t,n,e)}function C(t,n){return n(t)}function O(t){if(!t)throw new Error("Assertion Failed")}function T(t){d.setImmediate?setImmediate(t):setTimeout(t,0)}function D(t,n){return t.reduce(((t,e,r)=>{var i=n(e,r);return i&&(t[i[0]]=i[1]),t}),{})}function I(t,n){if(m(t,n))return t[n];if(!n)return t;if(typeof n!="string"){for(var e=[],r=0,i=n.length;r<i;++r){var s=I(t,n[r]);e.push(s)}return e}var o=n.indexOf(".");if(o!==-1){var u=t[n.substr(0,o)];return u===void 0?void 0:I(u,n.substr(o+1))}}function j(t,n,e){if(t&&n!==void 0&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if(typeof n!="string"&&"length"in n){O(typeof e!="string"&&"length"in e);for(var r=0,i=n.length;r<i;++r)j(t,n[r],e[r])}else{var s=n.indexOf(".");if(s!==-1){var o=n.substr(0,s),u=n.substr(s+1);if(u==="")e===void 0?p(t)&&!isNaN(parseInt(o))?t.splice(o,1):delete t[o]:t[o]=e;else{var a=t[o];a&&m(t,o)||(a=t[o]={}),j(a,u,e)}}else e===void 0?p(t)&&!isNaN(parseInt(n))?t.splice(n,1):delete t[n]:t[n]=e}}function R(t){var n={};for(var e in t)m(t,e)&&(n[e]=t[e]);return n}const K=[].concat;function B(t){return K.apply([],t)}const _="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(B([8,16,32,64].map((t=>["Int","Uint","Float"].map((n=>n+t+"Array")))))).filter((t=>d[t])),q=_.map((t=>d[t]));D(_,(t=>[t,!0]));let N=null;function M(t){N=typeof WeakMap<"u"&&new WeakMap;const n=F(t);return N=null,n}function F(t){if(!t||typeof t!="object")return t;let n=N&&N.get(t);if(n)return n;if(p(t)){n=[],N&&N.set(t,n);for(var e=0,r=t.length;e<r;++e)n.push(F(t[e]))}else if(q.indexOf(t.constructor)>=0)n=t;else{const e=w(t);for(var i in n=e===Object.prototype?{}:Object.create(e),N&&N.set(t,n),t)m(t,i)&&(n[i]=F(t[i]))}return n}const{toString:U}={};function L(t){return U.call(t).slice(8,-1)}const V=typeof Symbol<"u"?Symbol.iterator:"@@iterator",H=typeof V=="symbol"?function(t){var n;return t!=null&&(n=t[V])&&n.apply(t)}:function(){return null},W={};function G(t){var n,e,r,i;if(arguments.length===1){if(p(t))return t.slice();if(this===W&&typeof t=="string")return[t];if(i=H(t)){for(e=[];!(r=i.next()).done;)e.push(r.value);return e}if(t==null)return[t];if(typeof(n=t.length)=="number"){for(e=new Array(n);n--;)e[n]=t[n];return e}return[t]}for(n=arguments.length,e=new Array(n);n--;)e[n]=arguments[n];return e}const z=typeof Symbol<"u"?t=>t[Symbol.toStringTag]==="AsyncFunction":()=>!1;var J=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(t,n){J=t,Q=n}var Q=()=>!0;const X=!new Error("").stack;function Z(){if(X)try{throw new Error}catch(t){return t}return new Error}function tt(t,n){var e=t.stack;return e?(n=n||0,e.indexOf(t.name)===0&&(n+=(t.name+t.message).split(`\n`).length),e.split(`\n`).slice(n).filter(Q).map((t=>`\n`+t)).join("")):""}var nt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],et=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(nt),rt={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 it(t,n){this._e=Z(),this.name=t,this.message=n}function st(t,n){return t+". Errors: "+Object.keys(n).map((t=>n[t].toString())).filter(((t,n,e)=>e.indexOf(t)===n)).join(`\n`)}function ot(t,n,e,r){this._e=Z(),this.failures=n,this.failedKeys=r,this.successCount=e,this.message=st(t,n)}function ut(t,n){this._e=Z(),this.name="BulkError",this.failures=Object.keys(n).map((t=>n[t])),this.failuresByPos=n,this.message=st(t,n)}A(it).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+tt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),A(ot).from(it),A(ut).from(it);var at=et.reduce(((t,n)=>(t[n]=n+"Error",t)),{});const ct=it;var lt=et.reduce(((t,n)=>{var e=n+"Error";function r(t,r){this._e=Z(),this.name=e,t?typeof t=="string"?(this.message=`${t}${r?`\n `+r:""}`,this.inner=r||null):typeof t=="object"&&(this.message=`${t.name} ${t.message}`,this.inner=t):(this.message=rt[n]||e,this.inner=null)}return A(r).from(ct),t[n]=r,t}),{});lt.Syntax=SyntaxError,lt.Type=TypeError,lt.Range=RangeError;var ht=nt.reduce(((t,n)=>(t[n+"Error"]=lt[n],t)),{}),ft=et.reduce(((t,n)=>(["Syntax","Type","Range"].indexOf(n)===-1&&(t[n+"Error"]=lt[n]),t)),{});function dt(){}function yt(t){return t}function pt(t,n){return t==null||t===yt?n:function(e){return n(t(e))}}function vt(t,n){return function(){t.apply(this,arguments),n.apply(this,arguments)}}function wt(t,n){return t===dt?n:function(){var e=t.apply(this,arguments);e!==void 0&&(arguments[0]=e);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=n.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?vt(r,this.onsuccess):r),i&&(this.onerror=this.onerror?vt(i,this.onerror):i),s!==void 0?s:e}}function gt(t,n){return t===dt?n:function(){t.apply(this,arguments);var e=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,n.apply(this,arguments),e&&(this.onsuccess=this.onsuccess?vt(e,this.onsuccess):e),r&&(this.onerror=this.onerror?vt(r,this.onerror):r)}}function mt(t,n){return t===dt?n:function(e){var r=t.apply(this,arguments);v(e,r);var i=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var o=n.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?vt(i,this.onsuccess):i),s&&(this.onerror=this.onerror?vt(s,this.onerror):s),r===void 0?o===void 0?void 0:o:v(r,o)}}function bt(t,n){return t===dt?n:function(){return n.apply(this,arguments)!==!1&&t.apply(this,arguments)}}function kt(t,n){return t===dt?n:function(){var e=t.apply(this,arguments);if(e&&typeof e.then=="function"){for(var r=this,i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return e.then((function(){return n.apply(r,s)}))}return n.apply(this,arguments)}}ft.ModifyError=ot,ft.DexieError=it,ft.BulkError=ut;var $t={};const At=100,[St,xt,Pt]=typeof Promise>"u"?[]:(()=>{let t=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[t,w(t),t];const n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,w(n),t]})(),Et=xt&&xt.then,Ct=St&&St.constructor,Ot=!!Pt;var Tt=!1,Dt=Pt?()=>{Pt.then(tn)}:d.setImmediate?setImmediate.bind(null,tn):d.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver((()=>{tn(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(tn,0)},It=function(t,n){Ft.push([t,n]),Rt&&(Dt(),Rt=!1)},jt=!0,Rt=!0,Kt=[],Bt=[],_t=null,qt=yt,Nt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((t=>{try{Pn(t[0],t[1])}catch{}}))}},Mt=Nt,Ft=[],Ut=0,Lt=[];function Vt(t){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=dt,this._lib=!1;var n=this._PSD=Mt;if(J&&(this._stackHolder=Z(),this._prev=null,this._numPrev=0),typeof t!="function"){if(t!==$t)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&zt(this,this._value))}this._state=null,this._value=null,++n.ref,Gt(this,t)}const Ht={get:function(){var t=Mt,n=hn;function e(e,r){var i=!t.global&&(t!==Mt||n!==hn);const s=i&&!pn();var o=new Vt(((n,o)=>{Yt(this,new Wt(An(e,t,i,s),An(r,t,i,s),n,o,t))}));return J&&Zt(o,this),o}return e.prototype=$t,e},set:function(t){$(this,"then",t&&t.prototype===$t?Ht:{get:function(){return t},set:Ht.set})}};function Wt(t,n,e,r,i){this.onFulfilled=typeof t=="function"?t:null,this.onRejected=typeof n=="function"?n:null,this.resolve=e,this.reject=r,this.psd=i}function Gt(t,n){try{n((n=>{if(t._state===null){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var e=t._lib&&nn();n&&typeof n.then=="function"?Gt(t,((t,e)=>{n instanceof Vt?n._then(t,e):n.then(t,e)})):(t._state=!0,t._value=n,Jt(t)),e&&en()}}),zt.bind(null,t))}catch(n){zt(t,n)}}function zt(t,n){if(Bt.push(n),t._state===null){var e=t._lib&&nn();n=qt(n),t._state=!1,t._value=n,J&&n!==null&&typeof n=="object"&&!n._promise&&function(t,n,e){try{t.apply(null,e)}catch(t){n&&n(t)}}((()=>{var e=x(n,"stack");n._promise=t,$(n,"stack",{get:()=>Tt?e&&(e.get?e.get.apply(n):e.value):t.stack})})),function(t){Kt.some((n=>n._value===t._value))||Kt.push(t)}(t),Jt(t),e&&en()}}function Jt(t){var n=t._listeners;t._listeners=[];for(var e=0,r=n.length;e<r;++e)Yt(t,n[e]);var i=t._PSD;--i.ref||i.finalize(),Ut===0&&(++Ut,It((()=>{--Ut==0&&rn()}),[]))}function Yt(t,n){if(t._state!==null){var e=t._state?n.onFulfilled:n.onRejected;if(e===null)return(t._state?n.resolve:n.reject)(t._value);++n.psd.ref,++Ut,It(Qt,[e,t,n])}else t._listeners.push(n)}function Qt(t,n,e){try{_t=n;var r,i=n._value;n._state?r=t(i):(Bt.length&&(Bt=[]),r=t(i),Bt.indexOf(i)===-1&&function(t){for(var n=Kt.length;n;)if(Kt[--n]._value===t._value)return void Kt.splice(n,1)}(n)),e.resolve(r)}catch(t){e.reject(t)}finally{_t=null,--Ut==0&&rn(),--e.psd.ref||e.psd.finalize()}}function Xt(t,n,e){if(n.length===e)return n;var r="";if(t._state===!1){var i,s,o=t._value;o!=null?(i=o.name||"Error",s=o.message||o,r=tt(o,0)):(i=o,s=""),n.push(i+(s?": "+s:"")+r)}return J&&((r=tt(t._stackHolder,2))&&n.indexOf(r)===-1&&n.push(r),t._prev&&Xt(t._prev,n,e)),n}function Zt(t,n){var e=n?n._numPrev+1:0;e<100&&(t._prev=n,t._numPrev=e)}function tn(){nn()&&en()}function nn(){var t=jt;return jt=!1,Rt=!1,t}function en(){var t,n,e;do{for(;Ft.length>0;)for(t=Ft,Ft=[],e=t.length,n=0;n<e;++n){var r=t[n];r[0].apply(null,r[1])}}while(Ft.length>0);jt=!0,Rt=!0}function rn(){var t=Kt;Kt=[],t.forEach((t=>{t._PSD.onunhandled.call(null,t._value,t)}));for(var n=Lt.slice(0),e=n.length;e;)n[--e]()}function sn(t){return new Vt($t,!1,t)}function on(t,n){var e=Mt;return function(){var r=nn(),i=Mt;try{return mn(e,!0),t.apply(this,arguments)}catch(t){n&&n(t)}finally{mn(i,!1),r&&en()}}}b(Vt.prototype,{then:Ht,_then:function(t,n){Yt(this,new Wt(null,null,t,n,Mt))},catch:function(t){if(arguments.length===1)return this.then(null,t);var n=arguments[0],e=arguments[1];return typeof n=="function"?this.then(null,(t=>t instanceof n?e(t):sn(t))):this.then(null,(t=>t&&t.name===n?e(t):sn(t)))},finally:function(t){return this.then((n=>(t(),n)),(n=>(t(),sn(n))))},stack:{get:function(){if(this._stack)return this._stack;try{Tt=!0;var t=Xt(this,[],20).join(`\nFrom previous: `);return this._state!==null&&(this._stack=t),t}finally{Tt=!1}}},timeout:function(t,n){return t<1/0?new Vt(((e,r)=>{var i=setTimeout((()=>r(new lt.Timeout(n))),t);this.then(e,r).finally(clearTimeout.bind(null,i))})):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&$(Vt.prototype,Symbol.toStringTag,"Dexie.Promise"),Nt.env=bn(),b(Vt,{all:function(){var t=G.apply(null,arguments).map(vn);return new Vt((function(n,e){t.length===0&&n([]);var r=t.length;t.forEach(((i,s)=>Vt.resolve(i).then((e=>{t[s]=e,--r||n(t)}),e)))}))},resolve:t=>{if(t instanceof Vt)return t;if(t&&typeof t.then=="function")return new Vt(((n,e)=>{t.then(n,e)}));var n=new Vt($t,!0,t);return Zt(n,_t),n},reject:sn,race:function(){var t=G.apply(null,arguments).map(vn);return new Vt(((n,e)=>{t.map((t=>Vt.resolve(t).then(n,e)))}))},PSD:{get:()=>Mt,set:t=>Mt=t},totalEchoes:{get:()=>hn},newPSD:dn,usePSD:kn,scheduler:{get:()=>It,set:t=>{It=t}},rejectionMapper:{get:()=>qt,set:t=>{qt=t}},follow:(t,n)=>new Vt(((e,r)=>dn(((n,e)=>{var r=Mt;r.unhandleds=[],r.onunhandled=e,r.finalize=vt((function(){(function(t){function n(){t(),Lt.splice(Lt.indexOf(n),1)}Lt.push(n),++Ut,It((()=>{--Ut==0&&rn()}),[])})((()=>{this.unhandleds.length===0?n():e(this.unhandleds[0])}))}),r.finalize),t()}),n,e,r)))}),Ct&&(Ct.allSettled&&$(Vt,"allSettled",(function(){const t=G.apply(null,arguments).map(vn);return new Vt((n=>{t.length===0&&n([]);let e=t.length;const r=new Array(e);t.forEach(((t,i)=>Vt.resolve(t).then((t=>r[i]={status:"fulfilled",value:t}),(t=>r[i]={status:"rejected",reason:t})).then((()=>--e||n(r)))))}))})),Ct.any&&typeof AggregateError<"u"&&$(Vt,"any",(function(){const t=G.apply(null,arguments).map(vn);return new Vt(((n,e)=>{t.length===0&&e(new AggregateError([]));let r=t.length;const i=new Array(r);t.forEach(((t,s)=>Vt.resolve(t).then((t=>n(t)),(t=>{i[s]=t,--r||e(new AggregateError(i))}))))}))})));const un={awaits:0,echoes:0,id:0};var an=0,cn=[],ln=0,hn=0,fn=0;function dn(t,n,e,r){var i=Mt,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++fn;var o=Nt.env;s.env=Ot?{Promise:Vt,PromiseProp:{value:Vt,configurable:!0,writable:!0},all:Vt.all,race:Vt.race,allSettled:Vt.allSettled,any:Vt.any,resolve:Vt.resolve,reject:Vt.reject,nthen:Sn(o.nthen,s),gthen:Sn(o.gthen,s)}:{},n&&v(s,n),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=kn(s,t,e,r);return s.ref===0&&s.finalize(),u}function yn(){return un.id||(un.id=++an),++un.awaits,un.echoes+=At,un.id}function pn(){return!!un.awaits&&(--un.awaits==0&&(un.id=0),un.echoes=un.awaits*At,!0)}function vn(t){return un.echoes&&t&&t.constructor===Ct?(yn(),t.then((t=>(pn(),t)),(t=>(pn(),En(t))))):t}function wn(t){++hn,un.echoes&&--un.echoes!=0||(un.echoes=un.id=0),cn.push(Mt),mn(t,!0)}function gn(){var t=cn[cn.length-1];cn.pop(),mn(t,!1)}function mn(t,n){var e=Mt;if((n?!un.echoes||ln++&&t===Mt:!ln||--ln&&t===Mt)||$n(n?wn.bind(null,t):gn),t!==Mt&&(Mt=t,e===Nt&&(Nt.env=bn()),Ot)){var r=Nt.env.Promise,i=t.env;xt.then=i.nthen,r.prototype.then=i.gthen,(e.global||t.global)&&(Object.defineProperty(d,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function bn(){var t=d.Promise;return Ot?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(d,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:xt.then,gthen:t.prototype.then}:{}}function kn(t,n,e,r,i){var s=Mt;try{return mn(t,!0),n(e,r,i)}finally{mn(s,!1)}}function $n(t){Et.call(St,t)}function An(t,n,e,r){return typeof t!="function"?t:function(){var i=Mt;e&&yn(),mn(n,!0);try{return t.apply(this,arguments)}finally{mn(i,!1),r&&$n(pn)}}}function Sn(t,n){return function(e,r){return t.call(this,An(e,n),An(r,n))}}(""+Et).indexOf("[native code]")===-1&&(yn=pn=dt);const xn="unhandledrejection";function Pn(t,n){var e;try{e=n.onuncatched(t)}catch{}if(e!==!1)try{var r,i={promise:n,reason:t};if(d.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(xn,!0,!0),v(r,i)):d.CustomEvent&&v(r=new CustomEvent(xn,{detail:i}),i),r&&d.dispatchEvent&&(dispatchEvent(r),!d.PromiseRejectionEvent&&d.onunhandledrejection))try{d.onunhandledrejection(r)}catch{}J&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${t.stack||t}`)}catch{}}var En=Vt.reject;function Cn(t,n,e,r){if(t.idbdb&&(t._state.openComplete||Mt.letThrough||t._vip)){var i=t._createTransaction(n,e,t._dbSchema);try{i.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===at.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((()=>Cn(t,n,e,r)))):En(i)}return i._promise(n,((t,n)=>dn((()=>(Mt.trans=i,r(t,n,i)))))).then((t=>i._completion.then((()=>t))))}if(t._state.openComplete)return En(new lt.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return En(new lt.DatabaseClosed);t.open().catch(dt)}return t._state.dbReadyPromise.then((()=>Cn(t,n,e,r)))}const On="3.2.4",Tn=String.fromCharCode(65535),Dn=-1/0,In="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",jn="String expected.",Rn=[],Kn=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Bn=Kn,_n=Kn,qn=t=>!/(dexie\.js|dexie\.min\.js)/.test(t),Nn="__dbnames",Mn="readonly",Fn="readwrite";function Un(t,n){return t?n?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:t:n}const Ln={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Vn(t){return typeof t!="string"||/\./.test(t)?t=>t:n=>(n[t]===void 0&&t in n&&delete(n=M(n))[t],n)}class Hn{_trans(t,n,e){const r=this._tx||Mt.trans,i=this.name;function s(t,e,r){if(!r.schema[i])throw new lt.NotFound("Table "+i+" not part of transaction");return n(r.idbtrans,r)}const o=nn();try{return r&&r.db===this.db?r===Mt.trans?r._promise(t,s,e):dn((()=>r._promise(t,s,e)),{trans:r,transless:Mt.transless||Mt}):Cn(this.db,t,[this.name],s)}finally{o&&en()}}get(t,n){return t&&t.constructor===Object?this.where(t).first(n):this._trans("readonly",(n=>this.core.get({trans:n,key:t}).then((t=>this.hook.reading.fire(t))))).then(n)}where(t){if(typeof t=="string")return new this.db.WhereClause(this,t);if(p(t))return new this.db.WhereClause(this,`[${t.join("+")}]`);const n=y(t);if(n.length===1)return this.where(n[0]).equals(t[n[0]]);const e=this.schema.indexes.concat(this.schema.primKey).filter((t=>t.compound&&n.every((n=>t.keyPath.indexOf(n)>=0))&&t.keyPath.every((t=>n.indexOf(t)>=0))))[0];if(e&&this.db._maxKey!==Tn)return this.where(e.name).equals(e.keyPath.map((n=>t[n])));!e&&J&&console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function s(t,n){try{return i.cmp(t,n)===0}catch{return!1}}const[o,u]=n.reduce((([n,e],i)=>{const o=r[i],u=t[i];return[n||o,n||!o?Un(e,o&&o.multi?t=>{const n=I(t,i);return p(n)&&n.some((t=>s(u,t)))}:t=>s(u,I(t,i))):e]}),[null,null]);return o?this.where(o.name).equals(t[o.keyPath]).filter(u):e?this.filter(u):this.where(n).equals("")}filter(t){return this.toCollection().and(t)}count(t){return this.toCollection().count(t)}offset(t){return this.toCollection().offset(t)}limit(t){return this.toCollection().limit(t)}each(t){return this.toCollection().each(t)}toArray(t){return this.toCollection().toArray(t)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(t){return new this.db.Collection(new this.db.WhereClause(this,p(t)?`[${t.join("+")}]`:t))}reverse(){return this.toCollection().reverse()}mapToClass(t){this.schema.mappedClass=t;const n=n=>{if(!n)return n;const e=Object.create(t.prototype);for(var r in n)if(m(n,r))try{e[r]=n[r]}catch{}return e};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),t}defineClass(){return this.mapToClass((function(t){v(this,t)}))}add(t,n){const{auto:e,keyPath:r}=this.schema.primKey;let i=t;return r&&e&&(i=Vn(r)(t)),this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"add",keys:n!=null?[n]:null,values:[i]}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):t.lastResult)).then((n=>{if(r)try{j(t,r,n)}catch{}return n}))}update(t,n){if(typeof t!="object"||p(t))return this.where(":id").equals(t).modify(n);{const e=I(t,this.schema.primKey.keyPath);if(e===void 0)return En(new lt.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?y(n).forEach((e=>{j(t,e,n[e])})):n(t,{value:t,primKey:e})}catch{}return this.where(":id").equals(e).modify(n)}}put(t,n){const{auto:e,keyPath:r}=this.schema.primKey;let i=t;return r&&e&&(i=Vn(r)(t)),this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"put",values:[i],keys:n!=null?[n]:null}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):t.lastResult)).then((n=>{if(r)try{j(t,r,n)}catch{}return n}))}delete(t){return this._trans("readwrite",(n=>this.core.mutate({trans:n,type:"delete",keys:[t]}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):void 0))}clear(){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"deleteRange",range:Ln}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):void 0))}bulkGet(t){return this._trans("readonly",(n=>this.core.getMany({keys:t,trans:n}).then((t=>t.map((t=>this.hook.reading.fire(t)))))))}bulkAdd(t,n,e){const r=Array.isArray(n)?n:void 0,i=(e=e||(r?void 0:n))?e.allKeys:void 0;return this._trans("readwrite",(n=>{const{auto:e,keyPath:s}=this.schema.primKey;if(s&&r)throw new lt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new lt.InvalidArgument("Arguments objects and keys must have the same length");const o=t.length;let u=s&&e?t.map(Vn(s)):t;return this.core.mutate({trans:n,type:"add",keys:r,values:u,wantResults:i}).then((({numFailures:t,results:n,lastResult:e,failures:r})=>{if(t===0)return i?n:e;throw new ut(`${this.name}.bulkAdd(): ${t} of ${o} operations failed`,r)}))}))}bulkPut(t,n,e){const r=Array.isArray(n)?n:void 0,i=(e=e||(r?void 0:n))?e.allKeys:void 0;return this._trans("readwrite",(n=>{const{auto:e,keyPath:s}=this.schema.primKey;if(s&&r)throw new lt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new lt.InvalidArgument("Arguments objects and keys must have the same length");const o=t.length;let u=s&&e?t.map(Vn(s)):t;return this.core.mutate({trans:n,type:"put",keys:r,values:u,wantResults:i}).then((({numFailures:t,results:n,lastResult:e,failures:r})=>{if(t===0)return i?n:e;throw new ut(`${this.name}.bulkPut(): ${t} of ${o} operations failed`,r)}))}))}bulkDelete(t){const n=t.length;return this._trans("readwrite",(n=>this.core.mutate({trans:n,type:"delete",keys:t}))).then((({numFailures:t,lastResult:e,failures:r})=>{if(t===0)return e;throw new ut(`${this.name}.bulkDelete(): ${t} of ${n} operations failed`,r)}))}}function Wn(t){var n={},e=function(e,r){if(r){for(var i=arguments.length,s=new Array(i-1);--i;)s[i-1]=arguments[i];return n[e].subscribe.apply(null,s),t}if(typeof e=="string")return n[e]};e.addEventType=s;for(var r=1,i=arguments.length;r<i;++r)s(arguments[r]);return e;function s(t,r,i){if(typeof t!="object"){var o;r||(r=bt),i||(i=dt);var u={subscribers:[],fire:i,subscribe:function(t){u.subscribers.indexOf(t)===-1&&(u.subscribers.push(t),u.fire=r(u.fire,t))},unsubscribe:function(t){u.subscribers=u.subscribers.filter((function(n){return n!==t})),u.fire=u.subscribers.reduce(r,i)}};return n[t]=e[t]=u,u}y(o=t).forEach((function(t){var n=o[t];if(p(n))s(t,o[t][0],o[t][1]);else{if(n!=="asap")throw new lt.InvalidArgument("Invalid event config");var e=s(t,yt,(function(){for(var t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];e.subscribers.forEach((function(t){T((function(){t.apply(null,n)}))}))}))}}))}}function Gn(t,n){return A(n).from({prototype:t}),n}function zn(t,n){return!(t.filter||t.algorithm||t.or)&&(n?t.justLimit:!t.replayFilter)}function Jn(t,n){t.filter=Un(t.filter,n)}function Yn(t,n,e){var r=t.replayFilter;t.replayFilter=r?()=>Un(r(),n()):n,t.justLimit=e&&!r}function Qn(t,n){if(t.isPrimKey)return n.primaryKey;const e=n.getIndexByKeyPath(t.index);if(!e)throw new lt.Schema("KeyPath "+t.index+" on object store "+n.name+" is not indexed");return e}function Xn(t,n,e){const r=Qn(t,n.schema);return n.openCursor({trans:e,values:!t.keysOnly,reverse:t.dir==="prev",unique:!!t.unique,query:{index:r,range:t.range}})}function Zn(t,n,e,r){const i=t.replayFilter?Un(t.filter,t.replayFilter()):t.filter;if(t.or){const s={},o=(t,e,r)=>{if(!i||i(e,r,(t=>e.stop(t)),(t=>e.fail(t)))){var o=e.primaryKey,u=""+o;u==="[object ArrayBuffer]"&&(u=""+new Uint8Array(o)),m(s,u)||(s[u]=!0,n(t,e,r))}};return Promise.all([t.or._iterate(o,e),te(Xn(t,r,e),t.algorithm,o,!t.keysOnly&&t.valueMapper)])}return te(Xn(t,r,e),Un(t.algorithm,i),n,!t.keysOnly&&t.valueMapper)}function te(t,n,e,r){var i=on(r?(t,n,i)=>e(r(t),n,i):e);return t.then((t=>{if(t)return t.start((()=>{var e=()=>t.continue();n&&!n(t,(t=>e=t),(n=>{t.stop(n),e=dt}),(n=>{t.fail(n),e=dt}))||i(t.value,t,(t=>e=t)),e()}))}))}function ne(t,n){try{const e=ee(t),r=ee(n);if(e!==r)return e==="Array"?1:r==="Array"?-1:e==="binary"?1:r==="binary"?-1:e==="string"?1:r==="string"?-1:e==="Date"?1:r!=="Date"?NaN:-1;switch(e){case"number":case"Date":case"string":return t>n?1:t<n?-1:0;case"binary":return function(t,n){const e=t.length,r=n.length,i=e<r?e:r;for(let e=0;e<i;++e)if(t[e]!==n[e])return t[e]<n[e]?-1:1;return e===r?0:e<r?-1:1}(re(t),re(n));case"Array":return function(t,n){const e=t.length,r=n.length,i=e<r?e:r;for(let e=0;e<i;++e){const r=ne(t[e],n[e]);if(r!==0)return r}return e===r?0:e<r?-1:1}(t,n)}}catch{}return NaN}function ee(t){const n=typeof t;if(n!=="object")return n;if(ArrayBuffer.isView(t))return"binary";const e=L(t);return e==="ArrayBuffer"?"binary":e}function re(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}class ie{_read(t,n){var e=this._ctx;return e.error?e.table._trans(null,En.bind(null,e.error)):e.table._trans("readonly",t).then(n)}_write(t){var n=this._ctx;return n.error?n.table._trans(null,En.bind(null,n.error)):n.table._trans("readwrite",t,"locked")}_addAlgorithm(t){var n=this._ctx;n.algorithm=Un(n.algorithm,t)}_iterate(t,n){return Zn(this._ctx,t,n,this._ctx.table.core)}clone(t){var n=Object.create(this.constructor.prototype),e=Object.create(this._ctx);return t&&v(e,t),n._ctx=e,n}raw(){return this._ctx.valueMapper=null,this}each(t){var n=this._ctx;return this._read((e=>Zn(n,t,e,n.table.core)))}count(t){return this._read((t=>{const n=this._ctx,e=n.table.core;if(zn(n,!0))return e.count({trans:t,query:{index:Qn(n,e.schema),range:n.range}}).then((t=>Math.min(t,n.limit)));var r=0;return Zn(n,(()=>(++r,!1)),t,e).then((()=>r))})).then(t)}sortBy(t,n){const e=t.split(".").reverse(),r=e[0],i=e.length-1;function s(t,n){return n?s(t[e[n]],n-1):t[r]}var o=this._ctx.dir==="next"?1:-1;function u(t,n){var e=s(t,i),r=s(n,i);return e<r?-o:e>r?o:0}return this.toArray((function(t){return t.sort(u)})).then(n)}toArray(t){return this._read((t=>{var n=this._ctx;if(n.dir==="next"&&zn(n,!0)&&n.limit>0){const{valueMapper:e}=n,r=Qn(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:r,range:n.range}}).then((({result:t})=>e?t.map(e):t))}{const e=[];return Zn(n,(t=>e.push(t)),t,n.table.core).then((()=>e))}}),t)}offset(t){var n=this._ctx;return t<=0||(n.offset+=t,zn(n)?Yn(n,(()=>{var n=t;return(t,e)=>n===0||(n===1?(--n,!1):(e((()=>{t.advance(n),n=0})),!1))})):Yn(n,(()=>{var n=t;return()=>--n<0}))),this}limit(t){return this._ctx.limit=Math.min(this._ctx.limit,t),Yn(this._ctx,(()=>{var n=t;return function(t,e,r){return--n<=0&&e(r),n>=0}}),!0),this}until(t,n){return Jn(this._ctx,(function(e,r,i){return!t(e.value)||(r(i),n)})),this}first(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)}last(t){return this.reverse().first(t)}filter(t){var n,e;return Jn(this._ctx,(function(n){return t(n.value)})),n=this._ctx,e=t,n.isMatch=Un(n.isMatch,e),this}and(t){return this.filter(t)}or(t){return new this.db.WhereClause(this._ctx.table,t,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(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each((function(n,e){t(e.key,e)}))}eachUniqueKey(t){return this._ctx.unique="unique",this.eachKey(t)}eachPrimaryKey(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each((function(n,e){t(e.primaryKey,e)}))}keys(t){var n=this._ctx;n.keysOnly=!n.isMatch;var e=[];return this.each((function(t,n){e.push(n.key)})).then((function(){return e})).then(t)}primaryKeys(t){var n=this._ctx;if(n.dir==="next"&&zn(n,!0)&&n.limit>0)return this._read((t=>{var e=Qn(n,n.table.core.schema);return n.table.core.query({trans:t,values:!1,limit:n.limit,query:{index:e,range:n.range}})})).then((({result:t})=>t)).then(t);n.keysOnly=!n.isMatch;var e=[];return this.each((function(t,n){e.push(n.primaryKey)})).then((function(){return e})).then(t)}uniqueKeys(t){return this._ctx.unique="unique",this.keys(t)}firstKey(t){return this.limit(1).keys((function(t){return t[0]})).then(t)}lastKey(t){return this.reverse().firstKey(t)}distinct(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var e={};return Jn(this._ctx,(function(t){var n=t.primaryKey.toString(),r=m(e,n);return e[n]=!0,!r})),this}modify(t){var n=this._ctx;return this._write((e=>{var r;if(typeof t=="function")r=t;else{var i=y(t),s=i.length;r=function(n){for(var e=!1,r=0;r<s;++r){var o=i[r],u=t[o];I(n,o)!==u&&(j(n,o,u),e=!0)}return e}}const o=n.table.core,{outbound:u,extractKey:a}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const f=[],d=(t,n)=>{const{failures:e,numFailures:r}=n;h+=t-r;for(let t of y(e))l.push(e[t])};return this.clone().primaryKeys().then((i=>{const s=l=>{const h=Math.min(c,i.length-l);return o.getMany({trans:e,keys:i.slice(l,l+h),cache:"immutable"}).then((f=>{const y=[],p=[],v=u?[]:null,w=[];for(let t=0;t<h;++t){const n=f[t],e={value:M(n),primKey:i[l+t]};r.call(e,e.value,e)!==!1&&(e.value==null?w.push(i[l+t]):u||ne(a(n),a(e.value))===0?(p.push(e.value),u&&v.push(i[l+t])):(w.push(i[l+t]),y.push(e.value)))}const g=zn(n)&&n.limit===1/0&&(typeof t!="function"||t===se)&&{index:n.index,range:n.range};return Promise.resolve(y.length>0&&o.mutate({trans:e,type:"add",values:y}).then((t=>{for(let n in t.failures)w.splice(parseInt(n),1);d(y.length,t)}))).then((()=>(p.length>0||g&&typeof t=="object")&&o.mutate({trans:e,type:"put",keys:v,values:p,criteria:g,changeSpec:typeof t!="function"&&t}).then((t=>d(p.length,t))))).then((()=>(w.length>0||g&&t===se)&&o.mutate({trans:e,type:"delete",keys:w,criteria:g}).then((t=>d(w.length,t))))).then((()=>i.length>l+h&&s(l+c)))}))};return s(0).then((()=>{if(l.length>0)throw new ot("Error modifying one or more objects",l,h,f);return i.length}))}))}))}delete(){var t=this._ctx,n=t.range;return zn(t)&&(t.isPrimKey&&!_n||n.type===3)?this._write((e=>{const{primaryKey:r}=t.table.core.schema,i=n;return t.table.core.count({trans:e,query:{index:r,range:i}}).then((n=>t.table.core.mutate({trans:e,type:"deleteRange",range:i}).then((({failures:t,lastResult:e,results:r,numFailures:i})=>{if(i)throw new ot("Could not delete some values",Object.keys(t).map((n=>t[n])),n-i);return n-i}))))})):this.modify(se)}}const se=(t,n)=>n.value=null;function oe(t,n){return t<n?-1:t===n?0:1}function ue(t,n){return t>n?-1:t===n?0:1}function ae(t,n,e){var r=t instanceof ye?new t.Collection(t):t;return r._ctx.error=e?new e(n):new TypeError(n),r}function ce(t){return new t.Collection(t,(()=>de(""))).limit(0)}function le(t,n,e,r,i,s){for(var o=Math.min(t.length,r.length),u=-1,a=0;a<o;++a){var c=n[a];if(c!==r[a])return i(t[a],e[a])<0?t.substr(0,a)+e[a]+e.substr(a+1):i(t[a],r[a])<0?t.substr(0,a)+r[a]+e.substr(a+1):u>=0?t.substr(0,u)+n[u]+e.substr(u+1):null;i(t[a],c)<0&&(u=a)}return o<r.length&&s==="next"?t+e.substr(t.length):o<t.length&&s==="prev"?t.substr(0,e.length):u<0?null:t.substr(0,u)+r[u]+e.substr(u+1)}function he(t,n,e,r){var i,s,o,u,a,c,l,h=e.length;if(!e.every((t=>typeof t=="string")))return ae(t,jn);function f(t){i=function(t){return t==="next"?t=>t.toUpperCase():t=>t.toLowerCase()}(t),s=function(t){return t==="next"?t=>t.toLowerCase():t=>t.toUpperCase()}(t),o=t==="next"?oe:ue;var n=e.map((function(t){return{lower:s(t),upper:i(t)}})).sort((function(t,n){return o(t.lower,n.lower)}));u=n.map((function(t){return t.upper})),a=n.map((function(t){return t.lower})),c=t,l=t==="next"?"":r}f("next");var d=new t.Collection(t,(()=>fe(u[0],a[h-1]+r)));d._ondirectionchange=function(t){f(t)};var y=0;return d._addAlgorithm((function(t,e,r){var i=t.key;if(typeof i!="string")return!1;var f=s(i);if(n(f,a,y))return!0;for(var d=null,p=y;p<h;++p){var v=le(i,f,u[p],a[p],o,c);v===null&&d===null?y=p+1:(d===null||o(d,v)>0)&&(d=v)}return e(d!==null?function(){t.continue(d+l)}:r),!1})),d}function fe(t,n,e,r){return{type:2,lower:t,upper:n,lowerOpen:e,upperOpen:r}}function de(t){return{type:1,lower:t,upper:t}}class ye{get Collection(){return this._ctx.table.db.Collection}between(t,n,e,r){e=e!==!1,r=r===!0;try{return this._cmp(t,n)>0||this._cmp(t,n)===0&&(e||r)&&(!e||!r)?ce(this):new this.Collection(this,(()=>fe(t,n,!e,!r)))}catch{return ae(this,In)}}equals(t){return t==null?ae(this,In):new this.Collection(this,(()=>de(t)))}above(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(t,void 0,!0)))}aboveOrEqual(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(t,void 0,!1)))}below(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(void 0,t,!1,!0)))}belowOrEqual(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(void 0,t)))}startsWith(t){return typeof t!="string"?ae(this,jn):this.between(t,t+Tn,!0,!0)}startsWithIgnoreCase(t){return t===""?this.startsWith(t):he(this,((t,n)=>t.indexOf(n[0])===0),[t],Tn)}equalsIgnoreCase(t){return he(this,((t,n)=>t===n[0]),[t],"")}anyOfIgnoreCase(){var t=G.apply(W,arguments);return t.length===0?ce(this):he(this,((t,n)=>n.indexOf(t)!==-1),t,"")}startsWithAnyOfIgnoreCase(){var t=G.apply(W,arguments);return t.length===0?ce(this):he(this,((t,n)=>n.some((n=>t.indexOf(n)===0))),t,Tn)}anyOf(){const t=G.apply(W,arguments);let n=this._cmp;try{t.sort(n)}catch{return ae(this,In)}if(t.length===0)return ce(this);const e=new this.Collection(this,(()=>fe(t[0],t[t.length-1])));e._ondirectionchange=e=>{n=e==="next"?this._ascending:this._descending,t.sort(n)};let r=0;return e._addAlgorithm(((e,i,s)=>{const o=e.key;for(;n(o,t[r])>0;)if(++r,r===t.length)return i(s),!1;return n(o,t[r])===0||(i((()=>{e.continue(t[r])})),!1)})),e}notEqual(t){return this.inAnyRange([[Dn,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const t=G.apply(W,arguments);if(t.length===0)return new this.Collection(this);try{t.sort(this._ascending)}catch{return ae(this,In)}const n=t.reduce(((t,n)=>t?t.concat([[t[t.length-1][1],n]]):[[Dn,n]]),null);return n.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})}inAnyRange(t,n){const e=this._cmp,r=this._ascending,i=this._descending,s=this._min,o=this._max;if(t.length===0)return ce(this);if(!t.every((t=>t[0]!==void 0&&t[1]!==void 0&&r(t[0],t[1])<=0)))return ae(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",lt.InvalidArgument);const u=!n||n.includeLowers!==!1,a=n&&n.includeUppers===!0;let c,l=r;function h(t,n){return l(t[0],n[0])}try{c=t.reduce((function(t,n){let r=0,i=t.length;for(;r<i;++r){const i=t[r];if(e(n[0],i[1])<0&&e(n[1],i[0])>0){i[0]=s(i[0],n[0]),i[1]=o(i[1],n[1]);break}}return r===i&&t.push(n),t}),[]),c.sort(h)}catch{return ae(this,In)}let f=0;const d=a?t=>r(t,c[f][1])>0:t=>r(t,c[f][1])>=0,y=u?t=>i(t,c[f][0])>0:t=>i(t,c[f][0])>=0;let p=d;const v=new this.Collection(this,(()=>fe(c[0][0],c[c.length-1][1],!u,!a)));return v._ondirectionchange=t=>{t==="next"?(p=d,l=r):(p=y,l=i),c.sort(h)},v._addAlgorithm(((t,n,e)=>{for(var i=t.key;p(i);)if(++f,f===c.length)return n(e),!1;return!!function(t){return!d(t)&&!y(t)}(i)||(this._cmp(i,c[f][1])===0||this._cmp(i,c[f][0])===0||n((()=>{l===r?t.continue(c[f][0]):t.continue(c[f][1])})),!1)})),v}startsWithAnyOf(){const t=G.apply(W,arguments);return t.every((t=>typeof t=="string"))?t.length===0?ce(this):this.inAnyRange(t.map((t=>[t,t+Tn]))):ae(this,"startsWithAnyOf() only works with strings")}}function pe(t){return on((function(n){return ve(n),t(n.target.error),!1}))}function ve(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}const we="storagemutated",ge="x-storagemutated-1",me=Wn(null,we);class be{_lock(){return O(!Mt.global),++this._reculock,this._reculock!==1||Mt.global||(Mt.lockOwnerFor=this),this}_unlock(){if(O(!Mt.global),--this._reculock==0)for(Mt.global||(Mt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{kn(t[1],t[0])}catch{}}return this}_locked(){return this._reculock&&Mt.lockOwnerFor!==this}create(t){if(!this.mode)return this;const n=this.db.idbdb,e=this.db._state.dbOpenError;if(O(!this.idbtrans),!t&&!n)switch(e&&e.name){case"DatabaseClosedError":throw new lt.DatabaseClosed(e);case"MissingAPIError":throw new lt.MissingAPI(e.message,e);default:throw new lt.OpenFailed(e)}if(!this.active)throw new lt.TransactionInactive;return O(this._completion._state===null),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=on((n=>{ve(n),this._reject(t.error)})),t.onabort=on((n=>{ve(n),this.active&&this._reject(new lt.Abort(t.error)),this.active=!1,this.on("abort").fire(n)})),t.oncomplete=on((()=>{this.active=!1,this._resolve(),"mutatedParts"in t&&me.storagemutated.fire(t.mutatedParts)})),this}_promise(t,n,e){if(t==="readwrite"&&this.mode!=="readwrite")return En(new lt.ReadOnly("Transaction is readonly"));if(!this.active)return En(new lt.TransactionInactive);if(this._locked())return new Vt(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(t,n,e).then(r,i)},Mt])}));if(e)return dn((()=>{var t=new Vt(((t,e)=>{this._lock();const r=n(t,e,this);r&&r.then&&r.then(t,e)}));return t.finally((()=>this._unlock())),t._lib=!0,t}));var r=new Vt(((t,e)=>{var r=n(t,e,this);r&&r.then&&r.then(t,e)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(t){var n=this._root();const e=Vt.resolve(t);if(n._waitingFor)n._waitingFor=n._waitingFor.then((()=>e));else{n._waitingFor=e,n._waitingQueue=[];var r=n.idbtrans.objectStore(n.storeNames[0]);(function t(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(r.get(-1/0).onsuccess=t)})()}var i=n._waitingFor;return new Vt(((t,r)=>{e.then((e=>n._waitingQueue.push(on(t.bind(null,e)))),(t=>n._waitingQueue.push(on(r.bind(null,t))))).finally((()=>{n._waitingFor===i&&(n._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new lt.Abort))}table(t){const n=this._memoizedTables||(this._memoizedTables={});if(m(n,t))return n[t];const e=this.schema[t];if(!e)throw new lt.NotFound("Table "+t+" not part of transaction");const r=new this.db.Table(t,e,this);return r.core=this.db.core.table(t),n[t]=r,r}}function ke(t,n,e,r,i,s,o){return{name:t,keyPath:n,unique:e,multi:r,auto:i,compound:s,src:(e&&!o?"&":"")+(r?"*":"")+(i?"++":"")+$e(n)}}function $e(t){return typeof t=="string"?t:t?"["+[].join.call(t,"+")+"]":""}function Ae(t,n,e){return{name:t,primKey:n,indexes:e,mappedClass:null,idxByName:D(e,(t=>[t.name,t]))}}let Se=t=>{try{return t.only([[]]),Se=()=>[[]],[[]]}catch{return Se=()=>Tn,Tn}};function xe(t){return t==null?()=>{}:typeof t=="string"?function(t){return t.split(".").length===1?n=>n[t]:n=>I(n,t)}(t):n=>I(n,t)}function Pe(t){return[].slice.call(t)}let Ee=0;function Ce(t){return t==null?":id":typeof t=="string"?t:`[${t.join("+")}]`}function Oe(t,n,e){function r(t){if(t.type===3)return null;if(t.type===4)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:e,upper:r,lowerOpen:i,upperOpen:s}=t;return e===void 0?r===void 0?null:n.upperBound(r,!!s):r===void 0?n.lowerBound(e,!!i):n.bound(e,r,!!i,!!s)}const{schema:i,hasGetAll:s}=function(t,n){const e=Pe(t.objectStoreNames);return{schema:{name:t.name,tables:e.map((t=>n.objectStore(t))).map((t=>{const{keyPath:n,autoIncrement:e}=t,r=p(n),i=n==null,s={},o={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:n,autoIncrement:e,unique:!0,extractKey:xe(n)},indexes:Pe(t.indexNames).map((n=>t.index(n))).map((t=>{const{name:n,unique:e,multiEntry:r,keyPath:i}=t,o={name:n,compound:p(i),keyPath:i,unique:e,multiEntry:r,extractKey:xe(i)};return s[Ce(i)]=o,o})),getIndexByKeyPath:t=>s[Ce(t)]};return s[":id"]=o.primaryKey,n!=null&&(s[Ce(n)]=o.primaryKey),o}))},hasGetAll:e.length>0&&"getAll"in n.objectStore(e[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,e),o=i.tables.map((t=>function(t){const n=t.name;return{name:n,schema:t,mutate:function({trans:t,type:e,keys:i,values:s,range:o}){return new Promise(((u,a)=>{u=on(u);const c=t.objectStore(n),l=c.keyPath==null,h=e==="put"||e==="add";if(!h&&e!=="delete"&&e!=="deleteRange")throw new Error("Invalid operation type: "+e);const{length:f}=i||s||{length:1};if(i&&s&&i.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(f===0)return u({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const y=[],p=[];let v=0;const w=t=>{++v,ve(t)};if(e==="deleteRange"){if(o.type===4)return u({numFailures:v,failures:p,results:[],lastResult:void 0});o.type===3?y.push(d=c.clear()):y.push(d=c.delete(r(o)))}else{const[t,n]=h?l?[s,i]:[s,null]:[i,null];if(h)for(let r=0;r<f;++r)y.push(d=n&&n[r]!==void 0?c[e](t[r],n[r]):c[e](t[r])),d.onerror=w;else for(let n=0;n<f;++n)y.push(d=c[e](t[n])),d.onerror=w}const g=t=>{const n=t.target.result;y.forEach(((t,n)=>t.error!=null&&(p[n]=t.error))),u({numFailures:v,failures:p,results:e==="delete"?i:y.map((t=>t.result)),lastResult:n})};d.onerror=t=>{w(t),g(t)},d.onsuccess=g}))},getMany:({trans:t,keys:e})=>new Promise(((r,i)=>{r=on(r);const s=t.objectStore(n),o=e.length,u=new Array(o);let a,c=0,l=0;const h=t=>{const n=t.target;u[n._pos]=n.result,++l===c&&r(u)},f=pe(i);for(let t=0;t<o;++t)e[t]!=null&&(a=s.get(e[t]),a._pos=t,a.onsuccess=h,a.onerror=f,++c);c===0&&r(u)})),get:({trans:t,key:e})=>new Promise(((r,i)=>{r=on(r);const s=t.objectStore(n).get(e);s.onsuccess=t=>r(t.target.result),s.onerror=pe(i)})),query:function(t){return e=>new Promise(((i,s)=>{i=on(i);const{trans:o,values:u,limit:a,query:c}=e,l=a===1/0?void 0:a,{index:h,range:f}=c,d=o.objectStore(n),y=h.isPrimaryKey?d:d.index(h.name),p=r(f);if(a===0)return i({result:[]});if(t){const t=u?y.getAll(p,l):y.getAllKeys(p,l);t.onsuccess=t=>i({result:t.target.result}),t.onerror=pe(s)}else{let t=0;const n=u||!("openKeyCursor"in y)?y.openCursor(p):y.openKeyCursor(p),e=[];n.onsuccess=r=>{const s=n.result;return s?(e.push(u?s.value:s.primaryKey),++t===a?i({result:e}):void s.continue()):i({result:e})},n.onerror=pe(s)}}))}(s),openCursor:function({trans:t,values:e,query:i,reverse:s,unique:o}){return new Promise(((u,a)=>{u=on(u);const{index:c,range:l}=i,h=t.objectStore(n),f=c.isPrimaryKey?h:h.index(c.name),d=s?o?"prevunique":"prev":o?"nextunique":"next",y=e||!("openKeyCursor"in f)?f.openCursor(r(l),d):f.openKeyCursor(r(l),d);y.onerror=pe(a),y.onsuccess=on((n=>{const e=y.result;if(!e)return void u(null);e.___id=++Ee,e.done=!1;const r=e.continue.bind(e);let i=e.continuePrimaryKey;i&&(i=i.bind(e));const s=e.advance.bind(e),o=()=>{throw new Error("Cursor not stopped")};e.trans=t,e.stop=e.continue=e.continuePrimaryKey=e.advance=()=>{throw new Error("Cursor not started")},e.fail=on(a),e.next=function(){let t=1;return this.start((()=>t--?this.continue():this.stop())).then((()=>this))},e.start=t=>{const n=new Promise(((t,n)=>{t=on(t),y.onerror=pe(n),e.fail=n,e.stop=n=>{e.stop=e.continue=e.continuePrimaryKey=e.advance=o,t(n)}})),u=()=>{if(y.result)try{t()}catch(t){e.fail(t)}else e.done=!0,e.start=()=>{throw new Error("Cursor behind last entry")},e.stop()};return y.onsuccess=on((t=>{y.onsuccess=u,u()})),e.continue=r,e.continuePrimaryKey=i,e.advance=s,u(),n},u(e)}),a)}))},count({query:t,trans:e}){const{index:i,range:s}=t;return new Promise(((t,o)=>{const u=e.objectStore(n),a=i.isPrimaryKey?u:u.index(i.name),c=r(s),l=c?a.count(c):a.count();l.onsuccess=on((n=>t(n.target.result))),l.onerror=pe(o)}))}}}(t))),u={};return o.forEach((t=>u[t.name]=t)),{stack:"dbcore",transaction:t.transaction.bind(t),table(t){if(!u[t])throw new Error(`Table '${t}' not found`);return u[t]},MIN_KEY:-1/0,MAX_KEY:Se(n),schema:i}}function Te({_novip:t},n){const e=n.db,r=function(t,n,{IDBKeyRange:e,indexedDB:r},i){return{dbcore:function(t,n){return n.reduce(((t,{create:n})=>({...t,...n(t)})),t)}(Oe(n,e,i),t.dbcore)}}(t._middlewares,e,t._deps,n);t.core=r.dbcore,t.tables.forEach((n=>{const e=n.name;t.core.schema.tables.some((t=>t.name===e))&&(n.core=t.core.table(e),t[e]instanceof t.Table&&(t[e].core=n.core))}))}function De({_novip:t},n,e,r){e.forEach((e=>{const i=r[e];n.forEach((n=>{const r=x(n,e);(!r||"value"in r&&r.value===void 0)&&(n===t.Transaction.prototype||n instanceof t.Transaction?$(n,e,{get(){return this.table(e)},set(t){k(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):n[e]=new t.Table(e,i))}))}))}function Ie({_novip:t},n){n.forEach((n=>{for(let e in n)n[e]instanceof t.Table&&delete n[e]}))}function je(t,n){return t._cfg.version-n._cfg.version}function Re(t,n,e,r){const i=t._dbSchema,s=t._createTransaction("readwrite",t._storeNames,i);s.create(e),s._completion.catch(r);const o=s._reject.bind(s),u=Mt.transless||Mt;dn((()=>{Mt.trans=s,Mt.transless=u,n===0?(y(i).forEach((t=>{Be(e,t,i[t].primKey,i[t].indexes)})),Te(t,e),Vt.follow((()=>t.on.populate.fire(s))).catch(o)):function({_novip:t},n,e,r){const i=[],s=t._versions;let o=t._dbSchema=qe(t,t.idbdb,r),u=!1;const a=s.filter((t=>t._cfg.version>=n));function c(){return i.length?Vt.resolve(i.shift()(e.idbtrans)).then(c):Vt.resolve()}return a.forEach((s=>{i.push((()=>{const i=o,a=s._cfg.dbschema;Ne(t,i,r),Ne(t,a,r),o=t._dbSchema=a;const c=Ke(i,a);c.add.forEach((t=>{Be(r,t[0],t[1].primKey,t[1].indexes)})),c.change.forEach((t=>{if(t.recreate)throw new lt.Upgrade("Not yet support for changing primary key");{const n=r.objectStore(t.name);t.add.forEach((t=>_e(n,t))),t.change.forEach((t=>{n.deleteIndex(t.name),_e(n,t)})),t.del.forEach((t=>n.deleteIndex(t)))}}));const l=s._cfg.contentUpgrade;if(l&&s._cfg.version>n){Te(t,r),e._memoizedTables={},u=!0;let n=R(a);c.del.forEach((t=>{n[t]=i[t]})),Ie(t,[t.Transaction.prototype]),De(t,[t.Transaction.prototype],y(n),n),e.schema=n;const s=z(l);let o;s&&yn();const h=Vt.follow((()=>{if(o=l(e),o&&s){var t=pn.bind(null,null);o.then(t,t)}}));return o&&typeof o.then=="function"?Vt.resolve(o):h.then((()=>o))}})),i.push((n=>{(!u||!Bn)&&function(t,n){[].slice.call(n.db.objectStoreNames).forEach((e=>t[e]==null&&n.db.deleteObjectStore(e)))}(s._cfg.dbschema,n),Ie(t,[t.Transaction.prototype]),De(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),e.schema=t._dbSchema}))})),c().then((()=>{var t,n;n=r,y(t=o).forEach((e=>{n.db.objectStoreNames.contains(e)||Be(n,e,t[e].primKey,t[e].indexes)}))}))}(t,n,s,e).catch(o)}))}function Ke(t,n){const e={del:[],add:[],change:[]};let r;for(r in t)n[r]||e.del.push(r);for(r in n){const i=t[r],s=n[r];if(i){const t={name:r,def:s,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(s.primKey.keyPath||"")||i.primKey.auto!==s.primKey.auto&&!Kn)t.recreate=!0,e.change.push(t);else{const n=i.idxByName,r=s.idxByName;let o;for(o in n)r[o]||t.del.push(o);for(o in r){const e=n[o],i=r[o];e?e.src!==i.src&&t.change.push(i):t.add.push(i)}(t.del.length>0||t.add.length>0||t.change.length>0)&&e.change.push(t)}}else e.add.push([r,s])}return e}function Be(t,n,e,r){const i=t.db.createObjectStore(n,e.keyPath?{keyPath:e.keyPath,autoIncrement:e.auto}:{autoIncrement:e.auto});return r.forEach((t=>_e(i,t))),i}function _e(t,n){t.createIndex(n.name,n.keyPath,{unique:n.unique,multiEntry:n.multi})}function qe(t,n,e){const r={};return E(n.objectStoreNames,0).forEach((t=>{const n=e.objectStore(t);let i=n.keyPath;const s=ke($e(i),i||"",!1,!1,!!n.autoIncrement,i&&typeof i!="string",!0),o=[];for(let t=0;t<n.indexNames.length;++t){const e=n.index(n.indexNames[t]);i=e.keyPath;var u=ke(e.name,i,!!e.unique,!!e.multiEntry,!1,i&&typeof i!="string",!1);o.push(u)}r[t]=Ae(t,s,o)})),r}function Ne({_novip:t},n,e){const r=e.db.objectStoreNames;for(let i=0;i<r.length;++i){const s=r[i],o=e.objectStore(s);t._hasGetAll="getAll"in o;for(let t=0;t<o.indexNames.length;++t){const e=o.indexNames[t],r=o.index(e).keyPath,i=typeof r=="string"?r:"["+E(r).join("+")+"]";if(n[s]){const t=n[s].idxByName[i];t&&(t.name=e,delete n[s].idxByName[i],n[s].idxByName[e]=t)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&d.WorkerGlobalScope&&d instanceof d.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(t._hasGetAll=!1)}class Me{_parseStoresSpec(t,n){y(t).forEach((e=>{if(t[e]!==null){var r=t[e].split(",").map(((t,n)=>{const e=(t=t.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(e)?e.match(/^\[(.*)\]$/)[1].split("+"):e;return ke(e,r||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),p(r),n===0)})),i=r.shift();if(i.multi)throw new lt.Schema("Primary key cannot be multi-valued");r.forEach((t=>{if(t.auto)throw new lt.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new lt.Schema("Index must have a name and cannot be an empty string")})),n[e]=Ae(e,i,r)}}))}stores(t){const n=this.db;this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,t):t;const e=n._versions,r={};let i={};return e.forEach((t=>{v(r,t._cfg.storesSource),i=t._cfg.dbschema={},t._parseStoresSpec(r,i)})),n._dbSchema=i,Ie(n,[n._allTables,n,n.Transaction.prototype]),De(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],y(i),i),n._storeNames=y(i),this}upgrade(t){return this._cfg.contentUpgrade=kt(this._cfg.contentUpgrade||dt,t),this}}function Fe(t,n){let e=t._dbNamesDB;return e||(e=t._dbNamesDB=new lr(Nn,{addons:[],indexedDB:t,IDBKeyRange:n}),e.version(1).stores({dbnames:"name"})),e.table("dbnames")}function Ue(t){return t&&typeof t.databases=="function"}function Le(t){return dn((function(){return Mt.letThrough=!0,t()}))}function Ve(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(n){var e=function(){return indexedDB.databases().finally(n)};t=setInterval(e,100),e()})).finally((function(){return clearInterval(t)})):Promise.resolve()}function He(t){const n=t._state,{indexedDB:e}=t._deps;if(n.isBeingOpened||t.idbdb)return n.dbReadyPromise.then((()=>n.dbOpenError?En(n.dbOpenError):t));J&&(n.openCanceller._stackHolder=Z()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;const r=n.openCanceller;function i(){if(n.openCanceller!==r)throw new lt.DatabaseClosed("db.open() was cancelled")}let s=n.dbReadyResolve,o=null,u=!1;return Vt.race([r,(typeof navigator>"u"?Vt.resolve():Ve()).then((()=>new Vt(((r,s)=>{if(i(),!e)throw new lt.MissingAPI;const a=t.name,c=n.autoSchema?e.open(a):e.open(a,Math.round(10*t.verno));if(!c)throw new lt.MissingAPI;c.onerror=pe(s),c.onblocked=on(t._fireOnBlocked),c.onupgradeneeded=on((r=>{if(o=c.transaction,n.autoSchema&&!t._options.allowEmptyDB){c.onerror=ve,o.abort(),c.result.close();const t=e.deleteDatabase(a);t.onsuccess=t.onerror=on((()=>{s(new lt.NoSuchDatabase(`Database ${a} doesnt exist`))}))}else{o.onerror=pe(s);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=i<1,t._novip.idbdb=c.result,Re(t,i/10,o,s)}}),s),c.onsuccess=on((()=>{o=null;const e=t._novip.idbdb=c.result,i=E(e.objectStoreNames);if(i.length>0)try{const r=e.transaction((s=i).length===1?s[0]:s,"readonly");n.autoSchema?function({_novip:t},n,e){t.verno=n.version/10;const r=t._dbSchema=qe(0,n,e);t._storeNames=E(n.objectStoreNames,0),De(t,[t._allTables],y(r),r)}(t,e,r):(Ne(t,t._dbSchema,r),function(t,n){const e=Ke(qe(0,t.idbdb,n),t._dbSchema);return!(e.add.length||e.change.some((t=>t.add.length||t.change.length)))}(t,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Te(t,r)}catch{}var s;Rn.push(t),e.onversionchange=on((e=>{n.vcFired=!0,t.on("versionchange").fire(e)})),e.onclose=on((n=>{t.on("close").fire(n)})),u&&function({indexedDB:t,IDBKeyRange:n},e){!Ue(t)&&e!==Nn&&Fe(t,n).put({name:e}).catch(dt)}(t._deps,a),r()}),s)}))))]).then((()=>(i(),n.onReadyBeingFired=[],Vt.resolve(Le((()=>t.on.ready.fire(t.vip)))).then((function e(){if(n.onReadyBeingFired.length>0){let r=n.onReadyBeingFired.reduce(kt,dt);return n.onReadyBeingFired=[],Vt.resolve(Le((()=>r(t.vip)))).then(e)}}))))).finally((()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1})).then((()=>t)).catch((e=>{n.dbOpenError=e;try{o&&o.abort()}catch{}return r===n.openCanceller&&t._close(),En(e)})).finally((()=>{n.openComplete=!0,s()}))}function We(t){var n=n=>t.next(n),e=i(n),r=i((n=>t.throw(n)));function i(t){return n=>{var i=t(n),s=i.value;return i.done?s:s&&typeof s.then=="function"?s.then(e,r):p(s)?Promise.all(s).then(e,r):e(s)}}return i(n)()}function Ge(t,n,e){var r=arguments.length;if(r<2)throw new lt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return e=i.pop(),[t,B(i),e]}function ze(t,n,e,r,i){return Vt.resolve().then((()=>{const s=Mt.transless||Mt,o=t._createTransaction(n,e,t._dbSchema,r),u={trans:o,transless:s};if(r)o.idbtrans=r.idbtrans;else try{o.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===at.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((()=>ze(t,n,e,null,i)))):En(r)}const a=z(i);let c;a&&yn();const l=Vt.follow((()=>{if(c=i.call(o,o),c)if(a){var t=pn.bind(null,null);c.then(t,t)}else typeof c.next=="function"&&typeof c.throw=="function"&&(c=We(c))}),u);return(c&&typeof c.then=="function"?Vt.resolve(c).then((t=>o.active?t:En(new lt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((t=>(r&&o._resolve(),o._completion.then((()=>t))))).catch((t=>(o._reject(t),En(t))))}))}function Je(t,n,e){const r=p(t)?t.slice():[t];for(let t=0;t<e;++t)r.push(n);return r}const Ye={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return{...t,table(n){const e=t.table(n),{schema:r}=e,i={},s=[];function o(t,n,e){const r=Ce(t),u=i[r]=i[r]||[],a=t==null?0:typeof t=="string"?1:t.length,c=n>0,l={...e,isVirtual:c,keyTail:n,keyLength:a,extractKey:xe(t),unique:!c&&e.unique};return u.push(l),l.isPrimaryKey||s.push(l),a>1&&o(a===2?t[0]:t.slice(0,a-1),n+1,e),u.sort(((t,n)=>t.keyTail-n.keyTail)),l}const u=o(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[u];for(const t of r.indexes)o(t.keyPath,0,t);function a(n){const e=n.query.index;return e.isVirtual?{...n,query:{index:e,range:(r=n.query.range,i=e.keyTail,{type:r.type===1?2:r.type,lower:Je(r.lower,r.lowerOpen?t.MAX_KEY:t.MIN_KEY,i),lowerOpen:!0,upper:Je(r.upper,r.upperOpen?t.MIN_KEY:t.MAX_KEY,i),upperOpen:!0})}}:n;var r,i}return{...e,schema:{...r,primaryKey:u,indexes:s,getIndexByKeyPath:function(t){const n=i[Ce(t)];return n&&n[0]}},count:t=>e.count(a(t)),query:t=>e.query(a(t)),openCursor(n){const{keyTail:r,isVirtual:i,keyLength:s}=n.query.index;return i?e.openCursor(a(n)).then((e=>e&&function(e){return Object.create(e,{continue:{value:function(i){i!=null?e.continue(Je(i,n.reverse?t.MAX_KEY:t.MIN_KEY,r)):n.unique?e.continue(e.key.slice(0,s).concat(n.reverse?t.MIN_KEY:t.MAX_KEY,r)):e.continue()}},continuePrimaryKey:{value(n,i){e.continuePrimaryKey(Je(n,t.MAX_KEY,r),i)}},primaryKey:{get:()=>e.primaryKey},key:{get(){const t=e.key;return s===1?t[0]:t.slice(0,s)}},value:{get:()=>e.value}})}(e))):e.openCursor(n)}}}}}};function Qe(t,n,e,r){return e=e||{},r=r||"",y(t).forEach((i=>{if(m(n,i)){var s=t[i],o=n[i];if(typeof s=="object"&&typeof o=="object"&&s&&o){const t=L(s);t!==L(o)?e[r+i]=n[i]:t==="Object"?Qe(s,o,e,r+i+"."):s!==o&&(e[r+i]=n[i])}else s!==o&&(e[r+i]=n[i])}else e[r+i]=void 0})),y(n).forEach((i=>{m(t,i)||(e[r+i]=n[i])})),e}const Xe={stack:"dbcore",name:"HooksMiddleware",level:2,create:t=>({...t,table(n){const e=t.table(n),{primaryKey:r}=e.schema;return{...e,mutate(t){const i=Mt.trans,{deleting:s,creating:o,updating:u}=i.table(n).hook;switch(t.type){case"add":if(o.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"put":if(o.fire===dt&&u.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"delete":if(s.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"deleteRange":if(s.fire===dt)break;return i._promise("readwrite",(()=>function(t){return c(t.trans,t.range,1e4)}(t)),!0)}return e.mutate(t);function a(t){const n=Mt.trans,i=t.keys||function(t,n){return n.type==="delete"?n.keys:n.keys||n.values.map(t.extractKey)}(r,t);if(!i)throw new Error("Keys missing");return(t=t.type==="add"||t.type==="put"?{...t,keys:i}:{...t}).type!=="delete"&&(t.values=[...t.values]),t.keys&&(t.keys=[...t.keys]),function(t,n,e){return n.type==="add"?Promise.resolve([]):t.getMany({trans:n.trans,keys:e,cache:"immutable"})}(e,t,i).then((a=>{const c=i.map(((e,i)=>{const c=a[i],l={onerror:null,onsuccess:null};if(t.type==="delete")s.fire.call(l,e,c,n);else if(t.type==="add"||c===void 0){const s=o.fire.call(l,e,t.values[i],n);e==null&&s!=null&&(e=s,t.keys[i]=e,r.outbound||j(t.values[i],r.keyPath,e))}else{const r=Qe(c,t.values[i]),s=u.fire.call(l,r,e,c,n);if(s){const n=t.values[i];Object.keys(s).forEach((t=>{m(n,t)?n[t]=s[t]:j(n,t,s[t])}))}}return l}));return e.mutate(t).then((({failures:n,results:e,numFailures:r,lastResult:s})=>{for(let r=0;r<i.length;++r){const s=e?e[r]:i[r],o=c[r];s==null?o.onerror&&o.onerror(n[r]):o.onsuccess&&o.onsuccess(t.type==="put"&&a[r]?t.values[r]:s)}return{failures:n,results:e,numFailures:r,lastResult:s}})).catch((t=>(c.forEach((n=>n.onerror&&n.onerror(t))),Promise.reject(t))))}))}function c(t,n,i){return e.query({trans:t,values:!1,query:{index:r,range:n},limit:i}).then((({result:e})=>a({type:"delete",keys:e,trans:t}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):e.length<i?{failures:[],numFailures:0,lastResult:void 0}:c(t,{...n,lower:e[e.length-1],lowerOpen:!0},i)))))}}}}})};function Ze(t,n,e){try{if(!n||n.keys.length<t.length)return null;const r=[];for(let i=0,s=0;i<n.keys.length&&s<t.length;++i)ne(n.keys[i],t[s])===0&&(r.push(e?M(n.values[i]):n.values[i]),++s);return r.length===t.length?r:null}catch{return null}}const tr={stack:"dbcore",level:-1,create:t=>({table:n=>{const e=t.table(n);return{...e,getMany:t=>{if(!t.cache)return e.getMany(t);const n=Ze(t.keys,t.trans._cache,t.cache==="clone");return n?Vt.resolve(n):e.getMany(t).then((n=>(t.trans._cache={keys:t.keys,values:t.cache==="clone"?M(n):n},n)))},mutate:t=>(t.type!=="add"&&(t.trans._cache=null),e.mutate(t))}}})};function nr(t){return!("from"in t)}const er=function(t,n){if(!this){const n=new er;return t&&"d"in t&&v(n,t),n}v(this,arguments.length?{d:1,from:t,to:arguments.length>1?n:t}:{d:0})};function rr(t,n,e){const r=ne(n,e);if(isNaN(r))return;if(r>0)throw RangeError();if(nr(t))return v(t,{from:n,to:e,d:1});const i=t.l,s=t.r;if(ne(e,t.from)<0)return i?rr(i,n,e):t.l={from:n,to:e,d:1,l:null,r:null},ur(t);if(ne(n,t.to)>0)return s?rr(s,n,e):t.r={from:n,to:e,d:1,l:null,r:null},ur(t);ne(n,t.from)<0&&(t.from=n,t.l=null,t.d=s?s.d+1:1),ne(e,t.to)>0&&(t.to=e,t.r=null,t.d=t.l?t.l.d+1:1);const o=!t.r;i&&!t.l&&ir(t,i),s&&o&&ir(t,s)}function ir(t,n){nr(n)||function t(n,{from:e,to:r,l:i,r:s}){rr(n,e,r),i&&t(n,i),s&&t(n,s)}(t,n)}function sr(t,n){const e=or(n);let r=e.next();if(r.done)return!1;let i=r.value;const s=or(t);let o=s.next(i.from),u=o.value;for(;!r.done&&!o.done;){if(ne(u.from,i.to)<=0&&ne(u.to,i.from)>=0)return!0;ne(i.from,u.from)<0?i=(r=e.next(u.from)).value:u=(o=s.next(i.from)).value}return!1}function or(t){let n=nr(t)?null:{s:0,n:t};return{next(t){const e=arguments.length>0;for(;n;)switch(n.s){case 0:if(n.s=1,e)for(;n.n.l&&ne(t,n.n.from)<0;)n={up:n,n:n.n.l,s:1};else for(;n.n.l;)n={up:n,n:n.n.l,s:1};case 1:if(n.s=2,!e||ne(t,n.n.to)<=0)return{value:n.n,done:!1};case 2:if(n.n.r){n.s=3,n={up:n,n:n.n.r,s:0};continue}case 3:n=n.up}return{done:!0}}}}function ur(t){var n,e;const r=(((n=t.r)===null||n===void 0?void 0:n.d)||0)-(((e=t.l)===null||e===void 0?void 0:e.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const n=i==="r"?"l":"r",e={...t},r=t[i];t.from=r.from,t.to=r.to,t[i]=r[i],e[i]=r[n],t[n]=e,e.d=ar(e)}t.d=ar(t)}function ar({r:t,l:n}){return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}b(er.prototype,{add(t){return ir(this,t),this},addKey(t){return rr(this,t,t),this},addKeys(t){return t.forEach((t=>rr(this,t,t))),this},[V](){return or(this)}});const cr={stack:"dbcore",level:0,create:t=>{const n=t.schema.name,e=new er(t.MIN_KEY,t.MAX_KEY);return{...t,table:r=>{const i=t.table(r),{schema:s}=i,{primaryKey:o}=s,{extractKey:u,outbound:a}=o,c={...i,mutate:t=>{const o=t.trans,u=o.mutatedParts||(o.mutatedParts={}),a=t=>{const e=`idb://${n}/${r}/${t}`;return u[e]||(u[e]=new er)},c=a(""),l=a(":dels"),{type:h}=t;let[f,d]=t.type==="deleteRange"?[t.range]:t.type==="delete"?[t.keys]:t.values.length<50?[[],t.values]:[];const y=t.trans._cache;return i.mutate(t).then((t=>{if(p(f)){h!=="delete"&&(f=t.results),c.addKeys(f);const n=Ze(f,y);n||h==="add"||l.addKeys(f),(n||d)&&function(t,n,e,r){function i(n){const i=t(n.name||"");function s(t){return t!=null?n.extractKey(t):null}const o=t=>n.multiEntry&&p(t)?t.forEach((t=>i.addKey(t))):i.addKey(t);(e||r).forEach(((t,n)=>{const i=e&&s(e[n]),u=r&&s(r[n]);ne(i,u)!==0&&(i!=null&&o(i),u!=null&&o(u))}))}n.indexes.forEach(i)}(a,s,n,d)}else if(f){const t={from:f.lower,to:f.upper};l.add(t),c.add(t)}else c.add(e),l.add(e),s.indexes.forEach((t=>a(t.name).add(e)));return t}))}},l=({query:{index:n,range:e}})=>{var r,i;return[n,new er((r=e.lower)!==null&&r!==void 0?r:t.MIN_KEY,(i=e.upper)!==null&&i!==void 0?i:t.MAX_KEY)]},h={get:t=>[o,new er(t.key)],getMany:t=>[o,(new er).addKeys(t.keys)],count:l,query:l,openCursor:l};return y(h).forEach((t=>{c[t]=function(s){const{subscr:o}=Mt;if(o){const c=t=>{const e=`idb://${n}/${r}/${t}`;return o[e]||(o[e]=new er)},l=c(""),f=c(":dels"),[d,y]=h[t](s);if(c(d.name||"").add(y),!d.isPrimaryKey){if(t!=="count"){const n=t==="query"&&a&&s.values&&i.query({...s,values:!1});return i[t].apply(this,arguments).then((e=>{if(t==="query"){if(a&&s.values)return n.then((({result:t})=>(l.addKeys(t),e)));const t=s.values?e.result.map(u):e.result;s.values?l.addKeys(t):f.addKeys(t)}else if(t==="openCursor"){const t=e,n=s.values;return t&&Object.create(t,{key:{get:()=>(f.addKey(t.primaryKey),t.key)},primaryKey:{get(){const n=t.primaryKey;return f.addKey(n),n}},value:{get:()=>(n&&l.addKey(t.primaryKey),t.value)}})}return e}))}f.add(e)}}return i[t].apply(this,arguments)}})),c}}}};class lr{constructor(t,n){this._middlewares={},this.verno=0;const e=lr.dependencies;this._options=n={addons:lr.addons,autoOpen:!0,indexedDB:e.indexedDB,IDBKeyRange:e.IDBKeyRange,...n},this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:r}=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:dt,dbReadyPromise:null,cancelOpen:dt,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var s;i.dbReadyPromise=new Vt((t=>{i.dbReadyResolve=t})),i.openCanceller=new Vt(((t,n)=>{i.cancelOpen=n})),this._state=i,this.name=t,this.on=Wn(this,"populate","blocked","versionchange","close",{ready:[kt,dt]}),this.on.ready.subscribe=C(this.on.ready.subscribe,(t=>(n,e)=>{lr.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||Vt.resolve().then(n),e&&t(n);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(n),e&&t(n);else{t(n);const r=this;e||t((function t(){r.on.ready.unsubscribe(n),r.on.ready.unsubscribe(t)}))}}))})),this.Collection=(s=this,Gn(ie.prototype,(function(t,n){this.db=s;let e=Ln,r=null;if(n)try{e=n()}catch(t){r=t}const i=t._ctx,o=i.table,u=o.hook.reading.fire;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.index===o.schema.primKey.name,range:e,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:u!==yt?u:null}}))),this.Table=function(t){return Gn(Hn.prototype,(function(n,e,r){this.db=t,this._tx=r,this.name=n,this.schema=e,this.hook=t._allTables[n]?t._allTables[n].hook:Wn(null,{creating:[wt,dt],reading:[pt,yt],updating:[mt,dt],deleting:[gt,dt]})}))}(this),this.Transaction=function(t){return Gn(be.prototype,(function(n,e,r,i,s){this.db=t,this.mode=n,this.storeNames=e,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=Wn(this,"complete","error","abort"),this.parent=s||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 Vt(((t,n)=>{this._resolve=t,this._reject=n})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(t=>{var n=this.active;return this.active=!1,this.on.error.fire(t),this.parent?this.parent._reject(t):n&&this.idbtrans&&this.idbtrans.abort(),En(t)}))}))}(this),this.Version=function(t){return Gn(Me.prototype,(function(n){this.db=t,this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return Gn(ye.prototype,(function(n,e,r){this.db=t,this._ctx={table:n,index:e===":id"?null:e,or:r};const i=t._deps.indexedDB;if(!i)throw new lt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(t,n)=>i.cmp(n,t),this._max=(t,n)=>i.cmp(t,n)>0?t:n,this._min=(t,n)=>i.cmp(t,n)<0?t:n,this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(t=>{t.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",(t=>{!t.newVersion||t.newVersion<t.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${t.oldVersion/10}`)})),this._maxKey=Se(n.IDBKeyRange),this._createTransaction=(t,n,e,r)=>new this.Transaction(t,n,e,this._options.chromeTransactionDurability,r),this._fireOnBlocked=t=>{this.on("blocked").fire(t),Rn.filter((t=>t.name===this.name&&t!==this&&!t._state.vcFired)).map((n=>n.on("versionchange").fire(t)))},this.use(Ye),this.use(Xe),this.use(cr),this.use(tr),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((t=>t(this)))}version(t){if(isNaN(t)||t<.1)throw new lt.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new lt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);const n=this._versions;var e=n.filter((n=>n._cfg.version===t))[0];return e||(e=new this.Version(t),n.push(e),n.sort(je),e.stores({}),this._state.autoSchema=!1,e)}_whenReady(t){return this.idbdb&&(this._state.openComplete||Mt.letThrough||this._vip)?t():new Vt(((t,n)=>{if(this._state.openComplete)return n(new lt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void n(new lt.DatabaseClosed);this.open().catch(dt)}this._state.dbReadyPromise.then(t,n)})).then(t)}use({stack:t,create:n,level:e,name:r}){r&&this.unuse({stack:t,name:r});const i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:e??10,name:r}),i.sort(((t,n)=>t.level-n.level)),this}unuse({stack:t,name:n,create:e}){return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((t=>e?t.create!==e:!!n&&t.name!==n))),this}open(){return He(this)}_close(){const t=this._state,n=Rn.indexOf(this);if(n>=0&&Rn.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}t.dbReadyPromise=new Vt((n=>{t.dbReadyResolve=n})),t.openCanceller=new Vt(((n,e)=>{t.cancelOpen=e}))}close(){this._close();const t=this._state;this._options.autoOpen=!1,t.dbOpenError=new lt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}delete(){const t=arguments.length>0,n=this._state;return new Vt(((e,r)=>{const i=()=>{this.close();var t=this._deps.indexedDB.deleteDatabase(this.name);t.onsuccess=on((()=>{(function({indexedDB:t,IDBKeyRange:n},e){!Ue(t)&&e!==Nn&&Fe(t,n).delete(e).catch(dt)})(this._deps,this.name),e()})),t.onerror=pe(r),t.onblocked=this._fireOnBlocked};if(t)throw new lt.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 t=this._state.dbOpenError;return t&&t.name==="DatabaseClosed"}hasFailed(){return this._state.dbOpenError!==null}dynamicallyOpened(){return this._state.autoSchema}get tables(){return y(this._allTables).map((t=>this._allTables[t]))}transaction(){const t=Ge.apply(this,arguments);return this._transaction.apply(this,t)}_transaction(t,n,e){let r=Mt.trans;r&&r.db===this&&t.indexOf("!")===-1||(r=null);const i=t.indexOf("?")!==-1;let s,o;t=t.replace("!","").replace("?","");try{if(o=n.map((t=>{var n=t instanceof this.Table?t.name:t;if(typeof n!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return n})),t=="r"||t===Mn)s=Mn;else{if(t!="rw"&&t!=Fn)throw new lt.InvalidArgument("Invalid transaction mode: "+t);s=Fn}if(r){if(r.mode===Mn&&s===Fn){if(!i)throw new lt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&o.forEach((t=>{if(r&&r.storeNames.indexOf(t)===-1){if(!i)throw new lt.SubTransaction("Table "+t+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(t){return r?r._promise(null,((n,e)=>{e(t)})):En(t)}const u=ze.bind(null,this,s,o,r,e);return r?r._promise(s,u,"lock"):Mt.trans?kn(Mt.transless,(()=>this._whenReady(u))):this._whenReady(u)}table(t){if(!m(this._allTables,t))throw new lt.InvalidTable(`Table ${t} does not exist`);return this._allTables[t]}}const hr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class fr{constructor(t){this._subscribe=t}subscribe(t,n,e){return this._subscribe(t&&typeof t!="function"?t:{next:t,error:n,complete:e})}[hr](){return this}}function dr(t,n){return y(n).forEach((e=>{ir(t[e]||(t[e]=new er),n[e])})),t}function yr(t){let n,e=!1;const r=new fr((r=>{const i=z(t);let s=!1,o={},u={};const a={get closed(){return s},unsubscribe:()=>{s=!0,me.storagemutated.unsubscribe(f)}};r.start&&r.start(a);let c=!1,l=!1;function h(){return y(u).some((t=>o[t]&&sr(o[t],u[t])))}const f=t=>{dr(o,t),h()&&d()},d=()=>{if(c||s)return;o={};const y={},p=function(n){i&&yn();const e=()=>dn(t,{subscr:n,trans:null}),r=Mt.trans?kn(Mt.transless,e):e();return i&&r.then(pn,pn),r}(y);l||(me(we,f),l=!0),c=!0,Promise.resolve(p).then((t=>{e=!0,n=t,c=!1,s||(h()?d():(o={},u=y,r.next&&r.next(t)))}),(t=>{c=!1,e=!1,r.error&&r.error(t),a.unsubscribe()}))};return d(),a}));return r.hasValue=()=>e,r.getValue=()=>n,r}let pr;try{pr={indexedDB:d.indexedDB||d.mozIndexedDB||d.webkitIndexedDB||d.msIndexedDB,IDBKeyRange:d.IDBKeyRange||d.webkitIDBKeyRange}}catch{pr={indexedDB:null,IDBKeyRange:null}}const vr=lr;function wr(t){let n=gr;try{gr=!0,me.storagemutated.fire(t)}finally{gr=n}}b(vr,{...ft,delete:t=>new vr(t,{addons:[]}).delete(),exists:t=>new vr(t,{addons:[]}).open().then((t=>(t.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(t){try{return function({indexedDB:t,IDBKeyRange:n}){return Ue(t)?Promise.resolve(t.databases()).then((t=>t.map((t=>t.name)).filter((t=>t!==Nn)))):Fe(t,n).toCollection().primaryKeys()}(vr.dependencies).then(t)}catch{return En(new lt.MissingAPI)}},defineClass:()=>function(t){v(this,t)},ignoreTransaction:t=>Mt.trans?kn(Mt.transless,t):t(),vip:Le,async:function(t){return function(){try{var n=We(t.apply(this,arguments));return n&&typeof n.then=="function"?n:Vt.resolve(n)}catch(t){return En(t)}}},spawn:function(t,n,e){try{var r=We(t.apply(e,n||[]));return r&&typeof r.then=="function"?r:Vt.resolve(r)}catch(t){return En(t)}},currentTransaction:{get:()=>Mt.trans||null},waitFor:function(t,n){const e=Vt.resolve(typeof t=="function"?vr.ignoreTransaction(t):t).timeout(n||6e4);return Mt.trans?Mt.trans.waitFor(e):e},Promise:Vt,debug:{get:()=>J,set:t=>{Y(t,t==="dexie"?()=>!0:qn)}},derive:A,extend:v,props:b,override:C,Events:Wn,on:me,liveQuery:yr,extendObservabilitySet:dr,getByKeyPath:I,setByKeyPath:j,delByKeyPath:function(t,n){typeof n=="string"?j(t,n,void 0):"length"in n&&[].map.call(n,(function(n){j(t,n,void 0)}))},shallowClone:R,deepClone:M,getObjectDiff:Qe,cmp:ne,asap:T,minKey:Dn,addons:[],connections:Rn,errnames:at,dependencies:pr,semVer:On,version:On.split(".").map((t=>parseInt(t))).reduce(((t,n,e)=>t+n/Math.pow(10,2*e)))}),vr.maxKey=Se(vr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(me(we,(t=>{if(!gr){let n;Kn?(n=document.createEvent("CustomEvent"),n.initCustomEvent(ge,!0,!0,t)):n=new CustomEvent(ge,{detail:t}),gr=!0,dispatchEvent(n),gr=!1}})),addEventListener(ge,(({detail:t})=>{gr||wr(t)})));let gr=!1;if(typeof BroadcastChannel<"u"){const t=new BroadcastChannel(ge);typeof t.unref=="function"&&t.unref(),me(we,(n=>{gr||t.postMessage(n)})),t.onmessage=t=>{t.data&&wr(t.data)}}else if(typeof self<"u"&&typeof navigator<"u"){me(we,(t=>{try{gr||(typeof localStorage<"u"&&localStorage.setItem(ge,JSON.stringify({trig:Math.random(),changedParts:t})),typeof self.clients=="object"&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((n=>n.postMessage({type:ge,changedParts:t}))))}catch{}})),typeof addEventListener<"u"&&addEventListener("storage",(t=>{if(t.key===ge){const n=JSON.parse(t.newValue);n&&wr(n.changedParts)}}));const t=self.document&&navigator.serviceWorker;t&&t.addEventListener("message",(function({data:t}){t&&t.type===ge&&wr(t.changedParts)}))}Vt.rejectionMapper=function(t,n){if(!t||t instanceof it||t instanceof TypeError||t instanceof SyntaxError||!t.name||!ht[t.name])return t;var e=new ht[t.name](n||t.message,t);return"stack"in t&&$(e,"stack",{get:function(){return this.inner.stack}}),e},Y(J,qn);class mr extends lr{constructor(){super("NylasAuthDatabase");a(this,"grant");a(this,"pkce");this.version(1).stores({grant:"++id,token",pkce:"++id,codeVerifier"}),this.grant=this.table("grant"),this.pkce=this.table("pkce")}}class br{constructor(){a(this,"theDB");this.theDB=new mr}async setCodeVerifier(t){await this.theDB.pkce.put({id:1,codeVerifier:t},1)}async getCodeVerifier(){const[t]=await this.theDB.pkce.toArray();return t?t.codeVerifier:null}async getTokenInfo(){const t=await this.theDB.grant.get(1);return t?t.token:null}async setTokenInfo(t){await this.theDB.grant.put({id:1,token:t},1)}async reset(){await this.theDB.grant.clear()}}function kr(t){const n="NylasAuth";if(!t)throw new Error("NylasAuth requires a config object");let e=null;if(t.storageType==="indexeddb"&&(e=new br),!e)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"}],i=[{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 s(r,i,s,o=!0,u,a){const c=await(e==null?void 0:e.getTokenInfo()),l=new URL(r,u??t.apiUri),h=new Headers;h.append("Accept","application/json"),h.append("Content-Type","application/json"),h.append("User-Agent",n),c&&h.append("Authorization",`Bearer ${c.access_token}`);const f=await fetch(l.toString(),{method:i||"GET",headers:h,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0,...a||{}});return o?await f.json():f.body}return{config:t,async getHostedAuthRedirectURL(n=t.defaultScopes,r,i){const s=await f(Math.random().toString()),o=await f(s);await(e==null?void 0:e.setCodeVerifier(s));const u=new URL(`${t.apiUri}/v3/connect/auth`);return u.searchParams.set("client_id",t.clientId),u.searchParams.set("response_type","code"),u.searchParams.set("scope",n.join(" ")),u.searchParams.set("redirect_uri",t.redirectURI),u.searchParams.set("access_type","offline"),u.searchParams.set("code_challenge",o),u.searchParams.set("code_challenge_method","S256"),u.searchParams.set("options","rotate_refresh_token"),i&&u.searchParams.set("provider",i),r&&u.searchParams.set("login_hint",r),u.toString()},nylasAPIRequest:s,async exchangeAuthCodeForTokenInfo(n){if(!n)return null;const r=await(e==null?void 0:e.getCodeVerifier()),i=await this.nylasAPIRequest("/v3/connect/token","POST",{code:n,client_id:t.clientId,grant_type:"authorization_code",redirect_uri:t.redirectURI,code_verifier:r});return"error"in i||await(e==null?void 0:e.setTokenInfo(i)),i},async nylasDownloadFileRequest(r,i="GET",s){const o=await(e==null?void 0:e.getTokenInfo()),u=new URL(r,t.apiUri),a=new Headers;return a.append("Accept","application/json"),a.append("Content-Type","application/octet-stream"),a.append("User-Agent",n),o&&a.append("Authorization",`Bearer ${o.access_token}`),(await fetch(u.toString(),{method:i,headers:a,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0})).blob()},async logout(){const t=await(e==null?void 0:e.getTokenInfo());t&&await this.nylasAPIRequest(`/v3/connect/revoke?token=${t.access_token}`,"POST"),await(e==null?void 0:e.reset())},async isAuthenticated(){return!!await(e==null?void 0:e.getTokenInfo())},async getTokenInfo(){const t=await(e==null?void 0:e.getTokenInfo());if(!t)return null;const{access_token:n,...r}=t;return r},async isAccessTokenValid(){const t=await(e==null?void 0:e.getTokenInfo());return t?"data"in await this.nylasAPIRequest(`/v3/connect/tokeninfo?id_token=${t.id_token}`,"GET"):!1},async refreshAccessToken(){const n=await(e==null?void 0:e.getTokenInfo());if(!n)return null;const r=await this.nylasAPIRequest("/v3/connect/token","POST",{client_id:t.clientId,grant_type:"refresh_token",refresh_token:n.refresh_token});return"error"in r||await(e==null?void 0:e.setTokenInfo(r)),r},async hasScopeByType(t="email",n){const s=await(e==null?void 0:e.getTokenInfo());if(!s)return!1;const o=s.scope.toLowerCase().split(" ");let u=[];const a=Array.isArray(n)?n:[n];return t==="email"&&(u=[...i,...r].filter((t=>a.includes(t.type)))),u.every((t=>o.includes(t.value)))},async hasScope(t){const n=await(e==null?void 0:e.getTokenInfo());if(!n)return!1;const r=n.scope.toLowerCase().split(" ");return(Array.isArray(t)?t:[t]).some((t=>r.includes(t.toLowerCase())))}}}export{i as N,l as X,h as Z,kr as e,s as g,c as n};
|
|
2
|
+
//# sourceMappingURL=p-f0250b7d.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,e as t}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{a as e,e as t}from"./p-ad7cf473.js";import{a as n}from"./p-68c2fadf.js";function r(e,t,n="registerComponent"){return new CustomEvent(n,{bubbles:true,composed:true,detail:t})}function o(e,t,n="unregisterComponent"){return new CustomEvent(n,{bubbles:true,composed:true,detail:t})}function s(s){return(c,i)=>{const u=s.name;e(`[${u}] Registering component ${u} being called on ${i}`);const a=c.componentWillLoad;if(!a){t(`[${u}] componentWillLoad lifecycle method in ${u} missing. Required for RegisterComponent decorator.`);return}const l=c.connectedCallback;if(!l){t(`[${u}] connectedCallback lifecycle method in ${u} missing. Required for RegisterComponent decorator.`);return}const p=c.disconnectedCallback;if(!p){t(`[${u}] disconnectedCallback lifecycle method in ${u} missing. Required for RegisterComponent decorator.`);return}if(s.storeToProps&&s.stateToProps){const e=Array.from(s.storeToProps.values());const n=Array.from(s.stateToProps.values());const r=e.filter((e=>n.includes(e)));if(r.length>0){t(`[${u}] Overlapping prop keys detected in ${u} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${r.join(", ")}`);return}}const m=new Map;if(s.eventToProps){Object.keys(s.eventToProps).forEach((e=>{m.set(e,s.eventToProps?.[e])}))}c.connectedCallback=function(){e(`[~${u}] connectedCallback called`);const t=l?.call(this);const r=n(this);if(r.dataset.nylasId){return t}Object.defineProperty(r,"registerNylasComponent",{get(){return true},enumerable:true});Object.defineProperty(r,"stateToProps",{get(){return s.stateToProps},enumerable:true});Object.defineProperty(r,"getStoresToProp",{get(){return s.getStoresToProp},enumerable:true});Object.defineProperty(r,"storeToProps",{get(){return s.storeToProps},enumerable:true});Object.defineProperty(r,"eventToProps",{get(){return m},enumerable:true});Object.defineProperty(r,"authToProp",{get(){return s.authToProp},enumerable:true});Object.defineProperty(r,"connectorToProp",{get(){return s.connectorToProp},enumerable:true});Object.defineProperty(r,"localPropsToProp",{get(){return s.localPropsToProp},enumerable:true});return t};if(s.fireRegisterEvent){c.componentWillLoad=function(){const t=a?.call(this);const o=n(this);const i={element:o,...s,eventToProps:m};const l=r(c,i,s.registrationEventName);if(o.dispatchEvent(l)){e(`[${u}] Component ${u} successfully fired registration event`)}return t};c.disconnectedCallback=function(){const t=p?.call(this);const r=n(this);const i={element:r,...s,eventToProps:m};const a=o(c,i,s.unregistrationEventName);if(r.dispatchEvent(a)){e(`[${u}] Component ${u} successfully fired unregistration event`)}return t}}}}export{s as R};
|
|
2
|
+
//# sourceMappingURL=p-f0f3f350.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as a,h as t,H as i,a as n}from"./p-68c2fadf.js";import{R as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as a,h as t,H as i,a as n}from"./p-68c2fadf.js";import{R as e}from"./p-f0f3f350.js";import{a as s}from"./p-ad7cf473.js";import"./p-cb65c223.js";const r=':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{background:var(--nylas-base-50)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--nylas-base-300)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}';const l=r;var p=undefined&&undefined.__decorate||function(a,t,i,n){var e=arguments.length,s=e<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,i):n,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")s=Reflect.decorate(a,t,i,n);else for(var l=a.length-1;l>=0;l--)if(r=a[l])s=(e<3?r(s):e>3?r(t,i,s):r(t,i))||s;return e>3&&s&&Object.defineProperty(t,i,s),s};var d=undefined&&undefined.__metadata||function(a,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(a,t)};const o=class{constructor(t){a(this,t);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.name="participants";this.eventParticipants=undefined;this.participants=this.eventParticipants??[];this.participantsValid=true}elementNameChangedHandler(a){s("nylas-additional-participants","elementNameChangedHandler",a);this.host.setAttribute("name",a)}connectedCallback(){s("nylas-additional-participants","connectedCallback")}componentWillLoad(){s("nylas-additional-participants","componentWillLoad");this.host.setAttribute("name",this.name)}componentDidLoad(){s("nylas-additional-participants","componentDidLoad");this.internals.setFormValue(JSON.stringify(this.participants),"participants")}disconnectedCallback(){s("nylas-additional-participants","disconnectedCallback")}onParticipantChange(a,t){s("nylas-additional-participants","onParticipantChange");this.participants[t].email=a.target.value;this.internals.setFormValue(JSON.stringify(this.participants),"participants")}addParticipant(){s("nylas-additional-participants","addParticipant");this.participants=[...this.participants,{email:"",is_organizer:false,availability:{calendar_ids:["primary"]}}];this.internals.setFormValue(JSON.stringify(this.participants),"participants")}removeParticipant(a){s("nylas-additional-participants","addParticipant");this.participants=this.participants.filter((t=>t.email!==a));this.internals.setFormValue(JSON.stringify(this.participants),"participants")}validate(a,t){s("nylas-additional-participants","validate");const i=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;const n=i.test(String(a).toLowerCase());this.participants[t].is_valid=n;this.internals.setFormValue(JSON.stringify(this.participants),"participants")}render(){return t(i,{key:"2cee2dd98939f98fdfc950f609fce3f6045ced9f"},t("nylas-form-card",{key:"e587c19e99fa1b40c9d876123fd50cde51e8882c"},t("h3",{key:"6c4a90291f5918e98d62e03b599619ff4f345391",slot:"header-title",class:"nylas-additional-participants__title",part:"nap__title"},"Additional participants"),t("p",{key:"ad4fac5ca4cdb1430f889c723215d9a1538a266f",slot:"header-subtitle",class:"nylas-additional-participants__subtitle",part:"nap__subtitle"},"Add anyone else who would be joining for this event."),t("div",{key:"80b29a9b1275363dac86274be18cc52210e59de7",slot:"content",class:"nylas-additional-participants__content"},t("div",{key:"5adf8a7d2be8c780dbc5859b8b634efc114536c2"},this.participants.map(((a,i)=>t("div",{class:"nylas-additional-participants__input_group",part:"nap__input_group"},t("label",null,a.is_organizer?"Organizer":`Participant ${i}`),t("div",{part:"nap__input_wrapper",class:`nylas-additional-participants__input_wrapper ${a.is_organizer&&"nylas-additional-participants__input_wrapper_organizer"} ${a.is_valid===false&&"nylas-additional-participants__input_wrapper_invalid"}`},t("div",{class:"nylas-additional-participants__input",part:"nap__input"},t("input",{type:"text",value:a.email,onInput:a=>{this.onParticipantChange(a,i)},readOnly:a.is_organizer,onBlur:()=>this.validate(a.email,i)})),!a.is_organizer&&t("button",{onClick:()=>this.removeParticipant(a.email),part:"nap__remove-participant"},t("close-icon",null))))))))))}static get formAssociated(){return true}get host(){return n(this)}static get watchers(){return{name:["elementNameChangedHandler"]}}};p([e({name:"nylas-additional-participants",eventToProps:{},fireRegisterEvent:true}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],o.prototype,"render",null);o.style=l;export{o as nylas_additional_participants};
|
|
2
|
+
//# sourceMappingURL=p-f3974e14.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as a,H as r}from"./p-68c2fadf.js";import{R as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as a,H as r}from"./p-68c2fadf.js";import{R as o}from"./p-f0f3f350.js";import{a as i,b as n,c as s}from"./p-ad7cf473.js";import"./p-cb65c223.js";const l=':host{display:block;font-size:var(--nylas-font-size, inherit);font-family:var(--nylas-font-family, inherit)}.list-thread{display:grid;grid-auto-flow:row;color:var(--nylas-color-primary-800);width:100%}.thread{position:relative;width:100%;display:grid;padding:0.5rem 1rem;column-gap:0.25rem;grid-template-areas:"........ from count ....... date actions" "checkbox subject subject subject subject actions" "........ snippet snippet snippet snippet actions";grid-template-columns:auto auto auto auto auto auto;margin-bottom:0.75rem;border-radius:var(--nylas-border-radius-2x);color:var(--nylas-color-primary-00);background-color:var(--nylas-color-primary-50);border:0;box-sizing:border-box;text-align:left;cursor:pointer;box-shadow:1px 1px 3px 0px rgba(0, 0, 0, 0.3);font-size:inherit;font-family:inherit}.thread.loading{animation:pulsate 1.5s infinite ease-in-out;width:100%;height:90px}.thread:last-of-type{margin-bottom:0}.thread.selected{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread:hover{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread>div{align-self:center;pointer-events:all !important}.thread .actions{grid-area:actions}.thread .actions sp-action-menu{pointer-events:initial !important}.thread .actions sp-action-button{pointer-events:initial !important}.thread .actions sp-menu-item{pointer-events:initial !important}.thread .checkbox{grid-area:checkbox;margin-right:0.5rem;pointer-events:initial !important}.thread .checkbox sp-checkbox{pointer-events:initial !important}.thread .star{grid-area:star;justify-self:end}.thread .from{grid-area:from;color:var(--nylas-color-primary-600)}.thread .count{grid-area:count;color:var(--nylas-color-primary-600)}.thread .subject{grid-area:subject;color:var(--nylas-color-primary-600)}.thread .snippet{grid-area:snippet;color:var(--nylas-color-primary-500)}.thread .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-500)}.thread.unread .from,.thread.unread .count,.thread.unread .subject,.thread.unread .date{font-weight:600;color:var(--nylas-color-primary-800)}.thread.unread .snippet{color:var(--nylas-color-primary-700)}.thread .from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (min-width: 768px){.thread{column-gap:1rem;grid-template-areas:"checkbox from count subject snippet date actions";grid-template-columns:auto minmax(auto, 200px) auto auto 1fr auto auto;margin-bottom:0.5rem;border:1px solid var(--nylas-color-primary-100)}.thread.no-checkbox{grid-template-areas:"from count subject snippet date actions";grid-template-columns:minmax(auto, 200px) auto auto 1fr auto auto}.thread .checkbox{margin-right:0}}@keyframes pulsate{0%{background-color:var(--nylas-color-primary-50)}50%{background-color:var(--nylas-color-primary-100)}100%{background-color:var(--nylas-color-primary-50)}}';const d=l;var c=undefined&&undefined.__decorate||function(e,t,a,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,a):r,n;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,a,r);else for(var s=e.length-1;s>=0;s--)if(n=e[s])i=(o<3?n(i):o>3?n(t,a,i):n(t,a))||i;return o>3&&i&&Object.defineProperty(t,a,i),i};var p=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const h=class{constructor(a){e(this,a);this.threadSelected=t(this,"threadSelected",7);this.handleThreadSelected=async e=>{i(`[nylas-list-threads] Thread selected`,{thread:e});const t=this.threadSelected.emit(e);if(!t.defaultPrevented){i(`[nylas-list-threads] Default event not prevented, selecting thread`)}};this.handleCheckboxClick=async e=>{i(`[nylas-list-threads] Checkbox clicked`,{event:e});e.stopPropagation()};this.threads=[];this.isAuthenticated=false;this.tokenInfo=undefined;this.state="ready";this.showCheckbox=false}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){i(`[nylas-list-threads] Component will load`)}async componentDidLoad(){i(`[nylas-list-threads] Component did load`,{isAuthenticated:this.isAuthenticated})}render(){return a(r,{key:"f943d924f47f9e1133bf87fcd32ee78e5b9bbf01"},a("div",{key:"2159737dbb20305da9f966959d9da7a1830b9b2b",class:"list-thread",part:"list-thread"},this.state==="loading"&&new Array(10).fill(0).map(((e,t)=>a("div",{class:"thread loading",style:{animationDelay:`${t*20}ms`}}))),this.state==="ready"&&this.threads.map((e=>a("button",{key:e?.id,class:{thread:true,unread:e?.unread===true,"no-checkbox":this.showCheckbox===false},part:"thread","aria-label":`Thread with subject ${e?.subject}`,onClick:()=>this.handleThreadSelected(e)},this.showCheckbox&&a("div",{class:"checkbox",part:"checkbox"},a("sp-checkbox",{size:"s",value:e?.id,onClick:this.handleCheckboxClick})),a("div",{class:"from",part:"from"},n(e.participants??[],this.tokenInfo?.email,e?.message_ids?.length||1,1)),a("div",{class:"subject",part:"subject"},e?.subject),a("div",{class:"count",part:"count"},e?.message_ids?.length||1),a("div",{class:"snippet",part:"snippet"},e?.snippet?.trim()),e.latest_message_received_date&&a("div",{class:"date","aria-label":`${Intl.DateTimeFormat(undefined,{dateStyle:"full"}).format(new Date(e.latest_message_received_date*1e3))}`,part:"date"},s(e.latest_message_received_date)))))))}};c([o({name:"nylas-list-threads",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"],["auth.tokenInfo","tokenInfo"],["mailbox.threads","threads"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(e,t)=>{i(`[nylas-list-threads] Thread selected`,{event:e});await t.threads.selectThread(e.detail)}},fireRegisterEvent:true}),p("design:type",Function),p("design:paramtypes",[]),p("design:returntype",void 0)],h.prototype,"render",null);h.style=d;export{h as nylas_list_threads};
|
|
2
|
+
//# sourceMappingURL=p-f47163ac.entry.js.map
|