@powerhousedao/connect 4.1.0-dev.12 → 4.1.0-dev.120
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/.env → .env} +5 -7
- package/README.md +3 -4
- package/assets/icon.icns +0 -0
- package/assets/icon.ico +0 -0
- package/assets/icon.png +0 -0
- package/assets/icons/Atlas-Logomark.svg +24 -0
- package/assets/icons/BBP-logo-hover-dark.svg +14 -0
- package/assets/icons/BBP-logo-hover-light.svg +14 -0
- package/assets/icons/BBP-logo-main.svg +14 -0
- package/assets/icons/collapse.svg +7 -0
- package/assets/icons/connect-small.svg +3 -0
- package/assets/icons/connect.svg +16 -0
- package/assets/icons/cross.svg +4 -0
- package/assets/icons/dark.svg +5 -0
- package/assets/icons/draft.svg +3 -0
- package/assets/icons/file.svg +3 -0
- package/assets/icons/file2.svg +10 -0
- package/assets/icons/folder.svg +3 -0
- package/assets/icons/light.svg +20 -0
- package/assets/icons/logo.svg +11 -0
- package/assets/icons/plus-circle.svg +5 -0
- package/assets/icons/refresh.svg +4 -0
- package/assets/icons/renown.svg +27 -0
- package/assets/icons/settings.svg +6 -0
- package/assets/icons/template.svg +3 -0
- package/assets/info.plist +85 -0
- package/dist/assets/AddDriveModal-taMDAPrQ.js +1 -0
- package/dist/assets/ClearStorageModal-D25tK2Tm.js +1 -0
- package/dist/assets/CookiesPolicyModal-Ba5-1eFa.js +1 -0
- package/dist/assets/CreateDocumentModal-5yovTbYB.js +1 -0
- package/dist/assets/DebugSettingsModal-CAWbTT1p.js +1 -0
- package/dist/assets/DeleteDriveModal-pKVD1qOZ.js +1 -0
- package/dist/assets/DeleteItemModal-CHLRwYTU.js +1 -0
- package/dist/assets/DisclaimerModal-BS1Oo3E6.js +1 -0
- package/dist/assets/DriveSettingsModal-B3VKnJUX.js +1 -0
- package/dist/assets/ExportDocumentWithErrorsModal-CE0T15ar.js +1 -0
- package/dist/assets/SettingsModal-mIaby2OP.js +1 -0
- package/dist/assets/UpgradeDriveModal-BO8Z_H3T.js +1 -0
- package/dist/assets/_virtual_ph_external-packages-CM1tCR4L.js +1 -0
- package/dist/assets/config-CU-aFfVJ.js +1 -0
- package/dist/assets/design_system-eo6iPN5e.js +45 -0
- package/dist/assets/design_system_connect-DmksRnLk.js +45 -0
- package/dist/assets/design_system_ui-CL_VfWpj.js +1 -0
- package/dist/assets/document_drive-BEIKnuGM.js +305 -0
- package/dist/assets/document_engineering-BU6RThU0.js +1 -0
- package/dist/assets/document_model-DXcLJEjZ.js +230 -0
- package/dist/assets/document_model_editor-CUg9Icvc.js +23 -0
- package/dist/assets/drive_explorer-Ce2ufXFz.js +2 -0
- package/dist/assets/graphql-BS4Brs_E.js +75 -0
- package/dist/assets/graphql-editor-CHvNSr7t.js +73 -0
- package/dist/assets/graphql_request-9RNJ00DB.js +3 -0
- package/dist/assets/hmr-LMNkvzP7.js +1 -0
- package/dist/assets/hooks-DhZgS983.js +12 -0
- package/dist/assets/index-BoGd38C_.js +18 -0
- package/dist/assets/index-Br7E7qjt.css +1 -0
- package/dist/assets/json-editor-C3MIGF0C.js +1 -0
- package/dist/assets/react/jsx-runtime-DldvXD6N.js +1 -0
- package/dist/assets/react-DQSxOgtG.js +1 -0
- package/dist/assets/react-dom/client-BVPiT_FE.js +9 -0
- package/dist/assets/react-dom-D6zQJsh6.js +1 -0
- package/dist/assets/reactor_browser-DNPGNjYk.js +25 -0
- package/dist/assets/sentry_browser-B4YoBIIG.js +498 -0
- package/dist/assets/sentry_react-cODD7zWc.js +3 -0
- package/dist/assets/state-schemas-Bd5byQKj.js +2 -0
- package/dist/assets/tailwind_merge-Dr4f9Rms.js +1 -0
- package/dist/assets/zod-C6yxFxyo.js +1 -0
- package/dist/index.html +51 -84
- package/heroku/Dockerfile +98 -0
- package/heroku/Procfile +1 -0
- package/heroku/config/nginx.conf.template +77 -0
- package/heroku/heroku-entrypoint.sh +38 -0
- package/lib/cypress/e2e/navigation.cy.d.ts +2 -0
- package/lib/cypress/e2e/navigation.cy.d.ts.map +1 -0
- package/lib/cypress/e2e/navigation.cy.js +221 -0
- package/lib/cypress/e2e/navigation.cy.js.map +1 -0
- package/lib/cypress/e2e/utils/index.d.ts +15 -0
- package/lib/cypress/e2e/utils/index.d.ts.map +1 -0
- package/lib/cypress/e2e/utils/index.js +121 -0
- package/lib/cypress/e2e/utils/index.js.map +1 -0
- package/lib/cypress/support/commands.d.ts +2 -0
- package/lib/cypress/support/commands.d.ts.map +1 -0
- package/lib/cypress/support/commands.js +29 -0
- package/lib/cypress/support/commands.js.map +1 -0
- package/lib/cypress/support/e2e.d.ts +2 -0
- package/lib/cypress/support/e2e.d.ts.map +1 -0
- package/lib/cypress/support/e2e.js +19 -0
- package/lib/cypress/support/e2e.js.map +1 -0
- package/lib/cypress.config.d.ts +3 -0
- package/lib/cypress.config.d.ts.map +1 -0
- package/lib/cypress.config.js +15 -0
- package/lib/cypress.config.js.map +1 -0
- package/lib/package.copy.json +168 -0
- package/lib/scripts/render-skeleton.d.ts +2 -0
- package/lib/scripts/render-skeleton.d.ts.map +1 -0
- package/lib/scripts/render-skeleton.js +11 -0
- package/lib/scripts/render-skeleton.js.map +1 -0
- package/lib/src/components/analytics.d.ts +8 -0
- package/lib/src/components/analytics.d.ts.map +1 -0
- package/lib/src/components/analytics.js +30 -0
- package/lib/src/components/analytics.js.map +1 -0
- package/lib/src/components/app-loader.d.ts +7 -0
- package/lib/src/components/app-loader.d.ts.map +1 -0
- package/lib/src/components/app-loader.js +20 -0
- package/lib/src/components/app-loader.js.map +1 -0
- package/lib/src/components/app-skeleton.d.ts +3 -0
- package/lib/src/components/app-skeleton.d.ts.map +1 -0
- package/lib/src/components/app-skeleton.js +38 -0
- package/lib/src/components/app-skeleton.js.map +1 -0
- package/lib/src/components/app.d.ts +2 -0
- package/lib/src/components/app.d.ts.map +1 -0
- package/lib/src/components/app.js +18 -0
- package/lib/src/components/app.js.map +1 -0
- package/lib/src/components/button.d.ts +3 -0
- package/lib/src/components/button.d.ts.map +1 -0
- package/lib/src/components/button.js +7 -0
- package/lib/src/components/button.js.map +1 -0
- package/lib/src/components/cookie-banner.d.ts +2 -0
- package/lib/src/components/cookie-banner.d.ts.map +1 -0
- package/lib/src/components/cookie-banner.js +48 -0
- package/lib/src/components/cookie-banner.js.map +1 -0
- package/lib/src/components/document-editor-container.d.ts +2 -0
- package/lib/src/components/document-editor-container.d.ts.map +1 -0
- package/lib/src/components/document-editor-container.js +62 -0
- package/lib/src/components/document-editor-container.js.map +1 -0
- package/lib/src/components/dots-loader.d.ts +2 -0
- package/lib/src/components/dots-loader.d.ts.map +1 -0
- package/lib/src/components/dots-loader.js +15 -0
- package/lib/src/components/dots-loader.js.map +1 -0
- package/lib/src/components/drive-editor-container.d.ts +2 -0
- package/lib/src/components/drive-editor-container.d.ts.map +1 -0
- package/lib/src/components/drive-editor-container.js +25 -0
- package/lib/src/components/drive-editor-container.js.map +1 -0
- package/lib/src/components/drive-icon.d.ts +5 -0
- package/lib/src/components/drive-icon.d.ts.map +1 -0
- package/lib/src/components/drive-icon.js +15 -0
- package/lib/src/components/drive-icon.js.map +1 -0
- package/lib/src/components/editor-loader.d.ts +9 -0
- package/lib/src/components/editor-loader.d.ts.map +1 -0
- package/lib/src/components/editor-loader.js +19 -0
- package/lib/src/components/editor-loader.js.map +1 -0
- package/lib/src/components/editors.d.ts +10 -0
- package/lib/src/components/editors.d.ts.map +1 -0
- package/lib/src/components/editors.js +93 -0
- package/lib/src/components/editors.js.map +1 -0
- package/lib/src/components/footer.d.ts +2 -0
- package/lib/src/components/footer.d.ts.map +1 -0
- package/lib/src/components/footer.js +16 -0
- package/lib/src/components/footer.js.map +1 -0
- package/lib/src/components/index.d.ts +22 -0
- package/lib/src/components/index.d.ts.map +1 -0
- package/lib/src/components/index.js +22 -0
- package/lib/src/components/index.js.map +1 -0
- package/lib/src/components/login.d.ts +2 -0
- package/lib/src/components/login.d.ts.map +1 -0
- package/lib/src/components/login.js +12 -0
- package/lib/src/components/login.js.map +1 -0
- package/lib/src/components/modal/index.d.ts +19 -0
- package/lib/src/components/modal/index.d.ts.map +1 -0
- package/lib/src/components/modal/index.js +19 -0
- package/lib/src/components/modal/index.js.map +1 -0
- package/lib/src/components/modal/modals/AddDriveModal.d.ts +2 -0
- package/lib/src/components/modal/modals/AddDriveModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/AddDriveModal.js +113 -0
- package/lib/src/components/modal/modals/AddDriveModal.js.map +1 -0
- package/lib/src/components/modal/modals/ClearStorageModal.d.ts +2 -0
- package/lib/src/components/modal/modals/ClearStorageModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/ClearStorageModal.js +35 -0
- package/lib/src/components/modal/modals/ClearStorageModal.js.map +1 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.d.ts +2 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.js +16 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.js.map +1 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.d.ts +2 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.js +24 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.js.map +1 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.d.ts +2 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.js +108 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.js.map +1 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.d.ts +2 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.js +32 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.js.map +1 -0
- package/lib/src/components/modal/modals/DeleteItemModal.d.ts +3 -0
- package/lib/src/components/modal/modals/DeleteItemModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DeleteItemModal.js +33 -0
- package/lib/src/components/modal/modals/DeleteItemModal.js.map +1 -0
- package/lib/src/components/modal/modals/DisclaimerModal.d.ts +3 -0
- package/lib/src/components/modal/modals/DisclaimerModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DisclaimerModal.js +12 -0
- package/lib/src/components/modal/modals/DisclaimerModal.js.map +1 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.d.ts +2 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.js +28 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.js.map +1 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.d.ts +2 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.js +30 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.js.map +1 -0
- package/lib/src/components/modal/modals/SettingsModal.d.ts +3 -0
- package/lib/src/components/modal/modals/SettingsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/SettingsModal.js +45 -0
- package/lib/src/components/modal/modals/SettingsModal.js.map +1 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.d.ts +3 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.js +21 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.js.map +1 -0
- package/lib/src/components/modal/modals/settings/about.d.ts +2 -0
- package/lib/src/components/modal/modals/settings/about.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/about.js +10 -0
- package/lib/src/components/modal/modals/settings/about.js.map +1 -0
- package/lib/src/components/modal/modals/settings/danger-zone.d.ts +2 -0
- package/lib/src/components/modal/modals/settings/danger-zone.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/danger-zone.js +15 -0
- package/lib/src/components/modal/modals/settings/danger-zone.js.map +1 -0
- package/lib/src/components/modal/modals/settings/default-editor.d.ts +2 -0
- package/lib/src/components/modal/modals/settings/default-editor.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/default-editor.js +18 -0
- package/lib/src/components/modal/modals/settings/default-editor.js.map +1 -0
- package/lib/src/components/modal/modals/settings/package-manager.d.ts +3 -0
- package/lib/src/components/modal/modals/settings/package-manager.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/package-manager.js +87 -0
- package/lib/src/components/modal/modals/settings/package-manager.js.map +1 -0
- package/lib/src/components/modal/modals-container.d.ts +2 -0
- package/lib/src/components/modal/modals-container.d.ts.map +1 -0
- package/lib/src/components/modal/modals-container.js +62 -0
- package/lib/src/components/modal/modals-container.js.map +1 -0
- package/lib/src/components/modal/modals-error-boundary.d.ts +18 -0
- package/lib/src/components/modal/modals-error-boundary.d.ts.map +1 -0
- package/lib/src/components/modal/modals-error-boundary.js +22 -0
- package/lib/src/components/modal/modals-error-boundary.js.map +1 -0
- package/lib/src/components/ph-logo.d.ts +2 -0
- package/lib/src/components/ph-logo.d.ts.map +1 -0
- package/lib/src/components/ph-logo.js +7 -0
- package/lib/src/components/ph-logo.js.map +1 -0
- package/lib/src/components/reload-connect-toast.d.ts +2 -0
- package/lib/src/components/reload-connect-toast.d.ts.map +1 -0
- package/lib/src/components/reload-connect-toast.js +7 -0
- package/lib/src/components/reload-connect-toast.js.map +1 -0
- package/lib/src/components/root.d.ts +2 -0
- package/lib/src/components/root.d.ts.map +1 -0
- package/lib/src/components/root.js +8 -0
- package/lib/src/components/root.js.map +1 -0
- package/lib/src/components/router.d.ts +2 -0
- package/lib/src/components/router.d.ts.map +1 -0
- package/lib/src/components/router.js +41 -0
- package/lib/src/components/router.js.map +1 -0
- package/lib/src/components/search-bar.d.ts +2 -0
- package/lib/src/components/search-bar.d.ts.map +1 -0
- package/lib/src/components/search-bar.js +36 -0
- package/lib/src/components/search-bar.js.map +1 -0
- package/lib/src/components/sidebar.d.ts +2 -0
- package/lib/src/components/sidebar.d.ts.map +1 -0
- package/lib/src/components/sidebar.js +27 -0
- package/lib/src/components/sidebar.js.map +1 -0
- package/lib/src/connect.config.d.ts +113 -0
- package/lib/src/connect.config.d.ts.map +1 -0
- package/lib/src/connect.config.js +147 -0
- package/lib/src/connect.config.js.map +1 -0
- package/lib/src/context/index.d.ts +4 -0
- package/lib/src/context/index.d.ts.map +1 -0
- package/lib/src/context/index.js +4 -0
- package/lib/src/context/index.js.map +1 -0
- package/lib/src/context/processor-manager.d.ts +3 -0
- package/lib/src/context/processor-manager.d.ts.map +1 -0
- package/lib/src/context/processor-manager.js +189 -0
- package/lib/src/context/processor-manager.js.map +1 -0
- package/lib/src/context/read-mode.d.ts +2 -0
- package/lib/src/context/read-mode.d.ts.map +1 -0
- package/lib/src/context/read-mode.js +219 -0
- package/lib/src/context/read-mode.js.map +1 -0
- package/lib/src/context/sentry-provider.d.ts +6 -0
- package/lib/src/context/sentry-provider.d.ts.map +1 -0
- package/lib/src/context/sentry-provider.js +6 -0
- package/lib/src/context/sentry-provider.js.map +1 -0
- package/lib/src/feature-flags.d.ts +34 -0
- package/lib/src/feature-flags.d.ts.map +1 -0
- package/lib/src/feature-flags.js +124 -0
- package/lib/src/feature-flags.js.map +1 -0
- package/lib/src/globals.d.ts +9 -0
- package/lib/src/globals.d.ts.map +1 -0
- package/lib/src/globals.js +2 -0
- package/lib/src/globals.js.map +1 -0
- package/lib/src/hmr.d.ts +3 -0
- package/lib/src/hmr.d.ts.map +1 -0
- package/lib/src/hmr.js +2 -0
- package/lib/src/hmr.js.map +1 -0
- package/lib/src/hooks/index.d.ts +10 -0
- package/lib/src/hooks/index.d.ts.map +1 -0
- package/lib/src/hooks/index.js +10 -0
- package/lib/src/hooks/index.js.map +1 -0
- package/lib/src/hooks/useAcceptedCookies.d.ts +9 -0
- package/lib/src/hooks/useAcceptedCookies.d.ts.map +1 -0
- package/lib/src/hooks/useAcceptedCookies.js +34 -0
- package/lib/src/hooks/useAcceptedCookies.js.map +1 -0
- package/lib/src/hooks/useCheckLatestVersion.d.ts +2 -0
- package/lib/src/hooks/useCheckLatestVersion.d.ts.map +1 -0
- package/lib/src/hooks/useCheckLatestVersion.js +33 -0
- package/lib/src/hooks/useCheckLatestVersion.js.map +1 -0
- package/lib/src/hooks/useClientErrorHandler.d.ts +6 -0
- package/lib/src/hooks/useClientErrorHandler.d.ts.map +1 -0
- package/lib/src/hooks/useClientErrorHandler.js +120 -0
- package/lib/src/hooks/useClientErrorHandler.js.map +1 -0
- package/lib/src/hooks/useCookieBanner.d.ts +5 -0
- package/lib/src/hooks/useCookieBanner.d.ts.map +1 -0
- package/lib/src/hooks/useCookieBanner.js +32 -0
- package/lib/src/hooks/useCookieBanner.js.map +1 -0
- package/lib/src/hooks/useInitSentry.d.ts +2 -0
- package/lib/src/hooks/useInitSentry.d.ts.map +1 -0
- package/lib/src/hooks/useInitSentry.js +80 -0
- package/lib/src/hooks/useInitSentry.js.map +1 -0
- package/lib/src/hooks/useNodeActions.d.ts +6 -0
- package/lib/src/hooks/useNodeActions.d.ts.map +1 -0
- package/lib/src/hooks/useNodeActions.js +35 -0
- package/lib/src/hooks/useNodeActions.js.map +1 -0
- package/lib/src/hooks/useUndoRedoShortcuts.d.ts +8 -0
- package/lib/src/hooks/useUndoRedoShortcuts.d.ts.map +1 -0
- package/lib/src/hooks/useUndoRedoShortcuts.js +26 -0
- package/lib/src/hooks/useUndoRedoShortcuts.js.map +1 -0
- package/lib/src/hooks/useWindowSize.d.ts +5 -0
- package/lib/src/hooks/useWindowSize.d.ts.map +1 -0
- package/lib/src/hooks/useWindowSize.js +21 -0
- package/lib/src/hooks/useWindowSize.js.map +1 -0
- package/lib/src/hooks/utils.d.ts +7 -0
- package/lib/src/hooks/utils.d.ts.map +1 -0
- package/lib/src/hooks/utils.js +46 -0
- package/lib/src/hooks/utils.js.map +1 -0
- package/lib/src/i18n/index.d.ts +4 -0
- package/lib/src/i18n/index.d.ts.map +1 -0
- package/lib/src/i18n/index.js +26 -0
- package/lib/src/i18n/index.js.map +1 -0
- package/lib/src/i18n/locales/en.json +114 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +2 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/main.d.ts +2 -0
- package/lib/src/main.d.ts.map +1 -0
- package/lib/src/main.js +5 -0
- package/lib/src/main.js.map +1 -0
- package/lib/src/pages/content.d.ts +2 -0
- package/lib/src/pages/content.d.ts.map +1 -0
- package/lib/src/pages/content.js +39 -0
- package/lib/src/pages/content.js.map +1 -0
- package/lib/src/pages/demo/atlas-import.d.ts +2 -0
- package/lib/src/pages/demo/atlas-import.d.ts.map +1 -0
- package/lib/src/pages/demo/atlas-import.js +122 -0
- package/lib/src/pages/demo/atlas-import.js.map +1 -0
- package/lib/src/pages/index.d.ts +4 -0
- package/lib/src/pages/index.d.ts.map +1 -0
- package/lib/src/pages/index.js +4 -0
- package/lib/src/pages/index.js.map +1 -0
- package/lib/src/pages/settings.d.ts +4 -0
- package/lib/src/pages/settings.d.ts.map +1 -0
- package/lib/src/pages/settings.js +9 -0
- package/lib/src/pages/settings.js.map +1 -0
- package/lib/src/service-worker.d.ts +2 -0
- package/lib/src/service-worker.d.ts.map +1 -0
- package/lib/src/service-worker.js +58 -0
- package/lib/src/service-worker.js.map +1 -0
- package/lib/src/services/hmr.d.ts +13 -0
- package/lib/src/services/hmr.d.ts.map +1 -0
- package/lib/src/services/hmr.js +85 -0
- package/lib/src/services/hmr.js.map +1 -0
- package/lib/src/services/index.d.ts +10 -0
- package/lib/src/services/index.d.ts.map +1 -0
- package/lib/src/services/index.js +9 -0
- package/lib/src/services/index.js.map +1 -0
- package/lib/src/services/logger.d.ts +2 -0
- package/lib/src/services/logger.d.ts.map +1 -0
- package/lib/src/services/logger.js +28 -0
- package/lib/src/services/logger.js.map +1 -0
- package/lib/src/services/renown/browser.d.ts +2 -0
- package/lib/src/services/renown/browser.d.ts.map +1 -0
- package/lib/src/services/renown/browser.js +6 -0
- package/lib/src/services/renown/browser.js.map +1 -0
- package/lib/src/services/renown/constants.d.ts +130 -0
- package/lib/src/services/renown/constants.d.ts.map +1 -0
- package/lib/src/services/renown/constants.js +41 -0
- package/lib/src/services/renown/constants.js.map +1 -0
- package/lib/src/services/renown/utils.d.ts +7 -0
- package/lib/src/services/renown/utils.d.ts.map +1 -0
- package/lib/src/services/renown/utils.js +20 -0
- package/lib/src/services/renown/utils.js.map +1 -0
- package/lib/src/services/storage/base-storage.d.ts +9 -0
- package/lib/src/services/storage/base-storage.d.ts.map +1 -0
- package/lib/src/services/storage/base-storage.js +21 -0
- package/lib/src/services/storage/base-storage.js.map +1 -0
- package/lib/src/services/storage/browser.d.ts +5 -0
- package/lib/src/services/storage/browser.d.ts.map +1 -0
- package/lib/src/services/storage/browser.js +25 -0
- package/lib/src/services/storage/browser.js.map +1 -0
- package/lib/src/services/storage/types.d.ts +6 -0
- package/lib/src/services/storage/types.d.ts.map +1 -0
- package/lib/src/services/storage/types.js +2 -0
- package/lib/src/services/storage/types.js.map +1 -0
- package/lib/src/services/toast.d.ts +8 -0
- package/lib/src/services/toast.d.ts.map +1 -0
- package/lib/src/services/toast.js +11 -0
- package/lib/src/services/toast.js.map +1 -0
- package/lib/src/store/document-model.d.ts +3 -0
- package/lib/src/store/document-model.d.ts.map +1 -0
- package/lib/src/store/document-model.js +79 -0
- package/lib/src/store/document-model.js.map +1 -0
- package/lib/src/store/editor.d.ts +5 -0
- package/lib/src/store/editor.d.ts.map +1 -0
- package/lib/src/store/editor.js +31 -0
- package/lib/src/store/editor.js.map +1 -0
- package/lib/src/store/external-packages.d.ts +4 -0
- package/lib/src/store/external-packages.d.ts.map +1 -0
- package/lib/src/store/external-packages.js +36 -0
- package/lib/src/store/external-packages.js.map +1 -0
- package/lib/src/store/index.d.ts +7 -0
- package/lib/src/store/index.d.ts.map +1 -0
- package/lib/src/store/index.js +7 -0
- package/lib/src/store/index.js.map +1 -0
- package/lib/src/store/reactor.d.ts +3 -0
- package/lib/src/store/reactor.d.ts.map +1 -0
- package/lib/src/store/reactor.js +177 -0
- package/lib/src/store/reactor.js.map +1 -0
- package/lib/src/store/user.d.ts +2 -0
- package/lib/src/store/user.d.ts.map +1 -0
- package/lib/src/store/user.js +16 -0
- package/lib/src/store/user.js.map +1 -0
- package/lib/src/store/utils.d.ts +2 -0
- package/lib/src/store/utils.d.ts.map +1 -0
- package/lib/src/store/utils.js +59 -0
- package/lib/src/store/utils.js.map +1 -0
- package/lib/src/utils/browser.d.ts +2 -0
- package/lib/src/utils/browser.d.ts.map +1 -0
- package/lib/src/utils/browser.js +9 -0
- package/lib/src/utils/browser.js.map +1 -0
- package/lib/src/utils/document-editor-debug-tools.d.ts +17 -0
- package/lib/src/utils/document-editor-debug-tools.d.ts.map +1 -0
- package/lib/src/utils/document-editor-debug-tools.js +55 -0
- package/lib/src/utils/document-editor-debug-tools.js.map +1 -0
- package/lib/src/utils/drive-preservation.d.ts +19 -0
- package/lib/src/utils/drive-preservation.d.ts.map +1 -0
- package/lib/src/utils/drive-preservation.js +51 -0
- package/lib/src/utils/drive-preservation.js.map +1 -0
- package/lib/src/utils/drive-sections.d.ts +31 -0
- package/lib/src/utils/drive-sections.d.ts.map +1 -0
- package/lib/src/utils/drive-sections.js +63 -0
- package/lib/src/utils/drive-sections.js.map +1 -0
- package/lib/src/utils/index.d.ts +12 -0
- package/lib/src/utils/index.d.ts.map +1 -0
- package/lib/src/utils/index.js +12 -0
- package/lib/src/utils/index.js.map +1 -0
- package/lib/src/utils/join.d.ts +2 -0
- package/lib/src/utils/join.d.ts.map +1 -0
- package/lib/src/utils/join.js +11 -0
- package/lib/src/utils/join.js.map +1 -0
- package/lib/src/utils/openUrl.d.ts +2 -0
- package/lib/src/utils/openUrl.d.ts.map +1 -0
- package/lib/src/utils/openUrl.js +3 -0
- package/lib/src/utils/openUrl.js.map +1 -0
- package/lib/src/utils/path.d.ts +4 -0
- package/lib/src/utils/path.d.ts.map +1 -0
- package/lib/src/utils/path.js +17 -0
- package/lib/src/utils/path.js.map +1 -0
- package/lib/src/utils/reactor.d.ts +6 -0
- package/lib/src/utils/reactor.d.ts.map +1 -0
- package/lib/src/utils/reactor.js +57 -0
- package/lib/src/utils/reactor.js.map +1 -0
- package/lib/src/utils/registerServiceWorker.d.ts +12 -0
- package/lib/src/utils/registerServiceWorker.d.ts.map +1 -0
- package/lib/src/utils/registerServiceWorker.js +97 -0
- package/lib/src/utils/registerServiceWorker.js.map +1 -0
- package/lib/src/utils/signature.d.ts +4 -0
- package/lib/src/utils/signature.d.ts.map +1 -0
- package/lib/src/utils/signature.js +36 -0
- package/lib/src/utils/signature.js.map +1 -0
- package/lib/src/utils/slug.d.ts +2 -0
- package/lib/src/utils/slug.d.ts.map +1 -0
- package/lib/src/utils/slug.js +4 -0
- package/lib/src/utils/slug.js.map +1 -0
- package/lib/src/workers/pglite-worker.d.ts +2 -0
- package/lib/src/workers/pglite-worker.d.ts.map +1 -0
- package/lib/src/workers/pglite-worker.js +32 -0
- package/lib/src/workers/pglite-worker.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/vite.config.d.ts +3 -0
- package/lib/vite.config.d.ts.map +1 -0
- package/lib/vite.config.js +55 -0
- package/lib/vite.config.js.map +1 -0
- package/package.copy.json +168 -0
- package/package.json +132 -96
- package/public/icon.ico +0 -0
- package/public/robots.txt +3 -0
- package/public/settings.png +0 -0
- package/scripts/render-skeleton.ts +8 -10
- package/src/index.css +4 -0
- package/dist/assets/AddDriveModal.DJ-dAFOA.js +0 -2
- package/dist/assets/AddDriveModal.DJ-dAFOA.js.map +0 -1
- package/dist/assets/AddLocalDriveModal.De9JCy3U.js +0 -2
- package/dist/assets/AddLocalDriveModal.De9JCy3U.js.map +0 -1
- package/dist/assets/AddRemoteDriveModal.Bbso9zlA.js +0 -2
- package/dist/assets/AddRemoteDriveModal.Bbso9zlA.js.map +0 -1
- package/dist/assets/ConfirmationModal.vrZxNEXg.js +0 -2
- package/dist/assets/ConfirmationModal.vrZxNEXg.js.map +0 -1
- package/dist/assets/CookiesPolicyModal._TIEDwTl.js +0 -2
- package/dist/assets/CookiesPolicyModal._TIEDwTl.js.map +0 -1
- package/dist/assets/CreateDocumentModal.6coMTZ5K.js +0 -2
- package/dist/assets/CreateDocumentModal.6coMTZ5K.js.map +0 -1
- package/dist/assets/DebugSettingsModal.CC8h7-01.js +0 -2
- package/dist/assets/DebugSettingsModal.CC8h7-01.js.map +0 -1
- package/dist/assets/DeleteDriveModal.MOCpt-lE.js +0 -2
- package/dist/assets/DeleteDriveModal.MOCpt-lE.js.map +0 -1
- package/dist/assets/DeleteItemModal.D1JNJ3SD.js +0 -2
- package/dist/assets/DeleteItemModal.D1JNJ3SD.js.map +0 -1
- package/dist/assets/DisclaimerModal.CpWL_8dJ.js +0 -2
- package/dist/assets/DisclaimerModal.CpWL_8dJ.js.map +0 -1
- package/dist/assets/DriveSettingsModal.Cq31PlSd.js +0 -2
- package/dist/assets/DriveSettingsModal.Cq31PlSd.js.map +0 -1
- package/dist/assets/SettingsModal.DXSp8FUL.js +0 -2
- package/dist/assets/SettingsModal.DXSp8FUL.js.map +0 -1
- package/dist/assets/Trans.B_Bse39z.js +0 -2
- package/dist/assets/Trans.B_Bse39z.js.map +0 -1
- package/dist/assets/UpgradeDriveModal.Bcaqra-T.js +0 -2
- package/dist/assets/UpgradeDriveModal.Bcaqra-T.js.map +0 -1
- package/dist/assets/app-skeleton.js +0 -11
- package/dist/assets/app-skeleton.js.map +0 -1
- package/dist/assets/atlas-import.CrAV29KX.js +0 -6
- package/dist/assets/atlas-import.CrAV29KX.js.map +0 -1
- package/dist/assets/browser.BkwNmV2Z.js +0 -2
- package/dist/assets/browser.BkwNmV2Z.js.map +0 -1
- package/dist/assets/content.BVfObTK-.js +0 -3
- package/dist/assets/content.BVfObTK-.js.map +0 -1
- package/dist/assets/cookie-banner.CqSpDuL2.js +0 -2
- package/dist/assets/cookie-banner.CqSpDuL2.js.map +0 -1
- package/dist/assets/i18next.CqOP20KE.js +0 -2
- package/dist/assets/i18next.CqOP20KE.js.map +0 -1
- package/dist/assets/index-B7k827uL.css +0 -1
- package/dist/assets/index.Be3reTUB.js +0 -114
- package/dist/assets/index.Be3reTUB.js.map +0 -1
- package/dist/assets/index.C0tp--nk.js +0 -387
- package/dist/assets/index.C0tp--nk.js.map +0 -1
- package/dist/assets/index.CTYq_dOR.js +0 -16
- package/dist/assets/index.CTYq_dOR.js.map +0 -1
- package/dist/assets/index.CW6hXWch.js +0 -333
- package/dist/assets/index.CW6hXWch.js.map +0 -1
- package/dist/assets/index.DNX0QOJs.js +0 -2
- package/dist/assets/index.DNX0QOJs.js.map +0 -1
- package/dist/assets/index.MXCURbo4.js +0 -361
- package/dist/assets/index.MXCURbo4.js.map +0 -1
- package/dist/assets/index.TIUvoczv.js +0 -2
- package/dist/assets/index.TIUvoczv.js.map +0 -1
- package/dist/assets/index.hUDcoha1.js +0 -2
- package/dist/assets/index.hUDcoha1.js.map +0 -1
- package/dist/assets/index.ycvKRDCc.js +0 -2
- package/dist/assets/index.ycvKRDCc.js.map +0 -1
- package/dist/assets/main-CT4nIKNi.css +0 -1
- package/dist/assets/main.CpBKbYrC.js +0 -3
- package/dist/assets/main.CpBKbYrC.js.map +0 -1
- package/dist/assets/modal.B6AxZ1yB.js +0 -3
- package/dist/assets/modal.B6AxZ1yB.js.map +0 -1
- package/dist/assets/modals.jKUpbvJU.js +0 -2
- package/dist/assets/modals.jKUpbvJU.js.map +0 -1
- package/dist/assets/nodefs-CbgXeDrX.js +0 -2
- package/dist/assets/nodefs-CbgXeDrX.js.map +0 -1
- package/dist/assets/nodefs.rxvmn5tR.js +0 -2
- package/dist/assets/nodefs.rxvmn5tR.js.map +0 -1
- package/dist/assets/nodes.CkHD8Mis.js +0 -2
- package/dist/assets/nodes.CkHD8Mis.js.map +0 -1
- package/dist/assets/opfs-ahp-CvqFFNTs.js +0 -4
- package/dist/assets/opfs-ahp-CvqFFNTs.js.map +0 -1
- package/dist/assets/opfs-ahp.BE5Mymun.js +0 -4
- package/dist/assets/opfs-ahp.BE5Mymun.js.map +0 -1
- package/dist/assets/pglite-worker-CBI3hEVN.js +0 -144
- package/dist/assets/pglite-worker-CBI3hEVN.js.map +0 -1
- package/dist/assets/pglite-worker.dssW4LQw.js +0 -2
- package/dist/assets/pglite-worker.dssW4LQw.js.map +0 -1
- package/dist/assets/postgres-CkP7QCDB.data +0 -0
- package/dist/assets/postgres-CyuUVpXN.wasm +0 -0
- package/dist/assets/registerServiceWorker.3WXSlUUt.js +0 -2
- package/dist/assets/registerServiceWorker.3WXSlUUt.js.map +0 -1
- package/dist/assets/root.20yJwNI0.js +0 -6
- package/dist/assets/root.20yJwNI0.js.map +0 -1
- package/dist/assets/style-BkLV0sfQ.css +0 -1
- package/dist/assets/useAcceptedCookies.BEC0OUzL.js +0 -2
- package/dist/assets/useAcceptedCookies.BEC0OUzL.js.map +0 -1
- package/dist/assets/useDefaultDocumentModelEditor.oOnI3BO7.js +0 -2
- package/dist/assets/useDefaultDocumentModelEditor.oOnI3BO7.js.map +0 -1
- package/dist/assets/useInitSentry.DX0S8ltZ.js +0 -368
- package/dist/assets/useInitSentry.DX0S8ltZ.js.map +0 -1
- package/dist/external-packages.js +0 -1
- package/dist/fonts/Inter-Black.ttf +0 -0
- package/dist/fonts/Inter-Bold.ttf +0 -0
- package/dist/fonts/Inter-ExtraBold.ttf +0 -0
- package/dist/fonts/Inter-ExtraLight.ttf +0 -0
- package/dist/fonts/Inter-Light.ttf +0 -0
- package/dist/fonts/Inter-Medium.ttf +0 -0
- package/dist/fonts/Inter-Regular.ttf +0 -0
- package/dist/fonts/Inter-SemiBold.ttf +0 -0
- package/dist/fonts/Inter-Thin.ttf +0 -0
- package/dist/fonts/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/dist/hmr.js +0 -2
- package/dist/hmr.js.map +0 -1
- package/dist/service-worker.js +0 -2
- package/dist/service-worker.js.map +0 -1
- package/dist/swEnv.js +0 -70
- package/dist/vite-envs.sh +0 -494
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./nodefs.rxvmn5tR.js","./index.CW6hXWch.js","./index.C0tp--nk.js","./browser.BkwNmV2Z.js","./app-skeleton.js","./index-B7k827uL.css","./useAcceptedCookies.BEC0OUzL.js","./registerServiceWorker.3WXSlUUt.js","./opfs-ahp.BE5Mymun.js","./index.hUDcoha1.js","./index.TIUvoczv.js","./index.ycvKRDCc.js","./content.BVfObTK-.js","./modals.jKUpbvJU.js","./i18next.CqOP20KE.js","./modal.B6AxZ1yB.js","./nodes.CkHD8Mis.js","./useDefaultDocumentModelEditor.oOnI3BO7.js","./root.20yJwNI0.js","./atlas-import.CrAV29KX.js","./index.MXCURbo4.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var du=Object.defineProperty;var Kl=e=>{throw TypeError(e)};var hu=(e,t,I)=>t in e?du(e,t,{enumerable:!0,configurable:!0,writable:!0,value:I}):e[t]=I;var ji=(e,t,I)=>hu(e,typeof t!="symbol"?t+"":t,I),Il=(e,t,I)=>t.has(e)||Kl("Cannot "+I);var gr=(e,t,I)=>(Il(e,t,"read from private field"),I?I.call(e):t.get(e)),_i=(e,t,I)=>t.has(e)?Kl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,I),yi=(e,t,I,B)=>(Il(e,t,"write to private field"),B?B.call(e,I):t.set(e,I),I),Ai=(e,t,I)=>(Il(e,t,"access private method"),I);import{jsxs,jsx,Fragment}from"react/jsx-runtime";import{Z as require$$1,v as commonjsGlobal,p as process,g as getDefaultExportFromCjs,_ as __vitePreload,$ as QueryClientProvider,a0 as QueryClient,a1 as useQueryClient,a2 as useMutation,a3 as useQuery,a4 as WagmiContext,a5 as ToastContainer}from"./index.CW6hXWch.js";import{u as useConnectConfig,a as useAtomValue,b as unwrappedProcessorManagerAtom,c as childLogger,d as createRelationalDb,e as useAtomValue$1,f as atom,g as externalPackagesAtom,h as config}from"./index.C0tp--nk.js";import*as React from"react";import React__default,{useEffect,useMemo,useState,useRef,Suspense}from"react";import{u as useAcceptedCookies}from"./useAcceptedCookies.BEC0OUzL.js";import*as ReactDOM from"react-dom";import{s as serviceWorkerManager}from"./registerServiceWorker.3WXSlUUt.js";function gtag(...e){var t;(t=window.dataLayer)==null||t.push(...e)}const Analytics=()=>{const[{gaTrackingId:e}]=useConnectConfig(),[{analytics:t}]=useAcceptedCookies(),I=e&&t;return useEffect(()=>{if(I){const B=document.createElement("script");return B.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,B.async=!0,document.head.appendChild(B),window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config",e),()=>{document.head.removeChild(B)}}},[I,e]),null};function useProcessorManager(){return useAtomValue(unwrappedProcessorManagerAtom)}const SentryProvider=({children:e})=>(useInitSentry(),e);class DocumentEditorDebugTools{constructor(t){ji(this,"document");ji(this,"operations",[]);t&&(this.document=t)}operationsToTableObject(t){return t.map(I=>({...I,input:JSON.stringify(I.input)}))}setDocument(t){this.document=t}getDocument(){return this.document}getOperations(){return this.operations}pushOperation(t){this.operations.push(t)}operationsTable(){var I;this.document||console.warn("No document");const t=Object.values(((I=this.document)==null?void 0:I.operations)||{}).flatMap(B=>B).sort((B,tr)=>B.index-tr.index);console.table(this.operationsToTableObject(t))}scopeOperationsTable(t){var B;this.document||console.warn("No document");const I=((B=this.document)==null?void 0:B.operations[t])||[];console.table(this.operationsToTableObject(I))}operationsLog(){console.log(this.operations)}operationsLogTable(){console.table(this.operationsToTableObject(this.operations))}clear(){this.operations=[],this.document=void 0}}class PassthroughAnalyticsProfiler{get prefix(){return""}push(t){}pop(){}popAndReturn(t){return t}async record(t,I){return await I()}recordSync(t,I){return I()}}var AnalyticsSerializerTypes;(function(e){e[e.AnalyticsPath=0]="AnalyticsPath",e[e.AnalyticsPathSegment=1]="AnalyticsPathSegment",e[e.AnalyticsPeriod=2]="AnalyticsPeriod"})(AnalyticsSerializerTypes||(AnalyticsSerializerTypes={}));var AnalyticsPeriodType;(function(e){e[e.Year=0]="Year",e[e.Quarter=1]="Quarter",e[e.Month=2]="Month"})(AnalyticsPeriodType||(AnalyticsPeriodType={}));class AnalyticsPath{constructor(t){ji(this,"_segments");this._segments=t}get segments(){return this._segments}static fromString(t){const I=parseSeparatedList(t,"/").map(B=>AnalyticsPathSegment.fromString(B));return new AnalyticsPath(I)}static fromStringArray(t){return new AnalyticsPath(t.map(I=>AnalyticsPathSegment.fromString(I)))}static fromArray(t){return new AnalyticsPath(t)}static fromJSON(t){const I=t._v.split("/").map(B=>AnalyticsPathSegment.fromString(B));return new AnalyticsPath(I)}toJSON(){return{_t:AnalyticsSerializerTypes.AnalyticsPath,_v:this.toString()}}toString(t=""){return this._segments.map(I=>I.toString()).join("/")+t}firstSegment(){return this._segments.length>0?this._segments[0]:new AnalyticsPathSegment}reduce(){const t=this._segments.slice(1);return t.length<1&&t.push(new AnalyticsPathSegment),new AnalyticsPath(t)}applyLod(t){const I=[...this._segments];for(;I.length<t;)I.push(new AnalyticsPathSegment);return new AnalyticsPath(I.slice(0,t))}}class AnalyticsPathSegment{constructor(t=null,I=[]){ji(this,"_filters",null);ji(this,"_groups",null);this._filters=t,this._groups=I}get filters(){return this._filters}get groups(){return this._groups}static fromString(t){const I=parseSeparatedList(t,":");let B;I[0]==="*"?B=null:B=parseSeparatedList(I[0],",").map(rr=>AnalyticsPathSegment.unescape(rr));let tr;return I[1]===void 0||I[1].length<1?tr=[]:I[1]==="*"?tr=null:tr=parseSeparatedList(I[1],",").map(rr=>AnalyticsPathSegment.unescape(rr)),new AnalyticsPathSegment(B,tr)}static escape(t){return t.replace(/(\\|:|\/|,)/gi,"\\$1")}static unescape(t){return t.replace(/\\(.)/gi,"$1")}toJSON(){return{_t:AnalyticsSerializerTypes.AnalyticsPathSegment,_v:this.toString()}}toString(){let t="";return this._filters===null?t+="*":t+=this._filters.map(I=>AnalyticsPathSegment.escape(I)).join(","),this._groups===null?t+=":*":this._groups.length>0&&(t+=":"+this._groups.map(I=>AnalyticsPathSegment.escape(I)).join(",")),t}}const unescapedSeparatorPattern={":":new RegExp("(?<!\\\\):"),",":new RegExp("(?<!\\\\),"),"/":new RegExp("(?<!\\\\)\\/")};function parseSeparatedList(e,t){let I="@@";for(;e.indexOf(I)>-1;)I+="@";return e.replaceAll("\\\\",I).split(unescapedSeparatorPattern[t]).map(B=>B.replaceAll(I,"\\\\"))}var AnalyticsMetric;(function(e){e[e.Budget=0]="Budget",e[e.Forecast=1]="Forecast",e[e.Actuals=2]="Actuals",e[e.PaymentsOnChain=3]="PaymentsOnChain",e[e.PaymentsOffChainIncluded=4]="PaymentsOffChainIncluded",e[e.FTEs=5]="FTEs"})(AnalyticsMetric||(AnalyticsMetric={}));var CompoundOperator;(function(e){e[e.VectorAdd=0]="VectorAdd",e[e.VectorSubtract=1]="VectorSubtract",e[e.ScalarMultiply=2]="ScalarMultiply",e[e.ScalarDivide=3]="ScalarDivide"})(CompoundOperator||(CompoundOperator={}));var AnalyticsGranularity;(function(e){e[e.Total=0]="Total",e[e.Annual=1]="Annual",e[e.SemiAnnual=2]="SemiAnnual",e[e.Quarterly=3]="Quarterly",e[e.Monthly=4]="Monthly",e[e.Weekly=5]="Weekly",e[e.Daily=6]="Daily",e[e.Hourly=7]="Hourly"})(AnalyticsGranularity||(AnalyticsGranularity={}));class LuxonError extends Error{}class InvalidDateTimeError extends LuxonError{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class InvalidIntervalError extends LuxonError{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class InvalidDurationError extends LuxonError{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class ConflictingSpecificationError extends LuxonError{}class InvalidUnitError extends LuxonError{constructor(t){super(`Invalid unit ${t}`)}}class InvalidArgumentError extends LuxonError{}class ZoneIsAbstractError extends LuxonError{constructor(){super("Zone is an abstract class")}}const n$1="numeric",s$2="short",l$3="long",DATE_SHORT={year:n$1,month:n$1,day:n$1},DATE_MED={year:n$1,month:s$2,day:n$1},DATE_MED_WITH_WEEKDAY={year:n$1,month:s$2,day:n$1,weekday:s$2},DATE_FULL={year:n$1,month:l$3,day:n$1},DATE_HUGE={year:n$1,month:l$3,day:n$1,weekday:l$3},TIME_SIMPLE={hour:n$1,minute:n$1},TIME_WITH_SECONDS={hour:n$1,minute:n$1,second:n$1},TIME_WITH_SHORT_OFFSET={hour:n$1,minute:n$1,second:n$1,timeZoneName:s$2},TIME_WITH_LONG_OFFSET={hour:n$1,minute:n$1,second:n$1,timeZoneName:l$3},TIME_24_SIMPLE={hour:n$1,minute:n$1,hourCycle:"h23"},TIME_24_WITH_SECONDS={hour:n$1,minute:n$1,second:n$1,hourCycle:"h23"},TIME_24_WITH_SHORT_OFFSET={hour:n$1,minute:n$1,second:n$1,hourCycle:"h23",timeZoneName:s$2},TIME_24_WITH_LONG_OFFSET={hour:n$1,minute:n$1,second:n$1,hourCycle:"h23",timeZoneName:l$3},DATETIME_SHORT={year:n$1,month:n$1,day:n$1,hour:n$1,minute:n$1},DATETIME_SHORT_WITH_SECONDS={year:n$1,month:n$1,day:n$1,hour:n$1,minute:n$1,second:n$1},DATETIME_MED={year:n$1,month:s$2,day:n$1,hour:n$1,minute:n$1},DATETIME_MED_WITH_SECONDS={year:n$1,month:s$2,day:n$1,hour:n$1,minute:n$1,second:n$1},DATETIME_MED_WITH_WEEKDAY={year:n$1,month:s$2,day:n$1,weekday:s$2,hour:n$1,minute:n$1},DATETIME_FULL={year:n$1,month:l$3,day:n$1,hour:n$1,minute:n$1,timeZoneName:s$2},DATETIME_FULL_WITH_SECONDS={year:n$1,month:l$3,day:n$1,hour:n$1,minute:n$1,second:n$1,timeZoneName:s$2},DATETIME_HUGE={year:n$1,month:l$3,day:n$1,weekday:l$3,hour:n$1,minute:n$1,timeZoneName:l$3},DATETIME_HUGE_WITH_SECONDS={year:n$1,month:l$3,day:n$1,weekday:l$3,hour:n$1,minute:n$1,second:n$1,timeZoneName:l$3};class Zone{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get ianaName(){return this.name}get isUniversal(){throw new ZoneIsAbstractError}offsetName(t,I){throw new ZoneIsAbstractError}formatOffset(t,I){throw new ZoneIsAbstractError}offset(t){throw new ZoneIsAbstractError}equals(t){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}}let singleton$1=null;class SystemZone extends Zone{static get instance(){return singleton$1===null&&(singleton$1=new SystemZone),singleton$1}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:I,locale:B}){return parseZoneInfo(t,I,B)}formatOffset(t,I){return formatOffset(this.offset(t),I)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const dtfCache=new Map;function makeDTF(e){let t=dtfCache.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),dtfCache.set(e,t)),t}const typeToPos={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hackyOffset(e,t){const I=e.format(t).replace(/\u200E/g,""),B=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(I),[,tr,rr,ir,lr,dr,hr,fr]=B;return[ir,tr,rr,lr,dr,hr,fr]}function partsOffset(e,t){const I=e.formatToParts(t),B=[];for(let tr=0;tr<I.length;tr++){const{type:rr,value:ir}=I[tr],lr=typeToPos[rr];rr==="era"?B[lr]=ir:isUndefined$1(lr)||(B[lr]=parseInt(ir,10))}return B}const ianaZoneCache=new Map;class IANAZone extends Zone{static create(t){let I=ianaZoneCache.get(t);return I===void 0&&ianaZoneCache.set(t,I=new IANAZone(t)),I}static resetCache(){ianaZoneCache.clear(),dtfCache.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=IANAZone.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:I,locale:B}){return parseZoneInfo(t,I,B,this.name)}formatOffset(t,I){return formatOffset(this.offset(t),I)}offset(t){if(!this.valid)return NaN;const I=new Date(t);if(isNaN(I))return NaN;const B=makeDTF(this.name);let[tr,rr,ir,lr,dr,hr,fr]=B.formatToParts?partsOffset(B,I):hackyOffset(B,I);lr==="BC"&&(tr=-Math.abs(tr)+1);const _r=objToLocalTS({year:tr,month:rr,day:ir,hour:dr===24?0:dr,minute:hr,second:fr,millisecond:0});let yr=+I;const xr=yr%1e3;return yr-=xr>=0?xr:1e3+xr,(_r-yr)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let intlLFCache={};function getCachedLF(e,t={}){const I=JSON.stringify([e,t]);let B=intlLFCache[I];return B||(B=new Intl.ListFormat(e,t),intlLFCache[I]=B),B}const intlDTCache=new Map;function getCachedDTF(e,t={}){const I=JSON.stringify([e,t]);let B=intlDTCache.get(I);return B===void 0&&(B=new Intl.DateTimeFormat(e,t),intlDTCache.set(I,B)),B}const intlNumCache=new Map;function getCachedINF(e,t={}){const I=JSON.stringify([e,t]);let B=intlNumCache.get(I);return B===void 0&&(B=new Intl.NumberFormat(e,t),intlNumCache.set(I,B)),B}const intlRelCache=new Map;function getCachedRTF(e,t={}){const{base:I,...B}=t,tr=JSON.stringify([e,B]);let rr=intlRelCache.get(tr);return rr===void 0&&(rr=new Intl.RelativeTimeFormat(e,t),intlRelCache.set(tr,rr)),rr}let sysLocaleCache=null;function systemLocale(){return sysLocaleCache||(sysLocaleCache=new Intl.DateTimeFormat().resolvedOptions().locale,sysLocaleCache)}const intlResolvedOptionsCache=new Map;function getCachedIntResolvedOptions(e){let t=intlResolvedOptionsCache.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),intlResolvedOptionsCache.set(e,t)),t}const weekInfoCache=new Map;function getCachedWeekInfo(e){let t=weekInfoCache.get(e);if(!t){const I=new Intl.Locale(e);t="getWeekInfo"in I?I.getWeekInfo():I.weekInfo,"minimalDays"in t||(t={...fallbackWeekSettings,...t}),weekInfoCache.set(e,t)}return t}function parseLocaleString(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const I=e.indexOf("-u-");if(I===-1)return[e];{let B,tr;try{B=getCachedDTF(e).resolvedOptions(),tr=e}catch{const dr=e.substring(0,I);B=getCachedDTF(dr).resolvedOptions(),tr=dr}const{numberingSystem:rr,calendar:ir}=B;return[tr,rr,ir]}}function intlConfigString(e,t,I){return(I||t)&&(e.includes("-u-")||(e+="-u"),I&&(e+=`-ca-${I}`),t&&(e+=`-nu-${t}`)),e}function mapMonths(e){const t=[];for(let I=1;I<=12;I++){const B=DateTime.utc(2009,I,1);t.push(e(B))}return t}function mapWeekdays(e){const t=[];for(let I=1;I<=7;I++){const B=DateTime.utc(2016,11,13+I);t.push(e(B))}return t}function listStuff(e,t,I,B){const tr=e.listingMode();return tr==="error"?null:tr==="en"?I(t):B(t)}function supportsFastNumbers(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||getCachedIntResolvedOptions(e.locale).numberingSystem==="latn"}class PolyNumberFormatter{constructor(t,I,B){this.padTo=B.padTo||0,this.floor=B.floor||!1;const{padTo:tr,floor:rr,...ir}=B;if(!I||Object.keys(ir).length>0){const lr={useGrouping:!1,...B};B.padTo>0&&(lr.minimumIntegerDigits=B.padTo),this.inf=getCachedINF(t,lr)}}format(t){if(this.inf){const I=this.floor?Math.floor(t):t;return this.inf.format(I)}else{const I=this.floor?Math.floor(t):roundTo(t,3);return padStart(I,this.padTo)}}}class PolyDateFormatter{constructor(t,I,B){this.opts=B,this.originalZone=void 0;let tr;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const ir=-1*(t.offset/60),lr=ir>=0?`Etc/GMT+${ir}`:`Etc/GMT${ir}`;t.offset!==0&&IANAZone.create(lr).valid?(tr=lr,this.dt=t):(tr="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,tr=t.zone.name):(tr="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const rr={...this.opts};rr.timeZone=rr.timeZone||tr,this.dtf=getCachedDTF(I,rr)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(I=>{if(I.type==="timeZoneName"){const B=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...I,value:B}}else return I}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class PolyRelFormatter{constructor(t,I,B){this.opts={style:"long",...B},!I&&hasRelative()&&(this.rtf=getCachedRTF(t,B))}format(t,I){return this.rtf?this.rtf.format(t,I):formatRelativeTime(I,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,I){return this.rtf?this.rtf.formatToParts(t,I):[]}}const fallbackWeekSettings={firstDay:1,minimalDays:4,weekend:[6,7]};class Locale{static fromOpts(t){return Locale.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,I,B,tr,rr=!1){const ir=t||Settings.defaultLocale,lr=ir||(rr?"en-US":systemLocale()),dr=I||Settings.defaultNumberingSystem,hr=B||Settings.defaultOutputCalendar,fr=validateWeekSettings(tr)||Settings.defaultWeekSettings;return new Locale(lr,dr,hr,fr,ir)}static resetCache(){sysLocaleCache=null,intlDTCache.clear(),intlNumCache.clear(),intlRelCache.clear(),intlResolvedOptionsCache.clear(),weekInfoCache.clear()}static fromObject({locale:t,numberingSystem:I,outputCalendar:B,weekSettings:tr}={}){return Locale.create(t,I,B,tr)}constructor(t,I,B,tr,rr){const[ir,lr,dr]=parseLocaleString(t);this.locale=ir,this.numberingSystem=I||lr||null,this.outputCalendar=B||dr||null,this.weekSettings=tr,this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=rr,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=supportsFastNumbers(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),I=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&I?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Locale.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,validateWeekSettings(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,I=!1){return listStuff(this,t,months,()=>{const B=I?{month:t,day:"numeric"}:{month:t},tr=I?"format":"standalone";return this.monthsCache[tr][t]||(this.monthsCache[tr][t]=mapMonths(rr=>this.extract(rr,B,"month"))),this.monthsCache[tr][t]})}weekdays(t,I=!1){return listStuff(this,t,weekdays,()=>{const B=I?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},tr=I?"format":"standalone";return this.weekdaysCache[tr][t]||(this.weekdaysCache[tr][t]=mapWeekdays(rr=>this.extract(rr,B,"weekday"))),this.weekdaysCache[tr][t]})}meridiems(){return listStuff(this,void 0,()=>meridiems,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map(I=>this.extract(I,t,"dayperiod"))}return this.meridiemCache})}eras(t){return listStuff(this,t,eras,()=>{const I={era:t};return this.eraCache[t]||(this.eraCache[t]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map(B=>this.extract(B,I,"era"))),this.eraCache[t]})}extract(t,I,B){const tr=this.dtFormatter(t,I),rr=tr.formatToParts(),ir=rr.find(lr=>lr.type.toLowerCase()===B);return ir?ir.value:null}numberFormatter(t={}){return new PolyNumberFormatter(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,I={}){return new PolyDateFormatter(t,this.intl,I)}relFormatter(t={}){return new PolyRelFormatter(this.intl,this.isEnglish(),t)}listFormatter(t={}){return getCachedLF(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hasLocaleWeekInfo()?getCachedWeekInfo(this.locale):fallbackWeekSettings}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let singleton=null;class FixedOffsetZone extends Zone{static get utcInstance(){return singleton===null&&(singleton=new FixedOffsetZone(0)),singleton}static instance(t){return t===0?FixedOffsetZone.utcInstance:new FixedOffsetZone(t)}static parseSpecifier(t){if(t){const I=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(I)return new FixedOffsetZone(signedOffset(I[1],I[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${formatOffset(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,I){return formatOffset(this.fixed,I)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class InvalidZone extends Zone{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function normalizeZone(e,t){if(isUndefined$1(e)||e===null)return t;if(e instanceof Zone)return e;if(isString$1(e)){const I=e.toLowerCase();return I==="default"?t:I==="local"||I==="system"?SystemZone.instance:I==="utc"||I==="gmt"?FixedOffsetZone.utcInstance:FixedOffsetZone.parseSpecifier(I)||IANAZone.create(e)}else return isNumber$1(e)?FixedOffsetZone.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new InvalidZone(e)}const numberingSystems={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},numberingSystemsUTF16={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},hanidecChars=numberingSystems.hanidec.replace(/[\[|\]]/g,"").split("");function parseDigits(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let I=0;I<e.length;I++){const B=e.charCodeAt(I);if(e[I].search(numberingSystems.hanidec)!==-1)t+=hanidecChars.indexOf(e[I]);else for(const tr in numberingSystemsUTF16){const[rr,ir]=numberingSystemsUTF16[tr];B>=rr&&B<=ir&&(t+=B-rr)}}return parseInt(t,10)}else return t}const digitRegexCache=new Map;function resetDigitRegexCache(){digitRegexCache.clear()}function digitRegex({numberingSystem:e},t=""){const I=e||"latn";let B=digitRegexCache.get(I);B===void 0&&(B=new Map,digitRegexCache.set(I,B));let tr=B.get(t);return tr===void 0&&(tr=new RegExp(`${numberingSystems[I]}${t}`),B.set(t,tr)),tr}let now=()=>Date.now(),defaultZone="system",defaultLocale=null,defaultNumberingSystem=null,defaultOutputCalendar=null,twoDigitCutoffYear=60,throwOnInvalid,defaultWeekSettings=null;class Settings{static get now(){return now}static set now(t){now=t}static set defaultZone(t){defaultZone=t}static get defaultZone(){return normalizeZone(defaultZone,SystemZone.instance)}static get defaultLocale(){return defaultLocale}static set defaultLocale(t){defaultLocale=t}static get defaultNumberingSystem(){return defaultNumberingSystem}static set defaultNumberingSystem(t){defaultNumberingSystem=t}static get defaultOutputCalendar(){return defaultOutputCalendar}static set defaultOutputCalendar(t){defaultOutputCalendar=t}static get defaultWeekSettings(){return defaultWeekSettings}static set defaultWeekSettings(t){defaultWeekSettings=validateWeekSettings(t)}static get twoDigitCutoffYear(){return twoDigitCutoffYear}static set twoDigitCutoffYear(t){twoDigitCutoffYear=t%100}static get throwOnInvalid(){return throwOnInvalid}static set throwOnInvalid(t){throwOnInvalid=t}static resetCaches(){Locale.resetCache(),IANAZone.resetCache(),DateTime.resetCache(),resetDigitRegexCache()}}class Invalid{constructor(t,I){this.reason=t,this.explanation=I}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const nonLeapLadder=[0,31,59,90,120,151,181,212,243,273,304,334],leapLadder=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(e,t){return new Invalid("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function dayOfWeek(e,t,I){const B=new Date(Date.UTC(e,t-1,I));e<100&&e>=0&&B.setUTCFullYear(B.getUTCFullYear()-1900);const tr=B.getUTCDay();return tr===0?7:tr}function computeOrdinal(e,t,I){return I+(isLeapYear(e)?leapLadder:nonLeapLadder)[t-1]}function uncomputeOrdinal(e,t){const I=isLeapYear(e)?leapLadder:nonLeapLadder,B=I.findIndex(rr=>rr<t),tr=t-I[B];return{month:B+1,day:tr}}function isoWeekdayToLocal(e,t){return(e-t+7)%7+1}function gregorianToWeek(e,t=4,I=1){const{year:B,month:tr,day:rr}=e,ir=computeOrdinal(B,tr,rr),lr=isoWeekdayToLocal(dayOfWeek(B,tr,rr),I);let dr=Math.floor((ir-lr+14-t)/7),hr;return dr<1?(hr=B-1,dr=weeksInWeekYear(hr,t,I)):dr>weeksInWeekYear(B,t,I)?(hr=B+1,dr=1):hr=B,{weekYear:hr,weekNumber:dr,weekday:lr,...timeObject(e)}}function weekToGregorian(e,t=4,I=1){const{weekYear:B,weekNumber:tr,weekday:rr}=e,ir=isoWeekdayToLocal(dayOfWeek(B,1,t),I),lr=daysInYear(B);let dr=tr*7+rr-ir-7+t,hr;dr<1?(hr=B-1,dr+=daysInYear(hr)):dr>lr?(hr=B+1,dr-=daysInYear(B)):hr=B;const{month:fr,day:mr}=uncomputeOrdinal(hr,dr);return{year:hr,month:fr,day:mr,...timeObject(e)}}function gregorianToOrdinal(e){const{year:t,month:I,day:B}=e,tr=computeOrdinal(t,I,B);return{year:t,ordinal:tr,...timeObject(e)}}function ordinalToGregorian(e){const{year:t,ordinal:I}=e,{month:B,day:tr}=uncomputeOrdinal(t,I);return{year:t,month:B,day:tr,...timeObject(e)}}function usesLocalWeekValues(e,t){if(!isUndefined$1(e.localWeekday)||!isUndefined$1(e.localWeekNumber)||!isUndefined$1(e.localWeekYear)){if(!isUndefined$1(e.weekday)||!isUndefined$1(e.weekNumber)||!isUndefined$1(e.weekYear))throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields");return isUndefined$1(e.localWeekday)||(e.weekday=e.localWeekday),isUndefined$1(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),isUndefined$1(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function hasInvalidWeekData(e,t=4,I=1){const B=isInteger(e.weekYear),tr=integerBetween(e.weekNumber,1,weeksInWeekYear(e.weekYear,t,I)),rr=integerBetween(e.weekday,1,7);return B?tr?rr?!1:unitOutOfRange("weekday",e.weekday):unitOutOfRange("week",e.weekNumber):unitOutOfRange("weekYear",e.weekYear)}function hasInvalidOrdinalData(e){const t=isInteger(e.year),I=integerBetween(e.ordinal,1,daysInYear(e.year));return t?I?!1:unitOutOfRange("ordinal",e.ordinal):unitOutOfRange("year",e.year)}function hasInvalidGregorianData(e){const t=isInteger(e.year),I=integerBetween(e.month,1,12),B=integerBetween(e.day,1,daysInMonth(e.year,e.month));return t?I?B?!1:unitOutOfRange("day",e.day):unitOutOfRange("month",e.month):unitOutOfRange("year",e.year)}function hasInvalidTimeData(e){const{hour:t,minute:I,second:B,millisecond:tr}=e,rr=integerBetween(t,0,23)||t===24&&I===0&&B===0&&tr===0,ir=integerBetween(I,0,59),lr=integerBetween(B,0,59),dr=integerBetween(tr,0,999);return rr?ir?lr?dr?!1:unitOutOfRange("millisecond",tr):unitOutOfRange("second",B):unitOutOfRange("minute",I):unitOutOfRange("hour",t)}function isUndefined$1(e){return typeof e>"u"}function isNumber$1(e){return typeof e=="number"}function isInteger(e){return typeof e=="number"&&e%1===0}function isString$1(e){return typeof e=="string"}function isDate$1(e){return Object.prototype.toString.call(e)==="[object Date]"}function hasRelative(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function hasLocaleWeekInfo(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function maybeArray(e){return Array.isArray(e)?e:[e]}function bestBy(e,t,I){if(e.length!==0)return e.reduce((B,tr)=>{const rr=[t(tr),tr];return B&&I(B[0],rr[0])===B[0]?B:rr},null)[1]}function pick(e,t){return t.reduce((I,B)=>(I[B]=e[B],I),{})}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function validateWeekSettings(e){if(e==null)return null;if(typeof e!="object")throw new InvalidArgumentError("Week settings must be an object");if(!integerBetween(e.firstDay,1,7)||!integerBetween(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!integerBetween(t,1,7)))throw new InvalidArgumentError("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function integerBetween(e,t,I){return isInteger(e)&&e>=t&&e<=I}function floorMod(e,t){return e-t*Math.floor(e/t)}function padStart(e,t=2){const I=e<0;let B;return I?B="-"+(""+-e).padStart(t,"0"):B=(""+e).padStart(t,"0"),B}function parseInteger(e){if(!(isUndefined$1(e)||e===null||e===""))return parseInt(e,10)}function parseFloating(e){if(!(isUndefined$1(e)||e===null||e===""))return parseFloat(e)}function parseMillis(e){if(!(isUndefined$1(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function roundTo(e,t,I=!1){const B=10**t;return(I?Math.trunc:Math.round)(e*B)/B}function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}function daysInYear(e){return isLeapYear(e)?366:365}function daysInMonth(e,t){const I=floorMod(t-1,12)+1,B=e+(t-I)/12;return I===2?isLeapYear(B)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][I-1]}function objToLocalTS(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function firstWeekOffset(e,t,I){return-isoWeekdayToLocal(dayOfWeek(e,1,t),I)+t-1}function weeksInWeekYear(e,t=4,I=1){const B=firstWeekOffset(e,t,I),tr=firstWeekOffset(e+1,t,I);return(daysInYear(e)-B+tr)/7}function untruncateYear(e){return e>99?e:e>Settings.twoDigitCutoffYear?1900+e:2e3+e}function parseZoneInfo(e,t,I,B=null){const tr=new Date(e),rr={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};B&&(rr.timeZone=B);const ir={timeZoneName:t,...rr},lr=new Intl.DateTimeFormat(I,ir).formatToParts(tr).find(dr=>dr.type.toLowerCase()==="timezonename");return lr?lr.value:null}function signedOffset(e,t){let I=parseInt(e,10);Number.isNaN(I)&&(I=0);const B=parseInt(t,10)||0,tr=I<0||Object.is(I,-0)?-B:B;return I*60+tr}function asNumber(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new InvalidArgumentError(`Invalid unit value ${e}`);return t}function normalizeObject(e,t){const I={};for(const B in e)if(hasOwnProperty(e,B)){const tr=e[B];if(tr==null)continue;I[t(B)]=asNumber(tr)}return I}function formatOffset(e,t){const I=Math.trunc(Math.abs(e/60)),B=Math.trunc(Math.abs(e%60)),tr=e>=0?"+":"-";switch(t){case"short":return`${tr}${padStart(I,2)}:${padStart(B,2)}`;case"narrow":return`${tr}${I}${B>0?`:${B}`:""}`;case"techie":return`${tr}${padStart(I,2)}${padStart(B,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function timeObject(e){return pick(e,["hour","minute","second","millisecond"])}const monthsLong=["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsNarrow=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return[...monthsNarrow];case"short":return[...monthsShort];case"long":return[...monthsLong];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const weekdaysLong=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysNarrow=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return[...weekdaysNarrow];case"short":return[...weekdaysShort];case"long":return[...weekdaysLong];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const meridiems=["AM","PM"],erasLong=["Before Christ","Anno Domini"],erasShort=["BC","AD"],erasNarrow=["B","A"];function eras(e){switch(e){case"narrow":return[...erasNarrow];case"short":return[...erasShort];case"long":return[...erasLong];default:return null}}function meridiemForDateTime(e){return meridiems[e.hour<12?0:1]}function weekdayForDateTime(e,t){return weekdays(t)[e.weekday-1]}function monthForDateTime(e,t){return months(t)[e.month-1]}function eraForDateTime(e,t){return eras(t)[e.year<0?0:1]}function formatRelativeTime(e,t,I="always",B=!1){const tr={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},rr=["hours","minutes","seconds"].indexOf(e)===-1;if(I==="auto"&&rr){const mr=e==="days";switch(t){case 1:return mr?"tomorrow":`next ${tr[e][0]}`;case-1:return mr?"yesterday":`last ${tr[e][0]}`;case 0:return mr?"today":`this ${tr[e][0]}`}}const ir=Object.is(t,-0)||t<0,lr=Math.abs(t),dr=lr===1,hr=tr[e],fr=B?dr?hr[1]:hr[2]||hr[1]:dr?tr[e][0]:e;return ir?`${lr} ${fr} ago`:`in ${lr} ${fr}`}function stringifyTokens(e,t){let I="";for(const B of e)B.literal?I+=B.val:I+=t(B.val);return I}const macroTokenToFormatOpts={D:DATE_SHORT,DD:DATE_MED,DDD:DATE_FULL,DDDD:DATE_HUGE,t:TIME_SIMPLE,tt:TIME_WITH_SECONDS,ttt:TIME_WITH_SHORT_OFFSET,tttt:TIME_WITH_LONG_OFFSET,T:TIME_24_SIMPLE,TT:TIME_24_WITH_SECONDS,TTT:TIME_24_WITH_SHORT_OFFSET,TTTT:TIME_24_WITH_LONG_OFFSET,f:DATETIME_SHORT,ff:DATETIME_MED,fff:DATETIME_FULL,ffff:DATETIME_HUGE,F:DATETIME_SHORT_WITH_SECONDS,FF:DATETIME_MED_WITH_SECONDS,FFF:DATETIME_FULL_WITH_SECONDS,FFFF:DATETIME_HUGE_WITH_SECONDS};class Formatter{static create(t,I={}){return new Formatter(t,I)}static parseFormat(t){let I=null,B="",tr=!1;const rr=[];for(let ir=0;ir<t.length;ir++){const lr=t.charAt(ir);lr==="'"?(B.length>0&&rr.push({literal:tr||/^\s+$/.test(B),val:B}),I=null,B="",tr=!tr):tr||lr===I?B+=lr:(B.length>0&&rr.push({literal:/^\s+$/.test(B),val:B}),B=lr,I=lr)}return B.length>0&&rr.push({literal:tr||/^\s+$/.test(B),val:B}),rr}static macroTokenToFormatOpts(t){return macroTokenToFormatOpts[t]}constructor(t,I){this.opts=I,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,I){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...I}).format()}dtFormatter(t,I={}){return this.loc.dtFormatter(t,{...this.opts,...I})}formatDateTime(t,I){return this.dtFormatter(t,I).format()}formatDateTimeParts(t,I){return this.dtFormatter(t,I).formatToParts()}formatInterval(t,I){return this.dtFormatter(t.start,I).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,I){return this.dtFormatter(t,I).resolvedOptions()}num(t,I=0){if(this.opts.forceSimple)return padStart(t,I);const B={...this.opts};return I>0&&(B.padTo=I),this.loc.numberFormatter(B).format(t)}formatDateTimeFromString(t,I){const B=this.loc.listingMode()==="en",tr=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",rr=(yr,xr)=>this.loc.extract(t,yr,xr),ir=yr=>t.isOffsetFixed&&t.offset===0&&yr.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,yr.format):"",lr=()=>B?meridiemForDateTime(t):rr({hour:"numeric",hourCycle:"h12"},"dayperiod"),dr=(yr,xr)=>B?monthForDateTime(t,yr):rr(xr?{month:yr}:{month:yr,day:"numeric"},"month"),hr=(yr,xr)=>B?weekdayForDateTime(t,yr):rr(xr?{weekday:yr}:{weekday:yr,month:"long",day:"numeric"},"weekday"),fr=yr=>{const xr=Formatter.macroTokenToFormatOpts(yr);return xr?this.formatWithSystemDefault(t,xr):yr},mr=yr=>B?eraForDateTime(t,yr):rr({era:yr},"era"),_r=yr=>{switch(yr){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return ir({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ir({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ir({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return lr();case"d":return tr?rr({day:"numeric"},"day"):this.num(t.day);case"dd":return tr?rr({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return hr("short",!0);case"cccc":return hr("long",!0);case"ccccc":return hr("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return hr("short",!1);case"EEEE":return hr("long",!1);case"EEEEE":return hr("narrow",!1);case"L":return tr?rr({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return tr?rr({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return dr("short",!0);case"LLLL":return dr("long",!0);case"LLLLL":return dr("narrow",!0);case"M":return tr?rr({month:"numeric"},"month"):this.num(t.month);case"MM":return tr?rr({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return dr("short",!1);case"MMMM":return dr("long",!1);case"MMMMM":return dr("narrow",!1);case"y":return tr?rr({year:"numeric"},"year"):this.num(t.year);case"yy":return tr?rr({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return tr?rr({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return tr?rr({year:"numeric"},"year"):this.num(t.year,6);case"G":return mr("short");case"GG":return mr("long");case"GGGGG":return mr("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return fr(yr)}};return stringifyTokens(Formatter.parseFormat(I),_r)}formatDurationFromString(t,I){const B=dr=>{switch(dr[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},tr=dr=>hr=>{const fr=B(hr);return fr?this.num(dr.get(fr),hr.length):hr},rr=Formatter.parseFormat(I),ir=rr.reduce((dr,{literal:hr,val:fr})=>hr?dr:dr.concat(fr),[]),lr=t.shiftTo(...ir.map(B).filter(dr=>dr));return stringifyTokens(rr,tr(lr))}}const ianaRegex=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function combineRegexes(...e){const t=e.reduce((I,B)=>I+B.source,"");return RegExp(`^${t}$`)}function combineExtractors(...e){return t=>e.reduce(([I,B,tr],rr)=>{const[ir,lr,dr]=rr(t,tr);return[{...I,...ir},lr||B,dr]},[{},null,1]).slice(0,2)}function parse(e,...t){if(e==null)return[null,null];for(const[I,B]of t){const tr=I.exec(e);if(tr)return B(tr)}return[null,null]}function simpleParse(...e){return(t,I)=>{const B={};let tr;for(tr=0;tr<e.length;tr++)B[e[tr]]=parseInteger(t[I+tr]);return[B,null,I+tr]}}const offsetRegex=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,isoExtendedZone=`(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`,isoTimeBaseRegex=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,isoTimeRegex=RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`),isoTimeExtensionRegex=RegExp(`(?:T${isoTimeRegex.source})?`),isoYmdRegex=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,isoWeekRegex=/(\d{4})-?W(\d\d)(?:-?(\d))?/,isoOrdinalRegex=/(\d{4})-?(\d{3})/,extractISOWeekData=simpleParse("weekYear","weekNumber","weekDay"),extractISOOrdinalData=simpleParse("year","ordinal"),sqlYmdRegex=/(\d{4})-(\d\d)-(\d\d)/,sqlTimeRegex=RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`),sqlTimeExtensionRegex=RegExp(`(?: ${sqlTimeRegex.source})?`);function int(e,t,I){const B=e[t];return isUndefined$1(B)?I:parseInteger(B)}function extractISOYmd(e,t){return[{year:int(e,t),month:int(e,t+1,1),day:int(e,t+2,1)},null,t+3]}function extractISOTime(e,t){return[{hours:int(e,t,0),minutes:int(e,t+1,0),seconds:int(e,t+2,0),milliseconds:parseMillis(e[t+3])},null,t+4]}function extractISOOffset(e,t){const I=!e[t]&&!e[t+1],B=signedOffset(e[t+1],e[t+2]),tr=I?null:FixedOffsetZone.instance(B);return[{},tr,t+3]}function extractIANAZone(e,t){const I=e[t]?IANAZone.create(e[t]):null;return[{},I,t+1]}const isoTimeOnly=RegExp(`^T?${isoTimeBaseRegex.source}$`),isoDuration=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function extractISODuration(e){const[t,I,B,tr,rr,ir,lr,dr,hr]=e,fr=t[0]==="-",mr=dr&&dr[0]==="-",_r=(yr,xr=!1)=>yr!==void 0&&(xr||yr&&fr)?-yr:yr;return[{years:_r(parseFloating(I)),months:_r(parseFloating(B)),weeks:_r(parseFloating(tr)),days:_r(parseFloating(rr)),hours:_r(parseFloating(ir)),minutes:_r(parseFloating(lr)),seconds:_r(parseFloating(dr),dr==="-0"),milliseconds:_r(parseMillis(hr),mr)}]}const obsOffsets={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fromStrings(e,t,I,B,tr,rr,ir){const lr={year:t.length===2?untruncateYear(parseInteger(t)):parseInteger(t),month:monthsShort.indexOf(I)+1,day:parseInteger(B),hour:parseInteger(tr),minute:parseInteger(rr)};return ir&&(lr.second=parseInteger(ir)),e&&(lr.weekday=e.length>3?weekdaysLong.indexOf(e)+1:weekdaysShort.indexOf(e)+1),lr}const rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(e){const[,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr]=e,_r=fromStrings(t,tr,B,I,rr,ir,lr);let yr;return dr?yr=obsOffsets[dr]:hr?yr=0:yr=signedOffset(fr,mr),[_r,new FixedOffsetZone(yr)]}function preprocessRFC2822(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const rfc1123=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rfc850=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ascii=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(e){const[,t,I,B,tr,rr,ir,lr]=e;return[fromStrings(t,tr,B,I,rr,ir,lr),FixedOffsetZone.utcInstance]}function extractASCII(e){const[,t,I,B,tr,rr,ir,lr]=e;return[fromStrings(t,lr,I,B,tr,rr,ir),FixedOffsetZone.utcInstance]}const isoYmdWithTimeExtensionRegex=combineRegexes(isoYmdRegex,isoTimeExtensionRegex),isoWeekWithTimeExtensionRegex=combineRegexes(isoWeekRegex,isoTimeExtensionRegex),isoOrdinalWithTimeExtensionRegex=combineRegexes(isoOrdinalRegex,isoTimeExtensionRegex),isoTimeCombinedRegex=combineRegexes(isoTimeRegex),extractISOYmdTimeAndOffset=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),extractISOWeekTimeAndOffset=combineExtractors(extractISOWeekData,extractISOTime,extractISOOffset,extractIANAZone),extractISOOrdinalDateAndTime=combineExtractors(extractISOOrdinalData,extractISOTime,extractISOOffset,extractIANAZone),extractISOTimeAndOffset=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseISODate(e){return parse(e,[isoYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[isoWeekWithTimeExtensionRegex,extractISOWeekTimeAndOffset],[isoOrdinalWithTimeExtensionRegex,extractISOOrdinalDateAndTime],[isoTimeCombinedRegex,extractISOTimeAndOffset])}function parseRFC2822Date(e){return parse(preprocessRFC2822(e),[rfc2822,extractRFC2822])}function parseHTTPDate(e){return parse(e,[rfc1123,extractRFC1123Or850],[rfc850,extractRFC1123Or850],[ascii,extractASCII])}function parseISODuration(e){return parse(e,[isoDuration,extractISODuration])}const extractISOTimeOnly=combineExtractors(extractISOTime);function parseISOTimeOnly(e){return parse(e,[isoTimeOnly,extractISOTimeOnly])}const sqlYmdWithTimeExtensionRegex=combineRegexes(sqlYmdRegex,sqlTimeExtensionRegex),sqlTimeCombinedRegex=combineRegexes(sqlTimeRegex),extractISOTimeOffsetAndIANAZone=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(e){return parse(e,[sqlYmdWithTimeExtensionRegex,extractISOYmdTimeAndOffset],[sqlTimeCombinedRegex,extractISOTimeOffsetAndIANAZone])}const INVALID$2="Invalid Duration",lowOrderMatrix={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},casualMatrix={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...lowOrderMatrix},daysInYearAccurate=146097/400,daysInMonthAccurate=146097/4800,accurateMatrix={years:{quarters:4,months:12,weeks:daysInYearAccurate/7,days:daysInYearAccurate,hours:daysInYearAccurate*24,minutes:daysInYearAccurate*24*60,seconds:daysInYearAccurate*24*60*60,milliseconds:daysInYearAccurate*24*60*60*1e3},quarters:{months:3,weeks:daysInYearAccurate/28,days:daysInYearAccurate/4,hours:daysInYearAccurate*24/4,minutes:daysInYearAccurate*24*60/4,seconds:daysInYearAccurate*24*60*60/4,milliseconds:daysInYearAccurate*24*60*60*1e3/4},months:{weeks:daysInMonthAccurate/7,days:daysInMonthAccurate,hours:daysInMonthAccurate*24,minutes:daysInMonthAccurate*24*60,seconds:daysInMonthAccurate*24*60*60,milliseconds:daysInMonthAccurate*24*60*60*1e3},...lowOrderMatrix},orderedUnits$1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],reverseUnits=orderedUnits$1.slice(0).reverse();function clone$1(e,t,I=!1){const B={values:I?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Duration(B)}function durationToMillis(e,t){let I=t.milliseconds??0;for(const B of reverseUnits.slice(1))t[B]&&(I+=t[B]*e[B].milliseconds);return I}function normalizeValues(e,t){const I=durationToMillis(e,t)<0?-1:1;orderedUnits$1.reduceRight((B,tr)=>{if(isUndefined$1(t[tr]))return B;if(B){const rr=t[B]*I,ir=e[tr][B],lr=Math.floor(rr/ir);t[tr]+=lr*I,t[B]-=lr*ir*I}return tr},null),orderedUnits$1.reduce((B,tr)=>{if(isUndefined$1(t[tr]))return B;if(B){const rr=t[B]%1;t[B]-=rr,t[tr]+=rr*e[B][tr]}return tr},null)}function removeZeroes(e){const t={};for(const[I,B]of Object.entries(e))B!==0&&(t[I]=B);return t}class Duration{constructor(t){const I=t.conversionAccuracy==="longterm"||!1;let B=I?accurateMatrix:casualMatrix;t.matrix&&(B=t.matrix),this.values=t.values,this.loc=t.loc||Locale.create(),this.conversionAccuracy=I?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=B,this.isLuxonDuration=!0}static fromMillis(t,I){return Duration.fromObject({milliseconds:t},I)}static fromObject(t,I={}){if(t==null||typeof t!="object")throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Duration({values:normalizeObject(t,Duration.normalizeUnit),loc:Locale.fromObject(I),conversionAccuracy:I.conversionAccuracy,matrix:I.matrix})}static fromDurationLike(t){if(isNumber$1(t))return Duration.fromMillis(t);if(Duration.isDuration(t))return t;if(typeof t=="object")return Duration.fromObject(t);throw new InvalidArgumentError(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,I){const[B]=parseISODuration(t);return B?Duration.fromObject(B,I):Duration.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,I){const[B]=parseISOTimeOnly(t);return B?Duration.fromObject(B,I):Duration.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,I=null){if(!t)throw new InvalidArgumentError("need to specify a reason the Duration is invalid");const B=t instanceof Invalid?t:new Invalid(t,I);if(Settings.throwOnInvalid)throw new InvalidDurationError(B);return new Duration({invalid:B})}static normalizeUnit(t){const I={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!I)throw new InvalidUnitError(t);return I}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,I={}){const B={...I,floor:I.round!==!1&&I.floor!==!1};return this.isValid?Formatter.create(this.loc,B).formatDurationFromString(this,t):INVALID$2}toHuman(t={}){if(!this.isValid)return INVALID$2;const I=orderedUnits$1.map(B=>{const tr=this.values[B];return isUndefined$1(tr)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:B.slice(0,-1)}).format(tr)}).filter(B=>B);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(I)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const I=this.toMillis();return I<0||I>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},DateTime.fromMillis(I,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?durationToMillis(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const I=Duration.fromDurationLike(t),B={};for(const tr of orderedUnits$1)(hasOwnProperty(I.values,tr)||hasOwnProperty(this.values,tr))&&(B[tr]=I.get(tr)+this.get(tr));return clone$1(this,{values:B},!0)}minus(t){if(!this.isValid)return this;const I=Duration.fromDurationLike(t);return this.plus(I.negate())}mapUnits(t){if(!this.isValid)return this;const I={};for(const B of Object.keys(this.values))I[B]=asNumber(t(this.values[B],B));return clone$1(this,{values:I},!0)}get(t){return this[Duration.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const I={...this.values,...normalizeObject(t,Duration.normalizeUnit)};return clone$1(this,{values:I})}reconfigure({locale:t,numberingSystem:I,conversionAccuracy:B,matrix:tr}={}){const ir={loc:this.loc.clone({locale:t,numberingSystem:I}),matrix:tr,conversionAccuracy:B};return clone$1(this,ir)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return normalizeValues(this.matrix,t),clone$1(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=removeZeroes(this.normalize().shiftToAll().toObject());return clone$1(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(ir=>Duration.normalizeUnit(ir));const I={},B={},tr=this.toObject();let rr;for(const ir of orderedUnits$1)if(t.indexOf(ir)>=0){rr=ir;let lr=0;for(const hr in B)lr+=this.matrix[hr][ir]*B[hr],B[hr]=0;isNumber$1(tr[ir])&&(lr+=tr[ir]);const dr=Math.trunc(lr);I[ir]=dr,B[ir]=(lr*1e3-dr*1e3)/1e3}else isNumber$1(tr[ir])&&(B[ir]=tr[ir]);for(const ir in B)B[ir]!==0&&(I[rr]+=ir===rr?B[ir]:B[ir]/this.matrix[rr][ir]);return normalizeValues(this.matrix,I),clone$1(this,{values:I},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const I of Object.keys(this.values))t[I]=this.values[I]===0?0:-this.values[I];return clone$1(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function I(B,tr){return B===void 0||B===0?tr===void 0||tr===0:B===tr}for(const B of orderedUnits$1)if(!I(this.values[B],t.values[B]))return!1;return!0}}const INVALID$1="Invalid Interval";function validateStartEnd(e,t){return!e||!e.isValid?Interval.invalid("missing or invalid start"):!t||!t.isValid?Interval.invalid("missing or invalid end"):t<e?Interval.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Interval{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,I=null){if(!t)throw new InvalidArgumentError("need to specify a reason the Interval is invalid");const B=t instanceof Invalid?t:new Invalid(t,I);if(Settings.throwOnInvalid)throw new InvalidIntervalError(B);return new Interval({invalid:B})}static fromDateTimes(t,I){const B=friendlyDateTime(t),tr=friendlyDateTime(I),rr=validateStartEnd(B,tr);return rr??new Interval({start:B,end:tr})}static after(t,I){const B=Duration.fromDurationLike(I),tr=friendlyDateTime(t);return Interval.fromDateTimes(tr,tr.plus(B))}static before(t,I){const B=Duration.fromDurationLike(I),tr=friendlyDateTime(t);return Interval.fromDateTimes(tr.minus(B),tr)}static fromISO(t,I){const[B,tr]=(t||"").split("/",2);if(B&&tr){let rr,ir;try{rr=DateTime.fromISO(B,I),ir=rr.isValid}catch{ir=!1}let lr,dr;try{lr=DateTime.fromISO(tr,I),dr=lr.isValid}catch{dr=!1}if(ir&&dr)return Interval.fromDateTimes(rr,lr);if(ir){const hr=Duration.fromISO(tr,I);if(hr.isValid)return Interval.after(rr,hr)}else if(dr){const hr=Duration.fromISO(B,I);if(hr.isValid)return Interval.before(lr,hr)}}return Interval.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",I){if(!this.isValid)return NaN;const B=this.start.startOf(t,I);let tr;return I!=null&&I.useLocaleWeeks?tr=this.end.reconfigure({locale:B.locale}):tr=this.end,tr=tr.startOf(t,I),Math.floor(tr.diff(B,t).get(t))+(tr.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:I}={}){return this.isValid?Interval.fromDateTimes(t||this.s,I||this.e):this}splitAt(...t){if(!this.isValid)return[];const I=t.map(friendlyDateTime).filter(ir=>this.contains(ir)).sort((ir,lr)=>ir.toMillis()-lr.toMillis()),B=[];let{s:tr}=this,rr=0;for(;tr<this.e;){const ir=I[rr]||this.e,lr=+ir>+this.e?this.e:ir;B.push(Interval.fromDateTimes(tr,lr)),tr=lr,rr+=1}return B}splitBy(t){const I=Duration.fromDurationLike(t);if(!this.isValid||!I.isValid||I.as("milliseconds")===0)return[];let{s:B}=this,tr=1,rr;const ir=[];for(;B<this.e;){const lr=this.start.plus(I.mapUnits(dr=>dr*tr));rr=+lr>+this.e?this.e:lr,ir.push(Interval.fromDateTimes(B,rr)),B=rr,tr+=1}return ir}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const I=this.s>t.s?this.s:t.s,B=this.e<t.e?this.e:t.e;return I>=B?null:Interval.fromDateTimes(I,B)}union(t){if(!this.isValid)return this;const I=this.s<t.s?this.s:t.s,B=this.e>t.e?this.e:t.e;return Interval.fromDateTimes(I,B)}static merge(t){const[I,B]=t.sort((tr,rr)=>tr.s-rr.s).reduce(([tr,rr],ir)=>rr?rr.overlaps(ir)||rr.abutsStart(ir)?[tr,rr.union(ir)]:[tr.concat([rr]),ir]:[tr,ir],[[],null]);return B&&I.push(B),I}static xor(t){let I=null,B=0;const tr=[],rr=t.map(dr=>[{time:dr.s,type:"s"},{time:dr.e,type:"e"}]),ir=Array.prototype.concat(...rr),lr=ir.sort((dr,hr)=>dr.time-hr.time);for(const dr of lr)B+=dr.type==="s"?1:-1,B===1?I=dr.time:(I&&+I!=+dr.time&&tr.push(Interval.fromDateTimes(I,dr.time)),I=null);return Interval.merge(tr)}difference(...t){return Interval.xor([this].concat(t)).map(I=>this.intersection(I)).filter(I=>I&&!I.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:INVALID$1}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=DATE_SHORT,I={}){return this.isValid?Formatter.create(this.s.loc.clone(I),t).formatInterval(this):INVALID$1}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:INVALID$1}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:INVALID$1}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:INVALID$1}toFormat(t,{separator:I=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${I}${this.e.toFormat(t)}`:INVALID$1}toDuration(t,I){return this.isValid?this.e.diff(this.s,t,I):Duration.invalid(this.invalidReason)}mapEndpoints(t){return Interval.fromDateTimes(t(this.s),t(this.e))}}class Info{static hasDST(t=Settings.defaultZone){const I=DateTime.now().setZone(t).set({month:12});return!t.isUniversal&&I.offset!==I.set({month:6}).offset}static isValidIANAZone(t){return IANAZone.isValidZone(t)}static normalizeZone(t){return normalizeZone(t,Settings.defaultZone)}static getStartOfWeek({locale:t=null,locObj:I=null}={}){return(I||Locale.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:I=null}={}){return(I||Locale.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:I=null}={}){return(I||Locale.create(t)).getWeekendDays().slice()}static months(t="long",{locale:I=null,numberingSystem:B=null,locObj:tr=null,outputCalendar:rr="gregory"}={}){return(tr||Locale.create(I,B,rr)).months(t)}static monthsFormat(t="long",{locale:I=null,numberingSystem:B=null,locObj:tr=null,outputCalendar:rr="gregory"}={}){return(tr||Locale.create(I,B,rr)).months(t,!0)}static weekdays(t="long",{locale:I=null,numberingSystem:B=null,locObj:tr=null}={}){return(tr||Locale.create(I,B,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:I=null,numberingSystem:B=null,locObj:tr=null}={}){return(tr||Locale.create(I,B,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Locale.create(t).meridiems()}static eras(t="short",{locale:I=null}={}){return Locale.create(I,null,"gregory").eras(t)}static features(){return{relative:hasRelative(),localeWeek:hasLocaleWeekInfo()}}}function dayDiff(e,t){const I=tr=>tr.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),B=I(t)-I(e);return Math.floor(Duration.fromMillis(B).as("days"))}function highOrderDiffs(e,t,I){const B=[["years",(dr,hr)=>hr.year-dr.year],["quarters",(dr,hr)=>hr.quarter-dr.quarter+(hr.year-dr.year)*4],["months",(dr,hr)=>hr.month-dr.month+(hr.year-dr.year)*12],["weeks",(dr,hr)=>{const fr=dayDiff(dr,hr);return(fr-fr%7)/7}],["days",dayDiff]],tr={},rr=e;let ir,lr;for(const[dr,hr]of B)I.indexOf(dr)>=0&&(ir=dr,tr[dr]=hr(e,t),lr=rr.plus(tr),lr>t?(tr[dr]--,e=rr.plus(tr),e>t&&(lr=e,tr[dr]--,e=rr.plus(tr))):e=lr);return[e,tr,lr,ir]}function diff(e,t,I,B){let[tr,rr,ir,lr]=highOrderDiffs(e,t,I);const dr=t-tr,hr=I.filter(mr=>["hours","minutes","seconds","milliseconds"].indexOf(mr)>=0);hr.length===0&&(ir<t&&(ir=tr.plus({[lr]:1})),ir!==tr&&(rr[lr]=(rr[lr]||0)+dr/(ir-tr)));const fr=Duration.fromObject(rr,B);return hr.length>0?Duration.fromMillis(dr,B).shiftTo(...hr).plus(fr):fr}const MISSING_FTP="missing Intl.DateTimeFormat.formatToParts support";function intUnit(e,t=I=>I){return{regex:e,deser:([I])=>t(parseDigits(I))}}const NBSP=" ",spaceOrNBSP=`[ ${NBSP}]`,spaceOrNBSPRegExp=new RegExp(spaceOrNBSP,"g");function fixListRegex(e){return e.replace(/\./g,"\\.?").replace(spaceOrNBSPRegExp,spaceOrNBSP)}function stripInsensitivities(e){return e.replace(/\./g,"").replace(spaceOrNBSPRegExp," ").toLowerCase()}function oneOf(e,t){return e===null?null:{regex:RegExp(e.map(fixListRegex).join("|")),deser:([I])=>e.findIndex(B=>stripInsensitivities(I)===stripInsensitivities(B))+t}}function offset(e,t){return{regex:e,deser:([,I,B])=>signedOffset(I,B),groups:t}}function simple(e){return{regex:e,deser:([t])=>t}}function escapeToken(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function unitForToken(e,t){const I=digitRegex(t),B=digitRegex(t,"{2}"),tr=digitRegex(t,"{3}"),rr=digitRegex(t,"{4}"),ir=digitRegex(t,"{6}"),lr=digitRegex(t,"{1,2}"),dr=digitRegex(t,"{1,3}"),hr=digitRegex(t,"{1,6}"),fr=digitRegex(t,"{1,9}"),mr=digitRegex(t,"{2,4}"),_r=digitRegex(t,"{4,6}"),yr=vr=>({regex:RegExp(escapeToken(vr.val)),deser:([Sr])=>Sr,literal:!0}),Mr=(vr=>{if(e.literal)return yr(vr);switch(vr.val){case"G":return oneOf(t.eras("short"),0);case"GG":return oneOf(t.eras("long"),0);case"y":return intUnit(hr);case"yy":return intUnit(mr,untruncateYear);case"yyyy":return intUnit(rr);case"yyyyy":return intUnit(_r);case"yyyyyy":return intUnit(ir);case"M":return intUnit(lr);case"MM":return intUnit(B);case"MMM":return oneOf(t.months("short",!0),1);case"MMMM":return oneOf(t.months("long",!0),1);case"L":return intUnit(lr);case"LL":return intUnit(B);case"LLL":return oneOf(t.months("short",!1),1);case"LLLL":return oneOf(t.months("long",!1),1);case"d":return intUnit(lr);case"dd":return intUnit(B);case"o":return intUnit(dr);case"ooo":return intUnit(tr);case"HH":return intUnit(B);case"H":return intUnit(lr);case"hh":return intUnit(B);case"h":return intUnit(lr);case"mm":return intUnit(B);case"m":return intUnit(lr);case"q":return intUnit(lr);case"qq":return intUnit(B);case"s":return intUnit(lr);case"ss":return intUnit(B);case"S":return intUnit(dr);case"SSS":return intUnit(tr);case"u":return simple(fr);case"uu":return simple(lr);case"uuu":return intUnit(I);case"a":return oneOf(t.meridiems(),0);case"kkkk":return intUnit(rr);case"kk":return intUnit(mr,untruncateYear);case"W":return intUnit(lr);case"WW":return intUnit(B);case"E":case"c":return intUnit(I);case"EEE":return oneOf(t.weekdays("short",!1),1);case"EEEE":return oneOf(t.weekdays("long",!1),1);case"ccc":return oneOf(t.weekdays("short",!0),1);case"cccc":return oneOf(t.weekdays("long",!0),1);case"Z":case"ZZ":return offset(new RegExp(`([+-]${lr.source})(?::(${B.source}))?`),2);case"ZZZ":return offset(new RegExp(`([+-]${lr.source})(${B.source})?`),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);case" ":return simple(/[^\S\n\r]/);default:return yr(vr)}})(e)||{invalidReason:MISSING_FTP};return Mr.token=e,Mr}const partTypeStyleToTokenVal={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function tokenForPart(e,t,I){const{type:B,value:tr}=e;if(B==="literal"){const dr=/^\s+$/.test(tr);return{literal:!dr,val:dr?" ":tr}}const rr=t[B];let ir=B;B==="hour"&&(t.hour12!=null?ir=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?ir="hour12":ir="hour24":ir=I.hour12?"hour12":"hour24");let lr=partTypeStyleToTokenVal[ir];if(typeof lr=="object"&&(lr=lr[rr]),lr)return{literal:!1,val:lr}}function buildRegex(e){return[`^${e.map(I=>I.regex).reduce((I,B)=>`${I}(${B.source})`,"")}$`,e]}function match(e,t,I){const B=e.match(t);if(B){const tr={};let rr=1;for(const ir in I)if(hasOwnProperty(I,ir)){const lr=I[ir],dr=lr.groups?lr.groups+1:1;!lr.literal&&lr.token&&(tr[lr.token.val[0]]=lr.deser(B.slice(rr,rr+dr))),rr+=dr}return[B,tr]}else return[B,{}]}function dateTimeFromMatches(e){const t=rr=>{switch(rr){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let I=null,B;return isUndefined$1(e.z)||(I=IANAZone.create(e.z)),isUndefined$1(e.Z)||(I||(I=new FixedOffsetZone(e.Z)),B=e.Z),isUndefined$1(e.q)||(e.M=(e.q-1)*3+1),isUndefined$1(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),isUndefined$1(e.u)||(e.S=parseMillis(e.u)),[Object.keys(e).reduce((rr,ir)=>{const lr=t(ir);return lr&&(rr[lr]=e[ir]),rr},{}),I,B]}let dummyDateTimeCache=null;function getDummyDateTime(){return dummyDateTimeCache||(dummyDateTimeCache=DateTime.fromMillis(1555555555555)),dummyDateTimeCache}function maybeExpandMacroToken(e,t){if(e.literal)return e;const I=Formatter.macroTokenToFormatOpts(e.val),B=formatOptsToTokens(I,t);return B==null||B.includes(void 0)?e:B}function expandMacroTokens(e,t){return Array.prototype.concat(...e.map(I=>maybeExpandMacroToken(I,t)))}class TokenParser{constructor(t,I){if(this.locale=t,this.format=I,this.tokens=expandMacroTokens(Formatter.parseFormat(I),t),this.units=this.tokens.map(B=>unitForToken(B,t)),this.disqualifyingUnit=this.units.find(B=>B.invalidReason),!this.disqualifyingUnit){const[B,tr]=buildRegex(this.units);this.regex=RegExp(B,"i"),this.handlers=tr}}explainFromTokens(t){if(this.isValid){const[I,B]=match(t,this.regex,this.handlers),[tr,rr,ir]=B?dateTimeFromMatches(B):[null,null,void 0];if(hasOwnProperty(B,"a")&&hasOwnProperty(B,"H"))throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:I,matches:B,result:tr,zone:rr,specificOffset:ir}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function explainFromTokens(e,t,I){return new TokenParser(e,I).explainFromTokens(t)}function parseFromTokens(e,t,I){const{result:B,zone:tr,specificOffset:rr,invalidReason:ir}=explainFromTokens(e,t,I);return[B,tr,rr,ir]}function formatOptsToTokens(e,t){if(!e)return null;const B=Formatter.create(t,e).dtFormatter(getDummyDateTime()),tr=B.formatToParts(),rr=B.resolvedOptions();return tr.map(ir=>tokenForPart(ir,e,rr))}const INVALID="Invalid DateTime",MAX_DATE=864e13;function unsupportedZone(e){return new Invalid("unsupported zone",`the zone "${e.name}" is not supported`)}function possiblyCachedWeekData(e){return e.weekData===null&&(e.weekData=gregorianToWeek(e.c)),e.weekData}function possiblyCachedLocalWeekData(e){return e.localWeekData===null&&(e.localWeekData=gregorianToWeek(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function clone(e,t){const I={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new DateTime({...I,...t,old:I})}function fixOffset(e,t,I){let B=e-t*60*1e3;const tr=I.offset(B);if(t===tr)return[B,t];B-=(tr-t)*60*1e3;const rr=I.offset(B);return tr===rr?[B,tr]:[e-Math.min(tr,rr)*60*1e3,Math.max(tr,rr)]}function tsToObj(e,t){e+=t*60*1e3;const I=new Date(e);return{year:I.getUTCFullYear(),month:I.getUTCMonth()+1,day:I.getUTCDate(),hour:I.getUTCHours(),minute:I.getUTCMinutes(),second:I.getUTCSeconds(),millisecond:I.getUTCMilliseconds()}}function objToTS(e,t,I){return fixOffset(objToLocalTS(e),t,I)}function adjustTime(e,t){const I=e.o,B=e.c.year+Math.trunc(t.years),tr=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,rr={...e.c,year:B,month:tr,day:Math.min(e.c.day,daysInMonth(B,tr))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},ir=Duration.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),lr=objToLocalTS(rr);let[dr,hr]=fixOffset(lr,I,e.zone);return ir!==0&&(dr+=ir,hr=e.zone.offset(dr)),{ts:dr,o:hr}}function parseDataToDateTime(e,t,I,B,tr,rr){const{setZone:ir,zone:lr}=I;if(e&&Object.keys(e).length!==0||t){const dr=t||lr,hr=DateTime.fromObject(e,{...I,zone:dr,specificOffset:rr});return ir?hr:hr.setZone(lr)}else return DateTime.invalid(new Invalid("unparsable",`the input "${tr}" can't be parsed as ${B}`))}function toTechFormat(e,t,I=!0){return e.isValid?Formatter.create(Locale.create("en-US"),{allowZ:I,forceSimple:!0}).formatDateTimeFromString(e,t):null}function toISODate(e,t){const I=e.c.year>9999||e.c.year<0;let B="";return I&&e.c.year>=0&&(B+="+"),B+=padStart(e.c.year,I?6:4),t?(B+="-",B+=padStart(e.c.month),B+="-",B+=padStart(e.c.day)):(B+=padStart(e.c.month),B+=padStart(e.c.day)),B}function toISOTime(e,t,I,B,tr,rr){let ir=padStart(e.c.hour);return t?(ir+=":",ir+=padStart(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!I)&&(ir+=":")):ir+=padStart(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!I)&&(ir+=padStart(e.c.second),(e.c.millisecond!==0||!B)&&(ir+=".",ir+=padStart(e.c.millisecond,3))),tr&&(e.isOffsetFixed&&e.offset===0&&!rr?ir+="Z":e.o<0?(ir+="-",ir+=padStart(Math.trunc(-e.o/60)),ir+=":",ir+=padStart(Math.trunc(-e.o%60))):(ir+="+",ir+=padStart(Math.trunc(e.o/60)),ir+=":",ir+=padStart(Math.trunc(e.o%60)))),rr&&(ir+="["+e.zone.ianaName+"]"),ir}const defaultUnitValues={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},defaultWeekUnitValues={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},defaultOrdinalUnitValues={ordinal:1,hour:0,minute:0,second:0,millisecond:0},orderedUnits=["year","month","day","hour","minute","second","millisecond"],orderedWeekUnits=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],orderedOrdinalUnits=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new InvalidUnitError(e);return t}function normalizeUnitWithLocalWeeks(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return normalizeUnit(e)}}function guessOffsetForZone(e){if(zoneOffsetTs===void 0&&(zoneOffsetTs=Settings.now()),e.type!=="iana")return e.offset(zoneOffsetTs);const t=e.name;let I=zoneOffsetGuessCache.get(t);return I===void 0&&(I=e.offset(zoneOffsetTs),zoneOffsetGuessCache.set(t,I)),I}function quickDT(e,t){const I=normalizeZone(t.zone,Settings.defaultZone);if(!I.isValid)return DateTime.invalid(unsupportedZone(I));const B=Locale.fromObject(t);let tr,rr;if(isUndefined$1(e.year))tr=Settings.now();else{for(const dr of orderedUnits)isUndefined$1(e[dr])&&(e[dr]=defaultUnitValues[dr]);const ir=hasInvalidGregorianData(e)||hasInvalidTimeData(e);if(ir)return DateTime.invalid(ir);const lr=guessOffsetForZone(I);[tr,rr]=objToTS(e,lr,I)}return new DateTime({ts:tr,zone:I,loc:B,o:rr})}function diffRelative(e,t,I){const B=isUndefined$1(I.round)?!0:I.round,tr=(ir,lr)=>(ir=roundTo(ir,B||I.calendary?0:2,!0),t.loc.clone(I).relFormatter(I).format(ir,lr)),rr=ir=>I.calendary?t.hasSame(e,ir)?0:t.startOf(ir).diff(e.startOf(ir),ir).get(ir):t.diff(e,ir).get(ir);if(I.unit)return tr(rr(I.unit),I.unit);for(const ir of I.units){const lr=rr(ir);if(Math.abs(lr)>=1)return tr(lr,ir)}return tr(e>t?-0:0,I.units[I.units.length-1])}function lastOpts(e){let t={},I;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],I=Array.from(e).slice(0,e.length-1)):I=Array.from(e),[t,I]}let zoneOffsetTs;const zoneOffsetGuessCache=new Map;class DateTime{constructor(t){const I=t.zone||Settings.defaultZone;let B=t.invalid||(Number.isNaN(t.ts)?new Invalid("invalid input"):null)||(I.isValid?null:unsupportedZone(I));this.ts=isUndefined$1(t.ts)?Settings.now():t.ts;let tr=null,rr=null;if(!B)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(I))[tr,rr]=[t.old.c,t.old.o];else{const lr=isNumber$1(t.o)&&!t.old?t.o:I.offset(this.ts);tr=tsToObj(this.ts,lr),B=Number.isNaN(tr.year)?new Invalid("invalid input"):null,tr=B?null:tr,rr=B?null:lr}this._zone=I,this.loc=t.loc||Locale.create(),this.invalid=B,this.weekData=null,this.localWeekData=null,this.c=tr,this.o=rr,this.isLuxonDateTime=!0}static now(){return new DateTime({})}static local(){const[t,I]=lastOpts(arguments),[B,tr,rr,ir,lr,dr,hr]=I;return quickDT({year:B,month:tr,day:rr,hour:ir,minute:lr,second:dr,millisecond:hr},t)}static utc(){const[t,I]=lastOpts(arguments),[B,tr,rr,ir,lr,dr,hr]=I;return t.zone=FixedOffsetZone.utcInstance,quickDT({year:B,month:tr,day:rr,hour:ir,minute:lr,second:dr,millisecond:hr},t)}static fromJSDate(t,I={}){const B=isDate$1(t)?t.valueOf():NaN;if(Number.isNaN(B))return DateTime.invalid("invalid input");const tr=normalizeZone(I.zone,Settings.defaultZone);return tr.isValid?new DateTime({ts:B,zone:tr,loc:Locale.fromObject(I)}):DateTime.invalid(unsupportedZone(tr))}static fromMillis(t,I={}){if(isNumber$1(t))return t<-MAX_DATE||t>MAX_DATE?DateTime.invalid("Timestamp out of range"):new DateTime({ts:t,zone:normalizeZone(I.zone,Settings.defaultZone),loc:Locale.fromObject(I)});throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,I={}){if(isNumber$1(t))return new DateTime({ts:t*1e3,zone:normalizeZone(I.zone,Settings.defaultZone),loc:Locale.fromObject(I)});throw new InvalidArgumentError("fromSeconds requires a numerical input")}static fromObject(t,I={}){t=t||{};const B=normalizeZone(I.zone,Settings.defaultZone);if(!B.isValid)return DateTime.invalid(unsupportedZone(B));const tr=Locale.fromObject(I),rr=normalizeObject(t,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:ir,startOfWeek:lr}=usesLocalWeekValues(rr,tr),dr=Settings.now(),hr=isUndefined$1(I.specificOffset)?B.offset(dr):I.specificOffset,fr=!isUndefined$1(rr.ordinal),mr=!isUndefined$1(rr.year),_r=!isUndefined$1(rr.month)||!isUndefined$1(rr.day),yr=mr||_r,xr=rr.weekYear||rr.weekNumber;if((yr||fr)&&xr)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_r&&fr)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");const Mr=xr||rr.weekday&&!yr;let vr,Sr,wr=tsToObj(dr,hr);Mr?(vr=orderedWeekUnits,Sr=defaultWeekUnitValues,wr=gregorianToWeek(wr,ir,lr)):fr?(vr=orderedOrdinalUnits,Sr=defaultOrdinalUnitValues,wr=gregorianToOrdinal(wr)):(vr=orderedUnits,Sr=defaultUnitValues);let br=!1;for(const Fr of vr){const $r=rr[Fr];isUndefined$1($r)?br?rr[Fr]=Sr[Fr]:rr[Fr]=wr[Fr]:br=!0}const Ar=Mr?hasInvalidWeekData(rr,ir,lr):fr?hasInvalidOrdinalData(rr):hasInvalidGregorianData(rr),kr=Ar||hasInvalidTimeData(rr);if(kr)return DateTime.invalid(kr);const Dr=Mr?weekToGregorian(rr,ir,lr):fr?ordinalToGregorian(rr):rr,[Or,zr]=objToTS(Dr,hr,B),$n=new DateTime({ts:Or,zone:B,o:zr,loc:tr});return rr.weekday&&yr&&t.weekday!==$n.weekday?DateTime.invalid("mismatched weekday",`you can't specify both a weekday of ${rr.weekday} and a date of ${$n.toISO()}`):$n.isValid?$n:DateTime.invalid($n.invalid)}static fromISO(t,I={}){const[B,tr]=parseISODate(t);return parseDataToDateTime(B,tr,I,"ISO 8601",t)}static fromRFC2822(t,I={}){const[B,tr]=parseRFC2822Date(t);return parseDataToDateTime(B,tr,I,"RFC 2822",t)}static fromHTTP(t,I={}){const[B,tr]=parseHTTPDate(t);return parseDataToDateTime(B,tr,I,"HTTP",I)}static fromFormat(t,I,B={}){if(isUndefined$1(t)||isUndefined$1(I))throw new InvalidArgumentError("fromFormat requires an input string and a format");const{locale:tr=null,numberingSystem:rr=null}=B,ir=Locale.fromOpts({locale:tr,numberingSystem:rr,defaultToEN:!0}),[lr,dr,hr,fr]=parseFromTokens(ir,t,I);return fr?DateTime.invalid(fr):parseDataToDateTime(lr,dr,B,`format ${I}`,t,hr)}static fromString(t,I,B={}){return DateTime.fromFormat(t,I,B)}static fromSQL(t,I={}){const[B,tr]=parseSQL(t);return parseDataToDateTime(B,tr,I,"SQL",t)}static invalid(t,I=null){if(!t)throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");const B=t instanceof Invalid?t:new Invalid(t,I);if(Settings.throwOnInvalid)throw new InvalidDateTimeError(B);return new DateTime({invalid:B})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,I={}){const B=formatOptsToTokens(t,Locale.fromObject(I));return B?B.map(tr=>tr?tr.val:null).join(""):null}static expandFormat(t,I={}){return expandMacroTokens(Formatter.parseFormat(t),Locale.fromObject(I)).map(tr=>tr.val).join("")}static resetCache(){zoneOffsetTs=void 0,zoneOffsetGuessCache.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}get weekNumber(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}get weekday(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?possiblyCachedLocalWeekData(this).weekday:NaN}get localWeekNumber(){return this.isValid?possiblyCachedLocalWeekData(this).weekNumber:NaN}get localWeekYear(){return this.isValid?possiblyCachedLocalWeekData(this).weekYear:NaN}get ordinal(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}get monthShort(){return this.isValid?Info.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Info.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Info.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Info.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,I=6e4,B=objToLocalTS(this.c),tr=this.zone.offset(B-t),rr=this.zone.offset(B+t),ir=this.zone.offset(B-tr*I),lr=this.zone.offset(B-rr*I);if(ir===lr)return[this];const dr=B-ir*I,hr=B-lr*I,fr=tsToObj(dr,ir),mr=tsToObj(hr,lr);return fr.hour===mr.hour&&fr.minute===mr.minute&&fr.second===mr.second&&fr.millisecond===mr.millisecond?[clone(this,{ts:dr}),clone(this,{ts:hr})]:[this]}get isInLeapYear(){return isLeapYear(this.year)}get daysInMonth(){return daysInMonth(this.year,this.month)}get daysInYear(){return this.isValid?daysInYear(this.year):NaN}get weeksInWeekYear(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?weeksInWeekYear(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:I,numberingSystem:B,calendar:tr}=Formatter.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:I,numberingSystem:B,outputCalendar:tr}}toUTC(t=0,I={}){return this.setZone(FixedOffsetZone.instance(t),I)}toLocal(){return this.setZone(Settings.defaultZone)}setZone(t,{keepLocalTime:I=!1,keepCalendarTime:B=!1}={}){if(t=normalizeZone(t,Settings.defaultZone),t.equals(this.zone))return this;if(t.isValid){let tr=this.ts;if(I||B){const rr=t.offset(this.ts),ir=this.toObject();[tr]=objToTS(ir,rr,t)}return clone(this,{ts:tr,zone:t})}else return DateTime.invalid(unsupportedZone(t))}reconfigure({locale:t,numberingSystem:I,outputCalendar:B}={}){const tr=this.loc.clone({locale:t,numberingSystem:I,outputCalendar:B});return clone(this,{loc:tr})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const I=normalizeObject(t,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:B,startOfWeek:tr}=usesLocalWeekValues(I,this.loc),rr=!isUndefined$1(I.weekYear)||!isUndefined$1(I.weekNumber)||!isUndefined$1(I.weekday),ir=!isUndefined$1(I.ordinal),lr=!isUndefined$1(I.year),dr=!isUndefined$1(I.month)||!isUndefined$1(I.day),hr=lr||dr,fr=I.weekYear||I.weekNumber;if((hr||ir)&&fr)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(dr&&ir)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");let mr;rr?mr=weekToGregorian({...gregorianToWeek(this.c,B,tr),...I},B,tr):isUndefined$1(I.ordinal)?(mr={...this.toObject(),...I},isUndefined$1(I.day)&&(mr.day=Math.min(daysInMonth(mr.year,mr.month),mr.day))):mr=ordinalToGregorian({...gregorianToOrdinal(this.c),...I});const[_r,yr]=objToTS(mr,this.o,this.zone);return clone(this,{ts:_r,o:yr})}plus(t){if(!this.isValid)return this;const I=Duration.fromDurationLike(t);return clone(this,adjustTime(this,I))}minus(t){if(!this.isValid)return this;const I=Duration.fromDurationLike(t).negate();return clone(this,adjustTime(this,I))}startOf(t,{useLocaleWeeks:I=!1}={}){if(!this.isValid)return this;const B={},tr=Duration.normalizeUnit(t);switch(tr){case"years":B.month=1;case"quarters":case"months":B.day=1;case"weeks":case"days":B.hour=0;case"hours":B.minute=0;case"minutes":B.second=0;case"seconds":B.millisecond=0;break}if(tr==="weeks")if(I){const rr=this.loc.getStartOfWeek(),{weekday:ir}=this;ir<rr&&(B.weekNumber=this.weekNumber-1),B.weekday=rr}else B.weekday=1;if(tr==="quarters"){const rr=Math.ceil(this.month/3);B.month=(rr-1)*3+1}return this.set(B)}endOf(t,I){return this.isValid?this.plus({[t]:1}).startOf(t,I).minus(1):this}toFormat(t,I={}){return this.isValid?Formatter.create(this.loc.redefaultToEN(I)).formatDateTimeFromString(this,t):INVALID}toLocaleString(t=DATE_SHORT,I={}){return this.isValid?Formatter.create(this.loc.clone(I),t).formatDateTime(this):INVALID}toLocaleParts(t={}){return this.isValid?Formatter.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:I=!1,suppressMilliseconds:B=!1,includeOffset:tr=!0,extendedZone:rr=!1}={}){if(!this.isValid)return null;const ir=t==="extended";let lr=toISODate(this,ir);return lr+="T",lr+=toISOTime(this,ir,I,B,tr,rr),lr}toISODate({format:t="extended"}={}){return this.isValid?toISODate(this,t==="extended"):null}toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:I=!1,includeOffset:B=!0,includePrefix:tr=!1,extendedZone:rr=!1,format:ir="extended"}={}){return this.isValid?(tr?"T":"")+toISOTime(this,ir==="extended",I,t,B,rr):null}toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?toISODate(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:I=!1,includeOffsetSpace:B=!0}={}){let tr="HH:mm:ss.SSS";return(I||t)&&(B&&(tr+=" "),I?tr+="z":t&&(tr+="ZZ")),toTechFormat(this,tr,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():INVALID}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const I={...this.c};return t.includeConfig&&(I.outputCalendar=this.outputCalendar,I.numberingSystem=this.loc.numberingSystem,I.locale=this.loc.locale),I}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,I="milliseconds",B={}){if(!this.isValid||!t.isValid)return Duration.invalid("created by diffing an invalid DateTime");const tr={locale:this.locale,numberingSystem:this.numberingSystem,...B},rr=maybeArray(I).map(Duration.normalizeUnit),ir=t.valueOf()>this.valueOf(),lr=ir?this:t,dr=ir?t:this,hr=diff(lr,dr,rr,tr);return ir?hr.negate():hr}diffNow(t="milliseconds",I={}){return this.diff(DateTime.now(),t,I)}until(t){return this.isValid?Interval.fromDateTimes(this,t):this}hasSame(t,I,B){if(!this.isValid)return!1;const tr=t.valueOf(),rr=this.setZone(t.zone,{keepLocalTime:!0});return rr.startOf(I,B)<=tr&&tr<=rr.endOf(I,B)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const I=t.base||DateTime.fromObject({},{zone:this.zone}),B=t.padding?this<I?-t.padding:t.padding:0;let tr=["years","months","days","hours","minutes","seconds"],rr=t.unit;return Array.isArray(t.unit)&&(tr=t.unit,rr=void 0),diffRelative(I,this.plus(B),{...t,numeric:"always",units:tr,unit:rr})}toRelativeCalendar(t={}){return this.isValid?diffRelative(t.base||DateTime.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(DateTime.isDateTime))throw new InvalidArgumentError("min requires all arguments be DateTimes");return bestBy(t,I=>I.valueOf(),Math.min)}static max(...t){if(!t.every(DateTime.isDateTime))throw new InvalidArgumentError("max requires all arguments be DateTimes");return bestBy(t,I=>I.valueOf(),Math.max)}static fromFormatExplain(t,I,B={}){const{locale:tr=null,numberingSystem:rr=null}=B,ir=Locale.fromOpts({locale:tr,numberingSystem:rr,defaultToEN:!0});return explainFromTokens(ir,t,I)}static fromStringExplain(t,I,B={}){return DateTime.fromFormatExplain(t,I,B)}static buildFormatParser(t,I={}){const{locale:B=null,numberingSystem:tr=null}=I,rr=Locale.fromOpts({locale:B,numberingSystem:tr,defaultToEN:!0});return new TokenParser(rr,t)}static fromFormatParser(t,I,B={}){if(isUndefined$1(t)||isUndefined$1(I))throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser");const{locale:tr=null,numberingSystem:rr=null}=B,ir=Locale.fromOpts({locale:tr,numberingSystem:rr,defaultToEN:!0});if(!ir.equals(I.locale))throw new InvalidArgumentError(`fromFormatParser called with a locale of ${ir}, but the format parser was created for ${I.locale}`);const{result:lr,zone:dr,specificOffset:hr,invalidReason:fr}=I.explainFromTokens(t);return fr?DateTime.invalid(fr):parseDataToDateTime(lr,dr,B,`format ${I.format}`,t,hr)}static get DATE_SHORT(){return DATE_SHORT}static get DATE_MED(){return DATE_MED}static get DATE_MED_WITH_WEEKDAY(){return DATE_MED_WITH_WEEKDAY}static get DATE_FULL(){return DATE_FULL}static get DATE_HUGE(){return DATE_HUGE}static get TIME_SIMPLE(){return TIME_SIMPLE}static get TIME_WITH_SECONDS(){return TIME_WITH_SECONDS}static get TIME_WITH_SHORT_OFFSET(){return TIME_WITH_SHORT_OFFSET}static get TIME_WITH_LONG_OFFSET(){return TIME_WITH_LONG_OFFSET}static get TIME_24_SIMPLE(){return TIME_24_SIMPLE}static get TIME_24_WITH_SECONDS(){return TIME_24_WITH_SECONDS}static get TIME_24_WITH_SHORT_OFFSET(){return TIME_24_WITH_SHORT_OFFSET}static get TIME_24_WITH_LONG_OFFSET(){return TIME_24_WITH_LONG_OFFSET}static get DATETIME_SHORT(){return DATETIME_SHORT}static get DATETIME_SHORT_WITH_SECONDS(){return DATETIME_SHORT_WITH_SECONDS}static get DATETIME_MED(){return DATETIME_MED}static get DATETIME_MED_WITH_SECONDS(){return DATETIME_MED_WITH_SECONDS}static get DATETIME_MED_WITH_WEEKDAY(){return DATETIME_MED_WITH_WEEKDAY}static get DATETIME_FULL(){return DATETIME_FULL}static get DATETIME_FULL_WITH_SECONDS(){return DATETIME_FULL_WITH_SECONDS}static get DATETIME_HUGE(){return DATETIME_HUGE}static get DATETIME_HUGE_WITH_SECONDS(){return DATETIME_HUGE_WITH_SECONDS}}function friendlyDateTime(e){if(DateTime.isDateTime(e))return e;if(e&&e.valueOf&&isNumber$1(e.valueOf()))return DateTime.fromJSDate(e);if(e&&typeof e=="object")return DateTime.fromObject(e);throw new InvalidArgumentError(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const getPeriodSeriesArray=e=>{const t=[],I=getPeriodSeries(e);let B=I.next();for(;B;)t.push(B),B=I.next();return t},getPeriodSeries=e=>({...e,next:_createFactoryFn(e)}),_createFactoryFn=e=>{let t=e.start;return()=>{if(t==null)return null;let I=null;switch(e.granularity){case AnalyticsGranularity.Total:I=_nextTotalPeriod(t,e.end);break;case AnalyticsGranularity.Annual:I=_nextAnnualPeriod(t,e.end);break;case AnalyticsGranularity.SemiAnnual:I=_nextSemiAnnualPeriod(t,e.end);break;case AnalyticsGranularity.Quarterly:I=_nextQuarterlyPeriod(t,e.end);break;case AnalyticsGranularity.Monthly:I=_nextMonthlyPeriod(t,e.end);break;case AnalyticsGranularity.Weekly:I=_nextWeeklyPeriod(t,e.end);break;case AnalyticsGranularity.Daily:I=_nextDailyPeriod(t,e.end);break;case AnalyticsGranularity.Hourly:I=_nextHourlyPeriod(t,e.end)}return I===null?t=null:t=I.end.plus({milliseconds:1}),I}},_nextTotalPeriod=(e,t)=>t<=e?null:{period:"total",start:e,end:t},_nextAnnualPeriod=(e,t)=>{if(t<=e)return null;const I=e.toUTC(),B=DateTime.utc(I.year,I.month,I.day).plus({years:1});return{period:"annual",start:e,end:B}},_nextSemiAnnualPeriod=(e,t)=>{if(t<=e)return null;const I=DateTime.utc(e.year,7,1),B=DateTime.utc(e.year,12,31,23,59,59,999);let tr;return I>e?tr=I:tr=B,tr>t&&(tr=t),{period:"semiAnnual",start:e,end:tr}},_nextQuarterlyPeriod=(e,t)=>{if(t<=e)return null;let I;const B=e.toUTC(),tr=B.month;return tr<3?I=DateTime.utc(B.year,4,1):tr<6?I=DateTime.utc(B.year,7,1):tr<9?I=DateTime.utc(B.year,10,1):I=DateTime.utc(B.year,12,31,23,59,59,999),I>t&&(I=t),{period:"quarterly",start:e,end:I}},_nextMonthlyPeriod=(e,t)=>{if(t<=e)return null;const I=e.toUTC();let B=DateTime.utc(I.year,I.month,I.day).plus({months:1}).startOf("month");return B>t&&(e.hasSame(t,"month")||(B=t)),{period:"monthly",start:e,end:B}},_nextWeeklyPeriod=(e,t)=>{if(t<=e)return null;const I=e.toUTC(),B=DateTime.utc(I.year,I.month,I.day).plus({weeks:1}).startOf("week");return B>t&&!B.hasSame(t,"day")?{period:"weekly",start:e,end:t}:{period:"weekly",start:e,end:B}},_nextDailyPeriod=(e,t)=>{if(t<=e)return null;let B=e.toUTC().plus({days:1}).startOf("day");return(B>t||B.hasSame(t,"day"))&&(B=t),{period:"daily",start:e,end:B}},_nextHourlyPeriod=(e,t)=>{if(t<=e)return null;let B=e.toUTC().plus({hours:1});return B>t&&e.hour!==t.hour&&(B=t.toUTC()),{period:"hourly",start:e,end:B}},getQuarter=e=>Math.floor((e.month-1)/3)+1;class AnalyticsDiscretizer{static discretize(t,I,B,tr,rr){const ir=this._buildIndex(t,I),lr=getPeriodSeriesArray(this._calculateRange(B,tr,rr,t)),dr=this._discretizeNode(ir,{},I,lr);return this._groupResultsByPeriod(lr,dr)}static _calculateRange(t,I,B,tr){let rr=t||null,ir=I||null;if(rr==null||ir==null)for(const lr of tr){rr==null&&(rr=lr.start);const dr=lr.end||lr.start;(ir==null||ir<dr)&&(ir=dr)}if(rr==null||ir==null)throw new Error("Cannot determine query start and/or end.");return{start:rr,end:ir,granularity:B}}static _groupResultsByPeriod(t,I){const B={};for(const tr of t){const rr=tr.start.toISO()+"-"+tr.period,ir=AnalyticsDiscretizer._getPeriodString(tr);B[rr]={period:ir,start:tr.start,end:tr.end,rows:[]}}for(const tr of I)for(const rr of Object.keys(tr.series))B[rr].rows.push({dimensions:tr.dimensions,metric:tr.metric,unit:tr.unit=="__NULL__"?null:tr.unit,value:tr.series[rr].inc,sum:tr.series[rr].sum});return Object.values(B)}static _getPeriodString(t){switch(t.period){case"annual":return t.start.year.toString();case"semiAnnual":return`${t.start.year}/${t.start.month<7?"H1":"H2"}`;case"quarterly":return`${t.start.year}/Q${getQuarter(t.start)}`;case"monthly":const I=t.start.toUTC().month,B=I<10?`0${I}`:`${I}`;return`${t.start.year}/${B}`;case"weekly":return`${t.start.weekYear}/W${t.start.weekNumber}`;case"daily":const tr=t.start.month,rr=t.start.day,ir=tr<10?`0${tr}`:`${tr}`,lr=rr<10?`0${rr}`:`${rr}`;return`${t.start.year}/${ir}/${lr}`;case"hourly":const dr=t.start.month,hr=t.start.day,fr=t.start.hour,mr=dr<10?`0${dr}`:`${dr}`,_r=hr<10?`0${hr}`:`${hr}`,yr=fr<10?`0${fr}`:`${fr}`;return`${t.start.year}/${mr}/${_r}/${yr}`;default:return t.period}}static _discretizeNode(t,I,B,tr){const rr=[];if(B.length>0){const ir=B[0];Object.keys(t).forEach((lr,dr,hr)=>{const fr={...I};fr[ir]=lr,rr.push(...this._discretizeNode(t[lr],fr,B.slice(1),tr))})}else Object.keys(t).forEach(ir=>{rr.push(...this._discretizeLeaf(t[ir],tr,ir,I))});return rr}static _discretizeLeaf(t,I,B,tr){const rr=[];return Object.keys(t).forEach(ir=>{const lr={};Object.keys(tr).forEach(dr=>{lr[dr]={path:t[ir][0].dimensions[dr],icon:t[ir][0].dimensions.icon,label:t[ir][0].dimensions.label,description:t[ir][0].dimensions.description}}),rr.push({unit:ir,metric:B,dimensions:lr,series:this._discretizeSeries(t[ir],I)})}),rr}static _discretizeSeries(t,I){const B={};for(const tr of t){let rr=this._getValue(tr,I[0].start);for(const ir of I){const lr=this._getValue(tr,ir.end),dr=`${ir.start.toISO()}-${ir.period}`;B[dr]?(B[dr].inc+=lr-rr,B[dr].sum+=lr):B[dr]={inc:lr-rr,sum:lr},rr=lr}}return B}static _getValue(t,I){switch(t.fn){case"Single":return this._getSingleValue(t,I);case"DssVest":return this._getVestValue(t,I);default:return 0}}static _getSingleValue(t,I){return I>=t.start?t.value:0}static _getVestValue(t,I){var hr;const B=I,tr=t.start,rr=t.end,ir=(hr=t.params)!=null&&hr.cliff?DateTime.fromISO(t.params.cliff):null;if(B<tr||ir&&B<ir)return 0;if(rr&&B>=rr)return t.value;const lr=Interval.fromDateTimes(tr,B),dr=Interval.fromDateTimes(tr,rr||B);return lr.length()/dr.length()*t.value}static _buildIndex(t,I){const B={},tr={},rr=I[0]||"";for(const ir of t){const lr=ir.dimensions[rr];tr[lr]===void 0&&(tr[lr]=[]),tr[lr].push(ir)}if(I.length>1){const ir=I.slice(1);Object.keys(tr).forEach(lr=>{B[lr]=this._buildIndex(tr[lr],ir)})}else Object.keys(tr).forEach(ir=>{B[ir]=this._buildMetricsIndex(tr[ir])});return B}static _buildMetricsIndex(t){const I={},B={};for(const tr of t){const rr=tr.metric;B[rr]===void 0&&(B[rr]=[]),B[rr].push(tr)}return Object.keys(B).forEach(tr=>I[tr]=this._buildUnitIndex(B[tr])),I}static _buildUnitIndex(t){const I={};for(const B of t){const tr=B.unit||"__NULL__";I[tr]===void 0&&(I[tr]=[]),I[tr].push(B)}return I}}class AnalyticsQueryEngine{constructor(t,I){ji(this,"_analyticsStore");ji(this,"_profiler");this._analyticsStore=t,this._profiler=I??new PassthroughAnalyticsProfiler}async executeCompound(t){let I;const B={start:t.start,end:t.end,granularity:t.granularity,lod:t.lod,select:t.select,metrics:t.expression.inputs.metrics,currency:t.expression.inputs.currency},tr={start:t.start,end:t.end,granularity:t.granularity,lod:{priceData:1},select:{priceData:[AnalyticsPath.fromString("atlas")]},metrics:[t.expression.operand.metric],currency:t.expression.operand.currency},rr=await this.execute(B),ir=await this.execute(tr);return[CompoundOperator.VectorAdd,CompoundOperator.VectorSubtract].includes(t.expression.operator)?I=await this._profiler.record("ApplyVectorOperator",async()=>await this._applyVectorOperator(rr,ir,t.expression.operator,t.expression.resultCurrency)):I=await this._profiler.record("ApplyScalarOperator",async()=>await this._applyScalarOperator(rr,ir,t.expression.operator,t.expression.operand.useSum,t.expression.resultCurrency)),I}async execute(t){const I=await this._executeSeriesQuery(t),B=this._profiler.recordSync("ApplyLODs",()=>this._applyLods(I,t.lod)),tr=Object.keys(t.select);return this._profiler.recordSync("Discretize",()=>B.length<1?[]:AnalyticsDiscretizer.discretize(B,tr,t.start,t.end,t.granularity))}async executeMultiCurrency(t,I){const B={...t,currency:I.targetCurrency??t.currency};let tr=await this.execute(B);for(const rr of I.conversions){const ir={start:t.start,end:t.end,granularity:t.granularity,lod:t.lod,select:t.select,expression:{inputs:{metrics:B.metrics,currency:rr.currency},operator:CompoundOperator.ScalarMultiply,operand:{metric:rr.metric,currency:I.targetCurrency,useSum:!0},resultCurrency:I.targetCurrency}},lr=await this.executeCompound(ir);tr=await this._applyVectorOperator(tr,lr,CompoundOperator.VectorAdd,I.targetCurrency)}return tr}async _applyVectorOperator(t,I,B,tr){if([CompoundOperator.ScalarMultiply,CompoundOperator.ScalarDivide].includes(B))throw new Error("Invalid operator for vector operation");return I}async _applyScalarOperator(t,I,B,tr,rr){if([CompoundOperator.VectorAdd,CompoundOperator.VectorSubtract].includes(B))throw new Error("Invalid operator for scalar operation");const ir=[],lr={},dr=tr?"sum":"value";for(const hr of I)hr.rows.length>0&&(lr[hr.period]=hr.rows[0][dr]);for(const hr of t){const fr={period:hr.period,start:hr.start,end:hr.end,rows:hr.rows.map(mr=>({dimensions:mr.dimensions,metric:mr.metric,unit:rr?rr.toString():mr.unit,value:this._calculateOutputValue(mr.value,B,lr[hr.period]),sum:-1}))};ir.push(fr)}return ir}_calculateOutputValue(t,I,B){switch(I){case CompoundOperator.VectorAdd:return t+B;case CompoundOperator.VectorSubtract:return t-B;case CompoundOperator.ScalarMultiply:return t*B;case CompoundOperator.ScalarDivide:return t/B}}async _executeSeriesQuery(t){const I={start:t.start,end:t.end,select:t.select,metrics:t.metrics,currency:t.currency};return await this._analyticsStore.getMatchingSeries(I)}_applyLods(t,I){return t.map(B=>({...B,dimensions:this._applyDimensionsLods(B.dimensions,I)}))}_applyDimensionsLods(t,I){const B={};for(const[tr,rr]of Object.entries(I))rr!==null&&t[tr]&&(B[tr]=t[tr].path.applyLod(rr).toString(),B.icon=t[tr].icon.toString(),B.label=t[tr].label.toString(),B.description=t[tr].description.toString());return B}async getDimensions(){return await this._analyticsStore.getDimensions()}}class NotificationError extends Error{constructor(I){super(I.map(B=>B.message).join(`
|
|
3
|
-
`));ji(this,"innerErrors");this.name="NotificationError",this.innerErrors=I}}class AnalyticsSubscriptionManager{constructor(){ji(this,"_subscriptions",new Map)}subscribeToPath(t,I){const B=this.normalizePath(t.toString("/"));return this._subscriptions.has(B)||this._subscriptions.set(B,new Set),this._subscriptions.get(B).add(I),()=>{const tr=this._subscriptions.get(B);tr&&(tr.delete(I),tr.size===0&&this._subscriptions.delete(B))}}notifySubscribers(t){if(t.length===0||this._subscriptions.size===0)return;const I=[];for(const B of t){const tr=this.normalizePath(B.toString("/")),rr=this.getPathPrefixes(tr),ir=[];rr.filter(lr=>this._subscriptions.has(lr)).forEach(lr=>{ir.push({prefix:lr,callbacks:this._subscriptions.get(lr)})});for(const[lr,dr]of this._subscriptions.entries())rr.includes(lr)||this.pathMatchesWildcardPattern(tr,lr)&&ir.push({prefix:lr,callbacks:dr});if(ir.length!==0)for(const{callbacks:lr}of ir)for(const dr of lr)try{dr(B)}catch(hr){I.push(hr)}}if(I.length>0)throw new NotificationError(I)}normalizePath(t){return"/"+t.split("/").filter(tr=>tr.length>0).join("/")}pathMatchesWildcardPattern(t,I){if(I.includes("*")){const B=t.split("/").filter(rr=>rr.length>0),tr=I.split("/").filter(rr=>rr.length>0);if(tr.length>B.length)return!1;for(let rr=0;rr<tr.length;rr++){const ir=tr[rr],lr=B[rr];if(!(ir==="*"||ir.startsWith("*:"))&&ir!==lr)return!1}return!0}return t===I||t.startsWith(I+"/")}getPathPrefixes(t){const I=t.split("/").filter(rr=>rr.length>0),B=[];let tr="";for(const rr of I)tr=tr?`${tr}/${rr}`:`/${rr}`,B.push(tr);return B.length===0&&t==="/"&&B.push("/"),B}}function toPascalCase(e){return e.replace(/\w+/g,function(t){return t[0].toUpperCase()+t.slice(1)}).replace(/\s+/g,"")}class KnexAnalyticsStore{constructor({executor:t,knex:I}){ji(this,"_executor");ji(this,"_knex");ji(this,"_subscriptionManager",new AnalyticsSubscriptionManager);this._executor=t,this._knex=I}destroy(){this._knex.destroy()}async clearSeriesBySource(t,I=!1){const B=this._knex("AnalyticsSeries").whereLike("source",t.toString("/%")).delete();let tr=await this._executor.execute(B);return I&&(tr+=await this.clearEmptyAnalyticsDimensions()),this._subscriptionManager.notifySubscribers([t]),tr}async clearEmptyAnalyticsDimensions(){const t=this._knex("AnalyticsDimension AS AD").whereNotExists(I=>I.select("*").from("AnalyticsSeries_AnalyticsDimension AS ASAD").where("ASAD.dimensionId",this._knex.ref("AD.id"))).delete();return await this._executor.execute(t)}async getMatchingSeries(t){const I=t.currency?t.currency.firstSegment().filters:null,B=this._buildViewQuery("AV",Object.keys(t.select),t.metrics.map(ir=>ir),I,t.end),tr=this._knex(this._knex.raw(B)).select("AV.*");for(const[ir,lr]of Object.entries(t.select))tr.leftJoin(`AnalyticsDimension as ${ir}`,dr=>{dr.on(`${ir}.path`,`dim_${ir}`)}),tr.select(`${ir}.icon as dim_icon`),tr.select(`${ir}.description as dim_description`),tr.select(`${ir}.label as dim_label`),lr.length==1?tr.andWhereLike(`dim_${ir}`,lr[0].toString("/%")):lr.length>1&&tr.andWhere(dr=>(lr.forEach(hr=>dr.orWhereLike(`dim_${ir}`,hr.toString("/%"))),dr));tr.orderBy("start");const rr=await this._executor.execute(tr);return this._formatQueryRecords(rr,Object.keys(t.select))}async addSeriesValue(t){return this.addSeriesValues([t])}async addSeriesValues(t){const I={};for(let tr=0;tr<t.length;tr++){const rr=t[tr],ir=this._knex("AnalyticsSeries").insert({start:rr.start.toJSDate(),end:rr.end?rr.end.toJSDate():null,source:rr.source.toString("/"),metric:toPascalCase(rr.metric),value:rr.value,unit:rr.unit||null,fn:rr.fn||"Single",params:rr.params||null},"id"),lr=await this._executor.execute(ir);for(const[dr,hr]of Object.entries(t[tr].dimensions||{})){I[dr]||(I[dr]={});const fr=hr.toString("/");I[dr][fr]||(I[dr][fr]=[]),I[dr][fr].push(lr[0].id)}}for(const[tr,rr]of Object.entries(I))await this._linkDimensions(tr,rr);for(let tr=0;tr<t.length;tr++){const rr=t[tr].dimensionMetadata;rr&&await this.addDimensionMetadata(rr.path,rr.icon,rr.label,rr.description)}const B=t.map(tr=>tr.source);this._subscriptionManager.notifySubscribers(B)}_formatQueryRecords(t,I){return t.map(tr=>{const rr={id:tr.id,source:AnalyticsPath.fromString(tr.source.slice(0,-1)),start:DateTime.fromJSDate(tr.start),end:tr.end?DateTime.fromJSDate(tr.end):null,metric:tr.metric,value:tr.value,unit:tr.unit,fn:tr.fn,params:tr.params,dimensions:{}};return I.forEach(ir=>rr.dimensions[ir]={path:AnalyticsPath.fromString(tr[`dim_${ir}`]?tr[`dim_${ir}`].slice(0,-1):"?"),icon:tr.dim_icon?tr.dim_icon:"",label:tr.dim_label?tr.dim_label:"",description:tr.dim_description?tr.dim_description:""}),rr}).sort((tr,rr)=>tr.id-rr.id)}_buildViewQuery(t,I,B,tr,rr){const ir=this._knex("AnalyticsSeries as AS_inner").select("*").whereIn("metric",B);for(const lr of I)ir.select(this._buildDimensionQuery(lr));return tr&&tr.length>0&&tr[0]!==""&&ir.whereIn("unit",tr),rr&&ir.where("start","<",rr.toISO()),`(${ir.toString()}) AS "${t}"`}_buildDimensionQuery(t){const I=this._knex.ref("AS_inner.id");return this._knex("AnalyticsSeries_AnalyticsDimension as ASAD").leftJoin("AnalyticsDimension as AD","AD.id","ASAD.dimensionId").where("ASAD.seriesId",I).where("AD.dimension",t).select("path").as(`dim_${t}`)}async _linkDimensions(t,I){const B=this._knex("AnalyticsDimension").select("path","id").where("dimension",t).whereIn("path",Object.keys(I)),tr=await this._executor.execute(B);for(const[rr,ir]of Object.entries(I)){const lr=tr.findIndex(hr=>hr.path==rr),dr=lr<0?await this._createDimensionPath(t,rr):tr[lr].id;for(let hr=0;hr<ir.length;hr++){const fr=this._knex("AnalyticsSeries_AnalyticsDimension").insert({seriesId:ir[hr],dimensionId:dr});await this._executor.execute(fr)}}}async _createDimensionPath(t,I){const B=this._knex("AnalyticsDimension").insert({dimension:t,path:I},"id");return(await this._executor.execute(B))[0].id}async addDimensionMetadata(t,I,B,tr){if(!I&&!B&&!tr)return;const rr=this._knex("AnalyticsDimension").where("path",`${t.toString()}/`).update({icon:I||"",label:B||"",description:tr||""});await this._executor.execute(rr)}async getDimensions(){const t=this._knex.select("dimension","path","icon","label","description").from("AnalyticsDimension").whereNotNull("path").whereNot("path","").whereNot("path","/"),B=(await this._executor.execute(t)).reduce((rr,ir)=>(rr[ir.dimension]||(rr[ir.dimension]={name:ir.dimension,values:[]}),rr[ir.dimension].values.push({path:ir.path,icon:ir.icon,label:ir.label,description:ir.description}),rr),{});return Object.values(B)}async getMetrics(){const t=this._knex("AnalyticsSeries").select("metric").distinct().whereNotNull("metric"),B=(await this._executor.execute(t)).map(rr=>rr.metric);return["Budget","Forecast","Actuals","PaymentsOnChain","PaymentsOffChainIncluded"].forEach(rr=>{B.includes(rr)||B.push(rr)}),B}async getCurrencies(){const t=this._knex("AnalyticsSeries").select("unit").distinct().whereNotNull("unit");return(await this._executor.execute(t)).map(B=>B.unit)}subscribeToSource(t,I){return this._subscriptionManager.subscribeToPath(t,I)}}var tarn={exports:{}},Pool={},PendingOperation={},TimeoutError={},hasRequiredTimeoutError;function requireTimeoutError(){if(hasRequiredTimeoutError)return TimeoutError;hasRequiredTimeoutError=1,Object.defineProperty(TimeoutError,"__esModule",{value:!0});let e=class extends Error{};return TimeoutError.TimeoutError=e,TimeoutError}var utils$3={},PromiseInspection={},hasRequiredPromiseInspection;function requirePromiseInspection(){if(hasRequiredPromiseInspection)return PromiseInspection;hasRequiredPromiseInspection=1,Object.defineProperty(PromiseInspection,"__esModule",{value:!0});let e=class{constructor(I){this._value=I.value,this._error=I.error}value(){return this._value}reason(){return this._error}isRejected(){return!!this._error}isFulfilled(){return!!this._value}};return PromiseInspection.PromiseInspection=e,PromiseInspection}var hasRequiredUtils$3;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,Object.defineProperty(utils$3,"__esModule",{value:!0});const e=requirePromiseInspection();function t(){let hr=null,fr=null;return{promise:new Promise((_r,yr)=>{hr=_r,fr=yr}),resolve:hr,reject:fr}}utils$3.defer=t;function I(){return Date.now()}utils$3.now=I;function B(hr,fr){return Math.abs(fr-hr)}utils$3.duration=B;function tr(hr){return typeof hr>"u"?!0:rr(hr)}utils$3.checkOptionalTime=tr;function rr(hr){return typeof hr=="number"&&hr===Math.round(hr)&&hr>0}utils$3.checkRequiredTime=rr;function ir(hr){return new Promise(fr=>setTimeout(fr,hr))}utils$3.delay=ir;function lr(hr){return hr.then(fr=>new e.PromiseInspection({value:fr})).catch(fr=>new e.PromiseInspection({error:fr}))}utils$3.reflect=lr;function dr(hr){try{const fr=hr();return Promise.resolve(fr)}catch(fr){return Promise.reject(fr)}}return utils$3.tryPromise=dr,utils$3}var hasRequiredPendingOperation;function requirePendingOperation(){if(hasRequiredPendingOperation)return PendingOperation;hasRequiredPendingOperation=1,Object.defineProperty(PendingOperation,"__esModule",{value:!0});const e=requireTimeoutError(),t=requireUtils$3();let I=class{constructor(rr){this.timeoutMillis=rr,this.deferred=t.defer(),this.possibleTimeoutCause=null,this.isRejected=!1,this.promise=B(this.deferred.promise,rr).catch(ir=>(ir instanceof e.TimeoutError&&(this.possibleTimeoutCause?ir=new e.TimeoutError(this.possibleTimeoutCause.message):ir=new e.TimeoutError("operation timed out for an unknown reason")),this.isRejected=!0,Promise.reject(ir)))}abort(){this.reject(new Error("aborted"))}reject(rr){this.deferred.reject(rr)}resolve(rr){this.deferred.resolve(rr)}};PendingOperation.PendingOperation=I;function B(tr,rr){return new Promise((ir,lr)=>{const dr=setTimeout(()=>lr(new e.TimeoutError),rr);tr.then(hr=>{clearTimeout(dr),ir(hr)}).catch(hr=>{clearTimeout(dr),lr(hr)})})}return PendingOperation}var Resource={},hasRequiredResource;function requireResource(){if(hasRequiredResource)return Resource;hasRequiredResource=1,Object.defineProperty(Resource,"__esModule",{value:!0});const e=requireUtils$3();let t=class Xl{constructor(B){this.resource=B,this.resource=B,this.timestamp=e.now(),this.deferred=e.defer()}get promise(){return this.deferred.promise}resolve(){return this.deferred.resolve(void 0),new Xl(this.resource)}};return Resource.Resource=t,Resource}var events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(kr,Dr,Or){return Function.prototype.apply.call(kr,Dr,Or)},I;e&&typeof e.ownKeys=="function"?I=e.ownKeys:Object.getOwnPropertySymbols?I=function(kr){return Object.getOwnPropertyNames(kr).concat(Object.getOwnPropertySymbols(kr))}:I=function(kr){return Object.getOwnPropertyNames(kr)};function B(Ar){console&&console.warn&&console.warn(Ar)}var tr=Number.isNaN||function(kr){return kr!==kr};function rr(){rr.init.call(this)}events.exports=rr,events.exports.once=Sr,rr.EventEmitter=rr,rr.prototype._events=void 0,rr.prototype._eventsCount=0,rr.prototype._maxListeners=void 0;var ir=10;function lr(Ar){if(typeof Ar!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Ar)}Object.defineProperty(rr,"defaultMaxListeners",{enumerable:!0,get:function(){return ir},set:function(Ar){if(typeof Ar!="number"||Ar<0||tr(Ar))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Ar+".");ir=Ar}}),rr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},rr.prototype.setMaxListeners=function(kr){if(typeof kr!="number"||kr<0||tr(kr))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+kr+".");return this._maxListeners=kr,this};function dr(Ar){return Ar._maxListeners===void 0?rr.defaultMaxListeners:Ar._maxListeners}rr.prototype.getMaxListeners=function(){return dr(this)},rr.prototype.emit=function(kr){for(var Dr=[],Or=1;Or<arguments.length;Or++)Dr.push(arguments[Or]);var zr=kr==="error",$n=this._events;if($n!==void 0)zr=zr&&$n.error===void 0;else if(!zr)return!1;if(zr){var Fr;if(Dr.length>0&&(Fr=Dr[0]),Fr instanceof Error)throw Fr;var $r=new Error("Unhandled error."+(Fr?" ("+Fr.message+")":""));throw $r.context=Fr,$r}var Hn=$n[kr];if(Hn===void 0)return!1;if(typeof Hn=="function")t(Hn,this,Dr);else for(var ti=Hn.length,Ir=xr(Hn,ti),Or=0;Or<ti;++Or)t(Ir[Or],this,Dr);return!0};function hr(Ar,kr,Dr,Or){var zr,$n,Fr;if(lr(Dr),$n=Ar._events,$n===void 0?($n=Ar._events=Object.create(null),Ar._eventsCount=0):($n.newListener!==void 0&&(Ar.emit("newListener",kr,Dr.listener?Dr.listener:Dr),$n=Ar._events),Fr=$n[kr]),Fr===void 0)Fr=$n[kr]=Dr,++Ar._eventsCount;else if(typeof Fr=="function"?Fr=$n[kr]=Or?[Dr,Fr]:[Fr,Dr]:Or?Fr.unshift(Dr):Fr.push(Dr),zr=dr(Ar),zr>0&&Fr.length>zr&&!Fr.warned){Fr.warned=!0;var $r=new Error("Possible EventEmitter memory leak detected. "+Fr.length+" "+String(kr)+" listeners added. Use emitter.setMaxListeners() to increase limit");$r.name="MaxListenersExceededWarning",$r.emitter=Ar,$r.type=kr,$r.count=Fr.length,B($r)}return Ar}rr.prototype.addListener=function(kr,Dr){return hr(this,kr,Dr,!1)},rr.prototype.on=rr.prototype.addListener,rr.prototype.prependListener=function(kr,Dr){return hr(this,kr,Dr,!0)};function fr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function mr(Ar,kr,Dr){var Or={fired:!1,wrapFn:void 0,target:Ar,type:kr,listener:Dr},zr=fr.bind(Or);return zr.listener=Dr,Or.wrapFn=zr,zr}rr.prototype.once=function(kr,Dr){return lr(Dr),this.on(kr,mr(this,kr,Dr)),this},rr.prototype.prependOnceListener=function(kr,Dr){return lr(Dr),this.prependListener(kr,mr(this,kr,Dr)),this},rr.prototype.removeListener=function(kr,Dr){var Or,zr,$n,Fr,$r;if(lr(Dr),zr=this._events,zr===void 0)return this;if(Or=zr[kr],Or===void 0)return this;if(Or===Dr||Or.listener===Dr)--this._eventsCount===0?this._events=Object.create(null):(delete zr[kr],zr.removeListener&&this.emit("removeListener",kr,Or.listener||Dr));else if(typeof Or!="function"){for($n=-1,Fr=Or.length-1;Fr>=0;Fr--)if(Or[Fr]===Dr||Or[Fr].listener===Dr){$r=Or[Fr].listener,$n=Fr;break}if($n<0)return this;$n===0?Or.shift():Mr(Or,$n),Or.length===1&&(zr[kr]=Or[0]),zr.removeListener!==void 0&&this.emit("removeListener",kr,$r||Dr)}return this},rr.prototype.off=rr.prototype.removeListener,rr.prototype.removeAllListeners=function(kr){var Dr,Or,zr;if(Or=this._events,Or===void 0)return this;if(Or.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Or[kr]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Or[kr]),this;if(arguments.length===0){var $n=Object.keys(Or),Fr;for(zr=0;zr<$n.length;++zr)Fr=$n[zr],Fr!=="removeListener"&&this.removeAllListeners(Fr);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Dr=Or[kr],typeof Dr=="function")this.removeListener(kr,Dr);else if(Dr!==void 0)for(zr=Dr.length-1;zr>=0;zr--)this.removeListener(kr,Dr[zr]);return this};function _r(Ar,kr,Dr){var Or=Ar._events;if(Or===void 0)return[];var zr=Or[kr];return zr===void 0?[]:typeof zr=="function"?Dr?[zr.listener||zr]:[zr]:Dr?vr(zr):xr(zr,zr.length)}rr.prototype.listeners=function(kr){return _r(this,kr,!0)},rr.prototype.rawListeners=function(kr){return _r(this,kr,!1)},rr.listenerCount=function(Ar,kr){return typeof Ar.listenerCount=="function"?Ar.listenerCount(kr):yr.call(Ar,kr)},rr.prototype.listenerCount=yr;function yr(Ar){var kr=this._events;if(kr!==void 0){var Dr=kr[Ar];if(typeof Dr=="function")return 1;if(Dr!==void 0)return Dr.length}return 0}rr.prototype.eventNames=function(){return this._eventsCount>0?I(this._events):[]};function xr(Ar,kr){for(var Dr=new Array(kr),Or=0;Or<kr;++Or)Dr[Or]=Ar[Or];return Dr}function Mr(Ar,kr){for(;kr+1<Ar.length;kr++)Ar[kr]=Ar[kr+1];Ar.pop()}function vr(Ar){for(var kr=new Array(Ar.length),Dr=0;Dr<kr.length;++Dr)kr[Dr]=Ar[Dr].listener||Ar[Dr];return kr}function Sr(Ar,kr){return new Promise(function(Dr,Or){function zr(Fr){Ar.removeListener(kr,$n),Or(Fr)}function $n(){typeof Ar.removeListener=="function"&&Ar.removeListener("error",zr),Dr([].slice.call(arguments))}br(Ar,kr,$n,{once:!0}),kr!=="error"&&wr(Ar,zr,{once:!0})})}function wr(Ar,kr,Dr){typeof Ar.on=="function"&&br(Ar,"error",kr,Dr)}function br(Ar,kr,Dr,Or){if(typeof Ar.on=="function")Or.once?Ar.once(kr,Dr):Ar.on(kr,Dr);else if(typeof Ar.addEventListener=="function")Ar.addEventListener(kr,function zr($n){Or.once&&Ar.removeEventListener(kr,zr),Dr($n)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Ar)}return events.exports}var hasRequiredPool;function requirePool(){if(hasRequiredPool)return Pool;hasRequiredPool=1,Object.defineProperty(Pool,"__esModule",{value:!0});const e=requirePendingOperation(),t=requireResource(),I=requireUtils$3(),B=requireEvents(),tr=require$$1;let rr=class{constructor(hr){if(this.destroyed=!1,this.emitter=new B.EventEmitter,hr=hr||{},!hr.create)throw new Error("Tarn: opt.create function most be provided");if(!hr.destroy)throw new Error("Tarn: opt.destroy function most be provided");if(typeof hr.min!="number"||hr.min<0||hr.min!==Math.round(hr.min))throw new Error("Tarn: opt.min must be an integer >= 0");if(typeof hr.max!="number"||hr.max<=0||hr.max!==Math.round(hr.max))throw new Error("Tarn: opt.max must be an integer > 0");if(hr.min>hr.max)throw new Error("Tarn: opt.max is smaller than opt.min");if(!I.checkOptionalTime(hr.acquireTimeoutMillis))throw new Error("Tarn: invalid opt.acquireTimeoutMillis "+JSON.stringify(hr.acquireTimeoutMillis));if(!I.checkOptionalTime(hr.createTimeoutMillis))throw new Error("Tarn: invalid opt.createTimeoutMillis "+JSON.stringify(hr.createTimeoutMillis));if(!I.checkOptionalTime(hr.destroyTimeoutMillis))throw new Error("Tarn: invalid opt.destroyTimeoutMillis "+JSON.stringify(hr.destroyTimeoutMillis));if(!I.checkOptionalTime(hr.idleTimeoutMillis))throw new Error("Tarn: invalid opt.idleTimeoutMillis "+JSON.stringify(hr.idleTimeoutMillis));if(!I.checkOptionalTime(hr.reapIntervalMillis))throw new Error("Tarn: invalid opt.reapIntervalMillis "+JSON.stringify(hr.reapIntervalMillis));if(!I.checkOptionalTime(hr.createRetryIntervalMillis))throw new Error("Tarn: invalid opt.createRetryIntervalMillis "+JSON.stringify(hr.createRetryIntervalMillis));const fr={create:!0,validate:!0,destroy:!0,log:!0,min:!0,max:!0,acquireTimeoutMillis:!0,createTimeoutMillis:!0,destroyTimeoutMillis:!0,idleTimeoutMillis:!0,reapIntervalMillis:!0,createRetryIntervalMillis:!0,propagateCreateError:!0};for(const mr of Object.keys(hr))if(!fr[mr])throw new Error(`Tarn: unsupported option opt.${mr}`);this.creator=hr.create,this.destroyer=hr.destroy,this.validate=typeof hr.validate=="function"?hr.validate:()=>!0,this.log=hr.log||(()=>{}),this.acquireTimeoutMillis=hr.acquireTimeoutMillis||3e4,this.createTimeoutMillis=hr.createTimeoutMillis||3e4,this.destroyTimeoutMillis=hr.destroyTimeoutMillis||5e3,this.idleTimeoutMillis=hr.idleTimeoutMillis||3e4,this.reapIntervalMillis=hr.reapIntervalMillis||1e3,this.createRetryIntervalMillis=hr.createRetryIntervalMillis||200,this.propagateCreateError=!!hr.propagateCreateError,this.min=hr.min,this.max=hr.max,this.used=[],this.free=[],this.pendingCreates=[],this.pendingAcquires=[],this.pendingDestroys=[],this.pendingValidations=[],this.destroyed=!1,this.interval=null,this.eventId=1}numUsed(){return this.used.length}numFree(){return this.free.length}numPendingAcquires(){return this.pendingAcquires.length}numPendingValidations(){return this.pendingValidations.length}numPendingCreates(){return this.pendingCreates.length}acquire(){const hr=this.eventId++;this._executeEventHandlers("acquireRequest",hr);const fr=new e.PendingOperation(this.acquireTimeoutMillis);return this.pendingAcquires.push(fr),fr.promise=fr.promise.then(mr=>(this._executeEventHandlers("acquireSuccess",hr,mr),mr)).catch(mr=>(this._executeEventHandlers("acquireFail",hr,mr),ir(this.pendingAcquires,fr),Promise.reject(mr))),this._tryAcquireOrCreate(),fr}release(hr){this._executeEventHandlers("release",hr);for(let fr=0,mr=this.used.length;fr<mr;++fr){const _r=this.used[fr];if(_r.resource===hr)return this.used.splice(fr,1),this.free.push(_r.resolve()),this._tryAcquireOrCreate(),!0}return!1}isEmpty(){return[this.numFree(),this.numUsed(),this.numPendingAcquires(),this.numPendingValidations(),this.numPendingCreates()].reduce((hr,fr)=>hr+fr)===0}check(){const hr=I.now(),fr=[],mr=this.min-this.used.length,_r=this.free.length-mr;let yr=0;this.free.forEach(xr=>{I.duration(hr,xr.timestamp)>=this.idleTimeoutMillis&&yr<_r?(yr++,this._destroy(xr.resource)):fr.push(xr)}),this.free=fr,this.isEmpty()&&this._stopReaping()}destroy(){const hr=this.eventId++;return this._executeEventHandlers("poolDestroyRequest",hr),this._stopReaping(),this.destroyed=!0,I.reflect(Promise.all(this.pendingCreates.map(fr=>I.reflect(fr.promise))).then(()=>new Promise((fr,mr)=>{if(this.numPendingValidations()===0){fr();return}const _r=setInterval(()=>{this.numPendingValidations()===0&&(tr.clearInterval(_r),fr())},100)})).then(()=>Promise.all(this.used.map(fr=>I.reflect(fr.promise)))).then(()=>Promise.all(this.pendingAcquires.map(fr=>(fr.abort(),I.reflect(fr.promise))))).then(()=>Promise.all(this.free.map(fr=>I.reflect(this._destroy(fr.resource))))).then(()=>Promise.all(this.pendingDestroys.map(fr=>fr.promise))).then(()=>{this.free=[],this.pendingAcquires=[]})).then(fr=>(this._executeEventHandlers("poolDestroySuccess",hr),this.emitter.removeAllListeners(),fr))}on(hr,fr){this.emitter.on(hr,fr)}removeListener(hr,fr){this.emitter.removeListener(hr,fr)}removeAllListeners(hr){this.emitter.removeAllListeners(hr)}_tryAcquireOrCreate(){this.destroyed||(this._hasFreeResources()?this._doAcquire():this._shouldCreateMoreResources()&&this._doCreate())}_hasFreeResources(){return this.free.length>0}_doAcquire(){for(;this._canAcquire();){const hr=this.pendingAcquires.shift(),fr=this.free.pop();if(fr===void 0||hr===void 0){const _r="this.free was empty while trying to acquire resource";throw this.log(`Tarn: ${_r}`,"warn"),new Error(`Internal error, should never happen. ${_r}`)}this.pendingValidations.push(hr),this.used.push(fr);const mr=new e.PendingOperation(this.acquireTimeoutMillis);hr.promise.catch(_r=>{mr.abort()}),mr.promise.catch(_r=>(this.log("Tarn: resource validator threw an exception "+_r.stack,"warn"),!1)).then(_r=>{try{_r&&!hr.isRejected?(this._startReaping(),hr.resolve(fr.resource)):(ir(this.used,fr),_r?this.free.push(fr):(this._destroy(fr.resource),setTimeout(()=>{this._tryAcquireOrCreate()},0)),hr.isRejected||this.pendingAcquires.unshift(hr))}finally{ir(this.pendingValidations,hr)}}),this._validateResource(fr.resource).then(_r=>{mr.resolve(_r)}).catch(_r=>{mr.reject(_r)})}}_canAcquire(){return this.free.length>0&&this.pendingAcquires.length>0}_validateResource(hr){try{return Promise.resolve(this.validate(hr))}catch(fr){return Promise.reject(fr)}}_shouldCreateMoreResources(){return this.used.length+this.pendingCreates.length<this.max&&this.pendingCreates.length<this.pendingAcquires.length}_doCreate(){const hr=this.pendingAcquires.slice();this._create().promise.then(()=>(this._tryAcquireOrCreate(),null)).catch(mr=>{this.propagateCreateError&&this.pendingAcquires.length!==0&&this.pendingAcquires[0].reject(mr),hr.forEach(_r=>{_r.possibleTimeoutCause=mr}),I.delay(this.createRetryIntervalMillis).then(()=>this._tryAcquireOrCreate())})}_create(){const hr=this.eventId++;this._executeEventHandlers("createRequest",hr);const fr=new e.PendingOperation(this.createTimeoutMillis);return fr.promise=fr.promise.catch(mr=>{throw ir(this.pendingCreates,fr)&&this._executeEventHandlers("createFail",hr,mr),mr}),this.pendingCreates.push(fr),lr(this.creator).then(mr=>fr.isRejected?(this.destroyer(mr),null):(ir(this.pendingCreates,fr),this.free.push(new t.Resource(mr)),fr.resolve(mr),this._executeEventHandlers("createSuccess",hr,mr),null)).catch(mr=>(fr.isRejected||(ir(this.pendingCreates,fr)&&this._executeEventHandlers("createFail",hr,mr),fr.reject(mr)),null)),fr}_destroy(hr){const fr=this.eventId++;this._executeEventHandlers("destroyRequest",fr,hr);const mr=new e.PendingOperation(this.destroyTimeoutMillis);return Promise.resolve().then(()=>this.destroyer(hr)).then(()=>{mr.resolve(hr)}).catch(yr=>{mr.reject(yr)}),this.pendingDestroys.push(mr),mr.promise.then(yr=>(this._executeEventHandlers("destroySuccess",fr,hr),yr)).catch(yr=>this._logDestroyerError(fr,hr,yr)).then(yr=>{const xr=this.pendingDestroys.findIndex(Mr=>Mr===mr);return this.pendingDestroys.splice(xr,1),yr})}_logDestroyerError(hr,fr,mr){this._executeEventHandlers("destroyFail",hr,fr,mr),this.log("Tarn: resource destroyer threw an exception "+mr.stack,"warn")}_startReaping(){this.interval||(this._executeEventHandlers("startReaping"),this.interval=setInterval(()=>this.check(),this.reapIntervalMillis))}_stopReaping(){this.interval!==null&&(this._executeEventHandlers("stopReaping"),tr.clearInterval(this.interval)),this.interval=null}_executeEventHandlers(hr,...fr){this.emitter.listeners(hr).forEach(_r=>{try{_r(...fr)}catch(yr){this.log(`Tarn: event handler "${hr}" threw an exception ${yr.stack}`,"warn")}})}};Pool.Pool=rr;function ir(dr,hr){const fr=dr.indexOf(hr);return fr===-1?!1:(dr.splice(fr,1),!0)}function lr(dr){return new Promise((hr,fr)=>{const mr=(_r,yr)=>{_r?fr(_r):hr(yr)};I.tryPromise(()=>dr(mr)).then(_r=>{_r&&hr(_r)}).catch(_r=>{fr(_r)})})}return Pool}var hasRequiredTarn;function requireTarn(){return hasRequiredTarn||(hasRequiredTarn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const I=requirePool();t.Pool=I.Pool;const B=requireTimeoutError();t.TimeoutError=B.TimeoutError,e.exports={Pool:I.Pool,TimeoutError:B.TimeoutError}}(tarn,tarn.exports)),tarn.exports}var util={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},I=Symbol("test"),B=Object(I);if(typeof I=="string"||Object.prototype.toString.call(I)!=="[object Symbol]"||Object.prototype.toString.call(B)!=="[object Symbol]")return!1;var tr=42;t[I]=tr;for(var rr in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var ir=Object.getOwnPropertySymbols(t);if(ir.length!==1||ir[0]!==I||!Object.prototype.propertyIsEnumerable.call(t,I))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var lr=Object.getOwnPropertyDescriptor(t,I);if(lr.value!==tr||lr.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref$1,hasRequiredRef$1;function requireRef$1(){return hasRequiredRef$1||(hasRequiredRef$1=1,ref$1=ReferenceError),ref$1}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max=Math.max),max}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round=Math.round),round}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var sign,hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign;hasRequiredSign=1;var e=require_isNaN();return sign=function(I){return e(I)||I===0?I:I<0?-1:1},sign}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var e=requireGOPD();if(e)try{e([],"length")}catch{e=null}return gopd=e,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return esDefineProperty=e,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var e=requireEsObjectAtoms();return Object_getPrototypeOf=e.getPrototypeOf||null,Object_getPrototypeOf}var implementation$4,hasRequiredImplementation$4;function requireImplementation$4(){if(hasRequiredImplementation$4)return implementation$4;hasRequiredImplementation$4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,I=Math.max,B="[object Function]",tr=function(dr,hr){for(var fr=[],mr=0;mr<dr.length;mr+=1)fr[mr]=dr[mr];for(var _r=0;_r<hr.length;_r+=1)fr[_r+dr.length]=hr[_r];return fr},rr=function(dr,hr){for(var fr=[],mr=hr,_r=0;mr<dr.length;mr+=1,_r+=1)fr[_r]=dr[mr];return fr},ir=function(lr,dr){for(var hr="",fr=0;fr<lr.length;fr+=1)hr+=lr[fr],fr+1<lr.length&&(hr+=dr);return hr};return implementation$4=function(dr){var hr=this;if(typeof hr!="function"||t.apply(hr)!==B)throw new TypeError(e+hr);for(var fr=rr(arguments,1),mr,_r=function(){if(this instanceof mr){var Sr=hr.apply(this,tr(fr,arguments));return Object(Sr)===Sr?Sr:this}return hr.apply(dr,tr(fr,arguments))},yr=I(0,hr.length-fr.length),xr=[],Mr=0;Mr<yr;Mr++)xr[Mr]="$"+Mr;if(mr=Function("binder","return function ("+ir(xr,",")+"){ return binder.apply(this,arguments); }")(_r),hr.prototype){var vr=function(){};vr.prototype=hr.prototype,mr.prototype=new vr,vr.prototype=null}return mr},implementation$4}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var e=requireImplementation$4();return functionBind=Function.prototype.bind||e,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),I=requireFunctionCall(),B=requireReflectApply();return actualApply=B||e.call(I,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType(),I=requireFunctionCall(),B=requireActualApply();return callBindApplyHelpers=function(rr){if(rr.length<1||typeof rr[0]!="function")throw new t("a function is required");return B(e,I,rr)},callBindApplyHelpers}var get,hasRequiredGet$1;function requireGet$1(){if(hasRequiredGet$1)return get;hasRequiredGet$1=1;var e=requireCallBindApplyHelpers(),t=requireGopd(),I;try{I=[].__proto__===Array.prototype}catch(ir){if(!ir||typeof ir!="object"||!("code"in ir)||ir.code!=="ERR_PROTO_ACCESS")throw ir}var B=!!I&&t&&t(Object.prototype,"__proto__"),tr=Object,rr=tr.getPrototypeOf;return get=B&&typeof B.get=="function"?e([B.get]):typeof rr=="function"?function(lr){return rr(lr==null?lr:tr(lr))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var e=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),I=requireGet$1();return getProto=e?function(tr){return e(tr)}:t?function(tr){if(!tr||typeof tr!="object"&&typeof tr!="function")throw new TypeError("getProto: not an object");return t(tr)}:I?function(tr){return I(tr)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,I=requireFunctionBind();return hasown=I.call(e,t),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var e,t=requireEsObjectAtoms(),I=requireEsErrors(),B=require_eval(),tr=requireRange(),rr=requireRef$1(),ir=requireSyntax(),lr=requireType(),dr=requireUri(),hr=requireAbs(),fr=requireFloor(),mr=requireMax(),_r=requireMin(),yr=requirePow(),xr=requireRound(),Mr=requireSign(),vr=Function,Sr=function(ci){try{return vr('"use strict"; return ('+ci+").constructor;")()}catch{}},wr=requireGopd(),br=requireEsDefineProperty(),Ar=function(){throw new lr},kr=wr?function(){try{return Ar}catch{try{return wr(arguments,"callee").get}catch{return Ar}}}():Ar,Dr=requireHasSymbols()(),Or=requireGetProto(),zr=requireObject_getPrototypeOf(),$n=requireReflect_getPrototypeOf(),Fr=requireFunctionApply(),$r=requireFunctionCall(),Hn={},ti=typeof Uint8Array>"u"||!Or?e:Or(Uint8Array),Ir={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":Dr&&Or?Or([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":Hn,"%AsyncGenerator%":Hn,"%AsyncGeneratorFunction%":Hn,"%AsyncIteratorPrototype%":Hn,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":I,"%eval%":eval,"%EvalError%":B,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":vr,"%GeneratorFunction%":Hn,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Dr&&Or?Or(Or([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Dr||!Or?e:Or(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":wr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":tr,"%ReferenceError%":rr,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Dr||!Or?e:Or(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Dr&&Or?Or(""[Symbol.iterator]()):e,"%Symbol%":Dr?Symbol:e,"%SyntaxError%":ir,"%ThrowTypeError%":kr,"%TypedArray%":ti,"%TypeError%":lr,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":dr,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":$r,"%Function.prototype.apply%":Fr,"%Object.defineProperty%":br,"%Object.getPrototypeOf%":zr,"%Math.abs%":hr,"%Math.floor%":fr,"%Math.max%":mr,"%Math.min%":_r,"%Math.pow%":yr,"%Math.round%":xr,"%Math.sign%":Mr,"%Reflect.getPrototypeOf%":$n},Lr=function ci(ai){var fi;if(ai==="%AsyncFunction%")fi=Sr("async function () {}");else if(ai==="%GeneratorFunction%")fi=Sr("function* () {}");else if(ai==="%AsyncGeneratorFunction%")fi=Sr("async function* () {}");else if(ai==="%AsyncGenerator%"){var vi=ci("%AsyncGeneratorFunction%");vi&&(fi=vi.prototype)}else if(ai==="%AsyncIteratorPrototype%"){var xi=ci("%AsyncGenerator%");xi&&Or&&(fi=Or(xi.prototype))}return Ir[ai]=fi,fi},Kn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},pi=requireFunctionBind(),gi=requireHasown(),oi=pi.call($r,Array.prototype.concat),qn=pi.call(Fr,Array.prototype.splice),li=pi.call($r,String.prototype.replace),di=pi.call($r,String.prototype.slice),Jn=pi.call($r,RegExp.prototype.exec),Qr=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jr=/\\(\\)?/g,ei=function(ai){var fi=di(ai,0,1),vi=di(ai,-1);if(fi==="%"&&vi!=="%")throw new ir("invalid intrinsic syntax, expected closing `%`");if(vi==="%"&&fi!=="%")throw new ir("invalid intrinsic syntax, expected opening `%`");var xi=[];return li(ai,Qr,function(Ci,Yn,ii,$i){xi[xi.length]=ii?li($i,Jr,"$1"):Yn||Ci}),xi},mi=function(ai,fi){var vi=ai,xi;if(gi(Kn,vi)&&(xi=Kn[vi],vi="%"+xi[0]+"%"),gi(Ir,vi)){var Ci=Ir[vi];if(Ci===Hn&&(Ci=Lr(vi)),typeof Ci>"u"&&!fi)throw new lr("intrinsic "+ai+" exists, but is not available. Please file an issue!");return{alias:xi,name:vi,value:Ci}}throw new ir("intrinsic "+ai+" does not exist!")};return getIntrinsic=function(ai,fi){if(typeof ai!="string"||ai.length===0)throw new lr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof fi!="boolean")throw new lr('"allowMissing" argument must be a boolean');if(Jn(/^%?[^%]*%?$/,ai)===null)throw new ir("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var vi=ei(ai),xi=vi.length>0?vi[0]:"",Ci=mi("%"+xi+"%",fi),Yn=Ci.name,ii=Ci.value,$i=!1,Ti=Ci.alias;Ti&&(xi=Ti[0],qn(vi,oi([0,1],Ti)));for(var Qi=1,hi=!0;Qi<vi.length;Qi+=1){var hs=vi[Qi],Yi=di(hs,0,1),ss=di(hs,-1);if((Yi==='"'||Yi==="'"||Yi==="`"||ss==='"'||ss==="'"||ss==="`")&&Yi!==ss)throw new ir("property names with quotes must have matching quotes");if((hs==="constructor"||!hi)&&($i=!0),xi+="."+hs,Yn="%"+xi+"%",gi(Ir,Yn))ii=Ir[Yn];else if(ii!=null){if(!(hs in ii)){if(!fi)throw new lr("base intrinsic for "+ai+" exists, but the property is not available.");return}if(wr&&Qi+1>=vi.length){var Bi=wr(ii,hs);hi=!!Bi,hi&&"get"in Bi&&!("originalValue"in Bi.get)?ii=Bi.get:ii=ii[hs]}else hi=gi(ii,hs),ii=ii[hs];hi&&!$i&&(Ir[Yn]=ii)}}return ii},getIntrinsic}var callBound$1,hasRequiredCallBound$1;function requireCallBound$1(){if(hasRequiredCallBound$1)return callBound$1;hasRequiredCallBound$1=1;var e=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),I=t([e("%String.prototype.indexOf%")]);return callBound$1=function(tr,rr){var ir=e(tr,!!rr);return typeof ir=="function"&&I(tr,".prototype.")>-1?t([ir]):ir},callBound$1}var isArguments$1,hasRequiredIsArguments$2;function requireIsArguments$2(){if(hasRequiredIsArguments$2)return isArguments$1;hasRequiredIsArguments$2=1;var e=requireShams()(),t=requireCallBound$1(),I=t("Object.prototype.toString"),B=function(lr){return e&&lr&&typeof lr=="object"&&Symbol.toStringTag in lr?!1:I(lr)==="[object Arguments]"},tr=function(lr){return B(lr)?!0:lr!==null&&typeof lr=="object"&&"length"in lr&&typeof lr.length=="number"&&lr.length>=0&&I(lr)!=="[object Array]"&&"callee"in lr&&I(lr.callee)==="[object Function]"},rr=function(){return B(arguments)}();return B.isLegacyArguments=tr,isArguments$1=rr?B:tr,isArguments$1}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var e=requireCallBound$1(),t=requireShams()(),I=requireHasown(),B=requireGopd(),tr;if(t){var rr=e("RegExp.prototype.exec"),ir={},lr=function(){throw ir},dr={toString:lr,valueOf:lr};typeof Symbol.toPrimitive=="symbol"&&(dr[Symbol.toPrimitive]=lr),tr=function(_r){if(!_r||typeof _r!="object")return!1;var yr=B(_r,"lastIndex"),xr=yr&&I(yr,"value");if(!xr)return!1;try{rr(_r,dr)}catch(Mr){return Mr===ir}}}else{var hr=e("Object.prototype.toString"),fr="[object RegExp]";tr=function(_r){return!_r||typeof _r!="object"&&typeof _r!="function"?!1:hr(_r)===fr}}return isRegex=tr,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound$1(),t=requireIsRegex(),I=e("RegExp.prototype.exec"),B=requireType();return safeRegexTest=function(rr){if(!t(rr))throw new B("`regex` must be a RegExp");return function(lr){return I(rr,lr)!==null}},safeRegexTest}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var e=requireCallBound$1(),t=requireSafeRegexTest(),I=t(/^\s*(?:function)?\*/),B=requireShams()(),tr=requireGetProto(),rr=e("Object.prototype.toString"),ir=e("Function.prototype.toString"),lr=function(){if(!B)return!1;try{return Function("return function*() {}")()}catch{}},dr;return isGeneratorFunction=function(fr){if(typeof fr!="function")return!1;if(I(ir(fr)))return!0;if(!B){var mr=rr(fr);return mr==="[object GeneratorFunction]"}if(!tr)return!1;if(typeof dr>"u"){var _r=lr();dr=_r?tr(_r):!1}return tr(fr)===dr},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,I,B;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{I=Object.defineProperty({},"length",{get:function(){throw B}}),B={},t(function(){throw 42},null,I)}catch(wr){wr!==B&&(t=null)}else t=null;var tr=/^\s*class\b/,rr=function(br){try{var Ar=e.call(br);return tr.test(Ar)}catch{return!1}},ir=function(br){try{return rr(br)?!1:(e.call(br),!0)}catch{return!1}},lr=Object.prototype.toString,dr="[object Object]",hr="[object Function]",fr="[object GeneratorFunction]",mr="[object HTMLAllCollection]",_r="[object HTML document.all class]",yr="[object HTMLCollection]",xr=typeof Symbol=="function"&&!!Symbol.toStringTag,Mr=!(0 in[,]),vr=function(){return!1};if(typeof document=="object"){var Sr=document.all;lr.call(Sr)===lr.call(document.all)&&(vr=function(br){if((Mr||!br)&&(typeof br>"u"||typeof br=="object"))try{var Ar=lr.call(br);return(Ar===mr||Ar===_r||Ar===yr||Ar===dr)&&br("")==null}catch{}return!1})}return isCallable=t?function(br){if(vr(br))return!0;if(!br||typeof br!="function"&&typeof br!="object")return!1;try{t(br,null,I)}catch(Ar){if(Ar!==B)return!1}return!rr(br)&&ir(br)}:function(br){if(vr(br))return!0;if(!br||typeof br!="function"&&typeof br!="object")return!1;if(xr)return ir(br);if(rr(br))return!1;var Ar=lr.call(br);return Ar!==hr&&Ar!==fr&&!/^\[object HTML/.test(Ar)?!1:ir(br)},isCallable}var forEach,hasRequiredForEach$1;function requireForEach$1(){if(hasRequiredForEach$1)return forEach;hasRequiredForEach$1=1;var e=requireIsCallable(),t=Object.prototype.toString,I=Object.prototype.hasOwnProperty,B=function(dr,hr,fr){for(var mr=0,_r=dr.length;mr<_r;mr++)I.call(dr,mr)&&(fr==null?hr(dr[mr],mr,dr):hr.call(fr,dr[mr],mr,dr))},tr=function(dr,hr,fr){for(var mr=0,_r=dr.length;mr<_r;mr++)fr==null?hr(dr.charAt(mr),mr,dr):hr.call(fr,dr.charAt(mr),mr,dr)},rr=function(dr,hr,fr){for(var mr in dr)I.call(dr,mr)&&(fr==null?hr(dr[mr],mr,dr):hr.call(fr,dr[mr],mr,dr))};function ir(lr){return t.call(lr)==="[object Array]"}return forEach=function(dr,hr,fr){if(!e(hr))throw new TypeError("iterator must be a function");var mr;arguments.length>=3&&(mr=fr),ir(dr)?B(dr,hr,mr):typeof dr=="string"?tr(dr,hr,mr):rr(dr,hr,mr)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var e=requirePossibleTypedArrayNames(),t=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var B=[],tr=0;tr<e.length;tr++)typeof t[e[tr]]=="function"&&(B[B.length]=e[tr]);return B},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var e=requireEsDefineProperty(),t=requireSyntax(),I=requireType(),B=requireGopd();return defineDataProperty=function(rr,ir,lr){if(!rr||typeof rr!="object"&&typeof rr!="function")throw new I("`obj` must be an object or a function`");if(typeof ir!="string"&&typeof ir!="symbol")throw new I("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new I("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new I("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new I("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new I("`loose`, if provided, must be a boolean");var dr=arguments.length>3?arguments[3]:null,hr=arguments.length>4?arguments[4]:null,fr=arguments.length>5?arguments[5]:null,mr=arguments.length>6?arguments[6]:!1,_r=!!B&&B(rr,ir);if(e)e(rr,ir,{configurable:fr===null&&_r?_r.configurable:!fr,enumerable:dr===null&&_r?_r.enumerable:!dr,value:lr,writable:hr===null&&_r?_r.writable:!hr});else if(mr||!dr&&!hr&&!fr)rr[ir]=lr;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),I=requireHasPropertyDescriptors()(),B=requireGopd(),tr=requireType(),rr=e("%Math.floor%");return setFunctionLength=function(lr,dr){if(typeof lr!="function")throw new tr("`fn` is not a function");if(typeof dr!="number"||dr<0||dr>4294967295||rr(dr)!==dr)throw new tr("`length` must be a positive 32-bit integer");var hr=arguments.length>2&&!!arguments[2],fr=!0,mr=!0;if("length"in lr&&B){var _r=B(lr,"length");_r&&!_r.configurable&&(fr=!1),_r&&!_r.writable&&(mr=!1)}return(fr||mr||!hr)&&(I?t(lr,"length",dr,!0,!0):t(lr,"length",dr)),lr},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),I=requireActualApply();return applyBind=function(){return I(e,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,function(e){var t=requireSetFunctionLength(),I=requireEsDefineProperty(),B=requireCallBindApplyHelpers(),tr=requireApplyBind();e.exports=function(ir){var lr=B(arguments),dr=ir.length-(arguments.length-1);return t(lr,1+(dr>0?dr:0),!0)},I?I(e.exports,"apply",{value:tr}):e.exports.apply=tr}(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var e=requireForEach$1(),t=requireAvailableTypedArrays(),I=requireCallBind(),B=requireCallBound$1(),tr=requireGopd(),rr=requireGetProto(),ir=B("Object.prototype.toString"),lr=requireShams()(),dr=typeof globalThis>"u"?commonjsGlobal:globalThis,hr=t(),fr=B("String.prototype.slice"),mr=B("Array.prototype.indexOf",!0)||function(vr,Sr){for(var wr=0;wr<vr.length;wr+=1)if(vr[wr]===Sr)return wr;return-1},_r={__proto__:null};lr&&tr&&rr?e(hr,function(Mr){var vr=new dr[Mr];if(Symbol.toStringTag in vr&&rr){var Sr=rr(vr),wr=tr(Sr,Symbol.toStringTag);if(!wr&&Sr){var br=rr(Sr);wr=tr(br,Symbol.toStringTag)}_r["$"+Mr]=I(wr.get)}}):e(hr,function(Mr){var vr=new dr[Mr],Sr=vr.slice||vr.set;Sr&&(_r["$"+Mr]=I(Sr))});var yr=function(vr){var Sr=!1;return e(_r,function(wr,br){if(!Sr)try{"$"+wr(vr)===br&&(Sr=fr(br,1))}catch{}}),Sr},xr=function(vr){var Sr=!1;return e(_r,function(wr,br){if(!Sr)try{wr(vr),Sr=fr(br,1)}catch{}}),Sr};return whichTypedArray=function(vr){if(!vr||typeof vr!="object")return!1;if(!lr){var Sr=fr(ir(vr),8,-1);return mr(hr,Sr)>-1?Sr:Sr!=="Object"?!1:xr(vr)}return tr?yr(vr):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray$1;function requireIsTypedArray$1(){if(hasRequiredIsTypedArray$1)return isTypedArray;hasRequiredIsTypedArray$1=1;var e=requireWhichTypedArray();return isTypedArray=function(I){return!!e(I)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(e){var t=requireIsArguments$2(),I=requireIsGeneratorFunction(),B=requireWhichTypedArray(),tr=requireIsTypedArray$1();function rr(hi){return hi.call.bind(hi)}var ir=typeof BigInt<"u",lr=typeof Symbol<"u",dr=rr(Object.prototype.toString),hr=rr(Number.prototype.valueOf),fr=rr(String.prototype.valueOf),mr=rr(Boolean.prototype.valueOf);if(ir)var _r=rr(BigInt.prototype.valueOf);if(lr)var yr=rr(Symbol.prototype.valueOf);function xr(hi,hs){if(typeof hi!="object")return!1;try{return hs(hi),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=I,e.isTypedArray=tr;function Mr(hi){return typeof Promise<"u"&&hi instanceof Promise||hi!==null&&typeof hi=="object"&&typeof hi.then=="function"&&typeof hi.catch=="function"}e.isPromise=Mr;function vr(hi){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(hi):tr(hi)||Jn(hi)}e.isArrayBufferView=vr;function Sr(hi){return B(hi)==="Uint8Array"}e.isUint8Array=Sr;function wr(hi){return B(hi)==="Uint8ClampedArray"}e.isUint8ClampedArray=wr;function br(hi){return B(hi)==="Uint16Array"}e.isUint16Array=br;function Ar(hi){return B(hi)==="Uint32Array"}e.isUint32Array=Ar;function kr(hi){return B(hi)==="Int8Array"}e.isInt8Array=kr;function Dr(hi){return B(hi)==="Int16Array"}e.isInt16Array=Dr;function Or(hi){return B(hi)==="Int32Array"}e.isInt32Array=Or;function zr(hi){return B(hi)==="Float32Array"}e.isFloat32Array=zr;function $n(hi){return B(hi)==="Float64Array"}e.isFloat64Array=$n;function Fr(hi){return B(hi)==="BigInt64Array"}e.isBigInt64Array=Fr;function $r(hi){return B(hi)==="BigUint64Array"}e.isBigUint64Array=$r;function Hn(hi){return dr(hi)==="[object Map]"}Hn.working=typeof Map<"u"&&Hn(new Map);function ti(hi){return typeof Map>"u"?!1:Hn.working?Hn(hi):hi instanceof Map}e.isMap=ti;function Ir(hi){return dr(hi)==="[object Set]"}Ir.working=typeof Set<"u"&&Ir(new Set);function Lr(hi){return typeof Set>"u"?!1:Ir.working?Ir(hi):hi instanceof Set}e.isSet=Lr;function Kn(hi){return dr(hi)==="[object WeakMap]"}Kn.working=typeof WeakMap<"u"&&Kn(new WeakMap);function pi(hi){return typeof WeakMap>"u"?!1:Kn.working?Kn(hi):hi instanceof WeakMap}e.isWeakMap=pi;function gi(hi){return dr(hi)==="[object WeakSet]"}gi.working=typeof WeakSet<"u"&&gi(new WeakSet);function oi(hi){return gi(hi)}e.isWeakSet=oi;function qn(hi){return dr(hi)==="[object ArrayBuffer]"}qn.working=typeof ArrayBuffer<"u"&&qn(new ArrayBuffer);function li(hi){return typeof ArrayBuffer>"u"?!1:qn.working?qn(hi):hi instanceof ArrayBuffer}e.isArrayBuffer=li;function di(hi){return dr(hi)==="[object DataView]"}di.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&di(new DataView(new ArrayBuffer(1),0,1));function Jn(hi){return typeof DataView>"u"?!1:di.working?di(hi):hi instanceof DataView}e.isDataView=Jn;var Qr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Jr(hi){return dr(hi)==="[object SharedArrayBuffer]"}function ei(hi){return typeof Qr>"u"?!1:(typeof Jr.working>"u"&&(Jr.working=Jr(new Qr)),Jr.working?Jr(hi):hi instanceof Qr)}e.isSharedArrayBuffer=ei;function mi(hi){return dr(hi)==="[object AsyncFunction]"}e.isAsyncFunction=mi;function ci(hi){return dr(hi)==="[object Map Iterator]"}e.isMapIterator=ci;function ai(hi){return dr(hi)==="[object Set Iterator]"}e.isSetIterator=ai;function fi(hi){return dr(hi)==="[object Generator]"}e.isGeneratorObject=fi;function vi(hi){return dr(hi)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=vi;function xi(hi){return xr(hi,hr)}e.isNumberObject=xi;function Ci(hi){return xr(hi,fr)}e.isStringObject=Ci;function Yn(hi){return xr(hi,mr)}e.isBooleanObject=Yn;function ii(hi){return ir&&xr(hi,_r)}e.isBigIntObject=ii;function $i(hi){return lr&&xr(hi,yr)}e.isSymbolObject=$i;function Ti(hi){return xi(hi)||Ci(hi)||Yn(hi)||ii(hi)||$i(hi)}e.isBoxedPrimitive=Ti;function Qi(hi){return typeof Uint8Array<"u"&&(li(hi)||ei(hi))}e.isAnyArrayBuffer=Qi,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(hi){Object.defineProperty(e,hi,{enumerable:!1,value:function(){throw new Error(hi+" is not supported in userland")}})})}(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),isBufferBrowser}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(t,I){I&&(t.super_=I,t.prototype=Object.create(I.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(t,I){if(I){t.super_=I;var B=function(){};B.prototype=I.prototype,t.prototype=new B,t.prototype.constructor=t}}),inherits_browser.exports}var hasRequiredUtil;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,function(e){var t={},I=Object.getOwnPropertyDescriptors||function(Qr){for(var Jr=Object.keys(Qr),ei={},mi=0;mi<Jr.length;mi++)ei[Jr[mi]]=Object.getOwnPropertyDescriptor(Qr,Jr[mi]);return ei},B=/%[sdj%]/g;e.format=function(Jn){if(!Dr(Jn)){for(var Qr=[],Jr=0;Jr<arguments.length;Jr++)Qr.push(lr(arguments[Jr]));return Qr.join(" ")}for(var Jr=1,ei=arguments,mi=ei.length,ci=String(Jn).replace(B,function(fi){if(fi==="%%")return"%";if(Jr>=mi)return fi;switch(fi){case"%s":return String(ei[Jr++]);case"%d":return Number(ei[Jr++]);case"%j":try{return JSON.stringify(ei[Jr++])}catch{return"[Circular]"}default:return fi}}),ai=ei[Jr];Jr<mi;ai=ei[++Jr])br(ai)||!Fr(ai)?ci+=" "+ai:ci+=" "+lr(ai);return ci},e.deprecate=function(Jn,Qr){if(typeof process<"u"&&process.noDeprecation===!0)return Jn;if(typeof process>"u")return function(){return e.deprecate(Jn,Qr).apply(this,arguments)};var Jr=!1;function ei(){if(!Jr){if(process.throwDeprecation)throw new Error(Qr);process.traceDeprecation?console.trace(Qr):console.error(Qr),Jr=!0}return Jn.apply(this,arguments)}return ei};var tr={},rr=/^$/;if(t.NODE_DEBUG){var ir=t.NODE_DEBUG;ir=ir.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),rr=new RegExp("^"+ir+"$","i")}e.debuglog=function(Jn){if(Jn=Jn.toUpperCase(),!tr[Jn])if(rr.test(Jn)){var Qr=process.pid;tr[Jn]=function(){var Jr=e.format.apply(e,arguments);console.error("%s %d: %s",Jn,Qr,Jr)}}else tr[Jn]=function(){};return tr[Jn]};function lr(Jn,Qr){var Jr={seen:[],stylize:hr};return arguments.length>=3&&(Jr.depth=arguments[2]),arguments.length>=4&&(Jr.colors=arguments[3]),wr(Qr)?Jr.showHidden=Qr:Qr&&e._extend(Jr,Qr),zr(Jr.showHidden)&&(Jr.showHidden=!1),zr(Jr.depth)&&(Jr.depth=2),zr(Jr.colors)&&(Jr.colors=!1),zr(Jr.customInspect)&&(Jr.customInspect=!0),Jr.colors&&(Jr.stylize=dr),mr(Jr,Jn,Jr.depth)}e.inspect=lr,lr.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},lr.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function dr(Jn,Qr){var Jr=lr.styles[Qr];return Jr?"\x1B["+lr.colors[Jr][0]+"m"+Jn+"\x1B["+lr.colors[Jr][1]+"m":Jn}function hr(Jn,Qr){return Jn}function fr(Jn){var Qr={};return Jn.forEach(function(Jr,ei){Qr[Jr]=!0}),Qr}function mr(Jn,Qr,Jr){if(Jn.customInspect&&Qr&&ti(Qr.inspect)&&Qr.inspect!==e.inspect&&!(Qr.constructor&&Qr.constructor.prototype===Qr)){var ei=Qr.inspect(Jr,Jn);return Dr(ei)||(ei=mr(Jn,ei,Jr)),ei}var mi=_r(Jn,Qr);if(mi)return mi;var ci=Object.keys(Qr),ai=fr(ci);if(Jn.showHidden&&(ci=Object.getOwnPropertyNames(Qr)),Hn(Qr)&&(ci.indexOf("message")>=0||ci.indexOf("description")>=0))return yr(Qr);if(ci.length===0){if(ti(Qr)){var fi=Qr.name?": "+Qr.name:"";return Jn.stylize("[Function"+fi+"]","special")}if($n(Qr))return Jn.stylize(RegExp.prototype.toString.call(Qr),"regexp");if($r(Qr))return Jn.stylize(Date.prototype.toString.call(Qr),"date");if(Hn(Qr))return yr(Qr)}var vi="",xi=!1,Ci=["{","}"];if(Sr(Qr)&&(xi=!0,Ci=["[","]"]),ti(Qr)){var Yn=Qr.name?": "+Qr.name:"";vi=" [Function"+Yn+"]"}if($n(Qr)&&(vi=" "+RegExp.prototype.toString.call(Qr)),$r(Qr)&&(vi=" "+Date.prototype.toUTCString.call(Qr)),Hn(Qr)&&(vi=" "+yr(Qr)),ci.length===0&&(!xi||Qr.length==0))return Ci[0]+vi+Ci[1];if(Jr<0)return $n(Qr)?Jn.stylize(RegExp.prototype.toString.call(Qr),"regexp"):Jn.stylize("[Object]","special");Jn.seen.push(Qr);var ii;return xi?ii=xr(Jn,Qr,Jr,ai,ci):ii=ci.map(function($i){return Mr(Jn,Qr,Jr,ai,$i,xi)}),Jn.seen.pop(),vr(ii,vi,Ci)}function _r(Jn,Qr){if(zr(Qr))return Jn.stylize("undefined","undefined");if(Dr(Qr)){var Jr="'"+JSON.stringify(Qr).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Jn.stylize(Jr,"string")}if(kr(Qr))return Jn.stylize(""+Qr,"number");if(wr(Qr))return Jn.stylize(""+Qr,"boolean");if(br(Qr))return Jn.stylize("null","null")}function yr(Jn){return"["+Error.prototype.toString.call(Jn)+"]"}function xr(Jn,Qr,Jr,ei,mi){for(var ci=[],ai=0,fi=Qr.length;ai<fi;++ai)oi(Qr,String(ai))?ci.push(Mr(Jn,Qr,Jr,ei,String(ai),!0)):ci.push("");return mi.forEach(function(vi){vi.match(/^\d+$/)||ci.push(Mr(Jn,Qr,Jr,ei,vi,!0))}),ci}function Mr(Jn,Qr,Jr,ei,mi,ci){var ai,fi,vi;if(vi=Object.getOwnPropertyDescriptor(Qr,mi)||{value:Qr[mi]},vi.get?vi.set?fi=Jn.stylize("[Getter/Setter]","special"):fi=Jn.stylize("[Getter]","special"):vi.set&&(fi=Jn.stylize("[Setter]","special")),oi(ei,mi)||(ai="["+mi+"]"),fi||(Jn.seen.indexOf(vi.value)<0?(br(Jr)?fi=mr(Jn,vi.value,null):fi=mr(Jn,vi.value,Jr-1),fi.indexOf(`
|
|
4
|
-
`)>-1&&(ci?fi=fi.split(`
|
|
5
|
-
`).map(function(xi){return" "+xi}).join(`
|
|
6
|
-
`).slice(2):fi=`
|
|
7
|
-
`+fi.split(`
|
|
8
|
-
`).map(function(xi){return" "+xi}).join(`
|
|
9
|
-
`))):fi=Jn.stylize("[Circular]","special")),zr(ai)){if(ci&&mi.match(/^\d+$/))return fi;ai=JSON.stringify(""+mi),ai.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ai=ai.slice(1,-1),ai=Jn.stylize(ai,"name")):(ai=ai.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ai=Jn.stylize(ai,"string"))}return ai+": "+fi}function vr(Jn,Qr,Jr){var ei=Jn.reduce(function(mi,ci){return ci.indexOf(`
|
|
10
|
-
`)>=0,mi+ci.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ei>60?Jr[0]+(Qr===""?"":Qr+`
|
|
11
|
-
`)+" "+Jn.join(`,
|
|
12
|
-
`)+" "+Jr[1]:Jr[0]+Qr+" "+Jn.join(", ")+" "+Jr[1]}e.types=requireTypes();function Sr(Jn){return Array.isArray(Jn)}e.isArray=Sr;function wr(Jn){return typeof Jn=="boolean"}e.isBoolean=wr;function br(Jn){return Jn===null}e.isNull=br;function Ar(Jn){return Jn==null}e.isNullOrUndefined=Ar;function kr(Jn){return typeof Jn=="number"}e.isNumber=kr;function Dr(Jn){return typeof Jn=="string"}e.isString=Dr;function Or(Jn){return typeof Jn=="symbol"}e.isSymbol=Or;function zr(Jn){return Jn===void 0}e.isUndefined=zr;function $n(Jn){return Fr(Jn)&&Lr(Jn)==="[object RegExp]"}e.isRegExp=$n,e.types.isRegExp=$n;function Fr(Jn){return typeof Jn=="object"&&Jn!==null}e.isObject=Fr;function $r(Jn){return Fr(Jn)&&Lr(Jn)==="[object Date]"}e.isDate=$r,e.types.isDate=$r;function Hn(Jn){return Fr(Jn)&&(Lr(Jn)==="[object Error]"||Jn instanceof Error)}e.isError=Hn,e.types.isNativeError=Hn;function ti(Jn){return typeof Jn=="function"}e.isFunction=ti;function Ir(Jn){return Jn===null||typeof Jn=="boolean"||typeof Jn=="number"||typeof Jn=="string"||typeof Jn=="symbol"||typeof Jn>"u"}e.isPrimitive=Ir,e.isBuffer=requireIsBufferBrowser();function Lr(Jn){return Object.prototype.toString.call(Jn)}function Kn(Jn){return Jn<10?"0"+Jn.toString(10):Jn.toString(10)}var pi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gi(){var Jn=new Date,Qr=[Kn(Jn.getHours()),Kn(Jn.getMinutes()),Kn(Jn.getSeconds())].join(":");return[Jn.getDate(),pi[Jn.getMonth()],Qr].join(" ")}e.log=function(){console.log("%s - %s",gi(),e.format.apply(e,arguments))},e.inherits=requireInherits_browser(),e._extend=function(Jn,Qr){if(!Qr||!Fr(Qr))return Jn;for(var Jr=Object.keys(Qr),ei=Jr.length;ei--;)Jn[Jr[ei]]=Qr[Jr[ei]];return Jn};function oi(Jn,Qr){return Object.prototype.hasOwnProperty.call(Jn,Qr)}var qn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(Qr){if(typeof Qr!="function")throw new TypeError('The "original" argument must be of type Function');if(qn&&Qr[qn]){var Jr=Qr[qn];if(typeof Jr!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Jr,qn,{value:Jr,enumerable:!1,writable:!1,configurable:!0}),Jr}function Jr(){for(var ei,mi,ci=new Promise(function(vi,xi){ei=vi,mi=xi}),ai=[],fi=0;fi<arguments.length;fi++)ai.push(arguments[fi]);ai.push(function(vi,xi){vi?mi(vi):ei(xi)});try{Qr.apply(this,ai)}catch(vi){mi(vi)}return ci}return Object.setPrototypeOf(Jr,Object.getPrototypeOf(Qr)),qn&&Object.defineProperty(Jr,qn,{value:Jr,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Jr,I(Qr))},e.promisify.custom=qn;function li(Jn,Qr){if(!Jn){var Jr=new Error("Promise was rejected with a falsy value");Jr.reason=Jn,Jn=Jr}return Qr(Jn)}function di(Jn){if(typeof Jn!="function")throw new TypeError('The "original" argument must be of type Function');function Qr(){for(var Jr=[],ei=0;ei<arguments.length;ei++)Jr.push(arguments[ei]);var mi=Jr.pop();if(typeof mi!="function")throw new TypeError("The last argument must be of type Function");var ci=this,ai=function(){return mi.apply(ci,arguments)};Jn.apply(this,Jr).then(function(fi){process.nextTick(ai.bind(null,null,fi))},function(fi){process.nextTick(li.bind(null,fi,ai))})}return Object.setPrototypeOf(Qr,Object.getPrototypeOf(Jn)),Object.defineProperties(Qr,I(Jn)),Qr}e.callbackify=di}(util)),util}var string,hasRequiredString;function requireString(){if(hasRequiredString)return string;hasRequiredString=1;const e=/[\0\b\t\n\r\x1a"'\\]/g,t={"\0":"\\0","\b":"\\b"," ":"\\t","\n":"\\n","\r":"\\r","":"\\Z",'"':'\\"',"'":"\\'","\\":"\\\\"};function I(mr){return function _r(yr,xr={}){return mr(yr,_r,xr)}}function B(mr={}){const _r=mr.escapeDate||dr,yr=mr.escapeArray||rr,xr=mr.escapeBuffer||ir,Mr=mr.escapeString||lr,vr=mr.escapeObject||tr,Sr=mr.wrap||I;function wr(br,Ar,kr){if(br==null)return"NULL";switch(typeof br){case"boolean":return br?"true":"false";case"number":return br+"";case"object":if(br instanceof Date)br=_r(br,Ar,kr);else return Array.isArray(br)?yr(br,Ar,kr):Buffer.isBuffer(br)?xr(br,Ar,kr):vr(br,Ar,kr)}return Mr(br,Ar,kr)}return Sr?Sr(wr):wr}function tr(mr,_r,yr){return mr&&typeof mr.toSQL=="function"?mr.toSQL(yr):JSON.stringify(mr)}function rr(mr,_r,yr){let xr="";for(let Mr=0;Mr<mr.length;Mr++){const vr=mr[Mr];Array.isArray(vr)?xr+=(Mr===0?"":", ")+"("+rr(vr,_r,yr)+")":xr+=(Mr===0?"":", ")+_r(vr,yr)}return xr}function ir(mr){return"X"+lr(mr.toString("hex"))}function lr(mr,_r,yr){let xr=e.lastIndex=0,Mr="",vr;for(;vr=e.exec(mr);)Mr+=mr.slice(xr,vr.index)+t[vr[0]],xr=e.lastIndex;return xr===0?"'"+mr+"'":xr<mr.length?"'"+Mr+mr.slice(xr)+"'":"'"+Mr+"'"}function dr(mr,_r,yr={}){const xr=yr.timeZone||"local",Mr=new Date(mr);let vr,Sr,wr,br,Ar,kr,Dr;if(xr==="local")vr=Mr.getFullYear(),Sr=Mr.getMonth()+1,wr=Mr.getDate(),br=Mr.getHours(),Ar=Mr.getMinutes(),kr=Mr.getSeconds(),Dr=Mr.getMilliseconds();else{const Or=fr(xr);Or!==!1&&Or!==0&&Mr.setTime(Mr.getTime()+Or*6e4),vr=Mr.getUTCFullYear(),Sr=Mr.getUTCMonth()+1,wr=Mr.getUTCDate(),br=Mr.getUTCHours(),Ar=Mr.getUTCMinutes(),kr=Mr.getUTCSeconds(),Dr=Mr.getUTCMilliseconds()}return hr(vr,4)+"-"+hr(Sr,2)+"-"+hr(wr,2)+" "+hr(br,2)+":"+hr(Ar,2)+":"+hr(kr,2)+"."+hr(Dr,3)}function hr(mr,_r){for(mr=mr.toString();mr.length<_r;)mr="0"+mr;return mr}function fr(mr){if(mr==="Z")return 0;const _r=mr.match(/([+\-\s])(\d\d):?(\d\d)?/);return _r?(_r[1]=="-"?-1:1)*(parseInt(_r[2],10)+(_r[3]?parseInt(_r[3],10):0)/60)*60:!1}return string={arrayToList:rr,bufferToString:ir,dateToString:dr,escapeString:lr,charsRegex:e,charsMap:t,escapeObject:tr,makeEscape:B},string}var _listCacheClear,hasRequired_listCacheClear;function require_listCacheClear(){if(hasRequired_listCacheClear)return _listCacheClear;hasRequired_listCacheClear=1;function e(){this.__data__=[],this.size=0}return _listCacheClear=e,_listCacheClear}var eq_1,hasRequiredEq;function requireEq(){if(hasRequiredEq)return eq_1;hasRequiredEq=1;function e(t,I){return t===I||t!==t&&I!==I}return eq_1=e,eq_1}var _assocIndexOf,hasRequired_assocIndexOf;function require_assocIndexOf(){if(hasRequired_assocIndexOf)return _assocIndexOf;hasRequired_assocIndexOf=1;var e=requireEq();function t(I,B){for(var tr=I.length;tr--;)if(e(I[tr][0],B))return tr;return-1}return _assocIndexOf=t,_assocIndexOf}var _listCacheDelete,hasRequired_listCacheDelete;function require_listCacheDelete(){if(hasRequired_listCacheDelete)return _listCacheDelete;hasRequired_listCacheDelete=1;var e=require_assocIndexOf(),t=Array.prototype,I=t.splice;function B(tr){var rr=this.__data__,ir=e(rr,tr);if(ir<0)return!1;var lr=rr.length-1;return ir==lr?rr.pop():I.call(rr,ir,1),--this.size,!0}return _listCacheDelete=B,_listCacheDelete}var _listCacheGet,hasRequired_listCacheGet;function require_listCacheGet(){if(hasRequired_listCacheGet)return _listCacheGet;hasRequired_listCacheGet=1;var e=require_assocIndexOf();function t(I){var B=this.__data__,tr=e(B,I);return tr<0?void 0:B[tr][1]}return _listCacheGet=t,_listCacheGet}var _listCacheHas,hasRequired_listCacheHas;function require_listCacheHas(){if(hasRequired_listCacheHas)return _listCacheHas;hasRequired_listCacheHas=1;var e=require_assocIndexOf();function t(I){return e(this.__data__,I)>-1}return _listCacheHas=t,_listCacheHas}var _listCacheSet,hasRequired_listCacheSet;function require_listCacheSet(){if(hasRequired_listCacheSet)return _listCacheSet;hasRequired_listCacheSet=1;var e=require_assocIndexOf();function t(I,B){var tr=this.__data__,rr=e(tr,I);return rr<0?(++this.size,tr.push([I,B])):tr[rr][1]=B,this}return _listCacheSet=t,_listCacheSet}var _ListCache,hasRequired_ListCache;function require_ListCache(){if(hasRequired_ListCache)return _ListCache;hasRequired_ListCache=1;var e=require_listCacheClear(),t=require_listCacheDelete(),I=require_listCacheGet(),B=require_listCacheHas(),tr=require_listCacheSet();function rr(ir){var lr=-1,dr=ir==null?0:ir.length;for(this.clear();++lr<dr;){var hr=ir[lr];this.set(hr[0],hr[1])}}return rr.prototype.clear=e,rr.prototype.delete=t,rr.prototype.get=I,rr.prototype.has=B,rr.prototype.set=tr,_ListCache=rr,_ListCache}var _stackClear,hasRequired_stackClear;function require_stackClear(){if(hasRequired_stackClear)return _stackClear;hasRequired_stackClear=1;var e=require_ListCache();function t(){this.__data__=new e,this.size=0}return _stackClear=t,_stackClear}var _stackDelete,hasRequired_stackDelete;function require_stackDelete(){if(hasRequired_stackDelete)return _stackDelete;hasRequired_stackDelete=1;function e(t){var I=this.__data__,B=I.delete(t);return this.size=I.size,B}return _stackDelete=e,_stackDelete}var _stackGet,hasRequired_stackGet;function require_stackGet(){if(hasRequired_stackGet)return _stackGet;hasRequired_stackGet=1;function e(t){return this.__data__.get(t)}return _stackGet=e,_stackGet}var _stackHas,hasRequired_stackHas;function require_stackHas(){if(hasRequired_stackHas)return _stackHas;hasRequired_stackHas=1;function e(t){return this.__data__.has(t)}return _stackHas=e,_stackHas}var _freeGlobal,hasRequired_freeGlobal;function require_freeGlobal(){if(hasRequired_freeGlobal)return _freeGlobal;hasRequired_freeGlobal=1;var e=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;return _freeGlobal=e,_freeGlobal}var _root,hasRequired_root;function require_root(){if(hasRequired_root)return _root;hasRequired_root=1;var e=require_freeGlobal(),t=typeof self=="object"&&self&&self.Object===Object&&self,I=e||t||Function("return this")();return _root=I,_root}var _Symbol,hasRequired_Symbol;function require_Symbol(){if(hasRequired_Symbol)return _Symbol;hasRequired_Symbol=1;var e=require_root(),t=e.Symbol;return _Symbol=t,_Symbol}var _getRawTag,hasRequired_getRawTag;function require_getRawTag(){if(hasRequired_getRawTag)return _getRawTag;hasRequired_getRawTag=1;var e=require_Symbol(),t=Object.prototype,I=t.hasOwnProperty,B=t.toString,tr=e?e.toStringTag:void 0;function rr(ir){var lr=I.call(ir,tr),dr=ir[tr];try{ir[tr]=void 0;var hr=!0}catch{}var fr=B.call(ir);return hr&&(lr?ir[tr]=dr:delete ir[tr]),fr}return _getRawTag=rr,_getRawTag}var _objectToString,hasRequired_objectToString;function require_objectToString(){if(hasRequired_objectToString)return _objectToString;hasRequired_objectToString=1;var e=Object.prototype,t=e.toString;function I(B){return t.call(B)}return _objectToString=I,_objectToString}var _baseGetTag,hasRequired_baseGetTag;function require_baseGetTag(){if(hasRequired_baseGetTag)return _baseGetTag;hasRequired_baseGetTag=1;var e=require_Symbol(),t=require_getRawTag(),I=require_objectToString(),B="[object Null]",tr="[object Undefined]",rr=e?e.toStringTag:void 0;function ir(lr){return lr==null?lr===void 0?tr:B:rr&&rr in Object(lr)?t(lr):I(lr)}return _baseGetTag=ir,_baseGetTag}var isObject_1,hasRequiredIsObject;function requireIsObject(){if(hasRequiredIsObject)return isObject_1;hasRequiredIsObject=1;function e(t){var I=typeof t;return t!=null&&(I=="object"||I=="function")}return isObject_1=e,isObject_1}var isFunction_1,hasRequiredIsFunction;function requireIsFunction(){if(hasRequiredIsFunction)return isFunction_1;hasRequiredIsFunction=1;var e=require_baseGetTag(),t=requireIsObject(),I="[object AsyncFunction]",B="[object Function]",tr="[object GeneratorFunction]",rr="[object Proxy]";function ir(lr){if(!t(lr))return!1;var dr=e(lr);return dr==B||dr==tr||dr==I||dr==rr}return isFunction_1=ir,isFunction_1}var _coreJsData,hasRequired_coreJsData;function require_coreJsData(){if(hasRequired_coreJsData)return _coreJsData;hasRequired_coreJsData=1;var e=require_root(),t=e["__core-js_shared__"];return _coreJsData=t,_coreJsData}var _isMasked,hasRequired_isMasked;function require_isMasked(){if(hasRequired_isMasked)return _isMasked;hasRequired_isMasked=1;var e=require_coreJsData(),t=function(){var B=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return B?"Symbol(src)_1."+B:""}();function I(B){return!!t&&t in B}return _isMasked=I,_isMasked}var _toSource,hasRequired_toSource;function require_toSource(){if(hasRequired_toSource)return _toSource;hasRequired_toSource=1;var e=Function.prototype,t=e.toString;function I(B){if(B!=null){try{return t.call(B)}catch{}try{return B+""}catch{}}return""}return _toSource=I,_toSource}var _baseIsNative,hasRequired_baseIsNative;function require_baseIsNative(){if(hasRequired_baseIsNative)return _baseIsNative;hasRequired_baseIsNative=1;var e=requireIsFunction(),t=require_isMasked(),I=requireIsObject(),B=require_toSource(),tr=/[\\^$.*+?()[\]{}|]/g,rr=/^\[object .+?Constructor\]$/,ir=Function.prototype,lr=Object.prototype,dr=ir.toString,hr=lr.hasOwnProperty,fr=RegExp("^"+dr.call(hr).replace(tr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mr(_r){if(!I(_r)||t(_r))return!1;var yr=e(_r)?fr:rr;return yr.test(B(_r))}return _baseIsNative=mr,_baseIsNative}var _getValue,hasRequired_getValue;function require_getValue(){if(hasRequired_getValue)return _getValue;hasRequired_getValue=1;function e(t,I){return t==null?void 0:t[I]}return _getValue=e,_getValue}var _getNative,hasRequired_getNative;function require_getNative(){if(hasRequired_getNative)return _getNative;hasRequired_getNative=1;var e=require_baseIsNative(),t=require_getValue();function I(B,tr){var rr=t(B,tr);return e(rr)?rr:void 0}return _getNative=I,_getNative}var _Map,hasRequired_Map;function require_Map(){if(hasRequired_Map)return _Map;hasRequired_Map=1;var e=require_getNative(),t=require_root(),I=e(t,"Map");return _Map=I,_Map}var _nativeCreate,hasRequired_nativeCreate;function require_nativeCreate(){if(hasRequired_nativeCreate)return _nativeCreate;hasRequired_nativeCreate=1;var e=require_getNative(),t=e(Object,"create");return _nativeCreate=t,_nativeCreate}var _hashClear,hasRequired_hashClear;function require_hashClear(){if(hasRequired_hashClear)return _hashClear;hasRequired_hashClear=1;var e=require_nativeCreate();function t(){this.__data__=e?e(null):{},this.size=0}return _hashClear=t,_hashClear}var _hashDelete,hasRequired_hashDelete;function require_hashDelete(){if(hasRequired_hashDelete)return _hashDelete;hasRequired_hashDelete=1;function e(t){var I=this.has(t)&&delete this.__data__[t];return this.size-=I?1:0,I}return _hashDelete=e,_hashDelete}var _hashGet,hasRequired_hashGet;function require_hashGet(){if(hasRequired_hashGet)return _hashGet;hasRequired_hashGet=1;var e=require_nativeCreate(),t="__lodash_hash_undefined__",I=Object.prototype,B=I.hasOwnProperty;function tr(rr){var ir=this.__data__;if(e){var lr=ir[rr];return lr===t?void 0:lr}return B.call(ir,rr)?ir[rr]:void 0}return _hashGet=tr,_hashGet}var _hashHas,hasRequired_hashHas;function require_hashHas(){if(hasRequired_hashHas)return _hashHas;hasRequired_hashHas=1;var e=require_nativeCreate(),t=Object.prototype,I=t.hasOwnProperty;function B(tr){var rr=this.__data__;return e?rr[tr]!==void 0:I.call(rr,tr)}return _hashHas=B,_hashHas}var _hashSet,hasRequired_hashSet;function require_hashSet(){if(hasRequired_hashSet)return _hashSet;hasRequired_hashSet=1;var e=require_nativeCreate(),t="__lodash_hash_undefined__";function I(B,tr){var rr=this.__data__;return this.size+=this.has(B)?0:1,rr[B]=e&&tr===void 0?t:tr,this}return _hashSet=I,_hashSet}var _Hash,hasRequired_Hash;function require_Hash(){if(hasRequired_Hash)return _Hash;hasRequired_Hash=1;var e=require_hashClear(),t=require_hashDelete(),I=require_hashGet(),B=require_hashHas(),tr=require_hashSet();function rr(ir){var lr=-1,dr=ir==null?0:ir.length;for(this.clear();++lr<dr;){var hr=ir[lr];this.set(hr[0],hr[1])}}return rr.prototype.clear=e,rr.prototype.delete=t,rr.prototype.get=I,rr.prototype.has=B,rr.prototype.set=tr,_Hash=rr,_Hash}var _mapCacheClear,hasRequired_mapCacheClear;function require_mapCacheClear(){if(hasRequired_mapCacheClear)return _mapCacheClear;hasRequired_mapCacheClear=1;var e=require_Hash(),t=require_ListCache(),I=require_Map();function B(){this.size=0,this.__data__={hash:new e,map:new(I||t),string:new e}}return _mapCacheClear=B,_mapCacheClear}var _isKeyable,hasRequired_isKeyable;function require_isKeyable(){if(hasRequired_isKeyable)return _isKeyable;hasRequired_isKeyable=1;function e(t){var I=typeof t;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?t!=="__proto__":t===null}return _isKeyable=e,_isKeyable}var _getMapData,hasRequired_getMapData;function require_getMapData(){if(hasRequired_getMapData)return _getMapData;hasRequired_getMapData=1;var e=require_isKeyable();function t(I,B){var tr=I.__data__;return e(B)?tr[typeof B=="string"?"string":"hash"]:tr.map}return _getMapData=t,_getMapData}var _mapCacheDelete,hasRequired_mapCacheDelete;function require_mapCacheDelete(){if(hasRequired_mapCacheDelete)return _mapCacheDelete;hasRequired_mapCacheDelete=1;var e=require_getMapData();function t(I){var B=e(this,I).delete(I);return this.size-=B?1:0,B}return _mapCacheDelete=t,_mapCacheDelete}var _mapCacheGet,hasRequired_mapCacheGet;function require_mapCacheGet(){if(hasRequired_mapCacheGet)return _mapCacheGet;hasRequired_mapCacheGet=1;var e=require_getMapData();function t(I){return e(this,I).get(I)}return _mapCacheGet=t,_mapCacheGet}var _mapCacheHas,hasRequired_mapCacheHas;function require_mapCacheHas(){if(hasRequired_mapCacheHas)return _mapCacheHas;hasRequired_mapCacheHas=1;var e=require_getMapData();function t(I){return e(this,I).has(I)}return _mapCacheHas=t,_mapCacheHas}var _mapCacheSet,hasRequired_mapCacheSet;function require_mapCacheSet(){if(hasRequired_mapCacheSet)return _mapCacheSet;hasRequired_mapCacheSet=1;var e=require_getMapData();function t(I,B){var tr=e(this,I),rr=tr.size;return tr.set(I,B),this.size+=tr.size==rr?0:1,this}return _mapCacheSet=t,_mapCacheSet}var _MapCache,hasRequired_MapCache;function require_MapCache(){if(hasRequired_MapCache)return _MapCache;hasRequired_MapCache=1;var e=require_mapCacheClear(),t=require_mapCacheDelete(),I=require_mapCacheGet(),B=require_mapCacheHas(),tr=require_mapCacheSet();function rr(ir){var lr=-1,dr=ir==null?0:ir.length;for(this.clear();++lr<dr;){var hr=ir[lr];this.set(hr[0],hr[1])}}return rr.prototype.clear=e,rr.prototype.delete=t,rr.prototype.get=I,rr.prototype.has=B,rr.prototype.set=tr,_MapCache=rr,_MapCache}var _stackSet,hasRequired_stackSet;function require_stackSet(){if(hasRequired_stackSet)return _stackSet;hasRequired_stackSet=1;var e=require_ListCache(),t=require_Map(),I=require_MapCache(),B=200;function tr(rr,ir){var lr=this.__data__;if(lr instanceof e){var dr=lr.__data__;if(!t||dr.length<B-1)return dr.push([rr,ir]),this.size=++lr.size,this;lr=this.__data__=new I(dr)}return lr.set(rr,ir),this.size=lr.size,this}return _stackSet=tr,_stackSet}var _Stack,hasRequired_Stack;function require_Stack(){if(hasRequired_Stack)return _Stack;hasRequired_Stack=1;var e=require_ListCache(),t=require_stackClear(),I=require_stackDelete(),B=require_stackGet(),tr=require_stackHas(),rr=require_stackSet();function ir(lr){var dr=this.__data__=new e(lr);this.size=dr.size}return ir.prototype.clear=t,ir.prototype.delete=I,ir.prototype.get=B,ir.prototype.has=tr,ir.prototype.set=rr,_Stack=ir,_Stack}var _arrayEach,hasRequired_arrayEach;function require_arrayEach(){if(hasRequired_arrayEach)return _arrayEach;hasRequired_arrayEach=1;function e(t,I){for(var B=-1,tr=t==null?0:t.length;++B<tr&&I(t[B],B,t)!==!1;);return t}return _arrayEach=e,_arrayEach}var _defineProperty,hasRequired_defineProperty;function require_defineProperty(){if(hasRequired_defineProperty)return _defineProperty;hasRequired_defineProperty=1;var e=require_getNative(),t=function(){try{var I=e(Object,"defineProperty");return I({},"",{}),I}catch{}}();return _defineProperty=t,_defineProperty}var _baseAssignValue,hasRequired_baseAssignValue;function require_baseAssignValue(){if(hasRequired_baseAssignValue)return _baseAssignValue;hasRequired_baseAssignValue=1;var e=require_defineProperty();function t(I,B,tr){B=="__proto__"&&e?e(I,B,{configurable:!0,enumerable:!0,value:tr,writable:!0}):I[B]=tr}return _baseAssignValue=t,_baseAssignValue}var _assignValue,hasRequired_assignValue;function require_assignValue(){if(hasRequired_assignValue)return _assignValue;hasRequired_assignValue=1;var e=require_baseAssignValue(),t=requireEq(),I=Object.prototype,B=I.hasOwnProperty;function tr(rr,ir,lr){var dr=rr[ir];(!(B.call(rr,ir)&&t(dr,lr))||lr===void 0&&!(ir in rr))&&e(rr,ir,lr)}return _assignValue=tr,_assignValue}var _copyObject,hasRequired_copyObject;function require_copyObject(){if(hasRequired_copyObject)return _copyObject;hasRequired_copyObject=1;var e=require_assignValue(),t=require_baseAssignValue();function I(B,tr,rr,ir){var lr=!rr;rr||(rr={});for(var dr=-1,hr=tr.length;++dr<hr;){var fr=tr[dr],mr=ir?ir(rr[fr],B[fr],fr,rr,B):void 0;mr===void 0&&(mr=B[fr]),lr?t(rr,fr,mr):e(rr,fr,mr)}return rr}return _copyObject=I,_copyObject}var _baseTimes,hasRequired_baseTimes;function require_baseTimes(){if(hasRequired_baseTimes)return _baseTimes;hasRequired_baseTimes=1;function e(t,I){for(var B=-1,tr=Array(t);++B<t;)tr[B]=I(B);return tr}return _baseTimes=e,_baseTimes}var isObjectLike_1,hasRequiredIsObjectLike;function requireIsObjectLike(){if(hasRequiredIsObjectLike)return isObjectLike_1;hasRequiredIsObjectLike=1;function e(t){return t!=null&&typeof t=="object"}return isObjectLike_1=e,isObjectLike_1}var _baseIsArguments,hasRequired_baseIsArguments;function require_baseIsArguments(){if(hasRequired_baseIsArguments)return _baseIsArguments;hasRequired_baseIsArguments=1;var e=require_baseGetTag(),t=requireIsObjectLike(),I="[object Arguments]";function B(tr){return t(tr)&&e(tr)==I}return _baseIsArguments=B,_baseIsArguments}var isArguments_1,hasRequiredIsArguments$1;function requireIsArguments$1(){if(hasRequiredIsArguments$1)return isArguments_1;hasRequiredIsArguments$1=1;var e=require_baseIsArguments(),t=requireIsObjectLike(),I=Object.prototype,B=I.hasOwnProperty,tr=I.propertyIsEnumerable,rr=e(function(){return arguments}())?e:function(ir){return t(ir)&&B.call(ir,"callee")&&!tr.call(ir,"callee")};return isArguments_1=rr,isArguments_1}var isArray_1,hasRequiredIsArray;function requireIsArray(){if(hasRequiredIsArray)return isArray_1;hasRequiredIsArray=1;var e=Array.isArray;return isArray_1=e,isArray_1}var isBuffer={exports:{}},stubFalse_1,hasRequiredStubFalse;function requireStubFalse(){if(hasRequiredStubFalse)return stubFalse_1;hasRequiredStubFalse=1;function e(){return!1}return stubFalse_1=e,stubFalse_1}var hasRequiredIsBuffer;function requireIsBuffer(){return hasRequiredIsBuffer||(hasRequiredIsBuffer=1,function(e,t){var I=require_root(),B=requireStubFalse(),tr=t&&!t.nodeType&&t,rr=tr&&!0&&e&&!e.nodeType&&e,ir=rr&&rr.exports===tr,lr=ir?I.Buffer:void 0,dr=lr?lr.isBuffer:void 0,hr=dr||B;e.exports=hr}(isBuffer,isBuffer.exports)),isBuffer.exports}var _isIndex,hasRequired_isIndex;function require_isIndex(){if(hasRequired_isIndex)return _isIndex;hasRequired_isIndex=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function I(B,tr){var rr=typeof B;return tr=tr??e,!!tr&&(rr=="number"||rr!="symbol"&&t.test(B))&&B>-1&&B%1==0&&B<tr}return _isIndex=I,_isIndex}var isLength_1,hasRequiredIsLength;function requireIsLength(){if(hasRequiredIsLength)return isLength_1;hasRequiredIsLength=1;var e=9007199254740991;function t(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=e}return isLength_1=t,isLength_1}var _baseIsTypedArray,hasRequired_baseIsTypedArray;function require_baseIsTypedArray(){if(hasRequired_baseIsTypedArray)return _baseIsTypedArray;hasRequired_baseIsTypedArray=1;var e=require_baseGetTag(),t=requireIsLength(),I=requireIsObjectLike(),B="[object Arguments]",tr="[object Array]",rr="[object Boolean]",ir="[object Date]",lr="[object Error]",dr="[object Function]",hr="[object Map]",fr="[object Number]",mr="[object Object]",_r="[object RegExp]",yr="[object Set]",xr="[object String]",Mr="[object WeakMap]",vr="[object ArrayBuffer]",Sr="[object DataView]",wr="[object Float32Array]",br="[object Float64Array]",Ar="[object Int8Array]",kr="[object Int16Array]",Dr="[object Int32Array]",Or="[object Uint8Array]",zr="[object Uint8ClampedArray]",$n="[object Uint16Array]",Fr="[object Uint32Array]",$r={};$r[wr]=$r[br]=$r[Ar]=$r[kr]=$r[Dr]=$r[Or]=$r[zr]=$r[$n]=$r[Fr]=!0,$r[B]=$r[tr]=$r[vr]=$r[rr]=$r[Sr]=$r[ir]=$r[lr]=$r[dr]=$r[hr]=$r[fr]=$r[mr]=$r[_r]=$r[yr]=$r[xr]=$r[Mr]=!1;function Hn(ti){return I(ti)&&t(ti.length)&&!!$r[e(ti)]}return _baseIsTypedArray=Hn,_baseIsTypedArray}var _baseUnary,hasRequired_baseUnary;function require_baseUnary(){if(hasRequired_baseUnary)return _baseUnary;hasRequired_baseUnary=1;function e(t){return function(I){return t(I)}}return _baseUnary=e,_baseUnary}var _nodeUtil={exports:{}},hasRequired_nodeUtil;function require_nodeUtil(){return hasRequired_nodeUtil||(hasRequired_nodeUtil=1,function(e,t){var I=require_freeGlobal(),B=t&&!t.nodeType&&t,tr=B&&!0&&e&&!e.nodeType&&e,rr=tr&&tr.exports===B,ir=rr&&I.process,lr=function(){try{var dr=tr&&tr.require&&tr.require("util").types;return dr||ir&&ir.binding&&ir.binding("util")}catch{}}();e.exports=lr}(_nodeUtil,_nodeUtil.exports)),_nodeUtil.exports}var isTypedArray_1,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray_1;hasRequiredIsTypedArray=1;var e=require_baseIsTypedArray(),t=require_baseUnary(),I=require_nodeUtil(),B=I&&I.isTypedArray,tr=B?t(B):e;return isTypedArray_1=tr,isTypedArray_1}var _arrayLikeKeys,hasRequired_arrayLikeKeys;function require_arrayLikeKeys(){if(hasRequired_arrayLikeKeys)return _arrayLikeKeys;hasRequired_arrayLikeKeys=1;var e=require_baseTimes(),t=requireIsArguments$1(),I=requireIsArray(),B=requireIsBuffer(),tr=require_isIndex(),rr=requireIsTypedArray(),ir=Object.prototype,lr=ir.hasOwnProperty;function dr(hr,fr){var mr=I(hr),_r=!mr&&t(hr),yr=!mr&&!_r&&B(hr),xr=!mr&&!_r&&!yr&&rr(hr),Mr=mr||_r||yr||xr,vr=Mr?e(hr.length,String):[],Sr=vr.length;for(var wr in hr)(fr||lr.call(hr,wr))&&!(Mr&&(wr=="length"||yr&&(wr=="offset"||wr=="parent")||xr&&(wr=="buffer"||wr=="byteLength"||wr=="byteOffset")||tr(wr,Sr)))&&vr.push(wr);return vr}return _arrayLikeKeys=dr,_arrayLikeKeys}var _isPrototype,hasRequired_isPrototype;function require_isPrototype(){if(hasRequired_isPrototype)return _isPrototype;hasRequired_isPrototype=1;var e=Object.prototype;function t(I){var B=I&&I.constructor,tr=typeof B=="function"&&B.prototype||e;return I===tr}return _isPrototype=t,_isPrototype}var _overArg,hasRequired_overArg;function require_overArg(){if(hasRequired_overArg)return _overArg;hasRequired_overArg=1;function e(t,I){return function(B){return t(I(B))}}return _overArg=e,_overArg}var _nativeKeys,hasRequired_nativeKeys;function require_nativeKeys(){if(hasRequired_nativeKeys)return _nativeKeys;hasRequired_nativeKeys=1;var e=require_overArg(),t=e(Object.keys,Object);return _nativeKeys=t,_nativeKeys}var _baseKeys,hasRequired_baseKeys;function require_baseKeys(){if(hasRequired_baseKeys)return _baseKeys;hasRequired_baseKeys=1;var e=require_isPrototype(),t=require_nativeKeys(),I=Object.prototype,B=I.hasOwnProperty;function tr(rr){if(!e(rr))return t(rr);var ir=[];for(var lr in Object(rr))B.call(rr,lr)&&lr!="constructor"&&ir.push(lr);return ir}return _baseKeys=tr,_baseKeys}var isArrayLike_1,hasRequiredIsArrayLike;function requireIsArrayLike(){if(hasRequiredIsArrayLike)return isArrayLike_1;hasRequiredIsArrayLike=1;var e=requireIsFunction(),t=requireIsLength();function I(B){return B!=null&&t(B.length)&&!e(B)}return isArrayLike_1=I,isArrayLike_1}var keys_1,hasRequiredKeys;function requireKeys(){if(hasRequiredKeys)return keys_1;hasRequiredKeys=1;var e=require_arrayLikeKeys(),t=require_baseKeys(),I=requireIsArrayLike();function B(tr){return I(tr)?e(tr):t(tr)}return keys_1=B,keys_1}var _baseAssign,hasRequired_baseAssign;function require_baseAssign(){if(hasRequired_baseAssign)return _baseAssign;hasRequired_baseAssign=1;var e=require_copyObject(),t=requireKeys();function I(B,tr){return B&&e(tr,t(tr),B)}return _baseAssign=I,_baseAssign}var _nativeKeysIn,hasRequired_nativeKeysIn;function require_nativeKeysIn(){if(hasRequired_nativeKeysIn)return _nativeKeysIn;hasRequired_nativeKeysIn=1;function e(t){var I=[];if(t!=null)for(var B in Object(t))I.push(B);return I}return _nativeKeysIn=e,_nativeKeysIn}var _baseKeysIn,hasRequired_baseKeysIn;function require_baseKeysIn(){if(hasRequired_baseKeysIn)return _baseKeysIn;hasRequired_baseKeysIn=1;var e=requireIsObject(),t=require_isPrototype(),I=require_nativeKeysIn(),B=Object.prototype,tr=B.hasOwnProperty;function rr(ir){if(!e(ir))return I(ir);var lr=t(ir),dr=[];for(var hr in ir)hr=="constructor"&&(lr||!tr.call(ir,hr))||dr.push(hr);return dr}return _baseKeysIn=rr,_baseKeysIn}var keysIn_1,hasRequiredKeysIn;function requireKeysIn(){if(hasRequiredKeysIn)return keysIn_1;hasRequiredKeysIn=1;var e=require_arrayLikeKeys(),t=require_baseKeysIn(),I=requireIsArrayLike();function B(tr){return I(tr)?e(tr,!0):t(tr)}return keysIn_1=B,keysIn_1}var _baseAssignIn,hasRequired_baseAssignIn;function require_baseAssignIn(){if(hasRequired_baseAssignIn)return _baseAssignIn;hasRequired_baseAssignIn=1;var e=require_copyObject(),t=requireKeysIn();function I(B,tr){return B&&e(tr,t(tr),B)}return _baseAssignIn=I,_baseAssignIn}var _cloneBuffer={exports:{}},hasRequired_cloneBuffer;function require_cloneBuffer(){return hasRequired_cloneBuffer||(hasRequired_cloneBuffer=1,function(e,t){var I=require_root(),B=t&&!t.nodeType&&t,tr=B&&!0&&e&&!e.nodeType&&e,rr=tr&&tr.exports===B,ir=rr?I.Buffer:void 0,lr=ir?ir.allocUnsafe:void 0;function dr(hr,fr){if(fr)return hr.slice();var mr=hr.length,_r=lr?lr(mr):new hr.constructor(mr);return hr.copy(_r),_r}e.exports=dr}(_cloneBuffer,_cloneBuffer.exports)),_cloneBuffer.exports}var _copyArray,hasRequired_copyArray;function require_copyArray(){if(hasRequired_copyArray)return _copyArray;hasRequired_copyArray=1;function e(t,I){var B=-1,tr=t.length;for(I||(I=Array(tr));++B<tr;)I[B]=t[B];return I}return _copyArray=e,_copyArray}var _arrayFilter,hasRequired_arrayFilter;function require_arrayFilter(){if(hasRequired_arrayFilter)return _arrayFilter;hasRequired_arrayFilter=1;function e(t,I){for(var B=-1,tr=t==null?0:t.length,rr=0,ir=[];++B<tr;){var lr=t[B];I(lr,B,t)&&(ir[rr++]=lr)}return ir}return _arrayFilter=e,_arrayFilter}var stubArray_1,hasRequiredStubArray;function requireStubArray(){if(hasRequiredStubArray)return stubArray_1;hasRequiredStubArray=1;function e(){return[]}return stubArray_1=e,stubArray_1}var _getSymbols,hasRequired_getSymbols;function require_getSymbols(){if(hasRequired_getSymbols)return _getSymbols;hasRequired_getSymbols=1;var e=require_arrayFilter(),t=requireStubArray(),I=Object.prototype,B=I.propertyIsEnumerable,tr=Object.getOwnPropertySymbols,rr=tr?function(ir){return ir==null?[]:(ir=Object(ir),e(tr(ir),function(lr){return B.call(ir,lr)}))}:t;return _getSymbols=rr,_getSymbols}var _copySymbols,hasRequired_copySymbols;function require_copySymbols(){if(hasRequired_copySymbols)return _copySymbols;hasRequired_copySymbols=1;var e=require_copyObject(),t=require_getSymbols();function I(B,tr){return e(B,t(B),tr)}return _copySymbols=I,_copySymbols}var _arrayPush,hasRequired_arrayPush;function require_arrayPush(){if(hasRequired_arrayPush)return _arrayPush;hasRequired_arrayPush=1;function e(t,I){for(var B=-1,tr=I.length,rr=t.length;++B<tr;)t[rr+B]=I[B];return t}return _arrayPush=e,_arrayPush}var _getPrototype,hasRequired_getPrototype;function require_getPrototype(){if(hasRequired_getPrototype)return _getPrototype;hasRequired_getPrototype=1;var e=require_overArg(),t=e(Object.getPrototypeOf,Object);return _getPrototype=t,_getPrototype}var _getSymbolsIn,hasRequired_getSymbolsIn;function require_getSymbolsIn(){if(hasRequired_getSymbolsIn)return _getSymbolsIn;hasRequired_getSymbolsIn=1;var e=require_arrayPush(),t=require_getPrototype(),I=require_getSymbols(),B=requireStubArray(),tr=Object.getOwnPropertySymbols,rr=tr?function(ir){for(var lr=[];ir;)e(lr,I(ir)),ir=t(ir);return lr}:B;return _getSymbolsIn=rr,_getSymbolsIn}var _copySymbolsIn,hasRequired_copySymbolsIn;function require_copySymbolsIn(){if(hasRequired_copySymbolsIn)return _copySymbolsIn;hasRequired_copySymbolsIn=1;var e=require_copyObject(),t=require_getSymbolsIn();function I(B,tr){return e(B,t(B),tr)}return _copySymbolsIn=I,_copySymbolsIn}var _baseGetAllKeys,hasRequired_baseGetAllKeys;function require_baseGetAllKeys(){if(hasRequired_baseGetAllKeys)return _baseGetAllKeys;hasRequired_baseGetAllKeys=1;var e=require_arrayPush(),t=requireIsArray();function I(B,tr,rr){var ir=tr(B);return t(B)?ir:e(ir,rr(B))}return _baseGetAllKeys=I,_baseGetAllKeys}var _getAllKeys,hasRequired_getAllKeys;function require_getAllKeys(){if(hasRequired_getAllKeys)return _getAllKeys;hasRequired_getAllKeys=1;var e=require_baseGetAllKeys(),t=require_getSymbols(),I=requireKeys();function B(tr){return e(tr,I,t)}return _getAllKeys=B,_getAllKeys}var _getAllKeysIn,hasRequired_getAllKeysIn;function require_getAllKeysIn(){if(hasRequired_getAllKeysIn)return _getAllKeysIn;hasRequired_getAllKeysIn=1;var e=require_baseGetAllKeys(),t=require_getSymbolsIn(),I=requireKeysIn();function B(tr){return e(tr,I,t)}return _getAllKeysIn=B,_getAllKeysIn}var _DataView,hasRequired_DataView;function require_DataView(){if(hasRequired_DataView)return _DataView;hasRequired_DataView=1;var e=require_getNative(),t=require_root(),I=e(t,"DataView");return _DataView=I,_DataView}var _Promise,hasRequired_Promise;function require_Promise(){if(hasRequired_Promise)return _Promise;hasRequired_Promise=1;var e=require_getNative(),t=require_root(),I=e(t,"Promise");return _Promise=I,_Promise}var _Set,hasRequired_Set;function require_Set(){if(hasRequired_Set)return _Set;hasRequired_Set=1;var e=require_getNative(),t=require_root(),I=e(t,"Set");return _Set=I,_Set}var _WeakMap,hasRequired_WeakMap;function require_WeakMap(){if(hasRequired_WeakMap)return _WeakMap;hasRequired_WeakMap=1;var e=require_getNative(),t=require_root(),I=e(t,"WeakMap");return _WeakMap=I,_WeakMap}var _getTag,hasRequired_getTag;function require_getTag(){if(hasRequired_getTag)return _getTag;hasRequired_getTag=1;var e=require_DataView(),t=require_Map(),I=require_Promise(),B=require_Set(),tr=require_WeakMap(),rr=require_baseGetTag(),ir=require_toSource(),lr="[object Map]",dr="[object Object]",hr="[object Promise]",fr="[object Set]",mr="[object WeakMap]",_r="[object DataView]",yr=ir(e),xr=ir(t),Mr=ir(I),vr=ir(B),Sr=ir(tr),wr=rr;return(e&&wr(new e(new ArrayBuffer(1)))!=_r||t&&wr(new t)!=lr||I&&wr(I.resolve())!=hr||B&&wr(new B)!=fr||tr&&wr(new tr)!=mr)&&(wr=function(br){var Ar=rr(br),kr=Ar==dr?br.constructor:void 0,Dr=kr?ir(kr):"";if(Dr)switch(Dr){case yr:return _r;case xr:return lr;case Mr:return hr;case vr:return fr;case Sr:return mr}return Ar}),_getTag=wr,_getTag}var _initCloneArray,hasRequired_initCloneArray;function require_initCloneArray(){if(hasRequired_initCloneArray)return _initCloneArray;hasRequired_initCloneArray=1;var e=Object.prototype,t=e.hasOwnProperty;function I(B){var tr=B.length,rr=new B.constructor(tr);return tr&&typeof B[0]=="string"&&t.call(B,"index")&&(rr.index=B.index,rr.input=B.input),rr}return _initCloneArray=I,_initCloneArray}var _Uint8Array,hasRequired_Uint8Array;function require_Uint8Array(){if(hasRequired_Uint8Array)return _Uint8Array;hasRequired_Uint8Array=1;var e=require_root(),t=e.Uint8Array;return _Uint8Array=t,_Uint8Array}var _cloneArrayBuffer,hasRequired_cloneArrayBuffer;function require_cloneArrayBuffer(){if(hasRequired_cloneArrayBuffer)return _cloneArrayBuffer;hasRequired_cloneArrayBuffer=1;var e=require_Uint8Array();function t(I){var B=new I.constructor(I.byteLength);return new e(B).set(new e(I)),B}return _cloneArrayBuffer=t,_cloneArrayBuffer}var _cloneDataView,hasRequired_cloneDataView;function require_cloneDataView(){if(hasRequired_cloneDataView)return _cloneDataView;hasRequired_cloneDataView=1;var e=require_cloneArrayBuffer();function t(I,B){var tr=B?e(I.buffer):I.buffer;return new I.constructor(tr,I.byteOffset,I.byteLength)}return _cloneDataView=t,_cloneDataView}var _cloneRegExp,hasRequired_cloneRegExp;function require_cloneRegExp(){if(hasRequired_cloneRegExp)return _cloneRegExp;hasRequired_cloneRegExp=1;var e=/\w*$/;function t(I){var B=new I.constructor(I.source,e.exec(I));return B.lastIndex=I.lastIndex,B}return _cloneRegExp=t,_cloneRegExp}var _cloneSymbol,hasRequired_cloneSymbol;function require_cloneSymbol(){if(hasRequired_cloneSymbol)return _cloneSymbol;hasRequired_cloneSymbol=1;var e=require_Symbol(),t=e?e.prototype:void 0,I=t?t.valueOf:void 0;function B(tr){return I?Object(I.call(tr)):{}}return _cloneSymbol=B,_cloneSymbol}var _cloneTypedArray,hasRequired_cloneTypedArray;function require_cloneTypedArray(){if(hasRequired_cloneTypedArray)return _cloneTypedArray;hasRequired_cloneTypedArray=1;var e=require_cloneArrayBuffer();function t(I,B){var tr=B?e(I.buffer):I.buffer;return new I.constructor(tr,I.byteOffset,I.length)}return _cloneTypedArray=t,_cloneTypedArray}var _initCloneByTag,hasRequired_initCloneByTag;function require_initCloneByTag(){if(hasRequired_initCloneByTag)return _initCloneByTag;hasRequired_initCloneByTag=1;var e=require_cloneArrayBuffer(),t=require_cloneDataView(),I=require_cloneRegExp(),B=require_cloneSymbol(),tr=require_cloneTypedArray(),rr="[object Boolean]",ir="[object Date]",lr="[object Map]",dr="[object Number]",hr="[object RegExp]",fr="[object Set]",mr="[object String]",_r="[object Symbol]",yr="[object ArrayBuffer]",xr="[object DataView]",Mr="[object Float32Array]",vr="[object Float64Array]",Sr="[object Int8Array]",wr="[object Int16Array]",br="[object Int32Array]",Ar="[object Uint8Array]",kr="[object Uint8ClampedArray]",Dr="[object Uint16Array]",Or="[object Uint32Array]";function zr($n,Fr,$r){var Hn=$n.constructor;switch(Fr){case yr:return e($n);case rr:case ir:return new Hn(+$n);case xr:return t($n,$r);case Mr:case vr:case Sr:case wr:case br:case Ar:case kr:case Dr:case Or:return tr($n,$r);case lr:return new Hn;case dr:case mr:return new Hn($n);case hr:return I($n);case fr:return new Hn;case _r:return B($n)}}return _initCloneByTag=zr,_initCloneByTag}var _baseCreate,hasRequired_baseCreate;function require_baseCreate(){if(hasRequired_baseCreate)return _baseCreate;hasRequired_baseCreate=1;var e=requireIsObject(),t=Object.create,I=function(){function B(){}return function(tr){if(!e(tr))return{};if(t)return t(tr);B.prototype=tr;var rr=new B;return B.prototype=void 0,rr}}();return _baseCreate=I,_baseCreate}var _initCloneObject,hasRequired_initCloneObject;function require_initCloneObject(){if(hasRequired_initCloneObject)return _initCloneObject;hasRequired_initCloneObject=1;var e=require_baseCreate(),t=require_getPrototype(),I=require_isPrototype();function B(tr){return typeof tr.constructor=="function"&&!I(tr)?e(t(tr)):{}}return _initCloneObject=B,_initCloneObject}var _baseIsMap,hasRequired_baseIsMap;function require_baseIsMap(){if(hasRequired_baseIsMap)return _baseIsMap;hasRequired_baseIsMap=1;var e=require_getTag(),t=requireIsObjectLike(),I="[object Map]";function B(tr){return t(tr)&&e(tr)==I}return _baseIsMap=B,_baseIsMap}var isMap_1,hasRequiredIsMap;function requireIsMap(){if(hasRequiredIsMap)return isMap_1;hasRequiredIsMap=1;var e=require_baseIsMap(),t=require_baseUnary(),I=require_nodeUtil(),B=I&&I.isMap,tr=B?t(B):e;return isMap_1=tr,isMap_1}var _baseIsSet,hasRequired_baseIsSet;function require_baseIsSet(){if(hasRequired_baseIsSet)return _baseIsSet;hasRequired_baseIsSet=1;var e=require_getTag(),t=requireIsObjectLike(),I="[object Set]";function B(tr){return t(tr)&&e(tr)==I}return _baseIsSet=B,_baseIsSet}var isSet_1,hasRequiredIsSet;function requireIsSet(){if(hasRequiredIsSet)return isSet_1;hasRequiredIsSet=1;var e=require_baseIsSet(),t=require_baseUnary(),I=require_nodeUtil(),B=I&&I.isSet,tr=B?t(B):e;return isSet_1=tr,isSet_1}var _baseClone,hasRequired_baseClone;function require_baseClone(){if(hasRequired_baseClone)return _baseClone;hasRequired_baseClone=1;var e=require_Stack(),t=require_arrayEach(),I=require_assignValue(),B=require_baseAssign(),tr=require_baseAssignIn(),rr=require_cloneBuffer(),ir=require_copyArray(),lr=require_copySymbols(),dr=require_copySymbolsIn(),hr=require_getAllKeys(),fr=require_getAllKeysIn(),mr=require_getTag(),_r=require_initCloneArray(),yr=require_initCloneByTag(),xr=require_initCloneObject(),Mr=requireIsArray(),vr=requireIsBuffer(),Sr=requireIsMap(),wr=requireIsObject(),br=requireIsSet(),Ar=requireKeys(),kr=requireKeysIn(),Dr=1,Or=2,zr=4,$n="[object Arguments]",Fr="[object Array]",$r="[object Boolean]",Hn="[object Date]",ti="[object Error]",Ir="[object Function]",Lr="[object GeneratorFunction]",Kn="[object Map]",pi="[object Number]",gi="[object Object]",oi="[object RegExp]",qn="[object Set]",li="[object String]",di="[object Symbol]",Jn="[object WeakMap]",Qr="[object ArrayBuffer]",Jr="[object DataView]",ei="[object Float32Array]",mi="[object Float64Array]",ci="[object Int8Array]",ai="[object Int16Array]",fi="[object Int32Array]",vi="[object Uint8Array]",xi="[object Uint8ClampedArray]",Ci="[object Uint16Array]",Yn="[object Uint32Array]",ii={};ii[$n]=ii[Fr]=ii[Qr]=ii[Jr]=ii[$r]=ii[Hn]=ii[ei]=ii[mi]=ii[ci]=ii[ai]=ii[fi]=ii[Kn]=ii[pi]=ii[gi]=ii[oi]=ii[qn]=ii[li]=ii[di]=ii[vi]=ii[xi]=ii[Ci]=ii[Yn]=!0,ii[ti]=ii[Ir]=ii[Jn]=!1;function $i(Ti,Qi,hi,hs,Yi,ss){var Bi,Xn=Qi&Dr,ni=Qi&Or,wi=Qi&zr;if(hi&&(Bi=Yi?hi(Ti,hs,Yi,ss):hi(Ti)),Bi!==void 0)return Bi;if(!wr(Ti))return Ti;var Mi=Mr(Ti);if(Mi){if(Bi=_r(Ti),!Xn)return ir(Ti,Bi)}else{var ri=mr(Ti),Gr=ri==Ir||ri==Lr;if(vr(Ti))return rr(Ti,Xn);if(ri==gi||ri==$n||Gr&&!Yi){if(Bi=ni||Gr?{}:xr(Ti),!Xn)return ni?dr(Ti,tr(Bi,Ti)):lr(Ti,B(Bi,Ti))}else{if(!ii[ri])return Yi?Ti:{};Bi=yr(Ti,ri,Xn)}}ss||(ss=new e);var Si=ss.get(Ti);if(Si)return Si;ss.set(Ti,Bi),br(Ti)?Ti.forEach(function(Hi){Bi.add($i(Hi,Qi,hi,Hi,Ti,ss))}):Sr(Ti)&&Ti.forEach(function(Hi,os){Bi.set(os,$i(Hi,Qi,hi,os,Ti,ss))});var Wi=wi?ni?fr:hr:ni?kr:Ar,Vi=Mi?void 0:Wi(Ti);return t(Vi||Ti,function(Hi,os){Vi&&(os=Hi,Hi=Ti[os]),I(Bi,os,$i(Hi,Qi,hi,os,Ti,ss))}),Bi}return _baseClone=$i,_baseClone}var cloneDeep_1,hasRequiredCloneDeep;function requireCloneDeep(){if(hasRequiredCloneDeep)return cloneDeep_1;hasRequiredCloneDeep=1;var e=require_baseClone(),t=1,I=4;function B(tr){return e(tr,t|I)}return cloneDeep_1=B,cloneDeep_1}var identity_1,hasRequiredIdentity;function requireIdentity(){if(hasRequiredIdentity)return identity_1;hasRequiredIdentity=1;function e(t){return t}return identity_1=e,identity_1}var _apply,hasRequired_apply;function require_apply(){if(hasRequired_apply)return _apply;hasRequired_apply=1;function e(t,I,B){switch(B.length){case 0:return t.call(I);case 1:return t.call(I,B[0]);case 2:return t.call(I,B[0],B[1]);case 3:return t.call(I,B[0],B[1],B[2])}return t.apply(I,B)}return _apply=e,_apply}var _overRest,hasRequired_overRest;function require_overRest(){if(hasRequired_overRest)return _overRest;hasRequired_overRest=1;var e=require_apply(),t=Math.max;function I(B,tr,rr){return tr=t(tr===void 0?B.length-1:tr,0),function(){for(var ir=arguments,lr=-1,dr=t(ir.length-tr,0),hr=Array(dr);++lr<dr;)hr[lr]=ir[tr+lr];lr=-1;for(var fr=Array(tr+1);++lr<tr;)fr[lr]=ir[lr];return fr[tr]=rr(hr),e(B,this,fr)}}return _overRest=I,_overRest}var constant_1,hasRequiredConstant;function requireConstant(){if(hasRequiredConstant)return constant_1;hasRequiredConstant=1;function e(t){return function(){return t}}return constant_1=e,constant_1}var _baseSetToString,hasRequired_baseSetToString;function require_baseSetToString(){if(hasRequired_baseSetToString)return _baseSetToString;hasRequired_baseSetToString=1;var e=requireConstant(),t=require_defineProperty(),I=requireIdentity(),B=t?function(tr,rr){return t(tr,"toString",{configurable:!0,enumerable:!1,value:e(rr),writable:!0})}:I;return _baseSetToString=B,_baseSetToString}var _shortOut,hasRequired_shortOut;function require_shortOut(){if(hasRequired_shortOut)return _shortOut;hasRequired_shortOut=1;var e=800,t=16,I=Date.now;function B(tr){var rr=0,ir=0;return function(){var lr=I(),dr=t-(lr-ir);if(ir=lr,dr>0){if(++rr>=e)return arguments[0]}else rr=0;return tr.apply(void 0,arguments)}}return _shortOut=B,_shortOut}var _setToString,hasRequired_setToString;function require_setToString(){if(hasRequired_setToString)return _setToString;hasRequired_setToString=1;var e=require_baseSetToString(),t=require_shortOut(),I=t(e);return _setToString=I,_setToString}var _baseRest,hasRequired_baseRest;function require_baseRest(){if(hasRequired_baseRest)return _baseRest;hasRequired_baseRest=1;var e=requireIdentity(),t=require_overRest(),I=require_setToString();function B(tr,rr){return I(t(tr,rr,e),tr+"")}return _baseRest=B,_baseRest}var _isIterateeCall,hasRequired_isIterateeCall;function require_isIterateeCall(){if(hasRequired_isIterateeCall)return _isIterateeCall;hasRequired_isIterateeCall=1;var e=requireEq(),t=requireIsArrayLike(),I=require_isIndex(),B=requireIsObject();function tr(rr,ir,lr){if(!B(lr))return!1;var dr=typeof ir;return(dr=="number"?t(lr)&&I(ir,lr.length):dr=="string"&&ir in lr)?e(lr[ir],rr):!1}return _isIterateeCall=tr,_isIterateeCall}var defaults_1,hasRequiredDefaults;function requireDefaults(){if(hasRequiredDefaults)return defaults_1;hasRequiredDefaults=1;var e=require_baseRest(),t=requireEq(),I=require_isIterateeCall(),B=requireKeysIn(),tr=Object.prototype,rr=tr.hasOwnProperty,ir=e(function(lr,dr){lr=Object(lr);var hr=-1,fr=dr.length,mr=fr>2?dr[2]:void 0;for(mr&&I(dr[0],dr[1],mr)&&(fr=1);++hr<fr;)for(var _r=dr[hr],yr=B(_r),xr=-1,Mr=yr.length;++xr<Mr;){var vr=yr[xr],Sr=lr[vr];(Sr===void 0||t(Sr,tr[vr])&&!rr.call(lr,vr))&&(lr[vr]=_r[vr])}return lr});return defaults_1=ir,defaults_1}var _arrayMap,hasRequired_arrayMap;function require_arrayMap(){if(hasRequired_arrayMap)return _arrayMap;hasRequired_arrayMap=1;function e(t,I){for(var B=-1,tr=t==null?0:t.length,rr=Array(tr);++B<tr;)rr[B]=I(t[B],B,t);return rr}return _arrayMap=e,_arrayMap}var isSymbol_1,hasRequiredIsSymbol;function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol_1;hasRequiredIsSymbol=1;var e=require_baseGetTag(),t=requireIsObjectLike(),I="[object Symbol]";function B(tr){return typeof tr=="symbol"||t(tr)&&e(tr)==I}return isSymbol_1=B,isSymbol_1}var _baseToString,hasRequired_baseToString;function require_baseToString(){if(hasRequired_baseToString)return _baseToString;hasRequired_baseToString=1;var e=require_Symbol(),t=require_arrayMap(),I=requireIsArray(),B=requireIsSymbol(),tr=e?e.prototype:void 0,rr=tr?tr.toString:void 0;function ir(lr){if(typeof lr=="string")return lr;if(I(lr))return t(lr,ir)+"";if(B(lr))return rr?rr.call(lr):"";var dr=lr+"";return dr=="0"&&1/lr==-1/0?"-0":dr}return _baseToString=ir,_baseToString}var toString_1,hasRequiredToString;function requireToString(){if(hasRequiredToString)return toString_1;hasRequiredToString=1;var e=require_baseToString();function t(I){return I==null?"":e(I)}return toString_1=t,toString_1}var uniqueId_1,hasRequiredUniqueId;function requireUniqueId(){if(hasRequiredUniqueId)return uniqueId_1;hasRequiredUniqueId=1;var e=requireToString(),t=0;function I(B){var tr=++t;return e(B)+tr}return uniqueId_1=I,uniqueId_1}var timeout={},hasRequiredTimeout;function requireTimeout(){if(hasRequiredTimeout)return timeout;hasRequiredTimeout=1;class e extends Error{constructor(B){super(B),this.name="KnexTimeoutError"}}function t(I,B){return new Promise(function(tr,rr){const ir=setTimeout(function(){rr(new e("operation timed out"))},B);function lr(hr){clearTimeout(ir),tr(hr)}function dr(hr){clearTimeout(ir),rr(hr)}I.then(lr,dr)})}return timeout.KnexTimeoutError=e,timeout.timeout=t,timeout}var ensureConnectionCallback_1,hasRequiredEnsureConnectionCallback;function requireEnsureConnectionCallback(){if(hasRequiredEnsureConnectionCallback)return ensureConnectionCallback_1;hasRequiredEnsureConnectionCallback=1;function e(I){I.client.emit("start",I.builder),I.builder.emit("start",I.builder);const B=I.builder.toSQL();return I.builder._debug&&I.client.logger.debug(B),Array.isArray(B)?I.queryArray(B):I.query(B)}function t(I,B){try{const tr=I.builder.toSQL();if(Array.isArray(tr)&&B.hasHandler)throw new Error("The stream may only be used with a single query statement.");return I.client.stream(I.connection,tr,B.stream,B.options)}catch(tr){throw B.stream.emit("error",tr),tr}}return ensureConnectionCallback_1={ensureConnectionCallback:e,ensureConnectionStreamCallback:t},ensureConnectionCallback_1}var runner,hasRequiredRunner;function requireRunner(){if(hasRequiredRunner)return runner;hasRequiredRunner=1;const{KnexTimeoutError:e}=requireTimeout(),{timeout:t}=requireTimeout(),{ensureConnectionCallback:I,ensureConnectionStreamCallback:B}=requireEnsureConnectionCallback();let tr;class rr{constructor(lr,dr){this.client=lr,this.builder=dr,this.queries=[],this.connection=void 0}async run(){const lr=this;try{const dr=await this.ensureConnection(I);return lr.builder.emit("end"),dr}catch(dr){throw lr.builder._events&&lr.builder._events.error&&lr.builder.emit("error",dr),dr}}stream(lr,dr){const hr=typeof lr=="function"&&arguments.length===1,fr=hr?{}:lr,mr=hr?lr:dr,_r=typeof mr=="function";tr=tr||require$$1.Transform;const yr=this.builder.queryContext(),xr=new tr({objectMode:!0,transform:(vr,Sr,wr)=>{wr(null,this.client.postProcessResponse(vr,yr))}});xr.on("close",()=>{this.client.releaseConnection(this.connection)}),xr.on("pipe",vr=>{const Sr=()=>{vr.closed||vr.destroy()};xr.closed?Sr():xr.on("close",Sr)});const Mr=this.ensureConnection(B,{options:fr,hasHandler:_r,stream:xr}).catch(vr=>{this.connection||xr.emit("error",vr)});return _r?(mr(xr),Mr):xr}pipe(lr,dr){return this.stream(dr).pipe(lr)}async query(lr){const{__knexUid:dr,__knexTxId:hr}=this.connection;this.builder.emit("query",Object.assign({__knexUid:dr,__knexTxId:hr},lr));const fr=this,mr=this.builder.queryContext();lr!==null&&typeof lr=="object"&&(lr.queryContext=mr);let _r=this.client.query(this.connection,lr);return lr.timeout&&(_r=t(_r,lr.timeout)),_r.then(yr=>this.client.processResponse(yr,fr)).then(yr=>{const xr=this.client.postProcessResponse(yr,mr);return this.builder.emit("query-response",xr,Object.assign({__knexUid:dr,__knexTxId:hr},lr),this.builder),this.client.emit("query-response",xr,Object.assign({__knexUid:dr,__knexTxId:hr},lr),this.builder),xr}).catch(yr=>{if(!(yr instanceof e))return Promise.reject(yr);const{timeout:xr,sql:Mr,bindings:vr}=lr;let Sr;return lr.cancelOnTimeout?Sr=this.client.cancelQuery(this.connection):(this.connection.__knex__disposed=yr,Sr=Promise.resolve()),Sr.catch(wr=>{throw this.connection.__knex__disposed=yr,Object.assign(wr,{message:`After query timeout of ${xr}ms exceeded, cancelling of query failed.`,sql:Mr,bindings:vr,timeout:xr})}).then(()=>{throw Object.assign(yr,{message:`Defined query timeout of ${xr}ms exceeded when running query.`,sql:Mr,bindings:vr,timeout:xr})})}).catch(yr=>{throw this.builder.emit("query-error",yr,Object.assign({__knexUid:dr,__knexTxId:hr,queryContext:mr},lr)),yr})}async queryArray(lr){if(lr.length===1){const hr=lr[0];if(!hr.statementsProducer)return this.query(hr);const fr=await hr.statementsProducer(void 0,this.connection),mr=fr.sql.map(Mr=>({sql:Mr,bindings:hr.bindings})),_r=fr.pre.map(Mr=>({sql:Mr,bindings:hr.bindings})),yr=fr.post.map(Mr=>({sql:Mr,bindings:hr.bindings}));let xr=[];await this.queryArray(_r);try{await this.client.transaction(async Mr=>{const vr=new rr(Mr.client,this.builder);if(vr.connection=this.connection,xr=await vr.queryArray(mr),fr.check&&(await Mr.raw(fr.check)).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{await this.queryArray(yr)}return xr}const dr=[];for(const hr of lr)dr.push(await this.queryArray([hr]));return dr}async ensureConnection(lr,dr){if(this.builder._connection&&(this.connection=this.builder._connection),this.connection)return lr(this,dr);let hr;try{hr=await this.client.acquireConnection()}catch(fr){if(!(fr instanceof e))return Promise.reject(fr);throw this.builder&&(fr.sql=this.builder.sql,fr.bindings=this.builder.bindings),fr}try{return this.connection=hr,await lr(this,dr)}finally{await this.client.releaseConnection(hr)}}}return runner=rr,runner}var browser={exports:{}},ms,hasRequiredMs;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var e=1e3,t=e*60,I=t*60,B=I*24,tr=B*7,rr=B*365.25;ms=function(fr,mr){mr=mr||{};var _r=typeof fr;if(_r==="string"&&fr.length>0)return ir(fr);if(_r==="number"&&isFinite(fr))return mr.long?dr(fr):lr(fr);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(fr))};function ir(fr){if(fr=String(fr),!(fr.length>100)){var mr=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(fr);if(mr){var _r=parseFloat(mr[1]),yr=(mr[2]||"ms").toLowerCase();switch(yr){case"years":case"year":case"yrs":case"yr":case"y":return _r*rr;case"weeks":case"week":case"w":return _r*tr;case"days":case"day":case"d":return _r*B;case"hours":case"hour":case"hrs":case"hr":case"h":return _r*I;case"minutes":case"minute":case"mins":case"min":case"m":return _r*t;case"seconds":case"second":case"secs":case"sec":case"s":return _r*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _r;default:return}}}}function lr(fr){var mr=Math.abs(fr);return mr>=B?Math.round(fr/B)+"d":mr>=I?Math.round(fr/I)+"h":mr>=t?Math.round(fr/t)+"m":mr>=e?Math.round(fr/e)+"s":fr+"ms"}function dr(fr){var mr=Math.abs(fr);return mr>=B?hr(fr,mr,B,"day"):mr>=I?hr(fr,mr,I,"hour"):mr>=t?hr(fr,mr,t,"minute"):mr>=e?hr(fr,mr,e,"second"):fr+" ms"}function hr(fr,mr,_r,yr){var xr=mr>=_r*1.5;return Math.round(fr/_r)+" "+yr+(xr?"s":"")}return ms}var common,hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;function e(t){B.debug=B,B.default=B,B.coerce=hr,B.disable=ir,B.enable=rr,B.enabled=lr,B.humanize=requireMs(),B.destroy=fr,Object.keys(t).forEach(mr=>{B[mr]=t[mr]}),B.names=[],B.skips=[],B.formatters={};function I(mr){let _r=0;for(let yr=0;yr<mr.length;yr++)_r=(_r<<5)-_r+mr.charCodeAt(yr),_r|=0;return B.colors[Math.abs(_r)%B.colors.length]}B.selectColor=I;function B(mr){let _r,yr=null,xr,Mr;function vr(...Sr){if(!vr.enabled)return;const wr=vr,br=Number(new Date),Ar=br-(_r||br);wr.diff=Ar,wr.prev=_r,wr.curr=br,_r=br,Sr[0]=B.coerce(Sr[0]),typeof Sr[0]!="string"&&Sr.unshift("%O");let kr=0;Sr[0]=Sr[0].replace(/%([a-zA-Z%])/g,(Or,zr)=>{if(Or==="%%")return"%";kr++;const $n=B.formatters[zr];if(typeof $n=="function"){const Fr=Sr[kr];Or=$n.call(wr,Fr),Sr.splice(kr,1),kr--}return Or}),B.formatArgs.call(wr,Sr),(wr.log||B.log).apply(wr,Sr)}return vr.namespace=mr,vr.useColors=B.useColors(),vr.color=B.selectColor(mr),vr.extend=tr,vr.destroy=B.destroy,Object.defineProperty(vr,"enabled",{enumerable:!0,configurable:!1,get:()=>yr!==null?yr:(xr!==B.namespaces&&(xr=B.namespaces,Mr=B.enabled(mr)),Mr),set:Sr=>{yr=Sr}}),typeof B.init=="function"&&B.init(vr),vr}function tr(mr,_r){const yr=B(this.namespace+(typeof _r>"u"?":":_r)+mr);return yr.log=this.log,yr}function rr(mr){B.save(mr),B.namespaces=mr,B.names=[],B.skips=[];let _r;const yr=(typeof mr=="string"?mr:"").split(/[\s,]+/),xr=yr.length;for(_r=0;_r<xr;_r++)yr[_r]&&(mr=yr[_r].replace(/\*/g,".*?"),mr[0]==="-"?B.skips.push(new RegExp("^"+mr.slice(1)+"$")):B.names.push(new RegExp("^"+mr+"$")))}function ir(){const mr=[...B.names.map(dr),...B.skips.map(dr).map(_r=>"-"+_r)].join(",");return B.enable(""),mr}function lr(mr){if(mr[mr.length-1]==="*")return!0;let _r,yr;for(_r=0,yr=B.skips.length;_r<yr;_r++)if(B.skips[_r].test(mr))return!1;for(_r=0,yr=B.names.length;_r<yr;_r++)if(B.names[_r].test(mr))return!0;return!1}function dr(mr){return mr.toString().substring(2,mr.toString().length-2).replace(/\.\*\?$/,"*")}function hr(mr){return mr instanceof Error?mr.stack||mr.message:mr}function fr(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return B.enable(B.load()),B}return common=e,common}var hasRequiredBrowser;function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,function(e,t){var I={};t.formatArgs=tr,t.save=rr,t.load=ir,t.useColors=B,t.storage=lr(),t.destroy=(()=>{let hr=!1;return()=>{hr||(hr=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function B(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tr(hr){if(hr[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+hr[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const fr="color: "+this.color;hr.splice(1,0,fr,"color: inherit");let mr=0,_r=0;hr[0].replace(/%[a-zA-Z%]/g,yr=>{yr!=="%%"&&(mr++,yr==="%c"&&(_r=mr))}),hr.splice(_r,0,fr)}t.log=console.debug||console.log||(()=>{});function rr(hr){try{hr?t.storage.setItem("debug",hr):t.storage.removeItem("debug")}catch{}}function ir(){let hr;try{hr=t.storage.getItem("debug")}catch{}return!hr&&typeof process<"u"&&"env"in process&&(hr=I.DEBUG),hr}function lr(){try{return localStorage}catch{}}e.exports=requireCommon()(t);const{formatters:dr}=e.exports;dr.j=function(hr){try{return JSON.stringify(hr)}catch(fr){return"[UnexpectedJSONParseError]: "+fr.message}}}(browser,browser.exports)),browser.exports}var noop$1,hasRequiredNoop$1;function requireNoop$1(){return hasRequiredNoop$1||(hasRequiredNoop$1=1,noop$1=function(){}),noop$1}var FunctionHelper_1,hasRequiredFunctionHelper;function requireFunctionHelper(){if(hasRequiredFunctionHelper)return FunctionHelper_1;hasRequiredFunctionHelper=1;class e{constructor(I){this.client=I}now(I){return typeof I=="number"?this.client.raw(`CURRENT_TIMESTAMP(${I})`):this.client.raw("CURRENT_TIMESTAMP")}uuid(){switch(this.client.driverName){case"sqlite3":case"better-sqlite3":return this.client.raw("(lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))))");case"mssql":return this.client.raw("(NEWID())");case"pg":case"pgnative":case"cockroachdb":return this.client.raw("(gen_random_uuid())");case"oracle":case"oracledb":return this.client.raw("(random_uuid())");case"mysql":case"mysql2":return this.client.raw("(UUID())");default:throw new Error(`${this.client.driverName} does not have a uuid function`)}}uuidToBin(I,B=!0){const tr=Buffer.from(I.replace(/-/g,""),"hex");return B?Buffer.concat([tr.slice(6,8),tr.slice(4,6),tr.slice(0,4),tr.slice(8,16)]):Buffer.concat([tr.slice(0,4),tr.slice(4,6),tr.slice(6,8),tr.slice(8,16)])}binToUuid(I,B=!0){const tr=Buffer.from(I,"hex");return B?[tr.toString("hex",4,8),tr.toString("hex",2,4),tr.toString("hex",0,2),tr.toString("hex",8,10),tr.toString("hex",10,16)].join("-"):[tr.toString("hex",0,4),tr.toString("hex",4,6),tr.toString("hex",6,8),tr.toString("hex",8,10),tr.toString("hex",10,16)].join("-")}}return FunctionHelper_1=e,FunctionHelper_1}var methodConstants,hasRequiredMethodConstants;function requireMethodConstants(){return hasRequiredMethodConstants||(hasRequiredMethodConstants=1,methodConstants=["with","withRecursive","withMaterialized","withNotMaterialized","select","as","columns","column","from","fromJS","fromRaw","into","withSchema","table","distinct","join","joinRaw","innerJoin","leftJoin","leftOuterJoin","rightJoin","rightOuterJoin","outerJoin","fullOuterJoin","crossJoin","where","andWhere","orWhere","whereNot","orWhereNot","whereLike","andWhereLike","orWhereLike","whereILike","andWhereILike","orWhereILike","whereRaw","whereWrapped","havingWrapped","orWhereRaw","whereExists","orWhereExists","whereNotExists","orWhereNotExists","whereIn","orWhereIn","whereNotIn","orWhereNotIn","whereNull","orWhereNull","whereNotNull","orWhereNotNull","whereBetween","whereNotBetween","andWhereBetween","andWhereNotBetween","orWhereBetween","orWhereNotBetween","groupBy","groupByRaw","orderBy","orderByRaw","union","unionAll","intersect","except","having","havingRaw","orHaving","orHavingRaw","offset","limit","count","countDistinct","min","max","sum","sumDistinct","avg","avgDistinct","increment","decrement","first","debug","pluck","clearSelect","clearWhere","clearGroup","clearOrder","clearHaving","insert","update","returning","del","delete","truncate","transacting","connection","jsonExtract","jsonSet","jsonInsert","jsonRemove","whereJsonObject","orWhereJsonObject","andWhereJsonObject","whereNotJsonObject","orWhereNotJsonObject","andWhereNotJsonObject","whereJsonPath","orWhereJsonPath","andWhereJsonPath","whereJsonSupersetOf","orWhereJsonSupersetOf","andWhereJsonSupersetOf","whereJsonNotSupersetOf","orWhereJsonNotSupersetOf","andWhereJsonNotSupersetOf","whereJsonSubsetOf","orWhereJsonSubsetOf","andWhereJsonSubsetOf","whereJsonNotSubsetOf","orWhereJsonNotSubsetOf","andWhereJsonNotSubsetOf"]),methodConstants}var _assignMergeValue,hasRequired_assignMergeValue;function require_assignMergeValue(){if(hasRequired_assignMergeValue)return _assignMergeValue;hasRequired_assignMergeValue=1;var e=require_baseAssignValue(),t=requireEq();function I(B,tr,rr){(rr!==void 0&&!t(B[tr],rr)||rr===void 0&&!(tr in B))&&e(B,tr,rr)}return _assignMergeValue=I,_assignMergeValue}var _createBaseFor,hasRequired_createBaseFor;function require_createBaseFor(){if(hasRequired_createBaseFor)return _createBaseFor;hasRequired_createBaseFor=1;function e(t){return function(I,B,tr){for(var rr=-1,ir=Object(I),lr=tr(I),dr=lr.length;dr--;){var hr=lr[t?dr:++rr];if(B(ir[hr],hr,ir)===!1)break}return I}}return _createBaseFor=e,_createBaseFor}var _baseFor,hasRequired_baseFor;function require_baseFor(){if(hasRequired_baseFor)return _baseFor;hasRequired_baseFor=1;var e=require_createBaseFor(),t=e();return _baseFor=t,_baseFor}var isArrayLikeObject_1,hasRequiredIsArrayLikeObject;function requireIsArrayLikeObject(){if(hasRequiredIsArrayLikeObject)return isArrayLikeObject_1;hasRequiredIsArrayLikeObject=1;var e=requireIsArrayLike(),t=requireIsObjectLike();function I(B){return t(B)&&e(B)}return isArrayLikeObject_1=I,isArrayLikeObject_1}var isPlainObject_1,hasRequiredIsPlainObject;function requireIsPlainObject(){if(hasRequiredIsPlainObject)return isPlainObject_1;hasRequiredIsPlainObject=1;var e=require_baseGetTag(),t=require_getPrototype(),I=requireIsObjectLike(),B="[object Object]",tr=Function.prototype,rr=Object.prototype,ir=tr.toString,lr=rr.hasOwnProperty,dr=ir.call(Object);function hr(fr){if(!I(fr)||e(fr)!=B)return!1;var mr=t(fr);if(mr===null)return!0;var _r=lr.call(mr,"constructor")&&mr.constructor;return typeof _r=="function"&&_r instanceof _r&&ir.call(_r)==dr}return isPlainObject_1=hr,isPlainObject_1}var _safeGet,hasRequired_safeGet;function require_safeGet(){if(hasRequired_safeGet)return _safeGet;hasRequired_safeGet=1;function e(t,I){if(!(I==="constructor"&&typeof t[I]=="function")&&I!="__proto__")return t[I]}return _safeGet=e,_safeGet}var toPlainObject_1,hasRequiredToPlainObject;function requireToPlainObject(){if(hasRequiredToPlainObject)return toPlainObject_1;hasRequiredToPlainObject=1;var e=require_copyObject(),t=requireKeysIn();function I(B){return e(B,t(B))}return toPlainObject_1=I,toPlainObject_1}var _baseMergeDeep,hasRequired_baseMergeDeep;function require_baseMergeDeep(){if(hasRequired_baseMergeDeep)return _baseMergeDeep;hasRequired_baseMergeDeep=1;var e=require_assignMergeValue(),t=require_cloneBuffer(),I=require_cloneTypedArray(),B=require_copyArray(),tr=require_initCloneObject(),rr=requireIsArguments$1(),ir=requireIsArray(),lr=requireIsArrayLikeObject(),dr=requireIsBuffer(),hr=requireIsFunction(),fr=requireIsObject(),mr=requireIsPlainObject(),_r=requireIsTypedArray(),yr=require_safeGet(),xr=requireToPlainObject();function Mr(vr,Sr,wr,br,Ar,kr,Dr){var Or=yr(vr,wr),zr=yr(Sr,wr),$n=Dr.get(zr);if($n){e(vr,wr,$n);return}var Fr=kr?kr(Or,zr,wr+"",vr,Sr,Dr):void 0,$r=Fr===void 0;if($r){var Hn=ir(zr),ti=!Hn&&dr(zr),Ir=!Hn&&!ti&&_r(zr);Fr=zr,Hn||ti||Ir?ir(Or)?Fr=Or:lr(Or)?Fr=B(Or):ti?($r=!1,Fr=t(zr,!0)):Ir?($r=!1,Fr=I(zr,!0)):Fr=[]:mr(zr)||rr(zr)?(Fr=Or,rr(Or)?Fr=xr(Or):(!fr(Or)||hr(Or))&&(Fr=tr(zr))):$r=!1}$r&&(Dr.set(zr,Fr),Ar(Fr,zr,br,kr,Dr),Dr.delete(zr)),e(vr,wr,Fr)}return _baseMergeDeep=Mr,_baseMergeDeep}var _baseMerge,hasRequired_baseMerge;function require_baseMerge(){if(hasRequired_baseMerge)return _baseMerge;hasRequired_baseMerge=1;var e=require_Stack(),t=require_assignMergeValue(),I=require_baseFor(),B=require_baseMergeDeep(),tr=requireIsObject(),rr=requireKeysIn(),ir=require_safeGet();function lr(dr,hr,fr,mr,_r){dr!==hr&&I(hr,function(yr,xr){if(_r||(_r=new e),tr(yr))B(dr,hr,xr,fr,lr,mr,_r);else{var Mr=mr?mr(ir(dr,xr),yr,xr+"",dr,hr,_r):void 0;Mr===void 0&&(Mr=yr),t(dr,xr,Mr)}},rr)}return _baseMerge=lr,_baseMerge}var _createAssigner,hasRequired_createAssigner;function require_createAssigner(){if(hasRequired_createAssigner)return _createAssigner;hasRequired_createAssigner=1;var e=require_baseRest(),t=require_isIterateeCall();function I(B){return e(function(tr,rr){var ir=-1,lr=rr.length,dr=lr>1?rr[lr-1]:void 0,hr=lr>2?rr[2]:void 0;for(dr=B.length>3&&typeof dr=="function"?(lr--,dr):void 0,hr&&t(rr[0],rr[1],hr)&&(dr=lr<3?void 0:dr,lr=1),tr=Object(tr);++ir<lr;){var fr=rr[ir];fr&&B(tr,fr,ir,dr)}return tr})}return _createAssigner=I,_createAssigner}var merge_1,hasRequiredMerge;function requireMerge(){if(hasRequiredMerge)return merge_1;hasRequiredMerge=1;var e=require_baseMerge(),t=require_createAssigner(),I=t(function(B,tr,rr){e(B,tr,rr)});return merge_1=I,merge_1}var _baseSlice,hasRequired_baseSlice;function require_baseSlice(){if(hasRequired_baseSlice)return _baseSlice;hasRequired_baseSlice=1;function e(t,I,B){var tr=-1,rr=t.length;I<0&&(I=-I>rr?0:rr+I),B=B>rr?rr:B,B<0&&(B+=rr),rr=I>B?0:B-I>>>0,I>>>=0;for(var ir=Array(rr);++tr<rr;)ir[tr]=t[tr+I];return ir}return _baseSlice=e,_baseSlice}var _trimmedEndIndex,hasRequired_trimmedEndIndex;function require_trimmedEndIndex(){if(hasRequired_trimmedEndIndex)return _trimmedEndIndex;hasRequired_trimmedEndIndex=1;var e=/\s/;function t(I){for(var B=I.length;B--&&e.test(I.charAt(B)););return B}return _trimmedEndIndex=t,_trimmedEndIndex}var _baseTrim,hasRequired_baseTrim;function require_baseTrim(){if(hasRequired_baseTrim)return _baseTrim;hasRequired_baseTrim=1;var e=require_trimmedEndIndex(),t=/^\s+/;function I(B){return B&&B.slice(0,e(B)+1).replace(t,"")}return _baseTrim=I,_baseTrim}var toNumber_1,hasRequiredToNumber;function requireToNumber(){if(hasRequiredToNumber)return toNumber_1;hasRequiredToNumber=1;var e=require_baseTrim(),t=requireIsObject(),I=requireIsSymbol(),B=NaN,tr=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,ir=/^0o[0-7]+$/i,lr=parseInt;function dr(hr){if(typeof hr=="number")return hr;if(I(hr))return B;if(t(hr)){var fr=typeof hr.valueOf=="function"?hr.valueOf():hr;hr=t(fr)?fr+"":fr}if(typeof hr!="string")return hr===0?hr:+hr;hr=e(hr);var mr=rr.test(hr);return mr||ir.test(hr)?lr(hr.slice(2),mr?2:8):tr.test(hr)?B:+hr}return toNumber_1=dr,toNumber_1}var toFinite_1,hasRequiredToFinite;function requireToFinite(){if(hasRequiredToFinite)return toFinite_1;hasRequiredToFinite=1;var e=requireToNumber(),t=1/0,I=17976931348623157e292;function B(tr){if(!tr)return tr===0?tr:0;if(tr=e(tr),tr===t||tr===-t){var rr=tr<0?-1:1;return rr*I}return tr===tr?tr:0}return toFinite_1=B,toFinite_1}var toInteger_1,hasRequiredToInteger;function requireToInteger(){if(hasRequiredToInteger)return toInteger_1;hasRequiredToInteger=1;var e=requireToFinite();function t(I){var B=e(I),tr=B%1;return B===B?tr?B-tr:B:0}return toInteger_1=t,toInteger_1}var chunk_1,hasRequiredChunk;function requireChunk(){if(hasRequiredChunk)return chunk_1;hasRequiredChunk=1;var e=require_baseSlice(),t=require_isIterateeCall(),I=requireToInteger(),B=Math.ceil,tr=Math.max;function rr(ir,lr,dr){(dr?t(ir,lr,dr):lr===void 0)?lr=1:lr=tr(I(lr),0);var hr=ir==null?0:ir.length;if(!hr||lr<1)return[];for(var fr=0,mr=0,_r=Array(B(hr/lr));fr<hr;)_r[mr++]=e(ir,fr,fr+=lr);return _r}return chunk_1=rr,chunk_1}var _isFlattenable,hasRequired_isFlattenable;function require_isFlattenable(){if(hasRequired_isFlattenable)return _isFlattenable;hasRequired_isFlattenable=1;var e=require_Symbol(),t=requireIsArguments$1(),I=requireIsArray(),B=e?e.isConcatSpreadable:void 0;function tr(rr){return I(rr)||t(rr)||!!(B&&rr&&rr[B])}return _isFlattenable=tr,_isFlattenable}var _baseFlatten,hasRequired_baseFlatten;function require_baseFlatten(){if(hasRequired_baseFlatten)return _baseFlatten;hasRequired_baseFlatten=1;var e=require_arrayPush(),t=require_isFlattenable();function I(B,tr,rr,ir,lr){var dr=-1,hr=B.length;for(rr||(rr=t),lr||(lr=[]);++dr<hr;){var fr=B[dr];tr>0&&rr(fr)?tr>1?I(fr,tr-1,rr,ir,lr):e(lr,fr):ir||(lr[lr.length]=fr)}return lr}return _baseFlatten=I,_baseFlatten}var flatten_1,hasRequiredFlatten;function requireFlatten(){if(hasRequiredFlatten)return flatten_1;hasRequiredFlatten=1;var e=require_baseFlatten();function t(I){var B=I==null?0:I.length;return B?e(I,1):[]}return flatten_1=t,flatten_1}var delay,hasRequiredDelay;function requireDelay(){return hasRequiredDelay||(hasRequiredDelay=1,delay=e=>new Promise(t=>setTimeout(t,e))),delay}var is,hasRequiredIs;function requireIs(){if(hasRequiredIs)return is;hasRequiredIs=1;function e(ir){return typeof ir=="string"}function t(ir){return typeof ir=="number"}function I(ir){return typeof ir=="boolean"}function B(ir){return typeof ir>"u"}function tr(ir){return typeof ir=="object"&&ir!==null}function rr(ir){return typeof ir=="function"}return is={isString:e,isNumber:t,isBoolean:I,isUndefined:B,isObject:tr,isFunction:rr},is}var batchInsert_1,hasRequiredBatchInsert;function requireBatchInsert(){if(hasRequiredBatchInsert)return batchInsert_1;hasRequiredBatchInsert=1;const e=requireChunk(),t=requireFlatten(),I=requireDelay(),{isNumber:B}=requireIs();function tr(rr,ir,lr,dr=1e3){let hr,fr=null;if(!B(dr)||dr<1)throw new TypeError(`Invalid chunkSize: ${dr}`);if(!Array.isArray(lr))throw new TypeError(`Invalid batch: Expected array, got ${typeof lr}`);const mr=e(lr,dr),_r=yr=>fr?yr(fr):rr.transaction(yr);return Object.assign(Promise.resolve().then(async()=>(await I(1),_r(async yr=>{const xr=[];for(const Mr of mr)xr.push(await yr(ir).insert(Mr,hr));return t(xr)}))),{returning(yr){return hr=yr,this},transacting(yr){return fr=yr,this}})}return batchInsert_1=tr,batchInsert_1}var security,hasRequiredSecurity;function requireSecurity(){if(hasRequiredSecurity)return security;hasRequiredSecurity=1;function e(t,I,B="password"){I||(I=t),Object.defineProperty(t,B,{enumerable:!1,value:I[B]})}return security={setHiddenProperty:e},security}var makeKnex_1,hasRequiredMakeKnex;function requireMakeKnex(){if(hasRequiredMakeKnex)return makeKnex_1;hasRequiredMakeKnex=1;const{EventEmitter:e}=requireEvents(),{Migrator:t}=requireNoop$1(),I=requireNoop$1(),B=requireFunctionHelper(),tr=requireMethodConstants(),rr=requireMerge(),ir=requireBatchInsert(),{isObject:lr}=requireIs(),{setHiddenProperty:dr}=requireSecurity(),hr={client:{get(){return this.context.client},set(wr){this.context.client=wr},configurable:!0},userParams:{get(){return this.context.userParams},set(wr){this.context.userParams=wr},configurable:!0},schema:{get(){return this.client.schemaBuilder()},configurable:!0},migrate:{get(){return new t(this)},configurable:!0},seed:{get(){return new I(this)},configurable:!0},fn:{get(){return new B(this.client)},configurable:!0}},fr=["raw","batchInsert","transaction","transactionProvider","initialize","destroy","ref","withUserParams","queryBuilder","disableProcessing","enableProcessing"];for(const wr of fr)hr[wr]={value:function(...br){return this.context[wr](...br)},configurable:!0};function mr(wr){function br(Ar,kr){return vr(br.context,Ar,kr)}return xr(br,wr),br}function _r(wr){const br=wr.context||{};Object.assign(br,{queryBuilder(){return this.client.queryBuilder()},raw(){return this.client.raw.apply(this.client,arguments)},batchInsert(Ar,kr,Dr=1e3){return ir(this,Ar,kr,Dr)},transaction(Ar,kr){!kr&&lr(Ar)&&(kr=Ar,Ar=null);const Dr=Object.assign({},kr);return Dr.userParams=this.userParams||{},Dr.doNotRejectOnRollback===void 0&&(Dr.doNotRejectOnRollback=!0),this._transaction(Ar,Dr)},_transaction(Ar,kr,Dr=null){return Ar?this.client.transaction(Ar,kr,Dr):new Promise((Or,zr)=>{this.client.transaction(Or,kr,Dr).catch(zr)})},transactionProvider(Ar){let kr;return()=>(kr||(kr=this.transaction(void 0,Ar)),kr)},initialize(Ar){return this.client.initializePool(Ar)},destroy(Ar){return this.client.destroy(Ar)},ref(Ar){return this.client.ref(Ar)},disableProcessing(){this.userParams.isProcessingDisabled||(this.userParams.wrapIdentifier=this.client.config.wrapIdentifier,this.userParams.postProcessResponse=this.client.config.postProcessResponse,this.client.config.wrapIdentifier=null,this.client.config.postProcessResponse=null,this.userParams.isProcessingDisabled=!0)},enableProcessing(){this.userParams.isProcessingDisabled&&(this.client.config.wrapIdentifier=this.userParams.wrapIdentifier,this.client.config.postProcessResponse=this.userParams.postProcessResponse,this.userParams.isProcessingDisabled=!1)},withUserParams(Ar){const kr=Sr(wr);return this.client&&(kr.client=Object.create(this.client.constructor.prototype),rr(kr.client,this.client),kr.client.config=Object.assign({},this.client.config),this.client.config.password&&dr(kr.client.config,this.client.config)),xr(kr,kr.client),yr("query",wr,kr),yr("query-error",wr,kr),yr("query-response",wr,kr),yr("start",wr,kr),kr.userParams=Ar,kr}}),wr.context||(wr.context=br)}function yr(wr,br,Ar){br.listeners(wr).forEach(Dr=>{Ar.on(wr,Dr)})}function xr(wr,br){for(let kr=0;kr<tr.length;kr++){const Dr=tr[kr];wr[Dr]=function(){const Or=this.queryBuilder();return Or[Dr].apply(Or,arguments)}}Object.defineProperties(wr,hr),_r(wr),wr.client=br,wr.userParams={};const Ar=new e;for(const kr in Ar)wr[kr]=Ar[kr];wr._internalListeners&&wr._internalListeners.forEach(({eventName:kr,listener:Dr})=>{wr.client.removeListener(kr,Dr)}),wr._internalListeners=[],Mr(wr,"start",kr=>{wr.emit("start",kr)}),Mr(wr,"query",kr=>{wr.emit("query",kr)}),Mr(wr,"query-error",(kr,Dr)=>{wr.emit("query-error",kr,Dr)}),Mr(wr,"query-response",(kr,Dr,Or)=>{wr.emit("query-response",kr,Dr,Or)})}function Mr(wr,br,Ar){wr.client.on(br,Ar),wr._internalListeners.push({eventName:br,listener:Ar})}function vr(wr,br,Ar){const kr=wr.queryBuilder();return br||wr.client.logger.warn("calling knex without a tableName is deprecated. Use knex.queryBuilder() instead."),br?kr.table(br,Ar):kr}function Sr(wr){const br=Object.create(Object.getPrototypeOf(wr),Object.getOwnPropertyDescriptors(wr)),Ar={},Dr=((Or,zr)=>vr(Ar,Or,zr)).bind(br);return Object.assign(Dr,wr),Dr.context=Ar,Dr}return makeKnex_1=mr,makeKnex_1}var finallyMixin_1,hasRequiredFinallyMixin;function requireFinallyMixin(){if(hasRequiredFinallyMixin)return finallyMixin_1;hasRequiredFinallyMixin=1;const e=requireNoop$1(),t=I=>Object.assign(I,{finally(B){return this.then().finally(B)}});return finallyMixin_1=Promise.prototype.finally?t:e,finallyMixin_1}var transaction$5,hasRequiredTransaction$5;function requireTransaction$5(){if(hasRequiredTransaction$5)return transaction$5;hasRequiredTransaction$5=1;const{EventEmitter:e}=requireEvents(),t=requireBrowser(),I=requireUniqueId(),{callbackify:B}=requireUtil(),tr=requireMakeKnex(),{timeout:rr,KnexTimeoutError:ir}=requireTimeout(),lr=requireFinallyMixin(),dr=t("knex:tx");function hr(){return{userParams:{},doNotRejectOnRollback:!0}}const fr=["read uncommitted","read committed","snapshot","repeatable read","serializable"];class mr extends e{constructor(vr,Sr,wr=hr(),br=null){super(),this.userParams=wr.userParams,this.doNotRejectOnRollback=wr.doNotRejectOnRollback;const Ar=this.txid=I("trx");this.client=vr,this.logger=vr.logger,this.outerTx=br,this.trxClient=void 0,this._completed=!1,this._debug=vr.config&&vr.config.debug,this.readOnly=wr.readOnly,wr.isolationLevel&&this.setIsolationLevel(wr.isolationLevel),dr("%s: Starting %s transaction",Ar,br?"nested":"top level"),this._lastChild=Promise.resolve();const Dr=(br?br._lastChild:Promise.resolve()).then(()=>this._evaluateContainer(wr,Sr));this._promise=Dr.then(Or=>Or),br&&(br._lastChild=Dr.catch(()=>{}))}isCompleted(){return this._completed||this.outerTx&&this.outerTx.isCompleted()||!1}begin(vr){const Sr=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return Sr.length===0?this.query(vr,"BEGIN;"):this.query(vr,`SET TRANSACTION ${Sr};`).then(()=>this.query(vr,"BEGIN;"))}savepoint(vr){return this.query(vr,`SAVEPOINT ${this.txid};`)}commit(vr,Sr){return this.query(vr,"COMMIT;",1,Sr)}release(vr,Sr){return this.query(vr,`RELEASE SAVEPOINT ${this.txid};`,1,Sr)}setIsolationLevel(vr){if(!fr.includes(vr))throw new Error(`Invalid isolationLevel, supported isolation levels are: ${JSON.stringify(fr)}`);return this.isolationLevel=vr,this}rollback(vr,Sr){return rr(this.query(vr,"ROLLBACK",2,Sr),5e3).catch(wr=>{if(!(wr instanceof ir))return Promise.reject(wr);this._rejecter(Sr)})}rollbackTo(vr,Sr){return rr(this.query(vr,`ROLLBACK TO SAVEPOINT ${this.txid}`,2,Sr),5e3).catch(wr=>{if(!(wr instanceof ir))return Promise.reject(wr);this._rejecter(Sr)})}query(vr,Sr,wr,br){const Ar=this.trxClient.query(vr,Sr).catch(kr=>{wr=2,br=kr,this._completed=!0,dr("%s error running transaction query",this.txid)}).then(kr=>{if(wr===1&&this._resolver(br),wr===2){if(br===void 0){if(this.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(Sr)){this._resolver();return}br=new Error(`Transaction rejected with non-error: ${br}`)}this._rejecter(br)}return kr});return(wr===1||wr===2)&&(this._completed=!0),Ar}debug(vr){return this._debug=arguments.length?vr:!0,this}async _evaluateContainer(vr,Sr){return this.acquireConnection(vr,wr=>{const br=this.trxClient=yr(this,this.client,wr),Ar=this.client.transacting?this.savepoint(wr):this.begin(wr),kr=new Promise((Dr,Or)=>{this._resolver=Dr,this._rejecter=Or});return Ar.then(()=>_r(this,wr,br)).then(Dr=>{this.transactor=Dr,this.outerTx&&(Dr.parentTransaction=this.outerTx.transactor),Dr.executionPromise=kr;let Or;try{Or=Sr(Dr)}catch(zr){Or=Promise.reject(zr)}return Or&&Or.then&&typeof Or.then=="function"&&Or.then(zr=>Dr.commit(zr)).catch(zr=>Dr.rollback(zr)),null}).catch(Dr=>this._rejecter(Dr)),kr})}async acquireConnection(vr,Sr){const wr=vr&&vr.connection,br=wr||await this.client.acquireConnection();try{return br.__knexTxId=this.txid,await Sr(br)}finally{wr?dr("%s: not releasing external connection",this.txid):(dr("%s: releasing connection",this.txid),this.client.releaseConnection(br))}}then(vr,Sr){return this._promise.then(vr,Sr)}catch(...vr){return this._promise.catch(...vr)}asCallback(vr){return B(()=>this._promise)(vr),this._promise}}lr(mr.prototype);function _r(Mr,vr,Sr){const wr=tr(Sr);return wr.context.withUserParams=()=>{throw new Error("Cannot set user params on a transaction - it can only inherit params from main knex instance")},wr.isTransaction=!0,wr.userParams=Mr.userParams||{},wr.context.transaction=function(br,Ar){return Ar?Ar.doNotRejectOnRollback===void 0&&(Ar.doNotRejectOnRollback=!0):Ar={doNotRejectOnRollback:!0},this._transaction(br,Ar,Mr)},wr.savepoint=function(br,Ar){return wr.transaction(br,Ar)},Mr.client.transacting?(wr.commit=br=>Mr.release(vr,br),wr.rollback=br=>Mr.rollbackTo(vr,br)):(wr.commit=br=>Mr.commit(vr,br),wr.rollback=br=>Mr.rollback(vr,br)),wr.isCompleted=()=>Mr.isCompleted(),wr}function yr(Mr,vr,Sr){const wr=Object.create(vr.constructor.prototype);wr.version=vr.version,wr.config=vr.config,wr.driver=vr.driver,wr.connectionSettings=vr.connectionSettings,wr.transacting=!0,wr.valueForUndefined=vr.valueForUndefined,wr.logger=vr.logger,wr.on("start",function(kr){Mr.emit("start",kr),vr.emit("start",kr)}),wr.on("query",function(kr){Mr.emit("query",kr),vr.emit("query",kr)}),wr.on("query-error",function(kr,Dr){Mr.emit("query-error",kr,Dr),vr.emit("query-error",kr,Dr)}),wr.on("query-response",function(kr,Dr,Or){Mr.emit("query-response",kr,Dr,Or),vr.emit("query-response",kr,Dr,Or)});const br=wr.query;wr.query=function(kr,Dr){const Or=Mr.isCompleted();return new Promise(function(zr,$n){try{if(kr!==Sr)throw new Error("Invalid connection for transaction query.");Or&&xr(Mr,Dr),zr(br.call(wr,kr,Dr))}catch(Fr){$n(Fr)}})};const Ar=wr.stream;return wr.stream=function(kr,Dr,Or,zr){const $n=Mr.isCompleted();return new Promise(function(Fr,$r){try{if(kr!==Sr)throw new Error("Invalid connection for transaction query.");$n&&xr(Mr,Dr),Fr(Ar.call(wr,kr,Dr,Or,zr))}catch(Hn){$r(Hn)}})},wr.acquireConnection=function(){return Promise.resolve(Sr)},wr.releaseConnection=function(){return Promise.resolve()},wr}function xr(Mr,vr){const Sr=typeof vr=="string"?vr:vr&&vr.sql;throw dr("%s: Transaction completed: %s",Mr.txid,Sr),new Error("Transaction query already complete, run with DEBUG=knex:tx for more info")}return transaction$5=mr,transaction$5}var queryExecutioner,hasRequiredQueryExecutioner;function requireQueryExecutioner(){if(hasRequiredQueryExecutioner)return queryExecutioner;hasRequiredQueryExecutioner=1;const e=requireBrowser()("knex:query"),t=requireBrowser()("knex:bindings"),I=(lr,dr)=>e(lr.replace(/%/g,"%%"),dr),{isString:B}=requireIs();function tr(lr,dr,hr,fr){dr=dr==null?[]:[].concat(dr);let mr=0;return lr.replace(/\\?\?/g,_r=>{if(_r==="\\?")return"?";if(mr===dr.length)return _r;const yr=dr[mr++];return fr._escapeBinding(yr,{timeZone:hr})})}function rr(lr,dr,hr){const fr=B(dr)?{sql:dr}:dr;fr.bindings=hr.prepBindings(fr.bindings),fr.sql=hr.positionBindings(fr.sql);const{__knexUid:mr,__knexTxId:_r}=lr;return hr.emit("query",Object.assign({__knexUid:mr,__knexTxId:_r},fr)),I(fr.sql,_r),t(fr.bindings,_r),fr}function ir(lr,dr,hr){return hr._query(lr,dr).catch(fr=>{throw hr.config&&hr.config.compileSqlOnError===!1?fr.message=dr.sql+" - "+fr.message:fr.message=tr(dr.sql,dr.bindings,void 0,hr)+" - "+fr.message,hr.emit("query-error",fr,Object.assign({__knexUid:lr.__knexUid,__knexTxId:lr.__knexUid},dr)),fr})}return queryExecutioner={enrichQueryObject:rr,executeQuery:ir,formatQuery:tr},queryExecutioner}var assert={exports:{}},errors={},hasRequiredErrors;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;function e(wr){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(br){return typeof br}:function(br){return br&&typeof Symbol=="function"&&br.constructor===Symbol&&br!==Symbol.prototype?"symbol":typeof br},e(wr)}function t(wr,br,Ar){return Object.defineProperty(wr,"prototype",{writable:!1}),wr}function I(wr,br){if(!(wr instanceof br))throw new TypeError("Cannot call a class as a function")}function B(wr,br){if(typeof br!="function"&&br!==null)throw new TypeError("Super expression must either be null or a function");wr.prototype=Object.create(br&&br.prototype,{constructor:{value:wr,writable:!0,configurable:!0}}),Object.defineProperty(wr,"prototype",{writable:!1}),br&&tr(wr,br)}function tr(wr,br){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(kr,Dr){return kr.__proto__=Dr,kr},tr(wr,br)}function rr(wr){var br=dr();return function(){var kr=hr(wr),Dr;if(br){var Or=hr(this).constructor;Dr=Reflect.construct(kr,arguments,Or)}else Dr=kr.apply(this,arguments);return ir(this,Dr)}}function ir(wr,br){if(br&&(e(br)==="object"||typeof br=="function"))return br;if(br!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lr(wr)}function lr(wr){if(wr===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return wr}function dr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hr(wr){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ar){return Ar.__proto__||Object.getPrototypeOf(Ar)},hr(wr)}var fr={},mr,_r;function yr(wr,br,Ar){Ar||(Ar=Error);function kr(Or,zr,$n){return typeof br=="string"?br:br(Or,zr,$n)}var Dr=function(Or){B($n,Or);var zr=rr($n);function $n(Fr,$r,Hn){var ti;return I(this,$n),ti=zr.call(this,kr(Fr,$r,Hn)),ti.code=wr,ti}return t($n)}(Ar);fr[wr]=Dr}function xr(wr,br){if(Array.isArray(wr)){var Ar=wr.length;return wr=wr.map(function(kr){return String(kr)}),Ar>2?"one of ".concat(br," ").concat(wr.slice(0,Ar-1).join(", "),", or ")+wr[Ar-1]:Ar===2?"one of ".concat(br," ").concat(wr[0]," or ").concat(wr[1]):"of ".concat(br," ").concat(wr[0])}else return"of ".concat(br," ").concat(String(wr))}function Mr(wr,br,Ar){return wr.substr(0,br.length)===br}function vr(wr,br,Ar){return(Ar===void 0||Ar>wr.length)&&(Ar=wr.length),wr.substring(Ar-br.length,Ar)===br}function Sr(wr,br,Ar){return typeof Ar!="number"&&(Ar=0),Ar+br.length>wr.length?!1:wr.indexOf(br,Ar)!==-1}return yr("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),yr("ERR_INVALID_ARG_TYPE",function(wr,br,Ar){mr===void 0&&(mr=requireAssert()),mr(typeof wr=="string","'name' must be a string");var kr;typeof br=="string"&&Mr(br,"not ")?(kr="must not be",br=br.replace(/^not /,"")):kr="must be";var Dr;if(vr(wr," argument"))Dr="The ".concat(wr," ").concat(kr," ").concat(xr(br,"type"));else{var Or=Sr(wr,".")?"property":"argument";Dr='The "'.concat(wr,'" ').concat(Or," ").concat(kr," ").concat(xr(br,"type"))}return Dr+=". Received type ".concat(e(Ar)),Dr},TypeError),yr("ERR_INVALID_ARG_VALUE",function(wr,br){var Ar=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";_r===void 0&&(_r=requireUtil());var kr=_r.inspect(br);return kr.length>128&&(kr="".concat(kr.slice(0,128),"...")),"The argument '".concat(wr,"' ").concat(Ar,". Received ").concat(kr)},TypeError),yr("ERR_INVALID_RETURN_VALUE",function(wr,br,Ar){var kr;return Ar&&Ar.constructor&&Ar.constructor.name?kr="instance of ".concat(Ar.constructor.name):kr="type ".concat(e(Ar)),"Expected ".concat(wr,' to be returned from the "').concat(br,'"')+" function but got ".concat(kr,".")},TypeError),yr("ERR_MISSING_ARGS",function(){for(var wr=arguments.length,br=new Array(wr),Ar=0;Ar<wr;Ar++)br[Ar]=arguments[Ar];mr===void 0&&(mr=requireAssert()),mr(br.length>0,"At least one arg needs to be specified");var kr="The ",Dr=br.length;switch(br=br.map(function(Or){return'"'.concat(Or,'"')}),Dr){case 1:kr+="".concat(br[0]," argument");break;case 2:kr+="".concat(br[0]," and ").concat(br[1]," arguments");break;default:kr+=br.slice(0,Dr-1).join(", "),kr+=", and ".concat(br[Dr-1]," arguments");break}return"".concat(kr," must be specified")},TypeError),errors.codes=fr,errors}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function e(oi,qn){var li=Object.keys(oi);if(Object.getOwnPropertySymbols){var di=Object.getOwnPropertySymbols(oi);qn&&(di=di.filter(function(Jn){return Object.getOwnPropertyDescriptor(oi,Jn).enumerable})),li.push.apply(li,di)}return li}function t(oi){for(var qn=1;qn<arguments.length;qn++){var li=arguments[qn]!=null?arguments[qn]:{};qn%2?e(Object(li),!0).forEach(function(di){I(oi,di,li[di])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oi,Object.getOwnPropertyDescriptors(li)):e(Object(li)).forEach(function(di){Object.defineProperty(oi,di,Object.getOwnPropertyDescriptor(li,di))})}return oi}function I(oi,qn,li){return qn=ir(qn),qn in oi?Object.defineProperty(oi,qn,{value:li,enumerable:!0,configurable:!0,writable:!0}):oi[qn]=li,oi}function B(oi,qn){if(!(oi instanceof qn))throw new TypeError("Cannot call a class as a function")}function tr(oi,qn){for(var li=0;li<qn.length;li++){var di=qn[li];di.enumerable=di.enumerable||!1,di.configurable=!0,"value"in di&&(di.writable=!0),Object.defineProperty(oi,ir(di.key),di)}}function rr(oi,qn,li){return qn&&tr(oi.prototype,qn),Object.defineProperty(oi,"prototype",{writable:!1}),oi}function ir(oi){var qn=lr(oi,"string");return wr(qn)==="symbol"?qn:String(qn)}function lr(oi,qn){if(wr(oi)!=="object"||oi===null)return oi;var li=oi[Symbol.toPrimitive];if(li!==void 0){var di=li.call(oi,qn);if(wr(di)!=="object")return di;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(oi)}function dr(oi,qn){if(typeof qn!="function"&&qn!==null)throw new TypeError("Super expression must either be null or a function");oi.prototype=Object.create(qn&&qn.prototype,{constructor:{value:oi,writable:!0,configurable:!0}}),Object.defineProperty(oi,"prototype",{writable:!1}),qn&&vr(oi,qn)}function hr(oi){var qn=xr();return function(){var di=Sr(oi),Jn;if(qn){var Qr=Sr(this).constructor;Jn=Reflect.construct(di,arguments,Qr)}else Jn=di.apply(this,arguments);return fr(this,Jn)}}function fr(oi,qn){if(qn&&(wr(qn)==="object"||typeof qn=="function"))return qn;if(qn!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mr(oi)}function mr(oi){if(oi===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oi}function _r(oi){var qn=typeof Map=="function"?new Map:void 0;return _r=function(di){if(di===null||!Mr(di))return di;if(typeof di!="function")throw new TypeError("Super expression must either be null or a function");if(typeof qn<"u"){if(qn.has(di))return qn.get(di);qn.set(di,Jn)}function Jn(){return yr(di,arguments,Sr(this).constructor)}return Jn.prototype=Object.create(di.prototype,{constructor:{value:Jn,enumerable:!1,writable:!0,configurable:!0}}),vr(Jn,di)},_r(oi)}function yr(oi,qn,li){return xr()?yr=Reflect.construct.bind():yr=function(Jn,Qr,Jr){var ei=[null];ei.push.apply(ei,Qr);var mi=Function.bind.apply(Jn,ei),ci=new mi;return Jr&&vr(ci,Jr.prototype),ci},yr.apply(null,arguments)}function xr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Mr(oi){return Function.toString.call(oi).indexOf("[native code]")!==-1}function vr(oi,qn){return vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(di,Jn){return di.__proto__=Jn,di},vr(oi,qn)}function Sr(oi){return Sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(li){return li.__proto__||Object.getPrototypeOf(li)},Sr(oi)}function wr(oi){"@babel/helpers - typeof";return wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(qn){return typeof qn}:function(qn){return qn&&typeof Symbol=="function"&&qn.constructor===Symbol&&qn!==Symbol.prototype?"symbol":typeof qn},wr(oi)}var br=requireUtil(),Ar=br.inspect,kr=requireErrors(),Dr=kr.codes.ERR_INVALID_ARG_TYPE;function Or(oi,qn,li){return(li===void 0||li>oi.length)&&(li=oi.length),oi.substring(li-qn.length,li)===qn}function zr(oi,qn){if(qn=Math.floor(qn),oi.length==0||qn==0)return"";var li=oi.length*qn;for(qn=Math.floor(Math.log(qn)/Math.log(2));qn;)oi+=oi,qn--;return oi+=oi.substring(0,li-oi.length),oi}var $n="",Fr="",$r="",Hn="",ti={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},Ir=10;function Lr(oi){var qn=Object.keys(oi),li=Object.create(Object.getPrototypeOf(oi));return qn.forEach(function(di){li[di]=oi[di]}),Object.defineProperty(li,"message",{value:oi.message}),li}function Kn(oi){return Ar(oi,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function pi(oi,qn,li){var di="",Jn="",Qr=0,Jr="",ei=!1,mi=Kn(oi),ci=mi.split(`
|
|
13
|
-
`),ai=Kn(qn).split(`
|
|
14
|
-
`),fi=0,vi="";if(li==="strictEqual"&&wr(oi)==="object"&&wr(qn)==="object"&&oi!==null&&qn!==null&&(li="strictEqualObject"),ci.length===1&&ai.length===1&&ci[0]!==ai[0]){var xi=ci[0].length+ai[0].length;if(xi<=Ir){if((wr(oi)!=="object"||oi===null)&&(wr(qn)!=="object"||qn===null)&&(oi!==0||qn!==0))return"".concat(ti[li],`
|
|
15
|
-
|
|
16
|
-
`)+"".concat(ci[0]," !== ").concat(ai[0],`
|
|
17
|
-
`)}else if(li!=="strictEqualObject"){var Ci=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(xi<Ci){for(;ci[0][fi]===ai[0][fi];)fi++;fi>2&&(vi=`
|
|
18
|
-
`.concat(zr(" ",fi),"^"),fi=0)}}}for(var Yn=ci[ci.length-1],ii=ai[ai.length-1];Yn===ii&&(fi++<2?Jr=`
|
|
19
|
-
`.concat(Yn).concat(Jr):di=Yn,ci.pop(),ai.pop(),!(ci.length===0||ai.length===0));)Yn=ci[ci.length-1],ii=ai[ai.length-1];var $i=Math.max(ci.length,ai.length);if($i===0){var Ti=mi.split(`
|
|
20
|
-
`);if(Ti.length>30)for(Ti[26]="".concat($n,"...").concat(Hn);Ti.length>27;)Ti.pop();return"".concat(ti.notIdentical,`
|
|
21
|
-
|
|
22
|
-
`).concat(Ti.join(`
|
|
23
|
-
`),`
|
|
24
|
-
`)}fi>3&&(Jr=`
|
|
25
|
-
`.concat($n,"...").concat(Hn).concat(Jr),ei=!0),di!==""&&(Jr=`
|
|
26
|
-
`.concat(di).concat(Jr),di="");var Qi=0,hi=ti[li]+`
|
|
27
|
-
`.concat(Fr,"+ actual").concat(Hn," ").concat($r,"- expected").concat(Hn),hs=" ".concat($n,"...").concat(Hn," Lines skipped");for(fi=0;fi<$i;fi++){var Yi=fi-Qr;if(ci.length<fi+1)Yi>1&&fi>2&&(Yi>4?(Jn+=`
|
|
28
|
-
`.concat($n,"...").concat(Hn),ei=!0):Yi>3&&(Jn+=`
|
|
29
|
-
`.concat(ai[fi-2]),Qi++),Jn+=`
|
|
30
|
-
`.concat(ai[fi-1]),Qi++),Qr=fi,di+=`
|
|
31
|
-
`.concat($r,"-").concat(Hn," ").concat(ai[fi]),Qi++;else if(ai.length<fi+1)Yi>1&&fi>2&&(Yi>4?(Jn+=`
|
|
32
|
-
`.concat($n,"...").concat(Hn),ei=!0):Yi>3&&(Jn+=`
|
|
33
|
-
`.concat(ci[fi-2]),Qi++),Jn+=`
|
|
34
|
-
`.concat(ci[fi-1]),Qi++),Qr=fi,Jn+=`
|
|
35
|
-
`.concat(Fr,"+").concat(Hn," ").concat(ci[fi]),Qi++;else{var ss=ai[fi],Bi=ci[fi],Xn=Bi!==ss&&(!Or(Bi,",")||Bi.slice(0,-1)!==ss);Xn&&Or(ss,",")&&ss.slice(0,-1)===Bi&&(Xn=!1,Bi+=","),Xn?(Yi>1&&fi>2&&(Yi>4?(Jn+=`
|
|
36
|
-
`.concat($n,"...").concat(Hn),ei=!0):Yi>3&&(Jn+=`
|
|
37
|
-
`.concat(ci[fi-2]),Qi++),Jn+=`
|
|
38
|
-
`.concat(ci[fi-1]),Qi++),Qr=fi,Jn+=`
|
|
39
|
-
`.concat(Fr,"+").concat(Hn," ").concat(Bi),di+=`
|
|
40
|
-
`.concat($r,"-").concat(Hn," ").concat(ss),Qi+=2):(Jn+=di,di="",(Yi===1||fi===0)&&(Jn+=`
|
|
41
|
-
`.concat(Bi),Qi++))}if(Qi>20&&fi<$i-2)return"".concat(hi).concat(hs,`
|
|
42
|
-
`).concat(Jn,`
|
|
43
|
-
`).concat($n,"...").concat(Hn).concat(di,`
|
|
44
|
-
`)+"".concat($n,"...").concat(Hn)}return"".concat(hi).concat(ei?hs:"",`
|
|
45
|
-
`).concat(Jn).concat(di).concat(Jr).concat(vi)}var gi=function(oi,qn){dr(di,oi);var li=hr(di);function di(Jn){var Qr;if(B(this,di),wr(Jn)!=="object"||Jn===null)throw new Dr("options","Object",Jn);var Jr=Jn.message,ei=Jn.operator,mi=Jn.stackStartFn,ci=Jn.actual,ai=Jn.expected,fi=Error.stackTraceLimit;if(Error.stackTraceLimit=0,Jr!=null)Qr=li.call(this,String(Jr));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?($n="\x1B[34m",Fr="\x1B[32m",Hn="\x1B[39m",$r="\x1B[31m"):($n="",Fr="",Hn="",$r="")),wr(ci)==="object"&&ci!==null&&wr(ai)==="object"&&ai!==null&&"stack"in ci&&ci instanceof Error&&"stack"in ai&&ai instanceof Error&&(ci=Lr(ci),ai=Lr(ai)),ei==="deepStrictEqual"||ei==="strictEqual")Qr=li.call(this,pi(ci,ai,ei));else if(ei==="notDeepStrictEqual"||ei==="notStrictEqual"){var vi=ti[ei],xi=Kn(ci).split(`
|
|
46
|
-
`);if(ei==="notStrictEqual"&&wr(ci)==="object"&&ci!==null&&(vi=ti.notStrictEqualObject),xi.length>30)for(xi[26]="".concat($n,"...").concat(Hn);xi.length>27;)xi.pop();xi.length===1?Qr=li.call(this,"".concat(vi," ").concat(xi[0])):Qr=li.call(this,"".concat(vi,`
|
|
47
|
-
|
|
48
|
-
`).concat(xi.join(`
|
|
49
|
-
`),`
|
|
50
|
-
`))}else{var Ci=Kn(ci),Yn="",ii=ti[ei];ei==="notDeepEqual"||ei==="notEqual"?(Ci="".concat(ti[ei],`
|
|
51
|
-
|
|
52
|
-
`).concat(Ci),Ci.length>1024&&(Ci="".concat(Ci.slice(0,1021),"..."))):(Yn="".concat(Kn(ai)),Ci.length>512&&(Ci="".concat(Ci.slice(0,509),"...")),Yn.length>512&&(Yn="".concat(Yn.slice(0,509),"...")),ei==="deepEqual"||ei==="equal"?Ci="".concat(ii,`
|
|
53
|
-
|
|
54
|
-
`).concat(Ci,`
|
|
55
|
-
|
|
56
|
-
should equal
|
|
57
|
-
|
|
58
|
-
`):Yn=" ".concat(ei," ").concat(Yn)),Qr=li.call(this,"".concat(Ci).concat(Yn))}return Error.stackTraceLimit=fi,Qr.generatedMessage=!Jr,Object.defineProperty(mr(Qr),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),Qr.code="ERR_ASSERTION",Qr.actual=ci,Qr.expected=ai,Qr.operator=ei,Error.captureStackTrace&&Error.captureStackTrace(mr(Qr),mi),Qr.name="AssertionError",fr(Qr)}return rr(di,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:qn,value:function(Qr,Jr){return Ar(this,t(t({},Jr),{},{customInspect:!1,depth:0}))}}]),di}(_r(Error),Ar.custom);return assertion_error=gi,assertion_error}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var e=Object.prototype.toString;return isArguments=function(I){var B=e.call(I),tr=B==="[object Arguments]";return tr||(tr=B!=="[object Array]"&&I!==null&&typeof I=="object"&&typeof I.length=="number"&&I.length>=0&&e.call(I.callee)==="[object Function]"),tr},isArguments}var implementation$3,hasRequiredImplementation$3;function requireImplementation$3(){if(hasRequiredImplementation$3)return implementation$3;hasRequiredImplementation$3=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,I=Object.prototype.toString,B=requireIsArguments(),tr=Object.prototype.propertyIsEnumerable,rr=!tr.call({toString:null},"toString"),ir=tr.call(function(){},"prototype"),lr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dr=function(_r){var yr=_r.constructor;return yr&&yr.prototype===_r},hr={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},fr=function(){if(typeof window>"u")return!1;for(var _r in window)try{if(!hr["$"+_r]&&t.call(window,_r)&&window[_r]!==null&&typeof window[_r]=="object")try{dr(window[_r])}catch{return!0}}catch{return!0}return!1}(),mr=function(_r){if(typeof window>"u"||!fr)return dr(_r);try{return dr(_r)}catch{return!1}};e=function(yr){var xr=yr!==null&&typeof yr=="object",Mr=I.call(yr)==="[object Function]",vr=B(yr),Sr=xr&&I.call(yr)==="[object String]",wr=[];if(!xr&&!Mr&&!vr)throw new TypeError("Object.keys called on a non-object");var br=ir&&Mr;if(Sr&&yr.length>0&&!t.call(yr,0))for(var Ar=0;Ar<yr.length;++Ar)wr.push(String(Ar));if(vr&&yr.length>0)for(var kr=0;kr<yr.length;++kr)wr.push(String(kr));else for(var Dr in yr)!(br&&Dr==="prototype")&&t.call(yr,Dr)&&wr.push(String(Dr));if(rr)for(var Or=mr(yr),zr=0;zr<lr.length;++zr)!(Or&&lr[zr]==="constructor")&&t.call(yr,lr[zr])&&wr.push(lr[zr]);return wr}}return implementation$3=e,implementation$3}var objectKeys,hasRequiredObjectKeys;function requireObjectKeys(){if(hasRequiredObjectKeys)return objectKeys;hasRequiredObjectKeys=1;var e=Array.prototype.slice,t=requireIsArguments(),I=Object.keys,B=I?function(ir){return I(ir)}:requireImplementation$3(),tr=Object.keys;return B.shim=function(){if(Object.keys){var ir=function(){var lr=Object.keys(arguments);return lr&&lr.length===arguments.length}(1,2);ir||(Object.keys=function(dr){return t(dr)?tr(e.call(dr)):tr(dr)})}else Object.keys=B;return Object.keys||B},objectKeys=B,objectKeys}var implementation$2,hasRequiredImplementation$2;function requireImplementation$2(){if(hasRequiredImplementation$2)return implementation$2;hasRequiredImplementation$2=1;var e=requireObjectKeys(),t=requireShams$1()(),I=requireCallBound$1(),B=requireEsObjectAtoms(),tr=I("Array.prototype.push"),rr=I("Object.prototype.propertyIsEnumerable"),ir=t?B.getOwnPropertySymbols:null;return implementation$2=function(dr,hr){if(dr==null)throw new TypeError("target must be an object");var fr=B(dr);if(arguments.length===1)return fr;for(var mr=1;mr<arguments.length;++mr){var _r=B(arguments[mr]),yr=e(_r),xr=t&&(B.getOwnPropertySymbols||ir);if(xr)for(var Mr=xr(_r),vr=0;vr<Mr.length;++vr){var Sr=Mr[vr];rr(_r,Sr)&&tr(yr,Sr)}for(var wr=0;wr<yr.length;++wr){var br=yr[wr];if(rr(_r,br)){var Ar=_r[br];fr[br]=Ar}}}return fr},implementation$2}var polyfill$2,hasRequiredPolyfill$2;function requirePolyfill$2(){if(hasRequiredPolyfill$2)return polyfill$2;hasRequiredPolyfill$2=1;var e=requireImplementation$2(),t=function(){if(!Object.assign)return!1;for(var B="abcdefghijklmnopqrst",tr=B.split(""),rr={},ir=0;ir<tr.length;++ir)rr[tr[ir]]=tr[ir];var lr=Object.assign({},rr),dr="";for(var hr in lr)dr+=hr;return B!==dr},I=function(){if(!Object.assign||!Object.preventExtensions)return!1;var B=Object.preventExtensions({1:2});try{Object.assign(B,"xy")}catch{return B[1]==="y"}return!1};return polyfill$2=function(){return!Object.assign||t()||I()?e:Object.assign},polyfill$2}var implementation$1,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$1;hasRequiredImplementation$1=1;var e=function(t){return t!==t};return implementation$1=function(I,B){return I===0&&B===0?1/I===1/B:!!(I===B||e(I)&&e(B))},implementation$1}var polyfill$1,hasRequiredPolyfill$1;function requirePolyfill$1(){if(hasRequiredPolyfill$1)return polyfill$1;hasRequiredPolyfill$1=1;var e=requireImplementation$1();return polyfill$1=function(){return typeof Object.is=="function"?Object.is:e},polyfill$1}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var e=requireGetIntrinsic(),t=requireCallBind(),I=t(e("String.prototype.indexOf"));return callBound=function(tr,rr){var ir=e(tr,!!rr);return typeof ir=="function"&&I(tr,".prototype.")>-1?t(ir):ir},callBound}var defineProperties_1,hasRequiredDefineProperties;function requireDefineProperties(){if(hasRequiredDefineProperties)return defineProperties_1;hasRequiredDefineProperties=1;var e=requireObjectKeys(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",I=Object.prototype.toString,B=Array.prototype.concat,tr=requireDefineDataProperty(),rr=function(hr){return typeof hr=="function"&&I.call(hr)==="[object Function]"},ir=requireHasPropertyDescriptors()(),lr=function(hr,fr,mr,_r){if(fr in hr){if(_r===!0){if(hr[fr]===mr)return}else if(!rr(_r)||!_r())return}ir?tr(hr,fr,mr,!0):tr(hr,fr,mr)},dr=function(hr,fr){var mr=arguments.length>2?arguments[2]:{},_r=e(fr);t&&(_r=B.call(_r,Object.getOwnPropertySymbols(fr)));for(var yr=0;yr<_r.length;yr+=1)lr(hr,_r[yr],fr[_r[yr]],mr[_r[yr]])};return dr.supportsDescriptors=!!ir,defineProperties_1=dr,defineProperties_1}var shim$1,hasRequiredShim$1;function requireShim$1(){if(hasRequiredShim$1)return shim$1;hasRequiredShim$1=1;var e=requirePolyfill$1(),t=requireDefineProperties();return shim$1=function(){var B=e();return t(Object,{is:B},{is:function(){return Object.is!==B}}),B},shim$1}var objectIs,hasRequiredObjectIs;function requireObjectIs(){if(hasRequiredObjectIs)return objectIs;hasRequiredObjectIs=1;var e=requireDefineProperties(),t=requireCallBind(),I=requireImplementation$1(),B=requirePolyfill$1(),tr=requireShim$1(),rr=t(B(),Object);return e(rr,{getPolyfill:B,implementation:I,shim:tr}),objectIs=rr,objectIs}var implementation,hasRequiredImplementation;function requireImplementation(){return hasRequiredImplementation||(hasRequiredImplementation=1,implementation=function(t){return t!==t}),implementation}var polyfill,hasRequiredPolyfill;function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var e=requireImplementation();return polyfill=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:e},polyfill}var shim,hasRequiredShim;function requireShim(){if(hasRequiredShim)return shim;hasRequiredShim=1;var e=requireDefineProperties(),t=requirePolyfill();return shim=function(){var B=t();return e(Number,{isNaN:B},{isNaN:function(){return Number.isNaN!==B}}),B},shim}var isNan,hasRequiredIsNan;function requireIsNan(){if(hasRequiredIsNan)return isNan;hasRequiredIsNan=1;var e=requireCallBind(),t=requireDefineProperties(),I=requireImplementation(),B=requirePolyfill(),tr=requireShim(),rr=e(B(),Number);return t(rr,{getPolyfill:B,implementation:I,shim:tr}),isNan=rr,isNan}var comparisons,hasRequiredComparisons;function requireComparisons(){if(hasRequiredComparisons)return comparisons;hasRequiredComparisons=1;function e(Xn,ni){return rr(Xn)||tr(Xn,ni)||I(Xn,ni)||t()}function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
59
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I(Xn,ni){if(Xn){if(typeof Xn=="string")return B(Xn,ni);var wi=Object.prototype.toString.call(Xn).slice(8,-1);if(wi==="Object"&&Xn.constructor&&(wi=Xn.constructor.name),wi==="Map"||wi==="Set")return Array.from(Xn);if(wi==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(wi))return B(Xn,ni)}}function B(Xn,ni){(ni==null||ni>Xn.length)&&(ni=Xn.length);for(var wi=0,Mi=new Array(ni);wi<ni;wi++)Mi[wi]=Xn[wi];return Mi}function tr(Xn,ni){var wi=Xn==null?null:typeof Symbol<"u"&&Xn[Symbol.iterator]||Xn["@@iterator"];if(wi!=null){var Mi,ri,Gr,Si,Wi=[],Vi=!0,Hi=!1;try{if(Gr=(wi=wi.call(Xn)).next,ni!==0)for(;!(Vi=(Mi=Gr.call(wi)).done)&&(Wi.push(Mi.value),Wi.length!==ni);Vi=!0);}catch(os){Hi=!0,ri=os}finally{try{if(!Vi&&wi.return!=null&&(Si=wi.return(),Object(Si)!==Si))return}finally{if(Hi)throw ri}}return Wi}}function rr(Xn){if(Array.isArray(Xn))return Xn}function ir(Xn){"@babel/helpers - typeof";return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ni){return typeof ni}:function(ni){return ni&&typeof Symbol=="function"&&ni.constructor===Symbol&&ni!==Symbol.prototype?"symbol":typeof ni},ir(Xn)}var lr=/a/g.flags!==void 0,dr=function(ni){var wi=[];return ni.forEach(function(Mi){return wi.push(Mi)}),wi},hr=function(ni){var wi=[];return ni.forEach(function(Mi,ri){return wi.push([ri,Mi])}),wi},fr=Object.is?Object.is:requireObjectIs(),mr=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},_r=Number.isNaN?Number.isNaN:requireIsNan();function yr(Xn){return Xn.call.bind(Xn)}var xr=yr(Object.prototype.hasOwnProperty),Mr=yr(Object.prototype.propertyIsEnumerable),vr=yr(Object.prototype.toString),Sr=requireUtil().types,wr=Sr.isAnyArrayBuffer,br=Sr.isArrayBufferView,Ar=Sr.isDate,kr=Sr.isMap,Dr=Sr.isRegExp,Or=Sr.isSet,zr=Sr.isNativeError,$n=Sr.isBoxedPrimitive,Fr=Sr.isNumberObject,$r=Sr.isStringObject,Hn=Sr.isBooleanObject,ti=Sr.isBigIntObject,Ir=Sr.isSymbolObject,Lr=Sr.isFloat32Array,Kn=Sr.isFloat64Array;function pi(Xn){if(Xn.length===0||Xn.length>10)return!0;for(var ni=0;ni<Xn.length;ni++){var wi=Xn.charCodeAt(ni);if(wi<48||wi>57)return!0}return Xn.length===10&&Xn>=Math.pow(2,32)}function gi(Xn){return Object.keys(Xn).filter(pi).concat(mr(Xn).filter(Object.prototype.propertyIsEnumerable.bind(Xn)))}/*!
|
|
60
|
-
* The buffer module from node.js, for the browser.
|
|
61
|
-
*
|
|
62
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
63
|
-
* @license MIT
|
|
64
|
-
*/function oi(Xn,ni){if(Xn===ni)return 0;for(var wi=Xn.length,Mi=ni.length,ri=0,Gr=Math.min(wi,Mi);ri<Gr;++ri)if(Xn[ri]!==ni[ri]){wi=Xn[ri],Mi=ni[ri];break}return wi<Mi?-1:Mi<wi?1:0}var qn=!0,li=!1,di=0,Jn=1,Qr=2,Jr=3;function ei(Xn,ni){return lr?Xn.source===ni.source&&Xn.flags===ni.flags:RegExp.prototype.toString.call(Xn)===RegExp.prototype.toString.call(ni)}function mi(Xn,ni){if(Xn.byteLength!==ni.byteLength)return!1;for(var wi=0;wi<Xn.byteLength;wi++)if(Xn[wi]!==ni[wi])return!1;return!0}function ci(Xn,ni){return Xn.byteLength!==ni.byteLength?!1:oi(new Uint8Array(Xn.buffer,Xn.byteOffset,Xn.byteLength),new Uint8Array(ni.buffer,ni.byteOffset,ni.byteLength))===0}function ai(Xn,ni){return Xn.byteLength===ni.byteLength&&oi(new Uint8Array(Xn),new Uint8Array(ni))===0}function fi(Xn,ni){return Fr(Xn)?Fr(ni)&&fr(Number.prototype.valueOf.call(Xn),Number.prototype.valueOf.call(ni)):$r(Xn)?$r(ni)&&String.prototype.valueOf.call(Xn)===String.prototype.valueOf.call(ni):Hn(Xn)?Hn(ni)&&Boolean.prototype.valueOf.call(Xn)===Boolean.prototype.valueOf.call(ni):ti(Xn)?ti(ni)&&BigInt.prototype.valueOf.call(Xn)===BigInt.prototype.valueOf.call(ni):Ir(ni)&&Symbol.prototype.valueOf.call(Xn)===Symbol.prototype.valueOf.call(ni)}function vi(Xn,ni,wi,Mi){if(Xn===ni)return Xn!==0?!0:wi?fr(Xn,ni):!0;if(wi){if(ir(Xn)!=="object")return typeof Xn=="number"&&_r(Xn)&&_r(ni);if(ir(ni)!=="object"||Xn===null||ni===null||Object.getPrototypeOf(Xn)!==Object.getPrototypeOf(ni))return!1}else{if(Xn===null||ir(Xn)!=="object")return ni===null||ir(ni)!=="object"?Xn==ni:!1;if(ni===null||ir(ni)!=="object")return!1}var ri=vr(Xn),Gr=vr(ni);if(ri!==Gr)return!1;if(Array.isArray(Xn)){if(Xn.length!==ni.length)return!1;var Si=gi(Xn),Wi=gi(ni);return Si.length!==Wi.length?!1:Ci(Xn,ni,wi,Mi,Jn,Si)}if(ri==="[object Object]"&&(!kr(Xn)&&kr(ni)||!Or(Xn)&&Or(ni)))return!1;if(Ar(Xn)){if(!Ar(ni)||Date.prototype.getTime.call(Xn)!==Date.prototype.getTime.call(ni))return!1}else if(Dr(Xn)){if(!Dr(ni)||!ei(Xn,ni))return!1}else if(zr(Xn)||Xn instanceof Error){if(Xn.message!==ni.message||Xn.name!==ni.name)return!1}else if(br(Xn)){if(!wi&&(Lr(Xn)||Kn(Xn))){if(!mi(Xn,ni))return!1}else if(!ci(Xn,ni))return!1;var Vi=gi(Xn),Hi=gi(ni);return Vi.length!==Hi.length?!1:Ci(Xn,ni,wi,Mi,di,Vi)}else{if(Or(Xn))return!Or(ni)||Xn.size!==ni.size?!1:Ci(Xn,ni,wi,Mi,Qr);if(kr(Xn))return!kr(ni)||Xn.size!==ni.size?!1:Ci(Xn,ni,wi,Mi,Jr);if(wr(Xn)){if(!ai(Xn,ni))return!1}else if($n(Xn)&&!fi(Xn,ni))return!1}return Ci(Xn,ni,wi,Mi,di)}function xi(Xn,ni){return ni.filter(function(wi){return Mr(Xn,wi)})}function Ci(Xn,ni,wi,Mi,ri,Gr){if(arguments.length===5){Gr=Object.keys(Xn);var Si=Object.keys(ni);if(Gr.length!==Si.length)return!1}for(var Wi=0;Wi<Gr.length;Wi++)if(!xr(ni,Gr[Wi]))return!1;if(wi&&arguments.length===5){var Vi=mr(Xn);if(Vi.length!==0){var Hi=0;for(Wi=0;Wi<Vi.length;Wi++){var os=Vi[Wi];if(Mr(Xn,os)){if(!Mr(ni,os))return!1;Gr.push(os),Hi++}else if(Mr(ni,os))return!1}var Ca=mr(ni);if(Vi.length!==Ca.length&&xi(ni,Ca).length!==Hi)return!1}else{var fa=mr(ni);if(fa.length!==0&&xi(ni,fa).length!==0)return!1}}if(Gr.length===0&&(ri===di||ri===Jn&&Xn.length===0||Xn.size===0))return!0;if(Mi===void 0)Mi={val1:new Map,val2:new Map,position:0};else{var Ba=Mi.val1.get(Xn);if(Ba!==void 0){var Qs=Mi.val2.get(ni);if(Qs!==void 0)return Ba===Qs}Mi.position++}Mi.val1.set(Xn,Mi.position),Mi.val2.set(ni,Mi.position);var aa=Yi(Xn,ni,wi,Gr,Mi,ri);return Mi.val1.delete(Xn),Mi.val2.delete(ni),aa}function Yn(Xn,ni,wi,Mi){for(var ri=dr(Xn),Gr=0;Gr<ri.length;Gr++){var Si=ri[Gr];if(vi(ni,Si,wi,Mi))return Xn.delete(Si),!0}return!1}function ii(Xn){switch(ir(Xn)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":Xn=+Xn;case"number":if(_r(Xn))return!1}return!0}function $i(Xn,ni,wi){var Mi=ii(wi);return Mi??(ni.has(Mi)&&!Xn.has(Mi))}function Ti(Xn,ni,wi,Mi,ri){var Gr=ii(wi);if(Gr!=null)return Gr;var Si=ni.get(Gr);return Si===void 0&&!ni.has(Gr)||!vi(Mi,Si,!1,ri)?!1:!Xn.has(Gr)&&vi(Mi,Si,!1,ri)}function Qi(Xn,ni,wi,Mi){for(var ri=null,Gr=dr(Xn),Si=0;Si<Gr.length;Si++){var Wi=Gr[Si];if(ir(Wi)==="object"&&Wi!==null)ri===null&&(ri=new Set),ri.add(Wi);else if(!ni.has(Wi)){if(wi||!$i(Xn,ni,Wi))return!1;ri===null&&(ri=new Set),ri.add(Wi)}}if(ri!==null){for(var Vi=dr(ni),Hi=0;Hi<Vi.length;Hi++){var os=Vi[Hi];if(ir(os)==="object"&&os!==null){if(!Yn(ri,os,wi,Mi))return!1}else if(!wi&&!Xn.has(os)&&!Yn(ri,os,wi,Mi))return!1}return ri.size===0}return!0}function hi(Xn,ni,wi,Mi,ri,Gr){for(var Si=dr(Xn),Wi=0;Wi<Si.length;Wi++){var Vi=Si[Wi];if(vi(wi,Vi,ri,Gr)&&vi(Mi,ni.get(Vi),ri,Gr))return Xn.delete(Vi),!0}return!1}function hs(Xn,ni,wi,Mi){for(var ri=null,Gr=hr(Xn),Si=0;Si<Gr.length;Si++){var Wi=e(Gr[Si],2),Vi=Wi[0],Hi=Wi[1];if(ir(Vi)==="object"&&Vi!==null)ri===null&&(ri=new Set),ri.add(Vi);else{var os=ni.get(Vi);if(os===void 0&&!ni.has(Vi)||!vi(Hi,os,wi,Mi)){if(wi||!Ti(Xn,ni,Vi,Hi,Mi))return!1;ri===null&&(ri=new Set),ri.add(Vi)}}}if(ri!==null){for(var Ca=hr(ni),fa=0;fa<Ca.length;fa++){var Ba=e(Ca[fa],2),Qs=Ba[0],aa=Ba[1];if(ir(Qs)==="object"&&Qs!==null){if(!hi(ri,Xn,Qs,aa,wi,Mi))return!1}else if(!wi&&(!Xn.has(Qs)||!vi(Xn.get(Qs),aa,!1,Mi))&&!hi(ri,Xn,Qs,aa,!1,Mi))return!1}return ri.size===0}return!0}function Yi(Xn,ni,wi,Mi,ri,Gr){var Si=0;if(Gr===Qr){if(!Qi(Xn,ni,wi,ri))return!1}else if(Gr===Jr){if(!hs(Xn,ni,wi,ri))return!1}else if(Gr===Jn)for(;Si<Xn.length;Si++)if(xr(Xn,Si)){if(!xr(ni,Si)||!vi(Xn[Si],ni[Si],wi,ri))return!1}else{if(xr(ni,Si))return!1;for(var Wi=Object.keys(Xn);Si<Wi.length;Si++){var Vi=Wi[Si];if(!xr(ni,Vi)||!vi(Xn[Vi],ni[Vi],wi,ri))return!1}return Wi.length===Object.keys(ni).length}for(Si=0;Si<Mi.length;Si++){var Hi=Mi[Si];if(!vi(Xn[Hi],ni[Hi],wi,ri))return!1}return!0}function ss(Xn,ni){return vi(Xn,ni,li)}function Bi(Xn,ni){return vi(Xn,ni,qn)}return comparisons={isDeepEqual:ss,isDeepStrictEqual:Bi},comparisons}var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert.exports;hasRequiredAssert=1;function e(Qr){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Jr){return typeof Jr}:function(Jr){return Jr&&typeof Symbol=="function"&&Jr.constructor===Symbol&&Jr!==Symbol.prototype?"symbol":typeof Jr},e(Qr)}function t(Qr,Jr,ei){return Object.defineProperty(Qr,"prototype",{writable:!1}),Qr}function I(Qr,Jr){if(!(Qr instanceof Jr))throw new TypeError("Cannot call a class as a function")}var B=requireErrors(),tr=B.codes,rr=tr.ERR_AMBIGUOUS_ARGUMENT,ir=tr.ERR_INVALID_ARG_TYPE,lr=tr.ERR_INVALID_ARG_VALUE,dr=tr.ERR_INVALID_RETURN_VALUE,hr=tr.ERR_MISSING_ARGS,fr=requireAssertion_error(),mr=requireUtil(),_r=mr.inspect,yr=requireUtil().types,xr=yr.isPromise,Mr=yr.isRegExp,vr=requirePolyfill$2()(),Sr=requirePolyfill$1()(),wr=requireCallBound()("RegExp.prototype.test"),br,Ar;function kr(){var Qr=requireComparisons();br=Qr.isDeepEqual,Ar=Qr.isDeepStrictEqual}var Dr=!1,Or=assert.exports=Hn,zr={};function $n(Qr){throw Qr.message instanceof Error?Qr.message:new fr(Qr)}function Fr(Qr,Jr,ei,mi,ci){var ai=arguments.length,fi;if(ai===0)fi="Failed";else if(ai===1)ei=Qr,Qr=void 0;else{if(Dr===!1){Dr=!0;var vi=process.emitWarning?process.emitWarning:console.warn.bind(console);vi("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}ai===2&&(mi="!=")}if(ei instanceof Error)throw ei;var xi={actual:Qr,expected:Jr,operator:mi===void 0?"fail":mi,stackStartFn:ci||Fr};ei!==void 0&&(xi.message=ei);var Ci=new fr(xi);throw fi&&(Ci.message=fi,Ci.generatedMessage=!0),Ci}Or.fail=Fr,Or.AssertionError=fr;function $r(Qr,Jr,ei,mi){if(!ei){var ci=!1;if(Jr===0)ci=!0,mi="No value argument passed to `assert.ok()`";else if(mi instanceof Error)throw mi;var ai=new fr({actual:ei,expected:!0,message:mi,operator:"==",stackStartFn:Qr});throw ai.generatedMessage=ci,ai}}function Hn(){for(var Qr=arguments.length,Jr=new Array(Qr),ei=0;ei<Qr;ei++)Jr[ei]=arguments[ei];$r.apply(void 0,[Hn,Jr.length].concat(Jr))}Or.ok=Hn,Or.equal=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");Jr!=ei&&$n({actual:Jr,expected:ei,message:mi,operator:"==",stackStartFn:Qr})},Or.notEqual=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");Jr==ei&&$n({actual:Jr,expected:ei,message:mi,operator:"!=",stackStartFn:Qr})},Or.deepEqual=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");br===void 0&&kr(),br(Jr,ei)||$n({actual:Jr,expected:ei,message:mi,operator:"deepEqual",stackStartFn:Qr})},Or.notDeepEqual=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");br===void 0&&kr(),br(Jr,ei)&&$n({actual:Jr,expected:ei,message:mi,operator:"notDeepEqual",stackStartFn:Qr})},Or.deepStrictEqual=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");br===void 0&&kr(),Ar(Jr,ei)||$n({actual:Jr,expected:ei,message:mi,operator:"deepStrictEqual",stackStartFn:Qr})},Or.notDeepStrictEqual=ti;function ti(Qr,Jr,ei){if(arguments.length<2)throw new hr("actual","expected");br===void 0&&kr(),Ar(Qr,Jr)&&$n({actual:Qr,expected:Jr,message:ei,operator:"notDeepStrictEqual",stackStartFn:ti})}Or.strictEqual=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");Sr(Jr,ei)||$n({actual:Jr,expected:ei,message:mi,operator:"strictEqual",stackStartFn:Qr})},Or.notStrictEqual=function Qr(Jr,ei,mi){if(arguments.length<2)throw new hr("actual","expected");Sr(Jr,ei)&&$n({actual:Jr,expected:ei,message:mi,operator:"notStrictEqual",stackStartFn:Qr})};var Ir=t(function Qr(Jr,ei,mi){var ci=this;I(this,Qr),ei.forEach(function(ai){ai in Jr&&(mi!==void 0&&typeof mi[ai]=="string"&&Mr(Jr[ai])&&wr(Jr[ai],mi[ai])?ci[ai]=mi[ai]:ci[ai]=Jr[ai])})});function Lr(Qr,Jr,ei,mi,ci,ai){if(!(ei in Qr)||!Ar(Qr[ei],Jr[ei])){if(!mi){var fi=new Ir(Qr,ci),vi=new Ir(Jr,ci,Qr),xi=new fr({actual:fi,expected:vi,operator:"deepStrictEqual",stackStartFn:ai});throw xi.actual=Qr,xi.expected=Jr,xi.operator=ai.name,xi}$n({actual:Qr,expected:Jr,message:mi,operator:ai.name,stackStartFn:ai})}}function Kn(Qr,Jr,ei,mi){if(typeof Jr!="function"){if(Mr(Jr))return wr(Jr,Qr);if(arguments.length===2)throw new ir("expected",["Function","RegExp"],Jr);if(e(Qr)!=="object"||Qr===null){var ci=new fr({actual:Qr,expected:Jr,message:ei,operator:"deepStrictEqual",stackStartFn:mi});throw ci.operator=mi.name,ci}var ai=Object.keys(Jr);if(Jr instanceof Error)ai.push("name","message");else if(ai.length===0)throw new lr("error",Jr,"may not be an empty object");return br===void 0&&kr(),ai.forEach(function(fi){typeof Qr[fi]=="string"&&Mr(Jr[fi])&&wr(Jr[fi],Qr[fi])||Lr(Qr,Jr,fi,ei,ai,mi)}),!0}return Jr.prototype!==void 0&&Qr instanceof Jr?!0:Error.isPrototypeOf(Jr)?!1:Jr.call({},Qr)===!0}function pi(Qr){if(typeof Qr!="function")throw new ir("fn","Function",Qr);try{Qr()}catch(Jr){return Jr}return zr}function gi(Qr){return xr(Qr)||Qr!==null&&e(Qr)==="object"&&typeof Qr.then=="function"&&typeof Qr.catch=="function"}function oi(Qr){return Promise.resolve().then(function(){var Jr;if(typeof Qr=="function"){if(Jr=Qr(),!gi(Jr))throw new dr("instance of Promise","promiseFn",Jr)}else if(gi(Qr))Jr=Qr;else throw new ir("promiseFn",["Function","Promise"],Qr);return Promise.resolve().then(function(){return Jr}).then(function(){return zr}).catch(function(ei){return ei})})}function qn(Qr,Jr,ei,mi){if(typeof ei=="string"){if(arguments.length===4)throw new ir("error",["Object","Error","Function","RegExp"],ei);if(e(Jr)==="object"&&Jr!==null){if(Jr.message===ei)throw new rr("error/message",'The error message "'.concat(Jr.message,'" is identical to the message.'))}else if(Jr===ei)throw new rr("error/message",'The error "'.concat(Jr,'" is identical to the message.'));mi=ei,ei=void 0}else if(ei!=null&&e(ei)!=="object"&&typeof ei!="function")throw new ir("error",["Object","Error","Function","RegExp"],ei);if(Jr===zr){var ci="";ei&&ei.name&&(ci+=" (".concat(ei.name,")")),ci+=mi?": ".concat(mi):".";var ai=Qr.name==="rejects"?"rejection":"exception";$n({actual:void 0,expected:ei,operator:Qr.name,message:"Missing expected ".concat(ai).concat(ci),stackStartFn:Qr})}if(ei&&!Kn(Jr,ei,mi,Qr))throw Jr}function li(Qr,Jr,ei,mi){if(Jr!==zr){if(typeof ei=="string"&&(mi=ei,ei=void 0),!ei||Kn(Jr,ei)){var ci=mi?": ".concat(mi):".",ai=Qr.name==="doesNotReject"?"rejection":"exception";$n({actual:Jr,expected:ei,operator:Qr.name,message:"Got unwanted ".concat(ai).concat(ci,`
|
|
65
|
-
`)+'Actual message: "'.concat(Jr&&Jr.message,'"'),stackStartFn:Qr})}throw Jr}}Or.throws=function Qr(Jr){for(var ei=arguments.length,mi=new Array(ei>1?ei-1:0),ci=1;ci<ei;ci++)mi[ci-1]=arguments[ci];qn.apply(void 0,[Qr,pi(Jr)].concat(mi))},Or.rejects=function Qr(Jr){for(var ei=arguments.length,mi=new Array(ei>1?ei-1:0),ci=1;ci<ei;ci++)mi[ci-1]=arguments[ci];return oi(Jr).then(function(ai){return qn.apply(void 0,[Qr,ai].concat(mi))})},Or.doesNotThrow=function Qr(Jr){for(var ei=arguments.length,mi=new Array(ei>1?ei-1:0),ci=1;ci<ei;ci++)mi[ci-1]=arguments[ci];li.apply(void 0,[Qr,pi(Jr)].concat(mi))},Or.doesNotReject=function Qr(Jr){for(var ei=arguments.length,mi=new Array(ei>1?ei-1:0),ci=1;ci<ei;ci++)mi[ci-1]=arguments[ci];return oi(Jr).then(function(ai){return li.apply(void 0,[Qr,ai].concat(mi))})},Or.ifError=function Qr(Jr){if(Jr!=null){var ei="ifError got unwanted exception: ";e(Jr)==="object"&&typeof Jr.message=="string"?Jr.message.length===0&&Jr.constructor?ei+=Jr.constructor.name:ei+=Jr.message:ei+=_r(Jr);var mi=new fr({actual:Jr,expected:null,operator:"ifError",message:ei,stackStartFn:Qr}),ci=Jr.stack;if(typeof ci=="string"){var ai=ci.split(`
|
|
66
|
-
`);ai.shift();for(var fi=mi.stack.split(`
|
|
67
|
-
`),vi=0;vi<ai.length;vi++){var xi=fi.indexOf(ai[vi]);if(xi!==-1){fi=fi.slice(0,xi);break}}mi.stack="".concat(fi.join(`
|
|
68
|
-
`),`
|
|
69
|
-
`).concat(ai.join(`
|
|
70
|
-
`))}throw mi}};function di(Qr,Jr,ei,mi,ci){if(!Mr(Jr))throw new ir("regexp","RegExp",Jr);var ai=ci==="match";if(typeof Qr!="string"||wr(Jr,Qr)!==ai){if(ei instanceof Error)throw ei;var fi=!ei;ei=ei||(typeof Qr!="string"?'The "string" argument must be of type string. Received type '+"".concat(e(Qr)," (").concat(_r(Qr),")"):(ai?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(_r(Jr),`. Input:
|
|
71
|
-
|
|
72
|
-
`).concat(_r(Qr),`
|
|
73
|
-
`));var vi=new fr({actual:Qr,expected:Jr,message:ei,operator:ci,stackStartFn:mi});throw vi.generatedMessage=fi,vi}}Or.match=function Qr(Jr,ei,mi){di(Jr,ei,mi,Qr,"match")},Or.doesNotMatch=function Qr(Jr,ei,mi){di(Jr,ei,mi,Qr,"doesNotMatch")};function Jn(){for(var Qr=arguments.length,Jr=new Array(Qr),ei=0;ei<Qr;ei++)Jr[ei]=arguments[ei];$r.apply(void 0,[Jn,Jr.length].concat(Jr))}return Or.strict=vr(Jn,Or,{equal:Or.strictEqual,deepEqual:Or.deepStrictEqual,notEqual:Or.notStrictEqual,notDeepEqual:Or.notDeepStrictEqual}),Or.strict.strict=Or.strict,assert.exports}var assign_1,hasRequiredAssign;function requireAssign(){if(hasRequiredAssign)return assign_1;hasRequiredAssign=1;var e=require_assignValue(),t=require_copyObject(),I=require_createAssigner(),B=requireIsArrayLike(),tr=require_isPrototype(),rr=requireKeys(),ir=Object.prototype,lr=ir.hasOwnProperty,dr=I(function(hr,fr){if(tr(fr)||B(fr)){t(fr,rr(fr),hr);return}for(var mr in fr)lr.call(fr,mr)&&e(hr,mr,fr[mr])});return assign_1=dr,assign_1}var clone_1,hasRequiredClone;function requireClone(){if(hasRequiredClone)return clone_1;hasRequiredClone=1;var e=require_baseClone(),t=4;function I(B){return e(B,t)}return clone_1=I,clone_1}var _baseForOwn,hasRequired_baseForOwn;function require_baseForOwn(){if(hasRequired_baseForOwn)return _baseForOwn;hasRequired_baseForOwn=1;var e=require_baseFor(),t=requireKeys();function I(B,tr){return B&&e(B,tr,t)}return _baseForOwn=I,_baseForOwn}var _createBaseEach,hasRequired_createBaseEach;function require_createBaseEach(){if(hasRequired_createBaseEach)return _createBaseEach;hasRequired_createBaseEach=1;var e=requireIsArrayLike();function t(I,B){return function(tr,rr){if(tr==null)return tr;if(!e(tr))return I(tr,rr);for(var ir=tr.length,lr=B?ir:-1,dr=Object(tr);(B?lr--:++lr<ir)&&rr(dr[lr],lr,dr)!==!1;);return tr}}return _createBaseEach=t,_createBaseEach}var _baseEach,hasRequired_baseEach;function require_baseEach(){if(hasRequired_baseEach)return _baseEach;hasRequired_baseEach=1;var e=require_baseForOwn(),t=require_createBaseEach(),I=t(e);return _baseEach=I,_baseEach}var _castFunction,hasRequired_castFunction;function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var e=requireIdentity();function t(I){return typeof I=="function"?I:e}return _castFunction=t,_castFunction}var forEach_1,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach_1;hasRequiredForEach=1;var e=require_arrayEach(),t=require_baseEach(),I=require_castFunction(),B=requireIsArray();function tr(rr,ir){var lr=B(rr)?e:t;return lr(rr,I(ir))}return forEach_1=tr,forEach_1}var each,hasRequiredEach;function requireEach(){return hasRequiredEach||(hasRequiredEach=1,each=requireForEach()),each}var isEmpty_1,hasRequiredIsEmpty;function requireIsEmpty(){if(hasRequiredIsEmpty)return isEmpty_1;hasRequiredIsEmpty=1;var e=require_baseKeys(),t=require_getTag(),I=requireIsArguments$1(),B=requireIsArray(),tr=requireIsArrayLike(),rr=requireIsBuffer(),ir=require_isPrototype(),lr=requireIsTypedArray(),dr="[object Map]",hr="[object Set]",fr=Object.prototype,mr=fr.hasOwnProperty;function _r(yr){if(yr==null)return!0;if(tr(yr)&&(B(yr)||typeof yr=="string"||typeof yr.splice=="function"||rr(yr)||lr(yr)||I(yr)))return!yr.length;var xr=t(yr);if(xr==dr||xr==hr)return!yr.size;if(ir(yr))return!e(yr).length;for(var Mr in yr)if(mr.call(yr,Mr))return!1;return!0}return isEmpty_1=_r,isEmpty_1}var last_1,hasRequiredLast;function requireLast(){if(hasRequiredLast)return last_1;hasRequiredLast=1;function e(t){var I=t==null?0:t.length;return I?t[I-1]:void 0}return last_1=e,last_1}var _baseFilter,hasRequired_baseFilter;function require_baseFilter(){if(hasRequired_baseFilter)return _baseFilter;hasRequired_baseFilter=1;var e=require_baseEach();function t(I,B){var tr=[];return e(I,function(rr,ir,lr){B(rr,ir,lr)&&tr.push(rr)}),tr}return _baseFilter=t,_baseFilter}var _setCacheAdd,hasRequired_setCacheAdd;function require_setCacheAdd(){if(hasRequired_setCacheAdd)return _setCacheAdd;hasRequired_setCacheAdd=1;var e="__lodash_hash_undefined__";function t(I){return this.__data__.set(I,e),this}return _setCacheAdd=t,_setCacheAdd}var _setCacheHas,hasRequired_setCacheHas;function require_setCacheHas(){if(hasRequired_setCacheHas)return _setCacheHas;hasRequired_setCacheHas=1;function e(t){return this.__data__.has(t)}return _setCacheHas=e,_setCacheHas}var _SetCache,hasRequired_SetCache;function require_SetCache(){if(hasRequired_SetCache)return _SetCache;hasRequired_SetCache=1;var e=require_MapCache(),t=require_setCacheAdd(),I=require_setCacheHas();function B(tr){var rr=-1,ir=tr==null?0:tr.length;for(this.__data__=new e;++rr<ir;)this.add(tr[rr])}return B.prototype.add=B.prototype.push=t,B.prototype.has=I,_SetCache=B,_SetCache}var _arraySome,hasRequired_arraySome;function require_arraySome(){if(hasRequired_arraySome)return _arraySome;hasRequired_arraySome=1;function e(t,I){for(var B=-1,tr=t==null?0:t.length;++B<tr;)if(I(t[B],B,t))return!0;return!1}return _arraySome=e,_arraySome}var _cacheHas,hasRequired_cacheHas;function require_cacheHas(){if(hasRequired_cacheHas)return _cacheHas;hasRequired_cacheHas=1;function e(t,I){return t.has(I)}return _cacheHas=e,_cacheHas}var _equalArrays,hasRequired_equalArrays;function require_equalArrays(){if(hasRequired_equalArrays)return _equalArrays;hasRequired_equalArrays=1;var e=require_SetCache(),t=require_arraySome(),I=require_cacheHas(),B=1,tr=2;function rr(ir,lr,dr,hr,fr,mr){var _r=dr&B,yr=ir.length,xr=lr.length;if(yr!=xr&&!(_r&&xr>yr))return!1;var Mr=mr.get(ir),vr=mr.get(lr);if(Mr&&vr)return Mr==lr&&vr==ir;var Sr=-1,wr=!0,br=dr&tr?new e:void 0;for(mr.set(ir,lr),mr.set(lr,ir);++Sr<yr;){var Ar=ir[Sr],kr=lr[Sr];if(hr)var Dr=_r?hr(kr,Ar,Sr,lr,ir,mr):hr(Ar,kr,Sr,ir,lr,mr);if(Dr!==void 0){if(Dr)continue;wr=!1;break}if(br){if(!t(lr,function(Or,zr){if(!I(br,zr)&&(Ar===Or||fr(Ar,Or,dr,hr,mr)))return br.push(zr)})){wr=!1;break}}else if(!(Ar===kr||fr(Ar,kr,dr,hr,mr))){wr=!1;break}}return mr.delete(ir),mr.delete(lr),wr}return _equalArrays=rr,_equalArrays}var _mapToArray,hasRequired_mapToArray;function require_mapToArray(){if(hasRequired_mapToArray)return _mapToArray;hasRequired_mapToArray=1;function e(t){var I=-1,B=Array(t.size);return t.forEach(function(tr,rr){B[++I]=[rr,tr]}),B}return _mapToArray=e,_mapToArray}var _setToArray,hasRequired_setToArray;function require_setToArray(){if(hasRequired_setToArray)return _setToArray;hasRequired_setToArray=1;function e(t){var I=-1,B=Array(t.size);return t.forEach(function(tr){B[++I]=tr}),B}return _setToArray=e,_setToArray}var _equalByTag,hasRequired_equalByTag;function require_equalByTag(){if(hasRequired_equalByTag)return _equalByTag;hasRequired_equalByTag=1;var e=require_Symbol(),t=require_Uint8Array(),I=requireEq(),B=require_equalArrays(),tr=require_mapToArray(),rr=require_setToArray(),ir=1,lr=2,dr="[object Boolean]",hr="[object Date]",fr="[object Error]",mr="[object Map]",_r="[object Number]",yr="[object RegExp]",xr="[object Set]",Mr="[object String]",vr="[object Symbol]",Sr="[object ArrayBuffer]",wr="[object DataView]",br=e?e.prototype:void 0,Ar=br?br.valueOf:void 0;function kr(Dr,Or,zr,$n,Fr,$r,Hn){switch(zr){case wr:if(Dr.byteLength!=Or.byteLength||Dr.byteOffset!=Or.byteOffset)return!1;Dr=Dr.buffer,Or=Or.buffer;case Sr:return!(Dr.byteLength!=Or.byteLength||!$r(new t(Dr),new t(Or)));case dr:case hr:case _r:return I(+Dr,+Or);case fr:return Dr.name==Or.name&&Dr.message==Or.message;case yr:case Mr:return Dr==Or+"";case mr:var ti=tr;case xr:var Ir=$n&ir;if(ti||(ti=rr),Dr.size!=Or.size&&!Ir)return!1;var Lr=Hn.get(Dr);if(Lr)return Lr==Or;$n|=lr,Hn.set(Dr,Or);var Kn=B(ti(Dr),ti(Or),$n,Fr,$r,Hn);return Hn.delete(Dr),Kn;case vr:if(Ar)return Ar.call(Dr)==Ar.call(Or)}return!1}return _equalByTag=kr,_equalByTag}var _equalObjects,hasRequired_equalObjects;function require_equalObjects(){if(hasRequired_equalObjects)return _equalObjects;hasRequired_equalObjects=1;var e=require_getAllKeys(),t=1,I=Object.prototype,B=I.hasOwnProperty;function tr(rr,ir,lr,dr,hr,fr){var mr=lr&t,_r=e(rr),yr=_r.length,xr=e(ir),Mr=xr.length;if(yr!=Mr&&!mr)return!1;for(var vr=yr;vr--;){var Sr=_r[vr];if(!(mr?Sr in ir:B.call(ir,Sr)))return!1}var wr=fr.get(rr),br=fr.get(ir);if(wr&&br)return wr==ir&&br==rr;var Ar=!0;fr.set(rr,ir),fr.set(ir,rr);for(var kr=mr;++vr<yr;){Sr=_r[vr];var Dr=rr[Sr],Or=ir[Sr];if(dr)var zr=mr?dr(Or,Dr,Sr,ir,rr,fr):dr(Dr,Or,Sr,rr,ir,fr);if(!(zr===void 0?Dr===Or||hr(Dr,Or,lr,dr,fr):zr)){Ar=!1;break}kr||(kr=Sr=="constructor")}if(Ar&&!kr){var $n=rr.constructor,Fr=ir.constructor;$n!=Fr&&"constructor"in rr&&"constructor"in ir&&!(typeof $n=="function"&&$n instanceof $n&&typeof Fr=="function"&&Fr instanceof Fr)&&(Ar=!1)}return fr.delete(rr),fr.delete(ir),Ar}return _equalObjects=tr,_equalObjects}var _baseIsEqualDeep,hasRequired_baseIsEqualDeep;function require_baseIsEqualDeep(){if(hasRequired_baseIsEqualDeep)return _baseIsEqualDeep;hasRequired_baseIsEqualDeep=1;var e=require_Stack(),t=require_equalArrays(),I=require_equalByTag(),B=require_equalObjects(),tr=require_getTag(),rr=requireIsArray(),ir=requireIsBuffer(),lr=requireIsTypedArray(),dr=1,hr="[object Arguments]",fr="[object Array]",mr="[object Object]",_r=Object.prototype,yr=_r.hasOwnProperty;function xr(Mr,vr,Sr,wr,br,Ar){var kr=rr(Mr),Dr=rr(vr),Or=kr?fr:tr(Mr),zr=Dr?fr:tr(vr);Or=Or==hr?mr:Or,zr=zr==hr?mr:zr;var $n=Or==mr,Fr=zr==mr,$r=Or==zr;if($r&&ir(Mr)){if(!ir(vr))return!1;kr=!0,$n=!1}if($r&&!$n)return Ar||(Ar=new e),kr||lr(Mr)?t(Mr,vr,Sr,wr,br,Ar):I(Mr,vr,Or,Sr,wr,br,Ar);if(!(Sr&dr)){var Hn=$n&&yr.call(Mr,"__wrapped__"),ti=Fr&&yr.call(vr,"__wrapped__");if(Hn||ti){var Ir=Hn?Mr.value():Mr,Lr=ti?vr.value():vr;return Ar||(Ar=new e),br(Ir,Lr,Sr,wr,Ar)}}return $r?(Ar||(Ar=new e),B(Mr,vr,Sr,wr,br,Ar)):!1}return _baseIsEqualDeep=xr,_baseIsEqualDeep}var _baseIsEqual,hasRequired_baseIsEqual;function require_baseIsEqual(){if(hasRequired_baseIsEqual)return _baseIsEqual;hasRequired_baseIsEqual=1;var e=require_baseIsEqualDeep(),t=requireIsObjectLike();function I(B,tr,rr,ir,lr){return B===tr?!0:B==null||tr==null||!t(B)&&!t(tr)?B!==B&&tr!==tr:e(B,tr,rr,ir,I,lr)}return _baseIsEqual=I,_baseIsEqual}var _baseIsMatch,hasRequired_baseIsMatch;function require_baseIsMatch(){if(hasRequired_baseIsMatch)return _baseIsMatch;hasRequired_baseIsMatch=1;var e=require_Stack(),t=require_baseIsEqual(),I=1,B=2;function tr(rr,ir,lr,dr){var hr=lr.length,fr=hr,mr=!dr;if(rr==null)return!fr;for(rr=Object(rr);hr--;){var _r=lr[hr];if(mr&&_r[2]?_r[1]!==rr[_r[0]]:!(_r[0]in rr))return!1}for(;++hr<fr;){_r=lr[hr];var yr=_r[0],xr=rr[yr],Mr=_r[1];if(mr&&_r[2]){if(xr===void 0&&!(yr in rr))return!1}else{var vr=new e;if(dr)var Sr=dr(xr,Mr,yr,rr,ir,vr);if(!(Sr===void 0?t(Mr,xr,I|B,dr,vr):Sr))return!1}}return!0}return _baseIsMatch=tr,_baseIsMatch}var _isStrictComparable,hasRequired_isStrictComparable;function require_isStrictComparable(){if(hasRequired_isStrictComparable)return _isStrictComparable;hasRequired_isStrictComparable=1;var e=requireIsObject();function t(I){return I===I&&!e(I)}return _isStrictComparable=t,_isStrictComparable}var _getMatchData,hasRequired_getMatchData;function require_getMatchData(){if(hasRequired_getMatchData)return _getMatchData;hasRequired_getMatchData=1;var e=require_isStrictComparable(),t=requireKeys();function I(B){for(var tr=t(B),rr=tr.length;rr--;){var ir=tr[rr],lr=B[ir];tr[rr]=[ir,lr,e(lr)]}return tr}return _getMatchData=I,_getMatchData}var _matchesStrictComparable,hasRequired_matchesStrictComparable;function require_matchesStrictComparable(){if(hasRequired_matchesStrictComparable)return _matchesStrictComparable;hasRequired_matchesStrictComparable=1;function e(t,I){return function(B){return B==null?!1:B[t]===I&&(I!==void 0||t in Object(B))}}return _matchesStrictComparable=e,_matchesStrictComparable}var _baseMatches,hasRequired_baseMatches;function require_baseMatches(){if(hasRequired_baseMatches)return _baseMatches;hasRequired_baseMatches=1;var e=require_baseIsMatch(),t=require_getMatchData(),I=require_matchesStrictComparable();function B(tr){var rr=t(tr);return rr.length==1&&rr[0][2]?I(rr[0][0],rr[0][1]):function(ir){return ir===tr||e(ir,tr,rr)}}return _baseMatches=B,_baseMatches}var _isKey,hasRequired_isKey;function require_isKey(){if(hasRequired_isKey)return _isKey;hasRequired_isKey=1;var e=requireIsArray(),t=requireIsSymbol(),I=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B=/^\w*$/;function tr(rr,ir){if(e(rr))return!1;var lr=typeof rr;return lr=="number"||lr=="symbol"||lr=="boolean"||rr==null||t(rr)?!0:B.test(rr)||!I.test(rr)||ir!=null&&rr in Object(ir)}return _isKey=tr,_isKey}var memoize_1,hasRequiredMemoize;function requireMemoize(){if(hasRequiredMemoize)return memoize_1;hasRequiredMemoize=1;var e=require_MapCache(),t="Expected a function";function I(B,tr){if(typeof B!="function"||tr!=null&&typeof tr!="function")throw new TypeError(t);var rr=function(){var ir=arguments,lr=tr?tr.apply(this,ir):ir[0],dr=rr.cache;if(dr.has(lr))return dr.get(lr);var hr=B.apply(this,ir);return rr.cache=dr.set(lr,hr)||dr,hr};return rr.cache=new(I.Cache||e),rr}return I.Cache=e,memoize_1=I,memoize_1}var _memoizeCapped,hasRequired_memoizeCapped;function require_memoizeCapped(){if(hasRequired_memoizeCapped)return _memoizeCapped;hasRequired_memoizeCapped=1;var e=requireMemoize(),t=500;function I(B){var tr=e(B,function(ir){return rr.size===t&&rr.clear(),ir}),rr=tr.cache;return tr}return _memoizeCapped=I,_memoizeCapped}var _stringToPath,hasRequired_stringToPath;function require_stringToPath(){if(hasRequired_stringToPath)return _stringToPath;hasRequired_stringToPath=1;var e=require_memoizeCapped(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/\\(\\)?/g,B=e(function(tr){var rr=[];return tr.charCodeAt(0)===46&&rr.push(""),tr.replace(t,function(ir,lr,dr,hr){rr.push(dr?hr.replace(I,"$1"):lr||ir)}),rr});return _stringToPath=B,_stringToPath}var _castPath,hasRequired_castPath;function require_castPath(){if(hasRequired_castPath)return _castPath;hasRequired_castPath=1;var e=requireIsArray(),t=require_isKey(),I=require_stringToPath(),B=requireToString();function tr(rr,ir){return e(rr)?rr:t(rr,ir)?[rr]:I(B(rr))}return _castPath=tr,_castPath}var _toKey,hasRequired_toKey;function require_toKey(){if(hasRequired_toKey)return _toKey;hasRequired_toKey=1;var e=requireIsSymbol();function t(I){if(typeof I=="string"||e(I))return I;var B=I+"";return B=="0"&&1/I==-1/0?"-0":B}return _toKey=t,_toKey}var _baseGet,hasRequired_baseGet;function require_baseGet(){if(hasRequired_baseGet)return _baseGet;hasRequired_baseGet=1;var e=require_castPath(),t=require_toKey();function I(B,tr){tr=e(tr,B);for(var rr=0,ir=tr.length;B!=null&&rr<ir;)B=B[t(tr[rr++])];return rr&&rr==ir?B:void 0}return _baseGet=I,_baseGet}var get_1,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get_1;hasRequiredGet=1;var e=require_baseGet();function t(I,B,tr){var rr=I==null?void 0:e(I,B);return rr===void 0?tr:rr}return get_1=t,get_1}var _baseHasIn,hasRequired_baseHasIn;function require_baseHasIn(){if(hasRequired_baseHasIn)return _baseHasIn;hasRequired_baseHasIn=1;function e(t,I){return t!=null&&I in Object(t)}return _baseHasIn=e,_baseHasIn}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var e=require_castPath(),t=requireIsArguments$1(),I=requireIsArray(),B=require_isIndex(),tr=requireIsLength(),rr=require_toKey();function ir(lr,dr,hr){dr=e(dr,lr);for(var fr=-1,mr=dr.length,_r=!1;++fr<mr;){var yr=rr(dr[fr]);if(!(_r=lr!=null&&hr(lr,yr)))break;lr=lr[yr]}return _r||++fr!=mr?_r:(mr=lr==null?0:lr.length,!!mr&&tr(mr)&&B(yr,mr)&&(I(lr)||t(lr)))}return _hasPath=ir,_hasPath}var hasIn_1,hasRequiredHasIn;function requireHasIn(){if(hasRequiredHasIn)return hasIn_1;hasRequiredHasIn=1;var e=require_baseHasIn(),t=require_hasPath();function I(B,tr){return B!=null&&t(B,tr,e)}return hasIn_1=I,hasIn_1}var _baseMatchesProperty,hasRequired_baseMatchesProperty;function require_baseMatchesProperty(){if(hasRequired_baseMatchesProperty)return _baseMatchesProperty;hasRequired_baseMatchesProperty=1;var e=require_baseIsEqual(),t=requireGet(),I=requireHasIn(),B=require_isKey(),tr=require_isStrictComparable(),rr=require_matchesStrictComparable(),ir=require_toKey(),lr=1,dr=2;function hr(fr,mr){return B(fr)&&tr(mr)?rr(ir(fr),mr):function(_r){var yr=t(_r,fr);return yr===void 0&&yr===mr?I(_r,fr):e(mr,yr,lr|dr)}}return _baseMatchesProperty=hr,_baseMatchesProperty}var _baseProperty,hasRequired_baseProperty;function require_baseProperty(){if(hasRequired_baseProperty)return _baseProperty;hasRequired_baseProperty=1;function e(t){return function(I){return I==null?void 0:I[t]}}return _baseProperty=e,_baseProperty}var _basePropertyDeep,hasRequired_basePropertyDeep;function require_basePropertyDeep(){if(hasRequired_basePropertyDeep)return _basePropertyDeep;hasRequired_basePropertyDeep=1;var e=require_baseGet();function t(I){return function(B){return e(B,I)}}return _basePropertyDeep=t,_basePropertyDeep}var property_1,hasRequiredProperty;function requireProperty(){if(hasRequiredProperty)return property_1;hasRequiredProperty=1;var e=require_baseProperty(),t=require_basePropertyDeep(),I=require_isKey(),B=require_toKey();function tr(rr){return I(rr)?e(B(rr)):t(rr)}return property_1=tr,property_1}var _baseIteratee,hasRequired_baseIteratee;function require_baseIteratee(){if(hasRequired_baseIteratee)return _baseIteratee;hasRequired_baseIteratee=1;var e=require_baseMatches(),t=require_baseMatchesProperty(),I=requireIdentity(),B=requireIsArray(),tr=requireProperty();function rr(ir){return typeof ir=="function"?ir:ir==null?I:typeof ir=="object"?B(ir)?t(ir[0],ir[1]):e(ir):tr(ir)}return _baseIteratee=rr,_baseIteratee}var negate_1,hasRequiredNegate;function requireNegate(){if(hasRequiredNegate)return negate_1;hasRequiredNegate=1;var e="Expected a function";function t(I){if(typeof I!="function")throw new TypeError(e);return function(){var B=arguments;switch(B.length){case 0:return!I.call(this);case 1:return!I.call(this,B[0]);case 2:return!I.call(this,B[0],B[1]);case 3:return!I.call(this,B[0],B[1],B[2])}return!I.apply(this,B)}}return negate_1=t,negate_1}var reject_1,hasRequiredReject;function requireReject(){if(hasRequiredReject)return reject_1;hasRequiredReject=1;var e=require_arrayFilter(),t=require_baseFilter(),I=require_baseIteratee(),B=requireIsArray(),tr=requireNegate();function rr(ir,lr){var dr=B(ir)?e:t;return dr(ir,tr(I(lr,3)))}return reject_1=rr,reject_1}var tail_1,hasRequiredTail;function requireTail(){if(hasRequiredTail)return tail_1;hasRequiredTail=1;var e=require_baseSlice();function t(I){var B=I==null?0:I.length;return B?e(I,1,B):[]}return tail_1=t,tail_1}var isString_1,hasRequiredIsString;function requireIsString(){if(hasRequiredIsString)return isString_1;hasRequiredIsString=1;var e=require_baseGetTag(),t=requireIsArray(),I=requireIsObjectLike(),B="[object String]";function tr(rr){return typeof rr=="string"||!t(rr)&&I(rr)&&e(rr)==B}return isString_1=tr,isString_1}var _iteratorToArray,hasRequired_iteratorToArray;function require_iteratorToArray(){if(hasRequired_iteratorToArray)return _iteratorToArray;hasRequired_iteratorToArray=1;function e(t){for(var I,B=[];!(I=t.next()).done;)B.push(I.value);return B}return _iteratorToArray=e,_iteratorToArray}var _asciiToArray,hasRequired_asciiToArray;function require_asciiToArray(){if(hasRequired_asciiToArray)return _asciiToArray;hasRequired_asciiToArray=1;function e(t){return t.split("")}return _asciiToArray=e,_asciiToArray}var _hasUnicode,hasRequired_hasUnicode;function require_hasUnicode(){if(hasRequired_hasUnicode)return _hasUnicode;hasRequired_hasUnicode=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",I="\\ufe20-\\ufe2f",B="\\u20d0-\\u20ff",tr=t+I+B,rr="\\ufe0e\\ufe0f",ir="\\u200d",lr=RegExp("["+ir+e+tr+rr+"]");function dr(hr){return lr.test(hr)}return _hasUnicode=dr,_hasUnicode}var _unicodeToArray,hasRequired_unicodeToArray;function require_unicodeToArray(){if(hasRequired_unicodeToArray)return _unicodeToArray;hasRequired_unicodeToArray=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",I="\\ufe20-\\ufe2f",B="\\u20d0-\\u20ff",tr=t+I+B,rr="\\ufe0e\\ufe0f",ir="["+e+"]",lr="["+tr+"]",dr="\\ud83c[\\udffb-\\udfff]",hr="(?:"+lr+"|"+dr+")",fr="[^"+e+"]",mr="(?:\\ud83c[\\udde6-\\uddff]){2}",_r="[\\ud800-\\udbff][\\udc00-\\udfff]",yr="\\u200d",xr=hr+"?",Mr="["+rr+"]?",vr="(?:"+yr+"(?:"+[fr,mr,_r].join("|")+")"+Mr+xr+")*",Sr=Mr+xr+vr,wr="(?:"+[fr+lr+"?",lr,mr,_r,ir].join("|")+")",br=RegExp(dr+"(?="+dr+")|"+wr+Sr,"g");function Ar(kr){return kr.match(br)||[]}return _unicodeToArray=Ar,_unicodeToArray}var _stringToArray,hasRequired_stringToArray;function require_stringToArray(){if(hasRequired_stringToArray)return _stringToArray;hasRequired_stringToArray=1;var e=require_asciiToArray(),t=require_hasUnicode(),I=require_unicodeToArray();function B(tr){return t(tr)?I(tr):e(tr)}return _stringToArray=B,_stringToArray}var _baseValues,hasRequired_baseValues;function require_baseValues(){if(hasRequired_baseValues)return _baseValues;hasRequired_baseValues=1;var e=require_arrayMap();function t(I,B){return e(B,function(tr){return I[tr]})}return _baseValues=t,_baseValues}var values_1,hasRequiredValues;function requireValues(){if(hasRequiredValues)return values_1;hasRequiredValues=1;var e=require_baseValues(),t=requireKeys();function I(B){return B==null?[]:e(B,t(B))}return values_1=I,values_1}var toArray_1,hasRequiredToArray;function requireToArray(){if(hasRequiredToArray)return toArray_1;hasRequiredToArray=1;var e=require_Symbol(),t=require_copyArray(),I=require_getTag(),B=requireIsArrayLike(),tr=requireIsString(),rr=require_iteratorToArray(),ir=require_mapToArray(),lr=require_setToArray(),dr=require_stringToArray(),hr=requireValues(),fr="[object Map]",mr="[object Set]",_r=e?e.iterator:void 0;function yr(xr){if(!xr)return[];if(B(xr))return tr(xr)?dr(xr):t(xr);if(_r&&xr[_r])return rr(xr[_r]());var Mr=I(xr),vr=Mr==fr?ir:Mr==mr?lr:hr;return vr(xr)}return toArray_1=yr,toArray_1}var constants$1,hasRequiredConstants$1;function requireConstants$1(){if(hasRequiredConstants$1)return constants$1;hasRequiredConstants$1=1;const e=Object.freeze({pg:"postgres",postgresql:"postgres",sqlite:"sqlite3"}),t=Object.freeze(["mssql","mysql","mysql2","oracledb","postgres","pgnative","redshift","sqlite3","cockroachdb","better-sqlite3"].concat(Object.keys(e))),I=Object.freeze({MsSQL:"mssql",MySQL:"mysql",MySQL2:"mysql2",Oracle:"oracledb",PostgreSQL:"pg",PgNative:"pgnative",Redshift:"pg-redshift",SQLite:"sqlite3",CockroachDB:"cockroachdb",BetterSQLite3:"better-sqlite3"}),B=Object.freeze(["maxWaitingClients","testOnBorrow","fifo","priorityRange","autostart","evictionRunIntervalMillis","numTestsPerRun","softIdleTimeoutMillis","Promise"]);return constants$1={CLIENT_ALIASES:e,SUPPORTED_CLIENTS:t,POOL_CONFIG_OPTIONS:B,COMMA_NO_PAREN_REGEX:/,[\s](?![^(]*\))/g,DRIVER_NAMES:I},constants$1}var helpers$1,hasRequiredHelpers$1;function requireHelpers$1(){if(hasRequiredHelpers$1)return helpers$1;hasRequiredHelpers$1=1;const e=requireIsPlainObject(),t=requireIsTypedArray(),{CLIENT_ALIASES:I}=requireConstants$1(),{isFunction:B}=requireIs();function tr(...fr){return Array.isArray(fr[0])?fr[0]:fr}function rr(fr){let mr=!1;if(t(fr))return!1;if(fr&&B(fr.toSQL))return mr;if(Array.isArray(fr))for(let _r=0;_r<fr.length&&!mr;_r++)mr=rr(fr[_r]);else e(fr)?Object.keys(fr).forEach(_r=>{mr||(mr=rr(fr[_r]))}):mr=fr===void 0;return mr}function ir(fr){const mr=[];return Array.isArray(fr)?fr.forEach((_r,yr)=>{rr(_r)&&mr.push(yr)}):e(fr)?Object.keys(fr).forEach(_r=>{rr(fr[_r])&&mr.push(_r)}):mr.push(0),mr}function lr(fr){fr.prototype.queryContext=function(mr){return mr===void 0?this._queryContext:(this._queryContext=mr,this)}}function dr(fr){return I[fr]||fr}function hr(fr,mr){if(fr==null)return mr;const _r=parseInt(fr,10);return isNaN(_r)?mr:_r}return helpers$1={addQueryContext:lr,containsUndefined:rr,getUndefinedIndices:ir,normalizeArr:tr,resolveClientNameWithAliases:dr,toNumber:hr},helpers$1}var joinclause,hasRequiredJoinclause;function requireJoinclause(){if(hasRequiredJoinclause)return joinclause;hasRequiredJoinclause=1;const e=requireAssert();function t(B,tr,rr,ir,lr){if(typeof rr=="function")return{type:"onWrapped",value:rr,bool:tr};switch(arguments.length){case 3:return{type:"onRaw",value:rr,bool:tr};case 4:return{type:B,column:rr,operator:"=",value:ir,bool:tr};default:return{type:B,column:rr,operator:ir,value:lr,bool:tr}}}class I{constructor(tr,rr,ir){this.schema=ir,this.table=tr,this.joinType=rr,this.and=this,this.clauses=[]}get or(){return this._bool("or")}on(tr){if(typeof tr=="object"&&typeof tr.toSQL!="function"){const ir=Object.keys(tr);let lr=-1;const dr=this._bool()==="or"?"orOn":"on";for(;++lr<ir.length;)this[dr](ir[lr],tr[ir[lr]]);return this}const rr=t("onBasic",this._bool(),...arguments);return rr&&this.clauses.push(rr),this}orOn(tr,rr,ir){return this._bool("or").on.apply(this,arguments)}onJsonPathEquals(tr,rr,ir,lr){return this.clauses.push({type:"onJsonPathEquals",columnFirst:tr,jsonPathFirst:rr,columnSecond:ir,jsonPathSecond:lr,bool:this._bool(),not:this._not()}),this}orOnJsonPathEquals(tr,rr,ir,lr){return this._bool("or").onJsonPathEquals.apply(this,arguments)}using(tr){return this.clauses.push({type:"onUsing",column:tr,bool:this._bool()})}onVal(tr){if(typeof tr=="object"&&typeof tr.toSQL!="function"){const ir=Object.keys(tr);let lr=-1;const dr=this._bool()==="or"?"orOnVal":"onVal";for(;++lr<ir.length;)this[dr](ir[lr],tr[ir[lr]]);return this}const rr=t("onVal",this._bool(),...arguments);return rr&&this.clauses.push(rr),this}andOnVal(){return this.onVal(...arguments)}orOnVal(){return this._bool("or").onVal(...arguments)}onBetween(tr,rr){return e(Array.isArray(rr),"The second argument to onBetween must be an array."),e(rr.length===2,"You must specify 2 values for the onBetween clause"),this.clauses.push({type:"onBetween",column:tr,value:rr,bool:this._bool(),not:this._not()}),this}onNotBetween(tr,rr){return this._not(!0).onBetween(tr,rr)}orOnBetween(tr,rr){return this._bool("or").onBetween(tr,rr)}orOnNotBetween(tr,rr){return this._bool("or")._not(!0).onBetween(tr,rr)}onIn(tr,rr){return Array.isArray(rr)&&rr.length===0?this.on(1,"=",0):(this.clauses.push({type:"onIn",column:tr,value:rr,not:this._not(),bool:this._bool()}),this)}onNotIn(tr,rr){return this._not(!0).onIn(tr,rr)}orOnIn(tr,rr){return this._bool("or").onIn(tr,rr)}orOnNotIn(tr,rr){return this._bool("or")._not(!0).onIn(tr,rr)}onNull(tr){return this.clauses.push({type:"onNull",column:tr,not:this._not(),bool:this._bool()}),this}orOnNull(tr){return this._bool("or").onNull(tr)}onNotNull(tr){return this._not(!0).onNull(tr)}orOnNotNull(tr){return this._not(!0)._bool("or").onNull(tr)}onExists(tr){return this.clauses.push({type:"onExists",value:tr,not:this._not(),bool:this._bool()}),this}orOnExists(tr){return this._bool("or").onExists(tr)}onNotExists(tr){return this._not(!0).onExists(tr)}orOnNotExists(tr){return this._not(!0)._bool("or").onExists(tr)}type(tr){return this.joinType=tr,this}_bool(tr){if(arguments.length===1)return this._boolFlag=tr,this;const rr=this._boolFlag||"and";return this._boolFlag="and",rr}_not(tr){if(arguments.length===1)return this._notFlag=tr,this;const rr=this._notFlag;return this._notFlag=!1,rr}}return Object.assign(I.prototype,{grouping:"join"}),I.prototype.andOn=I.prototype.on,I.prototype.andOnIn=I.prototype.onIn,I.prototype.andOnNotIn=I.prototype.onNotIn,I.prototype.andOnNull=I.prototype.onNull,I.prototype.andOnNotNull=I.prototype.onNotNull,I.prototype.andOnExists=I.prototype.onExists,I.prototype.andOnNotExists=I.prototype.onNotExists,I.prototype.andOnBetween=I.prototype.onBetween,I.prototype.andOnNotBetween=I.prototype.onNotBetween,I.prototype.andOnJsonPathEquals=I.prototype.onJsonPathEquals,joinclause=I,joinclause}var analytic,hasRequiredAnalytic;function requireAnalytic(){if(hasRequiredAnalytic)return analytic;hasRequiredAnalytic=1;const e=requireAssert();class t{constructor(B,tr,rr,ir,lr){this.schema=tr,this.type="analytic",this.method=B,this.order=ir||[],this.partitions=lr||[],this.alias=rr,this.and=this,this.grouping="columns"}partitionBy(B,tr){return e(Array.isArray(B)||typeof B=="string",`The argument to an analytic partitionBy function must be either a string
|
|
74
|
-
or an array of string.`),Array.isArray(B)?this.partitions=this.partitions.concat(B):this.partitions.push({column:B,order:tr}),this}orderBy(B,tr){return e(Array.isArray(B)||typeof B=="string",`The argument to an analytic orderBy function must be either a string
|
|
75
|
-
or an array of string.`),Array.isArray(B)?this.order=this.order.concat(B):this.order.push({column:B,order:tr}),this}}return analytic=t,analytic}var saveAsyncStack,hasRequiredSaveAsyncStack;function requireSaveAsyncStack(){return hasRequiredSaveAsyncStack||(hasRequiredSaveAsyncStack=1,saveAsyncStack=function(t,I){t.client.config.asyncStackTraces&&(t._asyncStack={error:new Error,lines:I})}),saveAsyncStack}var constants,hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,constants={lockMode:{forShare:"forShare",forUpdate:"forUpdate",forNoKeyUpdate:"forNoKeyUpdate",forKeyShare:"forKeyShare"},waitMode:{skipLocked:"skipLocked",noWait:"noWait"}}),constants}var builderInterfaceAugmenter,hasRequiredBuilderInterfaceAugmenter;function requireBuilderInterfaceAugmenter(){if(hasRequiredBuilderInterfaceAugmenter)return builderInterfaceAugmenter;hasRequiredBuilderInterfaceAugmenter=1;const e=requireClone(),t=requireIsEmpty(),{callbackify:I}=requireUtil(),B=requireFinallyMixin(),{formatQuery:tr}=requireQueryExecutioner();function rr(ir){ir.prototype.toQuery=function(lr){let dr=this.toSQL(this._method,lr);return Array.isArray(dr)||(dr=[dr]),dr.length?dr.map(hr=>tr(hr.sql,hr.bindings,lr,this.client)).reduce((hr,fr)=>hr.concat(hr.endsWith(";")?`
|
|
76
|
-
`:`;
|
|
77
|
-
`,fr)):""},ir.prototype.then=function(){let lr=this.client.runner(this).run();return this.client.config.asyncStackTraces&&(lr=lr.catch(dr=>{dr.originalStack=dr.stack;const hr=dr.stack.split(`
|
|
78
|
-
`)[0],{error:fr,lines:mr}=this._asyncStack,yr=fr.stack.split(`
|
|
79
|
-
`).slice(mr);throw yr.unshift(hr),dr.stack=yr.join(`
|
|
80
|
-
`),dr})),lr.then.apply(lr,arguments)},ir.prototype.options=function(lr){return this._options=this._options||[],this._options.push(e(lr)||{}),this},ir.prototype.connection=function(lr){return this._connection=lr,this.client.processPassedConnection(lr),this},ir.prototype.debug=function(lr){return this._debug=arguments.length?lr:!0,this},ir.prototype.transacting=function(lr){if(lr&&lr.client&&(lr.client.transacting?this.client=lr.client:lr.client.logger.warn(`Invalid transaction value: ${lr.client}`)),t(lr))throw this.client.logger.error("Invalid value on transacting call, potential bug"),Error("Invalid transacting value (null, undefined or empty object)");return this},ir.prototype.stream=function(lr){return this.client.runner(this).stream(lr)},ir.prototype.pipe=function(lr,dr){return this.client.runner(this).pipe(lr,dr)},ir.prototype.asCallback=function(lr){const dr=this.then();return I(()=>dr)(lr),dr},ir.prototype.catch=function(lr){return this.then().catch(lr)},Object.defineProperty(ir.prototype,Symbol.toStringTag,{get:()=>"object"}),B(ir.prototype)}return builderInterfaceAugmenter={augmentWithBuilderInterface:rr},builderInterfaceAugmenter}var querybuilder,hasRequiredQuerybuilder;function requireQuerybuilder(){if(hasRequiredQuerybuilder)return querybuilder;hasRequiredQuerybuilder=1;const e=requireAssert(),{EventEmitter:t}=requireEvents(),I=requireAssign(),B=requireClone(),tr=requireEach(),rr=requireIsEmpty(),ir=requireIsPlainObject(),lr=requireLast(),dr=requireReject(),hr=requireTail(),fr=requireToArray(),{addQueryContext:mr,normalizeArr:_r}=requireHelpers$1(),yr=requireJoinclause(),xr=requireAnalytic(),Mr=requireSaveAsyncStack(),{isBoolean:vr,isNumber:Sr,isObject:wr,isString:br,isFunction:Ar}=requireIs(),{lockMode:kr,waitMode:Dr}=requireConstants(),{augmentWithBuilderInterface:Or}=requireBuilderInterfaceAugmenter(),zr=new Set(["pluck","first","select"]),$n=new Set(["with","select","columns","hintComments","where","union","join","group","order","having","limit","offset","counter","counters"]),Fr=new Set([kr.forShare,kr.forUpdate,kr.forNoKeyUpdate,kr.forKeyShare]);class $r extends t{constructor(Ir){super(),this.client=Ir,this.and=this,this._single={},this._comments=[],this._statements=[],this._method="select",Ir.config&&(Mr(this,5),this._debug=Ir.config.debug),this._joinFlag="inner",this._boolFlag="and",this._notFlag=!1,this._asColumnFlag=!1}toString(){return this.toQuery()}toSQL(Ir,Lr){return this.client.queryCompiler(this).toSQL(Ir||this._method,Lr)}clone(){const Ir=new this.constructor(this.client);return Ir._method=this._method,Ir._single=B(this._single),Ir._comments=B(this._comments),Ir._statements=B(this._statements),Ir._debug=this._debug,this._options!==void 0&&(Ir._options=B(this._options)),this._queryContext!==void 0&&(Ir._queryContext=B(this._queryContext)),this._connection!==void 0&&(Ir._connection=this._connection),Ir}timeout(Ir,{cancel:Lr}={}){return Sr(Ir)&&Ir>0&&(this._timeout=Ir,Lr&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}isValidStatementArg(Ir){return typeof Ir=="function"||Ir instanceof $r||Ir&&Ir.isRawInstance}_validateWithArgs(Ir,Lr,Kn,pi){const[gi,oi]=typeof Kn>"u"?[Lr,void 0]:[Kn,Lr];if(typeof Ir!="string")throw new Error(`${pi}() first argument must be a string`);if(this.isValidStatementArg(gi)&&typeof oi>"u")return;if(!(Array.isArray(oi)&&oi.length>0&&oi.every(li=>typeof li=="string")))throw new Error(`${pi}() second argument must be a statement or non-empty column name list.`);if(!this.isValidStatementArg(gi))throw new Error(`${pi}() third argument must be a function / QueryBuilder or a raw when its second argument is a column name list`)}with(Ir,Lr,Kn){return this._validateWithArgs(Ir,Lr,Kn,"with"),this.withWrapped(Ir,Lr,Kn)}withMaterialized(Ir,Lr,Kn){throw new Error("With materialized is not supported by this dialect")}withNotMaterialized(Ir,Lr,Kn){throw new Error("With materialized is not supported by this dialect")}withWrapped(Ir,Lr,Kn,pi){const[gi,oi]=typeof Kn>"u"?[Lr,void 0]:[Kn,Lr],qn={grouping:"with",type:"withWrapped",alias:Ir,columnList:oi,value:gi};return pi!==void 0&&(qn.materialized=pi),this._statements.push(qn),this}withRecursive(Ir,Lr,Kn){return this._validateWithArgs(Ir,Lr,Kn,"withRecursive"),this.withRecursiveWrapped(Ir,Lr,Kn)}withRecursiveWrapped(Ir,Lr,Kn){return this.withWrapped(Ir,Lr,Kn),this._statements[this._statements.length-1].recursive=!0,this}columns(Ir){return!Ir&&Ir!==0?this:(this._statements.push({grouping:"columns",value:_r(...arguments)}),this)}comment(Ir){if(!br(Ir))throw new Error("Comment must be a string");const Lr=["/*","*/","?"];if(Lr.some(Kn=>Ir.includes(Kn)))throw new Error(`Cannot include ${Lr.join(", ")} in comment`);return this._comments.push({comment:Ir}),this}as(Ir){return this._single.as=Ir,this}hintComment(Ir){if(Ir=Array.isArray(Ir)?Ir:[Ir],Ir.some(Lr=>!br(Lr)))throw new Error("Hint comment must be a string");if(Ir.some(Lr=>Lr.includes("/*")||Lr.includes("*/")))throw new Error('Hint comment cannot include "/*" or "*/"');if(Ir.some(Lr=>Lr.includes("?")))throw new Error('Hint comment cannot include "?"');return this._statements.push({grouping:"hintComments",value:Ir}),this}withSchema(Ir){return this._single.schema=Ir,this}table(Ir,Lr={}){return this._single.table=Ir,this._single.only=Lr.only===!0,this}distinct(...Ir){return this._statements.push({grouping:"columns",value:_r(...Ir),distinct:!0}),this}distinctOn(...Ir){if(rr(Ir))throw new Error("distinctOn requires at least on argument");return this._statements.push({grouping:"columns",value:_r(...Ir),distinctOn:!0}),this}join(Ir,Lr,...Kn){let pi;const gi=Ir instanceof $r||typeof Ir=="function"?void 0:this._single.schema,oi=this._joinType();return typeof Lr=="function"?(pi=new yr(Ir,oi,gi),Lr.call(pi,pi)):oi==="raw"?pi=new yr(this.client.raw(Ir,Lr),"raw"):(pi=new yr(Ir,oi,gi),Lr&&pi.on(Lr,...Kn)),this._statements.push(pi),this}using(Ir){throw new Error("'using' function is only available in PostgreSQL dialect with Delete statements.")}innerJoin(...Ir){return this._joinType("inner").join(...Ir)}leftJoin(...Ir){return this._joinType("left").join(...Ir)}leftOuterJoin(...Ir){return this._joinType("left outer").join(...Ir)}rightJoin(...Ir){return this._joinType("right").join(...Ir)}rightOuterJoin(...Ir){return this._joinType("right outer").join(...Ir)}outerJoin(...Ir){return this._joinType("outer").join(...Ir)}fullOuterJoin(...Ir){return this._joinType("full outer").join(...Ir)}crossJoin(...Ir){return this._joinType("cross").join(...Ir)}joinRaw(...Ir){return this._joinType("raw").join(...Ir)}get or(){return this._bool("or")}get not(){return this._not(!0)}where(Ir,Lr,Kn){const pi=arguments.length;if(Ir===!1||Ir===!0)return this.where(1,"=",Ir?1:0);if(typeof Ir=="function")return this.whereWrapped(Ir);if(wr(Ir)&&!Ir.isRawInstance)return this._objectWhere(Ir);if(Ir&&Ir.isRawInstance&&pi===1)return this.whereRaw(Ir);if(pi===2&&(Kn=Lr,Lr="=",Kn===null))return this.whereNull(Ir);const gi=`${Lr}`.toLowerCase().trim();if(pi===3){if(gi==="in"||gi==="not in")return this._not(gi==="not in").whereIn(Ir,Kn);if(gi==="between"||gi==="not between")return this._not(gi==="not between").whereBetween(Ir,Kn)}return Kn===null&&(gi==="is"||gi==="is not")?this._not(gi==="is not").whereNull(Ir):(this._statements.push({grouping:"where",type:"whereBasic",column:Ir,operator:Lr,value:Kn,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this)}whereColumn(...Ir){return this._asColumnFlag=!0,this.where(...Ir),this._asColumnFlag=!1,this}orWhere(Ir,...Lr){this._bool("or");const Kn=Ir;return wr(Kn)&&!Kn.isRawInstance?this.whereWrapped(function(){for(const pi in Kn)this.andWhere(pi,Kn[pi])}):this.where(Ir,...Lr)}orWhereColumn(Ir,...Lr){this._bool("or");const Kn=Ir;return wr(Kn)&&!Kn.isRawInstance?this.whereWrapped(function(){for(const pi in Kn)this.andWhereColumn(pi,"=",Kn[pi])}):this.whereColumn(Ir,...Lr)}whereNot(Ir,...Lr){return Lr.length>=2&&(Lr[0]==="in"||Lr[0]==="between")&&this.client.logger.warn('whereNot is not suitable for "in" and "between" type subqueries. You should use "not in" and "not between" instead.'),this._not(!0).where(Ir,...Lr)}whereNotColumn(...Ir){return this._not(!0).whereColumn(...Ir)}orWhereNot(...Ir){return this._bool("or").whereNot(...Ir)}orWhereNotColumn(...Ir){return this._bool("or").whereNotColumn(...Ir)}_objectWhere(Ir){const Lr=this._bool(),Kn=this._not()?"Not":"";for(const pi in Ir)this[Lr+"Where"+Kn](pi,Ir[pi]);return this}whereRaw(Ir,Lr){const Kn=Ir.isRawInstance?Ir:this.client.raw(Ir,Lr);return this._statements.push({grouping:"where",type:"whereRaw",value:Kn,not:this._not(),bool:this._bool()}),this}orWhereRaw(Ir,Lr){return this._bool("or").whereRaw(Ir,Lr)}whereWrapped(Ir){return this._statements.push({grouping:"where",type:"whereWrapped",value:Ir,not:this._not(),bool:this._bool()}),this}whereExists(Ir){return this._statements.push({grouping:"where",type:"whereExists",value:Ir,not:this._not(),bool:this._bool()}),this}orWhereExists(Ir){return this._bool("or").whereExists(Ir)}whereNotExists(Ir){return this._not(!0).whereExists(Ir)}orWhereNotExists(Ir){return this._bool("or").whereNotExists(Ir)}whereIn(Ir,Lr){return Array.isArray(Lr)&&rr(Lr)?this.where(this._not()):(this._statements.push({grouping:"where",type:"whereIn",column:Ir,value:Lr,not:this._not(),bool:this._bool()}),this)}orWhereIn(Ir,Lr){return this._bool("or").whereIn(Ir,Lr)}whereNotIn(Ir,Lr){return this._not(!0).whereIn(Ir,Lr)}orWhereNotIn(Ir,Lr){return this._bool("or")._not(!0).whereIn(Ir,Lr)}whereNull(Ir){return this._statements.push({grouping:"where",type:"whereNull",column:Ir,not:this._not(),bool:this._bool()}),this}orWhereNull(Ir){return this._bool("or").whereNull(Ir)}whereNotNull(Ir){return this._not(!0).whereNull(Ir)}orWhereNotNull(Ir){return this._bool("or").whereNotNull(Ir)}whereBetween(Ir,Lr){return e(Array.isArray(Lr),"The second argument to whereBetween must be an array."),e(Lr.length===2,"You must specify 2 values for the whereBetween clause"),this._statements.push({grouping:"where",type:"whereBetween",column:Ir,value:Lr,not:this._not(),bool:this._bool()}),this}whereNotBetween(Ir,Lr){return this._not(!0).whereBetween(Ir,Lr)}orWhereBetween(Ir,Lr){return this._bool("or").whereBetween(Ir,Lr)}orWhereNotBetween(Ir,Lr){return this._bool("or").whereNotBetween(Ir,Lr)}_whereLike(Ir,Lr,Kn){return this._statements.push({grouping:"where",type:Ir,column:Lr,value:Kn,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this}whereLike(Ir,Lr){return this._whereLike("whereLike",Ir,Lr)}orWhereLike(Ir,Lr){return this._bool("or")._whereLike("whereLike",Ir,Lr)}whereILike(Ir,Lr){return this._whereLike("whereILike",Ir,Lr)}orWhereILike(Ir,Lr){return this._bool("or")._whereLike("whereILike",Ir,Lr)}groupBy(Ir){return Ir&&Ir.isRawInstance?this.groupByRaw.apply(this,arguments):(this._statements.push({grouping:"group",type:"groupByBasic",value:_r(...arguments)}),this)}groupByRaw(Ir,Lr){const Kn=Ir.isRawInstance?Ir:this.client.raw(Ir,Lr);return this._statements.push({grouping:"group",type:"groupByRaw",value:Kn}),this}orderBy(Ir,Lr,Kn=""){return Array.isArray(Ir)?this._orderByArray(Ir):(this._statements.push({grouping:"order",type:"orderByBasic",value:Ir,direction:Lr,nulls:Kn}),this)}_orderByArray(Ir){for(let Lr=0;Lr<Ir.length;Lr++){const Kn=Ir[Lr];wr(Kn)?this._statements.push({grouping:"order",type:"orderByBasic",value:Kn.column,direction:Kn.order,nulls:Kn.nulls}):(br(Kn)||Sr(Kn))&&this._statements.push({grouping:"order",type:"orderByBasic",value:Kn})}return this}orderByRaw(Ir,Lr){const Kn=Ir.isRawInstance?Ir:this.client.raw(Ir,Lr);return this._statements.push({grouping:"order",type:"orderByRaw",value:Kn}),this}_union(Ir,Lr){let Kn=Lr[0],pi=Lr[1];if(Lr.length===1||Lr.length===2&&vr(pi)){Array.isArray(Kn)||(Kn=[Kn]);for(let gi=0,oi=Kn.length;gi<oi;gi++)this._statements.push({grouping:"union",clause:Ir,value:Kn[gi],wrap:pi||!1})}else Kn=fr(Lr).slice(0,Lr.length-1),pi=Lr[Lr.length-1],vr(pi)||(Kn.push(pi),pi=!1),this._union(Ir,[Kn,pi]);return this}union(...Ir){return this._union("union",Ir)}unionAll(...Ir){return this._union("union all",Ir)}intersect(...Ir){return this._union("intersect",Ir)}except(...Ir){return this._union("except",Ir)}having(Ir,Lr,Kn){return Ir.isRawInstance&&arguments.length===1?this.havingRaw(Ir):typeof Ir=="function"?this.havingWrapped(Ir):(this._statements.push({grouping:"having",type:"havingBasic",column:Ir,operator:Lr,value:Kn,bool:this._bool(),not:this._not()}),this)}orHaving(Ir,...Lr){this._bool("or");const Kn=Ir;return wr(Kn)&&!Kn.isRawInstance?this.havingWrapped(function(){for(const pi in Kn)this.andHaving(pi,Kn[pi])}):this.having(Ir,...Lr)}havingWrapped(Ir){return this._statements.push({grouping:"having",type:"havingWrapped",value:Ir,bool:this._bool(),not:this._not()}),this}havingNull(Ir){return this._statements.push({grouping:"having",type:"havingNull",column:Ir,not:this._not(),bool:this._bool()}),this}orHavingNull(Ir){return this._bool("or").havingNull(Ir)}havingNotNull(Ir){return this._not(!0).havingNull(Ir)}orHavingNotNull(Ir){return this._not(!0)._bool("or").havingNull(Ir)}havingExists(Ir){return this._statements.push({grouping:"having",type:"havingExists",value:Ir,not:this._not(),bool:this._bool()}),this}orHavingExists(Ir){return this._bool("or").havingExists(Ir)}havingNotExists(Ir){return this._not(!0).havingExists(Ir)}orHavingNotExists(Ir){return this._not(!0)._bool("or").havingExists(Ir)}havingBetween(Ir,Lr){return e(Array.isArray(Lr),"The second argument to havingBetween must be an array."),e(Lr.length===2,"You must specify 2 values for the havingBetween clause"),this._statements.push({grouping:"having",type:"havingBetween",column:Ir,value:Lr,not:this._not(),bool:this._bool()}),this}orHavingBetween(Ir,Lr){return this._bool("or").havingBetween(Ir,Lr)}havingNotBetween(Ir,Lr){return this._not(!0).havingBetween(Ir,Lr)}orHavingNotBetween(Ir,Lr){return this._not(!0)._bool("or").havingBetween(Ir,Lr)}havingIn(Ir,Lr){return Array.isArray(Lr)&&rr(Lr)?this.where(this._not()):(this._statements.push({grouping:"having",type:"havingIn",column:Ir,value:Lr,not:this._not(),bool:this._bool()}),this)}orHavingIn(Ir,Lr){return this._bool("or").havingIn(Ir,Lr)}havingNotIn(Ir,Lr){return this._not(!0).havingIn(Ir,Lr)}orHavingNotIn(Ir,Lr){return this._bool("or")._not(!0).havingIn(Ir,Lr)}havingRaw(Ir,Lr){const Kn=Ir.isRawInstance?Ir:this.client.raw(Ir,Lr);return this._statements.push({grouping:"having",type:"havingRaw",value:Kn,bool:this._bool(),not:this._not()}),this}orHavingRaw(Ir,Lr){return this._bool("or").havingRaw(Ir,Lr)}_setSkipBinding(Ir,Lr){let Kn=Lr;wr(Lr)&&(Kn=Lr.skipBinding),this._single.skipBinding=this._single.skipBinding||{},this._single.skipBinding[Ir]=Kn}offset(Ir,Lr){if(Ir==null||Ir.isRawInstance||Ir instanceof $r)this._single.offset=Ir;else{const Kn=parseInt(Ir,10);if(isNaN(Kn))this.client.logger.warn("A valid integer must be provided to offset");else{if(Kn<0)throw new Error("A non-negative integer must be provided to offset.");this._single.offset=Kn}}return this._setSkipBinding("offset",Lr),this}limit(Ir,Lr){const Kn=parseInt(Ir,10);return isNaN(Kn)?this.client.logger.warn("A valid integer must be provided to limit"):(this._single.limit=Kn,this._setSkipBinding("limit",Lr)),this}count(Ir,Lr){return this._aggregate("count",Ir||"*",Lr)}min(Ir,Lr){return this._aggregate("min",Ir,Lr)}max(Ir,Lr){return this._aggregate("max",Ir,Lr)}sum(Ir,Lr){return this._aggregate("sum",Ir,Lr)}avg(Ir,Lr){return this._aggregate("avg",Ir,Lr)}countDistinct(...Ir){let Lr;return Ir.length>1&&ir(lr(Ir))&&([Lr]=Ir.splice(Ir.length-1,1)),Ir.length?Ir.length===1&&(Ir=Ir[0]):Ir="*",this._aggregate("count",Ir,{...Lr,distinct:!0})}sumDistinct(Ir,Lr){return this._aggregate("sum",Ir,{...Lr,distinct:!0})}avgDistinct(Ir,Lr){return this._aggregate("avg",Ir,{...Lr,distinct:!0})}increment(Ir,Lr=1){if(wr(Ir)){for(const Kn in Ir)this._counter(Kn,Ir[Kn]);return this}return this._counter(Ir,Lr)}decrement(Ir,Lr=1){if(wr(Ir)){for(const Kn in Ir)this._counter(Kn,-Ir[Kn]);return this}return this._counter(Ir,-Lr)}clearCounters(){return this._single.counter={},this}first(...Ir){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .first() on "${this._method}" query`);return this.select(_r(...Ir)),this._method="first",this.limit(1),this}connection(Ir){return this._connection=Ir,this.client.processPassedConnection(Ir),this}pluck(Ir){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .pluck() on "${this._method}" query`);return this._method="pluck",this._single.pluck=Ir,this._statements.push({grouping:"columns",type:"pluck",value:Ir}),this}clearSelect(){return this._clearGrouping("columns"),this}clearWhere(){return this._clearGrouping("where"),this}clearGroup(){return this._clearGrouping("group"),this}clearOrder(){return this._clearGrouping("order"),this}clearHaving(){return this._clearGrouping("having"),this}clear(Ir){if(!$n.has(Ir))throw new Error(`Knex Error: unknown statement '${Ir}'`);return Ir.startsWith("counter")?this.clearCounters():(Ir==="select"&&(Ir="columns"),this._clearGrouping(Ir),this)}insert(Ir,Lr,Kn){return this._method="insert",rr(Lr)||this.returning(Lr,Kn),this._single.insert=Ir,this}update(Ir,Lr,Kn){let pi;const gi=this._single.update||{};if(this._method="update",br(Ir))ir(Lr)?gi[Ir]=JSON.stringify(Lr):gi[Ir]=Lr,arguments.length>2&&(pi=arguments[2]);else{const oi=Object.keys(Ir);this._single.update&&this.client.logger.warn("Update called multiple times with objects.");let qn=-1;for(;++qn<oi.length;)gi[oi[qn]]=Ir[oi[qn]];pi=arguments[1]}return rr(pi)||this.returning(pi,Kn),this._single.update=gi,this}returning(Ir,Lr){return this._single.returning=Ir,this._single.options=Lr,this}onConflict(Ir){return typeof Ir=="string"&&(Ir=[Ir]),new Hn(this,Ir||!0)}delete(Ir,Lr){return this._method="del",rr(Ir)||this.returning(Ir,Lr),this}truncate(Ir){return this._method="truncate",Ir&&(this._single.table=Ir),this}columnInfo(Ir){return this._method="columnInfo",this._single.columnInfo=Ir,this}forUpdate(...Ir){return this._single.lock=kr.forUpdate,Ir.length===1&&Array.isArray(Ir[0])?this._single.lockTables=Ir[0]:this._single.lockTables=Ir,this}forShare(...Ir){return this._single.lock=kr.forShare,this._single.lockTables=Ir,this}forNoKeyUpdate(...Ir){return this._single.lock=kr.forNoKeyUpdate,this._single.lockTables=Ir,this}forKeyShare(...Ir){return this._single.lock=kr.forKeyShare,this._single.lockTables=Ir,this}skipLocked(){if(!this._isSelectQuery())throw new Error(`Cannot chain .skipLocked() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".skipLocked() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===Dr.noWait)throw new Error(".skipLocked() cannot be used together with .noWait()!");return this._single.waitMode=Dr.skipLocked,this}noWait(){if(!this._isSelectQuery())throw new Error(`Cannot chain .noWait() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".noWait() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===Dr.skipLocked)throw new Error(".noWait() cannot be used together with .skipLocked()!");return this._single.waitMode=Dr.noWait,this}fromJS(Ir){return tr(Ir,(Lr,Kn)=>{typeof this[Kn]!="function"&&this.client.logger.warn(`Knex Error: unknown key ${Kn}`),Array.isArray(Lr)?this[Kn].apply(this,Lr):this[Kn](Lr)}),this}fromRaw(Ir,Lr){const Kn=Ir.isRawInstance?Ir:this.client.raw(Ir,Lr);return this.from(Kn)}modify(Ir){return Ir.apply(this,[this].concat(hr(arguments))),this}upsert(Ir,Lr,Kn){throw new Error(`Upsert is not yet supported for dialect ${this.client.dialect}`)}_json(Ir,Lr){return this._statements.push({grouping:"columns",type:"json",method:Ir,params:Lr}),this}jsonExtract(){const Ir=arguments[0];let Lr,Kn,pi=!0;return arguments.length>=2&&(Lr=arguments[1]),arguments.length>=3&&(Kn=arguments[2]),arguments.length===4&&(pi=arguments[3]),arguments.length===2&&Array.isArray(arguments[0])&&vr(arguments[1])&&(pi=arguments[1]),this._json("jsonExtract",{column:Ir,path:Lr,alias:Kn,singleValue:pi})}jsonSet(Ir,Lr,Kn,pi){return this._json("jsonSet",{column:Ir,path:Lr,value:Kn,alias:pi})}jsonInsert(Ir,Lr,Kn,pi){return this._json("jsonInsert",{column:Ir,path:Lr,value:Kn,alias:pi})}jsonRemove(Ir,Lr,Kn){return this._json("jsonRemove",{column:Ir,path:Lr,alias:Kn})}_isJsonObject(Ir){return wr(Ir)&&!(Ir instanceof $r)}_whereJsonWrappedValue(Ir,Lr,Kn){const pi={grouping:"where",type:Ir,column:Lr,value:Kn,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag};arguments[3]&&(pi.operator=arguments[3]),arguments[4]&&(pi.jsonPath=arguments[4]),this._statements.push(pi)}whereJsonObject(Ir,Lr){return this._whereJsonWrappedValue("whereJsonObject",Ir,Lr),this}orWhereJsonObject(Ir,Lr){return this._bool("or").whereJsonObject(Ir,Lr)}whereNotJsonObject(Ir,Lr){return this._not(!0).whereJsonObject(Ir,Lr)}orWhereNotJsonObject(Ir,Lr){return this._bool("or").whereNotJsonObject(Ir,Lr)}whereJsonPath(Ir,Lr,Kn,pi){return this._whereJsonWrappedValue("whereJsonPath",Ir,pi,Kn,Lr),this}orWhereJsonPath(Ir,Lr,Kn,pi){return this._bool("or").whereJsonPath(Ir,Lr,Kn,pi)}whereJsonSupersetOf(Ir,Lr){return this._whereJsonWrappedValue("whereJsonSupersetOf",Ir,Lr),this}whereJsonNotSupersetOf(Ir,Lr){return this._not(!0).whereJsonSupersetOf(Ir,Lr)}orWhereJsonSupersetOf(Ir,Lr){return this._bool("or").whereJsonSupersetOf(Ir,Lr)}orWhereJsonNotSupersetOf(Ir,Lr){return this._bool("or").whereJsonNotSupersetOf(Ir,Lr)}whereJsonSubsetOf(Ir,Lr){return this._whereJsonWrappedValue("whereJsonSubsetOf",Ir,Lr),this}whereJsonNotSubsetOf(Ir,Lr){return this._not(!0).whereJsonSubsetOf(Ir,Lr)}orWhereJsonSubsetOf(Ir,Lr){return this._bool("or").whereJsonSubsetOf(Ir,Lr)}orWhereJsonNotSubsetOf(Ir,Lr){return this._bool("or").whereJsonNotSubsetOf(Ir,Lr)}whereJsonHasNone(Ir,Lr){return this._not(!0).whereJsonHasAll(Ir,Lr),this}_analytic(Ir,Lr,Kn){let pi;const{schema:gi}=this._single,oi=this._analyticMethod();if(Ir=typeof Ir=="string"?Ir:null,e(typeof Lr=="function"||Lr.isRawInstance||Array.isArray(Lr)||typeof Lr=="string"||typeof Lr=="object",`The second argument to an analytic function must be either a function, a raw,
|
|
81
|
-
an array of string or object, an object or a single string.`),Kn&&e(Array.isArray(Kn)||typeof Kn=="string"||typeof Kn=="object","The third argument to an analytic function must be either a string, an array of string or object or an object."),Ar(Lr))pi=new xr(oi,gi,Ir),Lr.call(pi,pi);else if(Lr.isRawInstance)pi={grouping:"columns",type:"analytic",method:oi,raw:Lr,alias:Ir};else{const qn=Array.isArray(Lr)?Lr:[Lr];let li=Kn||[];li=Array.isArray(li)?li:[li],pi={grouping:"columns",type:"analytic",method:oi,order:qn,alias:Ir,partitions:li}}return this._statements.push(pi),this}rank(...Ir){return this._analyticMethod("rank")._analytic(...Ir)}denseRank(...Ir){return this._analyticMethod("dense_rank")._analytic(...Ir)}rowNumber(...Ir){return this._analyticMethod("row_number")._analytic(...Ir)}_counter(Ir,Lr){return Lr=parseFloat(Lr),this._method="update",this._single.counter=this._single.counter||{},this._single.counter[Ir]=Lr,this}_bool(Ir){if(arguments.length===1)return this._boolFlag=Ir,this;const Lr=this._boolFlag;return this._boolFlag="and",Lr}_not(Ir){if(arguments.length===1)return this._notFlag=Ir,this;const Lr=this._notFlag;return this._notFlag=!1,Lr}_joinType(Ir){if(arguments.length===1)return this._joinFlag=Ir,this;const Lr=this._joinFlag||"inner";return this._joinFlag="inner",Lr}_analyticMethod(Ir){return arguments.length===1?(this._analyticFlag=Ir,this):this._analyticFlag||"row_number"}_aggregate(Ir,Lr,Kn={}){return this._statements.push({grouping:"columns",type:Lr.isRawInstance?"aggregateRaw":"aggregate",method:Ir,value:Lr,aggregateDistinct:Kn.distinct||!1,alias:Kn.as}),this}_clearGrouping(Ir){Ir in this._single?this._single[Ir]=void 0:this._statements=dr(this._statements,{grouping:Ir})}_isSelectQuery(){return zr.has(this._method)}_hasLockMode(){return Fr.has(this._single.lock)}}$r.prototype.select=$r.prototype.columns,$r.prototype.column=$r.prototype.columns,$r.prototype.andWhereNot=$r.prototype.whereNot,$r.prototype.andWhereNotColumn=$r.prototype.whereNotColumn,$r.prototype.andWhere=$r.prototype.where,$r.prototype.andWhereColumn=$r.prototype.whereColumn,$r.prototype.andWhereRaw=$r.prototype.whereRaw,$r.prototype.andWhereBetween=$r.prototype.whereBetween,$r.prototype.andWhereNotBetween=$r.prototype.whereNotBetween,$r.prototype.andWhereJsonObject=$r.prototype.whereJsonObject,$r.prototype.andWhereNotJsonObject=$r.prototype.whereNotJsonObject,$r.prototype.andWhereJsonPath=$r.prototype.whereJsonPath,$r.prototype.andWhereLike=$r.prototype.whereLike,$r.prototype.andWhereILike=$r.prototype.whereILike,$r.prototype.andHaving=$r.prototype.having,$r.prototype.andHavingIn=$r.prototype.havingIn,$r.prototype.andHavingNotIn=$r.prototype.havingNotIn,$r.prototype.andHavingNull=$r.prototype.havingNull,$r.prototype.andHavingNotNull=$r.prototype.havingNotNull,$r.prototype.andHavingExists=$r.prototype.havingExists,$r.prototype.andHavingNotExists=$r.prototype.havingNotExists,$r.prototype.andHavingBetween=$r.prototype.havingBetween,$r.prototype.andHavingNotBetween=$r.prototype.havingNotBetween,$r.prototype.from=$r.prototype.table,$r.prototype.into=$r.prototype.table,$r.prototype.del=$r.prototype.delete,Or($r),mr($r),$r.extend=(ti,Ir)=>{if(Object.prototype.hasOwnProperty.call($r.prototype,ti))throw new Error(`Can't extend QueryBuilder with existing method ('${ti}').`);I($r.prototype,{[ti]:Ir})};class Hn{constructor(Ir,Lr){this.builder=Ir,this._columns=Lr}ignore(){return this.builder._single.onConflict=this._columns,this.builder._single.ignore=!0,this.builder}merge(Ir){return this.builder._single.onConflict=this._columns,this.builder._single.merge={updates:Ir},this.builder}then(){throw new Error("Incomplete onConflict clause. .onConflict() must be directly followed by either .merge() or .ignore()")}}return querybuilder=$r,querybuilder}var _arrayReduce,hasRequired_arrayReduce;function require_arrayReduce(){if(hasRequired_arrayReduce)return _arrayReduce;hasRequired_arrayReduce=1;function e(t,I,B,tr){var rr=-1,ir=t==null?0:t.length;for(tr&&ir&&(B=t[++rr]);++rr<ir;)B=I(B,t[rr],rr,t);return B}return _arrayReduce=e,_arrayReduce}var _baseReduce,hasRequired_baseReduce;function require_baseReduce(){if(hasRequired_baseReduce)return _baseReduce;hasRequired_baseReduce=1;function e(t,I,B,tr,rr){return rr(t,function(ir,lr,dr){B=tr?(tr=!1,ir):I(B,ir,lr,dr)}),B}return _baseReduce=e,_baseReduce}var reduce_1,hasRequiredReduce;function requireReduce(){if(hasRequiredReduce)return reduce_1;hasRequiredReduce=1;var e=require_arrayReduce(),t=require_baseEach(),I=require_baseIteratee(),B=require_baseReduce(),tr=requireIsArray();function rr(ir,lr,dr){var hr=tr(ir)?e:B,fr=arguments.length<3;return hr(ir,I(lr,4),dr,fr,t)}return reduce_1=rr,reduce_1}var transform_1,hasRequiredTransform;function requireTransform(){if(hasRequiredTransform)return transform_1;hasRequiredTransform=1;var e=require_arrayEach(),t=require_baseCreate(),I=require_baseForOwn(),B=require_baseIteratee(),tr=require_getPrototype(),rr=requireIsArray(),ir=requireIsBuffer(),lr=requireIsFunction(),dr=requireIsObject(),hr=requireIsTypedArray();function fr(mr,_r,yr){var xr=rr(mr),Mr=xr||ir(mr)||hr(mr);if(_r=B(_r,4),yr==null){var vr=mr&&mr.constructor;Mr?yr=xr?new vr:[]:dr(mr)?yr=lr(vr)?t(tr(mr)):{}:yr={}}return(Mr?e:I)(mr,function(Sr,wr,br){return _r(yr,Sr,wr,br)}),yr}return transform_1=fr,transform_1}var formatterUtils,hasRequiredFormatterUtils;function requireFormatterUtils(){if(hasRequiredFormatterUtils)return formatterUtils;hasRequiredFormatterUtils=1;const{isObject:e}=requireIs();function t(tr,rr,ir,lr){const dr=ir.queryBuilder();return tr.call(dr,dr),ir.queryCompiler(dr,lr.bindings).toSQL(rr||dr._method||"select")}function I(tr,rr,ir){const lr=rr.queryContext();return ir.wrapIdentifier((tr||"").trim(),lr)}function B(tr,rr,ir){return tr===void 0?"":tr===null?"null":tr&&tr.isRawInstance?tr.toQuery():rr==="bool"?(tr==="false"&&(tr=0),`'${tr?1:0}'`):(rr==="json"||rr==="jsonb")&&e(tr)?`'${JSON.stringify(tr)}'`:ir._escapeBinding(tr.toString())}return formatterUtils={compileCallback:t,wrapAsIdentifier:I,formatDefault:B},formatterUtils}var wrappingFormatter,hasRequiredWrappingFormatter;function requireWrappingFormatter(){if(hasRequiredWrappingFormatter)return wrappingFormatter;hasRequiredWrappingFormatter=1;const e=requireTransform(),t=requireQuerybuilder(),{compileCallback:I,wrapAsIdentifier:B}=requireFormatterUtils(),tr=["asc","desc"],rr=e(["=","<",">","<=",">=","<>","!=","like","not like","between","not between","ilike","not ilike","exists","not exist","rlike","not rlike","regexp","not regexp","match","&","|","^","<<",">>","~","~=","~*","!~","!~*","#","&&","@>","<@","||","&<","&>","-|-","@@","!!",["?","\\?"],["?|","\\?|"],["?&","\\?&"]],(Mr,vr)=>{Array.isArray(vr)?Mr[vr[0]]=vr[1]:Mr[vr]=vr},{});function ir(Mr,vr,Sr,wr){const br=Array.isArray(Mr)?Mr:[Mr];let Ar="",kr=-1;for(;++kr<br.length;)kr>0&&(Ar+=", "),Ar+=lr(br[kr],void 0,vr,Sr,wr);return Ar}function lr(Mr,vr,Sr,wr,br){const Ar=dr(Mr,vr,Sr,wr,br);if(Ar)return Ar;switch(typeof Mr){case"function":return _r(I(Mr,void 0,wr,br),!0,Sr,wr);case"object":return mr(Mr,Sr,wr,br);case"number":return Mr;default:return fr(Mr+"",Sr,wr)}}function dr(Mr,vr,Sr,wr,br){let Ar;if(Mr instanceof t)return Ar=wr.queryCompiler(Mr).toSQL(),Ar.bindings&&br.bindings.push(...Ar.bindings),_r(Ar,vr,Sr,wr);if(Mr&&Mr.isRawInstance)return Mr.client=wr,Sr._queryContext&&(Mr.queryContext=()=>Sr._queryContext),Ar=Mr.toSQL(),Ar.bindings&&br.bindings.push(...Ar.bindings),Ar.sql;vr&&br.bindings.push(Mr)}function hr(Mr,vr,Sr,wr){const br=dr(Mr,void 0,vr,Sr,wr);if(br)return br;const Ar=rr[(Mr||"").toLowerCase()];if(!Ar)throw new TypeError(`The operator "${Mr}" is not permitted`);return Ar}function fr(Mr,vr,Sr){const wr=Mr.toLowerCase().indexOf(" as ");if(wr!==-1){const Dr=Mr.slice(0,wr),Or=Mr.slice(wr+4);return Sr.alias(fr(Dr,vr,Sr),B(Or,vr,Sr))}const br=[];let Ar=-1;const kr=Mr.split(".");for(;++Ar<kr.length;)Mr=kr[Ar],Ar===0&&kr.length>1?br.push(fr((Mr||"").trim(),vr,Sr)):br.push(B(Mr,vr,Sr));return br.join(".")}function mr(Mr,vr,Sr,wr){const br=[];for(const Ar in Mr){const kr=Mr[Ar];if(typeof kr=="function"){const Dr=I(kr,void 0,Sr,wr);Dr.as=Ar,br.push(_r(Dr,!0,vr,Sr))}else kr instanceof t?br.push(Sr.alias(`(${lr(kr,void 0,vr,Sr,wr)})`,B(Ar,vr,Sr))):br.push(Sr.alias(lr(kr,void 0,vr,Sr,wr),B(Ar,vr,Sr)))}return br.join(", ")}function _r(Mr,vr,Sr,wr){let br=Mr.sql||"";return br&&(Mr.method==="select"||Mr.method==="first")&&(vr||Mr.as)&&(br=`(${br})`,Mr.as)?wr.alias(br,fr(Mr.as,Sr,wr)):br}function yr(Mr,vr,Sr,wr,br){return typeof Mr=="function"?_r(I(Mr,vr,wr,br),void 0,Sr,wr):dr(Mr,void 0,Sr,wr,br)||""}function xr(Mr,vr,Sr,wr){const br=dr(Mr,void 0,vr,Sr,wr);return br||(tr.indexOf((Mr||"").toLowerCase())!==-1?Mr:"asc")}return wrappingFormatter={columnize:ir,direction:xr,operator:hr,outputQuery:_r,rawOrFn:yr,unwrapRaw:dr,wrap:lr,wrapString:fr},wrappingFormatter}var rawFormatter,hasRequiredRawFormatter;function requireRawFormatter(){if(hasRequiredRawFormatter)return rawFormatter;hasRequiredRawFormatter=1;const{columnize:e}=requireWrappingFormatter();function t(B,tr){const rr={bindings:[]},ir=B,lr=B.bindings.length,dr=B.bindings;let hr=0;const fr=B.sql.replace(/\\?\?\??/g,function(mr){if(mr==="\\?")return mr;const _r=dr[hr++];return mr==="??"?e(_r,ir,tr,rr):tr.parameter(_r,ir,rr)});if(lr!==hr)throw new Error(`Expected ${lr} bindings, saw ${hr}`);return{method:"raw",sql:fr,bindings:rr.bindings}}function I(B,tr){const rr={bindings:[]},ir=B,lr=B.bindings,dr=/\\?(:(\w+):(?=::)|:(\w+):(?!:)|:(\w+))/g;return{method:"raw",sql:B.sql.replace(dr,function(fr,mr,_r,yr,xr){if(fr!==mr)return mr;const Mr=_r||yr||xr,vr=fr.trim(),Sr=vr[vr.length-1]===":",wr=lr[Mr];return wr===void 0?(Object.prototype.hasOwnProperty.call(lr,Mr)&&rr.bindings.push(wr),fr):Sr?fr.replace(mr,e(wr,ir,tr,rr)):fr.replace(mr,tr.parameter(wr,ir,rr))}),bindings:rr.bindings}}return rawFormatter={replaceKeyBindings:I,replaceRawArrBindings:t},rawFormatter}var nanoid_1,hasRequiredNanoid;function requireNanoid(){if(hasRequiredNanoid)return nanoid_1;hasRequiredNanoid=1;const e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",t="0123456789";function I(tr=21){let rr="",ir=tr;for(;ir--;)rr+=e[Math.random()*64|0];return rr}function B(tr=21){let rr="",ir=tr;for(;ir--;)rr+=t[Math.random()*10|0];return rr}return nanoid_1={nanoid:I,nanonum:B},nanoid_1}var raw,hasRequiredRaw;function requireRaw(){if(hasRequiredRaw)return raw;hasRequiredRaw=1;const{EventEmitter:e}=requireEvents(),t=requireBrowser(),I=requireAssign(),B=requireIsPlainObject(),tr=requireReduce(),{replaceRawArrBindings:rr,replaceKeyBindings:ir}=requireRawFormatter(),lr=requireHelpers$1(),dr=requireSaveAsyncStack(),{nanoid:hr}=requireNanoid(),{isNumber:fr,isObject:mr}=requireIs(),{augmentWithBuilderInterface:_r}=requireBuilderInterfaceAugmenter(),yr=t("knex:bindings");class xr extends e{constructor(vr){super(),this.client=vr,this.sql="",this.bindings=[],this._wrappedBefore=void 0,this._wrappedAfter=void 0,vr&&vr.config&&(this._debug=vr.config.debug,dr(this,4))}set(vr,Sr){return this.sql=vr,this.bindings=mr(Sr)&&!Sr.toSQL||Sr===void 0?Sr:[Sr],this}timeout(vr,{cancel:Sr}={}){return fr(vr)&&vr>0&&(this._timeout=vr,Sr&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}wrap(vr,Sr){return this._wrappedBefore=vr,this._wrappedAfter=Sr,this}toString(){return this.toQuery()}toSQL(vr,Sr){let wr;if(Array.isArray(this.bindings)?wr=rr(this,this.client):this.bindings&&B(this.bindings)?wr=ir(this,this.client):wr={method:"raw",sql:this.sql,bindings:this.bindings===void 0?[]:[this.bindings]},this._wrappedBefore&&(wr.sql=this._wrappedBefore+wr.sql),this._wrappedAfter&&(wr.sql=wr.sql+this._wrappedAfter),wr.options=tr(this._options,I,{}),this._timeout&&(wr.timeout=this._timeout,this._cancelOnTimeout&&(wr.cancelOnTimeout=this._cancelOnTimeout)),wr.bindings=wr.bindings||[],lr.containsUndefined(wr.bindings)){const br=lr.getUndefinedIndices(this.bindings);throw yr(wr.bindings),new Error(`Undefined binding(s) detected for keys [${br}] when compiling RAW query: ${wr.sql}`)}return wr.__knexQueryUid=hr(),Object.defineProperties(wr,{toNative:{value:()=>({sql:this.client.positionBindings(wr.sql),bindings:this.client.prepBindings(wr.bindings)}),enumerable:!1}}),wr}}return xr.prototype.isRawInstance=!0,_r(xr),lr.addQueryContext(xr),raw=xr,raw}var compact_1,hasRequiredCompact;function requireCompact(){if(hasRequiredCompact)return compact_1;hasRequiredCompact=1;function e(t){for(var I=-1,B=t==null?0:t.length,tr=0,rr=[];++I<B;){var ir=t[I];ir&&(rr[tr++]=ir)}return rr}return compact_1=e,compact_1}var _arrayAggregator,hasRequired_arrayAggregator;function require_arrayAggregator(){if(hasRequired_arrayAggregator)return _arrayAggregator;hasRequired_arrayAggregator=1;function e(t,I,B,tr){for(var rr=-1,ir=t==null?0:t.length;++rr<ir;){var lr=t[rr];I(tr,lr,B(lr),t)}return tr}return _arrayAggregator=e,_arrayAggregator}var _baseAggregator,hasRequired_baseAggregator;function require_baseAggregator(){if(hasRequired_baseAggregator)return _baseAggregator;hasRequired_baseAggregator=1;var e=require_baseEach();function t(I,B,tr,rr){return e(I,function(ir,lr,dr){B(rr,ir,tr(ir),dr)}),rr}return _baseAggregator=t,_baseAggregator}var _createAggregator,hasRequired_createAggregator;function require_createAggregator(){if(hasRequired_createAggregator)return _createAggregator;hasRequired_createAggregator=1;var e=require_arrayAggregator(),t=require_baseAggregator(),I=require_baseIteratee(),B=requireIsArray();function tr(rr,ir){return function(lr,dr){var hr=B(lr)?e:t,fr=ir?ir():{};return hr(lr,rr,I(dr,2),fr)}}return _createAggregator=tr,_createAggregator}var groupBy_1,hasRequiredGroupBy;function requireGroupBy(){if(hasRequiredGroupBy)return groupBy_1;hasRequiredGroupBy=1;var e=require_baseAssignValue(),t=require_createAggregator(),I=Object.prototype,B=I.hasOwnProperty,tr=t(function(rr,ir,lr){B.call(rr,lr)?rr[lr].push(ir):e(rr,lr,[ir])});return groupBy_1=tr,groupBy_1}var _baseHas,hasRequired_baseHas;function require_baseHas(){if(hasRequired_baseHas)return _baseHas;hasRequired_baseHas=1;var e=Object.prototype,t=e.hasOwnProperty;function I(B,tr){return B!=null&&t.call(B,tr)}return _baseHas=I,_baseHas}var has_1,hasRequiredHas;function requireHas(){if(hasRequiredHas)return has_1;hasRequiredHas=1;var e=require_baseHas(),t=require_hasPath();function I(B,tr){return B!=null&&t(B,tr,e)}return has_1=I,has_1}var _baseMap,hasRequired_baseMap;function require_baseMap(){if(hasRequired_baseMap)return _baseMap;hasRequired_baseMap=1;var e=require_baseEach(),t=requireIsArrayLike();function I(B,tr){var rr=-1,ir=t(B)?Array(B.length):[];return e(B,function(lr,dr,hr){ir[++rr]=tr(lr,dr,hr)}),ir}return _baseMap=I,_baseMap}var map_1,hasRequiredMap;function requireMap(){if(hasRequiredMap)return map_1;hasRequiredMap=1;var e=require_arrayMap(),t=require_baseIteratee(),I=require_baseMap(),B=requireIsArray();function tr(rr,ir){var lr=B(rr)?e:I;return lr(rr,t(ir,3))}return map_1=tr,map_1}var _baseSet,hasRequired_baseSet;function require_baseSet(){if(hasRequired_baseSet)return _baseSet;hasRequired_baseSet=1;var e=require_assignValue(),t=require_castPath(),I=require_isIndex(),B=requireIsObject(),tr=require_toKey();function rr(ir,lr,dr,hr){if(!B(ir))return ir;lr=t(lr,ir);for(var fr=-1,mr=lr.length,_r=mr-1,yr=ir;yr!=null&&++fr<mr;){var xr=tr(lr[fr]),Mr=dr;if(xr==="__proto__"||xr==="constructor"||xr==="prototype")return ir;if(fr!=_r){var vr=yr[xr];Mr=hr?hr(vr,xr,yr):void 0,Mr===void 0&&(Mr=B(vr)?vr:I(lr[fr+1])?[]:{})}e(yr,xr,Mr),yr=yr[xr]}return ir}return _baseSet=rr,_baseSet}var _basePickBy,hasRequired_basePickBy;function require_basePickBy(){if(hasRequired_basePickBy)return _basePickBy;hasRequired_basePickBy=1;var e=require_baseGet(),t=require_baseSet(),I=require_castPath();function B(tr,rr,ir){for(var lr=-1,dr=rr.length,hr={};++lr<dr;){var fr=rr[lr],mr=e(tr,fr);ir(mr,fr)&&t(hr,I(fr,tr),mr)}return hr}return _basePickBy=B,_basePickBy}var pickBy_1,hasRequiredPickBy;function requirePickBy(){if(hasRequiredPickBy)return pickBy_1;hasRequiredPickBy=1;var e=require_arrayMap(),t=require_baseIteratee(),I=require_basePickBy(),B=require_getAllKeysIn();function tr(rr,ir){if(rr==null)return{};var lr=e(B(rr),function(dr){return[dr]});return ir=t(ir),I(rr,lr,function(dr,hr){return ir(dr,hr[0])})}return pickBy_1=tr,pickBy_1}var omitBy_1,hasRequiredOmitBy;function requireOmitBy(){if(hasRequiredOmitBy)return omitBy_1;hasRequiredOmitBy=1;var e=require_baseIteratee(),t=requireNegate(),I=requirePickBy();function B(tr,rr){return I(tr,t(e(rr)))}return omitBy_1=B,omitBy_1}var querycompiler,hasRequiredQuerycompiler;function requireQuerycompiler(){if(hasRequiredQuerycompiler)return querycompiler;hasRequiredQuerycompiler=1;const e=requireHelpers$1(),t=requireRaw(),I=requireQuerybuilder(),B=requireJoinclause(),tr=requireBrowser(),rr=requireAssign(),ir=requireCompact(),lr=requireGroupBy(),dr=requireHas(),hr=requireIsEmpty(),fr=requireMap(),mr=requireOmitBy(),_r=requireReduce(),{nanoid:yr}=requireNanoid(),{isString:xr,isUndefined:Mr}=requireIs(),{columnize:vr,direction:Sr,operator:wr,wrap:br,unwrapRaw:Ar,rawOrFn:kr}=requireWrappingFormatter(),Dr=tr("knex:bindings"),Or=["comments","columns","join","where","union","group","having","order","limit","offset","lock","waitMode"];class zr{constructor(Fr,$r,Hn){this.client=Fr,this.method=$r._method||"select",this.options=$r._options,this.single=$r._single,this.queryComments=$r._comments,this.timeout=$r._timeout||!1,this.cancelOnTimeout=$r._cancelOnTimeout||!1,this.grouped=lr($r._statements,"grouping"),this.formatter=Fr.formatter($r),this._emptyInsertValue="default values",this.first=this.select,this.bindings=Hn||[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.builder=this.formatter.builder}toSQL(Fr,$r){this._undefinedInWhereClause=!1,this.undefinedBindingsInfo=[],Fr=Fr||this.method;const Hn=this[Fr]()||"",ti={method:Fr,options:_r(this.options,rr,{}),timeout:this.timeout,cancelOnTimeout:this.cancelOnTimeout,bindings:this.bindingsHolder.bindings||[],__knexQueryUid:yr()};if(Object.defineProperties(ti,{toNative:{value:()=>({sql:this.client.positionBindings(ti.sql),bindings:this.client.prepBindings(ti.bindings)}),enumerable:!1}}),xr(Hn)?ti.sql=Hn:rr(ti,Hn),(Fr==="select"||Fr==="first")&&this.single.as&&(ti.as=this.single.as),this._undefinedInWhereClause)throw Dr(ti.bindings),new Error(`Undefined binding(s) detected when compiling ${Fr.toUpperCase()}. Undefined column(s): [${this.undefinedBindingsInfo.join(", ")}] query: ${ti.sql}`);return ti}select(){let Fr=this.with(),$r="";const Hn=[],ti=[];Or.forEach(Lr=>{const Kn=this[Lr](this);switch(Lr){case"union":$r=Kn;break;case"comments":case"columns":case"join":case"where":Hn.push(Kn);break;default:ti.push(Kn);break}});const Ir=this.grouped.union&&this.grouped.union.map(Lr=>Lr.wrap).some(Lr=>Lr);if(this.onlyUnions()){const Lr=ir(Hn.concat(ti)).join(" ");Fr+=$r+(Lr?" "+Lr:"")}else{const Lr=(Ir?"(":"")+ir(Hn).join(" ")+(Ir?")":""),Kn=ir(ti).join(" ");Fr+=Lr+($r?" "+$r:"")+(Kn&&" "+Kn)}return Fr}pluck(){let Fr=this.single.pluck;return Fr.indexOf(".")!==-1&&(Fr=Fr.split(".").slice(-1)[0]),{sql:this.select(),pluck:Fr}}insert(){const Fr=this.single.insert||[],$r=this.with()+`insert into ${this.tableName} `,Hn=this._insertBody(Fr);return Hn===""?"":$r+Hn}_onConflictClause(Fr){return Fr instanceof t?this.formatter.wrap(Fr):`(${this.formatter.columnize(Fr)})`}_buildInsertValues(Fr){let $r="",Hn=-1;for(;++Hn<Fr.values.length;)Hn!==0&&($r+="), ("),$r+=this.client.parameterize(Fr.values[Hn],this.client.valueForUndefined,this.builder,this.bindingsHolder);return $r}_insertBody(Fr){let $r="";if(Array.isArray(Fr)){if(Fr.length===0)return""}else if(typeof Fr=="object"&&hr(Fr))return $r+this._emptyInsertValue;const Hn=this._prepInsert(Fr);return typeof Hn=="string"?$r+=Hn:Hn.columns.length?($r+=`(${vr(Hn.columns,this.builder,this.client,this.bindingsHolder)}`,$r+=") values ("+this._buildInsertValues(Hn)+")"):Fr.length===1&&Fr[0]?$r+=this._emptyInsertValue:$r="",$r}update(){const Fr=this.with(),{tableName:$r}=this,Hn=this._prepUpdate(this.single.update),ti=this.where();return Fr+`update ${this.single.only?"only ":""}${$r} set `+Hn.join(", ")+(ti?` ${ti}`:"")}_hintComments(){let Fr=this.grouped.hintComments||[];return Fr=Fr.map($r=>ir($r.value).join(" ")),Fr=ir(Fr).join(" "),Fr?`/*+ ${Fr} */ `:""}columns(){let Fr="";if(this.onlyUnions())return"";const $r=this._hintComments(),Hn=this.grouped.columns||[];let ti=-1,Ir=[];if(Hn)for(;++ti<Hn.length;){const Kn=Hn[ti];if(Kn.distinct&&(Fr="distinct "),Kn.distinctOn){Fr=this.distinctOn(Kn.value);continue}Kn.type==="aggregate"?Ir.push(...this.aggregate(Kn)):Kn.type==="aggregateRaw"?Ir.push(this.aggregateRaw(Kn)):Kn.type==="analytic"?Ir.push(this.analytic(Kn)):Kn.type==="json"?Ir.push(this.json(Kn)):Kn.value&&Kn.value.length>0&&Ir.push(vr(Kn.value,this.builder,this.client,this.bindingsHolder))}return Ir.length===0&&(Ir=["*"]),`${this.onlyJson()?"":"select "}${$r}${Fr}`+Ir.join(", ")+(this.tableName?` from ${this.single.only?"only ":""}${this.tableName}`:"")}comments(){return this.queryComments.length?this.queryComments.map(Fr=>`/* ${Fr.comment} */`).join(" "):""}_aggregate(Fr,{aliasSeparator:$r=" as ",distinctParentheses:Hn}={}){const ti=Fr.value,Ir=Fr.method,Lr=Fr.aggregateDistinct?"distinct ":"",Kn=Jn=>br(Jn,void 0,this.builder,this.client,this.bindingsHolder),pi=(Jn,Qr)=>Qr?Jn+$r+Kn(Qr):Jn,gi=(Jn,Qr)=>{let Jr=Jn.map(Kn).join(", ");if(Lr){const mi=Hn?"(":" ",ci=Hn?")":"";Jr=Lr.trim()+mi+Jr+ci}const ei=`${Ir}(${Jr})`;return pi(ei,Qr)},oi=(Jn,Qr)=>{const Jr=`${Ir}(${Lr+Kn(Jn)})`;return pi(Jr,Qr)};if(Array.isArray(ti))return[gi(ti)];if(typeof ti=="object"){if(Fr.alias)throw new Error("When using an object explicit alias can not be used");return Object.entries(ti).map(([Jn,Qr])=>Array.isArray(Qr)?gi(Qr,Jn):oi(Qr,Jn))}const qn=ti.toLowerCase().indexOf(" as ");let li=ti,{alias:di}=Fr;if(qn!==-1){if(li=ti.slice(0,qn),di)throw new Error(`Found multiple aliases for same column: ${li}`);di=ti.slice(qn+4)}return[oi(li,di)]}aggregate(Fr){return this._aggregate(Fr)}aggregateRaw(Fr){const $r=Fr.aggregateDistinct?"distinct ":"";return`${Fr.method}(${$r+Ar(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)})`}_joinTable(Fr){return Fr.schema&&!(Fr.table instanceof t)?`${Fr.schema}.${Fr.table}`:Fr.table}join(){let Fr="",$r=-1;const Hn=this.grouped.join;if(!Hn)return"";for(;++$r<Hn.length;){const ti=Hn[$r],Ir=this._joinTable(ti);if($r>0&&(Fr+=" "),ti.joinType==="raw")Fr+=Ar(ti.table,void 0,this.builder,this.client,this.bindingsHolder);else{Fr+=ti.joinType+" join "+br(Ir,void 0,this.builder,this.client,this.bindingsHolder);let Lr=-1;for(;++Lr<ti.clauses.length;){const Kn=ti.clauses[Lr];Lr>0?Fr+=` ${Kn.bool} `:Fr+=` ${Kn.type==="onUsing"?"using":"on"} `;const pi=this[Kn.type](Kn);pi&&(Fr+=pi)}}}return Fr}onBetween(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(Fr,"between")+" "+Fr.value.map($r=>this.client.parameter($r,this.builder,this.bindingsHolder)).join(" and ")}onNull(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(Fr,"null")}onExists(Fr){return this._not(Fr,"exists")+" ("+kr(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}onIn(Fr){if(Array.isArray(Fr.column))return this.multiOnIn(Fr);let $r;return Fr.value instanceof t?$r=this.client.parameter(Fr.value,this.builder,this.formatter):$r=this.client.parameterize(Fr.value,void 0,this.builder,this.bindingsHolder),br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(Fr,"in ")+this.wrap($r)}multiOnIn(Fr){let $r=-1,Hn=`(${vr(Fr.column,this.builder,this.client,this.bindingsHolder)}) `;for(Hn+=this._not(Fr,"in ")+"((";++$r<Fr.value.length;)$r!==0&&(Hn+="),("),Hn+=this.client.parameterize(Fr.value[$r],void 0,this.builder,this.bindingsHolder);return Hn+"))"}where(){const Fr=this.grouped.where;if(!Fr)return;const $r=[];let Hn=-1;for(;++Hn<Fr.length;){const ti=Fr[Hn];Object.prototype.hasOwnProperty.call(ti,"value")&&e.containsUndefined(ti.value)&&(this.undefinedBindingsInfo.push(ti.column),this._undefinedInWhereClause=!0);const Ir=this[ti.type](ti);Ir&&($r.length===0?$r[0]="where":$r.push(ti.bool),$r.push(Ir))}return $r.length>1?$r.join(" "):""}group(){return this._groupsOrders("group")}order(){return this._groupsOrders("order")}having(){const Fr=this.grouped.having;if(!Fr)return"";const $r=["having"];for(let Hn=0,ti=Fr.length;Hn<ti;Hn++){const Ir=Fr[Hn],Lr=this[Ir.type](Ir);Lr&&($r.length===0&&($r[0]="where"),($r.length>1||$r.length===1&&$r[0]!=="having")&&$r.push(Ir.bool),$r.push(Lr))}return $r.length>1?$r.join(" "):""}havingRaw(Fr){return this._not(Fr,"")+Ar(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)}havingWrapped(Fr){const $r=kr(Fr.value,"where",this.builder,this.client,this.bindingsHolder);return $r&&this._not(Fr,"")+"("+$r.slice(6)+")"||""}havingBasic(Fr){return this._not(Fr,"")+br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+wr(Fr.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(Fr.value,this.builder,this.bindingsHolder)}havingNull(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(Fr,"null")}havingExists(Fr){return this._not(Fr,"exists")+" ("+kr(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}havingBetween(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(Fr,"between")+" "+Fr.value.map($r=>this.client.parameter($r,this.builder,this.bindingsHolder)).join(" and ")}havingIn(Fr){return Array.isArray(Fr.column)?this.multiHavingIn(Fr):br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(Fr,"in ")+this.wrap(this.client.parameterize(Fr.value,void 0,this.builder,this.bindingsHolder))}multiHavingIn(Fr){return this.multiOnIn(Fr)}union(){const Fr=this.onlyUnions(),$r=this.grouped.union;if(!$r)return"";let Hn="";for(let ti=0,Ir=$r.length;ti<Ir;ti++){const Lr=$r[ti];ti>0&&(Hn+=" "),(ti>0||!Fr)&&(Hn+=Lr.clause+" ");const Kn=kr(Lr.value,void 0,this.builder,this.client,this.bindingsHolder);if(Kn){const pi=Lr.wrap;pi&&(Hn+="("),Hn+=Kn,pi&&(Hn+=")")}}return Hn}onlyUnions(){return(!this.grouped.columns||!!this.grouped.columns[0].value)&&this.grouped.union&&!this.tableName}_getValueOrParameterFromAttribute(Fr,$r){return this.single.skipBinding[Fr]===!0?$r??this.single[Fr]:this.client.parameter(this.single[Fr],this.builder,this.bindingsHolder)}onlyJson(){return!this.tableName&&this.grouped.columns&&this.grouped.columns.length===1&&this.grouped.columns[0].type==="json"}limit(){return!this.single.limit&&this.single.limit!==0?"":`limit ${this._getValueOrParameterFromAttribute("limit")}`}offset(){return this.single.offset?`offset ${this._getValueOrParameterFromAttribute("offset")}`:""}del(){const{tableName:Fr}=this,$r=this.with(),Hn=this.where(),ti=this.join(),Ir=ti?Fr+" ":"";return $r+`delete ${Ir}from ${this.single.only?"only ":""}${Fr}`+(ti?` ${ti}`:"")+(Hn?` ${Hn}`:"")}truncate(){return`truncate ${this.tableName}`}lock(){if(this.single.lock)return this[this.single.lock]()}waitMode(){if(this.single.waitMode)return this[this.single.waitMode]()}skipLocked(){throw new Error(".skipLocked() is currently only supported on MySQL 8.0+ and PostgreSQL 9.5+")}noWait(){throw new Error(".noWait() is currently only supported on MySQL 8.0+, MariaDB 10.3.0+ and PostgreSQL 9.5+")}distinctOn(Fr){throw new Error(".distinctOn() is currently only supported on PostgreSQL")}onWrapped(Fr){const $r=this,Hn=new B;Fr.value.call(Hn,Hn);let ti="";for(let Ir=0;Ir<Hn.clauses.length;Ir++){const Lr=Hn.clauses[Ir];Ir>0&&(ti+=` ${Lr.bool} `);const Kn=$r[Lr.type](Lr);Kn&&(ti+=Kn)}return ti.length?`(${ti})`:""}onBasic(Fr){const $r=Fr.value instanceof I;return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+wr(Fr.operator,this.builder,this.client,this.bindingsHolder)+" "+($r?"(":"")+br(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)+($r?")":"")}onVal(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+wr(Fr.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(Fr.value,this.builder,this.bindingsHolder)}onRaw(Fr){return Ar(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)}onUsing(Fr){return"("+vr(Fr.column,this.builder,this.client,this.bindingsHolder)+")"}_valueClause(Fr){return Fr.asColumn?br(Fr.value,void 0,this.builder,this.client,this.bindingsHolder):this.client.parameter(Fr.value,this.builder,this.bindingsHolder)}_columnClause(Fr){let $r;return Array.isArray(Fr.column)?$r=`(${vr(Fr.column,this.builder,this.client,this.bindingsHolder)})`:$r=br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder),$r}whereIn(Fr){const $r=this.client.values(Fr.value,this.builder,this.bindingsHolder);return`${this._columnClause(Fr)} ${this._not(Fr,"in ")}${$r}`}whereLike(Fr){return`${this._columnClause(Fr)} ${this._not(Fr,"like ")}${this._valueClause(Fr)}`}whereILike(Fr){return`${this._columnClause(Fr)} ${this._not(Fr,"ilike ")}${this._valueClause(Fr)}`}whereNull(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(Fr,"null")}whereBasic(Fr){return this._not(Fr,"")+br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+wr(Fr.operator,this.builder,this.client,this.bindingsHolder)+" "+this._valueClause(Fr)}whereExists(Fr){return this._not(Fr,"exists")+" ("+kr(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}whereWrapped(Fr){const $r=kr(Fr.value,"where",this.builder,this.client,this.bindingsHolder);return $r&&this._not(Fr,"")+"("+$r.slice(6)+")"||""}whereBetween(Fr){return br(Fr.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(Fr,"between")+" "+Fr.value.map($r=>this.client.parameter($r,this.builder,this.bindingsHolder)).join(" and ")}whereRaw(Fr){return this._not(Fr,"")+Ar(Fr.value,void 0,this.builder,this.client,this.bindingsHolder)}_jsonWrapValue(Fr){if(!this.builder._isJsonObject(Fr))try{return JSON.stringify(JSON.parse(Fr.replace(/\n|\t/g,"")))}catch{return Fr}return JSON.stringify(Fr)}_jsonValueClause(Fr){return Fr.value=this._jsonWrapValue(Fr.value),this._valueClause(Fr)}whereJsonObject(Fr){return`${this._columnClause(Fr)} ${Fr.not?"!=":"="} ${this._jsonValueClause(Fr)}`}wrap(Fr){return Fr.charAt(0)!=="("?`(${Fr})`:Fr}json(Fr){return this[Fr.method](Fr.params)}analytic(Fr){let $r="";const Hn=this;return $r+=Fr.method+"() over (",Fr.raw?$r+=Fr.raw:(Fr.partitions.length&&($r+="partition by ",$r+=fr(Fr.partitions,function(ti){return xr(ti)?Hn.formatter.columnize(ti):Hn.formatter.columnize(ti.column)+(ti.order?" "+ti.order:"")}).join(", ")+" "),$r+="order by ",$r+=fr(Fr.order,function(ti){return xr(ti)?Hn.formatter.columnize(ti):Hn.formatter.columnize(ti.column)+(ti.order?" "+ti.order:"")}).join(", ")),$r+=")",Fr.alias&&($r+=" as "+Fr.alias),$r}with(){if(!this.grouped.with||!this.grouped.with.length)return"";const Fr=this.grouped.with;if(!Fr)return;const $r=[];let Hn=-1,ti=!1;for(;++Hn<Fr.length;){const Ir=Fr[Hn];Ir.recursive&&(ti=!0);const Lr=this[Ir.type](Ir);$r.push(Lr)}return`with ${ti?"recursive ":""}${$r.join(", ")} `}withWrapped(Fr){const $r=kr(Fr.value,void 0,this.builder,this.client,this.bindingsHolder),Hn=Fr.columnList?"("+vr(Fr.columnList,this.builder,this.client,this.bindingsHolder)+")":"",ti=Fr.materialized===void 0?"":Fr.materialized?"materialized ":"not materialized ";return $r&&vr(Fr.alias,this.builder,this.client,this.bindingsHolder)+Hn+" as "+ti+"("+$r+")"||""}_not(Fr,$r){return Fr.not?`not ${$r}`:$r}_prepInsert(Fr){const $r=kr(Fr,void 0,this.builder,this.client,this.bindingsHolder);if($r)return $r;let Hn=[];const ti=[];Array.isArray(Fr)||(Fr=Fr?[Fr]:[]);let Ir=-1;for(;++Ir<Fr.length&&Fr[Ir]!=null;){Ir===0&&(Hn=Object.keys(Fr[Ir]).sort());const Lr=new Array(Hn.length),Kn=Object.keys(Fr[Ir]);let pi=-1;for(;++pi<Kn.length;){const gi=Kn[pi];let oi=Hn.indexOf(gi);if(oi===-1){Hn=Hn.concat(gi).sort(),oi=Hn.indexOf(gi);let qn=-1;for(;++qn<ti.length;)ti[qn].splice(oi,0,void 0);Lr.splice(oi,0,void 0)}Lr[oi]=Fr[Ir][gi]}ti.push(Lr)}return{columns:Hn,values:ti}}_prepUpdate(Fr={}){const{counter:$r={}}=this.single;for(const Lr of Object.keys($r)){if(dr(Fr,Lr)){this.client.logger.warn("increment/decrement called for a column that has already been specified in main .update() call. Ignoring increment/decrement and using value from .update() call.");continue}let Kn=$r[Lr];const pi=Kn<0?"-":"+";pi==="-"&&(Kn=-Kn),Fr[Lr]=this.client.raw(`?? ${pi} ?`,[Lr,Kn])}Fr=mr(Fr,Mr);const Hn=[],ti=Object.keys(Fr);let Ir=-1;for(;++Ir<ti.length;)Hn.push(br(ti[Ir],void 0,this.builder,this.client,this.bindingsHolder)+" = "+this.client.parameter(Fr[ti[Ir]],this.builder,this.bindingsHolder));if(hr(Hn))throw new Error(["Empty .update() call detected!","Update data does not contain any values to update.","This will result in a faulty query.",this.single.table?`Table: ${this.single.table}.`:"",this.single.update?`Columns: ${Object.keys(this.single.update)}.`:""].join(" "));return Hn}_formatGroupsItemValue(Fr,$r){const{formatter:Hn}=this;let ti="";$r==="last"?ti=" is null":$r==="first"&&(ti=" is not null");let Ir;return Fr instanceof t?Ir=Ar(Fr,void 0,this.builder,this.client,this.bindingsHolder):Fr instanceof I||$r?Ir="("+Hn.columnize(Fr)+ti+")":Ir=Hn.columnize(Fr),Ir}_basicGroupOrder(Fr,$r){const Hn=this._formatGroupsItemValue(Fr.value,Fr.nulls),ti=$r==="order"&&Fr.type!=="orderByRaw"?` ${Sr(Fr.direction,this.builder,this.client,this.bindingsHolder)}`:"";return Hn+ti}_groupOrder(Fr,$r){return this._basicGroupOrder(Fr,$r)}_groupOrderNulls(Fr,$r){const Hn=this._formatGroupsItemValue(Fr.value),ti=$r==="order"&&Fr.type!=="orderByRaw"?` ${Sr(Fr.direction,this.builder,this.client,this.bindingsHolder)}`:"";return Fr.nulls&&!(Fr.value instanceof t)?`${Hn}${ti||""} nulls ${Fr.nulls}`:Hn+ti}_groupsOrders(Fr){const $r=this.grouped[Fr];if(!$r)return"";const Hn=$r.map(ti=>this._groupOrder(ti,Fr));return Hn.length?Fr+" by "+Hn.join(", "):""}get tableName(){if(!this._tableName){let Fr=this.single.table;const $r=this.single.schema;if(Fr&&$r){const Hn=Fr instanceof I,ti=Fr instanceof t;!Hn&&!ti&&!(typeof Fr=="function")&&(Fr=`${$r}.${Fr}`)}this._tableName=Fr?br(Fr,Fr instanceof I,this.builder,this.client,this.bindingsHolder):""}return this._tableName}_jsonPathWrap(Fr){return this.client.parameter(Fr.path||Fr[1],this.builder,this.bindingsHolder)}_jsonExtract(Fr,$r){let Hn;return Array.isArray($r.column)?Hn=$r.column:Hn=[$r],Array.isArray(Fr)||(Fr=[Fr]),Hn.map(ti=>{let Ir=`${vr(ti.column||ti[0],this.builder,this.client,this.bindingsHolder)}, ${this._jsonPathWrap(ti)}`;Fr.forEach(Kn=>{Ir=Kn+"("+Ir+")"});const Lr=ti.alias||ti[2];return Lr?this.client.alias(Ir,this.formatter.wrap(Lr)):Ir}).join(", ")}_jsonSet(Fr,$r){const Hn=`${Fr}(${vr($r.column,this.builder,this.client,this.bindingsHolder)}, ${this.client.parameter($r.path,this.builder,this.bindingsHolder)}, ${this.client.parameter($r.value,this.builder,this.bindingsHolder)})`;return $r.alias?this.client.alias(Hn,this.formatter.wrap($r.alias)):Hn}_whereJsonPath(Fr,$r){return`${Fr}(${this._columnClause($r)}, ${this._jsonPathWrap({path:$r.jsonPath})}) ${wr($r.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause($r)}`}_onJsonPathEquals(Fr,$r){return Fr+"("+br($r.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter($r.jsonPathFirst,this.builder,this.bindingsHolder)+") = "+Fr+"("+br($r.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter($r.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return querycompiler=zr,querycompiler}var builder,hasRequiredBuilder;function requireBuilder(){if(hasRequiredBuilder)return builder;hasRequiredBuilder=1;const{EventEmitter:e}=requireEvents(),t=requireToArray(),I=requireAssign(),{addQueryContext:B}=requireHelpers$1(),tr=requireSaveAsyncStack(),{augmentWithBuilderInterface:rr}=requireBuilderInterfaceAugmenter();class ir extends e{constructor(dr){super(),this.client=dr,this._sequence=[],dr.config&&(this._debug=dr.config.debug,tr(this,4))}withSchema(dr){return this._schema=dr,this}toString(){return this.toQuery()}toSQL(){return this.client.schemaCompiler(this).toSQL()}async generateDdlCommands(){return await this.client.schemaCompiler(this).generateDdlCommands()}}return["createTable","createTableIfNotExists","createTableLike","createView","createViewOrReplace","createMaterializedView","refreshMaterializedView","dropView","dropViewIfExists","dropMaterializedView","dropMaterializedViewIfExists","createSchema","createSchemaIfNotExists","dropSchema","dropSchemaIfExists","createExtension","createExtensionIfNotExists","dropExtension","dropExtensionIfExists","table","alterTable","view","alterView","hasTable","hasColumn","dropTable","renameTable","renameView","dropTableIfExists","raw"].forEach(function(lr){ir.prototype[lr]=function(){return lr==="createTableIfNotExists"&&this.client.logger.warn(["Use async .hasTable to check if table exists and then use plain .createTable. Since ",'.createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." ',"query it will not work correctly if there are any alter table queries generated for ","columns afterwards. To not break old migrations this function is left untouched for now",", but it should not be used when writing new code and it is removed from documentation."].join("")),lr==="table"&&(lr="alterTable"),lr==="view"&&(lr="alterView"),this._sequence.push({method:lr,args:t(arguments)}),this}}),ir.extend=(lr,dr)=>{if(Object.prototype.hasOwnProperty.call(ir.prototype,lr))throw new Error(`Can't extend SchemaBuilder with existing method ('${lr}').`);I(ir.prototype,{[lr]:dr})},rr(ir),B(ir),builder=ir,builder}var helpers,hasRequiredHelpers;function requireHelpers(){if(hasRequiredHelpers)return helpers;hasRequiredHelpers=1;const e=requireTail(),{isString:t}=requireIs();function I(rr){rr&&(t(rr)&&(rr={sql:rr}),rr.bindings||(rr.bindings=this.bindingsHolder.bindings),this.sequence.push(rr),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}function B(rr){const ir=new this.constructor(this.client,this.tableCompiler,this.columnBuilder);rr.call(ir,e(arguments)),this.sequence.additional=(this.sequence.additional||[]).concat(ir.sequence)}function tr(rr){rr&&(t(rr)&&(rr={sql:rr}),rr.bindings||(rr.bindings=this.bindingsHolder.bindings),this.sequence.unshift(rr),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}return helpers={pushAdditional:B,pushQuery:I,unshiftQuery:tr},helpers}var compiler$1,hasRequiredCompiler$1;function requireCompiler$1(){if(hasRequiredCompiler$1)return compiler$1;hasRequiredCompiler$1=1;const{pushQuery:e,pushAdditional:t,unshiftQuery:I}=requireHelpers();class B{constructor(fr,mr){this.builder=mr,this._commonBuilder=this.builder,this.client=fr,this.schema=mr._schema,this.bindings=[],this.bindingsHolder=this,this.formatter=fr.formatter(mr),this.formatter.bindings=this.bindings,this.sequence=[]}createSchema(){dr("createSchema")}createSchemaIfNotExists(){dr("createSchemaIfNotExists")}dropSchema(){dr("dropSchema")}dropSchemaIfExists(){dr("dropSchemaIfExists")}dropTable(fr){this.pushQuery(this.dropTablePrefix+this.formatter.wrap(lr(this.schema,fr)))}dropTableIfExists(fr){this.pushQuery(this.dropTablePrefix+"if exists "+this.formatter.wrap(lr(this.schema,fr)))}dropView(fr){this._dropView(fr,!1,!1)}dropViewIfExists(fr){this._dropView(fr,!0,!1)}dropMaterializedView(fr){throw new Error("materialized views are not supported by this dialect.")}dropMaterializedViewIfExists(fr){throw new Error("materialized views are not supported by this dialect.")}renameView(fr,mr){throw new Error("rename view is not supported by this dialect (instead drop then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}_dropView(fr,mr,_r){this.pushQuery((_r?this.dropMaterializedViewPrefix:this.dropViewPrefix)+(mr?"if exists ":"")+this.formatter.wrap(lr(this.schema,fr)))}raw(fr,mr){this.sequence.push(this.client.raw(fr,mr).toSQL())}toSQL(){const fr=this.builder._sequence;for(let mr=0,_r=fr.length;mr<_r;mr++){const yr=fr[mr];this[yr.method].apply(this,yr.args)}return this.sequence}async generateDdlCommands(){const fr=this.toSQL();return{pre:[],sql:Array.isArray(fr)?fr:[fr],check:null,post:[]}}}B.prototype.dropTablePrefix="drop table ",B.prototype.dropViewPrefix="drop view ",B.prototype.dropMaterializedViewPrefix="drop materialized view ",B.prototype.alterViewPrefix="alter view ",B.prototype.alterTable=rr("alter"),B.prototype.createTable=rr("create"),B.prototype.createTableIfNotExists=rr("createIfNot"),B.prototype.createTableLike=rr("createLike"),B.prototype.createView=ir("create"),B.prototype.createViewOrReplace=ir("createOrReplace"),B.prototype.createMaterializedView=ir("createMaterializedView"),B.prototype.alterView=ir("alter"),B.prototype.pushQuery=e,B.prototype.pushAdditional=t,B.prototype.unshiftQuery=I;function tr(hr){const fr=this.builder.queryContext();fr!==void 0&&hr.queryContext()===void 0&&hr.queryContext(fr),hr.setSchema(this.schema);const mr=hr.toSQL();for(let _r=0,yr=mr.length;_r<yr;_r++)this.sequence.push(mr[_r])}function rr(hr){return hr==="createLike"?function(fr,mr,_r){const yr=this.client.tableBuilder(hr,fr,mr,_r);tr.call(this,yr)}:function(fr,mr){const _r=this.client.tableBuilder(hr,fr,null,mr);tr.call(this,_r)}}function ir(hr){return function(fr,mr){const _r=this.client.viewBuilder(hr,fr,mr);tr.call(this,_r)}}function lr(hr,fr){return hr?`${hr}.${fr}`:fr}function dr(hr){throw new Error(`${hr} is not supported for this dialect (only PostgreSQL supports it currently).`)}return compiler$1=B,compiler$1}var assignIn_1,hasRequiredAssignIn;function requireAssignIn(){if(hasRequiredAssignIn)return assignIn_1;hasRequiredAssignIn=1;var e=require_copyObject(),t=require_createAssigner(),I=requireKeysIn(),B=t(function(tr,rr){e(rr,I(rr),tr)});return assignIn_1=B,assignIn_1}var extend,hasRequiredExtend;function requireExtend(){return hasRequiredExtend||(hasRequiredExtend=1,extend=requireAssignIn()),extend}var tablebuilder,hasRequiredTablebuilder;function requireTablebuilder(){if(hasRequiredTablebuilder)return tablebuilder;hasRequiredTablebuilder=1;const e=requireEach(),t=requireExtend(),I=requireAssign(),B=requireToArray(),tr=requireHelpers$1(),{isString:rr,isFunction:ir,isObject:lr}=requireIs();class dr{constructor(yr,xr,Mr,vr,Sr){if(this.client=yr,this._fn=Sr,this._method=xr,this._schemaName=void 0,this._tableName=Mr,this._tableNameLike=vr,this._statements=[],this._single={},!vr&&!ir(this._fn))throw new TypeError("A callback function must be supplied to calls against `.createTable` and `.table`")}setSchema(yr){this._schemaName=yr}toSQL(){return this._method==="alter"&&t(this,mr),this._fn&&this._fn.call(this,this),this.client.tableCompiler(this).toSQL()}timestamps(yr,xr,Mr){lr(yr)&&({useTimestamps:yr,defaultToNow:xr,useCamelCase:Mr}=yr);const vr=yr===!0?"timestamp":"datetime",Sr=this[vr](Mr?"createdAt":"created_at"),wr=this[vr](Mr?"updatedAt":"updated_at");if(xr===!0){const br=this.client.raw("CURRENT_TIMESTAMP");Sr.notNullable().defaultTo(br),wr.notNullable().defaultTo(br)}}comment(yr){if(typeof yr!="string")throw new TypeError("Table comment must be string");this._single.comment=yr}foreign(yr,xr){const Mr={column:yr,keyName:xr};this._statements.push({grouping:"alterTable",method:"foreign",args:[Mr]});let vr={references(Sr){let wr;return rr(Sr)&&(wr=Sr.split(".")),!wr||wr.length===1?(Mr.references=wr?wr[0]:Sr,{on(br){if(typeof br!="string")throw new TypeError(`Expected tableName to be a string, got: ${typeof br}`);return Mr.inTable=br,vr},inTable(){return this.on.apply(this,arguments)}}):(Mr.inTable=wr[0],Mr.references=wr[1],vr)},withKeyName(Sr){return Mr.keyName=Sr,vr},onUpdate(Sr){return Mr.onUpdate=Sr,vr},onDelete(Sr){return Mr.onDelete=Sr,vr},deferrable:Sr=>{if(["mysql","mssql","redshift","mysql2","oracledb"].indexOf(this.client.dialect)!==-1)throw new Error(`${this.client.dialect} does not support deferrable`);return Mr.deferrable=Sr,vr},_columnBuilder(Sr){return t(Sr,vr),vr=Sr,Sr}};return vr}check(yr,xr,Mr){return this._statements.push({grouping:"checks",args:[yr,xr,Mr]}),this}}["index","primary","unique","dropPrimary","dropUnique","dropIndex","dropForeign"].forEach(_r=>{dr.prototype[_r]=function(){return this._statements.push({grouping:"alterTable",method:_r,args:B(arguments)}),this}}),e({mysql:["engine","charset","collate"],postgresql:["inherits"]},function(_r,yr){_r.forEach(function(xr){dr.prototype[xr]=function(Mr){if(this.client.dialect!==yr)throw new Error(`Knex only supports ${xr} statement with ${yr}.`);if(this._method==="alter")throw new Error(`Knex does not support altering the ${xr} outside of create table, please use knex.raw statement.`);this._single[xr]=Mr}})}),tr.addQueryContext(dr),["tinyint","smallint","mediumint","int","bigint","decimal","float","double","real","bit","boolean","serial","date","datetime","timestamp","time","year","geometry","geography","point","char","varchar","tinytext","tinyText","text","mediumtext","mediumText","longtext","longText","binary","varbinary","tinyblob","tinyBlob","mediumblob","mediumBlob","blob","longblob","longBlob","enum","set","bool","dateTime","increments","bigincrements","bigIncrements","integer","biginteger","bigInteger","string","json","jsonb","uuid","enu","specificType"].forEach(_r=>{dr.prototype[_r]=function(){const yr=B(arguments),xr=this.client.columnBuilder(this,_r,yr);return this._statements.push({grouping:"columns",builder:xr}),xr}});const mr={renameColumn(_r,yr){return this._statements.push({grouping:"alterTable",method:"renameColumn",args:[_r,yr]}),this},dropTimestamps(){return this.dropColumns(arguments[0]===!0?["createdAt","updatedAt"]:["created_at","updated_at"])},setNullable(_r){return this._statements.push({grouping:"alterTable",method:"setNullable",args:[_r]}),this},check(_r,yr,xr){this._statements.push({grouping:"alterTable",method:"check",args:[_r,yr,xr]})},dropChecks(){this._statements.push({grouping:"alterTable",method:"dropChecks",args:B(arguments)})},dropNullable(_r){return this._statements.push({grouping:"alterTable",method:"dropNullable",args:[_r]}),this}};return mr.dropColumn=mr.dropColumns=function(){return this._statements.push({grouping:"alterTable",method:"dropColumn",args:B(arguments)}),this},dr.extend=(_r,yr)=>{if(Object.prototype.hasOwnProperty.call(dr.prototype,_r))throw new Error(`Can't extend TableBuilder with existing method ('${_r}').`);I(dr.prototype,{[_r]:yr})},tablebuilder=dr,tablebuilder}var _baseFindIndex,hasRequired_baseFindIndex;function require_baseFindIndex(){if(hasRequired_baseFindIndex)return _baseFindIndex;hasRequired_baseFindIndex=1;function e(t,I,B,tr){for(var rr=t.length,ir=B+(tr?1:-1);tr?ir--:++ir<rr;)if(I(t[ir],ir,t))return ir;return-1}return _baseFindIndex=e,_baseFindIndex}var _baseIsNaN,hasRequired_baseIsNaN;function require_baseIsNaN(){if(hasRequired_baseIsNaN)return _baseIsNaN;hasRequired_baseIsNaN=1;function e(t){return t!==t}return _baseIsNaN=e,_baseIsNaN}var _strictIndexOf,hasRequired_strictIndexOf;function require_strictIndexOf(){if(hasRequired_strictIndexOf)return _strictIndexOf;hasRequired_strictIndexOf=1;function e(t,I,B){for(var tr=B-1,rr=t.length;++tr<rr;)if(t[tr]===I)return tr;return-1}return _strictIndexOf=e,_strictIndexOf}var _baseIndexOf,hasRequired_baseIndexOf;function require_baseIndexOf(){if(hasRequired_baseIndexOf)return _baseIndexOf;hasRequired_baseIndexOf=1;var e=require_baseFindIndex(),t=require_baseIsNaN(),I=require_strictIndexOf();function B(tr,rr,ir){return rr===rr?I(tr,rr,ir):e(tr,t,ir)}return _baseIndexOf=B,_baseIndexOf}var indexOf_1,hasRequiredIndexOf;function requireIndexOf(){if(hasRequiredIndexOf)return indexOf_1;hasRequiredIndexOf=1;var e=require_baseIndexOf(),t=requireToInteger(),I=Math.max;function B(tr,rr,ir){var lr=tr==null?0:tr.length;if(!lr)return-1;var dr=ir==null?0:t(ir);return dr<0&&(dr=I(lr+dr,0)),e(tr,rr,dr)}return indexOf_1=B,indexOf_1}var tablecompiler,hasRequiredTablecompiler;function requireTablecompiler(){if(hasRequiredTablecompiler)return tablecompiler;hasRequiredTablecompiler=1;const{pushAdditional:e,pushQuery:t,unshiftQuery:I}=requireHelpers(),B=requireHelpers$1(),tr=requireGroupBy(),rr=requireIndexOf(),ir=requireIsEmpty(),lr=requireTail(),{normalizeArr:dr}=requireHelpers$1();class hr{constructor(mr,_r){this.client=mr,this.tableBuilder=_r,this._commonBuilder=this.tableBuilder,this.method=_r._method,this.schemaNameRaw=_r._schemaName,this.tableNameRaw=_r._tableName,this.tableNameLikeRaw=_r._tableNameLike,this.single=_r._single,this.grouped=tr(_r._statements,"grouping"),this.formatter=mr.formatter(_r),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this._formatting=mr.config&&mr.config.formatting,this.checksCount=0}toSQL(){return this[this.method](),this.sequence}create(mr,_r){const xr=this.getColumns().map(vr=>vr.toSQL()),Mr=this.getColumnTypes(xr);this.createAlterTableMethods&&this.alterTableForCreate(Mr),this.createQuery(Mr,mr,_r),this.columnQueries(xr),delete this.single.comment,this.alterTable()}createIfNot(){this.create(!0)}createLike(){this.create(!1,!0)}createLikeIfNot(){this.create(!0,!0)}alter(){const _r=this.getColumns().map(Sr=>Sr.toSQL()),yr=this.getColumns("alter"),xr=yr.map(Sr=>Sr.toSQL()),Mr=this.getColumnTypes(_r),vr=this.getColumnTypes(xr);this.addColumns(Mr),this.alterColumns(vr,yr),this.columnQueries(_r),this.columnQueries(xr),this.alterTable()}foreign(mr){if(mr.inTable&&mr.references){const _r=mr.keyName?this.formatter.wrap(mr.keyName):this._indexCommand("foreign",this.tableNameRaw,mr.column),yr=this.formatter.columnize(mr.column),xr=this.formatter.columnize(mr.references),Mr=this.formatter.wrap(mr.inTable),vr=mr.onUpdate?(this.lowerCase?" on update ":" ON UPDATE ")+mr.onUpdate:"",Sr=mr.onDelete?(this.lowerCase?" on delete ":" ON DELETE ")+mr.onDelete:"",wr=mr.deferrable?this.lowerCase?` deferrable initially ${mr.deferrable.toLowerCase()} `:` DEFERRABLE INITIALLY ${mr.deferrable.toUpperCase()} `:"";this.lowerCase?this.pushQuery((this.forCreate?"":`alter table ${this.tableName()} add `)+"constraint "+_r+" foreign key ("+yr+") references "+Mr+" ("+xr+")"+vr+Sr+wr):this.pushQuery((this.forCreate?"":`ALTER TABLE ${this.tableName()} ADD `)+"CONSTRAINT "+_r+" FOREIGN KEY ("+yr+") REFERENCES "+Mr+" ("+xr+")"+vr+Sr+wr)}}getColumnTypes(mr){return mr.reduce(function(_r,yr){const xr=yr[0];return _r.sql.push(xr.sql),_r.bindings.concat(xr.bindings),_r},{sql:[],bindings:[]})}columnQueries(mr){const _r=mr.reduce(function(yr,xr){const Mr=lr(xr);return ir(Mr)?yr:yr.concat(Mr)},[]);for(const yr of _r)this.pushQuery(yr)}addColumns(mr,_r){if(_r=_r||this.addColumnsPrefix,mr.sql.length>0){const yr=mr.sql.map(xr=>_r+xr);this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+yr.join(", "),bindings:mr.bindings})}}alterColumns(mr,_r){mr.sql.length>0&&this.addColumns(mr,this.alterColumnsPrefix,_r)}getColumns(mr){const _r=this.grouped.columns||[];mr=mr||"add";const yr=this.tableBuilder.queryContext();return _r.filter(xr=>xr.builder._method===mr).map(xr=>(yr!==void 0&&xr.builder.queryContext()===void 0&&xr.builder.queryContext(yr),this.client.columnCompiler(this,xr.builder)))}tableName(){const mr=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameRaw}`:this.tableNameRaw;return this.formatter.wrap(mr)}tableNameLike(){const mr=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameLikeRaw}`:this.tableNameLikeRaw;return this.formatter.wrap(mr)}alterTable(){const mr=this.grouped.alterTable||[];for(let _r=0,yr=mr.length;_r<yr;_r++){const xr=mr[_r];this[xr.method]?this[xr.method].apply(this,xr.args):this.client.logger.error(`Debug: ${xr.method} does not exist`)}for(const _r in this.single)typeof this[_r]=="function"&&this[_r](this.single[_r])}alterTableForCreate(mr){this.forCreate=!0;const _r=this.sequence,yr=this.grouped.alterTable||[];this.grouped.alterTable=[];for(let xr=0,Mr=yr.length;xr<Mr;xr++){const vr=yr[xr];if(rr(this.createAlterTableMethods,vr.method)<0){this.grouped.alterTable.push(vr);continue}this[vr.method]?(this.sequence=[],this[vr.method].apply(this,vr.args),mr.sql.push(this.sequence[0].sql)):this.client.logger.error(`Debug: ${vr.method} does not exist`)}this.sequence=_r,this.forCreate=!1}dropIndex(mr){this.pushQuery(`drop index${mr}`)}dropUnique(){throw new Error("Method implemented in the dialect driver")}dropForeign(){throw new Error("Method implemented in the dialect driver")}dropColumn(){const mr=B.normalizeArr.apply(null,arguments),_r=(Array.isArray(mr)?mr:[mr]).map(yr=>this.dropColumnPrefix+this.formatter.wrap(yr));this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+_r.join(", "))}_setNullableState(mr,_r){const yr=this.tableName(),xr=this.formatter.columnize(mr),Mr=this.alterColumnsPrefix;return this.pushQuery({sql:"SELECT 1",output:()=>this.client.queryBuilder().from(this.tableNameRaw).columnInfo(mr).then(vr=>{if(ir(vr))throw new Error(`.setNullable: Column ${xr} does not exist in table ${yr}.`);const Sr=_r?"null":"not null",wr=vr.type+(vr.maxLength?`(${vr.maxLength})`:""),br=vr.defaultValue!==null&&vr.defaultValue!==void 0?`default '${vr.defaultValue}'`:"",Ar=`alter table ${yr} ${Mr} ${xr} ${wr} ${Sr} ${br}`;return this.client.raw(Ar)})})}setNullable(mr){return this._setNullableState(mr,!0)}dropNullable(mr){return this._setNullableState(mr,!1)}dropChecks(mr){if(mr===void 0)return"";mr=dr(mr);const yr=`alter table ${this.tableName()} ${mr.map(xr=>`drop constraint ${xr}`).join(", ")}`;this.pushQuery(yr)}check(mr,_r,yr){const xr=this.tableName();let Mr=yr;Mr||(this.checksCount++,Mr=xr+"_"+this.checksCount);const vr=`alter table ${xr} add constraint ${Mr} check(${mr})`;this.pushQuery(vr)}_addChecks(){return this.grouped.checks?", "+this.grouped.checks.map(mr=>`${mr.args[2]?"constraint "+mr.args[2]+" ":""}check (${this.client.raw(mr.args[0],mr.args[1])})`).join(", "):""}_indexCommand(mr,_r,yr){Array.isArray(yr)||(yr=yr?[yr]:[]);const Mr=(_r.replace(/\.|-/g,"_")+"_"+yr.join("_")+"_"+mr).toLowerCase();return this.formatter.wrap(Mr)}_getPrimaryKeys(){return(this.grouped.alterTable||[]).filter(mr=>mr.method==="primary").flatMap(mr=>mr.args).flat()}_canBeAddPrimaryKey(mr){return mr.primaryKey&&this._getPrimaryKeys().length===0}_getIncrementsColumnNames(){return this.grouped.columns.filter(mr=>mr.builder._type==="increments").map(mr=>mr.builder._args[0])}_getBigIncrementsColumnNames(){return this.grouped.columns.filter(mr=>mr.builder._type==="bigincrements").map(mr=>mr.builder._args[0])}}return hr.prototype.pushQuery=t,hr.prototype.pushAdditional=e,hr.prototype.unshiftQuery=I,hr.prototype.lowerCase=!0,hr.prototype.createAlterTableMethods=null,hr.prototype.addColumnsPrefix="add column ",hr.prototype.alterColumnsPrefix="alter column ",hr.prototype.modifyColumnPrefix="modify column ",hr.prototype.dropColumnPrefix="drop column ",tablecompiler=hr,tablecompiler}var columnbuilder,hasRequiredColumnbuilder;function requireColumnbuilder(){if(hasRequiredColumnbuilder)return columnbuilder;hasRequiredColumnbuilder=1;const e=requireExtend(),t=requireAssign(),I=requireToArray(),{addQueryContext:B}=requireHelpers$1();class tr{constructor(fr,mr,_r,yr){this.client=fr,this._method="add",this._single={},this._modifiers={},this._statements=[],this._type=dr[_r]||_r,this._args=yr,this._tableBuilder=mr,mr._method==="alter"&&e(this,lr)}references(fr){return this._tableBuilder.foreign.call(this._tableBuilder,this._args[0],void 0,this)._columnBuilder(this).references(fr)}}const rr=["default","defaultsTo","defaultTo","unsigned","nullable","first","after","comment","collate","check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex"],ir={default:"defaultTo",defaultsTo:"defaultTo"};rr.forEach(function(hr){const fr=ir[hr]||hr;tr.prototype[hr]=function(){return this._modifiers[fr]=I(arguments),this}}),B(tr),tr.prototype.notNull=tr.prototype.notNullable=function(){return this.nullable(!1)},["index","primary","unique"].forEach(function(hr){tr.prototype[hr]=function(){return this._type.toLowerCase().indexOf("increments")===-1&&this._tableBuilder[hr].apply(this._tableBuilder,[this._args[0]].concat(I(arguments))),this}}),tr.extend=(hr,fr)=>{if(Object.prototype.hasOwnProperty.call(tr.prototype,hr))throw new Error(`Can't extend ColumnBuilder with existing method ('${hr}').`);t(tr.prototype,{[hr]:fr})};const lr={};lr.drop=function(){return this._single.drop=!0,this},lr.alterType=function(hr){return this._statements.push({grouping:"alterType",value:hr}),this},lr.alter=function({alterNullable:hr=!0,alterType:fr=!0}={}){return this._method="alter",this.alterNullable=hr,this.alterType=fr,this};const dr={float:"floating",enum:"enu",boolean:"bool",string:"varchar",bigint:"bigInteger"};return columnbuilder=tr,columnbuilder}var head_1,hasRequiredHead;function requireHead(){if(hasRequiredHead)return head_1;hasRequiredHead=1;function e(t){return t&&t.length?t[0]:void 0}return head_1=e,head_1}var first,hasRequiredFirst;function requireFirst(){return hasRequiredFirst||(hasRequiredFirst=1,first=requireHead()),first}var columncompiler,hasRequiredColumncompiler;function requireColumncompiler(){if(hasRequiredColumncompiler)return columncompiler;hasRequiredColumncompiler=1;const e=requireHelpers(),t=requireGroupBy(),I=requireFirst(),B=requireHas(),tr=requireTail(),{toNumber:rr}=requireHelpers$1(),{formatDefault:ir}=requireFormatterUtils(),{operator:lr}=requireWrappingFormatter();class dr{constructor(fr,mr,_r){this.client=fr,this.tableCompiler=mr,this.columnBuilder=_r,this._commonBuilder=this.columnBuilder,this.args=_r._args,this.type=_r._type.toLowerCase(),this.grouped=t(_r._statements,"grouping"),this.modified=_r._modifiers,this.isIncrements=this.type.indexOf("increments")!==-1,this.formatter=fr.formatter(_r),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this.modifiers=[],this.checksCount=0}_addCheckModifiers(){this.modifiers.push("check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex")}defaults(fr){if(Object.prototype.hasOwnProperty.call(this._defaultMap,fr))return this._defaultMap[fr].bind(this)();throw new Error(`There is no default for the specified identifier ${fr}`)}toSQL(){return this.pushQuery(this.compileColumn()),this.sequence.additional&&(this.sequence=this.sequence.concat(this.sequence.additional)),this.sequence}compileColumn(){return this.formatter.wrap(this.getColumnName())+" "+this.getColumnType()+this.getModifiers()}getColumnName(){return I(this.args)||this.defaults("columnName")}getColumnType(){if(!this._columnType){const fr=this[this.type];this._columnType=typeof fr=="function"?fr.apply(this,tr(this.args)):fr}return this._columnType}getModifiers(){const fr=[];for(let mr=0,_r=this.modifiers.length;mr<_r;mr++){const yr=this.modifiers[mr];if((!this.isIncrements||this.isIncrements&&yr==="comment")&&B(this.modified,yr)){const xr=this[yr].apply(this,this.modified[yr]);xr&&fr.push(xr)}}return fr.length>0?` ${fr.join(" ")}`:""}varchar(fr){return`varchar(${rr(fr,255)})`}floating(fr,mr){return`float(${rr(fr,8)}, ${rr(mr,2)})`}decimal(fr,mr){if(fr===null)throw new Error("Specifying no precision on decimal columns is not supported for that SQL dialect.");return`decimal(${rr(fr,8)}, ${rr(mr,2)})`}specifictype(fr){return fr}nullable(fr){return fr===!1?"not null":"null"}notNullable(){return this.nullable(!1)}defaultTo(fr){return`default ${ir(fr,this.type,this.client)}`}increments(fr={primaryKey:!0}){return"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(fr)?" primary key":"")+" autoincrement"}bigincrements(fr={primaryKey:!0}){return this.increments(fr)}_pushAlterCheckQuery(fr,mr){let _r=mr;_r||(this.checksCount++,_r=this.tableCompiler.tableNameRaw+"_"+this.getColumnName()+"_"+this.checksCount),this.pushAdditional(function(){this.pushQuery(`alter table ${this.tableCompiler.tableName()} add constraint ${_r} check(${fr})`)})}_checkConstraintName(fr){return fr?`constraint ${fr} `:""}_check(fr,mr){return this.columnBuilder._method==="alter"?(this._pushAlterCheckQuery(fr,mr),""):`${this._checkConstraintName(mr)}check (${fr})`}checkPositive(fr){return this._check(`${this.formatter.wrap(this.getColumnName())} ${lr(">",this.columnBuilder,this.bindingsHolder)} 0`,fr)}checkNegative(fr){return this._check(`${this.formatter.wrap(this.getColumnName())} ${lr("<",this.columnBuilder,this.bindingsHolder)} 0`,fr)}_checkIn(fr,mr,_r){return this._check(`${this.formatter.wrap(this.getColumnName())} ${_r?"not ":""}in (${fr.map(yr=>this.client._escapeBinding(yr)).join(",")})`,mr)}checkIn(fr,mr){return this._checkIn(fr,mr)}checkNotIn(fr,mr){return this._checkIn(fr,mr,!0)}checkBetween(fr,mr){fr.length===2&&!Array.isArray(fr[0])&&!Array.isArray(fr[1])&&(fr=[fr]);const _r=fr.map(yr=>`${this.formatter.wrap(this.getColumnName())} between ${this.client._escapeBinding(yr[0])} and ${this.client._escapeBinding(yr[1])}`).join(" or ");return this._check(_r,mr)}checkLength(fr,mr,_r){return this._check(`length(${this.formatter.wrap(this.getColumnName())}) ${lr(fr,this.columnBuilder,this.bindingsHolder)} ${rr(mr)}`,_r)}}return dr.prototype.binary="blob",dr.prototype.bool="boolean",dr.prototype.date="date",dr.prototype.datetime="datetime",dr.prototype.time="time",dr.prototype.timestamp="timestamp",dr.prototype.geometry="geometry",dr.prototype.geography="geography",dr.prototype.point="point",dr.prototype.enu="varchar",dr.prototype.bit=dr.prototype.json="text",dr.prototype.uuid=({useBinaryUuid:hr=!1,primaryKey:fr=!1}={})=>hr?"binary(16)":"char(36)",dr.prototype.integer=dr.prototype.smallint=dr.prototype.mediumint="integer",dr.prototype.biginteger="bigint",dr.prototype.text="text",dr.prototype.tinyint="tinyint",dr.prototype.pushQuery=e.pushQuery,dr.prototype.pushAdditional=e.pushAdditional,dr.prototype.unshiftQuery=e.unshiftQuery,dr.prototype._defaultMap={columnName:function(){if(!this.isIncrements)throw new Error(`You did not specify a column name for the ${this.type} column.`);return"id"}},columncompiler=dr,columncompiler}var ref,hasRequiredRef;function requireRef(){if(hasRequiredRef)return ref;hasRequiredRef=1;const e=requireRaw();class t extends e{constructor(B,tr){super(B),this.ref=tr,this._schema=null,this._alias=null}withSchema(B){return this._schema=B,this}as(B){return this._alias=B,this}toSQL(){const B=this._schema?`${this._schema}.${this.ref}`:this.ref,tr=this.client.formatter(this),rr=tr.columnize(B),ir=this._alias?`${rr} as ${tr.wrap(this._alias)}`:rr;return this.set(ir,[]),super.toSQL(...arguments)}}return ref=t,ref}var formatter,hasRequiredFormatter;function requireFormatter(){if(hasRequiredFormatter)return formatter;hasRequiredFormatter=1;const{columnize:e,wrap:t}=requireWrappingFormatter();class I{constructor(tr,rr){this.client=tr,this.builder=rr,this.bindings=[]}columnize(tr){return e(tr,this.builder,this.client,this)}wrap(tr,rr){return t(tr,rr,this.builder,this.client,this)}}return formatter=I,formatter}var colorette={},hasRequiredColorette;function requireColorette(){if(hasRequiredColorette)return colorette;hasRequiredColorette=1,Object.defineProperty(colorette,"__esModule",{value:!0});var e=require$$1;function t(Xn){if(Xn&&Xn.__esModule)return Xn;var ni=Object.create(null);return Xn&&Object.keys(Xn).forEach(function(wi){if(wi!=="default"){var Mi=Object.getOwnPropertyDescriptor(Xn,wi);Object.defineProperty(ni,wi,Mi.get?Mi:{enumerable:!0,get:function(){return Xn[wi]}})}}),ni.default=Xn,Object.freeze(ni)}var I=t(e);const{env:B={},argv:tr=[],platform:rr=""}=typeof process>"u"?{}:process,ir="NO_COLOR"in B||tr.includes("--no-color"),lr="FORCE_COLOR"in B||tr.includes("--color"),dr=rr==="win32",hr=B.TERM==="dumb",fr=I&&I.isatty&&I.isatty(1)&&B.TERM&&!hr,mr="CI"in B&&("GITHUB_ACTIONS"in B||"GITLAB_CI"in B||"CIRCLECI"in B),_r=!ir&&(lr||dr&&!hr||fr||mr),yr=(Xn,ni,wi,Mi,ri=ni.substring(0,Xn)+Mi,Gr=ni.substring(Xn+wi.length),Si=Gr.indexOf(wi))=>ri+(Si<0?Gr:yr(Si,Gr,wi,Mi)),xr=(Xn,ni,wi,Mi,ri)=>Xn<0?wi+ni+Mi:wi+yr(Xn,ni,Mi,ri)+Mi,Mr=(Xn,ni,wi=Xn,Mi=Xn.length+1)=>ri=>ri||!(ri===""||ri===void 0)?xr((""+ri).indexOf(ni,Mi),ri,Xn,ni,wi):"",vr=(Xn,ni,wi)=>Mr(`\x1B[${Xn}m`,`\x1B[${ni}m`,wi),Sr={reset:vr(0,0),bold:vr(1,22,"\x1B[22m\x1B[1m"),dim:vr(2,22,"\x1B[22m\x1B[2m"),italic:vr(3,23),underline:vr(4,24),inverse:vr(7,27),hidden:vr(8,28),strikethrough:vr(9,29),black:vr(30,39),red:vr(31,39),green:vr(32,39),yellow:vr(33,39),blue:vr(34,39),magenta:vr(35,39),cyan:vr(36,39),white:vr(37,39),gray:vr(90,39),bgBlack:vr(40,49),bgRed:vr(41,49),bgGreen:vr(42,49),bgYellow:vr(43,49),bgBlue:vr(44,49),bgMagenta:vr(45,49),bgCyan:vr(46,49),bgWhite:vr(47,49),blackBright:vr(90,39),redBright:vr(91,39),greenBright:vr(92,39),yellowBright:vr(93,39),blueBright:vr(94,39),magentaBright:vr(95,39),cyanBright:vr(96,39),whiteBright:vr(97,39),bgBlackBright:vr(100,49),bgRedBright:vr(101,49),bgGreenBright:vr(102,49),bgYellowBright:vr(103,49),bgBlueBright:vr(104,49),bgMagentaBright:vr(105,49),bgCyanBright:vr(106,49),bgWhiteBright:vr(107,49)},wr=({useColor:Xn=_r}={})=>Xn?Sr:Object.keys(Sr).reduce((ni,wi)=>({...ni,[wi]:String}),{}),{reset:br,bold:Ar,dim:kr,italic:Dr,underline:Or,inverse:zr,hidden:$n,strikethrough:Fr,black:$r,red:Hn,green:ti,yellow:Ir,blue:Lr,magenta:Kn,cyan:pi,white:gi,gray:oi,bgBlack:qn,bgRed:li,bgGreen:di,bgYellow:Jn,bgBlue:Qr,bgMagenta:Jr,bgCyan:ei,bgWhite:mi,blackBright:ci,redBright:ai,greenBright:fi,yellowBright:vi,blueBright:xi,magentaBright:Ci,cyanBright:Yn,whiteBright:ii,bgBlackBright:$i,bgRedBright:Ti,bgGreenBright:Qi,bgYellowBright:hi,bgBlueBright:hs,bgMagentaBright:Yi,bgCyanBright:ss,bgWhiteBright:Bi}=wr();return colorette.bgBlack=qn,colorette.bgBlackBright=$i,colorette.bgBlue=Qr,colorette.bgBlueBright=hs,colorette.bgCyan=ei,colorette.bgCyanBright=ss,colorette.bgGreen=di,colorette.bgGreenBright=Qi,colorette.bgMagenta=Jr,colorette.bgMagentaBright=Yi,colorette.bgRed=li,colorette.bgRedBright=Ti,colorette.bgWhite=mi,colorette.bgWhiteBright=Bi,colorette.bgYellow=Jn,colorette.bgYellowBright=hi,colorette.black=$r,colorette.blackBright=ci,colorette.blue=Lr,colorette.blueBright=xi,colorette.bold=Ar,colorette.createColors=wr,colorette.cyan=pi,colorette.cyanBright=Yn,colorette.dim=kr,colorette.gray=oi,colorette.green=ti,colorette.greenBright=fi,colorette.hidden=$n,colorette.inverse=zr,colorette.isColorSupported=_r,colorette.italic=Dr,colorette.magenta=Kn,colorette.magentaBright=Ci,colorette.red=Hn,colorette.redBright=ai,colorette.reset=br,colorette.strikethrough=Fr,colorette.underline=Or,colorette.white=gi,colorette.whiteBright=ii,colorette.yellow=Ir,colorette.yellowBright=vi,colorette}var logger$3,hasRequiredLogger;function requireLogger(){if(hasRequiredLogger)return logger$3;hasRequiredLogger=1;const e=requireColorette(),{inspect:t}=requireUtil(),{isString:I,isFunction:B}=requireIs();class tr{constructor(lr={}){const{log:{debug:dr,warn:hr,error:fr,deprecate:mr,inspectionDepth:_r,enableColors:yr}={}}=lr;this._inspectionDepth=_r||5,this._enableColors=rr(yr),this._debug=dr,this._warn=hr,this._error=fr,this._deprecate=mr}_log(lr,dr,hr){if(dr!=null&&!B(dr))throw new TypeError("Extensions to knex logger must be functions!");if(B(dr)){dr(lr);return}I(lr)||(lr=t(lr,{depth:this._inspectionDepth,colors:this._enableColors})),console.log(hr?hr(lr):lr)}debug(lr){this._log(lr,this._debug)}warn(lr){this._log(lr,this._warn,e.yellow)}error(lr){this._log(lr,this._error,e.red)}deprecate(lr,dr){const hr=`${lr} is deprecated, please use ${dr}`;this._log(hr,this._deprecate,e.yellow)}}function rr(ir){return ir??(process&&process.stdout?process.stdout.isTTY:!1)}return logger$3=tr,logger$3}var viewbuilder,hasRequiredViewbuilder;function requireViewbuilder(){if(hasRequiredViewbuilder)return viewbuilder;hasRequiredViewbuilder=1;const e=requireHelpers$1(),t=requireExtend(),I=requireAssign();class B{constructor(ir,lr,dr,hr){this.client=ir,this._method=lr,this._schemaName=void 0,this._columns=void 0,this._fn=hr,this._viewName=dr,this._statements=[],this._single={}}setSchema(ir){this._schemaName=ir}columns(ir){this._columns=ir}as(ir){this._selectQuery=ir}checkOption(){throw new Error("check option definition is not supported by this dialect.")}localCheckOption(){throw new Error("check option definition is not supported by this dialect.")}cascadedCheckOption(){throw new Error("check option definition is not supported by this dialect.")}toSQL(){return this._method==="alter"&&t(this,tr),this._fn.call(this,this),this.client.viewCompiler(this).toSQL()}}const tr={column(rr){const ir=this;return{rename:function(lr){return ir._statements.push({grouping:"alterView",method:"renameColumn",args:[rr,lr]}),this},defaultTo:function(lr){return ir._statements.push({grouping:"alterView",method:"defaultTo",args:[rr,lr]}),this}}}};return e.addQueryContext(B),B.extend=(rr,ir)=>{if(Object.prototype.hasOwnProperty.call(B.prototype,rr))throw new Error(`Can't extend ViewBuilder with existing method ('${rr}').`);I(B.prototype,{[rr]:ir})},viewbuilder=B,viewbuilder}var viewcompiler,hasRequiredViewcompiler;function requireViewcompiler(){if(hasRequiredViewcompiler)return viewcompiler;hasRequiredViewcompiler=1;const{pushQuery:e}=requireHelpers(),t=requireGroupBy(),{columnize:I}=requireWrappingFormatter();class B{constructor(rr,ir){this.client=rr,this.viewBuilder=ir,this._commonBuilder=this.viewBuilder,this.method=ir._method,this.schemaNameRaw=ir._schemaName,this.viewNameRaw=ir._viewName,this.single=ir._single,this.selectQuery=ir._selectQuery,this.columns=ir._columns,this.grouped=t(ir._statements,"grouping"),this.formatter=rr.formatter(ir),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[]}toSQL(){return this[this.method](),this.sequence}create(){this.createQuery(this.columns,this.selectQuery)}createOrReplace(){throw new Error("replace views is not supported by this dialect.")}createMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}createQuery(rr,ir,lr,dr){const hr="create "+(lr?"materialized ":"")+(dr?"or replace ":"")+"view ",fr=rr?" ("+I(rr,this.viewBuilder,this.client,this.bindingsHolder)+")":"";let mr=hr+this.viewName()+fr;switch(mr+=" as ",mr+=ir.toString(),this.single.checkOption){case"default_option":mr+=" with check option";break;case"local":mr+=" with local check option";break;case"cascaded":mr+=" with cascaded check option";break}this.pushQuery({sql:mr})}renameView(rr,ir){throw new Error("rename view is not supported by this dialect (instead drop, then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}alter(){this.alterView()}alterView(){const rr=this.grouped.alterView||[];for(let ir=0,lr=rr.length;ir<lr;ir++){const dr=rr[ir];this[dr.method]?this[dr.method].apply(this,dr.args):this.client.logger.error(`Debug: ${dr.method} does not exist`)}for(const ir in this.single)typeof this[ir]=="function"&&this[ir](this.single[ir])}renameColumn(rr,ir){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(rr,ir){throw new Error("change default values of views is not supported by this dialect.")}viewName(){const rr=this.schemaNameRaw?`${this.schemaNameRaw}.${this.viewNameRaw}`:this.viewNameRaw;return this.formatter.wrap(rr)}}return B.prototype.pushQuery=e,viewcompiler=B,viewcompiler}var client,hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;const{Pool:e,TimeoutError:t}=requireTarn(),{EventEmitter:I}=requireEvents(),{promisify:B}=requireUtil(),{makeEscape:tr}=requireString(),rr=requireCloneDeep(),ir=requireDefaults(),lr=requireUniqueId(),dr=requireRunner(),hr=requireTransaction$5(),{executeQuery:fr,enrichQueryObject:mr}=requireQueryExecutioner(),_r=requireQuerybuilder(),yr=requireQuerycompiler(),xr=requireBuilder(),Mr=requireCompiler$1(),vr=requireTablebuilder(),Sr=requireTablecompiler(),wr=requireColumnbuilder(),br=requireColumncompiler(),{KnexTimeoutError:Ar}=requireTimeout(),{outputQuery:kr,unwrapRaw:Dr}=requireWrappingFormatter(),{compileCallback:Or}=requireFormatterUtils(),zr=requireRaw(),$n=requireRef(),Fr=requireFormatter(),$r=requireLogger(),{POOL_CONFIG_OPTIONS:Hn}=requireConstants$1(),ti=requireViewbuilder(),Ir=requireViewcompiler(),Lr=requireIsPlainObject(),{setHiddenProperty:Kn}=requireSecurity(),pi=requireBrowser()("knex:client");class gi extends I{constructor(qn={}){if(super(),this.config=qn,this.logger=new $r(qn),this.config.connection&&this.config.connection.password&&Kn(this.config.connection),this.dialect&&!this.config.client&&this.logger.warn("Using 'this.dialect' to identify the client is deprecated and support for it will be removed in the future. Please use configuration option 'client' instead."),!(this.config.client||this.dialect))throw new Error("knex: Required configuration option 'client' is missing.");qn.version&&(this.version=qn.version),qn.connection&&qn.connection instanceof Function?(this.connectionConfigProvider=qn.connection,this.connectionConfigExpirationChecker=()=>!0):(this.connectionSettings=rr(qn.connection||{}),qn.connection&&qn.connection.password&&Kn(this.connectionSettings,qn.connection),this.connectionConfigExpirationChecker=null),this.driverName&&qn.connection&&(this.initializeDriver(),(!qn.pool||qn.pool&&qn.pool.max!==0)&&this.initializePool(qn)),this.valueForUndefined=this.raw("DEFAULT"),qn.useNullAsDefault&&(this.valueForUndefined=null)}formatter(qn){return new Fr(this,qn)}queryBuilder(){return new _r(this)}queryCompiler(qn,li){return new yr(this,qn,li)}schemaBuilder(){return new xr(this)}schemaCompiler(qn){return new Mr(this,qn)}tableBuilder(qn,li,di,Jn){return new vr(this,qn,li,di,Jn)}viewBuilder(qn,li,di){return new ti(this,qn,li,di)}tableCompiler(qn){return new Sr(this,qn)}viewCompiler(qn){return new Ir(this,qn)}columnBuilder(qn,li,di){return new wr(this,qn,li,di)}columnCompiler(qn,li){return new br(this,qn,li)}runner(qn){return new dr(this,qn)}transaction(qn,li,di){return new hr(this,qn,li,di)}raw(){return new zr(this).set(...arguments)}ref(){return new $n(this,...arguments)}query(qn,li){const di=mr(qn,li,this);return fr(qn,di,this)}stream(qn,li,di,Jn){const Qr=mr(qn,li,this);return this._stream(qn,Qr,di,Jn)}prepBindings(qn){return qn}positionBindings(qn){return qn}postProcessResponse(qn,li){return this.config.postProcessResponse?this.config.postProcessResponse(qn,li):qn}wrapIdentifier(qn,li){return this.customWrapIdentifier(qn,this.wrapIdentifierImpl,li)}customWrapIdentifier(qn,li,di){return this.config.wrapIdentifier?this.config.wrapIdentifier(qn,li,di):li(qn)}wrapIdentifierImpl(qn){return qn!=="*"?`"${qn.replace(/"/g,'""')}"`:"*"}initializeDriver(){try{this.driver=this._driver()}catch(qn){const li=`Knex: run
|
|
82
|
-
$ npm install ${this.driverName} --save`;throw this.logger.error(`${li}
|
|
83
|
-
${qn.message}
|
|
84
|
-
${qn.stack}`),new Error(`${li}
|
|
85
|
-
${qn.message}`)}}poolDefaults(){return{min:2,max:10,propagateCreateError:!0}}getPoolSettings(qn){qn=ir({},qn,this.poolDefaults()),Hn.forEach(Qr=>{Qr in qn&&this.logger.warn([`Pool config option "${Qr}" is no longer supported.`,"See https://github.com/Vincit/tarn.js for possible pool config options."].join(" "))});const li=6e4,di=[this.config.acquireConnectionTimeout,qn.acquireTimeoutMillis].filter(Qr=>Qr!==void 0);di.length||di.push(li),qn.acquireTimeoutMillis=Math.min(...di);const Jn=async()=>{if(!this.connectionConfigProvider||!this.connectionConfigExpirationChecker||!this.connectionConfigExpirationChecker())return;const Qr=await this.connectionConfigProvider();Qr.expirationChecker?(this.connectionConfigExpirationChecker=Qr.expirationChecker,delete Qr.expirationChecker):this.connectionConfigExpirationChecker=null,this.connectionSettings=Qr};return Object.assign(qn,{create:async()=>{await Jn();const Qr=await this.acquireRawConnection();return Qr.__knexUid=lr("__knexUid"),qn.afterCreate&&await B(qn.afterCreate)(Qr),Qr},destroy:Qr=>{if(Qr!==void 0)return this.destroyRawConnection(Qr)},validate:Qr=>Qr.__knex__disposed?(this.logger.warn(`Connection Error: ${Qr.__knex__disposed}`),!1):this.validateConnection(Qr)})}initializePool(qn=this.config){if(this.pool){this.logger.warn("The pool has already been initialized");return}const li={...this.getPoolSettings(qn.pool)};li.afterCreate&&delete li.afterCreate,this.pool=new e(li)}validateConnection(qn){return!0}async acquireConnection(){if(!this.pool)throw new Error("Unable to acquire a connection");try{const qn=await this.pool.acquire().promise;return pi("acquired connection from pool: %s",qn.__knexUid),qn.config&&(qn.config.password&&Kn(qn.config),qn.config.authentication&&qn.config.authentication.options&&qn.config.authentication.options.password&&Kn(qn.config.authentication.options)),qn}catch(qn){let li=qn;throw qn instanceof t&&(li=new Ar("Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?")),li}}releaseConnection(qn){return pi("releasing connection to pool: %s",qn.__knexUid),this.pool.release(qn)||pi("pool refused connection: %s",qn.__knexUid),Promise.resolve()}async destroy(qn){try{this.pool&&this.pool.destroy&&await this.pool.destroy(),this.pool=void 0,typeof qn=="function"&&qn()}catch(li){if(typeof qn=="function")return qn(li);throw li}}database(){return this.connectionSettings.database}toString(){return"[object KnexClient]"}assertCanCancelQuery(){if(!this.canCancelQuery)throw new Error("Query cancelling not supported for this dialect")}cancelQuery(){throw new Error("Query cancelling not supported for this dialect")}alias(qn,li){return qn+" as "+li}parameter(qn,li,di){return typeof qn=="function"?kr(Or(qn,void 0,this,di),!0,li,this):Dr(qn,!0,li,this,di)||"?"}parameterize(qn,li,di,Jn){if(typeof qn=="function")return this.parameter(qn,di,Jn);qn=Array.isArray(qn)?qn:[qn];let Qr="",Jr=-1;for(;++Jr<qn.length;){Jr>0&&(Qr+=", ");let ei=qn[Jr];Lr(ei)&&(ei=JSON.stringify(ei)),Qr+=this.parameter(ei===void 0?li:ei,di,Jn)}return Qr}values(qn,li,di){return Array.isArray(qn)?Array.isArray(qn[0])?`(${qn.map(Jn=>`(${this.parameterize(Jn,void 0,li,di)})`).join(", ")})`:`(${this.parameterize(qn,void 0,li,di)})`:qn&&qn.isRawInstance?`(${this.parameter(qn,li,di)})`:this.parameter(qn,li,di)}processPassedConnection(qn){}toPathForJson(qn){return qn}}return Object.assign(gi.prototype,{_escapeBinding:tr({escapeString(oi){return`'${oi.replace(/'/g,"''")}'`}}),canCancelQuery:!1}),client=gi,client}var pgConnectionString,hasRequiredPgConnectionString;function requirePgConnectionString(){if(hasRequiredPgConnectionString)return pgConnectionString;hasRequiredPgConnectionString=1;function e(t){if(t.charAt(0)==="/"){const dr=t.split(" ");return{host:dr[0],database:dr[1]}}const I={};let B,tr=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/\%25(\d\d)/g,"%$1"));try{B=new URL(t,"postgres://base")}catch{B=new URL(t.replace("@/","@___DUMMY___/"),"postgres://base"),tr=!0}for(const dr of B.searchParams.entries())I[dr[0]]=dr[1];if(I.user=I.user||decodeURIComponent(B.username),I.password=I.password||decodeURIComponent(B.password),B.protocol=="socket:")return I.host=decodeURI(B.pathname),I.database=B.searchParams.get("db"),I.client_encoding=B.searchParams.get("encoding"),I;const rr=tr?"":B.hostname;I.host?rr&&/^%2f/i.test(rr)&&(B.pathname=rr+B.pathname):I.host=decodeURIComponent(rr),I.port||(I.port=B.port);const ir=B.pathname.slice(1)||null;I.database=ir?decodeURI(ir):null,(I.ssl==="true"||I.ssl==="1")&&(I.ssl=!0),I.ssl==="0"&&(I.ssl=!1),(I.sslcert||I.sslkey||I.sslrootcert||I.sslmode)&&(I.ssl={});const lr=I.sslcert||I.sslkey||I.sslrootcert?require$$1:null;switch(I.sslcert&&(I.ssl.cert=lr.readFileSync(I.sslcert).toString()),I.sslkey&&(I.ssl.key=lr.readFileSync(I.sslkey).toString()),I.sslrootcert&&(I.ssl.ca=lr.readFileSync(I.sslrootcert).toString()),I.sslmode){case"disable":{I.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{I.ssl.rejectUnauthorized=!1;break}}return I}return pgConnectionString=e,e.parse=e,pgConnectionString}var parseConnection,hasRequiredParseConnection;function requireParseConnection(){if(hasRequiredParseConnection)return parseConnection;hasRequiredParseConnection=1;const{parse:e}=requirePgConnectionString(),t=e,I=process&&process.platform&&process.platform==="win32";function B(rr){try{return new URL(rr)}catch{return null}}parseConnection=function(ir){const lr=B(ir),dr=I&&lr&&lr.protocol.length===2;if(!lr||dr)return{client:"sqlite3",connection:{filename:ir}};let{protocol:hr}=lr;hr.slice(-1)===":"&&(hr=hr.slice(0,-1));const fr=["postgresql","postgres"].includes(hr);return{client:hr,connection:fr?t(ir):tr(lr)}};function tr(rr){const ir={};let lr=rr.pathname;if(lr[0]==="/"&&(lr=lr.slice(1)),ir.database=lr,rr.hostname&&(rr.protocol.indexOf("mssql")===0?ir.server=rr.hostname:ir.host=rr.hostname),rr.port&&(ir.port=rr.port),(rr.username||rr.password)&&(ir.user=decodeURIComponent(rr.username)),rr.password&&(ir.password=decodeURIComponent(rr.password)),rr.searchParams)for(const[dr,hr]of rr.searchParams.entries())if(["mysql:","mariadb:","mssql:"].includes(rr.protocol))try{ir[dr]=JSON.parse(hr)}catch{ir[dr]=hr}else ir[dr]=hr;return ir}return parseConnection}var dialects={},sqliteTransaction,hasRequiredSqliteTransaction;function requireSqliteTransaction(){if(hasRequiredSqliteTransaction)return sqliteTransaction;hasRequiredSqliteTransaction=1;const e=requireTransaction$5();class t extends e{begin(B){return this.isolationLevel&&this.client.logger.warn("sqlite3 only supports serializable transactions, ignoring the isolation level param"),this.readOnly&&this.client.logger.warn("sqlite3 implicitly handles read vs write transactions"),this.query(B,"BEGIN;")}}return sqliteTransaction=t,sqliteTransaction}var sqliteQuerycompiler,hasRequiredSqliteQuerycompiler;function requireSqliteQuerycompiler(){if(hasRequiredSqliteQuerycompiler)return sqliteQuerycompiler;hasRequiredSqliteQuerycompiler=1;const e=requireConstant(),t=requireEach(),I=requireIdentity(),B=requireIsEmpty(),tr=requireReduce(),rr=requireQuerycompiler(),ir=requireNoop$1(),{isString:lr}=requireIs(),{wrapString:dr,columnize:hr}=requireWrappingFormatter(),fr=e("");class mr extends rr{constructor(yr,xr,Mr){super(yr,xr,Mr),this.forShare=fr,this.forKeyShare=fr,this.forUpdate=fr,this.forNoKeyUpdate=fr}insert(){const yr=this.single.insert||[];let xr=this.with()+`insert into ${this.tableName} `;if(Array.isArray(yr)){if(yr.length===0)return"";if(yr.length===1&&yr[0]&&B(yr[0]))return{sql:xr+this._emptyInsertValue}}else if(typeof yr=="object"&&B(yr))return{sql:xr+this._emptyInsertValue};const Mr=this._prepInsert(yr);if(lr(Mr))return{sql:xr+Mr};if(Mr.columns.length===0)return{sql:""};if(xr+=`(${this.formatter.columnize(Mr.columns)})`,this.client.valueForUndefined!==null&&Mr.values.forEach(Dr=>{t(Dr,Or=>{if(Or===void 0)throw new TypeError("`sqlite` does not support inserting default values. Specify values explicitly or use the `useNullAsDefault` config flag. (see docs https://knexjs.org/guide/query-builder.html#insert).")})}),Mr.values.length===1){const Dr=this.client.parameterize(Mr.values[0],this.client.valueForUndefined,this.builder,this.bindingsHolder);xr+=` values (${Dr})`;const{onConflict:Or,ignore:zr,merge:$n}=this.single;if(Or&&zr)xr+=this._ignore(Or);else if(Or&&$n){xr+=this._merge($n.updates,Or,yr);const $r=this.where();$r&&(xr+=` ${$r}`)}const{returning:Fr}=this.single;return Fr&&(xr+=this._returning(Fr)),{sql:xr,returning:Fr}}const vr=[];let Sr=-1;for(;++Sr<Mr.values.length;){let Dr=-1;const Or=vr[Sr]=[];let zr=Mr.values[Sr];for(zr=zr===void 0?this.client.valueForUndefined:zr;++Dr<Mr.columns.length;)Or.push(this.client.alias(this.client.parameter(zr[Dr],this.builder,this.bindingsHolder),this.formatter.wrap(Mr.columns[Dr])));vr[Sr]=Or.join(", ")}xr+=" select "+vr.join(" union all select ");const{onConflict:wr,ignore:br,merge:Ar}=this.single;wr&&br?xr+=" where true"+this._ignore(wr):wr&&Ar&&(xr+=" where true"+this._merge(Ar.updates,wr,yr));const{returning:kr}=this.single;return kr&&(xr+=this._returning(kr)),{sql:xr,returning:kr}}update(){const yr=this.with(),xr=this._prepUpdate(this.single.update),Mr=this.where(),{returning:vr}=this.single;return{sql:yr+`update ${this.single.only?"only ":""}${this.tableName} set ${xr.join(", ")}`+(Mr?` ${Mr}`:"")+this._returning(vr),returning:vr}}_ignore(yr){return yr===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(yr)} do nothing`}_merge(yr,xr,Mr){let vr=` on conflict ${this._onConflictClause(xr)} do update set `;if(yr&&Array.isArray(yr))return vr+=yr.map(Sr=>dr(Sr.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(Sr=>`${Sr} = excluded.${Sr}`).join(", "),vr;if(yr&&typeof yr=="object"){const Sr=this._prepUpdate(yr);return typeof Sr=="string"?vr+=Sr:vr+=Sr.join(","),vr}else{const Sr=this._prepInsert(Mr);if(typeof Sr=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return vr+=Sr.columns.map(wr=>dr(wr.split(".").pop(),this.builder,this.client)).map(wr=>`${wr} = excluded.${wr}`).join(", "),vr}}_returning(yr){return yr?` returning ${this.formatter.columnize(yr)}`:""}truncate(){const{table:yr}=this.single;return{sql:`delete from ${this.tableName}`,output(){return this.query({sql:`delete from sqlite_sequence where name = '${yr}'`}).catch(ir)}}}columnInfo(){const yr=this.single.columnInfo;return{sql:`PRAGMA table_info(\`${this.client.customWrapIdentifier(this.single.table,I)}\`)`,output(Mr){const vr=/.*\((\d+)\)/,Sr=tr(Mr,function(wr,br){let{type:Ar}=br,kr=Ar.match(vr);return kr&&(kr=kr[1]),Ar=kr?Ar.split("(")[0]:Ar,wr[br.name]={type:Ar.toLowerCase(),maxLength:kr,nullable:!br.notnull,defaultValue:br.dflt_value},wr},{});return yr&&Sr[yr]||Sr}}}limit(){const yr=!this.single.limit&&this.single.limit!==0;return yr&&!this.single.offset?"":(this.single.limit=yr?-1:this.single.limit,`limit ${this._getValueOrParameterFromAttribute("limit")}`)}jsonExtract(yr){return this._jsonExtract("json_extract",yr)}jsonSet(yr){return this._jsonSet("json_set",yr)}jsonInsert(yr){return this._jsonSet("json_insert",yr)}jsonRemove(yr){const xr=`json_remove(${hr(yr.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(yr.path,this.builder,this.bindingsHolder)})`;return yr.alias?this.client.alias(xr,this.formatter.wrap(yr.alias)):xr}whereJsonPath(yr){return this._whereJsonPath("json_extract",yr)}whereJsonSupersetOf(yr){throw new Error("Json superset where clause not actually supported by SQLite")}whereJsonSubsetOf(yr){throw new Error("Json subset where clause not actually supported by SQLite")}onJsonPathEquals(yr){return this._onJsonPathEquals("json_extract",yr)}}return sqliteQuerycompiler=mr,sqliteQuerycompiler}var _baseSome,hasRequired_baseSome;function require_baseSome(){if(hasRequired_baseSome)return _baseSome;hasRequired_baseSome=1;var e=require_baseEach();function t(I,B){var tr;return e(I,function(rr,ir,lr){return tr=B(rr,ir,lr),!tr}),!!tr}return _baseSome=t,_baseSome}var some_1,hasRequiredSome;function requireSome(){if(hasRequiredSome)return some_1;hasRequiredSome=1;var e=require_arraySome(),t=require_baseIteratee(),I=require_baseSome(),B=requireIsArray(),tr=require_isIterateeCall();function rr(ir,lr,dr){var hr=B(ir)?e:I;return dr&&tr(ir,lr,dr)&&(lr=void 0),hr(ir,t(lr,3))}return some_1=rr,some_1}var sqliteCompiler,hasRequiredSqliteCompiler;function requireSqliteCompiler(){if(hasRequiredSqliteCompiler)return sqliteCompiler;hasRequiredSqliteCompiler=1;const e=requireCompiler$1(),t=requireSome();class I extends e{constructor(tr,rr){super(tr,rr)}hasTable(tr){const rr=`select * from sqlite_master where type = 'table' and name = ${this.client.parameter(this.formatter.wrap(tr).replace(/`/g,""),this.builder,this.bindingsHolder)}`;this.pushQuery({sql:rr,output:ir=>ir.length>0})}hasColumn(tr,rr){this.pushQuery({sql:`PRAGMA table_info(${this.formatter.wrap(tr)})`,output(ir){return t(ir,lr=>this.client.wrapIdentifier(lr.name.toLowerCase())===this.client.wrapIdentifier(rr.toLowerCase()))}})}renameTable(tr,rr){this.pushQuery(`alter table ${this.formatter.wrap(tr)} rename to ${this.formatter.wrap(rr)}`)}async generateDdlCommands(){const tr=this.builder._sequence;for(let ir=0,lr=tr.length;ir<lr;ir++){const dr=tr[ir];this[dr.method].apply(this,dr.args)}const rr=this.sequence;if(rr.length===1&&rr[0].statementsProducer)return rr[0].statementsProducer();{const ir=[];for(const lr of rr){const dr=lr.sql;Array.isArray(dr)?ir.push(...dr):ir.push(dr)}return{pre:[],sql:ir,check:null,post:[]}}}}return sqliteCompiler=I,sqliteCompiler}var sqliteColumncompiler,hasRequiredSqliteColumncompiler;function requireSqliteColumncompiler(){if(hasRequiredSqliteColumncompiler)return sqliteColumncompiler;hasRequiredSqliteColumncompiler=1;const e=requireColumncompiler();class t extends e{constructor(){super(...arguments),this.modifiers=["nullable","defaultTo"],this._addCheckModifiers()}enu(B){return`text check (${this.formatter.wrap(this.args[0])} in ('${B.join("', '")}'))`}_pushAlterCheckQuery(B,tr){throw new Error("Alter table with to add constraints is not permitted in SQLite")}checkRegex(B,tr){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(B)}`,tr)}}return t.prototype.json="json",t.prototype.jsonb="json",t.prototype.double=t.prototype.decimal=t.prototype.floating="float",t.prototype.timestamp="datetime",t.prototype.increments=t.prototype.bigincrements="integer not null primary key autoincrement",sqliteColumncompiler=t,sqliteColumncompiler}var filter_1,hasRequiredFilter;function requireFilter(){if(hasRequiredFilter)return filter_1;hasRequiredFilter=1;var e=require_arrayFilter(),t=require_baseFilter(),I=require_baseIteratee(),B=requireIsArray();function tr(rr,ir){var lr=B(rr)?e:t;return lr(rr,I(ir,3))}return filter_1=tr,filter_1}var sqliteTablecompiler,hasRequiredSqliteTablecompiler;function requireSqliteTablecompiler(){if(hasRequiredSqliteTablecompiler)return sqliteTablecompiler;hasRequiredSqliteTablecompiler=1;const e=requireFilter(),t=requireValues(),I=requireIdentity(),{isObject:B}=requireIs(),tr=requireTablecompiler(),{formatDefault:rr}=requireFormatterUtils();class ir extends tr{constructor(){super(...arguments)}createQuery(dr,hr,fr){let _r=(hr?"create table if not exists ":"create table ")+this.tableName();fr&&this.tableNameLike()?_r+=" as select * from "+this.tableNameLike()+" where 0=1":(_r+=" ("+dr.sql.join(", "),_r+=this.foreignKeys()||"",_r+=this.primaryKeys()||"",_r+=this._addChecks(),_r+=")"),this.pushQuery(_r),fr&&this.addColumns(dr,this.addColumnsPrefix)}addColumns(dr,hr,fr){if(hr===this.alterColumnsPrefix){const mr=this,_r=fr.map(yr=>{const xr=this.client.customWrapIdentifier(yr.getColumnName(),I,yr.columnBuilder.queryContext()),Mr=yr.getColumnType(),vr=yr.modified.defaultTo?rr(yr.modified.defaultTo[0],yr.type,this.client):null,Sr=yr.modified.nullable&&yr.modified.nullable[0]===!1;return{name:xr,type:Mr,defaultTo:vr,notNull:Sr}});this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(yr,xr){return mr.client.ddl(mr,yr,xr).alterColumn(_r)}})}else for(let mr=0,_r=dr.sql.length;mr<_r;mr++)this.pushQuery({sql:`alter table ${this.tableName()} add column ${dr.sql[mr]}`,bindings:dr.bindings[mr]})}dropUnique(dr,hr){hr=hr?this.formatter.wrap(hr):this._indexCommand("unique",this.tableNameRaw,dr),this.pushQuery(`drop index ${hr}`)}dropForeign(dr,hr){const fr=this;dr=Array.isArray(dr)?dr:[dr],dr=dr.map(mr=>this.client.customWrapIdentifier(mr,I)),hr=this.client.customWrapIdentifier(hr,I),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(mr){return fr.client.ddl(fr,mr,this.connection).dropForeign(dr,hr)}})}dropPrimary(dr){const hr=this;dr=this.client.customWrapIdentifier(dr,I),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(fr){return hr.client.ddl(hr,fr,this.connection).dropPrimary(dr)}})}dropIndex(dr,hr){hr=hr?this.formatter.wrap(hr):this._indexCommand("index",this.tableNameRaw,dr),this.pushQuery(`drop index ${hr}`)}unique(dr,hr){let fr,mr;B(hr)&&({indexName:hr,deferrable:fr,predicate:mr}=hr),fr&&fr!=="not deferrable"&&this.client.logger.warn(`sqlite3: unique index \`${hr}\` will not be deferrable ${fr} because sqlite3 does not support deferred constraints.`),hr=hr?this.formatter.wrap(hr):this._indexCommand("unique",this.tableNameRaw,dr),dr=this.formatter.columnize(dr);const _r=mr?" "+this.client.queryCompiler(mr).where():"";this.pushQuery(`create unique index ${hr} on ${this.tableName()} (${dr})${_r}`)}index(dr,hr,fr){hr=hr?this.formatter.wrap(hr):this._indexCommand("index",this.tableNameRaw,dr),dr=this.formatter.columnize(dr);let mr;B(fr)&&({predicate:mr}=fr);const _r=mr?" "+this.client.queryCompiler(mr).where():"";this.pushQuery(`create index ${hr} on ${this.tableName()} (${dr})${_r}`)}primary(dr,hr){const fr=this;dr=Array.isArray(dr)?dr:[dr],dr=dr.map(_r=>this.client.customWrapIdentifier(_r,I));let mr;B(hr)&&({constraintName:hr,deferrable:mr}=hr),mr&&mr!=="not deferrable"&&this.client.logger.warn(`sqlite3: primary key constraint \`${hr}\` will not be deferrable ${mr} because sqlite3 does not support deferred constraints.`),hr=this.client.customWrapIdentifier(hr,I),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(_r){return fr.client.ddl(fr,_r,this.connection).primary(dr,hr)}})}foreign(dr){const hr=this;this.method!=="create"&&this.method!=="createIfNot"&&(dr.column=Array.isArray(dr.column)?dr.column:[dr.column],dr.column=dr.column.map(fr=>this.client.customWrapIdentifier(fr,I)),dr.inTable=this.client.customWrapIdentifier(dr.inTable,I),dr.references=Array.isArray(dr.references)?dr.references:[dr.references],dr.references=dr.references.map(fr=>this.client.customWrapIdentifier(fr,I)),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(fr,mr){return hr.client.ddl(hr,fr,mr).foreign(dr)}}))}primaryKeys(){const dr=e(this.grouped.alterTable||[],{method:"primary"});if(dr.length>0&&dr[0].args.length>0){const hr=dr[0].args[0];let fr=dr[0].args[1]||"";fr&&(fr=" constraint "+this.formatter.wrap(fr));const mr=this.grouped.columns.filter(_r=>_r.builder._type==="increments").length>0;return`,${fr} ${mr?"unique":"primary key"} (${this.formatter.columnize(hr)})`}}foreignKeys(){let dr="";const hr=e(this.grouped.alterTable||[],{method:"foreign"});for(let fr=0,mr=hr.length;fr<mr;fr++){const _r=hr[fr].args[0],yr=this.formatter.columnize(_r.column),xr=this.formatter.columnize(_r.references),Mr=this.formatter.wrap(_r.inTable);let vr=_r.keyName||"";vr&&(vr=" constraint "+this.formatter.wrap(vr)),dr+=`,${vr} foreign key(${yr}) references ${Mr}(${xr})`,_r.onDelete&&(dr+=` on delete ${_r.onDelete}`),_r.onUpdate&&(dr+=` on update ${_r.onUpdate}`)}return dr}createTableBlock(){return this.getColumns().concat().join(",")}renameColumn(dr,hr){this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(dr)} to ${this.formatter.wrap(hr)}`})}_setNullableState(dr,hr){const fr=this;this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(mr,_r){return fr.client.ddl(fr,mr,_r).setNullable(dr,hr)}})}dropColumn(){const dr=this,fr=t(arguments).map(mr=>this.client.customWrapIdentifier(mr,I));this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(mr){return dr.client.ddl(dr,mr,this.connection).dropColumn(fr)}})}}return sqliteTablecompiler=ir,sqliteTablecompiler}var sqliteViewcompiler,hasRequiredSqliteViewcompiler;function requireSqliteViewcompiler(){if(hasRequiredSqliteViewcompiler)return sqliteViewcompiler;hasRequiredSqliteViewcompiler=1;const e=requireViewcompiler(),{columnize:t}=requireWrappingFormatter();class I extends e{constructor(tr,rr){super(tr,rr)}createOrReplace(){const tr=this.columns,rr=this.selectQuery.toString(),ir=this.viewName(),lr=tr?" ("+t(tr,this.viewBuilder,this.client,this.bindingsHolder)+")":"",dr=`drop view if exists ${ir}`,hr=`create view ${ir}${lr} as ${rr}`;this.pushQuery({sql:dr}),this.pushQuery({sql:hr})}}return sqliteViewcompiler=I,sqliteViewcompiler}var sqliteDdlOperations,hasRequiredSqliteDdlOperations;function requireSqliteDdlOperations(){if(hasRequiredSqliteDdlOperations)return sqliteDdlOperations;hasRequiredSqliteDdlOperations=1;function e(lr,dr,hr){return`INSERT INTO "${dr}" SELECT ${hr===void 0?"*":hr.map(fr=>`"${fr}"`).join(", ")} FROM "${lr}";`}function t(lr){return`DROP TABLE "${lr}"`}function I(lr,dr){return`ALTER TABLE "${lr}" RENAME TO "${dr}"`}function B(lr){return`SELECT type, sql FROM sqlite_master WHERE (type='table' OR (type='index' AND sql IS NOT NULL)) AND lower(tbl_name)='${lr.toLowerCase()}'`}function tr(){return"PRAGMA foreign_keys"}function rr(lr){return`PRAGMA foreign_keys = ${lr?"ON":"OFF"}`}function ir(){return"PRAGMA foreign_key_check"}return sqliteDdlOperations={copyData:e,dropOriginal:t,renameTable:I,getTableSql:B,isForeignCheckEnabled:tr,setForeignCheck:rr,executeForeignCheck:ir},sqliteDdlOperations}var tokenizer,hasRequiredTokenizer;function requireTokenizer(){if(hasRequiredTokenizer)return tokenizer;hasRequiredTokenizer=1;function e(t,I){const B=new RegExp(Object.entries(I).map(([ir,lr])=>`(?<${ir}>${lr.source})`).join("|"),"yi");let tr=0;const rr=[];for(;tr<t.length;){B.lastIndex=tr;const ir=t.match(B);if(ir!==null){const[lr,dr]=Object.entries(ir.groups).find(([hr,fr])=>fr!==void 0);tr+=dr.length,lr.startsWith("_")||rr.push({type:lr,text:dr})}else throw new Error(`No matching tokenizer rule found at: [${t.substring(tr)}]`)}return rr}return tokenizer={tokenize:e},tokenizer}var parserCombinator,hasRequiredParserCombinator;function requireParserCombinator(){if(hasRequiredParserCombinator)return parserCombinator;hasRequiredParserCombinator=1;function e(hr,fr=mr=>mr){return function({index:mr=0,input:_r}){let yr=mr;const xr=[];for(const Mr of hr){const vr=Mr({index:yr,input:_r});if(vr.success)yr=vr.index,xr.push(vr.ast);else return vr}return{success:!0,ast:fr(xr),index:yr,input:_r}}}function t(hr,fr=mr=>mr){return function({index:mr=0,input:_r}){for(const yr of hr){const xr=yr({index:mr,input:_r});if(xr.success)return{success:!0,ast:fr(xr.ast),index:xr.index,input:_r}}return{success:!1,ast:null,index:mr,input:_r}}}function I(hr,fr=mr=>mr){return function({index:mr=0,input:_r}){let yr={},xr=mr;const Mr=[];do yr=hr({index:xr,input:_r}),yr.success&&(xr=yr.index,Mr.push(yr.ast));while(yr.success);return Mr.length>0?{success:!0,ast:fr(Mr),index:xr,input:_r}:{success:!1,ast:null,index:xr,input:_r}}}function B(hr,fr=mr=>mr){return function({index:mr=0,input:_r}){const yr=hr({index:mr,input:_r});return yr.success?{success:!0,ast:fr(yr.ast),index:yr.index,input:_r}:{success:!0,ast:fr(null),index:mr,input:_r}}}function tr(hr,fr=mr=>mr){return function({index:mr=0,input:_r}){const yr=hr.do({index:mr,input:_r});return yr.success&&hr.next({index:yr.index,input:_r}).success?{success:!0,ast:fr(yr.ast),index:yr.index,input:_r}:{success:!1,ast:null,index:mr,input:_r}}}function rr(hr,fr=mr=>mr){return function({index:mr=0,input:_r}){const yr=hr.do({index:mr,input:_r});return yr.success&&!hr.not({index:mr,input:_r}).success?{success:!0,ast:fr(yr.ast),index:yr.index,input:_r}:{success:!1,ast:null,index:mr,input:_r}}}function ir(hr,fr=mr=>mr.text){return function({index:mr=0,input:_r}){const yr=_r[mr];return yr!==void 0&&(hr.type===void 0||hr.type===yr.type)&&(hr.text===void 0||hr.text.toUpperCase()===yr.text.toUpperCase())?{success:!0,ast:fr(yr),index:mr+1,input:_r}:{success:!1,ast:null,index:mr,input:_r}}}return parserCombinator={s:e,a:t,m:I,o:B,l:tr,n:rr,t:ir,e:function({index:hr=0,input:fr}){return{success:!0,ast:null,index:hr,input:fr}},f:function({index:hr=0,input:fr}){return{success:hr===fr.length,ast:null,index:hr,input:fr}}},parserCombinator}var parser,hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser;hasRequiredParser=1;const{tokenize:e}=requireTokenizer(),{s:t,a:I,m:B,o:tr,l:rr,n:ir,t:lr,e:dr,f:hr}=requireParserCombinator(),fr={keyword:/(?:ABORT|ACTION|ADD|AFTER|ALL|ALTER|ALWAYS|ANALYZE|AND|AS|ASC|ATTACH|AUTOINCREMENT|BEFORE|BEGIN|BETWEEN|BY|CASCADE|CASE|CAST|CHECK|COLLATE|COLUMN|COMMIT|CONFLICT|CONSTRAINT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|DATABASE|DEFAULT|DEFERRED|DEFERRABLE|DELETE|DESC|DETACH|DISTINCT|DO|DROP|END|EACH|ELSE|ESCAPE|EXCEPT|EXCLUSIVE|EXCLUDE|EXISTS|EXPLAIN|FAIL|FILTER|FIRST|FOLLOWING|FOR|FOREIGN|FROM|FULL|GENERATED|GLOB|GROUP|GROUPS|HAVING|IF|IGNORE|IMMEDIATE|IN|INDEX|INDEXED|INITIALLY|INNER|INSERT|INSTEAD|INTERSECT|INTO|IS|ISNULL|JOIN|KEY|LAST|LEFT|LIKE|LIMIT|MATCH|MATERIALIZED|NATURAL|NO|NOT|NOTHING|NOTNULL|NULL|NULLS|OF|OFFSET|ON|OR|ORDER|OTHERS|OUTER|OVER|PARTITION|PLAN|PRAGMA|PRECEDING|PRIMARY|QUERY|RAISE|RANGE|RECURSIVE|REFERENCES|REGEXP|REINDEX|RELEASE|RENAME|REPLACE|RESTRICT|RETURNING|RIGHT|ROLLBACK|ROW|ROWS|SAVEPOINT|SELECT|SET|TABLE|TEMP|TEMPORARY|THEN|TIES|TO|TRANSACTION|TRIGGER|UNBOUNDED|UNION|UNIQUE|UPDATE|USING|VACUUM|VALUES|VIEW|VIRTUAL|WHEN|WHERE|WINDOW|WITH|WITHOUT)(?=\s+|-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\.)/,id:/"[^"]*(?:""[^"]*)*"|`[^`]*(?:``[^`]*)*`|\[[^[\]]*\]|[a-z_][a-z0-9_$]*/,string:/'[^']*(?:''[^']*)*'/,blob:/x'(?:[0-9a-f][0-9a-f])+'/,numeric:/(?:\d+(?:\.\d*)?|\.\d+)(?:e(?:\+|-)?\d+)?|0x[0-9a-f]+/,variable:/\?\d*|[@$:][a-z0-9_$]+/,operator:/-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\./,_ws:/\s+/};function mr(ri){const Gr=yr({input:e(ri,fr)});if(!Gr.success)throw new Error(`Parsing CREATE TABLE failed at [${Gr.input.slice(Gr.index).map(Si=>Si.text).join(" ")}] of "${ri}"`);return Gr.ast}function _r(ri){const Gr=fi({input:e(ri,fr)});if(!Gr.success)throw new Error(`Parsing CREATE INDEX failed at [${Gr.input.slice(Gr.index).map(Si=>Si.text).join(" ")}] of "${ri}"`);return Gr.ast}function yr(ri){return t([lr({text:"CREATE"},Gr=>null),xr,lr({text:"TABLE"},Gr=>null),xi,Ci,ii,lr({text:"("},Gr=>null),vr,Lr,lr({text:")"},Gr=>null),Mr,hr],Gr=>Object.assign({},...Gr.filter(Si=>Si!==null)))(ri)}function xr(ri){return I([lr({text:"TEMP"}),lr({text:"TEMPORARY"}),dr],Gr=>({temporary:Gr!==null}))(ri)}function Mr(ri){return tr(t([lr({text:"WITHOUT"}),lr({text:"ROWID"})]),Gr=>({rowid:Gr!==null}))(ri)}function vr(ri){return I([t([Sr,lr({text:","}),vr],Gr=>({columns:[Gr[0]].concat(Gr[2].columns)})),t([Sr],Gr=>({columns:[Gr[0]]}))])(ri)}function Sr(ri){return t([t([Xn],Gr=>({name:Gr[0]})),wr,br],Gr=>Object.assign({},...Gr))(ri)}function wr(ri){return tr(t([B(lr({type:"id"})),I([t([lr({text:"("}),Mi,lr({text:","}),Mi,lr({text:")"})],Gr=>`(${Gr[1]}, ${Gr[3]})`),t([lr({text:"("}),Mi,lr({text:")"})],Gr=>`(${Gr[1]})`),dr])],Gr=>`${Gr[0].join(" ")}${Gr[1]||""}`),Gr=>({type:Gr}))(ri)}function br(ri){return tr(B(Ar),Gr=>({constraints:Object.assign({primary:null,notnull:null,null:null,unique:null,check:null,default:null,collate:null,references:null,as:null},...Gr||[])}))(ri)}function Ar(ri){return I([kr,Or,zr,$n,Fr,$r,Hn,ti,Ir])(ri)}function kr(ri){return t([ai,lr({text:"PRIMARY"},Gr=>null),lr({text:"KEY"},Gr=>null),Yi,oi,Dr],Gr=>({primary:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function Dr(ri){return tr(lr({text:"AUTOINCREMENT"}),Gr=>({autoincrement:Gr!==null}))(ri)}function Or(ri){return t([ai,lr({text:"NOT"},Gr=>null),lr({text:"NULL"},Gr=>null),oi],Gr=>({notnull:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function zr(ri){return t([ai,lr({text:"NULL"},Gr=>null),oi],Gr=>({null:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function $n(ri){return t([ai,lr({text:"UNIQUE"},Gr=>null),oi],Gr=>({unique:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function Fr(ri){return t([ai,lr({text:"CHECK"},Gr=>null),lr({text:"("},Gr=>null),t([Bi],Gr=>({expression:Gr[0]})),lr({text:")"},Gr=>null)],Gr=>({check:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function $r(ri){return t([ai,lr({text:"DEFAULT"},Gr=>null),I([t([lr({text:"("}),Bi,lr({text:")"})],Gr=>({value:Gr[1],expression:!0})),t([wi],Gr=>({value:Gr[0],expression:!1})),t([Mi],Gr=>({value:Gr[0],expression:!1}))])],Gr=>({default:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function Hn(ri){return t([ai,lr({text:"COLLATE"},Gr=>null),lr({type:"id"},Gr=>({collation:Gr.text}))],Gr=>({collate:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function ti(ri){return t([ai,t([di],Gr=>Gr[0].references)],Gr=>({references:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function Ir(ri){return t([ai,tr(t([lr({text:"GENERATED"}),lr({text:"ALWAYS"})]),Gr=>({generated:Gr!==null})),lr({text:"AS"},Gr=>null),lr({text:"("},Gr=>null),t([Bi],Gr=>({expression:Gr[0]})),lr({text:")"},Gr=>null),I([lr({text:"STORED"}),lr({text:"VIRTUAL"}),dr],Gr=>({mode:Gr?Gr.toUpperCase():null}))],Gr=>({as:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function Lr(ri){return tr(B(t([lr({text:","}),Kn],Gr=>Gr[1])),Gr=>({constraints:Gr||[]}))(ri)}function Kn(ri){return I([pi,gi,qn,li])(ri)}function pi(ri){return t([ai,lr({text:"PRIMARY"},Gr=>null),lr({text:"KEY"},Gr=>null),lr({text:"("},Gr=>null),Ti,lr({text:")"},Gr=>null),oi],Gr=>Object.assign({type:"PRIMARY KEY"},...Gr.filter(Si=>Si!==null)))(ri)}function gi(ri){return t([ai,lr({text:"UNIQUE"},Gr=>null),lr({text:"("},Gr=>null),Ti,lr({text:")"},Gr=>null),oi],Gr=>Object.assign({type:"UNIQUE"},...Gr.filter(Si=>Si!==null)))(ri)}function oi(ri){return tr(t([lr({text:"ON"}),lr({text:"CONFLICT"}),I([lr({text:"ROLLBACK"}),lr({text:"ABORT"}),lr({text:"FAIL"}),lr({text:"IGNORE"}),lr({text:"REPLACE"})])],Gr=>Gr[2]),Gr=>({conflict:Gr?Gr.toUpperCase():null}))(ri)}function qn(ri){return t([ai,lr({text:"CHECK"},Gr=>null),lr({text:"("},Gr=>null),t([Bi],Gr=>({expression:Gr[0]})),lr({text:")"},Gr=>null)],Gr=>Object.assign({type:"CHECK"},...Gr.filter(Si=>Si!==null)))(ri)}function li(ri){return t([ai,lr({text:"FOREIGN"},Gr=>null),lr({text:"KEY"},Gr=>null),lr({text:"("},Gr=>null),Qr,lr({text:")"},Gr=>null),di],Gr=>Object.assign({type:"FOREIGN KEY"},...Gr.filter(Si=>Si!==null)))(ri)}function di(ri){return t([lr({text:"REFERENCES"},Gr=>null),ii,Jn,tr(B(I([Jr,ei,mi])),Gr=>Object.assign({delete:null,update:null,match:null},...Gr||[])),ci],Gr=>({references:Object.assign({},...Gr.filter(Si=>Si!==null))}))(ri)}function Jn(ri){return tr(t([lr({text:"("}),Qr,lr({text:")"})],Gr=>Gr[1]),Gr=>({columns:Gr?Gr.columns:[]}))(ri)}function Qr(ri){return t([tr(B(t([Xn,lr({text:","})],Gr=>Gr[0])),Gr=>Gr!==null?Gr:[]),Xn],Gr=>({columns:Gr[0].concat([Gr[1]])}))(ri)}function Jr(ri){return t([lr({text:"ON"}),lr({text:"DELETE"}),ni],Gr=>({delete:Gr[2]}))(ri)}function ei(ri){return t([lr({text:"ON"}),lr({text:"UPDATE"}),ni],Gr=>({update:Gr[2]}))(ri)}function mi(ri){return t([lr({text:"MATCH"}),I([lr({type:"keyword"}),lr({type:"id"})])],Gr=>({match:Gr[1]}))(ri)}function ci(ri){return tr(t([tr(lr({text:"NOT"})),lr({text:"DEFERRABLE"}),tr(t([lr({text:"INITIALLY"}),I([lr({text:"DEFERRED"}),lr({text:"IMMEDIATE"})])],Gr=>Gr[1].toUpperCase()))]),Gr=>({deferrable:Gr?{not:Gr[0]!==null,initially:Gr[2]}:null}))(ri)}function ai(ri){return tr(t([lr({text:"CONSTRAINT"}),Xn],Gr=>Gr[1]),Gr=>({name:Gr}))(ri)}function fi(ri){return t([lr({text:"CREATE"},Gr=>null),vi,lr({text:"INDEX"},Gr=>null),xi,Ci,Yn,lr({text:"ON"},Gr=>null),ii,lr({text:"("},Gr=>null),Ti,lr({text:")"},Gr=>null),$i,hr],Gr=>Object.assign({},...Gr.filter(Si=>Si!==null)))(ri)}function vi(ri){return tr(lr({text:"UNIQUE"}),Gr=>({unique:Gr!==null}))(ri)}function xi(ri){return tr(t([lr({text:"IF"}),lr({text:"NOT"}),lr({text:"EXISTS"})]),Gr=>({exists:Gr!==null}))(ri)}function Ci(ri){return tr(t([Xn,lr({text:"."})],Gr=>Gr[0]),Gr=>({schema:Gr}))(ri)}function Yn(ri){return t([Xn],Gr=>({index:Gr[0]}))(ri)}function ii(ri){return t([Xn],Gr=>({table:Gr[0]}))(ri)}function $i(ri){return tr(t([lr({text:"WHERE"}),Bi],Gr=>Gr[1]),Gr=>({where:Gr}))(ri)}function Ti(ri){return I([t([Qi,lr({text:","}),Ti],Gr=>({columns:[Gr[0]].concat(Gr[2].columns)})),t([hi,lr({text:","}),Ti],Gr=>({columns:[Gr[0]].concat(Gr[2].columns)})),rr({do:Qi,next:lr({text:")"})},Gr=>({columns:[Gr]})),rr({do:hi,next:lr({text:")"})},Gr=>({columns:[Gr]}))])(ri)}function Qi(ri){return t([t([Xn],Gr=>({name:Gr[0],expression:!1})),hs,Yi],Gr=>Object.assign({},...Gr.filter(Si=>Si!==null)))(ri)}function hi(ri){return t([t([ss],Gr=>({name:Gr[0],expression:!0})),hs,Yi],Gr=>Object.assign({},...Gr.filter(Si=>Si!==null)))(ri)}function hs(ri){return tr(t([lr({text:"COLLATE"}),lr({type:"id"})],Gr=>Gr[1]),Gr=>({collation:Gr}))(ri)}function Yi(ri){return I([lr({text:"ASC"}),lr({text:"DESC"}),dr],Gr=>({order:Gr?Gr.toUpperCase():null}))(ri)}function ss(ri){return B(I([ir({do:lr({type:"keyword"}),not:I([lr({text:"COLLATE"}),lr({text:"ASC"}),lr({text:"DESC"})])}),lr({type:"id"}),lr({type:"string"}),lr({type:"blob"}),lr({type:"numeric"}),lr({type:"variable"}),ir({do:lr({type:"operator"}),not:I([lr({text:"("}),lr({text:")"}),lr({text:","})])}),t([lr({text:"("}),tr(Bi),lr({text:")"})],Gr=>Gr[1]||[])]))(ri)}function Bi(ri){return B(I([lr({type:"keyword"}),lr({type:"id"}),lr({type:"string"}),lr({type:"blob"}),lr({type:"numeric"}),lr({type:"variable"}),ir({do:lr({type:"operator"}),not:I([lr({text:"("}),lr({text:")"})])}),t([lr({text:"("}),tr(Bi),lr({text:")"})],Gr=>Gr[1]||[])]))(ri)}function Xn(ri){return I([lr({type:"id"}),lr({type:"string"})],Gr=>/^["`['][^]*["`\]']$/.test(Gr)?Gr.substring(1,Gr.length-1):Gr)(ri)}function ni(ri){return I([t([lr({text:"SET"}),lr({text:"NULL"})],Gr=>`${Gr[0]} ${Gr[1]}`),t([lr({text:"SET"}),lr({text:"DEFAULT"})],Gr=>`${Gr[0]} ${Gr[1]}`),lr({text:"CASCADE"}),lr({text:"RESTRICT"}),t([lr({text:"NO"}),lr({text:"ACTION"})],Gr=>`${Gr[0]} ${Gr[1]}`)],Gr=>Gr.toUpperCase())(ri)}function wi(ri){return I([lr({type:"numeric"}),lr({type:"string"}),lr({type:"id"}),lr({type:"blob"}),lr({text:"NULL"}),lr({text:"TRUE"}),lr({text:"FALSE"}),lr({text:"CURRENT_TIME"}),lr({text:"CURRENT_DATE"}),lr({text:"CURRENT_TIMESTAMP"})])(ri)}function Mi(ri){return t([I([lr({text:"+"}),lr({text:"-"}),dr]),lr({type:"numeric"})],Gr=>`${Gr[0]||""}${Gr[1]}`)(ri)}return parser={parseCreateTable:mr,parseCreateIndex:_r},parser}var compiler,hasRequiredCompiler;function requireCompiler(){if(hasRequiredCompiler)return compiler;hasRequiredCompiler=1;function e(Yn,ii=$i=>$i){return I(Yn,ii)}function t(Yn,ii=$i=>$i){return oi(Yn,ii)}function I(Yn,ii){return`CREATE${B(Yn)} TABLE${li(Yn)} ${di(Yn,ii)}${Qr(Yn,ii)} (${rr(Yn,ii)}${br(Yn,ii)})${tr(Yn)}`}function B(Yn,ii){return Yn.temporary?" TEMP":""}function tr(Yn,ii){return Yn.rowid?" WITHOUT ROWID":""}function rr(Yn,ii){return Yn.columns.map($i=>ir($i,ii)).join(", ")}function ir(Yn,ii){return`${Ci(Yn.name,ii)}${lr(Yn)}${dr(Yn.constraints,ii)}`}function lr(Yn,ii){return Yn.type!==null?` ${Yn.type}`:""}function dr(Yn,ii){return`${hr(Yn,ii)}${mr(Yn,ii)}${_r(Yn,ii)}${yr(Yn,ii)}${xr(Yn,ii)}${Mr(Yn,ii)}${vr(Yn,ii)}${Sr(Yn,ii)}${wr(Yn,ii)}`}function hr(Yn,ii){return Yn.primary!==null?` ${gi(Yn.primary,ii)}PRIMARY KEY${fi(Yn.primary)}${Or(Yn.primary)}${fr(Yn.primary)}`:""}function fr(Yn,ii){return Yn.autoincrement?" AUTOINCREMENT":""}function mr(Yn,ii){return Yn.notnull!==null?` ${gi(Yn.notnull,ii)}NOT NULL${Or(Yn.notnull)}`:""}function _r(Yn,ii){return Yn.null!==null?` ${gi(Yn.null,ii)}NULL${Or(Yn.null)}`:""}function yr(Yn,ii){return Yn.unique!==null?` ${gi(Yn.unique,ii)}UNIQUE${Or(Yn.unique)}`:""}function xr(Yn,ii){return Yn.check!==null?` ${gi(Yn.check,ii)}CHECK (${xi(Yn.check.expression)})`:""}function Mr(Yn,ii){return Yn.default!==null?` ${gi(Yn.default,ii)}DEFAULT ${Yn.default.expression?`(${xi(Yn.default.value)})`:Yn.default.value}`:""}function vr(Yn,ii){return Yn.collate!==null?` ${gi(Yn.collate,ii)}COLLATE ${Yn.collate.collation}`:""}function Sr(Yn,ii){return Yn.references!==null?` ${gi(Yn.references,ii)}${Fr(Yn.references,ii)}`:""}function wr(Yn,ii){return Yn.as!==null?` ${gi(Yn.as,ii)}${Yn.as.generated?"GENERATED ALWAYS ":""}AS (${xi(Yn.as.expression)})${Yn.as.mode!==null?` ${Yn.as.mode}`:""}`:""}function br(Yn,ii){return Yn.constraints.reduce(($i,Ti)=>`${$i}, ${Ar(Ti,ii)}`,"")}function Ar(Yn,ii){switch(Yn.type){case"PRIMARY KEY":return kr(Yn,ii);case"UNIQUE":return Dr(Yn,ii);case"CHECK":return zr(Yn,ii);case"FOREIGN KEY":return $n(Yn,ii)}}function kr(Yn,ii){return`${gi(Yn,ii)}PRIMARY KEY (${ei(Yn,ii)})${Or(Yn)}`}function Dr(Yn,ii){return`${gi(Yn,ii)}UNIQUE (${ei(Yn,ii)})${Or(Yn)}`}function Or(Yn,ii){return Yn.conflict!==null?` ON CONFLICT ${Yn.conflict}`:""}function zr(Yn,ii){return`${gi(Yn,ii)}CHECK (${xi(Yn.expression)})`}function $n(Yn,ii){return`${gi(Yn,ii)}FOREIGN KEY (${Hn(Yn,ii)}) ${Fr(Yn.references,ii)}`}function Fr(Yn,ii){return`REFERENCES ${Qr(Yn,ii)}${$r(Yn,ii)}${ti(Yn)}${pi(Yn.deferrable)}`}function $r(Yn,ii){return Yn.columns.length>0?` (${Hn(Yn,ii)})`:""}function Hn(Yn,ii){return Yn.columns.map($i=>Ci($i,ii)).join(", ")}function ti(Yn,ii){return`${Ir(Yn)}${Lr(Yn)}${Kn(Yn)}`}function Ir(Yn,ii){return Yn.delete!==null?` ON DELETE ${Yn.delete}`:""}function Lr(Yn,ii){return Yn.update!==null?` ON UPDATE ${Yn.update}`:""}function Kn(Yn,ii){return Yn.match!==null?` MATCH ${Yn.match}`:""}function pi(Yn,ii){return Yn!==null?` ${Yn.not?"NOT ":""}DEFERRABLE${Yn.initially!==null?` INITIALLY ${Yn.initially}`:""}`:""}function gi(Yn,ii){return Yn.name!==null?`CONSTRAINT ${Ci(Yn.name,ii)} `:""}function oi(Yn,ii){return`CREATE${qn(Yn)} INDEX${li(Yn)} ${di(Yn,ii)}${Jn(Yn,ii)} on ${Qr(Yn,ii)} (${ei(Yn,ii)})${Jr(Yn)}`}function qn(Yn,ii){return Yn.unique?" UNIQUE":""}function li(Yn,ii){return Yn.exists?" IF NOT EXISTS":""}function di(Yn,ii){return Yn.schema!==null?`${Ci(Yn.schema,ii)}.`:""}function Jn(Yn,ii){return Ci(Yn.index,ii)}function Qr(Yn,ii){return Ci(Yn.table,ii)}function Jr(Yn,ii){return Yn.where!==null?` where ${xi(Yn.where)}`:""}function ei(Yn,ii){return Yn.columns.map($i=>$i.expression?ci($i):mi($i,ii)).join(", ")}function mi(Yn,ii){return`${Ci(Yn.name,ii)}${ai(Yn)}${fi(Yn)}`}function ci(Yn,ii){return`${vi(Yn.name)}${ai(Yn)}${fi(Yn)}`}function ai(Yn,ii){return Yn.collation!==null?` COLLATE ${Yn.collation}`:""}function fi(Yn,ii){return Yn.order!==null?` ${Yn.order}`:""}function vi(Yn,ii){return xi(Yn)}function xi(Yn,ii){return Yn.reduce(($i,Ti)=>Array.isArray(Ti)?`${$i}(${xi(Ti)})`:$i?`${$i} ${Ti}`:Ti,"")}function Ci(Yn,ii){return ii(Yn)}return compiler={compileCreateTable:e,compileCreateIndex:t},compiler}var utils$2,hasRequiredUtils$2;function requireUtils$2(){if(hasRequiredUtils$2)return utils$2;hasRequiredUtils$2=1;function e(I,B){return I.toLowerCase()===B.toLowerCase()}function t(I,B){return I.some(tr=>e(tr,B))}return utils$2={isEqualId:e,includesId:t},utils$2}var ddl,hasRequiredDdl;function requireDdl(){if(hasRequiredDdl)return ddl;hasRequiredDdl=1;const e=requireIdentity(),{nanonum:t}=requireNanoid(),{copyData:I,dropOriginal:B,renameTable:tr,getTableSql:rr,isForeignCheckEnabled:ir,setForeignCheck:lr,executeForeignCheck:dr}=requireSqliteDdlOperations(),{parseCreateTable:hr,parseCreateIndex:fr}=requireParser(),{compileCreateTable:mr,compileCreateIndex:_r}=requireCompiler(),{isEqualId:yr,includesId:xr}=requireUtils$2();class Mr{constructor(Sr,wr,br,Ar){this.client=Sr,this.tableCompiler=wr,this.pragma=br,this.tableNameRaw=this.tableCompiler.tableNameRaw,this.alteredName=`_knex_temp_alter${t(3)}`,this.connection=Ar,this.formatter=kr=>this.client.customWrapIdentifier(kr,e),this.wrap=kr=>this.client.wrapIdentifierImpl(kr)}tableName(){return this.formatter(this.tableNameRaw)}getTableSql(){const Sr=this.tableName();return this.client.transaction(async wr=>{wr.disableProcessing();const br=await wr.raw(rr(Sr));return wr.enableProcessing(),{createTable:br.filter(Ar=>Ar.type==="table")[0].sql,createIndices:br.filter(Ar=>Ar.type==="index").map(Ar=>Ar.sql)}},{connection:this.connection})}async isForeignCheckEnabled(){return(await this.client.raw(ir()).connection(this.connection))[0].foreign_keys===1}async setForeignCheck(Sr){await this.client.raw(lr(Sr)).connection(this.connection)}renameTable(Sr){return Sr.raw(tr(this.alteredName,this.tableName()))}dropOriginal(Sr){return Sr.raw(B(this.tableName()))}copyData(Sr,wr){return Sr.raw(I(this.tableName(),this.alteredName,wr))}async alterColumn(Sr){const{createTable:wr,createIndices:br}=await this.getTableSql(),Ar=hr(wr);Ar.table=this.alteredName,Ar.columns=Ar.columns.map(Dr=>{const Or=Sr.find(zr=>yr(zr.name,Dr.name));return Or&&(Dr.type=Or.type,Dr.constraints.default=Or.defaultTo!==null?{name:null,value:Or.defaultTo,expression:!1}:null,Dr.constraints.notnull=Or.notNull?{name:null,conflict:null}:null,Dr.constraints.null=Or.notNull?null:Dr.constraints.null),Dr});const kr=mr(Ar,this.wrap);return this.generateAlterCommands(kr,br)}async dropColumn(Sr){const{createTable:wr,createIndices:br}=await this.getTableSql(),Ar=hr(wr);if(Ar.table=this.alteredName,Ar.columns=Ar.columns.filter(zr=>zr.expression||!xr(Sr,zr.name)),Ar.columns.length===0)throw new Error("Unable to drop last column from table");Ar.constraints=Ar.constraints.filter(zr=>zr.type==="PRIMARY KEY"||zr.type==="UNIQUE"?zr.columns.every($n=>$n.expression||!xr(Sr,$n.name)):zr.type==="FOREIGN KEY"?zr.columns.every($n=>!xr(Sr,$n))&&(zr.references.table!==Ar.table||zr.references.columns.every($n=>!xr(Sr,$n))):!0);const kr=Ar.columns.map(zr=>zr.name),Dr=mr(Ar,this.wrap),Or=[];for(const zr of br){const $n=fr(zr);$n.columns=$n.columns.filter(Fr=>Fr.expression||!xr(Sr,Fr.name)),$n.columns.length>0&&Or.push(_r($n,this.wrap))}return this.alter(Dr,Or,kr)}async dropForeign(Sr,wr){const{createTable:br,createIndices:Ar}=await this.getTableSql(),kr=hr(br);kr.table=this.alteredName,wr||(kr.columns=kr.columns.map(Or=>({...Or,references:xr(Sr,Or.name)?null:Or.references}))),kr.constraints=kr.constraints.filter(Or=>Or.type==="FOREIGN KEY"?wr?!Or.name||!yr(Or.name,wr):Or.columns.every(zr=>!xr(Sr,zr)):!0);const Dr=mr(kr,this.wrap);return this.alter(Dr,Ar)}async dropPrimary(Sr){const{createTable:wr,createIndices:br}=await this.getTableSql(),Ar=hr(wr);Ar.table=this.alteredName,Ar.columns=Ar.columns.map(Dr=>({...Dr,primary:null})),Ar.constraints=Ar.constraints.filter(Dr=>Dr.type==="PRIMARY KEY"?Sr?!Dr.name||!yr(Dr.name,Sr):!1:!0);const kr=mr(Ar,this.wrap);return this.alter(kr,br)}async primary(Sr,wr){const{createTable:br,createIndices:Ar}=await this.getTableSql(),kr=hr(br);kr.table=this.alteredName,kr.columns=kr.columns.map(Or=>({...Or,primary:null})),kr.constraints=kr.constraints.filter(Or=>Or.type!=="PRIMARY KEY"),kr.constraints.push({type:"PRIMARY KEY",name:wr||null,columns:Sr.map(Or=>({name:Or,expression:!1,collation:null,order:null})),conflict:null});const Dr=mr(kr,this.wrap);return this.alter(Dr,Ar)}async foreign(Sr){const{createTable:wr,createIndices:br}=await this.getTableSql(),Ar=hr(wr);Ar.table=this.alteredName,Ar.constraints.push({type:"FOREIGN KEY",name:Sr.keyName||null,columns:Sr.column,references:{table:Sr.inTable,columns:Sr.references,delete:Sr.onDelete||null,update:Sr.onUpdate||null,match:null,deferrable:null}});const kr=mr(Ar,this.wrap);return this.generateAlterCommands(kr,br)}async setNullable(Sr,wr){const{createTable:br,createIndices:Ar}=await this.getTableSql(),kr=hr(br);kr.table=this.alteredName;const Dr=kr.columns.find(zr=>yr(Sr,zr.name));if(!Dr)throw new Error(`.setNullable: Column ${Sr} does not exist in table ${this.tableName()}.`);Dr.constraints.notnull=wr?null:{name:null,conflict:null},Dr.constraints.null=wr?Dr.constraints.null:null;const Or=mr(kr,this.wrap);return this.generateAlterCommands(Or,Ar)}async alter(Sr,wr,br){const Ar=await this.isForeignCheckEnabled();Ar&&await this.setForeignCheck(!1);try{await this.client.transaction(async kr=>{await kr.raw(Sr),await this.copyData(kr,br),await this.dropOriginal(kr),await this.renameTable(kr);for(const Dr of wr)await kr.raw(Dr);if(Ar&&(await kr.raw(dr())).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{Ar&&await this.setForeignCheck(!0)}}async generateAlterCommands(Sr,wr,br){const Ar=[],kr=[],Dr=[];let Or=null;Ar.push(Sr),Ar.push(I(this.tableName(),this.alteredName,br)),Ar.push(B(this.tableName())),Ar.push(tr(this.alteredName,this.tableName()));for(const $n of wr)Ar.push($n);return await this.isForeignCheckEnabled()&&(kr.push(lr(!1)),Dr.push(lr(!0)),Or=dr()),{pre:kr,sql:Ar,check:Or,post:Dr}}}return ddl=Mr,ddl}var sqliteQuerybuilder,hasRequiredSqliteQuerybuilder;function requireSqliteQuerybuilder(){if(hasRequiredSqliteQuerybuilder)return sqliteQuerybuilder;hasRequiredSqliteQuerybuilder=1;const e=requireQuerybuilder();return sqliteQuerybuilder=class extends e{withMaterialized(I,B,tr){return this._validateWithArgs(I,B,tr,"with"),this.withWrapped(I,B,tr,!0)}withNotMaterialized(I,B,tr){return this._validateWithArgs(I,B,tr,"with"),this.withWrapped(I,B,tr,!1)}},sqliteQuerybuilder}var sqlite3,hasRequiredSqlite3;function requireSqlite3(){if(hasRequiredSqlite3)return sqlite3;hasRequiredSqlite3=1;const e=requireDefaults(),t=requireMap(),{promisify:I}=requireUtil(),B=requireClient(),tr=requireRaw(),rr=requireSqliteTransaction(),ir=requireSqliteQuerycompiler(),lr=requireSqliteCompiler(),dr=requireSqliteColumncompiler(),hr=requireSqliteTablecompiler(),fr=requireSqliteViewcompiler(),mr=requireDdl(),_r=requireFormatter(),yr=requireSqliteQuerybuilder();class xr extends B{constructor(vr){super(vr),vr.connection&&vr.connection.filename===void 0&&this.logger.warn("Could not find `connection.filename` in config. Please specify the database path and name to avoid errors. (see docs https://knexjs.org/guide/#configuration-options)"),vr.useNullAsDefault===void 0&&this.logger.warn("sqlite does not support inserting default values. Set the `useNullAsDefault` flag to hide this warning. (see docs https://knexjs.org/guide/query-builder.html#insert).")}_driver(){return require$$1}schemaCompiler(){return new lr(this,...arguments)}transaction(){return new rr(this,...arguments)}queryCompiler(vr,Sr){return new ir(this,vr,Sr)}queryBuilder(){return new yr(this)}viewCompiler(vr,Sr){return new fr(this,vr,Sr)}columnCompiler(){return new dr(this,...arguments)}tableCompiler(){return new hr(this,...arguments)}ddl(vr,Sr,wr){return new mr(this,vr,Sr,wr)}wrapIdentifierImpl(vr){return vr!=="*"?`\`${vr.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((vr,Sr)=>{let wr=this.driver.OPEN_READWRITE|this.driver.OPEN_CREATE;if(this.connectionSettings.flags){if(!Array.isArray(this.connectionSettings.flags))throw new Error("flags must be an array of strings");this.connectionSettings.flags.forEach(Ar=>{if(!Ar.startsWith("OPEN_")||!this.driver[Ar])throw new Error(`flag ${Ar} not supported by node-sqlite3`);wr=wr|this.driver[Ar]})}const br=new this.driver.Database(this.connectionSettings.filename,wr,Ar=>{if(Ar)return Sr(Ar);vr(br)})})}async destroyRawConnection(vr){return I(wr=>vr.close(wr))()}_query(vr,Sr){if(!Sr.sql)throw new Error("The query is empty");const{method:wr}=Sr;let br;switch(wr){case"insert":case"update":br=Sr.returning?"all":"run";break;case"counter":case"del":br="run";break;default:br="all"}return new Promise(function(Ar,kr){if(!vr||!vr[br])return kr(new Error(`Error calling ${br} on connection.`));vr[br](Sr.sql,Sr.bindings,function(Dr,Or){return Dr?kr(Dr):(Sr.response=Or,Sr.context=this,Ar(Sr))})})}_stream(vr,Sr,wr){if(!Sr.sql)throw new Error("The query is empty");const br=this;return new Promise(function(Ar,kr){return wr.on("error",kr),wr.on("end",Ar),br._query(vr,Sr).then(Dr=>Dr.response).then(Dr=>Dr.forEach(Or=>wr.write(Or))).catch(function(Dr){wr.emit("error",Dr)}).then(function(){wr.end()})})}processResponse(vr,Sr){const wr=vr.context,{response:br,returning:Ar}=vr;if(vr.output)return vr.output.call(Sr,br);switch(vr.method){case"select":return br;case"first":return br[0];case"pluck":return t(br,vr.pluck);case"insert":return Ar&&br?br:[wr.lastID];case"update":return Ar&&br?br:wr.changes;case"del":case"counter":return wr.changes;default:return br}}poolDefaults(){return e({min:1,max:1},super.poolDefaults())}formatter(vr){return new _r(this,vr)}values(vr,Sr,wr){return Array.isArray(vr)?Array.isArray(vr[0])?`( values ${vr.map(br=>`(${this.parameterize(br,void 0,Sr,wr)})`).join(", ")})`:`(${this.parameterize(vr,void 0,Sr,wr)})`:vr instanceof tr?`(${this.parameter(vr,Sr,wr)})`:this.parameter(vr,Sr,wr)}}return Object.assign(xr.prototype,{dialect:"sqlite3",driverName:"sqlite3"}),sqlite3=xr,sqlite3}var betterSqlite3,hasRequiredBetterSqlite3;function requireBetterSqlite3(){if(hasRequiredBetterSqlite3)return betterSqlite3;hasRequiredBetterSqlite3=1;const e=requireSqlite3();class t extends e{_driver(){return require$$1}async acquireRawConnection(){const B=this.connectionSettings.options||{};return new this.driver(this.connectionSettings.filename,{nativeBinding:B.nativeBinding,readonly:!!B.readonly})}async destroyRawConnection(B){return B.close()}async _query(B,tr){if(!tr.sql)throw new Error("The query is empty");if(!B)throw new Error("No connection provided");const rr=B.prepare(tr.sql),ir=this._formatBindings(tr.bindings);if(rr.reader){const dr=await rr.all(ir);return tr.response=dr,tr}const lr=await rr.run(ir);return tr.response=lr,tr.context={lastID:lr.lastInsertRowid,changes:lr.changes},tr}_formatBindings(B){return B?B.map(tr=>tr instanceof Date?tr.valueOf():typeof tr=="boolean"?Number(tr):tr):[]}}return Object.assign(t.prototype,{driverName:"better-sqlite3"}),betterSqlite3=t,betterSqlite3}var pgTransaction,hasRequiredPgTransaction;function requirePgTransaction(){if(hasRequiredPgTransaction)return pgTransaction;hasRequiredPgTransaction=1;const e=requireTransaction$5();class t extends e{begin(B){const tr=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return tr.length===0?this.query(B,"BEGIN;"):this.query(B,`BEGIN TRANSACTION ${tr};`)}}return pgTransaction=t,pgTransaction}var pgQuerycompiler,hasRequiredPgQuerycompiler;function requirePgQuerycompiler(){if(hasRequiredPgQuerycompiler)return pgQuerycompiler;hasRequiredPgQuerycompiler=1;const e=requireIdentity(),t=requireReduce(),I=requireQuerycompiler(),{wrapString:B,columnize:tr,operator:rr,wrap:ir}=requireWrappingFormatter();class lr extends I{constructor(hr,fr,mr){super(hr,fr,mr),this._defaultInsertValue="default"}truncate(){return`truncate ${this.tableName} restart identity`}insert(){let hr=super.insert();if(hr==="")return hr;const{returning:fr,onConflict:mr,ignore:_r,merge:yr,insert:xr}=this.single;if(mr&&_r&&(hr+=this._ignore(mr)),mr&&yr){hr+=this._merge(yr.updates,mr,xr);const Mr=this.where();Mr&&(hr+=` ${Mr}`)}return fr&&(hr+=this._returning(fr)),{sql:hr,returning:fr}}update(){const hr=this.with(),fr=this._prepUpdate(this.single.update),mr=this.where(),{returning:_r,updateFrom:yr}=this.single;return{sql:hr+`update ${this.single.only?"only ":""}${this.tableName} set ${fr.join(", ")}`+this._updateFrom(yr)+(mr?` ${mr}`:"")+this._returning(_r),returning:_r}}using(){const hr=this.single.using;if(!hr)return;let fr="using ";return Array.isArray(hr)?fr+=hr.map(mr=>this.formatter.wrap(mr)).join(","):fr+=this.formatter.wrap(hr),fr}del(){const{tableName:hr}=this,fr=this.with();let mr=this.where()||"",_r=this.using()||"";const yr=this.grouped.join,xr=[];if(Array.isArray(yr)){for(const Sr of yr){xr.push(ir(this._joinTable(Sr),void 0,this.builder,this.client,this.bindingsHolder));const wr=[];for(const br of Sr.clauses)wr.push(this.whereBasic({column:br.column,operator:"=",value:br.value,asColumn:!0}));wr.length>0&&(mr+=(mr?" and ":"where ")+wr.join(" and "))}xr.length>0&&(_r+=(_r?",":"using ")+xr.join(","))}const Mr=fr+`delete from ${this.single.only?"only ":""}${hr}`+(_r?` ${_r}`:"")+(mr?` ${mr}`:""),{returning:vr}=this.single;return{sql:Mr+this._returning(vr),returning:vr}}aggregate(hr){return this._aggregate(hr,{distinctParentheses:!0})}_returning(hr){return hr?` returning ${this.formatter.columnize(hr)}`:""}_updateFrom(hr){return hr?` from ${this.formatter.wrap(hr)}`:""}_ignore(hr){return hr===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(hr)} do nothing`}_merge(hr,fr,mr){let _r=` on conflict ${this._onConflictClause(fr)} do update set `;if(hr&&Array.isArray(hr))return _r+=hr.map(yr=>B(yr.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(yr=>`${yr} = excluded.${yr}`).join(", "),_r;if(hr&&typeof hr=="object"){const yr=this._prepUpdate(hr);return typeof yr=="string"?_r+=yr:_r+=yr.join(","),_r}else{const yr=this._prepInsert(mr);if(typeof yr=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return _r+=yr.columns.map(xr=>B(xr.split(".").pop(),this.builder,this.client)).map(xr=>`${xr} = excluded.${xr}`).join(", "),_r}}_tableNames(hr){const fr=this.single.schema,mr=[];for(let _r=0;_r<hr.length;_r++){let yr=hr[_r];yr&&(fr&&(yr=`${fr}.${yr}`),mr.push(this.formatter.wrap(yr)))}return mr.join(", ")}_lockingClause(hr){const fr=this.single.lockTables||[];return hr+(fr.length?" of "+this._tableNames(fr):"")}_groupOrder(hr,fr){return super._groupOrderNulls(hr,fr)}forUpdate(){return this._lockingClause("for update")}forShare(){return this._lockingClause("for share")}forNoKeyUpdate(){return this._lockingClause("for no key update")}forKeyShare(){return this._lockingClause("for key share")}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const hr=this.single.columnInfo;let fr=this.single.schema;const mr=this.client.customWrapIdentifier(this.single.table,e);fr&&(fr=this.client.customWrapIdentifier(fr,e));const _r="select * from information_schema.columns where table_name = ? and table_catalog = current_database()",yr=[mr];return this._buildColumnInfoQuery(fr,_r,yr,hr)}_buildColumnInfoQuery(hr,fr,mr,_r){return hr?(fr+=" and table_schema = ?",mr.push(hr)):fr+=" and table_schema = current_schema()",{sql:fr,bindings:mr,output(yr){const xr=t(yr.rows,function(Mr,vr){return Mr[vr.column_name]={type:vr.data_type,maxLength:vr.character_maximum_length,nullable:vr.is_nullable==="YES",defaultValue:vr.column_default},Mr},{});return _r&&xr[_r]||xr}}}distinctOn(hr){return"distinct on ("+this.formatter.columnize(hr)+") "}jsonExtract(hr){return this._jsonExtract("jsonb_path_query",hr)}jsonSet(hr){return this._jsonSet("jsonb_set",Object.assign({},hr,{path:this.client.toPathForJson(hr.path)}))}jsonInsert(hr){return this._jsonSet("jsonb_insert",Object.assign({},hr,{path:this.client.toPathForJson(hr.path)}))}jsonRemove(hr){const fr=`${tr(hr.column,this.builder,this.client,this.bindingsHolder)} #- ${this.client.parameter(this.client.toPathForJson(hr.path),this.builder,this.bindingsHolder)}`;return hr.alias?this.client.alias(fr,this.formatter.wrap(hr.alias)):fr}whereJsonPath(hr){let fr="";return!isNaN(hr.value)&&parseInt(hr.value)?fr="::int":!isNaN(hr.value)&&parseFloat(hr.value)?fr="::float":fr=" #>> '{}'",`jsonb_path_query_first(${this._columnClause(hr)}, ${this.client.parameter(hr.jsonPath,this.builder,this.bindingsHolder)})${fr} ${rr(hr.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(hr)}`}whereJsonSupersetOf(hr){return this._not(hr,`${ir(hr.column,void 0,this.builder,this.client,this.bindingsHolder)} @> ${this._jsonValueClause(hr)}`)}whereJsonSubsetOf(hr){return this._not(hr,`${tr(hr.column,this.builder,this.client,this.bindingsHolder)} <@ ${this._jsonValueClause(hr)}`)}onJsonPathEquals(hr){return this._onJsonPathEquals("jsonb_path_query_first",hr)}}return pgQuerycompiler=lr,pgQuerycompiler}var pgQuerybuilder,hasRequiredPgQuerybuilder;function requirePgQuerybuilder(){if(hasRequiredPgQuerybuilder)return pgQuerybuilder;hasRequiredPgQuerybuilder=1;const e=requireQuerybuilder();return pgQuerybuilder=class extends e{updateFrom(I){return this._single.updateFrom=I,this}using(I){return this._single.using=I,this}withMaterialized(I,B,tr){return this._validateWithArgs(I,B,tr,"with"),this.withWrapped(I,B,tr,!0)}withNotMaterialized(I,B,tr){return this._validateWithArgs(I,B,tr,"with"),this.withWrapped(I,B,tr,!1)}},pgQuerybuilder}var pgColumncompiler,hasRequiredPgColumncompiler;function requirePgColumncompiler(){if(hasRequiredPgColumncompiler)return pgColumncompiler;hasRequiredPgColumncompiler=1;const e=requireColumncompiler(),{isObject:t}=requireIs(),{toNumber:I}=requireHelpers$1(),B=new RegExp("(?<!')'(?!')","g");class tr extends e{constructor(lr,dr,hr){super(lr,dr,hr),this.modifiers=["nullable","defaultTo","comment"],this._addCheckModifiers()}bit(lr){return lr.length!==!1?`bit(${lr.length})`:"bit"}enu(lr,dr){dr=dr||{};const hr=dr.useNative&&dr.existingType?void 0:lr.join("', '");if(dr.useNative){let fr="";const mr=dr.schemaName||this.tableCompiler.schemaNameRaw;return mr&&(fr+=`"${mr}".`),fr+=`"${dr.enumName}"`,dr.existingType||this.tableCompiler.unshiftQuery(`create type ${fr} as enum ('${hr}')`),fr}return`text check (${this.formatter.wrap(this.args[0])} in ('${hr}'))`}decimal(lr,dr){return lr===null?"decimal":`decimal(${I(lr,8)}, ${I(dr,2)})`}json(lr){return lr&&this.client.logger.deprecate("json(true)","jsonb()"),rr(this.client,lr)}jsonb(){return rr(this.client,!0)}checkRegex(lr,dr){return this._check(`${this.formatter.wrap(this.getColumnName())} ~ ${this.client._escapeBinding(lr)}`,dr)}datetime(lr=!1,dr){let hr;return t(lr)?{useTz:hr,precision:dr}=lr:hr=!lr,hr=typeof hr=="boolean"?hr:!0,dr=dr!=null?"("+dr+")":"",`${hr?"timestamptz":"timestamp"}${dr}`}timestamp(lr=!1,dr){return this.datetime(lr,dr)}comment(lr){const dr=this.args[0]||this.defaults("columnName"),hr=lr?`'${lr.replace(B,"''")}'`:"NULL";this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(dr)+` is ${hr}`)},lr)}increments(lr={primaryKey:!0}){return"serial"+(this.tableCompiler._canBeAddPrimaryKey(lr)?" primary key":"")}bigincrements(lr={primaryKey:!0}){return"bigserial"+(this.tableCompiler._canBeAddPrimaryKey(lr)?" primary key":"")}uuid(lr={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(lr)?" primary key":"")}}tr.prototype.bigint="bigint",tr.prototype.binary="bytea",tr.prototype.bool="boolean",tr.prototype.double="double precision",tr.prototype.floating="real",tr.prototype.smallint="smallint",tr.prototype.tinyint="smallint";function rr(ir,lr){return!ir.version||ir.config.client==="cockroachdb"||ir.config.jsonbSupport===!0||parseFloat(ir.version)>=9.2?lr?"jsonb":"json":"text"}return pgColumncompiler=tr,pgColumncompiler}var pgTablecompiler,hasRequiredPgTablecompiler;function requirePgTablecompiler(){if(hasRequiredPgTablecompiler)return pgTablecompiler;hasRequiredPgTablecompiler=1;const e=requireHas(),t=requireTablecompiler(),{isObject:I,isString:B}=requireIs();class tr extends t{constructor(ir,lr){super(ir,lr)}renameColumn(ir,lr){return this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(ir)} to ${this.formatter.wrap(lr)}`})}_setNullableState(ir,lr){const dr=lr?"drop not null":"set not null",hr=`alter table ${this.tableName()} alter column ${this.formatter.wrap(ir)} ${dr}`;return this.pushQuery({sql:hr})}compileAdd(ir){const lr=this.formatter.wrap(ir),dr=this.prefixArray("add column",this.getColumns(ir));return this.pushQuery({sql:`alter table ${lr} ${dr.join(", ")}`})}createQuery(ir,lr,dr){const hr=lr?"create table if not exists ":"create table ",fr=` (${ir.sql.join(", ")}${this.primaryKeys()||""}${this._addChecks()})`;let mr=hr+this.tableName()+(dr&&this.tableNameLike()?" (like "+this.tableNameLike()+" including all"+(ir.sql.length?", "+ir.sql.join(", "):"")+")":fr);this.single.inherits&&(mr+=` inherits (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:mr,bindings:ir.bindings}),e(this.single,"comment")&&this.comment(this.single.comment)}primaryKeys(){const ir=(this.grouped.alterTable||[]).filter(lr=>lr.method==="primary");if(ir.length>0&&ir[0].args.length>0){const lr=ir[0].args[0];let dr=ir[0].args[1]||"",hr;return I(dr)&&({constraintName:dr,deferrable:hr}=dr),hr=hr?` deferrable initially ${hr}`:"",dr=dr?this.formatter.wrap(dr):this.formatter.wrap(`${this.tableNameRaw}_pkey`),`, constraint ${dr} primary key (${this.formatter.columnize(lr)})${hr}`}}addColumns(ir,lr,dr){if(lr===this.alterColumnsPrefix)for(const hr of dr)this._addColumn(hr);else super.addColumns(ir,lr)}_addColumn(ir){const lr=this.tableName(),dr=ir.getColumnType(),hr=this.client.wrapIdentifier(ir.getColumnName(),ir.columnBuilder.queryContext()),fr=ir.type==="enu";this.pushQuery({sql:`alter table ${lr} alter column ${hr} drop default`,bindings:[]});const mr=ir.columnBuilder.alterNullable;mr&&this.pushQuery({sql:`alter table ${lr} alter column ${hr} drop not null`,bindings:[]}),ir.columnBuilder.alterType&&this.pushQuery({sql:`alter table ${lr} alter column ${hr} type ${dr} using (${hr}${fr?"::text::":"::"}${dr})`,bindings:[]});const yr=ir.modified.defaultTo;if(yr){const xr=ir.defaultTo.apply(ir,yr);this.pushQuery({sql:`alter table ${lr} alter column ${hr} set ${xr}`,bindings:[]})}if(mr){const xr=ir.modified.nullable;xr&&xr[0]===!1&&this.pushQuery({sql:`alter table ${lr} alter column ${hr} set not null`,bindings:[]})}}comment(ir){this.pushQuery(`comment on table ${this.tableName()} is '${this.single.comment}'`)}primary(ir,lr){let dr;I(lr)&&({constraintName:lr,deferrable:dr}=lr),dr=dr?` deferrable initially ${dr}`:"",lr=lr?this.formatter.wrap(lr):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add constraint ${lr} primary key (${this.formatter.columnize(ir)})${dr}`)}unique(ir,lr){let dr,hr=!0,fr;if(I(lr)&&({indexName:lr,deferrable:dr,useConstraint:hr,predicate:fr}=lr,hr===void 0&&(hr=!!dr||!fr)),!hr&&dr&&dr!=="not deferrable")throw new Error("postgres cannot create deferrable index");if(hr&&fr)throw new Error("postgres cannot create constraint with predicate");if(dr=dr?` deferrable initially ${dr}`:"",lr=lr?this.formatter.wrap(lr):this._indexCommand("unique",this.tableNameRaw,ir),hr)this.pushQuery(`alter table ${this.tableName()} add constraint ${lr} unique (`+this.formatter.columnize(ir)+")"+dr);else{const mr=fr?" "+this.client.queryCompiler(fr).where():"";this.pushQuery(`create unique index ${lr} on ${this.tableName()} (${this.formatter.columnize(ir)})${mr}`)}}index(ir,lr,dr){lr=lr?this.formatter.wrap(lr):this._indexCommand("index",this.tableNameRaw,ir);let hr,fr,mr;B(dr)?fr=dr:I(dr)&&({indexType:mr,storageEngineIndexType:fr,predicate:hr}=dr);const _r=hr?" "+this.client.queryCompiler(hr).where():"";this.pushQuery(`create${typeof mr=="string"&&mr.toLowerCase()==="unique"?" unique":""} index ${lr} on ${this.tableName()}${fr&&` using ${fr}`||""} (`+this.formatter.columnize(ir)+`)${_r}`)}dropPrimary(ir){ir=ir?this.formatter.wrap(ir):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${ir}`)}dropIndex(ir,lr){lr=lr?this.formatter.wrap(lr):this._indexCommand("index",this.tableNameRaw,ir),lr=this.schemaNameRaw?`${this.formatter.wrap(this.schemaNameRaw)}.${lr}`:lr,this.pushQuery(`drop index ${lr}`)}dropUnique(ir,lr){lr=lr?this.formatter.wrap(lr):this._indexCommand("unique",this.tableNameRaw,ir),this.pushQuery(`alter table ${this.tableName()} drop constraint ${lr}`)}dropForeign(ir,lr){lr=lr?this.formatter.wrap(lr):this._indexCommand("foreign",this.tableNameRaw,ir),this.pushQuery(`alter table ${this.tableName()} drop constraint ${lr}`)}}return pgTablecompiler=tr,pgTablecompiler}var pgViewcompiler,hasRequiredPgViewcompiler;function requirePgViewcompiler(){if(hasRequiredPgViewcompiler)return pgViewcompiler;hasRequiredPgViewcompiler=1;const e=requireViewcompiler();class t extends e{constructor(B,tr){super(B,tr)}renameColumn(B,tr){return this.pushQuery({sql:`alter view ${this.viewName()} rename ${this.formatter.wrap(B)} to ${this.formatter.wrap(tr)}`})}defaultTo(B,tr){return this.pushQuery({sql:`alter view ${this.viewName()} alter ${this.formatter.wrap(B)} set default ${tr}`})}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return pgViewcompiler=t,pgViewcompiler}var pgViewbuilder,hasRequiredPgViewbuilder;function requirePgViewbuilder(){if(hasRequiredPgViewbuilder)return pgViewbuilder;hasRequiredPgViewbuilder=1;const e=requireViewbuilder();class t extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return pgViewbuilder=t,pgViewbuilder}var pgCompiler,hasRequiredPgCompiler;function requirePgCompiler(){if(hasRequiredPgCompiler)return pgCompiler;hasRequiredPgCompiler=1;const e=requireCompiler$1();class t extends e{constructor(B,tr){super(B,tr)}hasTable(B){let tr="select * from information_schema.tables where table_name = ?";const rr=[B];this.schema?(tr+=" and table_schema = ?",rr.push(this.schema)):tr+=" and table_schema = current_schema()",this.pushQuery({sql:tr,bindings:rr,output(ir){return ir.rows.length>0}})}hasColumn(B,tr){let rr="select * from information_schema.columns where table_name = ? and column_name = ?";const ir=[B,tr];this.schema?(rr+=" and table_schema = ?",ir.push(this.schema)):rr+=" and table_schema = current_schema()",this.pushQuery({sql:rr,bindings:ir,output(lr){return lr.rows.length>0}})}qualifiedTableName(B){const tr=this.schema?`${this.schema}.${B}`:B;return this.formatter.wrap(tr)}renameTable(B,tr){this.pushQuery(`alter table ${this.qualifiedTableName(B)} rename to ${this.formatter.wrap(tr)}`)}createSchema(B){this.pushQuery(`create schema ${this.formatter.wrap(B)}`)}createSchemaIfNotExists(B){this.pushQuery(`create schema if not exists ${this.formatter.wrap(B)}`)}dropSchema(B,tr=!1){this.pushQuery(`drop schema ${this.formatter.wrap(B)}${tr?" cascade":""}`)}dropSchemaIfExists(B,tr=!1){this.pushQuery(`drop schema if exists ${this.formatter.wrap(B)}${tr?" cascade":""}`)}dropExtension(B){this.pushQuery(`drop extension ${this.formatter.wrap(B)}`)}dropExtensionIfExists(B){this.pushQuery(`drop extension if exists ${this.formatter.wrap(B)}`)}createExtension(B){this.pushQuery(`create extension ${this.formatter.wrap(B)}`)}createExtensionIfNotExists(B){this.pushQuery(`create extension if not exists ${this.formatter.wrap(B)}`)}renameView(B,tr){this.pushQuery(this.alterViewPrefix+`${this.formatter.wrap(B)} rename to ${this.formatter.wrap(tr)}`)}refreshMaterializedView(B,tr=!1){this.pushQuery({sql:`refresh materialized view${tr?" concurrently":""} ${this.formatter.wrap(B)}`})}dropMaterializedView(B){this._dropView(B,!1,!0)}dropMaterializedViewIfExists(B){this._dropView(B,!0,!0)}}return pgCompiler=t,pgCompiler}var postgres,hasRequiredPostgres;function requirePostgres(){if(hasRequiredPostgres)return postgres;hasRequiredPostgres=1;const e=requireExtend(),t=requireMap(),{promisify:I}=requireUtil(),B=requireClient(),tr=requirePgTransaction(),rr=requirePgQuerycompiler(),ir=requirePgQuerybuilder(),lr=requirePgColumncompiler(),dr=requirePgTablecompiler(),hr=requirePgViewcompiler(),fr=requirePgViewbuilder(),mr=requirePgCompiler(),{makeEscape:_r}=requireString(),{isString:yr}=requireIs();class xr extends B{constructor(Sr){super(Sr),Sr.returning&&(this.defaultReturning=Sr.returning),Sr.searchPath&&(this.searchPath=Sr.searchPath)}transaction(){return new tr(this,...arguments)}queryBuilder(){return new ir(this)}queryCompiler(Sr,wr){return new rr(this,Sr,wr)}columnCompiler(){return new lr(this,...arguments)}schemaCompiler(){return new mr(this,...arguments)}tableCompiler(){return new dr(this,...arguments)}viewCompiler(){return new hr(this,...arguments)}viewBuilder(){return new fr(this,...arguments)}_driver(){return require$$1}wrapIdentifierImpl(Sr){if(Sr==="*")return Sr;let wr="";const br=Sr.match(/(.*?)(\[[0-9]+\])/);return br&&(Sr=br[1],wr=br[2]),`"${Sr.replace(/"/g,'""')}"${wr}`}_acquireOnlyConnection(){const Sr=new this.driver.Client(this.connectionSettings);return Sr.on("error",wr=>{Sr.__knex__disposed=wr}),Sr.on("end",wr=>{Sr.__knex__disposed=wr||"Connection ended unexpectedly"}),Sr.connect().then(()=>Sr)}acquireRawConnection(){const Sr=this;return this._acquireOnlyConnection().then(function(wr){return Sr.version?wr:Sr.checkVersion(wr).then(function(br){return Sr.version=br,wr})}).then(async function(br){return await Sr.setSchemaSearchPath(br),br})}async destroyRawConnection(Sr){return I(br=>Sr.end(br))()}checkVersion(Sr){return new Promise((wr,br)=>{Sr.query("select version();",(Ar,kr)=>{if(Ar)return br(Ar);wr(this._parseVersion(kr.rows[0].version))})})}_parseVersion(Sr){return/^PostgreSQL (.*?)( |$)/.exec(Sr)[1]}positionBindings(Sr){let wr=0;return Sr.replace(/(\\*)(\?)/g,function(br,Ar){return Ar.length%2?"?":(wr++,`$${wr}`)})}setSchemaSearchPath(Sr,wr){let br=wr||this.searchPath;if(!br)return Promise.resolve(!0);if(!Array.isArray(br)&&!yr(br))throw new TypeError(`knex: Expected searchPath to be Array/String, got: ${typeof br}`);if(yr(br)){if(br.includes(",")){const kr=`[${br.split(",").map(Dr=>`'${Dr}'`).join(", ")}]`;this.logger.warn(`Detected comma in searchPath "${br}".If you are trying to specify multiple schemas, use Array syntax: ${kr}`)}br=[br]}return br=br.map(Ar=>`"${Ar}"`).join(","),new Promise(function(Ar,kr){Sr.query(`set search_path to ${br}`,function(Dr){if(Dr)return kr(Dr);Ar(!0)})})}_stream(Sr,wr,br,Ar){if(!wr.sql)throw new Error("The query is empty");const kr=process.browser?void 0:require$$1,Dr=wr.sql;return new Promise(function(Or,zr){const $n=Sr.query(new kr(Dr,wr.bindings,Ar),Fr=>{zr(Fr)});$n.on("error",function(Fr){zr(Fr),br.emit("error",Fr)}),br.on("end",Or),$n.pipe(br)})}_query(Sr,wr){if(!wr.sql)throw new Error("The query is empty");let br={text:wr.sql,values:wr.bindings||[]};return wr.options&&(br=e(br,wr.options)),new Promise(function(Ar,kr){Sr.query(br,function(Dr,Or){if(Dr)return kr(Dr);wr.response=Or,Ar(wr)})})}processResponse(Sr,wr){const br=Sr.response;if(Sr.output)return Sr.output.call(wr,br);if(Sr.method==="raw")return br;const{returning:Ar}=Sr;if(br.command==="SELECT")return Sr.method==="first"?br.rows[0]:Sr.method==="pluck"?t(br.rows,Sr.pluck):br.rows;if(Ar){const kr=[];for(let Dr=0,Or=br.rows.length;Dr<Or;Dr++){const zr=br.rows[Dr];kr[Dr]=zr}return kr}return br.command==="UPDATE"||br.command==="DELETE"?br.rowCount:br}async cancelQuery(Sr){const wr=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(wr,Sr)}finally{await this.destroyRawConnection(wr).catch(br=>{this.logger.warn(`Connection Error: ${br}`)})}}_wrappedCancelQueryCall(Sr,wr){return this._query(Sr,{sql:"SELECT pg_cancel_backend($1);",bindings:[wr.processID],options:{}})}toPathForJson(Sr){const wr=/^{.*}$/;return Sr.match(wr)?Sr:"{"+Sr.replace(/^(\$\.)/,"").replace(".",",").replace(/\[([0-9]+)]/,",$1")+"}"}}Object.assign(xr.prototype,{dialect:"postgresql",driverName:"pg",canCancelQuery:!0,_escapeBinding:_r({escapeArray(vr,Sr){return Sr(Mr(vr,Sr))},escapeString(vr){let Sr=!1,wr="'";for(let br=0;br<vr.length;br++){const Ar=vr[br];Ar==="'"?wr+=Ar+Ar:Ar==="\\"?(wr+=Ar+Ar,Sr=!0):wr+=Ar}return wr+="'",Sr===!0&&(wr="E"+wr),wr},escapeObject(vr,Sr,wr,br=[]){if(vr&&typeof vr.toPostgres=="function"){if(br=br||[],br.indexOf(vr)!==-1)throw new Error(`circular reference detected while preparing "${vr}" for query`);return br.push(vr),Sr(vr.toPostgres(Sr),br)}return JSON.stringify(vr)}})});function Mr(vr,Sr){let wr="{";for(let br=0;br<vr.length;br++){br>0&&(wr+=",");const Ar=vr[br];Ar===null||typeof Ar>"u"?wr+="NULL":Array.isArray(Ar)?wr+=Mr(Ar,Sr):typeof Ar=="number"?wr+=Ar:wr+=JSON.stringify(typeof Ar=="string"?Ar:Sr(Ar))}return wr+"}"}return postgres=xr,postgres}var crdbQuerycompiler,hasRequiredCrdbQuerycompiler;function requireCrdbQuerycompiler(){if(hasRequiredCrdbQuerycompiler)return crdbQuerycompiler;hasRequiredCrdbQuerycompiler=1;const e=requirePgQuerycompiler(),{columnize:t,wrap:I,operator:B}=requireWrappingFormatter();class tr extends e{truncate(){return`truncate ${this.tableName}`}upsert(){let ir=this._upsert();if(ir==="")return ir;const{returning:lr}=this.single;return lr&&(ir+=this._returning(lr)),{sql:ir,returning:lr}}_upsert(){const ir=this.single.upsert||[],lr=this.with()+`upsert into ${this.tableName} `,dr=this._insertBody(ir);return dr===""?"":lr+dr}_groupOrder(ir,lr){return this._basicGroupOrder(ir,lr)}whereJsonPath(ir){let lr="";return!isNaN(ir.value)&&parseInt(ir.value)?lr="::int":!isNaN(ir.value)&&parseFloat(ir.value)?lr="::float":lr=" #>> '{}'",`json_extract_path(${this._columnClause(ir)}, ${this.client.toArrayPathFromJsonPath(ir.jsonPath,this.builder,this.bindingsHolder)})${lr} ${B(ir.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(ir)}`}_jsonExtract(ir,lr){let dr;return Array.isArray(lr.column)?dr=lr.column:dr=[lr],dr.map(hr=>{const fr=`json_extract_path(${t(hr.column||hr[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toArrayPathFromJsonPath(hr.path||hr[1],this.builder,this.bindingsHolder)})`,mr=hr.alias||hr[2];return mr?this.client.alias(fr,this.formatter.wrap(mr)):fr}).join(", ")}_onJsonPathEquals(ir,lr){return"json_extract_path("+I(lr.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(lr.jsonPathFirst,this.builder,this.bindingsHolder)+") = json_extract_path("+I(lr.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(lr.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return crdbQuerycompiler=tr,crdbQuerycompiler}var crdbColumncompiler,hasRequiredCrdbColumncompiler;function requireCrdbColumncompiler(){if(hasRequiredCrdbColumncompiler)return crdbColumncompiler;hasRequiredCrdbColumncompiler=1;const e=requirePgColumncompiler();class t extends e{uuid(B={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(B)?" primary key default gen_random_uuid()":"")}}return crdbColumncompiler=t,crdbColumncompiler}var crdbTablecompiler,hasRequiredCrdbTablecompiler;function requireCrdbTablecompiler(){if(hasRequiredCrdbTablecompiler)return crdbTablecompiler;hasRequiredCrdbTablecompiler=1;const e=requirePgTablecompiler();class t extends e{constructor(B,tr){super(B,tr)}addColumns(B,tr,rr){if(tr===this.alterColumnsPrefix)for(const ir of rr)this.client.logger.warn("Experimental alter column in use, see issue: https://github.com/cockroachdb/cockroach/issues/49329"),this.pushQuery({sql:"SET enable_experimental_alter_column_type_general = true",bindings:[]}),super._addColumn(ir);else super.addColumns(B,tr)}dropUnique(B,tr){tr=tr?this.formatter.wrap(tr):this._indexCommand("unique",this.tableNameRaw,B),this.pushQuery(`drop index ${this.tableName()}@${tr} cascade `)}}return crdbTablecompiler=t,crdbTablecompiler}var crdbViewcompiler,hasRequiredCrdbViewcompiler;function requireCrdbViewcompiler(){if(hasRequiredCrdbViewcompiler)return crdbViewcompiler;hasRequiredCrdbViewcompiler=1;const e=requirePgViewcompiler();class t extends e{renameColumn(B,tr){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(B,tr){throw new Error("change default values of views is not supported by this dialect.")}}return crdbViewcompiler=t,crdbViewcompiler}var crdbQuerybuilder,hasRequiredCrdbQuerybuilder;function requireCrdbQuerybuilder(){if(hasRequiredCrdbQuerybuilder)return crdbQuerybuilder;hasRequiredCrdbQuerybuilder=1;const e=requireQuerybuilder(),t=requireIsEmpty();return crdbQuerybuilder=class extends e{upsert(B,tr,rr){return this._method="upsert",t(tr)||this.returning(tr,rr),this._single.upsert=B,this}},crdbQuerybuilder}var cockroachdb,hasRequiredCockroachdb;function requireCockroachdb(){if(hasRequiredCockroachdb)return cockroachdb;hasRequiredCockroachdb=1;const e=requirePostgres(),t=requirePgTransaction(),I=requireCrdbQuerycompiler(),B=requireCrdbColumncompiler(),tr=requireCrdbTablecompiler(),rr=requireCrdbViewcompiler(),ir=requireCrdbQuerybuilder();class lr extends e{transaction(){return new t(this,...arguments)}queryCompiler(hr,fr){return new I(this,hr,fr)}columnCompiler(){return new B(this,...arguments)}tableCompiler(){return new tr(this,...arguments)}viewCompiler(){return new rr(this,...arguments)}queryBuilder(){return new ir(this)}_parseVersion(hr){return hr.split(" ")[2]}async cancelQuery(hr){try{return await this._wrappedCancelQueryCall(null,hr)}catch(fr){throw this.logger.warn(`Connection Error: ${fr}`),fr}}_wrappedCancelQueryCall(hr,fr){if(!(fr.activeQuery.processID===0&&fr.activeQuery.secretKey===0))return fr.cancel(fr,fr.activeQuery)}toArrayPathFromJsonPath(hr,fr,mr){return hr.replace(/^(\$\.)/,"").replace(/\[([0-9]+)]/,".$1").split(".").map((function(_r){return this.parameter(_r,fr,mr)}).bind(this)).join(", ")}}return Object.assign(lr.prototype,{driverName:"cockroachdb"}),cockroachdb=lr,cockroachdb}var isNil_1,hasRequiredIsNil;function requireIsNil(){if(hasRequiredIsNil)return isNil_1;hasRequiredIsNil=1;function e(t){return t==null}return isNil_1=e,isNil_1}var mssqlFormatter,hasRequiredMssqlFormatter;function requireMssqlFormatter(){if(hasRequiredMssqlFormatter)return mssqlFormatter;hasRequiredMssqlFormatter=1;const e=requireFormatter();class t extends e{columnizeWithPrefix(B,tr){const rr=typeof tr=="string"?[tr]:tr;let ir="",lr=-1;for(;++lr<rr.length;)lr>0&&(ir+=", "),ir+=B+this.wrap(rr[lr]);return ir}escapingStringDelimiters(B){return(B||"").replace(/'/g,"''")}}return mssqlFormatter=t,mssqlFormatter}var transaction$4,hasRequiredTransaction$4;function requireTransaction$4(){if(hasRequiredTransaction$4)return transaction$4;hasRequiredTransaction$4=1;const e=requireTransaction$5(),t=requireBrowser()("knex:tx");class I extends e{begin(lr){return t("transaction::begin id=%s",this.txid),new Promise((dr,hr)=>{lr.beginTransaction(fr=>{if(fr)return t("transaction::begin error id=%s message=%s",this.txid,fr.message),hr(fr);dr()},this.outerTx?this.txid:void 0,B(this.isolationLevel))}).then(this._resolver,this._rejecter)}savepoint(lr){return t("transaction::savepoint id=%s",this.txid),new Promise((dr,hr)=>{lr.saveTransaction(fr=>{if(fr)return t("transaction::savepoint id=%s message=%s",this.txid,fr.message),hr(fr);this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:this.outerTx?`SAVE TRANSACTION [${this.txid}]`:"SAVE TRANSACTION"}),dr()},this.outerTx?this.txid:void 0)})}commit(lr,dr){return t("transaction::commit id=%s",this.txid),new Promise((hr,fr)=>{lr.commitTransaction(mr=>{if(mr)return t("transaction::commit error id=%s message=%s",this.txid,mr.message),fr(mr);this._completed=!0,hr(dr)},this.outerTx?this.txid:void 0)}).then(()=>this._resolver(dr),this._rejecter)}release(lr,dr){return this._resolver(dr)}rollback(lr,dr){return this._completed=!0,t("transaction::rollback id=%s",this.txid),new Promise((hr,fr)=>{if(!lr.inTransaction)return fr(dr||new Error("Transaction rejected with non-error: undefined"));if(lr.state.name!=="LoggedIn")return fr(new Error("Can't rollback transaction. There is a request in progress"));lr.rollbackTransaction(mr=>{mr&&t("transaction::rollback error id=%s message=%s",this.txid,mr.message),fr(mr||dr||new Error("Transaction rejected with non-error: undefined"))},this.outerTx?this.txid:void 0)}).catch(hr=>{if(!dr&&this.doNotRejectOnRollback){this._resolver();return}if(dr)try{hr.originalError=dr}catch{}this._rejecter(hr)})}rollbackTo(lr,dr){return this.rollback(lr,dr).then(()=>void this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:"ROLLBACK TRANSACTION"}))}}transaction$4=I;function B(ir){if(!ir)return;ir=ir.toUpperCase().replace(" ","_");const lr=tr[ir];if(!lr)throw new Error(`Unknown Isolation level, was expecting one of: ${JSON.stringify(rr)}`);return lr}const tr={READ_UNCOMMITTED:1,READ_COMMITTED:2,REPEATABLE_READ:3,SERIALIZABLE:4,SNAPSHOT:5},rr=Object.keys(tr).map(ir=>ir.toLowerCase().replace("_"," "));return transaction$4}var mssqlQuerycompiler,hasRequiredMssqlQuerycompiler;function requireMssqlQuerycompiler(){if(hasRequiredMssqlQuerycompiler)return mssqlQuerycompiler;hasRequiredMssqlQuerycompiler=1;const e=requireQuerycompiler(),t=requireCompact(),I=requireIdentity(),B=requireIsEmpty(),tr=requireRaw(),{columnize:rr}=requireWrappingFormatter(),ir=["comments","columns","join","lock","where","union","group","having","order","limit","offset"];class lr extends e{constructor(hr,fr,mr){super(hr,fr,mr);const{onConflict:_r}=this.single;if(_r)throw new Error(".onConflict() is not supported for mssql.");this._emptyInsertValue="default values"}with(){const hr=[];if(this.grouped.with)for(const mr of this.grouped.with)mr.recursive&&(hr.push(mr),mr.recursive=!1);const fr=super.with();for(const mr of hr)mr.recursive=!0;return fr}select(){const hr=this.with(),fr=ir.map(mr=>this[mr](this));return hr+t(fr).join(" ")}insert(){return this.single.options&&this.single.options.includeTriggerModifications?this.insertWithTriggers():this.standardInsert()}insertWithTriggers(){const hr=this.single.insert||[],{returning:fr}=this.single;let mr=this.with()+`${this._buildTempTable(fr)}insert into ${this.tableName} `;const _r=fr?this._returning("insert",fr,!0)+" ":"";if(Array.isArray(hr)){if(hr.length===0)return""}else if(typeof hr=="object"&&B(hr))return{sql:mr+_r+this._emptyInsertValue+this._buildReturningSelect(fr),returning:fr};return mr+=this._buildInsertData(hr,_r),fr&&(mr+=this._buildReturningSelect(fr)),{sql:mr,returning:fr}}_buildInsertData(hr,fr){let mr="";const _r=this._prepInsert(hr);if(typeof _r=="string")mr+=_r;else if(_r.columns.length)mr+=`(${this.formatter.columnize(_r.columns)}`,mr+=`) ${fr}values (`+this._buildInsertValues(_r)+")";else if(hr.length===1&&hr[0])mr+=fr+this._emptyInsertValue;else return"";return mr}standardInsert(){const hr=this.single.insert||[];let fr=this.with()+`insert into ${this.tableName} `;const{returning:mr}=this.single,_r=mr?this._returning("insert",mr)+" ":"";if(Array.isArray(hr)){if(hr.length===0)return""}else if(typeof hr=="object"&&B(hr))return{sql:fr+_r+this._emptyInsertValue,returning:mr};return fr+=this._buildInsertData(hr,_r),{sql:fr,returning:mr}}update(){return this.single.options&&this.single.options.includeTriggerModifications?this.updateWithTriggers():this.standardUpdate()}updateWithTriggers(){const hr=this.top(),fr=this.with(),mr=this._prepUpdate(this.single.update),_r=this.join(),yr=this.where(),xr=this.order(),{returning:Mr}=this.single,vr=this._buildTempTable(Mr);return{sql:fr+vr+`update ${hr?hr+" ":""}${this.tableName} set `+mr.join(", ")+(Mr?` ${this._returning("update",Mr,!0)}`:"")+(_r?` from ${this.tableName} ${_r}`:"")+(yr?` ${yr}`:"")+(xr?` ${xr}`:"")+(Mr?this._buildReturningSelect(Mr):this._returning("rowcount","@@rowcount")),returning:Mr||"@@rowcount"}}_formatGroupsItemValue(hr,fr){const mr=super._formatGroupsItemValue(hr);if(fr&&!(hr instanceof tr)){const _r=`IIF(${mr} is null,`;if(fr==="first")return`${_r}0,1)`;if(fr==="last")return`${_r}1,0)`}return mr}standardUpdate(){const hr=this.top(),fr=this.with(),mr=this._prepUpdate(this.single.update),_r=this.join(),yr=this.where(),xr=this.order(),{returning:Mr}=this.single;return{sql:fr+`update ${hr?hr+" ":""}${this.tableName} set `+mr.join(", ")+(Mr?` ${this._returning("update",Mr)}`:"")+(_r?` from ${this.tableName} ${_r}`:"")+(yr?` ${yr}`:"")+(xr?` ${xr}`:"")+(Mr?"":this._returning("rowcount","@@rowcount")),returning:Mr||"@@rowcount"}}del(){return this.single.options&&this.single.options.includeTriggerModifications?this.deleteWithTriggers():this.standardDelete()}deleteWithTriggers(){const hr=this.with(),{tableName:fr}=this,mr=this.where(),_r=this.join(),{returning:yr}=this.single,xr=yr?` ${this._returning("del",yr,!0)}`:"",Mr=_r?`${fr}${xr} `:"";return{sql:hr+`${this._buildTempTable(yr)}delete ${Mr}from ${fr}`+(_r?"":xr)+(_r?` ${_r}`:"")+(mr?` ${mr}`:"")+(yr?this._buildReturningSelect(yr):this._returning("rowcount","@@rowcount")),returning:yr||"@@rowcount"}}standardDelete(){const hr=this.with(),{tableName:fr}=this,mr=this.where(),_r=this.join(),{returning:yr}=this.single,xr=yr?` ${this._returning("del",yr)}`:"",Mr=_r?`${fr}${xr} `:"";return{sql:hr+`delete ${Mr}from ${fr}`+(_r?"":xr)+(_r?` ${_r}`:"")+(mr?` ${mr}`:"")+(yr?"":this._returning("rowcount","@@rowcount")),returning:yr||"@@rowcount"}}columns(){let hr="";if(this.onlyUnions())return"";const fr=this.top(),mr=this._hintComments(),_r=this.grouped.columns||[];let yr=-1,xr=[];if(_r)for(;++yr<_r.length;){const vr=_r[yr];if(vr.distinct&&(hr="distinct "),vr.distinctOn){hr=this.distinctOn(vr.value);continue}vr.type==="aggregate"?xr.push(...this.aggregate(vr)):vr.type==="aggregateRaw"?xr.push(this.aggregateRaw(vr)):vr.type==="analytic"?xr.push(this.analytic(vr)):vr.type==="json"?xr.push(this.json(vr)):vr.value&&vr.value.length>0&&xr.push(this.formatter.columnize(vr.value))}return xr.length===0&&(xr=["*"]),`${this.onlyJson()?"":"select "}${mr}${hr}`+(fr?fr+" ":"")+xr.join(", ")+(this.tableName?` from ${this.tableName}`:"")}_returning(hr,fr,mr){switch(hr){case"update":case"insert":return fr?`output ${this.formatter.columnizeWithPrefix("inserted.",fr)}${mr?" into #out":""}`:"";case"del":return fr?`output ${this.formatter.columnizeWithPrefix("deleted.",fr)}${mr?" into #out":""}`:"";case"rowcount":return fr?";select @@rowcount":""}}_buildTempTable(hr){if(hr&&hr.length>0){let fr="";Array.isArray(hr)?fr=hr.map(_r=>`[t].${this.formatter.columnize(_r)}`).join(","):fr=`[t].${this.formatter.columnize(hr)}`;let mr=`select top(0) ${fr} into #out `;return mr+=`from ${this.tableName} as t `,mr+=`left join ${this.tableName} on 0=1;`,mr}return""}_buildReturningSelect(hr){if(hr&&hr.length>0){let fr="";Array.isArray(hr)?fr=hr.map(_r=>`${this.formatter.columnize(_r)}`).join(","):fr=this.formatter.columnize(hr);let mr=`; select ${fr} from #out; `;return mr+="drop table #out;",mr}return""}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"with (UPDLOCK)"}forShare(){return"with (HOLDLOCK)"}columnInfo(){const hr=this.single.columnInfo;let fr=this.single.schema;const mr=this.client.customWrapIdentifier(this.single.table,I);fr&&(fr=this.client.customWrapIdentifier(fr,I));let _r="select [COLUMN_NAME], [COLUMN_DEFAULT], [DATA_TYPE], [CHARACTER_MAXIMUM_LENGTH], [IS_NULLABLE] from INFORMATION_SCHEMA.COLUMNS where table_name = ? and table_catalog = ?";const yr=[mr,this.client.database()];return fr?(_r+=" and table_schema = ?",yr.push(fr)):_r+=" and table_schema = 'dbo'",{sql:_r,bindings:yr,output(xr){const Mr=xr.reduce((vr,Sr)=>(vr[Sr[0].value]={defaultValue:Sr[1].value,type:Sr[2].value,maxLength:Sr[3].value,nullable:Sr[4].value==="YES"},vr),{});return hr&&Mr[hr]||Mr}}}top(){const hr=!this.single.limit&&this.single.limit!==0,fr=!this.single.offset;return hr||!fr?"":`top (${this._getValueOrParameterFromAttribute("limit")})`}limit(){return""}offset(){const hr=!this.single.limit&&this.single.limit!==0,fr=!this.single.offset;if(fr)return"";let mr=`offset ${fr?"0":this._getValueOrParameterFromAttribute("offset")} rows`;return hr||(mr+=` fetch next ${this._getValueOrParameterFromAttribute("limit")} rows only`),mr}whereLike(hr){return`${this._columnClause(hr)} collate SQL_Latin1_General_CP1_CS_AS ${this._not(hr,"like ")}${this._valueClause(hr)}`}whereILike(hr){return`${this._columnClause(hr)} collate SQL_Latin1_General_CP1_CI_AS ${this._not(hr,"like ")}${this._valueClause(hr)}`}jsonExtract(hr){return this._jsonExtract(hr.singleValue?"JSON_VALUE":"JSON_QUERY",hr)}jsonSet(hr){return this._jsonSet("JSON_MODIFY",hr)}jsonInsert(hr){return this._jsonSet("JSON_MODIFY",hr)}jsonRemove(hr){const fr=`JSON_MODIFY(${rr(hr.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(hr.path,this.builder,this.bindingsHolder)}, NULL)`;return hr.alias?this.client.alias(fr,this.formatter.wrap(hr.alias)):fr}whereJsonPath(hr){return this._whereJsonPath("JSON_VALUE",hr)}whereJsonSupersetOf(hr){throw new Error("Json superset where clause not actually supported by MSSQL")}whereJsonSubsetOf(hr){throw new Error("Json subset where clause not actually supported by MSSQL")}_getExtracts(hr,fr){const mr=rr(hr.column,this.builder,this.client,this.bindingsHolder);return(Array.isArray(hr.values)?hr.values:[hr.values]).map(function(_r){return"JSON_VALUE("+mr+","+this.client.parameter(_r,this.builder,this.bindingsHolder)+")"},this).join(fr)}onJsonPathEquals(hr){return this._onJsonPathEquals("JSON_VALUE",hr)}}return mssqlQuerycompiler=lr,mssqlQuerycompiler}var mssqlCompiler,hasRequiredMssqlCompiler;function requireMssqlCompiler(){if(hasRequiredMssqlCompiler)return mssqlCompiler;hasRequiredMssqlCompiler=1;const e=requireCompiler$1();class t extends e{constructor(tr,rr){super(tr,rr)}dropTableIfExists(tr){const rr=this.formatter.wrap(I(this.schema,tr));this.pushQuery(`if object_id('${rr}', 'U') is not null DROP TABLE ${rr}`)}dropViewIfExists(tr){const rr=this.formatter.wrap(I(this.schema,tr));this.pushQuery(`if object_id('${rr}', 'V') is not null DROP VIEW ${rr}`)}renameTable(tr,rr){this.pushQuery(`exec sp_rename ${this.client.parameter(I(this.schema,tr),this.builder,this.bindingsHolder)}, ${this.client.parameter(rr,this.builder,this.bindingsHolder)}`)}renameView(tr,rr){this.pushQuery(`exec sp_rename ${this.client.parameter(I(this.schema,tr),this.builder,this.bindingsHolder)}, ${this.client.parameter(rr,this.builder,this.bindingsHolder)}`)}hasTable(tr){const rr=this.client.parameter(I(this.schema,tr),this.builder,this.bindingsHolder),ir=[tr];let lr=`SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ${rr}`;this.schema&&(lr+=" AND TABLE_SCHEMA = ?",ir.push(this.schema)),this.pushQuery({sql:lr,bindings:ir,output:dr=>dr.length>0})}hasColumn(tr,rr){const ir=this.client.parameter(rr,this.builder,this.bindingsHolder),lr=this.client.parameter(this.formatter.wrap(I(this.schema,tr)),this.builder,this.bindingsHolder),dr=`select object_id from sys.columns where name = ${ir} and object_id = object_id(${lr})`;this.pushQuery({sql:dr,output:hr=>hr.length>0})}}t.prototype.dropTablePrefix="DROP TABLE ";function I(B,tr){return B?`${B}.${tr}`:tr}return mssqlCompiler=t,mssqlCompiler}var mssqlTablecompiler,hasRequiredMssqlTablecompiler;function requireMssqlTablecompiler(){if(hasRequiredMssqlTablecompiler)return mssqlTablecompiler;hasRequiredMssqlTablecompiler=1;const e=requireTablecompiler(),t=requireHelpers$1(),{isObject:I}=requireIs();class B extends e{constructor(rr,ir){super(rr,ir)}createQuery(rr,ir,lr){let dr=ir?`if object_id('${this.tableName()}', 'U') is null `:"";lr?dr+=`SELECT * INTO ${this.tableName()} FROM ${this.tableNameLike()} WHERE 0=1`:dr+="CREATE TABLE "+this.tableName()+(this._formatting?` (
|
|
86
|
-
`:" (")+rr.sql.join(this._formatting?`,
|
|
87
|
-
`:", ")+this._addChecks()+")",this.pushQuery(dr),this.single.comment&&this.comment(this.single.comment),lr&&this.addColumns(rr,this.addColumnsPrefix)}comment(rr){if(!rr)return;rr.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const ir=this.formatter.escapingStringDelimiters(rr),lr=this.formatter.escapingStringDelimiters(this.schemaNameRaw||"dbo"),dr=this.formatter.escapingStringDelimiters(this.tableNameRaw),hr=`N'MS_Description', N'${ir}', N'Schema', N'${lr}', N'Table', N'${dr}'`,fr=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${lr}', N'Table', N'${dr}', NULL, NULL))`;this.pushQuery(`IF ${fr}
|
|
88
|
-
EXEC sys.sp_updateextendedproperty ${hr}
|
|
89
|
-
ELSE
|
|
90
|
-
EXEC sys.sp_addextendedproperty ${hr}`)}addColumns(rr,ir){ir=ir||this.addColumnsPrefix,rr.sql.length>0&&this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+ir+rr.sql.join(", "),bindings:rr.bindings})}alterColumns(rr,ir){for(let lr=0,dr=ir.length;lr<dr;lr++){const hr=ir[lr];if(hr.modified.defaultTo){const mr=`
|
|
91
|
-
DECLARE @constraint varchar(100) = (SELECT default_constraints.name
|
|
92
|
-
FROM sys.all_columns
|
|
93
|
-
INNER JOIN sys.tables
|
|
94
|
-
ON all_columns.object_id = tables.object_id
|
|
95
|
-
INNER JOIN sys.schemas
|
|
96
|
-
ON tables.schema_id = schemas.schema_id
|
|
97
|
-
INNER JOIN sys.default_constraints
|
|
98
|
-
ON all_columns.default_object_id = default_constraints.object_id
|
|
99
|
-
WHERE schemas.name = '${this.schemaNameRaw||"dbo"}'
|
|
100
|
-
AND tables.name = '${this.tableNameRaw}'
|
|
101
|
-
AND all_columns.name = '${hr.getColumnName()}')
|
|
102
|
-
|
|
103
|
-
IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(mr)}}rr.sql.forEach(lr=>{this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+(this.lowerCase?this.alterColumnPrefix.toLowerCase():this.alterColumnPrefix)+lr,bindings:rr.bindings})})}dropColumn(){const rr=this,ir=t.normalizeArr.apply(null,arguments),dr=(Array.isArray(ir)?ir:[ir]).map(fr=>rr.formatter.wrap(fr)),hr=this.schemaNameRaw||"dbo";for(const fr of ir){const mr=`
|
|
104
|
-
DECLARE @constraint varchar(100) = (SELECT default_constraints.name
|
|
105
|
-
FROM sys.all_columns
|
|
106
|
-
INNER JOIN sys.tables
|
|
107
|
-
ON all_columns.object_id = tables.object_id
|
|
108
|
-
INNER JOIN sys.schemas
|
|
109
|
-
ON tables.schema_id = schemas.schema_id
|
|
110
|
-
INNER JOIN sys.default_constraints
|
|
111
|
-
ON all_columns.default_object_id = default_constraints.object_id
|
|
112
|
-
WHERE schemas.name = '${hr}'
|
|
113
|
-
AND tables.name = '${this.tableNameRaw}'
|
|
114
|
-
AND all_columns.name = '${fr}')
|
|
115
|
-
|
|
116
|
-
IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(mr)}this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+this.dropColumnPrefix+dr.join(", "))}changeType(){}renameColumn(rr,ir){this.pushQuery(`exec sp_rename ${this.client.parameter(this.tableName()+"."+rr,this.tableBuilder,this.bindingsHolder)}, ${this.client.parameter(ir,this.tableBuilder,this.bindingsHolder)}, 'COLUMN'`)}dropFKRefs(rr,ir){const lr=this.client.formatter(this.tableBuilder);return Promise.all(ir.map(function(dr){const hr=lr.wrap(dr.CONSTRAINT_NAME),fr=lr.wrap(dr.TABLE_NAME);return rr.query({sql:`ALTER TABLE ${fr} DROP CONSTRAINT ${hr}`})}))}createFKRefs(rr,ir){const lr=this.client.formatter(this.tableBuilder);return Promise.all(ir.map(function(dr){const hr=lr.wrap(dr.TABLE_NAME),fr=lr.wrap(dr.CONSTRAINT_NAME),mr=lr.columnize(dr.COLUMN_NAME),_r=lr.columnize(dr.REFERENCED_COLUMN_NAME),yr=lr.wrap(dr.REFERENCED_TABLE_NAME),xr=` ON UPDATE ${dr.UPDATE_RULE}`,Mr=` ON DELETE ${dr.DELETE_RULE}`;return rr.query({sql:`ALTER TABLE ${hr} ADD CONSTRAINT ${fr} FOREIGN KEY (`+mr+") REFERENCES "+yr+" ("+_r+")"+xr+Mr})}))}index(rr,ir,lr){ir=ir?this.formatter.wrap(ir):this._indexCommand("index",this.tableNameRaw,rr);let dr;I(lr)&&({predicate:dr}=lr);const hr=dr?" "+this.client.queryCompiler(dr).where():"";this.pushQuery(`CREATE INDEX ${ir} ON ${this.tableName()} (${this.formatter.columnize(rr)})${hr}`)}primary(rr,ir){let lr;I(ir)&&({constraintName:ir,deferrable:lr}=ir),lr&&lr!=="not deferrable"&&this.client.logger.warn(`mssql: primary key constraint [${ir}] will not be deferrable ${lr} because mssql does not support deferred constraints.`),ir=ir?this.formatter.wrap(ir):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.forCreate?this.pushQuery(`CONSTRAINT ${ir} PRIMARY KEY (${this.formatter.columnize(rr)})`):this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${ir} PRIMARY KEY (${this.formatter.columnize(rr)})`)}unique(rr,ir){let lr,dr=!1,hr;if(I(ir)&&({indexName:ir,deferrable:lr,useConstraint:dr,predicate:hr}=ir),lr&&lr!=="not deferrable"&&this.client.logger.warn(`mssql: unique index [${ir}] will not be deferrable ${lr} because mssql does not support deferred constraints.`),dr&&hr)throw new Error("mssql cannot create constraint with predicate");if(ir=ir?this.formatter.wrap(ir):this._indexCommand("unique",this.tableNameRaw,rr),Array.isArray(rr)||(rr=[rr]),dr)this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${ir} UNIQUE (${this.formatter.columnize(rr)})`);else{const fr=hr?" "+this.client.queryCompiler(hr).where():" WHERE "+rr.map(mr=>this.formatter.columnize(mr)+" IS NOT NULL").join(" AND ");this.pushQuery(`CREATE UNIQUE INDEX ${ir} ON ${this.tableName()} (${this.formatter.columnize(rr)})${fr}`)}}dropIndex(rr,ir){ir=ir?this.formatter.wrap(ir):this._indexCommand("index",this.tableNameRaw,rr),this.pushQuery(`DROP INDEX ${ir} ON ${this.tableName()}`)}dropForeign(rr,ir){ir=ir?this.formatter.wrap(ir):this._indexCommand("foreign",this.tableNameRaw,rr),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${ir}`)}dropPrimary(rr){rr=rr?this.formatter.wrap(rr):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${rr}`)}dropUnique(rr,ir){ir=ir?this.formatter.wrap(ir):this._indexCommand("unique",this.tableNameRaw,rr),this.pushQuery(`DROP INDEX ${ir} ON ${this.tableName()}`)}}return B.prototype.createAlterTableMethods=["foreign","primary"],B.prototype.lowerCase=!1,B.prototype.addColumnsPrefix="ADD ",B.prototype.dropColumnPrefix="DROP COLUMN ",B.prototype.alterColumnPrefix="ALTER COLUMN ",mssqlTablecompiler=B,mssqlTablecompiler}var mssqlViewcompiler,hasRequiredMssqlViewcompiler;function requireMssqlViewcompiler(){if(hasRequiredMssqlViewcompiler)return mssqlViewcompiler;hasRequiredMssqlViewcompiler=1;const e=requireViewcompiler(),{columnize:t}=requireWrappingFormatter();class I extends e{constructor(tr,rr){super(tr,rr)}createQuery(tr,rr,ir,lr){let hr="CREATE "+(lr?"OR ALTER ":"")+"VIEW "+this.viewName();const fr=tr?" ("+t(tr,this.viewBuilder,this.client,this.bindingsHolder)+")":"";hr+=fr,hr+=" AS ",hr+=rr.toString(),this.pushQuery({sql:hr})}renameColumn(tr,rr){this.pushQuery(`exec sp_rename ${this.client.parameter(this.viewName()+"."+tr,this.viewBuilder,this.bindingsHolder)}, ${this.client.parameter(rr,this.viewBuilder,this.bindingsHolder)}, 'COLUMN'`)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return mssqlViewcompiler=I,mssqlViewcompiler}var mssqlColumncompiler,hasRequiredMssqlColumncompiler;function requireMssqlColumncompiler(){if(hasRequiredMssqlColumncompiler)return mssqlColumncompiler;hasRequiredMssqlColumncompiler=1;const e=requireColumncompiler(),{toNumber:t}=requireHelpers$1(),{formatDefault:I}=requireFormatterUtils(),{operator:B}=requireWrappingFormatter();class tr extends e{constructor(ir,lr,dr){super(ir,lr,dr),this.modifiers=["nullable","defaultTo","first","after","comment"],this._addCheckModifiers()}double(ir,lr){return"float"}floating(ir,lr){return"float"}integer(){return"int"}tinyint(){return"tinyint"}varchar(ir){return`nvarchar(${t(ir,255)})`}timestamp({useTz:ir=!1}={}){return ir?"datetimeoffset":"datetime2"}bit(ir){return ir>1&&this.client.logger.warn("Bit field is exactly 1 bit length for MSSQL"),"bit"}binary(ir){return ir?`varbinary(${t(ir)})`:"varbinary(max)"}first(){return this.client.logger.warn("Column first modifier not available for MSSQL"),""}after(ir){return this.client.logger.warn("Column after modifier not available for MSSQL"),""}defaultTo(ir,{constraintName:lr}={}){const dr=I(ir,this.type,this.client);return lr=typeof lr<"u"?lr:`${this.tableCompiler.tableNameRaw}_${this.getColumnName()}_default`.toLowerCase(),this.columnBuilder._method==="alter"?(this.pushAdditional(function(){this.pushQuery(`ALTER TABLE ${this.tableCompiler.tableName()} ADD CONSTRAINT ${this.formatter.wrap(lr)} DEFAULT ${dr} FOR ${this.formatter.wrap(this.getColumnName())}`)}),""):lr?`CONSTRAINT ${this.formatter.wrap(lr)} DEFAULT ${dr}`:`DEFAULT ${dr}`}comment(ir){if(!ir)return;ir&&ir.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const lr=this.formatter.escapingStringDelimiters(ir),dr=this.tableCompiler.schemaNameRaw||"dbo",hr=this.formatter.escapingStringDelimiters(this.tableCompiler.tableNameRaw),fr=this.formatter.escapingStringDelimiters(this.args[0]||this.defaults("columnName")),mr=`N'MS_Description', N'${lr}', N'Schema', N'${dr}', N'Table', N'${hr}', N'Column', N'${fr}'`;return this.pushAdditional(function(){const _r=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${dr}', N'Table', N'${hr}', N'Column', N'${fr}'))`;this.pushQuery(`IF ${_r}
|
|
117
|
-
EXEC sys.sp_updateextendedproperty ${mr}
|
|
118
|
-
ELSE
|
|
119
|
-
EXEC sys.sp_addextendedproperty ${mr}`)}),""}checkLength(ir,lr,dr){return this._check(`LEN(${this.formatter.wrap(this.getColumnName())}) ${B(ir,this.columnBuilder,this.bindingsHolder)} ${t(lr)}`,dr)}checkRegex(ir,lr){return this._check(`${this.formatter.wrap(this.getColumnName())} LIKE ${this.client._escapeBinding("%"+ir+"%")}`,lr)}increments(ir={primaryKey:!0}){return"int identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(ir)?" primary key":"")}bigincrements(ir={primaryKey:!0}){return"bigint identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(ir)?" primary key":"")}}return tr.prototype.bigint="bigint",tr.prototype.mediumint="int",tr.prototype.smallint="smallint",tr.prototype.text="nvarchar(max)",tr.prototype.mediumtext="nvarchar(max)",tr.prototype.longtext="nvarchar(max)",tr.prototype.json=tr.prototype.jsonb="nvarchar(max)",tr.prototype.enu="nvarchar(100)",tr.prototype.uuid=({useBinaryUuid:rr=!1}={})=>rr?"binary(16)":"uniqueidentifier",tr.prototype.datetime="datetime2",tr.prototype.bool="bit",mssqlColumncompiler=tr,mssqlColumncompiler}var mssql,hasRequiredMssql;function requireMssql(){if(hasRequiredMssql)return mssql;hasRequiredMssql=1;const e=requireMap(),t=requireIsNil(),I=requireClient(),B=requireMssqlFormatter(),tr=requireTransaction$4(),rr=requireMssqlQuerycompiler(),ir=requireMssqlCompiler(),lr=requireMssqlTablecompiler(),dr=requireMssqlViewcompiler(),hr=requireMssqlColumncompiler(),fr=requireQuerybuilder(),{setHiddenProperty:mr}=requireSecurity(),_r=requireBrowser()("knex:mssql"),yr={MIN:-2147483648,MAX:2147483647},xr={MIN:-9007199254740991,MAX:9007199254740991};class Mr extends I{constructor(Sr={}){super(Sr)}_generateConnection(){const Sr=this.connectionSettings;Sr.options=Sr.options||{};const wr={authentication:{type:Sr.type||"default",options:{userName:Sr.userName||Sr.user,password:Sr.password,domain:Sr.domain,token:Sr.token,clientId:Sr.clientId,clientSecret:Sr.clientSecret,tenantId:Sr.tenantId,msiEndpoint:Sr.msiEndpoint}},server:Sr.server||Sr.host,options:{database:Sr.database,encrypt:Sr.encrypt||!1,port:Sr.port||1433,connectTimeout:Sr.connectionTimeout||Sr.timeout||15e3,requestTimeout:t(Sr.requestTimeout)?15e3:Sr.requestTimeout,rowCollectionOnDone:!1,rowCollectionOnRequestCompletion:!1,useColumnNames:!1,tdsVersion:Sr.options.tdsVersion||"7_4",appName:Sr.options.appName||"knex",trustServerCertificate:!1,...Sr.options}};return wr.authentication.options.password&&mr(wr.authentication.options),wr.options.instanceName&&delete wr.options.port,isNaN(wr.options.requestTimeout)&&(wr.options.requestTimeout=15e3),wr.options.requestTimeout===1/0&&(wr.options.requestTimeout=0),wr.options.requestTimeout<0&&(wr.options.requestTimeout=0),Sr.debug&&(wr.options.debug={packet:!0,token:!0,data:!0,payload:!0}),wr}_driver(){return require$$1}formatter(){return new B(this,...arguments)}transaction(){return new tr(this,...arguments)}queryCompiler(){return new rr(this,...arguments)}schemaCompiler(){return new ir(this,...arguments)}tableCompiler(){return new lr(this,...arguments)}viewCompiler(){return new dr(this,...arguments)}queryBuilder(){return new fr(this)}columnCompiler(){return new hr(this,...arguments)}wrapIdentifierImpl(Sr){return Sr==="*"?"*":`[${Sr.replace(/[[\]]+/g,"")}]`}acquireRawConnection(){return new Promise((Sr,wr)=>{_r("connection::connection new connection requested");const br=this._driver(),Ar=Object.assign({},this._generateConnection()),kr=new br.Connection(Ar);kr.connect(Dr=>Dr?(_r("connection::connect error: %s",Dr.message),wr(Dr)):(_r("connection::connect connected to server"),kr.connected=!0,kr.on("error",Or=>{_r("connection::error message=%s",Or.message),kr.__knex__disposed=Or,kr.connected=!1}),kr.once("end",()=>{kr.connected=!1,kr.__knex__disposed="Connection to server was terminated.",_r("connection::end connection ended.")}),Sr(kr)))})}validateConnection(Sr){return Sr&&Sr.connected}destroyRawConnection(Sr){return _r("connection::destroy"),new Promise(wr=>{Sr.once("end",()=>{wr()}),Sr.close()})}positionBindings(Sr){let wr=-1;return Sr.replace(/\\?\?/g,br=>br==="\\?"?"?":(wr+=1,`@p${wr}`))}_chomp(Sr){if(Sr.state.name==="LoggedIn"){const wr=this.requestQueue.pop();wr&&(_r("connection::query executing query, %d more in queue",this.requestQueue.length),Sr.execSql(wr))}}_enqueueRequest(Sr,wr){this.requestQueue.push(Sr),this._chomp(wr)}_makeRequest(Sr,wr){const br=this._driver(),Ar=typeof Sr=="string"?Sr:Sr.sql;let kr=0;if(!Ar)throw new Error("The query is empty");_r("request::request sql=%s",Ar);const Dr=new br.Request(Ar,(Or,zr)=>{if(Or)return _r("request::error message=%s",Or.message),wr(Or);kr=zr,_r("request::callback rowCount=%d",kr)});return Dr.on("prepared",()=>{_r("request %s::request prepared",this.id)}),Dr.on("done",(Or,zr)=>{_r("request::done rowCount=%d more=%s",Or,zr)}),Dr.on("doneProc",(Or,zr)=>{_r("request::doneProc id=%s rowCount=%d more=%s",Dr.id,Or,zr)}),Dr.on("doneInProc",(Or,zr)=>{_r("request::doneInProc id=%s rowCount=%d more=%s",Dr.id,Or,zr)}),Dr.once("requestCompleted",()=>(_r("request::completed id=%s",Dr.id),wr(null,kr))),Dr.on("error",Or=>(_r("request::error id=%s message=%s",Dr.id,Or.message),wr(Or))),Dr}_stream(Sr,wr,br){return new Promise((Ar,kr)=>{const Dr=this._makeRequest(wr,Or=>{if(Or)return br.emit("error",Or),kr(Or);Ar()});Dr.on("row",Or=>{br.write(Or.reduce((zr,$n)=>({...zr,[$n.metadata.colName]:$n.value}),{}))}),Dr.on("error",Or=>{br.emit("error",Or),kr(Or)}),Dr.once("requestCompleted",()=>{br.end(),Ar()}),this._assignBindings(Dr,wr.bindings),this._enqueueRequest(Dr,Sr)})}_assignBindings(Sr,wr){if(Array.isArray(wr))for(let br=0;br<wr.length;br++){const Ar=wr[br];this._setReqInput(Sr,br,Ar)}}_scaleForBinding(Sr){if(Sr%1===0)throw new Error(`The binding value ${Sr} must be a decimal number.`);return{scale:10}}_typeForBinding(Sr){const wr=this._driver();if(this.connectionSettings.options&&this.connectionSettings.options.mapBinding){const br=this.connectionSettings.options.mapBinding(Sr);if(br)return[br.value,br.type]}switch(typeof Sr){case"string":return[Sr,wr.TYPES.NVarChar];case"boolean":return[Sr,wr.TYPES.Bit];case"number":{if(Sr%1!==0)return[Sr,wr.TYPES.Float];if(Sr<yr.MIN||Sr>yr.MAX){if(Sr<xr.MIN||Sr>xr.MAX)throw new Error(`Bigint must be safe integer or must be passed as string, saw ${Sr}`);return[Sr,wr.TYPES.BigInt]}return[Sr,wr.TYPES.Int]}default:return Sr instanceof Date?[Sr,wr.TYPES.DateTime]:Sr instanceof Buffer?[Sr,wr.TYPES.VarBinary]:[Sr,wr.TYPES.NVarChar]}}_query(Sr,wr){return new Promise((br,Ar)=>{const kr=[],Dr=this._makeRequest(wr,(Or,zr)=>{if(Or)return Ar(Or);wr.response=kr,process.nextTick(()=>this._chomp(Sr)),br(wr)});Dr.on("row",Or=>{_r("request::row"),kr.push(Or)}),this._assignBindings(Dr,wr.bindings),this._enqueueRequest(Dr,Sr)})}_setReqInput(Sr,wr,br){const[Ar,kr]=this._typeForBinding(br),Dr="p".concat(wr);let Or;typeof Ar=="number"&&Ar%1!==0&&(Or=this._scaleForBinding(Ar)),_r("request::binding pos=%d type=%s value=%s",wr,kr.name,Ar),Buffer.isBuffer(Ar)&&(Or={length:"max"}),Sr.addParameter(Dr,kr,Ar,Or)}processResponse(Sr,wr){if(Sr==null)return;let{response:br}=Sr;const{method:Ar}=Sr;if(Sr.output||(br=br.map(kr=>kr.reduce((Dr,Or)=>{const zr=Or.metadata.colName;return Dr[zr]?(Array.isArray(Dr[zr])||(Dr[zr]=[Dr[zr]]),Dr[zr].push(Or.value)):Dr[zr]=Or.value,Dr},{})),Sr.output))return Sr.output.call(wr,br);switch(Ar){case"select":return br;case"first":return br[0];case"pluck":return e(br,Sr.pluck);case"insert":case"del":case"update":case"counter":return Sr.returning&&Sr.returning==="@@rowcount"?br[0][""]:br;default:return br}}}return Object.assign(Mr.prototype,{requestQueue:[],dialect:"mssql",driverName:"mssql"}),mssql=Mr,mssql}var _baseDelay,hasRequired_baseDelay;function require_baseDelay(){if(hasRequired_baseDelay)return _baseDelay;hasRequired_baseDelay=1;var e="Expected a function";function t(I,B,tr){if(typeof I!="function")throw new TypeError(e);return setTimeout(function(){I.apply(void 0,tr)},B)}return _baseDelay=t,_baseDelay}var defer_1,hasRequiredDefer;function requireDefer(){if(hasRequiredDefer)return defer_1;hasRequiredDefer=1;var e=require_baseDelay(),t=require_baseRest(),I=t(function(B,tr){return e(B,1,tr)});return defer_1=I,defer_1}var transaction$3,hasRequiredTransaction$3;function requireTransaction$3(){if(hasRequiredTransaction$3)return transaction$3;hasRequiredTransaction$3=1;const e=requireTransaction$5(),I=requireBrowser()("knex:tx");class B extends e{query(rr,ir,lr,dr){const hr=this,fr=this.trxClient.query(rr,ir).catch(mr=>{if(mr.errno===1305){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}lr=2,dr=mr,hr._completed=!0,I("%s error running transaction query",hr.txid)}).then(function(mr){if(lr===1&&hr._resolver(dr),lr===2){if(dr===void 0){if(hr.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(ir)){hr._resolver();return}dr=new Error(`Transaction rejected with non-error: ${dr}`)}hr._rejecter(dr)}return mr});return(lr===1||lr===2)&&(hr._completed=!0),fr}}return transaction$3=B,transaction$3}var mysqlQuerybuilder,hasRequiredMysqlQuerybuilder;function requireMysqlQuerybuilder(){if(hasRequiredMysqlQuerybuilder)return mysqlQuerybuilder;hasRequiredMysqlQuerybuilder=1;const e=requireQuerybuilder(),t=requireIsEmpty();return mysqlQuerybuilder=class extends e{upsert(B,tr,rr){return this._method="upsert",t(tr)||this.returning(tr,rr),this._single.upsert=B,this}},mysqlQuerybuilder}var mysqlQuerycompiler,hasRequiredMysqlQuerycompiler;function requireMysqlQuerycompiler(){if(hasRequiredMysqlQuerycompiler)return mysqlQuerycompiler;hasRequiredMysqlQuerycompiler=1;const e=requireAssert(),t=requireIdentity(),I=requireIsPlainObject(),B=requireIsEmpty(),tr=requireQuerycompiler(),{wrapAsIdentifier:rr}=requireFormatterUtils(),{columnize:ir,wrap:lr}=requireWrappingFormatter(),dr=fr=>I(fr)||Array.isArray(fr);class hr extends tr{constructor(mr,_r,yr){super(mr,_r,yr);const{returning:xr}=this.single;xr&&this.client.logger.warn(".returning() is not supported by mysql and will not have any effect."),this._emptyInsertValue="() values ()"}del(){const mr=super.del();if(mr==="")return mr;const _r=this.comments();return(_r===""?"":_r+" ")+mr}insert(){let mr=super.insert();if(mr==="")return mr;const _r=this.comments();mr=(_r===""?"":_r+" ")+mr;const{ignore:yr,merge:xr,insert:Mr}=this.single;if(yr&&(mr=mr.replace("insert into","insert ignore into")),xr&&(mr+=this._merge(xr.updates,Mr),this.where()))throw new Error(".onConflict().merge().where() is not supported for mysql");return mr}upsert(){const mr=this.single.upsert||[],_r=this.with()+`replace into ${this.tableName} `,yr=this._insertBody(mr);return yr===""?"":_r+yr}_merge(mr,_r){const yr=" on duplicate key update ";if(mr&&Array.isArray(mr))return yr+mr.map(xr=>rr(xr,this.formatter.builder,this.client)).map(xr=>`${xr} = values(${xr})`).join(", ");if(mr&&typeof mr=="object"){const xr=this._prepUpdate(mr);return yr+xr.join(",")}else{const xr=this._prepInsert(_r);if(typeof xr=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return yr+xr.columns.map(Mr=>rr(Mr,this.builder,this.client)).map(Mr=>`${Mr} = values(${Mr})`).join(", ")}}update(){const mr=this.comments(),_r=this.with(),yr=this.join(),xr=this._prepUpdate(this.single.update),Mr=this.where(),vr=this.order(),Sr=this.limit();return(mr===""?"":mr+" ")+_r+`update ${this.tableName}`+(yr?` ${yr}`:"")+" set "+xr.join(", ")+(Mr?` ${Mr}`:"")+(vr?` ${vr}`:"")+(Sr?` ${Sr}`:"")}forUpdate(){return"for update"}forShare(){return"lock in share mode"}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const mr=this.single.columnInfo;return{sql:"select * from information_schema.columns where table_name = ? and table_schema = ?",bindings:[this.client.customWrapIdentifier(this.single.table,t),this.client.database()],output(yr){const xr=yr.reduce(function(Mr,vr){return Mr[vr.COLUMN_NAME]={defaultValue:vr.COLUMN_DEFAULT==="NULL"?null:vr.COLUMN_DEFAULT,type:vr.DATA_TYPE,maxLength:vr.CHARACTER_MAXIMUM_LENGTH,nullable:vr.IS_NULLABLE==="YES"},Mr},{});return mr&&xr[mr]||xr}}}limit(){const mr=!this.single.limit&&this.single.limit!==0;return mr&&!this.single.offset?"":`limit ${this.single.offset&&mr?"18446744073709551615":this._getValueOrParameterFromAttribute("limit")}`}whereBasic(mr){return e(!dr(mr.value),"The values in where clause must not be object or array."),super.whereBasic(mr)}whereRaw(mr){return e(B(mr.value.bindings)||!Object.values(mr.value.bindings).some(dr),"The values in where clause must not be object or array."),super.whereRaw(mr)}whereLike(mr){return`${this._columnClause(mr)} ${this._not(mr,"like ")}${this._valueClause(mr)} COLLATE utf8_bin`}whereILike(mr){return`${this._columnClause(mr)} ${this._not(mr,"like ")}${this._valueClause(mr)}`}jsonExtract(mr){return this._jsonExtract(["json_extract","json_unquote"],mr)}jsonSet(mr){return this._jsonSet("json_set",mr)}jsonInsert(mr){return this._jsonSet("json_insert",mr)}jsonRemove(mr){const _r=`json_remove(${ir(mr.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(mr.path,this.builder,this.bindingsHolder)})`;return mr.alias?this.client.alias(_r,this.formatter.wrap(mr.alias)):_r}whereJsonObject(mr){return this._not(mr,`json_contains(${this._columnClause(mr)}, ${this._jsonValueClause(mr)})`)}whereJsonPath(mr){return this._whereJsonPath("json_extract",mr)}whereJsonSupersetOf(mr){return this._not(mr,`json_contains(${lr(mr.column,void 0,this.builder,this.client,this.bindingsHolder)},${this._jsonValueClause(mr)})`)}whereJsonSubsetOf(mr){return this._not(mr,`json_contains(${this._jsonValueClause(mr)},${lr(mr.column,void 0,this.builder,this.client,this.bindingsHolder)})`)}onJsonPathEquals(mr){return this._onJsonPathEquals("json_extract",mr)}}return mysqlQuerycompiler=hr,mysqlQuerycompiler}var mysqlCompiler,hasRequiredMysqlCompiler;function requireMysqlCompiler(){if(hasRequiredMysqlCompiler)return mysqlCompiler;hasRequiredMysqlCompiler=1;const e=requireCompiler$1();class t extends e{constructor(B,tr){super(B,tr)}renameTable(B,tr){this.pushQuery(`rename table ${this.formatter.wrap(B)} to ${this.formatter.wrap(tr)}`)}renameView(B,tr){this.renameTable(B,tr)}hasTable(B){let tr="select * from information_schema.tables where table_name = ?";const rr=[B];this.schema?(tr+=" and table_schema = ?",rr.push(this.schema)):tr+=" and table_schema = database()",this.pushQuery({sql:tr,bindings:rr,output:function(lr){return lr.length>0}})}hasColumn(B,tr){this.pushQuery({sql:`show columns from ${this.formatter.wrap(B)}`,output(rr){return rr.some(ir=>this.client.wrapIdentifier(ir.Field.toLowerCase())===this.client.wrapIdentifier(tr.toLowerCase()))}})}}return mysqlCompiler=t,mysqlCompiler}var mysqlTablecompiler,hasRequiredMysqlTablecompiler;function requireMysqlTablecompiler(){if(hasRequiredMysqlTablecompiler)return mysqlTablecompiler;hasRequiredMysqlTablecompiler=1;const e=requireTablecompiler(),{isObject:t,isString:I}=requireIs();class B extends e{constructor(rr,ir){super(rr,ir)}createQuery(rr,ir,lr){const dr=ir?"create table if not exists ":"create table ",{client:hr}=this;let fr={},mr=" ("+rr.sql.join(", ");mr+=this.primaryKeys()||"",mr+=this._addChecks(),mr+=")";let _r=dr+this.tableName()+(lr&&this.tableNameLike()?" like "+this.tableNameLike():mr);hr.connectionSettings&&(fr=hr.connectionSettings);const yr=this.single.charset||fr.charset||"",xr=this.single.collate||fr.collate||"",Mr=this.single.engine||"";if(yr&&!lr&&(_r+=` default character set ${yr}`),xr&&(_r+=` collate ${xr}`),Mr&&(_r+=` engine = ${Mr}`),this.single.comment){const vr=this.single.comment||"",Sr=1024;vr.length>Sr&&this.client.logger.warn(`The max length for a table comment is ${Sr} characters`),_r+=` comment = '${vr}'`}this.pushQuery(_r),lr&&this.addColumns(rr,this.addColumnsPrefix)}comment(rr){this.pushQuery(`alter table ${this.tableName()} comment = '${rr}'`)}changeType(){}renameColumn(rr,ir){const lr=this,dr=this.tableName(),hr=this.formatter.wrap(rr)+" "+this.formatter.wrap(ir);this.pushQuery({sql:`show full fields from ${dr} where field = `+this.client.parameter(rr,this.tableBuilder,this.bindingsHolder),output(fr){const mr=fr[0],_r=this;return lr.getFKRefs(_r).then(([yr])=>new Promise((xr,Mr)=>{try{yr.length||xr(),xr(lr.dropFKRefs(_r,yr))}catch(vr){Mr(vr)}}).then(function(){let xr=`alter table ${dr} change ${hr} ${mr.Type}`;return String(mr.Null).toUpperCase()!=="YES"?xr+=" NOT NULL":xr+=" NULL",mr.Default!==void 0&&mr.Default!==null&&(xr+=` DEFAULT '${mr.Default}'`),mr.Collation!==void 0&&mr.Collation!==null&&(xr+=` COLLATE '${mr.Collation}'`),mr.Extra=="auto_increment"&&(xr+=" AUTO_INCREMENT"),_r.query({sql:xr})}).then(function(){if(yr.length)return lr.createFKRefs(_r,yr.map(function(xr){return xr.REFERENCED_COLUMN_NAME===rr&&(xr.REFERENCED_COLUMN_NAME=ir),xr.COLUMN_NAME===rr&&(xr.COLUMN_NAME=ir),xr}))}))}})}primaryKeys(){const rr=(this.grouped.alterTable||[]).filter(ir=>ir.method==="primary");if(rr.length>0&&rr[0].args.length>0){const ir=rr[0].args[0];let lr=rr[0].args[1]||"";if(lr&&(lr=" constraint "+this.formatter.wrap(lr)),this.grouped.columns){const dr=this._getIncrementsColumnNames();dr.length&&dr.forEach(fr=>{ir.includes(fr)||ir.unshift(fr)});const hr=this._getBigIncrementsColumnNames();hr.length&&hr.forEach(fr=>{ir.includes(fr)||ir.unshift(fr)})}return`,${lr} primary key (${this.formatter.columnize(ir)})`}}getFKRefs(rr){const ir={bindings:[]},lr="SELECT KCU.CONSTRAINT_NAME, KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC USING(CONSTRAINT_NAME)WHERE KCU.REFERENCED_TABLE_NAME = "+this.client.parameter(this.tableNameRaw,this.tableBuilder,ir)+" AND KCU.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,ir)+" AND RC.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,ir);return rr.query({sql:lr,bindings:ir.bindings})}dropFKRefs(rr,ir){const lr=this.client.formatter(this.tableBuilder);return Promise.all(ir.map(function(dr){const hr=lr.wrap(dr.CONSTRAINT_NAME),fr=lr.wrap(dr.TABLE_NAME);return rr.query({sql:`alter table ${fr} drop foreign key ${hr}`})}))}createFKRefs(rr,ir){const lr=this.client.formatter(this.tableBuilder);return Promise.all(ir.map(function(dr){const hr=lr.wrap(dr.TABLE_NAME),fr=lr.wrap(dr.CONSTRAINT_NAME),mr=lr.columnize(dr.COLUMN_NAME),_r=lr.columnize(dr.REFERENCED_COLUMN_NAME),yr=lr.wrap(dr.REFERENCED_TABLE_NAME),xr=` ON UPDATE ${dr.UPDATE_RULE}`,Mr=` ON DELETE ${dr.DELETE_RULE}`;return rr.query({sql:`alter table ${hr} add constraint ${fr} foreign key (`+mr+") references "+yr+" ("+_r+")"+xr+Mr})}))}index(rr,ir,lr){let dr,hr;I(lr)?hr=lr:t(lr)&&({indexType:hr,storageEngineIndexType:dr}=lr),ir=ir?this.formatter.wrap(ir):this._indexCommand("index",this.tableNameRaw,rr),dr=dr?` using ${dr}`:"",this.pushQuery(`alter table ${this.tableName()} add${hr?` ${hr}`:""} index ${ir}(${this.formatter.columnize(rr)})${dr}`)}primary(rr,ir){let lr;t(ir)&&({constraintName:ir,deferrable:lr}=ir),lr&&lr!=="not deferrable"&&this.client.logger.warn(`mysql: primary key constraint \`${ir}\` will not be deferrable ${lr} because mysql does not support deferred constraints.`),ir=ir?this.formatter.wrap(ir):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const dr=rr;let hr=[],fr=[];this.grouped.columns&&(hr=this._getIncrementsColumnNames(),hr&&hr.forEach(mr=>{dr.includes(mr)||dr.unshift(mr)}),fr=this._getBigIncrementsColumnNames(),fr&&fr.forEach(mr=>{dr.includes(mr)||dr.unshift(mr)})),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add primary key ${ir}(${this.formatter.columnize(dr)})`),hr.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(hr)} int unsigned not null auto_increment`),fr.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(fr)} bigint unsigned not null auto_increment`)}unique(rr,ir){let lr,dr;t(ir)&&({indexName:ir,deferrable:dr,storageEngineIndexType:lr}=ir),dr&&dr!=="not deferrable"&&this.client.logger.warn(`mysql: unique index \`${ir}\` will not be deferrable ${dr} because mysql does not support deferred constraints.`),ir=ir?this.formatter.wrap(ir):this._indexCommand("unique",this.tableNameRaw,rr),lr=lr?` using ${lr}`:"",this.pushQuery(`alter table ${this.tableName()} add unique ${ir}(${this.formatter.columnize(rr)})${lr}`)}dropIndex(rr,ir){ir=ir?this.formatter.wrap(ir):this._indexCommand("index",this.tableNameRaw,rr),this.pushQuery(`alter table ${this.tableName()} drop index ${ir}`)}dropForeign(rr,ir){ir=ir?this.formatter.wrap(ir):this._indexCommand("foreign",this.tableNameRaw,rr),this.pushQuery(`alter table ${this.tableName()} drop foreign key ${ir}`)}dropPrimary(){this.pushQuery(`alter table ${this.tableName()} drop primary key`)}dropUnique(rr,ir){ir=ir?this.formatter.wrap(ir):this._indexCommand("unique",this.tableNameRaw,rr),this.pushQuery(`alter table ${this.tableName()} drop index ${ir}`)}}return B.prototype.addColumnsPrefix="add ",B.prototype.alterColumnsPrefix="modify ",B.prototype.dropColumnPrefix="drop ",mysqlTablecompiler=B,mysqlTablecompiler}var mysqlColumncompiler,hasRequiredMysqlColumncompiler;function requireMysqlColumncompiler(){if(hasRequiredMysqlColumncompiler)return mysqlColumncompiler;hasRequiredMysqlColumncompiler=1;const e=requireColumncompiler(),{isObject:t}=requireIs(),{toNumber:I}=requireHelpers$1(),B=new RegExp("(?<!\\\\)'","g");class tr extends e{constructor(ir,lr,dr){super(ir,lr,dr),this.modifiers=["unsigned","nullable","defaultTo","comment","collate","first","after"],this._addCheckModifiers()}double(ir,lr){return ir?`double(${I(ir,8)}, ${I(lr,2)})`:"double"}integer(ir){return ir=ir?`(${I(ir,11)})`:"",`int${ir}`}tinyint(ir){return ir=ir?`(${I(ir,1)})`:"",`tinyint${ir}`}text(ir){switch(ir){case"medium":case"mediumtext":return"mediumtext";case"long":case"longtext":return"longtext";default:return"text"}}mediumtext(){return this.text("medium")}longtext(){return this.text("long")}enu(ir){return`enum('${ir.join("', '")}')`}datetime(ir){return t(ir)&&({precision:ir}=ir),typeof ir=="number"?`datetime(${ir})`:"datetime"}timestamp(ir){return t(ir)&&({precision:ir}=ir),typeof ir=="number"?`timestamp(${ir})`:"timestamp"}time(ir){return t(ir)&&({precision:ir}=ir),typeof ir=="number"?`time(${ir})`:"time"}bit(ir){return ir?`bit(${I(ir)})`:"bit"}binary(ir){return ir?`varbinary(${I(ir)})`:"blob"}json(){return"json"}jsonb(){return"json"}defaultTo(ir){if(ir==null)return;if((this.type==="json"||this.type==="jsonb")&&t(ir))return`default ('${JSON.stringify(ir)}')`;const lr=super.defaultTo.apply(this,arguments);return this.type!=="blob"&&this.type.indexOf("text")===-1?lr:""}unsigned(){return"unsigned"}comment(ir){return ir&&ir.length>255&&this.client.logger.warn("Your comment is longer than the max comment length for MySQL"),ir&&`comment '${ir.replace(B,"\\'")}'`}first(){return"first"}after(ir){return`after ${this.formatter.wrap(ir)}`}collate(ir){return ir&&`collate '${ir}'`}checkRegex(ir,lr){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(ir)}`,lr)}increments(ir={primaryKey:!0}){return"int unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(ir)?" auto_increment primary key":"")}bigincrements(ir={primaryKey:!0}){return"bigint unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(ir)?" auto_increment primary key":"")}}return tr.prototype.bigint="bigint",tr.prototype.mediumint="mediumint",tr.prototype.smallint="smallint",mysqlColumncompiler=tr,mysqlColumncompiler}var mysqlViewcompiler,hasRequiredMysqlViewcompiler;function requireMysqlViewcompiler(){if(hasRequiredMysqlViewcompiler)return mysqlViewcompiler;hasRequiredMysqlViewcompiler=1;const e=requireViewcompiler();class t extends e{constructor(B,tr){super(B,tr)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return mysqlViewcompiler=t,mysqlViewcompiler}var mysqlViewbuilder,hasRequiredMysqlViewbuilder;function requireMysqlViewbuilder(){if(hasRequiredMysqlViewbuilder)return mysqlViewbuilder;hasRequiredMysqlViewbuilder=1;const e=requireViewbuilder();class t extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return mysqlViewbuilder=t,mysqlViewbuilder}var mysql,hasRequiredMysql;function requireMysql(){if(hasRequiredMysql)return mysql;hasRequiredMysql=1;const e=requireDefer(),t=requireMap(),{promisify:I}=requireUtil(),B=requireClient(),tr=requireTransaction$3(),rr=requireMysqlQuerybuilder(),ir=requireMysqlQuerycompiler(),lr=requireMysqlCompiler(),dr=requireMysqlTablecompiler(),hr=requireMysqlColumncompiler(),{makeEscape:fr}=requireString(),mr=requireMysqlViewcompiler(),_r=requireMysqlViewbuilder();class yr extends B{_driver(){return require$$1}queryBuilder(){return new rr(this)}queryCompiler(Mr,vr){return new ir(this,Mr,vr)}schemaCompiler(){return new lr(this,...arguments)}tableCompiler(){return new dr(this,...arguments)}viewCompiler(){return new mr(this,...arguments)}viewBuilder(){return new _r(this,...arguments)}columnCompiler(){return new hr(this,...arguments)}transaction(){return new tr(this,...arguments)}wrapIdentifierImpl(Mr){return Mr!=="*"?`\`${Mr.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((Mr,vr)=>{const Sr=this.driver.createConnection(this.connectionSettings);Sr.on("error",wr=>{Sr.__knex__disposed=wr}),Sr.connect(wr=>{if(wr)return Sr.removeAllListeners(),vr(wr);Mr(Sr)})})}async destroyRawConnection(Mr){try{return await I(Sr=>Mr.end(Sr))()}catch(vr){Mr.__knex__disposed=vr}finally{e(()=>Mr.removeAllListeners())}}validateConnection(Mr){return Mr.state==="connected"||Mr.state==="authenticated"}_stream(Mr,vr,Sr,wr){if(!vr.sql)throw new Error("The query is empty");wr=wr||{};const br=Object.assign({sql:vr.sql},vr.options);return new Promise((Ar,kr)=>{Sr.on("error",kr),Sr.on("end",Ar);const Dr=Mr.query(br,vr.bindings).stream(wr);Dr.on("error",Or=>{kr(Or),Sr.emit("error",Or)}),Dr.pipe(Sr)})}_query(Mr,vr){if((!vr||typeof vr=="string")&&(vr={sql:vr}),!vr.sql)throw new Error("The query is empty");return new Promise(function(Sr,wr){if(!vr.sql){Sr();return}const br=Object.assign({sql:vr.sql},vr.options);Mr.query(br,vr.bindings,function(Ar,kr,Dr){if(Ar)return wr(Ar);vr.response=[kr,Dr],Sr(vr)})})}processResponse(Mr,vr){if(Mr==null)return;const{response:Sr}=Mr,{method:wr}=Mr,br=Sr[0],Ar=Sr[1];if(Mr.output)return Mr.output.call(vr,br,Ar);switch(wr){case"select":return br;case"first":return br[0];case"pluck":return t(br,Mr.pluck);case"insert":return[br.insertId];case"del":case"update":case"counter":return br.affectedRows;default:return Sr}}async cancelQuery(Mr){const vr=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(vr,Mr)}finally{await this.destroyRawConnection(vr),vr.__knex__disposed&&this.logger.warn(`Connection Error: ${vr.__knex__disposed}`)}}_wrappedCancelQueryCall(Mr,vr){return this._query(Mr,{sql:"KILL QUERY ?",bindings:[vr.threadId],options:{}})}}return Object.assign(yr.prototype,{dialect:"mysql",driverName:"mysql",_escapeBinding:fr(),canCancelQuery:!0}),mysql=yr,mysql}var transaction$2,hasRequiredTransaction$2;function requireTransaction$2(){if(hasRequiredTransaction$2)return transaction$2;hasRequiredTransaction$2=1;const e=requireTransaction$5(),t=requireBrowser()("knex:tx");class I extends e{query(tr,rr,ir,lr){const dr=this,hr=this.trxClient.query(tr,rr).catch(fr=>{if(fr.code==="ER_SP_DOES_NOT_EXIST"){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}ir=2,lr=fr,dr._completed=!0,t("%s error running transaction query",dr.txid)}).then(function(fr){if(ir===1&&dr._resolver(lr),ir===2){if(lr===void 0){if(dr.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(rr)){dr._resolver();return}lr=new Error(`Transaction rejected with non-error: ${lr}`)}return dr._rejecter(lr),fr}});return(ir===1||ir===2)&&(dr._completed=!0),hr}}return transaction$2=I,transaction$2}var mysql2,hasRequiredMysql2;function requireMysql2(){if(hasRequiredMysql2)return mysql2;hasRequiredMysql2=1;const e=requireMysql(),t=requireTransaction$2();class I extends e{transaction(){return new t(this,...arguments)}_driver(){return require$$1}initializeDriver(){try{this.driver=this._driver()}catch(tr){let rr=`Knex: run
|
|
120
|
-
$ npm install ${this.driverName}`;throw process.version.replace(/^v/,"").split(".")[0]<=12&&(rr+="@3.2.0",this.logger.error("Mysql2 version 3.2.0 is the latest version to support Node.js 12 or lower.")),rr+=" --save",this.logger.error(`${rr}
|
|
121
|
-
${tr.message}
|
|
122
|
-
${tr.stack}`),new Error(`${rr}
|
|
123
|
-
${tr.message}`)}}validateConnection(tr){return tr&&!tr._fatalError&&!tr._protocolError&&!tr._closing&&!tr.stream.destroyed}}return Object.assign(I.prototype,{driverName:"mysql2"}),mysql2=I,mysql2}var utils$1,hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;class e{constructor(rr){this.oracleVersion=rr;const ir=rr.split(".").map(lr=>parseInt(lr));ir[0]>12||ir[0]===12&&ir[1]>=2?this.limit=128:this.limit=30}generateCombinedName(rr,ir,lr,dr){const hr=require$$1;Array.isArray(dr)||(dr=dr?[dr]:[]);const fr=lr.replace(/\.|-/g,"_"),mr=dr.join("_");let _r=`${fr}_${mr.length?mr+"_":""}${ir}`.toLowerCase();return _r.length>this.limit&&(rr.warn(`Automatically generated name "${_r}" exceeds ${this.limit} character limit for Oracle Database ${this.oracleVersion}. Using base64 encoded sha1 of that name instead.`),_r=hr.createHash("sha1").update(_r).digest("base64").replace("=","")),_r}}function t(tr,rr){return`begin execute immediate '${tr.replace(/'/g,"''")}'; exception when others then if sqlcode != ${rr} then raise; end if; end;`}function I(tr){this.columnName=tr}I.prototype.toString=function(){return`[object ReturningHelper:${this.columnName}]`};function B(tr){return["DPI-1010","DPI-1080","ORA-03114","ORA-03113","ORA-03135","ORA-12514","ORA-00022","ORA-00028","ORA-00031","ORA-00045","ORA-00378","ORA-00602","ORA-00603","ORA-00609","ORA-01012","ORA-01041","ORA-01043","ORA-01089","ORA-01092","ORA-02396","ORA-03122","ORA-12153","ORA-12537","ORA-12547","ORA-12570","ORA-12583","ORA-27146","ORA-28511","ORA-56600","NJS-024","NJS-003"].some(function(rr){return tr.message.indexOf(rr)===0})}return utils$1={NameHelper:e,isConnectionError:B,wrapSqlWithCatch:t,ReturningHelper:I},utils$1}var trigger,hasRequiredTrigger;function requireTrigger(){if(hasRequiredTrigger)return trigger;hasRequiredTrigger=1;const{NameHelper:e}=requireUtils$1();class t{constructor(B){this.nameHelper=new e(B)}renameColumnTrigger(B,tr,rr,ir){const lr=this.nameHelper.generateCombinedName(B,"autoinc_trg",tr),dr=this.nameHelper.generateCombinedName(B,"seq",tr);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('ALTER TABLE "${tr}" RENAME COLUMN "${rr}" TO "${ir}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${lr}'; IF (IS_AUTOINC > 0) THEN SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${tr}'; IF ('${ir}' = PK_NAME) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${lr}"'); EXECUTE IMMEDIATE ('create or replace trigger "${lr}" BEFORE INSERT on "${tr}" for each row declare checking number := 1; begin if (:new."${ir}" is null) then while checking >= 1 loop select "${dr}".nextval into :new."${ir}" from dual; select count("${ir}") into checking from "${tr}" where "${ir}" = :new."${ir}"; end loop; end if; end;'); end if; end if;END;`}createAutoIncrementTrigger(B,tr,rr){const ir=`"${tr}"`,lr=tr,dr=rr?`"${rr}".`:"",hr=rr?`'${rr}'`:"cols.owner",fr=this.nameHelper.generateCombinedName(B,"autoinc_trg",tr),_r=`"${this.nameHelper.generateCombinedName(B,"seq",tr)}"`;return`DECLARE PK_NAME VARCHAR(200); BEGIN EXECUTE IMMEDIATE ('CREATE SEQUENCE ${dr}${_r}'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = ${hr} AND cols.table_name = '${lr}'; execute immediate ('create or replace trigger ${dr}"${fr}" BEFORE INSERT on ${dr}${ir} for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select ${dr}${_r}.nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from ${dr}${ir} where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); END;`}renameTableAndAutoIncrementTrigger(B,tr,rr){const ir=this.nameHelper.generateCombinedName(B,"autoinc_trg",tr),lr=this.nameHelper.generateCombinedName(B,"seq",tr),dr=this.nameHelper.generateCombinedName(B,"autoinc_trg",rr),hr=this.nameHelper.generateCombinedName(B,"seq",rr);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('RENAME "${tr}" TO "${rr}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${ir}'; IF (IS_AUTOINC > 0) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${ir}"'); EXECUTE IMMEDIATE ('RENAME "${lr}" TO "${hr}"'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${rr}'; EXECUTE IMMEDIATE ('create or replace trigger "${dr}" BEFORE INSERT on "${rr}" for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select "${hr}".nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from "${rr}" where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); end if;END;`}}return trigger=t,trigger}var oracleCompiler,hasRequiredOracleCompiler;function requireOracleCompiler(){if(hasRequiredOracleCompiler)return oracleCompiler;hasRequiredOracleCompiler=1;const e=requireCompiler$1(),t=requireUtils$1(),I=requireTrigger();class B extends e{constructor(){super(...arguments)}renameTable(rr,ir){const dr=new I(this.client.version).renameTableAndAutoIncrementTrigger(this.client.logger,rr,ir);this.pushQuery(dr)}hasTable(rr){this.pushQuery({sql:"select TABLE_NAME from USER_TABLES where TABLE_NAME = "+this.client.parameter(rr,this.builder,this.bindingsHolder),output(ir){return ir.length>0}})}hasColumn(rr,ir){const lr=`select COLUMN_NAME from ALL_TAB_COLUMNS where TABLE_NAME = ${this.client.parameter(rr,this.builder,this.bindingsHolder)} and COLUMN_NAME = ${this.client.parameter(ir,this.builder,this.bindingsHolder)}`;this.pushQuery({sql:lr,output:dr=>dr.length>0})}dropSequenceIfExists(rr){const ir=this.schema?`"${this.schema}".`:"";this.pushQuery(t.wrapSqlWithCatch(`drop sequence ${ir}${this.formatter.wrap(rr)}`,-2289))}_dropRelatedSequenceIfExists(rr){const lr=new t.NameHelper(this.client.version).generateCombinedName(this.client.logger,"seq",rr);this.dropSequenceIfExists(lr)}dropTable(rr){const ir=this.schema?`"${this.schema}".`:"";this.pushQuery(`drop table ${ir}${this.formatter.wrap(rr)}`),this._dropRelatedSequenceIfExists(rr)}dropTableIfExists(rr){this.dropObject(rr,"table")}dropViewIfExists(rr){this.dropObject(rr,"view")}dropObject(rr,ir){const lr=this.schema?`"${this.schema}".`:"";let dr=-942;ir==="materialized view"&&(dr=-12003),this.pushQuery(t.wrapSqlWithCatch(`drop ${ir} ${lr}${this.formatter.wrap(rr)}`,dr)),this._dropRelatedSequenceIfExists(rr)}refreshMaterializedView(rr){return this.pushQuery({sql:`BEGIN DBMS_MVIEW.REFRESH('${this.schemaNameRaw?this.schemaNameRaw+".":""}${rr}'); END;`})}dropMaterializedView(rr){this._dropView(rr,!1,!0)}dropMaterializedViewIfExists(rr){this.dropObject(rr,"materialized view")}}return oracleCompiler=B,oracleCompiler}var oracleColumnbuilder,hasRequiredOracleColumnbuilder;function requireOracleColumnbuilder(){if(hasRequiredOracleColumnbuilder)return oracleColumnbuilder;hasRequiredOracleColumnbuilder=1;const e=requireColumnbuilder(),t=requireToArray();class I extends e{constructor(){super(...arguments)}checkIn(){return this._modifiers.checkIn=t(arguments),this}}return oracleColumnbuilder=I,oracleColumnbuilder}var _arrayIncludes,hasRequired_arrayIncludes;function require_arrayIncludes(){if(hasRequired_arrayIncludes)return _arrayIncludes;hasRequired_arrayIncludes=1;var e=require_baseIndexOf();function t(I,B){var tr=I==null?0:I.length;return!!tr&&e(I,B,0)>-1}return _arrayIncludes=t,_arrayIncludes}var _arrayIncludesWith,hasRequired_arrayIncludesWith;function require_arrayIncludesWith(){if(hasRequired_arrayIncludesWith)return _arrayIncludesWith;hasRequired_arrayIncludesWith=1;function e(t,I,B){for(var tr=-1,rr=t==null?0:t.length;++tr<rr;)if(B(I,t[tr]))return!0;return!1}return _arrayIncludesWith=e,_arrayIncludesWith}var noop_1,hasRequiredNoop;function requireNoop(){if(hasRequiredNoop)return noop_1;hasRequiredNoop=1;function e(){}return noop_1=e,noop_1}var _createSet,hasRequired_createSet;function require_createSet(){if(hasRequired_createSet)return _createSet;hasRequired_createSet=1;var e=require_Set(),t=requireNoop(),I=require_setToArray(),B=1/0,tr=e&&1/I(new e([,-0]))[1]==B?function(rr){return new e(rr)}:t;return _createSet=tr,_createSet}var _baseUniq,hasRequired_baseUniq;function require_baseUniq(){if(hasRequired_baseUniq)return _baseUniq;hasRequired_baseUniq=1;var e=require_SetCache(),t=require_arrayIncludes(),I=require_arrayIncludesWith(),B=require_cacheHas(),tr=require_createSet(),rr=require_setToArray(),ir=200;function lr(dr,hr,fr){var mr=-1,_r=t,yr=dr.length,xr=!0,Mr=[],vr=Mr;if(fr)xr=!1,_r=I;else if(yr>=ir){var Sr=hr?null:tr(dr);if(Sr)return rr(Sr);xr=!1,_r=B,vr=new e}else vr=hr?[]:Mr;e:for(;++mr<yr;){var wr=dr[mr],br=hr?hr(wr):wr;if(wr=fr||wr!==0?wr:0,xr&&br===br){for(var Ar=vr.length;Ar--;)if(vr[Ar]===br)continue e;hr&&vr.push(br),Mr.push(wr)}else _r(vr,br,fr)||(vr!==Mr&&vr.push(br),Mr.push(wr))}return Mr}return _baseUniq=lr,_baseUniq}var uniq_1,hasRequiredUniq;function requireUniq(){if(hasRequiredUniq)return uniq_1;hasRequiredUniq=1;var e=require_baseUniq();function t(I){return I&&I.length?e(I):[]}return uniq_1=t,uniq_1}var incrementUtils,hasRequiredIncrementUtils;function requireIncrementUtils(){if(hasRequiredIncrementUtils)return incrementUtils;hasRequiredIncrementUtils=1;const e=requireTrigger();function t(I){const B=new e(I.client.version);I.pushAdditional(function(){const tr=this.tableCompiler.tableNameRaw,rr=this.tableCompiler.schemaNameRaw,ir=B.createAutoIncrementTrigger(this.client.logger,tr,rr);this.pushQuery(ir)})}return incrementUtils={createAutoIncrementTriggerAndSequence:t},incrementUtils}var oracleColumncompiler,hasRequiredOracleColumncompiler;function requireOracleColumncompiler(){if(hasRequiredOracleColumncompiler)return oracleColumncompiler;hasRequiredOracleColumncompiler=1;const e=requireUniq(),t=requireRaw(),I=requireColumncompiler(),{createAutoIncrementTriggerAndSequence:B}=requireIncrementUtils(),{toNumber:tr}=requireHelpers$1();class rr extends I{constructor(){super(...arguments),this.modifiers=["defaultTo","checkIn","nullable","comment"]}increments(lr={primaryKey:!0}){return B(this),"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(lr)?" primary key":"")}bigincrements(lr={primaryKey:!0}){return B(this),"number(20, 0) not null"+(this.tableCompiler._canBeAddPrimaryKey(lr)?" primary key":"")}floating(lr){const dr=tr(lr,0);return`float${dr?`(${dr})`:""}`}double(lr,dr){return`number(${tr(lr,8)}, ${tr(dr,2)})`}decimal(lr,dr){return lr===null?"decimal":`decimal(${tr(lr,8)}, ${tr(dr,2)})`}integer(lr){return lr?`number(${tr(lr,11)})`:"integer"}enu(lr){lr=e(lr);const dr=(lr||[]).reduce((hr,fr)=>Math.max(hr,String(fr).length),1);return this.columnBuilder._modifiers.checkIn=[lr],`varchar2(${dr})`}datetime(lr){return lr?"timestamp":"timestamp with time zone"}timestamp(lr){return lr?"timestamp":"timestamp with time zone"}bool(){return this.columnBuilder._modifiers.checkIn=[[0,1]],"number(1, 0)"}varchar(lr){return`varchar2(${tr(lr,255)})`}comment(lr){const dr=this.args[0]||this.defaults("columnName");this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(dr)+" is '"+(lr||"")+"'")},lr)}checkIn(lr){return lr===void 0?"":(lr instanceof t?lr=lr.toQuery():Array.isArray(lr)?lr=lr.map(dr=>`'${dr}'`).join(", "):lr=`'${lr}'`,`check (${this.formatter.wrap(this.args[0])} in (${lr}))`)}}return rr.prototype.tinyint="smallint",rr.prototype.smallint="smallint",rr.prototype.mediumint="integer",rr.prototype.biginteger="number(20, 0)",rr.prototype.text="clob",rr.prototype.time="timestamp with time zone",rr.prototype.bit="clob",rr.prototype.json="clob",oracleColumncompiler=rr,oracleColumncompiler}var oracleTablecompiler,hasRequiredOracleTablecompiler;function requireOracleTablecompiler(){if(hasRequiredOracleTablecompiler)return oracleTablecompiler;hasRequiredOracleTablecompiler=1;const e=requireUtils$1(),t=requireTablecompiler(),I=requireHelpers$1(),B=requireTrigger(),{isObject:tr}=requireIs();class rr extends t{constructor(){super(...arguments)}addColumns(lr,dr){if(lr.sql.length>0){dr=dr||this.addColumnsPrefix;const hr=lr.sql;let mr=`${this.lowerCase?"alter table ":"ALTER TABLE "}${this.tableName()} ${dr}`;lr.sql.length>1?mr+=`(${hr.join(", ")})`:mr+=hr.join(", "),this.pushQuery({sql:mr,bindings:lr.bindings})}}renameColumn(lr,dr){const hr=this.tableName().slice(1,-1),fr=new B(this.client.version);return this.pushQuery(fr.renameColumnTrigger(this.client.logger,hr,lr,dr))}compileAdd(lr){const dr=this.formatter.wrap(lr),hr=this.prefixArray("add column",this.getColumns(lr));return this.pushQuery({sql:`alter table ${dr} ${hr.join(", ")}`})}createQuery(lr,dr,hr){const fr=hr&&this.tableNameLike()?" as (select * from "+this.tableNameLike()+" where 0=1)":" ("+lr.sql.join(", ")+this._addChecks()+")",mr=`create table ${this.tableName()}${fr}`;this.pushQuery({sql:dr?e.wrapSqlWithCatch(mr,-955):mr,bindings:lr.bindings}),this.single.comment&&this.comment(this.single.comment),hr&&this.addColumns(lr,this.addColumnsPrefix)}comment(lr){this.pushQuery(`comment on table ${this.tableName()} is '${lr}'`)}dropColumn(){const lr=I.normalizeArr.apply(null,arguments);this.pushQuery(`alter table ${this.tableName()} drop (${this.formatter.columnize(lr)})`)}_indexCommand(lr,dr,hr){const fr=new e.NameHelper(this.client.version);return this.formatter.wrap(fr.generateCombinedName(this.client.logger,lr,dr,hr))}primary(lr,dr){let hr;tr(dr)&&({constraintName:dr,deferrable:hr}=dr),hr=hr?` deferrable initially ${hr}`:"",dr=dr?this.formatter.wrap(dr):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const fr=lr;let mr=[];this.grouped.columns&&(mr=this._getIncrementsColumnNames(),mr&&mr.forEach(_r=>{fr.includes(_r)||fr.unshift(_r)})),this.pushQuery(`alter table ${this.tableName()} add constraint ${dr} primary key (${this.formatter.columnize(fr)})${hr}`)}dropPrimary(lr){lr=lr?this.formatter.wrap(lr):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${lr}`)}index(lr,dr){dr=dr?this.formatter.wrap(dr):this._indexCommand("index",this.tableNameRaw,lr),this.pushQuery(`create index ${dr} on ${this.tableName()} (`+this.formatter.columnize(lr)+")")}dropIndex(lr,dr){dr=dr?this.formatter.wrap(dr):this._indexCommand("index",this.tableNameRaw,lr),this.pushQuery(`drop index ${dr}`)}unique(lr,dr){let hr;tr(dr)&&({indexName:dr,deferrable:hr}=dr),hr=hr?` deferrable initially ${hr}`:"",dr=dr?this.formatter.wrap(dr):this._indexCommand("unique",this.tableNameRaw,lr),this.pushQuery(`alter table ${this.tableName()} add constraint ${dr} unique (`+this.formatter.columnize(lr)+")"+hr)}dropUnique(lr,dr){dr=dr?this.formatter.wrap(dr):this._indexCommand("unique",this.tableNameRaw,lr),this.pushQuery(`alter table ${this.tableName()} drop constraint ${dr}`)}dropForeign(lr,dr){dr=dr?this.formatter.wrap(dr):this._indexCommand("foreign",this.tableNameRaw,lr),this.pushQuery(`alter table ${this.tableName()} drop constraint ${dr}`)}}return rr.prototype.addColumnsPrefix="add ",rr.prototype.alterColumnsPrefix="modify ",oracleTablecompiler=rr,oracleTablecompiler}var oracle,hasRequiredOracle;function requireOracle(){if(hasRequiredOracle)return oracle;hasRequiredOracle=1;const{ReturningHelper:e}=requireUtils$1(),{isConnectionError:t}=requireUtils$1(),I=requireClient(),B=requireOracleCompiler(),tr=requireOracleColumnbuilder(),rr=requireOracleColumncompiler(),ir=requireOracleTablecompiler();class lr extends I{schemaCompiler(){return new B(this,...arguments)}columnBuilder(){return new tr(this,...arguments)}columnCompiler(){return new rr(this,...arguments)}tableCompiler(){return new ir(this,...arguments)}database(){return this.connectionSettings.database}positionBindings(hr){let fr=0;return hr.replace(/\?/g,function(){return fr+=1,`:${fr}`})}_stream(hr,fr,mr,_r){if(!fr.sql)throw new Error("The query is empty");return new Promise(function(yr,xr){mr.on("error",vr=>{t(vr)&&(hr.__knex__disposed=vr),xr(vr)}),mr.on("end",yr);const Mr=hr.queryStream(fr.sql,fr.bindings,_r);Mr.pipe(mr),Mr.on("error",function(vr){xr(vr),mr.emit("error",vr)})})}alias(hr,fr){return hr+" "+fr}parameter(hr,fr,mr){return hr instanceof e&&this.driver?hr=new this.driver.OutParam(this.driver.OCCISTRING):typeof hr=="boolean"&&(hr=hr?1:0),super.parameter(hr,fr,mr)}}return Object.assign(lr.prototype,{dialect:"oracle",driverName:"oracle"}),oracle=lr,oracle}var oracleQuerycompiler,hasRequiredOracleQuerycompiler;function requireOracleQuerycompiler(){if(hasRequiredOracleQuerycompiler)return oracleQuerycompiler;hasRequiredOracleQuerycompiler=1;const e=requireCompact(),t=requireIdentity(),I=requireIsEmpty(),B=requireIsPlainObject(),tr=requireReduce(),rr=requireQuerycompiler(),{ReturningHelper:ir}=requireUtils$1(),{isString:lr}=requireIs(),dr=["comments","columns","join","where","union","group","having","order","lock"];class hr extends rr{constructor(mr,_r,yr){super(mr,_r,yr);const{onConflict:xr}=this.single;if(xr)throw new Error(".onConflict() is not supported for oracledb.");this.first=this.select}insert(){let mr=this.single.insert||[],{returning:_r}=this.single;if(!Array.isArray(mr)&&B(this.single.insert)&&(mr=[this.single.insert]),_r&&!Array.isArray(_r)&&(_r=[_r]),Array.isArray(mr)&&mr.length===1&&I(mr[0]))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.wrap(this.single.returning)}) values (default)`,_r,this.tableName);if(I(this.single.insert)&&typeof this.single.insert!="function")return"";const yr=this._prepInsert(mr),xr={};if(lr(yr))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} ${yr}`,_r);if(yr.values.length===1)return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.columnize(yr.columns)}) values (${this.client.parameterize(yr.values[0],void 0,this.builder,this.bindingsHolder)})`,_r,this.tableName);const Mr=yr.columns.length===0;return xr.sql="begin "+yr.values.map(vr=>{let Sr;const wr=Mr?"":this.client.parameterize(vr,this.client.valueForUndefined,this.builder,this.bindingsHolder),br=Array.isArray(_r)?_r:[_r];let Ar=`insert into ${this.tableName} `;_r&&(Sr=new ir(br.join(":")),xr.outParams=(xr.outParams||[]).concat(Sr)),Mr?Ar+=`(${this.formatter.wrap(this.single.returning)}) values (default)`:Ar+=`(${this.formatter.columnize(yr.columns)}) values (${wr})`,Ar+=_r?` returning ROWID into ${this.client.parameter(Sr,this.builder,this.bindingsHolder)}`:"",Ar=this.formatter.client.positionBindings(Ar);const kr=wr.replace("DEFAULT, ","").replace(", DEFAULT","");return`execute immediate '${Ar.replace(/'/g,"''")}`+(kr||_r?"' using ":"")+kr+(kr&&_r?", ":"")+(_r?"out ?":"")+";"}).join(" ")+"end;",_r&&(xr.returning=_r,xr.returningSql=`select ${this.formatter.columnize(_r)} from `+this.tableName+" where ROWID in ("+xr.outParams.map((vr,Sr)=>`:${Sr+1}`).join(", ")+") order by case ROWID "+xr.outParams.map((vr,Sr)=>`when CHARTOROWID(:${Sr+1}) then ${Sr}`).join(" ")+" end"),xr}update(){const mr=this._prepUpdate(this.single.update),_r=this.where();let{returning:yr}=this.single;const xr=`update ${this.tableName} set `+mr.join(", ")+(_r?` ${_r}`:"");return yr?(Array.isArray(yr)||(yr=[yr]),this._addReturningToSqlAndConvert(xr,yr,this.tableName)):xr}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"for update"}forShare(){return this.client.logger.warn("lock for share is not supported by oracle dialect"),""}columnInfo(){const mr=this.single.columnInfo;return{sql:`select * from xmltable( '/ROWSET/ROW'
|
|
124
|
-
passing dbms_xmlgen.getXMLType('
|
|
125
|
-
select char_col_decl_length, column_name, data_type, data_default, nullable
|
|
126
|
-
from all_tab_columns where table_name = ''${this.client.customWrapIdentifier(this.single.table,t)}'' ')
|
|
127
|
-
columns
|
|
128
|
-
CHAR_COL_DECL_LENGTH number, COLUMN_NAME varchar2(200), DATA_TYPE varchar2(106),
|
|
129
|
-
DATA_DEFAULT clob, NULLABLE varchar2(1))`,output(xr){const Mr=tr(xr,function(vr,Sr){return vr[Sr.COLUMN_NAME]={type:Sr.DATA_TYPE,defaultValue:Sr.DATA_DEFAULT,maxLength:Sr.CHAR_COL_DECL_LENGTH,nullable:Sr.NULLABLE==="Y"},vr},{});return mr&&Mr[mr]||Mr}}}select(){let mr=this.with();const _r=dr.map(yr=>this[yr]());return mr+=e(_r).join(" "),this._surroundQueryWithLimitAndOffset(mr)}aggregate(mr){return this._aggregate(mr,{aliasSeparator:" "})}_addReturningToSqlAndConvert(mr,_r,yr){const xr={sql:mr};if(!_r)return xr;const Mr=Array.isArray(_r)?_r:[_r],vr=new ir(Mr.join(":"));return xr.sql=mr+" returning ROWID into "+this.client.parameter(vr,this.builder,this.bindingsHolder),xr.returningSql=`select ${this.formatter.columnize(_r)} from ${yr} where ROWID = :1`,xr.outParams=[vr],xr.returning=_r,xr}_surroundQueryWithLimitAndOffset(mr){let{limit:_r}=this.single;const{offset:yr}=this.single,xr=_r||_r===0||_r==="0";if(_r=+_r,!xr&&!yr)return mr;if(mr=mr||"",xr&&!yr)return`select * from (${mr}) where rownum <= ${this._getValueOrParameterFromAttribute("limit",_r)}`;const Mr=+yr+(xr?_r:1e13);return"select * from (select row_.*, ROWNUM rownum_ from ("+mr+") row_ where rownum <= "+(this.single.skipBinding.offset?Mr:this.client.parameter(Mr,this.builder,this.bindingsHolder))+") where rownum_ > "+this._getValueOrParameterFromAttribute("offset",yr)}}return oracleQuerycompiler=hr,oracleQuerycompiler}var utils,hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;const e=requireUtils$1(),{promisify:t}=requireUtil(),I=require$$1;function B(lr,dr){this.columnName=lr,this.value=dr,this.returning=!1}B.prototype.toString=function(){return"[object BlobHelper:"+this.columnName+"]"};function tr(lr,dr){return new Promise((hr,fr)=>{let mr=dr==="string"?"":Buffer.alloc(0);lr.on("error",function(_r){fr(_r)}),lr.on("data",function(_r){dr==="string"?mr+=_r:mr=Buffer.concat([mr,_r])}),lr.on("end",function(){hr(mr)})})}const rr=function(lr){const dr=require$$1;let hr;if(lr.type)lr.type===dr.BLOB?hr="buffer":lr.type===dr.CLOB&&(hr="string");else if(lr.iLob)lr.iLob.type===dr.CLOB?hr="string":lr.iLob.type===dr.BLOB&&(hr="buffer");else throw new Error("Unrecognized oracledb lob stream type");return hr==="string"&&lr.setEncoding("utf-8"),tr(lr,hr)};function ir(lr,dr){if(lr.executeAsync)return;lr.commitAsync=function(){return new Promise((fr,mr)=>{this.commit(function(_r){if(_r)return mr(_r);fr()})})},lr.rollbackAsync=function(){return new Promise((fr,mr)=>{this.rollback(function(_r){if(_r)return mr(_r);fr()})})};const hr=t(function(fr,mr,_r,yr){if(_r=_r||{},_r.outFormat=dr.driver.OUT_FORMAT_OBJECT||dr.driver.OBJECT,!_r.outFormat)throw new Error("not found oracledb.outFormat constants");_r.resultSet?lr.execute(fr,mr||[],_r,function(xr,Mr){if(xr)return e.isConnectionError(xr)&&(lr.close().catch(function(br){}),lr.__knex__disposed=xr),yr(xr);const vr={rows:[],resultSet:Mr.resultSet},Sr=100,wr=function(br,Ar,kr){Ar.getRows(kr,function(Dr,Or){if(Dr)e.isConnectionError(Dr)&&(br.close().catch(function(zr){}),br.__knex__disposed=Dr),Ar.close(function(){return yr(Dr)});else{if(Or.length===0)return yr(null,vr);if(Or.length>0)if(Or.length===kr)vr.rows=vr.rows.concat(Or),wr(br,Ar,kr);else return vr.rows=vr.rows.concat(Or),yr(null,vr)}})};wr(lr,Mr.resultSet,Sr)}):lr.execute(fr,mr||[],_r,function(xr,Mr){return xr?(e.isConnectionError(xr)&&(lr.close().catch(function(vr){}),lr.__knex__disposed=xr),yr(xr)):yr(null,Mr)})});lr.executeAsync=function(fr,mr,_r){return hr(fr,mr,_r).then(async yr=>{const xr=()=>yr.resultSet?t(yr.resultSet.close).call(yr.resultSet):Promise.resolve(),Mr=[];if(yr.rows&&Array.isArray(yr.rows))for(let vr=0;vr<yr.rows.length;vr++){const Sr=yr.rows[vr];for(const wr in Sr)Sr[wr]instanceof I.Readable&&Mr.push({index:vr,key:wr,stream:Sr[wr]})}try{for(const vr of Mr)yr.rows[vr.index][vr.key]=await rr(vr.stream)}catch(vr){throw await xr().catch(()=>{}),vr}return await xr(),yr})}}return e.BlobHelper=B,e.monkeyPatchConnection=ir,utils=e,utils}var oracledbQuerycompiler,hasRequiredOracledbQuerycompiler;function requireOracledbQuerycompiler(){if(hasRequiredOracledbQuerycompiler)return oracledbQuerycompiler;hasRequiredOracledbQuerycompiler=1;const e=requireClone(),t=requireEach(),I=requireIsEmpty(),B=requireIsPlainObject(),tr=requireOracleQuerycompiler(),rr=requireUtils().ReturningHelper,ir=requireUtils().BlobHelper,{isString:lr}=requireIs(),{columnize:dr}=requireWrappingFormatter();class hr extends tr{insert(){const mr=this,_r=this._prepOutbindings(this.single.insert,this.single.returning),yr=_r.outBinding,xr=_r.returning,Mr=_r.values;if(Array.isArray(Mr)&&Mr.length===1&&I(Mr[0])){const br=this.single.returning?" ("+this.formatter.wrap(this.single.returning)+")":"";return this._addReturningToSqlAndConvert("insert into "+this.tableName+br+" values (default)",yr[0],this.tableName,xr)}if(I(this.single.insert)&&typeof this.single.insert!="function")return"";const vr=this._prepInsert(Mr),Sr={};if(lr(vr))return this._addReturningToSqlAndConvert("insert into "+this.tableName+" "+vr,yr[0],this.tableName,xr);if(vr.values.length===1)return this._addReturningToSqlAndConvert("insert into "+this.tableName+" ("+this.formatter.columnize(vr.columns)+") values ("+this.client.parameterize(vr.values[0],void 0,this.builder,this.bindingsHolder)+")",yr[0],this.tableName,xr);const wr=vr.columns.length===0;return Sr.returning=xr,Sr.sql="begin "+vr.values.map(function(br,Ar){const kr=wr?"":mr.client.parameterize(br,mr.client.valueForUndefined,mr.builder,mr.bindingsHolder);let Dr="insert into "+mr.tableName;wr?Dr+=" ("+mr.formatter.wrap(mr.single.returning)+") values (default)":Dr+=" ("+mr.formatter.columnize(vr.columns)+") values ("+kr+")";let Or="",zr="",$n="",Fr="";t(br,function(Hn){Hn instanceof ir||($n+=" ?,")}),$n=$n.slice(0,-1),yr[Ar].forEach(function(Hn){const ti=Hn.columnName||Hn;if(Or+=mr.formatter.wrap(ti)+",",zr+=" ?,",Fr+=" out ?,",Hn instanceof ir)return mr.formatter.bindings.push(Hn);mr.formatter.bindings.push(new rr(ti))}),Or=Or.slice(0,-1),zr=zr.slice(0,-1),Fr=Fr.slice(0,-1),Or&&zr&&(Dr+=" returning "+Or+" into"+zr),Dr=mr.formatter.client.positionBindings(Dr);const $r=kr.replace(/DEFAULT, /g,"").replace(/, DEFAULT/g,"").replace("EMPTY_BLOB(), ","").replace(", EMPTY_BLOB()","");return"execute immediate '"+Dr.replace(/'/g,"''")+($r||br?"' using ":"")+$r+($r&&Fr?",":"")+Fr+";"}).join(" ")+"end;",Sr.outBinding=yr,xr[0]==="*"&&(Sr.returningSql=function(){return"select * from "+mr.tableName+" where ROWID in ("+this.outBinding.map(function(br,Ar){return":"+(Ar+1)}).join(", ")+") order by case ROWID "+this.outBinding.map(function(br,Ar){return"when CHARTOROWID(:"+(Ar+1)+") then "+Ar}).join(" ")+" end"}),Sr}with(){const mr=[];if(this.grouped.with)for(const yr of this.grouped.with)yr.recursive&&(mr.push(yr),yr.recursive=!1);const _r=super.with();for(const yr of mr)yr.recursive=!0;return _r}_addReturningToSqlAndConvert(mr,_r,yr,xr){const Mr=this,vr={sql:mr};if(!_r)return vr;const Sr=Array.isArray(_r)?_r:[_r];let wr="",br="";return Sr.forEach(function(Ar){const kr=Ar.columnName||Ar;if(wr+=Mr.formatter.wrap(kr)+",",br+="?,",Ar instanceof ir)return Mr.formatter.bindings.push(Ar);Mr.formatter.bindings.push(new rr(kr))}),vr.sql=mr,wr=wr.slice(0,-1),br=br.slice(0,-1),wr&&br&&(vr.sql+=" returning "+wr+" into "+br),vr.outBinding=[_r],xr[0]==="*"&&(vr.returningSql=function(){return"select * from "+Mr.tableName+" where ROWID = :1"}),vr.returning=xr,vr}_prepOutbindings(mr,_r){const yr={};let xr=mr||[],Mr=_r||[];!Array.isArray(xr)&&B(mr)&&(xr=[xr]),Mr&&!Array.isArray(Mr)&&(Mr=[Mr]);const vr=[];return t(xr,function(Sr,wr){Mr[0]==="*"?vr[wr]=["ROWID"]:vr[wr]=e(Mr),t(Sr,function(br,Ar){if(br instanceof Buffer){Sr[Ar]=new ir(Ar,br);const kr=vr[wr].indexOf(Ar);kr>=0&&(vr[wr].splice(kr,1),Sr[Ar].returning=!0),vr[wr].push(Sr[Ar])}br===void 0&&delete xr[wr][Ar]})}),yr.returning=Mr,yr.outBinding=vr,yr.values=xr,yr}_groupOrder(mr,_r){return super._groupOrderNulls(mr,_r)}update(){const mr=this,_r={},yr=this._prepOutbindings(this.single.update||this.single.counter,this.single.returning),xr=yr.outBinding,Mr=yr.returning,vr=this._prepUpdate(this.single.update),Sr=this.where();let wr="",br="";return I(vr)&&typeof this.single.update!="function"?"":(xr.forEach(function(Ar){Ar.forEach(function(kr){const Dr=kr.columnName||kr;if(wr+=mr.formatter.wrap(Dr)+",",br+=" ?,",kr instanceof ir)return mr.formatter.bindings.push(kr);mr.formatter.bindings.push(new rr(Dr))})}),wr=wr.slice(0,-1),br=br.slice(0,-1),_r.outBinding=xr,_r.returning=Mr,_r.sql="update "+this.tableName+" set "+vr.join(", ")+(Sr?" "+Sr:""),xr.length&&!I(xr[0])&&(_r.sql+=" returning "+wr+" into"+br),Mr[0]==="*"&&(_r.returningSql=function(){let Ar="select * from "+mr.tableName;const kr=this.rowsAffected.length||this.rowsAffected;let Dr=" where ROWID in (",Or=") order by case ROWID ";for(let zr=0;zr<kr;zr++)this.returning[0]==="*"&&(Dr+=":"+(zr+1)+", ",Or+="when CHARTOROWID(:"+(zr+1)+") then "+zr+" ");return this.returning[0]==="*"&&(this.returning=this.returning.slice(0,-1),Dr=Dr.slice(0,-2),Or=Or.slice(0,-1)),Ar+=Dr+Or+" end"}),_r)}_jsonPathWrap(mr){return`'${mr.path||mr[1]}'`}jsonExtract(mr){return this._jsonExtract(mr.singleValue?"json_value":"json_query",mr)}jsonSet(mr){return`json_transform(${dr(mr.column,this.builder,this.client,this.bindingsHolder)}, set ${this.client.parameter(mr.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(mr.value,this.builder,this.bindingsHolder)})`}jsonInsert(mr){return`json_transform(${dr(mr.column,this.builder,this.client,this.bindingsHolder)}, insert ${this.client.parameter(mr.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(mr.value,this.builder,this.bindingsHolder)})`}jsonRemove(mr){const _r=`json_transform(${dr(mr.column,this.builder,this.client,this.bindingsHolder)}, remove ${this.client.parameter(mr.path,this.builder,this.bindingsHolder)})`;return mr.alias?this.client.alias(_r,this.formatter.wrap(mr.alias)):_r}whereJsonPath(mr){return this._whereJsonPath("json_value",mr)}whereJsonSupersetOf(mr){throw new Error("Json superset where clause not actually supported by Oracle")}whereJsonSubsetOf(mr){throw new Error("Json subset where clause not actually supported by Oracle")}onJsonPathEquals(mr){return this._onJsonPathEquals("json_value",mr)}}return oracledbQuerycompiler=hr,oracledbQuerycompiler}var oracledbTablecompiler,hasRequiredOracledbTablecompiler;function requireOracledbTablecompiler(){if(hasRequiredOracledbTablecompiler)return oracledbTablecompiler;hasRequiredOracledbTablecompiler=1;const e=requireOracleTablecompiler();class t extends e{constructor(B,tr){super(B,tr)}_setNullableState(B,tr){const rr=tr?"NULL":"NOT NULL",ir=`alter table ${this.tableName()} modify (${this.formatter.wrap(B)} ${rr})`;return this.pushQuery({sql:ir})}}return oracledbTablecompiler=t,oracledbTablecompiler}var oracledbColumncompiler,hasRequiredOracledbColumncompiler;function requireOracledbColumncompiler(){if(hasRequiredOracledbColumncompiler)return oracledbColumncompiler;hasRequiredOracledbColumncompiler=1;const e=requireOracleColumncompiler(),{isObject:t}=requireIs();class I extends e{constructor(){super(...arguments),this.modifiers=["defaultTo","nullable","comment","checkJson"],this._addCheckModifiers()}datetime(tr){let rr;return t(tr)?{useTz:rr}=tr:rr=!tr,rr?"timestamp with local time zone":"timestamp"}timestamp(tr){let rr;return t(tr)?{useTz:rr}=tr:rr=!tr,rr?"timestamp with local time zone":"timestamp"}checkRegex(tr,rr){return this._check(`REGEXP_LIKE(${this.formatter.wrap(this.getColumnName())},${this.client._escapeBinding(tr)})`,rr)}json(){return this.columnBuilder._modifiers.checkJson=[this.formatter.columnize(this.getColumnName())],"varchar2(4000)"}jsonb(){return this.json()}checkJson(tr){return`check (${tr} is json)`}}return I.prototype.time="timestamp with local time zone",I.prototype.uuid=({useBinaryUuid:B=!1}={})=>B?"raw(16)":"char(36)",oracledbColumncompiler=I,oracledbColumncompiler}var oracledbViewcompiler,hasRequiredOracledbViewcompiler;function requireOracledbViewcompiler(){if(hasRequiredOracledbViewcompiler)return oracledbViewcompiler;hasRequiredOracledbViewcompiler=1;const e=requireViewcompiler();class t extends e{constructor(B,tr){super(B,tr)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return oracledbViewcompiler=t,oracledbViewcompiler}var oracledbViewbuilder,hasRequiredOracledbViewbuilder;function requireOracledbViewbuilder(){if(hasRequiredOracledbViewbuilder)return oracledbViewbuilder;hasRequiredOracledbViewbuilder=1;const e=requireViewbuilder();class t extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}}return oracledbViewbuilder=t,oracledbViewbuilder}var transaction$1,hasRequiredTransaction$1;function requireTransaction$1(){if(hasRequiredTransaction$1)return transaction$1;hasRequiredTransaction$1=1;const e=requireTransaction$5(),{timeout:t,KnexTimeoutError:I}=requireTimeout(),B=requireBrowser()("knex:tx");return transaction$1=class extends e{begin(rr){return this.isolationLevel&&this.client.logger.warn("Transaction isolation is not currently supported for Oracle"),Promise.resolve()}async commit(rr,ir){this._completed=!0;try{await rr.commitAsync(),this._resolver(ir)}catch(lr){this._rejecter(lr)}}release(rr,ir){return this._resolver(ir)}rollback(rr,ir){return this._completed=!0,B("%s: rolling back",this.txid),t(rr.rollbackAsync(),5e3).catch(lr=>{if(!(lr instanceof I))return Promise.reject(lr);this._rejecter(lr)}).then(()=>{if(ir===void 0){if(this.doNotRejectOnRollback){this._resolver();return}ir=new Error(`Transaction rejected with non-error: ${ir}`)}this._rejecter(ir)})}savepoint(rr){return this.query(rr,`SAVEPOINT ${this.txid}`)}async acquireConnection(rr,ir){const lr=rr&&rr.connection,dr=lr||await this.client.acquireConnection();try{return dr.__knexTxId=this.txid,dr.isTransaction=!0,await ir(dr)}finally{B("%s: releasing connection",this.txid),dr.isTransaction=!1;try{await dr.commitAsync()}catch(hr){this._rejecter(hr)}finally{lr?B("%s: not releasing external connection",this.txid):await this.client.releaseConnection(dr)}}}},transaction$1}var oracledb,hasRequiredOracledb;function requireOracledb(){if(hasRequiredOracledb)return oracledb;hasRequiredOracledb=1;const e=requireEach(),t=requireFlatten(),I=requireIsEmpty(),B=requireMap(),tr=requireFormatter(),rr=requireOracledbQuerycompiler(),ir=requireOracledbTablecompiler(),lr=requireOracledbColumncompiler(),{BlobHelper:dr,ReturningHelper:hr,monkeyPatchConnection:fr}=requireUtils(),mr=requireOracledbViewcompiler(),_r=requireOracledbViewbuilder(),yr=requireTransaction$1(),xr=requireOracle(),{isString:Mr}=requireIs(),{outputQuery:vr,unwrapRaw:Sr}=requireWrappingFormatter(),{compileCallback:wr}=requireFormatterUtils();class br extends xr{constructor(Or){super(Or),this.version&&(this.version=Ar(this.version))}_driver(){const Or=this,zr=require$$1;return Or.fetchAsString=[],this.config.fetchAsString&&Array.isArray(this.config.fetchAsString)&&this.config.fetchAsString.forEach(function($n){Mr($n)&&($n=$n.toUpperCase(),zr[$n]&&($n!=="NUMBER"&&$n!=="DATE"&&$n!=="CLOB"&&$n!=="BUFFER"&&this.logger.warn('Only "date", "number", "clob" and "buffer" are supported for fetchAsString'),Or.fetchAsString.push(zr[$n])))}),zr}queryCompiler(Or,zr){return new rr(this,Or,zr)}tableCompiler(){return new ir(this,...arguments)}columnCompiler(){return new lr(this,...arguments)}viewBuilder(){return new _r(this,...arguments)}viewCompiler(){return new mr(this,...arguments)}formatter(Or){return new tr(this,Or)}transaction(){return new yr(this,...arguments)}prepBindings(Or){return B(Or,zr=>zr instanceof dr&&this.driver?{type:this.driver.BLOB,dir:this.driver.BIND_OUT}:zr instanceof hr&&this.driver?{type:this.driver.STRING,dir:this.driver.BIND_OUT}:typeof zr=="boolean"?zr?1:0:zr)}parameter(Or,zr,$n){return typeof Or=="function"?vr(wr(Or,void 0,this,$n),!0,zr,this):Or instanceof dr?($n.bindings.push(Or.value),"?"):Sr(Or,!0,zr,this,$n)||"?"}acquireRawConnection(){return new Promise((Or,zr)=>{const $n=this.connectionSettings.externalAuth?{externalAuth:this.connectionSettings.externalAuth}:{user:this.connectionSettings.user,password:this.connectionSettings.password};$n.connectString=kr(this.connectionSettings),this.connectionSettings.prefetchRowCount&&($n.prefetchRows=this.connectionSettings.prefetchRowCount),this.connectionSettings.stmtCacheSize!==void 0&&($n.stmtCacheSize=this.connectionSettings.stmtCacheSize),this.driver.fetchAsString=this.fetchAsString,this.driver.getConnection($n,(Fr,$r)=>{if(Fr)return zr(Fr);fr($r,this),Or($r)})})}destroyRawConnection(Or){return Or.release()}async acquireConnection(){const Or=await super.acquireConnection();return this.checkVersion(Or),Or}checkVersion(Or){if(this.version)return this.version;const zr=Ar(Or.oracleServerVersionString);if(!zr)throw new Error(this.version===null?"Invalid Oracledb version number format passed to knex. Unable to successfully auto-detect as fallback. Please specify a valid oracledb version.":"Unable to detect Oracledb version number automatically. Please specify the version in knex configuration.");return this.version=zr,zr}_query(Or,zr){if(!zr.sql)throw new Error("The query is empty");const $n=Object.assign({},zr.options,{autoCommit:!1});return zr.method==="select"&&($n.resultSet=!0),Or.executeAsync(zr.sql,zr.bindings,$n).then(async function(Fr){let $r=t(Fr.outBinds);if(zr.response=Fr.rows||[],zr.rowsAffected=Fr.rows?Fr.rows.rowsAffected:Fr.rowsAffected,zr.method==="raw"&&$r.length>0)return{response:$r};if(zr.method==="update"){const Ir=zr.rowsAffected.length||zr.rowsAffected,Lr=[],Kn=[],pi=gi=>function(oi,qn){const li=qn*Ir;Kn.push($r[gi+li])};for(let gi=0;gi<Ir;gi++)Lr.push(zr.outBinding[0]),e(zr.outBinding[0],pi(gi));$r=Kn,zr.outBinding=Lr}if(!zr.returning&&$r.length===0)return Or.isTransaction||await Or.commitAsync(),zr;const Hn=[];let ti=0;for(let Ir=0;Ir<zr.outBinding.length;Ir++){const Lr=zr.outBinding[Ir];ti=ti+(zr.outBinding[Ir-1]?zr.outBinding[Ir-1].length:0);for(let Kn=0;Kn<Lr.length;Kn++){const pi=Lr[Kn];await new Promise(function(gi,oi){if(pi instanceof dr){const qn=$r[Kn+ti];pi.returning&&(zr.response[Ir]=zr.response[Ir]||{},zr.response[Ir][pi.columnName]=pi.value),qn.on("error",function(li){oi(li)}),qn.on("finish",function(){gi()}),qn.write(pi.value),qn.end()}else zr.outBinding[Ir][Kn]==="ROWID"?(Hn.push($r[Kn+ti]),gi()):(zr.response[Ir]=zr.response[Ir]||{},zr.response[Ir][pi]=$r[Kn+ti],gi())})}}if(zr.returningSql){const Ir=await Or.executeAsync(zr.returningSql(),Hn,{resultSet:!0});zr.response=Ir.rows}return Or.isTransaction||await Or.commitAsync(),zr})}processResponse(Or,zr){const{response:$n}=Or;if(Or.output)return Or.output.call(zr,$n);switch(Or.method){case"select":return $n;case"first":return $n[0];case"pluck":return B($n,Or.pluck);case"insert":case"del":case"update":case"counter":return Or.returning&&!I(Or.returning)||Or.returningSql?$n:Or.rowsAffected!==void 0?Or.rowsAffected:1;default:return $n}}processPassedConnection(Or){this.checkVersion(Or),fr(Or,this)}}br.prototype.driverName="oracledb";function Ar(Dr){try{const Or=Dr.split(".").slice(0,2);Or.forEach(($n,Fr)=>{Or[Fr]=$n.replace(/\D$/,"")});const zr=Or.join(".");return zr.match(/^\d+\.?\d*$/)?zr:null}catch{return null}}function kr(Dr){return Dr.connectString?Dr.connectString:Dr.port?Dr.host+":"+Dr.port+"/"+Dr.database:Dr.host+"/"+Dr.database}return oracledb=br,oracledb}var pgnative,hasRequiredPgnative;function requirePgnative(){if(hasRequiredPgnative)return pgnative;hasRequiredPgnative=1;const e=requirePostgres();class t extends e{constructor(...B){super(...B),this.driverName="pgnative",this.canCancelQuery=!0}_driver(){return require$$1.native}_stream(B,tr,rr,ir){if(!tr.sql)throw new Error("The query is empty");const lr=this;return new Promise((dr,hr)=>(rr.on("error",hr),rr.on("end",dr),lr._query(B,tr).then(fr=>fr.response).then(({rows:fr})=>fr.forEach(mr=>rr.write(mr))).catch(function(fr){rr.emit("error",fr)}).then(function(){rr.end()})))}async cancelQuery(B){try{return await this._wrappedCancelQueryCall(null,B)}catch(tr){throw this.logger.warn(`Connection Error: ${tr}`),tr}}_wrappedCancelQueryCall(B,tr){return new Promise(function(rr,ir){tr.native.cancel(function(lr){if(lr){ir(lr);return}rr(!0)})})}}return pgnative=t,pgnative}var transaction,hasRequiredTransaction;function requireTransaction(){if(hasRequiredTransaction)return transaction;hasRequiredTransaction=1;const e=requireTransaction$5();return transaction=class extends e{begin(I){const B=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return B.length===0?this.query(I,"BEGIN;"):this.query(I,`BEGIN ${B};`)}savepoint(I){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}release(I,B){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}rollbackTo(I,B){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}},transaction}var redshiftQuerycompiler,hasRequiredRedshiftQuerycompiler;function requireRedshiftQuerycompiler(){if(hasRequiredRedshiftQuerycompiler)return redshiftQuerycompiler;hasRequiredRedshiftQuerycompiler=1;const e=requireQuerycompiler(),t=requirePgQuerycompiler(),I=requireIdentity(),{columnize:B}=requireWrappingFormatter();class tr extends t{truncate(){return`truncate ${this.tableName.toLowerCase()}`}insert(){const ir=e.prototype.insert.apply(this,arguments);return ir===""?ir:(this._slightReturn(),{sql:ir})}update(){const ir=e.prototype.update.apply(this,arguments);return this._slightReturn(),{sql:ir}}del(){const ir=e.prototype.del.apply(this,arguments);return this._slightReturn(),{sql:ir}}_slightReturn(){this.single.isReturning&&this.client.logger.warn("insert/update/delete returning is not supported by redshift dialect")}forUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}forNoKeyUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forKeyShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}columnInfo(){const ir=this.single.columnInfo;let lr=this.single.schema;const dr=this.client.customWrapIdentifier(this.single.table,I);lr&&(lr=this.client.customWrapIdentifier(lr,I));const hr="select * from information_schema.columns where table_name = ? and table_catalog = ?",fr=[dr.toLowerCase(),this.client.database().toLowerCase()];return this._buildColumnInfoQuery(lr,hr,fr,ir)}jsonExtract(ir){let lr;return Array.isArray(ir.column)?lr=ir.column:lr=[ir],lr.map(dr=>{const hr=`json_extract_path_text(${B(dr.column||dr[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toPathForJson(ir.path||dr[1],this.builder,this.bindingsHolder)})`,fr=dr.alias||dr[2];return fr?this.client.alias(hr,this.formatter.wrap(fr)):hr}).join(", ")}jsonSet(ir){throw new Error("Json set is not supported by Redshift")}jsonInsert(ir){throw new Error("Json insert is not supported by Redshift")}jsonRemove(ir){throw new Error("Json remove is not supported by Redshift")}whereJsonPath(ir){return this._whereJsonPath("json_extract_path_text",Object.assign({},ir,{path:this.client.toPathForJson(ir.path)}))}whereJsonSupersetOf(ir){throw new Error("Json superset is not supported by Redshift")}whereJsonSubsetOf(ir){throw new Error("Json subset is not supported by Redshift")}onJsonPathEquals(ir){return this._onJsonPathEquals("json_extract_path_text",ir)}}return redshiftQuerycompiler=tr,redshiftQuerycompiler}var redshiftColumnbuilder,hasRequiredRedshiftColumnbuilder;function requireRedshiftColumnbuilder(){if(hasRequiredRedshiftColumnbuilder)return redshiftColumnbuilder;hasRequiredRedshiftColumnbuilder=1;const e=requireColumnbuilder();class t extends e{constructor(){super(...arguments)}primary(){return this.notNullable(),super.primary(...arguments)}index(){return this.client.logger.warn("Redshift does not support the creation of indexes."),this}}return redshiftColumnbuilder=t,redshiftColumnbuilder}var redshiftColumncompiler,hasRequiredRedshiftColumncompiler;function requireRedshiftColumncompiler(){if(hasRequiredRedshiftColumncompiler)return redshiftColumncompiler;hasRequiredRedshiftColumncompiler=1;const e=requirePgColumncompiler(),t=requireColumncompiler();class I extends e{constructor(){super(...arguments)}bit(tr){return tr.length!==!1?`char(${tr.length})`:"char(1)"}datetime(tr){return tr?"timestamp":"timestamptz"}timestamp(tr){return tr?"timestamp":"timestamptz"}comment(tr){this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(this.args[0])+" is "+(tr?`'${tr}'`:"NULL"))},tr)}}return I.prototype.increments=({primaryKey:B=!0}={})=>"integer identity(1,1)"+(B?" primary key":"")+" not null",I.prototype.bigincrements=({primaryKey:B=!0}={})=>"bigint identity(1,1)"+(B?" primary key":"")+" not null",I.prototype.binary="varchar(max)",I.prototype.blob="varchar(max)",I.prototype.enu="varchar(255)",I.prototype.enum="varchar(255)",I.prototype.json="varchar(max)",I.prototype.jsonb="varchar(max)",I.prototype.longblob="varchar(max)",I.prototype.mediumblob="varchar(16777218)",I.prototype.set="text",I.prototype.text="varchar(max)",I.prototype.tinyblob="varchar(256)",I.prototype.uuid=t.prototype.uuid,I.prototype.varbinary="varchar(max)",I.prototype.bigint="bigint",I.prototype.bool="boolean",I.prototype.double="double precision",I.prototype.floating="real",I.prototype.smallint="smallint",I.prototype.tinyint="smallint",redshiftColumncompiler=I,redshiftColumncompiler}var redshiftTablecompiler,hasRequiredRedshiftTablecompiler;function requireRedshiftTablecompiler(){if(hasRequiredRedshiftTablecompiler)return redshiftTablecompiler;hasRequiredRedshiftTablecompiler=1;const e=requireHas(),t=requirePgTablecompiler();class I extends t{constructor(){super(...arguments)}index(tr,rr,ir){this.client.logger.warn("Redshift does not support the creation of indexes.")}dropIndex(tr,rr){this.client.logger.warn("Redshift does not support the deletion of indexes.")}createQuery(tr,rr,ir){const lr=rr?"create table if not exists ":"create table ",dr=" ("+tr.sql.join(", ")+this._addChecks()+")";let hr=lr+this.tableName()+(ir&&this.tableNameLike()?" (like "+this.tableNameLike()+")":dr);this.single.inherits&&(hr+=` like (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:hr,bindings:tr.bindings}),e(this.single,"comment")&&this.comment(this.single.comment),ir&&this.addColumns(tr,this.addColumnsPrefix)}primary(tr,rr){const ir=this;rr=rr?ir.formatter.wrap(rr):ir.formatter.wrap(`${this.tableNameRaw}_pkey`),tr.constructor!==Array&&(tr=[tr]);const lr=ir.grouped.columns;if(lr)for(let dr=0;dr<tr.length;dr++){let hr=lr.find(mr=>mr.grouping==="columns"&&mr.builder&&mr.builder._method==="add"&&mr.builder._args&&mr.builder._args.indexOf(tr[dr])>-1);if(hr&&(hr=hr.builder),!(hr&&hr._modifiers&&hr._modifiers.nullable&&hr._modifiers.nullable[0]===!1))return hr?this.client.logger.warn("Redshift does not allow primary keys to contain nullable columns."):this.client.logger.warn("Redshift does not allow primary keys to contain nonexistent columns.")}return ir.pushQuery(`alter table ${ir.tableName()} add constraint ${rr} primary key (${ir.formatter.columnize(tr)})`)}addColumns(tr,rr,ir){if(rr===this.alterColumnsPrefix)super.addColumns(tr,rr,ir);else{rr=rr||this.addColumnsPrefix,ir=ir||this.getColumns();for(const lr of ir){const dr=this.tableName(),hr=lr.compileColumn();this.pushQuery({sql:`alter table ${dr} ${rr}${hr}`,bindings:[]})}}}}return redshiftTablecompiler=I,redshiftTablecompiler}var redshiftCompiler,hasRequiredRedshiftCompiler;function requireRedshiftCompiler(){if(hasRequiredRedshiftCompiler)return redshiftCompiler;hasRequiredRedshiftCompiler=1;const e=requirePgCompiler();class t extends e{constructor(){super(...arguments)}}return redshiftCompiler=t,redshiftCompiler}var redshiftViewcompiler,hasRequiredRedshiftViewcompiler;function requireRedshiftViewcompiler(){if(hasRequiredRedshiftViewcompiler)return redshiftViewcompiler;hasRequiredRedshiftViewcompiler=1;const e=requirePgViewcompiler();class t extends e{constructor(B,tr){super(B,tr)}}return redshiftViewcompiler=t,redshiftViewcompiler}var redshift,hasRequiredRedshift;function requireRedshift(){if(hasRequiredRedshift)return redshift;hasRequiredRedshift=1;const e=requirePostgres(),t=requireMap(),I=requireTransaction(),B=requireRedshiftQuerycompiler(),tr=requireRedshiftColumnbuilder(),rr=requireRedshiftColumncompiler(),ir=requireRedshiftTablecompiler(),lr=requireRedshiftCompiler(),dr=requireRedshiftViewcompiler();class hr extends e{transaction(){return new I(this,...arguments)}queryCompiler(mr,_r){return new B(this,mr,_r)}columnBuilder(){return new tr(this,...arguments)}columnCompiler(){return new rr(this,...arguments)}tableCompiler(){return new ir(this,...arguments)}schemaCompiler(){return new lr(this,...arguments)}viewCompiler(){return new dr(this,...arguments)}_driver(){return require$$1}processResponse(mr,_r){const yr=mr.response;return mr.output?mr.output.call(_r,yr):mr.method==="raw"?yr:yr.command==="SELECT"?mr.method==="first"?yr.rows[0]:mr.method==="pluck"?t(yr.rows,mr.pluck):yr.rows:yr.command==="INSERT"||yr.command==="UPDATE"||yr.command==="DELETE"?yr.rowCount:yr}toPathForJson(mr,_r,yr){return mr.replace(/^(\$\.)/,"").split(".").map((function(xr){return this.parameter(xr,_r,yr)}).bind(this)).join(", ")}}return Object.assign(hr.prototype,{dialect:"redshift",driverName:"pg-redshift"}),redshift=hr,redshift}var hasRequiredDialects;function requireDialects(){if(hasRequiredDialects)return dialects;hasRequiredDialects=1,Object.defineProperty(dialects,"__esModule",{value:!0}),dialects.getDialectByNameOrAlias=void 0;const{resolveClientNameWithAliases:e}=requireHelpers$1(),t=Object.freeze({"better-sqlite3":()=>requireBetterSqlite3(),cockroachdb:()=>requireCockroachdb(),mssql:()=>requireMssql(),mysql:()=>requireMysql(),mysql2:()=>requireMysql2(),oracle:()=>requireOracle(),oracledb:()=>requireOracledb(),pgnative:()=>requirePgnative(),postgres:()=>requirePostgres(),redshift:()=>requireRedshift(),sqlite3:()=>requireSqlite3()});function I(B){const tr=e(B),rr=t[tr];if(!rr)throw new Error(`Invalid clientName given: ${B}`);return rr()}return dialects.getDialectByNameOrAlias=I,dialects}var configResolver,hasRequiredConfigResolver;function requireConfigResolver(){if(hasRequiredConfigResolver)return configResolver;hasRequiredConfigResolver=1;const e=requireClient(),{SUPPORTED_CLIENTS:t}=requireConstants$1(),I=requireParseConnection(),{getDialectByNameOrAlias:B}=requireDialects();function tr(rr){let ir,lr;const dr=typeof rr=="string"?Object.assign(I(rr),arguments[2]):rr;if(arguments.length===0||!dr.client&&!dr.dialect)ir=e;else if(typeof dr.client=="function")ir=dr.client;else{const hr=dr.client||dr.dialect;if(!t.includes(hr))throw new Error(`knex: Unknown configuration option 'client' value ${hr}. Note that it is case-sensitive, check documentation for supported values.`);ir=B(hr)}return typeof dr.connection=="string"?lr=Object.assign({},dr,{connection:I(dr.connection).connection}):lr=Object.assign({},dr),{resolvedConfig:lr,Dialect:ir}}return configResolver={resolveConfig:tr},configResolver}var Knex,hasRequiredKnex;function requireKnex(){if(hasRequiredKnex)return Knex;hasRequiredKnex=1;const e=requireClient(),t=requireQuerybuilder(),I=requireMethodConstants(),B=requireMakeKnex(),{KnexTimeoutError:tr}=requireTimeout(),{resolveConfig:rr}=requireConfigResolver(),ir=requireBuilder(),lr=requireViewbuilder(),dr=requireColumnbuilder(),hr=requireTablebuilder();function fr(mr){const{resolvedConfig:_r,Dialect:yr}=rr(...arguments),xr=B(new yr(_r));return _r.userParams&&(xr.userParams=_r.userParams),xr}return fr.Client=e,fr.KnexTimeoutError=tr,fr.QueryBuilder={extend:function(mr,_r){t.extend(mr,_r),I.push(mr)}},fr.SchemaBuilder={extend:function(mr,_r){ir.extend(mr,_r)}},fr.ViewBuilder={extend:function(mr,_r){lr.extend(mr,_r)}},fr.ColumnBuilder={extend:function(mr,_r){dr.extend(mr,_r)}},fr.TableBuilder={extend:function(mr,_r){hr.extend(mr,_r)}},Knex=fr,Knex}var lib,hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,lib=requireKnex()),lib}var libExports=requireLib();const knex=getDefaultExportFromCjs(libExports),parseRawResults=e=>{const t=[];for(const I of e.values()||[]){const{fields:B,rows:tr}=I,rr=new Array(tr.length);for(let ir=0,lr=rr.length;ir<lr;ir++){const dr=tr[ir],hr={};for(let fr=0,mr=B.length;fr<mr;fr++){const{name:_r}=B[fr];hr[_r]=dr[_r]}rr[ir]=hr}t.push(...rr)}return t};class PGLiteQueryExecutor{constructor(t,I,B){ji(this,"_profiler");ji(this,"_queryLogger");ji(this,"_resultsLogger");ji(this,"_index",0);ji(this,"_sql",null);this._profiler=t,this._queryLogger=I,this._resultsLogger=B}init(t){this._sql=t}async execute(t){if(!this._sql)throw new Error("PGLiteQueryExecutor not initialized");const I=t.toString(),B=this._index++;this._queryLogger&&this._queryLogger(B,I);const tr=await this._profiler.record("Query",async()=>{var lr;const rr=await((lr=this._sql)==null?void 0:lr.exec(I));return rr?parseRawResults(rr):void 0});return this._resultsLogger&&this._resultsLogger(B,tr),tr}}var p=Object.create,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,l$2=Object.getPrototypeOf,s$1=Object.prototype.hasOwnProperty,a=e=>{throw TypeError(e)},_$1=(e,t,I)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:I}):e[t]=I,d=(e,t)=>()=>(e&&(t=e(e=0)),t),D$2=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),F$2=(e,t)=>{for(var I in t)i(e,I,{get:t[I],enumerable:!0})},g$4=(e,t,I,B)=>{if(t&&typeof t=="object"||typeof t=="function")for(let tr of f(t))!s$1.call(e,tr)&&tr!==I&&i(e,tr,{get:()=>t[tr],enumerable:!(B=c(t,tr))||B.enumerable});return e},L$2=(e,t,I)=>(I=e!=null?p(l$2(e)):{},g$4(i(I,"default",{value:e,enumerable:!0}),e)),P$1=(e,t,I)=>_$1(e,typeof t!="symbol"?t+"":t,I),n=(e,t,I)=>t.has(e)||a("Cannot "+I),h$1=(e,t,I)=>(n(e,t,"read from private field"),I?I.call(e):t.get(e)),R$2=(e,t,I)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,I),x$2=(e,t,I,B)=>(n(e,t,"write to private field"),t.set(e,I),I),T=(e,t,I)=>(n(e,t,"access private method"),I),U$2=(e,t,I,B)=>({set _(tr){x$2(e,t,tr)},get _(){return h$1(e,t,B)}}),u$1=d(()=>{}),hn={};F$2(hn,{ABSTIME:()=>Et,ACLITEM:()=>Vt,BIT:()=>Wt,BOOL:()=>be,BPCHAR:()=>_e$1,BYTEA:()=>ge$1,CHAR:()=>gt,CID:()=>St,CIDR:()=>Tt,CIRCLE:()=>Ut,DATE:()=>He$1,FLOAT4:()=>je$1,FLOAT8:()=>Qe$1,GTSVECTOR:()=>rn,INET:()=>kt,INT2:()=>ve,INT4:()=>Ge,INT8:()=>we,INTERVAL:()=>vt,JSON:()=>Ae$1,JSONB:()=>Ye,MACADDR:()=>Ot,MACADDR8:()=>Nt,MONEY:()=>Lt,NUMERIC:()=>Qt,OID:()=>We$1,PATH:()=>Mt,PG_DEPENDENCIES:()=>en,PG_LSN:()=>Xt,PG_NDISTINCT:()=>Zt,PG_NODE_TREE:()=>Bt,POLYGON:()=>Rt,REFCURSOR:()=>_t,REGCLASS:()=>Yt,REGCONFIG:()=>sn,REGDICTIONARY:()=>an,REGNAMESPACE:()=>on,REGOPER:()=>Ht,REGOPERATOR:()=>qt,REGPROC:()=>wt,REGPROCEDURE:()=>zt,REGROLE:()=>un,REGTYPE:()=>$t,RELTIME:()=>Ct,SMGR:()=>It,TEXT:()=>F$1,TID:()=>At,TIME:()=>Ft,TIMESTAMP:()=>qe$1,TIMESTAMPTZ:()=>xe,TIMETZ:()=>Gt,TINTERVAL:()=>Pt,TSQUERY:()=>nn,TSVECTOR:()=>tn,TXID_SNAPSHOT:()=>Jt,UUID:()=>Kt,VARBIT:()=>jt,VARCHAR:()=>ze,XID:()=>xt,XML:()=>Dt,arrayParser:()=>yn,arraySerializer:()=>Ke$1,parseType:()=>ue,parsers:()=>ln,serializers:()=>cn,types:()=>$e});u$1();var ht=globalThis.JSON.parse,bt=globalThis.JSON.stringify,be=16,ge$1=17,gt=18,we=20,ve=21,Ge=23,wt=24,F$1=25,We$1=26,At=27,xt=28,St=29,Ae$1=114,Dt=142,Bt=194,It=210,Mt=602,Rt=604,Tt=650,je$1=700,Qe$1=701,Et=702,Ct=703,Pt=704,Ut=718,Nt=774,Lt=790,Ot=829,kt=869,Vt=1033,_e$1=1042,ze=1043,He$1=1082,Ft=1083,qe$1=1114,xe=1184,vt=1186,Gt=1266,Wt=1560,jt=1562,Qt=1700,_t=1790,zt=2202,Ht=2203,qt=2204,Yt=2205,$t=2206,Kt=2950,Jt=2970,Xt=3220,Zt=3361,en=3402,tn=3614,nn=3615,rn=3642,sn=3734,an=3769,Ye=3802,on=4089,un=4096,$e={string:{to:F$1,from:[F$1,ze,_e$1],serialize:e=>{if(typeof e=="string")return e;if(typeof e=="number")return e.toString();throw new Error("Invalid input for string type")},parse:e=>e},number:{to:0,from:[ve,Ge,We$1,je$1,Qe$1],serialize:e=>e.toString(),parse:e=>+e},bigint:{to:we,from:[we],serialize:e=>e.toString(),parse:e=>{let t=BigInt(e);return t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER?t:Number(t)}},json:{to:Ae$1,from:[Ae$1,Ye],serialize:e=>typeof e=="string"?e:bt(e),parse:e=>ht(e)},boolean:{to:be,from:[be],serialize:e=>{if(typeof e!="boolean")throw new Error("Invalid input for boolean type");return e?"t":"f"},parse:e=>e==="t"},date:{to:xe,from:[He$1,qe$1,xe],serialize:e=>{if(typeof e=="string")return e;if(typeof e=="number")return new Date(e).toISOString();if(e instanceof Date)return e.toISOString();throw new Error("Invalid input for date type")},parse:e=>new Date(e)},bytea:{to:ge$1,from:[ge$1],serialize:e=>{if(!(e instanceof Uint8Array))throw new Error("Invalid input for bytea type");return"\\x"+Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},parse:e=>{let t=e.slice(2);return Uint8Array.from({length:t.length/2},(I,B)=>parseInt(t.substring(B*2,(B+1)*2),16))}}},Se=pn($e),ln=Se.parsers,cn=Se.serializers;function ue(e,t,I){if(e===null)return null;let B=(I==null?void 0:I[t])??Se.parsers[t];return B?B(e,t):e}function pn(e){return Object.keys(e).reduce(({parsers:t,serializers:I},B)=>{let{to:tr,from:rr,serialize:ir,parse:lr}=e[B];return I[tr]=ir,I[B]=ir,t[B]=lr,Array.isArray(rr)?rr.forEach(dr=>{t[dr]=lr,I[dr]=ir}):(t[rr]=lr,I[rr]=ir),{parsers:t,serializers:I}},{parsers:{},serializers:{}})}var dn=/\\/g,fn=/"/g;function mn(e){return e.replace(dn,"\\\\").replace(fn,'\\"')}function Ke$1(e,t,I){if(Array.isArray(e)===!1)return e;if(!e.length)return"{}";let B=e[0],tr=I===1020?";":",";return Array.isArray(B)?`{${e.map(rr=>Ke$1(rr,t,I)).join(tr)}}`:`{${e.map(rr=>(rr===void 0&&(rr=null),rr===null?"null":'"'+mn(t?t(rr):rr.toString())+'"')).join(tr)}}`}var he={i:0,char:null,str:"",quoted:!1,last:0,p:null};function yn(e,t,I){return he.i=he.last=0,Je(he,e,t,I)[0]}function Je(e,t,I,B){let tr=[],rr=B===1020?";":",";for(;e.i<t.length;e.i++){if(e.char=t[e.i],e.quoted)e.char==="\\"?e.str+=t[++e.i]:e.char==='"'?(tr.push(I?I(e.str):e.str),e.str="",e.quoted=t[e.i+1]==='"',e.last=e.i+2):e.str+=e.char;else if(e.char==='"')e.quoted=!0;else if(e.char==="{")e.last=++e.i,tr.push(Je(e,t,I,B));else if(e.char==="}"){e.quoted=!1,e.last<e.i&&tr.push(I?I(t.slice(e.last,e.i)):t.slice(e.last,e.i)),e.last=e.i+1;break}else e.char===rr&&e.p!=="}"&&e.p!=='"'&&(tr.push(I?I(t.slice(e.last,e.i)):t.slice(e.last,e.i)),e.last=e.i+1);e.p=e.char}return e.last<e.i&&tr.push(I?I(t.slice(e.last,e.i+1)):t.slice(e.last,e.i+1)),tr}var wn={};F$2(wn,{parseDescribeStatementResults:()=>De,parseResults:()=>bn});u$1();function bn(e,t,I,B){let tr=[],rr={rows:[],fields:[]},ir=0,lr={...t,...I==null?void 0:I.parsers};return e.forEach(dr=>{switch(dr.name){case"rowDescription":{let hr=dr;rr.fields=hr.fields.map(fr=>({name:fr.name,dataTypeID:fr.dataTypeID}));break}case"dataRow":{if(!rr)break;let hr=dr;(I==null?void 0:I.rowMode)==="array"?rr.rows.push(hr.fields.map((fr,mr)=>ue(fr,rr.fields[mr].dataTypeID,lr))):rr.rows.push(Object.fromEntries(hr.fields.map((fr,mr)=>[rr.fields[mr].name,ue(fr,rr.fields[mr].dataTypeID,lr)])));break}case"commandComplete":{ir+=gn(dr),tr.push({...rr,affectedRows:ir,...B?{blob:B}:{}}),rr={rows:[],fields:[]};break}}}),tr.length===0&&tr.push({affectedRows:0,rows:[],fields:[]}),tr}function gn(e){let t=e.text.split(" ");switch(t[0]){case"INSERT":return parseInt(t[2],10);case"UPDATE":case"DELETE":case"COPY":return parseInt(t[1],10);default:return 0}}function De(e){let t=e.find(I=>I.name==="parameterDescription");return t?t.dataTypeIDs:[]}var Ue$1={};F$2(Ue$1,{AuthenticationCleartextPassword:()=>G$1,AuthenticationMD5Password:()=>W$1,AuthenticationOk:()=>v,AuthenticationSASL:()=>j$2,AuthenticationSASLContinue:()=>Q,AuthenticationSASLFinal:()=>_,BackendKeyDataMessage:()=>J$1,CommandCompleteMessage:()=>ee$1,CopyDataMessage:()=>z$1,CopyResponse:()=>H$2,DataRowMessage:()=>te$1,DatabaseError:()=>E,Field:()=>q$1,NoticeMessage:()=>ne,NotificationResponseMessage:()=>X,ParameterDescriptionMessage:()=>$$1,ParameterStatusMessage:()=>K$1,ReadyForQueryMessage:()=>Z$1,RowDescriptionMessage:()=>Y$1,bindComplete:()=>Ie$1,closeComplete:()=>Me,copyDone:()=>Pe$1,emptyQuery:()=>Ce,noData:()=>Re,parseComplete:()=>Be,portalSuspended:()=>Te$1,replicationStart:()=>Ee});u$1();var Be={name:"parseComplete",length:5},Ie$1={name:"bindComplete",length:5},Me={name:"closeComplete",length:5},Re={name:"noData",length:5},Te$1={name:"portalSuspended",length:5},Ee={name:"replicationStart",length:4},Ce={name:"emptyQuery",length:4},Pe$1={name:"copyDone",length:4},v=class{constructor(e){this.length=e,this.name="authenticationOk"}},G$1=class{constructor(t){this.length=t,this.name="authenticationCleartextPassword"}},W$1=class{constructor(t,I){this.length=t,this.salt=I,this.name="authenticationMD5Password"}},j$2=class{constructor(t,I){this.length=t,this.mechanisms=I,this.name="authenticationSASL"}},Q=class{constructor(e,t){this.length=e,this.data=t,this.name="authenticationSASLContinue"}},_=class{constructor(e,t){this.length=e,this.data=t,this.name="authenticationSASLFinal"}},E=class extends Error{constructor(e,t,I){super(e),this.length=t,this.name=I}},z$1=class{constructor(t,I){this.length=t,this.chunk=I,this.name="copyData"}},H$2=class{constructor(t,I,B,tr){this.length=t,this.name=I,this.binary=B,this.columnTypes=new Array(tr)}},q$1=class{constructor(t,I,B,tr,rr,ir,lr){this.name=t,this.tableID=I,this.columnID=B,this.dataTypeID=tr,this.dataTypeSize=rr,this.dataTypeModifier=ir,this.format=lr}},Y$1=class{constructor(t,I){this.length=t,this.fieldCount=I,this.name="rowDescription",this.fields=new Array(this.fieldCount)}},$$1=class{constructor(t,I){this.length=t,this.parameterCount=I,this.name="parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}},K$1=class{constructor(t,I,B){this.length=t,this.parameterName=I,this.parameterValue=B,this.name="parameterStatus"}},J$1=class{constructor(t,I,B){this.length=t,this.processID=I,this.secretKey=B,this.name="backendKeyData"}},X=class{constructor(e,t,I,B){this.length=e,this.processId=t,this.channel=I,this.payload=B,this.name="notification"}},Z$1=class{constructor(t,I){this.length=t,this.status=I,this.name="readyForQuery"}},ee$1=class{constructor(t,I){this.length=t,this.text=I,this.name="commandComplete"}},te$1=class{constructor(t,I){this.length=t,this.fields=I,this.name="dataRow",this.fieldCount=I.length}},ne=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}},zn={};F$2(zn,{Parser:()=>ye,messages:()=>Ue$1,serialize:()=>O$1});u$1();u$1();u$1();u$1();function C$1(e){let t=e.length;for(let I=e.length-1;I>=0;I--){let B=e.charCodeAt(I);B>127&&B<=2047?t++:B>2047&&B<=65535&&(t+=2),B>=56320&&B<=57343&&I--}return t}var b$1,g$3,U$1,ce$2,N,x$1,le,P,Xe,R$1=class{constructor(t=256){this.size=t,R$2(this,x$1),R$2(this,b$1),R$2(this,g$3,5),R$2(this,U$1,!1),R$2(this,ce$2,new TextEncoder),R$2(this,N,0),x$2(this,b$1,T(this,x$1,le).call(this,t))}addInt32(t){return T(this,x$1,P).call(this,4),h$1(this,b$1).setInt32(h$1(this,g$3),t,h$1(this,U$1)),x$2(this,g$3,h$1(this,g$3)+4),this}addInt16(t){return T(this,x$1,P).call(this,2),h$1(this,b$1).setInt16(h$1(this,g$3),t,h$1(this,U$1)),x$2(this,g$3,h$1(this,g$3)+2),this}addCString(t){return t&&this.addString(t),T(this,x$1,P).call(this,1),h$1(this,b$1).setUint8(h$1(this,g$3),0),U$2(this,g$3)._++,this}addString(t=""){let I=C$1(t);return T(this,x$1,P).call(this,I),h$1(this,ce$2).encodeInto(t,new Uint8Array(h$1(this,b$1).buffer,h$1(this,g$3))),x$2(this,g$3,h$1(this,g$3)+I),this}add(t){return T(this,x$1,P).call(this,t.byteLength),new Uint8Array(h$1(this,b$1).buffer).set(new Uint8Array(t),h$1(this,g$3)),x$2(this,g$3,h$1(this,g$3)+t.byteLength),this}flush(t){let I=T(this,x$1,Xe).call(this,t);return x$2(this,g$3,5),x$2(this,b$1,T(this,x$1,le).call(this,this.size)),new Uint8Array(I)}};b$1=new WeakMap,g$3=new WeakMap,U$1=new WeakMap,ce$2=new WeakMap,N=new WeakMap,x$1=new WeakSet,le=function(e){return new DataView(new ArrayBuffer(e))},P=function(e){if(h$1(this,b$1).byteLength-h$1(this,g$3)<e){let t=h$1(this,b$1).buffer,I=t.byteLength+(t.byteLength>>1)+e;x$2(this,b$1,T(this,x$1,le).call(this,I)),new Uint8Array(h$1(this,b$1).buffer).set(new Uint8Array(t))}},Xe=function(e){if(e){h$1(this,b$1).setUint8(h$1(this,N),e);let t=h$1(this,g$3)-(h$1(this,N)+1);h$1(this,b$1).setInt32(h$1(this,N)+1,t,h$1(this,U$1))}return h$1(this,b$1).buffer.slice(e?0:5,h$1(this,g$3))};var m=new R$1,An=e=>{m.addInt16(3).addInt16(0);for(let B of Object.keys(e))m.addCString(B).addCString(e[B]);m.addCString("client_encoding").addCString("UTF8");let t=m.addCString("").flush(),I=t.byteLength+4;return new R$1().addInt32(I).add(t).flush()},xn=()=>{let e=new DataView(new ArrayBuffer(8));return e.setInt32(0,8,!1),e.setInt32(4,80877103,!1),new Uint8Array(e.buffer)},Sn=e=>m.addCString(e).flush(112),Dn=(e,t)=>(m.addCString(e).addInt32(C$1(t)).addString(t),m.flush(112)),Bn=e=>m.addString(e).flush(112),In=e=>m.addCString(e).flush(81),Mn=[],Rn=e=>{var B,tr;let t=e.name??"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let I=m.addCString(t).addCString(e.text).addInt16(((B=e.types)==null?void 0:B.length)??0);return(tr=e.types)==null||tr.forEach(rr=>I.addInt32(rr)),m.flush(80)},L$1=new R$1,Tn=(e,t)=>{for(let I=0;I<e.length;I++){let B=t?t(e[I],I):e[I];if(B===null)m.addInt16(0),L$1.addInt32(-1);else if(B instanceof ArrayBuffer||ArrayBuffer.isView(B)){let tr=ArrayBuffer.isView(B)?B.buffer.slice(B.byteOffset,B.byteOffset+B.byteLength):B;m.addInt16(1),L$1.addInt32(tr.byteLength),L$1.add(tr)}else m.addInt16(0),L$1.addInt32(C$1(B)),L$1.addString(B)}},En=(e={})=>{let t=e.portal??"",I=e.statement??"",B=e.binary??!1,tr=e.values??Mn,rr=tr.length;return m.addCString(t).addCString(I),m.addInt16(rr),Tn(tr,e.valueMapper),m.addInt16(rr),m.add(L$1.flush()),m.addInt16(B?1:0),m.flush(66)},Cn=new Uint8Array([69,0,0,0,9,0,0,0,0,0]),Pn=e=>{if(!e||!e.portal&&!e.rows)return Cn;let t=e.portal??"",I=e.rows??0,B=C$1(t),tr=4+B+1+4,rr=new DataView(new ArrayBuffer(1+tr));return rr.setUint8(0,69),rr.setInt32(1,tr,!1),new TextEncoder().encodeInto(t,new Uint8Array(rr.buffer,5)),rr.setUint8(B+5,0),rr.setUint32(rr.byteLength-4,I,!1),new Uint8Array(rr.buffer)},Un=(e,t)=>{let I=new DataView(new ArrayBuffer(16));return I.setInt32(0,16,!1),I.setInt16(4,1234,!1),I.setInt16(6,5678,!1),I.setInt32(8,e,!1),I.setInt32(12,t,!1),new Uint8Array(I.buffer)},Ne=(e,t)=>{let I=new R$1;return I.addCString(t),I.flush(e)},Nn=m.addCString("P").flush(68),Ln=m.addCString("S").flush(68),On=e=>e.name?Ne(68,`${e.type}${e.name??""}`):e.type==="P"?Nn:Ln,kn=e=>{let t=`${e.type}${e.name??""}`;return Ne(67,t)},Vn=e=>m.add(e).flush(100),Fn=e=>Ne(102,e),pe$1=e=>new Uint8Array([e,0,0,0,4]),vn=pe$1(72),Gn=pe$1(83),Wn=pe$1(88),jn=pe$1(99),O$1={startup:An,password:Sn,requestSsl:xn,sendSASLInitialResponseMessage:Dn,sendSCRAMClientFinalMessage:Bn,query:In,parse:Rn,bind:En,execute:Pn,describe:On,close:kn,flush:()=>vn,sync:()=>Gn,end:()=>Wn,copyData:Vn,copyDone:()=>jn,copyFail:Fn,cancel:Un};u$1();u$1();var Le={text:0,binary:1};u$1();var Qn=new ArrayBuffer(0),M$1,w$1,fe,me$1,re$1,de=class{constructor(e=0){R$2(this,M$1,new DataView(Qn)),R$2(this,w$1),R$2(this,fe,"utf-8"),R$2(this,me$1,new TextDecoder(h$1(this,fe))),R$2(this,re$1,!1),x$2(this,w$1,e)}setBuffer(e,t){x$2(this,w$1,e),x$2(this,M$1,new DataView(t))}int16(){let e=h$1(this,M$1).getInt16(h$1(this,w$1),h$1(this,re$1));return x$2(this,w$1,h$1(this,w$1)+2),e}byte(){let e=h$1(this,M$1).getUint8(h$1(this,w$1));return U$2(this,w$1)._++,e}int32(){let e=h$1(this,M$1).getInt32(h$1(this,w$1),h$1(this,re$1));return x$2(this,w$1,h$1(this,w$1)+4),e}string(e){return h$1(this,me$1).decode(this.bytes(e))}cstring(){let e=h$1(this,w$1),t=e;for(;h$1(this,M$1).getUint8(t++)!==0;);let I=this.string(t-e-1);return x$2(this,w$1,t),I}bytes(e){let t=h$1(this,M$1).buffer.slice(h$1(this,w$1),h$1(this,w$1)+e);return x$2(this,w$1,h$1(this,w$1)+e),new Uint8Array(t)}};M$1=new WeakMap,w$1=new WeakMap,fe=new WeakMap,me$1=new WeakMap,re$1=new WeakMap;var Oe=1,_n=4,Ze=Oe+_n,et=new ArrayBuffer(0),A,S$1,D$1,o$1,l$1,tt,nt,rt,st,it,at,ot,ke$1,ut,lt,ct,pt,dt,ft,mt,yt,Ve$1,ye=class{constructor(){R$2(this,l$1),R$2(this,A,new DataView(et)),R$2(this,S$1,0),R$2(this,D$1,0),R$2(this,o$1,new de)}parse(e,t){T(this,l$1,tt).call(this,ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e);let I=h$1(this,D$1)+h$1(this,S$1),B=h$1(this,D$1);for(;B+Ze<=I;){let tr=h$1(this,A).getUint8(B),rr=h$1(this,A).getUint32(B+Oe,!1),ir=Oe+rr;if(ir+B<=I){let lr=T(this,l$1,nt).call(this,B+Ze,tr,rr,h$1(this,A).buffer);t(lr),B+=ir}else break}B===I?(x$2(this,A,new DataView(et)),x$2(this,S$1,0),x$2(this,D$1,0)):(x$2(this,S$1,I-B),x$2(this,D$1,B))}};A=new WeakMap,S$1=new WeakMap,D$1=new WeakMap,o$1=new WeakMap,l$1=new WeakSet,tt=function(e){if(h$1(this,S$1)>0){let t=h$1(this,S$1)+e.byteLength;if(t+h$1(this,D$1)>h$1(this,A).byteLength){let I;if(t<=h$1(this,A).byteLength&&h$1(this,D$1)>=h$1(this,S$1))I=h$1(this,A).buffer;else{let B=h$1(this,A).byteLength*2;for(;t>=B;)B*=2;I=new ArrayBuffer(B)}new Uint8Array(I).set(new Uint8Array(h$1(this,A).buffer,h$1(this,D$1),h$1(this,S$1))),x$2(this,A,new DataView(I)),x$2(this,D$1,0)}new Uint8Array(h$1(this,A).buffer).set(new Uint8Array(e),h$1(this,D$1)+h$1(this,S$1)),x$2(this,S$1,t)}else x$2(this,A,new DataView(e)),x$2(this,D$1,0),x$2(this,S$1,e.byteLength)},nt=function(e,t,I,B){switch(t){case 50:return Ie$1;case 49:return Be;case 51:return Me;case 110:return Re;case 115:return Te$1;case 99:return Pe$1;case 87:return Ee;case 73:return Ce;case 68:return T(this,l$1,dt).call(this,e,I,B);case 67:return T(this,l$1,st).call(this,e,I,B);case 90:return T(this,l$1,rt).call(this,e,I,B);case 65:return T(this,l$1,ut).call(this,e,I,B);case 82:return T(this,l$1,yt).call(this,e,I,B);case 83:return T(this,l$1,ft).call(this,e,I,B);case 75:return T(this,l$1,mt).call(this,e,I,B);case 69:return T(this,l$1,Ve$1).call(this,e,I,B,"error");case 78:return T(this,l$1,Ve$1).call(this,e,I,B,"notice");case 84:return T(this,l$1,lt).call(this,e,I,B);case 116:return T(this,l$1,pt).call(this,e,I,B);case 71:return T(this,l$1,at).call(this,e,I,B);case 72:return T(this,l$1,ot).call(this,e,I,B);case 100:return T(this,l$1,it).call(this,e,I,B);default:return new E("received invalid response: "+t.toString(16),I,"error")}},rt=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).string(1);return new Z$1(t,B)},st=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).cstring();return new ee$1(t,B)},it=function(e,t,I){let B=I.slice(e,e+(t-4));return new z$1(t,new Uint8Array(B))},at=function(e,t,I){return T(this,l$1,ke$1).call(this,e,t,I,"copyInResponse")},ot=function(e,t,I){return T(this,l$1,ke$1).call(this,e,t,I,"copyOutResponse")},ke$1=function(e,t,I,B){h$1(this,o$1).setBuffer(e,I);let tr=h$1(this,o$1).byte()!==0,rr=h$1(this,o$1).int16(),ir=new H$2(t,B,tr,rr);for(let lr=0;lr<rr;lr++)ir.columnTypes[lr]=h$1(this,o$1).int16();return ir},ut=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).int32(),tr=h$1(this,o$1).cstring(),rr=h$1(this,o$1).cstring();return new X(t,B,tr,rr)},lt=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).int16(),tr=new Y$1(t,B);for(let rr=0;rr<B;rr++)tr.fields[rr]=T(this,l$1,ct).call(this);return tr},ct=function(){let e=h$1(this,o$1).cstring(),t=h$1(this,o$1).int32(),I=h$1(this,o$1).int16(),B=h$1(this,o$1).int32(),tr=h$1(this,o$1).int16(),rr=h$1(this,o$1).int32(),ir=h$1(this,o$1).int16()===0?Le.text:Le.binary;return new q$1(e,t,I,B,tr,rr,ir)},pt=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).int16(),tr=new $$1(t,B);for(let rr=0;rr<B;rr++)tr.dataTypeIDs[rr]=h$1(this,o$1).int32();return tr},dt=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).int16(),tr=new Array(B);for(let rr=0;rr<B;rr++){let ir=h$1(this,o$1).int32();tr[rr]=ir===-1?null:h$1(this,o$1).string(ir)}return new te$1(t,tr)},ft=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).cstring(),tr=h$1(this,o$1).cstring();return new K$1(t,B,tr)},mt=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).int32(),tr=h$1(this,o$1).int32();return new J$1(t,B,tr)},yt=function(e,t,I){h$1(this,o$1).setBuffer(e,I);let B=h$1(this,o$1).int32();switch(B){case 0:return new v(t);case 3:return new G$1(t);case 5:return new W$1(t,h$1(this,o$1).bytes(4));case 10:{let tr=[];for(;;){let rr=h$1(this,o$1).cstring();if(rr.length===0)return new j$2(t,tr);tr.push(rr)}}case 11:return new Q(t,h$1(this,o$1).string(t-8));case 12:return new _(t,h$1(this,o$1).string(t-8));default:throw new Error("Unknown authenticationOk message type "+B)}},Ve$1=function(e,t,I,B){h$1(this,o$1).setBuffer(e,I);let tr={},rr=h$1(this,o$1).string(1);for(;rr!=="\0";)tr[rr]=h$1(this,o$1).cstring(),rr=h$1(this,o$1).string(1);let ir=tr.M,lr=B==="notice"?new ne(t,ir):new E(ir,t,B);return lr.severity=tr.S,lr.code=tr.C,lr.detail=tr.D,lr.hint=tr.H,lr.position=tr.P,lr.internalPosition=tr.p,lr.internalQuery=tr.q,lr.where=tr.W,lr.schema=tr.s,lr.table=tr.t,lr.column=tr.c,lr.dataType=tr.d,lr.constraint=tr.n,lr.file=tr.F,lr.line=tr.L,lr.routine=tr.R,lr};u$1();var Fe$1=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",se$1;async function Rr(){if(Fe$1||se$1)return;let e=new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url);se$1=fetch(e)}var k$1;async function Tr(e,t){if(t||k$1)return WebAssembly.instantiate(t||k$1,e),{instance:await WebAssembly.instantiate(t||k$1,e),module:t||k$1};let I=new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url);if(Fe$1){let B=await(await __vitePreload(async()=>{const{readFile:ir}=await import("./index.CW6hXWch.js").then(lr=>lr.bE);return{readFile:ir}},[],import.meta.url)).readFile(I),{module:tr,instance:rr}=await WebAssembly.instantiate(B,e);return k$1=tr,{instance:rr,module:tr}}else{se$1||(se$1=fetch(I));let B=await se$1,{module:tr,instance:rr}=await WebAssembly.instantiateStreaming(B,e);return k$1=tr,{instance:rr,module:tr}}}async function Er(){let e=new URL(""+new URL("postgres-CkP7QCDB.data",import.meta.url).href,import.meta.url);return Fe$1?(await(await __vitePreload(async()=>{const{readFile:t}=await import("./index.CW6hXWch.js").then(I=>I.bE);return{readFile:t}},[],import.meta.url)).readFile(e)).buffer:(await fetch(e)).arrayBuffer()}var Cr=()=>{var I,B;if((I=globalThis.crypto)!=null&&I.randomUUID)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);if((B=globalThis.crypto)!=null&&B.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let tr=0;tr<e.length;tr++)e[tr]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];return e.forEach(tr=>{t.push(tr.toString(16).padStart(2,"0"))}),t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10).join("")};async function Pr(e,t,I,B){if(!I||I.length===0)return t;B=B??e;let tr;try{await e.execProtocol(O$1.parse({text:t}),{syncToFs:!1}),tr=De((await e.execProtocol(O$1.describe({type:"S"}),{syncToFs:!1})).messages)}finally{await e.execProtocol(O$1.sync(),{syncToFs:!1})}let rr=t.replace(/\$([0-9]+)/g,(ir,lr)=>"%"+lr+"L");return(await B.query(`SELECT format($1, ${I.map((ir,lr)=>`$${lr+2}`).join(", ")}) as query`,[rr,...I],{paramTypes:[F$1,...tr]})).rows[0].query}function Ur(e){let t,I=!1,B=async()=>{if(!t){I=!1;return}I=!0;let{args:tr,resolve:rr,reject:ir}=t;t=void 0;try{let lr=await e(...tr);rr(lr)}catch(lr){ir(lr)}finally{B()}};return async(...tr)=>{t&&t.resolve(void 0);let rr=new Promise((ir,lr)=>{t={args:tr,resolve:ir,reject:lr}});return I||B(),rr}}function Nr(e){let t;return e.startsWith('"')&&e.endsWith('"')?t=e.substring(1,e.length-1):t=e.toLowerCase(),t}u$1();var o={part:"part",container:"container"};function s(e,t,...I){let B=e.length-1,tr=I.length-1;if(tr!==-1){if(tr===0){e[B]=e[B]+I[0]+t;return}e[B]=e[B]+I[0],e.push(...I.slice(1,tr)),e.push(I[tr]+t)}}function y(e,...t){let I=[e[0]];I.raw=[e.raw[0]];let B=[];for(let tr=0;tr<t.length;tr++){let rr=t[tr],ir=tr+1;if((rr==null?void 0:rr._templateType)===o.part){s(I,e[ir],rr.str),s(I.raw,e.raw[ir],rr.str);continue}if((rr==null?void 0:rr._templateType)===o.container){s(I,e[ir],...rr.strings),s(I.raw,e.raw[ir],...rr.strings.raw),B.push(...rr.values);continue}I.push(e[ir]),I.raw.push(e.raw[ir]),B.push(rr)}return{_templateType:"container",strings:I,values:B}}function g$2(e,...t){let{strings:I,values:B}=y(e,...t);return{query:[I[0],...B.flatMap((tr,rr)=>[`$${rr+1}`,I[rr+1]])].join(""),params:B}}u$1();var b,u,r,l,g$1,h,R,z=class{constructor(){R$2(this,r),this.serializers={...cn},this.parsers={...ln},R$2(this,b,!1),R$2(this,u,!1)}async _initArrayTypes({force:e=!1}={}){if(h$1(this,b)&&!e)return;x$2(this,b,!0);let t=await this.query(`
|
|
130
|
-
SELECT b.oid, b.typarray
|
|
131
|
-
FROM pg_catalog.pg_type a
|
|
132
|
-
LEFT JOIN pg_catalog.pg_type b ON b.oid = a.typelem
|
|
133
|
-
WHERE a.typcategory = 'A'
|
|
134
|
-
GROUP BY b.oid, b.typarray
|
|
135
|
-
ORDER BY b.oid
|
|
136
|
-
`);for(let I of t.rows)this.serializers[I.typarray]=B=>Ke$1(B,this.serializers[I.oid],I.typarray),this.parsers[I.typarray]=B=>yn(B,this.parsers[I.oid],I.typarray)}async refreshArrayTypes(){await this._initArrayTypes({force:!0})}async query(e,t,I){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T(this,r,g$1).call(this,e,t,I))}async sql(e,...t){let{query:I,params:B}=g$2(e,...t);return await this.query(I,B)}async exec(e,t){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T(this,r,h).call(this,e,t))}async describeQuery(e,t){try{await T(this,r,l).call(this,O$1.parse({text:e,types:t==null?void 0:t.paramTypes}),t);let I=await T(this,r,l).call(this,O$1.describe({type:"S"}),t),B=I.messages.find(lr=>lr.name==="parameterDescription"),tr=I.messages.find(lr=>lr.name==="rowDescription"),rr=(B==null?void 0:B.dataTypeIDs.map(lr=>({dataTypeID:lr,serializer:this.serializers[lr]})))??[],ir=(tr==null?void 0:tr.fields.map(lr=>({name:lr.name,dataTypeID:lr.dataTypeID,parser:this.parsers[lr.dataTypeID]})))??[];return{queryParams:rr,resultFields:ir}}finally{await T(this,r,l).call(this,O$1.sync(),t)}}async transaction(e){return await this._checkReady(),await this._runExclusiveTransaction(async()=>{await T(this,r,h).call(this,"BEGIN"),x$2(this,u,!0);let t=!1,I=()=>{if(t)throw new Error("Transaction is closed")},B={query:async(tr,rr,ir)=>(I(),await T(this,r,g$1).call(this,tr,rr,ir)),sql:async(tr,...rr)=>{let{query:ir,params:lr}=g$2(tr,...rr);return await T(this,r,g$1).call(this,ir,lr)},exec:async(tr,rr)=>(I(),await T(this,r,h).call(this,tr,rr)),rollback:async()=>{I(),await T(this,r,h).call(this,"ROLLBACK"),t=!0},get closed(){return t}};try{let tr=await e(B);return t||(t=!0,await T(this,r,h).call(this,"COMMIT")),x$2(this,u,!1),tr}catch(tr){throw t||await T(this,r,h).call(this,"ROLLBACK"),x$2(this,u,!1),tr}})}async runExclusive(e){return await this._runExclusiveQuery(e)}};b=new WeakMap,u=new WeakMap,r=new WeakSet,l=async function(e,t={}){return await this.execProtocol(e,{...t,syncToFs:!1})},g$1=async function(e,t=[],I){return await this._runExclusiveQuery(async()=>{T(this,r,R).call(this,"runQuery",e,t,I),await this._handleBlob(I==null?void 0:I.blob);let B;try{let{messages:rr}=await T(this,r,l).call(this,O$1.parse({text:e,types:I==null?void 0:I.paramTypes}),I),ir=De((await T(this,r,l).call(this,O$1.describe({type:"S"}),I)).messages),lr=t.map((dr,hr)=>{var _r;let fr=ir[hr];if(dr==null)return null;let mr=((_r=I==null?void 0:I.serializers)==null?void 0:_r[fr])??this.serializers[fr];return mr?mr(dr):dr.toString()});B=[...rr,...(await T(this,r,l).call(this,O$1.bind({values:lr}),I)).messages,...(await T(this,r,l).call(this,O$1.describe({type:"P"}),I)).messages,...(await T(this,r,l).call(this,O$1.execute({}),I)).messages]}finally{await T(this,r,l).call(this,O$1.sync(),I)}await this._cleanupBlob(),h$1(this,u)||await this.syncToFs();let tr=await this._getWrittenBlob();return bn(B,this.parsers,I,tr)[0]})},h=async function(e,t){return await this._runExclusiveQuery(async()=>{T(this,r,R).call(this,"runExec",e,t),await this._handleBlob(t==null?void 0:t.blob);let I;try{I=(await T(this,r,l).call(this,O$1.query(e),t)).messages}finally{await T(this,r,l).call(this,O$1.sync(),t)}this._cleanupBlob(),h$1(this,u)||await this.syncToFs();let B=await this._getWrittenBlob();return bn(I,this.parsers,t,B)})},R=function(...e){this.debug>0&&console.log(...e)};var w=D$2((e,t)=>{u$1();var I=9007199254740991,B=function(Sr){return Sr}();function tr(Sr){return Sr===B}function rr(Sr){return typeof Sr=="string"||Object.prototype.toString.call(Sr)=="[object String]"}function ir(Sr){return Object.prototype.toString.call(Sr)=="[object Date]"}function lr(Sr){return Sr!==null&&typeof Sr=="object"}function dr(Sr){return typeof Sr=="function"}function hr(Sr){return typeof Sr=="number"&&Sr>-1&&Sr%1==0&&Sr<=I}function fr(Sr){return Object.prototype.toString.call(Sr)=="[object Array]"}function mr(Sr){return lr(Sr)&&!dr(Sr)&&hr(Sr.length)}function _r(Sr){return Object.prototype.toString.call(Sr)=="[object ArrayBuffer]"}function yr(Sr,wr){return Array.prototype.map.call(Sr,wr)}function xr(Sr,wr){var br=B;return dr(wr)&&Array.prototype.every.call(Sr,function(Ar,kr,Dr){var Or=wr(Ar,kr,Dr);return Or&&(br=Ar),!Or}),br}function Mr(Sr){return Object.assign.apply(null,arguments)}function vr(Sr){var wr,br,Ar;if(rr(Sr)){for(br=Sr.length,Ar=new Uint8Array(br),wr=0;wr<br;wr++)Ar[wr]=Sr.charCodeAt(wr)&255;return Ar}return _r(Sr)?new Uint8Array(Sr):lr(Sr)&&_r(Sr.buffer)?new Uint8Array(Sr.buffer):mr(Sr)?new Uint8Array(Sr):lr(Sr)&&dr(Sr.toString)?vr(Sr.toString()):new Uint8Array}t.exports.MAX_SAFE_INTEGER=I,t.exports.isUndefined=tr,t.exports.isString=rr,t.exports.isObject=lr,t.exports.isDateTime=ir,t.exports.isFunction=dr,t.exports.isArray=fr,t.exports.isArrayLike=mr,t.exports.isArrayBuffer=_r,t.exports.map=yr,t.exports.find=xr,t.exports.extend=Mr,t.exports.toUint8Array=vr}),x=D$2((e,t)=>{u$1();var I="\0";t.exports={NULL_CHAR:I,TMAGIC:"ustar"+I+"00",OLDGNU_MAGIC:"ustar "+I,REGTYPE:0,LNKTYPE:1,SYMTYPE:2,CHRTYPE:3,BLKTYPE:4,DIRTYPE:5,FIFOTYPE:6,CONTTYPE:7,TSUID:parseInt("4000",8),TSGID:parseInt("2000",8),TSVTX:parseInt("1000",8),TUREAD:parseInt("0400",8),TUWRITE:parseInt("0200",8),TUEXEC:parseInt("0100",8),TGREAD:parseInt("0040",8),TGWRITE:parseInt("0020",8),TGEXEC:parseInt("0010",8),TOREAD:parseInt("0004",8),TOWRITE:parseInt("0002",8),TOEXEC:parseInt("0001",8),TPERMALL:parseInt("0777",8),TPERMMASK:parseInt("0777",8)}}),L=D$2((e,t)=>{u$1();var I=w(),B=x(),tr=512,rr=B.TPERMALL,ir=0,lr=0,dr=[["name",100,0,function(wr,br){return mr(wr[br[0]],br[1])},function(wr,br,Ar){return xr(wr.slice(br,br+Ar[1]))}],["mode",8,100,function(wr,br){var Ar=wr[br[0]]||rr;return Ar=Ar&B.TPERMMASK,_r(Ar,br[1],rr)},function(wr,br,Ar){var kr=Mr(wr.slice(br,br+Ar[1]));return kr&=B.TPERMMASK,kr}],["uid",8,108,function(wr,br){return _r(wr[br[0]],br[1],ir)},function(wr,br,Ar){return Mr(wr.slice(br,br+Ar[1]))}],["gid",8,116,function(wr,br){return _r(wr[br[0]],br[1],lr)},function(wr,br,Ar){return Mr(wr.slice(br,br+Ar[1]))}],["size",12,124,function(wr,br){return _r(wr.data.length,br[1])},function(wr,br,Ar){return Mr(wr.slice(br,br+Ar[1]))}],["modifyTime",12,136,function(wr,br){return yr(wr[br[0]],br[1])},function(wr,br,Ar){return vr(wr.slice(br,br+Ar[1]))}],["checksum",8,148,function(wr,br){return" "},function(wr,br,Ar){return Mr(wr.slice(br,br+Ar[1]))}],["type",1,156,function(wr,br){return""+(parseInt(wr[br[0]],10)||0)%8},function(wr,br,Ar){return(parseInt(String.fromCharCode(wr[br]),10)||0)%8}],["linkName",100,157,function(wr,br){return""},function(wr,br,Ar){return xr(wr.slice(br,br+Ar[1]))}],["ustar",8,257,function(wr,br){return B.TMAGIC},function(wr,br,Ar){return fr(xr(wr.slice(br,br+Ar[1]),!0))},function(wr,br){return wr[br[0]]==B.TMAGIC||wr[br[0]]==B.OLDGNU_MAGIC}],["owner",32,265,function(wr,br){return mr(wr[br[0]],br[1])},function(wr,br,Ar){return xr(wr.slice(br,br+Ar[1]))}],["group",32,297,function(wr,br){return mr(wr[br[0]],br[1])},function(wr,br,Ar){return xr(wr.slice(br,br+Ar[1]))}],["majorNumber",8,329,function(wr,br){return""},function(wr,br,Ar){return Mr(wr.slice(br,br+Ar[1]))}],["minorNumber",8,337,function(wr,br){return""},function(wr,br,Ar){return Mr(wr.slice(br,br+Ar[1]))}],["prefix",131,345,function(wr,br){return mr(wr[br[0]],br[1])},function(wr,br,Ar){return xr(wr.slice(br,br+Ar[1]))}],["accessTime",12,476,function(wr,br){return yr(wr[br[0]],br[1])},function(wr,br,Ar){return vr(wr.slice(br,br+Ar[1]))}],["createTime",12,488,function(wr,br){return yr(wr[br[0]],br[1])},function(wr,br,Ar){return vr(wr.slice(br,br+Ar[1]))}]],hr=function(wr){var br=wr[wr.length-1];return br[2]+br[1]}(dr);function fr(wr){if(wr.length==8){var br=wr.split("");if(br[5]==B.NULL_CHAR)return(br[6]==" "||br[6]==B.NULL_CHAR)&&(br[6]="0"),(br[7]==" "||br[7]==B.NULL_CHAR)&&(br[7]="0"),br=br.join(""),br==B.TMAGIC?br:wr;if(br[7]==B.NULL_CHAR)return br[5]==B.NULL_CHAR&&(br[5]=" "),br[6]==B.NULL_CHAR&&(br[6]=" "),br==B.OLDGNU_MAGIC?br:wr}return wr}function mr(wr,br){return br-=1,I.isUndefined(wr)&&(wr=""),wr=(""+wr).substr(0,br),wr+B.NULL_CHAR}function _r(wr,br,Ar){for(Ar=parseInt(Ar)||0,br-=1,wr=(parseInt(wr)||Ar).toString(8).substr(-br,br);wr.length<br;)wr="0"+wr;return wr+B.NULL_CHAR}function yr(wr,br){if(I.isDateTime(wr))wr=Math.floor(1*wr/1e3);else if(wr=parseInt(wr,10),isFinite(wr)){if(wr<=0)return""}else wr=Math.floor(1*new Date/1e3);return _r(wr,br,0)}function xr(wr,br){var Ar=String.fromCharCode.apply(null,wr);if(br)return Ar;var kr=Ar.indexOf(B.NULL_CHAR);return kr>=0?Ar.substr(0,kr):Ar}function Mr(wr){var br=String.fromCharCode.apply(null,wr);return parseInt(br.replace(/^0+$/g,""),8)||0}function vr(wr){return wr.length==0||wr[0]==0?null:new Date(1e3*Mr(wr))}function Sr(wr,br,Ar){var kr=parseInt(br,10)||0,Dr=Math.min(kr+hr,wr.length),Or=0,zr=0,$n=0;Ar&&dr.every(function(ti){return ti[0]=="checksum"?(zr=kr+ti[2],$n=zr+ti[1],!1):!0});for(var Fr=32,$r=kr;$r<Dr;$r++){var Hn=$r>=zr&&$r<$n?Fr:wr[$r];Or=(Or+Hn)%262144}return Or}t.exports.recordSize=tr,t.exports.defaultFileMode=rr,t.exports.defaultUid=ir,t.exports.defaultGid=lr,t.exports.posixHeader=dr,t.exports.effectiveHeaderSize=hr,t.exports.calculateChecksum=Sr,t.exports.formatTarString=mr,t.exports.formatTarNumber=_r,t.exports.formatTarDateTime=yr,t.exports.parseTarString=xr,t.exports.parseTarNumber=Mr,t.exports.parseTarDateTime=vr}),er=D$2((e,t)=>{u$1();var I=x(),B=w(),tr=L();function rr(mr){return tr.recordSize}function ir(mr){return Math.ceil(mr.data.length/tr.recordSize)*tr.recordSize}function lr(mr){var _r=0;return mr.forEach(function(yr){_r+=rr()+ir(yr)}),_r+=tr.recordSize*2,new Uint8Array(_r)}function dr(mr,_r,yr){yr=parseInt(yr)||0;var xr=yr;tr.posixHeader.forEach(function(br){for(var Ar=br[3](_r,br),kr=Ar.length,Dr=0;Dr<kr;Dr+=1)mr[xr+Dr]=Ar.charCodeAt(Dr)&255;xr+=br[1]});var Mr=B.find(tr.posixHeader,function(br){return br[0]=="checksum"});if(Mr){var vr=tr.calculateChecksum(mr,yr,!0),Sr=tr.formatTarNumber(vr,Mr[1]-2)+I.NULL_CHAR+" ";xr=yr+Mr[2];for(var wr=0;wr<Sr.length;wr+=1)mr[xr]=Sr.charCodeAt(wr)&255,xr++}return yr+rr()}function hr(mr,_r,yr){return yr=parseInt(yr,10)||0,mr.set(_r.data,yr),yr+ir(_r)}function fr(mr){mr=B.map(mr,function(xr){return B.extend({},xr,{data:B.toUint8Array(xr.data)})});var _r=lr(mr),yr=0;return mr.forEach(function(xr){yr=dr(_r,xr,yr),yr=hr(_r,xr,yr)}),_r}t.exports.tar=fr}),nr=D$2((e,t)=>{u$1();var I=x(),B=w(),tr=L(),rr={extractData:!0,checkHeader:!0,checkChecksum:!0,checkFileSize:!0},ir={size:!0,checksum:!0,ustar:!0},lr={unexpectedEndOfFile:"Unexpected end of file.",fileCorrupted:"File is corrupted.",checksumCheckFailed:"Checksum check failed."};function dr(Mr){return tr.recordSize}function hr(Mr){return Math.ceil(Mr/tr.recordSize)*tr.recordSize}function fr(Mr,vr){for(var Sr=vr,wr=Math.min(Mr.length,vr+tr.recordSize*2),br=Sr;br<wr;br++)if(Mr[br]!=0)return!1;return!0}function mr(Mr,vr,Sr){if(Mr.length-vr<tr.recordSize){if(Sr.checkFileSize)throw new Error(lr.unexpectedEndOfFile);return null}vr=parseInt(vr)||0;var wr={},br=vr;if(tr.posixHeader.forEach(function(Dr){wr[Dr[0]]=Dr[4](Mr,br,Dr),br+=Dr[1]}),wr.type!=0&&(wr.size=0),Sr.checkHeader&&tr.posixHeader.forEach(function(Dr){if(B.isFunction(Dr[5])&&!Dr[5](wr,Dr)){var Or=new Error(lr.fileCorrupted);throw Or.data={offset:vr+Dr[2],field:Dr[0]},Or}}),Sr.checkChecksum){var Ar=tr.calculateChecksum(Mr,vr,!0);if(Ar!=wr.checksum){var kr=new Error(lr.checksumCheckFailed);throw kr.data={offset:vr,header:wr,checksum:Ar},kr}}return wr}function _r(Mr,vr,Sr,wr){return wr.extractData?Sr.size<=0?new Uint8Array:Mr.slice(vr,vr+Sr.size):null}function yr(Mr,vr){var Sr={};return tr.posixHeader.forEach(function(wr){var br=wr[0];ir[br]||(Sr[br]=Mr[br])}),Sr.isOldGNUFormat=Mr.ustar==I.OLDGNU_MAGIC,vr&&(Sr.data=vr),Sr}function xr(Mr,vr){vr=B.extend({},rr,vr);for(var Sr=[],wr=0,br=Mr.length;br-wr>=tr.recordSize;){Mr=B.toUint8Array(Mr);var Ar=mr(Mr,wr,vr);if(!Ar)break;wr+=dr();var kr=_r(Mr,wr,Ar,vr);if(Sr.push(yr(Ar,kr)),wr+=hr(Ar.size),fr(Mr,wr))break}return Sr}t.exports.untar=xr}),or=D$2((e,t)=>{u$1();var I=w(),B=x(),tr=er(),rr=nr();I.extend(t.exports,tr,rr,B)});u$1();u$1();var g=L$2(or());async function H$1(e,t,I="pgdata",B="auto"){let tr=Br(e,t),[rr,ir]=await qr(tr,B),lr=I+(ir?".tar.gz":".tar"),dr=ir?"application/x-gzip":"application/x-tar";return typeof File<"u"?new File([rr],lr,{type:dr}):new Blob([rr],{type:dr})}var Hr=["application/x-gtar","application/x-tar+gzip","application/x-gzip","application/gzip"];async function ce$1(e,t,I){let B=new Uint8Array(await t.arrayBuffer()),tr=typeof File<"u"&&t instanceof File?t.name:void 0;(Hr.includes(t.type)||tr!=null&&tr.endsWith(".tgz")||tr!=null&&tr.endsWith(".tar.gz"))&&(B=await ar(B));let rr;try{rr=(0,g.untar)(B)}catch(ir){if(ir instanceof Error&&ir.message.includes("File is corrupted"))B=await ar(B),rr=(0,g.untar)(B);else throw ir}for(let ir of rr){let lr=I+ir.name,dr=lr.split("/").slice(0,-1);for(let hr=1;hr<=dr.length;hr++){let fr=dr.slice(0,hr).join("/");e.analyzePath(fr).exists||e.mkdir(fr)}ir.type===g.REGTYPE?(e.writeFile(lr,ir.data),e.utime(lr,sr(ir.modifyTime),sr(ir.modifyTime))):ir.type===g.DIRTYPE&&e.mkdir(lr)}}function jr(e,t){let I=[],B=tr=>{e.readdir(tr).forEach(rr=>{if(rr==="."||rr==="..")return;let ir=tr+"/"+rr,lr=e.stat(ir),dr=e.isFile(lr.mode)?e.readFile(ir,{encoding:"binary"}):new Uint8Array(0);I.push({name:ir.substring(t.length),mode:lr.mode,size:lr.size,type:e.isFile(lr.mode)?g.REGTYPE:g.DIRTYPE,modifyTime:lr.mtime,data:dr}),e.isDir(lr.mode)&&B(ir)})};return B(t),I}function Br(e,t){let I=jr(e,t);return(0,g.tar)(I)}async function qr(e,t="auto"){if(t==="none")return[e,!1];if(typeof CompressionStream<"u")return[await Yr(e),!0];if(typeof process<"u"&&process.versions&&process.versions.node)return[await Wr(e),!0];if(t==="auto")return[e,!1];throw new Error("Compression not supported in this environment")}async function Yr(e){let t=new CompressionStream("gzip"),I=t.writable.getWriter(),B=t.readable.getReader();I.write(e),I.close();let tr=[];for(;;){let{value:lr,done:dr}=await B.read();if(dr)break;lr&&tr.push(lr)}let rr=new Uint8Array(tr.reduce((lr,dr)=>lr+dr.length,0)),ir=0;return tr.forEach(lr=>{rr.set(lr,ir),ir+=lr.length}),rr}async function Wr(e){let{promisify:t}=await __vitePreload(()=>import("./index.CW6hXWch.js").then(B=>B.bE),[],import.meta.url),{gzip:I}=await __vitePreload(async()=>{const{gzip:B}=await import("./index.CW6hXWch.js").then(tr=>tr.bE);return{gzip:B}},[],import.meta.url);return await t(I)(e)}async function ar(e){if(typeof CompressionStream<"u")return await Xr(e);if(typeof process<"u"&&process.versions&&process.versions.node)return await Kr(e);throw new Error("Unsupported environment for decompression")}async function Xr(e){let t=new DecompressionStream("gzip"),I=t.writable.getWriter(),B=t.readable.getReader();I.write(e),I.close();let tr=[];for(;;){let{value:lr,done:dr}=await B.read();if(dr)break;lr&&tr.push(lr)}let rr=new Uint8Array(tr.reduce((lr,dr)=>lr+dr.length,0)),ir=0;return tr.forEach(lr=>{rr.set(lr,ir),ir+=lr.length}),rr}async function Kr(e){let{promisify:t}=await __vitePreload(()=>import("./index.CW6hXWch.js").then(B=>B.bE),[],import.meta.url),{gunzip:I}=await __vitePreload(async()=>{const{gunzip:B}=await import("./index.CW6hXWch.js").then(tr=>tr.bE);return{gunzip:B}},[],import.meta.url);return await t(I)(e)}function sr(e){return e?typeof e=="number"?e:Math.floor(e.getTime()/1e3):Math.floor(Date.now()/1e3)}var Vr="/tmp/pglite",C=Vr+"/base",ur=class{constructor(e){this.dataDir=e}async init(e,t){return this.pg=e,{emscriptenOpts:t}}async syncToFs(e){}async initialSyncFs(){}async closeFs(){}async dumpTar(e,t){return H$1(this.pg.Module.FS,C,e,t)}},cr=class{constructor(e,{debug:t=!1}={}){this.dataDir=e,this.debug=t}async syncToFs(e){}async initialSyncFs(){}async closeFs(){}async dumpTar(e,t){return H$1(this.pg.Module.FS,C,e,t)}async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],I=>{let B=Zr(I,this);I.FS.mkdir(C),I.FS.mount(B,{},C)}]}}}},pr={EBADF:8,EBADFD:127,EEXIST:20,EINVAL:28,EISDIR:31,ENODEV:43,ENOENT:44,ENOTDIR:54,ENOTEMPTY:55},Zr=(e,t)=>{let I=e.FS,B=t.debug?console.log:null,tr={tryFSOperation(rr){try{return rr()}catch(ir){throw ir.code?ir.code==="UNKNOWN"?new I.ErrnoError(pr.EINVAL):new I.ErrnoError(ir.code):ir}},mount(rr){return tr.createNode(null,"/",16895,0)},syncfs(rr,ir,lr){},createNode(rr,ir,lr,dr){if(!I.isDir(lr)&&!I.isFile(lr))throw new I.ErrnoError(28);let hr=I.createNode(rr,ir,lr);return hr.node_ops=tr.node_ops,hr.stream_ops=tr.stream_ops,hr},getMode:function(rr){return B==null||B("getMode",rr),tr.tryFSOperation(()=>t.lstat(rr).mode)},realPath:function(rr){let ir=[];for(;rr.parent!==rr;)ir.push(rr.name),rr=rr.parent;return ir.push(rr.mount.opts.root),ir.reverse(),ir.join("/")},node_ops:{getattr(rr){B==null||B("getattr",tr.realPath(rr));let ir=tr.realPath(rr);return tr.tryFSOperation(()=>{let lr=t.lstat(ir);return{...lr,dev:0,ino:rr.id,nlink:1,rdev:rr.rdev,atime:new Date(lr.atime),mtime:new Date(lr.mtime),ctime:new Date(lr.ctime)}})},setattr(rr,ir){B==null||B("setattr",tr.realPath(rr),ir);let lr=tr.realPath(rr);tr.tryFSOperation(()=>{ir.mode!==void 0&&t.chmod(lr,ir.mode),ir.size!==void 0&&t.truncate(lr,ir.size),ir.timestamp!==void 0&&t.utimes(lr,ir.timestamp,ir.timestamp),ir.size!==void 0&&t.truncate(lr,ir.size)})},lookup(rr,ir){B==null||B("lookup",tr.realPath(rr),ir);let lr=[tr.realPath(rr),ir].join("/"),dr=tr.getMode(lr);return tr.createNode(rr,ir,dr)},mknod(rr,ir,lr,dr){B==null||B("mknod",tr.realPath(rr),ir,lr,dr);let hr=tr.createNode(rr,ir,lr,dr),fr=tr.realPath(hr);return tr.tryFSOperation(()=>(I.isDir(hr.mode)?t.mkdir(fr,{mode:lr}):t.writeFile(fr,"",{mode:lr}),hr))},rename(rr,ir,lr){B==null||B("rename",tr.realPath(rr),tr.realPath(ir),lr);let dr=tr.realPath(rr),hr=[tr.realPath(ir),lr].join("/");tr.tryFSOperation(()=>{t.rename(dr,hr)}),rr.name=lr},unlink(rr,ir){B==null||B("unlink",tr.realPath(rr),ir);let lr=[tr.realPath(rr),ir].join("/");try{t.unlink(lr)}catch{}},rmdir(rr,ir){B==null||B("rmdir",tr.realPath(rr),ir);let lr=[tr.realPath(rr),ir].join("/");return tr.tryFSOperation(()=>{t.rmdir(lr)})},readdir(rr){B==null||B("readdir",tr.realPath(rr));let ir=tr.realPath(rr);return tr.tryFSOperation(()=>t.readdir(ir))},symlink(rr,ir,lr){throw B==null||B("symlink",tr.realPath(rr),ir,lr),new I.ErrnoError(63)},readlink(rr){throw B==null||B("readlink",tr.realPath(rr)),new I.ErrnoError(63)}},stream_ops:{open(rr){B==null||B("open stream",tr.realPath(rr.node));let ir=tr.realPath(rr.node);return tr.tryFSOperation(()=>{I.isFile(rr.node.mode)&&(rr.shared.refcount=1,rr.nfd=t.open(ir))})},close(rr){return B==null||B("close stream",tr.realPath(rr.node)),tr.tryFSOperation(()=>{I.isFile(rr.node.mode)&&rr.nfd&&--rr.shared.refcount===0&&t.close(rr.nfd)})},dup(rr){B==null||B("dup stream",tr.realPath(rr.node)),rr.shared.refcount++},read(rr,ir,lr,dr,hr){return B==null||B("read stream",tr.realPath(rr.node),lr,dr,hr),dr===0?0:tr.tryFSOperation(()=>t.read(rr.nfd,ir,lr,dr,hr))},write(rr,ir,lr,dr,hr){return B==null||B("write stream",tr.realPath(rr.node),lr,dr,hr),tr.tryFSOperation(()=>t.write(rr.nfd,ir.buffer,lr,dr,hr))},llseek(rr,ir,lr){B==null||B("llseek stream",tr.realPath(rr.node),ir,lr);let dr=ir;if(lr===1?dr+=rr.position:lr===2&&I.isFile(rr.node.mode)&&tr.tryFSOperation(()=>{let hr=t.fstat(rr.nfd);dr+=hr.size}),dr<0)throw new I.ErrnoError(28);return dr},mmap(rr,ir,lr,dr,hr){if(B==null||B("mmap stream",tr.realPath(rr.node),ir,lr,dr,hr),!I.isFile(rr.node.mode))throw new I.ErrnoError(pr.ENODEV);let fr=e.mmapAlloc(ir);return tr.stream_ops.read(rr,e.HEAP8,fr,ir,lr),{ptr:fr,allocated:!0}},msync(rr,ir,lr,dr,hr){return B==null||B("msync stream",tr.realPath(rr.node),lr,dr,hr),tr.stream_ops.write(rr,ir,0,dr,lr),0}}};return tr};u$1();u$1();u$1();var He=new Error("request for lock canceled"),We=function(e,t,I,B){function tr(rr){return rr instanceof I?rr:new I(function(ir){ir(rr)})}return new(I||(I=Promise))(function(rr,ir){function lr(fr){try{hr(B.next(fr))}catch(mr){ir(mr)}}function dr(fr){try{hr(B.throw(fr))}catch(mr){ir(mr)}}function hr(fr){fr.done?rr(fr.value):tr(fr.value).then(lr,dr)}hr((B=B.apply(e,[])).next())})},ce=class{constructor(e,t=He){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,I)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:I}),this._dispatch()})}runExclusive(e,t=1){return We(this,void 0,void 0,function*(){let[I,B]=yield this.acquire(t);try{return yield e(I)}finally{B()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let I=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!I)continue;let B=this._value,tr=t;this._value-=t,t=this._value+1,I.resolve([B,this._newReleaser(tr)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)this._weightedWaiters[e-1]&&(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},je=function(e,t,I,B){function tr(rr){return rr instanceof I?rr:new I(function(ir){ir(rr)})}return new(I||(I=Promise))(function(rr,ir){function lr(fr){try{hr(B.next(fr))}catch(mr){ir(mr)}}function dr(fr){try{hr(B.throw(fr))}catch(mr){ir(mr)}}function hr(fr){fr.done?rr(fr.value):tr(fr.value).then(lr,dr)}hr((B=B.apply(e,[])).next())})},H=class{constructor(e){this._semaphore=new ce(1,e)}acquire(){return je(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};u$1();var Ie=L$2(or());async function ge(e){if(Fe$1){let t=await __vitePreload(()=>import("./index.CW6hXWch.js").then(lr=>lr.bE),[],import.meta.url),I=await __vitePreload(()=>import("./index.CW6hXWch.js").then(lr=>lr.bE),[],import.meta.url),{Writable:B}=await __vitePreload(async()=>{const{Writable:lr}=await import("./index.CW6hXWch.js").then(dr=>dr.bE);return{Writable:lr}},[],import.meta.url),{pipeline:tr}=await __vitePreload(async()=>{const{pipeline:lr}=await import("./index.CW6hXWch.js").then(dr=>dr.bE);return{pipeline:lr}},[],import.meta.url);if(!t.existsSync(e))throw new Error(`Extension bundle not found: ${e}`);let rr=I.createGunzip(),ir=[];return await tr(t.createReadStream(e),rr,new B({write(lr,dr,hr){ir.push(lr),hr()}})),new Blob(ir)}else{let t=await fetch(e.toString());if(!t.ok||!t.body)return null;if(t.headers.get("Content-Encoding")==="gzip")return t.blob();{let I=new DecompressionStream("gzip");return new Response(t.body.pipeThrough(I)).blob()}}}async function Pe(e,t){for(let I in e.pg_extensions){let B;try{B=await e.pg_extensions[I]}catch(tr){console.error("Failed to fetch extension:",I,tr);continue}if(B){let tr=new Uint8Array(await B.arrayBuffer());Ve(e,I,tr,t)}else console.error("Could not get binary data for extension:",I)}}function Ve(e,t,I,B){Ie.default.untar(I).forEach(tr=>{if(!tr.name.startsWith(".")){let rr=e.WASM_PREFIX+"/"+tr.name;if(tr.name.endsWith(".so")){let ir=(...dr)=>{B("pgfs:ext OK",rr,dr)},lr=(...dr)=>{B("pgfs:ext FAIL",rr,dr)};e.FS.createPreloadedFile(Ke(rr),tr.name.split("/").pop().slice(0,-3),tr.data,!0,!0,ir,lr,!1)}else e.FS.writeFile(rr,tr.data)}})}function Ke(e){let t=e.lastIndexOf("/");return t>0?e.slice(0,t):e}u$1();u$1();var ee=class extends ur{async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],I=>{let B=I.FS.filesystems.IDBFS;I.FS.mkdir("/pglite"),I.FS.mkdir(`/pglite/${this.dataDir}`),I.FS.mount(B,{},`/pglite/${this.dataDir}`),I.FS.symlink(`/pglite/${this.dataDir}`,C)}]}}}initialSyncFs(){return new Promise((e,t)=>{this.pg.Module.FS.syncfs(!0,I=>{I?t(I):e()})})}syncToFs(e){return new Promise((t,I)=>{this.pg.Module.FS.syncfs(!1,B=>{B?I(B):t()})})}async closeFs(){let e=this.pg.Module.FS.filesystems.IDBFS.dbs[this.dataDir];e&&e.close(),this.pg.Module.FS.quit()}};u$1();var te=class extends ur{async closeFs(){this.pg.Module.FS.quit()}};function Fe(e){let t;if(e!=null&&e.startsWith("file://")){if(e=e.slice(7),!e)throw new Error("Invalid dataDir, must be a valid path");t="nodefs"}else e!=null&&e.startsWith("idb://")?(e=e.slice(6),t="idbfs"):e!=null&&e.startsWith("opfs-ahp://")?(e=e.slice(11),t="opfs-ahp"):!e||e!=null&&e.startsWith("memory://")?t="memoryfs":t="nodefs";return{dataDir:e,fsType:t}}async function Ae(e,t){let I;if(e&&t==="nodefs"){let{NodeFS:B}=await __vitePreload(()=>import("./nodefs.rxvmn5tR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);I=new B(e)}else if(e&&t==="idbfs")I=new ee(e);else if(e&&t==="opfs-ahp"){let{OpfsAhpFS:B}=await __vitePreload(()=>import("./opfs-ahp.BE5Mymun.js"),__vite__mapDeps([8,1,2,3,4,5,6,7]),import.meta.url);I=new B(e)}else I=new te;return I}u$1();u$1();var Qe=(()=>{var _scriptName=import.meta.url;return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await __vitePreload(()=>import("./index.CW6hXWch.js").then(I=>I.bE),[],import.meta.url),t=import.meta.url;t.startsWith("data:")&&(t="/");var require=e(t)}Module.expectedDataFileDownloads??(Module.expectedDataFileDownloads=0),Module.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD<"u"&&ENVIRONMENT_IS_PTHREAD,t=typeof ENVIRONMENT_IS_WASM_WORKER<"u"&&ENVIRONMENT_IS_WASM_WORKER;if(e||t)return;var I=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";function B(tr){typeof window=="object"?window.encodeURIComponent(window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.substring(0,location.pathname.lastIndexOf("/"))+"/");var rr="postgres.data",ir="postgres.data",lr=Module.locateFile?Module.locateFile(ir,""):ir,dr=tr.remote_package_size;function hr(xr,Mr,vr,Sr){if(I){require("fs").readFile(xr,(wr,br)=>{wr?Sr(wr):vr(br.buffer)});return}Module.dataFileDownloads??(Module.dataFileDownloads={}),fetch(xr).catch(wr=>Promise.reject(new Error(`Network Error: ${xr}`,{cause:wr}))).then(wr=>{var Fr;if(!wr.ok)return Promise.reject(new Error(`${wr.status}: ${wr.url}`));if(!wr.body&&wr.arrayBuffer)return wr.arrayBuffer().then(vr);let br=wr.body.getReader(),Ar=()=>br.read().then($n).catch($r=>Promise.reject(new Error(`Unexpected error while handling : ${wr.url} ${$r}`,{cause:$r}))),kr=[],Dr=wr.headers,Or=Number(Dr.get("Content-Length")??Mr),zr=0,$n=({done:$r,value:Hn})=>{var ti;if($r){let Ir=new Uint8Array(kr.map(Kn=>Kn.length).reduce((Kn,pi)=>Kn+pi,0)),Lr=0;for(let Kn of kr)Ir.set(Kn,Lr),Lr+=Kn.length;vr(Ir.buffer)}else{kr.push(Hn),zr+=Hn.length,Module.dataFileDownloads[xr]={loaded:zr,total:Or};let Ir=0,Lr=0;for(let Kn of Object.values(Module.dataFileDownloads))Ir+=Kn.loaded,Lr+=Kn.total;return(ti=Module.setStatus)==null||ti.call(Module,`Downloading data... (${Ir}/${Lr})`),Ar()}};return(Fr=Module.setStatus)==null||Fr.call(Module,"Downloading data..."),Ar()})}function fr(xr){console.error("package error:",xr)}var mr=null,_r=Module.getPreloadedPackage?Module.getPreloadedPackage(lr,dr):null;_r||hr(lr,dr,xr=>{mr?(mr(xr),mr=null):_r=xr},fr);function yr(xr){function Mr(Ar,kr){if(!Ar)throw kr+new Error().stack}xr.FS_createPath("/","home",!0,!0),xr.FS_createPath("/home","web_user",!0,!0),xr.FS_createPath("/","tmp",!0,!0),xr.FS_createPath("/tmp","pglite",!0,!0),xr.FS_createPath("/tmp/pglite","bin",!0,!0),xr.FS_createPath("/tmp/pglite","lib",!0,!0),xr.FS_createPath("/tmp/pglite/lib","postgresql",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql","pgxs",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","config",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","src",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","makefiles",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","test",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","isolation",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","regress",!0,!0),xr.FS_createPath("/tmp/pglite","share",!0,!0),xr.FS_createPath("/tmp/pglite/share","postgresql",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","extension",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","timezone",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Africa",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","America",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Argentina",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Indiana",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Kentucky",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","North_Dakota",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Antarctica",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Arctic",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Asia",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Atlantic",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Australia",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Brazil",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Canada",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Chile",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Etc",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Europe",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Indian",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Mexico",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Pacific",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","US",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","timezonesets",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","tsearch_data",!0,!0);function vr(Ar,kr,Dr){this.start=Ar,this.end=kr,this.audio=Dr}vr.prototype={requests:{},open:function(Ar,kr){this.name=kr,this.requests[kr]=this,xr.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var Ar=this.byteArray.subarray(this.start,this.end);this.finish(Ar)},finish:function(Ar){var kr=this;xr.FS_createDataFile(this.name,null,Ar,!0,!0,!0),xr.removeRunDependency(`fp ${kr.name}`),this.requests[this.name]=null}};for(var Sr=tr.files,wr=0;wr<Sr.length;++wr)new vr(Sr[wr].start,Sr[wr].end,Sr[wr].audio||0).open("GET",Sr[wr].filename);function br(Ar){Mr(Ar,"Loading data file failed."),Mr(Ar.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var kr=new Uint8Array(Ar);vr.prototype.byteArray=kr;for(var Dr=tr.files,Or=0;Or<Dr.length;++Or)vr.prototype.requests[Dr[Or].filename].onload();xr.removeRunDependency("datafile_postgres.data")}xr.addRunDependency("datafile_postgres.data"),xr.preloadResults??(xr.preloadResults={}),xr.preloadResults[rr]={fromCache:!1},_r?(br(_r),_r=null):mr=br}Module.calledRun?yr(Module):(Module.preRun??(Module.preRun=[])).push(yr)}B({files:[{filename:"/home/web_user/.pgpass",start:0,end:204},{filename:"/tmp/pglite/bin/initdb",start:204,end:216},{filename:"/tmp/pglite/bin/postgres",start:216,end:228},{filename:"/tmp/pglite/lib/postgresql/cyrillic_and_mic.so",start:228,end:20397},{filename:"/tmp/pglite/lib/postgresql/dict_snowball.so",start:20397,end:1581299},{filename:"/tmp/pglite/lib/postgresql/euc2004_sjis2004.so",start:1581299,end:1592382},{filename:"/tmp/pglite/lib/postgresql/euc_cn_and_mic.so",start:1592382,end:1599256},{filename:"/tmp/pglite/lib/postgresql/euc_jp_and_sjis.so",start:1599256,end:1622931},{filename:"/tmp/pglite/lib/postgresql/euc_kr_and_mic.so",start:1622931,end:1630057},{filename:"/tmp/pglite/lib/postgresql/euc_tw_and_big5.so",start:1630057,end:1651566},{filename:"/tmp/pglite/lib/postgresql/latin2_and_win1250.so",start:1651566,end:1660345},{filename:"/tmp/pglite/lib/postgresql/latin_and_mic.so",start:1660345,end:1668272},{filename:"/tmp/pglite/lib/postgresql/libpqwalreceiver.so",start:1668272,end:2186522},{filename:"/tmp/pglite/lib/postgresql/pgoutput.so",start:2186522,end:2303364},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/install-sh",start:2303364,end:2317361},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/missing",start:2317361,end:2318709},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.global",start:2318709,end:2354956},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.port",start:2354956,end:2355232},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.shlib",start:2355232,end:2371270},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/makefiles/pgxs.mk",start:2371270,end:2386198},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/nls-global.mk",start:2386198,end:2393083},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/isolationtester.cjs",start:2393083,end:2589770},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/pg_isolation_regress.cjs",start:2589770,end:2742128},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/regress/pg_regress.cjs",start:2742128,end:2894476},{filename:"/tmp/pglite/lib/postgresql/plpgsql.so",start:2894476,end:3653241},{filename:"/tmp/pglite/password",start:3653241,end:3653250},{filename:"/tmp/pglite/share/postgresql/errcodes.txt",start:3653250,end:3686708},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql--1.0.sql",start:3686708,end:3687366},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql.control",start:3687366,end:3687559},{filename:"/tmp/pglite/share/postgresql/fix-CVE-2024-4317.sql",start:3687559,end:3693324},{filename:"/tmp/pglite/share/postgresql/information_schema.sql",start:3693324,end:3808299},{filename:"/tmp/pglite/share/postgresql/pg_hba.conf.sample",start:3808299,end:3813924},{filename:"/tmp/pglite/share/postgresql/pg_ident.conf.sample",start:3813924,end:3816564},{filename:"/tmp/pglite/share/postgresql/pg_service.conf.sample",start:3816564,end:3817168},{filename:"/tmp/pglite/share/postgresql/postgres.bki",start:3817168,end:4761272},{filename:"/tmp/pglite/share/postgresql/postgresql.conf.sample",start:4761272,end:4790919},{filename:"/tmp/pglite/share/postgresql/psqlrc.sample",start:4790919,end:4791197},{filename:"/tmp/pglite/share/postgresql/snowball_create.sql",start:4791197,end:4835373},{filename:"/tmp/pglite/share/postgresql/sql_features.txt",start:4835373,end:4871054},{filename:"/tmp/pglite/share/postgresql/system_constraints.sql",start:4871054,end:4879949},{filename:"/tmp/pglite/share/postgresql/system_functions.sql",start:4879949,end:4903264},{filename:"/tmp/pglite/share/postgresql/system_views.sql",start:4903264,end:4953537},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Abidjan",start:4953537,end:4953667},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Accra",start:4953667,end:4953797},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Addis_Ababa",start:4953797,end:4953988},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Algiers",start:4953988,end:4954458},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmara",start:4954458,end:4954649},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmera",start:4954649,end:4954840},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bamako",start:4954840,end:4954970},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bangui",start:4954970,end:4955150},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Banjul",start:4955150,end:4955280},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bissau",start:4955280,end:4955429},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Blantyre",start:4955429,end:4955560},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Brazzaville",start:4955560,end:4955740},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bujumbura",start:4955740,end:4955871},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Cairo",start:4955871,end:4957180},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Casablanca",start:4957180,end:4959099},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ceuta",start:4959099,end:4959661},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Conakry",start:4959661,end:4959791},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dakar",start:4959791,end:4959921},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dar_es_Salaam",start:4959921,end:4960112},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Djibouti",start:4960112,end:4960303},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Douala",start:4960303,end:4960483},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/El_Aaiun",start:4960483,end:4962313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Freetown",start:4962313,end:4962443},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Gaborone",start:4962443,end:4962574},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Harare",start:4962574,end:4962705},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Johannesburg",start:4962705,end:4962895},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Juba",start:4962895,end:4963353},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kampala",start:4963353,end:4963544},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Khartoum",start:4963544,end:4964002},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kigali",start:4964002,end:4964133},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kinshasa",start:4964133,end:4964313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lagos",start:4964313,end:4964493},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Libreville",start:4964493,end:4964673},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lome",start:4964673,end:4964803},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Luanda",start:4964803,end:4964983},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lubumbashi",start:4964983,end:4965114},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lusaka",start:4965114,end:4965245},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Malabo",start:4965245,end:4965425},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maputo",start:4965425,end:4965556},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maseru",start:4965556,end:4965746},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mbabane",start:4965746,end:4965936},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mogadishu",start:4965936,end:4966127},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Monrovia",start:4966127,end:4966291},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nairobi",start:4966291,end:4966482},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ndjamena",start:4966482,end:4966642},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Niamey",start:4966642,end:4966822},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nouakchott",start:4966822,end:4966952},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ouagadougou",start:4966952,end:4967082},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Porto-Novo",start:4967082,end:4967262},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Sao_Tome",start:4967262,end:4967435},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Timbuktu",start:4967435,end:4967565},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tripoli",start:4967565,end:4967996},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tunis",start:4967996,end:4968445},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Windhoek",start:4968445,end:4969083},{filename:"/tmp/pglite/share/postgresql/timezone/America/Adak",start:4969083,end:4970052},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anchorage",start:4970052,end:4971029},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anguilla",start:4971029,end:4971206},{filename:"/tmp/pglite/share/postgresql/timezone/America/Antigua",start:4971206,end:4971383},{filename:"/tmp/pglite/share/postgresql/timezone/America/Araguaina",start:4971383,end:4971975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Buenos_Aires",start:4971975,end:4972683},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Catamarca",start:4972683,end:4973391},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/ComodRivadavia",start:4973391,end:4974099},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Cordoba",start:4974099,end:4974807},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Jujuy",start:4974807,end:4975497},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/La_Rioja",start:4975497,end:4976214},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Mendoza",start:4976214,end:4976922},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Rio_Gallegos",start:4976922,end:4977630},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Salta",start:4977630,end:4978320},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Juan",start:4978320,end:4979037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Luis",start:4979037,end:4979754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Tucuman",start:4979754,end:4980480},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Ushuaia",start:4980480,end:4981188},{filename:"/tmp/pglite/share/postgresql/timezone/America/Aruba",start:4981188,end:4981365},{filename:"/tmp/pglite/share/postgresql/timezone/America/Asuncion",start:4981365,end:4982249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atikokan",start:4982249,end:4982398},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atka",start:4982398,end:4983367},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia",start:4983367,end:4984049},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia_Banderas",start:4984049,end:4984777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Barbados",start:4984777,end:4985055},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belem",start:4985055,end:4985449},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belize",start:4985449,end:4986494},{filename:"/tmp/pglite/share/postgresql/timezone/America/Blanc-Sablon",start:4986494,end:4986671},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boa_Vista",start:4986671,end:4987101},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bogota",start:4987101,end:4987280},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boise",start:4987280,end:4988279},{filename:"/tmp/pglite/share/postgresql/timezone/America/Buenos_Aires",start:4988279,end:4988987},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cambridge_Bay",start:4988987,end:4989870},{filename:"/tmp/pglite/share/postgresql/timezone/America/Campo_Grande",start:4989870,end:4990822},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cancun",start:4990822,end:4991351},{filename:"/tmp/pglite/share/postgresql/timezone/America/Caracas",start:4991351,end:4991541},{filename:"/tmp/pglite/share/postgresql/timezone/America/Catamarca",start:4991541,end:4992249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayenne",start:4992249,end:4992400},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayman",start:4992400,end:4992549},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chicago",start:4992549,end:4994303},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chihuahua",start:4994303,end:4994994},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ciudad_Juarez",start:4994994,end:4995712},{filename:"/tmp/pglite/share/postgresql/timezone/America/Coral_Harbour",start:4995712,end:4995861},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cordoba",start:4995861,end:4996569},{filename:"/tmp/pglite/share/postgresql/timezone/America/Costa_Rica",start:4996569,end:4996801},{filename:"/tmp/pglite/share/postgresql/timezone/America/Creston",start:4996801,end:4997041},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cuiaba",start:4997041,end:4997975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Curacao",start:4997975,end:4998152},{filename:"/tmp/pglite/share/postgresql/timezone/America/Danmarkshavn",start:4998152,end:4998599},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson",start:4998599,end:4999628},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson_Creek",start:4999628,end:5000311},{filename:"/tmp/pglite/share/postgresql/timezone/America/Denver",start:5000311,end:5001353},{filename:"/tmp/pglite/share/postgresql/timezone/America/Detroit",start:5001353,end:5002252},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dominica",start:5002252,end:5002429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Edmonton",start:5002429,end:5003399},{filename:"/tmp/pglite/share/postgresql/timezone/America/Eirunepe",start:5003399,end:5003835},{filename:"/tmp/pglite/share/postgresql/timezone/America/El_Salvador",start:5003835,end:5004011},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ensenada",start:5004011,end:5005036},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Nelson",start:5005036,end:5006484},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Wayne",start:5006484,end:5007015},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fortaleza",start:5007015,end:5007499},{filename:"/tmp/pglite/share/postgresql/timezone/America/Glace_Bay",start:5007499,end:5008379},{filename:"/tmp/pglite/share/postgresql/timezone/America/Godthab",start:5008379,end:5009344},{filename:"/tmp/pglite/share/postgresql/timezone/America/Goose_Bay",start:5009344,end:5010924},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grand_Turk",start:5010924,end:5011777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grenada",start:5011777,end:5011954},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guadeloupe",start:5011954,end:5012131},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guatemala",start:5012131,end:5012343},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guayaquil",start:5012343,end:5012522},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guyana",start:5012522,end:5012703},{filename:"/tmp/pglite/share/postgresql/timezone/America/Halifax",start:5012703,end:5014375},{filename:"/tmp/pglite/share/postgresql/timezone/America/Havana",start:5014375,end:5015492},{filename:"/tmp/pglite/share/postgresql/timezone/America/Hermosillo",start:5015492,end:5015778},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Indianapolis",start:5015778,end:5016309},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Knox",start:5016309,end:5017325},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Marengo",start:5017325,end:5017892},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Petersburg",start:5017892,end:5018575},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Tell_City",start:5018575,end:5019097},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vevay",start:5019097,end:5019466},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vincennes",start:5019466,end:5020024},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Winamac",start:5020024,end:5020636},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indianapolis",start:5020636,end:5021167},{filename:"/tmp/pglite/share/postgresql/timezone/America/Inuvik",start:5021167,end:5021984},{filename:"/tmp/pglite/share/postgresql/timezone/America/Iqaluit",start:5021984,end:5022839},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jamaica",start:5022839,end:5023178},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jujuy",start:5023178,end:5023868},{filename:"/tmp/pglite/share/postgresql/timezone/America/Juneau",start:5023868,end:5024834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Louisville",start:5024834,end:5026076},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Monticello",start:5026076,end:5027048},{filename:"/tmp/pglite/share/postgresql/timezone/America/Knox_IN",start:5027048,end:5028064},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kralendijk",start:5028064,end:5028241},{filename:"/tmp/pglite/share/postgresql/timezone/America/La_Paz",start:5028241,end:5028411},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lima",start:5028411,end:5028694},{filename:"/tmp/pglite/share/postgresql/timezone/America/Los_Angeles",start:5028694,end:5029988},{filename:"/tmp/pglite/share/postgresql/timezone/America/Louisville",start:5029988,end:5031230},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lower_Princes",start:5031230,end:5031407},{filename:"/tmp/pglite/share/postgresql/timezone/America/Maceio",start:5031407,end:5031909},{filename:"/tmp/pglite/share/postgresql/timezone/America/Managua",start:5031909,end:5032204},{filename:"/tmp/pglite/share/postgresql/timezone/America/Manaus",start:5032204,end:5032616},{filename:"/tmp/pglite/share/postgresql/timezone/America/Marigot",start:5032616,end:5032793},{filename:"/tmp/pglite/share/postgresql/timezone/America/Martinique",start:5032793,end:5032971},{filename:"/tmp/pglite/share/postgresql/timezone/America/Matamoros",start:5032971,end:5033408},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mazatlan",start:5033408,end:5034126},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mendoza",start:5034126,end:5034834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Menominee",start:5034834,end:5035751},{filename:"/tmp/pglite/share/postgresql/timezone/America/Merida",start:5035751,end:5036405},{filename:"/tmp/pglite/share/postgresql/timezone/America/Metlakatla",start:5036405,end:5037e3},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mexico_City",start:5037e3,end:5037773},{filename:"/tmp/pglite/share/postgresql/timezone/America/Miquelon",start:5037773,end:5038323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Moncton",start:5038323,end:5039816},{filename:"/tmp/pglite/share/postgresql/timezone/America/Monterrey",start:5039816,end:5040460},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montevideo",start:5040460,end:5041429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montreal",start:5041429,end:5043146},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montserrat",start:5043146,end:5043323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nassau",start:5043323,end:5045040},{filename:"/tmp/pglite/share/postgresql/timezone/America/New_York",start:5045040,end:5046784},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nipigon",start:5046784,end:5048501},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nome",start:5048501,end:5049476},{filename:"/tmp/pglite/share/postgresql/timezone/America/Noronha",start:5049476,end:5049960},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Beulah",start:5049960,end:5051003},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Center",start:5051003,end:5051993},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/New_Salem",start:5051993,end:5052983},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nuuk",start:5052983,end:5053948},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ojinaga",start:5053948,end:5054657},{filename:"/tmp/pglite/share/postgresql/timezone/America/Panama",start:5054657,end:5054806},{filename:"/tmp/pglite/share/postgresql/timezone/America/Pangnirtung",start:5054806,end:5055661},{filename:"/tmp/pglite/share/postgresql/timezone/America/Paramaribo",start:5055661,end:5055848},{filename:"/tmp/pglite/share/postgresql/timezone/America/Phoenix",start:5055848,end:5056088},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port-au-Prince",start:5056088,end:5056653},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port_of_Spain",start:5056653,end:5056830},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Acre",start:5056830,end:5057248},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Velho",start:5057248,end:5057642},{filename:"/tmp/pglite/share/postgresql/timezone/America/Puerto_Rico",start:5057642,end:5057819},{filename:"/tmp/pglite/share/postgresql/timezone/America/Punta_Arenas",start:5057819,end:5059037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rainy_River",start:5059037,end:5060331},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rankin_Inlet",start:5060331,end:5061138},{filename:"/tmp/pglite/share/postgresql/timezone/America/Recife",start:5061138,end:5061622},{filename:"/tmp/pglite/share/postgresql/timezone/America/Regina",start:5061622,end:5062260},{filename:"/tmp/pglite/share/postgresql/timezone/America/Resolute",start:5062260,end:5063067},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rio_Branco",start:5063067,end:5063485},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rosario",start:5063485,end:5064193},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santa_Isabel",start:5064193,end:5065218},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santarem",start:5065218,end:5065627},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santiago",start:5065627,end:5066981},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santo_Domingo",start:5066981,end:5067298},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sao_Paulo",start:5067298,end:5068250},{filename:"/tmp/pglite/share/postgresql/timezone/America/Scoresbysund",start:5068250,end:5069234},{filename:"/tmp/pglite/share/postgresql/timezone/America/Shiprock",start:5069234,end:5070276},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sitka",start:5070276,end:5071232},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Barthelemy",start:5071232,end:5071409},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Johns",start:5071409,end:5073287},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Kitts",start:5073287,end:5073464},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Lucia",start:5073464,end:5073641},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Thomas",start:5073641,end:5073818},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Vincent",start:5073818,end:5073995},{filename:"/tmp/pglite/share/postgresql/timezone/America/Swift_Current",start:5073995,end:5074363},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tegucigalpa",start:5074363,end:5074557},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thule",start:5074557,end:5075012},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thunder_Bay",start:5075012,end:5076729},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tijuana",start:5076729,end:5077754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Toronto",start:5077754,end:5079471},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tortola",start:5079471,end:5079648},{filename:"/tmp/pglite/share/postgresql/timezone/America/Vancouver",start:5079648,end:5080978},{filename:"/tmp/pglite/share/postgresql/timezone/America/Virgin",start:5080978,end:5081155},{filename:"/tmp/pglite/share/postgresql/timezone/America/Whitehorse",start:5081155,end:5082184},{filename:"/tmp/pglite/share/postgresql/timezone/America/Winnipeg",start:5082184,end:5083478},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yakutat",start:5083478,end:5084424},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yellowknife",start:5084424,end:5085394},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Casey",start:5085394,end:5085681},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Davis",start:5085681,end:5085878},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/DumontDUrville",start:5085878,end:5086032},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Macquarie",start:5086032,end:5087008},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Mawson",start:5087008,end:5087160},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/McMurdo",start:5087160,end:5088203},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Palmer",start:5088203,end:5089090},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Rothera",start:5089090,end:5089222},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/South_Pole",start:5089222,end:5090265},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Syowa",start:5090265,end:5090398},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Troll",start:5090398,end:5090575},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Vostok",start:5090575,end:5090745},{filename:"/tmp/pglite/share/postgresql/timezone/Arctic/Longyearbyen",start:5090745,end:5091450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aden",start:5091450,end:5091583},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Almaty",start:5091583,end:5092201},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Amman",start:5092201,end:5093129},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Anadyr",start:5093129,end:5093872},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtau",start:5093872,end:5094478},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtobe",start:5094478,end:5095093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashgabat",start:5095093,end:5095468},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashkhabad",start:5095468,end:5095843},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Atyrau",start:5095843,end:5096459},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baghdad",start:5096459,end:5097089},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bahrain",start:5097089,end:5097241},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baku",start:5097241,end:5097985},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bangkok",start:5097985,end:5098137},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Barnaul",start:5098137,end:5098890},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Beirut",start:5098890,end:5099622},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bishkek",start:5099622,end:5100240},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Brunei",start:5100240,end:5100560},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Calcutta",start:5100560,end:5100780},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chita",start:5100780,end:5101530},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Choibalsan",start:5101530,end:5102149},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chongqing",start:5102149,end:5102542},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chungking",start:5102542,end:5102935},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Colombo",start:5102935,end:5103182},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dacca",start:5103182,end:5103413},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Damascus",start:5103413,end:5104647},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dhaka",start:5104647,end:5104878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dili",start:5104878,end:5105048},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dubai",start:5105048,end:5105181},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dushanbe",start:5105181,end:5105547},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Famagusta",start:5105547,end:5106487},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Gaza",start:5106487,end:5108933},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Harbin",start:5108933,end:5109326},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hebron",start:5109326,end:5111790},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ho_Chi_Minh",start:5111790,end:5112026},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hong_Kong",start:5112026,end:5112801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hovd",start:5112801,end:5113395},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Irkutsk",start:5113395,end:5114155},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Istanbul",start:5114155,end:5115355},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jakarta",start:5115355,end:5115603},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jayapura",start:5115603,end:5115774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jerusalem",start:5115774,end:5116848},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kabul",start:5116848,end:5117007},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kamchatka",start:5117007,end:5117734},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Karachi",start:5117734,end:5118e3},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kashgar",start:5118e3,end:5118133},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kathmandu",start:5118133,end:5118294},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Katmandu",start:5118294,end:5118455},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Khandyga",start:5118455,end:5119230},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kolkata",start:5119230,end:5119450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Krasnoyarsk",start:5119450,end:5120191},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuala_Lumpur",start:5120191,end:5120447},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuching",start:5120447,end:5120767},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuwait",start:5120767,end:5120900},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macao",start:5120900,end:5121691},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macau",start:5121691,end:5122482},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Magadan",start:5122482,end:5123233},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Makassar",start:5123233,end:5123423},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Manila",start:5123423,end:5123661},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Muscat",start:5123661,end:5123794},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Nicosia",start:5123794,end:5124391},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novokuznetsk",start:5124391,end:5125117},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novosibirsk",start:5125117,end:5125870},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Omsk",start:5125870,end:5126611},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Oral",start:5126611,end:5127236},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Phnom_Penh",start:5127236,end:5127388},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pontianak",start:5127388,end:5127635},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pyongyang",start:5127635,end:5127818},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qatar",start:5127818,end:5127970},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qostanay",start:5127970,end:5128594},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qyzylorda",start:5128594,end:5129218},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Rangoon",start:5129218,end:5129405},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Riyadh",start:5129405,end:5129538},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Saigon",start:5129538,end:5129774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Sakhalin",start:5129774,end:5130529},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Samarkand",start:5130529,end:5130895},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Seoul",start:5130895,end:5131310},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Shanghai",start:5131310,end:5131703},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Singapore",start:5131703,end:5131959},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Srednekolymsk",start:5131959,end:5132701},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Taipei",start:5132701,end:5133212},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tashkent",start:5133212,end:5133578},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tbilisi",start:5133578,end:5134207},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tehran",start:5134207,end:5135019},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tel_Aviv",start:5135019,end:5136093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimbu",start:5136093,end:5136247},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimphu",start:5136247,end:5136401},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tokyo",start:5136401,end:5136614},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tomsk",start:5136614,end:5137367},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ujung_Pandang",start:5137367,end:5137557},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulaanbaatar",start:5137557,end:5138151},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulan_Bator",start:5138151,end:5138745},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Urumqi",start:5138745,end:5138878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ust-Nera",start:5138878,end:5139649},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vientiane",start:5139649,end:5139801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vladivostok",start:5139801,end:5140543},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yakutsk",start:5140543,end:5141284},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yangon",start:5141284,end:5141471},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yekaterinburg",start:5141471,end:5142231},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yerevan",start:5142231,end:5142939},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Azores",start:5142939,end:5144392},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Bermuda",start:5144392,end:5145416},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Canary",start:5145416,end:5145894},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Cape_Verde",start:5145894,end:5146069},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faeroe",start:5146069,end:5146510},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faroe",start:5146510,end:5146951},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Jan_Mayen",start:5146951,end:5147656},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Madeira",start:5147656,end:5149109},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Reykjavik",start:5149109,end:5149239},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/South_Georgia",start:5149239,end:5149371},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/St_Helena",start:5149371,end:5149501},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Stanley",start:5149501,end:5150290},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/ACT",start:5150290,end:5151194},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Adelaide",start:5151194,end:5152115},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Brisbane",start:5152115,end:5152404},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Broken_Hill",start:5152404,end:5153345},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Canberra",start:5153345,end:5154249},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Currie",start:5154249,end:5155252},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Darwin",start:5155252,end:5155486},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Eucla",start:5155486,end:5155800},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Hobart",start:5155800,end:5156803},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/LHI",start:5156803,end:5157495},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lindeman",start:5157495,end:5157820},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lord_Howe",start:5157820,end:5158512},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Melbourne",start:5158512,end:5159416},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/NSW",start:5159416,end:5160320},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/North",start:5160320,end:5160554},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Perth",start:5160554,end:5160860},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Queensland",start:5160860,end:5161149},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/South",start:5161149,end:5162070},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Sydney",start:5162070,end:5162974},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Tasmania",start:5162974,end:5163977},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Victoria",start:5163977,end:5164881},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/West",start:5164881,end:5165187},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Yancowinna",start:5165187,end:5166128},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/Acre",start:5166128,end:5166546},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/DeNoronha",start:5166546,end:5167030},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/East",start:5167030,end:5167982},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/West",start:5167982,end:5168394},{filename:"/tmp/pglite/share/postgresql/timezone/CET",start:5168394,end:5169015},{filename:"/tmp/pglite/share/postgresql/timezone/CST6CDT",start:5169015,end:5169966},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Atlantic",start:5169966,end:5171638},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Central",start:5171638,end:5172932},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Eastern",start:5172932,end:5174649},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Mountain",start:5174649,end:5175619},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Newfoundland",start:5175619,end:5177497},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Pacific",start:5177497,end:5178827},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Saskatchewan",start:5178827,end:5179465},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Yukon",start:5179465,end:5180494},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/Continental",start:5180494,end:5181848},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/EasterIsland",start:5181848,end:5183022},{filename:"/tmp/pglite/share/postgresql/timezone/Cuba",start:5183022,end:5184139},{filename:"/tmp/pglite/share/postgresql/timezone/EET",start:5184139,end:5184636},{filename:"/tmp/pglite/share/postgresql/timezone/EST",start:5184636,end:5184747},{filename:"/tmp/pglite/share/postgresql/timezone/EST5EDT",start:5184747,end:5185698},{filename:"/tmp/pglite/share/postgresql/timezone/Egypt",start:5185698,end:5187007},{filename:"/tmp/pglite/share/postgresql/timezone/Eire",start:5187007,end:5188503},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT",start:5188503,end:5188614},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+0",start:5188614,end:5188725},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+1",start:5188725,end:5188838},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+10",start:5188838,end:5188952},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+11",start:5188952,end:5189066},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+12",start:5189066,end:5189180},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+2",start:5189180,end:5189293},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+3",start:5189293,end:5189406},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+4",start:5189406,end:5189519},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+5",start:5189519,end:5189632},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+6",start:5189632,end:5189745},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+7",start:5189745,end:5189858},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+8",start:5189858,end:5189971},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+9",start:5189971,end:5190084},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-0",start:5190084,end:5190195},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-1",start:5190195,end:5190309},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-10",start:5190309,end:5190424},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-11",start:5190424,end:5190539},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-12",start:5190539,end:5190654},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-13",start:5190654,end:5190769},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-14",start:5190769,end:5190884},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-2",start:5190884,end:5190998},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-3",start:5190998,end:5191112},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-4",start:5191112,end:5191226},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-5",start:5191226,end:5191340},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-6",start:5191340,end:5191454},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-7",start:5191454,end:5191568},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-8",start:5191568,end:5191682},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-9",start:5191682,end:5191796},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT0",start:5191796,end:5191907},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Greenwich",start:5191907,end:5192018},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UCT",start:5192018,end:5192129},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UTC",start:5192129,end:5192240},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Universal",start:5192240,end:5192351},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Zulu",start:5192351,end:5192462},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Amsterdam",start:5192462,end:5193565},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Andorra",start:5193565,end:5193954},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Astrakhan",start:5193954,end:5194680},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Athens",start:5194680,end:5195362},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belfast",start:5195362,end:5196961},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belgrade",start:5196961,end:5197439},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Berlin",start:5197439,end:5198144},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bratislava",start:5198144,end:5198867},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Brussels",start:5198867,end:5199970},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bucharest",start:5199970,end:5200631},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Budapest",start:5200631,end:5201397},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Busingen",start:5201397,end:5201894},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Chisinau",start:5201894,end:5202649},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Copenhagen",start:5202649,end:5203354},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Dublin",start:5203354,end:5204850},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Gibraltar",start:5204850,end:5206070},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Guernsey",start:5206070,end:5207669},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Helsinki",start:5207669,end:5208150},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Isle_of_Man",start:5208150,end:5209749},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Istanbul",start:5209749,end:5210949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Jersey",start:5210949,end:5212548},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kaliningrad",start:5212548,end:5213452},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kiev",start:5213452,end:5214010},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kirov",start:5214010,end:5214745},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kyiv",start:5214745,end:5215303},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Lisbon",start:5215303,end:5216757},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ljubljana",start:5216757,end:5217235},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/London",start:5217235,end:5218834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Luxembourg",start:5218834,end:5219937},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Madrid",start:5219937,end:5220834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Malta",start:5220834,end:5221762},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Mariehamn",start:5221762,end:5222243},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Minsk",start:5222243,end:5223051},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Monaco",start:5223051,end:5224156},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Moscow",start:5224156,end:5225064},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Nicosia",start:5225064,end:5225661},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Oslo",start:5225661,end:5226366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Paris",start:5226366,end:5227471},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Podgorica",start:5227471,end:5227949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Prague",start:5227949,end:5228672},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Riga",start:5228672,end:5229366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Rome",start:5229366,end:5230313},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Samara",start:5230313,end:5231045},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/San_Marino",start:5231045,end:5231992},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sarajevo",start:5231992,end:5232470},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Saratov",start:5232470,end:5233196},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Simferopol",start:5233196,end:5234061},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Skopje",start:5234061,end:5234539},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sofia",start:5234539,end:5235131},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Stockholm",start:5235131,end:5235836},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tallinn",start:5235836,end:5236511},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tirane",start:5236511,end:5237115},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tiraspol",start:5237115,end:5237870},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ulyanovsk",start:5237870,end:5238630},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Uzhgorod",start:5238630,end:5239188},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vaduz",start:5239188,end:5239685},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vatican",start:5239685,end:5240632},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vienna",start:5240632,end:5241290},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vilnius",start:5241290,end:5241966},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Volgograd",start:5241966,end:5242719},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Warsaw",start:5242719,end:5243642},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zagreb",start:5243642,end:5244120},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zaporozhye",start:5244120,end:5244678},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zurich",start:5244678,end:5245175},{filename:"/tmp/pglite/share/postgresql/timezone/Factory",start:5245175,end:5245288},{filename:"/tmp/pglite/share/postgresql/timezone/GB",start:5245288,end:5246887},{filename:"/tmp/pglite/share/postgresql/timezone/GB-Eire",start:5246887,end:5248486},{filename:"/tmp/pglite/share/postgresql/timezone/GMT",start:5248486,end:5248597},{filename:"/tmp/pglite/share/postgresql/timezone/GMT+0",start:5248597,end:5248708},{filename:"/tmp/pglite/share/postgresql/timezone/GMT-0",start:5248708,end:5248819},{filename:"/tmp/pglite/share/postgresql/timezone/GMT0",start:5248819,end:5248930},{filename:"/tmp/pglite/share/postgresql/timezone/Greenwich",start:5248930,end:5249041},{filename:"/tmp/pglite/share/postgresql/timezone/HST",start:5249041,end:5249153},{filename:"/tmp/pglite/share/postgresql/timezone/Hongkong",start:5249153,end:5249928},{filename:"/tmp/pglite/share/postgresql/timezone/Iceland",start:5249928,end:5250058},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Antananarivo",start:5250058,end:5250249},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Chagos",start:5250249,end:5250401},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Christmas",start:5250401,end:5250553},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Cocos",start:5250553,end:5250740},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Comoro",start:5250740,end:5250931},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Kerguelen",start:5250931,end:5251083},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mahe",start:5251083,end:5251216},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Maldives",start:5251216,end:5251368},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mauritius",start:5251368,end:5251547},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mayotte",start:5251547,end:5251738},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Reunion",start:5251738,end:5251871},{filename:"/tmp/pglite/share/postgresql/timezone/Iran",start:5251871,end:5252683},{filename:"/tmp/pglite/share/postgresql/timezone/Israel",start:5252683,end:5253757},{filename:"/tmp/pglite/share/postgresql/timezone/Jamaica",start:5253757,end:5254096},{filename:"/tmp/pglite/share/postgresql/timezone/Japan",start:5254096,end:5254309},{filename:"/tmp/pglite/share/postgresql/timezone/Kwajalein",start:5254309,end:5254528},{filename:"/tmp/pglite/share/postgresql/timezone/Libya",start:5254528,end:5254959},{filename:"/tmp/pglite/share/postgresql/timezone/MET",start:5254959,end:5255580},{filename:"/tmp/pglite/share/postgresql/timezone/MST",start:5255580,end:5255691},{filename:"/tmp/pglite/share/postgresql/timezone/MST7MDT",start:5255691,end:5256642},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaNorte",start:5256642,end:5257667},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaSur",start:5257667,end:5258385},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/General",start:5258385,end:5259158},{filename:"/tmp/pglite/share/postgresql/timezone/NZ",start:5259158,end:5260201},{filename:"/tmp/pglite/share/postgresql/timezone/NZ-CHAT",start:5260201,end:5261009},{filename:"/tmp/pglite/share/postgresql/timezone/Navajo",start:5261009,end:5262051},{filename:"/tmp/pglite/share/postgresql/timezone/PRC",start:5262051,end:5262444},{filename:"/tmp/pglite/share/postgresql/timezone/PST8PDT",start:5262444,end:5263395},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Apia",start:5263395,end:5263802},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Auckland",start:5263802,end:5264845},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Bougainville",start:5264845,end:5265046},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chatham",start:5265046,end:5265854},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chuuk",start:5265854,end:5266008},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Easter",start:5266008,end:5267182},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Efate",start:5267182,end:5267524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Enderbury",start:5267524,end:5267696},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fakaofo",start:5267696,end:5267849},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fiji",start:5267849,end:5268245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Funafuti",start:5268245,end:5268379},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Galapagos",start:5268379,end:5268554},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Gambier",start:5268554,end:5268686},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guadalcanal",start:5268686,end:5268820},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guam",start:5268820,end:5269170},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Honolulu",start:5269170,end:5269391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Johnston",start:5269391,end:5269612},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kanton",start:5269612,end:5269784},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kiritimati",start:5269784,end:5269958},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kosrae",start:5269958,end:5270200},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kwajalein",start:5270200,end:5270419},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Majuro",start:5270419,end:5270553},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Marquesas",start:5270553,end:5270692},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Midway",start:5270692,end:5270838},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Nauru",start:5270838,end:5271021},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Niue",start:5271021,end:5271175},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Norfolk",start:5271175,end:5271422},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Noumea",start:5271422,end:5271620},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pago_Pago",start:5271620,end:5271766},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Palau",start:5271766,end:5271914},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pitcairn",start:5271914,end:5272067},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pohnpei",start:5272067,end:5272201},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Ponape",start:5272201,end:5272335},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Port_Moresby",start:5272335,end:5272489},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Rarotonga",start:5272489,end:5272895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Saipan",start:5272895,end:5273245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Samoa",start:5273245,end:5273391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tahiti",start:5273391,end:5273524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tarawa",start:5273524,end:5273658},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tongatapu",start:5273658,end:5273895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Truk",start:5273895,end:5274049},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wake",start:5274049,end:5274183},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wallis",start:5274183,end:5274317},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Yap",start:5274317,end:5274471},{filename:"/tmp/pglite/share/postgresql/timezone/Poland",start:5274471,end:5275394},{filename:"/tmp/pglite/share/postgresql/timezone/Portugal",start:5275394,end:5276848},{filename:"/tmp/pglite/share/postgresql/timezone/ROC",start:5276848,end:5277359},{filename:"/tmp/pglite/share/postgresql/timezone/ROK",start:5277359,end:5277774},{filename:"/tmp/pglite/share/postgresql/timezone/Singapore",start:5277774,end:5278030},{filename:"/tmp/pglite/share/postgresql/timezone/Turkey",start:5278030,end:5279230},{filename:"/tmp/pglite/share/postgresql/timezone/UCT",start:5279230,end:5279341},{filename:"/tmp/pglite/share/postgresql/timezone/US/Alaska",start:5279341,end:5280318},{filename:"/tmp/pglite/share/postgresql/timezone/US/Aleutian",start:5280318,end:5281287},{filename:"/tmp/pglite/share/postgresql/timezone/US/Arizona",start:5281287,end:5281527},{filename:"/tmp/pglite/share/postgresql/timezone/US/Central",start:5281527,end:5283281},{filename:"/tmp/pglite/share/postgresql/timezone/US/East-Indiana",start:5283281,end:5283812},{filename:"/tmp/pglite/share/postgresql/timezone/US/Eastern",start:5283812,end:5285556},{filename:"/tmp/pglite/share/postgresql/timezone/US/Hawaii",start:5285556,end:5285777},{filename:"/tmp/pglite/share/postgresql/timezone/US/Indiana-Starke",start:5285777,end:5286793},{filename:"/tmp/pglite/share/postgresql/timezone/US/Michigan",start:5286793,end:5287692},{filename:"/tmp/pglite/share/postgresql/timezone/US/Mountain",start:5287692,end:5288734},{filename:"/tmp/pglite/share/postgresql/timezone/US/Pacific",start:5288734,end:5290028},{filename:"/tmp/pglite/share/postgresql/timezone/US/Samoa",start:5290028,end:5290174},{filename:"/tmp/pglite/share/postgresql/timezone/UTC",start:5290174,end:5290285},{filename:"/tmp/pglite/share/postgresql/timezone/Universal",start:5290285,end:5290396},{filename:"/tmp/pglite/share/postgresql/timezone/W-SU",start:5290396,end:5291304},{filename:"/tmp/pglite/share/postgresql/timezone/WET",start:5291304,end:5291798},{filename:"/tmp/pglite/share/postgresql/timezone/Zulu",start:5291798,end:5291909},{filename:"/tmp/pglite/share/postgresql/timezonesets/Africa.txt",start:5291909,end:5298882},{filename:"/tmp/pglite/share/postgresql/timezonesets/America.txt",start:5298882,end:5309889},{filename:"/tmp/pglite/share/postgresql/timezonesets/Antarctica.txt",start:5309889,end:5311023},{filename:"/tmp/pglite/share/postgresql/timezonesets/Asia.txt",start:5311023,end:5319334},{filename:"/tmp/pglite/share/postgresql/timezonesets/Atlantic.txt",start:5319334,end:5322867},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia",start:5322867,end:5324002},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia.txt",start:5324002,end:5327386},{filename:"/tmp/pglite/share/postgresql/timezonesets/Default",start:5327386,end:5354636},{filename:"/tmp/pglite/share/postgresql/timezonesets/Etc.txt",start:5354636,end:5355886},{filename:"/tmp/pglite/share/postgresql/timezonesets/Europe.txt",start:5355886,end:5364668},{filename:"/tmp/pglite/share/postgresql/timezonesets/India",start:5364668,end:5365261},{filename:"/tmp/pglite/share/postgresql/timezonesets/Indian.txt",start:5365261,end:5366522},{filename:"/tmp/pglite/share/postgresql/timezonesets/Pacific.txt",start:5366522,end:5370290},{filename:"/tmp/pglite/share/postgresql/tsearch_data/danish.stop",start:5370290,end:5370714},{filename:"/tmp/pglite/share/postgresql/tsearch_data/dutch.stop",start:5370714,end:5371167},{filename:"/tmp/pglite/share/postgresql/tsearch_data/english.stop",start:5371167,end:5371789},{filename:"/tmp/pglite/share/postgresql/tsearch_data/finnish.stop",start:5371789,end:5373368},{filename:"/tmp/pglite/share/postgresql/tsearch_data/french.stop",start:5373368,end:5374173},{filename:"/tmp/pglite/share/postgresql/tsearch_data/german.stop",start:5374173,end:5375522},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hungarian.stop",start:5375522,end:5376749},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample.affix",start:5376749,end:5376992},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.affix",start:5376992,end:5377625},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.dict",start:5377625,end:5377723},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.affix",start:5377723,end:5378185},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.dict",start:5378185,end:5378314},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.affix",start:5378314,end:5378779},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.dict",start:5378779,end:5378860},{filename:"/tmp/pglite/share/postgresql/tsearch_data/italian.stop",start:5378860,end:5380514},{filename:"/tmp/pglite/share/postgresql/tsearch_data/nepali.stop",start:5380514,end:5384775},{filename:"/tmp/pglite/share/postgresql/tsearch_data/norwegian.stop",start:5384775,end:5385626},{filename:"/tmp/pglite/share/postgresql/tsearch_data/portuguese.stop",start:5385626,end:5386893},{filename:"/tmp/pglite/share/postgresql/tsearch_data/russian.stop",start:5386893,end:5388128},{filename:"/tmp/pglite/share/postgresql/tsearch_data/spanish.stop",start:5388128,end:5390306},{filename:"/tmp/pglite/share/postgresql/tsearch_data/swedish.stop",start:5390306,end:5390865},{filename:"/tmp/pglite/share/postgresql/tsearch_data/synonym_sample.syn",start:5390865,end:5390938},{filename:"/tmp/pglite/share/postgresql/tsearch_data/thesaurus_sample.ths",start:5390938,end:5391411},{filename:"/tmp/pglite/share/postgresql/tsearch_data/turkish.stop",start:5391411,end:5391671},{filename:"/tmp/pglite/share/postgresql/tsearch_data/unaccent.rules",start:5391671,end:5401610},{filename:"/tmp/pglite/share/postgresql/tsearch_data/xsyn_sample.rules",start:5401610,end:5401749}],remote_package_size:5401749})})();var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");import.meta.url.startsWith("data:")||(scriptDirectory=nodePath.dirname(require("url").fileURLToPath(import.meta.url))+"/"),readBinary=e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},readAsync=async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var I=fs.readFileSync(e,t?void 0:"utf8");return I},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),readAsync=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,t){e||abort(t)}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=new BigUint64Array(e)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||134217728;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var I;if(runDependencies--,(I=Module.monitorRunDependencies)==null||I.call(Module,runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var I;(I=Module.onAbort)==null||I.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){if(Module.locateFile){var e="postgres.wasm";return isDataURI(e)?e:locateFile(e)}return new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url).href}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}async function instantiateArrayBuffer(e,t){try{var I=await getWasmBinary(e),B=await WebAssembly.instantiate(I,t);return B}catch(tr){err(`failed to asynchronously prepare wasm: ${tr}`),abort(tr)}}async function instantiateAsync(e,t,I){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(t)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var B=fetch(t,{credentials:"same-origin"}),tr=await WebAssembly.instantiateStreaming(B,I);return tr}catch(rr){err(`wasm streaming compile failed: ${rr}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,I)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function e(tr,rr){wasmExports=tr.exports,wasmExports=relocateExports(wasmExports,16777216);var ir=getDylinkMetadata(rr);return ir.neededDynlibs&&(dynamicLibraries=ir.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(),wasmExports}addRunDependency();function t(tr){e(tr.instance,tr.module)}var I=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(I,e)}catch(tr){err(`Module.instantiateWasm callback failed with error: ${tr}`),readyPromiseReject(tr)}wasmBinaryFile??(wasmBinaryFile=findWasmBinary());try{var B=await instantiateAsync(wasmBinary,wasmBinaryFile,I);return t(B),B}catch(tr){readyPromiseReject(tr);return}}var ASM_CONSTS={18792944:e=>{Module.is_worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Module.FD_BUFFER_MAX=e,Module.emscripten_copy_to=console.warn},18793117:()=>{Module.postMessage=function(e){console.log("# 1252: onCustomMessage:",__FILE__,e)}},18793242:()=>{if(Module.is_worker){let e=function(t){console.log("onCustomMessage:",t)};Module.onCustomMessage=e}else Module.postMessage=function(e){switch(e.type){case"raw":{stringToUTF8(e.data,shm_rawinput,Module.FD_BUFFER_MAX);break}case"stdin":{stringToUTF8(e.data,1,Module.FD_BUFFER_MAX);break}case"rcon":{stringToUTF8(e.data,shm_rcon,Module.FD_BUFFER_MAX);break}default:console.warn("custom_postMessage?",e)}}}};function is_web_env(){try{if(window)return 1}catch{return 0}}is_web_env.sig="i";class ExitStatus{constructor(t){P$1(this,"name","ExitStatus"),this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var I=GOT[t];return I||(I=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(I.required=!0),I}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(e,t=0,I=NaN)=>{for(var B=t+I,tr=t;e[tr]&&!(tr>=B);)++tr;if(tr-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,tr));for(var rr="";t<tr;){var ir=e[t++];if(!(ir&128)){rr+=String.fromCharCode(ir);continue}var lr=e[t++]&63;if((ir&224)==192){rr+=String.fromCharCode((ir&31)<<6|lr);continue}var dr=e[t++]&63;if((ir&240)==224?ir=(ir&15)<<12|lr<<6|dr:ir=(ir&7)<<18|lr<<12|dr<<6|e[t++]&63,ir<65536)rr+=String.fromCharCode(ir);else{var hr=ir-65536;rr+=String.fromCharCode(55296|hr>>10,56320|hr&1023)}}return rr},getDylinkMetadata=e=>{var t=0,I=0;function B(){return e[t++]}function tr(){for(var Hn=0,ti=1;;){var Ir=e[t++];if(Hn+=(Ir&127)*ti,ti*=128,!(Ir&128))break}return Hn}function rr(){var Hn=tr();return t+=Hn,UTF8ArrayToString(e,t-Hn,Hn)}function ir(Hn,ti){if(Hn)throw new Error(ti)}var lr="dylink.0";if(e instanceof WebAssembly.Module){var dr=WebAssembly.Module.customSections(e,lr);dr.length===0&&(lr="dylink",dr=WebAssembly.Module.customSections(e,lr)),ir(dr.length===0,"need dylink section"),e=new Uint8Array(dr[0]),I=e.length}else{var hr=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),fr=hr[0]==1836278016;ir(!fr,"need to see wasm magic number"),ir(e[8]!==0,"need the dylink section to be first"),t=9;var mr=tr();I=t+mr,lr=rr()}var _r={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(lr=="dylink"){_r.memorySize=tr(),_r.memoryAlign=tr(),_r.tableSize=tr(),_r.tableAlign=tr();for(var yr=tr(),xr=0;xr<yr;++xr){var Mr=rr();_r.neededDynlibs.push(Mr)}}else{ir(lr!=="dylink.0");for(var vr=1,Sr=2,wr=3,br=4,Ar=256,kr=3,Dr=1;t<I;){var Or=B(),zr=tr();if(Or===vr)_r.memorySize=tr(),_r.memoryAlign=tr(),_r.tableSize=tr(),_r.tableAlign=tr();else if(Or===Sr)for(var yr=tr(),xr=0;xr<yr;++xr)Mr=rr(),_r.neededDynlibs.push(Mr);else if(Or===wr)for(var $n=tr();$n--;){var Fr=rr(),$r=tr();$r&Ar&&_r.tlsExports.add(Fr)}else if(Or===br)for(var $n=tr();$n--;){rr();var Fr=rr(),$r=tr();($r&kr)==Dr&&_r.weakImports.add(Fr)}else t+=zr}}return _r};function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP64[e>>3];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${t}`)}}var newDSO=(e,t,I)=>{var B={refcount:1/0,name:e,exports:I,global:!0};return LDSO.loadedLibsByName[e]=B,t!=null&&(LDSO.loadedLibsByHandle[t]=B),B},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=23144432,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,I=t+alignMemory(e,16);return ___heap_base=I,GOT.__heap_base.value=I,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},I={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},B=1;B<e.length;++B)I.parameters.push(t[e[B]]);return I},generateFuncType=(e,t)=>{var I=e.slice(0,1),B=e.slice(1),tr={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(B.length,t);for(var rr=0;rr<B.length;++rr)t.push(tr[B[rr]]);I=="v"?t.push(0):t.push(1,tr[I])},convertJsFunctionToWasm=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var I=[1];generateFuncType(t,I);var B=[0,97,115,109,1,0,0,0,1];uleb128Encode(I.length,B),B.push(...I),B.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var tr=new WebAssembly.Module(new Uint8Array(B)),rr=new WebAssembly.Instance(tr,{e:{f:e}}),ir=rr.exports.f;return ir},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:5360,element:"anyfunc"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var I=e;I<e+t;I++){var B=getWasmTableEntry(I);B&&functionsInTableMap.set(B,I)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var I=getFunctionAddress(e);if(I)return I;var B=getEmptyTableSlot();try{setWasmTableEntry(B,e)}catch(rr){if(!(rr instanceof TypeError))throw rr;var tr=convertJsFunctionToWasm(e,t);setWasmTableEntry(B,tr)}return functionsInTableMap.set(e,B),B},updateGOT=(e,t)=>{for(var I in e)if(!isInternalSym(I)){var B=e[I];GOT[I]||(GOT[I]=new WebAssembly.Global({value:"i32",mutable:!0})),GOT[I].value==0&&(typeof B=="function"?GOT[I].value=addFunction(B):typeof B=="number"?GOT[I].value=B:err(`unhandled export type for '${I}': ${typeof B}`))}},relocateExports=(e,t,I)=>{var B={};for(var tr in e){var rr=e[tr];typeof rr=="object"&&(rr=rr.value),typeof rr=="number"&&(rr+=t),B[tr]=rr}return updateGOT(B),B},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCall=(e,t,I=[])=>{var B=getWasmTableEntry(t)(...I);return B},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),createInvokeFunction=e=>(t,...I)=>{var B=stackSave();try{return dynCall(e,t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;if(_setThrew(1,0),e[0]=="j")return 0n}},resolveGlobalSymbol=(e,t=!1)=>{var I;return isSymbolDefined(e)?I=wasmImports[e]:e.startsWith("invoke_")&&(I=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:I,name:e}},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];if(!(t in e)){var I;e[t]=(...B)=>(I||(I=resolveSymbol(t)),I(...B))}return e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replaceAll("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{for(var[I,B]of Object.entries(e)){let tr=ir=>{isSymbolDefined(ir)||(wasmImports[ir]=B)};tr(I);let rr="__main_argc_argv";I=="main"&&tr(rr),I==rr&&tr("main")}},asyncLoad=async e=>{var t=await readAsync(e);return new Uint8Array(t)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var e={promiseChainEnd:Promise.resolve(),canHandle:t=>!Module.noWasmDecoding&&t.endsWith(".so"),handle:(t,I,B,tr)=>{e.promiseChainEnd=e.promiseChainEnd.then(()=>loadWebAssemblyModule(t,{loadAsync:!0,nodelete:!0},I,{})).then(rr=>{preloadedWasm[I]=rr,B(t)},rr=>{err(`failed to instantiate wasm: ${I}: ${rr}`),tr()})}};preloadPlugins.push(e)},preloadedWasm={};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},I,B){var tr=LDSO.loadedLibsByName[e];if(tr)return t.global?tr.global||(tr.global=!0,mergeLibSymbols(tr.exports)):I&&Object.assign(I,tr.exports),t.nodelete&&tr.refcount!==1/0&&(tr.refcount=1/0),tr.refcount++,B&&(LDSO.loadedLibsByHandle[B]=tr),t.loadAsync?Promise.resolve(!0):!0;tr=newDSO(e,B,"loading"),tr.refcount=t.nodelete?1/0:1,tr.global=t.global;function rr(){if(B){var dr=HEAPU32[B+28>>2],hr=HEAPU32[B+32>>2];if(dr&&hr){var fr=HEAP8.slice(dr,dr+hr);return t.loadAsync?Promise.resolve(fr):fr}}var mr=locateFile(e);if(t.loadAsync)return asyncLoad(mr);if(!readBinary)throw new Error(`${mr}: file not found, and synchronous loading of external files is not available`);return readBinary(mr)}function ir(){var dr=preloadedWasm[e];return dr?t.loadAsync?Promise.resolve(dr):dr:t.loadAsync?rr().then(hr=>loadWebAssemblyModule(hr,t,e,I,B)):loadWebAssemblyModule(rr(),t,e,I,B)}function lr(dr){tr.global?mergeLibSymbols(dr):I&&Object.assign(I,dr),tr.exports=dr}return t.loadAsync?ir().then(dr=>(lr(dr),!0)):(lr(ir()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var I=resolveGlobalSymbol(e,!0).sym;if(!I&&!t.required)continue;if(typeof I=="function")t.value=addFunction(I,I.sig);else if(typeof I=="number")t.value=I;else throw new Error(`bad export type for '${e}': ${typeof I}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency(),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency()})},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,I="i8"){switch(I.endsWith("*")&&(I="*"),I){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":HEAP64[e>>3]=BigInt(t);break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort(`invalid type for setValue: ${I}`)}}var ___assert_fail=(e,t,I,B)=>abort(`Assertion failed: ${UTF8ToString(e)}, at: `+[t?UTF8ToString(t):"unknown filename",I,B?UTF8ToString(B):"unknown function"]);___assert_fail.sig="vppip";var ___call_sighandler=(e,t)=>getWasmTableEntry(e)(t);___call_sighandler.sig="vpi";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},16777216),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},23144432),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var I=0,B=e.length-1;B>=0;B--){var tr=e[B];tr==="."?e.splice(B,1):tr===".."?(e.splice(B,1),I++):I&&(e.splice(B,1),I--)}if(t)for(;I;I--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),I=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(B=>!!B),!t).join("/"),!e&&!t&&(e="."),e&&I&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),I=t[0],B=t[1];return!I&&!B?".":(B&&(B=B.substr(0,B.length-1)),I+B)},basename:e=>{if(e==="/")return"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return B=>crypto.getRandomValues(B);if(ENVIRONMENT_IS_NODE)try{var e=require("crypto"),t=e.randomFillSync;if(t)return B=>e.randomFillSync(B);var I=e.randomBytes;return B=>(B.set(I(B.byteLength)),B)}catch{}abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:(...e)=>{for(var t="",I=!1,B=e.length-1;B>=-1&&!I;B--){var tr=B>=0?e[B]:FS.cwd();if(typeof tr!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!tr)return"";t=tr+"/"+t,I=PATH.isAbs(tr)}return t=PATH.normalizeArray(t.split("/").filter(rr=>!!rr),!I).join("/"),(I?"/":"")+t||"."},relative:(e,t)=>{e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);function I(hr){for(var fr=0;fr<hr.length&&hr[fr]==="";fr++);for(var mr=hr.length-1;mr>=0&&hr[mr]==="";mr--);return fr>mr?[]:hr.slice(fr,mr-fr+1)}for(var B=I(e.split("/")),tr=I(t.split("/")),rr=Math.min(B.length,tr.length),ir=rr,lr=0;lr<rr;lr++)if(B[lr]!==tr[lr]){ir=lr;break}for(var dr=[],lr=ir;lr<B.length;lr++)dr.push("..");return dr=dr.concat(tr.slice(ir)),dr.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var t=0,I=0;I<e.length;++I){var B=e.charCodeAt(I);B<=127?t++:B<=2047?t+=2:B>=55296&&B<=57343?(t+=4,++I):t+=3}return t},stringToUTF8Array=(e,t,I,B)=>{if(!(B>0))return 0;for(var tr=I,rr=I+B-1,ir=0;ir<e.length;++ir){var lr=e.charCodeAt(ir);if(lr>=55296&&lr<=57343){var dr=e.charCodeAt(++ir);lr=65536+((lr&1023)<<10)|dr&1023}if(lr<=127){if(I>=rr)break;t[I++]=lr}else if(lr<=2047){if(I+1>=rr)break;t[I++]=192|lr>>6,t[I++]=128|lr&63}else if(lr<=65535){if(I+2>=rr)break;t[I++]=224|lr>>12,t[I++]=128|lr>>6&63,t[I++]=128|lr&63}else{if(I+3>=rr)break;t[I++]=240|lr>>18,t[I++]=128|lr>>12&63,t[I++]=128|lr>>6&63,t[I++]=128|lr&63}}return t[I]=0,I-tr};function intArrayFromString(e,t,I){var B=lengthBytesUTF8(e)+1,tr=new Array(B),rr=stringToUTF8Array(e,tr,0,tr.length);return tr.length=rr,tr}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var t=256,I=Buffer.alloc(t),B=0,tr=process.stdin.fd;try{B=fs.readSync(tr,I,0,t)}catch(rr){if(rr.toString().includes("EOF"))B=0;else throw rr}B>0&&(e=I.slice(0,B).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
137
|
-
`));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,I,B,tr){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var rr=0,ir=0;ir<B;ir++){var lr;try{lr=e.tty.ops.get_char(e.tty)}catch{throw new FS.ErrnoError(29)}if(lr===void 0&&rr===0)throw new FS.ErrnoError(6);if(lr==null)break;rr++,t[I+ir]=lr}return rr&&(e.node.atime=Date.now()),rr},write(e,t,I,B,tr){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var rr=0;rr<B;rr++)e.tty.ops.put_char(e.tty,t[I+rr])}catch{throw new FS.ErrnoError(29)}return B&&(e.node.mtime=e.node.ctime=Date.now()),rr}},default_tty_ops:{get_char(e){return FS_stdin_getChar()},put_char(e,t){t===null||t===10?(out(UTF8ArrayToString(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,I){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(err(UTF8ArrayToString(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output)),e.output=[])}}},zeroMemory=(e,t)=>{HEAPU8.fill(0,e,e+t)},mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t&&zeroMemory(t,e),t},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,t,I,B){if(FS.isBlkdev(I)||FS.isFIFO(I))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var tr=FS.createNode(e,t,I,B);return FS.isDir(tr.mode)?(tr.node_ops=MEMFS.ops_table.dir.node,tr.stream_ops=MEMFS.ops_table.dir.stream,tr.contents={}):FS.isFile(tr.mode)?(tr.node_ops=MEMFS.ops_table.file.node,tr.stream_ops=MEMFS.ops_table.file.stream,tr.usedBytes=0,tr.contents=null):FS.isLink(tr.mode)?(tr.node_ops=MEMFS.ops_table.link.node,tr.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(tr.mode)&&(tr.node_ops=MEMFS.ops_table.chrdev.node,tr.stream_ops=MEMFS.ops_table.chrdev.stream),tr.atime=tr.mtime=tr.ctime=Date.now(),e&&(e.contents[t]=tr,e.atime=e.mtime=e.ctime=tr.atime),tr},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){var I=e.contents?e.contents.length:0;if(!(I>=t)){var B=1048576;t=Math.max(t,I*(I<B?2:1.125)>>>0),I!=0&&(t=Math.max(t,256));var tr=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(tr.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var I=e.contents;e.contents=new Uint8Array(t),I&&e.contents.set(I.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){for(let I of["mode","atime","mtime","ctime"])t[I]&&(e[I]=t[I]);t.size!==void 0&&MEMFS.resizeFileStorage(e,t.size)},lookup(e,t){throw MEMFS.doesNotExistError},mknod(e,t,I,B){return MEMFS.createNode(e,t,I,B)},rename(e,t,I){var B;try{B=FS.lookupNode(t,I)}catch{}if(B){if(FS.isDir(e.mode))for(var tr in B.contents)throw new FS.ErrnoError(55);FS.hashRemoveNode(B)}delete e.parent.contents[e.name],t.contents[I]=e,e.name=I,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.contents[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var I=FS.lookupNode(e,t);for(var B in I.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,t,I){var B=MEMFS.createNode(e,t,41471,0);return B.link=I,B},readlink(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read(e,t,I,B,tr){var rr=e.node.contents;if(tr>=e.node.usedBytes)return 0;var ir=Math.min(e.node.usedBytes-tr,B);if(ir>8&&rr.subarray)t.set(rr.subarray(tr,tr+ir),I);else for(var lr=0;lr<ir;lr++)t[I+lr]=rr[tr+lr];return ir},write(e,t,I,B,tr,rr){if(t.buffer===HEAP8.buffer&&(rr=!1),!B)return 0;var ir=e.node;if(ir.mtime=ir.ctime=Date.now(),t.subarray&&(!ir.contents||ir.contents.subarray)){if(rr)return ir.contents=t.subarray(I,I+B),ir.usedBytes=B,B;if(ir.usedBytes===0&&tr===0)return ir.contents=t.slice(I,I+B),ir.usedBytes=B,B;if(tr+B<=ir.usedBytes)return ir.contents.set(t.subarray(I,I+B),tr),B}if(MEMFS.expandFileStorage(ir,tr+B),ir.contents.subarray&&t.subarray)ir.contents.set(t.subarray(I,I+B),tr);else for(var lr=0;lr<B;lr++)ir.contents[tr+lr]=t[I+lr];return ir.usedBytes=Math.max(ir.usedBytes,tr+B),B},llseek(e,t,I){var B=t;if(I===1?B+=e.position:I===2&&FS.isFile(e.node.mode)&&(B+=e.node.usedBytes),B<0)throw new FS.ErrnoError(28);return B},allocate(e,t,I){MEMFS.expandFileStorage(e.node,t+I),e.node.usedBytes=Math.max(e.node.usedBytes,t+I)},mmap(e,t,I,B,tr){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var rr,ir,lr=e.node.contents;if(!(tr&2)&&lr&&lr.buffer===HEAP8.buffer)ir=!1,rr=lr.byteOffset;else{if(ir=!0,rr=mmapAlloc(t),!rr)throw new FS.ErrnoError(48);lr&&((I>0||I+t<lr.length)&&(lr.subarray?lr=lr.subarray(I,I+t):lr=Array.prototype.slice.call(lr,I,I+t)),HEAP8.set(lr,rr))}return{ptr:rr,allocated:ir}},msync(e,t,I,B,tr){return MEMFS.stream_ops.write(e,t,0,B,I,!1),0}}},FS_createDataFile=(e,t,I,B,tr,rr)=>{FS.createDataFile(e,t,I,B,tr,rr)},FS_handledByPreloadPlugin=(e,t,I,B)=>{typeof Browser<"u"&&Browser.init();var tr=!1;return preloadPlugins.forEach(rr=>{tr||rr.canHandle(t)&&(rr.handle(e,t,I,B),tr=!0)}),tr},FS_createPreloadedFile=(e,t,I,B,tr,rr,ir,lr,dr,hr)=>{var fr=t?PATH_FS.resolve(PATH.join2(e,t)):e;function mr(_r){function yr(xr){hr==null||hr(),lr||FS_createDataFile(e,t,xr,B,tr,dr),rr==null||rr(),removeRunDependency()}FS_handledByPreloadPlugin(_r,fr,yr,()=>{ir==null||ir(),removeRunDependency()})||yr(_r)}addRunDependency(),typeof I=="string"?asyncLoad(I).then(mr,ir):mr(I)},FS_modeStringToFlags=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},I=t[e];if(typeof I>"u")throw new Error(`Unknown file open mode: ${e}`);return I},FS_getMode=(e,t)=>{var I=0;return e&&(I|=365),t&&(I|=146),I},IDBFS={dbs:{},indexedDB:()=>{if(typeof indexedDB<"u")return indexedDB;var e=null;return typeof window=="object"&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",queuePersist:e=>{function t(){e.idbPersistState==="again"?I():e.idbPersistState=0}function I(){e.idbPersistState="idb",IDBFS.syncfs(e,!1,t)}e.idbPersistState?e.idbPersistState==="idb"&&(e.idbPersistState="again"):e.idbPersistState=setTimeout(I,0)},mount:e=>{var B;var t=MEMFS.mount(e);if((B=e==null?void 0:e.opts)!=null&&B.autoPersist){t.idbPersistState=0;var I=t.node_ops;t.node_ops=Object.assign({},t.node_ops),t.node_ops.mknod=(tr,rr,ir,lr)=>{var dr=I.mknod(tr,rr,ir,lr);return dr.node_ops=t.node_ops,dr.idbfs_mount=t.mount,dr.memfs_stream_ops=dr.stream_ops,dr.stream_ops=Object.assign({},dr.stream_ops),dr.stream_ops.write=(hr,fr,mr,_r,yr,xr)=>(hr.node.isModified=!0,dr.memfs_stream_ops.write(hr,fr,mr,_r,yr,xr)),dr.stream_ops.close=hr=>{var fr=hr.node;if(fr.isModified&&(IDBFS.queuePersist(fr.idbfs_mount),fr.isModified=!1),fr.memfs_stream_ops.close)return fr.memfs_stream_ops.close(hr)},dr},t.node_ops.mkdir=(...tr)=>(IDBFS.queuePersist(t.mount),I.mkdir(...tr)),t.node_ops.rmdir=(...tr)=>(IDBFS.queuePersist(t.mount),I.rmdir(...tr)),t.node_ops.symlink=(...tr)=>(IDBFS.queuePersist(t.mount),I.symlink(...tr)),t.node_ops.unlink=(...tr)=>(IDBFS.queuePersist(t.mount),I.unlink(...tr)),t.node_ops.rename=(...tr)=>(IDBFS.queuePersist(t.mount),I.rename(...tr))}return t},syncfs:(e,t,I)=>{IDBFS.getLocalSet(e,(B,tr)=>{if(B)return I(B);IDBFS.getRemoteSet(e,(rr,ir)=>{if(rr)return I(rr);var lr=t?ir:tr,dr=t?tr:ir;IDBFS.reconcile(lr,dr,I)})})},quit:()=>{Object.values(IDBFS.dbs).forEach(e=>e.close()),IDBFS.dbs={}},getDB:(e,t)=>{var I=IDBFS.dbs[e];if(I)return t(null,I);var B;try{B=IDBFS.indexedDB().open(e,IDBFS.DB_VERSION)}catch(tr){return t(tr)}if(!B)return t("Unable to connect to IndexedDB");B.onupgradeneeded=tr=>{var rr=tr.target.result,ir=tr.target.transaction,lr;rr.objectStoreNames.contains(IDBFS.DB_STORE_NAME)?lr=ir.objectStore(IDBFS.DB_STORE_NAME):lr=rr.createObjectStore(IDBFS.DB_STORE_NAME),lr.indexNames.contains("timestamp")||lr.createIndex("timestamp","timestamp",{unique:!1})},B.onsuccess=()=>{I=B.result,IDBFS.dbs[e]=I,t(null,I)},B.onerror=tr=>{t(tr.target.error),tr.preventDefault()}},getLocalSet:(e,t)=>{var I={};function B(dr){return dr!=="."&&dr!==".."}function tr(dr){return hr=>PATH.join2(dr,hr)}for(var rr=FS.readdir(e.mountpoint).filter(B).map(tr(e.mountpoint));rr.length;){var ir=rr.pop(),lr;try{lr=FS.stat(ir)}catch(dr){return t(dr)}FS.isDir(lr.mode)&&rr.push(...FS.readdir(ir).filter(B).map(tr(ir))),I[ir]={timestamp:lr.mtime}}return t(null,{type:"local",entries:I})},getRemoteSet:(e,t)=>{var I={};IDBFS.getDB(e.mountpoint,(B,tr)=>{if(B)return t(B);try{var rr=tr.transaction([IDBFS.DB_STORE_NAME],"readonly");rr.onerror=dr=>{t(dr.target.error),dr.preventDefault()};var ir=rr.objectStore(IDBFS.DB_STORE_NAME),lr=ir.index("timestamp");lr.openKeyCursor().onsuccess=dr=>{var hr=dr.target.result;if(!hr)return t(null,{type:"remote",db:tr,entries:I});I[hr.primaryKey]={timestamp:hr.key},hr.continue()}}catch(dr){return t(dr)}})},loadLocalEntry:(e,t)=>{var I,B;try{var tr=FS.lookupPath(e);B=tr.node,I=FS.stat(e)}catch(rr){return t(rr)}return FS.isDir(I.mode)?t(null,{timestamp:I.mtime,mode:I.mode}):FS.isFile(I.mode)?(B.contents=MEMFS.getFileDataAsTypedArray(B),t(null,{timestamp:I.mtime,mode:I.mode,contents:B.contents})):t(new Error("node type not supported"))},storeLocalEntry:(e,t,I)=>{try{if(FS.isDir(t.mode))FS.mkdirTree(e,t.mode);else if(FS.isFile(t.mode))FS.writeFile(e,t.contents,{canOwn:!0});else return I(new Error("node type not supported"));FS.chmod(e,t.mode),FS.utime(e,t.timestamp,t.timestamp)}catch(B){return I(B)}I(null)},removeLocalEntry:(e,t)=>{try{var I=FS.stat(e);FS.isDir(I.mode)?FS.rmdir(e):FS.isFile(I.mode)&&FS.unlink(e)}catch(B){return t(B)}t(null)},loadRemoteEntry:(e,t,I)=>{var B=e.get(t);B.onsuccess=tr=>I(null,tr.target.result),B.onerror=tr=>{I(tr.target.error),tr.preventDefault()}},storeRemoteEntry:(e,t,I,B)=>{try{var tr=e.put(I,t)}catch(rr){B(rr);return}tr.onsuccess=rr=>B(),tr.onerror=rr=>{B(rr.target.error),rr.preventDefault()}},removeRemoteEntry:(e,t,I)=>{var B=e.delete(t);B.onsuccess=tr=>I(),B.onerror=tr=>{I(tr.target.error),tr.preventDefault()}},reconcile:(e,t,I)=>{var B=0,tr=[];Object.keys(e.entries).forEach(mr=>{var _r=e.entries[mr],yr=t.entries[mr];(!yr||_r.timestamp.getTime()!=yr.timestamp.getTime())&&(tr.push(mr),B++)});var rr=[];if(Object.keys(t.entries).forEach(mr=>{e.entries[mr]||(rr.push(mr),B++)}),!B)return I(null);var ir=!1,lr=e.type==="remote"?e.db:t.db,dr=lr.transaction([IDBFS.DB_STORE_NAME],"readwrite"),hr=dr.objectStore(IDBFS.DB_STORE_NAME);function fr(mr){if(mr&&!ir)return ir=!0,I(mr)}dr.onerror=dr.onabort=mr=>{fr(mr.target.error),mr.preventDefault()},dr.oncomplete=mr=>{ir||I(null)},tr.sort().forEach(mr=>{t.type==="local"?IDBFS.loadRemoteEntry(hr,mr,(_r,yr)=>{if(_r)return fr(_r);IDBFS.storeLocalEntry(mr,yr,fr)}):IDBFS.loadLocalEntry(mr,(_r,yr)=>{if(_r)return fr(_r);IDBFS.storeRemoteEntry(hr,mr,yr,fr)})}),rr.sort().reverse().forEach(mr=>{t.type==="local"?IDBFS.removeLocalEntry(mr,fr):IDBFS.removeRemoteEntry(hr,mr,fr)})}},ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},NODEFS={isWindows:!1,staticInit(){NODEFS.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),NODEFS.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,256:e.O_NOCTTY,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY,131072:e.O_NOFOLLOW}},convertNodeCode(e){var t=e.code;return ERRNO_CODES[t]},tryFSOperation(e){try{return e()}catch(t){throw t.code?t.code==="UNKNOWN"?new FS.ErrnoError(28):new FS.ErrnoError(NODEFS.convertNodeCode(t)):t}},mount(e){return NODEFS.createNode(null,"/",NODEFS.getMode(e.opts.root),0)},createNode(e,t,I,B){if(!FS.isDir(I)&&!FS.isFile(I)&&!FS.isLink(I))throw new FS.ErrnoError(28);var tr=FS.createNode(e,t,I);return tr.node_ops=NODEFS.node_ops,tr.stream_ops=NODEFS.stream_ops,tr},getMode(e){return NODEFS.tryFSOperation(()=>{var t=fs.lstatSync(e).mode;return NODEFS.isWindows&&(t|=(t&292)>>2),t})},realPath(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.mount.opts.root),t.reverse(),PATH.join(...t)},flagsForNode(e){e&=-2097153,e&=-2049,e&=-32769,e&=-524289,e&=-65537;var t=0;for(var I in NODEFS.flagsForNodeMap)e&I&&(t|=NODEFS.flagsForNodeMap[I],e^=I);if(e)throw new FS.ErrnoError(28);return t},node_ops:{getattr(e){var t=NODEFS.realPath(e),I;return NODEFS.tryFSOperation(()=>I=fs.lstatSync(t)),NODEFS.isWindows&&(I.blksize||(I.blksize=4096),I.blocks||(I.blocks=(I.size+I.blksize-1)/I.blksize|0),I.mode|=(I.mode&292)>>2),{dev:I.dev,ino:I.ino,mode:I.mode,nlink:I.nlink,uid:I.uid,gid:I.gid,rdev:I.rdev,size:I.size,atime:I.atime,mtime:I.mtime,ctime:I.ctime,blksize:I.blksize,blocks:I.blocks}},setattr(e,t){var I=NODEFS.realPath(e);NODEFS.tryFSOperation(()=>{if(t.mode!==void 0){var B=t.mode;NODEFS.isWindows&&(B&=384),fs.chmodSync(I,B),e.mode=t.mode}if(t.atime||t.mtime){var tr=t.atime&&new Date(t.atime),rr=t.mtime&&new Date(t.mtime);fs.utimesSync(I,tr,rr)}t.size!==void 0&&fs.truncateSync(I,t.size)})},lookup(e,t){var I=PATH.join2(NODEFS.realPath(e),t),B=NODEFS.getMode(I);return NODEFS.createNode(e,t,B)},mknod(e,t,I,B){var tr=NODEFS.createNode(e,t,I,B),rr=NODEFS.realPath(tr);return NODEFS.tryFSOperation(()=>{FS.isDir(tr.mode)?fs.mkdirSync(rr,tr.mode):fs.writeFileSync(rr,"",{mode:tr.mode})}),tr},rename(e,t,I){var B=NODEFS.realPath(e),tr=PATH.join2(NODEFS.realPath(t),I);try{FS.unlink(tr)}catch{}NODEFS.tryFSOperation(()=>fs.renameSync(B,tr)),e.name=I},unlink(e,t){var I=PATH.join2(NODEFS.realPath(e),t);NODEFS.tryFSOperation(()=>fs.unlinkSync(I))},rmdir(e,t){var I=PATH.join2(NODEFS.realPath(e),t);NODEFS.tryFSOperation(()=>fs.rmdirSync(I))},readdir(e){var t=NODEFS.realPath(e);return NODEFS.tryFSOperation(()=>fs.readdirSync(t))},symlink(e,t,I){var B=PATH.join2(NODEFS.realPath(e),t);NODEFS.tryFSOperation(()=>fs.symlinkSync(I,B))},readlink(e){var t=NODEFS.realPath(e);return NODEFS.tryFSOperation(()=>fs.readlinkSync(t))},statfs(e){var t=NODEFS.tryFSOperation(()=>fs.statfsSync(e));return t.frsize=t.bsize,t}},stream_ops:{open(e){var t=NODEFS.realPath(e.node);NODEFS.tryFSOperation(()=>{FS.isFile(e.node.mode)&&(e.shared.refcount=1,e.nfd=fs.openSync(t,NODEFS.flagsForNode(e.flags)))})},close(e){NODEFS.tryFSOperation(()=>{FS.isFile(e.node.mode)&&e.nfd&&--e.shared.refcount===0&&fs.closeSync(e.nfd)})},dup(e){e.shared.refcount++},read(e,t,I,B,tr){return B===0?0:NODEFS.tryFSOperation(()=>fs.readSync(e.nfd,new Int8Array(t.buffer,I,B),0,B,tr))},write(e,t,I,B,tr){return NODEFS.tryFSOperation(()=>fs.writeSync(e.nfd,new Int8Array(t.buffer,I,B),0,B,tr))},llseek(e,t,I){var B=t;if(I===1?B+=e.position:I===2&&FS.isFile(e.node.mode)&&NODEFS.tryFSOperation(()=>{var tr=fs.fstatSync(e.nfd);B+=tr.size}),B<0)throw new FS.ErrnoError(28);return B},mmap(e,t,I,B,tr){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var rr=mmapAlloc(t);return NODEFS.stream_ops.read(e,HEAP8,rr,t,I),{ptr:rr,allocated:!0}},msync(e,t,I,B,tr){return NODEFS.stream_ops.write(e,t,0,B,I,!1),0}}},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){P$1(this,"name","ErrnoError"),this.errno=e}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){P$1(this,"shared",{})}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,I,B){P$1(this,"node_ops",{}),P$1(this,"stream_ops",{}),P$1(this,"readMode",365),P$1(this,"writeMode",146),P$1(this,"mounted",null),e||(e=this),this.parent=e,this.mount=e.mount,this.id=FS.nextInode++,this.name=t,this.mode=I,this.rdev=B,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,t={}){if(!e)return{path:"",node:null};t.follow_mount??(t.follow_mount=!0),PATH.isAbs(e)||(e=FS.cwd()+"/"+e);e:for(var I=0;I<40;I++){for(var B=e.split("/").filter(hr=>!!hr&&hr!=="."),tr=FS.root,rr="/",ir=0;ir<B.length;ir++){var lr=ir===B.length-1;if(lr&&t.parent)break;if(B[ir]===".."){rr=PATH.dirname(rr),tr=tr.parent;continue}rr=PATH.join2(rr,B[ir]);try{tr=FS.lookupNode(tr,B[ir])}catch(hr){if((hr==null?void 0:hr.errno)===44&&lr&&t.noent_okay)return{path:rr};throw hr}if(FS.isMountpoint(tr)&&(!lr||t.follow_mount)&&(tr=tr.mounted.root),FS.isLink(tr.mode)&&(!lr||t.follow)){if(!tr.node_ops.readlink)throw new FS.ErrnoError(52);var dr=tr.node_ops.readlink(tr);PATH.isAbs(dr)||(dr=PATH.dirname(rr)+"/"+dr),e=dr+"/"+B.slice(ir+1).join("/");continue e}}return{path:rr,node:tr}}throw new FS.ErrnoError(32)},getPath(e){for(var t;;){if(FS.isRoot(e)){var I=e.mount.mountpoint;return t?I[I.length-1]!=="/"?`${I}/${t}`:I+t:I}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var I=0,B=0;B<t.length;B++)I=(I<<5)-I+t.charCodeAt(B)|0;return(e+I>>>0)%FS.nameTable.length},hashAddNode(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var I=FS.nameTable[t];I;){if(I.name_next===e){I.name_next=e.name_next;break}I=I.name_next}},lookupNode(e,t){var I=FS.mayLookup(e);if(I)throw new FS.ErrnoError(I);for(var B=FS.hashName(e.id,t),tr=FS.nameTable[B];tr;tr=tr.name_next){var rr=tr.name;if(tr.parent.id===e.id&&rr===t)return tr}return FS.lookup(e,t)},createNode(e,t,I,B){var tr=new FS.FSNode(e,t,I,B);return FS.hashAddNode(tr),tr},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return FS.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){if(!FS.isDir(e.mode))return 54;try{return FS.lookupNode(e,t),20}catch{}return FS.nodePermissions(e,"wx")},mayDelete(e,t,I){var B;try{B=FS.lookupNode(e,t)}catch(rr){return rr.errno}var tr=FS.nodePermissions(e,"wx");if(tr)return tr;if(I){if(!FS.isDir(B.mode))return 54;if(FS.isRoot(B)||FS.getPath(B)===FS.cwd())return 10}else if(FS.isDir(B.mode))return 31;return 0},mayOpen(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(t)!=="r"||t&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t},getStream:e=>FS.streams[e],createStream(e,t=-1){return e=Object.assign(new FS.FSStream,e),t==-1&&(t=FS.nextfd()),e.fd=t,FS.streams[t]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,t=-1){var B,tr;var I=FS.createStream(e,t);return(tr=(B=I.stream_ops)==null?void 0:B.dup)==null||tr.call(B,I),I},chrdev_stream_ops:{open(e){var I,B;var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(B=(I=e.stream_ops).open)==null||B.call(I,e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts(e){for(var t=[],I=[e];I.length;){var B=I.pop();t.push(B),I.push(...B.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var I=FS.getMounts(FS.root.mount),B=0;function tr(ir){return FS.syncFSRequests--,t(ir)}function rr(ir){if(ir)return rr.errored?void 0:(rr.errored=!0,tr(ir));++B>=I.length&&tr(null)}I.forEach(ir=>{if(!ir.type.syncfs)return rr(null);ir.type.syncfs(ir,e,rr)})},mount(e,t,I){var B=I==="/",tr=!I,rr;if(B&&FS.root)throw new FS.ErrnoError(10);if(!B&&!tr){var ir=FS.lookupPath(I,{follow_mount:!1});if(I=ir.path,rr=ir.node,FS.isMountpoint(rr))throw new FS.ErrnoError(10);if(!FS.isDir(rr.mode))throw new FS.ErrnoError(54)}var lr={type:e,opts:t,mountpoint:I,mounts:[]},dr=e.mount(lr);return dr.mount=lr,lr.root=dr,B?FS.root=dr:rr&&(rr.mounted=lr,rr.mount&&rr.mount.mounts.push(lr)),dr},unmount(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var I=t.node,B=I.mounted,tr=FS.getMounts(B);Object.keys(FS.nameTable).forEach(ir=>{for(var lr=FS.nameTable[ir];lr;){var dr=lr.name_next;tr.includes(lr.mount)&&FS.destroyNode(lr),lr=dr}}),I.mounted=null;var rr=I.mount.mounts.indexOf(B);I.mount.mounts.splice(rr,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,I){var B=FS.lookupPath(e,{parent:!0}),tr=B.node,rr=PATH.basename(e);if(!rr||rr==="."||rr==="..")throw new FS.ErrnoError(28);var ir=FS.mayCreate(tr,rr);if(ir)throw new FS.ErrnoError(ir);if(!tr.node_ops.mknod)throw new FS.ErrnoError(63);return tr.node_ops.mknod(tr,rr,t,I)},statfs(e){var t={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255},I=FS.lookupPath(e,{follow:!0}).node;return I!=null&&I.node_ops.statfs&&Object.assign(t,I.node_ops.statfs(I.mount.opts.root)),t},create(e,t=438){return t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir(e,t=511){return t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree(e,t){for(var I=e.split("/"),B="",tr=0;tr<I.length;++tr)if(I[tr]){B+="/"+I[tr];try{FS.mkdir(B,t)}catch(rr){if(rr.errno!=20)throw rr}}},mkdev(e,t,I){return typeof I>"u"&&(I=t,t=438),t|=8192,FS.mknod(e,t,I)},symlink(e,t){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var I=FS.lookupPath(t,{parent:!0}),B=I.node;if(!B)throw new FS.ErrnoError(44);var tr=PATH.basename(t),rr=FS.mayCreate(B,tr);if(rr)throw new FS.ErrnoError(rr);if(!B.node_ops.symlink)throw new FS.ErrnoError(63);return B.node_ops.symlink(B,tr,e)},rename(e,t){var I=PATH.dirname(e),B=PATH.dirname(t),tr=PATH.basename(e),rr=PATH.basename(t),ir,lr,dr;if(ir=FS.lookupPath(e,{parent:!0}),lr=ir.node,ir=FS.lookupPath(t,{parent:!0}),dr=ir.node,!lr||!dr)throw new FS.ErrnoError(44);if(lr.mount!==dr.mount)throw new FS.ErrnoError(75);var hr=FS.lookupNode(lr,tr),fr=PATH_FS.relative(e,B);if(fr.charAt(0)!==".")throw new FS.ErrnoError(28);if(fr=PATH_FS.relative(t,I),fr.charAt(0)!==".")throw new FS.ErrnoError(55);var mr;try{mr=FS.lookupNode(dr,rr)}catch{}if(hr!==mr){var _r=FS.isDir(hr.mode),yr=FS.mayDelete(lr,tr,_r);if(yr)throw new FS.ErrnoError(yr);if(yr=mr?FS.mayDelete(dr,rr,_r):FS.mayCreate(dr,rr),yr)throw new FS.ErrnoError(yr);if(!lr.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(hr)||mr&&FS.isMountpoint(mr))throw new FS.ErrnoError(10);if(dr!==lr&&(yr=FS.nodePermissions(lr,"w"),yr))throw new FS.ErrnoError(yr);FS.hashRemoveNode(hr);try{lr.node_ops.rename(hr,dr,rr),hr.parent=dr}catch(xr){throw xr}finally{FS.hashAddNode(hr)}}},rmdir(e){var t=FS.lookupPath(e,{parent:!0}),I=t.node,B=PATH.basename(e),tr=FS.lookupNode(I,B),rr=FS.mayDelete(I,B,!0);if(rr)throw new FS.ErrnoError(rr);if(!I.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(tr))throw new FS.ErrnoError(10);I.node_ops.rmdir(I,B),FS.destroyNode(tr)},readdir(e){var t=FS.lookupPath(e,{follow:!0}),I=t.node;if(!I.node_ops.readdir)throw new FS.ErrnoError(54);return I.node_ops.readdir(I)},unlink(e){var t=FS.lookupPath(e,{parent:!0}),I=t.node;if(!I)throw new FS.ErrnoError(44);var B=PATH.basename(e),tr=FS.lookupNode(I,B),rr=FS.mayDelete(I,B,!1);if(rr)throw new FS.ErrnoError(rr);if(!I.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(tr))throw new FS.ErrnoError(10);I.node_ops.unlink(I,B),FS.destroyNode(tr)},readlink(e){var t=FS.lookupPath(e),I=t.node;if(!I)throw new FS.ErrnoError(44);if(!I.node_ops.readlink)throw new FS.ErrnoError(28);return I.node_ops.readlink(I)},stat(e,t){var I=FS.lookupPath(e,{follow:!t}),B=I.node;if(!B)throw new FS.ErrnoError(44);if(!B.node_ops.getattr)throw new FS.ErrnoError(63);return B.node_ops.getattr(B)},lstat(e){return FS.stat(e,!0)},chmod(e,t,I){var B;if(typeof e=="string"){var tr=FS.lookupPath(e,{follow:!I});B=tr.node}else B=e;if(!B.node_ops.setattr)throw new FS.ErrnoError(63);B.node_ops.setattr(B,{mode:t&4095|B.mode&-4096,ctime:Date.now()})},lchmod(e,t){FS.chmod(e,t,!0)},fchmod(e,t){var I=FS.getStreamChecked(e);FS.chmod(I.node,t)},chown(e,t,I,B){var tr;if(typeof e=="string"){var rr=FS.lookupPath(e,{follow:!B});tr=rr.node}else tr=e;if(!tr.node_ops.setattr)throw new FS.ErrnoError(63);tr.node_ops.setattr(tr,{timestamp:Date.now()})},lchown(e,t,I){FS.chown(e,t,I,!0)},fchown(e,t,I){var B=FS.getStreamChecked(e);FS.chown(B.node,t,I)},truncate(e,t){if(t<0)throw new FS.ErrnoError(28);var I;if(typeof e=="string"){var B=FS.lookupPath(e,{follow:!0});I=B.node}else I=e;if(!I.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(I.mode))throw new FS.ErrnoError(31);if(!FS.isFile(I.mode))throw new FS.ErrnoError(28);var tr=FS.nodePermissions(I,"w");if(tr)throw new FS.ErrnoError(tr);I.node_ops.setattr(I,{size:t,timestamp:Date.now()})},ftruncate(e,t){var I=FS.getStreamChecked(e);if(!(I.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(I.node,t)},utime(e,t,I){var B=FS.lookupPath(e,{follow:!0}),tr=B.node;tr.node_ops.setattr(tr,{atime:t,mtime:I})},open(e,t,I=438){if(e==="")throw new FS.ErrnoError(44);t=typeof t=="string"?FS_modeStringToFlags(t):t,t&64?I=I&4095|32768:I=0;var B;if(typeof e=="object")B=e;else{var tr=FS.lookupPath(e,{follow:!(t&131072),noent_okay:!0});B=tr.node,e=tr.path}var rr=!1;if(t&64)if(B){if(t&128)throw new FS.ErrnoError(20)}else B=FS.mknod(e,I,0),rr=!0;if(!B)throw new FS.ErrnoError(44);if(FS.isChrdev(B.mode)&&(t&=-513),t&65536&&!FS.isDir(B.mode))throw new FS.ErrnoError(54);if(!rr){var ir=FS.mayOpen(B,t);if(ir)throw new FS.ErrnoError(ir)}t&512&&!rr&&FS.truncate(B,0),t&=-131713;var lr=FS.createStream({node:B,path:FS.getPath(B),flags:t,seekable:!0,position:0,stream_ops:B.stream_ops,ungotten:[],error:!1});return lr.stream_ops.open&&lr.stream_ops.open(lr),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),lr},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,I){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(I!=0&&I!=1&&I!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,I),e.ungotten=[],e.position},read(e,t,I,B,tr){if(B<0||tr<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var rr=typeof tr<"u";if(!rr)tr=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var ir=e.stream_ops.read(e,t,I,B,tr);return rr||(e.position+=ir),ir},write(e,t,I,B,tr,rr){if(B<0||tr<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var ir=typeof tr<"u";if(!ir)tr=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var lr=e.stream_ops.write(e,t,I,B,tr,rr);return ir||(e.position+=lr),lr},allocate(e,t,I){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||I<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,I)},mmap(e,t,I,B,tr){if(B&2&&!(tr&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!t)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,t,I,B,tr)},msync(e,t,I,B,tr){return e.stream_ops.msync?e.stream_ops.msync(e,t,I,B,tr):0},ioctl(e,t,I){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,I)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);var I,B=FS.open(e,t.flags),tr=FS.stat(e),rr=tr.size,ir=new Uint8Array(rr);return FS.read(B,ir,0,rr,0),t.encoding==="utf8"?I=UTF8ArrayToString(ir):t.encoding==="binary"&&(I=ir),FS.close(B),I},writeFile(e,t,I={}){I.flags=I.flags||577;var B=FS.open(e,I.flags,I.mode);if(typeof t=="string"){var tr=new Uint8Array(lengthBytesUTF8(t)+1),rr=stringToUTF8Array(t,tr,0,tr.length);FS.write(B,tr,0,rr,void 0,I.canOwn)}else if(ArrayBuffer.isView(t))FS.write(B,t,0,t.byteLength,void 0,I.canOwn);else throw new Error("Unsupported data type");FS.close(B)},cwd:()=>FS.currentPath,chdir(e){var t=FS.lookupPath(e,{follow:!0});if(t.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var I=FS.nodePermissions(t.node,"x");if(I)throw new FS.ErrnoError(I);FS.currentPath=t.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(B,tr,rr,ir,lr)=>ir,llseek:()=>0}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=new Uint8Array(1024),t=0,I=()=>(t===0&&(t=randomFill(e).byteLength),e[--t]);FS.createDevice("/dev","random",I),FS.createDevice("/dev","urandom",I),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var t=FS.createNode(e,"fd",16895,73);return t.stream_ops={llseek:MEMFS.stream_ops.llseek},t.node_ops={lookup(I,B){var tr=+B,rr=FS.getStreamChecked(tr),ir={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>rr.path},id:tr+1};return ir.parent=ir,ir},readdir(){return Array.from(FS.streams.entries()).filter(([I,B])=>B).map(([I,B])=>I.toString())}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,I){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),t?FS.createDevice("/dev","stdout",null,t):FS.symlink("/dev/tty","/dev/stdout"),I?FS.createDevice("/dev","stderr",null,I):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},staticInit(){FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS,IDBFS,NODEFS}},init(e,t,I){FS.initialized=!0,e??(e=Module.stdin),t??(t=Module.stdout),I??(I=Module.stderr),FS.createStandardStreams(e,t,I)},quit(){FS.initialized=!1,_fflush(0);for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},findObject(e,t){var I=FS.analyzePath(e,t);return I.exists?I.object:null},analyzePath(e,t){try{var I=FS.lookupPath(e,{follow:!t});e=I.path}catch{}var B={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var I=FS.lookupPath(e,{parent:!0});B.parentExists=!0,B.parentPath=I.path,B.parentObject=I.node,B.name=PATH.basename(e),I=FS.lookupPath(e,{follow:!t}),B.exists=!0,B.path=I.path,B.object=I.node,B.name=I.node.name,B.isRoot=I.path==="/"}catch(tr){B.error=tr.errno}return B},createPath(e,t,I,B){e=typeof e=="string"?e:FS.getPath(e);for(var tr=t.split("/").reverse();tr.length;){var rr=tr.pop();if(rr){var ir=PATH.join2(e,rr);try{FS.mkdir(ir)}catch{}e=ir}}return ir},createFile(e,t,I,B,tr){var rr=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),ir=FS_getMode(B,tr);return FS.create(rr,ir)},createDataFile(e,t,I,B,tr,rr){var ir=t;e&&(e=typeof e=="string"?e:FS.getPath(e),ir=t?PATH.join2(e,t):e);var lr=FS_getMode(B,tr),dr=FS.create(ir,lr);if(I){if(typeof I=="string"){for(var hr=new Array(I.length),fr=0,mr=I.length;fr<mr;++fr)hr[fr]=I.charCodeAt(fr);I=hr}FS.chmod(dr,lr|146);var _r=FS.open(dr,577);FS.write(_r,I,0,I.length,0,rr),FS.close(_r),FS.chmod(dr,lr)}},createDevice(e,t,I,B){var tr,rr=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),ir=FS_getMode(!!I,!!B);(tr=FS.createDevice).major??(tr.major=64);var lr=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(lr,{open(dr){dr.seekable=!1},close(dr){var hr;(hr=B==null?void 0:B.buffer)!=null&&hr.length&&B(10)},read(dr,hr,fr,mr,_r){for(var yr=0,xr=0;xr<mr;xr++){var Mr;try{Mr=I()}catch{throw new FS.ErrnoError(29)}if(Mr===void 0&&yr===0)throw new FS.ErrnoError(6);if(Mr==null)break;yr++,hr[fr+xr]=Mr}return yr&&(dr.node.atime=Date.now()),yr},write(dr,hr,fr,mr,_r){for(var yr=0;yr<mr;yr++)try{B(hr[fr+yr])}catch{throw new FS.ErrnoError(29)}return mr&&(dr.node.mtime=dr.node.ctime=Date.now()),yr}}),FS.mkdev(rr,ir,lr)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=readBinary(e.url),e.usedBytes=e.contents.length}catch{throw new FS.ErrnoError(29)}},createLazyFile(e,t,I,B,tr){class rr{constructor(){P$1(this,"lengthKnown",!1),P$1(this,"chunks",[])}get(yr){if(!(yr>this.length-1||yr<0)){var xr=yr%this.chunkSize,Mr=yr/this.chunkSize|0;return this.getter(Mr)[xr]}}setDataGetter(yr){this.getter=yr}cacheLength(){var yr=new XMLHttpRequest;if(yr.open("HEAD",I,!1),yr.send(null),!(yr.status>=200&&yr.status<300||yr.status===304))throw new Error("Couldn't load "+I+". Status: "+yr.status);var xr=Number(yr.getResponseHeader("Content-length")),Mr,vr=(Mr=yr.getResponseHeader("Accept-Ranges"))&&Mr==="bytes",Sr=(Mr=yr.getResponseHeader("Content-Encoding"))&&Mr==="gzip",wr=1024*1024;vr||(wr=xr);var br=(kr,Dr)=>{if(kr>Dr)throw new Error("invalid range ("+kr+", "+Dr+") or no bytes requested!");if(Dr>xr-1)throw new Error("only "+xr+" bytes available! programmer error!");var Or=new XMLHttpRequest;if(Or.open("GET",I,!1),xr!==wr&&Or.setRequestHeader("Range","bytes="+kr+"-"+Dr),Or.responseType="arraybuffer",Or.overrideMimeType&&Or.overrideMimeType("text/plain; charset=x-user-defined"),Or.send(null),!(Or.status>=200&&Or.status<300||Or.status===304))throw new Error("Couldn't load "+I+". Status: "+Or.status);return Or.response!==void 0?new Uint8Array(Or.response||[]):intArrayFromString(Or.responseText||"")},Ar=this;Ar.setDataGetter(kr=>{var Dr=kr*wr,Or=(kr+1)*wr-1;if(Or=Math.min(Or,xr-1),typeof Ar.chunks[kr]>"u"&&(Ar.chunks[kr]=br(Dr,Or)),typeof Ar.chunks[kr]>"u")throw new Error("doXHR failed!");return Ar.chunks[kr]}),(Sr||!xr)&&(wr=xr=1,xr=this.getter(0).length,wr=xr,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=xr,this._chunkSize=wr,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var ir=new rr,lr={isDevice:!1,contents:ir}}else var lr={isDevice:!1,url:I};var dr=FS.createFile(e,t,lr,B,tr);lr.contents?dr.contents=lr.contents:lr.url&&(dr.contents=null,dr.url=lr.url),Object.defineProperties(dr,{usedBytes:{get:function(){return this.contents.length}}});var hr={},fr=Object.keys(dr.stream_ops);fr.forEach(_r=>{var yr=dr.stream_ops[_r];hr[_r]=(...xr)=>(FS.forceLoadFile(dr),yr(...xr))});function mr(_r,yr,xr,Mr,vr){var Sr=_r.node.contents;if(vr>=Sr.length)return 0;var wr=Math.min(Sr.length-vr,Mr);if(Sr.slice)for(var br=0;br<wr;br++)yr[xr+br]=Sr[vr+br];else for(var br=0;br<wr;br++)yr[xr+br]=Sr.get(vr+br);return wr}return hr.read=(_r,yr,xr,Mr,vr)=>(FS.forceLoadFile(dr),mr(_r,yr,xr,Mr,vr)),hr.mmap=(_r,yr,xr,Mr,vr)=>{FS.forceLoadFile(dr);var Sr=mmapAlloc(yr);if(!Sr)throw new FS.ErrnoError(48);return mr(_r,HEAP8,Sr,yr,xr),{ptr:Sr,allocated:!0}},dr.stream_ops=hr,dr}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,t,I){if(PATH.isAbs(t))return t;var B;if(e===-100)B=FS.cwd();else{var tr=SYSCALLS.getStreamFromFD(e);B=tr.path}if(t.length==0){if(!I)throw new FS.ErrnoError(44);return B}return B+"/"+t},doStat(e,t,I){var B=e(t);HEAP32[I>>2]=B.dev,HEAP32[I+4>>2]=B.mode,HEAPU32[I+8>>2]=B.nlink,HEAP32[I+12>>2]=B.uid,HEAP32[I+16>>2]=B.gid,HEAP32[I+20>>2]=B.rdev,HEAP64[I+24>>3]=BigInt(B.size),HEAP32[I+32>>2]=4096,HEAP32[I+36>>2]=B.blocks;var tr=B.atime.getTime(),rr=B.mtime.getTime(),ir=B.ctime.getTime();return HEAP64[I+40>>3]=BigInt(Math.floor(tr/1e3)),HEAPU32[I+48>>2]=tr%1e3*1e3*1e3,HEAP64[I+56>>3]=BigInt(Math.floor(rr/1e3)),HEAPU32[I+64>>2]=rr%1e3*1e3*1e3,HEAP64[I+72>>3]=BigInt(Math.floor(ir/1e3)),HEAPU32[I+80>>2]=ir%1e3*1e3*1e3,HEAP64[I+88>>3]=BigInt(B.ino),0},doMsync(e,t,I,B,tr){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(B&2)return 0;var rr=HEAPU8.slice(e,e+I);FS.msync(t,rr,tr,I,B)},getStreamFromFD(e){var t=FS.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=UTF8ToString(e);return t}},___syscall__newselect=function(e,t,I,B,tr){try{for(var rr=0,ir=t?HEAP32[t>>2]:0,lr=t?HEAP32[t+4>>2]:0,dr=I?HEAP32[I>>2]:0,hr=I?HEAP32[I+4>>2]:0,fr=B?HEAP32[B>>2]:0,mr=B?HEAP32[B+4>>2]:0,_r=0,yr=0,xr=0,Mr=0,vr=0,Sr=0,wr=(t?HEAP32[t>>2]:0)|(I?HEAP32[I>>2]:0)|(B?HEAP32[B>>2]:0),br=(t?HEAP32[t+4>>2]:0)|(I?HEAP32[I+4>>2]:0)|(B?HEAP32[B+4>>2]:0),Ar=(Hn,ti,Ir,Lr)=>Hn<32?ti&Lr:Ir&Lr,kr=0;kr<e;kr++){var Dr=1<<kr%32;if(Ar(kr,wr,br,Dr)){var Or=SYSCALLS.getStreamFromFD(kr),zr=SYSCALLS.DEFAULT_POLLMASK;if(Or.stream_ops.poll){var $n=-1;if(tr){var Fr=t?HEAP32[tr>>2]:0,$r=t?HEAP32[tr+4>>2]:0;$n=(Fr+$r/1e6)*1e3}zr=Or.stream_ops.poll(Or,$n)}zr&1&&Ar(kr,ir,lr,Dr)&&(kr<32?_r=_r|Dr:yr=yr|Dr,rr++),zr&4&&Ar(kr,dr,hr,Dr)&&(kr<32?xr=xr|Dr:Mr=Mr|Dr,rr++),zr&2&&Ar(kr,fr,mr,Dr)&&(kr<32?vr=vr|Dr:Sr=Sr|Dr,rr++)}}return t&&(HEAP32[t>>2]=_r,HEAP32[t+4>>2]=yr),I&&(HEAP32[I>>2]=xr,HEAP32[I+4>>2]=Mr),B&&(HEAP32[B>>2]=vr,HEAP32[B+4>>2]=Sr),rr}catch(Hn){if(typeof FS>"u"||Hn.name!=="ErrnoError")throw Hn;return-Hn.errno}};___syscall__newselect.sig="iipppp";var SOCKFS={websocketArgs:{},callbacks:{},on(e,t){SOCKFS.callbacks[e]=t},emit(e,t){var I,B;(B=(I=SOCKFS.callbacks)[e])==null||B.call(I,t)},mount(e){return SOCKFS.websocketArgs=Module.websocket||{},(Module.websocket??(Module.websocket={})).on=SOCKFS.on,FS.createNode(null,"/",16895,0)},createSocket(e,t,I){t&=-526337;var B=t==1;if(B&&I&&I!=6)throw new FS.ErrnoError(66);var tr={family:e,type:t,protocol:I,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},rr=SOCKFS.nextname(),ir=FS.createNode(SOCKFS.root,rr,49152,0);ir.sock=tr;var lr=FS.createStream({path:rr,node:ir,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return tr.stream=lr,tr},getSocket(e){var t=FS.getStream(e);return!t||!FS.isSocket(t.node.mode)?null:t.node.sock},stream_ops:{poll(e){var t=e.node.sock;return t.sock_ops.poll(t)},ioctl(e,t,I){var B=e.node.sock;return B.sock_ops.ioctl(B,t,I)},read(e,t,I,B,tr){var rr=e.node.sock,ir=rr.sock_ops.recvmsg(rr,B);return ir?(t.set(ir.buffer,I),ir.buffer.length):0},write(e,t,I,B,tr){var rr=e.node.sock;return rr.sock_ops.sendmsg(rr,t,I,B)},close(e){var t=e.node.sock;t.sock_ops.close(t)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),`socket[${SOCKFS.nextname.current++}]`},websocket_sock_ops:{createPeer(e,t,I){var B;if(typeof t=="object"&&(B=t,t=null,I=null),B)if(B._socket)t=B._socket.remoteAddress,I=B._socket.remotePort;else{var tr=/ws[s]?:\/\/([^:]+):(\d+)/.exec(B.url);if(!tr)throw new Error("WebSocket URL must be in the format ws(s)://address:port");t=tr[1],I=parseInt(tr[2],10)}else try{var rr="ws:#".replace("#","//"),ir="binary",lr=void 0;if(SOCKFS.websocketArgs.url&&(rr=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?ir=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(ir="null"),rr==="ws://"||rr==="wss://"){var dr=t.split("/");rr=rr+dr[0]+":"+I+"/"+dr.slice(1).join("/")}ir!=="null"&&(ir=ir.replace(/^ +| +$/g,"").split(/ *, */),lr=ir);var hr;ENVIRONMENT_IS_NODE?hr=require("ws"):hr=WebSocket,B=new hr(rr,lr),B.binaryType="arraybuffer"}catch{throw new FS.ErrnoError(23)}var fr={addr:t,port:I,socket:B,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,fr),SOCKFS.websocket_sock_ops.handlePeerEvents(e,fr),e.type===2&&typeof e.sport<"u"&&fr.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),fr},getPeer(e,t,I){return e.peers[t+":"+I]},addPeer(e,t){e.peers[t.addr+":"+t.port]=t},removePeer(e,t){delete e.peers[t.addr+":"+t.port]},handlePeerEvents(e,t){var I=!0,B=function(){e.connecting=!1,SOCKFS.emit("open",e.stream.fd);try{for(var rr=t.msg_send_queue.shift();rr;)t.socket.send(rr),rr=t.msg_send_queue.shift()}catch{t.socket.close()}};function tr(rr){if(typeof rr=="string"){var ir=new TextEncoder;rr=ir.encode(rr)}else{if(assert(rr.byteLength!==void 0),rr.byteLength==0)return;rr=new Uint8Array(rr)}var lr=I;if(I=!1,lr&&rr.length===10&&rr[0]===255&&rr[1]===255&&rr[2]===255&&rr[3]===255&&rr[4]===112&&rr[5]===111&&rr[6]===114&&rr[7]===116){var dr=rr[8]<<8|rr[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=dr,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:rr}),SOCKFS.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(t.socket.on("open",B),t.socket.on("message",function(rr,ir){ir&&tr(new Uint8Array(rr).buffer)}),t.socket.on("close",function(){SOCKFS.emit("close",e.stream.fd)}),t.socket.on("error",function(rr){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=B,t.socket.onclose=function(){SOCKFS.emit("close",e.stream.fd)},t.socket.onmessage=function(rr){tr(rr.data)},t.socket.onerror=function(rr){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var t=0,I=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!I||I&&I.socket.readyState===I.socket.CLOSING||I&&I.socket.readyState===I.socket.CLOSED)&&(t|=65),(!I||I&&I.socket.readyState===I.socket.OPEN)&&(t|=4),(I&&I.socket.readyState===I.socket.CLOSING||I&&I.socket.readyState===I.socket.CLOSED)&&(e.connecting?t|=4:t|=16),t},ioctl(e,t,I){switch(t){case 21531:var B=0;return e.recv_queue.length&&(B=e.recv_queue[0].data.length),HEAP32[I>>2]=B,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch{}e.server=null}for(var t=Object.keys(e.peers),I=0;I<t.length;I++){var B=e.peers[t[I]];try{B.socket.close()}catch{}SOCKFS.websocket_sock_ops.removePeer(e,B)}return 0},bind(e,t,I){if(typeof e.saddr<"u"||typeof e.sport<"u")throw new FS.ErrnoError(28);if(e.saddr=t,e.sport=I,e.type===2){e.server&&(e.server.close(),e.server=null);try{e.sock_ops.listen(e,0)}catch(B){if(B.name!=="ErrnoError"||B.errno!==138)throw B}}},connect(e,t,I){if(e.server)throw new FS.ErrnoError(138);if(typeof e.daddr<"u"&&typeof e.dport<"u"){var B=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(B)throw B.socket.readyState===B.socket.CONNECTING?new FS.ErrnoError(7):new FS.ErrnoError(30)}var tr=SOCKFS.websocket_sock_ops.createPeer(e,t,I);e.daddr=tr.addr,e.dport=tr.port,e.connecting=!0},listen(e,t){if(!ENVIRONMENT_IS_NODE)throw new FS.ErrnoError(138);if(e.server)throw new FS.ErrnoError(28);var I=require("ws").Server,B=e.saddr;e.server=new I({host:B,port:e.sport}),SOCKFS.emit("listen",e.stream.fd),e.server.on("connection",function(tr){if(e.type===1){var rr=SOCKFS.createSocket(e.family,e.type,e.protocol),ir=SOCKFS.websocket_sock_ops.createPeer(rr,tr);rr.daddr=ir.addr,rr.dport=ir.port,e.pending.push(rr),SOCKFS.emit("connection",rr.stream.fd)}else SOCKFS.websocket_sock_ops.createPeer(e,tr),SOCKFS.emit("connection",e.stream.fd)}),e.server.on("close",function(){SOCKFS.emit("close",e.stream.fd),e.server=null}),e.server.on("error",function(tr){e.error=23,SOCKFS.emit("error",[e.stream.fd,e.error,"EHOSTUNREACH: Host is unreachable"])})},accept(e){if(!e.server||!e.pending.length)throw new FS.ErrnoError(28);var t=e.pending.shift();return t.stream.flags=e.stream.flags,t},getname(e,t){var I,B;if(t){if(e.daddr===void 0||e.dport===void 0)throw new FS.ErrnoError(53);I=e.daddr,B=e.dport}else I=e.saddr||0,B=e.sport||0;return{addr:I,port:B}},sendmsg(e,t,I,B,tr,rr){if(e.type===2){if((tr===void 0||rr===void 0)&&(tr=e.daddr,rr=e.dport),tr===void 0||rr===void 0)throw new FS.ErrnoError(17)}else tr=e.daddr,rr=e.dport;var ir=SOCKFS.websocket_sock_ops.getPeer(e,tr,rr);if(e.type===1&&(!ir||ir.socket.readyState===ir.socket.CLOSING||ir.socket.readyState===ir.socket.CLOSED))throw new FS.ErrnoError(53);ArrayBuffer.isView(t)&&(I+=t.byteOffset,t=t.buffer);var lr=t.slice(I,I+B);if(!ir||ir.socket.readyState!==ir.socket.OPEN)return e.type===2&&(!ir||ir.socket.readyState===ir.socket.CLOSING||ir.socket.readyState===ir.socket.CLOSED)&&(ir=SOCKFS.websocket_sock_ops.createPeer(e,tr,rr)),ir.msg_send_queue.push(lr),B;try{return ir.socket.send(lr),B}catch{throw new FS.ErrnoError(28)}},recvmsg(e,t){if(e.type===1&&e.server)throw new FS.ErrnoError(53);var I=e.recv_queue.shift();if(!I){if(e.type===1){var B=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(!B)throw new FS.ErrnoError(53);if(B.socket.readyState===B.socket.CLOSING||B.socket.readyState===B.socket.CLOSED)return null;throw new FS.ErrnoError(6)}throw new FS.ErrnoError(6)}var tr=I.data.byteLength||I.data.length,rr=I.data.byteOffset||0,ir=I.data.buffer||I.data,lr=Math.min(t,tr),dr={buffer:new Uint8Array(ir,rr,lr),addr:I.addr,port:I.port};if(e.type===1&&lr<tr){var hr=tr-lr;I.data=new Uint8Array(ir,rr+lr,hr),e.recv_queue.unshift(I)}return dr}}},getSocketFromFD=e=>{var t=SOCKFS.getSocket(e);if(!t)throw new FS.ErrnoError(8);return t},inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var t="",I=0,B=0,tr=0,rr=0,ir=0,lr=0,dr=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],hr=!0,fr="";for(lr=0;lr<5;lr++)if(dr[lr]!==0){hr=!1;break}if(hr){if(fr=inetNtop4(dr[6]|dr[7]<<16),dr[5]===-1)return t="::ffff:",t+=fr,t;if(dr[5]===0)return t="::",fr==="0.0.0.0"&&(fr=""),fr==="0.0.0.1"&&(fr="1"),t+=fr,t}for(I=0;I<8;I++)dr[I]===0&&(I-tr>1&&(ir=0),tr=I,ir++),ir>B&&(B=ir,rr=I-B+1);for(I=0;I<8;I++){if(B>1&&dr[I]===0&&I>=rr&&I<rr+B){I===rr&&(t+=":",rr===0&&(t+=":"));continue}t+=Number(_ntohs(dr[I]&65535)).toString(16),t+=I<7?":":""}return t},readSockaddr=(e,t)=>{var I=HEAP16[e>>1],B=_ntohs(HEAPU16[e+2>>1]),tr;switch(I){case 2:if(t!==16)return{errno:28};tr=HEAP32[e+4>>2],tr=inetNtop4(tr);break;case 10:if(t!==28)return{errno:28};tr=[HEAP32[e+8>>2],HEAP32[e+12>>2],HEAP32[e+16>>2],HEAP32[e+20>>2]],tr=inetNtop6(tr);break;default:return{errno:5}}return{family:I,addr:tr,port:B}},inetPton4=e=>{for(var t=e.split("."),I=0;I<4;I++){var B=Number(t[I]);if(isNaN(B))return null;t[I]=B}return(t[0]|t[1]<<8|t[2]<<16|t[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var t,I,B,tr,rr=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,ir=[];if(!rr.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),t=e.split(":"),t[t.length-4]=jstoi_q(t[t.length-4])+jstoi_q(t[t.length-3])*256,t[t.length-3]=jstoi_q(t[t.length-2])+jstoi_q(t[t.length-1])*256,t=t.slice(0,t.length-2)):t=e.split(":"),B=0,tr=0,I=0;I<t.length;I++)if(typeof t[I]=="string")if(t[I]==="Z"){for(tr=0;tr<8-t.length+1;tr++)ir[I+tr]=0;B=tr-1}else ir[I+B]=_htons(parseInt(t[I],16));else ir[I+B]=t[I];return[ir[1]<<16|ir[0],ir[3]<<16|ir[2],ir[5]<<16|ir[4],ir[7]<<16|ir[6]]},DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(e){var t=inetPton4(e);if(t!==null||(t=inetPton6(e),t!==null))return e;var I;if(DNS.address_map.addrs[e])I=DNS.address_map.addrs[e];else{var B=DNS.address_map.id++;assert(B<65535,"exceeded max address mappings of 65535"),I="172.29."+(B&255)+"."+(B&65280),DNS.address_map.names[I]=e,DNS.address_map.addrs[e]=I}return I},lookup_addr(e){return DNS.address_map.names[e]?DNS.address_map.names[e]:null}},getSocketAddress=(e,t)=>{var I=readSockaddr(e,t);if(I.errno)throw new FS.ErrnoError(I.errno);return I.addr=DNS.lookup_addr(I.addr)||I.addr,I};function ___syscall_bind(e,t,I,B,tr,rr){try{var ir=getSocketFromFD(e),lr=getSocketAddress(t,I);return ir.sock_ops.bind(ir,lr.addr,lr.port),0}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_bind.sig="iippiii";function ___syscall_chdir(e){try{return e=SYSCALLS.getStr(e),FS.chdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_chdir.sig="ip";function ___syscall_chmod(e,t){try{return e=SYSCALLS.getStr(e),FS.chmod(e,t),0}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_chmod.sig="ipi";function ___syscall_connect(e,t,I,B,tr,rr){try{var ir=getSocketFromFD(e),lr=getSocketAddress(t,I);return ir.sock_ops.connect(ir,lr.addr,lr.port),0}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_connect.sig="iippiii";function ___syscall_dup(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.dupStream(t).fd}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_dup.sig="ii";function ___syscall_dup3(e,t,I){try{var B=SYSCALLS.getStreamFromFD(e);if(B.fd===t)return-28;if(t<0||t>=FS.MAX_OPEN_FDS)return-8;var tr=FS.getStream(t);return tr&&FS.close(tr),FS.dupStream(B,t).fd}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_dup3.sig="iiii";function ___syscall_faccessat(e,t,I,B){try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),I&-8)return-28;var tr=FS.lookupPath(t,{follow:!0}),rr=tr.node;if(!rr)return-44;var ir="";return I&4&&(ir+="r"),I&2&&(ir+="w"),I&1&&(ir+="x"),ir&&FS.nodePermissions(rr,ir)?-2:0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(e,t,I,B)=>0;___syscall_fadvise64.sig="iijji";var INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=e=>e<INT53_MIN||e>INT53_MAX?NaN:Number(e);function ___syscall_fallocate(e,t,I,B){I=bigintToI53Checked(I),B=bigintToI53Checked(B);try{if(isNaN(I))return 61;var tr=SYSCALLS.getStreamFromFD(e);return FS.allocate(tr,I,B),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_fallocate.sig="iiijj";var syscallGetVarargI=()=>{var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(e,t,I){SYSCALLS.varargs=I;try{var B=SYSCALLS.getStreamFromFD(e);switch(t){case 0:{var tr=syscallGetVarargI();if(tr<0)return-28;for(;FS.streams[tr];)tr++;var rr;return rr=FS.dupStream(B,tr),rr.fd}case 1:case 2:return 0;case 3:return B.flags;case 4:{var tr=syscallGetVarargI();return B.flags|=tr,0}case 12:{var tr=syscallGetVarargP(),ir=0;return HEAP16[tr+ir>>1]=2,0}case 13:case 14:return 0}return-28}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(e){try{return SYSCALLS.getStreamFromFD(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_fdatasync.sig="ii";function ___syscall_fstat64(e,t){try{var I=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,I.path,t)}catch(B){if(typeof FS>"u"||B.name!=="ErrnoError")throw B;return-B.errno}}___syscall_fstat64.sig="iip";function ___syscall_ftruncate64(e,t){t=bigintToI53Checked(t);try{return isNaN(t)?61:(FS.ftruncate(e,t),0)}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_ftruncate64.sig="iij";var stringToUTF8=(e,t,I)=>stringToUTF8Array(e,HEAPU8,t,I);function ___syscall_getcwd(e,t){try{if(t===0)return-28;var I=FS.cwd(),B=lengthBytesUTF8(I)+1;return t<B?-68:(stringToUTF8(I,e,t),B)}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_getcwd.sig="ipp";function ___syscall_getdents64(e,t,I){try{var B=SYSCALLS.getStreamFromFD(e);B.getdents||(B.getdents=FS.readdir(B.path));for(var tr=280,rr=0,ir=FS.llseek(B,0,1),lr=Math.floor(ir/tr),dr=Math.min(B.getdents.length,lr+Math.floor(I/tr)),hr=lr;hr<dr;hr++){var fr,mr,_r=B.getdents[hr];if(_r===".")fr=B.node.id,mr=4;else if(_r===".."){var yr=FS.lookupPath(B.path,{parent:!0});fr=yr.node.id,mr=4}else{var xr;try{xr=FS.lookupNode(B.node,_r)}catch(Mr){if((Mr==null?void 0:Mr.errno)===28)continue;throw Mr}fr=xr.id,mr=FS.isChrdev(xr.mode)?2:FS.isDir(xr.mode)?4:FS.isLink(xr.mode)?10:8}HEAP64[t+rr>>3]=BigInt(fr),HEAP64[t+rr+8>>3]=BigInt((hr+1)*tr),HEAP16[t+rr+16>>1]=280,HEAP8[t+rr+18]=mr,stringToUTF8(_r,t+rr+19,256),rr+=tr}return FS.llseek(B,hr*tr,0),rr}catch(Mr){if(typeof FS>"u"||Mr.name!=="ErrnoError")throw Mr;return-Mr.errno}}___syscall_getdents64.sig="iipp";var writeSockaddr=(e,t,I,B,tr)=>{switch(t){case 2:I=inetPton4(I),zeroMemory(e,16),tr&&(HEAP32[tr>>2]=16),HEAP16[e>>1]=t,HEAP32[e+4>>2]=I,HEAP16[e+2>>1]=_htons(B);break;case 10:I=inetPton6(I),zeroMemory(e,28),tr&&(HEAP32[tr>>2]=28),HEAP32[e>>2]=t,HEAP32[e+8>>2]=I[0],HEAP32[e+12>>2]=I[1],HEAP32[e+16>>2]=I[2],HEAP32[e+20>>2]=I[3],HEAP16[e+2>>1]=_htons(B);break;default:return 5}return 0};function ___syscall_getsockname(e,t,I,B,tr,rr){try{var ir=getSocketFromFD(e);return writeSockaddr(t,ir.family,DNS.lookup_name(ir.saddr||"0.0.0.0"),ir.sport,I),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(e,t,I,B,tr,rr){try{var ir=getSocketFromFD(e);return t===1&&I===4?(HEAP32[B>>2]=ir.error,HEAP32[tr>>2]=4,ir.error=null,0):-50}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(e,t,I){SYSCALLS.varargs=I;try{var B=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:return B.tty?0:-59;case 21505:{if(!B.tty)return-59;if(B.tty.ops.ioctl_tcgets){var tr=B.tty.ops.ioctl_tcgets(B),rr=syscallGetVarargP();HEAP32[rr>>2]=tr.c_iflag||0,HEAP32[rr+4>>2]=tr.c_oflag||0,HEAP32[rr+8>>2]=tr.c_cflag||0,HEAP32[rr+12>>2]=tr.c_lflag||0;for(var ir=0;ir<32;ir++)HEAP8[rr+ir+17]=tr.c_cc[ir]||0;return 0}return 0}case 21510:case 21511:case 21512:return B.tty?0:-59;case 21506:case 21507:case 21508:{if(!B.tty)return-59;if(B.tty.ops.ioctl_tcsets){for(var rr=syscallGetVarargP(),lr=HEAP32[rr>>2],dr=HEAP32[rr+4>>2],hr=HEAP32[rr+8>>2],fr=HEAP32[rr+12>>2],mr=[],ir=0;ir<32;ir++)mr.push(HEAP8[rr+ir+17]);return B.tty.ops.ioctl_tcsets(B.tty,t,{c_iflag:lr,c_oflag:dr,c_cflag:hr,c_lflag:fr,c_cc:mr})}return 0}case 21519:{if(!B.tty)return-59;var rr=syscallGetVarargP();return HEAP32[rr>>2]=0,0}case 21520:return B.tty?-28:-59;case 21531:{var rr=syscallGetVarargP();return FS.ioctl(B,t,rr)}case 21523:{if(!B.tty)return-59;if(B.tty.ops.ioctl_tiocgwinsz){var _r=B.tty.ops.ioctl_tiocgwinsz(B.tty),rr=syscallGetVarargP();HEAP16[rr>>1]=_r[0],HEAP16[rr+2>>1]=_r[1]}return 0}case 21524:return B.tty?0:-59;case 21515:return B.tty?0:-59;default:return-28}}catch(yr){if(typeof FS>"u"||yr.name!=="ErrnoError")throw yr;return-yr.errno}}___syscall_ioctl.sig="iiip";function ___syscall_lstat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(e,t,I){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),FS.mkdir(t,I,0),0}catch(B){if(typeof FS>"u"||B.name!=="ErrnoError")throw B;return-B.errno}}___syscall_mkdirat.sig="iipi";function ___syscall_newfstatat(e,t,I,B){try{t=SYSCALLS.getStr(t);var tr=B&256,rr=B&4096;return B=B&-6401,t=SYSCALLS.calculateAt(e,t,rr),SYSCALLS.doStat(tr?FS.lstat:FS.stat,t,I)}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_newfstatat.sig="iippi";function ___syscall_openat(e,t,I,B){SYSCALLS.varargs=B;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var tr=B?syscallGetVarargI():0;return FS.open(t,I,tr).fd}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(e){return FS.createNode(null,"/",16895,0)},createPipe(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),I=PIPEFS.nextname(),B=FS.createNode(PIPEFS.root,t,4096,0),tr=FS.createNode(PIPEFS.root,I,4096,0);B.pipe=e,tr.pipe=e;var rr=FS.createStream({path:t,node:B,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});B.stream=rr;var ir=FS.createStream({path:I,node:tr,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return tr.stream=ir,{readable_fd:rr.fd,writable_fd:ir.fd}},stream_ops:{poll(e){var t=e.node.pipe;if((e.flags&2097155)===1)return 260;if(t.buckets.length>0)for(var I=0;I<t.buckets.length;I++){var B=t.buckets[I];if(B.offset-B.roffset>0)return 65}return 0},ioctl(e,t,I){return 28},fsync(e){return 28},read(e,t,I,B,tr){for(var rr=e.node.pipe,ir=0,lr=0;lr<rr.buckets.length;lr++){var dr=rr.buckets[lr];ir+=dr.offset-dr.roffset}var hr=t.subarray(I,I+B);if(B<=0)return 0;if(ir==0)throw new FS.ErrnoError(6);for(var fr=Math.min(ir,B),mr=fr,_r=0,lr=0;lr<rr.buckets.length;lr++){var yr=rr.buckets[lr],xr=yr.offset-yr.roffset;if(fr<=xr){var Mr=yr.buffer.subarray(yr.roffset,yr.offset);fr<xr?(Mr=Mr.subarray(0,fr),yr.roffset+=fr):_r++,hr.set(Mr);break}else{var Mr=yr.buffer.subarray(yr.roffset,yr.offset);hr.set(Mr),hr=hr.subarray(Mr.byteLength),fr-=Mr.byteLength,_r++}}return _r&&_r==rr.buckets.length&&(_r--,rr.buckets[_r].offset=0,rr.buckets[_r].roffset=0),rr.buckets.splice(0,_r),mr},write(e,t,I,B,tr){var rr=e.node.pipe,ir=t.subarray(I,I+B),lr=ir.byteLength;if(lr<=0)return 0;var dr=null;rr.buckets.length==0?(dr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},rr.buckets.push(dr)):dr=rr.buckets[rr.buckets.length-1],assert(dr.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var hr=PIPEFS.BUCKET_BUFFER_SIZE-dr.offset;if(hr>=lr)return dr.buffer.set(ir,dr.offset),dr.offset+=lr,lr;hr>0&&(dr.buffer.set(ir.subarray(0,hr),dr.offset),dr.offset+=hr,ir=ir.subarray(hr,ir.byteLength));for(var fr=ir.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,mr=ir.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,_r=0;_r<fr;_r++){var yr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};rr.buckets.push(yr),yr.buffer.set(ir.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),ir=ir.subarray(PIPEFS.BUCKET_BUFFER_SIZE,ir.byteLength)}if(mr>0){var yr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:ir.byteLength,roffset:0};rr.buckets.push(yr),yr.buffer.set(ir)}return lr},close(e){var t=e.node.pipe;t.refcnt--,t.refcnt===0&&(t.buckets=null)}},nextname(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){try{if(e==0)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>2]=t.readable_fd,HEAP32[e+4>>2]=t.writable_fd,0}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_pipe.sig="ip";function ___syscall_poll(e,t,I){try{for(var B=0,tr=0;tr<t;tr++){var rr=e+8*tr,ir=HEAP32[rr>>2],lr=HEAP16[rr+4>>1],dr=32,hr=FS.getStream(ir);hr&&(dr=SYSCALLS.DEFAULT_POLLMASK,hr.stream_ops.poll&&(dr=hr.stream_ops.poll(hr,-1))),dr&=lr|8|16,dr&&B++,HEAP16[rr+6>>1]=dr}return B}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_poll.sig="ipii";function ___syscall_readlinkat(e,t,I,B){try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),B<=0)return-28;var tr=FS.readlink(t),rr=Math.min(B,lengthBytesUTF8(tr)),ir=HEAP8[I+rr];return stringToUTF8(tr,I,B+1),HEAP8[I+rr]=ir,rr}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(e,t,I,B,tr,rr){try{var ir=getSocketFromFD(e),lr=ir.sock_ops.recvmsg(ir,I);if(!lr)return 0;if(tr)var dr=writeSockaddr(tr,ir.family,DNS.lookup_name(lr.addr),lr.port,rr);return HEAPU8.set(lr.buffer,t),lr.buffer.byteLength}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return-hr.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_renameat(e,t,I,B){try{return t=SYSCALLS.getStr(t),B=SYSCALLS.getStr(B),t=SYSCALLS.calculateAt(e,t),B=SYSCALLS.calculateAt(I,B),FS.rename(t,B),0}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_renameat.sig="iipip";function ___syscall_rmdir(e){try{return e=SYSCALLS.getStr(e),FS.rmdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_rmdir.sig="ip";function ___syscall_sendto(e,t,I,B,tr,rr){try{var ir=getSocketFromFD(e);if(!tr)return FS.write(ir.stream,HEAP8,t,I);var lr=getSocketAddress(tr,rr);return ir.sock_ops.sendmsg(ir,HEAP8,t,I,lr.addr,lr.port)}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_sendto.sig="iippipp";function ___syscall_socket(e,t,I){try{var B=SOCKFS.createSocket(e,t,I);return B.stream.fd}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_socket.sig="iiiiiii";function ___syscall_stat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_stat64.sig="ipp";function ___syscall_symlinkat(e,t,I){try{return e=SYSCALLS.getStr(e),I=SYSCALLS.getStr(I),I=SYSCALLS.calculateAt(t,I),FS.symlink(e,I),0}catch(B){if(typeof FS>"u"||B.name!=="ErrnoError")throw B;return-B.errno}}___syscall_symlinkat.sig="ipip";function ___syscall_truncate64(e,t){t=bigintToI53Checked(t);try{return isNaN(t)?61:(e=SYSCALLS.getStr(e),FS.truncate(e,t),0)}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}___syscall_truncate64.sig="ipj";function ___syscall_unlinkat(e,t,I){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),I===0?FS.unlink(t):I===512?FS.rmdir(t):abort("Invalid flags passed to unlinkat"),0}catch(B){if(typeof FS>"u"||B.name!=="ErrnoError")throw B;return-B.errno}}___syscall_unlinkat.sig="iipi";var ___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>abort("");__abort_js.sig="v";var ENV={},stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,I=stackAlloc(t);return stringToUTF8(e,I,t),I},dlSetError=e=>{var t=stackSave(),I=stringToUTF8OnStack(e);___dl_seterr(I,0),stackRestore(t)},dlopenInternal=(e,t)=>{var I=UTF8ToString(e+36),B=HEAP32[e+4>>2];I=PATH.normalize(I);var tr=!!(B&256),rr=tr?null:{},ir={global:tr,nodelete:!!(B&4096),loadAsync:t.loadAsync};try{return loadDynamicLibrary(I,ir,rr,e)}catch(lr){return dlSetError(`Could not load dynamic lib: ${I}
|
|
138
|
-
${lr}`),0}},__dlopen_js=e=>dlopenInternal(e,{loadAsync:!1});__dlopen_js.sig="pp";var __dlsym_js=(e,t,I)=>{t=UTF8ToString(t);var B,tr,rr=LDSO.loadedLibsByHandle[e];if(!rr.exports.hasOwnProperty(t)||rr.exports[t].stub)return dlSetError(`Tried to lookup unknown symbol "${t}" in dynamic lib: ${rr.name}`),0;if(tr=Object.keys(rr.exports).indexOf(t),B=rr.exports[t],typeof B=="function"){var ir=getFunctionAddress(B);ir?B=ir:(B=addFunction(B,B.sig),HEAPU32[I>>2]=tr)}return B};__dlsym_js.sig="pppp";var __emscripten_memcpy_js=(e,t,I)=>HEAPU8.copyWithin(e,t,t+I);__emscripten_memcpy_js.sig="vppp";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_system=e=>{if(ENVIRONMENT_IS_NODE){if(!e)return 1;var t=UTF8ToString(e);if(!t.length)return 0;var I=require("child_process"),B=I.spawnSync(t,[],{shell:!0,stdio:"inherit"}),tr=(ir,lr)=>ir<<8|lr;if(B.status===null){var rr=ir=>{switch(ir){case"SIGHUP":return 1;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;default:return 2}};return tr(0,rr(B.signal))}return tr(B.status,0)}return e?-52:0};__emscripten_system.sig="ip";var __emscripten_throw_longjmp=()=>{throw 1/0};__emscripten_throw_longjmp.sig="v";function __gmtime_js(e,t){e=bigintToI53Checked(e);var I=new Date(e*1e3);HEAP32[t>>2]=I.getUTCSeconds(),HEAP32[t+4>>2]=I.getUTCMinutes(),HEAP32[t+8>>2]=I.getUTCHours(),HEAP32[t+12>>2]=I.getUTCDate(),HEAP32[t+16>>2]=I.getUTCMonth(),HEAP32[t+20>>2]=I.getUTCFullYear()-1900,HEAP32[t+24>>2]=I.getUTCDay();var B=Date.UTC(I.getUTCFullYear(),0,1,0,0,0,0),tr=(I.getTime()-B)/(1e3*60*60*24)|0;HEAP32[t+28>>2]=tr}__gmtime_js.sig="vjp";var isLeapYear=e=>e%4===0&&(e%100!==0||e%400===0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=e=>{var t=isLeapYear(e.getFullYear()),I=t?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE,B=I[e.getMonth()]+e.getDate()-1;return B};function __localtime_js(e,t){e=bigintToI53Checked(e);var I=new Date(e*1e3);HEAP32[t>>2]=I.getSeconds(),HEAP32[t+4>>2]=I.getMinutes(),HEAP32[t+8>>2]=I.getHours(),HEAP32[t+12>>2]=I.getDate(),HEAP32[t+16>>2]=I.getMonth(),HEAP32[t+20>>2]=I.getFullYear()-1900,HEAP32[t+24>>2]=I.getDay();var B=ydayFromDate(I)|0;HEAP32[t+28>>2]=B,HEAP32[t+36>>2]=-(I.getTimezoneOffset()*60);var tr=new Date(I.getFullYear(),0,1),rr=new Date(I.getFullYear(),6,1).getTimezoneOffset(),ir=tr.getTimezoneOffset(),lr=(rr!=ir&&I.getTimezoneOffset()==Math.min(ir,rr))|0;HEAP32[t+32>>2]=lr}__localtime_js.sig="vjp";function __mmap_js(e,t,I,B,tr,rr,ir){tr=bigintToI53Checked(tr);try{if(isNaN(tr))return 61;var lr=SYSCALLS.getStreamFromFD(B),dr=FS.mmap(lr,e,tr,t,I),hr=dr.ptr;return HEAP32[rr>>2]=dr.allocated,HEAPU32[ir>>2]=hr,0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}__mmap_js.sig="ipiiijpp";function __munmap_js(e,t,I,B,tr,rr){rr=bigintToI53Checked(rr);try{var ir=SYSCALLS.getStreamFromFD(tr);I&2&&SYSCALLS.doMsync(e,ir,t,B,rr)}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}__munmap_js.sig="ippiiij";var timers={},handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{var t;EXITSTATUS=e,keepRuntimeAlive()||((t=Module.onExit)==null||t.call(Module,e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},callUserCallback=e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var I=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:I,timeout_ms:t},0};__setitimer_js.sig="iid";var __tzset_js=(e,t,I,B)=>{var tr=new Date().getFullYear(),rr=new Date(tr,0,1),ir=new Date(tr,6,1),lr=rr.getTimezoneOffset(),dr=ir.getTimezoneOffset(),hr=Math.max(lr,dr);HEAPU32[e>>2]=hr*60,HEAP32[t>>2]=+(lr!=dr);var fr=yr=>{var xr=yr>=0?"-":"+",Mr=Math.abs(yr),vr=String(Math.floor(Mr/60)).padStart(2,"0"),Sr=String(Mr%60).padStart(2,"0");return`UTC${xr}${vr}${Sr}`},mr=fr(lr),_r=fr(dr);dr<lr?(stringToUTF8(mr,I,17),stringToUTF8(_r,B,17)):(stringToUTF8(mr,B,17),stringToUTF8(_r,I,17))};__tzset_js.sig="vpppp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";var checkWasiClock=e=>e>=0&&e<=3;function _clock_time_get(e,t,I){if(!checkWasiClock(e))return 28;var B;e===0?B=_emscripten_date_now():B=_emscripten_get_now();var tr=Math.round(B*1e3*1e3);return HEAP64[I>>3]=BigInt(tr),0}_clock_time_get.sig="iijp";var readEmAsmArgsArray=[],readEmAsmArgs=(e,t)=>{readEmAsmArgsArray.length=0;for(var I;I=HEAPU8[e++];){var B=I!=105;B&=I!=112,t+=B&&t%8?4:0,readEmAsmArgsArray.push(I==112?HEAPU32[t>>2]:I==106?HEAP64[t>>3]:I==105?HEAP32[t>>2]:HEAPF64[t>>3]),t+=B?8:4}return readEmAsmArgsArray},runEmAsmFunction=(e,t,I)=>{var B=readEmAsmArgs(t,I);return ASM_CONSTS[e](...B)},_emscripten_asm_const_int=(e,t,I)=>runEmAsmFunction(e,t,I);_emscripten_asm_const_int.sig="ippp";var _emscripten_force_exit=e=>{__emscripten_runtime_keepalive_clear(),_exit(e)};_emscripten_force_exit.sig="vi";var getHeapMax=()=>2147483648,growMemory=e=>{var t=wasmMemory.buffer,I=(e-t.byteLength+65535)/65536|0;try{return wasmMemory.grow(I),updateMemoryViews(),1}catch{}},_emscripten_resize_heap=e=>{var t=HEAPU8.length;e>>>=0;var I=getHeapMax();if(e>I)return!1;for(var B=1;B<=4;B*=2){var tr=t*(1+.2/B);tr=Math.min(tr,e+100663296);var rr=Math.min(I,alignMemory(Math.max(e,tr),65536)),ir=growMemory(rr);if(ir)return!0}return!1};_emscripten_resize_heap.sig="ip";var _emscripten_set_main_loop_timing=(e,t)=>{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var rr=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,rr)},MainLoop.method="timeout";else if(e==1)MainLoop.scheduler=function(){MainLoop.requestAnimationFrame(MainLoop.runner)},MainLoop.method="rAF";else if(e==2){if(typeof MainLoop.setImmediate>"u")if(typeof setImmediate>"u"){var I=[],B="setimmediate",tr=rr=>{(rr.data===B||rr.data.target===B)&&(rr.stopPropagation(),I.shift()())};addEventListener("message",tr,!0),MainLoop.setImmediate=rr=>{I.push(rr),ENVIRONMENT_IS_WORKER?(Module.setImmediates??(Module.setImmediates=[]),Module.setImmediates.push(rr),postMessage({target:B})):postMessage(B,"*")}}else MainLoop.setImmediate=setImmediate;MainLoop.scheduler=function(){MainLoop.setImmediate(MainLoop.runner)},MainLoop.method="immediate"}return 0};_emscripten_set_main_loop_timing.sig="iii";var MainLoop={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){MainLoop.scheduler=null,MainLoop.currentlyRunningMainloop++},resume(){MainLoop.currentlyRunningMainloop++;var e=MainLoop.timingMode,t=MainLoop.timingValue,I=MainLoop.func;MainLoop.func=null,setMainLoop(I,0,!1,MainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),MainLoop.scheduler()},updateStatus(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=MainLoop.remainingBlockers??0,I=MainLoop.expectedBlockers??0;t?t<I?Module.setStatus("{message} ({expected - remaining}/{expected})"):Module.setStatus(e):Module.setStatus("")}},init(){Module.preMainLoop&&MainLoop.preMainLoop.push(Module.preMainLoop),Module.postMainLoop&&MainLoop.postMainLoop.push(Module.postMainLoop)},runIter(e){if(!ABORT){for(var t of MainLoop.preMainLoop)if(t()===!1)return;callUserCallback(e);for(var I of MainLoop.postMainLoop)I()}},nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(MainLoop.nextRAF===0)MainLoop.nextRAF=t+1e3/60;else for(;t+2>=MainLoop.nextRAF;)MainLoop.nextRAF+=1e3/60;var I=Math.max(MainLoop.nextRAF-t,0);setTimeout(e,I)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}var t=MainLoop.fakeRequestAnimationFrame;t(e)}},setMainLoop=(e,t,I,B,tr)=>{MainLoop.func=e,MainLoop.arg=B;var rr=MainLoop.currentlyRunningMainloop;function ir(){return rr<MainLoop.currentlyRunningMainloop?(maybeExit(),!1):!0}if(MainLoop.running=!1,MainLoop.runner=function(){if(!ABORT){if(MainLoop.queue.length>0){var lr=MainLoop.queue.shift();if(lr.func(lr.arg),MainLoop.remainingBlockers){var dr=MainLoop.remainingBlockers,hr=dr%1==0?dr-1:Math.floor(dr);lr.counted?MainLoop.remainingBlockers=hr:(hr=hr+.5,MainLoop.remainingBlockers=(8*dr+hr)/9)}if(MainLoop.updateStatus(),!ir())return;setTimeout(MainLoop.runner,0);return}if(ir()){if(MainLoop.currentFrameNumber=MainLoop.currentFrameNumber+1|0,MainLoop.timingMode==1&&MainLoop.timingValue>1&&MainLoop.currentFrameNumber%MainLoop.timingValue!=0){MainLoop.scheduler();return}else MainLoop.timingMode==0&&(MainLoop.tickStartTime=_emscripten_get_now());MainLoop.runIter(e),ir()&&MainLoop.scheduler()}}},tr||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),MainLoop.scheduler()),I)throw"unwind"},_emscripten_set_main_loop=(e,t,I)=>{var B=getWasmTableEntry(e);setMainLoop(B,t,I)};_emscripten_set_main_loop.sig="vpii";var getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var I in ENV)ENV[I]===void 0?delete t[I]:t[I]=ENV[I];var B=[];for(var I in t)B.push(`${I}=${t[I]}`);getEnvStrings.strings=B}return getEnvStrings.strings},stringToAscii=(e,t)=>{for(var I=0;I<e.length;++I)HEAP8[t++]=e.charCodeAt(I);HEAP8[t]=0},_environ_get=(e,t)=>{var I=0;return getEnvStrings().forEach((B,tr)=>{var rr=t+I;HEAPU32[e+tr*4>>2]=rr,stringToAscii(B,rr),I+=B.length+1}),0};_environ_get.sig="ipp";var _environ_sizes_get=(e,t)=>{var I=getEnvStrings();HEAPU32[e>>2]=I.length;var B=0;return I.forEach(tr=>B+=tr.length+1),HEAPU32[t>>2]=B,0};_environ_sizes_get.sig="ipp";function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(I){if(typeof FS>"u"||I.name!=="ErrnoError")throw I;return I.errno}}_fd_close.sig="ii";function _fd_fdstat_get(e,t){try{var I=0,B=0,tr=0,rr=SYSCALLS.getStreamFromFD(e),ir=rr.tty?2:FS.isDir(rr.mode)?3:FS.isLink(rr.mode)?7:4;return HEAP8[t]=ir,HEAP16[t+2>>1]=tr,HEAP64[t+8>>3]=BigInt(I),HEAP64[t+16>>3]=BigInt(B),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return lr.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,I,B)=>{for(var tr=0,rr=0;rr<I;rr++){var ir=HEAPU32[t>>2],lr=HEAPU32[t+4>>2];t+=8;var dr=FS.read(e,HEAP8,ir,lr,B);if(dr<0)return-1;if(tr+=dr,dr<lr)break;typeof B<"u"&&(B+=dr)}return tr};function _fd_pread(e,t,I,B,tr){B=bigintToI53Checked(B);try{if(isNaN(B))return 61;var rr=SYSCALLS.getStreamFromFD(e),ir=doReadv(rr,t,I,B);return HEAPU32[tr>>2]=ir,0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return lr.errno}}_fd_pread.sig="iippjp";var doWritev=(e,t,I,B)=>{for(var tr=0,rr=0;rr<I;rr++){var ir=HEAPU32[t>>2],lr=HEAPU32[t+4>>2];t+=8;var dr=FS.write(e,HEAP8,ir,lr,B);if(dr<0)return-1;if(tr+=dr,dr<lr)break;typeof B<"u"&&(B+=dr)}return tr};function _fd_pwrite(e,t,I,B,tr){B=bigintToI53Checked(B);try{if(isNaN(B))return 61;var rr=SYSCALLS.getStreamFromFD(e),ir=doWritev(rr,t,I,B);return HEAPU32[tr>>2]=ir,0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return lr.errno}}_fd_pwrite.sig="iippjp";function _fd_read(e,t,I,B){try{var tr=SYSCALLS.getStreamFromFD(e),rr=doReadv(tr,t,I);return HEAPU32[B>>2]=rr,0}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return ir.errno}}_fd_read.sig="iippp";function _fd_seek(e,t,I,B){t=bigintToI53Checked(t);try{if(isNaN(t))return 61;var tr=SYSCALLS.getStreamFromFD(e);return FS.llseek(tr,t,I),HEAP64[B>>3]=BigInt(tr.position),tr.getdents&&t===0&&I===0&&(tr.getdents=null),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return rr.errno}}_fd_seek.sig="iijip";function _fd_sync(e){var I;try{var t=SYSCALLS.getStreamFromFD(e);return(I=t.stream_ops)!=null&&I.fsync?t.stream_ops.fsync(t):0}catch(B){if(typeof FS>"u"||B.name!=="ErrnoError")throw B;return B.errno}}_fd_sync.sig="ii";function _fd_write(e,t,I,B){try{var tr=SYSCALLS.getStreamFromFD(e),rr=doWritev(tr,t,I);return HEAPU32[B>>2]=rr,0}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return ir.errno}}_fd_write.sig="iippp";var _getaddrinfo=(e,t,I,B)=>{var tr=0,rr=0,ir=0,lr=0,dr=0,hr=0,fr;function mr(_r,yr,xr,Mr,vr,Sr){var wr,br,Ar,kr;return br=_r===10?28:16,vr=_r===10?inetNtop6(vr):inetNtop4(vr),wr=_malloc(br),kr=writeSockaddr(wr,_r,vr,Sr),assert(!kr),Ar=_malloc(32),HEAP32[Ar+4>>2]=_r,HEAP32[Ar+8>>2]=yr,HEAP32[Ar+12>>2]=xr,HEAPU32[Ar+24>>2]=Mr,HEAPU32[Ar+20>>2]=wr,_r===10?HEAP32[Ar+16>>2]=28:HEAP32[Ar+16>>2]=16,HEAP32[Ar+28>>2]=0,Ar}if(I&&(ir=HEAP32[I>>2],lr=HEAP32[I+4>>2],dr=HEAP32[I+8>>2],hr=HEAP32[I+12>>2]),dr&&!hr&&(hr=dr===2?17:6),!dr&&hr&&(dr=hr===17?2:1),hr===0&&(hr=6),dr===0&&(dr=1),!e&&!t)return-2;if(ir&-1088||I!==0&&HEAP32[I>>2]&2&&!e)return-1;if(ir&32)return-2;if(dr!==0&&dr!==1&&dr!==2)return-7;if(lr!==0&&lr!==2&&lr!==10)return-6;if(t&&(t=UTF8ToString(t),rr=parseInt(t,10),isNaN(rr)))return ir&1024?-2:-8;if(!e)return lr===0&&(lr=2),ir&1||(lr===2?tr=_htonl(2130706433):tr=[0,0,0,_htonl(1)]),fr=mr(lr,dr,hr,null,tr,rr),HEAPU32[B>>2]=fr,0;if(e=UTF8ToString(e),tr=inetPton4(e),tr!==null)if(lr===0||lr===2)lr=2;else if(lr===10&&ir&8)tr=[0,0,_htonl(65535),tr],lr=10;else return-2;else if(tr=inetPton6(e),tr!==null)if(lr===0||lr===10)lr=10;else return-2;return tr!=null?(fr=mr(lr,dr,hr,e,tr,rr),HEAPU32[B>>2]=fr,0):ir&4?-2:(e=DNS.lookup_name(e),tr=inetPton4(e),lr===0?lr=2:lr===10&&(tr=[0,0,_htonl(65535),tr]),fr=mr(lr,dr,hr,null,tr,rr),HEAPU32[B>>2]=fr,0)};_getaddrinfo.sig="ipppp";var _getnameinfo=(e,t,I,B,tr,rr,ir)=>{var lr=readSockaddr(e,t);if(lr.errno)return-6;var dr=lr.port,hr=lr.addr,fr=!1;if(I&&B){var mr;if(ir&1||!(mr=DNS.lookup_addr(hr))){if(ir&8)return-2}else hr=mr;var _r=stringToUTF8(hr,I,B);_r+1>=B&&(fr=!0)}if(tr&&rr){dr=""+dr;var _r=stringToUTF8(dr,tr,rr);_r+1>=rr&&(fr=!0)}return fr?-12:0};_getnameinfo.sig="ipipipii";var stringToNewUTF8=e=>{var t=lengthBytesUTF8(e)+1,I=_malloc(t);return I&&stringToUTF8(e,I,t),I},getCFunc=e=>{var t=Module["_"+e];return t},writeArrayToMemory=(e,t)=>{HEAP8.set(e,t)},ccall=(e,t,I,B,tr)=>{var rr={string:xr=>{var Mr=0;return xr!=null&&xr!==0&&(Mr=stringToUTF8OnStack(xr)),Mr},array:xr=>{var Mr=stackAlloc(xr.length);return writeArrayToMemory(xr,Mr),Mr}};function ir(xr){return t==="string"?UTF8ToString(xr):t==="boolean"?!!xr:xr}var lr=getCFunc(e),dr=[],hr=0;if(B)for(var fr=0;fr<B.length;fr++){var mr=rr[I[fr]];mr?(hr===0&&(hr=stackSave()),dr[fr]=mr(B[fr])):dr[fr]=B[fr]}var _r=lr(...dr);function yr(xr){return hr!==0&&stackRestore(hr),ir(xr)}return _r=yr(_r),_r},cwrap=(e,t,I,B)=>{var tr=!I||I.every(ir=>ir==="number"||ir==="boolean"),rr=t!=="string";return rr&&tr&&!B?getCFunc(e):(...ir)=>ccall(e,t,I,ir)},FS_createPath=FS.createPath,FS_unlink=e=>FS.unlink(e),FS_createLazyFile=FS.createLazyFile,FS_createDevice=FS.createDevice,setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;var getTempRet0=e=>__emscripten_tempret_get(),_getTempRet0=getTempRet0;Module._getTempRet0=_getTempRet0,registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_unlink=FS.unlink,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createDevice=FS.createDevice,MEMFS.doesNotExistError=new FS.ErrnoError(44),MEMFS.doesNotExistError.stack="<generic error, no stack>",ENVIRONMENT_IS_NODE&&NODEFS.staticInit(),Module.requestAnimationFrame=MainLoop.requestAnimationFrame,Module.pauseMainLoop=MainLoop.pause,Module.resumeMainLoop=MainLoop.resume,MainLoop.init();var wasmImports={__assert_fail:___assert_fail,__call_sighandler:___call_sighandler,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__syscall__newselect:___syscall__newselect,__syscall_bind:___syscall_bind,__syscall_chdir:___syscall_chdir,__syscall_chmod:___syscall_chmod,__syscall_connect:___syscall_connect,__syscall_dup:___syscall_dup,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fadvise64:___syscall_fadvise64,__syscall_fallocate:___syscall_fallocate,__syscall_fcntl64:___syscall_fcntl64,__syscall_fdatasync:___syscall_fdatasync,__syscall_fstat64:___syscall_fstat64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_getsockname:___syscall_getsockname,__syscall_getsockopt:___syscall_getsockopt,__syscall_ioctl:___syscall_ioctl,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_readlinkat:___syscall_readlinkat,__syscall_recvfrom:___syscall_recvfrom,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,__syscall_stat64:___syscall_stat64,__syscall_symlinkat:___syscall_symlinkat,__syscall_truncate64:___syscall_truncate64,__syscall_unlinkat:___syscall_unlinkat,__table_base:___table_base,_abort_js:__abort_js,_dlopen_js:__dlopen_js,_dlsym_js:__dlsym_js,_emscripten_memcpy_js:__emscripten_memcpy_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_system:__emscripten_system,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mmap_js:__mmap_js,_munmap_js:__munmap_js,_setitimer_js:__setitimer_js,_tzset_js:__tzset_js,clock_time_get:_clock_time_get,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_date_now:_emscripten_date_now,emscripten_force_exit:_emscripten_force_exit,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,emscripten_set_main_loop:_emscripten_set_main_loop,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_pread:_fd_pread,fd_pwrite:_fd_pwrite,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,getTempRet0:_getTempRet0,getaddrinfo:_getaddrinfo,getnameinfo:_getnameinfo,invoke_di,invoke_i,invoke_id,invoke_ii,invoke_iii,invoke_iiii,invoke_iiiii,invoke_iiiiii,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiii,invoke_iiiiiiiiii,invoke_iiiiiiiiiiiiiiiii,invoke_iiiiiji,invoke_iiiij,invoke_iiiijii,invoke_iiij,invoke_iiji,invoke_ij,invoke_ijiiiii,invoke_ijiiiiii,invoke_ji,invoke_jii,invoke_jiiii,invoke_jiiiii,invoke_jiiiiiiii,invoke_v,invoke_vi,invoke_vid,invoke_vii,invoke_viii,invoke_viiii,invoke_viiiii,invoke_viiiiii,invoke_viiiiiii,invoke_viiiiiiii,invoke_viiiiiiiii,invoke_viiiiiiiiiiii,invoke_viiij,invoke_viij,invoke_viiji,invoke_viijii,invoke_viijiiii,invoke_vij,invoke_viji,invoke_vijiji,invoke_vj,invoke_vji,is_web_env,memory:wasmMemory,proc_exit:_proc_exit,setTempRet0:_setTempRet0},wasmExports;createWasm(),Module._ScanKeywordLookup=(e,t)=>(Module._ScanKeywordLookup=wasmExports.ScanKeywordLookup)(e,t),Module._pg_snprintf=(e,t,I,B)=>(Module._pg_snprintf=wasmExports.pg_snprintf)(e,t,I,B),Module._strlen=e=>(Module._strlen=wasmExports.strlen)(e),Module._memset=(e,t,I)=>(Module._memset=wasmExports.memset)(e,t,I),Module._strchr=(e,t)=>(Module._strchr=wasmExports.strchr)(e,t),Module._PQserverVersion=e=>(Module._PQserverVersion=wasmExports.PQserverVersion)(e),Module._strstr=(e,t)=>(Module._strstr=wasmExports.strstr)(e,t),Module._pg_fprintf=(e,t,I)=>(Module._pg_fprintf=wasmExports.pg_fprintf)(e,t,I),Module._strspn=(e,t)=>(Module._strspn=wasmExports.strspn)(e,t);var _malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e);Module._pg_strcasecmp=(e,t)=>(Module._pg_strcasecmp=wasmExports.pg_strcasecmp)(e,t),Module._strcmp=(e,t)=>(Module._strcmp=wasmExports.strcmp)(e,t),Module._free=e=>(Module._free=wasmExports.free)(e),Module._pg_tolower=e=>(Module._pg_tolower=wasmExports.pg_tolower)(e),Module._memchr=(e,t,I)=>(Module._memchr=wasmExports.memchr)(e,t,I),Module._getenv=e=>(Module._getenv=wasmExports.getenv)(e),Module._fileno=e=>(Module._fileno=wasmExports.fileno)(e),Module._isatty=e=>(Module._isatty=wasmExports.isatty)(e),Module._strdup=e=>(Module._strdup=wasmExports.strdup)(e),Module.___errno_location=()=>(Module.___errno_location=wasmExports.__errno_location)();var _fflush=Module._fflush=e=>(_fflush=Module._fflush=wasmExports.fflush)(e);Module._pg_vsnprintf=(e,t,I,B)=>(Module._pg_vsnprintf=wasmExports.pg_vsnprintf)(e,t,I,B),Module._pg_malloc_extended=(e,t)=>(Module._pg_malloc_extended=wasmExports.pg_malloc_extended)(e,t),Module._PageInit=(e,t,I)=>(Module._PageInit=wasmExports.PageInit)(e,t,I),Module._pg_checksum_page=(e,t)=>(Module._pg_checksum_page=wasmExports.pg_checksum_page)(e,t),Module._errstart=(e,t)=>(Module._errstart=wasmExports.errstart)(e,t),Module._errcode=e=>(Module._errcode=wasmExports.errcode)(e),Module._errmsg=(e,t)=>(Module._errmsg=wasmExports.errmsg)(e,t),Module._errfinish=(e,t,I)=>(Module._errfinish=wasmExports.errfinish)(e,t,I),Module._PageAddItemExtended=(e,t,I,B,tr)=>(Module._PageAddItemExtended=wasmExports.PageAddItemExtended)(e,t,I,B,tr),Module._errstart_cold=(e,t)=>(Module._errstart_cold=wasmExports.errstart_cold)(e,t),Module._puts=e=>(Module._puts=wasmExports.puts)(e),Module._errmsg_internal=(e,t)=>(Module._errmsg_internal=wasmExports.errmsg_internal)(e,t),Module._memmove=(e,t,I)=>(Module._memmove=wasmExports.memmove)(e,t,I),Module._memcpy=(e,t,I)=>(Module._memcpy=wasmExports.memcpy)(e,t,I),Module._palloc=e=>(Module._palloc=wasmExports.palloc)(e),Module._pfree=e=>(Module._pfree=wasmExports.pfree)(e),Module._PageGetFreeSpace=e=>(Module._PageGetFreeSpace=wasmExports.PageGetFreeSpace)(e),Module._PageGetExactFreeSpace=e=>(Module._PageGetExactFreeSpace=wasmExports.PageGetExactFreeSpace)(e),Module._PageGetHeapFreeSpace=e=>(Module._PageGetHeapFreeSpace=wasmExports.PageGetHeapFreeSpace)(e),Module._PageIndexMultiDelete=(e,t,I)=>(Module._PageIndexMultiDelete=wasmExports.PageIndexMultiDelete)(e,t,I),Module._PageIndexTupleOverwrite=(e,t,I,B)=>(Module._PageIndexTupleOverwrite=wasmExports.PageIndexTupleOverwrite)(e,t,I,B),Module._ItemPointerEquals=(e,t)=>(Module._ItemPointerEquals=wasmExports.ItemPointerEquals)(e,t),Module._ItemPointerCompare=(e,t)=>(Module._ItemPointerCompare=wasmExports.ItemPointerCompare)(e,t),Module._add_size=(e,t)=>(Module._add_size=wasmExports.add_size)(e,t),Module._ShmemInitStruct=(e,t,I)=>(Module._ShmemInitStruct=wasmExports.ShmemInitStruct)(e,t,I),Module._s_init_lock_sema=(e,t)=>(Module._s_init_lock_sema=wasmExports.s_init_lock_sema)(e,t),Module._LWLockAcquire=(e,t)=>(Module._LWLockAcquire=wasmExports.LWLockAcquire)(e,t),Module._LWLockRelease=e=>(Module._LWLockRelease=wasmExports.LWLockRelease)(e),Module._on_shmem_exit=(e,t)=>(Module._on_shmem_exit=wasmExports.on_shmem_exit)(e,t),Module._tas_sema=e=>(Module._tas_sema=wasmExports.tas_sema)(e),Module._s_lock=(e,t,I,B)=>(Module._s_lock=wasmExports.s_lock)(e,t,I,B),Module._s_unlock_sema=e=>(Module._s_unlock_sema=wasmExports.s_unlock_sema)(e),Module._StartTransactionCommand=()=>(Module._StartTransactionCommand=wasmExports.StartTransactionCommand)(),Module._CommitTransactionCommand=()=>(Module._CommitTransactionCommand=wasmExports.CommitTransactionCommand)(),Module._WaitLatch=(e,t,I,B)=>(Module._WaitLatch=wasmExports.WaitLatch)(e,t,I,B),Module._ResetLatch=e=>(Module._ResetLatch=wasmExports.ResetLatch)(e),Module._ProcessInterrupts=()=>(Module._ProcessInterrupts=wasmExports.ProcessInterrupts)(),Module._MemoryContextAlloc=(e,t)=>(Module._MemoryContextAlloc=wasmExports.MemoryContextAlloc)(e,t),Module._AllocateDir=e=>(Module._AllocateDir=wasmExports.AllocateDir)(e),Module._ReadDir=(e,t)=>(Module._ReadDir=wasmExports.ReadDir)(e,t),Module._strncmp=(e,t,I)=>(Module._strncmp=wasmExports.strncmp)(e,t,I),Module._unlink=e=>(Module._unlink=wasmExports.unlink)(e),Module._errcode_for_file_access=()=>(Module._errcode_for_file_access=wasmExports.errcode_for_file_access)(),Module._FreeDir=e=>(Module._FreeDir=wasmExports.FreeDir)(e),Module._pg_prng_uint32=e=>(Module._pg_prng_uint32=wasmExports.pg_prng_uint32)(e),Module._dsm_create=(e,t)=>(Module._dsm_create=wasmExports.dsm_create)(e,t),Module._dsm_attach=e=>(Module._dsm_attach=wasmExports.dsm_attach)(e),Module._dsm_detach=e=>(Module._dsm_detach=wasmExports.dsm_detach)(e),Module._dsm_segment_address=e=>(Module._dsm_segment_address=wasmExports.dsm_segment_address)(e),Module._dsm_segment_handle=e=>(Module._dsm_segment_handle=wasmExports.dsm_segment_handle)(e),Module._MemoryContextAllocZero=(e,t)=>(Module._MemoryContextAllocZero=wasmExports.MemoryContextAllocZero)(e,t),Module._read=(e,t,I)=>(Module._read=wasmExports.read)(e,t,I),Module._hash_create=(e,t,I,B)=>(Module._hash_create=wasmExports.hash_create)(e,t,I,B),Module._hash_destroy=e=>(Module._hash_destroy=wasmExports.hash_destroy)(e),Module._hash_seq_init=(e,t)=>(Module._hash_seq_init=wasmExports.hash_seq_init)(e,t),Module._hash_seq_search=e=>(Module._hash_seq_search=wasmExports.hash_seq_search)(e),Module._hash_search=(e,t,I,B)=>(Module._hash_search=wasmExports.hash_search)(e,t,I,B),Module._initStringInfo=e=>(Module._initStringInfo=wasmExports.initStringInfo)(e),Module._appendStringInfo=(e,t,I)=>(Module._appendStringInfo=wasmExports.appendStringInfo)(e,t,I),Module._GetCurrentTimestamp=()=>(Module._GetCurrentTimestamp=wasmExports.GetCurrentTimestamp)(),Module._pg_usleep=e=>(Module._pg_usleep=wasmExports.pg_usleep)(e),Module._errdetail=(e,t)=>(Module._errdetail=wasmExports.errdetail)(e,t),Module._TransactionIdDidCommit=e=>(Module._TransactionIdDidCommit=wasmExports.TransactionIdDidCommit)(e),Module._TransactionIdPrecedes=(e,t)=>(Module._TransactionIdPrecedes=wasmExports.TransactionIdPrecedes)(e,t),Module._XLogBeginInsert=()=>(Module._XLogBeginInsert=wasmExports.XLogBeginInsert)(),Module._XLogRegisterData=(e,t)=>(Module._XLogRegisterData=wasmExports.XLogRegisterData)(e,t),Module._XLogInsert=(e,t)=>(Module._XLogInsert=wasmExports.XLogInsert)(e,t),Module._ConditionVariableInit=e=>(Module._ConditionVariableInit=wasmExports.ConditionVariableInit)(e),Module._ConditionVariableCancelSleep=()=>(Module._ConditionVariableCancelSleep=wasmExports.ConditionVariableCancelSleep)(),Module._ConditionVariableSleep=(e,t)=>(Module._ConditionVariableSleep=wasmExports.ConditionVariableSleep)(e,t),Module.___wasm_setjmp=(e,t,I)=>(Module.___wasm_setjmp=wasmExports.__wasm_setjmp)(e,t,I),Module.___wasm_setjmp_test=(e,t)=>(Module.___wasm_setjmp_test=wasmExports.__wasm_setjmp_test)(e,t),Module._pg_re_throw=()=>(Module._pg_re_throw=wasmExports.pg_re_throw)(),Module._emscripten_longjmp=(e,t)=>(Module._emscripten_longjmp=wasmExports.emscripten_longjmp)(e,t),Module._procsignal_sigusr1_handler=e=>(Module._procsignal_sigusr1_handler=wasmExports.procsignal_sigusr1_handler)(e),Module._close=e=>(Module._close=wasmExports.close)(e),Module._ReleaseExternalFD=()=>(Module._ReleaseExternalFD=wasmExports.ReleaseExternalFD)(),Module._fcntl=(e,t,I)=>(Module._fcntl=wasmExports.fcntl)(e,t,I),Module._pqsignal=(e,t)=>(Module._pqsignal=wasmExports.pqsignal)(e,t),Module._write=(e,t,I)=>(Module._write=wasmExports.write)(e,t,I),Module._AddWaitEventToSet=(e,t,I,B,tr)=>(Module._AddWaitEventToSet=wasmExports.AddWaitEventToSet)(e,t,I,B,tr),Module._clock_gettime=(e,t)=>(Module._clock_gettime=wasmExports.clock_gettime)(e,t),Module._poll=(e,t,I)=>(Module._poll=wasmExports.poll)(e,t,I),Module._WaitLatchOrSocket=(e,t,I,B,tr)=>(Module._WaitLatchOrSocket=wasmExports.WaitLatchOrSocket)(e,t,I,B,tr),Module._GetNumRegisteredWaitEvents=e=>(Module._GetNumRegisteredWaitEvents=wasmExports.GetNumRegisteredWaitEvents)(e),Module._ShmemInitHash=(e,t,I,B,tr)=>(Module._ShmemInitHash=wasmExports.ShmemInitHash)(e,t,I,B,tr),Module._InitMaterializedSRF=(e,t)=>(Module._InitMaterializedSRF=wasmExports.InitMaterializedSRF)(e,t),Module._cstring_to_text=e=>(Module._cstring_to_text=wasmExports.cstring_to_text)(e),Module._Int64GetDatum=e=>(Module._Int64GetDatum=wasmExports.Int64GetDatum)(e),Module._tuplestore_putvalues=(e,t,I,B)=>(Module._tuplestore_putvalues=wasmExports.tuplestore_putvalues)(e,t,I,B),Module._shm_toc_allocate=(e,t)=>(Module._shm_toc_allocate=wasmExports.shm_toc_allocate)(e,t),Module._shm_toc_insert=(e,t,I)=>(Module._shm_toc_insert=wasmExports.shm_toc_insert)(e,t,I),Module._shm_toc_lookup=(e,t,I)=>(Module._shm_toc_lookup=wasmExports.shm_toc_lookup)(e,t,I),Module._superuser_arg=e=>(Module._superuser_arg=wasmExports.superuser_arg)(e),Module._superuser=()=>(Module._superuser=wasmExports.superuser)(),Module._GetUserId=()=>(Module._GetUserId=wasmExports.GetUserId)(),Module._has_privs_of_role=(e,t)=>(Module._has_privs_of_role=wasmExports.has_privs_of_role)(e,t),Module._errmsg_plural=(e,t,I,B)=>(Module._errmsg_plural=wasmExports.errmsg_plural)(e,t,I,B),Module._errhint=(e,t)=>(Module._errhint=wasmExports.errhint)(e,t),Module._fstat=(e,t)=>(Module._fstat=wasmExports.fstat)(e,t),Module._ftruncate=(e,t)=>(Module._ftruncate=wasmExports.ftruncate)(e,t),Module._RequestAddinShmemSpace=e=>(Module._RequestAddinShmemSpace=wasmExports.RequestAddinShmemSpace)(e),Module._hash_estimate_size=(e,t)=>(Module._hash_estimate_size=wasmExports.hash_estimate_size)(e,t),Module._pg_sprintf=(e,t,I)=>(Module._pg_sprintf=wasmExports.pg_sprintf)(e,t,I),Module._SetConfigOption=(e,t,I,B)=>(Module._SetConfigOption=wasmExports.SetConfigOption)(e,t,I,B),Module._pg_printf=(e,t)=>(Module._pg_printf=wasmExports.pg_printf)(e,t),Module._before_shmem_exit=(e,t)=>(Module._before_shmem_exit=wasmExports.before_shmem_exit)(e,t),Module._cancel_before_shmem_exit=(e,t)=>(Module._cancel_before_shmem_exit=wasmExports.cancel_before_shmem_exit)(e,t),Module._pg_qsort=(e,t,I,B)=>(Module._pg_qsort=wasmExports.pg_qsort)(e,t,I,B),Module._TransactionIdIsInProgress=e=>(Module._TransactionIdIsInProgress=wasmExports.TransactionIdIsInProgress)(e),Module._TransactionIdIsCurrentTransactionId=e=>(Module._TransactionIdIsCurrentTransactionId=wasmExports.TransactionIdIsCurrentTransactionId)(e),Module._RecoveryInProgress=()=>(Module._RecoveryInProgress=wasmExports.RecoveryInProgress)(),Module._GetOldestNonRemovableTransactionId=e=>(Module._GetOldestNonRemovableTransactionId=wasmExports.GetOldestNonRemovableTransactionId)(e),Module._GetCurrentCommandId=e=>(Module._GetCurrentCommandId=wasmExports.GetCurrentCommandId)(e),Module._BackendXidGetPid=e=>(Module._BackendXidGetPid=wasmExports.BackendXidGetPid)(e),Module._lappend_int=(e,t)=>(Module._lappend_int=wasmExports.lappend_int)(e,t),Module._index_close=(e,t)=>(Module._index_close=wasmExports.index_close)(e,t),Module._table_close=(e,t)=>(Module._table_close=wasmExports.table_close)(e,t),Module._CommandCounterIncrement=()=>(Module._CommandCounterIncrement=wasmExports.CommandCounterIncrement)(),Module._GetActiveSnapshot=()=>(Module._GetActiveSnapshot=wasmExports.GetActiveSnapshot)(),Module._ScanKeyInit=(e,t,I,B,tr)=>(Module._ScanKeyInit=wasmExports.ScanKeyInit)(e,t,I,B,tr),Module._table_open=(e,t)=>(Module._table_open=wasmExports.table_open)(e,t),Module._systable_beginscan=(e,t,I,B,tr,rr)=>(Module._systable_beginscan=wasmExports.systable_beginscan)(e,t,I,B,tr,rr),Module._systable_getnext=e=>(Module._systable_getnext=wasmExports.systable_getnext)(e),Module._systable_endscan=e=>(Module._systable_endscan=wasmExports.systable_endscan)(e),Module._index_open=(e,t)=>(Module._index_open=wasmExports.index_open)(e,t),Module._systable_beginscan_ordered=(e,t,I,B,tr)=>(Module._systable_beginscan_ordered=wasmExports.systable_beginscan_ordered)(e,t,I,B,tr),Module._systable_getnext_ordered=(e,t)=>(Module._systable_getnext_ordered=wasmExports.systable_getnext_ordered)(e,t),Module._systable_endscan_ordered=e=>(Module._systable_endscan_ordered=wasmExports.systable_endscan_ordered)(e),Module._heap_form_tuple=(e,t,I)=>(Module._heap_form_tuple=wasmExports.heap_form_tuple)(e,t,I),Module._heap_freetuple=e=>(Module._heap_freetuple=wasmExports.heap_freetuple)(e),Module._AllocSetContextCreateInternal=(e,t,I,B,tr)=>(Module._AllocSetContextCreateInternal=wasmExports.AllocSetContextCreateInternal)(e,t,I,B,tr),Module._list_free_deep=e=>(Module._list_free_deep=wasmExports.list_free_deep)(e),Module._lappend=(e,t)=>(Module._lappend=wasmExports.lappend)(e,t),Module._LockBuffer=(e,t)=>(Module._LockBuffer=wasmExports.LockBuffer)(e,t),Module._GetFreeIndexPage=e=>(Module._GetFreeIndexPage=wasmExports.GetFreeIndexPage)(e),Module._RecordFreeIndexPage=(e,t)=>(Module._RecordFreeIndexPage=wasmExports.RecordFreeIndexPage)(e,t),Module._IndexFreeSpaceMapVacuum=e=>(Module._IndexFreeSpaceMapVacuum=wasmExports.IndexFreeSpaceMapVacuum)(e),Module._UnlockReleaseBuffer=e=>(Module._UnlockReleaseBuffer=wasmExports.UnlockReleaseBuffer)(e),Module._smgropen=(e,t)=>(Module._smgropen=wasmExports.smgropen)(e,t),Module._smgrsetowner=(e,t)=>(Module._smgrsetowner=wasmExports.smgrsetowner)(e,t),Module._RelationGetNumberOfBlocksInFork=(e,t)=>(Module._RelationGetNumberOfBlocksInFork=wasmExports.RelationGetNumberOfBlocksInFork)(e,t),Module._ReleaseBuffer=e=>(Module._ReleaseBuffer=wasmExports.ReleaseBuffer)(e),Module._GetRecordedFreeSpace=(e,t)=>(Module._GetRecordedFreeSpace=wasmExports.GetRecordedFreeSpace)(e,t),Module._smgrexists=(e,t)=>(Module._smgrexists=wasmExports.smgrexists)(e,t),Module._ReadBufferExtended=(e,t,I,B,tr)=>(Module._ReadBufferExtended=wasmExports.ReadBufferExtended)(e,t,I,B,tr),Module._MarkBufferDirty=e=>(Module._MarkBufferDirty=wasmExports.MarkBufferDirty)(e),Module._log_newpage_buffer=(e,t)=>(Module._log_newpage_buffer=wasmExports.log_newpage_buffer)(e,t),Module._copy_file=(e,t)=>(Module._copy_file=wasmExports.copy_file)(e,t),Module._fd_fsync_fname=(e,t)=>(Module._fd_fsync_fname=wasmExports.fd_fsync_fname)(e,t),Module._OpenTransientFile=(e,t)=>(Module._OpenTransientFile=wasmExports.OpenTransientFile)(e,t),Module._CloseTransientFile=e=>(Module._CloseTransientFile=wasmExports.CloseTransientFile)(e),Module._hash_bytes=(e,t)=>(Module._hash_bytes=wasmExports.hash_bytes)(e,t),Module._pstrdup=e=>(Module._pstrdup=wasmExports.pstrdup)(e),Module._repalloc=(e,t)=>(Module._repalloc=wasmExports.repalloc)(e,t),Module._wasm_OpenPipeStream=(e,t)=>(Module._wasm_OpenPipeStream=wasmExports.wasm_OpenPipeStream)(e,t),Module._access=(e,t)=>(Module._access=wasmExports.access)(e,t),Module._fopen=(e,t)=>(Module._fopen=wasmExports.fopen)(e,t),Module._fiprintf=(e,t,I)=>(Module._fiprintf=wasmExports.fiprintf)(e,t,I),Module._fclose=e=>(Module._fclose=wasmExports.fclose)(e),Module._fsync_fname_ext=(e,t,I,B)=>(Module._fsync_fname_ext=wasmExports.fsync_fname_ext)(e,t,I,B),Module._fd_durable_rename=(e,t,I)=>(Module._fd_durable_rename=wasmExports.fd_durable_rename)(e,t,I),Module._rename=(e,t)=>(Module._rename=wasmExports.rename)(e,t),Module._strlcpy=(e,t,I)=>(Module._strlcpy=wasmExports.strlcpy)(e,t,I),Module._dup=e=>(Module._dup=wasmExports.dup)(e),Module._open=(e,t,I)=>(Module._open=wasmExports.open)(e,t,I),Module._AcquireExternalFD=()=>(Module._AcquireExternalFD=wasmExports.AcquireExternalFD)(),Module._realloc=(e,t)=>(Module._realloc=wasmExports.realloc)(e,t),Module._stat=(e,t)=>(Module._stat=wasmExports.stat)(e,t),Module._pwrite=(e,t,I,B)=>(Module._pwrite=wasmExports.pwrite)(e,t,I,B),Module._lseek=(e,t,I)=>(Module._lseek=wasmExports.lseek)(e,t,I),Module._AllocateFile=(e,t)=>(Module._AllocateFile=wasmExports.AllocateFile)(e,t),Module._GetCurrentSubTransactionId=()=>(Module._GetCurrentSubTransactionId=wasmExports.GetCurrentSubTransactionId)(),Module._FreeFile=e=>(Module._FreeFile=wasmExports.FreeFile)(e),Module._pclose=e=>(Module._pclose=wasmExports.pclose)(e),Module._ClosePipeStream=e=>(Module._ClosePipeStream=wasmExports.ClosePipeStream)(e),Module._pg_prng_uint64_range=(e,t,I)=>(Module._pg_prng_uint64_range=wasmExports.pg_prng_uint64_range)(e,t,I),Module._AtEOSubXact_Files=(e,t,I)=>(Module._AtEOSubXact_Files=wasmExports.AtEOSubXact_Files)(e,t,I),Module._pre_format_elog_string=(e,t)=>(Module._pre_format_elog_string=wasmExports.pre_format_elog_string)(e,t),Module._format_elog_string=(e,t)=>(Module._format_elog_string=wasmExports.format_elog_string)(e,t),Module._list_free=e=>(Module._list_free=wasmExports.list_free)(e),Module._guc_malloc=(e,t)=>(Module._guc_malloc=wasmExports.guc_malloc)(e,t),Module._MemoryContextDelete=e=>(Module._MemoryContextDelete=wasmExports.MemoryContextDelete)(e),Module._strtoul=(e,t,I)=>(Module._strtoul=wasmExports.strtoul)(e,t,I),Module._hash_get_num_entries=e=>(Module._hash_get_num_entries=wasmExports.hash_get_num_entries)(e),Module._LWLockInitialize=(e,t)=>(Module._LWLockInitialize=wasmExports.LWLockInitialize)(e,t),Module._PrefetchBuffer=(e,t,I,B)=>(Module._PrefetchBuffer=wasmExports.PrefetchBuffer)(e,t,I,B),Module._LockBufHdr=e=>(Module._LockBufHdr=wasmExports.LockBufHdr)(e),Module._ReadBuffer=(e,t)=>(Module._ReadBuffer=wasmExports.ReadBuffer)(e,t),Module._pgstat_assoc_relation=e=>(Module._pgstat_assoc_relation=wasmExports.pgstat_assoc_relation)(e),Module._ExtendBufferedRel=(e,t,I,B)=>(Module._ExtendBufferedRel=wasmExports.ExtendBufferedRel)(e,t,I,B),Module._LockBufferForCleanup=e=>(Module._LockBufferForCleanup=wasmExports.LockBufferForCleanup)(e),Module._smgrread=(e,t,I,B)=>(Module._smgrread=wasmExports.smgrread)(e,t,I,B),Module._LockRelationForExtension=(e,t)=>(Module._LockRelationForExtension=wasmExports.LockRelationForExtension)(e,t),Module._UnlockRelationForExtension=(e,t)=>(Module._UnlockRelationForExtension=wasmExports.UnlockRelationForExtension)(e,t),Module._BufferGetBlockNumber=e=>(Module._BufferGetBlockNumber=wasmExports.BufferGetBlockNumber)(e),Module._bsearch=(e,t,I,B,tr)=>(Module._bsearch=wasmExports.bsearch)(e,t,I,B,tr),Module._set_errcontext_domain=e=>(Module._set_errcontext_domain=wasmExports.set_errcontext_domain)(e),Module._errcontext_msg=(e,t)=>(Module._errcontext_msg=wasmExports.errcontext_msg)(e,t),Module._GetAccessStrategy=e=>(Module._GetAccessStrategy=wasmExports.GetAccessStrategy)(e),Module._FreeAccessStrategy=e=>(Module._FreeAccessStrategy=wasmExports.FreeAccessStrategy)(e),Module._ConditionalLockBuffer=e=>(Module._ConditionalLockBuffer=wasmExports.ConditionalLockBuffer)(e),Module._TestForOldSnapshot_impl=(e,t)=>(Module._TestForOldSnapshot_impl=wasmExports.TestForOldSnapshot_impl)(e,t);var _calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t);Module._have_free_buffer=()=>(Module._have_free_buffer=wasmExports.have_free_buffer)(),Module._palloc0=e=>(Module._palloc0=wasmExports.palloc0)(e),Module._resetStringInfo=e=>(Module._resetStringInfo=wasmExports.resetStringInfo)(e),Module._appendStringInfoChar=(e,t)=>(Module._appendStringInfoChar=wasmExports.appendStringInfoChar)(e,t),Module._appendBinaryStringInfo=(e,t,I)=>(Module._appendBinaryStringInfo=wasmExports.appendBinaryStringInfo)(e,t,I),Module._errdetail_internal=(e,t)=>(Module._errdetail_internal=wasmExports.errdetail_internal)(e,t),Module._strcpy=(e,t)=>(Module._strcpy=wasmExports.strcpy)(e,t),Module._LWLockRegisterTranche=(e,t)=>(Module._LWLockRegisterTranche=wasmExports.LWLockRegisterTranche)(e,t),Module._GetNamedLWLockTranche=e=>(Module._GetNamedLWLockTranche=wasmExports.GetNamedLWLockTranche)(e),Module._LWLockNewTrancheId=()=>(Module._LWLockNewTrancheId=wasmExports.LWLockNewTrancheId)(),Module._RequestNamedLWLockTranche=(e,t)=>(Module._RequestNamedLWLockTranche=wasmExports.RequestNamedLWLockTranche)(e,t),Module._pg_prng_double=e=>(Module._pg_prng_double=wasmExports.pg_prng_double)(e),Module._getpid=()=>(Module._getpid=wasmExports.getpid)(),Module._GetTransactionSnapshot=()=>(Module._GetTransactionSnapshot=wasmExports.GetTransactionSnapshot)(),Module._ConditionVariableSignal=e=>(Module._ConditionVariableSignal=wasmExports.ConditionVariableSignal)(e),Module._LockPage=(e,t,I)=>(Module._LockPage=wasmExports.LockPage)(e,t,I),Module._UnlockPage=(e,t,I)=>(Module._UnlockPage=wasmExports.UnlockPage)(e,t,I),Module._pgstat_progress_update_param=(e,t)=>(Module._pgstat_progress_update_param=wasmExports.pgstat_progress_update_param)(e,t),Module._list_make1_impl=(e,t)=>(Module._list_make1_impl=wasmExports.list_make1_impl)(e,t),Module._psprintf=(e,t)=>(Module._psprintf=wasmExports.psprintf)(e,t),Module._smgrtruncate=(e,t,I,B)=>(Module._smgrtruncate=wasmExports.smgrtruncate)(e,t,I,B),Module._log=e=>(Module._log=wasmExports.log)(e),Module._pairingheap_allocate=(e,t)=>(Module._pairingheap_allocate=wasmExports.pairingheap_allocate)(e,t),Module._pairingheap_add=(e,t)=>(Module._pairingheap_add=wasmExports.pairingheap_add)(e,t),Module._pairingheap_first=e=>(Module._pairingheap_first=wasmExports.pairingheap_first)(e),Module._pairingheap_remove_first=e=>(Module._pairingheap_remove_first=wasmExports.pairingheap_remove_first)(e),Module._bloom_create=(e,t,I)=>(Module._bloom_create=wasmExports.bloom_create)(e,t,I),Module._bloom_free=e=>(Module._bloom_free=wasmExports.bloom_free)(e),Module._bloom_add_element=(e,t,I)=>(Module._bloom_add_element=wasmExports.bloom_add_element)(e,t,I),Module._hash_bytes_extended=(e,t,I)=>(Module._hash_bytes_extended=wasmExports.hash_bytes_extended)(e,t,I),Module._bloom_lacks_element=(e,t,I)=>(Module._bloom_lacks_element=wasmExports.bloom_lacks_element)(e,t,I),Module._bloom_prop_bits_set=e=>(Module._bloom_prop_bits_set=wasmExports.bloom_prop_bits_set)(e),Module._pg_popcount=(e,t)=>(Module._pg_popcount=wasmExports.pg_popcount)(e,t),Module._memcmp=(e,t,I)=>(Module._memcmp=wasmExports.memcmp)(e,t,I),Module._bms_make_singleton=e=>(Module._bms_make_singleton=wasmExports.bms_make_singleton)(e),Module._bms_add_members=(e,t)=>(Module._bms_add_members=wasmExports.bms_add_members)(e,t),Module._bms_add_member=(e,t)=>(Module._bms_add_member=wasmExports.bms_add_member)(e,t),Module._bms_del_member=(e,t)=>(Module._bms_del_member=wasmExports.bms_del_member)(e,t),Module._check_stack_depth=()=>(Module._check_stack_depth=wasmExports.check_stack_depth)(),Module._parser_errposition=(e,t)=>(Module._parser_errposition=wasmExports.parser_errposition)(e,t),Module._makeVar=(e,t,I,B,tr,rr)=>(Module._makeVar=wasmExports.makeVar)(e,t,I,B,tr,rr),Module._bms_union=(e,t)=>(Module._bms_union=wasmExports.bms_union)(e,t),Module._varstr_levenshtein_less_equal=(e,t,I,B,tr,rr,ir,lr,dr)=>(Module._varstr_levenshtein_less_equal=wasmExports.varstr_levenshtein_less_equal)(e,t,I,B,tr,rr,ir,lr,dr),Module._SearchSysCacheExists=(e,t,I,B,tr)=>(Module._SearchSysCacheExists=wasmExports.SearchSysCacheExists)(e,t,I,B,tr),Module._MemoryContextAllocZeroAligned=(e,t)=>(Module._MemoryContextAllocZeroAligned=wasmExports.MemoryContextAllocZeroAligned)(e,t),Module._makeString=e=>(Module._makeString=wasmExports.makeString)(e),Module._addRTEPermissionInfo=(e,t)=>(Module._addRTEPermissionInfo=wasmExports.addRTEPermissionInfo)(e,t),Module._copyObjectImpl=e=>(Module._copyObjectImpl=wasmExports.copyObjectImpl)(e),Module._exprType=e=>(Module._exprType=wasmExports.exprType)(e),Module._lappend_oid=(e,t)=>(Module._lappend_oid=wasmExports.lappend_oid)(e,t),Module._exprTypmod=e=>(Module._exprTypmod=wasmExports.exprTypmod)(e),Module._exprLocation=e=>(Module._exprLocation=wasmExports.exprLocation)(e),Module._CreateTemplateTupleDesc=e=>(Module._CreateTemplateTupleDesc=wasmExports.CreateTemplateTupleDesc)(e),Module._TupleDescInitEntry=(e,t,I,B,tr,rr)=>(Module._TupleDescInitEntry=wasmExports.TupleDescInitEntry)(e,t,I,B,tr,rr),Module._TupleDescInitEntryCollation=(e,t,I)=>(Module._TupleDescInitEntryCollation=wasmExports.TupleDescInitEntryCollation)(e,t,I),Module._typenameTypeIdAndMod=(e,t,I,B)=>(Module._typenameTypeIdAndMod=wasmExports.typenameTypeIdAndMod)(e,t,I,B),Module._format_type_be=e=>(Module._format_type_be=wasmExports.format_type_be)(e),Module._list_concat=(e,t)=>(Module._list_concat=wasmExports.list_concat)(e,t),Module._list_copy=e=>(Module._list_copy=wasmExports.list_copy)(e),Module._relation_open=(e,t)=>(Module._relation_open=wasmExports.relation_open)(e,t),Module._relation_close=(e,t)=>(Module._relation_close=wasmExports.relation_close)(e,t),Module._makeTargetEntry=(e,t,I,B)=>(Module._makeTargetEntry=wasmExports.makeTargetEntry)(e,t,I,B),Module._get_attname=(e,t,I)=>(Module._get_attname=wasmExports.get_attname)(e,t,I),Module._SearchSysCache2=(e,t,I)=>(Module._SearchSysCache2=wasmExports.SearchSysCache2)(e,t,I),Module._ReleaseSysCache=e=>(Module._ReleaseSysCache=wasmExports.ReleaseSysCache)(e),Module._RangeVarGetRelidExtended=(e,t,I,B,tr)=>(Module._RangeVarGetRelidExtended=wasmExports.RangeVarGetRelidExtended)(e,t,I,B,tr),Module._pg_mbstrlen_with_len=(e,t)=>(Module._pg_mbstrlen_with_len=wasmExports.pg_mbstrlen_with_len)(e,t),Module._errposition=e=>(Module._errposition=wasmExports.errposition)(e),Module._numeric_in=e=>(Module._numeric_in=wasmExports.numeric_in)(e),Module._DirectFunctionCall3Coll=(e,t,I,B,tr)=>(Module._DirectFunctionCall3Coll=wasmExports.DirectFunctionCall3Coll)(e,t,I,B,tr),Module._bit_in=e=>(Module._bit_in=wasmExports.bit_in)(e),Module._NameListToString=e=>(Module._NameListToString=wasmExports.NameListToString)(e),Module._appendStringInfoString=(e,t)=>(Module._appendStringInfoString=wasmExports.appendStringInfoString)(e,t),Module._lookup_type_cache=(e,t)=>(Module._lookup_type_cache=wasmExports.lookup_type_cache)(e,t),Module._CacheRegisterSyscacheCallback=(e,t,I)=>(Module._CacheRegisterSyscacheCallback=wasmExports.CacheRegisterSyscacheCallback)(e,t,I),Module._SearchSysCache1=(e,t)=>(Module._SearchSysCache1=wasmExports.SearchSysCache1)(e,t),Module._list_make2_impl=(e,t,I)=>(Module._list_make2_impl=wasmExports.list_make2_impl)(e,t,I),Module._get_base_element_type=e=>(Module._get_base_element_type=wasmExports.get_base_element_type)(e),Module._downcase_truncate_identifier=(e,t,I)=>(Module._downcase_truncate_identifier=wasmExports.downcase_truncate_identifier)(e,t,I),Module._pg_database_encoding_max_length=()=>(Module._pg_database_encoding_max_length=wasmExports.pg_database_encoding_max_length)(),Module._truncate_identifier=(e,t,I)=>(Module._truncate_identifier=wasmExports.truncate_identifier)(e,t,I),Module._scanner_isspace=e=>(Module._scanner_isspace=wasmExports.scanner_isspace)(e),Module._get_typcollation=e=>(Module._get_typcollation=wasmExports.get_typcollation)(e),Module._list_delete_cell=(e,t)=>(Module._list_delete_cell=wasmExports.list_delete_cell)(e,t),Module._makeTypeNameFromNameList=e=>(Module._makeTypeNameFromNameList=wasmExports.makeTypeNameFromNameList)(e),Module._SysCacheGetAttrNotNull=(e,t,I)=>(Module._SysCacheGetAttrNotNull=wasmExports.SysCacheGetAttrNotNull)(e,t,I),Module._text_to_cstring=e=>(Module._text_to_cstring=wasmExports.text_to_cstring)(e),Module._stringToNode=e=>(Module._stringToNode=wasmExports.stringToNode)(e),Module._bms_is_member=(e,t)=>(Module._bms_is_member=wasmExports.bms_is_member)(e,t),Module._bms_free=e=>(Module._bms_free=wasmExports.bms_free)(e),Module._core_yylex=(e,t,I)=>(Module._core_yylex=wasmExports.core_yylex)(e,t,I),Module._getc=e=>(Module._getc=wasmExports.getc)(e),Module._ferror=e=>(Module._ferror=wasmExports.ferror)(e),Module._fread=(e,t,I,B)=>(Module._fread=wasmExports.fread)(e,t,I,B),Module._clearerr=e=>(Module._clearerr=wasmExports.clearerr)(e),Module._scanner_init=(e,t,I,B)=>(Module._scanner_init=wasmExports.scanner_init)(e,t,I,B),Module._scanner_finish=e=>(Module._scanner_finish=wasmExports.scanner_finish)(e),Module._get_namespace_name=e=>(Module._get_namespace_name=wasmExports.get_namespace_name)(e),Module._lookup_rowtype_tupdesc=(e,t)=>(Module._lookup_rowtype_tupdesc=wasmExports.lookup_rowtype_tupdesc)(e,t),Module._DecrTupleDescRefCount=e=>(Module._DecrTupleDescRefCount=wasmExports.DecrTupleDescRefCount)(e),Module._relation_openrv=(e,t)=>(Module._relation_openrv=wasmExports.relation_openrv)(e,t),Module._errdetail_relkind_not_supported=e=>(Module._errdetail_relkind_not_supported=wasmExports.errdetail_relkind_not_supported)(e),Module._object_aclcheck=(e,t,I,B)=>(Module._object_aclcheck=wasmExports.object_aclcheck)(e,t,I,B),Module._aclcheck_error=(e,t,I)=>(Module._aclcheck_error=wasmExports.aclcheck_error)(e,t,I),Module._pg_class_aclcheck=(e,t,I)=>(Module._pg_class_aclcheck=wasmExports.pg_class_aclcheck)(e,t,I),Module._get_relkind_objtype=e=>(Module._get_relkind_objtype=wasmExports.get_relkind_objtype)(e),Module._list_make3_impl=(e,t,I,B)=>(Module._list_make3_impl=wasmExports.list_make3_impl)(e,t,I,B),Module._quote_qualified_identifier=(e,t)=>(Module._quote_qualified_identifier=wasmExports.quote_qualified_identifier)(e,t),Module._table_openrv=(e,t)=>(Module._table_openrv=wasmExports.table_openrv)(e,t),Module._equal=(e,t)=>(Module._equal=wasmExports.equal)(e,t),Module._RelationGetIndexList=e=>(Module._RelationGetIndexList=wasmExports.RelationGetIndexList)(e),Module._pg_detoast_datum=e=>(Module._pg_detoast_datum=wasmExports.pg_detoast_datum)(e),Module._SysCacheGetAttr=(e,t,I,B)=>(Module._SysCacheGetAttr=wasmExports.SysCacheGetAttr)(e,t,I,B),Module._deconstruct_array_builtin=(e,t,I,B,tr)=>(Module._deconstruct_array_builtin=wasmExports.deconstruct_array_builtin)(e,t,I,B,tr),Module._untransformRelOptions=e=>(Module._untransformRelOptions=wasmExports.untransformRelOptions)(e),Module._transformExpr=(e,t,I)=>(Module._transformExpr=wasmExports.transformExpr)(e,t,I),Module._get_rel_namespace=e=>(Module._get_rel_namespace=wasmExports.get_rel_namespace)(e),Module._get_rel_name=e=>(Module._get_rel_name=wasmExports.get_rel_name)(e),Module._makeRangeVar=(e,t,I)=>(Module._makeRangeVar=wasmExports.makeRangeVar)(e,t,I),Module._makeDefElem=(e,t,I)=>(Module._makeDefElem=wasmExports.makeDefElem)(e,t,I),Module._makeRangeVarFromNameList=e=>(Module._makeRangeVarFromNameList=wasmExports.makeRangeVarFromNameList)(e),Module._coerce_to_target_type=(e,t,I,B,tr,rr,ir,lr)=>(Module._coerce_to_target_type=wasmExports.coerce_to_target_type)(e,t,I,B,tr,rr,ir,lr),Module._LookupTypeName=(e,t,I,B)=>(Module._LookupTypeName=wasmExports.LookupTypeName)(e,t,I,B),Module._GetSysCacheOid=(e,t,I,B,tr,rr)=>(Module._GetSysCacheOid=wasmExports.GetSysCacheOid)(e,t,I,B,tr,rr),Module._construct_array_builtin=(e,t,I)=>(Module._construct_array_builtin=wasmExports.construct_array_builtin)(e,t,I),Module._get_collation_oid=(e,t)=>(Module._get_collation_oid=wasmExports.get_collation_oid)(e,t),Module._typeStringToTypeName=(e,t)=>(Module._typeStringToTypeName=wasmExports.typeStringToTypeName)(e,t),Module._raw_parser=(e,t)=>(Module._raw_parser=wasmExports.raw_parser)(e,t),Module._errsave_start=(e,t)=>(Module._errsave_start=wasmExports.errsave_start)(e,t),Module._errsave_finish=(e,t,I,B)=>(Module._errsave_finish=wasmExports.errsave_finish)(e,t,I,B),Module._defGetBoolean=e=>(Module._defGetBoolean=wasmExports.defGetBoolean)(e),Module._list_delete_last=e=>(Module._list_delete_last=wasmExports.list_delete_last)(e),Module._format_type_with_typemod=(e,t)=>(Module._format_type_with_typemod=wasmExports.format_type_with_typemod)(e,t),Module._list_member=(e,t)=>(Module._list_member=wasmExports.list_member)(e,t),Module._list_member_int=(e,t)=>(Module._list_member_int=wasmExports.list_member_int)(e,t),Module._list_sort=(e,t)=>(Module._list_sort=wasmExports.list_sort)(e,t),Module._get_element_type=e=>(Module._get_element_type=wasmExports.get_element_type)(e),Module._makeBoolean=e=>(Module._makeBoolean=wasmExports.makeBoolean)(e),Module._makeInteger=e=>(Module._makeInteger=wasmExports.makeInteger)(e),Module._makeTypeName=e=>(Module._makeTypeName=wasmExports.makeTypeName)(e),Module._list_make4_impl=(e,t,I,B,tr)=>(Module._list_make4_impl=wasmExports.list_make4_impl)(e,t,I,B,tr),Module._isxdigit=e=>(Module._isxdigit=wasmExports.isxdigit)(e),Module._strip_implicit_coercions=e=>(Module._strip_implicit_coercions=wasmExports.strip_implicit_coercions)(e),Module._SearchSysCacheList=(e,t,I,B,tr)=>(Module._SearchSysCacheList=wasmExports.SearchSysCacheList)(e,t,I,B,tr),Module._ReleaseCatCacheList=e=>(Module._ReleaseCatCacheList=wasmExports.ReleaseCatCacheList)(e),Module._get_sortgroupref_tle=(e,t)=>(Module._get_sortgroupref_tle=wasmExports.get_sortgroupref_tle)(e,t),Module._type_is_rowtype=e=>(Module._type_is_rowtype=wasmExports.type_is_rowtype)(e),Module._bms_next_member=(e,t)=>(Module._bms_next_member=wasmExports.bms_next_member)(e,t),Module._MemoryContextReset=e=>(Module._MemoryContextReset=wasmExports.MemoryContextReset)(e),Module._abort=()=>(Module._abort=wasmExports.abort)(),Module._heap_getnext=(e,t)=>(Module._heap_getnext=wasmExports.heap_getnext)(e,t),Module._OidOutputFunctionCall=(e,t)=>(Module._OidOutputFunctionCall=wasmExports.OidOutputFunctionCall)(e,t),Module._atoi=e=>(Module._atoi=wasmExports.atoi)(e),Module._GetConfigOption=(e,t,I)=>(Module._GetConfigOption=wasmExports.GetConfigOption)(e,t,I),Module._pg_strong_random=(e,t)=>(Module._pg_strong_random=wasmExports.pg_strong_random)(e,t),Module._pg_prng_seed_check=e=>(Module._pg_prng_seed_check=wasmExports.pg_prng_seed_check)(e),Module._pg_prng_seed=(e,t)=>(Module._pg_prng_seed=wasmExports.pg_prng_seed)(e,t),Module._fputc=(e,t)=>(Module._fputc=wasmExports.fputc)(e,t),Module._time=e=>(Module._time=wasmExports.time)(e),Module._TimestampDifferenceMilliseconds=(e,t)=>(Module._TimestampDifferenceMilliseconds=wasmExports.TimestampDifferenceMilliseconds)(e,t),Module._ProcessConfigFile=e=>(Module._ProcessConfigFile=wasmExports.ProcessConfigFile)(e),Module._send=(e,t,I,B)=>(Module._send=wasmExports.send)(e,t,I,B),Module._parse_bool=(e,t)=>(Module._parse_bool=wasmExports.parse_bool)(e,t),Module._enlargeStringInfo=(e,t)=>(Module._enlargeStringInfo=wasmExports.enlargeStringInfo)(e,t),Module._BackgroundWorkerInitializeConnectionByOid=(e,t,I)=>(Module._BackgroundWorkerInitializeConnectionByOid=wasmExports.BackgroundWorkerInitializeConnectionByOid)(e,t,I),Module._BackgroundWorkerUnblockSignals=()=>(Module._BackgroundWorkerUnblockSignals=wasmExports.BackgroundWorkerUnblockSignals)(),Module._pg_getnameinfo_all=(e,t,I,B,tr,rr,ir)=>(Module._pg_getnameinfo_all=wasmExports.pg_getnameinfo_all)(e,t,I,B,tr,rr,ir),Module._gai_strerror=e=>(Module._gai_strerror=wasmExports.gai_strerror)(e),Module._SignalHandlerForConfigReload=e=>(Module._SignalHandlerForConfigReload=wasmExports.SignalHandlerForConfigReload)(e),Module._fwrite=(e,t,I,B)=>(Module._fwrite=wasmExports.fwrite)(e,t,I,B),Module._SignalHandlerForShutdownRequest=e=>(Module._SignalHandlerForShutdownRequest=wasmExports.SignalHandlerForShutdownRequest)(e),Module._EmitErrorReport=()=>(Module._EmitErrorReport=wasmExports.EmitErrorReport)(),Module._FlushErrorState=()=>(Module._FlushErrorState=wasmExports.FlushErrorState)(),Module._die=e=>(Module._die=wasmExports.die)(e),Module._MultiXactIdPrecedes=(e,t)=>(Module._MultiXactIdPrecedes=wasmExports.MultiXactIdPrecedes)(e,t),Module._CreateTupleDescCopy=e=>(Module._CreateTupleDescCopy=wasmExports.CreateTupleDescCopy)(e),Module._pgstat_report_activity=(e,t)=>(Module._pgstat_report_activity=wasmExports.pgstat_report_activity)(e,t),Module._DirectFunctionCall2Coll=(e,t,I,B)=>(Module._DirectFunctionCall2Coll=wasmExports.DirectFunctionCall2Coll)(e,t,I,B),Module._RegisterBackgroundWorker=e=>(Module._RegisterBackgroundWorker=wasmExports.RegisterBackgroundWorker)(e),Module._RegisterDynamicBackgroundWorker=(e,t)=>(Module._RegisterDynamicBackgroundWorker=wasmExports.RegisterDynamicBackgroundWorker)(e,t),Module._WaitForBackgroundWorkerStartup=(e,t)=>(Module._WaitForBackgroundWorkerStartup=wasmExports.WaitForBackgroundWorkerStartup)(e,t),Module._WaitForBackgroundWorkerShutdown=e=>(Module._WaitForBackgroundWorkerShutdown=wasmExports.WaitForBackgroundWorkerShutdown)(e),Module._GetXLogReplayRecPtr=e=>(Module._GetXLogReplayRecPtr=wasmExports.GetXLogReplayRecPtr)(e),Module._gettimeofday=(e,t)=>(Module._gettimeofday=wasmExports.gettimeofday)(e,t),Module._sscanf=(e,t,I)=>(Module._sscanf=wasmExports.sscanf)(e,t,I),Module._get_call_result_type=(e,t,I)=>(Module._get_call_result_type=wasmExports.get_call_result_type)(e,t,I),Module._HeapTupleHeaderGetDatum=e=>(Module._HeapTupleHeaderGetDatum=wasmExports.HeapTupleHeaderGetDatum)(e),Module._wal_segment_close=e=>(Module._wal_segment_close=wasmExports.wal_segment_close)(e),Module._wal_segment_open=(e,t,I)=>(Module._wal_segment_open=wasmExports.wal_segment_open)(e,t,I),Module._GetFlushRecPtr=e=>(Module._GetFlushRecPtr=wasmExports.GetFlushRecPtr)(e),Module._XLogReadRecord=(e,t)=>(Module._XLogReadRecord=wasmExports.XLogReadRecord)(e,t),Module._RmgrNotFound=e=>(Module._RmgrNotFound=wasmExports.RmgrNotFound)(e),Module._CacheRegisterRelcacheCallback=(e,t)=>(Module._CacheRegisterRelcacheCallback=wasmExports.CacheRegisterRelcacheCallback)(e,t),Module._free_attrmap=e=>(Module._free_attrmap=wasmExports.free_attrmap)(e),Module._BuildIndexInfo=e=>(Module._BuildIndexInfo=wasmExports.BuildIndexInfo)(e),Module._hash_seq_term=e=>(Module._hash_seq_term=wasmExports.hash_seq_term)(e),Module._PushActiveSnapshot=e=>(Module._PushActiveSnapshot=wasmExports.PushActiveSnapshot)(e),Module._PopActiveSnapshot=()=>(Module._PopActiveSnapshot=wasmExports.PopActiveSnapshot)(),Module._MakePerTupleExprContext=e=>(Module._MakePerTupleExprContext=wasmExports.MakePerTupleExprContext)(e),Module._ExecInitExpr=(e,t)=>(Module._ExecInitExpr=wasmExports.ExecInitExpr)(e,t),Module._FreeExecutorState=e=>(Module._FreeExecutorState=wasmExports.FreeExecutorState)(e),Module._list_member_oid=(e,t)=>(Module._list_member_oid=wasmExports.list_member_oid)(e,t),Module._MemoryContextStrdup=(e,t)=>(Module._MemoryContextStrdup=wasmExports.MemoryContextStrdup)(e,t),Module._pq_getmsgint=(e,t)=>(Module._pq_getmsgint=wasmExports.pq_getmsgint)(e,t),Module._CreateExecutorState=()=>(Module._CreateExecutorState=wasmExports.CreateExecutorState)(),Module._ExecInitRangeTable=(e,t,I)=>(Module._ExecInitRangeTable=wasmExports.ExecInitRangeTable)(e,t,I),Module._getTypeInputInfo=(e,t,I)=>(Module._getTypeInputInfo=wasmExports.getTypeInputInfo)(e,t,I),Module._ExecStoreVirtualTuple=e=>(Module._ExecStoreVirtualTuple=wasmExports.ExecStoreVirtualTuple)(e),Module._execute_attr_map_slot=(e,t,I)=>(Module._execute_attr_map_slot=wasmExports.execute_attr_map_slot)(e,t,I),Module._slot_getsomeattrs_int=(e,t)=>(Module._slot_getsomeattrs_int=wasmExports.slot_getsomeattrs_int)(e,t),Module._GetUserNameFromId=(e,t)=>(Module._GetUserNameFromId=wasmExports.GetUserNameFromId)(e,t),Module._makeStringInfo=()=>(Module._makeStringInfo=wasmExports.makeStringInfo)(),Module._list_member_xid=(e,t)=>(Module._list_member_xid=wasmExports.list_member_xid)(e,t),Module._lappend_xid=(e,t)=>(Module._lappend_xid=wasmExports.lappend_xid)(e,t),Module._tuplestore_end=e=>(Module._tuplestore_end=wasmExports.tuplestore_end)(e),Module._quote_literal_cstr=e=>(Module._quote_literal_cstr=wasmExports.quote_literal_cstr)(e),Module._MakeSingleTupleTableSlot=(e,t)=>(Module._MakeSingleTupleTableSlot=wasmExports.MakeSingleTupleTableSlot)(e,t),Module._ExecDropSingleTupleTableSlot=e=>(Module._ExecDropSingleTupleTableSlot=wasmExports.ExecDropSingleTupleTableSlot)(e),Module._tuplestore_tuple_count=e=>(Module._tuplestore_tuple_count=wasmExports.tuplestore_tuple_count)(e),Module._quote_identifier=e=>(Module._quote_identifier=wasmExports.quote_identifier)(e),Module._BeginCopyFrom=(e,t,I,B,tr,rr,ir,lr)=>(Module._BeginCopyFrom=wasmExports.BeginCopyFrom)(e,t,I,B,tr,rr,ir,lr),Module._array_contains_nulls=e=>(Module._array_contains_nulls=wasmExports.array_contains_nulls)(e),Module._format_procedure=e=>(Module._format_procedure=wasmExports.format_procedure)(e),Module._pg_detoast_datum_packed=e=>(Module._pg_detoast_datum_packed=wasmExports.pg_detoast_datum_packed)(e),Module._cstring_to_text_with_len=(e,t)=>(Module._cstring_to_text_with_len=wasmExports.cstring_to_text_with_len)(e,t),Module._GenerationContextCreate=(e,t,I,B,tr)=>(Module._GenerationContextCreate=wasmExports.GenerationContextCreate)(e,t,I,B,tr),Module._BeginInternalSubTransaction=e=>(Module._BeginInternalSubTransaction=wasmExports.BeginInternalSubTransaction)(e),Module._RollbackAndReleaseCurrentSubTransaction=()=>(Module._RollbackAndReleaseCurrentSubTransaction=wasmExports.RollbackAndReleaseCurrentSubTransaction)(),Module._CopyErrorData=()=>(Module._CopyErrorData=wasmExports.CopyErrorData)(),Module._FreeErrorData=e=>(Module._FreeErrorData=wasmExports.FreeErrorData)(e),Module._RelidByRelfilenumber=(e,t)=>(Module._RelidByRelfilenumber=wasmExports.RelidByRelfilenumber)(e,t),Module._RelationIdGetRelation=e=>(Module._RelationIdGetRelation=wasmExports.RelationIdGetRelation)(e),Module._heap_deform_tuple=(e,t,I,B)=>(Module._heap_deform_tuple=wasmExports.heap_deform_tuple)(e,t,I,B),Module._RelationClose=e=>(Module._RelationClose=wasmExports.RelationClose)(e),Module._nocachegetattr=(e,t,I)=>(Module._nocachegetattr=wasmExports.nocachegetattr)(e,t,I),Module._XLogReaderAllocate=(e,t,I,B)=>(Module._XLogReaderAllocate=wasmExports.XLogReaderAllocate)(e,t,I,B),Module._XLogReaderFree=e=>(Module._XLogReaderFree=wasmExports.XLogReaderFree)(e),Module._OutputPluginPrepareWrite=(e,t)=>(Module._OutputPluginPrepareWrite=wasmExports.OutputPluginPrepareWrite)(e,t),Module._OutputPluginWrite=(e,t)=>(Module._OutputPluginWrite=wasmExports.OutputPluginWrite)(e,t),Module._OutputPluginUpdateProgress=(e,t)=>(Module._OutputPluginUpdateProgress=wasmExports.OutputPluginUpdateProgress)(e,t),Module._replorigin_by_oid=(e,t,I)=>(Module._replorigin_by_oid=wasmExports.replorigin_by_oid)(e,t,I),Module._logicalrep_write_begin=(e,t)=>(Module._logicalrep_write_begin=wasmExports.logicalrep_write_begin)(e,t),Module._logicalrep_write_commit=(e,t,I)=>(Module._logicalrep_write_commit=wasmExports.logicalrep_write_commit)(e,t,I),Module._logicalrep_write_begin_prepare=(e,t)=>(Module._logicalrep_write_begin_prepare=wasmExports.logicalrep_write_begin_prepare)(e,t),Module._logicalrep_write_prepare=(e,t,I)=>(Module._logicalrep_write_prepare=wasmExports.logicalrep_write_prepare)(e,t,I),Module._logicalrep_write_commit_prepared=(e,t,I)=>(Module._logicalrep_write_commit_prepared=wasmExports.logicalrep_write_commit_prepared)(e,t,I),Module._logicalrep_write_rollback_prepared=(e,t,I,B)=>(Module._logicalrep_write_rollback_prepared=wasmExports.logicalrep_write_rollback_prepared)(e,t,I,B),Module._logicalrep_write_stream_prepare=(e,t,I)=>(Module._logicalrep_write_stream_prepare=wasmExports.logicalrep_write_stream_prepare)(e,t,I),Module._logicalrep_write_origin=(e,t,I)=>(Module._logicalrep_write_origin=wasmExports.logicalrep_write_origin)(e,t,I),Module._logicalrep_write_insert=(e,t,I,B,tr,rr)=>(Module._logicalrep_write_insert=wasmExports.logicalrep_write_insert)(e,t,I,B,tr,rr),Module._logicalrep_write_update=(e,t,I,B,tr,rr,ir)=>(Module._logicalrep_write_update=wasmExports.logicalrep_write_update)(e,t,I,B,tr,rr,ir),Module._logicalrep_write_delete=(e,t,I,B,tr,rr)=>(Module._logicalrep_write_delete=wasmExports.logicalrep_write_delete)(e,t,I,B,tr,rr),Module._logicalrep_write_truncate=(e,t,I,B,tr,rr)=>(Module._logicalrep_write_truncate=wasmExports.logicalrep_write_truncate)(e,t,I,B,tr,rr),Module._logicalrep_write_message=(e,t,I,B,tr,rr,ir)=>(Module._logicalrep_write_message=wasmExports.logicalrep_write_message)(e,t,I,B,tr,rr,ir),Module._logicalrep_write_rel=(e,t,I,B)=>(Module._logicalrep_write_rel=wasmExports.logicalrep_write_rel)(e,t,I,B),Module._logicalrep_write_typ=(e,t,I)=>(Module._logicalrep_write_typ=wasmExports.logicalrep_write_typ)(e,t,I),Module._logicalrep_write_stream_start=(e,t,I)=>(Module._logicalrep_write_stream_start=wasmExports.logicalrep_write_stream_start)(e,t,I),Module._logicalrep_write_stream_stop=e=>(Module._logicalrep_write_stream_stop=wasmExports.logicalrep_write_stream_stop)(e),Module._logicalrep_write_stream_commit=(e,t,I)=>(Module._logicalrep_write_stream_commit=wasmExports.logicalrep_write_stream_commit)(e,t,I),Module._logicalrep_write_stream_abort=(e,t,I,B,tr,rr)=>(Module._logicalrep_write_stream_abort=wasmExports.logicalrep_write_stream_abort)(e,t,I,B,tr,rr),Module._ProcessWalRcvInterrupts=()=>(Module._ProcessWalRcvInterrupts=wasmExports.ProcessWalRcvInterrupts)(),Module._timestamptz_to_str=e=>(Module._timestamptz_to_str=wasmExports.timestamptz_to_str)(e),Module._GetDatabaseEncodingName=()=>(Module._GetDatabaseEncodingName=wasmExports.GetDatabaseEncodingName)(),Module._PQconnectStartParams=(e,t,I)=>(Module._PQconnectStartParams=wasmExports.PQconnectStartParams)(e,t,I),Module._PQstatus=e=>(Module._PQstatus=wasmExports.PQstatus)(e),Module._PQsocket=e=>(Module._PQsocket=wasmExports.PQsocket)(e),Module._PQconnectPoll=e=>(Module._PQconnectPoll=wasmExports.PQconnectPoll)(e),Module._PQconnectionUsedPassword=e=>(Module._PQconnectionUsedPassword=wasmExports.PQconnectionUsedPassword)(e),Module._PQfinish=e=>(Module._PQfinish=wasmExports.PQfinish)(e),Module._PQresultStatus=e=>(Module._PQresultStatus=wasmExports.PQresultStatus)(e),Module._PQclear=e=>(Module._PQclear=wasmExports.PQclear)(e),Module._PQerrorMessage=e=>(Module._PQerrorMessage=wasmExports.PQerrorMessage)(e),Module._pchomp=e=>(Module._pchomp=wasmExports.pchomp)(e),Module._PQnfields=e=>(Module._PQnfields=wasmExports.PQnfields)(e),Module._PQntuples=e=>(Module._PQntuples=wasmExports.PQntuples)(e),Module._PQgetvalue=(e,t,I)=>(Module._PQgetvalue=wasmExports.PQgetvalue)(e,t,I),Module._pg_strtoint32=e=>(Module._pg_strtoint32=wasmExports.pg_strtoint32)(e),Module._PQconsumeInput=e=>(Module._PQconsumeInput=wasmExports.PQconsumeInput)(e),Module._pg_lsn_in=e=>(Module._pg_lsn_in=wasmExports.pg_lsn_in)(e),Module._DirectFunctionCall1Coll=(e,t,I)=>(Module._DirectFunctionCall1Coll=wasmExports.DirectFunctionCall1Coll)(e,t,I),Module._PQgetisnull=(e,t,I)=>(Module._PQgetisnull=wasmExports.PQgetisnull)(e,t,I),Module._tuplestore_begin_heap=(e,t,I)=>(Module._tuplestore_begin_heap=wasmExports.tuplestore_begin_heap)(e,t,I),Module._TupleDescGetAttInMetadata=e=>(Module._TupleDescGetAttInMetadata=wasmExports.TupleDescGetAttInMetadata)(e),Module._BuildTupleFromCStrings=(e,t)=>(Module._BuildTupleFromCStrings=wasmExports.BuildTupleFromCStrings)(e,t),Module._tuplestore_puttuple=(e,t)=>(Module._tuplestore_puttuple=wasmExports.tuplestore_puttuple)(e,t),Module._PQresultErrorField=(e,t)=>(Module._PQresultErrorField=wasmExports.PQresultErrorField)(e,t),Module._PQsendQuery=(e,t)=>(Module._PQsendQuery=wasmExports.PQsendQuery)(e,t),Module._PQisBusy=e=>(Module._PQisBusy=wasmExports.PQisBusy)(e),Module._PQgetResult=e=>(Module._PQgetResult=wasmExports.PQgetResult)(e),Module._ResourceOwnerDelete=e=>(Module._ResourceOwnerDelete=wasmExports.ResourceOwnerDelete)(e),Module._CreateDestReceiver=e=>(Module._CreateDestReceiver=wasmExports.CreateDestReceiver)(e),Module._defGetString=e=>(Module._defGetString=wasmExports.defGetString)(e),Module._pg_md5_encrypt=(e,t,I,B,tr)=>(Module._pg_md5_encrypt=wasmExports.pg_md5_encrypt)(e,t,I,B,tr),Module._plain_crypt_verify=(e,t,I,B)=>(Module._plain_crypt_verify=wasmExports.plain_crypt_verify)(e,t,I,B),Module._pg_b64_enc_len=e=>(Module._pg_b64_enc_len=wasmExports.pg_b64_enc_len)(e),Module._pg_b64_encode=(e,t,I,B)=>(Module._pg_b64_encode=wasmExports.pg_b64_encode)(e,t,I,B),Module._pg_b64_dec_len=e=>(Module._pg_b64_dec_len=wasmExports.pg_b64_dec_len)(e),Module._pg_b64_decode=(e,t,I,B)=>(Module._pg_b64_decode=wasmExports.pg_b64_decode)(e,t,I,B),Module._pg_hmac_create=e=>(Module._pg_hmac_create=wasmExports.pg_hmac_create)(e),Module._pg_hmac_init=(e,t,I)=>(Module._pg_hmac_init=wasmExports.pg_hmac_init)(e,t,I),Module._pg_hmac_update=(e,t,I)=>(Module._pg_hmac_update=wasmExports.pg_hmac_update)(e,t,I),Module._pg_hmac_final=(e,t,I)=>(Module._pg_hmac_final=wasmExports.pg_hmac_final)(e,t,I),Module._pg_hmac_error=e=>(Module._pg_hmac_error=wasmExports.pg_hmac_error)(e),Module._pg_hmac_free=e=>(Module._pg_hmac_free=wasmExports.pg_hmac_free)(e),Module._scram_H=(e,t,I,B,tr)=>(Module._scram_H=wasmExports.scram_H)(e,t,I,B,tr),Module._pg_saslprep=(e,t)=>(Module._pg_saslprep=wasmExports.pg_saslprep)(e,t),Module._scram_build_secret=(e,t,I,B,tr,rr,ir)=>(Module._scram_build_secret=wasmExports.scram_build_secret)(e,t,I,B,tr,rr,ir),Module._scram_SaltedPassword=(e,t,I,B,tr,rr,ir,lr)=>(Module._scram_SaltedPassword=wasmExports.scram_SaltedPassword)(e,t,I,B,tr,rr,ir,lr),Module._scram_ServerKey=(e,t,I,B,tr)=>(Module._scram_ServerKey=wasmExports.scram_ServerKey)(e,t,I,B,tr),Module._strtol=(e,t,I)=>(Module._strtol=wasmExports.strtol)(e,t,I),Module._replace_percent_placeholders=(e,t,I,B)=>(Module._replace_percent_placeholders=wasmExports.replace_percent_placeholders)(e,t,I,B),Module._fgets=(e,t,I)=>(Module._fgets=wasmExports.fgets)(e,t,I),Module._explicit_bzero=(e,t)=>(Module._explicit_bzero=wasmExports.explicit_bzero)(e,t),Module._wait_result_to_str=e=>(Module._wait_result_to_str=wasmExports.wait_result_to_str)(e),Module._pg_strip_crlf=e=>(Module._pg_strip_crlf=wasmExports.pg_strip_crlf)(e),Module._geteuid=()=>(Module._geteuid=wasmExports.geteuid)(),Module._getpeereid=(e,t,I)=>(Module._getpeereid=wasmExports.getpeereid)(e,t,I),Module._pg_getaddrinfo_all=(e,t,I,B)=>(Module._pg_getaddrinfo_all=wasmExports.pg_getaddrinfo_all)(e,t,I,B),Module._socket=(e,t,I)=>(Module._socket=wasmExports.socket)(e,t,I),Module._connect=(e,t,I)=>(Module._connect=wasmExports.connect)(e,t,I),Module._recv=(e,t,I,B)=>(Module._recv=wasmExports.recv)(e,t,I,B),Module._pg_freeaddrinfo_all=(e,t)=>(Module._pg_freeaddrinfo_all=wasmExports.pg_freeaddrinfo_all)(e,t),Module._pq_sendtext=(e,t,I)=>(Module._pq_sendtext=wasmExports.pq_sendtext)(e,t,I),Module._pq_sendfloat4=(e,t)=>(Module._pq_sendfloat4=wasmExports.pq_sendfloat4)(e,t),Module._pq_sendfloat8=(e,t)=>(Module._pq_sendfloat8=wasmExports.pq_sendfloat8)(e,t),Module._pq_begintypsend=e=>(Module._pq_begintypsend=wasmExports.pq_begintypsend)(e),Module._pq_endtypsend=e=>(Module._pq_endtypsend=wasmExports.pq_endtypsend)(e),Module._pq_getmsgfloat4=e=>(Module._pq_getmsgfloat4=wasmExports.pq_getmsgfloat4)(e),Module._pq_getmsgfloat8=e=>(Module._pq_getmsgfloat8=wasmExports.pq_getmsgfloat8)(e),Module._pq_getmsgtext=(e,t,I)=>(Module._pq_getmsgtext=wasmExports.pq_getmsgtext)(e,t,I),Module._feof=e=>(Module._feof=wasmExports.feof)(e),Module._pg_mb2wchar_with_len=(e,t,I)=>(Module._pg_mb2wchar_with_len=wasmExports.pg_mb2wchar_with_len)(e,t,I),Module._pg_regcomp=(e,t,I,B,tr)=>(Module._pg_regcomp=wasmExports.pg_regcomp)(e,t,I,B,tr),Module._pg_regerror=(e,t,I,B)=>(Module._pg_regerror=wasmExports.pg_regerror)(e,t,I,B),Module._get_role_oid=(e,t)=>(Module._get_role_oid=wasmExports.get_role_oid)(e,t),Module._strcat=(e,t)=>(Module._strcat=wasmExports.strcat)(e,t),Module._sigemptyset=e=>(Module._sigemptyset=wasmExports.sigemptyset)(e),Module._be_lo_unlink=e=>(Module._be_lo_unlink=wasmExports.be_lo_unlink)(e),Module._object_ownercheck=(e,t,I)=>(Module._object_ownercheck=wasmExports.object_ownercheck)(e,t,I),Module._text_to_cstring_buffer=(e,t,I)=>(Module._text_to_cstring_buffer=wasmExports.text_to_cstring_buffer)(e,t,I),Module._setsockopt=(e,t,I,B,tr)=>(Module._setsockopt=wasmExports.setsockopt)(e,t,I,B,tr),Module._getsockname=(e,t,I)=>(Module._getsockname=wasmExports.getsockname)(e,t,I),Module._pq_recvbuf_fill=(e,t)=>(Module._pq_recvbuf_fill=wasmExports.pq_recvbuf_fill)(e,t),Module._getsockopt=(e,t,I,B,tr)=>(Module._getsockopt=wasmExports.getsockopt)(e,t,I,B,tr),Module._getmissingattr=(e,t,I)=>(Module._getmissingattr=wasmExports.getmissingattr)(e,t,I),Module._get_rel_relkind=e=>(Module._get_rel_relkind=wasmExports.get_rel_relkind)(e),Module._MemoryContextSetIdentifier=(e,t)=>(Module._MemoryContextSetIdentifier=wasmExports.MemoryContextSetIdentifier)(e,t),Module._MemoryContextSetParent=(e,t)=>(Module._MemoryContextSetParent=wasmExports.MemoryContextSetParent)(e,t),Module._find_base_rel=(e,t)=>(Module._find_base_rel=wasmExports.find_base_rel)(e,t),Module._bms_equal=(e,t)=>(Module._bms_equal=wasmExports.bms_equal)(e,t),Module._bms_num_members=e=>(Module._bms_num_members=wasmExports.bms_num_members)(e),Module._fmgr_info_copy=(e,t,I)=>(Module._fmgr_info_copy=wasmExports.fmgr_info_copy)(e,t,I),Module._fmgr_info_cxt=(e,t,I)=>(Module._fmgr_info_cxt=wasmExports.fmgr_info_cxt)(e,t,I),Module._get_typlenbyvalalign=(e,t,I,B)=>(Module._get_typlenbyvalalign=wasmExports.get_typlenbyvalalign)(e,t,I,B),Module._deconstruct_array=(e,t,I,B,tr,rr,ir,lr)=>(Module._deconstruct_array=wasmExports.deconstruct_array)(e,t,I,B,tr,rr,ir,lr),Module._datumCopy=(e,t,I)=>(Module._datumCopy=wasmExports.datumCopy)(e,t,I),Module._qsort_arg=(e,t,I,B,tr)=>(Module._qsort_arg=wasmExports.qsort_arg)(e,t,I,B,tr),Module._FunctionCall2Coll=(e,t,I,B)=>(Module._FunctionCall2Coll=wasmExports.FunctionCall2Coll)(e,t,I,B),Module._datumIsEqual=(e,t,I,B)=>(Module._datumIsEqual=wasmExports.datumIsEqual)(e,t,I,B),Module._bms_overlap=(e,t)=>(Module._bms_overlap=wasmExports.bms_overlap)(e,t),Module._ExecPrepareExpr=(e,t)=>(Module._ExecPrepareExpr=wasmExports.ExecPrepareExpr)(e,t),Module._RegisterSnapshot=e=>(Module._RegisterSnapshot=wasmExports.RegisterSnapshot)(e),Module._UnregisterSnapshot=e=>(Module._UnregisterSnapshot=wasmExports.UnregisterSnapshot)(e),Module._get_fn_expr_argtype=(e,t)=>(Module._get_fn_expr_argtype=wasmExports.get_fn_expr_argtype)(e,t),Module._get_opfamily_member=(e,t,I,B)=>(Module._get_opfamily_member=wasmExports.get_opfamily_member)(e,t,I,B),Module._init_MultiFuncCall=e=>(Module._init_MultiFuncCall=wasmExports.init_MultiFuncCall)(e),Module._per_MultiFuncCall=e=>(Module._per_MultiFuncCall=wasmExports.per_MultiFuncCall)(e),Module._end_MultiFuncCall=(e,t)=>(Module._end_MultiFuncCall=wasmExports.end_MultiFuncCall)(e,t),Module._textToQualifiedNameList=e=>(Module._textToQualifiedNameList=wasmExports.textToQualifiedNameList)(e),Module._FunctionCall1Coll=(e,t,I)=>(Module._FunctionCall1Coll=wasmExports.FunctionCall1Coll)(e,t,I),Module._DirectFunctionCall4Coll=(e,t,I,B,tr,rr)=>(Module._DirectFunctionCall4Coll=wasmExports.DirectFunctionCall4Coll)(e,t,I,B,tr,rr),Module._pg_mblen=e=>(Module._pg_mblen=wasmExports.pg_mblen)(e),Module._tsearch_readline_begin=(e,t)=>(Module._tsearch_readline_begin=wasmExports.tsearch_readline_begin)(e,t),Module._tsearch_readline=e=>(Module._tsearch_readline=wasmExports.tsearch_readline)(e),Module._t_isspace=e=>(Module._t_isspace=wasmExports.t_isspace)(e),Module._lowerstr=e=>(Module._lowerstr=wasmExports.lowerstr)(e),Module._tsearch_readline_end=e=>(Module._tsearch_readline_end=wasmExports.tsearch_readline_end)(e),Module._t_isdigit=e=>(Module._t_isdigit=wasmExports.t_isdigit)(e),Module._pnstrdup=(e,t)=>(Module._pnstrdup=wasmExports.pnstrdup)(e,t),Module._get_tsearch_config_filename=(e,t)=>(Module._get_tsearch_config_filename=wasmExports.get_tsearch_config_filename)(e,t),Module._lookup_ts_dictionary_cache=e=>(Module._lookup_ts_dictionary_cache=wasmExports.lookup_ts_dictionary_cache)(e),Module._FunctionCall4Coll=(e,t,I,B,tr,rr)=>(Module._FunctionCall4Coll=wasmExports.FunctionCall4Coll)(e,t,I,B,tr,rr),Module._t_isalnum=e=>(Module._t_isalnum=wasmExports.t_isalnum)(e),Module._isalnum=e=>(Module._isalnum=wasmExports.isalnum)(e),Module._pg_any_to_server=(e,t,I)=>(Module._pg_any_to_server=wasmExports.pg_any_to_server)(e,t,I),Module._lowerstr_with_len=(e,t)=>(Module._lowerstr_with_len=wasmExports.lowerstr_with_len)(e,t),Module._tolower=e=>(Module._tolower=wasmExports.tolower)(e),Module._readstoplist=(e,t,I)=>(Module._readstoplist=wasmExports.readstoplist)(e,t,I),Module._searchstoplist=(e,t)=>(Module._searchstoplist=wasmExports.searchstoplist)(e,t),Module._GetDatabaseEncoding=()=>(Module._GetDatabaseEncoding=wasmExports.GetDatabaseEncoding)(),Module._vacuum_delay_point=()=>(Module._vacuum_delay_point=wasmExports.vacuum_delay_point)(),Module._get_restriction_variable=(e,t,I,B,tr,rr)=>(Module._get_restriction_variable=wasmExports.get_restriction_variable)(e,t,I,B,tr,rr),Module._get_attstatsslot=(e,t,I,B,tr)=>(Module._get_attstatsslot=wasmExports.get_attstatsslot)(e,t,I,B,tr),Module._free_attstatsslot=e=>(Module._free_attstatsslot=wasmExports.free_attstatsslot)(e),Module._Float8GetDatum=e=>(Module._Float8GetDatum=wasmExports.Float8GetDatum)(e),Module._ExecReScan=e=>(Module._ExecReScan=wasmExports.ExecReScan)(e),Module._ExecAsyncResponse=e=>(Module._ExecAsyncResponse=wasmExports.ExecAsyncResponse)(e),Module._ExecAsyncRequestDone=(e,t)=>(Module._ExecAsyncRequestDone=wasmExports.ExecAsyncRequestDone)(e,t),Module._ExecAsyncRequestPending=e=>(Module._ExecAsyncRequestPending=wasmExports.ExecAsyncRequestPending)(e),Module._tuplesort_end=e=>(Module._tuplesort_end=wasmExports.tuplesort_end)(e),Module._ExecInitExprList=(e,t)=>(Module._ExecInitExprList=wasmExports.ExecInitExprList)(e,t),Module._fmgr_info=(e,t)=>(Module._fmgr_info=wasmExports.fmgr_info)(e,t),Module._get_typlenbyval=(e,t,I)=>(Module._get_typlenbyval=wasmExports.get_typlenbyval)(e,t,I),Module._ExecForceStoreHeapTuple=(e,t,I)=>(Module._ExecForceStoreHeapTuple=wasmExports.ExecForceStoreHeapTuple)(e,t,I),Module._tuplesort_performsort=e=>(Module._tuplesort_performsort=wasmExports.tuplesort_performsort)(e),Module._tuplesort_begin_heap=(e,t,I,B,tr,rr,ir,lr,dr)=>(Module._tuplesort_begin_heap=wasmExports.tuplesort_begin_heap)(e,t,I,B,tr,rr,ir,lr,dr),Module._MemoryContextMemAllocated=(e,t)=>(Module._MemoryContextMemAllocated=wasmExports.MemoryContextMemAllocated)(e,t),Module._tuplesort_gettupleslot=(e,t,I,B,tr)=>(Module._tuplesort_gettupleslot=wasmExports.tuplesort_gettupleslot)(e,t,I,B,tr),Module._tuplesort_puttupleslot=(e,t)=>(Module._tuplesort_puttupleslot=wasmExports.tuplesort_puttupleslot)(e,t),Module._ExecStoreAllNullTuple=e=>(Module._ExecStoreAllNullTuple=wasmExports.ExecStoreAllNullTuple)(e),Module._MakeExpandedObjectReadOnlyInternal=e=>(Module._MakeExpandedObjectReadOnlyInternal=wasmExports.MakeExpandedObjectReadOnlyInternal)(e),Module._BlessTupleDesc=e=>(Module._BlessTupleDesc=wasmExports.BlessTupleDesc)(e),Module._pg_detoast_datum_copy=e=>(Module._pg_detoast_datum_copy=wasmExports.pg_detoast_datum_copy)(e),Module._construct_md_array=(e,t,I,B,tr,rr,ir,lr,dr)=>(Module._construct_md_array=wasmExports.construct_md_array)(e,t,I,B,tr,rr,ir,lr,dr),Module._ArrayGetNItems=(e,t)=>(Module._ArrayGetNItems=wasmExports.ArrayGetNItems)(e,t),Module._construct_empty_array=e=>(Module._construct_empty_array=wasmExports.construct_empty_array)(e),Module._DatumGetEOHP=e=>(Module._DatumGetEOHP=wasmExports.DatumGetEOHP)(e),Module._expanded_record_fetch_tupdesc=e=>(Module._expanded_record_fetch_tupdesc=wasmExports.expanded_record_fetch_tupdesc)(e),Module._expanded_record_fetch_field=(e,t,I)=>(Module._expanded_record_fetch_field=wasmExports.expanded_record_fetch_field)(e,t,I),Module._execute_attr_map_tuple=(e,t)=>(Module._execute_attr_map_tuple=wasmExports.execute_attr_map_tuple)(e,t),Module._MemoryContextAllocExtended=(e,t,I)=>(Module._MemoryContextAllocExtended=wasmExports.MemoryContextAllocExtended)(e,t,I),Module._lookup_rowtype_tupdesc_domain=(e,t,I)=>(Module._lookup_rowtype_tupdesc_domain=wasmExports.lookup_rowtype_tupdesc_domain)(e,t,I),Module._MemoryContextGetParent=e=>(Module._MemoryContextGetParent=wasmExports.MemoryContextGetParent)(e),Module._DeleteExpandedObject=e=>(Module._DeleteExpandedObject=wasmExports.DeleteExpandedObject)(e),Module._InstrAlloc=(e,t,I)=>(Module._InstrAlloc=wasmExports.InstrAlloc)(e,t,I),Module._ExprEvalPushStep=(e,t)=>(Module._ExprEvalPushStep=wasmExports.ExprEvalPushStep)(e,t),Module._getTypeOutputInfo=(e,t,I)=>(Module._getTypeOutputInfo=wasmExports.getTypeOutputInfo)(e,t,I),Module._ExecInitExprWithParams=(e,t)=>(Module._ExecInitExprWithParams=wasmExports.ExecInitExprWithParams)(e,t),Module._ExecOpenScanRelation=(e,t,I)=>(Module._ExecOpenScanRelation=wasmExports.ExecOpenScanRelation)(e,t,I),Module._FreeExprContext=(e,t)=>(Module._FreeExprContext=wasmExports.FreeExprContext)(e,t),Module._CreateExprContext=e=>(Module._CreateExprContext=wasmExports.CreateExprContext)(e),Module._ExecGetReturningSlot=(e,t)=>(Module._ExecGetReturningSlot=wasmExports.ExecGetReturningSlot)(e,t),Module._build_attrmap_by_name_if_req=(e,t,I)=>(Module._build_attrmap_by_name_if_req=wasmExports.build_attrmap_by_name_if_req)(e,t,I),Module._ExecGetResultRelCheckAsUser=(e,t)=>(Module._ExecGetResultRelCheckAsUser=wasmExports.ExecGetResultRelCheckAsUser)(e,t),Module._InstrEndLoop=e=>(Module._InstrEndLoop=wasmExports.InstrEndLoop)(e),Module._ExecStoreHeapTuple=(e,t,I)=>(Module._ExecStoreHeapTuple=wasmExports.ExecStoreHeapTuple)(e,t,I),Module._get_partition_ancestors=e=>(Module._get_partition_ancestors=wasmExports.get_partition_ancestors)(e),Module._pull_varattnos=(e,t,I)=>(Module._pull_varattnos=wasmExports.pull_varattnos)(e,t,I),Module._ExecFindJunkAttributeInTlist=(e,t)=>(Module._ExecFindJunkAttributeInTlist=wasmExports.ExecFindJunkAttributeInTlist)(e,t),Module._visibilitymap_get_status=(e,t,I)=>(Module._visibilitymap_get_status=wasmExports.visibilitymap_get_status)(e,t,I),Module._index_deform_tuple=(e,t,I,B)=>(Module._index_deform_tuple=wasmExports.index_deform_tuple)(e,t,I,B),Module._LaunchParallelWorkers=e=>(Module._LaunchParallelWorkers=wasmExports.LaunchParallelWorkers)(e),Module._standard_ExecutorStart=(e,t)=>(Module._standard_ExecutorStart=wasmExports.standard_ExecutorStart)(e,t),Module._GetCommandTagName=e=>(Module._GetCommandTagName=wasmExports.GetCommandTagName)(e),Module._standard_ExecutorRun=(e,t,I,B)=>(Module._standard_ExecutorRun=wasmExports.standard_ExecutorRun)(e,t,I,B),Module._EnterParallelMode=()=>(Module._EnterParallelMode=wasmExports.EnterParallelMode)(),Module._ExitParallelMode=()=>(Module._ExitParallelMode=wasmExports.ExitParallelMode)(),Module._standard_ExecutorFinish=e=>(Module._standard_ExecutorFinish=wasmExports.standard_ExecutorFinish)(e),Module._standard_ExecutorEnd=e=>(Module._standard_ExecutorEnd=wasmExports.standard_ExecutorEnd)(e),Module._MakeTupleTableSlot=(e,t)=>(Module._MakeTupleTableSlot=wasmExports.MakeTupleTableSlot)(e,t),Module._CreateParallelContext=(e,t,I)=>(Module._CreateParallelContext=wasmExports.CreateParallelContext)(e,t,I),Module._InitializeParallelDSM=e=>(Module._InitializeParallelDSM=wasmExports.InitializeParallelDSM)(e),Module._WaitForParallelWorkersToFinish=e=>(Module._WaitForParallelWorkersToFinish=wasmExports.WaitForParallelWorkersToFinish)(e),Module._DestroyParallelContext=e=>(Module._DestroyParallelContext=wasmExports.DestroyParallelContext)(e),Module._SPI_connect=()=>(Module._SPI_connect=wasmExports.SPI_connect)(),Module._SPI_connect_ext=e=>(Module._SPI_connect_ext=wasmExports.SPI_connect_ext)(e),Module._SPI_finish=()=>(Module._SPI_finish=wasmExports.SPI_finish)(),Module._SPI_commit=()=>(Module._SPI_commit=wasmExports.SPI_commit)(),Module._ReThrowError=e=>(Module._ReThrowError=wasmExports.ReThrowError)(e),Module._SPI_commit_and_chain=()=>(Module._SPI_commit_and_chain=wasmExports.SPI_commit_and_chain)(),Module._SPI_rollback=()=>(Module._SPI_rollback=wasmExports.SPI_rollback)(),Module._SPI_rollback_and_chain=()=>(Module._SPI_rollback_and_chain=wasmExports.SPI_rollback_and_chain)(),Module._SPI_execute=(e,t,I)=>(Module._SPI_execute=wasmExports.SPI_execute)(e,t,I),Module._EnsurePortalSnapshotExists=()=>(Module._EnsurePortalSnapshotExists=wasmExports.EnsurePortalSnapshotExists)(),Module._SPI_freetuptable=e=>(Module._SPI_freetuptable=wasmExports.SPI_freetuptable)(e),Module._ReleaseCachedPlan=(e,t)=>(Module._ReleaseCachedPlan=wasmExports.ReleaseCachedPlan)(e,t),Module._SPI_exec=(e,t)=>(Module._SPI_exec=wasmExports.SPI_exec)(e,t),Module._SPI_execute_extended=(e,t)=>(Module._SPI_execute_extended=wasmExports.SPI_execute_extended)(e,t),Module._makeParamList=e=>(Module._makeParamList=wasmExports.makeParamList)(e),Module._SPI_execp=(e,t,I,B)=>(Module._SPI_execp=wasmExports.SPI_execp)(e,t,I,B),Module._SPI_execute_plan_extended=(e,t)=>(Module._SPI_execute_plan_extended=wasmExports.SPI_execute_plan_extended)(e,t),Module._SPI_execute_plan_with_paramlist=(e,t,I,B)=>(Module._SPI_execute_plan_with_paramlist=wasmExports.SPI_execute_plan_with_paramlist)(e,t,I,B),Module._SPI_prepare=(e,t,I)=>(Module._SPI_prepare=wasmExports.SPI_prepare)(e,t,I),Module._SPI_prepare_extended=(e,t)=>(Module._SPI_prepare_extended=wasmExports.SPI_prepare_extended)(e,t),Module._SPI_keepplan=e=>(Module._SPI_keepplan=wasmExports.SPI_keepplan)(e),Module._SPI_freeplan=e=>(Module._SPI_freeplan=wasmExports.SPI_freeplan)(e),Module._SPI_copytuple=e=>(Module._SPI_copytuple=wasmExports.SPI_copytuple)(e),Module._SPI_returntuple=(e,t)=>(Module._SPI_returntuple=wasmExports.SPI_returntuple)(e,t),Module._SPI_fnumber=(e,t)=>(Module._SPI_fnumber=wasmExports.SPI_fnumber)(e,t),Module._SPI_fname=(e,t)=>(Module._SPI_fname=wasmExports.SPI_fname)(e,t),Module._SPI_getvalue=(e,t,I)=>(Module._SPI_getvalue=wasmExports.SPI_getvalue)(e,t,I),Module._SPI_getbinval=(e,t,I,B)=>(Module._SPI_getbinval=wasmExports.SPI_getbinval)(e,t,I,B),Module._SPI_gettype=(e,t)=>(Module._SPI_gettype=wasmExports.SPI_gettype)(e,t),Module._SPI_gettypeid=(e,t)=>(Module._SPI_gettypeid=wasmExports.SPI_gettypeid)(e,t),Module._SPI_getrelname=e=>(Module._SPI_getrelname=wasmExports.SPI_getrelname)(e),Module._SPI_palloc=e=>(Module._SPI_palloc=wasmExports.SPI_palloc)(e),Module._SPI_datumTransfer=(e,t,I)=>(Module._SPI_datumTransfer=wasmExports.SPI_datumTransfer)(e,t,I),Module._datumTransfer=(e,t,I)=>(Module._datumTransfer=wasmExports.datumTransfer)(e,t,I),Module._SPI_cursor_open_with_paramlist=(e,t,I,B)=>(Module._SPI_cursor_open_with_paramlist=wasmExports.SPI_cursor_open_with_paramlist)(e,t,I,B),Module._SPI_cursor_parse_open=(e,t,I)=>(Module._SPI_cursor_parse_open=wasmExports.SPI_cursor_parse_open)(e,t,I),Module._SPI_cursor_find=e=>(Module._SPI_cursor_find=wasmExports.SPI_cursor_find)(e),Module._SPI_cursor_fetch=(e,t,I)=>(Module._SPI_cursor_fetch=wasmExports.SPI_cursor_fetch)(e,t,I),Module._SPI_scroll_cursor_fetch=(e,t,I)=>(Module._SPI_scroll_cursor_fetch=wasmExports.SPI_scroll_cursor_fetch)(e,t,I),Module._SPI_scroll_cursor_move=(e,t,I)=>(Module._SPI_scroll_cursor_move=wasmExports.SPI_scroll_cursor_move)(e,t,I),Module._SPI_cursor_close=e=>(Module._SPI_cursor_close=wasmExports.SPI_cursor_close)(e),Module._SPI_result_code_string=e=>(Module._SPI_result_code_string=wasmExports.SPI_result_code_string)(e),Module._SPI_plan_get_plan_sources=e=>(Module._SPI_plan_get_plan_sources=wasmExports.SPI_plan_get_plan_sources)(e),Module._SPI_plan_get_cached_plan=e=>(Module._SPI_plan_get_cached_plan=wasmExports.SPI_plan_get_cached_plan)(e),Module._geterrposition=()=>(Module._geterrposition=wasmExports.geterrposition)(),Module._internalerrposition=e=>(Module._internalerrposition=wasmExports.internalerrposition)(e),Module._internalerrquery=e=>(Module._internalerrquery=wasmExports.internalerrquery)(e),Module._SPI_register_trigger_data=e=>(Module._SPI_register_trigger_data=wasmExports.SPI_register_trigger_data)(e),Module._EOH_get_flat_size=e=>(Module._EOH_get_flat_size=wasmExports.EOH_get_flat_size)(e),Module._EOH_flatten_into=(e,t,I)=>(Module._EOH_flatten_into=wasmExports.EOH_flatten_into)(e,t,I),Module._ExecFetchSlotHeapTuple=(e,t,I)=>(Module._ExecFetchSlotHeapTuple=wasmExports.ExecFetchSlotHeapTuple)(e,t,I),Module._InputFunctionCall=(e,t,I,B)=>(Module._InputFunctionCall=wasmExports.InputFunctionCall)(e,t,I,B),Module._convert_tuples_by_position=(e,t,I)=>(Module._convert_tuples_by_position=wasmExports.convert_tuples_by_position)(e,t,I),Module._SetTuplestoreDestReceiverParams=(e,t,I,B,tr,rr)=>(Module._SetTuplestoreDestReceiverParams=wasmExports.SetTuplestoreDestReceiverParams)(e,t,I,B,tr,rr),Module._detoast_external_attr=e=>(Module._detoast_external_attr=wasmExports.detoast_external_attr)(e),Module._bms_nonempty_difference=(e,t)=>(Module._bms_nonempty_difference=wasmExports.bms_nonempty_difference)(e,t),Module._table_parallelscan_estimate=(e,t)=>(Module._table_parallelscan_estimate=wasmExports.table_parallelscan_estimate)(e,t),Module._table_parallelscan_initialize=(e,t,I)=>(Module._table_parallelscan_initialize=wasmExports.table_parallelscan_initialize)(e,t,I),Module._table_beginscan_parallel=(e,t)=>(Module._table_beginscan_parallel=wasmExports.table_beginscan_parallel)(e,t),Module._BufferUsageAccumDiff=(e,t,I)=>(Module._BufferUsageAccumDiff=wasmExports.BufferUsageAccumDiff)(e,t,I),Module._WalUsageAccumDiff=(e,t,I)=>(Module._WalUsageAccumDiff=wasmExports.WalUsageAccumDiff)(e,t,I),Module._InstrUpdateTupleCount=(e,t)=>(Module._InstrUpdateTupleCount=wasmExports.InstrUpdateTupleCount)(e,t),Module._tuplesort_reset=e=>(Module._tuplesort_reset=wasmExports.tuplesort_reset)(e),Module._get_call_expr_argtype=(e,t)=>(Module._get_call_expr_argtype=wasmExports.get_call_expr_argtype)(e,t),Module._get_typtype=e=>(Module._get_typtype=wasmExports.get_typtype)(e),Module._pull_var_clause=(e,t)=>(Module._pull_var_clause=wasmExports.pull_var_clause)(e,t),Module._bms_is_subset=(e,t)=>(Module._bms_is_subset=wasmExports.bms_is_subset)(e,t),Module._bms_membership=e=>(Module._bms_membership=wasmExports.bms_membership)(e),Module._make_restrictinfo=(e,t,I,B,tr,rr,ir,lr,dr,hr)=>(Module._make_restrictinfo=wasmExports.make_restrictinfo)(e,t,I,B,tr,rr,ir,lr,dr,hr),Module._GetSysCacheHashValue=(e,t,I,B,tr)=>(Module._GetSysCacheHashValue=wasmExports.GetSysCacheHashValue)(e,t,I,B,tr),Module._tlist_member=(e,t)=>(Module._tlist_member=wasmExports.tlist_member)(e,t),Module._add_path=(e,t)=>(Module._add_path=wasmExports.add_path)(e,t),Module._contain_mutable_functions=e=>(Module._contain_mutable_functions=wasmExports.contain_mutable_functions)(e),Module._make_orclause=e=>(Module._make_orclause=wasmExports.make_orclause)(e),Module._extract_actual_clauses=(e,t)=>(Module._extract_actual_clauses=wasmExports.extract_actual_clauses)(e,t),Module._cost_sort=(e,t,I,B,tr,rr,ir,lr,dr)=>(Module._cost_sort=wasmExports.cost_sort)(e,t,I,B,tr,rr,ir,lr,dr),Module._pathkeys_contained_in=(e,t)=>(Module._pathkeys_contained_in=wasmExports.pathkeys_contained_in)(e,t),Module._change_plan_targetlist=(e,t,I)=>(Module._change_plan_targetlist=wasmExports.change_plan_targetlist)(e,t,I),Module._make_foreignscan=(e,t,I,B,tr,rr,ir,lr)=>(Module._make_foreignscan=wasmExports.make_foreignscan)(e,t,I,B,tr,rr,ir,lr),Module._list_member_ptr=(e,t)=>(Module._list_member_ptr=wasmExports.list_member_ptr)(e,t),Module._clamp_row_est=e=>(Module._clamp_row_est=wasmExports.clamp_row_est)(e),Module._standard_planner=(e,t,I,B)=>(Module._standard_planner=wasmExports.standard_planner)(e,t,I,B),Module._estimate_expression_value=(e,t)=>(Module._estimate_expression_value=wasmExports.estimate_expression_value)(e,t),Module._add_new_columns_to_pathtarget=(e,t)=>(Module._add_new_columns_to_pathtarget=wasmExports.add_new_columns_to_pathtarget)(e,t),Module._get_sortgroupref_clause_noerr=(e,t)=>(Module._get_sortgroupref_clause_noerr=wasmExports.get_sortgroupref_clause_noerr)(e,t),Module._get_agg_clause_costs=(e,t,I)=>(Module._get_agg_clause_costs=wasmExports.get_agg_clause_costs)(e,t,I),Module._grouping_is_sortable=e=>(Module._grouping_is_sortable=wasmExports.grouping_is_sortable)(e),Module._create_sort_path=(e,t,I,B,tr)=>(Module._create_sort_path=wasmExports.create_sort_path)(e,t,I,B,tr),Module._copy_pathtarget=e=>(Module._copy_pathtarget=wasmExports.copy_pathtarget)(e),Module._get_sortgrouplist_exprs=(e,t)=>(Module._get_sortgrouplist_exprs=wasmExports.get_sortgrouplist_exprs)(e,t),Module._estimate_num_groups=(e,t,I,B,tr)=>(Module._estimate_num_groups=wasmExports.estimate_num_groups)(e,t,I,B,tr),Module._cost_qual_eval=(e,t,I)=>(Module._cost_qual_eval=wasmExports.cost_qual_eval)(e,t,I),Module._plan_create_index_workers=(e,t)=>(Module._plan_create_index_workers=wasmExports.plan_create_index_workers)(e,t),Module._create_projection_path=(e,t,I,B)=>(Module._create_projection_path=wasmExports.create_projection_path)(e,t,I,B),Module._get_plan_rowmark=(e,t)=>(Module._get_plan_rowmark=wasmExports.get_plan_rowmark)(e,t),Module._find_join_rel=(e,t)=>(Module._find_join_rel=wasmExports.find_join_rel)(e,t),Module._make_canonical_pathkey=(e,t,I,B,tr)=>(Module._make_canonical_pathkey=wasmExports.make_canonical_pathkey)(e,t,I,B,tr),Module._eclass_useful_for_merging=(e,t,I)=>(Module._eclass_useful_for_merging=wasmExports.eclass_useful_for_merging)(e,t,I),Module._update_mergeclause_eclasses=(e,t)=>(Module._update_mergeclause_eclasses=wasmExports.update_mergeclause_eclasses)(e,t),Module._clauselist_selectivity=(e,t,I,B,tr)=>(Module._clauselist_selectivity=wasmExports.clauselist_selectivity)(e,t,I,B,tr),Module._join_clause_is_movable_to=(e,t)=>(Module._join_clause_is_movable_to=wasmExports.join_clause_is_movable_to)(e,t),Module._generate_implied_equalities_for_column=(e,t,I,B,tr)=>(Module._generate_implied_equalities_for_column=wasmExports.generate_implied_equalities_for_column)(e,t,I,B,tr),Module._get_tablespace_page_costs=(e,t,I)=>(Module._get_tablespace_page_costs=wasmExports.get_tablespace_page_costs)(e,t,I),Module._set_baserel_size_estimates=(e,t)=>(Module._set_baserel_size_estimates=wasmExports.set_baserel_size_estimates)(e,t),Module._add_to_flat_tlist=(e,t)=>(Module._add_to_flat_tlist=wasmExports.add_to_flat_tlist)(e,t),Module._get_baserel_parampathinfo=(e,t,I)=>(Module._get_baserel_parampathinfo=wasmExports.get_baserel_parampathinfo)(e,t,I),Module._create_foreignscan_path=(e,t,I,B,tr,rr,ir,lr,dr,hr)=>(Module._create_foreignscan_path=wasmExports.create_foreignscan_path)(e,t,I,B,tr,rr,ir,lr,dr,hr),Module._create_foreign_join_path=(e,t,I,B,tr,rr,ir,lr,dr,hr)=>(Module._create_foreign_join_path=wasmExports.create_foreign_join_path)(e,t,I,B,tr,rr,ir,lr,dr,hr),Module._create_foreign_upper_path=(e,t,I,B,tr,rr,ir,lr,dr)=>(Module._create_foreign_upper_path=wasmExports.create_foreign_upper_path)(e,t,I,B,tr,rr,ir,lr,dr),Module._adjust_limit_rows_costs=(e,t,I,B,tr)=>(Module._adjust_limit_rows_costs=wasmExports.adjust_limit_rows_costs)(e,t,I,B,tr),Module._SearchSysCacheAttName=(e,t)=>(Module._SearchSysCacheAttName=wasmExports.SearchSysCacheAttName)(e,t),Module._get_translated_update_targetlist=(e,t,I,B)=>(Module._get_translated_update_targetlist=wasmExports.get_translated_update_targetlist)(e,t,I,B),Module._add_row_identity_var=(e,t,I,B)=>(Module._add_row_identity_var=wasmExports.add_row_identity_var)(e,t,I,B),Module._get_rel_all_updated_cols=(e,t)=>(Module._get_rel_all_updated_cols=wasmExports.get_rel_all_updated_cols)(e,t),Module._list_append_unique_ptr=(e,t)=>(Module._list_append_unique_ptr=wasmExports.list_append_unique_ptr)(e,t),Module._palloc_extended=(e,t)=>(Module._palloc_extended=wasmExports.palloc_extended)(e,t),Module._pg_reg_getinitialstate=e=>(Module._pg_reg_getinitialstate=wasmExports.pg_reg_getinitialstate)(e),Module._pg_reg_getfinalstate=e=>(Module._pg_reg_getfinalstate=wasmExports.pg_reg_getfinalstate)(e),Module._pg_reg_getnumoutarcs=(e,t)=>(Module._pg_reg_getnumoutarcs=wasmExports.pg_reg_getnumoutarcs)(e,t),Module._pg_reg_getoutarcs=(e,t,I,B)=>(Module._pg_reg_getoutarcs=wasmExports.pg_reg_getoutarcs)(e,t,I,B),Module._pg_reg_getnumcolors=e=>(Module._pg_reg_getnumcolors=wasmExports.pg_reg_getnumcolors)(e),Module._pg_reg_colorisbegin=(e,t)=>(Module._pg_reg_colorisbegin=wasmExports.pg_reg_colorisbegin)(e,t),Module._pg_reg_colorisend=(e,t)=>(Module._pg_reg_colorisend=wasmExports.pg_reg_colorisend)(e,t),Module._pg_reg_getnumcharacters=(e,t)=>(Module._pg_reg_getnumcharacters=wasmExports.pg_reg_getnumcharacters)(e,t),Module._pg_reg_getcharacters=(e,t,I,B)=>(Module._pg_reg_getcharacters=wasmExports.pg_reg_getcharacters)(e,t,I,B),Module._toupper=e=>(Module._toupper=wasmExports.toupper)(e),Module._pg_initdb=()=>(Module._pg_initdb=wasmExports.pg_initdb)(),Module._pg_initdb_main=()=>(Module._pg_initdb_main=wasmExports.pg_initdb_main)(),Module.___cxa_throw=(e,t,I)=>(Module.___cxa_throw=wasmExports.__cxa_throw)(e,t,I),Module._main_repl=()=>(Module._main_repl=wasmExports.main_repl)(),Module._main=(e,t)=>(Module._main=wasmExports.__main_argc_argv)(e,t),Module._setenv=(e,t,I)=>(Module._setenv=wasmExports.setenv)(e,t,I),Module._pg_repl_raf=()=>(Module._pg_repl_raf=wasmExports.pg_repl_raf)(),Module._GetForeignDataWrapper=e=>(Module._GetForeignDataWrapper=wasmExports.GetForeignDataWrapper)(e),Module._GetForeignServer=e=>(Module._GetForeignServer=wasmExports.GetForeignServer)(e),Module._GetForeignServerExtended=(e,t)=>(Module._GetForeignServerExtended=wasmExports.GetForeignServerExtended)(e,t),Module._GetForeignServerByName=(e,t)=>(Module._GetForeignServerByName=wasmExports.GetForeignServerByName)(e,t),Module._GetUserMapping=(e,t)=>(Module._GetUserMapping=wasmExports.GetUserMapping)(e,t),Module._GetForeignTable=e=>(Module._GetForeignTable=wasmExports.GetForeignTable)(e),Module._GetForeignColumnOptions=(e,t)=>(Module._GetForeignColumnOptions=wasmExports.GetForeignColumnOptions)(e,t),Module._initClosestMatch=(e,t,I)=>(Module._initClosestMatch=wasmExports.initClosestMatch)(e,t,I),Module._updateClosestMatch=(e,t)=>(Module._updateClosestMatch=wasmExports.updateClosestMatch)(e,t),Module._getClosestMatch=e=>(Module._getClosestMatch=wasmExports.getClosestMatch)(e),Module._GetExistingLocalJoinPath=e=>(Module._GetExistingLocalJoinPath=wasmExports.GetExistingLocalJoinPath)(e),Module._BaseBackupAddTarget=(e,t,I)=>(Module._BaseBackupAddTarget=wasmExports.BaseBackupAddTarget)(e,t,I),Module._bbsink_forward_begin_backup=e=>(Module._bbsink_forward_begin_backup=wasmExports.bbsink_forward_begin_backup)(e),Module._bbsink_forward_archive_contents=(e,t)=>(Module._bbsink_forward_archive_contents=wasmExports.bbsink_forward_archive_contents)(e,t),Module._bbsink_forward_end_archive=e=>(Module._bbsink_forward_end_archive=wasmExports.bbsink_forward_end_archive)(e),Module._bbsink_forward_begin_archive=(e,t)=>(Module._bbsink_forward_begin_archive=wasmExports.bbsink_forward_begin_archive)(e,t),Module._bbsink_forward_begin_manifest=e=>(Module._bbsink_forward_begin_manifest=wasmExports.bbsink_forward_begin_manifest)(e),Module._bbsink_forward_manifest_contents=(e,t)=>(Module._bbsink_forward_manifest_contents=wasmExports.bbsink_forward_manifest_contents)(e,t),Module._bbsink_forward_end_manifest=e=>(Module._bbsink_forward_end_manifest=wasmExports.bbsink_forward_end_manifest)(e),Module._bbsink_forward_end_backup=(e,t,I)=>(Module._bbsink_forward_end_backup=wasmExports.bbsink_forward_end_backup)(e,t,I),Module._bbsink_forward_cleanup=e=>(Module._bbsink_forward_cleanup=wasmExports.bbsink_forward_cleanup)(e),Module._ResourceOwnerCreate=(e,t)=>(Module._ResourceOwnerCreate=wasmExports.ResourceOwnerCreate)(e,t),Module._escape_json=(e,t)=>(Module._escape_json=wasmExports.escape_json)(e,t),Module._exprIsLengthCoercion=(e,t)=>(Module._exprIsLengthCoercion=wasmExports.exprIsLengthCoercion)(e,t),Module._tbm_add_tuples=(e,t,I,B)=>(Module._tbm_add_tuples=wasmExports.tbm_add_tuples)(e,t,I,B),Module._appendStringInfoStringQuoted=(e,t,I)=>(Module._appendStringInfoStringQuoted=wasmExports.appendStringInfoStringQuoted)(e,t,I),Module._list_make5_impl=(e,t,I,B,tr,rr)=>(Module._list_make5_impl=wasmExports.list_make5_impl)(e,t,I,B,tr,rr),Module._list_delete=(e,t)=>(Module._list_delete=wasmExports.list_delete)(e,t),Module._CleanQuerytext=(e,t,I)=>(Module._CleanQuerytext=wasmExports.CleanQuerytext)(e,t,I),Module._EnableQueryId=()=>(Module._EnableQueryId=wasmExports.EnableQueryId)(),Module._get_rel_type_id=e=>(Module._get_rel_type_id=wasmExports.get_rel_type_id)(e),Module._set_config_option=(e,t,I,B,tr,rr,ir,lr)=>(Module._set_config_option=wasmExports.set_config_option)(e,t,I,B,tr,rr,ir,lr),Module._NewGUCNestLevel=()=>(Module._NewGUCNestLevel=wasmExports.NewGUCNestLevel)(),Module._AtEOXact_GUC=(e,t)=>(Module._AtEOXact_GUC=wasmExports.AtEOXact_GUC)(e,t),Module._parse_int=(e,t,I,B)=>(Module._parse_int=wasmExports.parse_int)(e,t,I,B),Module._strtod=(e,t)=>(Module._strtod=wasmExports.strtod)(e,t),Module._parse_real=(e,t,I,B)=>(Module._parse_real=wasmExports.parse_real)(e,t,I,B),Module._DefineCustomBoolVariable=(e,t,I,B,tr,rr,ir,lr,dr,hr)=>(Module._DefineCustomBoolVariable=wasmExports.DefineCustomBoolVariable)(e,t,I,B,tr,rr,ir,lr,dr,hr),Module._DefineCustomIntVariable=(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr)=>(Module._DefineCustomIntVariable=wasmExports.DefineCustomIntVariable)(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr),Module._DefineCustomRealVariable=(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr)=>(Module._DefineCustomRealVariable=wasmExports.DefineCustomRealVariable)(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr),Module._DefineCustomStringVariable=(e,t,I,B,tr,rr,ir,lr,dr,hr)=>(Module._DefineCustomStringVariable=wasmExports.DefineCustomStringVariable)(e,t,I,B,tr,rr,ir,lr,dr,hr),Module._DefineCustomEnumVariable=(e,t,I,B,tr,rr,ir,lr,dr,hr,fr)=>(Module._DefineCustomEnumVariable=wasmExports.DefineCustomEnumVariable)(e,t,I,B,tr,rr,ir,lr,dr,hr,fr),Module._MarkGUCPrefixReserved=e=>(Module._MarkGUCPrefixReserved=wasmExports.MarkGUCPrefixReserved)(e),Module._strcspn=(e,t)=>(Module._strcspn=wasmExports.strcspn)(e,t),Module._BlockSampler_Init=(e,t,I,B)=>(Module._BlockSampler_Init=wasmExports.BlockSampler_Init)(e,t,I,B),Module._sampler_random_init_state=(e,t)=>(Module._sampler_random_init_state=wasmExports.sampler_random_init_state)(e,t),Module._BlockSampler_HasMore=e=>(Module._BlockSampler_HasMore=wasmExports.BlockSampler_HasMore)(e),Module._BlockSampler_Next=e=>(Module._BlockSampler_Next=wasmExports.BlockSampler_Next)(e),Module._sampler_random_fract=e=>(Module._sampler_random_fract=wasmExports.sampler_random_fract)(e),Module._reservoir_init_selection_state=(e,t)=>(Module._reservoir_init_selection_state=wasmExports.reservoir_init_selection_state)(e,t),Module._reservoir_get_next_S=(e,t,I)=>(Module._reservoir_get_next_S=wasmExports.reservoir_get_next_S)(e,t,I),Module._canonicalize_path=e=>(Module._canonicalize_path=wasmExports.canonicalize_path)(e),Module.__bt_mkscankey=(e,t)=>(Module.__bt_mkscankey=wasmExports._bt_mkscankey)(e,t),Module._nocache_index_getattr=(e,t,I)=>(Module._nocache_index_getattr=wasmExports.nocache_index_getattr)(e,t,I),Module._tuplesort_estimate_shared=e=>(Module._tuplesort_estimate_shared=wasmExports.tuplesort_estimate_shared)(e),Module._tuplesort_initialize_shared=(e,t,I)=>(Module._tuplesort_initialize_shared=wasmExports.tuplesort_initialize_shared)(e,t,I),Module._tuplesort_attach_shared=(e,t)=>(Module._tuplesort_attach_shared=wasmExports.tuplesort_attach_shared)(e,t),Module._GetCurrentTransactionNestLevel=()=>(Module._GetCurrentTransactionNestLevel=wasmExports.GetCurrentTransactionNestLevel)(),Module._in_error_recursion_trouble=()=>(Module._in_error_recursion_trouble=wasmExports.in_error_recursion_trouble)(),Module._strrchr=(e,t)=>(Module._strrchr=wasmExports.strrchr)(e,t),Module._errhidestmt=e=>(Module._errhidestmt=wasmExports.errhidestmt)(e),Module._err_generic_string=(e,t)=>(Module._err_generic_string=wasmExports.err_generic_string)(e,t),Module._getinternalerrposition=()=>(Module._getinternalerrposition=wasmExports.getinternalerrposition)(),Module._GetErrorContextStack=()=>(Module._GetErrorContextStack=wasmExports.GetErrorContextStack)(),Module._SplitIdentifierString=(e,t,I)=>(Module._SplitIdentifierString=wasmExports.SplitIdentifierString)(e,t,I),Module._appendStringInfoSpaces=(e,t)=>(Module._appendStringInfoSpaces=wasmExports.appendStringInfoSpaces)(e,t),Module._unpack_sql_state=e=>(Module._unpack_sql_state=wasmExports.unpack_sql_state)(e),Module._CreateTupleDescCopyConstr=e=>(Module._CreateTupleDescCopyConstr=wasmExports.CreateTupleDescCopyConstr)(e),Module._CachedPlanAllowsSimpleValidityCheck=(e,t,I)=>(Module._CachedPlanAllowsSimpleValidityCheck=wasmExports.CachedPlanAllowsSimpleValidityCheck)(e,t,I),Module._CachedPlanIsSimplyValid=(e,t,I)=>(Module._CachedPlanIsSimplyValid=wasmExports.CachedPlanIsSimplyValid)(e,t,I),Module._GetCachedExpression=e=>(Module._GetCachedExpression=wasmExports.GetCachedExpression)(e),Module._FreeCachedExpression=e=>(Module._FreeCachedExpression=wasmExports.FreeCachedExpression)(e),Module._MemoryContextDeleteChildren=e=>(Module._MemoryContextDeleteChildren=wasmExports.MemoryContextDeleteChildren)(e),Module._is_publishable_relation=e=>(Module._is_publishable_relation=wasmExports.is_publishable_relation)(e),Module._GetRelationPublications=e=>(Module._GetRelationPublications=wasmExports.GetRelationPublications)(e),Module._GetSchemaPublications=e=>(Module._GetSchemaPublications=wasmExports.GetSchemaPublications)(e),Module._index_getprocid=(e,t,I)=>(Module._index_getprocid=wasmExports.index_getprocid)(e,t,I),Module._get_rel_relispartition=e=>(Module._get_rel_relispartition=wasmExports.get_rel_relispartition)(e),Module._get_func_namespace=e=>(Module._get_func_namespace=wasmExports.get_func_namespace)(e),Module._get_typsubscript=(e,t)=>(Module._get_typsubscript=wasmExports.get_typsubscript)(e,t),Module._get_namespace_name_or_temp=e=>(Module._get_namespace_name_or_temp=wasmExports.get_namespace_name_or_temp)(e),Module._texteq=e=>(Module._texteq=wasmExports.texteq)(e),Module._GetUserIdAndSecContext=(e,t)=>(Module._GetUserIdAndSecContext=wasmExports.GetUserIdAndSecContext)(e,t),Module._SetUserIdAndSecContext=(e,t)=>(Module._SetUserIdAndSecContext=wasmExports.SetUserIdAndSecContext)(e,t),Module._DirectFunctionCall5Coll=(e,t,I,B,tr,rr,ir)=>(Module._DirectFunctionCall5Coll=wasmExports.DirectFunctionCall5Coll)(e,t,I,B,tr,rr,ir),Module._CallerFInfoFunctionCall2=(e,t,I,B,tr)=>(Module._CallerFInfoFunctionCall2=wasmExports.CallerFInfoFunctionCall2)(e,t,I,B,tr),Module._FunctionCall0Coll=(e,t)=>(Module._FunctionCall0Coll=wasmExports.FunctionCall0Coll)(e,t),Module._OutputFunctionCall=(e,t)=>(Module._OutputFunctionCall=wasmExports.OutputFunctionCall)(e,t),Module._get_fn_expr_rettype=e=>(Module._get_fn_expr_rettype=wasmExports.get_fn_expr_rettype)(e),Module._has_fn_opclass_options=e=>(Module._has_fn_opclass_options=wasmExports.has_fn_opclass_options)(e),Module._get_fn_opclass_options=e=>(Module._get_fn_opclass_options=wasmExports.get_fn_opclass_options)(e),Module._CheckFunctionValidatorAccess=(e,t)=>(Module._CheckFunctionValidatorAccess=wasmExports.CheckFunctionValidatorAccess)(e,t),Module._resolve_polymorphic_argtypes=(e,t,I,B)=>(Module._resolve_polymorphic_argtypes=wasmExports.resolve_polymorphic_argtypes)(e,t,I,B),Module._get_func_arg_info=(e,t,I,B)=>(Module._get_func_arg_info=wasmExports.get_func_arg_info)(e,t,I,B),Module._dlsym=(e,t)=>(Module._dlsym=wasmExports.dlsym)(e,t),Module._dlopen=(e,t)=>(Module._dlopen=wasmExports.dlopen)(e,t),Module._dlerror=()=>(Module._dlerror=wasmExports.dlerror)(),Module._dlclose=e=>(Module._dlclose=wasmExports.dlclose)(e),Module._find_rendezvous_variable=e=>(Module._find_rendezvous_variable=wasmExports.find_rendezvous_variable)(e),Module._fscanf=(e,t,I)=>(Module._fscanf=wasmExports.fscanf)(e,t,I),Module._strlcat=(e,t,I)=>(Module._strlcat=wasmExports.strlcat)(e,t,I),Module._pg_bindtextdomain=e=>(Module._pg_bindtextdomain=wasmExports.pg_bindtextdomain)(e),Module._pg_do_encoding_conversion=(e,t,I,B)=>(Module._pg_do_encoding_conversion=wasmExports.pg_do_encoding_conversion)(e,t,I,B),Module._report_invalid_encoding=(e,t,I)=>(Module._report_invalid_encoding=wasmExports.report_invalid_encoding)(e,t,I),Module._pg_encoding_to_char_private=e=>(Module._pg_encoding_to_char_private=wasmExports.pg_encoding_to_char_private)(e),Module._MemoryContextAllocHuge=(e,t)=>(Module._MemoryContextAllocHuge=wasmExports.MemoryContextAllocHuge)(e,t),Module._namein=e=>(Module._namein=wasmExports.namein)(e),Module._pg_char_to_encoding_private=e=>(Module._pg_char_to_encoding_private=wasmExports.pg_char_to_encoding_private)(e),Module._pg_encoding_max_length=e=>(Module._pg_encoding_max_length=wasmExports.pg_encoding_max_length)(e),Module._pg_server_to_any=(e,t,I)=>(Module._pg_server_to_any=wasmExports.pg_server_to_any)(e,t,I),Module._pg_utf_mblen=e=>(Module._pg_utf_mblen=wasmExports.pg_utf_mblen)(e),Module._pg_wchar2mb_with_len=(e,t,I)=>(Module._pg_wchar2mb_with_len=wasmExports.pg_wchar2mb_with_len)(e,t,I),Module._pg_encoding_mblen=(e,t)=>(Module._pg_encoding_mblen=wasmExports.pg_encoding_mblen)(e,t),Module._check_encoding_conversion_args=(e,t,I,B,tr)=>(Module._check_encoding_conversion_args=wasmExports.check_encoding_conversion_args)(e,t,I,B,tr),Module._report_untranslatable_char=(e,t,I,B)=>(Module._report_untranslatable_char=wasmExports.report_untranslatable_char)(e,t,I,B),Module._local2local=(e,t,I,B,tr,rr,ir)=>(Module._local2local=wasmExports.local2local)(e,t,I,B,tr,rr,ir),Module._latin2mic=(e,t,I,B,tr,rr)=>(Module._latin2mic=wasmExports.latin2mic)(e,t,I,B,tr,rr),Module._mic2latin=(e,t,I,B,tr,rr)=>(Module._mic2latin=wasmExports.mic2latin)(e,t,I,B,tr,rr),Module._latin2mic_with_table=(e,t,I,B,tr,rr,ir)=>(Module._latin2mic_with_table=wasmExports.latin2mic_with_table)(e,t,I,B,tr,rr,ir),Module._mic2latin_with_table=(e,t,I,B,tr,rr,ir)=>(Module._mic2latin_with_table=wasmExports.mic2latin_with_table)(e,t,I,B,tr,rr,ir),Module._pg_encoding_verifymbchar=(e,t,I)=>(Module._pg_encoding_verifymbchar=wasmExports.pg_encoding_verifymbchar)(e,t,I),Module._float_overflow_error=()=>(Module._float_overflow_error=wasmExports.float_overflow_error)(),Module._float_underflow_error=()=>(Module._float_underflow_error=wasmExports.float_underflow_error)(),Module._float4in_internal=(e,t,I,B,tr)=>(Module._float4in_internal=wasmExports.float4in_internal)(e,t,I,B,tr),Module._strtof=(e,t)=>(Module._strtof=wasmExports.strtof)(e,t),Module._float_to_shortest_decimal_buf=(e,t)=>(Module._float_to_shortest_decimal_buf=wasmExports.float_to_shortest_decimal_buf)(e,t),Module._float8in_internal=(e,t,I,B,tr)=>(Module._float8in_internal=wasmExports.float8in_internal)(e,t,I,B,tr),Module._float8out_internal=e=>(Module._float8out_internal=wasmExports.float8out_internal)(e),Module._btfloat4cmp=e=>(Module._btfloat4cmp=wasmExports.btfloat4cmp)(e),Module._btfloat8cmp=e=>(Module._btfloat8cmp=wasmExports.btfloat8cmp)(e),Module._pow=(e,t)=>(Module._pow=wasmExports.pow)(e,t),Module._log10=e=>(Module._log10=wasmExports.log10)(e),Module._acos=e=>(Module._acos=wasmExports.acos)(e),Module._asin=e=>(Module._asin=wasmExports.asin)(e),Module._cos=e=>(Module._cos=wasmExports.cos)(e),Module._sin=e=>(Module._sin=wasmExports.sin)(e),Module._fmod=(e,t)=>(Module._fmod=wasmExports.fmod)(e,t),Module._construct_array=(e,t,I,B,tr,rr)=>(Module._construct_array=wasmExports.construct_array)(e,t,I,B,tr,rr),Module._try_relation_open=(e,t)=>(Module._try_relation_open=wasmExports.try_relation_open)(e,t),Module._forkname_to_number=e=>(Module._forkname_to_number=wasmExports.forkname_to_number)(e),Module._numeric_lt=e=>(Module._numeric_lt=wasmExports.numeric_lt)(e),Module._int64_to_numeric=e=>(Module._int64_to_numeric=wasmExports.int64_to_numeric)(e),Module._numeric_sub=e=>(Module._numeric_sub=wasmExports.numeric_sub)(e),Module._numeric_ge=e=>(Module._numeric_ge=wasmExports.numeric_ge)(e),Module._inet_in=e=>(Module._inet_in=wasmExports.inet_in)(e),Module._format_operator=e=>(Module._format_operator=wasmExports.format_operator)(e),Module._RelationIsVisible=e=>(Module._RelationIsVisible=wasmExports.RelationIsVisible)(e),Module._pg_get_indexdef_columns_extended=(e,t)=>(Module._pg_get_indexdef_columns_extended=wasmExports.pg_get_indexdef_columns_extended)(e,t),Module._accumArrayResult=(e,t,I,B,tr)=>(Module._accumArrayResult=wasmExports.accumArrayResult)(e,t,I,B,tr),Module._makeArrayResult=(e,t)=>(Module._makeArrayResult=wasmExports.makeArrayResult)(e,t),Module._init_local_reloptions=(e,t)=>(Module._init_local_reloptions=wasmExports.init_local_reloptions)(e,t),Module._add_local_int_reloption=(e,t,I,B,tr,rr,ir)=>(Module._add_local_int_reloption=wasmExports.add_local_int_reloption)(e,t,I,B,tr,rr,ir),Module._pg_inet_net_ntop=(e,t,I,B,tr)=>(Module._pg_inet_net_ntop=wasmExports.pg_inet_net_ntop)(e,t,I,B,tr),Module._network_cmp=e=>(Module._network_cmp=wasmExports.network_cmp)(e),Module._convert_network_to_scalar=(e,t,I)=>(Module._convert_network_to_scalar=wasmExports.convert_network_to_scalar)(e,t,I),Module._JsonbValueToJsonb=e=>(Module._JsonbValueToJsonb=wasmExports.JsonbValueToJsonb)(e),Module._pushJsonbValue=(e,t,I)=>(Module._pushJsonbValue=wasmExports.pushJsonbValue)(e,t,I),Module._numeric_cmp=e=>(Module._numeric_cmp=wasmExports.numeric_cmp)(e),Module._timetz_cmp=e=>(Module._timetz_cmp=wasmExports.timetz_cmp)(e),Module._date_cmp=e=>(Module._date_cmp=wasmExports.date_cmp)(e),Module._time_cmp=e=>(Module._time_cmp=wasmExports.time_cmp)(e),Module._timestamp_cmp=e=>(Module._timestamp_cmp=wasmExports.timestamp_cmp)(e),Module._domain_check=(e,t,I,B,tr)=>(Module._domain_check=wasmExports.domain_check)(e,t,I,B,tr),Module._initArrayResult=(e,t,I)=>(Module._initArrayResult=wasmExports.initArrayResult)(e,t,I),Module._path_is_prefix_of_path=(e,t)=>(Module._path_is_prefix_of_path=wasmExports.path_is_prefix_of_path)(e,t),Module._path_is_relative_and_below_cwd=e=>(Module._path_is_relative_and_below_cwd=wasmExports.path_is_relative_and_below_cwd)(e),Module._ArrayGetIntegerTypmods=(e,t)=>(Module._ArrayGetIntegerTypmods=wasmExports.ArrayGetIntegerTypmods)(e,t),Module._bpchareq=e=>(Module._bpchareq=wasmExports.bpchareq)(e),Module._varstr_cmp=(e,t,I,B,tr)=>(Module._varstr_cmp=wasmExports.varstr_cmp)(e,t,I,B,tr),Module._bpcharlt=e=>(Module._bpcharlt=wasmExports.bpcharlt)(e),Module._bpcharle=e=>(Module._bpcharle=wasmExports.bpcharle)(e),Module._bpchargt=e=>(Module._bpchargt=wasmExports.bpchargt)(e),Module._bpcharge=e=>(Module._bpcharge=wasmExports.bpcharge)(e),Module._bpcharcmp=e=>(Module._bpcharcmp=wasmExports.bpcharcmp)(e),Module._current_query=e=>(Module._current_query=wasmExports.current_query)(e),Module._str_tolower=(e,t,I)=>(Module._str_tolower=wasmExports.str_tolower)(e,t,I),Module._TransferExpandedObject=(e,t)=>(Module._TransferExpandedObject=wasmExports.TransferExpandedObject)(e,t),Module._macaddr_cmp=e=>(Module._macaddr_cmp=wasmExports.macaddr_cmp)(e),Module._macaddr_lt=e=>(Module._macaddr_lt=wasmExports.macaddr_lt)(e),Module._macaddr_le=e=>(Module._macaddr_le=wasmExports.macaddr_le)(e),Module._macaddr_eq=e=>(Module._macaddr_eq=wasmExports.macaddr_eq)(e),Module._macaddr_ge=e=>(Module._macaddr_ge=wasmExports.macaddr_ge)(e),Module._macaddr_gt=e=>(Module._macaddr_gt=wasmExports.macaddr_gt)(e),Module._quote_ident=e=>(Module._quote_ident=wasmExports.quote_ident)(e),Module._timestamp_in=e=>(Module._timestamp_in=wasmExports.timestamp_in)(e),Module._ParseDateTime=(e,t,I,B,tr,rr,ir)=>(Module._ParseDateTime=wasmExports.ParseDateTime)(e,t,I,B,tr,rr,ir),Module._DecodeDateTime=(e,t,I,B,tr,rr,ir,lr)=>(Module._DecodeDateTime=wasmExports.DecodeDateTime)(e,t,I,B,tr,rr,ir,lr),Module.___multi3=(e,t,I,B,tr)=>(Module.___multi3=wasmExports.__multi3)(e,t,I,B,tr),Module._timestamptz_in=e=>(Module._timestamptz_in=wasmExports.timestamptz_in)(e),Module._timestamp_eq=e=>(Module._timestamp_eq=wasmExports.timestamp_eq)(e),Module._timestamp_lt=e=>(Module._timestamp_lt=wasmExports.timestamp_lt)(e),Module._timestamp_gt=e=>(Module._timestamp_gt=wasmExports.timestamp_gt)(e),Module._timestamp_le=e=>(Module._timestamp_le=wasmExports.timestamp_le)(e),Module._timestamp_ge=e=>(Module._timestamp_ge=wasmExports.timestamp_ge)(e),Module._interval_eq=e=>(Module._interval_eq=wasmExports.interval_eq)(e),Module._interval_lt=e=>(Module._interval_lt=wasmExports.interval_lt)(e),Module._interval_gt=e=>(Module._interval_gt=wasmExports.interval_gt)(e),Module._interval_le=e=>(Module._interval_le=wasmExports.interval_le)(e),Module._interval_ge=e=>(Module._interval_ge=wasmExports.interval_ge)(e),Module._interval_cmp=e=>(Module._interval_cmp=wasmExports.interval_cmp)(e),Module._timestamp_mi=e=>(Module._timestamp_mi=wasmExports.timestamp_mi)(e),Module._interval_um=e=>(Module._interval_um=wasmExports.interval_um)(e),Module._interval_mi=e=>(Module._interval_mi=wasmExports.interval_mi)(e),Module._IsValidJsonNumber=(e,t)=>(Module._IsValidJsonNumber=wasmExports.IsValidJsonNumber)(e,t),Module._btnamecmp=e=>(Module._btnamecmp=wasmExports.btnamecmp)(e),Module._strncpy=(e,t,I)=>(Module._strncpy=wasmExports.strncpy)(e,t,I),Module._expand_array=(e,t,I)=>(Module._expand_array=wasmExports.expand_array)(e,t,I),Module._pg_get_encoding_from_locale=(e,t)=>(Module._pg_get_encoding_from_locale=wasmExports.pg_get_encoding_from_locale)(e,t),Module._localtime=e=>(Module._localtime=wasmExports.localtime)(e),Module._strftime=(e,t,I,B)=>(Module._strftime=wasmExports.strftime)(e,t,I,B),Module._numeric_is_nan=e=>(Module._numeric_is_nan=wasmExports.numeric_is_nan)(e),Module._numeric_eq=e=>(Module._numeric_eq=wasmExports.numeric_eq)(e),Module._numeric_gt=e=>(Module._numeric_gt=wasmExports.numeric_gt)(e),Module._numeric_le=e=>(Module._numeric_le=wasmExports.numeric_le)(e),Module._numeric_div=e=>(Module._numeric_div=wasmExports.numeric_div)(e),Module._numeric_float8_no_overflow=e=>(Module._numeric_float8_no_overflow=wasmExports.numeric_float8_no_overflow)(e),Module._numeric_float4=e=>(Module._numeric_float4=wasmExports.numeric_float4)(e),Module._date_eq=e=>(Module._date_eq=wasmExports.date_eq)(e),Module._date_lt=e=>(Module._date_lt=wasmExports.date_lt)(e),Module._date_le=e=>(Module._date_le=wasmExports.date_le)(e),Module._date_gt=e=>(Module._date_gt=wasmExports.date_gt)(e),Module._date_ge=e=>(Module._date_ge=wasmExports.date_ge)(e),Module._date_mi=e=>(Module._date_mi=wasmExports.date_mi)(e),Module._time_eq=e=>(Module._time_eq=wasmExports.time_eq)(e),Module._time_lt=e=>(Module._time_lt=wasmExports.time_lt)(e),Module._time_le=e=>(Module._time_le=wasmExports.time_le)(e),Module._time_gt=e=>(Module._time_gt=wasmExports.time_gt)(e),Module._time_ge=e=>(Module._time_ge=wasmExports.time_ge)(e),Module._time_mi_time=e=>(Module._time_mi_time=wasmExports.time_mi_time)(e),Module._get_extension_oid=(e,t)=>(Module._get_extension_oid=wasmExports.get_extension_oid)(e,t),Module._pg_ltoa=(e,t)=>(Module._pg_ltoa=wasmExports.pg_ltoa)(e,t),Module._varbit_in=e=>(Module._varbit_in=wasmExports.varbit_in)(e),Module._biteq=e=>(Module._biteq=wasmExports.biteq)(e),Module._bitlt=e=>(Module._bitlt=wasmExports.bitlt)(e),Module._bitle=e=>(Module._bitle=wasmExports.bitle)(e),Module._bitgt=e=>(Module._bitgt=wasmExports.bitgt)(e),Module._bitge=e=>(Module._bitge=wasmExports.bitge)(e),Module._bitcmp=e=>(Module._bitcmp=wasmExports.bitcmp)(e),Module._tidin=e=>(Module._tidin=wasmExports.tidin)(e),Module._tidout=e=>(Module._tidout=wasmExports.tidout)(e),Module._cash_cmp=e=>(Module._cash_cmp=wasmExports.cash_cmp)(e),Module._arraycontsel=e=>(Module._arraycontsel=wasmExports.arraycontsel)(e),Module._arraycontjoinsel=e=>(Module._arraycontjoinsel=wasmExports.arraycontjoinsel)(e),Module._text_lt=e=>(Module._text_lt=wasmExports.text_lt)(e),Module._text_le=e=>(Module._text_le=wasmExports.text_le)(e),Module._text_gt=e=>(Module._text_gt=wasmExports.text_gt)(e),Module._text_ge=e=>(Module._text_ge=wasmExports.text_ge)(e),Module._bttextcmp=e=>(Module._bttextcmp=wasmExports.bttextcmp)(e),Module._byteaeq=e=>(Module._byteaeq=wasmExports.byteaeq)(e),Module._bytealt=e=>(Module._bytealt=wasmExports.bytealt)(e),Module._byteale=e=>(Module._byteale=wasmExports.byteale)(e),Module._byteagt=e=>(Module._byteagt=wasmExports.byteagt)(e),Module._byteage=e=>(Module._byteage=wasmExports.byteage)(e),Module._byteacmp=e=>(Module._byteacmp=wasmExports.byteacmp)(e),Module._to_hex32=e=>(Module._to_hex32=wasmExports.to_hex32)(e),Module._varstr_levenshtein=(e,t,I,B,tr,rr,ir,lr)=>(Module._varstr_levenshtein=wasmExports.varstr_levenshtein)(e,t,I,B,tr,rr,ir,lr),Module._utf8_to_unicode=e=>(Module._utf8_to_unicode=wasmExports.utf8_to_unicode)(e),Module._format_type_extended=(e,t,I)=>(Module._format_type_extended=wasmExports.format_type_extended)(e,t,I),Module._array_create_iterator=(e,t,I)=>(Module._array_create_iterator=wasmExports.array_create_iterator)(e,t,I),Module._array_iterate=(e,t,I)=>(Module._array_iterate=wasmExports.array_iterate)(e,t,I),Module._make_expanded_record_from_typeid=(e,t,I)=>(Module._make_expanded_record_from_typeid=wasmExports.make_expanded_record_from_typeid)(e,t,I),Module._make_expanded_record_from_tupdesc=(e,t)=>(Module._make_expanded_record_from_tupdesc=wasmExports.make_expanded_record_from_tupdesc)(e,t),Module._make_expanded_record_from_exprecord=(e,t)=>(Module._make_expanded_record_from_exprecord=wasmExports.make_expanded_record_from_exprecord)(e,t),Module._expanded_record_set_tuple=(e,t,I,B)=>(Module._expanded_record_set_tuple=wasmExports.expanded_record_set_tuple)(e,t,I,B),Module._expanded_record_get_tuple=e=>(Module._expanded_record_get_tuple=wasmExports.expanded_record_get_tuple)(e),Module._deconstruct_expanded_record=e=>(Module._deconstruct_expanded_record=wasmExports.deconstruct_expanded_record)(e),Module._expanded_record_lookup_field=(e,t,I)=>(Module._expanded_record_lookup_field=wasmExports.expanded_record_lookup_field)(e,t,I),Module._expanded_record_set_field_internal=(e,t,I,B,tr,rr)=>(Module._expanded_record_set_field_internal=wasmExports.expanded_record_set_field_internal)(e,t,I,B,tr,rr),Module._expanded_record_set_fields=(e,t,I,B)=>(Module._expanded_record_set_fields=wasmExports.expanded_record_set_fields)(e,t,I,B),Module._macaddr8_cmp=e=>(Module._macaddr8_cmp=wasmExports.macaddr8_cmp)(e),Module._macaddr8_lt=e=>(Module._macaddr8_lt=wasmExports.macaddr8_lt)(e),Module._macaddr8_le=e=>(Module._macaddr8_le=wasmExports.macaddr8_le)(e),Module._macaddr8_eq=e=>(Module._macaddr8_eq=wasmExports.macaddr8_eq)(e),Module._macaddr8_ge=e=>(Module._macaddr8_ge=wasmExports.macaddr8_ge)(e),Module._macaddr8_gt=e=>(Module._macaddr8_gt=wasmExports.macaddr8_gt)(e),Module._enum_lt=e=>(Module._enum_lt=wasmExports.enum_lt)(e),Module._enum_le=e=>(Module._enum_le=wasmExports.enum_le)(e),Module._enum_ge=e=>(Module._enum_ge=wasmExports.enum_ge)(e),Module._enum_gt=e=>(Module._enum_gt=wasmExports.enum_gt)(e),Module._enum_cmp=e=>(Module._enum_cmp=wasmExports.enum_cmp)(e),Module._uuid_in=e=>(Module._uuid_in=wasmExports.uuid_in)(e),Module._uuid_out=e=>(Module._uuid_out=wasmExports.uuid_out)(e),Module._uuid_cmp=e=>(Module._uuid_cmp=wasmExports.uuid_cmp)(e),Module._gen_random_uuid=e=>(Module._gen_random_uuid=wasmExports.gen_random_uuid)(e),Module._generic_restriction_selectivity=(e,t,I,B,tr,rr)=>(Module._generic_restriction_selectivity=wasmExports.generic_restriction_selectivity)(e,t,I,B,tr,rr),Module._genericcostestimate=(e,t,I,B)=>(Module._genericcostestimate=wasmExports.genericcostestimate)(e,t,I,B),Module._pg_xml_init=e=>(Module._pg_xml_init=wasmExports.pg_xml_init)(e),Module._xmlInitParser=()=>(Module._xmlInitParser=wasmExports.xmlInitParser)(),Module._xml_ereport=(e,t,I,B)=>(Module._xml_ereport=wasmExports.xml_ereport)(e,t,I,B),Module._pg_xml_done=(e,t)=>(Module._pg_xml_done=wasmExports.pg_xml_done)(e,t),Module._xmlXPathNewContext=e=>(Module._xmlXPathNewContext=wasmExports.xmlXPathNewContext)(e),Module._xmlXPathFreeContext=e=>(Module._xmlXPathFreeContext=wasmExports.xmlXPathFreeContext)(e),Module._xmlFreeDoc=e=>(Module._xmlFreeDoc=wasmExports.xmlFreeDoc)(e),Module._xmlXPathCompile=e=>(Module._xmlXPathCompile=wasmExports.xmlXPathCompile)(e),Module._xmlXPathCompiledEval=(e,t)=>(Module._xmlXPathCompiledEval=wasmExports.xmlXPathCompiledEval)(e,t),Module._xmlXPathFreeCompExpr=e=>(Module._xmlXPathFreeCompExpr=wasmExports.xmlXPathFreeCompExpr)(e),Module._xmlStrdup=e=>(Module._xmlStrdup=wasmExports.xmlStrdup)(e),Module._strnlen=(e,t)=>(Module._strnlen=wasmExports.strnlen)(e,t),Module._xmlXPathCastNodeToString=e=>(Module._xmlXPathCastNodeToString=wasmExports.xmlXPathCastNodeToString)(e),Module._heap_modify_tuple_by_cols=(e,t,I,B,tr,rr)=>(Module._heap_modify_tuple_by_cols=wasmExports.heap_modify_tuple_by_cols)(e,t,I,B,tr,rr),Module._ResourceOwnerReleaseAllPlanCacheRefs=e=>(Module._ResourceOwnerReleaseAllPlanCacheRefs=wasmExports.ResourceOwnerReleaseAllPlanCacheRefs)(e),Module._RegisterResourceReleaseCallback=(e,t)=>(Module._RegisterResourceReleaseCallback=wasmExports.RegisterResourceReleaseCallback)(e,t),Module._PinPortal=e=>(Module._PinPortal=wasmExports.PinPortal)(e),Module._UnpinPortal=e=>(Module._UnpinPortal=wasmExports.UnpinPortal)(e),Module._btint2cmp=e=>(Module._btint2cmp=wasmExports.btint2cmp)(e),Module._btint4cmp=e=>(Module._btint4cmp=wasmExports.btint4cmp)(e),Module._btoidcmp=e=>(Module._btoidcmp=wasmExports.btoidcmp)(e),Module._btcharcmp=e=>(Module._btcharcmp=wasmExports.btcharcmp)(e),Module._btint8cmp=e=>(Module._btint8cmp=wasmExports.btint8cmp)(e),Module._btboolcmp=e=>(Module._btboolcmp=wasmExports.btboolcmp)(e),Module._GetPublicationByName=(e,t)=>(Module._GetPublicationByName=wasmExports.GetPublicationByName)(e,t),Module._GetTopMostAncestorInPublication=(e,t,I)=>(Module._GetTopMostAncestorInPublication=wasmExports.GetTopMostAncestorInPublication)(e,t,I),Module._pub_collist_to_bitmapset=(e,t,I)=>(Module._pub_collist_to_bitmapset=wasmExports.pub_collist_to_bitmapset)(e,t,I),Module._getExtensionOfObject=(e,t)=>(Module._getExtensionOfObject=wasmExports.getExtensionOfObject)(e,t),Module._visibilitymap_prepare_truncate=(e,t)=>(Module._visibilitymap_prepare_truncate=wasmExports.visibilitymap_prepare_truncate)(e,t),Module._log_newpage_range=(e,t,I,B,tr)=>(Module._log_newpage_range=wasmExports.log_newpage_range)(e,t,I,B,tr),Module._function_parse_error_transpose=e=>(Module._function_parse_error_transpose=wasmExports.function_parse_error_transpose)(e),Module._IndexGetRelation=(e,t)=>(Module._IndexGetRelation=wasmExports.IndexGetRelation)(e,t),Module._RelnameGetRelid=e=>(Module._RelnameGetRelid=wasmExports.RelnameGetRelid)(e),Module._standard_ProcessUtility=(e,t,I,B,tr,rr,ir,lr)=>(Module._standard_ProcessUtility=wasmExports.standard_ProcessUtility)(e,t,I,B,tr,rr,ir,lr),Module._Async_Notify=(e,t)=>(Module._Async_Notify=wasmExports.Async_Notify)(e,t),Module._sigaddset=(e,t)=>(Module._sigaddset=wasmExports.sigaddset)(e,t),Module._fsync_pgdata=(e,t)=>(Module._fsync_pgdata=wasmExports.fsync_pgdata)(e,t),Module._get_restricted_token=()=>(Module._get_restricted_token=wasmExports.get_restricted_token)(),Module._pg_malloc=e=>(Module._pg_malloc=wasmExports.pg_malloc)(e),Module._pg_realloc=(e,t)=>(Module._pg_realloc=wasmExports.pg_realloc)(e,t),Module._pg_strdup=e=>(Module._pg_strdup=wasmExports.pg_strdup)(e),Module._simple_prompt=(e,t)=>(Module._simple_prompt=wasmExports.simple_prompt)(e,t),Module._interactive_file=()=>(Module._interactive_file=wasmExports.interactive_file)(),Module._interactive_one=()=>(Module._interactive_one=wasmExports.interactive_one)(),Module._pg_shutdown=()=>(Module._pg_shutdown=wasmExports.pg_shutdown)(),Module._interactive_write=e=>(Module._interactive_write=wasmExports.interactive_write)(e),Module._interactive_read=()=>(Module._interactive_read=wasmExports.interactive_read)(),Module._visibilitymap_pin=(e,t,I)=>(Module._visibilitymap_pin=wasmExports.visibilitymap_pin)(e,t,I),Module._HeapTupleSatisfiesVacuum=(e,t,I)=>(Module._HeapTupleSatisfiesVacuum=wasmExports.HeapTupleSatisfiesVacuum)(e,t,I),Module._visibilitymap_clear=(e,t,I,B)=>(Module._visibilitymap_clear=wasmExports.visibilitymap_clear)(e,t,I,B),Module._vac_estimate_reltuples=(e,t,I,B)=>(Module._vac_estimate_reltuples=wasmExports.vac_estimate_reltuples)(e,t,I,B),Module._heap_tuple_needs_eventual_freeze=e=>(Module._heap_tuple_needs_eventual_freeze=wasmExports.heap_tuple_needs_eventual_freeze)(e),Module._HeapTupleSatisfiesUpdate=(e,t,I)=>(Module._HeapTupleSatisfiesUpdate=wasmExports.HeapTupleSatisfiesUpdate)(e,t,I),Module._HeapTupleGetUpdateXid=e=>(Module._HeapTupleGetUpdateXid=wasmExports.HeapTupleGetUpdateXid)(e),Module._HeapTupleSatisfiesVisibility=(e,t,I)=>(Module._HeapTupleSatisfiesVisibility=wasmExports.HeapTupleSatisfiesVisibility)(e,t,I),Module._GetMultiXactIdMembers=(e,t,I,B)=>(Module._GetMultiXactIdMembers=wasmExports.GetMultiXactIdMembers)(e,t,I,B),Module._XLogRecGetBlockTagExtended=(e,t,I,B,tr,rr)=>(Module._XLogRecGetBlockTagExtended=wasmExports.XLogRecGetBlockTagExtended)(e,t,I,B,tr,rr),Module._toast_open_indexes=(e,t,I,B)=>(Module._toast_open_indexes=wasmExports.toast_open_indexes)(e,t,I,B),Module._init_toast_snapshot=e=>(Module._init_toast_snapshot=wasmExports.init_toast_snapshot)(e),Module._toast_close_indexes=(e,t,I)=>(Module._toast_close_indexes=wasmExports.toast_close_indexes)(e,t,I),Module._index_getprocinfo=(e,t,I)=>(Module._index_getprocinfo=wasmExports.index_getprocinfo)(e,t,I),Module._identify_opfamily_groups=(e,t)=>(Module._identify_opfamily_groups=wasmExports.identify_opfamily_groups)(e,t),Module._check_amproc_signature=(e,t,I,B,tr,rr)=>(Module._check_amproc_signature=wasmExports.check_amproc_signature)(e,t,I,B,tr,rr),Module._check_amoptsproc_signature=e=>(Module._check_amoptsproc_signature=wasmExports.check_amoptsproc_signature)(e),Module._check_amop_signature=(e,t,I,B)=>(Module._check_amop_signature=wasmExports.check_amop_signature)(e,t,I,B),Module._RelationGetIndexScan=(e,t,I)=>(Module._RelationGetIndexScan=wasmExports.RelationGetIndexScan)(e,t,I),Module.__hash_get_indextuple_hashkey=e=>(Module.__hash_get_indextuple_hashkey=wasmExports._hash_get_indextuple_hashkey)(e),Module.__hash_getbuf=(e,t,I,B)=>(Module.__hash_getbuf=wasmExports._hash_getbuf)(e,t,I,B),Module.__hash_relbuf=(e,t)=>(Module.__hash_relbuf=wasmExports._hash_relbuf)(e,t),Module.__hash_getbuf_with_strategy=(e,t,I,B,tr)=>(Module.__hash_getbuf_with_strategy=wasmExports._hash_getbuf_with_strategy)(e,t,I,B,tr),Module._build_reloptions=(e,t,I,B,tr,rr)=>(Module._build_reloptions=wasmExports.build_reloptions)(e,t,I,B,tr,rr),Module._index_form_tuple=(e,t,I)=>(Module._index_form_tuple=wasmExports.index_form_tuple)(e,t,I),Module.__hash_ovflblkno_to_bitno=(e,t)=>(Module.__hash_ovflblkno_to_bitno=wasmExports._hash_ovflblkno_to_bitno)(e,t),Module._brin_build_desc=e=>(Module._brin_build_desc=wasmExports.brin_build_desc)(e),Module._brin_deform_tuple=(e,t,I)=>(Module._brin_deform_tuple=wasmExports.brin_deform_tuple)(e,t,I),Module._brin_free_desc=e=>(Module._brin_free_desc=wasmExports.brin_free_desc)(e),Module._XLogRecGetBlockRefInfo=(e,t,I,B,tr)=>(Module._XLogRecGetBlockRefInfo=wasmExports.XLogRecGetBlockRefInfo)(e,t,I,B,tr),Module._ginPostingListDecode=(e,t)=>(Module._ginPostingListDecode=wasmExports.ginPostingListDecode)(e,t),Module._add_reloption_kind=()=>(Module._add_reloption_kind=wasmExports.add_reloption_kind)(),Module._register_reloptions_validator=(e,t)=>(Module._register_reloptions_validator=wasmExports.register_reloptions_validator)(e,t),Module._add_int_reloption=(e,t,I,B,tr,rr,ir)=>(Module._add_int_reloption=wasmExports.add_int_reloption)(e,t,I,B,tr,rr,ir),Module._XLogFindNextRecord=(e,t)=>(Module._XLogFindNextRecord=wasmExports.XLogFindNextRecord)(e,t),Module._RestoreBlockImage=(e,t,I)=>(Module._RestoreBlockImage=wasmExports.RestoreBlockImage)(e,t,I),Module._GenericXLogStart=e=>(Module._GenericXLogStart=wasmExports.GenericXLogStart)(e),Module._GenericXLogRegisterBuffer=(e,t,I)=>(Module._GenericXLogRegisterBuffer=wasmExports.GenericXLogRegisterBuffer)(e,t,I),Module._GenericXLogFinish=e=>(Module._GenericXLogFinish=wasmExports.GenericXLogFinish)(e),Module._GenericXLogAbort=e=>(Module._GenericXLogAbort=wasmExports.GenericXLogAbort)(e),Module._read_local_xlog_page_no_wait=(e,t,I,B,tr)=>(Module._read_local_xlog_page_no_wait=wasmExports.read_local_xlog_page_no_wait)(e,t,I,B,tr),Module._XLogRecStoreStats=(e,t)=>(Module._XLogRecStoreStats=wasmExports.XLogRecStoreStats)(e,t),Module._ReadMultiXactIdRange=(e,t)=>(Module._ReadMultiXactIdRange=wasmExports.ReadMultiXactIdRange)(e,t),Module._MultiXactIdPrecedesOrEquals=(e,t)=>(Module._MultiXactIdPrecedesOrEquals=wasmExports.MultiXactIdPrecedesOrEquals)(e,t),Module._RegisterXactCallback=(e,t)=>(Module._RegisterXactCallback=wasmExports.RegisterXactCallback)(e,t),Module._RegisterSubXactCallback=(e,t)=>(Module._RegisterSubXactCallback=wasmExports.RegisterSubXactCallback)(e,t),Module._ReleaseCurrentSubTransaction=()=>(Module._ReleaseCurrentSubTransaction=wasmExports.ReleaseCurrentSubTransaction)(),Module._WaitForParallelWorkersToAttach=e=>(Module._WaitForParallelWorkersToAttach=wasmExports.WaitForParallelWorkersToAttach)(e),Module.__bt_allequalimage=(e,t)=>(Module.__bt_allequalimage=wasmExports._bt_allequalimage)(e,t),Module.__bt_checkpage=(e,t)=>(Module.__bt_checkpage=wasmExports._bt_checkpage)(e,t),Module.__bt_relbuf=(e,t)=>(Module.__bt_relbuf=wasmExports._bt_relbuf)(e,t),Module.__bt_metaversion=(e,t,I)=>(Module.__bt_metaversion=wasmExports._bt_metaversion)(e,t,I),Module.__bt_search=(e,t,I,B,tr,rr)=>(Module.__bt_search=wasmExports._bt_search)(e,t,I,B,tr,rr),Module.__bt_compare=(e,t,I,B)=>(Module.__bt_compare=wasmExports._bt_compare)(e,t,I,B),Module.__bt_binsrch_insert=(e,t)=>(Module.__bt_binsrch_insert=wasmExports._bt_binsrch_insert)(e,t),Module.__bt_freestack=e=>(Module.__bt_freestack=wasmExports._bt_freestack)(e),Module.__bt_form_posting=(e,t,I)=>(Module.__bt_form_posting=wasmExports._bt_form_posting)(e,t,I),Module.__bt_check_natts=(e,t,I,B)=>(Module.__bt_check_natts=wasmExports._bt_check_natts)(e,t,I,B),Module._gistcheckpage=(e,t)=>(Module._gistcheckpage=wasmExports.gistcheckpage)(e,t),Module._EndCopyFrom=e=>(Module._EndCopyFrom=wasmExports.EndCopyFrom)(e),Module._ProcessCopyOptions=(e,t,I,B)=>(Module._ProcessCopyOptions=wasmExports.ProcessCopyOptions)(e,t,I,B),Module._CopyFromErrorCallback=e=>(Module._CopyFromErrorCallback=wasmExports.CopyFromErrorCallback)(e),Module._NextCopyFrom=(e,t,I,B)=>(Module._NextCopyFrom=wasmExports.NextCopyFrom)(e,t,I,B),Module._nextval=e=>(Module._nextval=wasmExports.nextval)(e),Module._defGetStreamingMode=e=>(Module._defGetStreamingMode=wasmExports.defGetStreamingMode)(e),Module._ExplainBeginOutput=e=>(Module._ExplainBeginOutput=wasmExports.ExplainBeginOutput)(e),Module._NewExplainState=()=>(Module._NewExplainState=wasmExports.NewExplainState)(),Module._ExplainEndOutput=e=>(Module._ExplainEndOutput=wasmExports.ExplainEndOutput)(e),Module._ExplainPrintPlan=(e,t)=>(Module._ExplainPrintPlan=wasmExports.ExplainPrintPlan)(e,t),Module._ExplainPrintTriggers=(e,t)=>(Module._ExplainPrintTriggers=wasmExports.ExplainPrintTriggers)(e,t),Module._ExplainPrintJITSummary=(e,t)=>(Module._ExplainPrintJITSummary=wasmExports.ExplainPrintJITSummary)(e,t),Module._ExplainPropertyInteger=(e,t,I,B)=>(Module._ExplainPropertyInteger=wasmExports.ExplainPropertyInteger)(e,t,I,B),Module._ExplainQueryText=(e,t)=>(Module._ExplainQueryText=wasmExports.ExplainQueryText)(e,t),Module._ExplainPropertyText=(e,t,I)=>(Module._ExplainPropertyText=wasmExports.ExplainPropertyText)(e,t,I),Module._ExplainQueryParameters=(e,t,I)=>(Module._ExplainQueryParameters=wasmExports.ExplainQueryParameters)(e,t,I),Module._pg_is_ascii=e=>(Module._pg_is_ascii=wasmExports.pg_is_ascii)(e),Module._fputs=(e,t)=>(Module._fputs=wasmExports.fputs)(e,t),Module._popen=(e,t)=>(Module._popen=wasmExports.popen)(e,t),Module._float_to_shortest_decimal_bufn=(e,t)=>(Module._float_to_shortest_decimal_bufn=wasmExports.float_to_shortest_decimal_bufn)(e,t),Module._pg_prng_uint64=e=>(Module._pg_prng_uint64=wasmExports.pg_prng_uint64)(e),Module._scram_ClientKey=(e,t,I,B,tr)=>(Module._scram_ClientKey=wasmExports.scram_ClientKey)(e,t,I,B,tr),Module._pg_encoding_dsplen=(e,t)=>(Module._pg_encoding_dsplen=wasmExports.pg_encoding_dsplen)(e,t),Module._getcwd=(e,t)=>(Module._getcwd=wasmExports.getcwd)(e,t),Module._pg_get_user_home_dir=(e,t,I)=>(Module._pg_get_user_home_dir=wasmExports.pg_get_user_home_dir)(e,t,I),Module._nanosleep=(e,t)=>(Module._nanosleep=wasmExports.nanosleep)(e,t),Module._snprintf=(e,t,I,B)=>(Module._snprintf=wasmExports.snprintf)(e,t,I,B),Module._pg_strerror_r=(e,t,I)=>(Module._pg_strerror_r=wasmExports.pg_strerror_r)(e,t,I),Module._pthread_mutex_lock=e=>(Module._pthread_mutex_lock=wasmExports.pthread_mutex_lock)(e),Module._pthread_mutex_unlock=e=>(Module._pthread_mutex_unlock=wasmExports.pthread_mutex_unlock)(e),Module._strncat=(e,t,I)=>(Module._strncat=wasmExports.strncat)(e,t,I),Module._PQexec=(e,t)=>(Module._PQexec=wasmExports.PQexec)(e,t),Module._PQsetSingleRowMode=e=>(Module._PQsetSingleRowMode=wasmExports.PQsetSingleRowMode)(e),Module._PQcmdStatus=e=>(Module._PQcmdStatus=wasmExports.PQcmdStatus)(e),Module._pthread_sigmask=(e,t,I)=>(Module._pthread_sigmask=wasmExports.pthread_sigmask)(e,t,I),Module._sigismember=(e,t)=>(Module._sigismember=wasmExports.sigismember)(e,t),Module._sigpending=e=>(Module._sigpending=wasmExports.sigpending)(e),Module._sigwait=(e,t)=>(Module._sigwait=wasmExports.sigwait)(e,t),Module._isolat1ToUTF8=(e,t,I,B)=>(Module._isolat1ToUTF8=wasmExports.isolat1ToUTF8)(e,t,I,B),Module._UTF8Toisolat1=(e,t,I,B)=>(Module._UTF8Toisolat1=wasmExports.UTF8Toisolat1)(e,t,I,B),Module._vfprintf=(e,t,I)=>(Module._vfprintf=wasmExports.vfprintf)(e,t,I),Module._vsnprintf=(e,t,I,B)=>(Module._vsnprintf=wasmExports.vsnprintf)(e,t,I,B),Module._xmlParserValidityWarning=(e,t,I)=>(Module._xmlParserValidityWarning=wasmExports.xmlParserValidityWarning)(e,t,I),Module._xmlParserValidityError=(e,t,I)=>(Module._xmlParserValidityError=wasmExports.xmlParserValidityError)(e,t,I),Module._xmlParserError=(e,t,I)=>(Module._xmlParserError=wasmExports.xmlParserError)(e,t,I),Module._xmlParserWarning=(e,t,I)=>(Module._xmlParserWarning=wasmExports.xmlParserWarning)(e,t,I),Module._fprintf=(e,t,I)=>(Module._fprintf=wasmExports.fprintf)(e,t,I),Module.___xmlParserInputBufferCreateFilename=(e,t)=>(Module.___xmlParserInputBufferCreateFilename=wasmExports.__xmlParserInputBufferCreateFilename)(e,t),Module.___xmlOutputBufferCreateFilename=(e,t,I)=>(Module.___xmlOutputBufferCreateFilename=wasmExports.__xmlOutputBufferCreateFilename)(e,t,I),Module._xmlSAX2InternalSubset=(e,t,I,B)=>(Module._xmlSAX2InternalSubset=wasmExports.xmlSAX2InternalSubset)(e,t,I,B),Module._xmlSAX2IsStandalone=e=>(Module._xmlSAX2IsStandalone=wasmExports.xmlSAX2IsStandalone)(e),Module._xmlSAX2HasInternalSubset=e=>(Module._xmlSAX2HasInternalSubset=wasmExports.xmlSAX2HasInternalSubset)(e),Module._xmlSAX2HasExternalSubset=e=>(Module._xmlSAX2HasExternalSubset=wasmExports.xmlSAX2HasExternalSubset)(e),Module._xmlSAX2ResolveEntity=(e,t,I)=>(Module._xmlSAX2ResolveEntity=wasmExports.xmlSAX2ResolveEntity)(e,t,I),Module._xmlSAX2GetEntity=(e,t)=>(Module._xmlSAX2GetEntity=wasmExports.xmlSAX2GetEntity)(e,t),Module._xmlSAX2EntityDecl=(e,t,I,B,tr,rr)=>(Module._xmlSAX2EntityDecl=wasmExports.xmlSAX2EntityDecl)(e,t,I,B,tr,rr),Module._xmlSAX2NotationDecl=(e,t,I,B)=>(Module._xmlSAX2NotationDecl=wasmExports.xmlSAX2NotationDecl)(e,t,I,B),Module._xmlSAX2AttributeDecl=(e,t,I,B,tr,rr,ir)=>(Module._xmlSAX2AttributeDecl=wasmExports.xmlSAX2AttributeDecl)(e,t,I,B,tr,rr,ir),Module._xmlSAX2ElementDecl=(e,t,I,B)=>(Module._xmlSAX2ElementDecl=wasmExports.xmlSAX2ElementDecl)(e,t,I,B),Module._xmlSAX2UnparsedEntityDecl=(e,t,I,B,tr)=>(Module._xmlSAX2UnparsedEntityDecl=wasmExports.xmlSAX2UnparsedEntityDecl)(e,t,I,B,tr),Module._xmlSAX2SetDocumentLocator=(e,t)=>(Module._xmlSAX2SetDocumentLocator=wasmExports.xmlSAX2SetDocumentLocator)(e,t),Module._xmlSAX2StartDocument=e=>(Module._xmlSAX2StartDocument=wasmExports.xmlSAX2StartDocument)(e),Module._xmlSAX2EndDocument=e=>(Module._xmlSAX2EndDocument=wasmExports.xmlSAX2EndDocument)(e),Module._xmlSAX2StartElement=(e,t,I)=>(Module._xmlSAX2StartElement=wasmExports.xmlSAX2StartElement)(e,t,I),Module._xmlSAX2EndElement=(e,t)=>(Module._xmlSAX2EndElement=wasmExports.xmlSAX2EndElement)(e,t),Module._xmlSAX2Reference=(e,t)=>(Module._xmlSAX2Reference=wasmExports.xmlSAX2Reference)(e,t),Module._xmlSAX2Characters=(e,t,I)=>(Module._xmlSAX2Characters=wasmExports.xmlSAX2Characters)(e,t,I),Module._xmlSAX2ProcessingInstruction=(e,t,I)=>(Module._xmlSAX2ProcessingInstruction=wasmExports.xmlSAX2ProcessingInstruction)(e,t,I),Module._xmlSAX2Comment=(e,t)=>(Module._xmlSAX2Comment=wasmExports.xmlSAX2Comment)(e,t),Module._xmlSAX2GetParameterEntity=(e,t)=>(Module._xmlSAX2GetParameterEntity=wasmExports.xmlSAX2GetParameterEntity)(e,t),Module._xmlSAX2CDataBlock=(e,t,I)=>(Module._xmlSAX2CDataBlock=wasmExports.xmlSAX2CDataBlock)(e,t,I),Module._xmlSAX2ExternalSubset=(e,t,I,B)=>(Module._xmlSAX2ExternalSubset=wasmExports.xmlSAX2ExternalSubset)(e,t,I,B),Module._xmlSAX2GetPublicId=e=>(Module._xmlSAX2GetPublicId=wasmExports.xmlSAX2GetPublicId)(e),Module._xmlSAX2GetSystemId=e=>(Module._xmlSAX2GetSystemId=wasmExports.xmlSAX2GetSystemId)(e),Module._xmlSAX2GetLineNumber=e=>(Module._xmlSAX2GetLineNumber=wasmExports.xmlSAX2GetLineNumber)(e),Module._xmlSAX2GetColumnNumber=e=>(Module._xmlSAX2GetColumnNumber=wasmExports.xmlSAX2GetColumnNumber)(e),Module._xmlSAX2IgnorableWhitespace=(e,t,I)=>(Module._xmlSAX2IgnorableWhitespace=wasmExports.xmlSAX2IgnorableWhitespace)(e,t,I),Module._xmlHashDefaultDeallocator=(e,t)=>(Module._xmlHashDefaultDeallocator=wasmExports.xmlHashDefaultDeallocator)(e,t),Module._iconv_open=(e,t)=>(Module._iconv_open=wasmExports.iconv_open)(e,t),Module._iconv_close=e=>(Module._iconv_close=wasmExports.iconv_close)(e),Module._iconv=(e,t,I,B,tr)=>(Module._iconv=wasmExports.iconv)(e,t,I,B,tr),Module._UTF8ToHtml=(e,t,I,B)=>(Module._UTF8ToHtml=wasmExports.UTF8ToHtml)(e,t,I,B),Module._xmlReadMemory=(e,t,I,B,tr)=>(Module._xmlReadMemory=wasmExports.xmlReadMemory)(e,t,I,B,tr),Module._xmlSAX2StartElementNs=(e,t,I,B,tr,rr,ir,lr,dr)=>(Module._xmlSAX2StartElementNs=wasmExports.xmlSAX2StartElementNs)(e,t,I,B,tr,rr,ir,lr,dr),Module._xmlSAX2EndElementNs=(e,t,I,B)=>(Module._xmlSAX2EndElementNs=wasmExports.xmlSAX2EndElementNs)(e,t,I,B),Module.___cxa_atexit=(e,t,I)=>(Module.___cxa_atexit=wasmExports.__cxa_atexit)(e,t,I),Module._xmlDocGetRootElement=e=>(Module._xmlDocGetRootElement=wasmExports.xmlDocGetRootElement)(e),Module._xmlFileMatch=e=>(Module._xmlFileMatch=wasmExports.xmlFileMatch)(e),Module._xmlFileOpen=e=>(Module._xmlFileOpen=wasmExports.xmlFileOpen)(e),Module._xmlFileRead=(e,t,I)=>(Module._xmlFileRead=wasmExports.xmlFileRead)(e,t,I),Module._xmlFileClose=e=>(Module._xmlFileClose=wasmExports.xmlFileClose)(e),Module._gzread=(e,t,I)=>(Module._gzread=wasmExports.gzread)(e,t,I),Module._gzclose=e=>(Module._gzclose=wasmExports.gzclose)(e),Module._gzdirect=e=>(Module._gzdirect=wasmExports.gzdirect)(e),Module._gzdopen=(e,t)=>(Module._gzdopen=wasmExports.gzdopen)(e,t),Module._gzopen=(e,t)=>(Module._gzopen=wasmExports.gzopen)(e,t),Module._gzwrite=(e,t,I)=>(Module._gzwrite=wasmExports.gzwrite)(e,t,I),Module._xmlUCSIsCatNd=e=>(Module._xmlUCSIsCatNd=wasmExports.xmlUCSIsCatNd)(e),Module._xmlUCSIsCatP=e=>(Module._xmlUCSIsCatP=wasmExports.xmlUCSIsCatP)(e),Module._xmlUCSIsCatZ=e=>(Module._xmlUCSIsCatZ=wasmExports.xmlUCSIsCatZ)(e),Module._xmlUCSIsCatC=e=>(Module._xmlUCSIsCatC=wasmExports.xmlUCSIsCatC)(e),Module._xmlUCSIsCatL=e=>(Module._xmlUCSIsCatL=wasmExports.xmlUCSIsCatL)(e),Module._xmlUCSIsCatLu=e=>(Module._xmlUCSIsCatLu=wasmExports.xmlUCSIsCatLu)(e),Module._xmlUCSIsCatLl=e=>(Module._xmlUCSIsCatLl=wasmExports.xmlUCSIsCatLl)(e),Module._xmlUCSIsCatLt=e=>(Module._xmlUCSIsCatLt=wasmExports.xmlUCSIsCatLt)(e),Module._xmlUCSIsCatLm=e=>(Module._xmlUCSIsCatLm=wasmExports.xmlUCSIsCatLm)(e),Module._xmlUCSIsCatLo=e=>(Module._xmlUCSIsCatLo=wasmExports.xmlUCSIsCatLo)(e),Module._xmlUCSIsCatM=e=>(Module._xmlUCSIsCatM=wasmExports.xmlUCSIsCatM)(e),Module._xmlUCSIsCatMn=e=>(Module._xmlUCSIsCatMn=wasmExports.xmlUCSIsCatMn)(e),Module._xmlUCSIsCatMc=e=>(Module._xmlUCSIsCatMc=wasmExports.xmlUCSIsCatMc)(e),Module._xmlUCSIsCatMe=e=>(Module._xmlUCSIsCatMe=wasmExports.xmlUCSIsCatMe)(e),Module._xmlUCSIsCatN=e=>(Module._xmlUCSIsCatN=wasmExports.xmlUCSIsCatN)(e),Module._xmlUCSIsCatNl=e=>(Module._xmlUCSIsCatNl=wasmExports.xmlUCSIsCatNl)(e),Module._xmlUCSIsCatNo=e=>(Module._xmlUCSIsCatNo=wasmExports.xmlUCSIsCatNo)(e),Module._xmlUCSIsCatPc=e=>(Module._xmlUCSIsCatPc=wasmExports.xmlUCSIsCatPc)(e),Module._xmlUCSIsCatPd=e=>(Module._xmlUCSIsCatPd=wasmExports.xmlUCSIsCatPd)(e),Module._xmlUCSIsCatPs=e=>(Module._xmlUCSIsCatPs=wasmExports.xmlUCSIsCatPs)(e),Module._xmlUCSIsCatPe=e=>(Module._xmlUCSIsCatPe=wasmExports.xmlUCSIsCatPe)(e),Module._xmlUCSIsCatPi=e=>(Module._xmlUCSIsCatPi=wasmExports.xmlUCSIsCatPi)(e),Module._xmlUCSIsCatPf=e=>(Module._xmlUCSIsCatPf=wasmExports.xmlUCSIsCatPf)(e),Module._xmlUCSIsCatPo=e=>(Module._xmlUCSIsCatPo=wasmExports.xmlUCSIsCatPo)(e),Module._xmlUCSIsCatZs=e=>(Module._xmlUCSIsCatZs=wasmExports.xmlUCSIsCatZs)(e),Module._xmlUCSIsCatZl=e=>(Module._xmlUCSIsCatZl=wasmExports.xmlUCSIsCatZl)(e),Module._xmlUCSIsCatZp=e=>(Module._xmlUCSIsCatZp=wasmExports.xmlUCSIsCatZp)(e),Module._xmlUCSIsCatS=e=>(Module._xmlUCSIsCatS=wasmExports.xmlUCSIsCatS)(e),Module._xmlUCSIsCatSm=e=>(Module._xmlUCSIsCatSm=wasmExports.xmlUCSIsCatSm)(e),Module._xmlUCSIsCatSc=e=>(Module._xmlUCSIsCatSc=wasmExports.xmlUCSIsCatSc)(e),Module._xmlUCSIsCatSk=e=>(Module._xmlUCSIsCatSk=wasmExports.xmlUCSIsCatSk)(e),Module._xmlUCSIsCatSo=e=>(Module._xmlUCSIsCatSo=wasmExports.xmlUCSIsCatSo)(e),Module._xmlUCSIsCatCc=e=>(Module._xmlUCSIsCatCc=wasmExports.xmlUCSIsCatCc)(e),Module._xmlUCSIsCatCf=e=>(Module._xmlUCSIsCatCf=wasmExports.xmlUCSIsCatCf)(e),Module._xmlUCSIsCatCo=e=>(Module._xmlUCSIsCatCo=wasmExports.xmlUCSIsCatCo)(e),Module._xmlUCSIsAegeanNumbers=e=>(Module._xmlUCSIsAegeanNumbers=wasmExports.xmlUCSIsAegeanNumbers)(e),Module._xmlUCSIsAlphabeticPresentationForms=e=>(Module._xmlUCSIsAlphabeticPresentationForms=wasmExports.xmlUCSIsAlphabeticPresentationForms)(e),Module._xmlUCSIsArabic=e=>(Module._xmlUCSIsArabic=wasmExports.xmlUCSIsArabic)(e),Module._xmlUCSIsArabicPresentationFormsA=e=>(Module._xmlUCSIsArabicPresentationFormsA=wasmExports.xmlUCSIsArabicPresentationFormsA)(e),Module._xmlUCSIsArabicPresentationFormsB=e=>(Module._xmlUCSIsArabicPresentationFormsB=wasmExports.xmlUCSIsArabicPresentationFormsB)(e),Module._xmlUCSIsArmenian=e=>(Module._xmlUCSIsArmenian=wasmExports.xmlUCSIsArmenian)(e),Module._xmlUCSIsArrows=e=>(Module._xmlUCSIsArrows=wasmExports.xmlUCSIsArrows)(e),Module._xmlUCSIsBasicLatin=e=>(Module._xmlUCSIsBasicLatin=wasmExports.xmlUCSIsBasicLatin)(e),Module._xmlUCSIsBengali=e=>(Module._xmlUCSIsBengali=wasmExports.xmlUCSIsBengali)(e),Module._xmlUCSIsBlockElements=e=>(Module._xmlUCSIsBlockElements=wasmExports.xmlUCSIsBlockElements)(e),Module._xmlUCSIsBopomofo=e=>(Module._xmlUCSIsBopomofo=wasmExports.xmlUCSIsBopomofo)(e),Module._xmlUCSIsBopomofoExtended=e=>(Module._xmlUCSIsBopomofoExtended=wasmExports.xmlUCSIsBopomofoExtended)(e),Module._xmlUCSIsBoxDrawing=e=>(Module._xmlUCSIsBoxDrawing=wasmExports.xmlUCSIsBoxDrawing)(e),Module._xmlUCSIsBraillePatterns=e=>(Module._xmlUCSIsBraillePatterns=wasmExports.xmlUCSIsBraillePatterns)(e),Module._xmlUCSIsBuhid=e=>(Module._xmlUCSIsBuhid=wasmExports.xmlUCSIsBuhid)(e),Module._xmlUCSIsByzantineMusicalSymbols=e=>(Module._xmlUCSIsByzantineMusicalSymbols=wasmExports.xmlUCSIsByzantineMusicalSymbols)(e),Module._xmlUCSIsCJKCompatibility=e=>(Module._xmlUCSIsCJKCompatibility=wasmExports.xmlUCSIsCJKCompatibility)(e),Module._xmlUCSIsCJKCompatibilityForms=e=>(Module._xmlUCSIsCJKCompatibilityForms=wasmExports.xmlUCSIsCJKCompatibilityForms)(e),Module._xmlUCSIsCJKCompatibilityIdeographs=e=>(Module._xmlUCSIsCJKCompatibilityIdeographs=wasmExports.xmlUCSIsCJKCompatibilityIdeographs)(e),Module._xmlUCSIsCJKCompatibilityIdeographsSupplement=e=>(Module._xmlUCSIsCJKCompatibilityIdeographsSupplement=wasmExports.xmlUCSIsCJKCompatibilityIdeographsSupplement)(e),Module._xmlUCSIsCJKRadicalsSupplement=e=>(Module._xmlUCSIsCJKRadicalsSupplement=wasmExports.xmlUCSIsCJKRadicalsSupplement)(e),Module._xmlUCSIsCJKSymbolsandPunctuation=e=>(Module._xmlUCSIsCJKSymbolsandPunctuation=wasmExports.xmlUCSIsCJKSymbolsandPunctuation)(e),Module._xmlUCSIsCJKUnifiedIdeographs=e=>(Module._xmlUCSIsCJKUnifiedIdeographs=wasmExports.xmlUCSIsCJKUnifiedIdeographs)(e),Module._xmlUCSIsCJKUnifiedIdeographsExtensionA=e=>(Module._xmlUCSIsCJKUnifiedIdeographsExtensionA=wasmExports.xmlUCSIsCJKUnifiedIdeographsExtensionA)(e),Module._xmlUCSIsCJKUnifiedIdeographsExtensionB=e=>(Module._xmlUCSIsCJKUnifiedIdeographsExtensionB=wasmExports.xmlUCSIsCJKUnifiedIdeographsExtensionB)(e),Module._xmlUCSIsCherokee=e=>(Module._xmlUCSIsCherokee=wasmExports.xmlUCSIsCherokee)(e),Module._xmlUCSIsCombiningDiacriticalMarks=e=>(Module._xmlUCSIsCombiningDiacriticalMarks=wasmExports.xmlUCSIsCombiningDiacriticalMarks)(e),Module._xmlUCSIsCombiningDiacriticalMarksforSymbols=e=>(Module._xmlUCSIsCombiningDiacriticalMarksforSymbols=wasmExports.xmlUCSIsCombiningDiacriticalMarksforSymbols)(e),Module._xmlUCSIsCombiningHalfMarks=e=>(Module._xmlUCSIsCombiningHalfMarks=wasmExports.xmlUCSIsCombiningHalfMarks)(e),Module._xmlUCSIsCombiningMarksforSymbols=e=>(Module._xmlUCSIsCombiningMarksforSymbols=wasmExports.xmlUCSIsCombiningMarksforSymbols)(e),Module._xmlUCSIsControlPictures=e=>(Module._xmlUCSIsControlPictures=wasmExports.xmlUCSIsControlPictures)(e),Module._xmlUCSIsCurrencySymbols=e=>(Module._xmlUCSIsCurrencySymbols=wasmExports.xmlUCSIsCurrencySymbols)(e),Module._xmlUCSIsCypriotSyllabary=e=>(Module._xmlUCSIsCypriotSyllabary=wasmExports.xmlUCSIsCypriotSyllabary)(e),Module._xmlUCSIsCyrillic=e=>(Module._xmlUCSIsCyrillic=wasmExports.xmlUCSIsCyrillic)(e),Module._xmlUCSIsCyrillicSupplement=e=>(Module._xmlUCSIsCyrillicSupplement=wasmExports.xmlUCSIsCyrillicSupplement)(e),Module._xmlUCSIsDeseret=e=>(Module._xmlUCSIsDeseret=wasmExports.xmlUCSIsDeseret)(e),Module._xmlUCSIsDevanagari=e=>(Module._xmlUCSIsDevanagari=wasmExports.xmlUCSIsDevanagari)(e),Module._xmlUCSIsDingbats=e=>(Module._xmlUCSIsDingbats=wasmExports.xmlUCSIsDingbats)(e),Module._xmlUCSIsEnclosedAlphanumerics=e=>(Module._xmlUCSIsEnclosedAlphanumerics=wasmExports.xmlUCSIsEnclosedAlphanumerics)(e),Module._xmlUCSIsEnclosedCJKLettersandMonths=e=>(Module._xmlUCSIsEnclosedCJKLettersandMonths=wasmExports.xmlUCSIsEnclosedCJKLettersandMonths)(e),Module._xmlUCSIsEthiopic=e=>(Module._xmlUCSIsEthiopic=wasmExports.xmlUCSIsEthiopic)(e),Module._xmlUCSIsGeneralPunctuation=e=>(Module._xmlUCSIsGeneralPunctuation=wasmExports.xmlUCSIsGeneralPunctuation)(e),Module._xmlUCSIsGeometricShapes=e=>(Module._xmlUCSIsGeometricShapes=wasmExports.xmlUCSIsGeometricShapes)(e),Module._xmlUCSIsGeorgian=e=>(Module._xmlUCSIsGeorgian=wasmExports.xmlUCSIsGeorgian)(e),Module._xmlUCSIsGothic=e=>(Module._xmlUCSIsGothic=wasmExports.xmlUCSIsGothic)(e),Module._xmlUCSIsGreek=e=>(Module._xmlUCSIsGreek=wasmExports.xmlUCSIsGreek)(e),Module._xmlUCSIsGreekExtended=e=>(Module._xmlUCSIsGreekExtended=wasmExports.xmlUCSIsGreekExtended)(e),Module._xmlUCSIsGreekandCoptic=e=>(Module._xmlUCSIsGreekandCoptic=wasmExports.xmlUCSIsGreekandCoptic)(e),Module._xmlUCSIsGujarati=e=>(Module._xmlUCSIsGujarati=wasmExports.xmlUCSIsGujarati)(e),Module._xmlUCSIsGurmukhi=e=>(Module._xmlUCSIsGurmukhi=wasmExports.xmlUCSIsGurmukhi)(e),Module._xmlUCSIsHalfwidthandFullwidthForms=e=>(Module._xmlUCSIsHalfwidthandFullwidthForms=wasmExports.xmlUCSIsHalfwidthandFullwidthForms)(e),Module._xmlUCSIsHangulCompatibilityJamo=e=>(Module._xmlUCSIsHangulCompatibilityJamo=wasmExports.xmlUCSIsHangulCompatibilityJamo)(e),Module._xmlUCSIsHangulJamo=e=>(Module._xmlUCSIsHangulJamo=wasmExports.xmlUCSIsHangulJamo)(e),Module._xmlUCSIsHangulSyllables=e=>(Module._xmlUCSIsHangulSyllables=wasmExports.xmlUCSIsHangulSyllables)(e),Module._xmlUCSIsHanunoo=e=>(Module._xmlUCSIsHanunoo=wasmExports.xmlUCSIsHanunoo)(e),Module._xmlUCSIsHebrew=e=>(Module._xmlUCSIsHebrew=wasmExports.xmlUCSIsHebrew)(e),Module._xmlUCSIsHighPrivateUseSurrogates=e=>(Module._xmlUCSIsHighPrivateUseSurrogates=wasmExports.xmlUCSIsHighPrivateUseSurrogates)(e),Module._xmlUCSIsHighSurrogates=e=>(Module._xmlUCSIsHighSurrogates=wasmExports.xmlUCSIsHighSurrogates)(e),Module._xmlUCSIsHiragana=e=>(Module._xmlUCSIsHiragana=wasmExports.xmlUCSIsHiragana)(e),Module._xmlUCSIsIPAExtensions=e=>(Module._xmlUCSIsIPAExtensions=wasmExports.xmlUCSIsIPAExtensions)(e),Module._xmlUCSIsIdeographicDescriptionCharacters=e=>(Module._xmlUCSIsIdeographicDescriptionCharacters=wasmExports.xmlUCSIsIdeographicDescriptionCharacters)(e),Module._xmlUCSIsKanbun=e=>(Module._xmlUCSIsKanbun=wasmExports.xmlUCSIsKanbun)(e),Module._xmlUCSIsKangxiRadicals=e=>(Module._xmlUCSIsKangxiRadicals=wasmExports.xmlUCSIsKangxiRadicals)(e),Module._xmlUCSIsKannada=e=>(Module._xmlUCSIsKannada=wasmExports.xmlUCSIsKannada)(e),Module._xmlUCSIsKatakana=e=>(Module._xmlUCSIsKatakana=wasmExports.xmlUCSIsKatakana)(e),Module._xmlUCSIsKatakanaPhoneticExtensions=e=>(Module._xmlUCSIsKatakanaPhoneticExtensions=wasmExports.xmlUCSIsKatakanaPhoneticExtensions)(e),Module._xmlUCSIsKhmer=e=>(Module._xmlUCSIsKhmer=wasmExports.xmlUCSIsKhmer)(e),Module._xmlUCSIsKhmerSymbols=e=>(Module._xmlUCSIsKhmerSymbols=wasmExports.xmlUCSIsKhmerSymbols)(e),Module._xmlUCSIsLao=e=>(Module._xmlUCSIsLao=wasmExports.xmlUCSIsLao)(e),Module._xmlUCSIsLatin1Supplement=e=>(Module._xmlUCSIsLatin1Supplement=wasmExports.xmlUCSIsLatin1Supplement)(e),Module._xmlUCSIsLatinExtendedA=e=>(Module._xmlUCSIsLatinExtendedA=wasmExports.xmlUCSIsLatinExtendedA)(e),Module._xmlUCSIsLatinExtendedB=e=>(Module._xmlUCSIsLatinExtendedB=wasmExports.xmlUCSIsLatinExtendedB)(e),Module._xmlUCSIsLatinExtendedAdditional=e=>(Module._xmlUCSIsLatinExtendedAdditional=wasmExports.xmlUCSIsLatinExtendedAdditional)(e),Module._xmlUCSIsLetterlikeSymbols=e=>(Module._xmlUCSIsLetterlikeSymbols=wasmExports.xmlUCSIsLetterlikeSymbols)(e),Module._xmlUCSIsLimbu=e=>(Module._xmlUCSIsLimbu=wasmExports.xmlUCSIsLimbu)(e),Module._xmlUCSIsLinearBIdeograms=e=>(Module._xmlUCSIsLinearBIdeograms=wasmExports.xmlUCSIsLinearBIdeograms)(e),Module._xmlUCSIsLinearBSyllabary=e=>(Module._xmlUCSIsLinearBSyllabary=wasmExports.xmlUCSIsLinearBSyllabary)(e),Module._xmlUCSIsLowSurrogates=e=>(Module._xmlUCSIsLowSurrogates=wasmExports.xmlUCSIsLowSurrogates)(e),Module._xmlUCSIsMalayalam=e=>(Module._xmlUCSIsMalayalam=wasmExports.xmlUCSIsMalayalam)(e),Module._xmlUCSIsMathematicalAlphanumericSymbols=e=>(Module._xmlUCSIsMathematicalAlphanumericSymbols=wasmExports.xmlUCSIsMathematicalAlphanumericSymbols)(e),Module._xmlUCSIsMathematicalOperators=e=>(Module._xmlUCSIsMathematicalOperators=wasmExports.xmlUCSIsMathematicalOperators)(e),Module._xmlUCSIsMiscellaneousMathematicalSymbolsA=e=>(Module._xmlUCSIsMiscellaneousMathematicalSymbolsA=wasmExports.xmlUCSIsMiscellaneousMathematicalSymbolsA)(e),Module._xmlUCSIsMiscellaneousMathematicalSymbolsB=e=>(Module._xmlUCSIsMiscellaneousMathematicalSymbolsB=wasmExports.xmlUCSIsMiscellaneousMathematicalSymbolsB)(e),Module._xmlUCSIsMiscellaneousSymbols=e=>(Module._xmlUCSIsMiscellaneousSymbols=wasmExports.xmlUCSIsMiscellaneousSymbols)(e),Module._xmlUCSIsMiscellaneousSymbolsandArrows=e=>(Module._xmlUCSIsMiscellaneousSymbolsandArrows=wasmExports.xmlUCSIsMiscellaneousSymbolsandArrows)(e),Module._xmlUCSIsMiscellaneousTechnical=e=>(Module._xmlUCSIsMiscellaneousTechnical=wasmExports.xmlUCSIsMiscellaneousTechnical)(e),Module._xmlUCSIsMongolian=e=>(Module._xmlUCSIsMongolian=wasmExports.xmlUCSIsMongolian)(e),Module._xmlUCSIsMusicalSymbols=e=>(Module._xmlUCSIsMusicalSymbols=wasmExports.xmlUCSIsMusicalSymbols)(e),Module._xmlUCSIsMyanmar=e=>(Module._xmlUCSIsMyanmar=wasmExports.xmlUCSIsMyanmar)(e),Module._xmlUCSIsNumberForms=e=>(Module._xmlUCSIsNumberForms=wasmExports.xmlUCSIsNumberForms)(e),Module._xmlUCSIsOgham=e=>(Module._xmlUCSIsOgham=wasmExports.xmlUCSIsOgham)(e),Module._xmlUCSIsOldItalic=e=>(Module._xmlUCSIsOldItalic=wasmExports.xmlUCSIsOldItalic)(e),Module._xmlUCSIsOpticalCharacterRecognition=e=>(Module._xmlUCSIsOpticalCharacterRecognition=wasmExports.xmlUCSIsOpticalCharacterRecognition)(e),Module._xmlUCSIsOriya=e=>(Module._xmlUCSIsOriya=wasmExports.xmlUCSIsOriya)(e),Module._xmlUCSIsOsmanya=e=>(Module._xmlUCSIsOsmanya=wasmExports.xmlUCSIsOsmanya)(e),Module._xmlUCSIsPhoneticExtensions=e=>(Module._xmlUCSIsPhoneticExtensions=wasmExports.xmlUCSIsPhoneticExtensions)(e),Module._xmlUCSIsPrivateUse=e=>(Module._xmlUCSIsPrivateUse=wasmExports.xmlUCSIsPrivateUse)(e),Module._xmlUCSIsPrivateUseArea=e=>(Module._xmlUCSIsPrivateUseArea=wasmExports.xmlUCSIsPrivateUseArea)(e),Module._xmlUCSIsRunic=e=>(Module._xmlUCSIsRunic=wasmExports.xmlUCSIsRunic)(e),Module._xmlUCSIsShavian=e=>(Module._xmlUCSIsShavian=wasmExports.xmlUCSIsShavian)(e),Module._xmlUCSIsSinhala=e=>(Module._xmlUCSIsSinhala=wasmExports.xmlUCSIsSinhala)(e),Module._xmlUCSIsSmallFormVariants=e=>(Module._xmlUCSIsSmallFormVariants=wasmExports.xmlUCSIsSmallFormVariants)(e),Module._xmlUCSIsSpacingModifierLetters=e=>(Module._xmlUCSIsSpacingModifierLetters=wasmExports.xmlUCSIsSpacingModifierLetters)(e),Module._xmlUCSIsSpecials=e=>(Module._xmlUCSIsSpecials=wasmExports.xmlUCSIsSpecials)(e),Module._xmlUCSIsSuperscriptsandSubscripts=e=>(Module._xmlUCSIsSuperscriptsandSubscripts=wasmExports.xmlUCSIsSuperscriptsandSubscripts)(e),Module._xmlUCSIsSupplementalArrowsA=e=>(Module._xmlUCSIsSupplementalArrowsA=wasmExports.xmlUCSIsSupplementalArrowsA)(e),Module._xmlUCSIsSupplementalArrowsB=e=>(Module._xmlUCSIsSupplementalArrowsB=wasmExports.xmlUCSIsSupplementalArrowsB)(e),Module._xmlUCSIsSupplementalMathematicalOperators=e=>(Module._xmlUCSIsSupplementalMathematicalOperators=wasmExports.xmlUCSIsSupplementalMathematicalOperators)(e),Module._xmlUCSIsSupplementaryPrivateUseAreaA=e=>(Module._xmlUCSIsSupplementaryPrivateUseAreaA=wasmExports.xmlUCSIsSupplementaryPrivateUseAreaA)(e),Module._xmlUCSIsSupplementaryPrivateUseAreaB=e=>(Module._xmlUCSIsSupplementaryPrivateUseAreaB=wasmExports.xmlUCSIsSupplementaryPrivateUseAreaB)(e),Module._xmlUCSIsSyriac=e=>(Module._xmlUCSIsSyriac=wasmExports.xmlUCSIsSyriac)(e),Module._xmlUCSIsTagalog=e=>(Module._xmlUCSIsTagalog=wasmExports.xmlUCSIsTagalog)(e),Module._xmlUCSIsTagbanwa=e=>(Module._xmlUCSIsTagbanwa=wasmExports.xmlUCSIsTagbanwa)(e),Module._xmlUCSIsTags=e=>(Module._xmlUCSIsTags=wasmExports.xmlUCSIsTags)(e),Module._xmlUCSIsTaiLe=e=>(Module._xmlUCSIsTaiLe=wasmExports.xmlUCSIsTaiLe)(e),Module._xmlUCSIsTaiXuanJingSymbols=e=>(Module._xmlUCSIsTaiXuanJingSymbols=wasmExports.xmlUCSIsTaiXuanJingSymbols)(e),Module._xmlUCSIsTamil=e=>(Module._xmlUCSIsTamil=wasmExports.xmlUCSIsTamil)(e),Module._xmlUCSIsTelugu=e=>(Module._xmlUCSIsTelugu=wasmExports.xmlUCSIsTelugu)(e),Module._xmlUCSIsThaana=e=>(Module._xmlUCSIsThaana=wasmExports.xmlUCSIsThaana)(e),Module._xmlUCSIsThai=e=>(Module._xmlUCSIsThai=wasmExports.xmlUCSIsThai)(e),Module._xmlUCSIsTibetan=e=>(Module._xmlUCSIsTibetan=wasmExports.xmlUCSIsTibetan)(e),Module._xmlUCSIsUgaritic=e=>(Module._xmlUCSIsUgaritic=wasmExports.xmlUCSIsUgaritic)(e),Module._xmlUCSIsUnifiedCanadianAboriginalSyllabics=e=>(Module._xmlUCSIsUnifiedCanadianAboriginalSyllabics=wasmExports.xmlUCSIsUnifiedCanadianAboriginalSyllabics)(e),Module._xmlUCSIsVariationSelectors=e=>(Module._xmlUCSIsVariationSelectors=wasmExports.xmlUCSIsVariationSelectors)(e),Module._xmlUCSIsVariationSelectorsSupplement=e=>(Module._xmlUCSIsVariationSelectorsSupplement=wasmExports.xmlUCSIsVariationSelectorsSupplement)(e),Module._xmlUCSIsYiRadicals=e=>(Module._xmlUCSIsYiRadicals=wasmExports.xmlUCSIsYiRadicals)(e),Module._xmlUCSIsYiSyllables=e=>(Module._xmlUCSIsYiSyllables=wasmExports.xmlUCSIsYiSyllables)(e),Module._xmlUCSIsYijingHexagramSymbols=e=>(Module._xmlUCSIsYijingHexagramSymbols=wasmExports.xmlUCSIsYijingHexagramSymbols)(e),Module._xmlUCSIsCatCs=e=>(Module._xmlUCSIsCatCs=wasmExports.xmlUCSIsCatCs)(e),Module.___small_fprintf=(e,t,I)=>(Module.___small_fprintf=wasmExports.__small_fprintf)(e,t,I),Module._xmlXPathBooleanFunction=(e,t)=>(Module._xmlXPathBooleanFunction=wasmExports.xmlXPathBooleanFunction)(e,t),Module._xmlXPathCeilingFunction=(e,t)=>(Module._xmlXPathCeilingFunction=wasmExports.xmlXPathCeilingFunction)(e,t),Module._xmlXPathCountFunction=(e,t)=>(Module._xmlXPathCountFunction=wasmExports.xmlXPathCountFunction)(e,t),Module._xmlXPathConcatFunction=(e,t)=>(Module._xmlXPathConcatFunction=wasmExports.xmlXPathConcatFunction)(e,t),Module._xmlXPathContainsFunction=(e,t)=>(Module._xmlXPathContainsFunction=wasmExports.xmlXPathContainsFunction)(e,t),Module._xmlXPathIdFunction=(e,t)=>(Module._xmlXPathIdFunction=wasmExports.xmlXPathIdFunction)(e,t),Module._xmlXPathFalseFunction=(e,t)=>(Module._xmlXPathFalseFunction=wasmExports.xmlXPathFalseFunction)(e,t),Module._xmlXPathFloorFunction=(e,t)=>(Module._xmlXPathFloorFunction=wasmExports.xmlXPathFloorFunction)(e,t),Module._xmlXPathLastFunction=(e,t)=>(Module._xmlXPathLastFunction=wasmExports.xmlXPathLastFunction)(e,t),Module._xmlXPathLangFunction=(e,t)=>(Module._xmlXPathLangFunction=wasmExports.xmlXPathLangFunction)(e,t),Module._xmlXPathLocalNameFunction=(e,t)=>(Module._xmlXPathLocalNameFunction=wasmExports.xmlXPathLocalNameFunction)(e,t),Module._xmlXPathNotFunction=(e,t)=>(Module._xmlXPathNotFunction=wasmExports.xmlXPathNotFunction)(e,t),Module._xmlXPathNamespaceURIFunction=(e,t)=>(Module._xmlXPathNamespaceURIFunction=wasmExports.xmlXPathNamespaceURIFunction)(e,t),Module._xmlXPathNormalizeFunction=(e,t)=>(Module._xmlXPathNormalizeFunction=wasmExports.xmlXPathNormalizeFunction)(e,t),Module._xmlXPathNumberFunction=(e,t)=>(Module._xmlXPathNumberFunction=wasmExports.xmlXPathNumberFunction)(e,t),Module._xmlXPathPositionFunction=(e,t)=>(Module._xmlXPathPositionFunction=wasmExports.xmlXPathPositionFunction)(e,t),Module._xmlXPathRoundFunction=(e,t)=>(Module._xmlXPathRoundFunction=wasmExports.xmlXPathRoundFunction)(e,t),Module._xmlXPathStringFunction=(e,t)=>(Module._xmlXPathStringFunction=wasmExports.xmlXPathStringFunction)(e,t),Module._xmlXPathStringLengthFunction=(e,t)=>(Module._xmlXPathStringLengthFunction=wasmExports.xmlXPathStringLengthFunction)(e,t),Module._xmlXPathStartsWithFunction=(e,t)=>(Module._xmlXPathStartsWithFunction=wasmExports.xmlXPathStartsWithFunction)(e,t),Module._xmlXPathSubstringFunction=(e,t)=>(Module._xmlXPathSubstringFunction=wasmExports.xmlXPathSubstringFunction)(e,t),Module._xmlXPathSubstringBeforeFunction=(e,t)=>(Module._xmlXPathSubstringBeforeFunction=wasmExports.xmlXPathSubstringBeforeFunction)(e,t),Module._xmlXPathSubstringAfterFunction=(e,t)=>(Module._xmlXPathSubstringAfterFunction=wasmExports.xmlXPathSubstringAfterFunction)(e,t),Module._xmlXPathSumFunction=(e,t)=>(Module._xmlXPathSumFunction=wasmExports.xmlXPathSumFunction)(e,t),Module._xmlXPathTrueFunction=(e,t)=>(Module._xmlXPathTrueFunction=wasmExports.xmlXPathTrueFunction)(e,t),Module._xmlXPathTranslateFunction=(e,t)=>(Module._xmlXPathTranslateFunction=wasmExports.xmlXPathTranslateFunction)(e,t),Module._xmlXPathNextSelf=(e,t)=>(Module._xmlXPathNextSelf=wasmExports.xmlXPathNextSelf)(e,t),Module._xmlXPathNextChild=(e,t)=>(Module._xmlXPathNextChild=wasmExports.xmlXPathNextChild)(e,t),Module._xmlXPathNextDescendant=(e,t)=>(Module._xmlXPathNextDescendant=wasmExports.xmlXPathNextDescendant)(e,t),Module._xmlXPathNextDescendantOrSelf=(e,t)=>(Module._xmlXPathNextDescendantOrSelf=wasmExports.xmlXPathNextDescendantOrSelf)(e,t),Module._xmlXPathNextParent=(e,t)=>(Module._xmlXPathNextParent=wasmExports.xmlXPathNextParent)(e,t),Module._xmlXPathNextAncestor=(e,t)=>(Module._xmlXPathNextAncestor=wasmExports.xmlXPathNextAncestor)(e,t),Module._xmlXPathNextAncestorOrSelf=(e,t)=>(Module._xmlXPathNextAncestorOrSelf=wasmExports.xmlXPathNextAncestorOrSelf)(e,t),Module._xmlXPathNextFollowingSibling=(e,t)=>(Module._xmlXPathNextFollowingSibling=wasmExports.xmlXPathNextFollowingSibling)(e,t),Module._xmlXPathNextPrecedingSibling=(e,t)=>(Module._xmlXPathNextPrecedingSibling=wasmExports.xmlXPathNextPrecedingSibling)(e,t),Module._xmlXPathNextFollowing=(e,t)=>(Module._xmlXPathNextFollowing=wasmExports.xmlXPathNextFollowing)(e,t),Module._xmlXPathNextNamespace=(e,t)=>(Module._xmlXPathNextNamespace=wasmExports.xmlXPathNextNamespace)(e,t),Module._xmlXPathNextAttribute=(e,t)=>(Module._xmlXPathNextAttribute=wasmExports.xmlXPathNextAttribute)(e,t),Module._zcalloc=(e,t,I)=>(Module._zcalloc=wasmExports.zcalloc)(e,t,I),Module._zcfree=(e,t)=>(Module._zcfree=wasmExports.zcfree)(e,t),Module._strerror=e=>(Module._strerror=wasmExports.strerror)(e);var ___dl_seterr=(e,t)=>(___dl_seterr=wasmExports.__dl_seterr)(e,t);Module._putc=(e,t)=>(Module._putc=wasmExports.putc)(e,t),Module._gmtime=e=>(Module._gmtime=wasmExports.gmtime)(e);var _htonl=e=>(_htonl=wasmExports.htonl)(e),_htons=e=>(_htons=wasmExports.htons)(e);Module._ioctl=(e,t,I)=>(Module._ioctl=wasmExports.ioctl)(e,t,I);var _emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),_ntohs=e=>(_ntohs=wasmExports.ntohs)(e);Module._srand=e=>(Module._srand=wasmExports.srand)(e),Module._rand=()=>(Module._rand=wasmExports.rand)();var __emscripten_timeout=(e,t)=>(__emscripten_timeout=wasmExports._emscripten_timeout)(e,t);Module.___floatsitf=(e,t)=>(Module.___floatsitf=wasmExports.__floatsitf)(e,t),Module.___multf3=(e,t,I,B,tr)=>(Module.___multf3=wasmExports.__multf3)(e,t,I,B,tr),Module.___extenddftf2=(e,t)=>(Module.___extenddftf2=wasmExports.__extenddftf2)(e,t),Module.___getf2=(e,t,I,B)=>(Module.___getf2=wasmExports.__getf2)(e,t,I,B),Module.___subtf3=(e,t,I,B,tr)=>(Module.___subtf3=wasmExports.__subtf3)(e,t,I,B,tr),Module.___letf2=(e,t,I,B)=>(Module.___letf2=wasmExports.__letf2)(e,t,I,B),Module.___lttf2=(e,t,I,B)=>(Module.___lttf2=wasmExports.__lttf2)(e,t,I,B);var _setThrew=(e,t)=>(_setThrew=wasmExports.setThrew)(e,t),__emscripten_tempret_set=e=>(__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=()=>(__emscripten_tempret_get=wasmExports._emscripten_tempret_get)();Module.___fixtfsi=(e,t)=>(Module.___fixtfsi=wasmExports.__fixtfsi)(e,t);var __emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)();Module._ScanKeywords=18770052,Module._stderr=18792480,Module._stdout=18792784,Module._TopMemoryContext=18830716,Module._MainLWLockArray=18800668,Module._MyProc=18802328,Module._MyProcPid=18824228,Module._MyLatch=18824260,Module._CurrentMemoryContext=18830712,Module._InterruptPending=18824092,Module._pg_global_prng_state=18936304,Module._CurrentResourceOwner=18830692,Module._InterruptHoldoffCount=18824132,Module._IsUnderPostmaster=18824165,Module._wal_level=18758340,Module._MyDatabaseId=18824148,Module._error_context_stack=18816816,Module._PG_exception_stack=18816820,Module.___THREW__=18950052,Module.___threwValue=18950056,Module._ShmemVariableCache=18849760,Module._shmem_startup_hook=18794508,Module._debug_query_string=18848300,Module._CritSectionCount=18824140,Module._old_snapshot_threshold=18823756,Module._TopTransactionResourceOwner=18830700,Module._LocalBufferBlockPointers=18800556,Module._BufferBlocks=18795304,Module._pgBufferUsage=18813728,Module._GUC_check_errdetail_string=18814680,Module._NBuffers=18690456,Module._BufferDescriptors=18795300,Module._ParallelWorkerNumber=18767008,Module._stdin=18792632,Module._ScanKeywordTokens=17487664,Module._post_parse_analyze_hook=18802584,Module._progname=18848060,Module._DataDir=18824144,Module._MyStartTime=18824232,Module._MyProcPort=18824248,Module._Log_directory=18803120,Module._Log_filename=18803124,Module._ConfigReloadPending=18803272,Module._ShutdownRequestPending=18803276,Module._process_shared_preload_libraries_in_progress=18824080,Module._wal_segment_size=18758360,Module._application_name=18815988,Module._XactIsoLevel=18758700,Module._RmgrTable=18758816,Module._CacheMemoryContext=18830728,Module._TopTransactionContext=18830736,Module._TTSOpsVirtual=18638668,Module._WalReceiverFunctions=18803712,Module._TTSOpsMinimalTuple=18638764,Module._cluster_name=18640444,Module._work_mem=18690432,Module._ClientAuthentication_hook=18804032,Module._cma_rsize=18848108,Module._SOCKET_DATA=18854312,Module._SOCKET_FILE=18854308,Module._TTSOpsHeapTuple=18638716,Module._SnapshotAnyData=18690240,Module._ExecutorStart_hook=18813600,Module._ExecutorRun_hook=18813604,Module._ExecutorFinish_hook=18813608,Module._ExecutorEnd_hook=18813612,Module._SPI_processed=18813624,Module._SPI_tuptable=18813632,Module._SPI_result=18813636,Module._pgWalUsage=18813840,Module._cpu_operator_cost=18638912,Module._planner_hook=18813876,Module._maintenance_work_mem=18690448,Module._max_parallel_maintenance_workers=18690452,Module._cpu_tuple_cost=18638896,Module._seq_page_cost=18638880,Module._check_function_bodies=18640389,Module._quote_all_identifiers=18848065,Module._extra_float_digits=18692128,Module._IntervalStyle=18824172,Module._pg_crc32_table=18115504,Module._oldSnapshotControl=18823760,Module._shmem_request_hook=18824084,Module._DateStyle=18690420,Module._pg_number_of_ones=18433360,Module._xmlStructuredError=18936668,Module._xmlStructuredErrorContext=18936676,Module._xmlGenericErrorContext=18936672,Module._xmlGenericError=18774356,Module._xmlIsBaseCharGroup=18774120,Module._xmlIsDigitGroup=18774152,Module._xmlIsCombiningGroup=18774136,Module._xmlIsExtenderGroup=18774168,Module._xmlFree=18774320,Module._ProcessUtility_hook=18848012,Module._single_mode_feed=18848076,Module._cma_wsize=18848116,Module._check_password_hook=18850784,Module._IDB_STAGE=18854320,Module._IDB_PIPE_FP=18854316,Module._pg_scram_mech=18774064,Module._pg_g_threadlock=18772168,Module._pgresStatus=18773856,Module._xmlIsPubidChar_tab=18433648,Module._xmlGetWarningsDefaultValue=18774348,Module._xmlMalloc=18774324,Module._xmlRealloc=18774332,Module._xmlLastError=18936688,Module._xmlMallocAtomic=18774328,Module._xmlMemStrdup=18774336,Module._xmlBufferAllocScheme=18774340,Module._xmlDefaultBufferSize=18774344,Module._xmlParserDebugEntities=18936628,Module._xmlDoValidityCheckingDefaultValue=18936632,Module._xmlLoadExtDtdDefaultValue=18936636,Module._xmlPedanticParserDefaultValue=18936640,Module._xmlLineNumbersDefaultValue=18936644,Module._xmlKeepBlanksDefaultValue=18774352,Module._xmlSubstituteEntitiesDefaultValue=18936648,Module._xmlRegisterNodeDefaultValue=18936652,Module._xmlDeregisterNodeDefaultValue=18936656,Module._xmlParserInputBufferCreateFilenameValue=18936660,Module._xmlOutputBufferCreateFilenameValue=18936664,Module._xmlIndentTreeOutput=18774360,Module._xmlTreeIndentString=18774364,Module._xmlSaveNoEmptyTags=18936680,Module._xmlDefaultSAXHandler=18774368,Module._xmlDefaultSAXLocator=18774480,Module._xmlParserMaxDepth=18775140,Module._xmlStringText=18435456,Module._xmlStringComment=18435471,Module._xmlStringTextNoenc=18435461,Module._xmlXPathNAN=18937352,Module._xmlXPathNINF=18937368,Module._xmlXPathPINF=18937360,Module._z_errmsg=18791696,Module.__length_code=18455120,Module.__dist_code=18454608;function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(I){if(stackRestore(t),I!==I+0)throw I;_setThrew(1,0)}}function invoke_v(e){var t=stackSave();try{getWasmTableEntry(e)()}catch(I){if(stackRestore(t),I!==I+0)throw I;_setThrew(1,0)}}function invoke_vi(e,t){var I=stackSave();try{getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;_setThrew(1,0)}}function invoke_iii(e,t,I){var B=stackSave();try{return getWasmTableEntry(e)(t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_iiiiii(e,t,I,B,tr,rr){var ir=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_viii(e,t,I,B){var tr=stackSave();try{getWasmTableEntry(e)(t,I,B)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_viiiiiii(e,t,I,B,tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr)}catch(hr){if(stackRestore(dr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_iiii(e,t,I,B){var tr=stackSave();try{return getWasmTableEntry(e)(t,I,B)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_viiii(e,t,I,B,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_iiiii(e,t,I,B,tr){var rr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_vii(e,t,I){var B=stackSave();try{getWasmTableEntry(e)(t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_ii(e,t){var I=stackSave();try{return getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;_setThrew(1,0)}}function invoke_viiiiiiii(e,t,I,B,tr,rr,ir,lr,dr){var hr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr)}catch(fr){if(stackRestore(hr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_viiiii(e,t,I,B,tr,rr){var ir=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_ij(e,t){var I=stackSave();try{return getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;_setThrew(1,0)}}function invoke_ji(e,t){var I=stackSave();try{return getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;return _setThrew(1,0),0n}}function invoke_ijiiiiii(e,t,I,B,tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr)}catch(hr){if(stackRestore(dr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_vij(e,t,I){var B=stackSave();try{getWasmTableEntry(e)(t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_vj(e,t){var I=stackSave();try{getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;_setThrew(1,0)}}function invoke_viijii(e,t,I,B,tr,rr){var ir=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_iiiiiji(e,t,I,B,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_viijiiii(e,t,I,B,tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr)}catch(hr){if(stackRestore(dr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_viij(e,t,I,B){var tr=stackSave();try{getWasmTableEntry(e)(t,I,B)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_jiiiiiiii(e,t,I,B,tr,rr,ir,lr,dr){var hr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr)}catch(fr){if(stackRestore(hr),fr!==fr+0)throw fr;return _setThrew(1,0),0n}}function invoke_jiiiii(e,t,I,B,tr,rr){var ir=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;return _setThrew(1,0),0n}}function invoke_iiiiiiiii(e,t,I,B,tr,rr,ir,lr,dr){var hr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr)}catch(fr){if(stackRestore(hr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_vji(e,t,I){var B=stackSave();try{getWasmTableEntry(e)(t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_iiiijii(e,t,I,B,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_vijiji(e,t,I,B,tr,rr){var ir=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_viji(e,t,I,B){var tr=stackSave();try{getWasmTableEntry(e)(t,I,B)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_iiij(e,t,I,B){var tr=stackSave();try{return getWasmTableEntry(e)(t,I,B)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_iiiiiiii(e,t,I,B,tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr)}catch(hr){if(stackRestore(dr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_iiiiiii(e,t,I,B,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_di(e,t){var I=stackSave();try{return getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;_setThrew(1,0)}}function invoke_id(e,t){var I=stackSave();try{return getWasmTableEntry(e)(t)}catch(B){if(stackRestore(I),B!==B+0)throw B;_setThrew(1,0)}}function invoke_ijiiiii(e,t,I,B,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_jiiii(e,t,I,B,tr){var rr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;return _setThrew(1,0),0n}}function invoke_viiiiii(e,t,I,B,tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_viiiiiiiiiiii(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr,_r){var yr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr,hr,fr,mr,_r)}catch(xr){if(stackRestore(yr),xr!==xr+0)throw xr;_setThrew(1,0)}}function invoke_jii(e,t,I){var B=stackSave();try{return getWasmTableEntry(e)(t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;return _setThrew(1,0),0n}}function invoke_iiiij(e,t,I,B,tr){var rr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_iiiiiiiiii(e,t,I,B,tr,rr,ir,lr,dr,hr){var fr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr,hr)}catch(mr){if(stackRestore(fr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_viiji(e,t,I,B,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_iiji(e,t,I,B){var tr=stackSave();try{return getWasmTableEntry(e)(t,I,B)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_vid(e,t,I){var B=stackSave();try{getWasmTableEntry(e)(t,I)}catch(tr){if(stackRestore(B),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_viiiiiiiii(e,t,I,B,tr,rr,ir,lr,dr,hr){var fr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr,hr)}catch(mr){if(stackRestore(fr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_viiij(e,t,I,B,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,I,B,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiii(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr,_r,yr,xr,Mr,vr){var Sr=stackSave();try{return getWasmTableEntry(e)(t,I,B,tr,rr,ir,lr,dr,hr,fr,mr,_r,yr,xr,Mr,vr)}catch(wr){if(stackRestore(Sr),wr!==wr+0)throw wr;_setThrew(1,0)}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.callMain=callMain,Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToNewUTF8=stringToNewUTF8,Module.stringToUTF8OnStack=stringToUTF8OnStack,Module.FS_createPreloadedFile=FS_createPreloadedFile,Module.FS_unlink=FS_unlink,Module.FS_createPath=FS_createPath,Module.FS_createDevice=FS_createDevice,Module.FS=FS,Module.FS_createDataFile=FS_createDataFile,Module.FS_createLazyFile=FS_createLazyFile;var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var I=e.length,B=stackAlloc((I+1)*4),tr=B;e.forEach(ir=>{HEAPU32[tr>>2]=stringToUTF8OnStack(ir),tr+=4}),HEAPU32[tr>>2]=0;try{var rr=t(I,B);return exitJS(rr),rr}catch(ir){return handleException(ir)}}}function run(e=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function t(){var I;calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),readyPromiseResolve(Module),(I=Module.onRuntimeInitialized)==null||I.call(Module),shouldRunNow&&callMain(e),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),moduleRtn=readyPromise,moduleRtn}})(),ke=Qe,Te=ke,Y,W,j$1,J,$,_e,ie,me,Z,ae,oe,se,V,G,k,K,O,qe,re,pe=class Ol extends z{constructor(t={},I={}){super(),R$2(this,O),R$2(this,Y,!1),R$2(this,W,!1),R$2(this,j$1,!1),R$2(this,J,!1),R$2(this,$,!1),R$2(this,_e,new H),R$2(this,ie,new H),R$2(this,me,new H),R$2(this,Z,!1),this.debug=0,R$2(this,ae),R$2(this,oe,[]),R$2(this,se,new ye),R$2(this,V),R$2(this,G),R$2(this,k,new Map),R$2(this,K,new Set),typeof t=="string"?I={dataDir:t,...I}:I=t,this.dataDir=I.dataDir,I.parsers!==void 0&&(this.parsers={...this.parsers,...I.parsers}),I.serializers!==void 0&&(this.serializers={...this.serializers,...I.serializers}),(I==null?void 0:I.debug)!==void 0&&(this.debug=I.debug),(I==null?void 0:I.relaxedDurability)!==void 0&&x$2(this,$,I.relaxedDurability),x$2(this,ae,I.extensions??{}),this.waitReady=T(this,O,qe).call(this,I??{})}static async create(t,I){let B=typeof t=="string"?{dataDir:t,...I??{}}:t??{},tr=new Ol(B);return await tr.waitReady,tr}get Module(){return this.mod}get ready(){return h$1(this,Y)&&!h$1(this,W)&&!h$1(this,j$1)}get closed(){return h$1(this,j$1)}async close(){await this._checkReady(),x$2(this,W,!0);for(let t of h$1(this,oe))await t();try{await this.execProtocol(O$1.end()),this.mod._pg_shutdown()}catch(t){let I=t;if(!(I.name==="ExitStatus"&&I.status===0))throw t}await this.fs.closeFs(),x$2(this,j$1,!0),x$2(this,W,!1)}async[Symbol.asyncDispose](){await this.close()}async _handleBlob(t){x$2(this,V,t?await t.arrayBuffer():void 0)}async _cleanupBlob(){x$2(this,V,void 0)}async _getWrittenBlob(){if(!h$1(this,G))return;let t=new Blob(h$1(this,G));return x$2(this,G,void 0),t}async _checkReady(){if(h$1(this,W))throw new Error("PGlite is closing");if(h$1(this,j$1))throw new Error("PGlite is closed");h$1(this,Y)||await this.waitReady}execProtocolRawSync(t){let I=t.length,B=this.mod;B._interactive_write(I),B.HEAPU8.set(t,1),B._interactive_one();let tr=I+2,rr=tr+B._interactive_read();return B.HEAPU8.subarray(tr,rr)}async execProtocolRaw(t,{syncToFs:I=!0}={}){let B=t.length,tr=this.mod;tr._interactive_write(B),tr.HEAPU8.set(t,1),tr._interactive_one();let rr=B+2,ir=rr+tr._interactive_read(),lr=tr.HEAPU8.subarray(rr,ir);return I&&await this.syncToFs(),lr}async execProtocol(t,{syncToFs:I=!0,throwOnError:B=!0,onNotice:tr}={}){let rr=await this.execProtocolRaw(t,{syncToFs:I}),ir=[];return h$1(this,se).parse(rr,lr=>{if(lr instanceof E){if(x$2(this,se,new ye),B)throw lr}else if(lr instanceof ne)this.debug>0&&console.warn(lr),tr&&tr(lr);else if(lr instanceof ee$1)switch(lr.text){case"BEGIN":x$2(this,J,!0);break;case"COMMIT":case"ROLLBACK":x$2(this,J,!1);break}else if(lr instanceof X){let dr=h$1(this,k).get(lr.channel);dr&&dr.forEach(hr=>{queueMicrotask(()=>hr(lr.payload))}),h$1(this,K).forEach(hr=>{queueMicrotask(()=>hr(lr.channel,lr.payload))})}ir.push(lr)}),{messages:ir,data:rr}}isInTransaction(){return h$1(this,J)}async syncToFs(){if(h$1(this,Z))return;x$2(this,Z,!0);let t=async()=>{await h$1(this,me).runExclusive(async()=>{x$2(this,Z,!1),await this.fs.syncToFs(h$1(this,$))})};h$1(this,$)?t():await t()}async listen(t,I){var tr;let B=Nr(t);h$1(this,k).has(B)||h$1(this,k).set(B,new Set),h$1(this,k).get(B).add(I);try{await this.exec(`LISTEN ${t}`)}catch(rr){throw h$1(this,k).get(B).delete(I),((tr=h$1(this,k).get(B))==null?void 0:tr.size)===0&&h$1(this,k).delete(B),rr}return async()=>{await this.unlisten(B,I)}}async unlisten(t,I){var tr,rr;let B=Nr(t);I?((tr=h$1(this,k).get(B))==null||tr.delete(I),((rr=h$1(this,k).get(B))==null?void 0:rr.size)===0&&(await this.exec(`UNLISTEN ${t}`),h$1(this,k).delete(B))):(await this.exec(`UNLISTEN ${t}`),h$1(this,k).delete(B))}onNotification(t){return h$1(this,K).add(t),()=>{h$1(this,K).delete(t)}}offNotification(t){h$1(this,K).delete(t)}async dumpDataDir(t){var B;let I=((B=this.dataDir)==null?void 0:B.split("/").pop())??"pgdata";return this.fs.dumpTar(I,t)}_runExclusiveQuery(t){return h$1(this,_e).runExclusive(t)}_runExclusiveTransaction(t){return h$1(this,ie).runExclusive(t)}async clone(){let t=await this.dumpDataDir("none");return new Ol({loadDataDir:t})}};Y=new WeakMap,W=new WeakMap,j$1=new WeakMap,J=new WeakMap,$=new WeakMap,_e=new WeakMap,ie=new WeakMap,me=new WeakMap,Z=new WeakMap,ae=new WeakMap,oe=new WeakMap,se=new WeakMap,V=new WeakMap,G=new WeakMap,k=new WeakMap,K=new WeakMap,O=new WeakSet,qe=async function(e){if(e.fs)this.fs=e.fs;else{let{dataDir:hr,fsType:fr}=Fe(e.dataDir);this.fs=await Ae(hr,fr)}let t={},I=[],B=[`PGDATA=${C}`,`PREFIX=${Vr}`,`PGUSER=${e.username??"postgres"}`,`PGDATABASE=${e.database??"template1"}`,"MODE=REACT","REPL=N",...this.debug?["-d",this.debug.toString()]:[]];e.wasmModule||Rr();let tr=e.fsBundle?e.fsBundle.arrayBuffer():Er(),rr;tr.then(hr=>{rr=hr});let ir={WASM_PREFIX:Vr,arguments:B,INITIAL_MEMORY:e.initialMemory,noExitRuntime:!0,...this.debug>0?{print:console.info,printErr:console.error}:{print:()=>{},printErr:()=>{}},instantiateWasm:(hr,fr)=>(Tr(hr,e.wasmModule).then(({instance:mr,module:_r})=>{fr(mr,_r)}),{}),getPreloadedPackage:(hr,fr)=>{if(hr==="postgres.data"){if(rr.byteLength!==fr)throw new Error(`Invalid FS bundle size: ${rr.byteLength} !== ${fr}`);return rr}throw new Error(`Unknown package: ${hr}`)},preRun:[hr=>{let fr=hr.FS.makedev(64,0),mr={open:_r=>{},close:_r=>{},read:(_r,yr,xr,Mr,vr)=>{let Sr=h$1(this,V);if(!Sr)throw new Error("No /dev/blob File or Blob provided to read from");let wr=new Uint8Array(Sr);if(vr>=wr.length)return 0;let br=Math.min(wr.length-vr,Mr);for(let Ar=0;Ar<br;Ar++)yr[xr+Ar]=wr[vr+Ar];return br},write:(_r,yr,xr,Mr,vr)=>(h$1(this,G)??x$2(this,G,[]),h$1(this,G).push(yr.slice(xr,xr+Mr)),Mr),llseek:(_r,yr,xr)=>{let Mr=h$1(this,V);if(!Mr)throw new Error("No /dev/blob File or Blob provided to llseek");let vr=yr;if(xr===1?vr+=_r.position:xr===2&&(vr=new Uint8Array(Mr).length),vr<0)throw new hr.FS.ErrnoError(28);return vr}};hr.FS.registerDevice(fr,mr),hr.FS.mkdev("/dev/blob",fr)}]},{emscriptenOpts:lr}=await this.fs.init(this,ir);ir=lr;for(let[hr,fr]of Object.entries(h$1(this,ae)))if(fr instanceof URL)t[hr]=ge(fr);else{let mr=await fr.setup(this,ir);if(mr.emscriptenOpts&&(ir=mr.emscriptenOpts),mr.namespaceObj){let _r=this;_r[hr]=mr.namespaceObj}mr.bundlePath&&(t[hr]=ge(mr.bundlePath)),mr.init&&I.push(mr.init),mr.close&&h$1(this,oe).push(mr.close)}if(ir.pg_extensions=t,await tr,this.mod=await Te(ir),await this.fs.initialSyncFs(),e.loadDataDir){if(this.mod.FS.analyzePath(C+"/PG_VERSION").exists)throw new Error("Database already exists, cannot load from tarball");T(this,O,re).call(this,"pglite: loading data from tarball"),await ce$1(this.mod.FS,e.loadDataDir,C)}this.mod.FS.analyzePath(C+"/PG_VERSION").exists?T(this,O,re).call(this,"pglite: found DB, resuming"):T(this,O,re).call(this,"pglite: no db"),await Pe(this.mod,(...hr)=>T(this,O,re).call(this,...hr));let dr=this.mod._pg_initdb();if(!dr)throw new Error("INITDB failed to return value");if(dr&1)throw new Error("INITDB failed");if(dr&2){let hr=e.username??"postgres",fr=e.database??"template1";if(dr&4){if(!(dr&12))throw new Error("Invalid db/user combination")}else if(fr!=="template1"&&hr!=="postgres")throw new Error("INITDB created a new datadir, but an alternative db/user was requested")}await this.syncToFs(),x$2(this,Y,!0),await this.exec("SET search_path TO public;"),await this._initArrayTypes();for(let hr of I)await hr()},re=function(...e){this.debug>0&&console.log(...e)};var Ue=pe;u$1();const initSql=`
|
|
139
|
-
|
|
140
|
-
create table if not exists "AnalyticsSeries"
|
|
141
|
-
(
|
|
142
|
-
id serial primary key,
|
|
143
|
-
source varchar(255) not null,
|
|
144
|
-
start timestamp not null,
|
|
145
|
-
"end" timestamp,
|
|
146
|
-
metric varchar(255) not null,
|
|
147
|
-
value real not null,
|
|
148
|
-
unit varchar(255),
|
|
149
|
-
fn varchar(255) not null,
|
|
150
|
-
params json
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
create unique index if not exists "AnalyticsSeries_pkey"
|
|
154
|
-
on "AnalyticsSeries" (id);
|
|
155
|
-
|
|
156
|
-
create index if not exists analyticsseries_end_index
|
|
157
|
-
on "AnalyticsSeries" ("end");
|
|
158
|
-
|
|
159
|
-
create index if not exists analyticsseries_fn_index
|
|
160
|
-
on "AnalyticsSeries" (fn);
|
|
161
|
-
|
|
162
|
-
create index if not exists analyticsseries_metric_index
|
|
163
|
-
on "AnalyticsSeries" (metric);
|
|
164
|
-
|
|
165
|
-
create index if not exists analyticsseries_source_index
|
|
166
|
-
on "AnalyticsSeries" (source);
|
|
167
|
-
|
|
168
|
-
create index if not exists analyticsseries_start_index
|
|
169
|
-
on "AnalyticsSeries" (start);
|
|
170
|
-
|
|
171
|
-
create index if not exists analyticsseries_unit_index
|
|
172
|
-
on "AnalyticsSeries" (unit);
|
|
173
|
-
|
|
174
|
-
create index if not exists analyticsseries_value_index
|
|
175
|
-
on "AnalyticsSeries" (value);
|
|
176
|
-
|
|
177
|
-
create table if not exists "AnalyticsDimension"
|
|
178
|
-
(
|
|
179
|
-
id serial primary key,
|
|
180
|
-
dimension varchar(255) not null,
|
|
181
|
-
path varchar(255) not null,
|
|
182
|
-
label varchar(255),
|
|
183
|
-
icon varchar(1000),
|
|
184
|
-
description text
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
create unique index if not exists "AnalyticsDimension_pkey"
|
|
188
|
-
on "AnalyticsDimension" (id);
|
|
189
|
-
|
|
190
|
-
create index if not exists analyticsdimension_dimension_index
|
|
191
|
-
on "AnalyticsDimension" (dimension);
|
|
192
|
-
|
|
193
|
-
create index if not exists analyticsdimension_path_index
|
|
194
|
-
on "AnalyticsDimension" (path);
|
|
195
|
-
|
|
196
|
-
create table if not exists "AnalyticsSeries_AnalyticsDimension"
|
|
197
|
-
(
|
|
198
|
-
"seriesId" integer not null
|
|
199
|
-
constraint analyticsseries_analyticsdimension_seriesid_foreign
|
|
200
|
-
references "AnalyticsSeries"
|
|
201
|
-
on delete cascade,
|
|
202
|
-
"dimensionId" integer not null
|
|
203
|
-
constraint analyticsseries_analyticsdimension_dimensionid_foreign
|
|
204
|
-
references "AnalyticsDimension"
|
|
205
|
-
on delete cascade
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
create index if not exists analyticsseries_analyticsdimension_dimensionid_index
|
|
209
|
-
on "AnalyticsSeries_AnalyticsDimension" ("dimensionId");
|
|
210
|
-
|
|
211
|
-
create index if not exists analyticsseries_analyticsdimension_seriesid_index
|
|
212
|
-
on "AnalyticsSeries_AnalyticsDimension" ("seriesId");
|
|
213
|
-
|
|
214
|
-
`;class MemoryAnalyticsStore extends KnexAnalyticsStore{constructor({knex:I,pgLiteFactory:B,queryLogger:tr,resultsLogger:rr,profiler:ir}={}){ir||(ir=new PassthroughAnalyticsProfiler);const lr=new PGLiteQueryExecutor(ir,tr,rr);super({executor:lr,knex:I||knex({client:"pg",useNullAsDefault:!0})});ji(this,"_pgLiteFactory");ji(this,"_queryLogger");ji(this,"_resultsLogger");ji(this,"_pgExecutor");ji(this,"_profiler");ji(this,"_sql",null);this._pgLiteFactory=B||Ue.create,this._queryLogger=tr||(()=>{}),this._resultsLogger=rr||(()=>{}),this._profiler=ir,this._pgExecutor=lr}async init(){this._sql=await this._pgLiteFactory(),this._pgExecutor.init(this._sql),await this._sql.exec(initSql)}async raw(I){return this._queryLogger(-1,I),await this._profiler.record("QueryRaw",async()=>{var tr;const B=await((tr=this._sql)==null?void 0:tr.exec(I));return this._resultsLogger(-1,B),parseRawResults(B||[])})}async destroy(){var I;super.destroy(),(I=this._sql)==null||I.close()}}class BrowserAnalyticsStore extends MemoryAnalyticsStore{constructor(t={databaseName:"analytics"}){t.pgLiteFactory||(t.pgLiteFactory=async()=>Ue.create({fs:new ee(t.databaseName),relaxedDurability:!0})),super(t)}}function getGlobal(e){var t;if(!(typeof window>"u"))return(t=window.powerhouse)==null?void 0:t[e]}function setGlobal(e,t){typeof window>"u"||(window.powerhouse=window.powerhouse||{},window.powerhouse[e]=t)}const logger$2=childLogger(["reactor-browser","analytics","provider"]),defaultQueryClient=new QueryClient,analyticsOptionsKey=["analytics","options"],analyticsStoreKey=["analytics","store"],analyticsEngineKey=["analytics","store"];async function createAnalyticsStore(e){const t=new BrowserAnalyticsStore(e);await t.init();const I=new AnalyticsQueryEngine(t);return{store:t,engine:I,options:e}}async function getAnalyticsStore(e){const t=getGlobal("analytics");if(!e||!e.databaseName){if(t)return(await t).store;throw new Error("Analytics store options are required if no global analytics store is available")}return t&&e.databaseName===(await t).options.databaseName?(await t).store:null}async function createOrGetAnalyticsStore(e){const t=await getAnalyticsStore(e);if(t)return t;if(!e)throw new Error("Analytics store options are required if no global analytics store is available");const I=createAnalyticsStore(e);return setGlobal("analytics",I),I.then(({store:B})=>{logger$2.verbose("Analytics store created",B)}).catch(B=>{logger$2.error("Analytics store creation failed",B)}),(await I).store}function useCreateAnalyticsStore(e){const t=useQueryClient();return useEffect(()=>{t.setQueryDefaults(analyticsOptionsKey,{queryFn:()=>e,staleTime:1/0,gcTime:1/0})},[t,e]),useMutation({mutationFn:async()=>{const I=await createOrGetAnalyticsStore(e);return t.setQueryDefaults(analyticsStoreKey,{queryFn:()=>I,staleTime:1/0,gcTime:1/0}),I}})}function useAnalyticsStoreAsync(e){return useQuery({queryKey:[analyticsStoreKey,e],queryFn:()=>getAnalyticsStore(e),retry:!0,throwOnError:!1})}function CreateAnalyticsStore(e){const t=useMemo(()=>"options"in e?e.options:"databaseName"in e&&e.databaseName?{databaseName:e.databaseName}:void 0,[e]),{mutate:I}=useCreateAnalyticsStore(t);return useEffect(()=>{t!=null&&t.databaseName&&I()},[t]),null}function AnalyticsProvider({children:e,queryClient:t=defaultQueryClient,...I}){return jsxs(QueryClientProvider,{client:t,children:[jsx(CreateAnalyticsStore,{...I}),e]})}function useAnalyticsEngineAsync(){return useQuery({queryKey:analyticsEngineKey,queryFn:async()=>{const e=getGlobal("analytics");if(!e)throw new Error("No analytics store available");return(await e).engine},retry:!1})}u$1();var M=5,U=async(e,t)=>{let I=new Set,B={async query(tr,rr,ir){let lr,dr,hr;if(typeof tr!="string"&&(lr=tr.signal,rr=tr.params,ir=tr.callback,dr=tr.offset,hr=tr.limit,tr=tr.query),dr===void 0!=(hr===void 0))throw new Error("offset and limit must be provided together");let fr=dr!==void 0&&hr!==void 0,mr;if(fr&&(typeof dr!="number"||isNaN(dr)||typeof hr!="number"||isNaN(hr)))throw new Error("offset and limit must be numbers");let _r=ir?[ir]:[],yr=Cr().replace(/-/g,""),xr=!1,Mr,vr,Sr=async()=>{await e.transaction(async Dr=>{let Or=rr&&rr.length>0?await Pr(e,tr,rr,Dr):tr;await Dr.exec(`CREATE OR REPLACE TEMP VIEW live_query_${yr}_view AS ${Or}`),vr=await q(Dr,`live_query_${yr}_view`),await F(Dr,vr,I),fr?(await Dr.exec(`
|
|
215
|
-
PREPARE live_query_${yr}_get(int, int) AS
|
|
216
|
-
SELECT * FROM live_query_${yr}_view
|
|
217
|
-
LIMIT $1 OFFSET $2;
|
|
218
|
-
`),await Dr.exec(`
|
|
219
|
-
PREPARE live_query_${yr}_get_total_count AS
|
|
220
|
-
SELECT COUNT(*) FROM live_query_${yr}_view;
|
|
221
|
-
`),mr=(await Dr.query(`EXECUTE live_query_${yr}_get_total_count;`)).rows[0].count,Mr={...await Dr.query(`EXECUTE live_query_${yr}_get(${hr}, ${dr});`),offset:dr,limit:hr,totalCount:mr}):(await Dr.exec(`
|
|
222
|
-
PREPARE live_query_${yr}_get AS
|
|
223
|
-
SELECT * FROM live_query_${yr}_view;
|
|
224
|
-
`),Mr=await Dr.query(`EXECUTE live_query_${yr}_get;`))})};await Sr();let wr=Ur(async({offset:Dr,limit:Or}={})=>{if(!fr&&(Dr!==void 0||Or!==void 0))throw new Error("offset and limit cannot be provided for non-windowed queries");if(Dr&&(typeof Dr!="number"||isNaN(Dr))||Or&&(typeof Or!="number"||isNaN(Or)))throw new Error("offset and limit must be numbers");dr=Dr??dr,hr=Or??hr;let zr=async($n=0)=>{if(_r.length!==0){try{fr?Mr={...await e.query(`EXECUTE live_query_${yr}_get(${hr}, ${dr});`),offset:dr,limit:hr,totalCount:mr}:Mr=await e.query(`EXECUTE live_query_${yr}_get;`)}catch(Fr){let $r=Fr.message;if($r.startsWith(`prepared statement "live_query_${yr}`)&&$r.endsWith("does not exist")){if($n>M)throw Fr;await Sr(),zr($n+1)}else throw Fr}if(S(_r,Mr),fr){let Fr=(await e.query(`EXECUTE live_query_${yr}_get_total_count;`)).rows[0].count;Fr!==mr&&(mr=Fr,wr())}}};await zr()}),br=await Promise.all(vr.map(Dr=>e.listen(`table_change__${Dr.schema_name}__${Dr.table_name}`,async()=>{wr()}))),Ar=Dr=>{if(xr)throw new Error("Live query is no longer active and cannot be subscribed to");_r.push(Dr)},kr=async Dr=>{Dr?_r=_r.filter(Or=>Or!==Or):_r=[],_r.length===0&&(xr=!0,await Promise.all(br.map(Or=>Or())),await e.exec(`
|
|
225
|
-
DROP VIEW IF EXISTS live_query_${yr}_view;
|
|
226
|
-
DEALLOCATE live_query_${yr}_get;
|
|
227
|
-
`))};return lr!=null&&lr.aborted?await kr():lr==null||lr.addEventListener("abort",()=>{kr()},{once:!0}),S(_r,Mr),{initialResults:Mr,subscribe:Ar,unsubscribe:kr,refresh:wr}},async changes(tr,rr,ir,lr){let dr;if(typeof tr!="string"&&(dr=tr.signal,rr=tr.params,ir=tr.key,lr=tr.callback,tr=tr.query),!ir)throw new Error("key is required for changes queries");let hr=lr?[lr]:[],fr=Cr().replace(/-/g,""),mr=!1,_r,yr=1,xr,Mr=async()=>{await e.transaction(async Ar=>{let kr=await Pr(e,tr,rr,Ar);await Ar.query(`CREATE OR REPLACE TEMP VIEW live_query_${fr}_view AS ${kr}`),_r=await q(Ar,`live_query_${fr}_view`),await F(Ar,_r,I);let Dr=[...(await Ar.query(`
|
|
228
|
-
SELECT column_name, data_type, udt_name
|
|
229
|
-
FROM information_schema.columns
|
|
230
|
-
WHERE table_name = 'live_query_${fr}_view'
|
|
231
|
-
`)).rows,{column_name:"__after__",data_type:"integer"}];await Ar.exec(`
|
|
232
|
-
CREATE TEMP TABLE live_query_${fr}_state1 (LIKE live_query_${fr}_view INCLUDING ALL);
|
|
233
|
-
CREATE TEMP TABLE live_query_${fr}_state2 (LIKE live_query_${fr}_view INCLUDING ALL);
|
|
234
|
-
`);for(let Or of[1,2]){let zr=Or===1?2:1;await Ar.exec(`
|
|
235
|
-
PREPARE live_query_${fr}_diff${Or} AS
|
|
236
|
-
WITH
|
|
237
|
-
prev AS (SELECT LAG("${ir}") OVER () as __after__, * FROM live_query_${fr}_state${zr}),
|
|
238
|
-
curr AS (SELECT LAG("${ir}") OVER () as __after__, * FROM live_query_${fr}_state${Or}),
|
|
239
|
-
data_diff AS (
|
|
240
|
-
-- INSERT operations: Include all columns
|
|
241
|
-
SELECT
|
|
242
|
-
'INSERT' AS __op__,
|
|
243
|
-
${Dr.map(({column_name:$n})=>`curr."${$n}" AS "${$n}"`).join(`,
|
|
244
|
-
`)},
|
|
245
|
-
ARRAY[]::text[] AS __changed_columns__
|
|
246
|
-
FROM curr
|
|
247
|
-
LEFT JOIN prev ON curr.${ir} = prev.${ir}
|
|
248
|
-
WHERE prev.${ir} IS NULL
|
|
249
|
-
UNION ALL
|
|
250
|
-
-- DELETE operations: Include only the primary key
|
|
251
|
-
SELECT
|
|
252
|
-
'DELETE' AS __op__,
|
|
253
|
-
${Dr.map(({column_name:$n,data_type:Fr,udt_name:$r})=>$n===ir?`prev."${$n}" AS "${$n}"`:`NULL${Fr==="USER-DEFINED"?`::${$r}`:""} AS "${$n}"`).join(`,
|
|
254
|
-
`)},
|
|
255
|
-
ARRAY[]::text[] AS __changed_columns__
|
|
256
|
-
FROM prev
|
|
257
|
-
LEFT JOIN curr ON prev.${ir} = curr.${ir}
|
|
258
|
-
WHERE curr.${ir} IS NULL
|
|
259
|
-
UNION ALL
|
|
260
|
-
-- UPDATE operations: Include only changed columns
|
|
261
|
-
SELECT
|
|
262
|
-
'UPDATE' AS __op__,
|
|
263
|
-
${Dr.map(({column_name:$n,data_type:Fr,udt_name:$r})=>$n===ir?`curr."${$n}" AS "${$n}"`:`CASE
|
|
264
|
-
WHEN curr."${$n}" IS DISTINCT FROM prev."${$n}"
|
|
265
|
-
THEN curr."${$n}"
|
|
266
|
-
ELSE NULL${Fr==="USER-DEFINED"?`::${$r}`:""}
|
|
267
|
-
END AS "${$n}"`).join(`,
|
|
268
|
-
`)},
|
|
269
|
-
ARRAY(SELECT unnest FROM unnest(ARRAY[${Dr.filter(({column_name:$n})=>$n!==ir).map(({column_name:$n})=>`CASE
|
|
270
|
-
WHEN curr."${$n}" IS DISTINCT FROM prev."${$n}"
|
|
271
|
-
THEN '${$n}'
|
|
272
|
-
ELSE NULL
|
|
273
|
-
END`).join(", ")}]) WHERE unnest IS NOT NULL) AS __changed_columns__
|
|
274
|
-
FROM curr
|
|
275
|
-
INNER JOIN prev ON curr.${ir} = prev.${ir}
|
|
276
|
-
WHERE NOT (curr IS NOT DISTINCT FROM prev)
|
|
277
|
-
)
|
|
278
|
-
SELECT * FROM data_diff;
|
|
279
|
-
`)}})};await Mr();let vr=Ur(async()=>{if(hr.length===0&&xr)return;let Ar=!1;for(let kr=0;kr<5;kr++)try{await e.transaction(async Dr=>{await Dr.exec(`
|
|
280
|
-
INSERT INTO live_query_${fr}_state${yr}
|
|
281
|
-
SELECT * FROM live_query_${fr}_view;
|
|
282
|
-
`),xr=await Dr.query(`EXECUTE live_query_${fr}_diff${yr};`),yr=yr===1?2:1,await Dr.exec(`
|
|
283
|
-
TRUNCATE live_query_${fr}_state${yr};
|
|
284
|
-
`)});break}catch(Dr){if(Dr.message===`relation "live_query_${fr}_state${yr}" does not exist`){Ar=!0,await Mr();continue}else throw Dr}D(hr,[...Ar?[{__op__:"RESET"}]:[],...xr.rows])}),Sr=await Promise.all(_r.map(Ar=>e.listen(`table_change__${Ar.schema_name}__${Ar.table_name}`,async()=>vr()))),wr=Ar=>{if(mr)throw new Error("Live query is no longer active and cannot be subscribed to");hr.push(Ar)},br=async Ar=>{Ar?hr=hr.filter(kr=>kr!==kr):hr=[],hr.length===0&&(mr=!0,await Promise.all(Sr.map(kr=>kr())),await e.exec(`
|
|
285
|
-
DROP VIEW IF EXISTS live_query_${fr}_view;
|
|
286
|
-
DROP TABLE IF EXISTS live_query_${fr}_state1;
|
|
287
|
-
DROP TABLE IF EXISTS live_query_${fr}_state2;
|
|
288
|
-
DEALLOCATE live_query_${fr}_diff1;
|
|
289
|
-
DEALLOCATE live_query_${fr}_diff2;
|
|
290
|
-
`))};return dr!=null&&dr.aborted?await br():dr==null||dr.addEventListener("abort",()=>{br()},{once:!0}),await vr(),{fields:xr.fields.filter(Ar=>!["__after__","__op__","__changed_columns__"].includes(Ar.name)),initialChanges:xr.rows,subscribe:wr,unsubscribe:br,refresh:vr}},async incrementalQuery(tr,rr,ir,lr){let dr;if(typeof tr!="string"&&(dr=tr.signal,rr=tr.params,ir=tr.key,lr=tr.callback,tr=tr.query),!ir)throw new Error("key is required for incremental queries");let hr=lr?[lr]:[],fr=new Map,mr=new Map,_r=[],yr=!0,{fields:xr,unsubscribe:Mr,refresh:vr}=await B.changes(tr,rr,ir,br=>{for(let Dr of br){let{__op__:Or,__changed_columns__:zr,...$n}=Dr;switch(Or){case"RESET":fr.clear(),mr.clear();break;case"INSERT":fr.set($n[ir],$n),mr.set($n.__after__,$n[ir]);break;case"DELETE":{let Fr=fr.get($n[ir]);fr.delete($n[ir]),Fr.__after__!==null&&mr.delete(Fr.__after__);break}case"UPDATE":{let Fr={...fr.get($n[ir])??{}};for(let $r of zr)Fr[$r]=$n[$r],$r==="__after__"&&mr.set($n.__after__,$n[ir]);fr.set($n[ir],Fr);break}}}let Ar=[],kr=null;for(let Dr=0;Dr<fr.size;Dr++){let Or=mr.get(kr),zr=fr.get(Or);if(!zr)break;let $n={...zr};delete $n.__after__,Ar.push($n),kr=Or}_r=Ar,yr||S(hr,{rows:Ar,fields:xr})});yr=!1,S(hr,{rows:_r,fields:xr});let Sr=br=>{hr.push(br)},wr=async br=>{br?hr=hr.filter(Ar=>Ar!==Ar):hr=[],hr.length===0&&await Mr()};return dr!=null&&dr.aborted?await wr():dr==null||dr.addEventListener("abort",()=>{wr()},{once:!0}),{initialResults:{rows:_r,fields:xr},subscribe:Sr,unsubscribe:wr,refresh:vr}}};return{namespaceObj:B}},j={name:"Live Queries",setup:U};async function q(e,t){return(await e.query(`
|
|
291
|
-
WITH RECURSIVE view_dependencies AS (
|
|
292
|
-
-- Base case: Get the initial view's dependencies
|
|
293
|
-
SELECT DISTINCT
|
|
294
|
-
cl.relname AS dependent_name,
|
|
295
|
-
n.nspname AS schema_name,
|
|
296
|
-
cl.relkind = 'v' AS is_view
|
|
297
|
-
FROM pg_rewrite r
|
|
298
|
-
JOIN pg_depend d ON r.oid = d.objid
|
|
299
|
-
JOIN pg_class cl ON d.refobjid = cl.oid
|
|
300
|
-
JOIN pg_namespace n ON cl.relnamespace = n.oid
|
|
301
|
-
WHERE
|
|
302
|
-
r.ev_class = (
|
|
303
|
-
SELECT oid FROM pg_class WHERE relname = $1 AND relkind = 'v'
|
|
304
|
-
)
|
|
305
|
-
AND d.deptype = 'n'
|
|
306
|
-
|
|
307
|
-
UNION ALL
|
|
308
|
-
|
|
309
|
-
-- Recursive case: Traverse dependencies for views
|
|
310
|
-
SELECT DISTINCT
|
|
311
|
-
cl.relname AS dependent_name,
|
|
312
|
-
n.nspname AS schema_name,
|
|
313
|
-
cl.relkind = 'v' AS is_view
|
|
314
|
-
FROM view_dependencies vd
|
|
315
|
-
JOIN pg_rewrite r ON vd.dependent_name = (
|
|
316
|
-
SELECT relname FROM pg_class WHERE oid = r.ev_class AND relkind = 'v'
|
|
317
|
-
)
|
|
318
|
-
JOIN pg_depend d ON r.oid = d.objid
|
|
319
|
-
JOIN pg_class cl ON d.refobjid = cl.oid
|
|
320
|
-
JOIN pg_namespace n ON cl.relnamespace = n.oid
|
|
321
|
-
WHERE d.deptype = 'n'
|
|
322
|
-
)
|
|
323
|
-
SELECT DISTINCT
|
|
324
|
-
dependent_name AS table_name,
|
|
325
|
-
schema_name
|
|
326
|
-
FROM view_dependencies
|
|
327
|
-
WHERE NOT is_view; -- Exclude intermediate views
|
|
328
|
-
`,[t])).rows.map(I=>({table_name:I.table_name,schema_name:I.schema_name}))}async function F(e,t,I){let B=t.filter(tr=>!I.has(`${tr.schema_name}_${tr.table_name}`)).map(tr=>`
|
|
329
|
-
CREATE OR REPLACE FUNCTION "_notify_${tr.schema_name}_${tr.table_name}"() RETURNS TRIGGER AS $$
|
|
330
|
-
BEGIN
|
|
331
|
-
PERFORM pg_notify('table_change__${tr.schema_name}__${tr.table_name}', '');
|
|
332
|
-
RETURN NULL;
|
|
333
|
-
END;
|
|
334
|
-
$$ LANGUAGE plpgsql;
|
|
335
|
-
CREATE OR REPLACE TRIGGER "_notify_trigger_${tr.schema_name}_${tr.table_name}"
|
|
336
|
-
AFTER INSERT OR UPDATE OR DELETE ON "${tr.schema_name}"."${tr.table_name}"
|
|
337
|
-
FOR EACH STATEMENT EXECUTE FUNCTION "_notify_${tr.schema_name}_${tr.table_name}"();
|
|
338
|
-
`).join(`
|
|
339
|
-
`);B.trim()!==""&&await e.exec(B),t.map(tr=>I.add(`${tr.schema_name}_${tr.table_name}`))}var S=(e,t)=>{for(let I of e)I(t)},D=(e,t)=>{for(let I of e)I(t)};const PGLITE_UPDATE_EVENT="ph:pglite-update",defaultPGliteState={db:null,isLoading:!0,error:null},usePGliteDB=()=>{const[e,t]=useState(()=>{var I;return((I=window.powerhouse)==null?void 0:I.pglite)??defaultPGliteState});return useEffect(()=>{const I=()=>{var B;return t(((B=window.powerhouse)==null?void 0:B.pglite)??defaultPGliteState)};return window.addEventListener(PGLITE_UPDATE_EVENT,I),()=>window.removeEventListener(PGLITE_UPDATE_EVENT,I)},[]),e},useSetPGliteDB=()=>t=>{var tr;const I=window.powerhouse??{},B=((tr=window.powerhouse)==null?void 0:tr.pglite)??defaultPGliteState;window.powerhouse={...I,pglite:{...B,...t}},window.dispatchEvent(new CustomEvent(PGLITE_UPDATE_EVENT))};function isUndefined(e){return typeof e>"u"||e===void 0}function isString(e){return typeof e=="string"}function isNumber(e){return typeof e=="number"}function isBoolean(e){return typeof e=="boolean"}function isNull(e){return e===null}function isDate(e){return e instanceof Date}function isBigInt(e){return typeof e=="bigint"}function isFunction(e){return typeof e=="function"}function isObject(e){return typeof e=="object"&&e!==null}function freeze(e){return Object.freeze(e)}function asArray(e){return isReadonlyArray(e)?e:[e]}function isReadonlyArray(e){return Array.isArray(e)}function noop(e){return e}const AlterTableNode=freeze({is(e){return e.kind==="AlterTableNode"},create(e){return freeze({kind:"AlterTableNode",table:e})},cloneWithTableProps(e,t){return freeze({...e,...t})},cloneWithColumnAlteration(e,t){return freeze({...e,columnAlterations:e.columnAlterations?[...e.columnAlterations,t]:[t]})}}),IdentifierNode=freeze({is(e){return e.kind==="IdentifierNode"},create(e){return freeze({kind:"IdentifierNode",name:e})}}),CreateIndexNode=freeze({is(e){return e.kind==="CreateIndexNode"},create(e){return freeze({kind:"CreateIndexNode",name:IdentifierNode.create(e)})},cloneWith(e,t){return freeze({...e,...t})},cloneWithColumns(e,t){return freeze({...e,columns:[...e.columns||[],...t]})}}),CreateSchemaNode=freeze({is(e){return e.kind==="CreateSchemaNode"},create(e,t){return freeze({kind:"CreateSchemaNode",schema:IdentifierNode.create(e),...t})},cloneWith(e,t){return freeze({...e,...t})}}),ON_COMMIT_ACTIONS=["preserve rows","delete rows","drop"],CreateTableNode=freeze({is(e){return e.kind==="CreateTableNode"},create(e){return freeze({kind:"CreateTableNode",table:e,columns:freeze([])})},cloneWithColumn(e,t){return freeze({...e,columns:freeze([...e.columns,t])})},cloneWithConstraint(e,t){return freeze({...e,constraints:e.constraints?freeze([...e.constraints,t]):freeze([t])})},cloneWithFrontModifier(e,t){return freeze({...e,frontModifiers:e.frontModifiers?freeze([...e.frontModifiers,t]):freeze([t])})},cloneWithEndModifier(e,t){return freeze({...e,endModifiers:e.endModifiers?freeze([...e.endModifiers,t]):freeze([t])})},cloneWith(e,t){return freeze({...e,...t})}}),SchemableIdentifierNode=freeze({is(e){return e.kind==="SchemableIdentifierNode"},create(e){return freeze({kind:"SchemableIdentifierNode",identifier:IdentifierNode.create(e)})},createWithSchema(e,t){return freeze({kind:"SchemableIdentifierNode",schema:IdentifierNode.create(e),identifier:IdentifierNode.create(t)})}}),DropIndexNode=freeze({is(e){return e.kind==="DropIndexNode"},create(e,t){return freeze({kind:"DropIndexNode",name:SchemableIdentifierNode.create(e),...t})},cloneWith(e,t){return freeze({...e,...t})}}),DropSchemaNode=freeze({is(e){return e.kind==="DropSchemaNode"},create(e,t){return freeze({kind:"DropSchemaNode",schema:IdentifierNode.create(e),...t})},cloneWith(e,t){return freeze({...e,...t})}}),DropTableNode=freeze({is(e){return e.kind==="DropTableNode"},create(e,t){return freeze({kind:"DropTableNode",table:e,...t})},cloneWith(e,t){return freeze({...e,...t})}}),AliasNode=freeze({is(e){return e.kind==="AliasNode"},create(e,t){return freeze({kind:"AliasNode",node:e,alias:t})}}),TableNode=freeze({is(e){return e.kind==="TableNode"},create(e){return freeze({kind:"TableNode",table:SchemableIdentifierNode.create(e)})},createWithSchema(e,t){return freeze({kind:"TableNode",table:SchemableIdentifierNode.createWithSchema(e,t)})}});function isOperationNodeSource(e){return isObject(e)&&isFunction(e.toOperationNode)}function isExpression(e){return isObject(e)&&"expressionType"in e&&isOperationNodeSource(e)}function isAliasedExpression(e){return isObject(e)&&"expression"in e&&isString(e.alias)&&isOperationNodeSource(e)}const SelectModifierNode=freeze({is(e){return e.kind==="SelectModifierNode"},create(e,t){return freeze({kind:"SelectModifierNode",modifier:e,of:t})},createWithExpression(e){return freeze({kind:"SelectModifierNode",rawModifier:e})}}),AndNode=freeze({is(e){return e.kind==="AndNode"},create(e,t){return freeze({kind:"AndNode",left:e,right:t})}}),OrNode=freeze({is(e){return e.kind==="OrNode"},create(e,t){return freeze({kind:"OrNode",left:e,right:t})}}),OnNode=freeze({is(e){return e.kind==="OnNode"},create(e){return freeze({kind:"OnNode",on:e})},cloneWithOperation(e,t,I){return freeze({...e,on:t==="And"?AndNode.create(e.on,I):OrNode.create(e.on,I)})}}),JoinNode=freeze({is(e){return e.kind==="JoinNode"},create(e,t){return freeze({kind:"JoinNode",joinType:e,table:t,on:void 0})},createWithOn(e,t,I){return freeze({kind:"JoinNode",joinType:e,table:t,on:OnNode.create(I)})},cloneWithOn(e,t){return freeze({...e,on:e.on?OnNode.cloneWithOperation(e.on,"And",t):OnNode.create(t)})}}),BinaryOperationNode=freeze({is(e){return e.kind==="BinaryOperationNode"},create(e,t,I){return freeze({kind:"BinaryOperationNode",leftOperand:e,operator:t,rightOperand:I})}}),COMPARISON_OPERATORS=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","match","ilike","not ilike","@>","<@","^@","&&","?","?&","?|","!<","!>","<=>","!~","~","~*","!~*","@@","@@@","!!","<->","regexp","is distinct from","is not distinct from"],ARITHMETIC_OPERATORS=["+","-","*","/","%","^","&","|","#","<<",">>"],JSON_OPERATORS=["->","->>"],BINARY_OPERATORS=[...COMPARISON_OPERATORS,...ARITHMETIC_OPERATORS,"&&","||"],UNARY_FILTER_OPERATORS=["exists","not exists"],UNARY_OPERATORS=["not","-",...UNARY_FILTER_OPERATORS],OPERATORS=[...BINARY_OPERATORS,...JSON_OPERATORS,...UNARY_OPERATORS,"between","between symmetric"],OperatorNode=freeze({is(e){return e.kind==="OperatorNode"},create(e){return freeze({kind:"OperatorNode",operator:e})}});function isJSONOperator(e){return isString(e)&&JSON_OPERATORS.includes(e)}const ColumnNode=freeze({is(e){return e.kind==="ColumnNode"},create(e){return freeze({kind:"ColumnNode",column:IdentifierNode.create(e)})}}),SelectAllNode=freeze({is(e){return e.kind==="SelectAllNode"},create(){return freeze({kind:"SelectAllNode"})}}),ReferenceNode=freeze({is(e){return e.kind==="ReferenceNode"},create(e,t){return freeze({kind:"ReferenceNode",table:t,column:e})},createSelectAll(e){return freeze({kind:"ReferenceNode",table:e,column:SelectAllNode.create()})}});var go;class DynamicReferenceBuilder{constructor(t){_i(this,go);yi(this,go,t)}get dynamicReference(){return gr(this,go)}get refType(){}toOperationNode(){return parseSimpleReferenceExpression(gr(this,go))}}go=new WeakMap;function isDynamicReferenceBuilder(e){return isObject(e)&&isOperationNodeSource(e)&&isString(e.dynamicReference)}const OrderByItemNode=freeze({is(e){return e.kind==="OrderByItemNode"},create(e,t){return freeze({kind:"OrderByItemNode",orderBy:e,direction:t})},cloneWith(e,t){return freeze({...e,...t})}}),RawNode=freeze({is(e){return e.kind==="RawNode"},create(e,t){return freeze({kind:"RawNode",sqlFragments:freeze(e),parameters:freeze(t)})},createWithSql(e){return RawNode.create([e],[])},createWithChild(e){return RawNode.create(["",""],[e])},createWithChildren(e){return RawNode.create(new Array(e.length+1).fill(""),e)}}),CollateNode={is(e){return e.kind==="CollateNode"},create(e){return freeze({kind:"CollateNode",collation:IdentifierNode.create(e)})}};var la;const Va=class Va{constructor(t){_i(this,la);yi(this,la,freeze(t))}desc(){return new Va({node:OrderByItemNode.cloneWith(gr(this,la).node,{direction:RawNode.createWithSql("desc")})})}asc(){return new Va({node:OrderByItemNode.cloneWith(gr(this,la).node,{direction:RawNode.createWithSql("asc")})})}nullsLast(){return new Va({node:OrderByItemNode.cloneWith(gr(this,la).node,{nulls:"last"})})}nullsFirst(){return new Va({node:OrderByItemNode.cloneWith(gr(this,la).node,{nulls:"first"})})}collate(t){return new Va({node:OrderByItemNode.cloneWith(gr(this,la).node,{collation:CollateNode.create(t)})})}toOperationNode(){return gr(this,la).node}};la=new WeakMap;let OrderByItemBuilder=Va;const LOGGED_MESSAGES=new Set;function logOnce(e){LOGGED_MESSAGES.has(e)||(LOGGED_MESSAGES.add(e),console.log(e))}function isOrderByDirection(e){return e==="asc"||e==="desc"}function parseOrderBy(e){if(e.length===2)return[parseOrderByItem(e[0],e[1])];if(e.length===1){const[t]=e;return Array.isArray(t)?(logOnce("orderBy(array) is deprecated, use multiple orderBy calls instead."),t.map(I=>parseOrderByItem(I))):[parseOrderByItem(t)]}throw new Error(`Invalid number of arguments at order by! expected 1-2, received ${e.length}`)}function parseOrderByItem(e,t){const I=parseOrderByExpression(e);if(OrderByItemNode.is(I)){if(t)throw new Error("Cannot specify direction twice!");return I}return parseOrderByWithModifiers(I,t)}function parseOrderByExpression(e){if(isExpressionOrFactory(e))return parseExpression(e);if(isDynamicReferenceBuilder(e))return e.toOperationNode();const[t,I]=e.split(" ");return I?(logOnce("`orderBy('column asc')` is deprecated. Use `orderBy('column', 'asc')` instead."),parseOrderByWithModifiers(parseStringReference(t),I)):parseStringReference(e)}function parseOrderByWithModifiers(e,t){if(typeof t=="string"){if(!isOrderByDirection(t))throw new Error(`Invalid order by direction: ${t}`);return OrderByItemNode.create(e,RawNode.createWithSql(t))}if(isExpression(t))return logOnce("`orderBy(..., expr)` is deprecated. Use `orderBy(..., 'asc')` or `orderBy(..., (ob) => ...)` instead."),OrderByItemNode.create(e,t.toOperationNode());const I=OrderByItemNode.create(e);return t?t(new OrderByItemBuilder({node:I})).toOperationNode():I}const JSONReferenceNode=freeze({is(e){return e.kind==="JSONReferenceNode"},create(e,t){return freeze({kind:"JSONReferenceNode",reference:e,traversal:t})},cloneWithTraversal(e,t){return freeze({...e,traversal:t})}}),JSONOperatorChainNode=freeze({is(e){return e.kind==="JSONOperatorChainNode"},create(e){return freeze({kind:"JSONOperatorChainNode",operator:e,values:freeze([])})},cloneWithValue(e,t){return freeze({...e,values:freeze([...e.values,t])})}}),JSONPathNode=freeze({is(e){return e.kind==="JSONPathNode"},create(e){return freeze({kind:"JSONPathNode",inOperator:e,pathLegs:freeze([])})},cloneWithLeg(e,t){return freeze({...e,pathLegs:freeze([...e.pathLegs,t])})}});function parseSimpleReferenceExpression(e){return isString(e)?parseStringReference(e):e.toOperationNode()}function parseReferenceExpressionOrList(e){return isReadonlyArray(e)?e.map(t=>parseReferenceExpression(t)):[parseReferenceExpression(e)]}function parseReferenceExpression(e){return isExpressionOrFactory(e)?parseExpression(e):parseSimpleReferenceExpression(e)}function parseJSONReference(e,t){const I=parseStringReference(e);if(isJSONOperator(t))return JSONReferenceNode.create(I,JSONOperatorChainNode.create(OperatorNode.create(t)));const B=t.slice(0,-1);if(isJSONOperator(B))return JSONReferenceNode.create(I,JSONPathNode.create(OperatorNode.create(B)));throw new Error(`Invalid JSON operator: ${t}`)}function parseStringReference(e){const t=".";if(!e.includes(t))return ReferenceNode.create(ColumnNode.create(e));const I=e.split(t).map(trim$2);if(I.length===3)return parseStringReferenceWithTableAndSchema(I);if(I.length===2)return parseStringReferenceWithTable(I);throw new Error(`invalid column reference ${e}`)}function parseAliasedStringReference(e){const t=" as ";if(e.includes(t)){const[I,B]=e.split(t).map(trim$2);return AliasNode.create(parseStringReference(I),IdentifierNode.create(B))}else return parseStringReference(e)}function parseColumnName(e){return ColumnNode.create(e)}function parseOrderedColumnName(e){const t=" ";if(e.includes(t)){const[I,B]=e.split(t).map(trim$2);if(!isOrderByDirection(B))throw new Error(`invalid order direction "${B}" next to "${I}"`);return parseOrderBy([I,B])[0]}else return parseColumnName(e)}function parseStringReferenceWithTableAndSchema(e){const[t,I,B]=e;return ReferenceNode.create(ColumnNode.create(B),TableNode.createWithSchema(t,I))}function parseStringReferenceWithTable(e){const[t,I]=e;return ReferenceNode.create(ColumnNode.create(I),TableNode.create(t))}function trim$2(e){return e.trim()}const PrimitiveValueListNode=freeze({is(e){return e.kind==="PrimitiveValueListNode"},create(e){return freeze({kind:"PrimitiveValueListNode",values:freeze([...e])})}}),ValueListNode=freeze({is(e){return e.kind==="ValueListNode"},create(e){return freeze({kind:"ValueListNode",values:freeze(e)})}}),ValueNode=freeze({is(e){return e.kind==="ValueNode"},create(e){return freeze({kind:"ValueNode",value:e})},createImmediate(e){return freeze({kind:"ValueNode",value:e,immediate:!0})}});function parseValueExpressionOrList(e){return isReadonlyArray(e)?parseValueExpressionList(e):parseValueExpression(e)}function parseValueExpression(e){return isExpressionOrFactory(e)?parseExpression(e):ValueNode.create(e)}function isSafeImmediateValue(e){return isNumber(e)||isBoolean(e)||isNull(e)}function parseSafeImmediateValue(e){if(!isSafeImmediateValue(e))throw new Error(`unsafe immediate value ${JSON.stringify(e)}`);return ValueNode.createImmediate(e)}function parseValueExpressionList(e){return e.some(isExpressionOrFactory)?ValueListNode.create(e.map(t=>parseValueExpression(t))):PrimitiveValueListNode.create(e)}const ParensNode=freeze({is(e){return e.kind==="ParensNode"},create(e){return freeze({kind:"ParensNode",node:e})}});function parseValueBinaryOperationOrExpression(e){if(e.length===3)return parseValueBinaryOperation(e[0],e[1],e[2]);if(e.length===1)return parseValueExpression(e[0]);throw new Error(`invalid arguments: ${JSON.stringify(e)}`)}function parseValueBinaryOperation(e,t,I){return isIsOperator(t)&&needsIsOperator(I)?BinaryOperationNode.create(parseReferenceExpression(e),parseOperator(t),ValueNode.createImmediate(I)):BinaryOperationNode.create(parseReferenceExpression(e),parseOperator(t),parseValueExpressionOrList(I))}function parseReferentialBinaryOperation(e,t,I){return BinaryOperationNode.create(parseReferenceExpression(e),parseOperator(t),parseReferenceExpression(I))}function parseFilterObject(e,t){return parseFilterList(Object.entries(e).filter(([,I])=>!isUndefined(I)).map(([I,B])=>parseValueBinaryOperation(I,needsIsOperator(B)?"is":"=",B)),t)}function parseFilterList(e,t,I=!0){const B=t==="and"?AndNode.create:OrNode.create;if(e.length===0)return BinaryOperationNode.create(ValueNode.createImmediate(1),OperatorNode.create("="),ValueNode.createImmediate(t==="and"?1:0));let tr=toOperationNode(e[0]);for(let rr=1;rr<e.length;++rr)tr=B(tr,toOperationNode(e[rr]));return e.length>1&&I?ParensNode.create(tr):tr}function isIsOperator(e){return e==="is"||e==="is not"}function needsIsOperator(e){return isNull(e)||isBoolean(e)}function parseOperator(e){if(isString(e)&&OPERATORS.includes(e))return OperatorNode.create(e);if(isOperationNodeSource(e))return e.toOperationNode();throw new Error(`invalid operator ${JSON.stringify(e)}`)}function toOperationNode(e){return isOperationNodeSource(e)?e.toOperationNode():e}const OrderByNode=freeze({is(e){return e.kind==="OrderByNode"},create(e){return freeze({kind:"OrderByNode",items:freeze([...e])})},cloneWithItems(e,t){return freeze({...e,items:freeze([...e.items,...t])})}}),PartitionByNode=freeze({is(e){return e.kind==="PartitionByNode"},create(e){return freeze({kind:"PartitionByNode",items:freeze(e)})},cloneWithItems(e,t){return freeze({...e,items:freeze([...e.items,...t])})}}),OverNode=freeze({is(e){return e.kind==="OverNode"},create(){return freeze({kind:"OverNode"})},cloneWithOrderByItems(e,t){return freeze({...e,orderBy:e.orderBy?OrderByNode.cloneWithItems(e.orderBy,t):OrderByNode.create(t)})},cloneWithPartitionByItems(e,t){return freeze({...e,partitionBy:e.partitionBy?PartitionByNode.cloneWithItems(e.partitionBy,t):PartitionByNode.create(t)})}}),FromNode=freeze({is(e){return e.kind==="FromNode"},create(e){return freeze({kind:"FromNode",froms:freeze(e)})},cloneWithFroms(e,t){return freeze({...e,froms:freeze([...e.froms,...t])})}}),GroupByNode=freeze({is(e){return e.kind==="GroupByNode"},create(e){return freeze({kind:"GroupByNode",items:freeze(e)})},cloneWithItems(e,t){return freeze({...e,items:freeze([...e.items,...t])})}}),HavingNode=freeze({is(e){return e.kind==="HavingNode"},create(e){return freeze({kind:"HavingNode",having:e})},cloneWithOperation(e,t,I){return freeze({...e,having:t==="And"?AndNode.create(e.having,I):OrNode.create(e.having,I)})}}),InsertQueryNode=freeze({is(e){return e.kind==="InsertQueryNode"},create(e,t,I){return freeze({kind:"InsertQueryNode",into:e,...t&&{with:t},replace:I})},createWithoutInto(){return freeze({kind:"InsertQueryNode"})},cloneWith(e,t){return freeze({...e,...t})}}),ListNode=freeze({is(e){return e.kind==="ListNode"},create(e){return freeze({kind:"ListNode",items:freeze(e)})}}),UpdateQueryNode=freeze({is(e){return e.kind==="UpdateQueryNode"},create(e,t){return freeze({kind:"UpdateQueryNode",table:e.length===1?e[0]:ListNode.create(e),...t&&{with:t}})},createWithoutTable(){return freeze({kind:"UpdateQueryNode"})},cloneWithFromItems(e,t){return freeze({...e,from:e.from?FromNode.cloneWithFroms(e.from,t):FromNode.create(t)})},cloneWithUpdates(e,t){return freeze({...e,updates:e.updates?freeze([...e.updates,...t]):t})},cloneWithLimit(e,t){return freeze({...e,limit:t})}}),UsingNode=freeze({is(e){return e.kind==="UsingNode"},create(e){return freeze({kind:"UsingNode",tables:freeze(e)})},cloneWithTables(e,t){return freeze({...e,tables:freeze([...e.tables,...t])})}}),DeleteQueryNode=freeze({is(e){return e.kind==="DeleteQueryNode"},create(e,t){return freeze({kind:"DeleteQueryNode",from:FromNode.create(e),...t&&{with:t}})},cloneWithOrderByItems:(e,t)=>QueryNode.cloneWithOrderByItems(e,t),cloneWithoutOrderBy:e=>QueryNode.cloneWithoutOrderBy(e),cloneWithLimit(e,t){return freeze({...e,limit:t})},cloneWithoutLimit(e){return freeze({...e,limit:void 0})},cloneWithUsing(e,t){return freeze({...e,using:e.using!==void 0?UsingNode.cloneWithTables(e.using,t):UsingNode.create(t)})}}),WhereNode=freeze({is(e){return e.kind==="WhereNode"},create(e){return freeze({kind:"WhereNode",where:e})},cloneWithOperation(e,t,I){return freeze({...e,where:t==="And"?AndNode.create(e.where,I):OrNode.create(e.where,I)})}}),ReturningNode=freeze({is(e){return e.kind==="ReturningNode"},create(e){return freeze({kind:"ReturningNode",selections:freeze(e)})},cloneWithSelections(e,t){return freeze({...e,selections:e.selections?freeze([...e.selections,...t]):freeze(t)})}}),ExplainNode=freeze({is(e){return e.kind==="ExplainNode"},create(e,t){return freeze({kind:"ExplainNode",format:e,options:t})}}),WhenNode=freeze({is(e){return e.kind==="WhenNode"},create(e){return freeze({kind:"WhenNode",condition:e})},cloneWithResult(e,t){return freeze({...e,result:t})}}),MergeQueryNode=freeze({is(e){return e.kind==="MergeQueryNode"},create(e,t){return freeze({kind:"MergeQueryNode",into:e,...t&&{with:t}})},cloneWithUsing(e,t){return freeze({...e,using:t})},cloneWithWhen(e,t){return freeze({...e,whens:e.whens?freeze([...e.whens,t]):freeze([t])})},cloneWithThen(e,t){return freeze({...e,whens:e.whens?freeze([...e.whens.slice(0,-1),WhenNode.cloneWithResult(e.whens[e.whens.length-1],t)]):void 0})}}),OutputNode=freeze({is(e){return e.kind==="OutputNode"},create(e){return freeze({kind:"OutputNode",selections:freeze(e)})},cloneWithSelections(e,t){return freeze({...e,selections:e.selections?freeze([...e.selections,...t]):freeze(t)})}}),QueryNode=freeze({is(e){return SelectQueryNode.is(e)||InsertQueryNode.is(e)||UpdateQueryNode.is(e)||DeleteQueryNode.is(e)||MergeQueryNode.is(e)},cloneWithEndModifier(e,t){return freeze({...e,endModifiers:e.endModifiers?freeze([...e.endModifiers,t]):freeze([t])})},cloneWithWhere(e,t){return freeze({...e,where:e.where?WhereNode.cloneWithOperation(e.where,"And",t):WhereNode.create(t)})},cloneWithJoin(e,t){return freeze({...e,joins:e.joins?freeze([...e.joins,t]):freeze([t])})},cloneWithReturning(e,t){return freeze({...e,returning:e.returning?ReturningNode.cloneWithSelections(e.returning,t):ReturningNode.create(t)})},cloneWithoutReturning(e){return freeze({...e,returning:void 0})},cloneWithoutWhere(e){return freeze({...e,where:void 0})},cloneWithExplain(e,t,I){return freeze({...e,explain:ExplainNode.create(t,I==null?void 0:I.toOperationNode())})},cloneWithTop(e,t){return freeze({...e,top:t})},cloneWithOutput(e,t){return freeze({...e,output:e.output?OutputNode.cloneWithSelections(e.output,t):OutputNode.create(t)})},cloneWithOrderByItems(e,t){return freeze({...e,orderBy:e.orderBy?OrderByNode.cloneWithItems(e.orderBy,t):OrderByNode.create(t)})},cloneWithoutOrderBy(e){return freeze({...e,orderBy:void 0})}}),SelectQueryNode=freeze({is(e){return e.kind==="SelectQueryNode"},create(e){return freeze({kind:"SelectQueryNode",...e&&{with:e}})},createFrom(e,t){return freeze({kind:"SelectQueryNode",from:FromNode.create(e),...t&&{with:t}})},cloneWithSelections(e,t){return freeze({...e,selections:e.selections?freeze([...e.selections,...t]):freeze(t)})},cloneWithDistinctOn(e,t){return freeze({...e,distinctOn:e.distinctOn?freeze([...e.distinctOn,...t]):freeze(t)})},cloneWithFrontModifier(e,t){return freeze({...e,frontModifiers:e.frontModifiers?freeze([...e.frontModifiers,t]):freeze([t])})},cloneWithOrderByItems:(e,t)=>QueryNode.cloneWithOrderByItems(e,t),cloneWithGroupByItems(e,t){return freeze({...e,groupBy:e.groupBy?GroupByNode.cloneWithItems(e.groupBy,t):GroupByNode.create(t)})},cloneWithLimit(e,t){return freeze({...e,limit:t})},cloneWithOffset(e,t){return freeze({...e,offset:t})},cloneWithFetch(e,t){return freeze({...e,fetch:t})},cloneWithHaving(e,t){return freeze({...e,having:e.having?HavingNode.cloneWithOperation(e.having,"And",t):HavingNode.create(t)})},cloneWithSetOperations(e,t){return freeze({...e,setOperations:e.setOperations?freeze([...e.setOperations,...t]):freeze([...t])})},cloneWithoutSelections(e){return freeze({...e,selections:[]})},cloneWithoutLimit(e){return freeze({...e,limit:void 0})},cloneWithoutOffset(e){return freeze({...e,offset:void 0})},cloneWithoutOrderBy:e=>QueryNode.cloneWithoutOrderBy(e),cloneWithoutGroupBy(e){return freeze({...e,groupBy:void 0})}});var Zs;const jo=class jo{constructor(t){_i(this,Zs);yi(this,Zs,freeze(t))}on(...t){return new jo({...gr(this,Zs),joinNode:JoinNode.cloneWithOn(gr(this,Zs).joinNode,parseValueBinaryOperationOrExpression(t))})}onRef(t,I,B){return new jo({...gr(this,Zs),joinNode:JoinNode.cloneWithOn(gr(this,Zs).joinNode,parseReferentialBinaryOperation(t,I,B))})}onTrue(){return new jo({...gr(this,Zs),joinNode:JoinNode.cloneWithOn(gr(this,Zs).joinNode,RawNode.createWithSql("true"))})}$call(t){return t(this)}toOperationNode(){return gr(this,Zs).joinNode}};Zs=new WeakMap;let JoinBuilder=jo;const PartitionByItemNode=freeze({is(e){return e.kind==="PartitionByItemNode"},create(e){return freeze({kind:"PartitionByItemNode",partitionBy:e})}});function parsePartitionBy(e){return parseReferenceExpressionOrList(e).map(PartitionByItemNode.create)}var Oa;const Wo=class Wo{constructor(t){_i(this,Oa);yi(this,Oa,freeze(t))}orderBy(...t){return new Wo({overNode:OverNode.cloneWithOrderByItems(gr(this,Oa).overNode,parseOrderBy(t))})}clearOrderBy(){return new Wo({overNode:QueryNode.cloneWithoutOrderBy(gr(this,Oa).overNode)})}partitionBy(t){return new Wo({overNode:OverNode.cloneWithPartitionByItems(gr(this,Oa).overNode,parsePartitionBy(t))})}$call(t){return t(this)}toOperationNode(){return gr(this,Oa).overNode}};Oa=new WeakMap;let OverBuilder=Wo;const SelectionNode=freeze({is(e){return e.kind==="SelectionNode"},create(e){return freeze({kind:"SelectionNode",selection:e})},createSelectAll(){return freeze({kind:"SelectionNode",selection:SelectAllNode.create()})},createSelectAllFromTable(e){return freeze({kind:"SelectionNode",selection:ReferenceNode.createSelectAll(e)})}});function parseSelectArg(e){return isFunction(e)?parseSelectArg(e(expressionBuilder())):isReadonlyArray(e)?e.map(t=>parseSelectExpression(t)):[parseSelectExpression(e)]}function parseSelectExpression(e){return isString(e)?SelectionNode.create(parseAliasedStringReference(e)):isDynamicReferenceBuilder(e)?SelectionNode.create(e.toOperationNode()):SelectionNode.create(parseAliasedExpression(e))}function parseSelectAll(e){return e?Array.isArray(e)?e.map(parseSelectAllArg):[parseSelectAllArg(e)]:[SelectionNode.createSelectAll()]}function parseSelectAllArg(e){if(isString(e))return SelectionNode.createSelectAllFromTable(parseTable(e));throw new Error(`invalid value selectAll expression: ${JSON.stringify(e)}`)}const ValuesNode=freeze({is(e){return e.kind==="ValuesNode"},create(e){return freeze({kind:"ValuesNode",values:freeze(e)})}}),DefaultInsertValueNode=freeze({is(e){return e.kind==="DefaultInsertValueNode"},create(){return freeze({kind:"DefaultInsertValueNode"})}});function parseInsertExpression(e){const t=isFunction(e)?e(expressionBuilder()):e,I=isReadonlyArray(t)?t:freeze([t]);return parseInsertColumnsAndValues(I)}function parseInsertColumnsAndValues(e){const t=parseColumnNamesAndIndexes(e);return[freeze([...t.keys()].map(ColumnNode.create)),ValuesNode.create(e.map(I=>parseRowValues(I,t)))]}function parseColumnNamesAndIndexes(e){const t=new Map;for(const I of e){const B=Object.keys(I);for(const tr of B)!t.has(tr)&&I[tr]!==void 0&&t.set(tr,t.size)}return t}function parseRowValues(e,t){const I=Object.keys(e),B=Array.from({length:t.size});let tr=!1,rr=I.length;for(const lr of I){const dr=t.get(lr);if(isUndefined(dr)){rr--;continue}const hr=e[lr];(isUndefined(hr)||isExpressionOrFactory(hr))&&(tr=!0),B[dr]=hr}if(rr<t.size||tr){const lr=DefaultInsertValueNode.create();return ValueListNode.create(B.map(dr=>isUndefined(dr)?lr:parseValueExpression(dr)))}return PrimitiveValueListNode.create(B)}const ColumnUpdateNode=freeze({is(e){return e.kind==="ColumnUpdateNode"},create(e,t){return freeze({kind:"ColumnUpdateNode",column:e,value:t})}});function parseUpdate(...e){return e.length===2?[ColumnUpdateNode.create(parseReferenceExpression(e[0]),parseValueExpression(e[1]))]:parseUpdateObjectExpression(e[0])}function parseUpdateObjectExpression(e){const t=isFunction(e)?e(expressionBuilder()):e;return Object.entries(t).filter(([I,B])=>B!==void 0).map(([I,B])=>ColumnUpdateNode.create(ColumnNode.create(I),parseValueExpression(B)))}const OnDuplicateKeyNode=freeze({is(e){return e.kind==="OnDuplicateKeyNode"},create(e){return freeze({kind:"OnDuplicateKeyNode",updates:e})}});class InsertResult{constructor(t,I){ji(this,"insertId");ji(this,"numInsertedOrUpdatedRows");this.insertId=t,this.numInsertedOrUpdatedRows=I}}class NoResultError extends Error{constructor(I){super("no result");ji(this,"node");this.node=I}}function isNoResultErrorConstructor(e){return Object.prototype.hasOwnProperty.call(e,"prototype")}const OnConflictNode=freeze({is(e){return e.kind==="OnConflictNode"},create(){return freeze({kind:"OnConflictNode"})},cloneWith(e,t){return freeze({...e,...t})},cloneWithIndexWhere(e,t){return freeze({...e,indexWhere:e.indexWhere?WhereNode.cloneWithOperation(e.indexWhere,"And",t):WhereNode.create(t)})},cloneWithIndexOrWhere(e,t){return freeze({...e,indexWhere:e.indexWhere?WhereNode.cloneWithOperation(e.indexWhere,"Or",t):WhereNode.create(t)})},cloneWithUpdateWhere(e,t){return freeze({...e,updateWhere:e.updateWhere?WhereNode.cloneWithOperation(e.updateWhere,"And",t):WhereNode.create(t)})},cloneWithUpdateOrWhere(e,t){return freeze({...e,updateWhere:e.updateWhere?WhereNode.cloneWithOperation(e.updateWhere,"Or",t):WhereNode.create(t)})},cloneWithoutIndexWhere(e){return freeze({...e,indexWhere:void 0})},cloneWithoutUpdateWhere(e){return freeze({...e,updateWhere:void 0})}});var us;const ga=class ga{constructor(t){_i(this,us);yi(this,us,freeze(t))}column(t){const I=ColumnNode.create(t);return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWith(gr(this,us).onConflictNode,{columns:gr(this,us).onConflictNode.columns?freeze([...gr(this,us).onConflictNode.columns,I]):freeze([I])})})}columns(t){const I=t.map(ColumnNode.create);return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWith(gr(this,us).onConflictNode,{columns:gr(this,us).onConflictNode.columns?freeze([...gr(this,us).onConflictNode.columns,...I]):freeze(I)})})}constraint(t){return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWith(gr(this,us).onConflictNode,{constraint:IdentifierNode.create(t)})})}expression(t){return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWith(gr(this,us).onConflictNode,{indexExpression:t.toOperationNode()})})}where(...t){return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWithIndexWhere(gr(this,us).onConflictNode,parseValueBinaryOperationOrExpression(t))})}whereRef(t,I,B){return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWithIndexWhere(gr(this,us).onConflictNode,parseReferentialBinaryOperation(t,I,B))})}clearWhere(){return new ga({...gr(this,us),onConflictNode:OnConflictNode.cloneWithoutIndexWhere(gr(this,us).onConflictNode)})}doNothing(){return new OnConflictDoNothingBuilder({...gr(this,us),onConflictNode:OnConflictNode.cloneWith(gr(this,us).onConflictNode,{doNothing:!0})})}doUpdateSet(t){return new OnConflictUpdateBuilder({...gr(this,us),onConflictNode:OnConflictNode.cloneWith(gr(this,us).onConflictNode,{updates:parseUpdateObjectExpression(t)})})}$call(t){return t(this)}};us=new WeakMap;let OnConflictBuilder=ga;var Yo;class OnConflictDoNothingBuilder{constructor(t){_i(this,Yo);yi(this,Yo,freeze(t))}toOperationNode(){return gr(this,Yo).onConflictNode}}Yo=new WeakMap;var ea;const Vo=class Vo{constructor(t){_i(this,ea);yi(this,ea,freeze(t))}where(...t){return new Vo({...gr(this,ea),onConflictNode:OnConflictNode.cloneWithUpdateWhere(gr(this,ea).onConflictNode,parseValueBinaryOperationOrExpression(t))})}whereRef(t,I,B){return new Vo({...gr(this,ea),onConflictNode:OnConflictNode.cloneWithUpdateWhere(gr(this,ea).onConflictNode,parseReferentialBinaryOperation(t,I,B))})}clearWhere(){return new Vo({...gr(this,ea),onConflictNode:OnConflictNode.cloneWithoutUpdateWhere(gr(this,ea).onConflictNode)})}$call(t){return t(this)}toOperationNode(){return gr(this,ea).onConflictNode}};ea=new WeakMap;let OnConflictUpdateBuilder=Vo;const TopNode=freeze({is(e){return e.kind==="TopNode"},create(e,t){return freeze({kind:"TopNode",expression:e,modifiers:t})}});function parseTop(e,t){if(!isNumber(e)&&!isBigInt(e))throw new Error(`Invalid top expression: ${e}`);if(!isUndefined(t)&&!isTopModifiers(t))throw new Error(`Invalid top modifiers: ${t}`);return TopNode.create(e,t)}function isTopModifiers(e){return e==="percent"||e==="with ties"||e==="percent with ties"}const OrActionNode=freeze({is(e){return e.kind==="OrActionNode"},create(e){return freeze({kind:"OrActionNode",action:e})}});var Oi;const as=class as{constructor(t){_i(this,Oi);yi(this,Oi,freeze(t))}values(t){const[I,B]=parseInsertExpression(t);return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{columns:I,values:B})})}columns(t){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{columns:freeze(t.map(ColumnNode.create))})})}expression(t){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{values:parseExpression(t)})})}defaultValues(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{defaultValues:!0})})}modifyEnd(t){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithEndModifier(gr(this,Oi).queryNode,t.toOperationNode())})}ignore(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{orAction:OrActionNode.create("ignore")})})}orIgnore(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{orAction:OrActionNode.create("ignore")})})}orAbort(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{orAction:OrActionNode.create("abort")})})}orFail(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{orAction:OrActionNode.create("fail")})})}orReplace(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{orAction:OrActionNode.create("replace")})})}orRollback(){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{orAction:OrActionNode.create("rollback")})})}top(t,I){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithTop(gr(this,Oi).queryNode,parseTop(t,I))})}onConflict(t){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{onConflict:t(new OnConflictBuilder({onConflictNode:OnConflictNode.create()})).toOperationNode()})})}onDuplicateKeyUpdate(t){return new as({...gr(this,Oi),queryNode:InsertQueryNode.cloneWith(gr(this,Oi).queryNode,{onDuplicateKey:OnDuplicateKeyNode.create(parseUpdateObjectExpression(t))})})}returning(t){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithReturning(gr(this,Oi).queryNode,parseSelectArg(t))})}returningAll(){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithReturning(gr(this,Oi).queryNode,parseSelectAll())})}output(t){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithOutput(gr(this,Oi).queryNode,parseSelectArg(t))})}outputAll(t){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithOutput(gr(this,Oi).queryNode,parseSelectAll(t))})}clearReturning(){return new as({...gr(this,Oi),queryNode:QueryNode.cloneWithoutReturning(gr(this,Oi).queryNode)})}$call(t){return t(this)}$if(t,I){return t?I(this):new as({...gr(this,Oi)})}$castTo(){return new as(gr(this,Oi))}$narrowType(){return new as(gr(this,Oi))}$assertType(){return new as(gr(this,Oi))}withPlugin(t){return new as({...gr(this,Oi),executor:gr(this,Oi).executor.withPlugin(t)})}toOperationNode(){return gr(this,Oi).executor.transformQuery(gr(this,Oi).queryNode,gr(this,Oi).queryId)}compile(){return gr(this,Oi).executor.compileQuery(this.toOperationNode(),gr(this,Oi).queryId)}async execute(){const t=this.compile(),I=await gr(this,Oi).executor.executeQuery(t,gr(this,Oi).queryId),{adapter:B}=gr(this,Oi).executor,tr=t.query;return tr.returning&&B.supportsReturning||tr.output&&B.supportsOutput?I.rows:[new InsertResult(I.insertId,I.numAffectedRows??BigInt(0))]}async executeTakeFirst(){const[t]=await this.execute();return t}async executeTakeFirstOrThrow(t=NoResultError){const I=await this.executeTakeFirst();if(I===void 0)throw isNoResultErrorConstructor(t)?new t(this.toOperationNode()):t(this.toOperationNode());return I}async*stream(t=100){const I=this.compile(),B=gr(this,Oi).executor.stream(I,t,gr(this,Oi).queryId);for await(const tr of B)yield*tr.rows}async explain(t,I){return await new as({...gr(this,Oi),queryNode:QueryNode.cloneWithExplain(gr(this,Oi).queryNode,t,I)}).execute()}};Oi=new WeakMap;let InsertQueryBuilder=as;class DeleteResult{constructor(t){ji(this,"numDeletedRows");this.numDeletedRows=t}}const LimitNode=freeze({is(e){return e.kind==="LimitNode"},create(e){return freeze({kind:"LimitNode",limit:e})}});var Fi,Xa,Bo;const ps=class ps{constructor(t){_i(this,Xa);_i(this,Fi);yi(this,Fi,freeze(t))}where(...t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithWhere(gr(this,Fi).queryNode,parseValueBinaryOperationOrExpression(t))})}whereRef(t,I,B){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithWhere(gr(this,Fi).queryNode,parseReferentialBinaryOperation(t,I,B))})}clearWhere(){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithoutWhere(gr(this,Fi).queryNode)})}top(t,I){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithTop(gr(this,Fi).queryNode,parseTop(t,I))})}using(t){return new ps({...gr(this,Fi),queryNode:DeleteQueryNode.cloneWithUsing(gr(this,Fi).queryNode,parseTableExpressionOrList(t))})}innerJoin(...t){return Ai(this,Xa,Bo).call(this,"InnerJoin",t)}leftJoin(...t){return Ai(this,Xa,Bo).call(this,"LeftJoin",t)}rightJoin(...t){return Ai(this,Xa,Bo).call(this,"RightJoin",t)}fullJoin(...t){return Ai(this,Xa,Bo).call(this,"FullJoin",t)}returning(t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithReturning(gr(this,Fi).queryNode,parseSelectArg(t))})}returningAll(t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithReturning(gr(this,Fi).queryNode,parseSelectAll(t))})}output(t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithOutput(gr(this,Fi).queryNode,parseSelectArg(t))})}outputAll(t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithOutput(gr(this,Fi).queryNode,parseSelectAll(t))})}clearReturning(){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithoutReturning(gr(this,Fi).queryNode)})}clearLimit(){return new ps({...gr(this,Fi),queryNode:DeleteQueryNode.cloneWithoutLimit(gr(this,Fi).queryNode)})}orderBy(...t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithOrderByItems(gr(this,Fi).queryNode,parseOrderBy(t))})}clearOrderBy(){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithoutOrderBy(gr(this,Fi).queryNode)})}limit(t){return new ps({...gr(this,Fi),queryNode:DeleteQueryNode.cloneWithLimit(gr(this,Fi).queryNode,LimitNode.create(parseValueExpression(t)))})}modifyEnd(t){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithEndModifier(gr(this,Fi).queryNode,t.toOperationNode())})}$call(t){return t(this)}$if(t,I){return t?I(this):new ps({...gr(this,Fi)})}$castTo(){return new ps(gr(this,Fi))}$narrowType(){return new ps(gr(this,Fi))}$assertType(){return new ps(gr(this,Fi))}withPlugin(t){return new ps({...gr(this,Fi),executor:gr(this,Fi).executor.withPlugin(t)})}toOperationNode(){return gr(this,Fi).executor.transformQuery(gr(this,Fi).queryNode,gr(this,Fi).queryId)}compile(){return gr(this,Fi).executor.compileQuery(this.toOperationNode(),gr(this,Fi).queryId)}async execute(){const t=this.compile(),I=await gr(this,Fi).executor.executeQuery(t,gr(this,Fi).queryId),{adapter:B}=gr(this,Fi).executor,tr=t.query;return tr.returning&&B.supportsReturning||tr.output&&B.supportsOutput?I.rows:[new DeleteResult(I.numAffectedRows??BigInt(0))]}async executeTakeFirst(){const[t]=await this.execute();return t}async executeTakeFirstOrThrow(t=NoResultError){const I=await this.executeTakeFirst();if(I===void 0)throw isNoResultErrorConstructor(t)?new t(this.toOperationNode()):t(this.toOperationNode());return I}async*stream(t=100){const I=this.compile(),B=gr(this,Fi).executor.stream(I,t,gr(this,Fi).queryId);for await(const tr of B)yield*tr.rows}async explain(t,I){return await new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithExplain(gr(this,Fi).queryNode,t,I)}).execute()}};Fi=new WeakMap,Xa=new WeakSet,Bo=function(t,I){return new ps({...gr(this,Fi),queryNode:QueryNode.cloneWithJoin(gr(this,Fi).queryNode,parseJoin(t,I))})};let DeleteQueryBuilder=ps;class UpdateResult{constructor(t,I){ji(this,"numUpdatedRows");ji(this,"numChangedRows");this.numUpdatedRows=t,this.numChangedRows=I}}var Di,Ya,zo;const _s=class _s{constructor(t){_i(this,Ya);_i(this,Di);yi(this,Di,freeze(t))}where(...t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithWhere(gr(this,Di).queryNode,parseValueBinaryOperationOrExpression(t))})}whereRef(t,I,B){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithWhere(gr(this,Di).queryNode,parseReferentialBinaryOperation(t,I,B))})}clearWhere(){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithoutWhere(gr(this,Di).queryNode)})}top(t,I){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithTop(gr(this,Di).queryNode,parseTop(t,I))})}from(t){return new _s({...gr(this,Di),queryNode:UpdateQueryNode.cloneWithFromItems(gr(this,Di).queryNode,parseTableExpressionOrList(t))})}innerJoin(...t){return Ai(this,Ya,zo).call(this,"InnerJoin",t)}leftJoin(...t){return Ai(this,Ya,zo).call(this,"LeftJoin",t)}rightJoin(...t){return Ai(this,Ya,zo).call(this,"RightJoin",t)}fullJoin(...t){return Ai(this,Ya,zo).call(this,"FullJoin",t)}orderBy(...t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithOrderByItems(gr(this,Di).queryNode,parseOrderBy(t))})}clearOrderBy(){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithoutOrderBy(gr(this,Di).queryNode)})}limit(t){return new _s({...gr(this,Di),queryNode:UpdateQueryNode.cloneWithLimit(gr(this,Di).queryNode,LimitNode.create(parseValueExpression(t)))})}set(...t){return new _s({...gr(this,Di),queryNode:UpdateQueryNode.cloneWithUpdates(gr(this,Di).queryNode,parseUpdate(...t))})}returning(t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithReturning(gr(this,Di).queryNode,parseSelectArg(t))})}returningAll(t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithReturning(gr(this,Di).queryNode,parseSelectAll(t))})}output(t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithOutput(gr(this,Di).queryNode,parseSelectArg(t))})}outputAll(t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithOutput(gr(this,Di).queryNode,parseSelectAll(t))})}modifyEnd(t){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithEndModifier(gr(this,Di).queryNode,t.toOperationNode())})}clearReturning(){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithoutReturning(gr(this,Di).queryNode)})}$call(t){return t(this)}$if(t,I){return t?I(this):new _s({...gr(this,Di)})}$castTo(){return new _s(gr(this,Di))}$narrowType(){return new _s(gr(this,Di))}$assertType(){return new _s(gr(this,Di))}withPlugin(t){return new _s({...gr(this,Di),executor:gr(this,Di).executor.withPlugin(t)})}toOperationNode(){return gr(this,Di).executor.transformQuery(gr(this,Di).queryNode,gr(this,Di).queryId)}compile(){return gr(this,Di).executor.compileQuery(this.toOperationNode(),gr(this,Di).queryId)}async execute(){const t=this.compile(),I=await gr(this,Di).executor.executeQuery(t,gr(this,Di).queryId),{adapter:B}=gr(this,Di).executor,tr=t.query;return tr.returning&&B.supportsReturning||tr.output&&B.supportsOutput?I.rows:[new UpdateResult(I.numAffectedRows??BigInt(0),I.numChangedRows)]}async executeTakeFirst(){const[t]=await this.execute();return t}async executeTakeFirstOrThrow(t=NoResultError){const I=await this.executeTakeFirst();if(I===void 0)throw isNoResultErrorConstructor(t)?new t(this.toOperationNode()):t(this.toOperationNode());return I}async*stream(t=100){const I=this.compile(),B=gr(this,Di).executor.stream(I,t,gr(this,Di).queryId);for await(const tr of B)yield*tr.rows}async explain(t,I){return await new _s({...gr(this,Di),queryNode:QueryNode.cloneWithExplain(gr(this,Di).queryNode,t,I)}).execute()}};Di=new WeakMap,Ya=new WeakSet,zo=function(t,I){return new _s({...gr(this,Di),queryNode:QueryNode.cloneWithJoin(gr(this,Di).queryNode,parseJoin(t,I))})};let UpdateQueryBuilder=_s;const CommonTableExpressionNameNode=freeze({is(e){return e.kind==="CommonTableExpressionNameNode"},create(e,t){return freeze({kind:"CommonTableExpressionNameNode",table:TableNode.create(e),columns:t?freeze(t.map(ColumnNode.create)):void 0})}}),CommonTableExpressionNode=freeze({is(e){return e.kind==="CommonTableExpressionNode"},create(e,t){return freeze({kind:"CommonTableExpressionNode",name:e,expression:t})},cloneWith(e,t){return freeze({...e,...t})}});var ba;const fl=class fl{constructor(t){_i(this,ba);yi(this,ba,freeze(t))}materialized(){return new fl({...gr(this,ba),node:CommonTableExpressionNode.cloneWith(gr(this,ba).node,{materialized:!0})})}notMaterialized(){return new fl({...gr(this,ba),node:CommonTableExpressionNode.cloneWith(gr(this,ba).node,{materialized:!1})})}toOperationNode(){return gr(this,ba).node}};ba=new WeakMap;let CTEBuilder=fl;function parseCommonTableExpression(e,t){const I=t(createQueryCreator()).toOperationNode();return isFunction(e)?e(cteBuilderFactory(I)).toOperationNode():CommonTableExpressionNode.create(parseCommonTableExpressionName(e),I)}function cteBuilderFactory(e){return t=>new CTEBuilder({node:CommonTableExpressionNode.create(parseCommonTableExpressionName(t),e)})}function parseCommonTableExpressionName(e){if(e.includes("(")){const t=e.split(/[\(\)]/),I=t[0],B=t[1].split(",").map(tr=>tr.trim());return CommonTableExpressionNameNode.create(I,B)}else return CommonTableExpressionNameNode.create(e)}const WithNode=freeze({is(e){return e.kind==="WithNode"},create(e,t){return freeze({kind:"WithNode",expressions:freeze([e]),...t})},cloneWithExpression(e,t){return freeze({...e,expressions:freeze([...e.expressions,t])})}}),CHARS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function randomString(e){let t="";for(let I=0;I<e;++I)t+=randomChar();return t}function randomChar(){return CHARS[~~(Math.random()*CHARS.length)]}function createQueryId(){return new LazyQueryId}var yo;class LazyQueryId{constructor(){_i(this,yo)}get queryId(){return gr(this,yo)===void 0&&yi(this,yo,randomString(8)),gr(this,yo)}}yo=new WeakMap;function requireAllProps(e){return e}var _l;class OperationNodeTransformer{constructor(){ji(this,"nodeStack",[]);_i(this,_l,freeze({AliasNode:this.transformAlias.bind(this),ColumnNode:this.transformColumn.bind(this),IdentifierNode:this.transformIdentifier.bind(this),SchemableIdentifierNode:this.transformSchemableIdentifier.bind(this),RawNode:this.transformRaw.bind(this),ReferenceNode:this.transformReference.bind(this),SelectQueryNode:this.transformSelectQuery.bind(this),SelectionNode:this.transformSelection.bind(this),TableNode:this.transformTable.bind(this),FromNode:this.transformFrom.bind(this),SelectAllNode:this.transformSelectAll.bind(this),AndNode:this.transformAnd.bind(this),OrNode:this.transformOr.bind(this),ValueNode:this.transformValue.bind(this),ValueListNode:this.transformValueList.bind(this),PrimitiveValueListNode:this.transformPrimitiveValueList.bind(this),ParensNode:this.transformParens.bind(this),JoinNode:this.transformJoin.bind(this),OperatorNode:this.transformOperator.bind(this),WhereNode:this.transformWhere.bind(this),InsertQueryNode:this.transformInsertQuery.bind(this),DeleteQueryNode:this.transformDeleteQuery.bind(this),ReturningNode:this.transformReturning.bind(this),CreateTableNode:this.transformCreateTable.bind(this),AddColumnNode:this.transformAddColumn.bind(this),ColumnDefinitionNode:this.transformColumnDefinition.bind(this),DropTableNode:this.transformDropTable.bind(this),DataTypeNode:this.transformDataType.bind(this),OrderByNode:this.transformOrderBy.bind(this),OrderByItemNode:this.transformOrderByItem.bind(this),GroupByNode:this.transformGroupBy.bind(this),GroupByItemNode:this.transformGroupByItem.bind(this),UpdateQueryNode:this.transformUpdateQuery.bind(this),ColumnUpdateNode:this.transformColumnUpdate.bind(this),LimitNode:this.transformLimit.bind(this),OffsetNode:this.transformOffset.bind(this),OnConflictNode:this.transformOnConflict.bind(this),OnDuplicateKeyNode:this.transformOnDuplicateKey.bind(this),CreateIndexNode:this.transformCreateIndex.bind(this),DropIndexNode:this.transformDropIndex.bind(this),ListNode:this.transformList.bind(this),PrimaryKeyConstraintNode:this.transformPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.transformUniqueConstraint.bind(this),ReferencesNode:this.transformReferences.bind(this),CheckConstraintNode:this.transformCheckConstraint.bind(this),WithNode:this.transformWith.bind(this),CommonTableExpressionNode:this.transformCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.transformCommonTableExpressionName.bind(this),HavingNode:this.transformHaving.bind(this),CreateSchemaNode:this.transformCreateSchema.bind(this),DropSchemaNode:this.transformDropSchema.bind(this),AlterTableNode:this.transformAlterTable.bind(this),DropColumnNode:this.transformDropColumn.bind(this),RenameColumnNode:this.transformRenameColumn.bind(this),AlterColumnNode:this.transformAlterColumn.bind(this),ModifyColumnNode:this.transformModifyColumn.bind(this),AddConstraintNode:this.transformAddConstraint.bind(this),DropConstraintNode:this.transformDropConstraint.bind(this),RenameConstraintNode:this.transformRenameConstraint.bind(this),ForeignKeyConstraintNode:this.transformForeignKeyConstraint.bind(this),CreateViewNode:this.transformCreateView.bind(this),RefreshMaterializedViewNode:this.transformRefreshMaterializedView.bind(this),DropViewNode:this.transformDropView.bind(this),GeneratedNode:this.transformGenerated.bind(this),DefaultValueNode:this.transformDefaultValue.bind(this),OnNode:this.transformOn.bind(this),ValuesNode:this.transformValues.bind(this),SelectModifierNode:this.transformSelectModifier.bind(this),CreateTypeNode:this.transformCreateType.bind(this),DropTypeNode:this.transformDropType.bind(this),ExplainNode:this.transformExplain.bind(this),DefaultInsertValueNode:this.transformDefaultInsertValue.bind(this),AggregateFunctionNode:this.transformAggregateFunction.bind(this),OverNode:this.transformOver.bind(this),PartitionByNode:this.transformPartitionBy.bind(this),PartitionByItemNode:this.transformPartitionByItem.bind(this),SetOperationNode:this.transformSetOperation.bind(this),BinaryOperationNode:this.transformBinaryOperation.bind(this),UnaryOperationNode:this.transformUnaryOperation.bind(this),UsingNode:this.transformUsing.bind(this),FunctionNode:this.transformFunction.bind(this),CaseNode:this.transformCase.bind(this),WhenNode:this.transformWhen.bind(this),JSONReferenceNode:this.transformJSONReference.bind(this),JSONPathNode:this.transformJSONPath.bind(this),JSONPathLegNode:this.transformJSONPathLeg.bind(this),JSONOperatorChainNode:this.transformJSONOperatorChain.bind(this),TupleNode:this.transformTuple.bind(this),MergeQueryNode:this.transformMergeQuery.bind(this),MatchedNode:this.transformMatched.bind(this),AddIndexNode:this.transformAddIndex.bind(this),CastNode:this.transformCast.bind(this),FetchNode:this.transformFetch.bind(this),TopNode:this.transformTop.bind(this),OutputNode:this.transformOutput.bind(this),OrActionNode:this.transformOrAction.bind(this),CollateNode:this.transformCollate.bind(this)}))}transformNode(t,I){if(!t)return t;this.nodeStack.push(t);const B=this.transformNodeImpl(t,I);return this.nodeStack.pop(),freeze(B)}transformNodeImpl(t,I){return gr(this,_l)[t.kind](t,I)}transformNodeList(t,I){return t&&freeze(t.map(B=>this.transformNode(B,I)))}transformSelectQuery(t,I){return{kind:"SelectQueryNode",from:this.transformNode(t.from,I),selections:this.transformNodeList(t.selections,I),distinctOn:this.transformNodeList(t.distinctOn,I),joins:this.transformNodeList(t.joins,I),groupBy:this.transformNode(t.groupBy,I),orderBy:this.transformNode(t.orderBy,I),where:this.transformNode(t.where,I),frontModifiers:this.transformNodeList(t.frontModifiers,I),endModifiers:this.transformNodeList(t.endModifiers,I),limit:this.transformNode(t.limit,I),offset:this.transformNode(t.offset,I),with:this.transformNode(t.with,I),having:this.transformNode(t.having,I),explain:this.transformNode(t.explain,I),setOperations:this.transformNodeList(t.setOperations,I),fetch:this.transformNode(t.fetch,I),top:this.transformNode(t.top,I)}}transformSelection(t,I){return{kind:"SelectionNode",selection:this.transformNode(t.selection,I)}}transformColumn(t,I){return{kind:"ColumnNode",column:this.transformNode(t.column,I)}}transformAlias(t,I){return{kind:"AliasNode",node:this.transformNode(t.node,I),alias:this.transformNode(t.alias,I)}}transformTable(t,I){return{kind:"TableNode",table:this.transformNode(t.table,I)}}transformFrom(t,I){return{kind:"FromNode",froms:this.transformNodeList(t.froms,I)}}transformReference(t,I){return{kind:"ReferenceNode",column:this.transformNode(t.column,I),table:this.transformNode(t.table,I)}}transformAnd(t,I){return{kind:"AndNode",left:this.transformNode(t.left,I),right:this.transformNode(t.right,I)}}transformOr(t,I){return{kind:"OrNode",left:this.transformNode(t.left,I),right:this.transformNode(t.right,I)}}transformValueList(t,I){return{kind:"ValueListNode",values:this.transformNodeList(t.values,I)}}transformParens(t,I){return{kind:"ParensNode",node:this.transformNode(t.node,I)}}transformJoin(t,I){return{kind:"JoinNode",joinType:t.joinType,table:this.transformNode(t.table,I),on:this.transformNode(t.on,I)}}transformRaw(t,I){return{kind:"RawNode",sqlFragments:freeze([...t.sqlFragments]),parameters:this.transformNodeList(t.parameters,I)}}transformWhere(t,I){return{kind:"WhereNode",where:this.transformNode(t.where,I)}}transformInsertQuery(t,I){return{kind:"InsertQueryNode",into:this.transformNode(t.into,I),columns:this.transformNodeList(t.columns,I),values:this.transformNode(t.values,I),returning:this.transformNode(t.returning,I),onConflict:this.transformNode(t.onConflict,I),onDuplicateKey:this.transformNode(t.onDuplicateKey,I),endModifiers:this.transformNodeList(t.endModifiers,I),with:this.transformNode(t.with,I),ignore:t.ignore,orAction:this.transformNode(t.orAction,I),replace:t.replace,explain:this.transformNode(t.explain,I),defaultValues:t.defaultValues,top:this.transformNode(t.top,I),output:this.transformNode(t.output,I)}}transformValues(t,I){return{kind:"ValuesNode",values:this.transformNodeList(t.values,I)}}transformDeleteQuery(t,I){return{kind:"DeleteQueryNode",from:this.transformNode(t.from,I),using:this.transformNode(t.using,I),joins:this.transformNodeList(t.joins,I),where:this.transformNode(t.where,I),returning:this.transformNode(t.returning,I),endModifiers:this.transformNodeList(t.endModifiers,I),with:this.transformNode(t.with,I),orderBy:this.transformNode(t.orderBy,I),limit:this.transformNode(t.limit,I),explain:this.transformNode(t.explain,I),top:this.transformNode(t.top,I),output:this.transformNode(t.output,I)}}transformReturning(t,I){return{kind:"ReturningNode",selections:this.transformNodeList(t.selections,I)}}transformCreateTable(t,I){return{kind:"CreateTableNode",table:this.transformNode(t.table,I),columns:this.transformNodeList(t.columns,I),constraints:this.transformNodeList(t.constraints,I),temporary:t.temporary,ifNotExists:t.ifNotExists,onCommit:t.onCommit,frontModifiers:this.transformNodeList(t.frontModifiers,I),endModifiers:this.transformNodeList(t.endModifiers,I),selectQuery:this.transformNode(t.selectQuery,I)}}transformColumnDefinition(t,I){return{kind:"ColumnDefinitionNode",column:this.transformNode(t.column,I),dataType:this.transformNode(t.dataType,I),references:this.transformNode(t.references,I),primaryKey:t.primaryKey,autoIncrement:t.autoIncrement,unique:t.unique,notNull:t.notNull,unsigned:t.unsigned,defaultTo:this.transformNode(t.defaultTo,I),check:this.transformNode(t.check,I),generated:this.transformNode(t.generated,I),frontModifiers:this.transformNodeList(t.frontModifiers,I),endModifiers:this.transformNodeList(t.endModifiers,I),nullsNotDistinct:t.nullsNotDistinct,identity:t.identity,ifNotExists:t.ifNotExists}}transformAddColumn(t,I){return{kind:"AddColumnNode",column:this.transformNode(t.column,I)}}transformDropTable(t,I){return{kind:"DropTableNode",table:this.transformNode(t.table,I),ifExists:t.ifExists,cascade:t.cascade}}transformOrderBy(t,I){return{kind:"OrderByNode",items:this.transformNodeList(t.items,I)}}transformOrderByItem(t,I){return{kind:"OrderByItemNode",orderBy:this.transformNode(t.orderBy,I),direction:this.transformNode(t.direction,I),collation:this.transformNode(t.collation,I),nulls:t.nulls}}transformGroupBy(t,I){return{kind:"GroupByNode",items:this.transformNodeList(t.items,I)}}transformGroupByItem(t,I){return{kind:"GroupByItemNode",groupBy:this.transformNode(t.groupBy,I)}}transformUpdateQuery(t,I){return{kind:"UpdateQueryNode",table:this.transformNode(t.table,I),from:this.transformNode(t.from,I),joins:this.transformNodeList(t.joins,I),where:this.transformNode(t.where,I),updates:this.transformNodeList(t.updates,I),returning:this.transformNode(t.returning,I),endModifiers:this.transformNodeList(t.endModifiers,I),with:this.transformNode(t.with,I),explain:this.transformNode(t.explain,I),limit:this.transformNode(t.limit,I),top:this.transformNode(t.top,I),output:this.transformNode(t.output,I),orderBy:this.transformNode(t.orderBy,I)}}transformColumnUpdate(t,I){return{kind:"ColumnUpdateNode",column:this.transformNode(t.column,I),value:this.transformNode(t.value,I)}}transformLimit(t,I){return{kind:"LimitNode",limit:this.transformNode(t.limit,I)}}transformOffset(t,I){return{kind:"OffsetNode",offset:this.transformNode(t.offset,I)}}transformOnConflict(t,I){return{kind:"OnConflictNode",columns:this.transformNodeList(t.columns,I),constraint:this.transformNode(t.constraint,I),indexExpression:this.transformNode(t.indexExpression,I),indexWhere:this.transformNode(t.indexWhere,I),updates:this.transformNodeList(t.updates,I),updateWhere:this.transformNode(t.updateWhere,I),doNothing:t.doNothing}}transformOnDuplicateKey(t,I){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(t.updates,I)}}transformCreateIndex(t,I){return{kind:"CreateIndexNode",name:this.transformNode(t.name,I),table:this.transformNode(t.table,I),columns:this.transformNodeList(t.columns,I),unique:t.unique,using:this.transformNode(t.using,I),ifNotExists:t.ifNotExists,where:this.transformNode(t.where,I),nullsNotDistinct:t.nullsNotDistinct}}transformList(t,I){return{kind:"ListNode",items:this.transformNodeList(t.items,I)}}transformDropIndex(t,I){return{kind:"DropIndexNode",name:this.transformNode(t.name,I),table:this.transformNode(t.table,I),ifExists:t.ifExists,cascade:t.cascade}}transformPrimaryKeyConstraint(t,I){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(t.columns,I),name:this.transformNode(t.name,I),deferrable:t.deferrable,initiallyDeferred:t.initiallyDeferred}}transformUniqueConstraint(t,I){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(t.columns,I),name:this.transformNode(t.name,I),nullsNotDistinct:t.nullsNotDistinct,deferrable:t.deferrable,initiallyDeferred:t.initiallyDeferred}}transformForeignKeyConstraint(t,I){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(t.columns,I),references:this.transformNode(t.references,I),name:this.transformNode(t.name,I),onDelete:t.onDelete,onUpdate:t.onUpdate,deferrable:t.deferrable,initiallyDeferred:t.initiallyDeferred}}transformSetOperation(t,I){return{kind:"SetOperationNode",operator:t.operator,expression:this.transformNode(t.expression,I),all:t.all}}transformReferences(t,I){return{kind:"ReferencesNode",table:this.transformNode(t.table,I),columns:this.transformNodeList(t.columns,I),onDelete:t.onDelete,onUpdate:t.onUpdate}}transformCheckConstraint(t,I){return{kind:"CheckConstraintNode",expression:this.transformNode(t.expression,I),name:this.transformNode(t.name,I)}}transformWith(t,I){return{kind:"WithNode",expressions:this.transformNodeList(t.expressions,I),recursive:t.recursive}}transformCommonTableExpression(t,I){return{kind:"CommonTableExpressionNode",name:this.transformNode(t.name,I),materialized:t.materialized,expression:this.transformNode(t.expression,I)}}transformCommonTableExpressionName(t,I){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(t.table,I),columns:this.transformNodeList(t.columns,I)}}transformHaving(t,I){return{kind:"HavingNode",having:this.transformNode(t.having,I)}}transformCreateSchema(t,I){return{kind:"CreateSchemaNode",schema:this.transformNode(t.schema,I),ifNotExists:t.ifNotExists}}transformDropSchema(t,I){return{kind:"DropSchemaNode",schema:this.transformNode(t.schema,I),ifExists:t.ifExists,cascade:t.cascade}}transformAlterTable(t,I){return{kind:"AlterTableNode",table:this.transformNode(t.table,I),renameTo:this.transformNode(t.renameTo,I),setSchema:this.transformNode(t.setSchema,I),columnAlterations:this.transformNodeList(t.columnAlterations,I),addConstraint:this.transformNode(t.addConstraint,I),dropConstraint:this.transformNode(t.dropConstraint,I),renameConstraint:this.transformNode(t.renameConstraint,I),addIndex:this.transformNode(t.addIndex,I),dropIndex:this.transformNode(t.dropIndex,I)}}transformDropColumn(t,I){return{kind:"DropColumnNode",column:this.transformNode(t.column,I)}}transformRenameColumn(t,I){return{kind:"RenameColumnNode",column:this.transformNode(t.column,I),renameTo:this.transformNode(t.renameTo,I)}}transformAlterColumn(t,I){return{kind:"AlterColumnNode",column:this.transformNode(t.column,I),dataType:this.transformNode(t.dataType,I),dataTypeExpression:this.transformNode(t.dataTypeExpression,I),setDefault:this.transformNode(t.setDefault,I),dropDefault:t.dropDefault,setNotNull:t.setNotNull,dropNotNull:t.dropNotNull}}transformModifyColumn(t,I){return{kind:"ModifyColumnNode",column:this.transformNode(t.column,I)}}transformAddConstraint(t,I){return{kind:"AddConstraintNode",constraint:this.transformNode(t.constraint,I)}}transformDropConstraint(t,I){return{kind:"DropConstraintNode",constraintName:this.transformNode(t.constraintName,I),ifExists:t.ifExists,modifier:t.modifier}}transformRenameConstraint(t,I){return{kind:"RenameConstraintNode",oldName:this.transformNode(t.oldName,I),newName:this.transformNode(t.newName,I)}}transformCreateView(t,I){return{kind:"CreateViewNode",name:this.transformNode(t.name,I),temporary:t.temporary,orReplace:t.orReplace,ifNotExists:t.ifNotExists,materialized:t.materialized,columns:this.transformNodeList(t.columns,I),as:this.transformNode(t.as,I)}}transformRefreshMaterializedView(t,I){return{kind:"RefreshMaterializedViewNode",name:this.transformNode(t.name,I),concurrently:t.concurrently,withNoData:t.withNoData}}transformDropView(t,I){return{kind:"DropViewNode",name:this.transformNode(t.name,I),ifExists:t.ifExists,materialized:t.materialized,cascade:t.cascade}}transformGenerated(t,I){return{kind:"GeneratedNode",byDefault:t.byDefault,always:t.always,identity:t.identity,stored:t.stored,expression:this.transformNode(t.expression,I)}}transformDefaultValue(t,I){return{kind:"DefaultValueNode",defaultValue:this.transformNode(t.defaultValue,I)}}transformOn(t,I){return{kind:"OnNode",on:this.transformNode(t.on,I)}}transformSelectModifier(t,I){return{kind:"SelectModifierNode",modifier:t.modifier,rawModifier:this.transformNode(t.rawModifier,I),of:this.transformNodeList(t.of,I)}}transformCreateType(t,I){return{kind:"CreateTypeNode",name:this.transformNode(t.name,I),enum:this.transformNode(t.enum,I)}}transformDropType(t,I){return{kind:"DropTypeNode",name:this.transformNode(t.name,I),ifExists:t.ifExists}}transformExplain(t,I){return{kind:"ExplainNode",format:t.format,options:this.transformNode(t.options,I)}}transformSchemableIdentifier(t,I){return{kind:"SchemableIdentifierNode",schema:this.transformNode(t.schema,I),identifier:this.transformNode(t.identifier,I)}}transformAggregateFunction(t,I){return{kind:"AggregateFunctionNode",func:t.func,aggregated:this.transformNodeList(t.aggregated,I),distinct:t.distinct,orderBy:this.transformNode(t.orderBy,I),withinGroup:this.transformNode(t.withinGroup,I),filter:this.transformNode(t.filter,I),over:this.transformNode(t.over,I)}}transformOver(t,I){return{kind:"OverNode",orderBy:this.transformNode(t.orderBy,I),partitionBy:this.transformNode(t.partitionBy,I)}}transformPartitionBy(t,I){return{kind:"PartitionByNode",items:this.transformNodeList(t.items,I)}}transformPartitionByItem(t,I){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(t.partitionBy,I)}}transformBinaryOperation(t,I){return{kind:"BinaryOperationNode",leftOperand:this.transformNode(t.leftOperand,I),operator:this.transformNode(t.operator,I),rightOperand:this.transformNode(t.rightOperand,I)}}transformUnaryOperation(t,I){return{kind:"UnaryOperationNode",operator:this.transformNode(t.operator,I),operand:this.transformNode(t.operand,I)}}transformUsing(t,I){return{kind:"UsingNode",tables:this.transformNodeList(t.tables,I)}}transformFunction(t,I){return{kind:"FunctionNode",func:t.func,arguments:this.transformNodeList(t.arguments,I)}}transformCase(t,I){return{kind:"CaseNode",value:this.transformNode(t.value,I),when:this.transformNodeList(t.when,I),else:this.transformNode(t.else,I),isStatement:t.isStatement}}transformWhen(t,I){return{kind:"WhenNode",condition:this.transformNode(t.condition,I),result:this.transformNode(t.result,I)}}transformJSONReference(t,I){return{kind:"JSONReferenceNode",reference:this.transformNode(t.reference,I),traversal:this.transformNode(t.traversal,I)}}transformJSONPath(t,I){return{kind:"JSONPathNode",inOperator:this.transformNode(t.inOperator,I),pathLegs:this.transformNodeList(t.pathLegs,I)}}transformJSONPathLeg(t,I){return{kind:"JSONPathLegNode",type:t.type,value:t.value}}transformJSONOperatorChain(t,I){return{kind:"JSONOperatorChainNode",operator:this.transformNode(t.operator,I),values:this.transformNodeList(t.values,I)}}transformTuple(t,I){return{kind:"TupleNode",values:this.transformNodeList(t.values,I)}}transformMergeQuery(t,I){return{kind:"MergeQueryNode",into:this.transformNode(t.into,I),using:this.transformNode(t.using,I),whens:this.transformNodeList(t.whens,I),with:this.transformNode(t.with,I),top:this.transformNode(t.top,I),endModifiers:this.transformNodeList(t.endModifiers,I),output:this.transformNode(t.output,I),returning:this.transformNode(t.returning,I)}}transformMatched(t,I){return{kind:"MatchedNode",not:t.not,bySource:t.bySource}}transformAddIndex(t,I){return{kind:"AddIndexNode",name:this.transformNode(t.name,I),columns:this.transformNodeList(t.columns,I),unique:t.unique,using:this.transformNode(t.using,I),ifNotExists:t.ifNotExists}}transformCast(t,I){return{kind:"CastNode",expression:this.transformNode(t.expression,I),dataType:this.transformNode(t.dataType,I)}}transformFetch(t,I){return{kind:"FetchNode",rowCount:this.transformNode(t.rowCount,I),modifier:t.modifier}}transformTop(t,I){return{kind:"TopNode",expression:t.expression,modifiers:t.modifiers}}transformOutput(t,I){return{kind:"OutputNode",selections:this.transformNodeList(t.selections,I)}}transformDataType(t,I){return t}transformSelectAll(t,I){return t}transformIdentifier(t,I){return t}transformValue(t,I){return t}transformPrimitiveValueList(t,I){return t}transformOperator(t,I){return t}transformDefaultInsertValue(t,I){return t}transformOrAction(t,I){return t}transformCollate(t,I){return t}}_l=new WeakMap;const ROOT_OPERATION_NODES=freeze({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,RefreshMaterializedViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0,MergeQueryNode:!0}),SCHEMALESS_FUNCTIONS={json_agg:!0,to_json:!0};var wo,Za,eo,ys,Pl,Yl,Zl,eu,ja,hl,tu;class WithSchemaTransformer extends OperationNodeTransformer{constructor(I){super();_i(this,ys);_i(this,wo);_i(this,Za,new Set);_i(this,eo,new Set);yi(this,wo,I)}transformNodeImpl(I,B){if(!Ai(this,ys,Yl).call(this,I))return super.transformNodeImpl(I,B);const tr=Ai(this,ys,eu).call(this,I);for(const lr of tr)gr(this,eo).add(lr);const rr=Ai(this,ys,Zl).call(this,I);for(const lr of rr)gr(this,Za).add(lr);const ir=super.transformNodeImpl(I,B);for(const lr of rr)gr(this,Za).delete(lr);for(const lr of tr)gr(this,eo).delete(lr);return ir}transformSchemableIdentifier(I,B){const tr=super.transformSchemableIdentifier(I,B);return tr.schema||!gr(this,Za).has(I.identifier.name)?tr:{...tr,schema:IdentifierNode.create(gr(this,wo))}}transformReferences(I,B){const tr=super.transformReferences(I,B);return tr.table.table.schema?tr:{...tr,table:TableNode.createWithSchema(gr(this,wo),tr.table.table.identifier.name)}}transformAggregateFunction(I,B){return{...super.transformAggregateFunction({...I,aggregated:[]},B),aggregated:Ai(this,ys,Pl).call(this,I,B,"aggregated")}}transformFunction(I,B){return{...super.transformFunction({...I,arguments:[]},B),arguments:Ai(this,ys,Pl).call(this,I,B,"arguments")}}}wo=new WeakMap,Za=new WeakMap,eo=new WeakMap,ys=new WeakSet,Pl=function(I,B,tr){return SCHEMALESS_FUNCTIONS[I.func]?I[tr].map(rr=>!TableNode.is(rr)||rr.table.schema?this.transformNode(rr,B):{...rr,table:this.transformIdentifier(rr.table.identifier,B)}):this.transformNodeList(I[tr],B)},Yl=function(I){return I.kind in ROOT_OPERATION_NODES},Zl=function(I){const B=new Set;if("name"in I&&I.name&&SchemableIdentifierNode.is(I.name)&&Ai(this,ys,hl).call(this,I.name,B),"from"in I&&I.from)for(const tr of I.from.froms)Ai(this,ys,ja).call(this,tr,B);if("into"in I&&I.into&&Ai(this,ys,ja).call(this,I.into,B),"table"in I&&I.table&&Ai(this,ys,ja).call(this,I.table,B),"joins"in I&&I.joins)for(const tr of I.joins)Ai(this,ys,ja).call(this,tr.table,B);return"using"in I&&I.using&&Ai(this,ys,ja).call(this,I.using,B),B},eu=function(I){const B=new Set;return"with"in I&&I.with&&Ai(this,ys,tu).call(this,I.with,B),B},ja=function(I,B){if(TableNode.is(I))Ai(this,ys,hl).call(this,I.table,B);else if(AliasNode.is(I)&&TableNode.is(I.node))Ai(this,ys,hl).call(this,I.node.table,B);else if(ListNode.is(I))for(const tr of I.items)Ai(this,ys,ja).call(this,tr,B)},hl=function(I,B){const tr=I.identifier.name;!gr(this,Za).has(tr)&&!gr(this,eo).has(tr)&&B.add(tr)},tu=function(I,B){for(const tr of I.expressions){const rr=tr.name.table.table.identifier.name;gr(this,eo).has(rr)||B.add(rr)}};var Zo;class WithSchemaPlugin{constructor(t){_i(this,Zo);yi(this,Zo,new WithSchemaTransformer(t))}transformQuery(t){return gr(this,Zo).transformNode(t.node,t.queryId)}async transformResult(t){return t.result}}Zo=new WeakMap;const MatchedNode=freeze({is(e){return e.kind==="MatchedNode"},create(e,t=!1){return freeze({kind:"MatchedNode",not:e,bySource:t})}});function parseMergeWhen(e,t,I){return WhenNode.create(parseFilterList([MatchedNode.create(!e.isMatched,e.bySource),...t&&t.length>0?[t.length===3&&I?parseReferentialBinaryOperation(t[0],t[1],t[2]):parseValueBinaryOperationOrExpression(t)]:[]],"and",!1))}function parseMergeThen(e){return isString(e)?RawNode.create([e],[]):isOperationNodeSource(e)?e.toOperationNode():e}var el,bo,Eo,Jl;let Deferred$1=(Jl=class{constructor(){_i(this,el);_i(this,bo);_i(this,Eo);ji(this,"resolve",t=>{gr(this,bo)&&gr(this,bo).call(this,t)});ji(this,"reject",t=>{gr(this,Eo)&&gr(this,Eo).call(this,t)});yi(this,el,new Promise((t,I)=>{yi(this,Eo,I),yi(this,bo,t)}))}get promise(){return gr(this,el)}},el=new WeakMap,bo=new WeakMap,Eo=new WeakMap,Jl);async function provideControlledConnection(e){const t=new Deferred$1,I=new Deferred$1;return e.provideConnection(async B=>(t.resolve(B),await I.promise)).catch(B=>t.reject(B)),freeze({connection:await t.promise,release:I.resolve})}const NO_PLUGINS=freeze([]);var to,tl,kl;class QueryExecutorBase{constructor(t=NO_PLUGINS){_i(this,tl);_i(this,to);yi(this,to,t)}get plugins(){return gr(this,to)}transformQuery(t,I){for(const B of gr(this,to)){const tr=B.transformQuery({node:t,queryId:I});if(tr.kind===t.kind)t=tr;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${t.kind}`,`but it returned a ${tr.kind}`].join(" "))}return t}async executeQuery(t,I){return await this.provideConnection(async B=>{const tr=await B.executeQuery(t);return"numUpdatedOrDeletedRows"in tr&&logOnce("kysely:warning: outdated driver/plugin detected! `QueryResult.numUpdatedOrDeletedRows` has been replaced with `QueryResult.numAffectedRows`."),await Ai(this,tl,kl).call(this,tr,I)})}async*stream(t,I,B){const{connection:tr,release:rr}=await provideControlledConnection(this);try{for await(const ir of tr.streamQuery(t,I))yield await Ai(this,tl,kl).call(this,ir,B)}finally{rr()}}}to=new WeakMap,tl=new WeakSet,kl=async function(t,I){for(const B of gr(this,to))t=await B.transformResult({result:t,queryId:I});return t};class NoopQueryExecutor extends QueryExecutorBase{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(t){return new NoopQueryExecutor([...this.plugins,t])}withPlugins(t){return new NoopQueryExecutor([...this.plugins,...t])}withPluginAtFront(t){return new NoopQueryExecutor([t,...this.plugins])}withoutPlugins(){return new NoopQueryExecutor([])}}const NOOP_QUERY_EXECUTOR=new NoopQueryExecutor;class MergeResult{constructor(t){ji(this,"numChangedRows");this.numChangedRows=t}}var Ns;const Na=class Na{constructor(t){_i(this,Ns);yi(this,Ns,freeze(t))}modifyEnd(t){return new Na({...gr(this,Ns),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ns).queryNode,t.toOperationNode())})}top(t,I){return new Na({...gr(this,Ns),queryNode:QueryNode.cloneWithTop(gr(this,Ns).queryNode,parseTop(t,I))})}using(...t){return new WheneableMergeQueryBuilder({...gr(this,Ns),queryNode:MergeQueryNode.cloneWithUsing(gr(this,Ns).queryNode,parseJoin("Using",t))})}returning(t){return new Na({...gr(this,Ns),queryNode:QueryNode.cloneWithReturning(gr(this,Ns).queryNode,parseSelectArg(t))})}returningAll(t){return new Na({...gr(this,Ns),queryNode:QueryNode.cloneWithReturning(gr(this,Ns).queryNode,parseSelectAll(t))})}output(t){return new Na({...gr(this,Ns),queryNode:QueryNode.cloneWithOutput(gr(this,Ns).queryNode,parseSelectArg(t))})}outputAll(t){return new Na({...gr(this,Ns),queryNode:QueryNode.cloneWithOutput(gr(this,Ns).queryNode,parseSelectAll(t))})}};Ns=new WeakMap;let MergeQueryBuilder=Na;var ns,Hs,pl,Wa;const ya=class ya{constructor(t){_i(this,Hs);_i(this,ns);yi(this,ns,freeze(t))}modifyEnd(t){return new ya({...gr(this,ns),queryNode:QueryNode.cloneWithEndModifier(gr(this,ns).queryNode,t.toOperationNode())})}top(t,I){return new ya({...gr(this,ns),queryNode:QueryNode.cloneWithTop(gr(this,ns).queryNode,parseTop(t,I))})}whenMatched(){return Ai(this,Hs,pl).call(this,[])}whenMatchedAnd(...t){return Ai(this,Hs,pl).call(this,t)}whenMatchedAndRef(t,I,B){return Ai(this,Hs,pl).call(this,[t,I,B],!0)}whenNotMatched(){return Ai(this,Hs,Wa).call(this,[])}whenNotMatchedAnd(...t){return Ai(this,Hs,Wa).call(this,t)}whenNotMatchedAndRef(t,I,B){return Ai(this,Hs,Wa).call(this,[t,I,B],!0)}whenNotMatchedBySource(){return Ai(this,Hs,Wa).call(this,[],!1,!0)}whenNotMatchedBySourceAnd(...t){return Ai(this,Hs,Wa).call(this,t,!1,!0)}whenNotMatchedBySourceAndRef(t,I,B){return Ai(this,Hs,Wa).call(this,[t,I,B],!0,!0)}returning(t){return new ya({...gr(this,ns),queryNode:QueryNode.cloneWithReturning(gr(this,ns).queryNode,parseSelectArg(t))})}returningAll(t){return new ya({...gr(this,ns),queryNode:QueryNode.cloneWithReturning(gr(this,ns).queryNode,parseSelectAll(t))})}output(t){return new ya({...gr(this,ns),queryNode:QueryNode.cloneWithOutput(gr(this,ns).queryNode,parseSelectArg(t))})}outputAll(t){return new ya({...gr(this,ns),queryNode:QueryNode.cloneWithOutput(gr(this,ns).queryNode,parseSelectAll(t))})}$call(t){return t(this)}$if(t,I){return t?I(this):new ya({...gr(this,ns)})}toOperationNode(){return gr(this,ns).executor.transformQuery(gr(this,ns).queryNode,gr(this,ns).queryId)}compile(){return gr(this,ns).executor.compileQuery(this.toOperationNode(),gr(this,ns).queryId)}async execute(){const t=this.compile(),I=await gr(this,ns).executor.executeQuery(t,gr(this,ns).queryId),{adapter:B}=gr(this,ns).executor,tr=t.query;return tr.returning&&B.supportsReturning||tr.output&&B.supportsOutput?I.rows:[new MergeResult(I.numAffectedRows)]}async executeTakeFirst(){const[t]=await this.execute();return t}async executeTakeFirstOrThrow(t=NoResultError){const I=await this.executeTakeFirst();if(I===void 0)throw isNoResultErrorConstructor(t)?new t(this.toOperationNode()):t(this.toOperationNode());return I}};ns=new WeakMap,Hs=new WeakSet,pl=function(t,I){return new MatchedThenableMergeQueryBuilder({...gr(this,ns),queryNode:MergeQueryNode.cloneWithWhen(gr(this,ns).queryNode,parseMergeWhen({isMatched:!0},t,I))})},Wa=function(t,I=!1,B=!1){const tr={...gr(this,ns),queryNode:MergeQueryNode.cloneWithWhen(gr(this,ns).queryNode,parseMergeWhen({isMatched:!1,bySource:B},t,I))},rr=B?MatchedThenableMergeQueryBuilder:NotMatchedThenableMergeQueryBuilder;return new rr(tr)};let WheneableMergeQueryBuilder=ya;var ta;class MatchedThenableMergeQueryBuilder{constructor(t){_i(this,ta);yi(this,ta,freeze(t))}thenDelete(){return new WheneableMergeQueryBuilder({...gr(this,ta),queryNode:MergeQueryNode.cloneWithThen(gr(this,ta).queryNode,parseMergeThen("delete"))})}thenDoNothing(){return new WheneableMergeQueryBuilder({...gr(this,ta),queryNode:MergeQueryNode.cloneWithThen(gr(this,ta).queryNode,parseMergeThen("do nothing"))})}thenUpdate(t){return new WheneableMergeQueryBuilder({...gr(this,ta),queryNode:MergeQueryNode.cloneWithThen(gr(this,ta).queryNode,parseMergeThen(t(new UpdateQueryBuilder({queryId:gr(this,ta).queryId,executor:NOOP_QUERY_EXECUTOR,queryNode:UpdateQueryNode.createWithoutTable()}))))})}thenUpdateSet(...t){return this.thenUpdate(I=>I.set(...t))}}ta=new WeakMap;var Pa;class NotMatchedThenableMergeQueryBuilder{constructor(t){_i(this,Pa);yi(this,Pa,freeze(t))}thenDoNothing(){return new WheneableMergeQueryBuilder({...gr(this,Pa),queryNode:MergeQueryNode.cloneWithThen(gr(this,Pa).queryNode,parseMergeThen("do nothing"))})}thenInsertValues(t){const[I,B]=parseInsertExpression(t);return new WheneableMergeQueryBuilder({...gr(this,Pa),queryNode:MergeQueryNode.cloneWithThen(gr(this,Pa).queryNode,parseMergeThen(InsertQueryNode.cloneWith(InsertQueryNode.createWithoutInto(),{columns:I,values:B})))})}}Pa=new WeakMap;var es;const Ha=class Ha{constructor(t){_i(this,es);yi(this,es,freeze(t))}selectFrom(t){return createSelectQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:SelectQueryNode.createFrom(parseTableExpressionOrList(t),gr(this,es).withNode)})}selectNoFrom(t){return createSelectQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:SelectQueryNode.cloneWithSelections(SelectQueryNode.create(gr(this,es).withNode),parseSelectArg(t))})}insertInto(t){return new InsertQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:InsertQueryNode.create(parseTable(t),gr(this,es).withNode)})}replaceInto(t){return new InsertQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:InsertQueryNode.create(parseTable(t),gr(this,es).withNode,!0)})}deleteFrom(t){return new DeleteQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:DeleteQueryNode.create(parseTableExpressionOrList(t),gr(this,es).withNode)})}updateTable(t){return new UpdateQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:UpdateQueryNode.create(parseTableExpressionOrList(t),gr(this,es).withNode)})}mergeInto(t){return new MergeQueryBuilder({queryId:createQueryId(),executor:gr(this,es).executor,queryNode:MergeQueryNode.create(parseAliasedTable(t),gr(this,es).withNode)})}with(t,I){const B=parseCommonTableExpression(t,I);return new Ha({...gr(this,es),withNode:gr(this,es).withNode?WithNode.cloneWithExpression(gr(this,es).withNode,B):WithNode.create(B)})}withRecursive(t,I){const B=parseCommonTableExpression(t,I);return new Ha({...gr(this,es),withNode:gr(this,es).withNode?WithNode.cloneWithExpression(gr(this,es).withNode,B):WithNode.create(B,{recursive:!0})})}withPlugin(t){return new Ha({...gr(this,es),executor:gr(this,es).executor.withPlugin(t)})}withoutPlugins(){return new Ha({...gr(this,es),executor:gr(this,es).executor.withoutPlugins()})}withSchema(t){return new Ha({...gr(this,es),executor:gr(this,es).executor.withPluginAtFront(new WithSchemaPlugin(t))})}};es=new WeakMap;let QueryCreator=Ha;function createQueryCreator(){return new QueryCreator({executor:NOOP_QUERY_EXECUTOR})}function createJoinBuilder(e,t){return new JoinBuilder({joinNode:JoinNode.create(e,parseTableExpression(t))})}function createOverBuilder(){return new OverBuilder({overNode:OverNode.create()})}function parseJoin(e,t){if(t.length===3)return parseSingleOnJoin(e,t[0],t[1],t[2]);if(t.length===2)return parseCallbackJoin(e,t[0],t[1]);if(t.length===1)return parseOnlessJoin(e,t[0]);throw new Error("not implemented")}function parseCallbackJoin(e,t,I){return I(createJoinBuilder(e,t)).toOperationNode()}function parseSingleOnJoin(e,t,I,B){return JoinNode.createWithOn(e,parseTableExpression(t),parseReferentialBinaryOperation(I,"=",B))}function parseOnlessJoin(e,t){return JoinNode.create(e,parseTableExpression(t))}const OffsetNode=freeze({is(e){return e.kind==="OffsetNode"},create(e){return freeze({kind:"OffsetNode",offset:e})}}),GroupByItemNode=freeze({is(e){return e.kind==="GroupByItemNode"},create(e){return freeze({kind:"GroupByItemNode",groupBy:e})}});function parseGroupBy(e){return e=isFunction(e)?e(expressionBuilder()):e,parseReferenceExpressionOrList(e).map(GroupByItemNode.create)}const SetOperationNode=freeze({is(e){return e.kind==="SetOperationNode"},create(e,t,I){return freeze({kind:"SetOperationNode",operator:e,expression:t,all:I})}});function parseSetOperations(e,t,I){return isFunction(t)&&(t=t(createExpressionBuilder())),isReadonlyArray(t)||(t=[t]),t.map(B=>SetOperationNode.create(e,parseExpression(B),I))}var Ea;const gl=class gl{constructor(t){_i(this,Ea);yi(this,Ea,t)}get expressionType(){}as(t){return new AliasedExpressionWrapper(this,t)}or(...t){return new OrWrapper(OrNode.create(gr(this,Ea),parseValueBinaryOperationOrExpression(t)))}and(...t){return new AndWrapper(AndNode.create(gr(this,Ea),parseValueBinaryOperationOrExpression(t)))}$castTo(){return new gl(gr(this,Ea))}$notNull(){return new gl(gr(this,Ea))}toOperationNode(){return gr(this,Ea)}};Ea=new WeakMap;let ExpressionWrapper=gl;var So,ka;class AliasedExpressionWrapper{constructor(t,I){_i(this,So);_i(this,ka);yi(this,So,t),yi(this,ka,I)}get expression(){return gr(this,So)}get alias(){return gr(this,ka)}toOperationNode(){return AliasNode.create(gr(this,So).toOperationNode(),isOperationNodeSource(gr(this,ka))?gr(this,ka).toOperationNode():IdentifierNode.create(gr(this,ka)))}}So=new WeakMap,ka=new WeakMap;var ro;const yl=class yl{constructor(t){_i(this,ro);yi(this,ro,t)}get expressionType(){}as(t){return new AliasedExpressionWrapper(this,t)}or(...t){return new yl(OrNode.create(gr(this,ro),parseValueBinaryOperationOrExpression(t)))}$castTo(){return new yl(gr(this,ro))}toOperationNode(){return ParensNode.create(gr(this,ro))}};ro=new WeakMap;let OrWrapper=yl;var no;const wl=class wl{constructor(t){_i(this,no);yi(this,no,t)}get expressionType(){}as(t){return new AliasedExpressionWrapper(this,t)}and(...t){return new wl(AndNode.create(gr(this,no),parseValueBinaryOperationOrExpression(t)))}$castTo(){return new wl(gr(this,no))}toOperationNode(){return ParensNode.create(gr(this,no))}};no=new WeakMap;let AndWrapper=wl;const FetchNode={is(e){return e.kind==="FetchNode"},create(e,t){return{kind:"FetchNode",rowCount:ValueNode.create(e),modifier:t}}};function parseFetch(e,t){if(!isNumber(e)&&!isBigInt(e))throw new Error(`Invalid fetch row count: ${e}`);if(!isFetchModifier(t))throw new Error(`Invalid fetch modifier: ${t}`);return FetchNode.create(e,t)}function isFetchModifier(e){return e==="only"||e==="with ties"}var Ei,Bs,Js;const Ui=class Ui{constructor(t){_i(this,Bs);_i(this,Ei);yi(this,Ei,freeze(t))}get expressionType(){}get isSelectQueryBuilder(){return!0}where(...t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithWhere(gr(this,Ei).queryNode,parseValueBinaryOperationOrExpression(t))})}whereRef(t,I,B){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithWhere(gr(this,Ei).queryNode,parseReferentialBinaryOperation(t,I,B))})}having(...t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithHaving(gr(this,Ei).queryNode,parseValueBinaryOperationOrExpression(t))})}havingRef(t,I,B){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithHaving(gr(this,Ei).queryNode,parseReferentialBinaryOperation(t,I,B))})}select(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSelections(gr(this,Ei).queryNode,parseSelectArg(t))})}distinctOn(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithDistinctOn(gr(this,Ei).queryNode,parseReferenceExpressionOrList(t))})}modifyFront(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithFrontModifier(gr(this,Ei).queryNode,SelectModifierNode.createWithExpression(t.toOperationNode()))})}modifyEnd(t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.createWithExpression(t.toOperationNode()))})}distinct(){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithFrontModifier(gr(this,Ei).queryNode,SelectModifierNode.create("Distinct"))})}forUpdate(t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.create("ForUpdate",t?asArray(t).map(parseTable):void 0))})}forShare(t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.create("ForShare",t?asArray(t).map(parseTable):void 0))})}forKeyShare(t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.create("ForKeyShare",t?asArray(t).map(parseTable):void 0))})}forNoKeyUpdate(t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.create("ForNoKeyUpdate",t?asArray(t).map(parseTable):void 0))})}skipLocked(){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.create("SkipLocked"))})}noWait(){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithEndModifier(gr(this,Ei).queryNode,SelectModifierNode.create("NoWait"))})}selectAll(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSelections(gr(this,Ei).queryNode,parseSelectAll(t))})}innerJoin(...t){return Ai(this,Bs,Js).call(this,"InnerJoin",t)}leftJoin(...t){return Ai(this,Bs,Js).call(this,"LeftJoin",t)}rightJoin(...t){return Ai(this,Bs,Js).call(this,"RightJoin",t)}fullJoin(...t){return Ai(this,Bs,Js).call(this,"FullJoin",t)}crossJoin(...t){return Ai(this,Bs,Js).call(this,"CrossJoin",t)}innerJoinLateral(...t){return Ai(this,Bs,Js).call(this,"LateralInnerJoin",t)}leftJoinLateral(...t){return Ai(this,Bs,Js).call(this,"LateralLeftJoin",t)}crossJoinLateral(...t){return Ai(this,Bs,Js).call(this,"LateralCrossJoin",t)}crossApply(...t){return Ai(this,Bs,Js).call(this,"CrossApply",t)}outerApply(...t){return Ai(this,Bs,Js).call(this,"OuterApply",t)}orderBy(...t){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithOrderByItems(gr(this,Ei).queryNode,parseOrderBy(t))})}groupBy(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithGroupByItems(gr(this,Ei).queryNode,parseGroupBy(t))})}limit(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithLimit(gr(this,Ei).queryNode,LimitNode.create(parseValueExpression(t)))})}offset(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithOffset(gr(this,Ei).queryNode,OffsetNode.create(parseValueExpression(t)))})}fetch(t,I="only"){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithFetch(gr(this,Ei).queryNode,parseFetch(t,I))})}top(t,I){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithTop(gr(this,Ei).queryNode,parseTop(t,I))})}union(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSetOperations(gr(this,Ei).queryNode,parseSetOperations("union",t,!1))})}unionAll(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSetOperations(gr(this,Ei).queryNode,parseSetOperations("union",t,!0))})}intersect(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSetOperations(gr(this,Ei).queryNode,parseSetOperations("intersect",t,!1))})}intersectAll(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSetOperations(gr(this,Ei).queryNode,parseSetOperations("intersect",t,!0))})}except(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSetOperations(gr(this,Ei).queryNode,parseSetOperations("except",t,!1))})}exceptAll(t){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithSetOperations(gr(this,Ei).queryNode,parseSetOperations("except",t,!0))})}as(t){return new AliasedSelectQueryBuilderImpl(this,t)}clearSelect(){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithoutSelections(gr(this,Ei).queryNode)})}clearWhere(){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithoutWhere(gr(this,Ei).queryNode)})}clearLimit(){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithoutLimit(gr(this,Ei).queryNode)})}clearOffset(){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithoutOffset(gr(this,Ei).queryNode)})}clearOrderBy(){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithoutOrderBy(gr(this,Ei).queryNode)})}clearGroupBy(){return new Ui({...gr(this,Ei),queryNode:SelectQueryNode.cloneWithoutGroupBy(gr(this,Ei).queryNode)})}$call(t){return t(this)}$if(t,I){return t?I(this):new Ui({...gr(this,Ei)})}$castTo(){return new Ui(gr(this,Ei))}$narrowType(){return new Ui(gr(this,Ei))}$assertType(){return new Ui(gr(this,Ei))}$asTuple(){return new ExpressionWrapper(this.toOperationNode())}$asScalar(){return new ExpressionWrapper(this.toOperationNode())}withPlugin(t){return new Ui({...gr(this,Ei),executor:gr(this,Ei).executor.withPlugin(t)})}toOperationNode(){return gr(this,Ei).executor.transformQuery(gr(this,Ei).queryNode,gr(this,Ei).queryId)}compile(){return gr(this,Ei).executor.compileQuery(this.toOperationNode(),gr(this,Ei).queryId)}async execute(){const t=this.compile();return(await gr(this,Ei).executor.executeQuery(t,gr(this,Ei).queryId)).rows}async executeTakeFirst(){const[t]=await this.execute();return t}async executeTakeFirstOrThrow(t=NoResultError){const I=await this.executeTakeFirst();if(I===void 0)throw isNoResultErrorConstructor(t)?new t(this.toOperationNode()):t(this.toOperationNode());return I}async*stream(t=100){const I=this.compile(),B=gr(this,Ei).executor.stream(I,t,gr(this,Ei).queryId);for await(const tr of B)yield*tr.rows}async explain(t,I){return await new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithExplain(gr(this,Ei).queryNode,t,I)}).execute()}};Ei=new WeakMap,Bs=new WeakSet,Js=function(t,I){return new Ui({...gr(this,Ei),queryNode:QueryNode.cloneWithJoin(gr(this,Ei).queryNode,parseJoin(t,I))})};let SelectQueryBuilderImpl=Ui;function createSelectQueryBuilder(e){return new SelectQueryBuilderImpl(e)}var vo,xo;class AliasedSelectQueryBuilderImpl{constructor(t,I){_i(this,vo);_i(this,xo);yi(this,vo,t),yi(this,xo,I)}get expression(){return gr(this,vo)}get alias(){return gr(this,xo)}get isAliasedSelectQueryBuilder(){return!0}toOperationNode(){return AliasNode.create(gr(this,vo).toOperationNode(),IdentifierNode.create(gr(this,xo)))}}vo=new WeakMap,xo=new WeakMap;const AggregateFunctionNode=freeze({is(e){return e.kind==="AggregateFunctionNode"},create(e,t=[]){return freeze({kind:"AggregateFunctionNode",func:e,aggregated:t})},cloneWithDistinct(e){return freeze({...e,distinct:!0})},cloneWithOrderBy(e,t,I=!1){const B=I?"withinGroup":"orderBy";return freeze({...e,[B]:e[B]?OrderByNode.cloneWithItems(e[B],t):OrderByNode.create(t)})},cloneWithFilter(e,t){return freeze({...e,filter:e.filter?WhereNode.cloneWithOperation(e.filter,"And",t):WhereNode.create(t)})},cloneWithOrFilter(e,t){return freeze({...e,filter:e.filter?WhereNode.cloneWithOperation(e.filter,"Or",t):WhereNode.create(t)})},cloneWithOver(e,t){return freeze({...e,over:t})}}),FunctionNode=freeze({is(e){return e.kind==="FunctionNode"},create(e,t){return freeze({kind:"FunctionNode",func:e,arguments:t})}});var vs;const Xs=class Xs{constructor(t){_i(this,vs);yi(this,vs,freeze(t))}get expressionType(){}as(t){return new AliasedAggregateFunctionBuilder(this,t)}distinct(){return new Xs({...gr(this,vs),aggregateFunctionNode:AggregateFunctionNode.cloneWithDistinct(gr(this,vs).aggregateFunctionNode)})}orderBy(...t){return new Xs({...gr(this,vs),aggregateFunctionNode:QueryNode.cloneWithOrderByItems(gr(this,vs).aggregateFunctionNode,parseOrderBy(t))})}clearOrderBy(){return new Xs({...gr(this,vs),aggregateFunctionNode:QueryNode.cloneWithoutOrderBy(gr(this,vs).aggregateFunctionNode)})}withinGroupOrderBy(...t){return new Xs({...gr(this,vs),aggregateFunctionNode:AggregateFunctionNode.cloneWithOrderBy(gr(this,vs).aggregateFunctionNode,parseOrderBy(t),!0)})}filterWhere(...t){return new Xs({...gr(this,vs),aggregateFunctionNode:AggregateFunctionNode.cloneWithFilter(gr(this,vs).aggregateFunctionNode,parseValueBinaryOperationOrExpression(t))})}filterWhereRef(t,I,B){return new Xs({...gr(this,vs),aggregateFunctionNode:AggregateFunctionNode.cloneWithFilter(gr(this,vs).aggregateFunctionNode,parseReferentialBinaryOperation(t,I,B))})}over(t){const I=createOverBuilder();return new Xs({...gr(this,vs),aggregateFunctionNode:AggregateFunctionNode.cloneWithOver(gr(this,vs).aggregateFunctionNode,(t?t(I):I).toOperationNode())})}$call(t){return t(this)}$castTo(){return new Xs(gr(this,vs))}$notNull(){return new Xs(gr(this,vs))}toOperationNode(){return gr(this,vs).aggregateFunctionNode}};vs=new WeakMap;let AggregateFunctionBuilder=Xs;var Mo,qo;class AliasedAggregateFunctionBuilder{constructor(t,I){_i(this,Mo);_i(this,qo);yi(this,Mo,t),yi(this,qo,I)}get expression(){return gr(this,Mo)}get alias(){return gr(this,qo)}toOperationNode(){return AliasNode.create(gr(this,Mo).toOperationNode(),IdentifierNode.create(gr(this,qo)))}}Mo=new WeakMap,qo=new WeakMap;function createFunctionModule(){const e=(I,B)=>new ExpressionWrapper(FunctionNode.create(I,parseReferenceExpressionOrList(B??[]))),t=(I,B)=>new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create(I,B?parseReferenceExpressionOrList(B):void 0)});return Object.assign(e,{agg:t,avg(I){return t("avg",[I])},coalesce(...I){return e("coalesce",I)},count(I){return t("count",[I])},countAll(I){return new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create("count",parseSelectAll(I))})},max(I){return t("max",[I])},min(I){return t("min",[I])},sum(I){return t("sum",[I])},any(I){return e("any",[I])},jsonAgg(I){return new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create("json_agg",[isString(I)?parseTable(I):I.toOperationNode()])})},toJson(I){return new ExpressionWrapper(FunctionNode.create("to_json",[isString(I)?parseTable(I):I.toOperationNode()]))}})}const UnaryOperationNode=freeze({is(e){return e.kind==="UnaryOperationNode"},create(e,t){return freeze({kind:"UnaryOperationNode",operator:e,operand:t})}});function parseUnaryOperation(e,t){return UnaryOperationNode.create(OperatorNode.create(e),parseReferenceExpression(t))}const CaseNode=freeze({is(e){return e.kind==="CaseNode"},create(e){return freeze({kind:"CaseNode",value:e})},cloneWithWhen(e,t){return freeze({...e,when:freeze(e.when?[...e.when,t]:[t])})},cloneWithThen(e,t){return freeze({...e,when:e.when?freeze([...e.when.slice(0,-1),WhenNode.cloneWithResult(e.when[e.when.length-1],t)]):void 0})},cloneWith(e,t){return freeze({...e,...t})}});var Co;class CaseBuilder{constructor(t){_i(this,Co);yi(this,Co,freeze(t))}when(...t){return new CaseThenBuilder({...gr(this,Co),node:CaseNode.cloneWithWhen(gr(this,Co).node,WhenNode.create(parseValueBinaryOperationOrExpression(t)))})}}Co=new WeakMap;var No;class CaseThenBuilder{constructor(t){_i(this,No);yi(this,No,freeze(t))}then(t){return new CaseWhenBuilder({...gr(this,No),node:CaseNode.cloneWithThen(gr(this,No).node,isSafeImmediateValue(t)?parseSafeImmediateValue(t):parseValueExpression(t))})}}No=new WeakMap;var ua;class CaseWhenBuilder{constructor(t){_i(this,ua);yi(this,ua,freeze(t))}when(...t){return new CaseThenBuilder({...gr(this,ua),node:CaseNode.cloneWithWhen(gr(this,ua).node,WhenNode.create(parseValueBinaryOperationOrExpression(t)))})}else(t){return new CaseEndBuilder({...gr(this,ua),node:CaseNode.cloneWith(gr(this,ua).node,{else:isSafeImmediateValue(t)?parseSafeImmediateValue(t):parseValueExpression(t)})})}end(){return new ExpressionWrapper(CaseNode.cloneWith(gr(this,ua).node,{isStatement:!1}))}endCase(){return new ExpressionWrapper(CaseNode.cloneWith(gr(this,ua).node,{isStatement:!0}))}}ua=new WeakMap;var Ao;class CaseEndBuilder{constructor(t){_i(this,Ao);yi(this,Ao,freeze(t))}end(){return new ExpressionWrapper(CaseNode.cloneWith(gr(this,Ao).node,{isStatement:!1}))}endCase(){return new ExpressionWrapper(CaseNode.cloneWith(gr(this,Ao).node,{isStatement:!0}))}}Ao=new WeakMap;const JSONPathLegNode=freeze({is(e){return e.kind==="JSONPathLegNode"},create(e,t){return freeze({kind:"JSONPathLegNode",type:e,value:t})}});var ca,rl,Fl;class JSONPathBuilder{constructor(t){_i(this,rl);_i(this,ca);yi(this,ca,t)}at(t){return Ai(this,rl,Fl).call(this,"ArrayLocation",t)}key(t){return Ai(this,rl,Fl).call(this,"Member",t)}}ca=new WeakMap,rl=new WeakSet,Fl=function(t,I){return JSONReferenceNode.is(gr(this,ca))?new TraversedJSONPathBuilder(JSONReferenceNode.cloneWithTraversal(gr(this,ca),JSONPathNode.is(gr(this,ca).traversal)?JSONPathNode.cloneWithLeg(gr(this,ca).traversal,JSONPathLegNode.create(t,I)):JSONOperatorChainNode.cloneWithValue(gr(this,ca).traversal,ValueNode.createImmediate(I)))):new TraversedJSONPathBuilder(JSONPathNode.cloneWithLeg(gr(this,ca),JSONPathLegNode.create(t,I)))};var io;const bl=class bl extends JSONPathBuilder{constructor(I){super(I);_i(this,io);yi(this,io,I)}get expressionType(){}as(I){return new AliasedJSONPathBuilder(this,I)}$castTo(){return new bl(gr(this,io))}$notNull(){return new bl(gr(this,io))}toOperationNode(){return gr(this,io)}};io=new WeakMap;let TraversedJSONPathBuilder=bl;var Ro,Fa;class AliasedJSONPathBuilder{constructor(t,I){_i(this,Ro);_i(this,Fa);yi(this,Ro,t),yi(this,Fa,I)}get expression(){return gr(this,Ro)}get alias(){return gr(this,Fa)}toOperationNode(){return AliasNode.create(gr(this,Ro).toOperationNode(),isOperationNodeSource(gr(this,Fa))?gr(this,Fa).toOperationNode():IdentifierNode.create(gr(this,Fa)))}}Ro=new WeakMap,Fa=new WeakMap;const TupleNode=freeze({is(e){return e.kind==="TupleNode"},create(e){return freeze({kind:"TupleNode",values:freeze(e)})}}),SIMPLE_COLUMN_DATA_TYPES=["varchar","char","text","integer","int2","int4","int8","smallint","bigint","boolean","real","double precision","float4","float8","decimal","numeric","binary","bytea","date","datetime","time","timetz","timestamp","timestamptz","serial","bigserial","uuid","json","jsonb","blob","varbinary","int4range","int4multirange","int8range","int8multirange","numrange","nummultirange","tsrange","tsmultirange","tstzrange","tstzmultirange","daterange","datemultirange"],COLUMN_DATA_TYPE_REGEX=[/^varchar\(\d+\)$/,/^char\(\d+\)$/,/^decimal\(\d+, \d+\)$/,/^numeric\(\d+, \d+\)$/,/^binary\(\d+\)$/,/^datetime\(\d+\)$/,/^time\(\d+\)$/,/^timetz\(\d+\)$/,/^timestamp\(\d+\)$/,/^timestamptz\(\d+\)$/,/^varbinary\(\d+\)$/],DataTypeNode=freeze({is(e){return e.kind==="DataTypeNode"},create(e){return freeze({kind:"DataTypeNode",dataType:e})}});function isColumnDataType(e){return!!(SIMPLE_COLUMN_DATA_TYPES.includes(e)||COLUMN_DATA_TYPE_REGEX.some(t=>t.test(e)))}function parseDataTypeExpression(e){if(isOperationNodeSource(e))return e.toOperationNode();if(isColumnDataType(e))return DataTypeNode.create(e);throw new Error(`invalid column data type ${JSON.stringify(e)}`)}const CastNode=freeze({is(e){return e.kind==="CastNode"},create(e,t){return freeze({kind:"CastNode",expression:e,dataType:t})}});function createExpressionBuilder(e=NOOP_QUERY_EXECUTOR){function t(tr,rr,ir){return new ExpressionWrapper(parseValueBinaryOperation(tr,rr,ir))}function I(tr,rr){return new ExpressionWrapper(parseUnaryOperation(tr,rr))}const B=Object.assign(t,{fn:void 0,eb:void 0,selectFrom(tr){return createSelectQueryBuilder({queryId:createQueryId(),executor:e,queryNode:SelectQueryNode.createFrom(parseTableExpressionOrList(tr))})},case(tr){return new CaseBuilder({node:CaseNode.create(isUndefined(tr)?void 0:parseReferenceExpression(tr))})},ref(tr,rr){return isUndefined(rr)?new ExpressionWrapper(parseStringReference(tr)):new JSONPathBuilder(parseJSONReference(tr,rr))},jsonPath(){return new JSONPathBuilder(JSONPathNode.create())},table(tr){return new ExpressionWrapper(parseTable(tr))},val(tr){return new ExpressionWrapper(parseValueExpression(tr))},refTuple(...tr){return new ExpressionWrapper(TupleNode.create(tr.map(parseReferenceExpression)))},tuple(...tr){return new ExpressionWrapper(TupleNode.create(tr.map(parseValueExpression)))},lit(tr){return new ExpressionWrapper(parseSafeImmediateValue(tr))},unary:I,not(tr){return I("not",tr)},exists(tr){return I("exists",tr)},neg(tr){return I("-",tr)},between(tr,rr,ir){return new ExpressionWrapper(BinaryOperationNode.create(parseReferenceExpression(tr),OperatorNode.create("between"),AndNode.create(parseValueExpression(rr),parseValueExpression(ir))))},betweenSymmetric(tr,rr,ir){return new ExpressionWrapper(BinaryOperationNode.create(parseReferenceExpression(tr),OperatorNode.create("between symmetric"),AndNode.create(parseValueExpression(rr),parseValueExpression(ir))))},and(tr){return isReadonlyArray(tr)?new ExpressionWrapper(parseFilterList(tr,"and")):new ExpressionWrapper(parseFilterObject(tr,"and"))},or(tr){return isReadonlyArray(tr)?new ExpressionWrapper(parseFilterList(tr,"or")):new ExpressionWrapper(parseFilterObject(tr,"or"))},parens(...tr){const rr=parseValueBinaryOperationOrExpression(tr);return ParensNode.is(rr)?new ExpressionWrapper(rr):new ExpressionWrapper(ParensNode.create(rr))},cast(tr,rr){return new ExpressionWrapper(CastNode.create(parseReferenceExpression(tr),parseDataTypeExpression(rr)))},withSchema(tr){return createExpressionBuilder(e.withPluginAtFront(new WithSchemaPlugin(tr)))}});return B.fn=createFunctionModule(),B.eb=B,B}function expressionBuilder(e){return createExpressionBuilder()}function parseExpression(e){if(isOperationNodeSource(e))return e.toOperationNode();if(isFunction(e))return e(expressionBuilder()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(e)}`)}function parseAliasedExpression(e){if(isOperationNodeSource(e))return e.toOperationNode();if(isFunction(e))return e(expressionBuilder()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(e)}`)}function isExpressionOrFactory(e){return isExpression(e)||isAliasedExpression(e)||isFunction(e)}var To;class DynamicTableBuilder{constructor(t){_i(this,To);yi(this,To,t)}get table(){return gr(this,To)}as(t){return new AliasedDynamicTableBuilder(gr(this,To),t)}}To=new WeakMap;var Io,Oo;class AliasedDynamicTableBuilder{constructor(t,I){_i(this,Io);_i(this,Oo);yi(this,Io,t),yi(this,Oo,I)}get table(){return gr(this,Io)}get alias(){return gr(this,Oo)}toOperationNode(){return AliasNode.create(parseTable(gr(this,Io)),IdentifierNode.create(gr(this,Oo)))}}Io=new WeakMap,Oo=new WeakMap;function isAliasedDynamicTableBuilder(e){return isObject(e)&&isOperationNodeSource(e)&&isString(e.table)&&isString(e.alias)}function parseTableExpressionOrList(e){return isReadonlyArray(e)?e.map(t=>parseTableExpression(t)):[parseTableExpression(e)]}function parseTableExpression(e){return isString(e)?parseAliasedTable(e):isAliasedDynamicTableBuilder(e)?e.toOperationNode():parseAliasedExpression(e)}function parseAliasedTable(e){const t=" as ";if(e.includes(t)){const[I,B]=e.split(t).map(trim$1);return AliasNode.create(parseTable(I),IdentifierNode.create(B))}else return parseTable(e)}function parseTable(e){const t=".";if(e.includes(t)){const[I,B]=e.split(t).map(trim$1);return TableNode.createWithSchema(I,B)}else return TableNode.create(e)}function trim$1(e){return e.trim()}const AddColumnNode=freeze({is(e){return e.kind==="AddColumnNode"},create(e){return freeze({kind:"AddColumnNode",column:e})}}),ColumnDefinitionNode=freeze({is(e){return e.kind==="ColumnDefinitionNode"},create(e,t){return freeze({kind:"ColumnDefinitionNode",column:ColumnNode.create(e),dataType:t})},cloneWithFrontModifier(e,t){return freeze({...e,frontModifiers:e.frontModifiers?freeze([...e.frontModifiers,t]):[t]})},cloneWithEndModifier(e,t){return freeze({...e,endModifiers:e.endModifiers?freeze([...e.endModifiers,t]):[t]})},cloneWith(e,t){return freeze({...e,...t})}}),DropColumnNode=freeze({is(e){return e.kind==="DropColumnNode"},create(e){return freeze({kind:"DropColumnNode",column:ColumnNode.create(e)})}}),RenameColumnNode=freeze({is(e){return e.kind==="RenameColumnNode"},create(e,t){return freeze({kind:"RenameColumnNode",column:ColumnNode.create(e),renameTo:ColumnNode.create(t)})}}),CheckConstraintNode=freeze({is(e){return e.kind==="CheckConstraintNode"},create(e,t){return freeze({kind:"CheckConstraintNode",expression:e,name:t?IdentifierNode.create(t):void 0})}}),ON_MODIFY_FOREIGN_ACTIONS=["no action","restrict","cascade","set null","set default"],ReferencesNode=freeze({is(e){return e.kind==="ReferencesNode"},create(e,t){return freeze({kind:"ReferencesNode",table:e,columns:freeze([...t])})},cloneWithOnDelete(e,t){return freeze({...e,onDelete:t})},cloneWithOnUpdate(e,t){return freeze({...e,onUpdate:t})}});function parseDefaultValueExpression(e){return isOperationNodeSource(e)?e.toOperationNode():ValueNode.createImmediate(e)}const GeneratedNode=freeze({is(e){return e.kind==="GeneratedNode"},create(e){return freeze({kind:"GeneratedNode",...e})},createWithExpression(e){return freeze({kind:"GeneratedNode",always:!0,expression:e})},cloneWith(e,t){return freeze({...e,...t})}}),DefaultValueNode=freeze({is(e){return e.kind==="DefaultValueNode"},create(e){return freeze({kind:"DefaultValueNode",defaultValue:e})}});function parseOnModifyForeignAction(e){if(ON_MODIFY_FOREIGN_ACTIONS.includes(e))return e;throw new Error(`invalid OnModifyForeignAction ${e}`)}var ts;const Ss=class Ss{constructor(t){_i(this,ts);yi(this,ts,t)}autoIncrement(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{autoIncrement:!0}))}identity(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{identity:!0}))}primaryKey(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{primaryKey:!0}))}references(t){const I=parseStringReference(t);if(!I.table||SelectAllNode.is(I.column))throw new Error(`invalid call references('${t}'). The reference must have format table.column or schema.table.column`);return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{references:ReferencesNode.create(I.table,[I.column])}))}onDelete(t){if(!gr(this,ts).references)throw new Error("on delete constraint can only be added for foreign keys");return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{references:ReferencesNode.cloneWithOnDelete(gr(this,ts).references,parseOnModifyForeignAction(t))}))}onUpdate(t){if(!gr(this,ts).references)throw new Error("on update constraint can only be added for foreign keys");return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{references:ReferencesNode.cloneWithOnUpdate(gr(this,ts).references,parseOnModifyForeignAction(t))}))}unique(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{unique:!0}))}notNull(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{notNull:!0}))}unsigned(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{unsigned:!0}))}defaultTo(t){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{defaultTo:DefaultValueNode.create(parseDefaultValueExpression(t))}))}check(t){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{check:CheckConstraintNode.create(t.toOperationNode())}))}generatedAlwaysAs(t){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{generated:GeneratedNode.createWithExpression(t.toOperationNode())}))}generatedAlwaysAsIdentity(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{generated:GeneratedNode.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{generated:GeneratedNode.create({identity:!0,byDefault:!0})}))}stored(){if(!gr(this,ts).generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{generated:GeneratedNode.cloneWith(gr(this,ts).generated,{stored:!0})}))}modifyFront(t){return new Ss(ColumnDefinitionNode.cloneWithFrontModifier(gr(this,ts),t.toOperationNode()))}nullsNotDistinct(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{nullsNotDistinct:!0}))}ifNotExists(){return new Ss(ColumnDefinitionNode.cloneWith(gr(this,ts),{ifNotExists:!0}))}modifyEnd(t){return new Ss(ColumnDefinitionNode.cloneWithEndModifier(gr(this,ts),t.toOperationNode()))}$call(t){return t(this)}toOperationNode(){return gr(this,ts)}};ts=new WeakMap;let ColumnDefinitionBuilder=Ss;const ModifyColumnNode=freeze({is(e){return e.kind==="ModifyColumnNode"},create(e){return freeze({kind:"ModifyColumnNode",column:e})}}),ForeignKeyConstraintNode=freeze({is(e){return e.kind==="ForeignKeyConstraintNode"},create(e,t,I,B){return freeze({kind:"ForeignKeyConstraintNode",columns:e,references:ReferencesNode.create(t,I),name:B?IdentifierNode.create(B):void 0})},cloneWith(e,t){return freeze({...e,...t})}});var ra;const Aa=class Aa{constructor(t){_i(this,ra);yi(this,ra,t)}onDelete(t){return new Aa(ForeignKeyConstraintNode.cloneWith(gr(this,ra),{onDelete:parseOnModifyForeignAction(t)}))}onUpdate(t){return new Aa(ForeignKeyConstraintNode.cloneWith(gr(this,ra),{onUpdate:parseOnModifyForeignAction(t)}))}deferrable(){return new Aa(ForeignKeyConstraintNode.cloneWith(gr(this,ra),{deferrable:!0}))}notDeferrable(){return new Aa(ForeignKeyConstraintNode.cloneWith(gr(this,ra),{deferrable:!1}))}initiallyDeferred(){return new Aa(ForeignKeyConstraintNode.cloneWith(gr(this,ra),{initiallyDeferred:!0}))}initiallyImmediate(){return new Aa(ForeignKeyConstraintNode.cloneWith(gr(this,ra),{initiallyDeferred:!1}))}$call(t){return t(this)}toOperationNode(){return gr(this,ra)}};ra=new WeakMap;let ForeignKeyConstraintBuilder=Aa;const AddConstraintNode=freeze({is(e){return e.kind==="AddConstraintNode"},create(e){return freeze({kind:"AddConstraintNode",constraint:e})}}),UniqueConstraintNode=freeze({is(e){return e.kind==="UniqueConstraintNode"},create(e,t,I){return freeze({kind:"UniqueConstraintNode",columns:freeze(e.map(ColumnNode.create)),name:t?IdentifierNode.create(t):void 0,nullsNotDistinct:I})},cloneWith(e,t){return freeze({...e,...t})}}),DropConstraintNode=freeze({is(e){return e.kind==="DropConstraintNode"},create(e){return freeze({kind:"DropConstraintNode",constraintName:IdentifierNode.create(e)})},cloneWith(e,t){return freeze({...e,...t})}}),AlterColumnNode=freeze({is(e){return e.kind==="AlterColumnNode"},create(e,t,I){return freeze({kind:"AlterColumnNode",column:ColumnNode.create(e),[t]:I})}});var Sa;class AlterColumnBuilder{constructor(t){_i(this,Sa);yi(this,Sa,t)}setDataType(t){return new AlteredColumnBuilder(AlterColumnNode.create(gr(this,Sa),"dataType",parseDataTypeExpression(t)))}setDefault(t){return new AlteredColumnBuilder(AlterColumnNode.create(gr(this,Sa),"setDefault",parseDefaultValueExpression(t)))}dropDefault(){return new AlteredColumnBuilder(AlterColumnNode.create(gr(this,Sa),"dropDefault",!0))}setNotNull(){return new AlteredColumnBuilder(AlterColumnNode.create(gr(this,Sa),"setNotNull",!0))}dropNotNull(){return new AlteredColumnBuilder(AlterColumnNode.create(gr(this,Sa),"dropNotNull",!0))}$call(t){return t(this)}}Sa=new WeakMap;var nl;class AlteredColumnBuilder{constructor(t){_i(this,nl);yi(this,nl,t)}toOperationNode(){return gr(this,nl)}}nl=new WeakMap;var na;class AlterTableExecutor{constructor(t){_i(this,na);yi(this,na,freeze(t))}toOperationNode(){return gr(this,na).executor.transformQuery(gr(this,na).node,gr(this,na).queryId)}compile(){return gr(this,na).executor.compileQuery(this.toOperationNode(),gr(this,na).queryId)}async execute(){await gr(this,na).executor.executeQuery(this.compile(),gr(this,na).queryId)}}na=new WeakMap;var gs;const Ra=class Ra{constructor(t){_i(this,gs);yi(this,gs,freeze(t))}onDelete(t){return new Ra({...gr(this,gs),constraintBuilder:gr(this,gs).constraintBuilder.onDelete(t)})}onUpdate(t){return new Ra({...gr(this,gs),constraintBuilder:gr(this,gs).constraintBuilder.onUpdate(t)})}deferrable(){return new Ra({...gr(this,gs),constraintBuilder:gr(this,gs).constraintBuilder.deferrable()})}notDeferrable(){return new Ra({...gr(this,gs),constraintBuilder:gr(this,gs).constraintBuilder.notDeferrable()})}initiallyDeferred(){return new Ra({...gr(this,gs),constraintBuilder:gr(this,gs).constraintBuilder.initiallyDeferred()})}initiallyImmediate(){return new Ra({...gr(this,gs),constraintBuilder:gr(this,gs).constraintBuilder.initiallyImmediate()})}$call(t){return t(this)}toOperationNode(){return gr(this,gs).executor.transformQuery(AlterTableNode.cloneWithTableProps(gr(this,gs).node,{addConstraint:AddConstraintNode.create(gr(this,gs).constraintBuilder.toOperationNode())}),gr(this,gs).queryId)}compile(){return gr(this,gs).executor.compileQuery(this.toOperationNode(),gr(this,gs).queryId)}async execute(){await gr(this,gs).executor.executeQuery(this.compile(),gr(this,gs).queryId)}};gs=new WeakMap;let AlterTableAddForeignKeyConstraintBuilder=Ra;var qs;const Ho=class Ho{constructor(t){_i(this,qs);yi(this,qs,freeze(t))}ifExists(){return new Ho({...gr(this,qs),node:AlterTableNode.cloneWithTableProps(gr(this,qs).node,{dropConstraint:DropConstraintNode.cloneWith(gr(this,qs).node.dropConstraint,{ifExists:!0})})})}cascade(){return new Ho({...gr(this,qs),node:AlterTableNode.cloneWithTableProps(gr(this,qs).node,{dropConstraint:DropConstraintNode.cloneWith(gr(this,qs).node.dropConstraint,{modifier:"cascade"})})})}restrict(){return new Ho({...gr(this,qs),node:AlterTableNode.cloneWithTableProps(gr(this,qs).node,{dropConstraint:DropConstraintNode.cloneWith(gr(this,qs).node.dropConstraint,{modifier:"restrict"})})})}$call(t){return t(this)}toOperationNode(){return gr(this,qs).executor.transformQuery(gr(this,qs).node,gr(this,qs).queryId)}compile(){return gr(this,qs).executor.compileQuery(this.toOperationNode(),gr(this,qs).queryId)}async execute(){await gr(this,qs).executor.executeQuery(this.compile(),gr(this,qs).queryId)}};qs=new WeakMap;let AlterTableDropConstraintBuilder=Ho;const PrimaryKeyConstraintNode=freeze({is(e){return e.kind==="PrimaryKeyConstraintNode"},create(e,t){return freeze({kind:"PrimaryKeyConstraintNode",columns:freeze(e.map(ColumnNode.create)),name:t?IdentifierNode.create(t):void 0})},cloneWith(e,t){return freeze({...e,...t})}}),AddIndexNode=freeze({is(e){return e.kind==="AddIndexNode"},create(e){return freeze({kind:"AddIndexNode",name:IdentifierNode.create(e)})},cloneWith(e,t){return freeze({...e,...t})},cloneWithColumns(e,t){return freeze({...e,columns:[...e.columns||[],...t]})}});var cs;const Qa=class Qa{constructor(t){_i(this,cs);yi(this,cs,freeze(t))}unique(){return new Qa({...gr(this,cs),node:AlterTableNode.cloneWithTableProps(gr(this,cs).node,{addIndex:AddIndexNode.cloneWith(gr(this,cs).node.addIndex,{unique:!0})})})}column(t){return new Qa({...gr(this,cs),node:AlterTableNode.cloneWithTableProps(gr(this,cs).node,{addIndex:AddIndexNode.cloneWithColumns(gr(this,cs).node.addIndex,[parseOrderedColumnName(t)])})})}columns(t){return new Qa({...gr(this,cs),node:AlterTableNode.cloneWithTableProps(gr(this,cs).node,{addIndex:AddIndexNode.cloneWithColumns(gr(this,cs).node.addIndex,t.map(parseOrderedColumnName))})})}expression(t){return new Qa({...gr(this,cs),node:AlterTableNode.cloneWithTableProps(gr(this,cs).node,{addIndex:AddIndexNode.cloneWithColumns(gr(this,cs).node.addIndex,[t.toOperationNode()])})})}using(t){return new Qa({...gr(this,cs),node:AlterTableNode.cloneWithTableProps(gr(this,cs).node,{addIndex:AddIndexNode.cloneWith(gr(this,cs).node.addIndex,{using:RawNode.createWithSql(t)})})})}$call(t){return t(this)}toOperationNode(){return gr(this,cs).executor.transformQuery(gr(this,cs).node,gr(this,cs).queryId)}compile(){return gr(this,cs).executor.compileQuery(this.toOperationNode(),gr(this,cs).queryId)}async execute(){await gr(this,cs).executor.executeQuery(this.compile(),gr(this,cs).queryId)}};cs=new WeakMap;let AlterTableAddIndexBuilder=Qa;var da;const Ga=class Ga{constructor(t){_i(this,da);yi(this,da,t)}nullsNotDistinct(){return new Ga(UniqueConstraintNode.cloneWith(gr(this,da),{nullsNotDistinct:!0}))}deferrable(){return new Ga(UniqueConstraintNode.cloneWith(gr(this,da),{deferrable:!0}))}notDeferrable(){return new Ga(UniqueConstraintNode.cloneWith(gr(this,da),{deferrable:!1}))}initiallyDeferred(){return new Ga(UniqueConstraintNode.cloneWith(gr(this,da),{initiallyDeferred:!0}))}initiallyImmediate(){return new Ga(UniqueConstraintNode.cloneWith(gr(this,da),{initiallyDeferred:!1}))}$call(t){return t(this)}toOperationNode(){return gr(this,da)}};da=new WeakMap;let UniqueConstraintNodeBuilder=Ga;var va;const mo=class mo{constructor(t){_i(this,va);yi(this,va,t)}deferrable(){return new mo(PrimaryKeyConstraintNode.cloneWith(gr(this,va),{deferrable:!0}))}notDeferrable(){return new mo(PrimaryKeyConstraintNode.cloneWith(gr(this,va),{deferrable:!1}))}initiallyDeferred(){return new mo(PrimaryKeyConstraintNode.cloneWith(gr(this,va),{initiallyDeferred:!0}))}initiallyImmediate(){return new mo(PrimaryKeyConstraintNode.cloneWith(gr(this,va),{initiallyDeferred:!1}))}$call(t){return t(this)}toOperationNode(){return gr(this,va)}};va=new WeakMap;let PrimaryKeyConstraintBuilder=mo;var il;class CheckConstraintBuilder{constructor(t){_i(this,il);yi(this,il,t)}$call(t){return t(this)}toOperationNode(){return gr(this,il)}}il=new WeakMap;const RenameConstraintNode=freeze({is(e){return e.kind==="RenameConstraintNode"},create(e,t){return freeze({kind:"RenameConstraintNode",oldName:IdentifierNode.create(e),newName:IdentifierNode.create(t)})}});var Ki;class AlterTableBuilder{constructor(t){_i(this,Ki);yi(this,Ki,freeze(t))}renameTo(t){return new AlterTableExecutor({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{renameTo:parseTable(t)})})}setSchema(t){return new AlterTableExecutor({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{setSchema:IdentifierNode.create(t)})})}alterColumn(t,I){const B=I(new AlterColumnBuilder(t));return new AlterTableColumnAlteringBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithColumnAlteration(gr(this,Ki).node,B.toOperationNode())})}dropColumn(t){return new AlterTableColumnAlteringBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithColumnAlteration(gr(this,Ki).node,DropColumnNode.create(t))})}renameColumn(t,I){return new AlterTableColumnAlteringBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithColumnAlteration(gr(this,Ki).node,RenameColumnNode.create(t,I))})}addColumn(t,I,B=noop){const tr=B(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(t,parseDataTypeExpression(I))));return new AlterTableColumnAlteringBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithColumnAlteration(gr(this,Ki).node,AddColumnNode.create(tr.toOperationNode()))})}modifyColumn(t,I,B=noop){const tr=B(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(t,parseDataTypeExpression(I))));return new AlterTableColumnAlteringBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithColumnAlteration(gr(this,Ki).node,ModifyColumnNode.create(tr.toOperationNode()))})}addUniqueConstraint(t,I,B=noop){const tr=B(new UniqueConstraintNodeBuilder(UniqueConstraintNode.create(I,t)));return new AlterTableExecutor({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{addConstraint:AddConstraintNode.create(tr.toOperationNode())})})}addCheckConstraint(t,I,B=noop){const tr=B(new CheckConstraintBuilder(CheckConstraintNode.create(I.toOperationNode(),t)));return new AlterTableExecutor({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{addConstraint:AddConstraintNode.create(tr.toOperationNode())})})}addForeignKeyConstraint(t,I,B,tr,rr=noop){const ir=rr(new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(I.map(ColumnNode.create),parseTable(B),tr.map(ColumnNode.create),t)));return new AlterTableAddForeignKeyConstraintBuilder({...gr(this,Ki),constraintBuilder:ir})}addPrimaryKeyConstraint(t,I,B=noop){const tr=B(new PrimaryKeyConstraintBuilder(PrimaryKeyConstraintNode.create(I,t)));return new AlterTableExecutor({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{addConstraint:AddConstraintNode.create(tr.toOperationNode())})})}dropConstraint(t){return new AlterTableDropConstraintBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{dropConstraint:DropConstraintNode.create(t)})})}renameConstraint(t,I){return new AlterTableDropConstraintBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{renameConstraint:RenameConstraintNode.create(t,I)})})}addIndex(t){return new AlterTableAddIndexBuilder({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{addIndex:AddIndexNode.create(t)})})}dropIndex(t){return new AlterTableExecutor({...gr(this,Ki),node:AlterTableNode.cloneWithTableProps(gr(this,Ki).node,{dropIndex:DropIndexNode.create(t)})})}$call(t){return t(this)}}Ki=new WeakMap;var xs;const Ka=class Ka{constructor(t){_i(this,xs);yi(this,xs,freeze(t))}alterColumn(t,I){const B=I(new AlterColumnBuilder(t));return new Ka({...gr(this,xs),node:AlterTableNode.cloneWithColumnAlteration(gr(this,xs).node,B.toOperationNode())})}dropColumn(t){return new Ka({...gr(this,xs),node:AlterTableNode.cloneWithColumnAlteration(gr(this,xs).node,DropColumnNode.create(t))})}renameColumn(t,I){return new Ka({...gr(this,xs),node:AlterTableNode.cloneWithColumnAlteration(gr(this,xs).node,RenameColumnNode.create(t,I))})}addColumn(t,I,B=noop){const tr=B(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(t,parseDataTypeExpression(I))));return new Ka({...gr(this,xs),node:AlterTableNode.cloneWithColumnAlteration(gr(this,xs).node,AddColumnNode.create(tr.toOperationNode()))})}modifyColumn(t,I,B=noop){const tr=B(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(t,parseDataTypeExpression(I))));return new Ka({...gr(this,xs),node:AlterTableNode.cloneWithColumnAlteration(gr(this,xs).node,ModifyColumnNode.create(tr.toOperationNode()))})}toOperationNode(){return gr(this,xs).executor.transformQuery(gr(this,xs).node,gr(this,xs).queryId)}compile(){return gr(this,xs).executor.compileQuery(this.toOperationNode(),gr(this,xs).queryId)}async execute(){await gr(this,xs).executor.executeQuery(this.compile(),gr(this,xs).queryId)}};xs=new WeakMap;let AlterTableColumnAlteringBuilder=Ka;class ImmediateValueTransformer extends OperationNodeTransformer{transformPrimitiveValueList(t){return ValueListNode.create(t.values.map(ValueNode.createImmediate))}transformValue(t){return ValueNode.createImmediate(t.value)}}var rs;const Ys=class Ys{constructor(t){_i(this,rs);yi(this,rs,freeze(t))}ifNotExists(){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWith(gr(this,rs).node,{ifNotExists:!0})})}unique(){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWith(gr(this,rs).node,{unique:!0})})}nullsNotDistinct(){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWith(gr(this,rs).node,{nullsNotDistinct:!0})})}on(t){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWith(gr(this,rs).node,{table:parseTable(t)})})}column(t){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWithColumns(gr(this,rs).node,[parseOrderedColumnName(t)])})}columns(t){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWithColumns(gr(this,rs).node,t.map(parseOrderedColumnName))})}expression(t){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWithColumns(gr(this,rs).node,[t.toOperationNode()])})}using(t){return new Ys({...gr(this,rs),node:CreateIndexNode.cloneWith(gr(this,rs).node,{using:RawNode.createWithSql(t)})})}where(...t){const I=new ImmediateValueTransformer;return new Ys({...gr(this,rs),node:QueryNode.cloneWithWhere(gr(this,rs).node,I.transformNode(parseValueBinaryOperationOrExpression(t),gr(this,rs).queryId))})}$call(t){return t(this)}toOperationNode(){return gr(this,rs).executor.transformQuery(gr(this,rs).node,gr(this,rs).queryId)}compile(){return gr(this,rs).executor.compileQuery(this.toOperationNode(),gr(this,rs).queryId)}async execute(){await gr(this,rs).executor.executeQuery(this.compile(),gr(this,rs).queryId)}};rs=new WeakMap;let CreateIndexBuilder=Ys;var zs;const zl=class zl{constructor(t){_i(this,zs);yi(this,zs,freeze(t))}ifNotExists(){return new zl({...gr(this,zs),node:CreateSchemaNode.cloneWith(gr(this,zs).node,{ifNotExists:!0})})}$call(t){return t(this)}toOperationNode(){return gr(this,zs).executor.transformQuery(gr(this,zs).node,gr(this,zs).queryId)}compile(){return gr(this,zs).executor.compileQuery(this.toOperationNode(),gr(this,zs).queryId)}async execute(){await gr(this,zs).executor.executeQuery(this.compile(),gr(this,zs).queryId)}};zs=new WeakMap;let CreateSchemaBuilder=zl;function parseOnCommitAction(e){if(ON_COMMIT_ACTIONS.includes(e))return e;throw new Error(`invalid OnCommitAction ${e}`)}var Ji;const Us=class Us{constructor(t){_i(this,Ji);yi(this,Ji,freeze(t))}temporary(){return new Us({...gr(this,Ji),node:CreateTableNode.cloneWith(gr(this,Ji).node,{temporary:!0})})}onCommit(t){return new Us({...gr(this,Ji),node:CreateTableNode.cloneWith(gr(this,Ji).node,{onCommit:parseOnCommitAction(t)})})}ifNotExists(){return new Us({...gr(this,Ji),node:CreateTableNode.cloneWith(gr(this,Ji).node,{ifNotExists:!0})})}addColumn(t,I,B=noop){const tr=B(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(t,parseDataTypeExpression(I))));return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithColumn(gr(this,Ji).node,tr.toOperationNode())})}addPrimaryKeyConstraint(t,I,B=noop){const tr=B(new PrimaryKeyConstraintBuilder(PrimaryKeyConstraintNode.create(I,t)));return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithConstraint(gr(this,Ji).node,tr.toOperationNode())})}addUniqueConstraint(t,I,B=noop){const tr=B(new UniqueConstraintNodeBuilder(UniqueConstraintNode.create(I,t)));return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithConstraint(gr(this,Ji).node,tr.toOperationNode())})}addCheckConstraint(t,I,B=noop){const tr=B(new CheckConstraintBuilder(CheckConstraintNode.create(I.toOperationNode(),t)));return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithConstraint(gr(this,Ji).node,tr.toOperationNode())})}addForeignKeyConstraint(t,I,B,tr,rr=noop){const ir=rr(new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(I.map(ColumnNode.create),parseTable(B),tr.map(ColumnNode.create),t)));return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithConstraint(gr(this,Ji).node,ir.toOperationNode())})}modifyFront(t){return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithFrontModifier(gr(this,Ji).node,t.toOperationNode())})}modifyEnd(t){return new Us({...gr(this,Ji),node:CreateTableNode.cloneWithEndModifier(gr(this,Ji).node,t.toOperationNode())})}as(t){return new Us({...gr(this,Ji),node:CreateTableNode.cloneWith(gr(this,Ji).node,{selectQuery:parseExpression(t)})})}$call(t){return t(this)}toOperationNode(){return gr(this,Ji).executor.transformQuery(gr(this,Ji).node,gr(this,Ji).queryId)}compile(){return gr(this,Ji).executor.compileQuery(this.toOperationNode(),gr(this,Ji).queryId)}async execute(){await gr(this,Ji).executor.executeQuery(this.compile(),gr(this,Ji).queryId)}};Ji=new WeakMap;let CreateTableBuilder=Us;var Is;const Qo=class Qo{constructor(t){_i(this,Is);yi(this,Is,freeze(t))}on(t){return new Qo({...gr(this,Is),node:DropIndexNode.cloneWith(gr(this,Is).node,{table:parseTable(t)})})}ifExists(){return new Qo({...gr(this,Is),node:DropIndexNode.cloneWith(gr(this,Is).node,{ifExists:!0})})}cascade(){return new Qo({...gr(this,Is),node:DropIndexNode.cloneWith(gr(this,Is).node,{cascade:!0})})}$call(t){return t(this)}toOperationNode(){return gr(this,Is).executor.transformQuery(gr(this,Is).node,gr(this,Is).queryId)}compile(){return gr(this,Is).executor.compileQuery(this.toOperationNode(),gr(this,Is).queryId)}async execute(){await gr(this,Is).executor.executeQuery(this.compile(),gr(this,Is).queryId)}};Is=new WeakMap;let DropIndexBuilder=Qo;var Fs;const El=class El{constructor(t){_i(this,Fs);yi(this,Fs,freeze(t))}ifExists(){return new El({...gr(this,Fs),node:DropSchemaNode.cloneWith(gr(this,Fs).node,{ifExists:!0})})}cascade(){return new El({...gr(this,Fs),node:DropSchemaNode.cloneWith(gr(this,Fs).node,{cascade:!0})})}$call(t){return t(this)}toOperationNode(){return gr(this,Fs).executor.transformQuery(gr(this,Fs).node,gr(this,Fs).queryId)}compile(){return gr(this,Fs).executor.compileQuery(this.toOperationNode(),gr(this,Fs).queryId)}async execute(){await gr(this,Fs).executor.executeQuery(this.compile(),gr(this,Fs).queryId)}};Fs=new WeakMap;let DropSchemaBuilder=El;var Ds;const Sl=class Sl{constructor(t){_i(this,Ds);yi(this,Ds,freeze(t))}ifExists(){return new Sl({...gr(this,Ds),node:DropTableNode.cloneWith(gr(this,Ds).node,{ifExists:!0})})}cascade(){return new Sl({...gr(this,Ds),node:DropTableNode.cloneWith(gr(this,Ds).node,{cascade:!0})})}$call(t){return t(this)}toOperationNode(){return gr(this,Ds).executor.transformQuery(gr(this,Ds).node,gr(this,Ds).queryId)}compile(){return gr(this,Ds).executor.compileQuery(this.toOperationNode(),gr(this,Ds).queryId)}async execute(){await gr(this,Ds).executor.executeQuery(this.compile(),gr(this,Ds).queryId)}};Ds=new WeakMap;let DropTableBuilder=Sl;const CreateViewNode=freeze({is(e){return e.kind==="CreateViewNode"},create(e){return freeze({kind:"CreateViewNode",name:SchemableIdentifierNode.create(e)})},cloneWith(e,t){return freeze({...e,...t})}});var vl;class ImmediateValuePlugin{constructor(){_i(this,vl,new ImmediateValueTransformer)}transformQuery(t){return gr(this,vl).transformNode(t.node,t.queryId)}transformResult(t){return Promise.resolve(t.result)}}vl=new WeakMap;var ws;const Ta=class Ta{constructor(t){_i(this,ws);yi(this,ws,freeze(t))}temporary(){return new Ta({...gr(this,ws),node:CreateViewNode.cloneWith(gr(this,ws).node,{temporary:!0})})}materialized(){return new Ta({...gr(this,ws),node:CreateViewNode.cloneWith(gr(this,ws).node,{materialized:!0})})}ifNotExists(){return new Ta({...gr(this,ws),node:CreateViewNode.cloneWith(gr(this,ws).node,{ifNotExists:!0})})}orReplace(){return new Ta({...gr(this,ws),node:CreateViewNode.cloneWith(gr(this,ws).node,{orReplace:!0})})}columns(t){return new Ta({...gr(this,ws),node:CreateViewNode.cloneWith(gr(this,ws).node,{columns:t.map(parseColumnName)})})}as(t){const I=t.withPlugin(new ImmediateValuePlugin).toOperationNode();return new Ta({...gr(this,ws),node:CreateViewNode.cloneWith(gr(this,ws).node,{as:I})})}$call(t){return t(this)}toOperationNode(){return gr(this,ws).executor.transformQuery(gr(this,ws).node,gr(this,ws).queryId)}compile(){return gr(this,ws).executor.compileQuery(this.toOperationNode(),gr(this,ws).queryId)}async execute(){await gr(this,ws).executor.executeQuery(this.compile(),gr(this,ws).queryId)}};ws=new WeakMap;let CreateViewBuilder=Ta;const DropViewNode=freeze({is(e){return e.kind==="DropViewNode"},create(e){return freeze({kind:"DropViewNode",name:SchemableIdentifierNode.create(e)})},cloneWith(e,t){return freeze({...e,...t})}});var Os;const Go=class Go{constructor(t){_i(this,Os);yi(this,Os,freeze(t))}materialized(){return new Go({...gr(this,Os),node:DropViewNode.cloneWith(gr(this,Os).node,{materialized:!0})})}ifExists(){return new Go({...gr(this,Os),node:DropViewNode.cloneWith(gr(this,Os).node,{ifExists:!0})})}cascade(){return new Go({...gr(this,Os),node:DropViewNode.cloneWith(gr(this,Os).node,{cascade:!0})})}$call(t){return t(this)}toOperationNode(){return gr(this,Os).executor.transformQuery(gr(this,Os).node,gr(this,Os).queryId)}compile(){return gr(this,Os).executor.compileQuery(this.toOperationNode(),gr(this,Os).queryId)}async execute(){await gr(this,Os).executor.executeQuery(this.compile(),gr(this,Os).queryId)}};Os=new WeakMap;let DropViewBuilder=Go;const CreateTypeNode=freeze({is(e){return e.kind==="CreateTypeNode"},create(e){return freeze({kind:"CreateTypeNode",name:e})},cloneWithEnum(e,t){return freeze({...e,enum:ValueListNode.create(t.map(ValueNode.createImmediate))})}});var js;const jl=class jl{constructor(t){_i(this,js);yi(this,js,freeze(t))}toOperationNode(){return gr(this,js).executor.transformQuery(gr(this,js).node,gr(this,js).queryId)}asEnum(t){return new jl({...gr(this,js),node:CreateTypeNode.cloneWithEnum(gr(this,js).node,t)})}$call(t){return t(this)}compile(){return gr(this,js).executor.compileQuery(this.toOperationNode(),gr(this,js).queryId)}async execute(){await gr(this,js).executor.executeQuery(this.compile(),gr(this,js).queryId)}};js=new WeakMap;let CreateTypeBuilder=jl;const DropTypeNode=freeze({is(e){return e.kind==="DropTypeNode"},create(e){return freeze({kind:"DropTypeNode",name:e})},cloneWith(e,t){return freeze({...e,...t})}});var Ws;const Wl=class Wl{constructor(t){_i(this,Ws);yi(this,Ws,freeze(t))}ifExists(){return new Wl({...gr(this,Ws),node:DropTypeNode.cloneWith(gr(this,Ws).node,{ifExists:!0})})}$call(t){return t(this)}toOperationNode(){return gr(this,Ws).executor.transformQuery(gr(this,Ws).node,gr(this,Ws).queryId)}compile(){return gr(this,Ws).executor.compileQuery(this.toOperationNode(),gr(this,Ws).queryId)}async execute(){await gr(this,Ws).executor.executeQuery(this.compile(),gr(this,Ws).queryId)}};Ws=new WeakMap;let DropTypeBuilder=Wl;function parseSchemableIdentifier(e){const t=".";if(e.includes(t)){const I=e.split(t).map(trim);if(I.length===2)return SchemableIdentifierNode.createWithSchema(I[0],I[1]);throw new Error(`invalid schemable identifier ${e}`)}else return SchemableIdentifierNode.create(e)}function trim(e){return e.trim()}const RefreshMaterializedViewNode=freeze({is(e){return e.kind==="RefreshMaterializedViewNode"},create(e){return freeze({kind:"RefreshMaterializedViewNode",name:SchemableIdentifierNode.create(e)})},cloneWith(e,t){return freeze({...e,...t})}});var Ps;const Ko=class Ko{constructor(t){_i(this,Ps);yi(this,Ps,freeze(t))}concurrently(){return new Ko({...gr(this,Ps),node:RefreshMaterializedViewNode.cloneWith(gr(this,Ps).node,{concurrently:!0,withNoData:!1})})}withData(){return new Ko({...gr(this,Ps),node:RefreshMaterializedViewNode.cloneWith(gr(this,Ps).node,{withNoData:!1})})}withNoData(){return new Ko({...gr(this,Ps),node:RefreshMaterializedViewNode.cloneWith(gr(this,Ps).node,{withNoData:!0,concurrently:!1})})}$call(t){return t(this)}toOperationNode(){return gr(this,Ps).executor.transformQuery(gr(this,Ps).node,gr(this,Ps).queryId)}compile(){return gr(this,Ps).executor.compileQuery(this.toOperationNode(),gr(this,Ps).queryId)}async execute(){await gr(this,Ps).executor.executeQuery(this.compile(),gr(this,Ps).queryId)}};Ps=new WeakMap;let RefreshMaterializedViewBuilder=Ko;var Cs;const Jo=class Jo{constructor(t){_i(this,Cs);yi(this,Cs,t)}createTable(t){return new CreateTableBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:CreateTableNode.create(parseTable(t))})}dropTable(t){return new DropTableBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:DropTableNode.create(parseTable(t))})}createIndex(t){return new CreateIndexBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:CreateIndexNode.create(t)})}dropIndex(t){return new DropIndexBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:DropIndexNode.create(t)})}createSchema(t){return new CreateSchemaBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:CreateSchemaNode.create(t)})}dropSchema(t){return new DropSchemaBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:DropSchemaNode.create(t)})}alterTable(t){return new AlterTableBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:AlterTableNode.create(parseTable(t))})}createView(t){return new CreateViewBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:CreateViewNode.create(t)})}refreshMaterializedView(t){return new RefreshMaterializedViewBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:RefreshMaterializedViewNode.create(t)})}dropView(t){return new DropViewBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:DropViewNode.create(t)})}createType(t){return new CreateTypeBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:CreateTypeNode.create(parseSchemableIdentifier(t))})}dropType(t){return new DropTypeBuilder({queryId:createQueryId(),executor:gr(this,Cs),node:DropTypeNode.create(parseSchemableIdentifier(t))})}withPlugin(t){return new Jo(gr(this,Cs).withPlugin(t))}withoutPlugins(){return new Jo(gr(this,Cs).withoutPlugins())}withSchema(t){return new Jo(gr(this,Cs).withPluginAtFront(new WithSchemaPlugin(t)))}};Cs=new WeakMap;let SchemaModule=Jo;class DynamicModule{ref(t){return new DynamicReferenceBuilder(t)}table(t){return new DynamicTableBuilder(t)}}var Po;class DefaultConnectionProvider{constructor(t){_i(this,Po);yi(this,Po,t)}async provideConnection(t){const I=await gr(this,Po).acquireConnection();try{return await t(I)}finally{await gr(this,Po).releaseConnection(I)}}}Po=new WeakMap;var ha,pa,xa;const Ja=class Ja extends QueryExecutorBase{constructor(I,B,tr,rr=[]){super(rr);_i(this,ha);_i(this,pa);_i(this,xa);yi(this,ha,I),yi(this,pa,B),yi(this,xa,tr)}get adapter(){return gr(this,pa)}compileQuery(I,B){return gr(this,ha).compileQuery(I,B)}provideConnection(I){return gr(this,xa).provideConnection(I)}withPlugins(I){return new Ja(gr(this,ha),gr(this,pa),gr(this,xa),[...this.plugins,...I])}withPlugin(I){return new Ja(gr(this,ha),gr(this,pa),gr(this,xa),[...this.plugins,I])}withPluginAtFront(I){return new Ja(gr(this,ha),gr(this,pa),gr(this,xa),[I,...this.plugins])}withConnectionProvider(I){return new Ja(gr(this,ha),gr(this,pa),I,[...this.plugins])}withoutPlugins(){return new Ja(gr(this,ha),gr(this,pa),gr(this,xa),[])}};ha=new WeakMap,pa=new WeakMap,xa=new WeakMap;let DefaultQueryExecutor=Ja;function performanceNow(){return typeof performance<"u"&&isFunction(performance.now)?performance.now():Date.now()}var ks,Da,Ma,ko,qa,sl,Ls,ru,nu,Dl,$l,Ll;class RuntimeDriver{constructor(t,I){_i(this,Ls);_i(this,ks);_i(this,Da);_i(this,Ma);_i(this,ko);_i(this,qa);_i(this,sl,new WeakSet);yi(this,ko,!1),yi(this,ks,t),yi(this,Da,I)}async init(){if(gr(this,qa))throw new Error("driver has already been destroyed");gr(this,Ma)||yi(this,Ma,gr(this,ks).init().then(()=>{yi(this,ko,!0)}).catch(t=>(yi(this,Ma,void 0),Promise.reject(t)))),await gr(this,Ma)}async acquireConnection(){if(gr(this,qa))throw new Error("driver has already been destroyed");gr(this,ko)||await this.init();const t=await gr(this,ks).acquireConnection();return gr(this,sl).has(t)||(Ai(this,Ls,ru).call(this)&&Ai(this,Ls,nu).call(this,t),gr(this,sl).add(t)),t}async releaseConnection(t){await gr(this,ks).releaseConnection(t)}beginTransaction(t,I){return gr(this,ks).beginTransaction(t,I)}commitTransaction(t){return gr(this,ks).commitTransaction(t)}rollbackTransaction(t){return gr(this,ks).rollbackTransaction(t)}savepoint(t,I,B){if(gr(this,ks).savepoint)return gr(this,ks).savepoint(t,I,B);throw new Error("The `savepoint` method is not supported by this driver")}rollbackToSavepoint(t,I,B){if(gr(this,ks).rollbackToSavepoint)return gr(this,ks).rollbackToSavepoint(t,I,B);throw new Error("The `rollbackToSavepoint` method is not supported by this driver")}releaseSavepoint(t,I,B){if(gr(this,ks).releaseSavepoint)return gr(this,ks).releaseSavepoint(t,I,B);throw new Error("The `releaseSavepoint` method is not supported by this driver")}async destroy(){gr(this,Ma)&&(await gr(this,Ma),gr(this,qa)||yi(this,qa,gr(this,ks).destroy().catch(t=>(yi(this,qa,void 0),Promise.reject(t)))),await gr(this,qa))}}ks=new WeakMap,Da=new WeakMap,Ma=new WeakMap,ko=new WeakMap,qa=new WeakMap,sl=new WeakMap,Ls=new WeakSet,ru=function(){return gr(this,Da).isLevelEnabled("query")||gr(this,Da).isLevelEnabled("error")},nu=function(t){const I=t.executeQuery,B=t.streamQuery,tr=this;t.executeQuery=async rr=>{var dr,hr;let ir;const lr=performanceNow();try{return await I.call(t,rr)}catch(fr){throw ir=fr,await Ai(dr=tr,Ls,Dl).call(dr,fr,rr,lr),fr}finally{ir||await Ai(hr=tr,Ls,$l).call(hr,rr,lr)}},t.streamQuery=async function*(rr,ir){var hr,fr;let lr;const dr=performanceNow();try{for await(const mr of B.call(t,rr,ir))yield mr}catch(mr){throw lr=mr,await Ai(hr=tr,Ls,Dl).call(hr,mr,rr,dr),mr}finally{lr||await Ai(fr=tr,Ls,$l).call(fr,rr,dr,!0)}}},Dl=async function(t,I,B){await gr(this,Da).error(()=>({level:"error",error:t,query:I,queryDurationMillis:Ai(this,Ls,Ll).call(this,B)}))},$l=async function(t,I,B=!1){await gr(this,Da).query(()=>({level:"query",isStream:B,query:t,queryDurationMillis:Ai(this,Ls,Ll).call(this,I)}))},Ll=function(t){return performanceNow()-t};const ignoreError=()=>{};var al,$a,xl,iu;class SingleConnectionProvider{constructor(t){_i(this,xl);_i(this,al);_i(this,$a);yi(this,al,t)}async provideConnection(t){for(;gr(this,$a);)await gr(this,$a).catch(ignoreError);return yi(this,$a,Ai(this,xl,iu).call(this,t).finally(()=>{yi(this,$a,void 0)})),gr(this,$a)}}al=new WeakMap,$a=new WeakMap,xl=new WeakSet,iu=async function(t){return await t(gr(this,al))};const TRANSACTION_ACCESS_MODES=["read only","read write"],TRANSACTION_ISOLATION_LEVELS=["read uncommitted","read committed","repeatable read","serializable","snapshot"];function validateTransactionSettings(e){if(e.accessMode&&!TRANSACTION_ACCESS_MODES.includes(e.accessMode))throw new Error(`invalid transaction access mode ${e.accessMode}`);if(e.isolationLevel&&!TRANSACTION_ISOLATION_LEVELS.includes(e.isolationLevel))throw new Error(`invalid transaction isolation level ${e.isolationLevel}`)}freeze(["query","error"]);var La,so;class Log{constructor(t){_i(this,La);_i(this,so);isFunction(t)?(yi(this,so,t),yi(this,La,freeze({query:!0,error:!0}))):(yi(this,so,defaultLogger),yi(this,La,freeze({query:t.includes("query"),error:t.includes("error")})))}isLevelEnabled(t){return gr(this,La)[t]}async query(t){gr(this,La).query&&await gr(this,so).call(this,t())}async error(t){gr(this,La).error&&await gr(this,so).call(this,t())}}La=new WeakMap,so=new WeakMap;function defaultLogger(e){if(e.level==="query"){const t=`kysely:query:${e.isStream?"stream:":""}`;console.log(`${t} ${e.query.sql}`),console.log(`${t} duration: ${e.queryDurationMillis.toFixed(1)}ms`)}else e.level==="error"&&(e.error instanceof Error?console.error(`kysely:error: ${e.error.stack??e.error.message}`):console.error(`kysely:error: ${JSON.stringify({error:e.error,query:e.query.sql,queryDurationMillis:e.queryDurationMillis})}`))}function isCompilable(e){return isObject(e)&&isFunction(e.compile)}Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));var As;const fo=class fo extends QueryCreator{constructor(I){let B,tr;if(isKyselyProps(I))B={executor:I.executor},tr={...I};else{const rr=I.dialect,ir=rr.createDriver(),lr=rr.createQueryCompiler(),dr=rr.createAdapter(),hr=new Log(I.log??[]),fr=new RuntimeDriver(ir,hr),mr=new DefaultConnectionProvider(fr),_r=new DefaultQueryExecutor(lr,dr,mr,I.plugins??[]);B={executor:_r},tr={config:I,executor:_r,dialect:rr,driver:fr}}super(B);_i(this,As);yi(this,As,freeze(tr))}get schema(){return new SchemaModule(gr(this,As).executor)}get dynamic(){return new DynamicModule}get introspection(){return gr(this,As).dialect.createIntrospector(this.withoutPlugins())}case(I){return new CaseBuilder({node:CaseNode.create(isUndefined(I)?void 0:parseExpression(I))})}get fn(){return createFunctionModule()}transaction(){return new TransactionBuilder({...gr(this,As)})}startTransaction(){return new ControlledTransactionBuilder({...gr(this,As)})}connection(){return new ConnectionBuilder({...gr(this,As)})}withPlugin(I){return new fo({...gr(this,As),executor:gr(this,As).executor.withPlugin(I)})}withoutPlugins(){return new fo({...gr(this,As),executor:gr(this,As).executor.withoutPlugins()})}withSchema(I){return new fo({...gr(this,As),executor:gr(this,As).executor.withPluginAtFront(new WithSchemaPlugin(I))})}withTables(){return new fo({...gr(this,As)})}async destroy(){await gr(this,As).driver.destroy()}get isTransaction(){return!1}getExecutor(){return gr(this,As).executor}executeQuery(I,B=createQueryId()){const tr=isCompilable(I)?I.compile():I;return this.getExecutor().executeQuery(tr,B)}async[Symbol.asyncDispose](){await this.destroy()}};As=new WeakMap;let Kysely=fo;var ia;const _o=class _o extends Kysely{constructor(I){super(I);_i(this,ia);yi(this,ia,I)}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(I){return new _o({...gr(this,ia),executor:gr(this,ia).executor.withPlugin(I)})}withoutPlugins(){return new _o({...gr(this,ia),executor:gr(this,ia).executor.withoutPlugins()})}withSchema(I){return new _o({...gr(this,ia),executor:gr(this,ia).executor.withPluginAtFront(new WithSchemaPlugin(I))})}withTables(){return new _o({...gr(this,ia)})}};ia=new WeakMap;let Transaction=_o;function isKyselyProps(e){return isObject(e)&&isObject(e.config)&&isObject(e.driver)&&isObject(e.executor)&&isObject(e.dialect)}var ao;class ConnectionBuilder{constructor(t){_i(this,ao);yi(this,ao,freeze(t))}async execute(t){return gr(this,ao).executor.provideConnection(async I=>{const B=gr(this,ao).executor.withConnectionProvider(new SingleConnectionProvider(I)),tr=new Kysely({...gr(this,ao),executor:B});return await t(tr)})}}ao=new WeakMap;var Gs;const Ml=class Ml{constructor(t){_i(this,Gs);yi(this,Gs,freeze(t))}setAccessMode(t){return new Ml({...gr(this,Gs),accessMode:t})}setIsolationLevel(t){return new Ml({...gr(this,Gs),isolationLevel:t})}async execute(t){const{isolationLevel:I,accessMode:B,...tr}=gr(this,Gs),rr={isolationLevel:I,accessMode:B};return validateTransactionSettings(rr),gr(this,Gs).executor.provideConnection(async ir=>{const lr=gr(this,Gs).executor.withConnectionProvider(new SingleConnectionProvider(ir)),dr=new Transaction({...tr,executor:lr});try{await gr(this,Gs).driver.beginTransaction(ir,rr);const hr=await t(dr);return await gr(this,Gs).driver.commitTransaction(ir),hr}catch(hr){throw await gr(this,Gs).driver.rollbackTransaction(ir),hr}})}};Gs=new WeakMap;let TransactionBuilder=Ml;var ma;const ql=class ql{constructor(t){_i(this,ma);yi(this,ma,freeze(t))}setAccessMode(t){return new ql({...gr(this,ma),accessMode:t})}setIsolationLevel(t){return new ql({...gr(this,ma),isolationLevel:t})}async execute(){const{isolationLevel:t,accessMode:I,...B}=gr(this,ma),tr={isolationLevel:t,accessMode:I};validateTransactionSettings(tr);const rr=await provideControlledConnection(gr(this,ma).executor);return await gr(this,ma).driver.beginTransaction(rr.connection,tr),new ControlledTransaction({...B,connection:rr,executor:gr(this,ma).executor.withConnectionProvider(new SingleConnectionProvider(rr.connection))})}};ma=new WeakMap;let ControlledTransactionBuilder=ql;var ds,oo,Vs;const wa=class wa extends Transaction{constructor(I){const B={isCommitted:!1,isRolledBack:!1};I={...I,executor:new NotCommittedOrRolledBackAssertingExecutor(I.executor,B)};const{connection:tr,...rr}=I;super(rr);_i(this,ds);_i(this,oo);_i(this,Vs);yi(this,ds,freeze(I)),yi(this,Vs,B);const ir=createQueryId();yi(this,oo,lr=>I.executor.compileQuery(lr,ir))}get isCommitted(){return gr(this,Vs).isCommitted}get isRolledBack(){return gr(this,Vs).isRolledBack}commit(){return assertNotCommittedOrRolledBack(gr(this,Vs)),new Command(async()=>{await gr(this,ds).driver.commitTransaction(gr(this,ds).connection.connection),gr(this,Vs).isCommitted=!0,gr(this,ds).connection.release()})}rollback(){return assertNotCommittedOrRolledBack(gr(this,Vs)),new Command(async()=>{await gr(this,ds).driver.rollbackTransaction(gr(this,ds).connection.connection),gr(this,Vs).isRolledBack=!0,gr(this,ds).connection.release()})}savepoint(I){return assertNotCommittedOrRolledBack(gr(this,Vs)),new Command(async()=>{var B,tr;return await((tr=(B=gr(this,ds).driver).savepoint)==null?void 0:tr.call(B,gr(this,ds).connection.connection,I,gr(this,oo))),new wa({...gr(this,ds)})})}rollbackToSavepoint(I){return assertNotCommittedOrRolledBack(gr(this,Vs)),new Command(async()=>{var B,tr;return await((tr=(B=gr(this,ds).driver).rollbackToSavepoint)==null?void 0:tr.call(B,gr(this,ds).connection.connection,I,gr(this,oo))),new wa({...gr(this,ds)})})}releaseSavepoint(I){return assertNotCommittedOrRolledBack(gr(this,Vs)),new Command(async()=>{var B,tr;return await((tr=(B=gr(this,ds).driver).releaseSavepoint)==null?void 0:tr.call(B,gr(this,ds).connection.connection,I,gr(this,oo))),new wa({...gr(this,ds)})})}withPlugin(I){return new wa({...gr(this,ds),executor:gr(this,ds).executor.withPlugin(I)})}withoutPlugins(){return new wa({...gr(this,ds),executor:gr(this,ds).executor.withoutPlugins()})}withSchema(I){return new wa({...gr(this,ds),executor:gr(this,ds).executor.withPluginAtFront(new WithSchemaPlugin(I))})}withTables(){return new wa({...gr(this,ds)})}};ds=new WeakMap,oo=new WeakMap,Vs=new WeakMap;let ControlledTransaction=wa;var ol;class Command{constructor(t){_i(this,ol);yi(this,ol,t)}async execute(){return await gr(this,ol).call(this)}}ol=new WeakMap;function assertNotCommittedOrRolledBack(e){if(e.isCommitted)throw new Error("Transaction is already committed");if(e.isRolledBack)throw new Error("Transaction is already rolled back")}var Rs,sa;const Ia=class Ia{constructor(t,I){_i(this,Rs);_i(this,sa);t instanceof Ia?yi(this,Rs,gr(t,Rs)):yi(this,Rs,t),yi(this,sa,I)}get adapter(){return gr(this,Rs).adapter}get plugins(){return gr(this,Rs).plugins}transformQuery(t,I){return gr(this,Rs).transformQuery(t,I)}compileQuery(t,I){return gr(this,Rs).compileQuery(t,I)}provideConnection(t){return gr(this,Rs).provideConnection(t)}executeQuery(t,I){return assertNotCommittedOrRolledBack(gr(this,sa)),gr(this,Rs).executeQuery(t,I)}stream(t,I,B){return assertNotCommittedOrRolledBack(gr(this,sa)),gr(this,Rs).stream(t,I,B)}withConnectionProvider(t){return new Ia(gr(this,Rs).withConnectionProvider(t),gr(this,sa))}withPlugin(t){return new Ia(gr(this,Rs).withPlugin(t),gr(this,sa))}withPlugins(t){return new Ia(gr(this,Rs).withPlugins(t),gr(this,sa))}withPluginAtFront(t){return new Ia(gr(this,Rs).withPluginAtFront(t),gr(this,sa))}withoutPlugins(){return new Ia(gr(this,Rs).withoutPlugins(),gr(this,sa))}};Rs=new WeakMap,sa=new WeakMap;let NotCommittedOrRolledBackAssertingExecutor=Ia;var $s,Ks,ml,Ul,Bl;const Xo=class Xo{constructor(t){_i(this,Ks);_i(this,$s);yi(this,$s,freeze(t))}get expressionType(){}get isRawBuilder(){return!0}as(t){return new AliasedRawBuilderImpl(this,t)}$castTo(){return new Xo({...gr(this,$s)})}$notNull(){return new Xo(gr(this,$s))}withPlugin(t){return new Xo({...gr(this,$s),plugins:gr(this,$s).plugins!==void 0?freeze([...gr(this,$s).plugins,t]):freeze([t])})}toOperationNode(){return Ai(this,Ks,Ul).call(this,Ai(this,Ks,ml).call(this))}compile(t){return Ai(this,Ks,Bl).call(this,Ai(this,Ks,ml).call(this,t))}async execute(t){const I=Ai(this,Ks,ml).call(this,t);return I.executeQuery(Ai(this,Ks,Bl).call(this,I),gr(this,$s).queryId)}};$s=new WeakMap,Ks=new WeakSet,ml=function(t){const I=t!==void 0?t.getExecutor():NOOP_QUERY_EXECUTOR;return gr(this,$s).plugins!==void 0?I.withPlugins(gr(this,$s).plugins):I},Ul=function(t){return t.transformQuery(gr(this,$s).rawNode,gr(this,$s).queryId)},Bl=function(t){return t.compileQuery(Ai(this,Ks,Ul).call(this,t),gr(this,$s).queryId)};let RawBuilderImpl=Xo;function createRawBuilder(e){return new RawBuilderImpl(e)}var lo,Ua;class AliasedRawBuilderImpl{constructor(t,I){_i(this,lo);_i(this,Ua);yi(this,lo,t),yi(this,Ua,I)}get expression(){return gr(this,lo)}get alias(){return gr(this,Ua)}get rawBuilder(){return gr(this,lo)}toOperationNode(){return AliasNode.create(gr(this,lo).toOperationNode(),isOperationNodeSource(gr(this,Ua))?gr(this,Ua).toOperationNode():IdentifierNode.create(gr(this,Ua)))}}lo=new WeakMap,Ua=new WeakMap;const sql=Object.assign((e,...t)=>createRawBuilder({queryId:createQueryId(),rawNode:RawNode.create(e,(t==null?void 0:t.map(parseParameter))??[])}),{ref(e){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseStringReference(e))})},val(e){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseValueExpression(e))})},value(e){return this.val(e)},table(e){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseTable(e))})},id(...e){const t=new Array(e.length+1).fill(".");return t[0]="",t[t.length-1]="",createRawBuilder({queryId:createQueryId(),rawNode:RawNode.create(t,e.map(IdentifierNode.create))})},lit(e){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(ValueNode.createImmediate(e))})},literal(e){return this.lit(e)},raw(e){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithSql(e)})},join(e,t=sql`, `){const I=new Array(Math.max(2*e.length-1,0)),B=t.toOperationNode();for(let tr=0;tr<e.length;++tr)I[2*tr]=parseParameter(e[tr]),tr!==e.length-1&&(I[2*tr+1]=B);return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChildren(I)})}});function parseParameter(e){return isOperationNodeSource(e)?e.toOperationNode():parseValueExpression(e)}var Cl;class OperationNodeVisitor{constructor(){ji(this,"nodeStack",[]);_i(this,Cl,freeze({AliasNode:this.visitAlias.bind(this),ColumnNode:this.visitColumn.bind(this),IdentifierNode:this.visitIdentifier.bind(this),SchemableIdentifierNode:this.visitSchemableIdentifier.bind(this),RawNode:this.visitRaw.bind(this),ReferenceNode:this.visitReference.bind(this),SelectQueryNode:this.visitSelectQuery.bind(this),SelectionNode:this.visitSelection.bind(this),TableNode:this.visitTable.bind(this),FromNode:this.visitFrom.bind(this),SelectAllNode:this.visitSelectAll.bind(this),AndNode:this.visitAnd.bind(this),OrNode:this.visitOr.bind(this),ValueNode:this.visitValue.bind(this),ValueListNode:this.visitValueList.bind(this),PrimitiveValueListNode:this.visitPrimitiveValueList.bind(this),ParensNode:this.visitParens.bind(this),JoinNode:this.visitJoin.bind(this),OperatorNode:this.visitOperator.bind(this),WhereNode:this.visitWhere.bind(this),InsertQueryNode:this.visitInsertQuery.bind(this),DeleteQueryNode:this.visitDeleteQuery.bind(this),ReturningNode:this.visitReturning.bind(this),CreateTableNode:this.visitCreateTable.bind(this),AddColumnNode:this.visitAddColumn.bind(this),ColumnDefinitionNode:this.visitColumnDefinition.bind(this),DropTableNode:this.visitDropTable.bind(this),DataTypeNode:this.visitDataType.bind(this),OrderByNode:this.visitOrderBy.bind(this),OrderByItemNode:this.visitOrderByItem.bind(this),GroupByNode:this.visitGroupBy.bind(this),GroupByItemNode:this.visitGroupByItem.bind(this),UpdateQueryNode:this.visitUpdateQuery.bind(this),ColumnUpdateNode:this.visitColumnUpdate.bind(this),LimitNode:this.visitLimit.bind(this),OffsetNode:this.visitOffset.bind(this),OnConflictNode:this.visitOnConflict.bind(this),OnDuplicateKeyNode:this.visitOnDuplicateKey.bind(this),CreateIndexNode:this.visitCreateIndex.bind(this),DropIndexNode:this.visitDropIndex.bind(this),ListNode:this.visitList.bind(this),PrimaryKeyConstraintNode:this.visitPrimaryKeyConstraint.bind(this),UniqueConstraintNode:this.visitUniqueConstraint.bind(this),ReferencesNode:this.visitReferences.bind(this),CheckConstraintNode:this.visitCheckConstraint.bind(this),WithNode:this.visitWith.bind(this),CommonTableExpressionNode:this.visitCommonTableExpression.bind(this),CommonTableExpressionNameNode:this.visitCommonTableExpressionName.bind(this),HavingNode:this.visitHaving.bind(this),CreateSchemaNode:this.visitCreateSchema.bind(this),DropSchemaNode:this.visitDropSchema.bind(this),AlterTableNode:this.visitAlterTable.bind(this),DropColumnNode:this.visitDropColumn.bind(this),RenameColumnNode:this.visitRenameColumn.bind(this),AlterColumnNode:this.visitAlterColumn.bind(this),ModifyColumnNode:this.visitModifyColumn.bind(this),AddConstraintNode:this.visitAddConstraint.bind(this),DropConstraintNode:this.visitDropConstraint.bind(this),RenameConstraintNode:this.visitRenameConstraint.bind(this),ForeignKeyConstraintNode:this.visitForeignKeyConstraint.bind(this),CreateViewNode:this.visitCreateView.bind(this),RefreshMaterializedViewNode:this.visitRefreshMaterializedView.bind(this),DropViewNode:this.visitDropView.bind(this),GeneratedNode:this.visitGenerated.bind(this),DefaultValueNode:this.visitDefaultValue.bind(this),OnNode:this.visitOn.bind(this),ValuesNode:this.visitValues.bind(this),SelectModifierNode:this.visitSelectModifier.bind(this),CreateTypeNode:this.visitCreateType.bind(this),DropTypeNode:this.visitDropType.bind(this),ExplainNode:this.visitExplain.bind(this),DefaultInsertValueNode:this.visitDefaultInsertValue.bind(this),AggregateFunctionNode:this.visitAggregateFunction.bind(this),OverNode:this.visitOver.bind(this),PartitionByNode:this.visitPartitionBy.bind(this),PartitionByItemNode:this.visitPartitionByItem.bind(this),SetOperationNode:this.visitSetOperation.bind(this),BinaryOperationNode:this.visitBinaryOperation.bind(this),UnaryOperationNode:this.visitUnaryOperation.bind(this),UsingNode:this.visitUsing.bind(this),FunctionNode:this.visitFunction.bind(this),CaseNode:this.visitCase.bind(this),WhenNode:this.visitWhen.bind(this),JSONReferenceNode:this.visitJSONReference.bind(this),JSONPathNode:this.visitJSONPath.bind(this),JSONPathLegNode:this.visitJSONPathLeg.bind(this),JSONOperatorChainNode:this.visitJSONOperatorChain.bind(this),TupleNode:this.visitTuple.bind(this),MergeQueryNode:this.visitMergeQuery.bind(this),MatchedNode:this.visitMatched.bind(this),AddIndexNode:this.visitAddIndex.bind(this),CastNode:this.visitCast.bind(this),FetchNode:this.visitFetch.bind(this),TopNode:this.visitTop.bind(this),OutputNode:this.visitOutput.bind(this),OrActionNode:this.visitOrAction.bind(this),CollateNode:this.visitCollate.bind(this)}));ji(this,"visitNode",t=>{this.nodeStack.push(t),gr(this,Cl)[t.kind](t),this.nodeStack.pop()})}get parentNode(){return this.nodeStack[this.nodeStack.length-2]}}Cl=new WeakMap;const LIT_WRAP_REGEX=/'/g;var Fo,uo;class DefaultQueryCompiler extends OperationNodeVisitor{constructor(){super(...arguments);_i(this,Fo,"");_i(this,uo,[])}get numParameters(){return gr(this,uo).length}compileQuery(I,B){return yi(this,Fo,""),yi(this,uo,[]),this.nodeStack.splice(0,this.nodeStack.length),this.visitNode(I),freeze({query:I,queryId:B,sql:this.getSql(),parameters:[...gr(this,uo)]})}getSql(){return gr(this,Fo)}visitSelectQuery(I){var tr,rr;const B=this.parentNode!==void 0&&!ParensNode.is(this.parentNode)&&!InsertQueryNode.is(this.parentNode)&&!CreateTableNode.is(this.parentNode)&&!CreateViewNode.is(this.parentNode)&&!SetOperationNode.is(this.parentNode);this.parentNode===void 0&&I.explain&&(this.visitNode(I.explain),this.append(" ")),B&&this.append("("),I.with&&(this.visitNode(I.with),this.append(" ")),this.append("select"),I.distinctOn&&(this.append(" "),this.compileDistinctOn(I.distinctOn)),(tr=I.frontModifiers)!=null&&tr.length&&(this.append(" "),this.compileList(I.frontModifiers," ")),I.top&&(this.append(" "),this.visitNode(I.top)),I.selections&&(this.append(" "),this.compileList(I.selections)),I.from&&(this.append(" "),this.visitNode(I.from)),I.joins&&(this.append(" "),this.compileList(I.joins," ")),I.where&&(this.append(" "),this.visitNode(I.where)),I.groupBy&&(this.append(" "),this.visitNode(I.groupBy)),I.having&&(this.append(" "),this.visitNode(I.having)),I.setOperations&&(this.append(" "),this.compileList(I.setOperations," ")),I.orderBy&&(this.append(" "),this.visitNode(I.orderBy)),I.limit&&(this.append(" "),this.visitNode(I.limit)),I.offset&&(this.append(" "),this.visitNode(I.offset)),I.fetch&&(this.append(" "),this.visitNode(I.fetch)),(rr=I.endModifiers)!=null&&rr.length&&(this.append(" "),this.compileList(this.sortSelectModifiers([...I.endModifiers])," ")),B&&this.append(")")}visitFrom(I){this.append("from "),this.compileList(I.froms)}visitSelection(I){this.visitNode(I.selection)}visitColumn(I){this.visitNode(I.column)}compileDistinctOn(I){this.append("distinct on ("),this.compileList(I),this.append(")")}compileList(I,B=", "){const tr=I.length-1;for(let rr=0;rr<=tr;rr++)this.visitNode(I[rr]),rr<tr&&this.append(B)}visitWhere(I){this.append("where "),this.visitNode(I.where)}visitHaving(I){this.append("having "),this.visitNode(I.having)}visitInsertQuery(I){var rr;const B=this.nodeStack.find(QueryNode.is),tr=B!==I;!tr&&I.explain&&(this.visitNode(I.explain),this.append(" ")),tr&&!MergeQueryNode.is(B)&&this.append("("),I.with&&(this.visitNode(I.with),this.append(" ")),this.append(I.replace?"replace":"insert"),I.ignore&&(logOnce("`InsertQueryNode.ignore` is deprecated. Use `InsertQueryNode.orAction` instead."),this.append(" ignore")),I.orAction&&(this.append(" "),this.visitNode(I.orAction)),I.top&&(this.append(" "),this.visitNode(I.top)),I.into&&(this.append(" into "),this.visitNode(I.into)),I.columns&&(this.append(" ("),this.compileList(I.columns),this.append(")")),I.output&&(this.append(" "),this.visitNode(I.output)),I.values&&(this.append(" "),this.visitNode(I.values)),I.defaultValues&&(this.append(" "),this.append("default values")),I.onConflict&&(this.append(" "),this.visitNode(I.onConflict)),I.onDuplicateKey&&(this.append(" "),this.visitNode(I.onDuplicateKey)),I.returning&&(this.append(" "),this.visitNode(I.returning)),tr&&!MergeQueryNode.is(B)&&this.append(")"),(rr=I.endModifiers)!=null&&rr.length&&(this.append(" "),this.compileList(I.endModifiers," "))}visitValues(I){this.append("values "),this.compileList(I.values)}visitDeleteQuery(I){var tr;const B=this.nodeStack.find(QueryNode.is)!==I;!B&&I.explain&&(this.visitNode(I.explain),this.append(" ")),B&&this.append("("),I.with&&(this.visitNode(I.with),this.append(" ")),this.append("delete "),I.top&&(this.visitNode(I.top),this.append(" ")),this.visitNode(I.from),I.output&&(this.append(" "),this.visitNode(I.output)),I.using&&(this.append(" "),this.visitNode(I.using)),I.joins&&(this.append(" "),this.compileList(I.joins," ")),I.where&&(this.append(" "),this.visitNode(I.where)),I.orderBy&&(this.append(" "),this.visitNode(I.orderBy)),I.limit&&(this.append(" "),this.visitNode(I.limit)),I.returning&&(this.append(" "),this.visitNode(I.returning)),B&&this.append(")"),(tr=I.endModifiers)!=null&&tr.length&&(this.append(" "),this.compileList(I.endModifiers," "))}visitReturning(I){this.append("returning "),this.compileList(I.selections)}visitAlias(I){this.visitNode(I.node),this.append(" as "),this.visitNode(I.alias)}visitReference(I){I.table&&(this.visitNode(I.table),this.append(".")),this.visitNode(I.column)}visitSelectAll(I){this.append("*")}visitIdentifier(I){this.append(this.getLeftIdentifierWrapper()),this.compileUnwrappedIdentifier(I),this.append(this.getRightIdentifierWrapper())}compileUnwrappedIdentifier(I){if(!isString(I.name))throw new Error("a non-string identifier was passed to compileUnwrappedIdentifier.");this.append(this.sanitizeIdentifier(I.name))}visitAnd(I){this.visitNode(I.left),this.append(" and "),this.visitNode(I.right)}visitOr(I){this.visitNode(I.left),this.append(" or "),this.visitNode(I.right)}visitValue(I){I.immediate?this.appendImmediateValue(I.value):this.appendValue(I.value)}visitValueList(I){this.append("("),this.compileList(I.values),this.append(")")}visitTuple(I){this.append("("),this.compileList(I.values),this.append(")")}visitPrimitiveValueList(I){this.append("(");const{values:B}=I;for(let tr=0;tr<B.length;++tr)this.appendValue(B[tr]),tr!==B.length-1&&this.append(", ");this.append(")")}visitParens(I){this.append("("),this.visitNode(I.node),this.append(")")}visitJoin(I){this.append(JOIN_TYPE_SQL[I.joinType]),this.append(" "),this.visitNode(I.table),I.on&&(this.append(" "),this.visitNode(I.on))}visitOn(I){this.append("on "),this.visitNode(I.on)}visitRaw(I){const{sqlFragments:B,parameters:tr}=I;for(let rr=0;rr<B.length;++rr)this.append(B[rr]),tr.length>rr&&this.visitNode(tr[rr])}visitOperator(I){this.append(I.operator)}visitTable(I){this.visitNode(I.table)}visitSchemableIdentifier(I){I.schema&&(this.visitNode(I.schema),this.append(".")),this.visitNode(I.identifier)}visitCreateTable(I){this.append("create "),I.frontModifiers&&I.frontModifiers.length>0&&(this.compileList(I.frontModifiers," "),this.append(" ")),I.temporary&&this.append("temporary "),this.append("table "),I.ifNotExists&&this.append("if not exists "),this.visitNode(I.table),I.selectQuery?(this.append(" as "),this.visitNode(I.selectQuery)):(this.append(" ("),this.compileList([...I.columns,...I.constraints??[]]),this.append(")"),I.onCommit&&(this.append(" on commit "),this.append(I.onCommit)),I.endModifiers&&I.endModifiers.length>0&&(this.append(" "),this.compileList(I.endModifiers," ")))}visitColumnDefinition(I){I.ifNotExists&&this.append("if not exists "),this.visitNode(I.column),this.append(" "),this.visitNode(I.dataType),I.unsigned&&this.append(" unsigned"),I.frontModifiers&&I.frontModifiers.length>0&&(this.append(" "),this.compileList(I.frontModifiers," ")),I.generated&&(this.append(" "),this.visitNode(I.generated)),I.identity&&this.append(" identity"),I.defaultTo&&(this.append(" "),this.visitNode(I.defaultTo)),I.notNull&&this.append(" not null"),I.unique&&this.append(" unique"),I.nullsNotDistinct&&this.append(" nulls not distinct"),I.primaryKey&&this.append(" primary key"),I.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),I.references&&(this.append(" "),this.visitNode(I.references)),I.check&&(this.append(" "),this.visitNode(I.check)),I.endModifiers&&I.endModifiers.length>0&&(this.append(" "),this.compileList(I.endModifiers," "))}getAutoIncrement(){return"auto_increment"}visitReferences(I){this.append("references "),this.visitNode(I.table),this.append(" ("),this.compileList(I.columns),this.append(")"),I.onDelete&&(this.append(" on delete "),this.append(I.onDelete)),I.onUpdate&&(this.append(" on update "),this.append(I.onUpdate))}visitDropTable(I){this.append("drop table "),I.ifExists&&this.append("if exists "),this.visitNode(I.table),I.cascade&&this.append(" cascade")}visitDataType(I){this.append(I.dataType)}visitOrderBy(I){this.append("order by "),this.compileList(I.items)}visitOrderByItem(I){this.visitNode(I.orderBy),I.collation&&(this.append(" "),this.visitNode(I.collation)),I.direction&&(this.append(" "),this.visitNode(I.direction)),I.nulls&&(this.append(" nulls "),this.append(I.nulls))}visitGroupBy(I){this.append("group by "),this.compileList(I.items)}visitGroupByItem(I){this.visitNode(I.groupBy)}visitUpdateQuery(I){var rr;const B=this.nodeStack.find(QueryNode.is),tr=B!==I;if(!tr&&I.explain&&(this.visitNode(I.explain),this.append(" ")),tr&&!MergeQueryNode.is(B)&&this.append("("),I.with&&(this.visitNode(I.with),this.append(" ")),this.append("update "),I.top&&(this.visitNode(I.top),this.append(" ")),I.table&&(this.visitNode(I.table),this.append(" ")),this.append("set "),I.updates&&this.compileList(I.updates),I.output&&(this.append(" "),this.visitNode(I.output)),I.from&&(this.append(" "),this.visitNode(I.from)),I.joins){if(!I.from)throw new Error("Joins in an update query are only supported as a part of a PostgreSQL 'update set from join' query. If you want to create a MySQL 'update join set' query, see https://kysely.dev/docs/examples/update/my-sql-joins");this.append(" "),this.compileList(I.joins," ")}I.where&&(this.append(" "),this.visitNode(I.where)),I.orderBy&&(this.append(" "),this.visitNode(I.orderBy)),I.limit&&(this.append(" "),this.visitNode(I.limit)),I.returning&&(this.append(" "),this.visitNode(I.returning)),tr&&!MergeQueryNode.is(B)&&this.append(")"),(rr=I.endModifiers)!=null&&rr.length&&(this.append(" "),this.compileList(I.endModifiers," "))}visitColumnUpdate(I){this.visitNode(I.column),this.append(" = "),this.visitNode(I.value)}visitLimit(I){this.append("limit "),this.visitNode(I.limit)}visitOffset(I){this.append("offset "),this.visitNode(I.offset)}visitOnConflict(I){this.append("on conflict"),I.columns?(this.append(" ("),this.compileList(I.columns),this.append(")")):I.constraint?(this.append(" on constraint "),this.visitNode(I.constraint)):I.indexExpression&&(this.append(" ("),this.visitNode(I.indexExpression),this.append(")")),I.indexWhere&&(this.append(" "),this.visitNode(I.indexWhere)),I.doNothing===!0?this.append(" do nothing"):I.updates&&(this.append(" do update set "),this.compileList(I.updates),I.updateWhere&&(this.append(" "),this.visitNode(I.updateWhere)))}visitOnDuplicateKey(I){this.append("on duplicate key update "),this.compileList(I.updates)}visitCreateIndex(I){this.append("create "),I.unique&&this.append("unique "),this.append("index "),I.ifNotExists&&this.append("if not exists "),this.visitNode(I.name),I.table&&(this.append(" on "),this.visitNode(I.table)),I.using&&(this.append(" using "),this.visitNode(I.using)),I.columns&&(this.append(" ("),this.compileList(I.columns),this.append(")")),I.nullsNotDistinct&&this.append(" nulls not distinct"),I.where&&(this.append(" "),this.visitNode(I.where))}visitDropIndex(I){this.append("drop index "),I.ifExists&&this.append("if exists "),this.visitNode(I.name),I.table&&(this.append(" on "),this.visitNode(I.table)),I.cascade&&this.append(" cascade")}visitCreateSchema(I){this.append("create schema "),I.ifNotExists&&this.append("if not exists "),this.visitNode(I.schema)}visitDropSchema(I){this.append("drop schema "),I.ifExists&&this.append("if exists "),this.visitNode(I.schema),I.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(I){I.name&&(this.append("constraint "),this.visitNode(I.name),this.append(" ")),this.append("primary key ("),this.compileList(I.columns),this.append(")"),this.buildDeferrable(I)}buildDeferrable(I){I.deferrable!==void 0&&(I.deferrable?this.append(" deferrable"):this.append(" not deferrable")),I.initiallyDeferred!==void 0&&(I.initiallyDeferred?this.append(" initially deferred"):this.append(" initially immediate"))}visitUniqueConstraint(I){I.name&&(this.append("constraint "),this.visitNode(I.name),this.append(" ")),this.append("unique"),I.nullsNotDistinct&&this.append(" nulls not distinct"),this.append(" ("),this.compileList(I.columns),this.append(")"),this.buildDeferrable(I)}visitCheckConstraint(I){I.name&&(this.append("constraint "),this.visitNode(I.name),this.append(" ")),this.append("check ("),this.visitNode(I.expression),this.append(")")}visitForeignKeyConstraint(I){I.name&&(this.append("constraint "),this.visitNode(I.name),this.append(" ")),this.append("foreign key ("),this.compileList(I.columns),this.append(") "),this.visitNode(I.references),I.onDelete&&(this.append(" on delete "),this.append(I.onDelete)),I.onUpdate&&(this.append(" on update "),this.append(I.onUpdate)),this.buildDeferrable(I)}visitList(I){this.compileList(I.items)}visitWith(I){this.append("with "),I.recursive&&this.append("recursive "),this.compileList(I.expressions)}visitCommonTableExpression(I){this.visitNode(I.name),this.append(" as "),isBoolean(I.materialized)&&(I.materialized||this.append("not "),this.append("materialized ")),this.visitNode(I.expression)}visitCommonTableExpressionName(I){this.visitNode(I.table),I.columns&&(this.append("("),this.compileList(I.columns),this.append(")"))}visitAlterTable(I){this.append("alter table "),this.visitNode(I.table),this.append(" "),I.renameTo&&(this.append("rename to "),this.visitNode(I.renameTo)),I.setSchema&&(this.append("set schema "),this.visitNode(I.setSchema)),I.addConstraint&&this.visitNode(I.addConstraint),I.dropConstraint&&this.visitNode(I.dropConstraint),I.renameConstraint&&this.visitNode(I.renameConstraint),I.columnAlterations&&this.compileColumnAlterations(I.columnAlterations),I.addIndex&&this.visitNode(I.addIndex),I.dropIndex&&this.visitNode(I.dropIndex)}visitAddColumn(I){this.append("add column "),this.visitNode(I.column)}visitRenameColumn(I){this.append("rename column "),this.visitNode(I.column),this.append(" to "),this.visitNode(I.renameTo)}visitDropColumn(I){this.append("drop column "),this.visitNode(I.column)}visitAlterColumn(I){this.append("alter column "),this.visitNode(I.column),this.append(" "),I.dataType&&(this.announcesNewColumnDataType()&&this.append("type "),this.visitNode(I.dataType),I.dataTypeExpression&&(this.append("using "),this.visitNode(I.dataTypeExpression))),I.setDefault&&(this.append("set default "),this.visitNode(I.setDefault)),I.dropDefault&&this.append("drop default"),I.setNotNull&&this.append("set not null"),I.dropNotNull&&this.append("drop not null")}visitModifyColumn(I){this.append("modify column "),this.visitNode(I.column)}visitAddConstraint(I){this.append("add "),this.visitNode(I.constraint)}visitDropConstraint(I){this.append("drop constraint "),I.ifExists&&this.append("if exists "),this.visitNode(I.constraintName),I.modifier==="cascade"?this.append(" cascade"):I.modifier==="restrict"&&this.append(" restrict")}visitRenameConstraint(I){this.append("rename constraint "),this.visitNode(I.oldName),this.append(" to "),this.visitNode(I.newName)}visitSetOperation(I){this.append(I.operator),this.append(" "),I.all&&this.append("all "),this.visitNode(I.expression)}visitCreateView(I){this.append("create "),I.orReplace&&this.append("or replace "),I.materialized&&this.append("materialized "),I.temporary&&this.append("temporary "),this.append("view "),I.ifNotExists&&this.append("if not exists "),this.visitNode(I.name),this.append(" "),I.columns&&(this.append("("),this.compileList(I.columns),this.append(") ")),I.as&&(this.append("as "),this.visitNode(I.as))}visitRefreshMaterializedView(I){this.append("refresh materialized view "),I.concurrently&&this.append("concurrently "),this.visitNode(I.name),I.withNoData?this.append(" with no data"):this.append(" with data")}visitDropView(I){this.append("drop "),I.materialized&&this.append("materialized "),this.append("view "),I.ifExists&&this.append("if exists "),this.visitNode(I.name),I.cascade&&this.append(" cascade")}visitGenerated(I){this.append("generated "),I.always&&this.append("always "),I.byDefault&&this.append("by default "),this.append("as "),I.identity&&this.append("identity"),I.expression&&(this.append("("),this.visitNode(I.expression),this.append(")")),I.stored&&this.append(" stored")}visitDefaultValue(I){this.append("default "),this.visitNode(I.defaultValue)}visitSelectModifier(I){I.rawModifier?this.visitNode(I.rawModifier):this.append(SELECT_MODIFIER_SQL[I.modifier]),I.of&&(this.append(" of "),this.compileList(I.of,", "))}visitCreateType(I){this.append("create type "),this.visitNode(I.name),I.enum&&(this.append(" as enum "),this.visitNode(I.enum))}visitDropType(I){this.append("drop type "),I.ifExists&&this.append("if exists "),this.visitNode(I.name)}visitExplain(I){this.append("explain"),(I.options||I.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),I.options&&(this.visitNode(I.options),I.format&&this.append(this.getExplainOptionsDelimiter())),I.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(I.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(I){this.append("default")}visitAggregateFunction(I){this.append(I.func),this.append("("),I.distinct&&this.append("distinct "),this.compileList(I.aggregated),I.orderBy&&(this.append(" "),this.visitNode(I.orderBy)),this.append(")"),I.withinGroup&&(this.append(" within group ("),this.visitNode(I.withinGroup),this.append(")")),I.filter&&(this.append(" filter("),this.visitNode(I.filter),this.append(")")),I.over&&(this.append(" "),this.visitNode(I.over))}visitOver(I){this.append("over("),I.partitionBy&&(this.visitNode(I.partitionBy),I.orderBy&&this.append(" ")),I.orderBy&&this.visitNode(I.orderBy),this.append(")")}visitPartitionBy(I){this.append("partition by "),this.compileList(I.items)}visitPartitionByItem(I){this.visitNode(I.partitionBy)}visitBinaryOperation(I){this.visitNode(I.leftOperand),this.append(" "),this.visitNode(I.operator),this.append(" "),this.visitNode(I.rightOperand)}visitUnaryOperation(I){this.visitNode(I.operator),this.isMinusOperator(I.operator)||this.append(" "),this.visitNode(I.operand)}isMinusOperator(I){return OperatorNode.is(I)&&I.operator==="-"}visitUsing(I){this.append("using "),this.compileList(I.tables)}visitFunction(I){this.append(I.func),this.append("("),this.compileList(I.arguments),this.append(")")}visitCase(I){this.append("case"),I.value&&(this.append(" "),this.visitNode(I.value)),I.when&&(this.append(" "),this.compileList(I.when," ")),I.else&&(this.append(" else "),this.visitNode(I.else)),this.append(" end"),I.isStatement&&this.append(" case")}visitWhen(I){this.append("when "),this.visitNode(I.condition),I.result&&(this.append(" then "),this.visitNode(I.result))}visitJSONReference(I){this.visitNode(I.reference),this.visitNode(I.traversal)}visitJSONPath(I){I.inOperator&&this.visitNode(I.inOperator),this.append("'$");for(const B of I.pathLegs)this.visitNode(B);this.append("'")}visitJSONPathLeg(I){const B=I.type==="ArrayLocation";this.append(B?"[":"."),this.append(String(I.value)),B&&this.append("]")}visitJSONOperatorChain(I){for(let B=0,tr=I.values.length;B<tr;B++)B===tr-1?this.visitNode(I.operator):this.append("->"),this.visitNode(I.values[B])}visitMergeQuery(I){var B;I.with&&(this.visitNode(I.with),this.append(" ")),this.append("merge "),I.top&&(this.visitNode(I.top),this.append(" ")),this.append("into "),this.visitNode(I.into),I.using&&(this.append(" "),this.visitNode(I.using)),I.whens&&(this.append(" "),this.compileList(I.whens," ")),I.returning&&(this.append(" "),this.visitNode(I.returning)),I.output&&(this.append(" "),this.visitNode(I.output)),(B=I.endModifiers)!=null&&B.length&&(this.append(" "),this.compileList(I.endModifiers," "))}visitMatched(I){I.not&&this.append("not "),this.append("matched"),I.bySource&&this.append(" by source")}visitAddIndex(I){this.append("add "),I.unique&&this.append("unique "),this.append("index "),this.visitNode(I.name),I.columns&&(this.append(" ("),this.compileList(I.columns),this.append(")")),I.using&&(this.append(" using "),this.visitNode(I.using))}visitCast(I){this.append("cast("),this.visitNode(I.expression),this.append(" as "),this.visitNode(I.dataType),this.append(")")}visitFetch(I){this.append("fetch next "),this.visitNode(I.rowCount),this.append(` rows ${I.modifier}`)}visitOutput(I){this.append("output "),this.compileList(I.selections)}visitTop(I){this.append(`top(${I.expression})`),I.modifiers&&this.append(` ${I.modifiers}`)}visitOrAction(I){this.append(I.action)}visitCollate(I){this.append("collate "),this.visitNode(I.collation)}append(I){yi(this,Fo,gr(this,Fo)+I)}appendValue(I){this.addParameter(I),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(I){const B=this.getLeftIdentifierWrapper(),tr=this.getRightIdentifierWrapper();let rr="";for(const ir of I)rr+=ir,ir===B?rr+=B:ir===tr&&(rr+=tr);return rr}sanitizeStringLiteral(I){return I.replace(LIT_WRAP_REGEX,"''")}addParameter(I){gr(this,uo).push(I)}appendImmediateValue(I){if(isString(I))this.appendStringLiteral(I);else if(isNumber(I)||isBoolean(I))this.append(I.toString());else if(isNull(I))this.append("null");else if(isDate(I))this.appendImmediateValue(I.toISOString());else if(isBigInt(I))this.appendImmediateValue(I.toString());else throw new Error(`invalid immediate value ${I}`)}appendStringLiteral(I){this.append("'"),this.append(this.sanitizeStringLiteral(I)),this.append("'")}sortSelectModifiers(I){return I.sort((B,tr)=>B.modifier&&tr.modifier?SELECT_MODIFIER_PRIORITY[B.modifier]-SELECT_MODIFIER_PRIORITY[tr.modifier]:1),freeze(I)}compileColumnAlterations(I){this.compileList(I)}announcesNewColumnDataType(){return!0}}Fo=new WeakMap,uo=new WeakMap;const SELECT_MODIFIER_SQL=freeze({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),SELECT_MODIFIER_PRIORITY=freeze({ForKeyShare:1,ForNoKeyUpdate:1,ForUpdate:1,ForShare:1,NoWait:2,SkipLocked:2,Distinct:0}),JOIN_TYPE_SQL=freeze({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",CrossJoin:"cross join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral",LateralCrossJoin:"cross join lateral",OuterApply:"outer apply",CrossApply:"cross apply",Using:"using"}),CompiledQuery=freeze({raw(e,t=[]){return freeze({sql:e,query:RawNode.createWithSql(e),parameters:freeze(t),queryId:createQueryId()})}});class DialectAdapterBase{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}get supportsOutput(){return!1}}const DEFAULT_MIGRATION_TABLE="kysely_migration",DEFAULT_MIGRATION_LOCK_TABLE="kysely_migration_lock";freeze({__noMigrations__:!0});const ID_WRAP_REGEX=/"/g;class PostgresQueryCompiler extends DefaultQueryCompiler{sanitizeIdentifier(t){return t.replace(ID_WRAP_REGEX,'""')}}var Do,Nl,su;class PostgresIntrospector{constructor(t){_i(this,Nl);_i(this,Do);yi(this,Do,t)}async getSchemas(){return(await gr(this,Do).selectFrom("pg_catalog.pg_namespace").select("nspname").$castTo().execute()).map(I=>({name:I.nspname}))}async getTables(t={withInternalKyselyTables:!1}){let I=gr(this,Do).selectFrom("pg_catalog.pg_attribute as a").innerJoin("pg_catalog.pg_class as c","a.attrelid","c.oid").innerJoin("pg_catalog.pg_namespace as ns","c.relnamespace","ns.oid").innerJoin("pg_catalog.pg_type as typ","a.atttypid","typ.oid").innerJoin("pg_catalog.pg_namespace as dtns","typ.typnamespace","dtns.oid").select(["a.attname as column","a.attnotnull as not_null","a.atthasdef as has_default","c.relname as table","c.relkind as table_type","ns.nspname as schema","typ.typname as type","dtns.nspname as type_schema",sql`col_description(a.attrelid, a.attnum)`.as("column_description"),sql`pg_get_serial_sequence(quote_ident(ns.nspname) || '.' || quote_ident(c.relname), a.attname)`.as("auto_incrementing")]).where("c.relkind","in",["r","v","p"]).where("ns.nspname","!~","^pg_").where("ns.nspname","!=","information_schema").where("a.attnum",">=",0).where("a.attisdropped","!=",!0).orderBy("ns.nspname").orderBy("c.relname").orderBy("a.attnum").$castTo();t.withInternalKyselyTables||(I=I.where("c.relname","!=",DEFAULT_MIGRATION_TABLE).where("c.relname","!=",DEFAULT_MIGRATION_LOCK_TABLE));const B=await I.execute();return Ai(this,Nl,su).call(this,B)}async getMetadata(t){return{tables:await this.getTables(t)}}}Do=new WeakMap,Nl=new WeakSet,su=function(t){return t.reduce((I,B)=>{let tr=I.find(rr=>rr.name===B.table&&rr.schema===B.schema);return tr||(tr=freeze({name:B.table,isView:B.table_type==="v",schema:B.schema,columns:[]}),I.push(tr)),tr.columns.push(freeze({name:B.column,dataType:B.type,dataTypeSchema:B.type_schema,isNullable:!B.not_null,isAutoIncrementing:B.auto_incrementing!==null,hasDefaultValue:B.has_default,comment:B.column_description??void 0})),I},[])};const LOCK_ID=BigInt("3853314791062309107");class PostgresAdapter extends DialectAdapterBase{get supportsTransactionalDdl(){return!0}get supportsReturning(){return!0}async acquireMigrationLock(t,I){await sql`select pg_advisory_xact_lock(${sql.lit(LOCK_ID)})`.execute(t)}async releaseMigrationLock(t,I){}}var PGliteConnection=class{constructor(e){ji(this,"client");this.client=e}async executeQuery(e){const t=await this.client.query(e.sql,[...e.parameters]);return t.affectedRows?{numAffectedRows:BigInt(t.affectedRows),rows:t.rows}:{rows:t.rows}}async*streamQuery(e,t){throw new Error("PGLite Driver does not support streaming")}},PGliteDialect=class{constructor(e){this.pgLite=e}createAdapter(){return new PostgresAdapter}createDriver(){return new PGliteDriver(this.pgLite)}createQueryCompiler(){return new PostgresQueryCompiler}createIntrospector(e){return new PostgresIntrospector(e)}},PGliteDriver=class{constructor(e){ji(this,"client");ji(this,"connection");ji(this,"queue",[]);this.client=e}async init(){}async acquireConnection(){if(this.client===void 0)throw new Error("PGLite not initialized");return this.connection!==void 0?new Promise(e=>{this.queue.push(e)}):(this.connection=new PGliteConnection(this.client),this.connection)}async releaseConnection(e){if(e!==this.connection)throw new Error("Invalid connection");const I=this.queue.splice(0,1)[0];if(I===void 0){this.connection=void 0;return}I(this.connection)}async beginTransaction(e,t){t.isolationLevel?await e.executeQuery(CompiledQuery.raw(`start transaction isolation level ${t.isolationLevel}`)):await e.executeQuery(CompiledQuery.raw("begin"))}async commitTransaction(e){await e.executeQuery(CompiledQuery.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(CompiledQuery.raw("rollback"))}async destroy(){this.client=void 0}};function createRelationalDbWithLive(e){const t=new Kysely({dialect:new PGliteDialect(e)}),B=createRelationalDb(t);return B.live=e.live,B}const useRelationalDb=()=>{const e=usePGliteDB();return useMemo(()=>!e.db||e.isLoading||e.error?{db:null,isLoading:e.isLoading,error:e.error}:{db:createRelationalDbWithLive(e.db),isLoading:!1,error:null},[e])};function getProcessorsFromModules(e){return e.map(t=>({packageName:t.manifest.name,processors:t.processors})).reduce((t,I)=>(I.processors&&(t=[...t,{packageName:I.packageName,processors:I.processors}]),t),[])}const externalProcessorsAtom=atom(async e=>{const t=await e(externalPackagesAtom);return getProcessorsFromModules(t)}),useExternalProcessors=()=>useAtomValue$1(externalProcessorsAtom),logger$1=childLogger(["reactor-analytics"]);function createPgLiteFactoryWorker(e){return async()=>{const t=(await __vitePreload(async()=>{const{default:rr}=await import("./pglite-worker.dssW4LQw.js");return{default:rr}},[],import.meta.url)).default,{PGliteWorker:I}=await __vitePreload(async()=>{const{PGliteWorker:rr}=await import("./index.hUDcoha1.js");return{PGliteWorker:rr}},__vite__mapDeps([9,1,2,3,4,5,6,7]),import.meta.url),B=new t({name:"pglite-worker"});B.onmessage=rr=>{logger$1.verbose(rr.data)},B.onerror=rr=>{throw logger$1.error(rr.message),rr.error};const tr=new I(B,{meta:{databaseName:e},extensions:{live:j}});return await tr.waitReady,tr}}async function registerExternalProcessors(e,t,I,B,tr){return await e.registerFactory(B,tr({analyticsStore:t,relationalDb:I}))}async function registerDiffAnalyzer(e,t){const{processorFactory:I}=await __vitePreload(async()=>{const{processorFactory:B}=await import("./index.TIUvoczv.js");return{processorFactory:B}},__vite__mapDeps([10,2,1,3,4,5,6,7]),import.meta.url);return await e.registerFactory("@powerhousedao/diff-analyzer",I({analyticsStore:t}))}async function registerDriveAnalytics(e,t){const{processorFactory:I}=await __vitePreload(async()=>{const{processorFactory:B}=await import("./index.ycvKRDCc.js");return{processorFactory:B}},__vite__mapDeps([11,2,1,3,4,5,6,7]),import.meta.url);return await e.registerFactory("@powerhousedao/common/drive-analytics",I({analyticsStore:t}))}function DiffAnalyzerProcessor(){const e=useAnalyticsStoreAsync(),t=useProcessorManager(),I=useRef(!1);return useEffect(()=>{!e.data||!t||I.current||(I.current=!0,registerDiffAnalyzer(t,e.data).catch(logger$1.error))},[e.data,t]),null}function DriveAnalyticsProcessor(){const e=useAnalyticsStoreAsync(),t=useProcessorManager(),I=useRef(!1);return useEffect(()=>{!e.data||!t||I.current||(I.current=!0,registerDriveAnalytics(t,e.data).then(()=>{logger$1.verbose("Drive analytics processor registered")}).catch(logger$1.error))},[e.data,t]),null}function ExternalProcessors(){const e=useExternalProcessors(),t=useAnalyticsStoreAsync(),I=useRelationalDb(),B=useProcessorManager(),tr=useRef(!1);return useEffect(()=>{if(!t.data||!B||tr.current||e.length===0||!I.db)return;tr.current=!0;let rr=0;for(const{packageName:ir,processors:lr}of e)registerExternalProcessors(B,t.data,I.db,`${ir}-${rr}`,lr).catch(logger$1.error),rr++},[t.data,B,I]),null}function ProcessorManagerProvider({children:e}){const t=config.analytics.useWorker?createPgLiteFactoryWorker(config.analytics.databaseName):void 0,I=useSetPGliteDB();useEffect(()=>{if(!t){I({db:null,isLoading:!1,error:null});return}t().then(tr=>{I({db:tr,isLoading:!1,error:null})}).catch(tr=>{const rr=tr instanceof Error?tr:new Error(String(tr));I({db:null,isLoading:!1,error:rr})})},[]);const B=jsxs(Fragment,{children:[config.analytics.diffProcessorEnabled&&jsx(DiffAnalyzerProcessor,{}),config.analytics.driveAnalyticsEnabled&&jsx(DriveAnalyticsProcessor,{}),config.analytics.externalProcessorsEnabled&&jsx(ExternalProcessors,{}),e]});return jsx(AnalyticsProvider,{options:{databaseName:config.analytics.databaseName,pgLiteFactory:t},children:B})}/**
|
|
340
|
-
* @remix-run/router v1.23.0
|
|
341
|
-
*
|
|
342
|
-
* Copyright (c) Remix Software Inc.
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the MIT license found in the
|
|
345
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
346
|
-
*
|
|
347
|
-
* @license MIT
|
|
348
|
-
*/function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var I=arguments[t];for(var B in I)Object.prototype.hasOwnProperty.call(I,B)&&(e[B]=I[B])}return e},_extends$2.apply(this,arguments)}var Action;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Action||(Action={}));const PopStateEventType="popstate";function createBrowserHistory(e){e===void 0&&(e={});function t(B,tr){let{pathname:rr,search:ir,hash:lr}=B.location;return createLocation("",{pathname:rr,search:ir,hash:lr},tr.state&&tr.state.usr||null,tr.state&&tr.state.key||"default")}function I(B,tr){return typeof tr=="string"?tr:createPath(tr)}return getUrlBasedHistory(t,I,null,e)}function invariant(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function warning(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(e,t){return{usr:e.state,key:e.key,idx:t}}function createLocation(e,t,I,B){return I===void 0&&(I=null),_extends$2({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?parsePath(t):t,{state:I,key:t&&t.key||B||createKey()})}function createPath(e){let{pathname:t="/",search:I="",hash:B=""}=e;return I&&I!=="?"&&(t+=I.charAt(0)==="?"?I:"?"+I),B&&B!=="#"&&(t+=B.charAt(0)==="#"?B:"#"+B),t}function parsePath(e){let t={};if(e){let I=e.indexOf("#");I>=0&&(t.hash=e.substr(I),e=e.substr(0,I));let B=e.indexOf("?");B>=0&&(t.search=e.substr(B),e=e.substr(0,B)),e&&(t.pathname=e)}return t}function getUrlBasedHistory(e,t,I,B){B===void 0&&(B={});let{window:tr=document.defaultView,v5Compat:rr=!1}=B,ir=tr.history,lr=Action.Pop,dr=null,hr=fr();hr==null&&(hr=0,ir.replaceState(_extends$2({},ir.state,{idx:hr}),""));function fr(){return(ir.state||{idx:null}).idx}function mr(){lr=Action.Pop;let vr=fr(),Sr=vr==null?null:vr-hr;hr=vr,dr&&dr({action:lr,location:Mr.location,delta:Sr})}function _r(vr,Sr){lr=Action.Push;let wr=createLocation(Mr.location,vr,Sr);hr=fr()+1;let br=getHistoryState(wr,hr),Ar=Mr.createHref(wr);try{ir.pushState(br,"",Ar)}catch(kr){if(kr instanceof DOMException&&kr.name==="DataCloneError")throw kr;tr.location.assign(Ar)}rr&&dr&&dr({action:lr,location:Mr.location,delta:1})}function yr(vr,Sr){lr=Action.Replace;let wr=createLocation(Mr.location,vr,Sr);hr=fr();let br=getHistoryState(wr,hr),Ar=Mr.createHref(wr);ir.replaceState(br,"",Ar),rr&&dr&&dr({action:lr,location:Mr.location,delta:0})}function xr(vr){let Sr=tr.location.origin!=="null"?tr.location.origin:tr.location.href,wr=typeof vr=="string"?vr:createPath(vr);return wr=wr.replace(/ $/,"%20"),invariant(Sr,"No window.location.(origin|href) available to create URL for href: "+wr),new URL(wr,Sr)}let Mr={get action(){return lr},get location(){return e(tr,ir)},listen(vr){if(dr)throw new Error("A history only accepts one active listener");return tr.addEventListener(PopStateEventType,mr),dr=vr,()=>{tr.removeEventListener(PopStateEventType,mr),dr=null}},createHref(vr){return t(tr,vr)},createURL:xr,encodeLocation(vr){let Sr=xr(vr);return{pathname:Sr.pathname,search:Sr.search,hash:Sr.hash}},push:_r,replace:yr,go(vr){return ir.go(vr)}};return Mr}var ResultType;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ResultType||(ResultType={}));const immutableRouteKeys=new Set(["lazy","caseSensitive","path","id","index","children"]);function isIndexRoute(e){return e.index===!0}function convertRoutesToDataRoutes(e,t,I,B){return I===void 0&&(I=[]),B===void 0&&(B={}),e.map((tr,rr)=>{let ir=[...I,String(rr)],lr=typeof tr.id=="string"?tr.id:ir.join("-");if(invariant(tr.index!==!0||!tr.children,"Cannot specify children on an index route"),invariant(!B[lr],'Found a route id collision on id "'+lr+`". Route id's must be globally unique within Data Router usages`),isIndexRoute(tr)){let dr=_extends$2({},tr,t(tr),{id:lr});return B[lr]=dr,dr}else{let dr=_extends$2({},tr,t(tr),{id:lr,children:void 0});return B[lr]=dr,tr.children&&(dr.children=convertRoutesToDataRoutes(tr.children,t,ir,B)),dr}})}function matchRoutes(e,t,I){return I===void 0&&(I="/"),matchRoutesImpl(e,t,I,!1)}function matchRoutesImpl(e,t,I,B){let tr=typeof t=="string"?parsePath(t):t,rr=stripBasename(tr.pathname||"/",I);if(rr==null)return null;let ir=flattenRoutes(e);rankRouteBranches(ir);let lr=null;for(let dr=0;lr==null&&dr<ir.length;++dr){let hr=decodePath(rr);lr=matchRouteBranch(ir[dr],hr,B)}return lr}function convertRouteMatchToUiMatch(e,t){let{route:I,pathname:B,params:tr}=e;return{id:I.id,pathname:B,params:tr,data:t[I.id],handle:I.handle}}function flattenRoutes(e,t,I,B){t===void 0&&(t=[]),I===void 0&&(I=[]),B===void 0&&(B="");let tr=(rr,ir,lr)=>{let dr={relativePath:lr===void 0?rr.path||"":lr,caseSensitive:rr.caseSensitive===!0,childrenIndex:ir,route:rr};dr.relativePath.startsWith("/")&&(invariant(dr.relativePath.startsWith(B),'Absolute route path "'+dr.relativePath+'" nested under path '+('"'+B+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),dr.relativePath=dr.relativePath.slice(B.length));let hr=joinPaths([B,dr.relativePath]),fr=I.concat(dr);rr.children&&rr.children.length>0&&(invariant(rr.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+hr+'".')),flattenRoutes(rr.children,t,fr,hr)),!(rr.path==null&&!rr.index)&&t.push({path:hr,score:computeScore(hr,rr.index),routesMeta:fr})};return e.forEach((rr,ir)=>{var lr;if(rr.path===""||!((lr=rr.path)!=null&&lr.includes("?")))tr(rr,ir);else for(let dr of explodeOptionalSegments(rr.path))tr(rr,ir,dr)}),t}function explodeOptionalSegments(e){let t=e.split("/");if(t.length===0)return[];let[I,...B]=t,tr=I.endsWith("?"),rr=I.replace(/\?$/,"");if(B.length===0)return tr?[rr,""]:[rr];let ir=explodeOptionalSegments(B.join("/")),lr=[];return lr.push(...ir.map(dr=>dr===""?rr:[rr,dr].join("/"))),tr&&lr.push(...ir),lr.map(dr=>e.startsWith("/")&&dr===""?"/":dr)}function rankRouteBranches(e){e.sort((t,I)=>t.score!==I.score?I.score-t.score:compareIndexes(t.routesMeta.map(B=>B.childrenIndex),I.routesMeta.map(B=>B.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=e=>e==="*";function computeScore(e,t){let I=e.split("/"),B=I.length;return I.some(isSplat)&&(B+=splatPenalty),t&&(B+=indexRouteValue),I.filter(tr=>!isSplat(tr)).reduce((tr,rr)=>tr+(paramRe.test(rr)?dynamicSegmentValue:rr===""?emptySegmentValue:staticSegmentValue),B)}function compareIndexes(e,t){return e.length===t.length&&e.slice(0,-1).every((B,tr)=>B===t[tr])?e[e.length-1]-t[t.length-1]:0}function matchRouteBranch(e,t,I){I===void 0&&(I=!1);let{routesMeta:B}=e,tr={},rr="/",ir=[];for(let lr=0;lr<B.length;++lr){let dr=B[lr],hr=lr===B.length-1,fr=rr==="/"?t:t.slice(rr.length)||"/",mr=matchPath({path:dr.relativePath,caseSensitive:dr.caseSensitive,end:hr},fr),_r=dr.route;if(!mr&&hr&&I&&!B[B.length-1].route.index&&(mr=matchPath({path:dr.relativePath,caseSensitive:dr.caseSensitive,end:!1},fr)),!mr)return null;Object.assign(tr,mr.params),ir.push({params:tr,pathname:joinPaths([rr,mr.pathname]),pathnameBase:normalizePathname(joinPaths([rr,mr.pathnameBase])),route:_r}),mr.pathnameBase!=="/"&&(rr=joinPaths([rr,mr.pathnameBase]))}return ir}function matchPath(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[I,B]=compilePath(e.path,e.caseSensitive,e.end),tr=t.match(I);if(!tr)return null;let rr=tr[0],ir=rr.replace(/(.)\/+$/,"$1"),lr=tr.slice(1);return{params:B.reduce((hr,fr,mr)=>{let{paramName:_r,isOptional:yr}=fr;if(_r==="*"){let Mr=lr[mr]||"";ir=rr.slice(0,rr.length-Mr.length).replace(/(.)\/+$/,"$1")}const xr=lr[mr];return yr&&!xr?hr[_r]=void 0:hr[_r]=(xr||"").replace(/%2F/g,"/"),hr},{}),pathname:rr,pathnameBase:ir,pattern:e}}function compilePath(e,t,I){t===void 0&&(t=!1),I===void 0&&(I=!0),warning(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let B=[],tr="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(ir,lr,dr)=>(B.push({paramName:lr,isOptional:dr!=null}),dr?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(B.push({paramName:"*"}),tr+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):I?tr+="\\/*$":e!==""&&e!=="/"&&(tr+="(?:(?=\\/|$))"),[new RegExp(tr,t?void 0:"i"),B]}function decodePath(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return warning(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function stripBasename(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let I=t.endsWith("/")?t.length-1:t.length,B=e.charAt(I);return B&&B!=="/"?null:e.slice(I)||"/"}function resolvePath(e,t){t===void 0&&(t="/");let{pathname:I,search:B="",hash:tr=""}=typeof e=="string"?parsePath(e):e;return{pathname:I?I.startsWith("/")?I:resolvePathname(I,t):t,search:normalizeSearch(B),hash:normalizeHash(tr)}}function resolvePathname(e,t){let I=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(tr=>{tr===".."?I.length>1&&I.pop():tr!=="."&&I.push(tr)}),I.length>1?I.join("/"):"/"}function getInvalidPathError(e,t,I,B){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(B)+"]. Please separate it out to the ")+("`to."+I+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function getPathContributingMatches(e){return e.filter((t,I)=>I===0||t.route.path&&t.route.path.length>0)}function getResolveToMatches(e,t){let I=getPathContributingMatches(e);return t?I.map((B,tr)=>tr===I.length-1?B.pathname:B.pathnameBase):I.map(B=>B.pathnameBase)}function resolveTo(e,t,I,B){B===void 0&&(B=!1);let tr;typeof e=="string"?tr=parsePath(e):(tr=_extends$2({},e),invariant(!tr.pathname||!tr.pathname.includes("?"),getInvalidPathError("?","pathname","search",tr)),invariant(!tr.pathname||!tr.pathname.includes("#"),getInvalidPathError("#","pathname","hash",tr)),invariant(!tr.search||!tr.search.includes("#"),getInvalidPathError("#","search","hash",tr)));let rr=e===""||tr.pathname==="",ir=rr?"/":tr.pathname,lr;if(ir==null)lr=I;else{let mr=t.length-1;if(!B&&ir.startsWith("..")){let _r=ir.split("/");for(;_r[0]==="..";)_r.shift(),mr-=1;tr.pathname=_r.join("/")}lr=mr>=0?t[mr]:"/"}let dr=resolvePath(tr,lr),hr=ir&&ir!=="/"&&ir.endsWith("/"),fr=(rr||ir===".")&&I.endsWith("/");return!dr.pathname.endsWith("/")&&(hr||fr)&&(dr.pathname+="/"),dr}const joinPaths=e=>e.join("/").replace(/\/\/+/g,"/"),normalizePathname=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,normalizeHash=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class ErrorResponseImpl{constructor(t,I,B,tr){tr===void 0&&(tr=!1),this.status=t,this.statusText=I||"",this.internal=tr,B instanceof Error?(this.data=B.toString(),this.error=B):this.data=B}}function isRouteErrorResponse(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const validMutationMethodsArr=["post","put","patch","delete"],validMutationMethods=new Set(validMutationMethodsArr),validRequestMethodsArr=["get",...validMutationMethodsArr],validRequestMethods=new Set(validRequestMethodsArr),redirectStatusCodes=new Set([301,302,303,307,308]),redirectPreserveMethodStatusCodes=new Set([307,308]),IDLE_NAVIGATION={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},IDLE_FETCHER={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},IDLE_BLOCKER={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,defaultMapRouteProperties=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),TRANSITIONS_STORAGE_KEY="remix-router-transitions";function createRouter$1(e){const t=e.window?e.window:typeof window<"u"?window:void 0,I=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",B=!I;invariant(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let tr;if(e.mapRouteProperties)tr=e.mapRouteProperties;else if(e.detectErrorBoundary){let Zn=e.detectErrorBoundary;tr=si=>({hasErrorBoundary:Zn(si)})}else tr=defaultMapRouteProperties;let rr={},ir=convertRoutesToDataRoutes(e.routes,tr,void 0,rr),lr,dr=e.basename||"/",hr=e.dataStrategy||defaultDataStrategy,fr=e.patchRoutesOnNavigation,mr=_extends$2({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),_r=null,yr=new Set,xr=null,Mr=null,vr=null,Sr=e.hydrationData!=null,wr=matchRoutes(ir,e.history.location,dr),br=!1,Ar=null;if(wr==null&&!fr){let Zn=getInternalRouterError(404,{pathname:e.history.location.pathname}),{matches:si,route:ui}=getShortCircuitMatches(ir);wr=si,Ar={[ui.id]:Zn}}wr&&!e.hydrationData&&ll(wr,ir,e.history.location.pathname).active&&(wr=null);let kr;if(wr)if(wr.some(Zn=>Zn.route.lazy))kr=!1;else if(!wr.some(Zn=>Zn.route.loader))kr=!0;else if(mr.v7_partialHydration){let Zn=e.hydrationData?e.hydrationData.loaderData:null,si=e.hydrationData?e.hydrationData.errors:null;if(si){let ui=wr.findIndex(bi=>si[bi.route.id]!==void 0);kr=wr.slice(0,ui+1).every(bi=>!shouldLoadRouteOnHydration(bi.route,Zn,si))}else kr=wr.every(ui=>!shouldLoadRouteOnHydration(ui.route,Zn,si))}else kr=e.hydrationData!=null;else if(kr=!1,wr=[],mr.v7_partialHydration){let Zn=ll(null,ir,e.history.location.pathname);Zn.active&&Zn.matches&&(br=!0,wr=Zn.matches)}let Dr,Or={historyAction:e.history.action,location:e.history.location,matches:wr,initialized:kr,navigation:IDLE_NAVIGATION,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||Ar,fetchers:new Map,blockers:new Map},zr=Action.Pop,$n=!1,Fr,$r=!1,Hn=new Map,ti=null,Ir=!1,Lr=!1,Kn=[],pi=new Set,gi=new Map,oi=0,qn=-1,li=new Map,di=new Set,Jn=new Map,Qr=new Map,Jr=new Set,ei=new Map,mi=new Map,ci;function ai(){if(_r=e.history.listen(Zn=>{let{action:si,location:ui,delta:bi}=Zn;if(ci){ci(),ci=void 0;return}warning(mi.size===0||bi!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let qi=Vl({currentLocation:Or.location,nextLocation:ui,historyAction:si});if(qi&&bi!=null){let ki=new Promise(Li=>{ci=Li});e.history.go(bi*-1),aa(qi,{state:"blocked",location:ui,proceed(){aa(qi,{state:"proceeding",proceed:void 0,reset:void 0,location:ui}),ki.then(()=>e.history.go(bi))},reset(){let Li=new Map(Or.blockers);Li.set(qi,IDLE_BLOCKER),xi({blockers:Li})}});return}return $i(si,ui)}),I){restoreAppliedTransitions(t,Hn);let Zn=()=>persistAppliedTransitions(t,Hn);t.addEventListener("pagehide",Zn),ti=()=>t.removeEventListener("pagehide",Zn)}return Or.initialized||$i(Action.Pop,Or.location,{initialHydration:!0}),Dr}function fi(){_r&&_r(),ti&&ti(),yr.clear(),Fr&&Fr.abort(),Or.fetchers.forEach((Zn,si)=>Wi(si)),Or.blockers.forEach((Zn,si)=>Qs(si))}function vi(Zn){return yr.add(Zn),()=>yr.delete(Zn)}function xi(Zn,si){si===void 0&&(si={}),Or=_extends$2({},Or,Zn);let ui=[],bi=[];mr.v7_fetcherPersist&&Or.fetchers.forEach((qi,ki)=>{qi.state==="idle"&&(Jr.has(ki)?bi.push(ki):ui.push(ki))}),Jr.forEach(qi=>{!Or.fetchers.has(qi)&&!gi.has(qi)&&bi.push(qi)}),[...yr].forEach(qi=>qi(Or,{deletedFetchers:bi,viewTransitionOpts:si.viewTransitionOpts,flushSync:si.flushSync===!0})),mr.v7_fetcherPersist?(ui.forEach(qi=>Or.fetchers.delete(qi)),bi.forEach(qi=>Wi(qi))):bi.forEach(qi=>Jr.delete(qi))}function Ci(Zn,si,ui){var bi,qi;let{flushSync:ki}=ui===void 0?{}:ui,Li=Or.actionData!=null&&Or.navigation.formMethod!=null&&isMutationMethod(Or.navigation.formMethod)&&Or.navigation.state==="loading"&&((bi=Zn.state)==null?void 0:bi._isRedirect)!==!0,Ri;si.actionData?Object.keys(si.actionData).length>0?Ri=si.actionData:Ri=null:Li?Ri=Or.actionData:Ri=null;let Ii=si.loaderData?mergeLoaderData(Or.loaderData,si.loaderData,si.matches||[],si.errors):Or.loaderData,Ni=Or.blockers;Ni.size>0&&(Ni=new Map(Ni),Ni.forEach((Gi,Ts)=>Ni.set(Ts,IDLE_BLOCKER)));let Pi=$n===!0||Or.navigation.formMethod!=null&&isMutationMethod(Or.navigation.formMethod)&&((qi=Zn.state)==null?void 0:qi._isRedirect)!==!0;lr&&(ir=lr,lr=void 0),Ir||zr===Action.Pop||(zr===Action.Push?e.history.push(Zn,Zn.state):zr===Action.Replace&&e.history.replace(Zn,Zn.state));let zi;if(zr===Action.Pop){let Gi=Hn.get(Or.location.pathname);Gi&&Gi.has(Zn.pathname)?zi={currentLocation:Or.location,nextLocation:Zn}:Hn.has(Zn.pathname)&&(zi={currentLocation:Zn,nextLocation:Or.location})}else if($r){let Gi=Hn.get(Or.location.pathname);Gi?Gi.add(Zn.pathname):(Gi=new Set([Zn.pathname]),Hn.set(Or.location.pathname,Gi)),zi={currentLocation:Or.location,nextLocation:Zn}}xi(_extends$2({},si,{actionData:Ri,loaderData:Ii,historyAction:zr,location:Zn,initialized:!0,navigation:IDLE_NAVIGATION,revalidation:"idle",restoreScrollPosition:Ql(Zn,si.matches||Or.matches),preventScrollReset:Pi,blockers:Ni}),{viewTransitionOpts:zi,flushSync:ki===!0}),zr=Action.Pop,$n=!1,$r=!1,Ir=!1,Lr=!1,Kn=[]}async function Yn(Zn,si){if(typeof Zn=="number"){e.history.go(Zn);return}let ui=normalizeTo(Or.location,Or.matches,dr,mr.v7_prependBasename,Zn,mr.v7_relativeSplatPath,si==null?void 0:si.fromRouteId,si==null?void 0:si.relative),{path:bi,submission:qi,error:ki}=normalizeNavigateOptions(mr.v7_normalizeFormMethod,!1,ui,si),Li=Or.location,Ri=createLocation(Or.location,bi,si&&si.state);Ri=_extends$2({},Ri,e.history.encodeLocation(Ri));let Ii=si&&si.replace!=null?si.replace:void 0,Ni=Action.Push;Ii===!0?Ni=Action.Replace:Ii===!1||qi!=null&&isMutationMethod(qi.formMethod)&&qi.formAction===Or.location.pathname+Or.location.search&&(Ni=Action.Replace);let Pi=si&&"preventScrollReset"in si?si.preventScrollReset===!0:void 0,zi=(si&&si.flushSync)===!0,Gi=Vl({currentLocation:Li,nextLocation:Ri,historyAction:Ni});if(Gi){aa(Gi,{state:"blocked",location:Ri,proceed(){aa(Gi,{state:"proceeding",proceed:void 0,reset:void 0,location:Ri}),Yn(Zn,si)},reset(){let Ts=new Map(Or.blockers);Ts.set(Gi,IDLE_BLOCKER),xi({blockers:Ts})}});return}return await $i(Ni,Ri,{submission:qi,pendingError:ki,preventScrollReset:Pi,replace:si&&si.replace,enableViewTransition:si&&si.viewTransition,flushSync:zi})}function ii(){if(Mi(),xi({revalidation:"loading"}),Or.navigation.state!=="submitting"){if(Or.navigation.state==="idle"){$i(Or.historyAction,Or.location,{startUninterruptedRevalidation:!0});return}$i(zr||Or.historyAction,Or.navigation.location,{overrideNavigation:Or.navigation,enableViewTransition:$r===!0})}}async function $i(Zn,si,ui){Fr&&Fr.abort(),Fr=null,zr=Zn,Ir=(ui&&ui.startUninterruptedRevalidation)===!0,ou(Or.location,Or.matches),$n=(ui&&ui.preventScrollReset)===!0,$r=(ui&&ui.enableViewTransition)===!0;let bi=lr||ir,qi=ui&&ui.overrideNavigation,ki=ui!=null&&ui.initialHydration&&Or.matches&&Or.matches.length>0&&!br?Or.matches:matchRoutes(bi,si,dr),Li=(ui&&ui.flushSync)===!0;if(ki&&Or.initialized&&!Lr&&isHashChangeOnly(Or.location,si)&&!(ui&&ui.submission&&isMutationMethod(ui.submission.formMethod))){Ci(si,{matches:ki},{flushSync:Li});return}let Ri=ll(ki,bi,si.pathname);if(Ri.active&&Ri.matches&&(ki=Ri.matches),!ki){let{error:ls,notFoundMatches:Zi,route:bs}=Al(si.pathname);Ci(si,{matches:Zi,loaderData:{},errors:{[bs.id]:ls}},{flushSync:Li});return}Fr=new AbortController;let Ii=createClientSideRequest(e.history,si,Fr.signal,ui&&ui.submission),Ni;if(ui&&ui.pendingError)Ni=[findNearestBoundary(ki).route.id,{type:ResultType.error,error:ui.pendingError}];else if(ui&&ui.submission&&isMutationMethod(ui.submission.formMethod)){let ls=await Ti(Ii,si,ui.submission,ki,Ri.active,{replace:ui.replace,flushSync:Li});if(ls.shortCircuited)return;if(ls.pendingActionResult){let[Zi,bs]=ls.pendingActionResult;if(isErrorResult(bs)&&isRouteErrorResponse(bs.error)&&bs.error.status===404){Fr=null,Ci(si,{matches:ls.matches,loaderData:{},errors:{[Zi]:bs.error}});return}}ki=ls.matches||ki,Ni=ls.pendingActionResult,qi=getLoadingNavigation(si,ui.submission),Li=!1,Ri.active=!1,Ii=createClientSideRequest(e.history,Ii.url,Ii.signal)}let{shortCircuited:Pi,matches:zi,loaderData:Gi,errors:Ts}=await Qi(Ii,si,ki,Ri.active,qi,ui&&ui.submission,ui&&ui.fetcherSubmission,ui&&ui.replace,ui&&ui.initialHydration===!0,Li,Ni);Pi||(Fr=null,Ci(si,_extends$2({matches:zi||ki},getActionDataForCommit(Ni),{loaderData:Gi,errors:Ts})))}async function Ti(Zn,si,ui,bi,qi,ki){ki===void 0&&(ki={}),Mi();let Li=getSubmittingNavigation(si,ui);if(xi({navigation:Li},{flushSync:ki.flushSync===!0}),qi){let Ni=await ul(bi,si.pathname,Zn.signal);if(Ni.type==="aborted")return{shortCircuited:!0};if(Ni.type==="error"){let Pi=findNearestBoundary(Ni.partialMatches).route.id;return{matches:Ni.partialMatches,pendingActionResult:[Pi,{type:ResultType.error,error:Ni.error}]}}else if(Ni.matches)bi=Ni.matches;else{let{notFoundMatches:Pi,error:zi,route:Gi}=Al(si.pathname);return{matches:Pi,pendingActionResult:[Gi.id,{type:ResultType.error,error:zi}]}}}let Ri,Ii=getTargetMatch(bi,si);if(!Ii.route.action&&!Ii.route.lazy)Ri={type:ResultType.error,error:getInternalRouterError(405,{method:Zn.method,pathname:si.pathname,routeId:Ii.route.id})};else if(Ri=(await ni("action",Or,Zn,[Ii],bi,null))[Ii.route.id],Zn.signal.aborted)return{shortCircuited:!0};if(isRedirectResult(Ri)){let Ni;return ki&&ki.replace!=null?Ni=ki.replace:Ni=normalizeRedirectLocation(Ri.response.headers.get("Location"),new URL(Zn.url),dr)===Or.location.pathname+Or.location.search,await Xn(Zn,Ri,!0,{submission:ui,replace:Ni}),{shortCircuited:!0}}if(isDeferredResult(Ri))throw getInternalRouterError(400,{type:"defer-action"});if(isErrorResult(Ri)){let Ni=findNearestBoundary(bi,Ii.route.id);return(ki&&ki.replace)!==!0&&(zr=Action.Push),{matches:bi,pendingActionResult:[Ni.route.id,Ri]}}return{matches:bi,pendingActionResult:[Ii.route.id,Ri]}}async function Qi(Zn,si,ui,bi,qi,ki,Li,Ri,Ii,Ni,Pi){let zi=qi||getLoadingNavigation(si,ki),Gi=ki||Li||getSubmissionFromNavigation(zi),Ts=!Ir&&(!mr.v7_partialHydration||!Ii);if(bi){if(Ts){let Es=hi(Pi);xi(_extends$2({navigation:zi},Es!==void 0?{actionData:Es}:{}),{flushSync:Ni})}let Xi=await ul(ui,si.pathname,Zn.signal);if(Xi.type==="aborted")return{shortCircuited:!0};if(Xi.type==="error"){let Es=findNearestBoundary(Xi.partialMatches).route.id;return{matches:Xi.partialMatches,loaderData:{},errors:{[Es]:Xi.error}}}else if(Xi.matches)ui=Xi.matches;else{let{error:Es,notFoundMatches:ho,route:Uo}=Al(si.pathname);return{matches:ho,loaderData:{},errors:{[Uo.id]:Es}}}}let ls=lr||ir,[Zi,bs]=getMatchesToLoad(e.history,Or,ui,Gi,si,mr.v7_partialHydration&&Ii===!0,mr.v7_skipActionErrorRevalidation,Lr,Kn,pi,Jr,Jn,di,ls,dr,Pi);if(Rl(Xi=>!(ui&&ui.some(Es=>Es.route.id===Xi))||Zi&&Zi.some(Es=>Es.route.id===Xi)),qn=++oi,Zi.length===0&&bs.length===0){let Xi=Ca();return Ci(si,_extends$2({matches:ui,loaderData:{},errors:Pi&&isErrorResult(Pi[1])?{[Pi[0]]:Pi[1].error}:null},getActionDataForCommit(Pi),Xi?{fetchers:new Map(Or.fetchers)}:{}),{flushSync:Ni}),{shortCircuited:!0}}if(Ts){let Xi={};if(!bi){Xi.navigation=zi;let Es=hi(Pi);Es!==void 0&&(Xi.actionData=Es)}bs.length>0&&(Xi.fetchers=hs(bs)),xi(Xi,{flushSync:Ni})}bs.forEach(Xi=>{Hi(Xi.key),Xi.controller&&gi.set(Xi.key,Xi.controller)});let co=()=>bs.forEach(Xi=>Hi(Xi.key));Fr&&Fr.signal.addEventListener("abort",co);let{loaderResults:$o,fetcherResults:_a}=await wi(Or,ui,Zi,bs,Zn);if(Zn.signal.aborted)return{shortCircuited:!0};Fr&&Fr.signal.removeEventListener("abort",co),bs.forEach(Xi=>gi.delete(Xi.key));let oa=findRedirect($o);if(oa)return await Xn(Zn,oa.result,!0,{replace:Ri}),{shortCircuited:!0};if(oa=findRedirect(_a),oa)return di.add(oa.key),await Xn(Zn,oa.result,!0,{replace:Ri}),{shortCircuited:!0};let{loaderData:Tl,errors:Lo}=processLoaderData(Or,ui,$o,Pi,bs,_a,ei);ei.forEach((Xi,Es)=>{Xi.subscribe(ho=>{(ho||Xi.done)&&ei.delete(Es)})}),mr.v7_partialHydration&&Ii&&Or.errors&&(Lo=_extends$2({},Or.errors,Lo));let za=Ca(),cl=fa(qn),dl=za||cl||bs.length>0;return _extends$2({matches:ui,loaderData:Tl,errors:Lo},dl?{fetchers:new Map(Or.fetchers)}:{})}function hi(Zn){if(Zn&&!isErrorResult(Zn[1]))return{[Zn[0]]:Zn[1].data};if(Or.actionData)return Object.keys(Or.actionData).length===0?null:Or.actionData}function hs(Zn){return Zn.forEach(si=>{let ui=Or.fetchers.get(si.key),bi=getLoadingFetcher(void 0,ui?ui.data:void 0);Or.fetchers.set(si.key,bi)}),new Map(Or.fetchers)}function Yi(Zn,si,ui,bi){if(B)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Hi(Zn);let qi=(bi&&bi.flushSync)===!0,ki=lr||ir,Li=normalizeTo(Or.location,Or.matches,dr,mr.v7_prependBasename,ui,mr.v7_relativeSplatPath,si,bi==null?void 0:bi.relative),Ri=matchRoutes(ki,Li,dr),Ii=ll(Ri,ki,Li);if(Ii.active&&Ii.matches&&(Ri=Ii.matches),!Ri){Gr(Zn,si,getInternalRouterError(404,{pathname:Li}),{flushSync:qi});return}let{path:Ni,submission:Pi,error:zi}=normalizeNavigateOptions(mr.v7_normalizeFormMethod,!0,Li,bi);if(zi){Gr(Zn,si,zi,{flushSync:qi});return}let Gi=getTargetMatch(Ri,Ni),Ts=(bi&&bi.preventScrollReset)===!0;if(Pi&&isMutationMethod(Pi.formMethod)){ss(Zn,si,Ni,Gi,Ri,Ii.active,qi,Ts,Pi);return}Jn.set(Zn,{routeId:si,path:Ni}),Bi(Zn,si,Ni,Gi,Ri,Ii.active,qi,Ts,Pi)}async function ss(Zn,si,ui,bi,qi,ki,Li,Ri,Ii){Mi(),Jn.delete(Zn);function Ni(Ms){if(!Ms.route.action&&!Ms.route.lazy){let po=getInternalRouterError(405,{method:Ii.formMethod,pathname:ui,routeId:si});return Gr(Zn,si,po,{flushSync:Li}),!0}return!1}if(!ki&&Ni(bi))return;let Pi=Or.fetchers.get(Zn);ri(Zn,getSubmittingFetcher(Ii,Pi),{flushSync:Li});let zi=new AbortController,Gi=createClientSideRequest(e.history,ui,zi.signal,Ii);if(ki){let Ms=await ul(qi,new URL(Gi.url).pathname,Gi.signal,Zn);if(Ms.type==="aborted")return;if(Ms.type==="error"){Gr(Zn,si,Ms.error,{flushSync:Li});return}else if(Ms.matches){if(qi=Ms.matches,bi=getTargetMatch(qi,ui),Ni(bi))return}else{Gr(Zn,si,getInternalRouterError(404,{pathname:ui}),{flushSync:Li});return}}gi.set(Zn,zi);let Ts=oi,Zi=(await ni("action",Or,Gi,[bi],qi,Zn))[bi.route.id];if(Gi.signal.aborted){gi.get(Zn)===zi&&gi.delete(Zn);return}if(mr.v7_fetcherPersist&&Jr.has(Zn)){if(isRedirectResult(Zi)||isErrorResult(Zi)){ri(Zn,getDoneFetcher(void 0));return}}else{if(isRedirectResult(Zi))if(gi.delete(Zn),qn>Ts){ri(Zn,getDoneFetcher(void 0));return}else return di.add(Zn),ri(Zn,getLoadingFetcher(Ii)),Xn(Gi,Zi,!1,{fetcherSubmission:Ii,preventScrollReset:Ri});if(isErrorResult(Zi)){Gr(Zn,si,Zi.error);return}}if(isDeferredResult(Zi))throw getInternalRouterError(400,{type:"defer-action"});let bs=Or.navigation.location||Or.location,co=createClientSideRequest(e.history,bs,zi.signal),$o=lr||ir,_a=Or.navigation.state!=="idle"?matchRoutes($o,Or.navigation.location,dr):Or.matches;invariant(_a,"Didn't find any matches after fetcher action");let oa=++oi;li.set(Zn,oa);let Tl=getLoadingFetcher(Ii,Zi.data);Or.fetchers.set(Zn,Tl);let[Lo,za]=getMatchesToLoad(e.history,Or,_a,Ii,bs,!1,mr.v7_skipActionErrorRevalidation,Lr,Kn,pi,Jr,Jn,di,$o,dr,[bi.route.id,Zi]);za.filter(Ms=>Ms.key!==Zn).forEach(Ms=>{let po=Ms.key,Gl=Or.fetchers.get(po),cu=getLoadingFetcher(void 0,Gl?Gl.data:void 0);Or.fetchers.set(po,cu),Hi(po),Ms.controller&&gi.set(po,Ms.controller)}),xi({fetchers:new Map(Or.fetchers)});let cl=()=>za.forEach(Ms=>Hi(Ms.key));zi.signal.addEventListener("abort",cl);let{loaderResults:dl,fetcherResults:Xi}=await wi(Or,_a,Lo,za,co);if(zi.signal.aborted)return;zi.signal.removeEventListener("abort",cl),li.delete(Zn),gi.delete(Zn),za.forEach(Ms=>gi.delete(Ms.key));let Es=findRedirect(dl);if(Es)return Xn(co,Es.result,!1,{preventScrollReset:Ri});if(Es=findRedirect(Xi),Es)return di.add(Es.key),Xn(co,Es.result,!1,{preventScrollReset:Ri});let{loaderData:ho,errors:Uo}=processLoaderData(Or,_a,dl,void 0,za,Xi,ei);if(Or.fetchers.has(Zn)){let Ms=getDoneFetcher(Zi.data);Or.fetchers.set(Zn,Ms)}fa(oa),Or.navigation.state==="loading"&&oa>qn?(invariant(zr,"Expected pending action"),Fr&&Fr.abort(),Ci(Or.navigation.location,{matches:_a,loaderData:ho,errors:Uo,fetchers:new Map(Or.fetchers)})):(xi({errors:Uo,loaderData:mergeLoaderData(Or.loaderData,ho,_a,Uo),fetchers:new Map(Or.fetchers)}),Lr=!1)}async function Bi(Zn,si,ui,bi,qi,ki,Li,Ri,Ii){let Ni=Or.fetchers.get(Zn);ri(Zn,getLoadingFetcher(Ii,Ni?Ni.data:void 0),{flushSync:Li});let Pi=new AbortController,zi=createClientSideRequest(e.history,ui,Pi.signal);if(ki){let Zi=await ul(qi,new URL(zi.url).pathname,zi.signal,Zn);if(Zi.type==="aborted")return;if(Zi.type==="error"){Gr(Zn,si,Zi.error,{flushSync:Li});return}else if(Zi.matches)qi=Zi.matches,bi=getTargetMatch(qi,ui);else{Gr(Zn,si,getInternalRouterError(404,{pathname:ui}),{flushSync:Li});return}}gi.set(Zn,Pi);let Gi=oi,ls=(await ni("loader",Or,zi,[bi],qi,Zn))[bi.route.id];if(isDeferredResult(ls)&&(ls=await resolveDeferredData(ls,zi.signal,!0)||ls),gi.get(Zn)===Pi&&gi.delete(Zn),!zi.signal.aborted){if(Jr.has(Zn)){ri(Zn,getDoneFetcher(void 0));return}if(isRedirectResult(ls))if(qn>Gi){ri(Zn,getDoneFetcher(void 0));return}else{di.add(Zn),await Xn(zi,ls,!1,{preventScrollReset:Ri});return}if(isErrorResult(ls)){Gr(Zn,si,ls.error);return}invariant(!isDeferredResult(ls),"Unhandled fetcher deferred data"),ri(Zn,getDoneFetcher(ls.data))}}async function Xn(Zn,si,ui,bi){let{submission:qi,fetcherSubmission:ki,preventScrollReset:Li,replace:Ri}=bi===void 0?{}:bi;si.response.headers.has("X-Remix-Revalidate")&&(Lr=!0);let Ii=si.response.headers.get("Location");invariant(Ii,"Expected a Location header on the redirect Response"),Ii=normalizeRedirectLocation(Ii,new URL(Zn.url),dr);let Ni=createLocation(Or.location,Ii,{_isRedirect:!0});if(I){let Zi=!1;if(si.response.headers.has("X-Remix-Reload-Document"))Zi=!0;else if(ABSOLUTE_URL_REGEX.test(Ii)){const bs=e.history.createURL(Ii);Zi=bs.origin!==t.location.origin||stripBasename(bs.pathname,dr)==null}if(Zi){Ri?t.location.replace(Ii):t.location.assign(Ii);return}}Fr=null;let Pi=Ri===!0||si.response.headers.has("X-Remix-Replace")?Action.Replace:Action.Push,{formMethod:zi,formAction:Gi,formEncType:Ts}=Or.navigation;!qi&&!ki&&zi&&Gi&&Ts&&(qi=getSubmissionFromNavigation(Or.navigation));let ls=qi||ki;if(redirectPreserveMethodStatusCodes.has(si.response.status)&&ls&&isMutationMethod(ls.formMethod))await $i(Pi,Ni,{submission:_extends$2({},ls,{formAction:Ii}),preventScrollReset:Li||$n,enableViewTransition:ui?$r:void 0});else{let Zi=getLoadingNavigation(Ni,qi);await $i(Pi,Ni,{overrideNavigation:Zi,fetcherSubmission:ki,preventScrollReset:Li||$n,enableViewTransition:ui?$r:void 0})}}async function ni(Zn,si,ui,bi,qi,ki){let Li,Ri={};try{Li=await callDataStrategyImpl(hr,Zn,si,ui,bi,qi,ki,rr,tr)}catch(Ii){return bi.forEach(Ni=>{Ri[Ni.route.id]={type:ResultType.error,error:Ii}}),Ri}for(let[Ii,Ni]of Object.entries(Li))if(isRedirectDataStrategyResultResult(Ni)){let Pi=Ni.result;Ri[Ii]={type:ResultType.redirect,response:normalizeRelativeRoutingRedirectResponse(Pi,ui,Ii,qi,dr,mr.v7_relativeSplatPath)}}else Ri[Ii]=await convertDataStrategyResultToDataResult(Ni);return Ri}async function wi(Zn,si,ui,bi,qi){let ki=Zn.matches,Li=ni("loader",Zn,qi,ui,si,null),Ri=Promise.all(bi.map(async Pi=>{if(Pi.matches&&Pi.match&&Pi.controller){let Gi=(await ni("loader",Zn,createClientSideRequest(e.history,Pi.path,Pi.controller.signal),[Pi.match],Pi.matches,Pi.key))[Pi.match.route.id];return{[Pi.key]:Gi}}else return Promise.resolve({[Pi.key]:{type:ResultType.error,error:getInternalRouterError(404,{pathname:Pi.path})}})})),Ii=await Li,Ni=(await Ri).reduce((Pi,zi)=>Object.assign(Pi,zi),{});return await Promise.all([resolveNavigationDeferredResults(si,Ii,qi.signal,ki,Zn.loaderData),resolveFetcherDeferredResults(si,Ni,bi)]),{loaderResults:Ii,fetcherResults:Ni}}function Mi(){Lr=!0,Kn.push(...Rl()),Jn.forEach((Zn,si)=>{gi.has(si)&&pi.add(si),Hi(si)})}function ri(Zn,si,ui){ui===void 0&&(ui={}),Or.fetchers.set(Zn,si),xi({fetchers:new Map(Or.fetchers)},{flushSync:(ui&&ui.flushSync)===!0})}function Gr(Zn,si,ui,bi){bi===void 0&&(bi={});let qi=findNearestBoundary(Or.matches,si);Wi(Zn),xi({errors:{[qi.route.id]:ui},fetchers:new Map(Or.fetchers)},{flushSync:(bi&&bi.flushSync)===!0})}function Si(Zn){return Qr.set(Zn,(Qr.get(Zn)||0)+1),Jr.has(Zn)&&Jr.delete(Zn),Or.fetchers.get(Zn)||IDLE_FETCHER}function Wi(Zn){let si=Or.fetchers.get(Zn);gi.has(Zn)&&!(si&&si.state==="loading"&&li.has(Zn))&&Hi(Zn),Jn.delete(Zn),li.delete(Zn),di.delete(Zn),mr.v7_fetcherPersist&&Jr.delete(Zn),pi.delete(Zn),Or.fetchers.delete(Zn)}function Vi(Zn){let si=(Qr.get(Zn)||0)-1;si<=0?(Qr.delete(Zn),Jr.add(Zn),mr.v7_fetcherPersist||Wi(Zn)):Qr.set(Zn,si),xi({fetchers:new Map(Or.fetchers)})}function Hi(Zn){let si=gi.get(Zn);si&&(si.abort(),gi.delete(Zn))}function os(Zn){for(let si of Zn){let ui=Si(si),bi=getDoneFetcher(ui.data);Or.fetchers.set(si,bi)}}function Ca(){let Zn=[],si=!1;for(let ui of di){let bi=Or.fetchers.get(ui);invariant(bi,"Expected fetcher: "+ui),bi.state==="loading"&&(di.delete(ui),Zn.push(ui),si=!0)}return os(Zn),si}function fa(Zn){let si=[];for(let[ui,bi]of li)if(bi<Zn){let qi=Or.fetchers.get(ui);invariant(qi,"Expected fetcher: "+ui),qi.state==="loading"&&(Hi(ui),li.delete(ui),si.push(ui))}return os(si),si.length>0}function Ba(Zn,si){let ui=Or.blockers.get(Zn)||IDLE_BLOCKER;return mi.get(Zn)!==si&&mi.set(Zn,si),ui}function Qs(Zn){Or.blockers.delete(Zn),mi.delete(Zn)}function aa(Zn,si){let ui=Or.blockers.get(Zn)||IDLE_BLOCKER;invariant(ui.state==="unblocked"&&si.state==="blocked"||ui.state==="blocked"&&si.state==="blocked"||ui.state==="blocked"&&si.state==="proceeding"||ui.state==="blocked"&&si.state==="unblocked"||ui.state==="proceeding"&&si.state==="unblocked","Invalid blocker state transition: "+ui.state+" -> "+si.state);let bi=new Map(Or.blockers);bi.set(Zn,si),xi({blockers:bi})}function Vl(Zn){let{currentLocation:si,nextLocation:ui,historyAction:bi}=Zn;if(mi.size===0)return;mi.size>1&&warning(!1,"A router only supports one blocker at a time");let qi=Array.from(mi.entries()),[ki,Li]=qi[qi.length-1],Ri=Or.blockers.get(ki);if(!(Ri&&Ri.state==="proceeding")&&Li({currentLocation:si,nextLocation:ui,historyAction:bi}))return ki}function Al(Zn){let si=getInternalRouterError(404,{pathname:Zn}),ui=lr||ir,{matches:bi,route:qi}=getShortCircuitMatches(ui);return Rl(),{notFoundMatches:bi,route:qi,error:si}}function Rl(Zn){let si=[];return ei.forEach((ui,bi)=>{(!Zn||Zn(bi))&&(ui.cancel(),si.push(bi),ei.delete(bi))}),si}function au(Zn,si,ui){if(xr=Zn,vr=si,Mr=ui||null,!Sr&&Or.navigation===IDLE_NAVIGATION){Sr=!0;let bi=Ql(Or.location,Or.matches);bi!=null&&xi({restoreScrollPosition:bi})}return()=>{xr=null,vr=null,Mr=null}}function Hl(Zn,si){return Mr&&Mr(Zn,si.map(bi=>convertRouteMatchToUiMatch(bi,Or.loaderData)))||Zn.key}function ou(Zn,si){if(xr&&vr){let ui=Hl(Zn,si);xr[ui]=vr()}}function Ql(Zn,si){if(xr){let ui=Hl(Zn,si),bi=xr[ui];if(typeof bi=="number")return bi}return null}function ll(Zn,si,ui){if(fr)if(Zn){if(Object.keys(Zn[0].params).length>0)return{active:!0,matches:matchRoutesImpl(si,ui,dr,!0)}}else return{active:!0,matches:matchRoutesImpl(si,ui,dr,!0)||[]};return{active:!1,matches:null}}async function ul(Zn,si,ui,bi){if(!fr)return{type:"success",matches:Zn};let qi=Zn;for(;;){let ki=lr==null,Li=lr||ir,Ri=rr;try{await fr({signal:ui,path:si,matches:qi,fetcherKey:bi,patch:(Pi,zi)=>{ui.aborted||patchRoutesImpl(Pi,zi,Li,Ri,tr)}})}catch(Pi){return{type:"error",error:Pi,partialMatches:qi}}finally{ki&&!ui.aborted&&(ir=[...ir])}if(ui.aborted)return{type:"aborted"};let Ii=matchRoutes(Li,si,dr);if(Ii)return{type:"success",matches:Ii};let Ni=matchRoutesImpl(Li,si,dr,!0);if(!Ni||qi.length===Ni.length&&qi.every((Pi,zi)=>Pi.route.id===Ni[zi].route.id))return{type:"success",matches:null};qi=Ni}}function lu(Zn){rr={},lr=convertRoutesToDataRoutes(Zn,tr,void 0,rr)}function uu(Zn,si){let ui=lr==null;patchRoutesImpl(Zn,si,lr||ir,rr,tr),ui&&(ir=[...ir],xi({}))}return Dr={get basename(){return dr},get future(){return mr},get state(){return Or},get routes(){return ir},get window(){return t},initialize:ai,subscribe:vi,enableScrollRestoration:au,navigate:Yn,fetch:Yi,revalidate:ii,createHref:Zn=>e.history.createHref(Zn),encodeLocation:Zn=>e.history.encodeLocation(Zn),getFetcher:Si,deleteFetcher:Vi,dispose:fi,getBlocker:Ba,deleteBlocker:Qs,patchRoutes:uu,_internalFetchControllers:gi,_internalActiveDeferreds:ei,_internalSetRoutes:lu},Dr}function isSubmissionNavigation(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function normalizeTo(e,t,I,B,tr,rr,ir,lr){let dr,hr;if(ir){dr=[];for(let mr of t)if(dr.push(mr),mr.route.id===ir){hr=mr;break}}else dr=t,hr=t[t.length-1];let fr=resolveTo(tr||".",getResolveToMatches(dr,rr),stripBasename(e.pathname,I)||e.pathname,lr==="path");if(tr==null&&(fr.search=e.search,fr.hash=e.hash),(tr==null||tr===""||tr===".")&&hr){let mr=hasNakedIndexQuery(fr.search);if(hr.route.index&&!mr)fr.search=fr.search?fr.search.replace(/^\?/,"?index&"):"?index";else if(!hr.route.index&&mr){let _r=new URLSearchParams(fr.search),yr=_r.getAll("index");_r.delete("index"),yr.filter(Mr=>Mr).forEach(Mr=>_r.append("index",Mr));let xr=_r.toString();fr.search=xr?"?"+xr:""}}return B&&I!=="/"&&(fr.pathname=fr.pathname==="/"?I:joinPaths([I,fr.pathname])),createPath(fr)}function normalizeNavigateOptions(e,t,I,B){if(!B||!isSubmissionNavigation(B))return{path:I};if(B.formMethod&&!isValidMethod(B.formMethod))return{path:I,error:getInternalRouterError(405,{method:B.formMethod})};let tr=()=>({path:I,error:getInternalRouterError(400,{type:"invalid-body"})}),rr=B.formMethod||"get",ir=e?rr.toUpperCase():rr.toLowerCase(),lr=stripHashFromPath(I);if(B.body!==void 0){if(B.formEncType==="text/plain"){if(!isMutationMethod(ir))return tr();let _r=typeof B.body=="string"?B.body:B.body instanceof FormData||B.body instanceof URLSearchParams?Array.from(B.body.entries()).reduce((yr,xr)=>{let[Mr,vr]=xr;return""+yr+Mr+"="+vr+`
|
|
349
|
-
`},""):String(B.body);return{path:I,submission:{formMethod:ir,formAction:lr,formEncType:B.formEncType,formData:void 0,json:void 0,text:_r}}}else if(B.formEncType==="application/json"){if(!isMutationMethod(ir))return tr();try{let _r=typeof B.body=="string"?JSON.parse(B.body):B.body;return{path:I,submission:{formMethod:ir,formAction:lr,formEncType:B.formEncType,formData:void 0,json:_r,text:void 0}}}catch{return tr()}}}invariant(typeof FormData=="function","FormData is not available in this environment");let dr,hr;if(B.formData)dr=convertFormDataToSearchParams(B.formData),hr=B.formData;else if(B.body instanceof FormData)dr=convertFormDataToSearchParams(B.body),hr=B.body;else if(B.body instanceof URLSearchParams)dr=B.body,hr=convertSearchParamsToFormData(dr);else if(B.body==null)dr=new URLSearchParams,hr=new FormData;else try{dr=new URLSearchParams(B.body),hr=convertSearchParamsToFormData(dr)}catch{return tr()}let fr={formMethod:ir,formAction:lr,formEncType:B&&B.formEncType||"application/x-www-form-urlencoded",formData:hr,json:void 0,text:void 0};if(isMutationMethod(fr.formMethod))return{path:I,submission:fr};let mr=parsePath(I);return t&&mr.search&&hasNakedIndexQuery(mr.search)&&dr.append("index",""),mr.search="?"+dr,{path:createPath(mr),submission:fr}}function getLoaderMatchesUntilBoundary(e,t,I){I===void 0&&(I=!1);let B=e.findIndex(tr=>tr.route.id===t);return B>=0?e.slice(0,I?B+1:B):e}function getMatchesToLoad(e,t,I,B,tr,rr,ir,lr,dr,hr,fr,mr,_r,yr,xr,Mr){let vr=Mr?isErrorResult(Mr[1])?Mr[1].error:Mr[1].data:void 0,Sr=e.createURL(t.location),wr=e.createURL(tr),br=I;rr&&t.errors?br=getLoaderMatchesUntilBoundary(I,Object.keys(t.errors)[0],!0):Mr&&isErrorResult(Mr[1])&&(br=getLoaderMatchesUntilBoundary(I,Mr[0]));let Ar=Mr?Mr[1].statusCode:void 0,kr=ir&&Ar&&Ar>=400,Dr=br.filter((zr,$n)=>{let{route:Fr}=zr;if(Fr.lazy)return!0;if(Fr.loader==null)return!1;if(rr)return shouldLoadRouteOnHydration(Fr,t.loaderData,t.errors);if(isNewLoader(t.loaderData,t.matches[$n],zr)||dr.some(ti=>ti===zr.route.id))return!0;let $r=t.matches[$n],Hn=zr;return shouldRevalidateLoader(zr,_extends$2({currentUrl:Sr,currentParams:$r.params,nextUrl:wr,nextParams:Hn.params},B,{actionResult:vr,actionStatus:Ar,defaultShouldRevalidate:kr?!1:lr||Sr.pathname+Sr.search===wr.pathname+wr.search||Sr.search!==wr.search||isNewRouteInstance($r,Hn)}))}),Or=[];return mr.forEach((zr,$n)=>{if(rr||!I.some(Ir=>Ir.route.id===zr.routeId)||fr.has($n))return;let Fr=matchRoutes(yr,zr.path,xr);if(!Fr){Or.push({key:$n,routeId:zr.routeId,path:zr.path,matches:null,match:null,controller:null});return}let $r=t.fetchers.get($n),Hn=getTargetMatch(Fr,zr.path),ti=!1;_r.has($n)?ti=!1:hr.has($n)?(hr.delete($n),ti=!0):$r&&$r.state!=="idle"&&$r.data===void 0?ti=lr:ti=shouldRevalidateLoader(Hn,_extends$2({currentUrl:Sr,currentParams:t.matches[t.matches.length-1].params,nextUrl:wr,nextParams:I[I.length-1].params},B,{actionResult:vr,actionStatus:Ar,defaultShouldRevalidate:kr?!1:lr})),ti&&Or.push({key:$n,routeId:zr.routeId,path:zr.path,matches:Fr,match:Hn,controller:new AbortController})}),[Dr,Or]}function shouldLoadRouteOnHydration(e,t,I){if(e.lazy)return!0;if(!e.loader)return!1;let B=t!=null&&t[e.id]!==void 0,tr=I!=null&&I[e.id]!==void 0;return!B&&tr?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!B&&!tr}function isNewLoader(e,t,I){let B=!t||I.route.id!==t.route.id,tr=e[I.route.id]===void 0;return B||tr}function isNewRouteInstance(e,t){let I=e.route.path;return e.pathname!==t.pathname||I!=null&&I.endsWith("*")&&e.params["*"]!==t.params["*"]}function shouldRevalidateLoader(e,t){if(e.route.shouldRevalidate){let I=e.route.shouldRevalidate(t);if(typeof I=="boolean")return I}return t.defaultShouldRevalidate}function patchRoutesImpl(e,t,I,B,tr){var rr;let ir;if(e){let hr=B[e];invariant(hr,"No route found to patch children into: routeId = "+e),hr.children||(hr.children=[]),ir=hr.children}else ir=I;let lr=t.filter(hr=>!ir.some(fr=>isSameRoute(hr,fr))),dr=convertRoutesToDataRoutes(lr,tr,[e||"_","patch",String(((rr=ir)==null?void 0:rr.length)||"0")],B);ir.push(...dr)}function isSameRoute(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((I,B)=>{var tr;return(tr=t.children)==null?void 0:tr.some(rr=>isSameRoute(I,rr))}):!1}async function loadLazyRouteModule(e,t,I){if(!e.lazy)return;let B=await e.lazy();if(!e.lazy)return;let tr=I[e.id];invariant(tr,"No route found in manifest");let rr={};for(let ir in B){let dr=tr[ir]!==void 0&&ir!=="hasErrorBoundary";warning(!dr,'Route "'+tr.id+'" has a static property "'+ir+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+ir+'" will be ignored.')),!dr&&!immutableRouteKeys.has(ir)&&(rr[ir]=B[ir])}Object.assign(tr,rr),Object.assign(tr,_extends$2({},t(tr),{lazy:void 0}))}async function defaultDataStrategy(e){let{matches:t}=e,I=t.filter(tr=>tr.shouldLoad);return(await Promise.all(I.map(tr=>tr.resolve()))).reduce((tr,rr,ir)=>Object.assign(tr,{[I[ir].route.id]:rr}),{})}async function callDataStrategyImpl(e,t,I,B,tr,rr,ir,lr,dr,hr){let fr=rr.map(yr=>yr.route.lazy?loadLazyRouteModule(yr.route,dr,lr):void 0),mr=rr.map((yr,xr)=>{let Mr=fr[xr],vr=tr.some(wr=>wr.route.id===yr.route.id);return _extends$2({},yr,{shouldLoad:vr,resolve:async wr=>(wr&&B.method==="GET"&&(yr.route.lazy||yr.route.loader)&&(vr=!0),vr?callLoaderOrAction(t,B,yr,Mr,wr,hr):Promise.resolve({type:ResultType.data,result:void 0}))})}),_r=await e({matches:mr,request:B,params:rr[0].params,fetcherKey:ir,context:hr});try{await Promise.all(fr)}catch{}return _r}async function callLoaderOrAction(e,t,I,B,tr,rr){let ir,lr,dr=hr=>{let fr,mr=new Promise((xr,Mr)=>fr=Mr);lr=()=>fr(),t.signal.addEventListener("abort",lr);let _r=xr=>typeof hr!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+I.route.id+"]"))):hr({request:t,params:I.params,context:rr},...xr!==void 0?[xr]:[]),yr=(async()=>{try{return{type:"data",result:await(tr?tr(Mr=>_r(Mr)):_r())}}catch(xr){return{type:"error",result:xr}}})();return Promise.race([yr,mr])};try{let hr=I.route[e];if(B)if(hr){let fr,[mr]=await Promise.all([dr(hr).catch(_r=>{fr=_r}),B]);if(fr!==void 0)throw fr;ir=mr}else if(await B,hr=I.route[e],hr)ir=await dr(hr);else if(e==="action"){let fr=new URL(t.url),mr=fr.pathname+fr.search;throw getInternalRouterError(405,{method:t.method,pathname:mr,routeId:I.route.id})}else return{type:ResultType.data,result:void 0};else if(hr)ir=await dr(hr);else{let fr=new URL(t.url),mr=fr.pathname+fr.search;throw getInternalRouterError(404,{pathname:mr})}invariant(ir.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+I.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(hr){return{type:ResultType.error,result:hr}}finally{lr&&t.signal.removeEventListener("abort",lr)}return ir}async function convertDataStrategyResultToDataResult(e){let{result:t,type:I}=e;if(isResponse(t)){let mr;try{let _r=t.headers.get("Content-Type");_r&&/\bapplication\/json\b/.test(_r)?t.body==null?mr=null:mr=await t.json():mr=await t.text()}catch(_r){return{type:ResultType.error,error:_r}}return I===ResultType.error?{type:ResultType.error,error:new ErrorResponseImpl(t.status,t.statusText,mr),statusCode:t.status,headers:t.headers}:{type:ResultType.data,data:mr,statusCode:t.status,headers:t.headers}}if(I===ResultType.error){if(isDataWithResponseInit(t)){var B,tr;if(t.data instanceof Error){var rr,ir;return{type:ResultType.error,error:t.data,statusCode:(rr=t.init)==null?void 0:rr.status,headers:(ir=t.init)!=null&&ir.headers?new Headers(t.init.headers):void 0}}return{type:ResultType.error,error:new ErrorResponseImpl(((B=t.init)==null?void 0:B.status)||500,void 0,t.data),statusCode:isRouteErrorResponse(t)?t.status:void 0,headers:(tr=t.init)!=null&&tr.headers?new Headers(t.init.headers):void 0}}return{type:ResultType.error,error:t,statusCode:isRouteErrorResponse(t)?t.status:void 0}}if(isDeferredData(t)){var lr,dr;return{type:ResultType.deferred,deferredData:t,statusCode:(lr=t.init)==null?void 0:lr.status,headers:((dr=t.init)==null?void 0:dr.headers)&&new Headers(t.init.headers)}}if(isDataWithResponseInit(t)){var hr,fr;return{type:ResultType.data,data:t.data,statusCode:(hr=t.init)==null?void 0:hr.status,headers:(fr=t.init)!=null&&fr.headers?new Headers(t.init.headers):void 0}}return{type:ResultType.data,data:t}}function normalizeRelativeRoutingRedirectResponse(e,t,I,B,tr,rr){let ir=e.headers.get("Location");if(invariant(ir,"Redirects returned/thrown from loaders/actions must have a Location header"),!ABSOLUTE_URL_REGEX.test(ir)){let lr=B.slice(0,B.findIndex(dr=>dr.route.id===I)+1);ir=normalizeTo(new URL(t.url),lr,tr,!0,ir,rr),e.headers.set("Location",ir)}return e}function normalizeRedirectLocation(e,t,I){if(ABSOLUTE_URL_REGEX.test(e)){let B=e,tr=B.startsWith("//")?new URL(t.protocol+B):new URL(B),rr=stripBasename(tr.pathname,I)!=null;if(tr.origin===t.origin&&rr)return tr.pathname+tr.search+tr.hash}return e}function createClientSideRequest(e,t,I,B){let tr=e.createURL(stripHashFromPath(t)).toString(),rr={signal:I};if(B&&isMutationMethod(B.formMethod)){let{formMethod:ir,formEncType:lr}=B;rr.method=ir.toUpperCase(),lr==="application/json"?(rr.headers=new Headers({"Content-Type":lr}),rr.body=JSON.stringify(B.json)):lr==="text/plain"?rr.body=B.text:lr==="application/x-www-form-urlencoded"&&B.formData?rr.body=convertFormDataToSearchParams(B.formData):rr.body=B.formData}return new Request(tr,rr)}function convertFormDataToSearchParams(e){let t=new URLSearchParams;for(let[I,B]of e.entries())t.append(I,typeof B=="string"?B:B.name);return t}function convertSearchParamsToFormData(e){let t=new FormData;for(let[I,B]of e.entries())t.append(I,B);return t}function processRouteLoaderData(e,t,I,B,tr){let rr={},ir=null,lr,dr=!1,hr={},fr=I&&isErrorResult(I[1])?I[1].error:void 0;return e.forEach(mr=>{if(!(mr.route.id in t))return;let _r=mr.route.id,yr=t[_r];if(invariant(!isRedirectResult(yr),"Cannot handle redirect results in processLoaderData"),isErrorResult(yr)){let xr=yr.error;fr!==void 0&&(xr=fr,fr=void 0),ir=ir||{};{let Mr=findNearestBoundary(e,_r);ir[Mr.route.id]==null&&(ir[Mr.route.id]=xr)}rr[_r]=void 0,dr||(dr=!0,lr=isRouteErrorResponse(yr.error)?yr.error.status:500),yr.headers&&(hr[_r]=yr.headers)}else isDeferredResult(yr)?(B.set(_r,yr.deferredData),rr[_r]=yr.deferredData.data,yr.statusCode!=null&&yr.statusCode!==200&&!dr&&(lr=yr.statusCode),yr.headers&&(hr[_r]=yr.headers)):(rr[_r]=yr.data,yr.statusCode&&yr.statusCode!==200&&!dr&&(lr=yr.statusCode),yr.headers&&(hr[_r]=yr.headers))}),fr!==void 0&&I&&(ir={[I[0]]:fr},rr[I[0]]=void 0),{loaderData:rr,errors:ir,statusCode:lr||200,loaderHeaders:hr}}function processLoaderData(e,t,I,B,tr,rr,ir){let{loaderData:lr,errors:dr}=processRouteLoaderData(t,I,B,ir);return tr.forEach(hr=>{let{key:fr,match:mr,controller:_r}=hr,yr=rr[fr];if(invariant(yr,"Did not find corresponding fetcher result"),!(_r&&_r.signal.aborted))if(isErrorResult(yr)){let xr=findNearestBoundary(e.matches,mr==null?void 0:mr.route.id);dr&&dr[xr.route.id]||(dr=_extends$2({},dr,{[xr.route.id]:yr.error})),e.fetchers.delete(fr)}else if(isRedirectResult(yr))invariant(!1,"Unhandled fetcher revalidation redirect");else if(isDeferredResult(yr))invariant(!1,"Unhandled fetcher deferred data");else{let xr=getDoneFetcher(yr.data);e.fetchers.set(fr,xr)}}),{loaderData:lr,errors:dr}}function mergeLoaderData(e,t,I,B){let tr=_extends$2({},t);for(let rr of I){let ir=rr.route.id;if(t.hasOwnProperty(ir)?t[ir]!==void 0&&(tr[ir]=t[ir]):e[ir]!==void 0&&rr.route.loader&&(tr[ir]=e[ir]),B&&B.hasOwnProperty(ir))break}return tr}function getActionDataForCommit(e){return e?isErrorResult(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function findNearestBoundary(e,t){return(t?e.slice(0,e.findIndex(B=>B.route.id===t)+1):[...e]).reverse().find(B=>B.route.hasErrorBoundary===!0)||e[0]}function getShortCircuitMatches(e){let t=e.length===1?e[0]:e.find(I=>I.index||!I.path||I.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function getInternalRouterError(e,t){let{pathname:I,routeId:B,method:tr,type:rr}=t===void 0?{}:t,ir="Unknown Server Error",lr="Unknown @remix-run/router error";return e===400?(ir="Bad Request",tr&&I&&B?lr="You made a "+tr+' request to "'+I+'" but '+('did not provide a `loader` for route "'+B+'", ')+"so there is no way to handle the request.":rr==="defer-action"?lr="defer() is not supported in actions":rr==="invalid-body"&&(lr="Unable to encode submission body")):e===403?(ir="Forbidden",lr='Route "'+B+'" does not match URL "'+I+'"'):e===404?(ir="Not Found",lr='No route matches URL "'+I+'"'):e===405&&(ir="Method Not Allowed",tr&&I&&B?lr="You made a "+tr.toUpperCase()+' request to "'+I+'" but '+('did not provide an `action` for route "'+B+'", ')+"so there is no way to handle the request.":tr&&(lr='Invalid request method "'+tr.toUpperCase()+'"')),new ErrorResponseImpl(e||500,ir,new Error(lr),!0)}function findRedirect(e){let t=Object.entries(e);for(let I=t.length-1;I>=0;I--){let[B,tr]=t[I];if(isRedirectResult(tr))return{key:B,result:tr}}}function stripHashFromPath(e){let t=typeof e=="string"?parsePath(e):e;return createPath(_extends$2({},t,{hash:""}))}function isHashChangeOnly(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function isRedirectDataStrategyResultResult(e){return isResponse(e.result)&&redirectStatusCodes.has(e.result.status)}function isDeferredResult(e){return e.type===ResultType.deferred}function isErrorResult(e){return e.type===ResultType.error}function isRedirectResult(e){return(e&&e.type)===ResultType.redirect}function isDataWithResponseInit(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function isDeferredData(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function isResponse(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function isValidMethod(e){return validRequestMethods.has(e.toLowerCase())}function isMutationMethod(e){return validMutationMethods.has(e.toLowerCase())}async function resolveNavigationDeferredResults(e,t,I,B,tr){let rr=Object.entries(t);for(let ir=0;ir<rr.length;ir++){let[lr,dr]=rr[ir],hr=e.find(_r=>(_r==null?void 0:_r.route.id)===lr);if(!hr)continue;let fr=B.find(_r=>_r.route.id===hr.route.id),mr=fr!=null&&!isNewRouteInstance(fr,hr)&&(tr&&tr[hr.route.id])!==void 0;isDeferredResult(dr)&&mr&&await resolveDeferredData(dr,I,!1).then(_r=>{_r&&(t[lr]=_r)})}}async function resolveFetcherDeferredResults(e,t,I){for(let B=0;B<I.length;B++){let{key:tr,routeId:rr,controller:ir}=I[B],lr=t[tr];e.find(hr=>(hr==null?void 0:hr.route.id)===rr)&&isDeferredResult(lr)&&(invariant(ir,"Expected an AbortController for revalidating fetcher deferred result"),await resolveDeferredData(lr,ir.signal,!0).then(hr=>{hr&&(t[tr]=hr)}))}}async function resolveDeferredData(e,t,I){if(I===void 0&&(I=!1),!await e.deferredData.resolveData(t)){if(I)try{return{type:ResultType.data,data:e.deferredData.unwrappedData}}catch(tr){return{type:ResultType.error,error:tr}}return{type:ResultType.data,data:e.deferredData.data}}}function hasNakedIndexQuery(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function getTargetMatch(e,t){let I=typeof t=="string"?parsePath(t).search:t.search;if(e[e.length-1].route.index&&hasNakedIndexQuery(I||""))return e[e.length-1];let B=getPathContributingMatches(e);return B[B.length-1]}function getSubmissionFromNavigation(e){let{formMethod:t,formAction:I,formEncType:B,text:tr,formData:rr,json:ir}=e;if(!(!t||!I||!B)){if(tr!=null)return{formMethod:t,formAction:I,formEncType:B,formData:void 0,json:void 0,text:tr};if(rr!=null)return{formMethod:t,formAction:I,formEncType:B,formData:rr,json:void 0,text:void 0};if(ir!==void 0)return{formMethod:t,formAction:I,formEncType:B,formData:void 0,json:ir,text:void 0}}}function getLoadingNavigation(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function getSubmittingNavigation(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function getLoadingFetcher(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function getSubmittingFetcher(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function getDoneFetcher(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function restoreAppliedTransitions(e,t){try{let I=e.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY);if(I){let B=JSON.parse(I);for(let[tr,rr]of Object.entries(B||{}))rr&&Array.isArray(rr)&&t.set(tr,new Set(rr||[]))}}catch{}}function persistAppliedTransitions(e,t){if(t.size>0){let I={};for(let[B,tr]of t)I[B]=[...tr];try{e.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY,JSON.stringify(I))}catch(B){warning(!1,"Failed to save applied view transitions in sessionStorage ("+B+").")}}}/**
|
|
350
|
-
* React Router v6.30.1
|
|
351
|
-
*
|
|
352
|
-
* Copyright (c) Remix Software Inc.
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the MIT license found in the
|
|
355
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
356
|
-
*
|
|
357
|
-
* @license MIT
|
|
358
|
-
*/function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var I=arguments[t];for(var B in I)Object.prototype.hasOwnProperty.call(I,B)&&(e[B]=I[B])}return e},_extends$1.apply(this,arguments)}const DataRouterContext=React.createContext(null),DataRouterStateContext=React.createContext(null),NavigationContext=React.createContext(null),LocationContext=React.createContext(null),RouteContext=React.createContext({outlet:null,matches:[],isDataRoute:!1}),RouteErrorContext=React.createContext(null);function useInRouterContext(){return React.useContext(LocationContext)!=null}function useLocation(){return useInRouterContext()||invariant(!1),React.useContext(LocationContext).location}function useNavigationType(){return React.useContext(LocationContext).navigationType}function useIsomorphicLayoutEffect(e){React.useContext(NavigationContext).static||React.useLayoutEffect(e)}function useNavigate(){let{isDataRoute:e}=React.useContext(RouteContext);return e?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){useInRouterContext()||invariant(!1);let e=React.useContext(DataRouterContext),{basename:t,future:I,navigator:B}=React.useContext(NavigationContext),{matches:tr}=React.useContext(RouteContext),{pathname:rr}=useLocation(),ir=JSON.stringify(getResolveToMatches(tr,I.v7_relativeSplatPath)),lr=React.useRef(!1);return useIsomorphicLayoutEffect(()=>{lr.current=!0}),React.useCallback(function(hr,fr){if(fr===void 0&&(fr={}),!lr.current)return;if(typeof hr=="number"){B.go(hr);return}let mr=resolveTo(hr,JSON.parse(ir),rr,fr.relative==="path");e==null&&t!=="/"&&(mr.pathname=mr.pathname==="/"?t:joinPaths([t,mr.pathname])),(fr.replace?B.replace:B.push)(mr,fr.state,fr)},[t,B,ir,rr,e])}const OutletContext=React.createContext(null);function useOutlet(e){let t=React.useContext(RouteContext).outlet;return t&&React.createElement(OutletContext.Provider,{value:e},t)}function useParams(){let{matches:e}=React.useContext(RouteContext),t=e[e.length-1];return t?t.params:{}}function useRoutesImpl(e,t,I,B){useInRouterContext()||invariant(!1);let{navigator:tr}=React.useContext(NavigationContext),{matches:rr}=React.useContext(RouteContext),ir=rr[rr.length-1],lr=ir?ir.params:{},dr=ir?ir.pathnameBase:"/",hr=useLocation(),fr;fr=hr;let mr=fr.pathname||"/",_r=mr;if(dr!=="/"){let Mr=dr.replace(/^\//,"").split("/");_r="/"+mr.replace(/^\//,"").split("/").slice(Mr.length).join("/")}let yr=matchRoutes(e,{pathname:_r});return _renderMatches(yr&&yr.map(Mr=>Object.assign({},Mr,{params:Object.assign({},lr,Mr.params),pathname:joinPaths([dr,tr.encodeLocation?tr.encodeLocation(Mr.pathname).pathname:Mr.pathname]),pathnameBase:Mr.pathnameBase==="/"?dr:joinPaths([dr,tr.encodeLocation?tr.encodeLocation(Mr.pathnameBase).pathname:Mr.pathnameBase])})),rr,I,B)}function DefaultErrorComponent(){let e=useRouteError(),t=isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),I=e instanceof Error?e.stack:null,tr={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return React.createElement(React.Fragment,null,React.createElement("h2",null,"Unexpected Application Error!"),React.createElement("h3",{style:{fontStyle:"italic"}},t),I?React.createElement("pre",{style:tr},I):null,null)}const defaultErrorElement=React.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends React.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,I){return I.location!==t.location||I.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:I.error,location:I.location,revalidation:t.revalidation||I.revalidation}}componentDidCatch(t,I){console.error("React Router caught the following error during render",t,I)}render(){return this.state.error!==void 0?React.createElement(RouteContext.Provider,{value:this.props.routeContext},React.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(e){let{routeContext:t,match:I,children:B}=e,tr=React.useContext(DataRouterContext);return tr&&tr.static&&tr.staticContext&&(I.route.errorElement||I.route.ErrorBoundary)&&(tr.staticContext._deepestRenderedBoundaryId=I.route.id),React.createElement(RouteContext.Provider,{value:t},B)}function _renderMatches(e,t,I,B){var tr;if(t===void 0&&(t=[]),I===void 0&&(I=null),B===void 0&&(B=null),e==null){var rr;if(!I)return null;if(I.errors)e=I.matches;else if((rr=B)!=null&&rr.v7_partialHydration&&t.length===0&&!I.initialized&&I.matches.length>0)e=I.matches;else return null}let ir=e,lr=(tr=I)==null?void 0:tr.errors;if(lr!=null){let fr=ir.findIndex(mr=>mr.route.id&&(lr==null?void 0:lr[mr.route.id])!==void 0);fr>=0||invariant(!1),ir=ir.slice(0,Math.min(ir.length,fr+1))}let dr=!1,hr=-1;if(I&&B&&B.v7_partialHydration)for(let fr=0;fr<ir.length;fr++){let mr=ir[fr];if((mr.route.HydrateFallback||mr.route.hydrateFallbackElement)&&(hr=fr),mr.route.id){let{loaderData:_r,errors:yr}=I,xr=mr.route.loader&&_r[mr.route.id]===void 0&&(!yr||yr[mr.route.id]===void 0);if(mr.route.lazy||xr){dr=!0,hr>=0?ir=ir.slice(0,hr+1):ir=[ir[0]];break}}}return ir.reduceRight((fr,mr,_r)=>{let yr,xr=!1,Mr=null,vr=null;I&&(yr=lr&&mr.route.id?lr[mr.route.id]:void 0,Mr=mr.route.errorElement||defaultErrorElement,dr&&(hr<0&&_r===0?(xr=!0,vr=null):hr===_r&&(xr=!0,vr=mr.route.hydrateFallbackElement||null)));let Sr=t.concat(ir.slice(0,_r+1)),wr=()=>{let br;return yr?br=Mr:xr?br=vr:mr.route.Component?br=React.createElement(mr.route.Component,null):mr.route.element?br=mr.route.element:br=fr,React.createElement(RenderedRoute,{match:mr,routeContext:{outlet:fr,matches:Sr,isDataRoute:I!=null},children:br})};return I&&(mr.route.ErrorBoundary||mr.route.errorElement||_r===0)?React.createElement(RenderErrorBoundary,{location:I.location,revalidation:I.revalidation,component:Mr,error:yr,children:wr(),routeContext:{outlet:null,matches:Sr,isDataRoute:!0}}):wr()},null)}function useDataRouterContext(e){let t=React.useContext(DataRouterContext);return t||invariant(!1),t}function useDataRouterState(e){let t=React.useContext(DataRouterStateContext);return t||invariant(!1),t}function useRouteContext(e){let t=React.useContext(RouteContext);return t||invariant(!1),t}function useCurrentRouteId(e){let t=useRouteContext(),I=t.matches[t.matches.length-1];return I.route.id||invariant(!1),I.route.id}function useRouteError(){var e;let t=React.useContext(RouteErrorContext),I=useDataRouterState(),B=useCurrentRouteId();return t!==void 0?t:(e=I.errors)==null?void 0:e[B]}function useNavigateStable(){let{router:e}=useDataRouterContext(),t=useCurrentRouteId(),I=React.useRef(!1);return useIsomorphicLayoutEffect(()=>{I.current=!0}),React.useCallback(function(tr,rr){rr===void 0&&(rr={}),I.current&&(typeof tr=="number"?e.navigate(tr):e.navigate(tr,_extends$1({fromRouteId:t},rr)))},[e,t])}function logV6DeprecationWarnings(e,t){}function Outlet(e){return useOutlet(e.context)}function Route(e){invariant(!1)}function Router$1(e){let{basename:t="/",children:I=null,location:B,navigationType:tr=Action.Pop,navigator:rr,static:ir=!1,future:lr}=e;useInRouterContext()&&invariant(!1);let dr=t.replace(/^\/*/,"/"),hr=React.useMemo(()=>({basename:dr,navigator:rr,static:ir,future:_extends$1({v7_relativeSplatPath:!1},lr)}),[dr,lr,rr,ir]);typeof B=="string"&&(B=parsePath(B));let{pathname:fr="/",search:mr="",hash:_r="",state:yr=null,key:xr="default"}=B,Mr=React.useMemo(()=>{let vr=stripBasename(fr,dr);return vr==null?null:{location:{pathname:vr,search:mr,hash:_r,state:yr,key:xr},navigationType:tr}},[dr,fr,mr,_r,yr,xr,tr]);return Mr==null?null:React.createElement(NavigationContext.Provider,{value:hr},React.createElement(LocationContext.Provider,{children:I,value:Mr}))}new Promise(()=>{});function createRoutesFromChildren(e,t){t===void 0&&(t=[]);let I=[];return React.Children.forEach(e,(B,tr)=>{if(!React.isValidElement(B))return;let rr=[...t,tr];if(B.type===React.Fragment){I.push.apply(I,createRoutesFromChildren(B.props.children,rr));return}B.type!==Route&&invariant(!1),!B.props.index||!B.props.children||invariant(!1);let ir={id:B.props.id||rr.join("-"),caseSensitive:B.props.caseSensitive,element:B.props.element,Component:B.props.Component,index:B.props.index,path:B.props.path,loader:B.props.loader,action:B.props.action,errorElement:B.props.errorElement,ErrorBoundary:B.props.ErrorBoundary,hasErrorBoundary:B.props.ErrorBoundary!=null||B.props.errorElement!=null,shouldRevalidate:B.props.shouldRevalidate,handle:B.props.handle,lazy:B.props.lazy};B.props.children&&(ir.children=createRoutesFromChildren(B.props.children,rr)),I.push(ir)}),I}function mapRouteProperties(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:React.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:React.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:React.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
359
|
-
* React Router DOM v6.30.1
|
|
360
|
-
*
|
|
361
|
-
* Copyright (c) Remix Software Inc.
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the MIT license found in the
|
|
364
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
365
|
-
*
|
|
366
|
-
* @license MIT
|
|
367
|
-
*/function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var I=arguments[t];for(var B in I)Object.prototype.hasOwnProperty.call(I,B)&&(e[B]=I[B])}return e},_extends.apply(this,arguments)}function createSearchParams(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,I)=>{let B=e[I];return t.concat(Array.isArray(B)?B.map(tr=>[I,tr]):[[I,B]])},[]))}function getSearchParamsForLocation(e,t){let I=createSearchParams(e);return t&&t.forEach((B,tr)=>{I.has(tr)||t.getAll(tr).forEach(rr=>{I.append(tr,rr)})}),I}const REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch(e){}function createBrowserRouter(e,t){return createRouter$1({basename:t==null?void 0:t.basename,future:_extends({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:createBrowserHistory({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||parseHydrationData(),routes:e,mapRouteProperties,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function parseHydrationData(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=_extends({},t,{errors:deserializeErrors(t.errors)})),t}function deserializeErrors(e){if(!e)return null;let t=Object.entries(e),I={};for(let[B,tr]of t)if(tr&&tr.__type==="RouteErrorResponse")I[B]=new ErrorResponseImpl(tr.status,tr.statusText,tr.data,tr.internal===!0);else if(tr&&tr.__type==="Error"){if(tr.__subType){let rr=window[tr.__subType];if(typeof rr=="function")try{let ir=new rr(tr.message);ir.stack="",I[B]=ir}catch{}}if(I[B]==null){let rr=new Error(tr.message);rr.stack="",I[B]=rr}}else I[B]=tr;return I}const ViewTransitionContext=React.createContext({isTransitioning:!1}),FetchersContext=React.createContext(new Map),START_TRANSITION="startTransition",startTransitionImpl=React[START_TRANSITION],FLUSH_SYNC="flushSync",flushSyncImpl=ReactDOM[FLUSH_SYNC];function startTransitionSafe(e){startTransitionImpl?startTransitionImpl(e):e()}function flushSyncSafe(e){flushSyncImpl?flushSyncImpl(e):e()}class Deferred{constructor(){this.status="pending",this.promise=new Promise((t,I)=>{this.resolve=B=>{this.status==="pending"&&(this.status="resolved",t(B))},this.reject=B=>{this.status==="pending"&&(this.status="rejected",I(B))}})}}function RouterProvider(e){let{fallbackElement:t,router:I,future:B}=e,[tr,rr]=React.useState(I.state),[ir,lr]=React.useState(),[dr,hr]=React.useState({isTransitioning:!1}),[fr,mr]=React.useState(),[_r,yr]=React.useState(),[xr,Mr]=React.useState(),vr=React.useRef(new Map),{v7_startTransition:Sr}=B||{},wr=React.useCallback(zr=>{Sr?startTransitionSafe(zr):zr()},[Sr]),br=React.useCallback((zr,$n)=>{let{deletedFetchers:Fr,flushSync:$r,viewTransitionOpts:Hn}=$n;zr.fetchers.forEach((Ir,Lr)=>{Ir.data!==void 0&&vr.current.set(Lr,Ir.data)}),Fr.forEach(Ir=>vr.current.delete(Ir));let ti=I.window==null||I.window.document==null||typeof I.window.document.startViewTransition!="function";if(!Hn||ti){$r?flushSyncSafe(()=>rr(zr)):wr(()=>rr(zr));return}if($r){flushSyncSafe(()=>{_r&&(fr&&fr.resolve(),_r.skipTransition()),hr({isTransitioning:!0,flushSync:!0,currentLocation:Hn.currentLocation,nextLocation:Hn.nextLocation})});let Ir=I.window.document.startViewTransition(()=>{flushSyncSafe(()=>rr(zr))});Ir.finished.finally(()=>{flushSyncSafe(()=>{mr(void 0),yr(void 0),lr(void 0),hr({isTransitioning:!1})})}),flushSyncSafe(()=>yr(Ir));return}_r?(fr&&fr.resolve(),_r.skipTransition(),Mr({state:zr,currentLocation:Hn.currentLocation,nextLocation:Hn.nextLocation})):(lr(zr),hr({isTransitioning:!0,flushSync:!1,currentLocation:Hn.currentLocation,nextLocation:Hn.nextLocation}))},[I.window,_r,fr,vr,wr]);React.useLayoutEffect(()=>I.subscribe(br),[I,br]),React.useEffect(()=>{dr.isTransitioning&&!dr.flushSync&&mr(new Deferred)},[dr]),React.useEffect(()=>{if(fr&&ir&&I.window){let zr=ir,$n=fr.promise,Fr=I.window.document.startViewTransition(async()=>{wr(()=>rr(zr)),await $n});Fr.finished.finally(()=>{mr(void 0),yr(void 0),lr(void 0),hr({isTransitioning:!1})}),yr(Fr)}},[wr,ir,fr,I.window]),React.useEffect(()=>{fr&&ir&&tr.location.key===ir.location.key&&fr.resolve()},[fr,_r,tr.location,ir]),React.useEffect(()=>{!dr.isTransitioning&&xr&&(lr(xr.state),hr({isTransitioning:!0,flushSync:!1,currentLocation:xr.currentLocation,nextLocation:xr.nextLocation}),Mr(void 0))},[dr.isTransitioning,xr]),React.useEffect(()=>{},[]);let Ar=React.useMemo(()=>({createHref:I.createHref,encodeLocation:I.encodeLocation,go:zr=>I.navigate(zr),push:(zr,$n,Fr)=>I.navigate(zr,{state:$n,preventScrollReset:Fr==null?void 0:Fr.preventScrollReset}),replace:(zr,$n,Fr)=>I.navigate(zr,{replace:!0,state:$n,preventScrollReset:Fr==null?void 0:Fr.preventScrollReset})}),[I]),kr=I.basename||"/",Dr=React.useMemo(()=>({router:I,navigator:Ar,static:!1,basename:kr}),[I,Ar,kr]),Or=React.useMemo(()=>({v7_relativeSplatPath:I.future.v7_relativeSplatPath}),[I.future.v7_relativeSplatPath]);return React.useEffect(()=>void 0,[B,I.future]),React.createElement(React.Fragment,null,React.createElement(DataRouterContext.Provider,{value:Dr},React.createElement(DataRouterStateContext.Provider,{value:tr},React.createElement(FetchersContext.Provider,{value:vr.current},React.createElement(ViewTransitionContext.Provider,{value:dr},React.createElement(Router$1,{basename:kr,location:tr.location,navigationType:tr.historyAction,navigator:Ar,future:Or},tr.initialized||I.future.v7_partialHydration?React.createElement(MemoizedDataRoutes,{routes:I.routes,future:I.future,state:tr}):t))))),null)}const MemoizedDataRoutes=React.memo(DataRoutes);function DataRoutes(e){let{routes:t,future:I,state:B}=e;return useRoutesImpl(t,void 0,B,I)}var DataRouterHook;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useSearchParams(e){let t=React.useRef(createSearchParams(e)),I=React.useRef(!1),B=useLocation(),tr=React.useMemo(()=>getSearchParamsForLocation(B.search,I.current?null:t.current),[B.search]),rr=useNavigate(),ir=React.useCallback((lr,dr)=>{const hr=createSearchParams(typeof lr=="function"?lr(tr):lr);I.current=!0,rr("?"+hr,dr)},[rr,tr]);return[tr,ir]}const Content=React__default.lazy(()=>__vitePreload(()=>import("./content.BVfObTK-.js"),__vite__mapDeps([12,2,1,3,4,5,13,14,15,16,17,6,7]),import.meta.url)),Root=React__default.lazy(()=>__vitePreload(()=>import("./root.20yJwNI0.js"),__vite__mapDeps([18,13,2,1,3,4,5,14,15,16,6,7]),import.meta.url)),AtlasImport=React__default.lazy(()=>__vitePreload(()=>import("./atlas-import.CrAV29KX.js"),__vite__mapDeps([19,2,1,3,4,5,6,7]),import.meta.url).then(e=>({default:e.AtlasImport}))),routerBasename=config.routerBasename.endsWith("/")?config.routerBasename.slice(0,-1):config.routerBasename;function createRouter(e){return createBrowserRouter(e,{basename:routerBasename,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function createRoutes(){return[{element:jsx(Suspense,{name:"RouteRoot",children:jsx(Root,{})}),children:[{index:!0,path:"d?/:driveId?/*?",element:jsx(Suspense,{name:"Drive",children:jsx(Content,{})})},{path:"import/:documentId",element:jsx(Suspense,{name:"AtlasImport",children:jsx(AtlasImport,{})})}]}]}const routes=createRoutes(),router=createRouter(routes),Router=()=>jsx(RouterProvider,{router});window.__VITE_ENVS.MODE==="development"?window.documentEditorDebugTools=new DocumentEditorDebugTools:serviceWorkerManager.registerServiceWorker(!1);const App=()=>jsx(SentryProvider,{children:jsx(WagmiContext,{children:jsxs(ProcessorManagerProvider,{children:[jsx(ToastContainer,{position:"bottom-right",containerId:"connect"}),jsx(Router,{}),jsx(Analytics,{})]})})}),app=Object.freeze(Object.defineProperty({__proto__:null,default:App},Symbol.toStringTag,{value:"Module"})),logger=childLogger(["sentry"]);let clientStarted=!1;async function getSentry(){return await __vitePreload(()=>import("./index.MXCURbo4.js"),__vite__mapDeps([20,2,1,3,4,5]),import.meta.url)}async function initSentry(){const e=window.__VITE_ENVS.SENTRY_RELEASE,t=await getSentry(),I=[t.httpClientIntegration(),t.extraErrorDataIntegration({depth:5}),t.replayIntegration(),t.captureConsoleIntegration({levels:["error"]})];config.sentry.tracing&&I.push(t.reactRouterV6BrowserTracingIntegration({useEffect:React__default.useEffect,useLocation,useNavigationType,createRoutesFromChildren,matchRoutes})),t.init({release:e,dsn:config.sentry.dsn,environment:config.sentry.env,integrations:I,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(B,tr){const rr=tr.originalException;return rr instanceof TypeError&&rr.message.includes("Failed to fetch")&&!navigator.onLine?null:B}}),clientStarted=!0}async function closeClient(){if(!clientStarted)return;const t=(await getSentry()).getClient();return t==null?void 0:t.close()}function useInitSentry(){const[e]=useAcceptedCookies(),{analytics:t}=e;useEffect(()=>{if(!t){closeClient().catch(I=>logger.error(I));return}clientStarted||!config.sentry.dsn||config.sentry.dsn===""||initSentry().catch(I=>logger.error(I))},[t])}export{AnalyticsPath as A,Cr as C,DateTime as D,Nr as N,Outlet as O,PGLITE_UPDATE_EVENT as P,R$2 as R,T,Ue as U,usePGliteDB as a,useSetPGliteDB as b,useAnalyticsStoreAsync as c,useAnalyticsEngineAsync as d,ee as e,AnalyticsGranularity as f,useNavigate as g,h$1 as h,useLocation as i,j,useSearchParams as k,useParams as l,ur as m,C as n,cr as o,pr as p,U$2 as q,app as r,u$1 as u,x$2 as x,z};
|
|
368
|
-
//# sourceMappingURL=useInitSentry.DX0S8ltZ.js.map
|