wadi 1.0.0
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/.agent/workflows/auto_sync.md +19 -0
- package/.agent/workflows/kivo_pipeline.md +27 -0
- package/.devcontainer/devcontainer.json +27 -0
- package/.github/workflows/kivo-cicd.yml +45 -0
- package/.github/workflows/monorepo-ci.yml +51 -0
- package/.github/workflows/wadi-ci.yml +38 -0
- package/.husky/pre-commit +2 -0
- package/.prettierignore +12 -0
- package/.prettierrc +9 -0
- package/.vscode/settings.json +19 -0
- package/CHANGELOG.md +56 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +42 -0
- package/DEPLOY_GUIDE.md +143 -0
- package/GO_LIVE_CHECKLIST.md +41 -0
- package/GO_LIVE_COMPLETE_REPORT.md +58 -0
- package/GO_LIVE_VALIDATION.md +39 -0
- package/LEGAL.md +38 -0
- package/MANIFESTO.md +40 -0
- package/MANUAL.md +82 -0
- package/OPS_PLAN.md +90 -0
- package/README.md +126 -0
- package/RELEASE_NOTES.md +51 -0
- package/ROADMAP.md +51 -0
- package/api_listado.txt +2197 -0
- package/apps/api/WADI_PROTOCOL.md +52 -0
- package/apps/api/debug-brain.js +11 -0
- package/apps/api/package.json +21 -0
- package/apps/api/src/core/analisis.js +17 -0
- package/apps/api/src/core/errors.js +31 -0
- package/apps/api/src/core/logger.js +32 -0
- package/apps/api/src/core/prompt-kivo.js +62 -0
- package/apps/api/src/index.js +212 -0
- package/apps/api/src/layers/human_pattern/composeResponse.js +35 -0
- package/apps/api/src/layers/human_pattern/detectPattern.js +39 -0
- package/apps/api/src/layers/human_pattern/heuristics.js +28 -0
- package/apps/api/src/layers/human_pattern/index.js +28 -0
- package/apps/api/src/layers/human_pattern/socialMemory.js +35 -0
- package/apps/api/src/middleware/errorHandler.js +24 -0
- package/apps/api/src/middleware/rateLimiter.js +38 -0
- package/apps/api/src/middleware/requestLogger.js +31 -0
- package/apps/api/src/middleware/upload.js +21 -0
- package/apps/api/src/middleware/validation.js +70 -0
- package/apps/api/src/modules/data.js +25 -0
- package/apps/api/src/modules/marketing.js +54 -0
- package/apps/api/src/modules/projects.js +40 -0
- package/apps/api/src/openai.js +16 -0
- package/apps/api/src/preferences/index.js +20 -0
- package/apps/api/src/register_user.js +22 -0
- package/apps/api/src/routes/kivo.js +58 -0
- package/apps/api/src/routes/monitoring.js +55 -0
- package/apps/api/src/routes.js +656 -0
- package/apps/api/src/supabase.js +17 -0
- package/apps/api/src/tools/index.js +57 -0
- package/apps/api/src/wadi-brain.js +171 -0
- package/apps/api/supabase/migrations/20251218_audit_logs.sql +27 -0
- package/apps/api/supabase/migrations/v2-chat-persistence.sql +83 -0
- package/apps/api/supabase/migrations/v3-cascade-delete.sql +11 -0
- package/apps/api/supabase/migrations/v3-security-fix.sql +90 -0
- package/apps/api/supabase/migrations/v3-storage.sql +36 -0
- package/apps/api/supabase/migrations/v4-gamification.sql +83 -0
- package/apps/api/supabase/migrations/v5-smoke-index.sql +6 -0
- package/apps/api/supabase/migrations/v6-schema-integrity-fix.sql +98 -0
- package/apps/api/supabase/migrations/v7-performance-indexes.sql +5 -0
- package/apps/api/supabase/migrations/v7-security-hardening.sql +132 -0
- package/apps/api/supabase/migrations/v8-security-hardening.sql +79 -0
- package/apps/api/test_human_pattern.js +30 -0
- package/apps/api/test_human_pattern_vague.js +30 -0
- package/apps/api/test_output.txt +76 -0
- package/apps/api/test_vague.js +30 -0
- package/apps/api/test_vague_block.js +30 -0
- package/apps/api/test_wadi.js +31 -0
- package/apps/api/tsconfig.json +13 -0
- package/apps/frontend/.env.local +3 -0
- package/apps/frontend/README.md +73 -0
- package/apps/frontend/eslint.config.js +27 -0
- package/apps/frontend/index.html +49 -0
- package/apps/frontend/package.json +41 -0
- package/apps/frontend/postcss.config.cjs +6 -0
- package/apps/frontend/public/cursors/wadi-neutral.svg +1 -0
- package/apps/frontend/public/cursors/wadi-select.svg +1 -0
- package/apps/frontend/public/icon-192.svg +1 -0
- package/apps/frontend/public/icon-512.svg +1 -0
- package/apps/frontend/public/manifest.webmanifest +23 -0
- package/apps/frontend/public/sw.js +57 -0
- package/apps/frontend/public/vite.svg +1 -0
- package/apps/frontend/public/wadi.svg +5 -0
- package/apps/frontend/src/assets/react.svg +1 -0
- package/apps/frontend/src/components/AuthLoader.tsx +50 -0
- package/apps/frontend/src/components/ChatInput.tsx +272 -0
- package/apps/frontend/src/components/ChatInterface.tsx +202 -0
- package/apps/frontend/src/components/ErrorBoundary.tsx +52 -0
- package/apps/frontend/src/components/InputArea.tsx +201 -0
- package/apps/frontend/src/components/Layout.tsx +73 -0
- package/apps/frontend/src/components/MessageBubble.tsx +66 -0
- package/apps/frontend/src/components/OnboardingModal.tsx +108 -0
- package/apps/frontend/src/components/SettingsModal.tsx +187 -0
- package/apps/frontend/src/components/Sidebar.tsx +171 -0
- package/apps/frontend/src/components/WadiOnboarding.tsx +71 -0
- package/apps/frontend/src/components/auditor/AuditReport.tsx +166 -0
- package/apps/frontend/src/components/auditor/AuditorHeader.tsx +34 -0
- package/apps/frontend/src/components/auditor/ContextPanel.tsx +138 -0
- package/apps/frontend/src/components/auditor/DataDeconstructor.tsx +85 -0
- package/apps/frontend/src/components/auditor/DecisionWall.tsx +65 -0
- package/apps/frontend/src/components/auditor/Dropzone.tsx +137 -0
- package/apps/frontend/src/components/common/Button.tsx +97 -0
- package/apps/frontend/src/components/common/Card.tsx +43 -0
- package/apps/frontend/src/components/common/Input.tsx +73 -0
- package/apps/frontend/src/components/common/Modal.tsx +53 -0
- package/apps/frontend/src/components/ui/Button.tsx +68 -0
- package/apps/frontend/src/components/ui/Card.tsx +86 -0
- package/apps/frontend/src/components/ui/Input.tsx +28 -0
- package/apps/frontend/src/components/ui/LogItem.tsx +64 -0
- package/apps/frontend/src/components/ui/MondayButton.tsx +40 -0
- package/apps/frontend/src/components/ui/MondayCard.tsx +24 -0
- package/apps/frontend/src/components/ui/Scouter.tsx +208 -0
- package/apps/frontend/src/components/ui/TerminalInput.tsx +202 -0
- package/apps/frontend/src/components/ui/Tooltip.tsx +67 -0
- package/apps/frontend/src/config/chatShortcuts.ts +20 -0
- package/apps/frontend/src/config/supabase.ts +6 -0
- package/apps/frontend/src/final_status.txt +3 -0
- package/apps/frontend/src/hooks/useScouter.ts +28 -0
- package/apps/frontend/src/hooks/useStoreHydration.ts +24 -0
- package/apps/frontend/src/improvement_status.txt +5 -0
- package/apps/frontend/src/index.css +88 -0
- package/apps/frontend/src/main.tsx +62 -0
- package/apps/frontend/src/monday_status.txt +7 -0
- package/apps/frontend/src/pages/ChatPage.tsx +201 -0
- package/apps/frontend/src/pages/DashboardPage.tsx +375 -0
- package/apps/frontend/src/pages/IntroWadi.tsx +114 -0
- package/apps/frontend/src/pages/LandingPage.tsx +103 -0
- package/apps/frontend/src/pages/Login.tsx +190 -0
- package/apps/frontend/src/pages/PrivacyPage.tsx +213 -0
- package/apps/frontend/src/pages/ProjectDetail.tsx +80 -0
- package/apps/frontend/src/pages/Projects.tsx +247 -0
- package/apps/frontend/src/pages/TermsPage.tsx +202 -0
- package/apps/frontend/src/router.tsx +83 -0
- package/apps/frontend/src/store/authStore.ts +152 -0
- package/apps/frontend/src/store/chatStore.ts +837 -0
- package/apps/frontend/src/store/documentStore.ts +89 -0
- package/apps/frontend/src/store/projectsStore.ts +111 -0
- package/apps/frontend/src/store/runsStore.ts +98 -0
- package/apps/frontend/src/utils/api.ts +34 -0
- package/apps/frontend/src/vite-env.d.ts +7 -0
- package/apps/frontend/tailwind.config.cjs +32 -0
- package/apps/frontend/tsconfig.app.json +27 -0
- package/apps/frontend/tsconfig.json +7 -0
- package/apps/frontend/tsconfig.node.json +26 -0
- package/apps/frontend/vite.config.ts +25 -0
- package/apps/kivo/.firebase/hosting.d3d3.cache +11 -0
- package/apps/kivo/.firebaserc +5 -0
- package/apps/kivo/BRANDING_GUIDE.md +71 -0
- package/apps/kivo/DEPLOYMENT_READY.md +46 -0
- package/apps/kivo/DEPLOY_URL.md +12 -0
- package/apps/kivo/IMPLEMENTATION_REPORT.md +35 -0
- package/apps/kivo/IMPLEMENTATION_REPORT_FINAL.md +49 -0
- package/apps/kivo/PLAN_MOBILE_2.0.md +44 -0
- package/apps/kivo/PWA_VERIFICATION_GUIDE.md +77 -0
- package/apps/kivo/README.md +28 -0
- package/apps/kivo/REBUILD_REPORT.md +34 -0
- package/apps/kivo/UPGRADE_REPORT.md +35 -0
- package/apps/kivo/android/app/build.gradle +54 -0
- package/apps/kivo/android/app/capacitor.build.gradle +19 -0
- package/apps/kivo/android/app/proguard-rules.pro +21 -0
- package/apps/kivo/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
- package/apps/kivo/android/app/src/main/AndroidManifest.xml +35 -0
- package/apps/kivo/android/app/src/main/java/com/kivo/app/MainActivity.java +5 -0
- package/apps/kivo/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/apps/kivo/android/app/src/main/res/drawable/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-night/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/apps/kivo/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/apps/kivo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +9 -0
- package/apps/kivo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +9 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- package/apps/kivo/android/app/src/main/res/values/strings.xml +7 -0
- package/apps/kivo/android/app/src/main/res/values/styles.xml +22 -0
- package/apps/kivo/android/app/src/main/res/xml/file_paths.xml +5 -0
- package/apps/kivo/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
- package/apps/kivo/android/build.gradle +29 -0
- package/apps/kivo/android/capacitor.settings.gradle +3 -0
- package/apps/kivo/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/apps/kivo/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/apps/kivo/android/gradle.properties +22 -0
- package/apps/kivo/android/gradlew +252 -0
- package/apps/kivo/android/gradlew.bat +94 -0
- package/apps/kivo/android/settings.gradle +5 -0
- package/apps/kivo/android/variables.gradle +16 -0
- package/apps/kivo/assets/icon.png +0 -0
- package/apps/kivo/assets/splash.png +0 -0
- package/apps/kivo/capacitor.config.json +16 -0
- package/apps/kivo/firebase.json +6 -0
- package/apps/kivo/jest.config.js +4 -0
- package/apps/kivo/package.json +26 -0
- package/apps/kivo/tests_disabled/logic.test.js +34 -0
- package/apps/kivo/www/assets/icon-192.png +0 -0
- package/apps/kivo/www/assets/icon-512.png +0 -0
- package/apps/kivo/www/assets/kivo-icon.png +0 -0
- package/apps/kivo/www/assets/pop.mp3 +0 -0
- package/apps/kivo/www/favicon.ico +0 -0
- package/apps/kivo/www/firebase-config.js +75 -0
- package/apps/kivo/www/index.html +38 -0
- package/apps/kivo/www/manifest.json +29 -0
- package/apps/kivo/www/script.js +72 -0
- package/apps/kivo/www/style.css +82 -0
- package/apps/kivo/www/sw.js +46 -0
- package/apps/kivo-brain-api/.env.example +2 -0
- package/apps/kivo-brain-api/KIVO_BACKEND_SETUP.md +27 -0
- package/apps/kivo-brain-api/controllers/kivoController.js +31 -0
- package/apps/kivo-brain-api/index.js +24 -0
- package/apps/kivo-brain-api/package.json +17 -0
- package/apps/kivo-brain-api/routes/message.js +8 -0
- package/apps/kivo-brain-api/services/openaiService.js +64 -0
- package/apps/tests/wadi-tests.js +155 -0
- package/apps/wadi-brain/docs/README_REMOVE_OPTIONS.md +26 -0
- package/cli/commands/deploy.js +10 -0
- package/cli/commands/docs.js +16 -0
- package/cli/commands/explain.js +29 -0
- package/cli/commands/lint.js +14 -0
- package/cli/index.js +26 -0
- package/cli/package.json +12 -0
- package/docs/CNAME +1 -0
- package/docs/README.md +38 -0
- package/docs/USO.md +30 -0
- package/docs/index.html +46 -0
- package/eslint.config.js +101 -0
- package/final_validation.json +27 -0
- package/frontend_listado.txt +33387 -0
- package/listado.txt +12591 -0
- package/package.json +46 -0
- package/packages/logger/index.js +43 -0
- package/packages/logger/package.json +19 -0
- package/packages/logger/test-logger.js +7 -0
- package/packages_listado.txt +801 -0
- package/pnpm-workspace.yaml +6 -0
- package/reseteador_existencial.ps1 +40 -0
- package/scripts/bump-version.js +26 -0
- package/scripts/env.ps1 +13 -0
- package/scripts/setup_android.ps1 +25 -0
- package/scripts/setup_virtual_env.ps1 +77 -0
- package/scripts/smoke-test.js +84 -0
- package/scripts/trigger_render_deploy.ps1 +3 -0
- package/scripts/validate-release.js +34 -0
- package/temp_check.js +57 -0
- package/tsconfig.json +5 -0
- package/validation_report.json +27 -0
package/temp_check.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function gg(r,n){for(var i=0;i<n.length;i++){const l=n[i];if(typeof l!="string"&&!Array.isArray(l)){for(const o in l)if(o!=="default"&&!(o in r)){const u=Object.getOwnPropertyDescriptor(l,o);u&&Object.defineProperty(r,o,u.get?u:{enumerable:!0,get:()=>l[o]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();function vg(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function t_(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var n=r.default;if(typeof n=="function"){var i=function l(){var o=!1;try{o=this instanceof l}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};i.prototype=n.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(r).forEach(function(l){var o=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(i,l,o.get?o:{enumerable:!0,get:function(){return r[l]}})}),i}var rf={exports:{}},El={};var Xp;function n_(){if(Xp)return El;Xp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(l,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var h in o)h!=="key"&&(u[h]=o[h])}else u=o;return o=u.ref,{$$typeof:r,type:l,key:f,ref:o!==void 0?o:null,props:u}}return El.Fragment=n,El.jsx=i,El.jsxs=i,El}var Zp;function a_(){return Zp||(Zp=1,rf.exports=n_()),rf.exports}var B=a_(),lf={exports:{}},we={};var Fp;function r_(){if(Fp)return we;Fp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),w=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function k(O,V,Q){this.props=O,this.context=V,this.refs=R,this.updater=Q||S}k.prototype.isReactComponent={},k.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,V,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function q(){}q.prototype=k.prototype;function $(O,V,Q){this.props=O,this.context=V,this.refs=R,this.updater=Q||S}var Z=$.prototype=new q;Z.constructor=$,C(Z,k.prototype),Z.isPureReactComponent=!0;var ne=Array.isArray;function le(){}var x={H:null,A:null,T:null,S:null},ge=Object.prototype.hasOwnProperty;function pe(O,V,Q){var te=Q.ref;return{$$typeof:r,type:O,key:V,ref:te!==void 0?te:null,props:Q}}function Pe(O,V){return pe(O.type,V,O.props)}function _e(O){return typeof O=="object"&&O!==null&&O.$$typeof===r}function Ye(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Q){return V[Q]})}var Ge=/\/+/g;function Ue(O,V){return typeof O=="object"&&O!==null&&O.key!=null?Ye(""+O.key):V.toString(36)}function ke(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(le,le):(O.status="pending",O.then(function(V){O.status==="pending"&&(O.status="fulfilled",O.value=V)},function(V){O.status==="pending"&&(O.status="rejected",O.reason=V)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function P(O,V,Q,te,me){var be=typeof O;(be==="undefined"||be==="boolean")&&(O=null);var ze=!1;if(O===null)ze=!0;else switch(be){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(O.$$typeof){case r:case n:ze=!0;break;case g:return ze=O._init,P(ze(O._payload),V,Q,te,me)}}if(ze)return me=me(O),ze=te===""?"."+Ue(O,0):te,ne(me)?(Q="",ze!=null&&(Q=ze.replace(Ge,"$&/")+"/"),P(me,V,Q,"",function(Ka){return Ka})):me!=null&&(_e(me)&&(me=Pe(me,Q+(me.key==null||O&&O.key===me.key?"":(""+me.key).replace(Ge,"$&/")+"/")+ze)),V.push(me)),1;ze=0;var ft=te===""?".":te+":";if(ne(O))for(var it=0;it<O.length;it++)te=O[it],be=ft+Ue(te,it),ze+=P(te,V,Q,be,me);else if(it=_(O),typeof it=="function")for(O=it.call(O),it=0;!(te=O.next()).done;)te=te.value,be=ft+Ue(te,it++),ze+=P(te,V,Q,be,me);else if(be==="object"){if(typeof O.then=="function")return P(ke(O),V,Q,te,me);throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ze}function J(O,V,Q){if(O==null)return O;var te=[],me=0;return P(O,te,"","",function(be){return V.call(Q,be,me++)}),te}function W(O){if(O._status===-1){var V=O._result;V=V(),V.then(function(Q){(O._status===0||O._status===-1)&&(O._status=1,O._result=Q)},function(Q){(O._status===0||O._status===-1)&&(O._status=2,O._result=Q)}),O._status===-1&&(O._status=0,O._result=V)}if(O._status===1)return O._result.default;throw O._result}var Se=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Oe={map:J,forEach:function(O,V,Q){J(O,function(){V.apply(this,arguments)},Q)},count:function(O){var V=0;return J(O,function(){V++}),V},toArray:function(O){return J(O,function(V){return V})||[]},only:function(O){if(!_e(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return we.Activity=v,we.Children=Oe,we.Component=k,we.Fragment=i,we.Profiler=o,we.PureComponent=$,we.StrictMode=l,we.Suspense=m,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,we.__COMPILER_RUNTIME={__proto__:null,c:function(O){return x.H.useMemoCache(O)}},we.cache=function(O){return function(){return O.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(O,V,Q){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var te=C({},O.props),me=O.key;if(V!=null)for(be in V.key!==void 0&&(me=""+V.key),V)!ge.call(V,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&V.ref===void 0||(te[be]=V[be]);var be=arguments.length-2;if(be===1)te.children=Q;else if(1<be){for(var ze=Array(be),ft=0;ft<be;ft++)ze[ft]=arguments[ft+2];te.children=ze}return pe(O.type,me,te)},we.createContext=function(O){return O={$$typeof:f,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:u,_context:O},O},we.createElement=function(O,V,Q){var te,me={},be=null;if(V!=null)for(te in V.key!==void 0&&(be=""+V.key),V)ge.call(V,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(me[te]=V[te]);var ze=arguments.length-2;if(ze===1)me.children=Q;else if(1<ze){for(var ft=Array(ze),it=0;it<ze;it++)ft[it]=arguments[it+2];me.children=ft}if(O&&O.defaultProps)for(te in ze=O.defaultProps,ze)me[te]===void 0&&(me[te]=ze[te]);return pe(O,be,me)},we.createRef=function(){return{current:null}},we.forwardRef=function(O){return{$$typeof:h,render:O}},we.isValidElement=_e,we.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:W}},we.memo=function(O,V){return{$$typeof:p,type:O,compare:V===void 0?null:V}},we.startTransition=function(O){var V=x.T,Q={};x.T=Q;try{var te=O(),me=x.S;me!==null&&me(Q,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(le,Se)}catch(be){Se(be)}finally{V!==null&&Q.types!==null&&(V.types=Q.types),x.T=V}},we.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},we.use=function(O){return x.H.use(O)},we.useActionState=function(O,V,Q){return x.H.useActionState(O,V,Q)},we.useCallback=function(O,V){return x.H.useCallback(O,V)},we.useContext=function(O){return x.H.useContext(O)},we.useDebugValue=function(){},we.useDeferredValue=function(O,V){return x.H.useDeferredValue(O,V)},we.useEffect=function(O,V){return x.H.useEffect(O,V)},we.useEffectEvent=function(O){return x.H.useEffectEvent(O)},we.useId=function(){return x.H.useId()},we.useImperativeHandle=function(O,V,Q){return x.H.useImperativeHandle(O,V,Q)},we.useInsertionEffect=function(O,V){return x.H.useInsertionEffect(O,V)},we.useLayoutEffect=function(O,V){return x.H.useLayoutEffect(O,V)},we.useMemo=function(O,V){return x.H.useMemo(O,V)},we.useOptimistic=function(O,V){return x.H.useOptimistic(O,V)},we.useReducer=function(O,V,Q){return x.H.useReducer(O,V,Q)},we.useRef=function(O){return x.H.useRef(O)},we.useState=function(O){return x.H.useState(O)},we.useSyncExternalStore=function(O,V,Q){return x.H.useSyncExternalStore(O,V,Q)},we.useTransition=function(){return x.H.useTransition()},we.version="19.2.1",we}var Wp;function Yf(){return Wp||(Wp=1,lf.exports=r_()),lf.exports}var U=Yf();const Al=vg(U),i_=gg({__proto__:null,default:Al},[U]);var sf={exports:{}},Tl={},of={exports:{}},uf={};var ey;function l_(){return ey||(ey=1,(function(r){function n(P,J){var W=P.length;P.push(J);e:for(;0<W;){var Se=W-1>>>1,Oe=P[Se];if(0<o(Oe,J))P[Se]=J,P[W]=Oe,W=Se;else break e}}function i(P){return P.length===0?null:P[0]}function l(P){if(P.length===0)return null;var J=P[0],W=P.pop();if(W!==J){P[0]=W;e:for(var Se=0,Oe=P.length,O=Oe>>>1;Se<O;){var V=2*(Se+1)-1,Q=P[V],te=V+1,me=P[te];if(0>o(Q,W))te<Oe&&0>o(me,Q)?(P[Se]=me,P[te]=W,Se=te):(P[Se]=Q,P[V]=W,Se=V);else if(te<Oe&&0>o(me,W))P[Se]=me,P[te]=W,Se=te;else break e}}return J}function o(P,J){var W=P.sortIndex-J.sortIndex;return W!==0?W:P.id-J.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();r.unstable_now=function(){return f.now()-h}}var m=[],p=[],g=1,v=null,w=3,_=!1,S=!1,C=!1,R=!1,k=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function Z(P){for(var J=i(p);J!==null;){if(J.callback===null)l(p);else if(J.startTime<=P)l(p),J.sortIndex=J.expirationTime,n(m,J);else break;J=i(p)}}function ne(P){if(C=!1,Z(P),!S)if(i(m)!==null)S=!0,le||(le=!0,Ye());else{var J=i(p);J!==null&&ke(ne,J.startTime-P)}}var le=!1,x=-1,ge=5,pe=-1;function Pe(){return R?!0:!(r.unstable_now()-pe<ge)}function _e(){if(R=!1,le){var P=r.unstable_now();pe=P;var J=!0;try{e:{S=!1,C&&(C=!1,q(x),x=-1),_=!0;var W=w;try{t:{for(Z(P),v=i(m);v!==null&&!(v.expirationTime>P&&Pe());){var Se=v.callback;if(typeof Se=="function"){v.callback=null,w=v.priorityLevel;var Oe=Se(v.expirationTime<=P);if(P=r.unstable_now(),typeof Oe=="function"){v.callback=Oe,Z(P),J=!0;break t}v===i(m)&&l(m),Z(P)}else l(m);v=i(m)}if(v!==null)J=!0;else{var O=i(p);O!==null&&ke(ne,O.startTime-P),J=!1}}break e}finally{v=null,w=W,_=!1}J=void 0}}finally{J?Ye():le=!1}}}var Ye;if(typeof $=="function")Ye=function(){$(_e)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Ue=Ge.port2;Ge.port1.onmessage=_e,Ye=function(){Ue.postMessage(null)}}else Ye=function(){k(_e,0)};function ke(P,J){x=k(function(){P(r.unstable_now())},J)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(P){P.callback=null},r.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ge=0<P?Math.floor(1e3/P):5},r.unstable_getCurrentPriorityLevel=function(){return w},r.unstable_next=function(P){switch(w){case 1:case 2:case 3:var J=3;break;default:J=w}var W=w;w=J;try{return P()}finally{w=W}},r.unstable_requestPaint=function(){R=!0},r.unstable_runWithPriority=function(P,J){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var W=w;w=P;try{return J()}finally{w=W}},r.unstable_scheduleCallback=function(P,J,W){var Se=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Se+W:Se):W=Se,P){case 1:var Oe=-1;break;case 2:Oe=250;break;case 5:Oe=1073741823;break;case 4:Oe=1e4;break;default:Oe=5e3}return Oe=W+Oe,P={id:g++,callback:J,priorityLevel:P,startTime:W,expirationTime:Oe,sortIndex:-1},W>Se?(P.sortIndex=W,n(p,P),i(m)===null&&P===i(p)&&(C?(q(x),x=-1):C=!0,ke(ne,W-Se))):(P.sortIndex=Oe,n(m,P),S||_||(S=!0,le||(le=!0,Ye()))),P},r.unstable_shouldYield=Pe,r.unstable_wrapCallback=function(P){var J=w;return function(){var W=w;w=J;try{return P.apply(this,arguments)}finally{w=W}}}})(uf)),uf}var ty;function s_(){return ty||(ty=1,of.exports=l_()),of.exports}var cf={exports:{}},Mt={};var ny;function o_(){if(ny)return Mt;ny=1;var r=Yf();function n(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,p,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:p,implementation:g}}var f=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Mt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Mt.createPortal=function(m,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return u(m,p,null,g)},Mt.flushSync=function(m){var p=f.T,g=l.p;try{if(f.T=null,l.p=2,m)return m()}finally{f.T=p,l.p=g,l.d.f()}},Mt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(m,p))},Mt.prefetchDNS=function(m){typeof m=="string"&&l.d.D(m)},Mt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var g=p.as,v=h(g,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?l.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:_}):g==="script"&&l.d.X(m,{crossOrigin:v,integrity:w,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Mt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=h(p.as,p.crossOrigin);l.d.M(m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(m)},Mt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,v=h(g,p.crossOrigin);l.d.L(m,g,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Mt.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=h(p.as,p.crossOrigin);l.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(m)},Mt.requestFormReset=function(m){l.d.r(m)},Mt.unstable_batchedUpdates=function(m,p){return m(p)},Mt.useFormState=function(m,p,g){return f.H.useFormState(m,p,g)},Mt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Mt.version="19.2.1",Mt}var ay;function bg(){if(ay)return cf.exports;ay=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),cf.exports=o_(),cf.exports}var ry;function u_(){if(ry)return Tl;ry=1;var r=s_(),n=Yf(),i=bg();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(l(188))}function p(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(l(188));return t!==e?null:e}for(var a=e,s=t;;){var c=a.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){a=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===a)return m(c),e;if(d===s)return m(c),t;d=d.sibling}throw Error(l(188))}if(a.return!==s.return)a=c,s=d;else{for(var y=!1,b=c.child;b;){if(b===a){y=!0,a=c,s=d;break}if(b===s){y=!0,s=c,a=d;break}b=b.sibling}if(!y){for(b=d.child;b;){if(b===a){y=!0,a=d,s=c;break}if(b===s){y=!0,s=d,a=c;break}b=b.sibling}if(!y)throw Error(l(189))}}if(a.alternate!==s)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),$=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),Pe=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function Ye(e){return e===null||typeof e!="object"?null:(e=_e&&e[_e]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case k:return"Profiler";case R:return"StrictMode";case ne:return"Suspense";case le:return"SuspenseList";case pe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case $:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case x:return t=e.displayName||null,t!==null?t:Ue(e.type)||"Memo";case ge:t=e._payload,e=e._init;try{return Ue(e(t))}catch{}}return null}var ke=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Se=[],Oe=-1;function O(e){return{current:e}}function V(e){0>Oe||(e.current=Se[Oe],Se[Oe]=null,Oe--)}function Q(e,t){Oe++,Se[Oe]=e.current,e.current=t}var te=O(null),me=O(null),be=O(null),ze=O(null);function ft(e,t){switch(Q(be,t),Q(me,e),Q(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=_p(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(te),Q(te,e)}function it(){V(te),V(me),V(be)}function Ka(e){e.memoizedState!==null&&Q(ze,e);var t=te.current,a=_p(t,e.type);t!==a&&(Q(me,e),Q(te,a))}function Ar(e){me.current===e&&(V(te),V(me)),ze.current===e&&(V(ze),bl._currentValue=W)}var yt,Gn;function kn(e){if(yt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);yt=t&&t[1]||"",Gn=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+yt+e+Gn}var Ci=!1;function Tn(e,t){if(!e||Ci)return"";Ci=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(H){var N=H}Reflect.construct(e,[],I)}else{try{I.call()}catch(H){N=H}e.call(I.prototype)}}else{try{throw Error()}catch(H){N=H}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(H){if(H&&N&&typeof H.stack=="string")return[H.stack,N.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),y=d[0],b=d[1];if(y&&b){var E=y.split(`
|
|
4
|
+
`),M=b.split(`
|
|
5
|
+
`);for(c=s=0;s<E.length&&!E[s].includes("DetermineComponentFrameRoot");)s++;for(;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;if(s===E.length||c===M.length)for(s=E.length-1,c=M.length-1;1<=s&&0<=c&&E[s]!==M[c];)c--;for(;1<=s&&0<=c;s--,c--)if(E[s]!==M[c]){if(s!==1||c!==1)do if(s--,c--,0>c||E[s]!==M[c]){var G=`
|
|
6
|
+
`+E[s].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=s&&0<=c);break}}}finally{Ci=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?kn(a):""}function Go(e,t){switch(e.tag){case 26:case 27:case 5:return kn(e.type);case 16:return kn("Lazy");case 13:return e.child!==t&&t!==null?kn("Suspense Fallback"):kn("Suspense");case 19:return kn("SuspenseList");case 0:case 15:return Tn(e.type,!1);case 11:return Tn(e.type.render,!1);case 1:return Tn(e.type,!0);case 31:return kn("Activity");default:return""}}function Kl(e){try{var t="",a=null;do t+=Go(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var Cr=Object.prototype.hasOwnProperty,ji=r.unstable_scheduleCallback,Di=r.unstable_cancelCallback,Yo=r.unstable_shouldYield,Io=r.unstable_requestPaint,dt=r.unstable_now,Ja=r.unstable_getCurrentPriorityLevel,Ui=r.unstable_ImmediatePriority,jr=r.unstable_UserBlockingPriority,Ht=r.unstable_NormalPriority,On=r.unstable_LowPriority,zi=r.unstable_IdlePriority,Ko=r.log,Mi=r.unstable_setDisableYieldValue,Qa=null,lt=null;function Rn(e){if(typeof Ko=="function"&&Mi(e),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Qa,e)}catch{}}var zt=Math.clz32?Math.clz32:Ql,Jl=Math.log,Jo=Math.LN2;function Ql(e){return e>>>=0,e===0?32:31-(Jl(e)/Jo|0)|0}var Yn=256,Xa=262144,da=4194304;function In(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Za(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var b=s&134217727;return b!==0?(s=b&~d,s!==0?c=In(s):(y&=b,y!==0?c=In(y):a||(a=b&~e,a!==0&&(c=In(a))))):(b=s&~d,b!==0?c=In(b):y!==0?c=In(y):a||(a=s&~e,a!==0&&(c=In(a)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:c}function Fa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wa(){var e=da;return da<<=1,(da&62914560)===0&&(da=4194304),e}function ha(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ma(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qo(e,t,a,s,c,d){var y=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,E=e.expirationTimes,M=e.hiddenUpdates;for(a=y&~a;0<a;){var G=31-zt(a),I=1<<G;b[G]=0,E[G]=-1;var N=M[G];if(N!==null)for(M[G]=null,G=0;G<N.length;G++){var H=N[G];H!==null&&(H.lane&=-536870913)}a&=~I}s!==0&&Zl(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function Zl(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-zt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function T(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-zt(a),c=1<<s;c&t|e[s]&t&&(e[s]|=t),a&=~c}}function D(e,t){var a=t&-t;return a=(a&42)!==0?1:L(a),(a&(e.suspendedLanes|t))!==0?0:a}function L(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function K(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function X(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Vp(e.type))}function ue(e,t){var a=J.p;try{return J.p=e,t()}finally{J.p=a}}var ae=Math.random().toString(36).slice(2),F="__reactFiber$"+ae,ee="__reactProps$"+ae,oe="__reactContainer$"+ae,ce="__reactEvents$"+ae,de="__reactListeners$"+ae,Me="__reactHandles$"+ae,Ie="__reactResources$"+ae,tt="__reactMarker$"+ae;function ot(e){delete e[F],delete e[ee],delete e[ce],delete e[de],delete e[Me]}function Le(e){var t=e[F];if(t)return t;for(var a=e.parentNode;a;){if(t=a[oe]||a[F]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=xp(e);e!==null;){if(a=e[F])return a;e=xp(e)}return t}e=a,a=e.parentNode}return null}function Be(e){if(e=e[F]||e[oe]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function cn(e){var t=e[Ie];return t||(t=e[Ie]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Fe(e){e[tt]=!0}var Qt=new Set,Dr={};function Xt(e,t){qt(e,t),qt(e+"Capture",t)}function qt(e,t){for(Dr[e]=t,e=0;e<t.length;e++)Qt.add(t[e])}var Ur=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),er={},Ce={};function Tt(e){return Cr.call(Ce,e)?!0:Cr.call(er,e)?!1:Ur.test(e)?Ce[e]=!0:(er[e]=!0,!1)}function xn(e,t,a){if(Tt(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function fn(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function He(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ni(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xo(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){a=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zo(e){if(!e._valueTracker){var t=Ni(e)?"checked":"value";e._valueTracker=Xo(e,t,""+e[t])}}function dd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=Ni(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Fl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Qv=/[\n"\\]/g;function dn(e){return e.replace(Qv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fo(e,t,a,s,c,d,y,b){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?Wo(e,y,xt(t)):a!=null?Wo(e,y,xt(a)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+xt(b):e.removeAttribute("name")}function hd(e,t,a,s,c,d,y,b){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Zo(e);return}a=a!=null?""+xt(a):"",t=t!=null?""+xt(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=b?e.checked:!!s,e.defaultChecked=!!s,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Zo(e)}function Wo(e,t,a){t==="number"&&Fl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function zr(e,t,a,s){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&s&&(e[a].defaultSelected=!0)}else{for(a=""+xt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function md(e,t,a){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+xt(a):""}function pd(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(l(92));if(ke(s)){if(1<s.length)throw Error(l(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=xt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Zo(e)}function Mr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Xv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function yd(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||Xv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function gd(e,t,a){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&a[c]!==s&&yd(e,c,s)}else for(var d in t)t.hasOwnProperty(d)&&yd(e,d,t[d])}function eu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Zv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Fv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Wl(e){return Fv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var tu=null;function nu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nr=null,kr=null;function vd(e){var t=Be(e);if(t&&(e=t.stateNode)){var a=e[ee]||null;e:switch(e=t.stateNode,t.type){case"input":if(Fo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+dn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var c=s[ee]||null;if(!c)throw Error(l(90));Fo(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&dd(s)}break e;case"textarea":md(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&zr(e,!!a.multiple,t,!1)}}}var au=!1;function bd(e,t,a){if(au)return e(t,a);au=!0;try{var s=e(t);return s}finally{if(au=!1,(Nr!==null||kr!==null)&&(qs(),Nr&&(t=Nr,e=kr,kr=Nr=null,vd(t),e)))for(t=0;t<e.length;t++)vd(e[t])}}function ki(e,t){var a=e.stateNode;if(a===null)return null;var s=a[ee]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(l(231,t,typeof a));return a}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ru=!1;if(Jn)try{var Li={};Object.defineProperty(Li,"passive",{get:function(){ru=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{ru=!1}var pa=null,iu=null,es=null;function _d(){if(es)return es;var e,t=iu,a=t.length,s,c="value"in pa?pa.value:pa.textContent,d=c.length;for(e=0;e<a&&t[e]===c[e];e++);var y=a-e;for(s=1;s<=y&&t[a-s]===c[d-s];s++);return es=c.slice(e,1<s?1-s:void 0)}function ts(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ns(){return!0}function wd(){return!1}function $t(e){function t(a,s,c,d,y){this._reactName=a,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(d):d[b]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ns:wd,this.isPropagationStopped=wd,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ns)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ns)},persist:function(){},isPersistent:ns}),t}var tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},as=$t(tr),Bi=v({},tr,{view:0,detail:0}),Wv=$t(Bi),lu,su,Hi,rs=v({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Hi&&(Hi&&e.type==="mousemove"?(lu=e.screenX-Hi.screenX,su=e.screenY-Hi.screenY):su=lu=0,Hi=e),lu)},movementY:function(e){return"movementY"in e?e.movementY:su}}),Sd=$t(rs),e0=v({},rs,{dataTransfer:0}),t0=$t(e0),n0=v({},Bi,{relatedTarget:0}),ou=$t(n0),a0=v({},tr,{animationName:0,elapsedTime:0,pseudoElement:0}),r0=$t(a0),i0=v({},tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),l0=$t(i0),s0=v({},tr,{data:0}),Ed=$t(s0),o0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},u0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},c0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function f0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=c0[e])?!!t[e]:!1}function uu(){return f0}var d0=v({},Bi,{key:function(e){if(e.key){var t=o0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ts(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?u0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uu,charCode:function(e){return e.type==="keypress"?ts(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ts(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),h0=$t(d0),m0=v({},rs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=$t(m0),p0=v({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uu}),y0=$t(p0),g0=v({},tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),v0=$t(g0),b0=v({},rs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_0=$t(b0),w0=v({},tr,{newState:0,oldState:0}),S0=$t(w0),E0=[9,13,27,32],cu=Jn&&"CompositionEvent"in window,qi=null;Jn&&"documentMode"in document&&(qi=document.documentMode);var T0=Jn&&"TextEvent"in window&&!qi,Od=Jn&&(!cu||qi&&8<qi&&11>=qi),Rd=" ",xd=!1;function Ad(e,t){switch(e){case"keyup":return E0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lr=!1;function O0(e,t){switch(e){case"compositionend":return Cd(t);case"keypress":return t.which!==32?null:(xd=!0,Rd);case"textInput":return e=t.data,e===Rd&&xd?null:e;default:return null}}function R0(e,t){if(Lr)return e==="compositionend"||!cu&&Ad(e,t)?(e=_d(),es=iu=pa=null,Lr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Od&&t.locale!=="ko"?null:t.data;default:return null}}var x0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!x0[e.type]:t==="textarea"}function Dd(e,t,a,s){Nr?kr?kr.push(s):kr=[s]:Nr=s,t=Ks(t,"onChange"),0<t.length&&(a=new as("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var $i=null,Pi=null;function A0(e){hp(e,0)}function is(e){var t=Jt(e);if(dd(t))return e}function Ud(e,t){if(e==="change")return t}var zd=!1;if(Jn){var fu;if(Jn){var du="oninput"in document;if(!du){var Md=document.createElement("div");Md.setAttribute("oninput","return;"),du=typeof Md.oninput=="function"}fu=du}else fu=!1;zd=fu&&(!document.documentMode||9<document.documentMode)}function Nd(){$i&&($i.detachEvent("onpropertychange",kd),Pi=$i=null)}function kd(e){if(e.propertyName==="value"&&is(Pi)){var t=[];Dd(t,Pi,e,nu(e)),bd(A0,t)}}function C0(e,t,a){e==="focusin"?(Nd(),$i=t,Pi=a,$i.attachEvent("onpropertychange",kd)):e==="focusout"&&Nd()}function j0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return is(Pi)}function D0(e,t){if(e==="click")return is(t)}function U0(e,t){if(e==="input"||e==="change")return is(t)}function z0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:z0;function Vi(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var c=a[s];if(!Cr.call(t,c)||!Zt(e[c],t[c]))return!1}return!0}function Ld(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bd(e,t){var a=Ld(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ld(a)}}function Hd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Fl(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Fl(e.document)}return t}function hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var M0=Jn&&"documentMode"in document&&11>=document.documentMode,Br=null,mu=null,Gi=null,pu=!1;function $d(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;pu||Br==null||Br!==Fl(s)||(s=Br,"selectionStart"in s&&hu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Gi&&Vi(Gi,s)||(Gi=s,s=Ks(mu,"onSelect"),0<s.length&&(t=new as("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Br)))}function nr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Hr={animationend:nr("Animation","AnimationEnd"),animationiteration:nr("Animation","AnimationIteration"),animationstart:nr("Animation","AnimationStart"),transitionrun:nr("Transition","TransitionRun"),transitionstart:nr("Transition","TransitionStart"),transitioncancel:nr("Transition","TransitionCancel"),transitionend:nr("Transition","TransitionEnd")},yu={},Pd={};Jn&&(Pd=document.createElement("div").style,"AnimationEvent"in window||(delete Hr.animationend.animation,delete Hr.animationiteration.animation,delete Hr.animationstart.animation),"TransitionEvent"in window||delete Hr.transitionend.transition);function ar(e){if(yu[e])return yu[e];if(!Hr[e])return e;var t=Hr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Pd)return yu[e]=t[a];return e}var Vd=ar("animationend"),Gd=ar("animationiteration"),Yd=ar("animationstart"),N0=ar("transitionrun"),k0=ar("transitionstart"),L0=ar("transitioncancel"),Id=ar("transitionend"),Kd=new Map,gu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");gu.push("scrollEnd");function An(e,t){Kd.set(e,t),Xt(t,[e])}var ls=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},hn=[],qr=0,vu=0;function ss(){for(var e=qr,t=vu=qr=0;t<e;){var a=hn[t];hn[t++]=null;var s=hn[t];hn[t++]=null;var c=hn[t];hn[t++]=null;var d=hn[t];if(hn[t++]=null,s!==null&&c!==null){var y=s.pending;y===null?c.next=c:(c.next=y.next,y.next=c),s.pending=c}d!==0&&Jd(a,c,d)}}function os(e,t,a,s){hn[qr++]=e,hn[qr++]=t,hn[qr++]=a,hn[qr++]=s,vu|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function bu(e,t,a,s){return os(e,t,a,s),us(e)}function rr(e,t){return os(e,null,null,t),us(e)}function Jd(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var c=!1,d=e.return;d!==null;)d.childLanes|=a,s=d.alternate,s!==null&&(s.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-zt(a),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=a|536870912),d):null}function us(e){if(50<dl)throw dl=0,Ac=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function B0(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,t,a,s){return new B0(e,t,a,s)}function _u(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var a=e.alternate;return a===null?(a=Ft(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Qd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function cs(e,t,a,s,c,d){var y=0;if(s=e,typeof e=="function")_u(e)&&(y=1);else if(typeof e=="string")y=Vb(e,a,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case pe:return e=Ft(31,a,t,c),e.elementType=pe,e.lanes=d,e;case C:return ir(a.children,c,d,t);case R:y=8,c|=24;break;case k:return e=Ft(12,a,t,c|2),e.elementType=k,e.lanes=d,e;case ne:return e=Ft(13,a,t,c),e.elementType=ne,e.lanes=d,e;case le:return e=Ft(19,a,t,c),e.elementType=le,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:y=10;break e;case q:y=9;break e;case Z:y=11;break e;case x:y=14;break e;case ge:y=16,s=null;break e}y=29,a=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=Ft(y,a,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function ir(e,t,a,s){return e=Ft(7,e,s,t),e.lanes=a,e}function wu(e,t,a){return e=Ft(6,e,null,t),e.lanes=a,e}function Xd(e){var t=Ft(18,null,null,0);return t.stateNode=e,t}function Su(e,t,a){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zd=new WeakMap;function mn(e,t){if(typeof e=="object"&&e!==null){var a=Zd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Kl(t)},Zd.set(e,t),t)}return{value:e,source:t,stack:Kl(t)}}var Pr=[],Vr=0,fs=null,Yi=0,pn=[],yn=0,ya=null,Ln=1,Bn="";function Xn(e,t){Pr[Vr++]=Yi,Pr[Vr++]=fs,fs=e,Yi=t}function Fd(e,t,a){pn[yn++]=Ln,pn[yn++]=Bn,pn[yn++]=ya,ya=e;var s=Ln;e=Bn;var c=32-zt(s)-1;s&=~(1<<c),a+=1;var d=32-zt(t)+c;if(30<d){var y=c-c%5;d=(s&(1<<y)-1).toString(32),s>>=y,c-=y,Ln=1<<32-zt(t)+c|a<<c|s,Bn=d+e}else Ln=1<<d|a<<c|s,Bn=e}function Eu(e){e.return!==null&&(Xn(e,1),Fd(e,1,0))}function Tu(e){for(;e===fs;)fs=Pr[--Vr],Pr[Vr]=null,Yi=Pr[--Vr],Pr[Vr]=null;for(;e===ya;)ya=pn[--yn],pn[yn]=null,Bn=pn[--yn],pn[yn]=null,Ln=pn[--yn],pn[yn]=null}function Wd(e,t){pn[yn++]=Ln,pn[yn++]=Bn,pn[yn++]=ya,Ln=t.id,Bn=t.overflow,ya=e}var At=null,nt=null,Ne=!1,ga=null,gn=!1,Ou=Error(l(519));function va(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ii(mn(t,e)),Ou}function eh(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[F]=e,t[ee]=s,a){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(a=0;a<ml.length;a++)Ae(ml[a],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),hd(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),pd(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||gp(t.textContent,a)?(s.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),s.onScroll!=null&&Ae("scroll",t),s.onScrollEnd!=null&&Ae("scrollend",t),s.onClick!=null&&(t.onclick=Kn),t=!0):t=!1,t||va(e,!0)}function th(e){for(At=e.return;At;)switch(At.tag){case 5:case 31:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:At=At.return}}function Gr(e){if(e!==At)return!1;if(!Ne)return th(e),Ne=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Vc(e.type,e.memoizedProps)),a=!a),a&&nt&&va(e),th(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));nt=Rp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));nt=Rp(e)}else t===27?(t=nt,Ua(e.type)?(e=Jc,Jc=null,nt=e):nt=t):nt=At?bn(e.stateNode.nextSibling):null;return!0}function lr(){nt=At=null,Ne=!1}function Ru(){var e=ga;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),ga=null),e}function Ii(e){ga===null?ga=[e]:ga.push(e)}var xu=O(null),sr=null,Zn=null;function ba(e,t,a){Q(xu,t._currentValue),t._currentValue=a}function Fn(e){e._currentValue=xu.current,V(xu)}function Au(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function Cu(e,t,a,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var y=c.child;d=d.firstContext;e:for(;d!==null;){var b=d;d=c;for(var E=0;E<t.length;E++)if(b.context===t[E]){d.lanes|=a,b=d.alternate,b!==null&&(b.lanes|=a),Au(d.return,a,e),s||(y=null);break e}d=b.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(l(341));y.lanes|=a,d=y.alternate,d!==null&&(d.lanes|=a),Au(y,a,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Yr(e,t,a,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(l(387));if(y=y.memoizedProps,y!==null){var b=c.type;Zt(c.pendingProps.value,y.value)||(e!==null?e.push(b):e=[b])}}else if(c===ze.current){if(y=c.alternate,y===null)throw Error(l(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(bl):e=[bl])}c=c.return}e!==null&&Cu(t,e,a,s),t.flags|=262144}function ds(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function or(e){sr=e,Zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return nh(sr,e)}function hs(e,t){return sr===null&&or(e),nh(e,t)}function nh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Zn===null){if(e===null)throw Error(l(308));Zn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Zn=Zn.next=t;return a}var H0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},q0=r.unstable_scheduleCallback,$0=r.unstable_NormalPriority,gt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ju(){return{controller:new H0,data:new Map,refCount:0}}function Ki(e){e.refCount--,e.refCount===0&&q0($0,function(){e.controller.abort()})}var Ji=null,Du=0,Ir=0,Kr=null;function P0(e,t){if(Ji===null){var a=Ji=[];Du=0,Ir=Mc(),Kr={status:"pending",value:void 0,then:function(s){a.push(s)}}}return Du++,t.then(ah,ah),t}function ah(){if(--Du===0&&Ji!==null){Kr!==null&&(Kr.status="fulfilled");var e=Ji;Ji=null,Ir=0,Kr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function V0(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),s}var rh=P.S;P.S=function(e,t){$m=dt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&P0(e,t),rh!==null&&rh(e,t)};var ur=O(null);function Uu(){var e=ur.current;return e!==null?e:We.pooledCache}function ms(e,t){t===null?Q(ur,ur.current):Q(ur,t.pool)}function ih(){var e=Uu();return e===null?null:{parent:gt._currentValue,pool:e}}var Jr=Error(l(460)),zu=Error(l(474)),ps=Error(l(542)),ys={then:function(){}};function lh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Kn,Kn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uh(e),e;default:if(typeof t.status=="string")t.then(Kn,Kn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uh(e),e}throw fr=t,Jr}}function cr(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fr=a,Jr):a}}var fr=null;function oh(){if(fr===null)throw Error(l(459));var e=fr;return fr=null,e}function uh(e){if(e===Jr||e===ps)throw Error(l(483))}var Qr=null,Qi=0;function gs(e){var t=Qi;return Qi+=1,Qr===null&&(Qr=[]),sh(Qr,e,t)}function Xi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function vs(e,t){throw t.$$typeof===w?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ch(e){function t(j,A){if(e){var z=j.deletions;z===null?(j.deletions=[A],j.flags|=16):z.push(A)}}function a(j,A){if(!e)return null;for(;A!==null;)t(j,A),A=A.sibling;return null}function s(j){for(var A=new Map;j!==null;)j.key!==null?A.set(j.key,j):A.set(j.index,j),j=j.sibling;return A}function c(j,A){return j=Qn(j,A),j.index=0,j.sibling=null,j}function d(j,A,z){return j.index=z,e?(z=j.alternate,z!==null?(z=z.index,z<A?(j.flags|=67108866,A):z):(j.flags|=67108866,A)):(j.flags|=1048576,A)}function y(j){return e&&j.alternate===null&&(j.flags|=67108866),j}function b(j,A,z,Y){return A===null||A.tag!==6?(A=wu(z,j.mode,Y),A.return=j,A):(A=c(A,z),A.return=j,A)}function E(j,A,z,Y){var he=z.type;return he===C?G(j,A,z.props.children,Y,z.key):A!==null&&(A.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===ge&&cr(he)===A.type)?(A=c(A,z.props),Xi(A,z),A.return=j,A):(A=cs(z.type,z.key,z.props,null,j.mode,Y),Xi(A,z),A.return=j,A)}function M(j,A,z,Y){return A===null||A.tag!==4||A.stateNode.containerInfo!==z.containerInfo||A.stateNode.implementation!==z.implementation?(A=Su(z,j.mode,Y),A.return=j,A):(A=c(A,z.children||[]),A.return=j,A)}function G(j,A,z,Y,he){return A===null||A.tag!==7?(A=ir(z,j.mode,Y,he),A.return=j,A):(A=c(A,z),A.return=j,A)}function I(j,A,z){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=wu(""+A,j.mode,z),A.return=j,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case _:return z=cs(A.type,A.key,A.props,null,j.mode,z),Xi(z,A),z.return=j,z;case S:return A=Su(A,j.mode,z),A.return=j,A;case ge:return A=cr(A),I(j,A,z)}if(ke(A)||Ye(A))return A=ir(A,j.mode,z,null),A.return=j,A;if(typeof A.then=="function")return I(j,gs(A),z);if(A.$$typeof===$)return I(j,hs(j,A),z);vs(j,A)}return null}function N(j,A,z,Y){var he=A!==null?A.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return he!==null?null:b(j,A,""+z,Y);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return z.key===he?E(j,A,z,Y):null;case S:return z.key===he?M(j,A,z,Y):null;case ge:return z=cr(z),N(j,A,z,Y)}if(ke(z)||Ye(z))return he!==null?null:G(j,A,z,Y,null);if(typeof z.then=="function")return N(j,A,gs(z),Y);if(z.$$typeof===$)return N(j,A,hs(j,z),Y);vs(j,z)}return null}function H(j,A,z,Y,he){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return j=j.get(z)||null,b(A,j,""+Y,he);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case _:return j=j.get(Y.key===null?z:Y.key)||null,E(A,j,Y,he);case S:return j=j.get(Y.key===null?z:Y.key)||null,M(A,j,Y,he);case ge:return Y=cr(Y),H(j,A,z,Y,he)}if(ke(Y)||Ye(Y))return j=j.get(z)||null,G(A,j,Y,he,null);if(typeof Y.then=="function")return H(j,A,z,gs(Y),he);if(Y.$$typeof===$)return H(j,A,z,hs(A,Y),he);vs(A,Y)}return null}function re(j,A,z,Y){for(var he=null,qe=null,se=A,Te=A=0,De=null;se!==null&&Te<z.length;Te++){se.index>Te?(De=se,se=null):De=se.sibling;var $e=N(j,se,z[Te],Y);if($e===null){se===null&&(se=De);break}e&&se&&$e.alternate===null&&t(j,se),A=d($e,A,Te),qe===null?he=$e:qe.sibling=$e,qe=$e,se=De}if(Te===z.length)return a(j,se),Ne&&Xn(j,Te),he;if(se===null){for(;Te<z.length;Te++)se=I(j,z[Te],Y),se!==null&&(A=d(se,A,Te),qe===null?he=se:qe.sibling=se,qe=se);return Ne&&Xn(j,Te),he}for(se=s(se);Te<z.length;Te++)De=H(se,j,Te,z[Te],Y),De!==null&&(e&&De.alternate!==null&&se.delete(De.key===null?Te:De.key),A=d(De,A,Te),qe===null?he=De:qe.sibling=De,qe=De);return e&&se.forEach(function(La){return t(j,La)}),Ne&&Xn(j,Te),he}function ye(j,A,z,Y){if(z==null)throw Error(l(151));for(var he=null,qe=null,se=A,Te=A=0,De=null,$e=z.next();se!==null&&!$e.done;Te++,$e=z.next()){se.index>Te?(De=se,se=null):De=se.sibling;var La=N(j,se,$e.value,Y);if(La===null){se===null&&(se=De);break}e&&se&&La.alternate===null&&t(j,se),A=d(La,A,Te),qe===null?he=La:qe.sibling=La,qe=La,se=De}if($e.done)return a(j,se),Ne&&Xn(j,Te),he;if(se===null){for(;!$e.done;Te++,$e=z.next())$e=I(j,$e.value,Y),$e!==null&&(A=d($e,A,Te),qe===null?he=$e:qe.sibling=$e,qe=$e);return Ne&&Xn(j,Te),he}for(se=s(se);!$e.done;Te++,$e=z.next())$e=H(se,j,Te,$e.value,Y),$e!==null&&(e&&$e.alternate!==null&&se.delete($e.key===null?Te:$e.key),A=d($e,A,Te),qe===null?he=$e:qe.sibling=$e,qe=$e);return e&&se.forEach(function(e_){return t(j,e_)}),Ne&&Xn(j,Te),he}function Ze(j,A,z,Y){if(typeof z=="object"&&z!==null&&z.type===C&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case _:e:{for(var he=z.key;A!==null;){if(A.key===he){if(he=z.type,he===C){if(A.tag===7){a(j,A.sibling),Y=c(A,z.props.children),Y.return=j,j=Y;break e}}else if(A.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===ge&&cr(he)===A.type){a(j,A.sibling),Y=c(A,z.props),Xi(Y,z),Y.return=j,j=Y;break e}a(j,A);break}else t(j,A);A=A.sibling}z.type===C?(Y=ir(z.props.children,j.mode,Y,z.key),Y.return=j,j=Y):(Y=cs(z.type,z.key,z.props,null,j.mode,Y),Xi(Y,z),Y.return=j,j=Y)}return y(j);case S:e:{for(he=z.key;A!==null;){if(A.key===he)if(A.tag===4&&A.stateNode.containerInfo===z.containerInfo&&A.stateNode.implementation===z.implementation){a(j,A.sibling),Y=c(A,z.children||[]),Y.return=j,j=Y;break e}else{a(j,A);break}else t(j,A);A=A.sibling}Y=Su(z,j.mode,Y),Y.return=j,j=Y}return y(j);case ge:return z=cr(z),Ze(j,A,z,Y)}if(ke(z))return re(j,A,z,Y);if(Ye(z)){if(he=Ye(z),typeof he!="function")throw Error(l(150));return z=he.call(z),ye(j,A,z,Y)}if(typeof z.then=="function")return Ze(j,A,gs(z),Y);if(z.$$typeof===$)return Ze(j,A,hs(j,z),Y);vs(j,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,A!==null&&A.tag===6?(a(j,A.sibling),Y=c(A,z),Y.return=j,j=Y):(a(j,A),Y=wu(z,j.mode,Y),Y.return=j,j=Y),y(j)):a(j,A)}return function(j,A,z,Y){try{Qi=0;var he=Ze(j,A,z,Y);return Qr=null,he}catch(se){if(se===Jr||se===ps)throw se;var qe=Ft(29,se,null,j.mode);return qe.lanes=Y,qe.return=j,qe}finally{}}}var dr=ch(!0),fh=ch(!1),_a=!1;function Mu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ve&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=us(e),Jd(e,null,a),t}return os(e,s,t,a),us(e)}function Zi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,T(e,a)}}function ku(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var c=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,a=a.next}while(a!==null);d===null?c=d=t:d=d.next=t}else c=d=t;a={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Lu=!1;function Fi(){if(Lu){var e=Kr;if(e!==null)throw e}}function Wi(e,t,a,s){Lu=!1;var c=e.updateQueue;_a=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var E=b,M=E.next;E.next=null,y===null?d=M:y.next=M,y=E;var G=e.alternate;G!==null&&(G=G.updateQueue,b=G.lastBaseUpdate,b!==y&&(b===null?G.firstBaseUpdate=M:b.next=M,G.lastBaseUpdate=E))}if(d!==null){var I=c.baseState;y=0,G=M=E=null,b=d;do{var N=b.lane&-536870913,H=N!==b.lane;if(H?(je&N)===N:(s&N)===N){N!==0&&N===Ir&&(Lu=!0),G!==null&&(G=G.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var re=e,ye=b;N=t;var Ze=a;switch(ye.tag){case 1:if(re=ye.payload,typeof re=="function"){I=re.call(Ze,I,N);break e}I=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ye.payload,N=typeof re=="function"?re.call(Ze,I,N):re,N==null)break e;I=v({},I,N);break e;case 2:_a=!0}}N=b.callback,N!==null&&(e.flags|=64,H&&(e.flags|=8192),H=c.callbacks,H===null?c.callbacks=[N]:H.push(N))}else H={lane:N,tag:b.tag,payload:b.payload,callback:b.callback,next:null},G===null?(M=G=H,E=I):G=G.next=H,y|=N;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;H=b,b=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);G===null&&(E=I),c.baseState=E,c.firstBaseUpdate=M,c.lastBaseUpdate=G,d===null&&(c.shared.lanes=0),xa|=y,e.lanes=y,e.memoizedState=I}}function dh(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function hh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)dh(a[e],t)}var Xr=O(null),bs=O(0);function mh(e,t){e=sa,Q(bs,e),Q(Xr,t),sa=e|t.baseLanes}function Bu(){Q(bs,sa),Q(Xr,Xr.current)}function Hu(){sa=bs.current,V(Xr),V(bs)}var Wt=O(null),vn=null;function Ea(e){var t=e.alternate;Q(ht,ht.current&1),Q(Wt,e),vn===null&&(t===null||Xr.current!==null||t.memoizedState!==null)&&(vn=e)}function qu(e){Q(ht,ht.current),Q(Wt,e),vn===null&&(vn=e)}function ph(e){e.tag===22?(Q(ht,ht.current),Q(Wt,e),vn===null&&(vn=e)):Ta()}function Ta(){Q(ht,ht.current),Q(Wt,Wt.current)}function en(e){V(Wt),vn===e&&(vn=null),V(ht)}var ht=O(0);function _s(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ic(a)||Kc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wn=0,Ee=null,Qe=null,vt=null,ws=!1,Zr=!1,hr=!1,Ss=0,el=0,Fr=null,G0=0;function ut(){throw Error(l(321))}function $u(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Zt(e[a],t[a]))return!1;return!0}function Pu(e,t,a,s,c,d){return Wn=d,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Fh:ac,hr=!1,d=a(s,c),hr=!1,Zr&&(d=gh(t,a,s,c)),yh(e),d}function yh(e){P.H=al;var t=Qe!==null&&Qe.next!==null;if(Wn=0,vt=Qe=Ee=null,ws=!1,el=0,Fr=null,t)throw Error(l(300));e===null||bt||(e=e.dependencies,e!==null&&ds(e)&&(bt=!0))}function gh(e,t,a,s){Ee=e;var c=0;do{if(Zr&&(Fr=null),el=0,Zr=!1,25<=c)throw Error(l(301));if(c+=1,vt=Qe=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}P.H=Wh,d=t(a,s)}while(Zr);return d}function Y0(){var e=P.H,t=e.useState()[0];return t=typeof t.then=="function"?tl(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(Ee.flags|=1024),t}function Vu(){var e=Ss!==0;return Ss=0,e}function Gu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Yu(e){if(ws){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ws=!1}Wn=0,vt=Qe=Ee=null,Zr=!1,el=Ss=0,Fr=null}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ee.memoizedState=vt=e:vt=vt.next=e,vt}function mt(){if(Qe===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=vt===null?Ee.memoizedState:vt.next;if(t!==null)vt=t,Qe=e;else{if(e===null)throw Ee.alternate===null?Error(l(467)):Error(l(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},vt===null?Ee.memoizedState=vt=e:vt=vt.next=e}return vt}function Es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(e){var t=el;return el+=1,Fr===null&&(Fr=[]),e=sh(Fr,e,t),t=Ee,(vt===null?t.memoizedState:vt.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Fh:ac),e}function Ts(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tl(e);if(e.$$typeof===$)return Ct(e)}throw Error(l(438,String(e)))}function Iu(e){var t=null,a=Ee.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=Ee.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Es(),Ee.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=Pe;return t.index++,a}function ea(e,t){return typeof t=="function"?t(e):t}function Os(e){var t=mt();return Ku(t,Qe,e)}function Ku(e,t,a){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=a;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var y=c.next;c.next=d.next,d.next=y}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var b=y=null,E=null,M=t,G=!1;do{var I=M.lane&-536870913;if(I!==M.lane?(je&I)===I:(Wn&I)===I){var N=M.revertLane;if(N===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),I===Ir&&(G=!0);else if((Wn&N)===N){M=M.next,N===Ir&&(G=!0);continue}else I={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},E===null?(b=E=I,y=d):E=E.next=I,Ee.lanes|=N,xa|=N;I=M.action,hr&&a(d,I),d=M.hasEagerState?M.eagerState:a(d,I)}else N={lane:I,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},E===null?(b=E=N,y=d):E=E.next=N,Ee.lanes|=I,xa|=I;M=M.next}while(M!==null&&M!==t);if(E===null?y=d:E.next=b,!Zt(d,e.memoizedState)&&(bt=!0,G&&(a=Kr,a!==null)))throw a;e.memoizedState=d,e.baseState=y,e.baseQueue=E,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Ju(e){var t=mt(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var s=a.dispatch,c=a.pending,d=t.memoizedState;if(c!==null){a.pending=null;var y=c=c.next;do d=e(d,y.action),y=y.next;while(y!==c);Zt(d,t.memoizedState)||(bt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),a.lastRenderedState=d}return[d,s]}function vh(e,t,a){var s=Ee,c=mt(),d=Ne;if(d){if(a===void 0)throw Error(l(407));a=a()}else a=t();var y=!Zt((Qe||c).memoizedState,a);if(y&&(c.memoizedState=a,bt=!0),c=c.queue,Zu(wh.bind(null,s,c,e),[e]),c.getSnapshot!==t||y||vt!==null&&vt.memoizedState.tag&1){if(s.flags|=2048,Wr(9,{destroy:void 0},_h.bind(null,s,c,a,t),null),We===null)throw Error(l(349));d||(Wn&127)!==0||bh(s,t,a)}return a}function bh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ee.updateQueue,t===null?(t=Es(),Ee.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function _h(e,t,a,s){t.value=a,t.getSnapshot=s,Sh(t)&&Eh(e)}function wh(e,t,a){return a(function(){Sh(t)&&Eh(e)})}function Sh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Zt(e,a)}catch{return!0}}function Eh(e){var t=rr(e,2);t!==null&&It(t,e,2)}function Qu(e){var t=Lt();if(typeof e=="function"){var a=e;if(e=a(),hr){Rn(!0);try{a()}finally{Rn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:e},t}function Th(e,t,a,s){return e.baseState=a,Ku(e,Qe,typeof s=="function"?s:ea)}function I0(e,t,a,s,c){if(As(e))throw Error(l(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};P.T!==null?a(!0):d.isTransition=!1,s(d),a=t.pending,a===null?(d.next=t.pending=d,Oh(t,d)):(d.next=a.next,t.pending=a.next=d)}}function Oh(e,t){var a=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=P.T,y={};P.T=y;try{var b=a(c,s),E=P.S;E!==null&&E(y,b),Rh(e,t,b)}catch(M){Xu(e,t,M)}finally{d!==null&&y.types!==null&&(d.types=y.types),P.T=d}}else try{d=a(c,s),Rh(e,t,d)}catch(M){Xu(e,t,M)}}function Rh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){xh(e,t,s)},function(s){return Xu(e,t,s)}):xh(e,t,a)}function xh(e,t,a){t.status="fulfilled",t.value=a,Ah(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Oh(e,a)))}function Xu(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Ah(t),t=t.next;while(t!==s)}e.action=null}function Ah(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ch(e,t){return t}function jh(e,t){if(Ne){var a=We.formState;if(a!==null){e:{var s=Ee;if(Ne){if(nt){t:{for(var c=nt,d=gn;c.nodeType!==8;){if(!d){c=null;break t}if(c=bn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){nt=bn(c.nextSibling),s=c.data==="F!";break e}}va(s)}s=!1}s&&(t=a[0])}}return a=Lt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ch,lastRenderedState:t},a.queue=s,a=Qh.bind(null,Ee,s),s.dispatch=a,s=Qu(!1),d=nc.bind(null,Ee,!1,s.queue),s=Lt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,a=I0.bind(null,Ee,c,d,a),c.dispatch=a,s.memoizedState=e,[t,a,!1]}function Dh(e){var t=mt();return Uh(t,Qe,e)}function Uh(e,t,a){if(t=Ku(e,t,Ch)[0],e=Os(ea)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=tl(t)}catch(y){throw y===Jr?ps:y}else s=t;t=mt();var c=t.queue,d=c.dispatch;return a!==t.memoizedState&&(Ee.flags|=2048,Wr(9,{destroy:void 0},K0.bind(null,c,a),null)),[s,d,e]}function K0(e,t){e.action=t}function zh(e){var t=mt(),a=Qe;if(a!==null)return Uh(t,a,e);mt(),t=t.memoizedState,a=mt();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function Wr(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=Es(),Ee.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Mh(){return mt().memoizedState}function Rs(e,t,a,s){var c=Lt();Ee.flags|=e,c.memoizedState=Wr(1|t,{destroy:void 0},a,s===void 0?null:s)}function xs(e,t,a,s){var c=mt();s=s===void 0?null:s;var d=c.memoizedState.inst;Qe!==null&&s!==null&&$u(s,Qe.memoizedState.deps)?c.memoizedState=Wr(t,d,a,s):(Ee.flags|=e,c.memoizedState=Wr(1|t,d,a,s))}function Nh(e,t){Rs(8390656,8,e,t)}function Zu(e,t){xs(2048,8,e,t)}function J0(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=Es(),Ee.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function kh(e){var t=mt().memoizedState;return J0({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Lh(e,t){return xs(4,2,e,t)}function Bh(e,t){return xs(4,4,e,t)}function Hh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qh(e,t,a){a=a!=null?a.concat([e]):null,xs(4,4,Hh.bind(null,t,e),a)}function Fu(){}function $h(e,t){var a=mt();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&$u(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function Ph(e,t){var a=mt();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&$u(t,s[1]))return s[0];if(s=e(),hr){Rn(!0);try{e()}finally{Rn(!1)}}return a.memoizedState=[s,t],s}function Wu(e,t,a){return a===void 0||(Wn&1073741824)!==0&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Vm(),Ee.lanes|=e,xa|=e,a)}function Vh(e,t,a,s){return Zt(a,t)?a:Xr.current!==null?(e=Wu(e,a,s),Zt(e,t)||(bt=!0),e):(Wn&42)===0||(Wn&1073741824)!==0&&(je&261930)===0?(bt=!0,e.memoizedState=a):(e=Vm(),Ee.lanes|=e,xa|=e,t)}function Gh(e,t,a,s,c){var d=J.p;J.p=d!==0&&8>d?d:8;var y=P.T,b={};P.T=b,nc(e,!1,t,a);try{var E=c(),M=P.S;if(M!==null&&M(b,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var G=V0(E,s);nl(e,t,G,an(e))}else nl(e,t,s,an(e))}catch(I){nl(e,t,{then:function(){},status:"rejected",reason:I},an())}finally{J.p=d,y!==null&&b.types!==null&&(y.types=b.types),P.T=y}}function Q0(){}function ec(e,t,a,s){if(e.tag!==5)throw Error(l(476));var c=Yh(e).queue;Gh(e,c,t,W,a===null?Q0:function(){return Ih(e),a(s)})}function Yh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:W},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ih(e){var t=Yh(e);t.next===null&&(t=e.alternate.memoizedState),nl(e,t.next.queue,{},an())}function tc(){return Ct(bl)}function Kh(){return mt().memoizedState}function Jh(){return mt().memoizedState}function X0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=an();e=wa(a);var s=Sa(t,e,a);s!==null&&(It(s,t,a),Zi(s,t,a)),t={cache:ju()},e.payload=t;return}t=t.return}}function Z0(e,t,a){var s=an();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},As(e)?Xh(t,a):(a=bu(e,t,a,s),a!==null&&(It(a,e,s),Zh(a,t,s)))}function Qh(e,t,a){var s=an();nl(e,t,a,s)}function nl(e,t,a,s){var c={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(As(e))Xh(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,b=d(y,a);if(c.hasEagerState=!0,c.eagerState=b,Zt(b,y))return os(e,t,c,0),We===null&&ss(),!1}catch{}finally{}if(a=bu(e,t,c,s),a!==null)return It(a,e,s),Zh(a,t,s),!0}return!1}function nc(e,t,a,s){if(s={lane:2,revertLane:Mc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(l(479))}else t=bu(e,a,s,2),t!==null&&It(t,e,2)}function As(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Xh(e,t){Zr=ws=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Zh(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,T(e,a)}}var al={readContext:Ct,use:Ts,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};al.useEffectEvent=ut;var Fh={readContext:Ct,use:Ts,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Nh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Rs(4194308,4,Hh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var a=Lt();t=t===void 0?null:t;var s=e();if(hr){Rn(!0);try{e()}finally{Rn(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Lt();if(a!==void 0){var c=a(t);if(hr){Rn(!0);try{a(t)}finally{Rn(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=Z0.bind(null,Ee,e),[s.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qu(e);var t=e.queue,a=Qh.bind(null,Ee,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Fu,useDeferredValue:function(e,t){var a=Lt();return Wu(a,e,t)},useTransition:function(){var e=Qu(!1);return e=Gh.bind(null,Ee,e.queue,!0,!1),Lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=Ee,c=Lt();if(Ne){if(a===void 0)throw Error(l(407));a=a()}else{if(a=t(),We===null)throw Error(l(349));(je&127)!==0||bh(s,t,a)}c.memoizedState=a;var d={value:a,getSnapshot:t};return c.queue=d,Nh(wh.bind(null,s,d,e),[e]),s.flags|=2048,Wr(9,{destroy:void 0},_h.bind(null,s,d,a,t),null),a},useId:function(){var e=Lt(),t=We.identifierPrefix;if(Ne){var a=Bn,s=Ln;a=(s&~(1<<32-zt(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Ss++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=G0++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:jh,useActionState:jh,useOptimistic:function(e){var t=Lt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=nc.bind(null,Ee,!0,a),a.dispatch=t,[e,t]},useMemoCache:Iu,useCacheRefresh:function(){return Lt().memoizedState=X0.bind(null,Ee)},useEffectEvent:function(e){var t=Lt(),a={impl:e};return t.memoizedState=a,function(){if((Ve&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},ac={readContext:Ct,use:Ts,useCallback:$h,useContext:Ct,useEffect:Zu,useImperativeHandle:qh,useInsertionEffect:Lh,useLayoutEffect:Bh,useMemo:Ph,useReducer:Os,useRef:Mh,useState:function(){return Os(ea)},useDebugValue:Fu,useDeferredValue:function(e,t){var a=mt();return Vh(a,Qe.memoizedState,e,t)},useTransition:function(){var e=Os(ea)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:vh,useId:Kh,useHostTransitionStatus:tc,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,t){var a=mt();return Th(a,Qe,e,t)},useMemoCache:Iu,useCacheRefresh:Jh};ac.useEffectEvent=kh;var Wh={readContext:Ct,use:Ts,useCallback:$h,useContext:Ct,useEffect:Zu,useImperativeHandle:qh,useInsertionEffect:Lh,useLayoutEffect:Bh,useMemo:Ph,useReducer:Ju,useRef:Mh,useState:function(){return Ju(ea)},useDebugValue:Fu,useDeferredValue:function(e,t){var a=mt();return Qe===null?Wu(a,e,t):Vh(a,Qe.memoizedState,e,t)},useTransition:function(){var e=Ju(ea)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:vh,useId:Kh,useHostTransitionStatus:tc,useFormState:zh,useActionState:zh,useOptimistic:function(e,t){var a=mt();return Qe!==null?Th(a,Qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:Jh};Wh.useEffectEvent=kh;function rc(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ic={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=an(),c=wa(s);c.payload=t,a!=null&&(c.callback=a),t=Sa(e,c,s),t!==null&&(It(t,e,s),Zi(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=an(),c=wa(s);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Sa(e,c,s),t!==null&&(It(t,e,s),Zi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=an(),s=wa(a);s.tag=2,t!=null&&(s.callback=t),t=Sa(e,s,a),t!==null&&(It(t,e,a),Zi(t,e,a))}};function em(e,t,a,s,c,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,y):t.prototype&&t.prototype.isPureReactComponent?!Vi(a,s)||!Vi(c,d):!0}function tm(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&ic.enqueueReplaceState(t,t.state,null)}function mr(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=v({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function nm(e){ls(e)}function am(e){console.error(e)}function rm(e){ls(e)}function Cs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function im(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function lc(e,t,a){return a=wa(a),a.tag=3,a.payload={element:null},a.callback=function(){Cs(e,t)},a}function lm(e){return e=wa(e),e.tag=3,e}function sm(e,t,a,s){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){im(t,a,s)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){im(t,a,s),typeof c!="function"&&(Aa===null?Aa=new Set([this]):Aa.add(this));var b=s.stack;this.componentDidCatch(s.value,{componentStack:b!==null?b:""})})}function F0(e,t,a,s,c){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&Yr(t,a,c,!0),a=Wt.current,a!==null){switch(a.tag){case 31:case 13:return vn===null?$s():a.alternate===null&&ct===0&&(ct=3),a.flags&=-257,a.flags|=65536,a.lanes=c,s===ys?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),Dc(e,s,c)),!1;case 22:return a.flags|=65536,s===ys?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),Dc(e,s,c)),!1}throw Error(l(435,a.tag))}return Dc(e,s,c),$s(),!1}if(Ne)return t=Wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==Ou&&(e=Error(l(422),{cause:s}),Ii(mn(e,a)))):(s!==Ou&&(t=Error(l(423),{cause:s}),Ii(mn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=mn(s,a),c=lc(e.stateNode,s,c),ku(e,c),ct!==4&&(ct=2)),!1;var d=Error(l(520),{cause:s});if(d=mn(d,a),fl===null?fl=[d]:fl.push(d),ct!==4&&(ct=2),t===null)return!0;s=mn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=lc(a.stateNode,s,e),ku(a,e),!1;case 1:if(t=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Aa===null||!Aa.has(d))))return a.flags|=65536,c&=-c,a.lanes|=c,c=lm(c),sm(c,e,a,s),ku(a,c),!1}a=a.return}while(a!==null);return!1}var sc=Error(l(461)),bt=!1;function jt(e,t,a,s){t.child=e===null?fh(t,null,a,s):dr(t,e.child,a,s)}function om(e,t,a,s,c){a=a.render;var d=t.ref;if("ref"in s){var y={};for(var b in s)b!=="ref"&&(y[b]=s[b])}else y=s;return or(t),s=Pu(e,t,a,y,d,c),b=Vu(),e!==null&&!bt?(Gu(e,t,c),ta(e,t,c)):(Ne&&b&&Eu(t),t.flags|=1,jt(e,t,s,c),t.child)}function um(e,t,a,s,c){if(e===null){var d=a.type;return typeof d=="function"&&!_u(d)&&d.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=d,cm(e,t,d,s,c)):(e=cs(a.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!pc(e,c)){var y=d.memoizedProps;if(a=a.compare,a=a!==null?a:Vi,a(y,s)&&e.ref===t.ref)return ta(e,t,c)}return t.flags|=1,e=Qn(d,s),e.ref=t.ref,e.return=t,t.child=e}function cm(e,t,a,s,c){if(e!==null){var d=e.memoizedProps;if(Vi(d,s)&&e.ref===t.ref)if(bt=!1,t.pendingProps=s=d,pc(e,c))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,ta(e,t,c)}return oc(e,t,a,s,c)}function fm(e,t,a,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return dm(e,t,d,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ms(t,d!==null?d.cachePool:null),d!==null?mh(t,d):Bu(),ph(t);else return s=t.lanes=536870912,dm(e,t,d!==null?d.baseLanes|a:a,a,s)}else d!==null?(ms(t,d.cachePool),mh(t,d),Ta(),t.memoizedState=null):(e!==null&&ms(t,null),Bu(),Ta());return jt(e,t,c,a),t.child}function rl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dm(e,t,a,s,c){var d=Uu();return d=d===null?null:{parent:gt._currentValue,pool:d},t.memoizedState={baseLanes:a,cachePool:d},e!==null&&ms(t,null),Bu(),ph(t),e!==null&&Yr(e,t,s,!0),t.childLanes=c,null}function js(e,t){return t=Us({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hm(e,t,a){return dr(t,e.child,null,a),e=js(t,t.pendingProps),e.flags|=2,en(t),t.memoizedState=null,e}function W0(e,t,a){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(s.mode==="hidden")return e=js(t,s),t.lanes=536870912,rl(null,e);if(qu(t),(e=nt)?(e=Op(e,gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Ln,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},a=Xd(e),a.return=t,t.child=a,At=t,nt=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return js(t,s)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(qu(t),c)if(t.flags&256)t.flags&=-257,t=hm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(bt||Yr(e,t,a,!1),c=(a&e.childLanes)!==0,bt||c){if(s=We,s!==null&&(y=D(s,a),y!==0&&y!==d.retryLane))throw d.retryLane=y,rr(e,y),It(s,e,y),sc;$s(),t=hm(e,t,a)}else e=d.treeContext,nt=bn(y.nextSibling),At=t,Ne=!0,ga=null,gn=!1,e!==null&&Wd(t,e),t=js(t,s),t.flags|=4096;return t}return e=Qn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ds(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function oc(e,t,a,s,c){return or(t),a=Pu(e,t,a,s,void 0,c),s=Vu(),e!==null&&!bt?(Gu(e,t,c),ta(e,t,c)):(Ne&&s&&Eu(t),t.flags|=1,jt(e,t,a,c),t.child)}function mm(e,t,a,s,c,d){return or(t),t.updateQueue=null,a=gh(t,s,a,c),yh(e),s=Vu(),e!==null&&!bt?(Gu(e,t,d),ta(e,t,d)):(Ne&&s&&Eu(t),t.flags|=1,jt(e,t,a,d),t.child)}function pm(e,t,a,s,c){if(or(t),t.stateNode===null){var d=$r,y=a.contextType;typeof y=="object"&&y!==null&&(d=Ct(y)),d=new a(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=ic,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},Mu(t),y=a.contextType,d.context=typeof y=="object"&&y!==null?Ct(y):$r,d.state=t.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(rc(t,a,y,s),d.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&ic.enqueueReplaceState(d,d.state,null),Wi(t,s,d,c),Fi(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var b=t.memoizedProps,E=mr(a,b);d.props=E;var M=d.context,G=a.contextType;y=$r,typeof G=="object"&&G!==null&&(y=Ct(G));var I=a.getDerivedStateFromProps;G=typeof I=="function"||typeof d.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,G||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b||M!==y)&&tm(t,d,s,y),_a=!1;var N=t.memoizedState;d.state=N,Wi(t,s,d,c),Fi(),M=t.memoizedState,b||N!==M||_a?(typeof I=="function"&&(rc(t,a,I,s),M=t.memoizedState),(E=_a||em(t,a,E,s,N,M,y))?(G||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=M),d.props=s,d.state=M,d.context=y,s=E):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,Nu(e,t),y=t.memoizedProps,G=mr(a,y),d.props=G,I=t.pendingProps,N=d.context,M=a.contextType,E=$r,typeof M=="object"&&M!==null&&(E=Ct(M)),b=a.getDerivedStateFromProps,(M=typeof b=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==I||N!==E)&&tm(t,d,s,E),_a=!1,N=t.memoizedState,d.state=N,Wi(t,s,d,c),Fi();var H=t.memoizedState;y!==I||N!==H||_a||e!==null&&e.dependencies!==null&&ds(e.dependencies)?(typeof b=="function"&&(rc(t,a,b,s),H=t.memoizedState),(G=_a||em(t,a,G,s,N,H,E)||e!==null&&e.dependencies!==null&&ds(e.dependencies))?(M||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,H,E),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,H,E)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=H),d.props=s,d.state=H,d.context=E,s=G):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Ds(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=dr(t,e.child,null,c),t.child=dr(t,null,a,c)):jt(e,t,a,c),t.memoizedState=d.state,e=t.child):e=ta(e,t,c),e}function ym(e,t,a,s){return lr(),t.flags|=256,jt(e,t,a,s),t.child}var uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cc(e){return{baseLanes:e,cachePool:ih()}}function fc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=nn),e}function gm(e,t,a){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(ht.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(c?Ea(t):Ta(),(e=nt)?(e=Op(e,gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Ln,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},a=Xd(e),a.return=t,t.child=a,At=t,nt=null)):e=null,e===null)throw va(t);return Kc(e)?t.lanes=32:t.lanes=536870912,null}var b=s.children;return s=s.fallback,c?(Ta(),c=t.mode,b=Us({mode:"hidden",children:b},c),s=ir(s,c,a,null),b.return=t,s.return=t,b.sibling=s,t.child=b,s=t.child,s.memoizedState=cc(a),s.childLanes=fc(e,y,a),t.memoizedState=uc,rl(null,s)):(Ea(t),dc(t,b))}var E=e.memoizedState;if(E!==null&&(b=E.dehydrated,b!==null)){if(d)t.flags&256?(Ea(t),t.flags&=-257,t=hc(e,t,a)):t.memoizedState!==null?(Ta(),t.child=e.child,t.flags|=128,t=null):(Ta(),b=s.fallback,c=t.mode,s=Us({mode:"visible",children:s.children},c),b=ir(b,c,a,null),b.flags|=2,s.return=t,b.return=t,s.sibling=b,t.child=s,dr(t,e.child,null,a),s=t.child,s.memoizedState=cc(a),s.childLanes=fc(e,y,a),t.memoizedState=uc,t=rl(null,s));else if(Ea(t),Kc(b)){if(y=b.nextSibling&&b.nextSibling.dataset,y)var M=y.dgst;y=M,s=Error(l(419)),s.stack="",s.digest=y,Ii({value:s,source:null,stack:null}),t=hc(e,t,a)}else if(bt||Yr(e,t,a,!1),y=(a&e.childLanes)!==0,bt||y){if(y=We,y!==null&&(s=D(y,a),s!==0&&s!==E.retryLane))throw E.retryLane=s,rr(e,s),It(y,e,s),sc;Ic(b)||$s(),t=hc(e,t,a)}else Ic(b)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,nt=bn(b.nextSibling),At=t,Ne=!0,ga=null,gn=!1,e!==null&&Wd(t,e),t=dc(t,s.children),t.flags|=4096);return t}return c?(Ta(),b=s.fallback,c=t.mode,E=e.child,M=E.sibling,s=Qn(E,{mode:"hidden",children:s.children}),s.subtreeFlags=E.subtreeFlags&65011712,M!==null?b=Qn(M,b):(b=ir(b,c,a,null),b.flags|=2),b.return=t,s.return=t,s.sibling=b,t.child=s,rl(null,s),s=t.child,b=e.child.memoizedState,b===null?b=cc(a):(c=b.cachePool,c!==null?(E=gt._currentValue,c=c.parent!==E?{parent:E,pool:E}:c):c=ih(),b={baseLanes:b.baseLanes|a,cachePool:c}),s.memoizedState=b,s.childLanes=fc(e,y,a),t.memoizedState=uc,rl(e.child,s)):(Ea(t),a=e.child,e=a.sibling,a=Qn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=a,t.memoizedState=null,a)}function dc(e,t){return t=Us({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Us(e,t){return e=Ft(22,e,null,t),e.lanes=0,e}function hc(e,t,a){return dr(t,e.child,null,a),e=dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vm(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Au(e.return,t,a)}function mc(e,t,a,s,c,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:c,treeForkCount:d}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=a,y.tailMode=c,y.treeForkCount=d)}function bm(e,t,a){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var y=ht.current,b=(y&2)!==0;if(b?(y=y&1|2,t.flags|=128):y&=1,Q(ht,y),jt(e,t,s,a),s=Ne?Yi:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vm(e,a,t);else if(e.tag===19)vm(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&_s(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),mc(t,!1,c,a,d,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&_s(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}mc(t,!0,a,null,d,s);break;case"together":mc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function ta(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),xa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Yr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,a=Qn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Qn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function pc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ds(e)))}function eb(e,t,a){switch(t.tag){case 3:ft(t,t.stateNode.containerInfo),ba(t,gt,e.memoizedState.cache),lr();break;case 27:case 5:Ka(t);break;case 4:ft(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qu(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ea(t),t.flags|=128,null):(a&t.child.childLanes)!==0?gm(e,t,a):(Ea(t),e=ta(e,t,a),e!==null?e.sibling:null);Ea(t);break;case 19:var c=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(Yr(e,t,a,!1),s=(a&t.childLanes)!==0),c){if(s)return bm(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Q(ht,ht.current),s)break;return null;case 22:return t.lanes=0,fm(e,t,a,t.pendingProps);case 24:ba(t,gt,e.memoizedState.cache)}return ta(e,t,a)}function _m(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!pc(e,a)&&(t.flags&128)===0)return bt=!1,eb(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Ne&&(t.flags&1048576)!==0&&Fd(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=cr(t.elementType),t.type=e,typeof e=="function")_u(e)?(s=mr(e,s),t.tag=1,t=pm(null,t,e,s,a)):(t.tag=0,t=oc(null,t,e,s,a));else{if(e!=null){var c=e.$$typeof;if(c===Z){t.tag=11,t=om(null,t,e,s,a);break e}else if(c===x){t.tag=14,t=um(null,t,e,s,a);break e}}throw t=Ue(e)||e,Error(l(306,t,""))}}return t;case 0:return oc(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,c=mr(s,t.pendingProps),pm(e,t,s,c,a);case 3:e:{if(ft(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,Nu(e,t),Wi(t,s,null,a);var y=t.memoizedState;if(s=y.cache,ba(t,gt,s),s!==d.cache&&Cu(t,[gt],a,!0),Fi(),s=y.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=ym(e,t,s,a);break e}else if(s!==c){c=mn(Error(l(424)),t),Ii(c),t=ym(e,t,s,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nt=bn(e.firstChild),At=t,Ne=!0,ga=null,gn=!0,a=fh(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(lr(),s===c){t=ta(e,t,a);break e}jt(e,t,s,a)}t=t.child}return t;case 26:return Ds(e,t),e===null?(a=Dp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ne||(a=t.type,e=t.pendingProps,s=Js(be.current).createElement(a),s[F]=t,s[ee]=e,Dt(s,a,e),Fe(s),t.stateNode=s):t.memoizedState=Dp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ka(t),e===null&&Ne&&(s=t.stateNode=Ap(t.type,t.pendingProps,be.current),At=t,gn=!0,c=nt,Ua(t.type)?(Jc=c,nt=bn(s.firstChild)):nt=c),jt(e,t,t.pendingProps.children,a),Ds(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((c=s=nt)&&(s=jb(s,t.type,t.pendingProps,gn),s!==null?(t.stateNode=s,At=t,nt=bn(s.firstChild),gn=!1,c=!0):c=!1),c||va(t)),Ka(t),c=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,s=d.children,Vc(c,d)?s=null:y!==null&&Vc(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=Pu(e,t,Y0,null,null,a),bl._currentValue=c),Ds(e,t),jt(e,t,s,a),t.child;case 6:return e===null&&Ne&&((e=a=nt)&&(a=Db(a,t.pendingProps,gn),a!==null?(t.stateNode=a,At=t,nt=null,e=!0):e=!1),e||va(t)),null;case 13:return gm(e,t,a);case 4:return ft(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=dr(t,null,s,a):jt(e,t,s,a),t.child;case 11:return om(e,t,t.type,t.pendingProps,a);case 7:return jt(e,t,t.pendingProps,a),t.child;case 8:return jt(e,t,t.pendingProps.children,a),t.child;case 12:return jt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,ba(t,t.type,s.value),jt(e,t,s.children,a),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,or(t),c=Ct(c),s=s(c),t.flags|=1,jt(e,t,s,a),t.child;case 14:return um(e,t,t.type,t.pendingProps,a);case 15:return cm(e,t,t.type,t.pendingProps,a);case 19:return bm(e,t,a);case 31:return W0(e,t,a);case 22:return fm(e,t,a,t.pendingProps);case 24:return or(t),s=Ct(gt),e===null?(c=Uu(),c===null&&(c=We,d=ju(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=a),c=d),t.memoizedState={parent:s,cache:c},Mu(t),ba(t,gt,c)):((e.lanes&a)!==0&&(Nu(e,t),Wi(t,null,null,a),Fi()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ba(t,gt,s)):(s=d.cache,ba(t,gt,s),s!==c.cache&&Cu(t,[gt],a,!0))),jt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function na(e){e.flags|=4}function yc(e,t,a,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Km())e.flags|=8192;else throw fr=ys,zu}else e.flags&=-16777217}function wm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kp(t))if(Km())e.flags|=8192;else throw fr=ys,zu}function zs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wa():536870912,e.lanes|=t,ai|=t)}function il(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function tb(e,t,a){var s=t.pendingProps;switch(Tu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return at(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Fn(gt),it(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Gr(t)?na(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ru())),at(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(na(t),d!==null?(at(t),wm(t,d)):(at(t),yc(t,c,null,s,a))):d?d!==e.memoizedState?(na(t),at(t),wm(t,d)):(at(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&na(t),at(t),yc(t,c,e,s,a)),null;case 27:if(Ar(t),a=be.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&na(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return at(t),null}e=te.current,Gr(t)?eh(t):(e=Ap(c,s,a),t.stateNode=e,na(t))}return at(t),null;case 5:if(Ar(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&na(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return at(t),null}if(d=te.current,Gr(t))eh(t);else{var y=Js(be.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?y.createElement("select",{is:s.is}):y.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?y.createElement(c,{is:s.is}):y.createElement(c)}}d[F]=t,d[ee]=s;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=d;e:switch(Dt(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&na(t)}}return at(t),yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&na(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=be.current,Gr(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,c=At,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[F]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||gp(e.nodeValue,a)),e||va(t,!0)}else e=Js(e).createTextNode(s),e[F]=t,t.stateNode=e}return at(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=Gr(t),a!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[F]=t}else lr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else a=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(en(t),t):(en(t),null);if((t.flags&128)!==0)throw Error(l(558))}return at(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Gr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(l(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[F]=t}else lr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),c=!1}else c=Ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(en(t),t):(en(t),null)}return en(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),zs(t,t.updateQueue),at(t),null);case 4:return it(),e===null&&Bc(t.stateNode.containerInfo),at(t),null;case 10:return Fn(t.type),at(t),null;case 19:if(V(ht),s=t.memoizedState,s===null)return at(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)il(s,!1);else{if(ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=_s(e),d!==null){for(t.flags|=128,il(s,!1),e=d.updateQueue,t.updateQueue=e,zs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Qd(a,e),a=a.sibling;return Q(ht,ht.current&1|2),Ne&&Xn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&dt()>Bs&&(t.flags|=128,c=!0,il(s,!1),t.lanes=4194304)}else{if(!c)if(e=_s(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,zs(t,e),il(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!Ne)return at(t),null}else 2*dt()-s.renderingStartTime>Bs&&a!==536870912&&(t.flags|=128,c=!0,il(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=dt(),e.sibling=null,a=ht.current,Q(ht,c?a&1|2:a&1),Ne&&Xn(t,s.treeForkCount),e):(at(t),null);case 22:case 23:return en(t),Hu(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),a=t.updateQueue,a!==null&&zs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&V(ur),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Fn(gt),at(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function nb(e,t){switch(Tu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fn(gt),it(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ar(t),null;case 31:if(t.memoizedState!==null){if(en(t),t.alternate===null)throw Error(l(340));lr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(en(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));lr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(ht),null;case 4:return it(),null;case 10:return Fn(t.type),null;case 22:case 23:return en(t),Hu(),e!==null&&V(ur),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(gt),null;case 25:return null;default:return null}}function Sm(e,t){switch(Tu(t),t.tag){case 3:Fn(gt),it();break;case 26:case 27:case 5:Ar(t);break;case 4:it();break;case 31:t.memoizedState!==null&&en(t);break;case 13:en(t);break;case 19:V(ht);break;case 10:Fn(t.type);break;case 22:case 23:en(t),Hu(),e!==null&&V(ur);break;case 24:Fn(gt)}}function ll(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){s=void 0;var d=a.create,y=a.inst;s=d(),y.destroy=s}a=a.next}while(a!==c)}}catch(b){Je(t,t.return,b)}}function Oa(e,t,a){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var y=s.inst,b=y.destroy;if(b!==void 0){y.destroy=void 0,c=t;var E=a,M=b;try{M()}catch(G){Je(c,E,G)}}}s=s.next}while(s!==d)}}catch(G){Je(t,t.return,G)}}function Em(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{hh(t,a)}catch(s){Je(e,e.return,s)}}}function Tm(e,t,a){a.props=mr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Je(e,t,s)}}function sl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(c){Je(e,t,c)}}function Hn(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(c){Je(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Je(e,t,c)}else a.current=null}function Om(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(c){Je(e,e.return,c)}}function gc(e,t,a){try{var s=e.stateNode;Tb(s,e.type,a,t),s[ee]=t}catch(c){Je(e,e.return,c)}}function Rm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ua(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bc(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Kn));else if(s!==4&&(s===27&&Ua(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(bc(e,t,a),e=e.sibling;e!==null;)bc(e,t,a),e=e.sibling}function Ms(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&Ua(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ms(e,t,a),e=e.sibling;e!==null;)Ms(e,t,a),e=e.sibling}function xm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Dt(t,s,a),t[F]=e,t[ee]=a}catch(d){Je(e,e.return,d)}}var aa=!1,_t=!1,_c=!1,Am=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function ab(e,t){if(e=e.containerInfo,$c=to,e=qd(e),hu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var c=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var y=0,b=-1,E=-1,M=0,G=0,I=e,N=null;t:for(;;){for(var H;I!==a||c!==0&&I.nodeType!==3||(b=y+c),I!==d||s!==0&&I.nodeType!==3||(E=y+s),I.nodeType===3&&(y+=I.nodeValue.length),(H=I.firstChild)!==null;)N=I,I=H;for(;;){if(I===e)break t;if(N===a&&++M===c&&(b=y),N===d&&++G===s&&(E=y),(H=I.nextSibling)!==null)break;I=N,N=I.parentNode}I=H}a=b===-1||E===-1?null:{start:b,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(Pc={focusedElem:e,selectionRange:a},to=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=t,c=d.memoizedProps,d=d.memoizedState,s=a.stateNode;try{var re=mr(a.type,c);e=s.getSnapshotBeforeUpdate(re,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(ye){Je(a,a.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Yc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Yc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function Cm(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:ia(e,a),s&4&&ll(5,a);break;case 1:if(ia(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(y){Je(a,a.return,y)}else{var c=mr(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Je(a,a.return,y)}}s&64&&Em(a),s&512&&sl(a,a.return);break;case 3:if(ia(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{hh(e,t)}catch(y){Je(a,a.return,y)}}break;case 27:t===null&&s&4&&xm(a);case 26:case 5:ia(e,a),t===null&&s&4&&Om(a),s&512&&sl(a,a.return);break;case 12:ia(e,a);break;case 31:ia(e,a),s&4&&Um(e,a);break;case 13:ia(e,a),s&4&&zm(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=db.bind(null,a),Ub(e,a))));break;case 22:if(s=a.memoizedState!==null||aa,!s){t=t!==null&&t.memoizedState!==null||_t,c=aa;var d=_t;aa=s,(_t=t)&&!d?la(e,a,(a.subtreeFlags&8772)!==0):ia(e,a),aa=c,_t=d}break;case 30:break;default:ia(e,a)}}function jm(e){var t=e.alternate;t!==null&&(e.alternate=null,jm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,Pt=!1;function ra(e,t,a){for(a=a.child;a!==null;)Dm(e,t,a),a=a.sibling}function Dm(e,t,a){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(Qa,a)}catch{}switch(a.tag){case 26:_t||Hn(a,t),ra(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_t||Hn(a,t);var s=rt,c=Pt;Ua(a.type)&&(rt=a.stateNode,Pt=!1),ra(e,t,a),yl(a.stateNode),rt=s,Pt=c;break;case 5:_t||Hn(a,t);case 6:if(s=rt,c=Pt,rt=null,ra(e,t,a),rt=s,Pt=c,rt!==null)if(Pt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode)}catch(d){Je(a,t,d)}else try{rt.removeChild(a.stateNode)}catch(d){Je(a,t,d)}break;case 18:rt!==null&&(Pt?(e=rt,Ep(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),fi(e)):Ep(rt,a.stateNode));break;case 4:s=rt,c=Pt,rt=a.stateNode.containerInfo,Pt=!0,ra(e,t,a),rt=s,Pt=c;break;case 0:case 11:case 14:case 15:Oa(2,a,t),_t||Oa(4,a,t),ra(e,t,a);break;case 1:_t||(Hn(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Tm(a,t,s)),ra(e,t,a);break;case 21:ra(e,t,a);break;case 22:_t=(s=_t)||a.memoizedState!==null,ra(e,t,a),_t=s;break;default:ra(e,t,a)}}function Um(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(a){Je(t,t.return,a)}}}function zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(a){Je(t,t.return,a)}}function rb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Am),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Am),t;default:throw Error(l(435,e.tag))}}function Ns(e,t){var a=rb(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var c=hb.bind(null,e,s);s.then(c,c)}})}function Vt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var c=a[s],d=e,y=t,b=y;e:for(;b!==null;){switch(b.tag){case 27:if(Ua(b.type)){rt=b.stateNode,Pt=!1;break e}break;case 5:rt=b.stateNode,Pt=!1;break e;case 3:case 4:rt=b.stateNode.containerInfo,Pt=!0;break e}b=b.return}if(rt===null)throw Error(l(160));Dm(d,y,c),rt=null,Pt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mm(t,e),t=t.sibling}var Cn=null;function Mm(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Gt(e),s&4&&(Oa(3,e,e.return),ll(3,e),Oa(5,e,e.return));break;case 1:Vt(t,e),Gt(e),s&512&&(_t||a===null||Hn(a,a.return)),s&64&&aa&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var c=Cn;if(Vt(t,e),Gt(e),s&512&&(_t||a===null||Hn(a,a.return)),s&4){var d=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":d=c.getElementsByTagName("title")[0],(!d||d[tt]||d[F]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(s),c.head.insertBefore(d,c.querySelector("head > title"))),Dt(d,s,a),d[F]=e,Fe(d),s=d;break e;case"link":var y=Mp("link","href",c).get(s+(a.href||""));if(y){for(var b=0;b<y.length;b++)if(d=y[b],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(b,1);break t}}d=c.createElement(s),Dt(d,s,a),c.head.appendChild(d);break;case"meta":if(y=Mp("meta","content",c).get(s+(a.content||""))){for(b=0;b<y.length;b++)if(d=y[b],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(b,1);break t}}d=c.createElement(s),Dt(d,s,a),c.head.appendChild(d);break;default:throw Error(l(468,s))}d[F]=e,Fe(d),s=d}e.stateNode=s}else Np(c,e.type,e.stateNode);else e.stateNode=zp(c,s,e.memoizedProps);else d!==s?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,s===null?Np(c,e.type,e.stateNode):zp(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&gc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Vt(t,e),Gt(e),s&512&&(_t||a===null||Hn(a,a.return)),a!==null&&s&4&&gc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Vt(t,e),Gt(e),s&512&&(_t||a===null||Hn(a,a.return)),e.flags&32){c=e.stateNode;try{Mr(c,"")}catch(re){Je(e,e.return,re)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,gc(e,c,a!==null?a.memoizedProps:c)),s&1024&&(_c=!0);break;case 6:if(Vt(t,e),Gt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(re){Je(e,e.return,re)}}break;case 3:if(Zs=null,c=Cn,Cn=Qs(t.containerInfo),Vt(t,e),Cn=c,Gt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(re){Je(e,e.return,re)}_c&&(_c=!1,Nm(e));break;case 4:s=Cn,Cn=Qs(e.stateNode.containerInfo),Vt(t,e),Gt(e),Cn=s;break;case 12:Vt(t,e),Gt(e);break;case 31:Vt(t,e),Gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ns(e,s)));break;case 13:Vt(t,e),Gt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ls=dt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ns(e,s)));break;case 22:c=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,M=aa,G=_t;if(aa=M||c,_t=G||E,Vt(t,e),_t=G,aa=M,Gt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||E||aa||_t||pr(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(d=E.stateNode,c)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{b=E.stateNode;var I=E.memoizedProps.style,N=I!=null&&I.hasOwnProperty("display")?I.display:null;b.style.display=N==null||typeof N=="boolean"?"":(""+N).trim()}}catch(re){Je(E,E.return,re)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=c?"":E.memoizedProps}catch(re){Je(E,E.return,re)}}}else if(t.tag===18){if(a===null){E=t;try{var H=E.stateNode;c?Tp(H,!0):Tp(E.stateNode,!1)}catch(re){Je(E,E.return,re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Ns(e,a))));break;case 19:Vt(t,e),Gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ns(e,s)));break;case 30:break;case 21:break;default:Vt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(Rm(s)){a=s;break}s=s.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var c=a.stateNode,d=vc(e);Ms(e,d,c);break;case 5:var y=a.stateNode;a.flags&32&&(Mr(y,""),a.flags&=-33);var b=vc(e);Ms(e,b,y);break;case 3:case 4:var E=a.stateNode.containerInfo,M=vc(e);bc(e,M,E);break;default:throw Error(l(161))}}catch(G){Je(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Cm(e,t.alternate,t),t=t.sibling}function pr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oa(4,t,t.return),pr(t);break;case 1:Hn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Tm(t,t.return,a),pr(t);break;case 27:yl(t.stateNode);case 26:case 5:Hn(t,t.return),pr(t);break;case 22:t.memoizedState===null&&pr(t);break;case 30:pr(t);break;default:pr(t)}e=e.sibling}}function la(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,y=d.flags;switch(d.tag){case 0:case 11:case 15:la(c,d,a),ll(4,d);break;case 1:if(la(c,d,a),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(M){Je(s,s.return,M)}if(s=d,c=s.updateQueue,c!==null){var b=s.stateNode;try{var E=c.shared.hiddenCallbacks;if(E!==null)for(c.shared.hiddenCallbacks=null,c=0;c<E.length;c++)dh(E[c],b)}catch(M){Je(s,s.return,M)}}a&&y&64&&Em(d),sl(d,d.return);break;case 27:xm(d);case 26:case 5:la(c,d,a),a&&s===null&&y&4&&Om(d),sl(d,d.return);break;case 12:la(c,d,a);break;case 31:la(c,d,a),a&&y&4&&Um(c,d);break;case 13:la(c,d,a),a&&y&4&&zm(c,d);break;case 22:d.memoizedState===null&&la(c,d,a),sl(d,d.return);break;case 30:break;default:la(c,d,a)}t=t.sibling}}function wc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ki(a))}function Sc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ki(e))}function jn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)km(e,t,a,s),t=t.sibling}function km(e,t,a,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:jn(e,t,a,s),c&2048&&ll(9,t);break;case 1:jn(e,t,a,s);break;case 3:jn(e,t,a,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ki(e)));break;case 12:if(c&2048){jn(e,t,a,s),e=t.stateNode;try{var d=t.memoizedProps,y=d.id,b=d.onPostCommit;typeof b=="function"&&b(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Je(t,t.return,E)}}else jn(e,t,a,s);break;case 31:jn(e,t,a,s);break;case 13:jn(e,t,a,s);break;case 23:break;case 22:d=t.stateNode,y=t.alternate,t.memoizedState!==null?d._visibility&2?jn(e,t,a,s):ol(e,t):d._visibility&2?jn(e,t,a,s):(d._visibility|=2,ei(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&wc(y,t);break;case 24:jn(e,t,a,s),c&2048&&Sc(t.alternate,t);break;default:jn(e,t,a,s)}}function ei(e,t,a,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,y=t,b=a,E=s,M=y.flags;switch(y.tag){case 0:case 11:case 15:ei(d,y,b,E,c),ll(8,y);break;case 23:break;case 22:var G=y.stateNode;y.memoizedState!==null?G._visibility&2?ei(d,y,b,E,c):ol(d,y):(G._visibility|=2,ei(d,y,b,E,c)),c&&M&2048&&wc(y.alternate,y);break;case 24:ei(d,y,b,E,c),c&&M&2048&&Sc(y.alternate,y);break;default:ei(d,y,b,E,c)}t=t.sibling}}function ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,c=s.flags;switch(s.tag){case 22:ol(a,s),c&2048&&wc(s.alternate,s);break;case 24:ol(a,s),c&2048&&Sc(s.alternate,s);break;default:ol(a,s)}t=t.sibling}}var ul=8192;function ti(e,t,a){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)Lm(e,t,a),e=e.sibling}function Lm(e,t,a){switch(e.tag){case 26:ti(e,t,a),e.flags&ul&&e.memoizedState!==null&&Gb(a,Cn,e.memoizedState,e.memoizedProps);break;case 5:ti(e,t,a);break;case 3:case 4:var s=Cn;Cn=Qs(e.stateNode.containerInfo),ti(e,t,a),Cn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ul,ul=16777216,ti(e,t,a),ul=s):ti(e,t,a));break;default:ti(e,t,a)}}function Bm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function cl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];Ot=s,qm(s,e)}Bm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hm(e),e=e.sibling}function Hm(e){switch(e.tag){case 0:case 11:case 15:cl(e),e.flags&2048&&Oa(9,e,e.return);break;case 3:cl(e);break;case 12:cl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ks(e)):cl(e);break;default:cl(e)}}function ks(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];Ot=s,qm(s,e)}Bm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oa(8,t,t.return),ks(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ks(t));break;default:ks(t)}e=e.sibling}}function qm(e,t){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:Oa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ki(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,Ot=s;else e:for(a=e;Ot!==null;){s=Ot;var c=s.sibling,d=s.return;if(jm(s),s===a){Ot=null;break e}if(c!==null){c.return=d,Ot=c;break e}Ot=d}}}var ib={getCacheForType:function(e){var t=Ct(gt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ct(gt).controller.signal}},lb=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,xe=null,je=0,Ke=0,tn=null,Ra=!1,ni=!1,Ec=!1,sa=0,ct=0,xa=0,yr=0,Tc=0,nn=0,ai=0,fl=null,Yt=null,Oc=!1,Ls=0,$m=0,Bs=1/0,Hs=null,Aa=null,St=0,Ca=null,ri=null,oa=0,Rc=0,xc=null,Pm=null,dl=0,Ac=null;function an(){return(Ve&2)!==0&&je!==0?je&-je:P.T!==null?Mc():X()}function Vm(){if(nn===0)if((je&536870912)===0||Ne){var e=Xa;Xa<<=1,(Xa&3932160)===0&&(Xa=262144),nn=e}else nn=536870912;return e=Wt.current,e!==null&&(e.flags|=32),nn}function It(e,t,a){(e===We&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(ii(e,0),ja(e,je,nn,!1)),ma(e,a),((Ve&2)===0||e!==We)&&(e===We&&((Ve&2)===0&&(yr|=a),ct===4&&ja(e,je,nn,!1)),qn(e))}function Gm(e,t,a){if((Ve&6)!==0)throw Error(l(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Fa(e,t),c=s?ub(e,t):jc(e,t,!0),d=s;do{if(c===0){ni&&!s&&ja(e,t,0,!1);break}else{if(a=e.current.alternate,d&&!sb(a)){c=jc(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var b=e;c=fl;var E=b.current.memoizedState.isDehydrated;if(E&&(ii(b,y).flags|=256),y=jc(b,y,!1),y!==2){if(Ec&&!E){b.errorRecoveryDisabledLanes|=d,yr|=d,c=4;break e}d=Yt,Yt=c,d!==null&&(Yt===null?Yt=d:Yt.push.apply(Yt,d))}c=y}if(d=!1,c!==2)continue}}if(c===1){ii(e,0),ja(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:ja(s,t,nn,!Ra);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(c=Ls+300-dt(),10<c)){if(ja(s,t,nn,!Ra),Za(s,0,!0)!==0)break e;oa=t,s.timeoutHandle=wp(Ym.bind(null,s,a,Yt,Hs,Oc,t,nn,yr,ai,Ra,d,"Throttled",-0,0),c);break e}Ym(s,a,Yt,Hs,Oc,t,nn,yr,ai,Ra,d,null,-0,0)}}break}while(!0);qn(e)}function Ym(e,t,a,s,c,d,y,b,E,M,G,I,N,H){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kn},Lm(t,d,I);var re=(d&62914560)===d?Ls-dt():(d&4194048)===d?$m-dt():0;if(re=Yb(I,re),re!==null){oa=d,e.cancelPendingCommit=re(Wm.bind(null,e,t,d,a,s,c,y,b,E,G,I,null,N,H)),ja(e,d,y,!M);return}}Wm(e,t,d,a,s,c,y,b,E)}function sb(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var c=a[s],d=c.getSnapshot;c=c.value;try{if(!Zt(d(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ja(e,t,a,s){t&=~Tc,t&=~yr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-zt(c),y=1<<d;s[d]=-1,c&=~y}a!==0&&Zl(e,a,t)}function qs(){return(Ve&6)===0?(hl(0),!1):!0}function Cc(){if(xe!==null){if(Ke===0)var e=xe.return;else e=xe,Zn=sr=null,Yu(e),Qr=null,Qi=0,e=xe;for(;e!==null;)Sm(e.alternate,e),e=e.return;xe=null}}function ii(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,xb(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),oa=0,Cc(),We=e,xe=a=Qn(e.current,null),je=t,Ke=0,tn=null,Ra=!1,ni=Fa(e,t),Ec=!1,ai=nn=Tc=yr=xa=ct=0,Yt=fl=null,Oc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-zt(s),d=1<<c;t|=e[c],s&=~d}return sa=t,ss(),a}function Im(e,t){Ee=null,P.H=al,t===Jr||t===ps?(t=oh(),Ke=3):t===zu?(t=oh(),Ke=4):Ke=t===sc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tn=t,xe===null&&(ct=1,Cs(e,mn(t,e.current)))}function Km(){var e=Wt.current;return e===null?!0:(je&4194048)===je?vn===null:(je&62914560)===je||(je&536870912)!==0?e===vn:!1}function Jm(){var e=P.H;return P.H=al,e===null?al:e}function Qm(){var e=P.A;return P.A=ib,e}function $s(){ct=4,Ra||(je&4194048)!==je&&Wt.current!==null||(ni=!0),(xa&134217727)===0&&(yr&134217727)===0||We===null||ja(We,je,nn,!1)}function jc(e,t,a){var s=Ve;Ve|=2;var c=Jm(),d=Qm();(We!==e||je!==t)&&(Hs=null,ii(e,t)),t=!1;var y=ct;e:do try{if(Ke!==0&&xe!==null){var b=xe,E=tn;switch(Ke){case 8:Cc(),y=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(t=!0);var M=Ke;if(Ke=0,tn=null,li(e,b,E,M),a&&ni){y=0;break e}break;default:M=Ke,Ke=0,tn=null,li(e,b,E,M)}}ob(),y=ct;break}catch(G){Im(e,G)}while(!0);return t&&e.shellSuspendCounter++,Zn=sr=null,Ve=s,P.H=c,P.A=d,xe===null&&(We=null,je=0,ss()),y}function ob(){for(;xe!==null;)Xm(xe)}function ub(e,t){var a=Ve;Ve|=2;var s=Jm(),c=Qm();We!==e||je!==t?(Hs=null,Bs=dt()+500,ii(e,t)):ni=Fa(e,t);e:do try{if(Ke!==0&&xe!==null){t=xe;var d=tn;t:switch(Ke){case 1:Ke=0,tn=null,li(e,t,d,1);break;case 2:case 9:if(lh(d)){Ke=0,tn=null,Zm(t);break}t=function(){Ke!==2&&Ke!==9||We!==e||(Ke=7),qn(e)},d.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:lh(d)?(Ke=0,tn=null,Zm(t)):(Ke=0,tn=null,li(e,t,d,7));break;case 5:var y=null;switch(xe.tag){case 26:y=xe.memoizedState;case 5:case 27:var b=xe;if(y?kp(y):b.stateNode.complete){Ke=0,tn=null;var E=b.sibling;if(E!==null)xe=E;else{var M=b.return;M!==null?(xe=M,Ps(M)):xe=null}break t}}Ke=0,tn=null,li(e,t,d,5);break;case 6:Ke=0,tn=null,li(e,t,d,6);break;case 8:Cc(),ct=6;break e;default:throw Error(l(462))}}cb();break}catch(G){Im(e,G)}while(!0);return Zn=sr=null,P.H=s,P.A=c,Ve=a,xe!==null?0:(We=null,je=0,ss(),ct)}function cb(){for(;xe!==null&&!Yo();)Xm(xe)}function Xm(e){var t=_m(e.alternate,e,sa);e.memoizedProps=e.pendingProps,t===null?Ps(e):xe=t}function Zm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=mm(a,t,t.pendingProps,t.type,void 0,je);break;case 11:t=mm(a,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:Yu(t);default:Sm(a,t),t=xe=Qd(t,sa),t=_m(a,t,sa)}e.memoizedProps=e.pendingProps,t===null?Ps(e):xe=t}function li(e,t,a,s){Zn=sr=null,Yu(t),Qr=null,Qi=0;var c=t.return;try{if(F0(e,c,t,a,je)){ct=1,Cs(e,mn(a,e.current)),xe=null;return}}catch(d){if(c!==null)throw xe=c,d;ct=1,Cs(e,mn(a,e.current)),xe=null;return}t.flags&32768?(Ne||s===1?e=!0:ni||(je&536870912)!==0?e=!1:(Ra=e=!0,(s===2||s===9||s===3||s===6)&&(s=Wt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Fm(t,e)):Ps(t)}function Ps(e){var t=e;do{if((t.flags&32768)!==0){Fm(t,Ra);return}e=t.return;var a=tb(t.alternate,t,sa);if(a!==null){xe=a;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);ct===0&&(ct=5)}function Fm(e,t){do{var a=nb(e.alternate,e);if(a!==null){a.flags&=32767,xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){xe=e;return}xe=e=a}while(e!==null);ct=6,xe=null}function Wm(e,t,a,s,c,d,y,b,E){e.cancelPendingCommit=null;do Vs();while(St!==0);if((Ve&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(d=t.lanes|t.childLanes,d|=vu,Qo(e,a,d,y,b,E),e===We&&(xe=We=null,je=0),ri=t,Ca=e,oa=a,Rc=d,xc=c,Pm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mb(Ht,function(){return rp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=P.T,P.T=null,c=J.p,J.p=2,y=Ve,Ve|=4;try{ab(e,t,a)}finally{Ve=y,J.p=c,P.T=s}}St=1,ep(),tp(),np()}}function ep(){if(St===1){St=0;var e=Ca,t=ri,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=P.T,P.T=null;var s=J.p;J.p=2;var c=Ve;Ve|=4;try{Mm(t,e);var d=Pc,y=qd(e.containerInfo),b=d.focusedElem,E=d.selectionRange;if(y!==b&&b&&b.ownerDocument&&Hd(b.ownerDocument.documentElement,b)){if(E!==null&&hu(b)){var M=E.start,G=E.end;if(G===void 0&&(G=M),"selectionStart"in b)b.selectionStart=M,b.selectionEnd=Math.min(G,b.value.length);else{var I=b.ownerDocument||document,N=I&&I.defaultView||window;if(N.getSelection){var H=N.getSelection(),re=b.textContent.length,ye=Math.min(E.start,re),Ze=E.end===void 0?ye:Math.min(E.end,re);!H.extend&&ye>Ze&&(y=Ze,Ze=ye,ye=y);var j=Bd(b,ye),A=Bd(b,Ze);if(j&&A&&(H.rangeCount!==1||H.anchorNode!==j.node||H.anchorOffset!==j.offset||H.focusNode!==A.node||H.focusOffset!==A.offset)){var z=I.createRange();z.setStart(j.node,j.offset),H.removeAllRanges(),ye>Ze?(H.addRange(z),H.extend(A.node,A.offset)):(z.setEnd(A.node,A.offset),H.addRange(z))}}}}for(I=[],H=b;H=H.parentNode;)H.nodeType===1&&I.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<I.length;b++){var Y=I[b];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}to=!!$c,Pc=$c=null}finally{Ve=c,J.p=s,P.T=a}}e.current=t,St=2}}function tp(){if(St===2){St=0;var e=Ca,t=ri,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=P.T,P.T=null;var s=J.p;J.p=2;var c=Ve;Ve|=4;try{Cm(e,t.alternate,t)}finally{Ve=c,J.p=s,P.T=a}}St=3}}function np(){if(St===4||St===3){St=0,Io();var e=Ca,t=ri,a=oa,s=Pm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,ri=Ca=null,ap(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Aa=null),K(a),t=t.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(Qa,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=P.T,c=J.p,J.p=2,P.T=null;try{for(var d=e.onRecoverableError,y=0;y<s.length;y++){var b=s[y];d(b.value,{componentStack:b.stack})}}finally{P.T=t,J.p=c}}(oa&3)!==0&&Vs(),qn(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===Ac?dl++:(dl=0,Ac=e):dl=0,hl(0)}}function ap(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ki(t)))}function Vs(){return ep(),tp(),np(),rp()}function rp(){if(St!==5)return!1;var e=Ca,t=Rc;Rc=0;var a=K(oa),s=P.T,c=J.p;try{J.p=32>a?32:a,P.T=null,a=xc,xc=null;var d=Ca,y=oa;if(St=0,ri=Ca=null,oa=0,(Ve&6)!==0)throw Error(l(331));var b=Ve;if(Ve|=4,Hm(d.current),km(d,d.current,y,a),Ve=b,hl(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Qa,d)}catch{}return!0}finally{J.p=c,P.T=s,ap(e,t)}}function ip(e,t,a){t=mn(a,t),t=lc(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(ma(e,2),qn(e))}function Je(e,t,a){if(e.tag===3)ip(e,e,a);else for(;t!==null;){if(t.tag===3){ip(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Aa===null||!Aa.has(s))){e=mn(a,e),a=lm(2),s=Sa(t,a,2),s!==null&&(sm(a,s,t,e),ma(s,2),qn(s));break}}t=t.return}}function Dc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new lb;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(a)||(Ec=!0,c.add(a),e=fb.bind(null,e,t,a),t.then(e,e))}function fb(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,We===e&&(je&a)===a&&(ct===4||ct===3&&(je&62914560)===je&&300>dt()-Ls?(Ve&2)===0&&ii(e,0):Tc|=a,ai===je&&(ai=0)),qn(e)}function lp(e,t){t===0&&(t=Wa()),e=rr(e,t),e!==null&&(ma(e,t),qn(e))}function db(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),lp(e,a)}function hb(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),lp(e,a)}function mb(e,t){return ji(e,t)}var Gs=null,si=null,Uc=!1,Ys=!1,zc=!1,Da=0;function qn(e){e!==si&&e.next===null&&(si===null?Gs=si=e:si=si.next=e),Ys=!0,Uc||(Uc=!0,yb())}function hl(e,t){if(!zc&&Ys){zc=!0;do for(var a=!1,s=Gs;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var y=s.suspendedLanes,b=s.pingedLanes;d=(1<<31-zt(42|e)+1)-1,d&=c&~(y&~b),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,cp(s,d))}else d=je,d=Za(s,s===We?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Fa(s,d)||(a=!0,cp(s,d));s=s.next}while(a);zc=!1}}function pb(){sp()}function sp(){Ys=Uc=!1;var e=0;Da!==0&&Rb()&&(e=Da);for(var t=dt(),a=null,s=Gs;s!==null;){var c=s.next,d=op(s,t);d===0?(s.next=null,a===null?Gs=c:a.next=c,c===null&&(si=a)):(a=s,(e!==0||(d&3)!==0)&&(Ys=!0)),s=c}St!==0&&St!==5||hl(e),Da!==0&&(Da=0)}function op(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-zt(d),b=1<<y,E=c[y];E===-1?((b&a)===0||(b&s)!==0)&&(c[y]=Xl(b,t)):E<=t&&(e.expiredLanes|=b),d&=~b}if(t=We,a=je,a=Za(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Di(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Fa(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Di(s),K(a)){case 2:case 8:a=jr;break;case 32:a=Ht;break;case 268435456:a=zi;break;default:a=Ht}return s=up.bind(null,e),a=ji(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Di(s),e.callbackPriority=2,e.callbackNode=null,2}function up(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Vs()&&e.callbackNode!==a)return null;var s=je;return s=Za(e,e===We?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Gm(e,s,t),op(e,dt()),e.callbackNode!=null&&e.callbackNode===a?up.bind(null,e):null)}function cp(e,t){if(Vs())return null;Gm(e,t,!0)}function yb(){Ab(function(){(Ve&6)!==0?ji(Ui,pb):sp()})}function Mc(){if(Da===0){var e=Ir;e===0&&(e=Yn,Yn<<=1,(Yn&261888)===0&&(Yn=256)),Da=e}return Da}function fp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Wl(""+e)}function dp(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function gb(e,t,a,s,c){if(t==="submit"&&a&&a.stateNode===c){var d=fp((c[ee]||null).action),y=s.submitter;y&&(t=(t=y[ee]||null)?fp(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var b=new as("action","action",null,s,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Da!==0){var E=y?dp(c,y):new FormData(c);ec(a,{pending:!0,data:E,method:c.method,action:d},null,E)}}else typeof d=="function"&&(b.preventDefault(),E=y?dp(c,y):new FormData(c),ec(a,{pending:!0,data:E,method:c.method,action:d},d,E))},currentTarget:c}]})}}for(var Nc=0;Nc<gu.length;Nc++){var kc=gu[Nc],vb=kc.toLowerCase(),bb=kc[0].toUpperCase()+kc.slice(1);An(vb,"on"+bb)}An(Vd,"onAnimationEnd"),An(Gd,"onAnimationIteration"),An(Yd,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(N0,"onTransitionRun"),An(k0,"onTransitionStart"),An(L0,"onTransitionCancel"),An(Id,"onTransitionEnd"),qt("onMouseEnter",["mouseout","mouseover"]),qt("onMouseLeave",["mouseout","mouseover"]),qt("onPointerEnter",["pointerout","pointerover"]),qt("onPointerLeave",["pointerout","pointerover"]),Xt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ml="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_b=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ml));function hp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var y=s.length-1;0<=y;y--){var b=s[y],E=b.instance,M=b.currentTarget;if(b=b.listener,E!==d&&c.isPropagationStopped())break e;d=b,c.currentTarget=M;try{d(c)}catch(G){ls(G)}c.currentTarget=null,d=E}else for(y=0;y<s.length;y++){if(b=s[y],E=b.instance,M=b.currentTarget,b=b.listener,E!==d&&c.isPropagationStopped())break e;d=b,c.currentTarget=M;try{d(c)}catch(G){ls(G)}c.currentTarget=null,d=E}}}}function Ae(e,t){var a=t[ce];a===void 0&&(a=t[ce]=new Set);var s=e+"__bubble";a.has(s)||(mp(t,e,2,!1),a.add(s))}function Lc(e,t,a){var s=0;t&&(s|=4),mp(a,e,s,t)}var Is="_reactListening"+Math.random().toString(36).slice(2);function Bc(e){if(!e[Is]){e[Is]=!0,Qt.forEach(function(a){a!=="selectionchange"&&(_b.has(a)||Lc(a,!1,e),Lc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Is]||(t[Is]=!0,Lc("selectionchange",!1,t))}}function mp(e,t,a,s){switch(Vp(t)){case 2:var c=Jb;break;case 8:c=Qb;break;default:c=Wc}a=c.bind(null,t,a,e),c=void 0,!ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function Hc(e,t,a,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var y=s.tag;if(y===3||y===4){var b=s.stateNode.containerInfo;if(b===c)break;if(y===4)for(y=s.return;y!==null;){var E=y.tag;if((E===3||E===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;b!==null;){if(y=Le(b),y===null)return;if(E=y.tag,E===5||E===6||E===26||E===27){s=d=y;continue e}b=b.parentNode}}s=s.return}bd(function(){var M=d,G=nu(a),I=[];e:{var N=Kd.get(e);if(N!==void 0){var H=as,re=e;switch(e){case"keypress":if(ts(a)===0)break e;case"keydown":case"keyup":H=h0;break;case"focusin":re="focus",H=ou;break;case"focusout":re="blur",H=ou;break;case"beforeblur":case"afterblur":H=ou;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=t0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=y0;break;case Vd:case Gd:case Yd:H=r0;break;case Id:H=v0;break;case"scroll":case"scrollend":H=Wv;break;case"wheel":H=_0;break;case"copy":case"cut":case"paste":H=l0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Td;break;case"toggle":case"beforetoggle":H=S0}var ye=(t&4)!==0,Ze=!ye&&(e==="scroll"||e==="scrollend"),j=ye?N!==null?N+"Capture":null:N;ye=[];for(var A=M,z;A!==null;){var Y=A;if(z=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||z===null||j===null||(Y=ki(A,j),Y!=null&&ye.push(pl(A,Y,z))),Ze)break;A=A.return}0<ye.length&&(N=new H(N,re,null,a,G),I.push({event:N,listeners:ye}))}}if((t&7)===0){e:{if(N=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",N&&a!==tu&&(re=a.relatedTarget||a.fromElement)&&(Le(re)||re[oe]))break e;if((H||N)&&(N=G.window===G?G:(N=G.ownerDocument)?N.defaultView||N.parentWindow:window,H?(re=a.relatedTarget||a.toElement,H=M,re=re?Le(re):null,re!==null&&(Ze=u(re),ye=re.tag,re!==Ze||ye!==5&&ye!==27&&ye!==6)&&(re=null)):(H=null,re=M),H!==re)){if(ye=Sd,Y="onMouseLeave",j="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Td,Y="onPointerLeave",j="onPointerEnter",A="pointer"),Ze=H==null?N:Jt(H),z=re==null?N:Jt(re),N=new ye(Y,A+"leave",H,a,G),N.target=Ze,N.relatedTarget=z,Y=null,Le(G)===M&&(ye=new ye(j,A+"enter",re,a,G),ye.target=z,ye.relatedTarget=Ze,Y=ye),Ze=Y,H&&re)t:{for(ye=wb,j=H,A=re,z=0,Y=j;Y;Y=ye(Y))z++;Y=0;for(var he=A;he;he=ye(he))Y++;for(;0<z-Y;)j=ye(j),z--;for(;0<Y-z;)A=ye(A),Y--;for(;z--;){if(j===A||A!==null&&j===A.alternate){ye=j;break t}j=ye(j),A=ye(A)}ye=null}else ye=null;H!==null&&pp(I,N,H,ye,!1),re!==null&&Ze!==null&&pp(I,Ze,re,ye,!0)}}e:{if(N=M?Jt(M):window,H=N.nodeName&&N.nodeName.toLowerCase(),H==="select"||H==="input"&&N.type==="file")var qe=Ud;else if(jd(N))if(zd)qe=U0;else{qe=j0;var se=C0}else H=N.nodeName,!H||H.toLowerCase()!=="input"||N.type!=="checkbox"&&N.type!=="radio"?M&&eu(M.elementType)&&(qe=Ud):qe=D0;if(qe&&(qe=qe(e,M))){Dd(I,qe,a,G);break e}se&&se(e,N,M),e==="focusout"&&M&&N.type==="number"&&M.memoizedProps.value!=null&&Wo(N,"number",N.value)}switch(se=M?Jt(M):window,e){case"focusin":(jd(se)||se.contentEditable==="true")&&(Br=se,mu=M,Gi=null);break;case"focusout":Gi=mu=Br=null;break;case"mousedown":pu=!0;break;case"contextmenu":case"mouseup":case"dragend":pu=!1,$d(I,a,G);break;case"selectionchange":if(M0)break;case"keydown":case"keyup":$d(I,a,G)}var Te;if(cu)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else Lr?Ad(e,a)&&(De="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(De="onCompositionStart");De&&(Od&&a.locale!=="ko"&&(Lr||De!=="onCompositionStart"?De==="onCompositionEnd"&&Lr&&(Te=_d()):(pa=G,iu="value"in pa?pa.value:pa.textContent,Lr=!0)),se=Ks(M,De),0<se.length&&(De=new Ed(De,e,null,a,G),I.push({event:De,listeners:se}),Te?De.data=Te:(Te=Cd(a),Te!==null&&(De.data=Te)))),(Te=T0?O0(e,a):R0(e,a))&&(De=Ks(M,"onBeforeInput"),0<De.length&&(se=new Ed("onBeforeInput","beforeinput",null,a,G),I.push({event:se,listeners:De}),se.data=Te)),gb(I,e,M,a,G)}hp(I,t)})}function pl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ks(e,t){for(var a=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=ki(e,a),c!=null&&s.unshift(pl(e,c,d)),c=ki(e,t),c!=null&&s.push(pl(e,c,d))),e.tag===3)return s;e=e.return}return[]}function wb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pp(e,t,a,s,c){for(var d=t._reactName,y=[];a!==null&&a!==s;){var b=a,E=b.alternate,M=b.stateNode;if(b=b.tag,E!==null&&E===s)break;b!==5&&b!==26&&b!==27||M===null||(E=M,c?(M=ki(a,d),M!=null&&y.unshift(pl(a,M,E))):c||(M=ki(a,d),M!=null&&y.push(pl(a,M,E)))),a=a.return}y.length!==0&&e.push({event:t,listeners:y})}var Sb=/\r\n?/g,Eb=/\u0000|\uFFFD/g;function yp(e){return(typeof e=="string"?e:""+e).replace(Sb,`
|
|
9
|
+
`).replace(Eb,"")}function gp(e,t){return t=yp(t),yp(e)===t}function Xe(e,t,a,s,c,d){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Mr(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Mr(e,""+s);break;case"className":fn(e,"class",s);break;case"tabIndex":fn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":fn(e,a,s);break;case"style":gd(e,s,d);break;case"data":if(t!=="object"){fn(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Wl(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(t!=="input"&&Xe(e,t,"name",c.name,c,null),Xe(e,t,"formEncType",c.formEncType,c,null),Xe(e,t,"formMethod",c.formMethod,c,null),Xe(e,t,"formTarget",c.formTarget,c,null)):(Xe(e,t,"encType",c.encType,c,null),Xe(e,t,"method",c.method,c,null),Xe(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=Wl(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"onScroll":s!=null&&Ae("scroll",e);break;case"onScrollEnd":s!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=Wl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),xn(e,"popover",s);break;case"xlinkActuate":He(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":He(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":He(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":He(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":He(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":He(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":He(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":He(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":He(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":xn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Zv.get(a)||a,xn(e,a,s))}}function qc(e,t,a,s,c,d){switch(a){case"style":gd(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Mr(e,s):(typeof s=="number"||typeof s=="bigint")&&Mr(e,""+s);break;case"onScroll":s!=null&&Ae("scroll",e);break;case"onScrollEnd":s!=null&&Ae("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),d=e[ee]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof s=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,c);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):xn(e,a,s)}}}function Dt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var s=!1,c=!1,d;for(d in a)if(a.hasOwnProperty(d)){var y=a[d];if(y!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Xe(e,t,d,y,a,null)}}c&&Xe(e,t,"srcSet",a.srcSet,a,null),s&&Xe(e,t,"src",a.src,a,null);return;case"input":Ae("invalid",e);var b=d=y=c=null,E=null,M=null;for(s in a)if(a.hasOwnProperty(s)){var G=a[s];if(G!=null)switch(s){case"name":c=G;break;case"type":y=G;break;case"checked":E=G;break;case"defaultChecked":M=G;break;case"value":d=G;break;case"defaultValue":b=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,t));break;default:Xe(e,t,s,G,a,null)}}hd(e,d,b,E,M,y,c,!1);return;case"select":Ae("invalid",e),s=y=d=null;for(c in a)if(a.hasOwnProperty(c)&&(b=a[c],b!=null))switch(c){case"value":d=b;break;case"defaultValue":y=b;break;case"multiple":s=b;default:Xe(e,t,c,b,a,null)}t=d,a=y,e.multiple=!!s,t!=null?zr(e,!!s,t,!1):a!=null&&zr(e,!!s,a,!0);return;case"textarea":Ae("invalid",e),d=c=s=null;for(y in a)if(a.hasOwnProperty(y)&&(b=a[y],b!=null))switch(y){case"value":s=b;break;case"defaultValue":c=b;break;case"children":d=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(l(91));break;default:Xe(e,t,y,b,a,null)}pd(e,s,c,d);return;case"option":for(E in a)if(a.hasOwnProperty(E)&&(s=a[E],s!=null))switch(E){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Xe(e,t,E,s,a,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(s=0;s<ml.length;s++)Ae(ml[s],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in a)if(a.hasOwnProperty(M)&&(s=a[M],s!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Xe(e,t,M,s,a,null)}return;default:if(eu(t)){for(G in a)a.hasOwnProperty(G)&&(s=a[G],s!==void 0&&qc(e,t,G,s,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(s=a[b],s!=null&&Xe(e,t,b,s,a,null))}function Tb(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,y=null,b=null,E=null,M=null,G=null;for(H in a){var I=a[H];if(a.hasOwnProperty(H)&&I!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":E=I;default:s.hasOwnProperty(H)||Xe(e,t,H,null,s,I)}}for(var N in s){var H=s[N];if(I=a[N],s.hasOwnProperty(N)&&(H!=null||I!=null))switch(N){case"type":d=H;break;case"name":c=H;break;case"checked":M=H;break;case"defaultChecked":G=H;break;case"value":y=H;break;case"defaultValue":b=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(l(137,t));break;default:H!==I&&Xe(e,t,N,H,s,I)}}Fo(e,y,b,E,M,G,d,c);return;case"select":H=y=b=N=null;for(d in a)if(E=a[d],a.hasOwnProperty(d)&&E!=null)switch(d){case"value":break;case"multiple":H=E;default:s.hasOwnProperty(d)||Xe(e,t,d,null,s,E)}for(c in s)if(d=s[c],E=a[c],s.hasOwnProperty(c)&&(d!=null||E!=null))switch(c){case"value":N=d;break;case"defaultValue":b=d;break;case"multiple":y=d;default:d!==E&&Xe(e,t,c,d,s,E)}t=b,a=y,s=H,N!=null?zr(e,!!a,N,!1):!!s!=!!a&&(t!=null?zr(e,!!a,t,!0):zr(e,!!a,a?[]:"",!1));return;case"textarea":H=N=null;for(b in a)if(c=a[b],a.hasOwnProperty(b)&&c!=null&&!s.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Xe(e,t,b,null,s,c)}for(y in s)if(c=s[y],d=a[y],s.hasOwnProperty(y)&&(c!=null||d!=null))switch(y){case"value":N=c;break;case"defaultValue":H=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==d&&Xe(e,t,y,c,s,d)}md(e,N,H);return;case"option":for(var re in a)if(N=a[re],a.hasOwnProperty(re)&&N!=null&&!s.hasOwnProperty(re))switch(re){case"selected":e.selected=!1;break;default:Xe(e,t,re,null,s,N)}for(E in s)if(N=s[E],H=a[E],s.hasOwnProperty(E)&&N!==H&&(N!=null||H!=null))switch(E){case"selected":e.selected=N&&typeof N!="function"&&typeof N!="symbol";break;default:Xe(e,t,E,N,s,H)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in a)N=a[ye],a.hasOwnProperty(ye)&&N!=null&&!s.hasOwnProperty(ye)&&Xe(e,t,ye,null,s,N);for(M in s)if(N=s[M],H=a[M],s.hasOwnProperty(M)&&N!==H&&(N!=null||H!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,t));break;default:Xe(e,t,M,N,s,H)}return;default:if(eu(t)){for(var Ze in a)N=a[Ze],a.hasOwnProperty(Ze)&&N!==void 0&&!s.hasOwnProperty(Ze)&&qc(e,t,Ze,void 0,s,N);for(G in s)N=s[G],H=a[G],!s.hasOwnProperty(G)||N===H||N===void 0&&H===void 0||qc(e,t,G,N,s,H);return}}for(var j in a)N=a[j],a.hasOwnProperty(j)&&N!=null&&!s.hasOwnProperty(j)&&Xe(e,t,j,null,s,N);for(I in s)N=s[I],H=a[I],!s.hasOwnProperty(I)||N===H||N==null&&H==null||Xe(e,t,I,N,s,H)}function vp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ob(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var c=a[s],d=c.transferSize,y=c.initiatorType,b=c.duration;if(d&&b&&vp(y)){for(y=0,b=c.responseEnd,s+=1;s<a.length;s++){var E=a[s],M=E.startTime;if(M>b)break;var G=E.transferSize,I=E.initiatorType;G&&vp(I)&&(E=E.responseEnd,y+=G*(E<b?1:(b-M)/(E-M)))}if(--s,t+=8*(d+y)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var $c=null,Pc=null;function Js(e){return e.nodeType===9?e:e.ownerDocument}function bp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Vc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gc=null;function Rb(){var e=window.event;return e&&e.type==="popstate"?e===Gc?!1:(Gc=e,!0):(Gc=null,!1)}var wp=typeof setTimeout=="function"?setTimeout:void 0,xb=typeof clearTimeout=="function"?clearTimeout:void 0,Sp=typeof Promise=="function"?Promise:void 0,Ab=typeof queueMicrotask=="function"?queueMicrotask:typeof Sp<"u"?function(e){return Sp.resolve(null).then(e).catch(Cb)}:wp;function Cb(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function Ep(e,t){var a=t,s=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(c),fi(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")yl(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,yl(a);for(var d=a.firstChild;d;){var y=d.nextSibling,b=d.nodeName;d[tt]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=y}}else a==="body"&&yl(e.ownerDocument.body);a=c}while(a);fi(t)}function Tp(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Yc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Yc(a),ot(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function jb(e,t,a,s){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[tt])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=bn(e.nextSibling),e===null)break}return null}function Db(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=bn(e.nextSibling),e===null))return null;return e}function Op(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=bn(e.nextSibling),e===null))return null;return e}function Ic(e){return e.data==="$?"||e.data==="$~"}function Kc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ub(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Jc=null;function Rp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return bn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function xp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Ap(e,t,a){switch(t=Js(a),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function yl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ot(e)}var _n=new Map,Cp=new Set;function Qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ua=J.d;J.d={f:zb,r:Mb,D:Nb,C:kb,L:Lb,m:Bb,X:qb,S:Hb,M:$b};function zb(){var e=ua.f(),t=qs();return e||t}function Mb(e){var t=Be(e);t!==null&&t.tag===5&&t.type==="form"?Ih(t):ua.r(e)}var oi=typeof document>"u"?null:document;function jp(e,t,a){var s=oi;if(s&&typeof t=="string"&&t){var c=dn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Cp.has(c)||(Cp.add(c),e={rel:e,crossOrigin:a,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),Dt(t,"link",e),Fe(t),s.head.appendChild(t)))}}function Nb(e){ua.D(e),jp("dns-prefetch",e,null)}function kb(e,t){ua.C(e,t),jp("preconnect",e,t)}function Lb(e,t,a){ua.L(e,t,a);var s=oi;if(s&&e&&t){var c='link[rel="preload"][as="'+dn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+dn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+dn(a.imageSizes)+'"]')):c+='[href="'+dn(e)+'"]';var d=c;switch(t){case"style":d=ui(e);break;case"script":d=ci(e)}_n.has(d)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_n.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(gl(d))||t==="script"&&s.querySelector(vl(d))||(t=s.createElement("link"),Dt(t,"link",e),Fe(t),s.head.appendChild(t)))}}function Bb(e,t){ua.m(e,t);var a=oi;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+dn(s)+'"][href="'+dn(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ci(e)}if(!_n.has(d)&&(e=v({rel:"modulepreload",href:e},t),_n.set(d,e),a.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(vl(d)))return}s=a.createElement("link"),Dt(s,"link",e),Fe(s),a.head.appendChild(s)}}}function Hb(e,t,a){ua.S(e,t,a);var s=oi;if(s&&e){var c=cn(s).hoistableStyles,d=ui(e);t=t||"default";var y=c.get(d);if(!y){var b={loading:0,preload:null};if(y=s.querySelector(gl(d)))b.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_n.get(d))&&Qc(e,a);var E=y=s.createElement("link");Fe(E),Dt(E,"link",e),E._p=new Promise(function(M,G){E.onload=M,E.onerror=G}),E.addEventListener("load",function(){b.loading|=1}),E.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Xs(y,t,s)}y={type:"stylesheet",instance:y,count:1,state:b},c.set(d,y)}}}function qb(e,t){ua.X(e,t);var a=oi;if(a&&e){var s=cn(a).hoistableScripts,c=ci(e),d=s.get(c);d||(d=a.querySelector(vl(c)),d||(e=v({src:e,async:!0},t),(t=_n.get(c))&&Xc(e,t),d=a.createElement("script"),Fe(d),Dt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function $b(e,t){ua.M(e,t);var a=oi;if(a&&e){var s=cn(a).hoistableScripts,c=ci(e),d=s.get(c);d||(d=a.querySelector(vl(c)),d||(e=v({src:e,async:!0,type:"module"},t),(t=_n.get(c))&&Xc(e,t),d=a.createElement("script"),Fe(d),Dt(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function Dp(e,t,a,s){var c=(c=be.current)?Qs(c):null;if(!c)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ui(a.href),a=cn(c).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ui(a.href);var d=cn(c).hoistableStyles,y=d.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=c.querySelector(gl(e)))&&!d._p&&(y.instance=d,y.state.loading=5),_n.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_n.set(e,a),d||Pb(c,e,a,y.state))),t&&s===null)throw Error(l(528,""));return y}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ci(a),a=cn(c).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function ui(e){return'href="'+dn(e)+'"'}function gl(e){return'link[rel="stylesheet"]['+e+"]"}function Up(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function Pb(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Dt(t,"link",a),Fe(t),e.head.appendChild(t))}function ci(e){return'[src="'+dn(e)+'"]'}function vl(e){return"script[async]"+e}function zp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+dn(a.href)+'"]');if(s)return t.instance=s,Fe(s),s;var c=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Fe(s),Dt(s,"style",c),Xs(s,a.precedence,e),t.instance=s;case"stylesheet":c=ui(a.href);var d=e.querySelector(gl(c));if(d)return t.state.loading|=4,t.instance=d,Fe(d),d;s=Up(a),(c=_n.get(c))&&Qc(s,c),d=(e.ownerDocument||e).createElement("link"),Fe(d);var y=d;return y._p=new Promise(function(b,E){y.onload=b,y.onerror=E}),Dt(d,"link",s),t.state.loading|=4,Xs(d,a.precedence,e),t.instance=d;case"script":return d=ci(a.src),(c=e.querySelector(vl(d)))?(t.instance=c,Fe(c),c):(s=a,(c=_n.get(d))&&(s=v({},a),Xc(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Fe(c),Dt(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Xs(s,a.precedence,e));return t.instance}function Xs(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,y=0;y<s.length;y++){var b=s[y];if(b.dataset.precedence===t)d=b;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zs=null;function Mp(e,t,a){if(Zs===null){var s=new Map,c=Zs=new Map;c.set(a,s)}else c=Zs,s=c.get(a),s||(s=new Map,c.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var d=a[c];if(!(d[tt]||d[F]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var b=s.get(y);b?b.push(d):s.set(y,[d])}}return s}function Np(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Vb(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function kp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Gb(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=ui(s.href),d=t.querySelector(gl(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=d,Fe(d);return}d=t.ownerDocument||t,s=Up(s),(c=_n.get(c))&&Qc(s,c),d=d.createElement("link"),Fe(d);var y=d;y._p=new Promise(function(b,E){y.onload=b,y.onerror=E}),Dt(d,"link",s),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Fs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Zc=0;function Yb(e,t){return e.stylesheets&&e.count===0&&eo(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&eo(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Zc===0&&(Zc=62500*Ob());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&eo(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Zc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Fs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)eo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ws=null;function eo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ws=new Map,t.forEach(Ib,e),Ws=null,Fs.call(e))}function Ib(e,t){if(!(t.state.loading&4)){var a=Ws.get(e);if(a)var s=a.get(null);else{a=new Map,Ws.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var y=c[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),s=y)}s&&a.set(null,s)}c=t.instance,y=c.getAttribute("data-precedence"),d=a.get(y)||s,d===s&&a.set(null,c),a.set(y,c),this.count++,s=Fs.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var bl={$$typeof:$,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function Kb(e,t,a,s,c,d,y,b,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ha(0),this.hiddenUpdates=ha(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function Lp(e,t,a,s,c,d,y,b,E,M,G,I){return e=new Kb(e,t,a,y,E,M,G,I,b),t=1,d===!0&&(t|=24),d=Ft(3,null,null,t),e.current=d,d.stateNode=e,t=ju(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:a,cache:t},Mu(d),e}function Bp(e){return e?(e=$r,e):$r}function Hp(e,t,a,s,c,d){c=Bp(c),s.context===null?s.context=c:s.pendingContext=c,s=wa(t),s.payload={element:a},d=d===void 0?null:d,d!==null&&(s.callback=d),a=Sa(e,s,t),a!==null&&(It(a,e,t),Zi(a,e,t))}function qp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fc(e,t){qp(e,t),(e=e.alternate)&&qp(e,t)}function $p(e){if(e.tag===13||e.tag===31){var t=rr(e,67108864);t!==null&&It(t,e,67108864),Fc(e,67108864)}}function Pp(e){if(e.tag===13||e.tag===31){var t=an();t=L(t);var a=rr(e,t);a!==null&&It(a,e,t),Fc(e,t)}}var to=!0;function Jb(e,t,a,s){var c=P.T;P.T=null;var d=J.p;try{J.p=2,Wc(e,t,a,s)}finally{J.p=d,P.T=c}}function Qb(e,t,a,s){var c=P.T;P.T=null;var d=J.p;try{J.p=8,Wc(e,t,a,s)}finally{J.p=d,P.T=c}}function Wc(e,t,a,s){if(to){var c=ef(s);if(c===null)Hc(e,t,s,no,a),Gp(e,s);else if(Zb(c,e,t,a,s))s.stopPropagation();else if(Gp(e,s),t&4&&-1<Xb.indexOf(e)){for(;c!==null;){var d=Be(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=In(d.pendingLanes);if(y!==0){var b=d;for(b.pendingLanes|=2,b.entangledLanes|=2;y;){var E=1<<31-zt(y);b.entanglements[1]|=E,y&=~E}qn(d),(Ve&6)===0&&(Bs=dt()+500,hl(0))}}break;case 31:case 13:b=rr(d,2),b!==null&&It(b,d,2),qs(),Fc(d,2)}if(d=ef(s),d===null&&Hc(e,t,s,no,a),d===c)break;c=d}c!==null&&s.stopPropagation()}else Hc(e,t,s,null,a)}}function ef(e){return e=nu(e),tf(e)}var no=null;function tf(e){if(no=null,e=Le(e),e!==null){var t=u(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=f(t),e!==null)return e;e=null}else if(a===31){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return no=e,null}function Vp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ja()){case Ui:return 2;case jr:return 8;case Ht:case On:return 32;case zi:return 268435456;default:return 32}default:return 32}}var nf=!1,za=null,Ma=null,Na=null,_l=new Map,wl=new Map,ka=[],Xb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Gp(e,t){switch(e){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":_l.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(t.pointerId)}}function Sl(e,t,a,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Be(t),t!==null&&$p(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Zb(e,t,a,s,c){switch(t){case"focusin":return za=Sl(za,e,t,a,s,c),!0;case"dragenter":return Ma=Sl(Ma,e,t,a,s,c),!0;case"mouseover":return Na=Sl(Na,e,t,a,s,c),!0;case"pointerover":var d=c.pointerId;return _l.set(d,Sl(_l.get(d)||null,e,t,a,s,c)),!0;case"gotpointercapture":return d=c.pointerId,wl.set(d,Sl(wl.get(d)||null,e,t,a,s,c)),!0}return!1}function Yp(e){var t=Le(e.target);if(t!==null){var a=u(t);if(a!==null){if(t=a.tag,t===13){if(t=f(a),t!==null){e.blockedOn=t,ue(e.priority,function(){Pp(a)});return}}else if(t===31){if(t=h(a),t!==null){e.blockedOn=t,ue(e.priority,function(){Pp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ao(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ef(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);tu=s,a.target.dispatchEvent(s),tu=null}else return t=Be(a),t!==null&&$p(t),e.blockedOn=a,!1;t.shift()}return!0}function Ip(e,t,a){ao(e)&&a.delete(t)}function Fb(){nf=!1,za!==null&&ao(za)&&(za=null),Ma!==null&&ao(Ma)&&(Ma=null),Na!==null&&ao(Na)&&(Na=null),_l.forEach(Ip),wl.forEach(Ip)}function ro(e,t){e.blockedOn===t&&(e.blockedOn=null,nf||(nf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Fb)))}var io=null;function Kp(e){io!==e&&(io=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){io===e&&(io=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(tf(s||a)===null)continue;break}var d=Be(a);d!==null&&(e.splice(t,3),t-=3,ec(d,{pending:!0,data:c,method:a.method,action:s},s,c))}}))}function fi(e){function t(E){return ro(E,e)}za!==null&&ro(za,e),Ma!==null&&ro(Ma,e),Na!==null&&ro(Na,e),_l.forEach(t),wl.forEach(t);for(var a=0;a<ka.length;a++){var s=ka[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ka.length&&(a=ka[0],a.blockedOn===null);)Yp(a),a.blockedOn===null&&ka.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var c=a[s],d=a[s+1],y=c[ee]||null;if(typeof d=="function")y||Kp(a);else if(y){var b=null;if(d&&d.hasAttribute("formAction")){if(c=d,y=d[ee]||null)b=y.formAction;else if(tf(c)!==null)continue}else b=y.action;typeof b=="function"?a[s+1]=b:(a.splice(s,3),s-=3),Kp(a)}}}function Jp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return c=y})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function af(e){this._internalRoot=e}lo.prototype.render=af.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var a=t.current,s=an();Hp(a,s,e,t,null,null)},lo.prototype.unmount=af.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hp(e.current,2,null,e,null,null),qs(),t[oe]=null}};function lo(e){this._internalRoot=e}lo.prototype.unstable_scheduleHydration=function(e){if(e){var t=X();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ka.length&&t!==0&&t<ka[a].priority;a++);ka.splice(a,0,e),a===0&&Yp(e)}};var Qp=n.version;if(Qp!=="19.2.1")throw Error(l(527,Qp,"19.2.1"));J.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=p(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Wb={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var so=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!so.isDisabled&&so.supportsFiber)try{Qa=so.inject(Wb),lt=so}catch{}}return Tl.createRoot=function(e,t){if(!o(e))throw Error(l(299));var a=!1,s="",c=nm,d=am,y=rm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=Lp(e,1,!1,null,null,a,s,null,c,d,y,Jp),e[oe]=t.current,Bc(e),new af(t)},Tl.hydrateRoot=function(e,t,a){if(!o(e))throw Error(l(299));var s=!1,c="",d=nm,y=am,b=rm,E=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=Lp(e,1,!0,t,a??null,s,c,E,d,y,b,Jp),t.context=Bp(null),a=t.current,s=an(),s=L(s),c=wa(s),c.callback=null,Sa(a,c,s),a=s,t.current.lanes=a,ma(t,a),qn(t),e[oe]=t.current,Bc(e),new lo(t)},Tl.version="19.2.1",Tl}var iy;function c_(){if(iy)return sf.exports;iy=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),sf.exports=u_(),sf.exports}var f_=c_();var _g=r=>{throw TypeError(r)},d_=(r,n,i)=>n.has(r)||_g("Cannot "+i),ff=(r,n,i)=>(d_(r,n,"read from private field"),i?i.call(r):n.get(r)),h_=(r,n,i)=>n.has(r)?_g("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(r):n.set(r,i),ly="popstate";function m_(r={}){function n(l,o){let{pathname:u,search:f,hash:h}=l.location;return Ml("",{pathname:u,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function i(l,o){return typeof o=="string"?o:Pn(o)}return y_(n,i,null,r)}function Re(r,n){if(r===!1||r===null||typeof r>"u")throw new Error(n)}function pt(r,n){if(!r){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function p_(){return Math.random().toString(36).substring(2,10)}function sy(r,n){return{usr:r.state,key:r.key,idx:n}}function Ml(r,n,i=null,l){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof n=="string"?Ga(n):n,state:i,key:n&&n.key||l||p_()}}function Pn({pathname:r="/",search:n="",hash:i=""}){return n&&n!=="?"&&(r+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(r+=i.charAt(0)==="#"?i:"#"+i),r}function Ga(r){let n={};if(r){let i=r.indexOf("#");i>=0&&(n.hash=r.substring(i),r=r.substring(0,i));let l=r.indexOf("?");l>=0&&(n.search=r.substring(l),r=r.substring(0,l)),r&&(n.pathname=r)}return n}function y_(r,n,i,l={}){let{window:o=document.defaultView,v5Compat:u=!1}=l,f=o.history,h="POP",m=null,p=g();p==null&&(p=0,f.replaceState({...f.state,idx:p},""));function g(){return(f.state||{idx:null}).idx}function v(){h="POP";let R=g(),k=R==null?null:R-p;p=R,m&&m({action:h,location:C.location,delta:k})}function w(R,k){h="PUSH";let q=Ml(C.location,R,k);p=g()+1;let $=sy(q,p),Z=C.createHref(q);try{f.pushState($,"",Z)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;o.location.assign(Z)}u&&m&&m({action:h,location:C.location,delta:1})}function _(R,k){h="REPLACE";let q=Ml(C.location,R,k);p=g();let $=sy(q,p),Z=C.createHref(q);f.replaceState($,"",Z),u&&m&&m({action:h,location:C.location,delta:0})}function S(R){return wg(R)}let C={get action(){return h},get location(){return r(o,f)},listen(R){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(ly,v),m=R,()=>{o.removeEventListener(ly,v),m=null}},createHref(R){return n(o,R)},createURL:S,encodeLocation(R){let k=S(R);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:w,replace:_,go(R){return f.go(R)}};return C}function wg(r,n=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Re(i,"No window.location.(origin|href) available to create URL");let l=typeof r=="string"?r:Pn(r);return l=l.replace(/ $/,"%20"),!n&&l.startsWith("//")&&(l=i+l),new URL(l,i)}var Cl,oy=class{constructor(r){if(h_(this,Cl,new Map),r)for(let[n,i]of r)this.set(n,i)}get(r){if(ff(this,Cl).has(r))return ff(this,Cl).get(r);if(r.defaultValue!==void 0)return r.defaultValue;throw new Error("No value found for context")}set(r,n){ff(this,Cl).set(r,n)}};Cl=new WeakMap;var g_=new Set(["lazy","caseSensitive","path","id","index","children"]);function v_(r){return g_.has(r)}var b_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function __(r){return b_.has(r)}function w_(r){return r.index===!0}function Nl(r,n,i=[],l={},o=!1){return r.map((u,f)=>{let h=[...i,String(f)],m=typeof u.id=="string"?u.id:h.join("-");if(Re(u.index!==!0||!u.children,"Cannot specify children on an index route"),Re(o||!l[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),w_(u)){let p={...u,id:m};return l[m]=uy(p,n(p)),p}else{let p={...u,id:m,children:void 0};return l[m]=uy(p,n(p)),u.children&&(p.children=Nl(u.children,n,h,l,o)),p}})}function uy(r,n){return Object.assign(r,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...r.lazy,...n.lazy}}:{}})}function Ha(r,n,i="/"){return jl(r,n,i,!1)}function jl(r,n,i,l){let o=typeof n=="string"?Ga(n):n,u=En(o.pathname||"/",i);if(u==null)return null;let f=Sg(r);E_(f);let h=null;for(let m=0;h==null&&m<f.length;++m){let p=M_(u);h=U_(f[m],p,l)}return h}function S_(r,n){let{route:i,pathname:l,params:o}=r;return{id:i.id,pathname:l,params:o,data:n[i.id],loaderData:n[i.id],handle:i.handle}}function Sg(r,n=[],i=[],l="",o=!1){let u=(f,h,m=o,p)=>{let g={relativePath:p===void 0?f.path||"":p,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&m)return;Re(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let v=$n([l,g.relativePath]),w=i.concat(g);f.children&&f.children.length>0&&(Re(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Sg(f.children,n,w,v,m)),!(f.path==null&&!f.index)&&n.push({path:v,score:j_(v,f.index),routesMeta:w})};return r.forEach((f,h)=>{if(f.path===""||!f.path?.includes("?"))u(f,h);else for(let m of Eg(f.path))u(f,h,!0,m)}),n}function Eg(r){let n=r.split("/");if(n.length===0)return[];let[i,...l]=n,o=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return o?[u,""]:[u];let f=Eg(l.join("/")),h=[];return h.push(...f.map(m=>m===""?u:[u,m].join("/"))),o&&h.push(...f),h.map(m=>r.startsWith("/")&&m===""?"/":m)}function E_(r){r.sort((n,i)=>n.score!==i.score?i.score-n.score:D_(n.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var T_=/^:[\w-]+$/,O_=3,R_=2,x_=1,A_=10,C_=-2,cy=r=>r==="*";function j_(r,n){let i=r.split("/"),l=i.length;return i.some(cy)&&(l+=C_),n&&(l+=R_),i.filter(o=>!cy(o)).reduce((o,u)=>o+(T_.test(u)?O_:u===""?x_:A_),l)}function D_(r,n){return r.length===n.length&&r.slice(0,-1).every((l,o)=>l===n[o])?r[r.length-1]-n[n.length-1]:0}function U_(r,n,i=!1){let{routesMeta:l}=r,o={},u="/",f=[];for(let h=0;h<l.length;++h){let m=l[h],p=h===l.length-1,g=u==="/"?n:n.slice(u.length)||"/",v=Co({path:m.relativePath,caseSensitive:m.caseSensitive,end:p},g),w=m.route;if(!v&&p&&i&&!l[l.length-1].route.index&&(v=Co({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!v)return null;Object.assign(o,v.params),f.push({params:o,pathname:$n([u,v.pathname]),pathnameBase:B_($n([u,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(u=$n([u,v.pathnameBase]))}return f}function Co(r,n){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[i,l]=z_(r.path,r.caseSensitive,r.end),o=n.match(i);if(!o)return null;let u=o[0],f=u.replace(/(.)\/+$/,"$1"),h=o.slice(1);return{params:l.reduce((p,{paramName:g,isOptional:v},w)=>{if(g==="*"){let S=h[w]||"";f=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const _=h[w];return v&&!_?p[g]=void 0:p[g]=(_||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:f,pattern:r}}function z_(r,n=!1,i=!0){pt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let l=[],o="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,m)=>(l.push({paramName:h,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(l.push({paramName:"*"}),o+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":r!==""&&r!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),l]}function M_(r){try{return r.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return pt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),r}}function En(r,n){if(n==="/")return r;if(!r.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,l=r.charAt(i);return l&&l!=="/"?null:r.slice(i)||"/"}function N_({basename:r,pathname:n}){return n==="/"?r:$n([r,n])}var k_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lo=r=>k_.test(r);function L_(r,n="/"){let{pathname:i,search:l="",hash:o=""}=typeof r=="string"?Ga(r):r,u;if(i)if(Lo(i))u=i;else{if(i.includes("//")){let f=i;i=i.replace(/\/\/+/g,"/"),pt(!1,`Pathnames cannot have embedded double slashes - normalizing ${f} -> ${i}`)}i.startsWith("/")?u=fy(i.substring(1),"/"):u=fy(i,n)}else u=n;return{pathname:u,search:H_(l),hash:q_(o)}}function fy(r,n){let i=n.replace(/\/+$/,"").split("/");return r.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function df(r,n,i,l){return`Cannot include a '${r}' character in a manually specified \`to.${n}\` field [${JSON.stringify(l)}]. 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 Tg(r){return r.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function If(r){let n=Tg(r);return n.map((i,l)=>l===n.length-1?i.pathname:i.pathnameBase)}function Kf(r,n,i,l=!1){let o;typeof r=="string"?o=Ga(r):(o={...r},Re(!o.pathname||!o.pathname.includes("?"),df("?","pathname","search",o)),Re(!o.pathname||!o.pathname.includes("#"),df("#","pathname","hash",o)),Re(!o.search||!o.search.includes("#"),df("#","search","hash",o)));let u=r===""||o.pathname==="",f=u?"/":o.pathname,h;if(f==null)h=i;else{let v=n.length-1;if(!l&&f.startsWith("..")){let w=f.split("/");for(;w[0]==="..";)w.shift(),v-=1;o.pathname=w.join("/")}h=v>=0?n[v]:"/"}let m=L_(o,h),p=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||g)&&(m.pathname+="/"),m}var $n=r=>r.join("/").replace(/\/\/+/g,"/"),B_=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),H_=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,q_=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Bo=class{constructor(r,n,i,l=!1){this.status=r,this.statusText=n||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function kl(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Pl(r){return r.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Va=Symbol("Uninstrumented");function $_(r,n){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};r.forEach(o=>o({id:n.id,index:n.index,path:n.path,instrument(u){let f=Object.keys(i);for(let h of f)u[h]&&i[h].push(u[h])}}));let l={};if(typeof n.lazy=="function"&&i.lazy.length>0){let o=wi(i.lazy,n.lazy,()=>{});o&&(l.lazy=o)}if(typeof n.lazy=="object"){let o=n.lazy;["middleware","loader","action"].forEach(u=>{let f=o[u],h=i[`lazy.${u}`];if(typeof f=="function"&&h.length>0){let m=wi(h,f,()=>{});m&&(l.lazy=Object.assign(l.lazy||{},{[u]:m}))}})}return["loader","action"].forEach(o=>{let u=n[o];if(typeof u=="function"&&i[o].length>0){let f=u[Va]??u,h=wi(i[o],f,(...m)=>dy(m[0]));h&&(h[Va]=f,l[o]=h)}}),n.middleware&&n.middleware.length>0&&i.middleware.length>0&&(l.middleware=n.middleware.map(o=>{let u=o[Va]??o,f=wi(i.middleware,u,(...h)=>dy(h[0]));return f?(f[Va]=u,f):o})),l}function P_(r,n){let i={navigate:[],fetch:[]};if(n.forEach(l=>l({instrument(o){let u=Object.keys(o);for(let f of u)o[f]&&i[f].push(o[f])}})),i.navigate.length>0){let l=r.navigate[Va]??r.navigate,o=wi(i.navigate,l,(...u)=>{let[f,h]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?Pn(f):".",...hy(r,h??{})}});o&&(o[Va]=l,r.navigate=o)}if(i.fetch.length>0){let l=r.fetch[Va]??r.fetch,o=wi(i.fetch,l,(...u)=>{let[f,,h,m]=u;return{href:h??".",fetcherKey:f,...hy(r,m??{})}});o&&(o[Va]=l,r.fetch=o)}return r}function wi(r,n,i){return r.length===0?null:async(...l)=>{let o=await Og(r,i(...l),()=>n(...l),r.length-1);if(o.type==="error")throw o.value;return o.value}}async function Og(r,n,i,l){let o=r[l],u;if(o){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=Og(r,n,i,l-1),u=await f,Re(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(h,n)}catch(m){console.error("An instrumentation function threw an error:",m)}f||await h(),await f}else try{u={type:"success",value:await i()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function dy(r){let{request:n,context:i,params:l,unstable_pattern:o}=r;return{request:V_(n),params:{...l},unstable_pattern:o,context:G_(i)}}function hy(r,n){return{currentUrl:Pn(r.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function V_(r){return{method:r.method,url:r.url,headers:{get:(...n)=>r.headers.get(...n)}}}function G_(r){if(I_(r)){let n={...r};return Object.freeze(n),n}else return{get:n=>r.get(n)}}var Y_=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function I_(r){if(r===null||typeof r!="object")return!1;const n=Object.getPrototypeOf(r);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===Y_}var Rg=["POST","PUT","PATCH","DELETE"],K_=new Set(Rg),J_=["GET",...Rg],Q_=new Set(J_),X_=new Set([301,302,303,307,308]),Z_=new Set([307,308]),hf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},F_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ol={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},W_=r=>({hasErrorBoundary:!!r.hasErrorBoundary}),xg="remix-router-transitions",Ag=Symbol("ResetLoaderData");function ew(r){const n=r.window?r.window:typeof window<"u"?window:void 0,i=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";Re(r.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=r.hydrationRouteProperties||[],o=r.mapRouteProperties||W_,u=o;if(r.unstable_instrumentations){let T=r.unstable_instrumentations;u=D=>({...o(D),...$_(T.map(L=>L.route).filter(Boolean),D)})}let f={},h=Nl(r.routes,u,void 0,f),m,p=r.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=r.dataStrategy||iw,v={...r.future},w=null,_=new Set,S=null,C=null,R=null,k=r.hydrationData!=null,q=Ha(h,r.history.location,p),$=!1,Z=null,ne;if(q==null&&!r.patchRoutesOnNavigation){let T=Sn(404,{pathname:r.history.location.pathname}),{matches:D,route:L}=oo(h);ne=!0,q=D,Z={[L.id]:T}}else if(q&&!r.hydrationData&&Wa(q,h,r.history.location.pathname).active&&(q=null),q)if(q.some(T=>T.route.lazy))ne=!1;else if(!q.some(T=>Jf(T.route)))ne=!0;else{let T=r.hydrationData?r.hydrationData.loaderData:null,D=r.hydrationData?r.hydrationData.errors:null;if(D){let L=q.findIndex(K=>D[K.route.id]!==void 0);ne=q.slice(0,L+1).every(K=>!Rf(K.route,T,D))}else ne=q.every(L=>!Rf(L.route,T,D))}else{ne=!1,q=[];let T=Wa(null,h,r.history.location.pathname);T.active&&T.matches&&($=!0,q=T.matches)}let le,x={historyAction:r.history.action,location:r.history.location,matches:q,initialized:ne,navigation:hf,restoreScrollPosition:r.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:r.hydrationData&&r.hydrationData.loaderData||{},actionData:r.hydrationData&&r.hydrationData.actionData||null,errors:r.hydrationData&&r.hydrationData.errors||Z,fetchers:new Map,blockers:new Map},ge="POP",pe=null,Pe=!1,_e,Ye=!1,Ge=new Map,Ue=null,ke=!1,P=!1,J=new Set,W=new Map,Se=0,Oe=-1,O=new Map,V=new Set,Q=new Map,te=new Map,me=new Set,be=new Map,ze,ft=null;function it(){if(w=r.history.listen(({action:T,location:D,delta:L})=>{if(ze){ze(),ze=void 0;return}pt(be.size===0||L!=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 K=Xa({currentLocation:x.location,nextLocation:D,historyAction:T});if(K&&L!=null){let X=new Promise(ue=>{ze=ue});r.history.go(L*-1),Yn(K,{state:"blocked",location:D,proceed(){Yn(K,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),X.then(()=>r.history.go(L))},reset(){let ue=new Map(x.blockers);ue.set(K,Ol),yt({blockers:ue})}}),pe?.resolve(),pe=null;return}return Tn(T,D)}),i){ww(n,Ge);let T=()=>Sw(n,Ge);n.addEventListener("pagehide",T),Ue=()=>n.removeEventListener("pagehide",T)}return x.initialized||Tn("POP",x.location,{initialHydration:!0}),le}function Ka(){w&&w(),Ue&&Ue(),_.clear(),_e&&_e.abort(),x.fetchers.forEach((T,D)=>Mi(D)),x.blockers.forEach((T,D)=>Ql(D))}function Ar(T){return _.add(T),()=>_.delete(T)}function yt(T,D={}){T.matches&&(T.matches=T.matches.map(X=>{let ue=f[X.route.id],ae=X.route;return ae.element!==ue.element||ae.errorElement!==ue.errorElement||ae.hydrateFallbackElement!==ue.hydrateFallbackElement?{...X,route:ue}:X})),x={...x,...T};let L=[],K=[];x.fetchers.forEach((X,ue)=>{X.state==="idle"&&(me.has(ue)?L.push(ue):K.push(ue))}),me.forEach(X=>{!x.fetchers.has(X)&&!W.has(X)&&L.push(X)}),[..._].forEach(X=>X(x,{deletedFetchers:L,newErrors:T.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),L.forEach(X=>Mi(X)),K.forEach(X=>x.fetchers.delete(X))}function Gn(T,D,{flushSync:L}={}){let K=x.actionData!=null&&x.navigation.formMethod!=null&&Bt(x.navigation.formMethod)&&x.navigation.state==="loading"&&T.state?._isRedirect!==!0,X;D.actionData?Object.keys(D.actionData).length>0?X=D.actionData:X=null:K?X=x.actionData:X=null;let ue=D.loaderData?Ey(x.loaderData,D.loaderData,D.matches||[],D.errors):x.loaderData,ae=x.blockers;ae.size>0&&(ae=new Map(ae),ae.forEach((ce,de)=>ae.set(de,Ol)));let F=ke?!1:Xl(T,D.matches||x.matches),ee=Pe===!0||x.navigation.formMethod!=null&&Bt(x.navigation.formMethod)&&T.state?._isRedirect!==!0;m&&(h=m,m=void 0),ke||ge==="POP"||(ge==="PUSH"?r.history.push(T,T.state):ge==="REPLACE"&&r.history.replace(T,T.state));let oe;if(ge==="POP"){let ce=Ge.get(x.location.pathname);ce&&ce.has(T.pathname)?oe={currentLocation:x.location,nextLocation:T}:Ge.has(T.pathname)&&(oe={currentLocation:T,nextLocation:x.location})}else if(Ye){let ce=Ge.get(x.location.pathname);ce?ce.add(T.pathname):(ce=new Set([T.pathname]),Ge.set(x.location.pathname,ce)),oe={currentLocation:x.location,nextLocation:T}}yt({...D,actionData:X,loaderData:ue,historyAction:ge,location:T,initialized:!0,navigation:hf,revalidation:"idle",restoreScrollPosition:F,preventScrollReset:ee,blockers:ae},{viewTransitionOpts:oe,flushSync:L===!0}),ge="POP",Pe=!1,Ye=!1,ke=!1,P=!1,pe?.resolve(),pe=null,ft?.resolve(),ft=null}async function kn(T,D){if(pe?.resolve(),pe=null,typeof T=="number"){pe||(pe=xy());let Ie=pe.promise;return r.history.go(T),Ie}let L=Of(x.location,x.matches,p,T,D?.fromRouteId,D?.relative),{path:K,submission:X,error:ue}=my(!1,L,D),ae=x.location,F=Ml(x.location,K,D&&D.state);F={...F,...r.history.encodeLocation(F)};let ee=D&&D.replace!=null?D.replace:void 0,oe="PUSH";ee===!0?oe="REPLACE":ee===!1||X!=null&&Bt(X.formMethod)&&X.formAction===x.location.pathname+x.location.search&&(oe="REPLACE");let ce=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,de=(D&&D.flushSync)===!0,Me=Xa({currentLocation:ae,nextLocation:F,historyAction:oe});if(Me){Yn(Me,{state:"blocked",location:F,proceed(){Yn(Me,{state:"proceeding",proceed:void 0,reset:void 0,location:F}),kn(T,D)},reset(){let Ie=new Map(x.blockers);Ie.set(Me,Ol),yt({blockers:Ie})}});return}await Tn(oe,F,{submission:X,pendingError:ue,preventScrollReset:ce,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:de})}function Ci(){ft||(ft=xy()),jr(),yt({revalidation:"loading"});let T=ft.promise;return x.navigation.state==="submitting"?T:x.navigation.state==="idle"?(Tn(x.historyAction,x.location,{startUninterruptedRevalidation:!0}),T):(Tn(ge||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:Ye===!0}),T)}async function Tn(T,D,L){_e&&_e.abort(),_e=null,ge=T,ke=(L&&L.startUninterruptedRevalidation)===!0,Fa(x.location,x.matches),Pe=(L&&L.preventScrollReset)===!0,Ye=(L&&L.enableViewTransition)===!0;let K=m||h,X=L&&L.overrideNavigation,ue=L?.initialHydration&&x.matches&&x.matches.length>0&&!$?x.matches:Ha(K,D,p),ae=(L&&L.flushSync)===!0;if(ue&&x.initialized&&!P&&hw(x.location,D)&&!(L&&L.submission&&Bt(L.submission.formMethod))){Gn(D,{matches:ue},{flushSync:ae});return}let F=Wa(ue,K,D.pathname);if(F.active&&F.matches&&(ue=F.matches),!ue){let{error:ot,notFoundMatches:Le,route:Be}=da(D.pathname);Gn(D,{matches:Le,loaderData:{},errors:{[Be.id]:ot}},{flushSync:ae});return}_e=new AbortController;let ee=vi(r.history,D,_e.signal,L&&L.submission),oe=r.getContext?await r.getContext():new oy,ce;if(L&&L.pendingError)ce=[qa(ue).route.id,{type:"error",error:L.pendingError}];else if(L&&L.submission&&Bt(L.submission.formMethod)){let ot=await Go(ee,D,L.submission,ue,oe,F.active,L&&L.initialHydration===!0,{replace:L.replace,flushSync:ae});if(ot.shortCircuited)return;if(ot.pendingActionResult){let[Le,Be]=ot.pendingActionResult;if(sn(Be)&&kl(Be.error)&&Be.error.status===404){_e=null,Gn(D,{matches:ot.matches,loaderData:{},errors:{[Le]:Be.error}});return}}ue=ot.matches||ue,ce=ot.pendingActionResult,X=mf(D,L.submission),ae=!1,F.active=!1,ee=vi(r.history,ee.url,ee.signal)}let{shortCircuited:de,matches:Me,loaderData:Ie,errors:tt}=await Kl(ee,D,ue,oe,F.active,X,L&&L.submission,L&&L.fetcherSubmission,L&&L.replace,L&&L.initialHydration===!0,ae,ce);de||(_e=null,Gn(D,{matches:Me||ue,...Ty(ce),loaderData:Ie,errors:tt}))}async function Go(T,D,L,K,X,ue,ae,F={}){jr();let ee=bw(D,L);if(yt({navigation:ee},{flushSync:F.flushSync===!0}),ue){let de=await ha(K,D.pathname,T.signal);if(de.type==="aborted")return{shortCircuited:!0};if(de.type==="error"){if(de.partialMatches.length===0){let{matches:Ie,route:tt}=oo(h);return{matches:Ie,pendingActionResult:[tt.id,{type:"error",error:de.error}]}}let Me=qa(de.partialMatches).route.id;return{matches:de.partialMatches,pendingActionResult:[Me,{type:"error",error:de.error}]}}else if(de.matches)K=de.matches;else{let{notFoundMatches:Me,error:Ie,route:tt}=da(D.pathname);return{matches:Me,pendingActionResult:[tt.id,{type:"error",error:Ie}]}}}let oe,ce=Oo(K,D);if(!ce.route.action&&!ce.route.lazy)oe={type:"error",error:Sn(405,{method:T.method,pathname:D.pathname,routeId:ce.route.id})};else{let de=Si(u,f,T,K,ce,ae?[]:l,X),Me=await Ja(T,de,X,null);if(oe=Me[ce.route.id],!oe){for(let Ie of K)if(Me[Ie.route.id]){oe=Me[Ie.route.id];break}}if(T.signal.aborted)return{shortCircuited:!0}}if(Er(oe)){let de;return F&&F.replace!=null?de=F.replace:de=_y(oe.response.headers.get("Location"),new URL(T.url),p)===x.location.pathname+x.location.search,await dt(T,oe,!0,{submission:L,replace:de}),{shortCircuited:!0}}if(sn(oe)){let de=qa(K,ce.route.id);return(F&&F.replace)!==!0&&(ge="PUSH"),{matches:K,pendingActionResult:[de.route.id,oe,ce.route.id]}}return{matches:K,pendingActionResult:[ce.route.id,oe]}}async function Kl(T,D,L,K,X,ue,ae,F,ee,oe,ce,de){let Me=ue||mf(D,ae),Ie=ae||F||Ry(Me),tt=!ke&&!oe;if(X){if(tt){let Tt=Cr(de);yt({navigation:Me,...Tt!==void 0?{actionData:Tt}:{}},{flushSync:ce})}let Ce=await ha(L,D.pathname,T.signal);if(Ce.type==="aborted")return{shortCircuited:!0};if(Ce.type==="error"){if(Ce.partialMatches.length===0){let{matches:xn,route:fn}=oo(h);return{matches:xn,loaderData:{},errors:{[fn.id]:Ce.error}}}let Tt=qa(Ce.partialMatches).route.id;return{matches:Ce.partialMatches,loaderData:{},errors:{[Tt]:Ce.error}}}else if(Ce.matches)L=Ce.matches;else{let{error:Tt,notFoundMatches:xn,route:fn}=da(D.pathname);return{matches:xn,loaderData:{},errors:{[fn.id]:Tt}}}}let ot=m||h,{dsMatches:Le,revalidatingFetchers:Be}=py(T,K,u,f,r.history,x,L,Ie,D,oe?[]:l,oe===!0,P,J,me,Q,V,ot,p,r.patchRoutesOnNavigation!=null,de);if(Oe=++Se,!r.dataStrategy&&!Le.some(Ce=>Ce.shouldLoad)&&!Le.some(Ce=>Ce.route.middleware&&Ce.route.middleware.length>0)&&Be.length===0){let Ce=zt();return Gn(D,{matches:L,loaderData:{},errors:de&&sn(de[1])?{[de[0]]:de[1].error}:null,...Ty(de),...Ce?{fetchers:new Map(x.fetchers)}:{}},{flushSync:ce}),{shortCircuited:!0}}if(tt){let Ce={};if(!X){Ce.navigation=Me;let Tt=Cr(de);Tt!==void 0&&(Ce.actionData=Tt)}Be.length>0&&(Ce.fetchers=ji(Be)),yt(Ce,{flushSync:ce})}Be.forEach(Ce=>{lt(Ce.key),Ce.controller&&W.set(Ce.key,Ce.controller)});let Jt=()=>Be.forEach(Ce=>lt(Ce.key));_e&&_e.signal.addEventListener("abort",Jt);let{loaderResults:cn,fetcherResults:Fe}=await Ui(Le,Be,T,K);if(T.signal.aborted)return{shortCircuited:!0};_e&&_e.signal.removeEventListener("abort",Jt),Be.forEach(Ce=>W.delete(Ce.key));let Qt=uo(cn);if(Qt)return await dt(T,Qt.result,!0,{replace:ee}),{shortCircuited:!0};if(Qt=uo(Fe),Qt)return V.add(Qt.key),await dt(T,Qt.result,!0,{replace:ee}),{shortCircuited:!0};let{loaderData:Dr,errors:Xt}=Sy(x,L,cn,de,Be,Fe);oe&&x.errors&&(Xt={...x.errors,...Xt});let qt=zt(),Ur=Jl(Oe),er=qt||Ur||Be.length>0;return{matches:L,loaderData:Dr,errors:Xt,...er?{fetchers:new Map(x.fetchers)}:{}}}function Cr(T){if(T&&!sn(T[1]))return{[T[0]]:T[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function ji(T){return T.forEach(D=>{let L=x.fetchers.get(D.key),K=Rl(void 0,L?L.data:void 0);x.fetchers.set(D.key,K)}),new Map(x.fetchers)}async function Di(T,D,L,K){lt(T);let X=(K&&K.flushSync)===!0,ue=m||h,ae=Of(x.location,x.matches,p,L,D,K?.relative),F=Ha(ue,ae,p),ee=Wa(F,ue,ae);if(ee.active&&ee.matches&&(F=ee.matches),!F){On(T,D,Sn(404,{pathname:ae}),{flushSync:X});return}let{path:oe,submission:ce,error:de}=my(!0,ae,K);if(de){On(T,D,de,{flushSync:X});return}let Me=r.getContext?await r.getContext():new oy,Ie=(K&&K.preventScrollReset)===!0;if(ce&&Bt(ce.formMethod)){await Yo(T,D,oe,F,Me,ee.active,X,Ie,ce);return}Q.set(T,{routeId:D,path:oe}),await Io(T,D,oe,F,Me,ee.active,X,Ie,ce)}async function Yo(T,D,L,K,X,ue,ae,F,ee){jr(),Q.delete(T);let oe=x.fetchers.get(T);Ht(T,_w(ee,oe),{flushSync:ae});let ce=new AbortController,de=vi(r.history,L,ce.signal,ee);if(ue){let He=await ha(K,new URL(de.url).pathname,de.signal,T);if(He.type==="aborted")return;if(He.type==="error"){On(T,D,He.error,{flushSync:ae});return}else if(He.matches)K=He.matches;else{On(T,D,Sn(404,{pathname:L}),{flushSync:ae});return}}let Me=Oo(K,L);if(!Me.route.action&&!Me.route.lazy){let He=Sn(405,{method:ee.formMethod,pathname:L,routeId:D});On(T,D,He,{flushSync:ae});return}W.set(T,ce);let Ie=Se,tt=Si(u,f,de,K,Me,l,X),ot=await Ja(de,tt,X,T),Le=ot[Me.route.id];if(!Le){for(let He of tt)if(ot[He.route.id]){Le=ot[He.route.id];break}}if(de.signal.aborted){W.get(T)===ce&&W.delete(T);return}if(me.has(T)){if(Er(Le)||sn(Le)){Ht(T,ca(void 0));return}}else{if(Er(Le))if(W.delete(T),Oe>Ie){Ht(T,ca(void 0));return}else return V.add(T),Ht(T,Rl(ee)),dt(de,Le,!1,{fetcherSubmission:ee,preventScrollReset:F});if(sn(Le)){On(T,D,Le.error);return}}let Be=x.navigation.location||x.location,Jt=vi(r.history,Be,ce.signal),cn=m||h,Fe=x.navigation.state!=="idle"?Ha(cn,x.navigation.location,p):x.matches;Re(Fe,"Didn't find any matches after fetcher action");let Qt=++Se;O.set(T,Qt);let Dr=Rl(ee,Le.data);x.fetchers.set(T,Dr);let{dsMatches:Xt,revalidatingFetchers:qt}=py(Jt,X,u,f,r.history,x,Fe,ee,Be,l,!1,P,J,me,Q,V,cn,p,r.patchRoutesOnNavigation!=null,[Me.route.id,Le]);qt.filter(He=>He.key!==T).forEach(He=>{let xt=He.key,Ni=x.fetchers.get(xt),Xo=Rl(void 0,Ni?Ni.data:void 0);x.fetchers.set(xt,Xo),lt(xt),He.controller&&W.set(xt,He.controller)}),yt({fetchers:new Map(x.fetchers)});let Ur=()=>qt.forEach(He=>lt(He.key));ce.signal.addEventListener("abort",Ur);let{loaderResults:er,fetcherResults:Ce}=await Ui(Xt,qt,Jt,X);if(ce.signal.aborted)return;if(ce.signal.removeEventListener("abort",Ur),O.delete(T),W.delete(T),qt.forEach(He=>W.delete(He.key)),x.fetchers.has(T)){let He=ca(Le.data);x.fetchers.set(T,He)}let Tt=uo(er);if(Tt)return dt(Jt,Tt.result,!1,{preventScrollReset:F});if(Tt=uo(Ce),Tt)return V.add(Tt.key),dt(Jt,Tt.result,!1,{preventScrollReset:F});let{loaderData:xn,errors:fn}=Sy(x,Fe,er,void 0,qt,Ce);Jl(Qt),x.navigation.state==="loading"&&Qt>Oe?(Re(ge,"Expected pending action"),_e&&_e.abort(),Gn(x.navigation.location,{matches:Fe,loaderData:xn,errors:fn,fetchers:new Map(x.fetchers)})):(yt({errors:fn,loaderData:Ey(x.loaderData,xn,Fe,fn),fetchers:new Map(x.fetchers)}),P=!1)}async function Io(T,D,L,K,X,ue,ae,F,ee){let oe=x.fetchers.get(T);Ht(T,Rl(ee,oe?oe.data:void 0),{flushSync:ae});let ce=new AbortController,de=vi(r.history,L,ce.signal);if(ue){let Be=await ha(K,new URL(de.url).pathname,de.signal,T);if(Be.type==="aborted")return;if(Be.type==="error"){On(T,D,Be.error,{flushSync:ae});return}else if(Be.matches)K=Be.matches;else{On(T,D,Sn(404,{pathname:L}),{flushSync:ae});return}}let Me=Oo(K,L);W.set(T,ce);let Ie=Se,tt=Si(u,f,de,K,Me,l,X),Le=(await Ja(de,tt,X,T))[Me.route.id];if(W.get(T)===ce&&W.delete(T),!de.signal.aborted){if(me.has(T)){Ht(T,ca(void 0));return}if(Er(Le))if(Oe>Ie){Ht(T,ca(void 0));return}else{V.add(T),await dt(de,Le,!1,{preventScrollReset:F});return}if(sn(Le)){On(T,D,Le.error);return}Ht(T,ca(Le.data))}}async function dt(T,D,L,{submission:K,fetcherSubmission:X,preventScrollReset:ue,replace:ae}={}){L||(pe?.resolve(),pe=null),D.response.headers.has("X-Remix-Revalidate")&&(P=!0);let F=D.response.headers.get("Location");Re(F,"Expected a Location header on the redirect Response"),F=_y(F,new URL(T.url),p);let ee=Ml(x.location,F,{_isRedirect:!0});if(i){let tt=!1;if(D.response.headers.has("X-Remix-Reload-Document"))tt=!0;else if(Lo(F)){const ot=wg(F,!0);tt=ot.origin!==n.location.origin||En(ot.pathname,p)==null}if(tt){ae?n.location.replace(F):n.location.assign(F);return}}_e=null;let oe=ae===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ce,formAction:de,formEncType:Me}=x.navigation;!K&&!X&&ce&&de&&Me&&(K=Ry(x.navigation));let Ie=K||X;if(Z_.has(D.response.status)&&Ie&&Bt(Ie.formMethod))await Tn(oe,ee,{submission:{...Ie,formAction:F},preventScrollReset:ue||Pe,enableViewTransition:L?Ye:void 0});else{let tt=mf(ee,K);await Tn(oe,ee,{overrideNavigation:tt,fetcherSubmission:X,preventScrollReset:ue||Pe,enableViewTransition:L?Ye:void 0})}}async function Ja(T,D,L,K){let X,ue={};try{X=await sw(g,T,D,K,L,!1)}catch(ae){return D.filter(F=>F.shouldLoad).forEach(F=>{ue[F.route.id]={type:"error",error:ae}}),ue}if(T.signal.aborted)return ue;for(let[ae,F]of Object.entries(X))if(gw(F)){let ee=F.result;ue[ae]={type:"redirect",response:fw(ee,T,ae,D,p)}}else ue[ae]=await cw(F);return ue}async function Ui(T,D,L,K){let X=Ja(L,T,K,null),ue=Promise.all(D.map(async ee=>{if(ee.matches&&ee.match&&ee.request&&ee.controller){let ce=(await Ja(ee.request,ee.matches,K,ee.key))[ee.match.route.id];return{[ee.key]:ce}}else return Promise.resolve({[ee.key]:{type:"error",error:Sn(404,{pathname:ee.path})}})})),ae=await X,F=(await ue).reduce((ee,oe)=>Object.assign(ee,oe),{});return{loaderResults:ae,fetcherResults:F}}function jr(){P=!0,Q.forEach((T,D)=>{W.has(D)&&J.add(D),lt(D)})}function Ht(T,D,L={}){x.fetchers.set(T,D),yt({fetchers:new Map(x.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function On(T,D,L,K={}){let X=qa(x.matches,D);Mi(T),yt({errors:{[X.route.id]:L},fetchers:new Map(x.fetchers)},{flushSync:(K&&K.flushSync)===!0})}function zi(T){return te.set(T,(te.get(T)||0)+1),me.has(T)&&me.delete(T),x.fetchers.get(T)||F_}function Ko(T,D){lt(T,D?.reason),Ht(T,ca(null))}function Mi(T){let D=x.fetchers.get(T);W.has(T)&&!(D&&D.state==="loading"&&O.has(T))&<(T),Q.delete(T),O.delete(T),V.delete(T),me.delete(T),J.delete(T),x.fetchers.delete(T)}function Qa(T){let D=(te.get(T)||0)-1;D<=0?(te.delete(T),me.add(T)):te.set(T,D),yt({fetchers:new Map(x.fetchers)})}function lt(T,D){let L=W.get(T);L&&(L.abort(D),W.delete(T))}function Rn(T){for(let D of T){let L=zi(D),K=ca(L.data);x.fetchers.set(D,K)}}function zt(){let T=[],D=!1;for(let L of V){let K=x.fetchers.get(L);Re(K,`Expected fetcher: ${L}`),K.state==="loading"&&(V.delete(L),T.push(L),D=!0)}return Rn(T),D}function Jl(T){let D=[];for(let[L,K]of O)if(K<T){let X=x.fetchers.get(L);Re(X,`Expected fetcher: ${L}`),X.state==="loading"&&(lt(L),O.delete(L),D.push(L))}return Rn(D),D.length>0}function Jo(T,D){let L=x.blockers.get(T)||Ol;return be.get(T)!==D&&be.set(T,D),L}function Ql(T){x.blockers.delete(T),be.delete(T)}function Yn(T,D){let L=x.blockers.get(T)||Ol;Re(L.state==="unblocked"&&D.state==="blocked"||L.state==="blocked"&&D.state==="blocked"||L.state==="blocked"&&D.state==="proceeding"||L.state==="blocked"&&D.state==="unblocked"||L.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${L.state} -> ${D.state}`);let K=new Map(x.blockers);K.set(T,D),yt({blockers:K})}function Xa({currentLocation:T,nextLocation:D,historyAction:L}){if(be.size===0)return;be.size>1&&pt(!1,"A router only supports one blocker at a time");let K=Array.from(be.entries()),[X,ue]=K[K.length-1],ae=x.blockers.get(X);if(!(ae&&ae.state==="proceeding")&&ue({currentLocation:T,nextLocation:D,historyAction:L}))return X}function da(T){let D=Sn(404,{pathname:T}),L=m||h,{matches:K,route:X}=oo(L);return{notFoundMatches:K,route:X,error:D}}function In(T,D,L){if(S=T,R=D,C=L||null,!k&&x.navigation===hf){k=!0;let K=Xl(x.location,x.matches);K!=null&&yt({restoreScrollPosition:K})}return()=>{S=null,R=null,C=null}}function Za(T,D){return C&&C(T,D.map(K=>S_(K,x.loaderData)))||T.key}function Fa(T,D){if(S&&R){let L=Za(T,D);S[L]=R()}}function Xl(T,D){if(S){let L=Za(T,D),K=S[L];if(typeof K=="number")return K}return null}function Wa(T,D,L){if(r.patchRoutesOnNavigation)if(T){if(Object.keys(T[0].params).length>0)return{active:!0,matches:jl(D,L,p,!0)}}else return{active:!0,matches:jl(D,L,p,!0)||[]};return{active:!1,matches:null}}async function ha(T,D,L,K){if(!r.patchRoutesOnNavigation)return{type:"success",matches:T};let X=T;for(;;){let ue=m==null,ae=m||h,F=f;try{await r.patchRoutesOnNavigation({signal:L,path:D,matches:X,fetcherKey:K,patch:(ce,de)=>{L.aborted||yy(ce,de,ae,F,u,!1)}})}catch(ce){return{type:"error",error:ce,partialMatches:X}}finally{ue&&!L.aborted&&(h=[...h])}if(L.aborted)return{type:"aborted"};let ee=Ha(ae,D,p),oe=null;if(ee){if(Object.keys(ee[0].params).length===0)return{type:"success",matches:ee};if(oe=jl(ae,D,p,!0),!(oe&&X.length<oe.length&&ma(X,oe.slice(0,X.length))))return{type:"success",matches:ee}}if(oe||(oe=jl(ae,D,p,!0)),!oe||ma(X,oe))return{type:"success",matches:null};X=oe}}function ma(T,D){return T.length===D.length&&T.every((L,K)=>L.route.id===D[K].route.id)}function Qo(T){f={},m=Nl(T,u,void 0,f)}function Zl(T,D,L=!1){let K=m==null;yy(T,D,m||h,f,u,L),K&&(h=[...h],yt({}))}return le={get basename(){return p},get future(){return v},get state(){return x},get routes(){return h},get window(){return n},initialize:it,subscribe:Ar,enableScrollRestoration:In,navigate:kn,fetch:Di,revalidate:Ci,createHref:T=>r.history.createHref(T),encodeLocation:T=>r.history.encodeLocation(T),getFetcher:zi,resetFetcher:Ko,deleteFetcher:Qa,dispose:Ka,getBlocker:Jo,deleteBlocker:Ql,patchRoutes:Zl,_internalFetchControllers:W,_internalSetRoutes:Qo,_internalSetStateDoNotUseOrYouWillBreakYourApp(T){yt(T)}},r.unstable_instrumentations&&(le=P_(le,r.unstable_instrumentations.map(T=>T.router).filter(Boolean))),le}function tw(r){return r!=null&&("formData"in r&&r.formData!=null||"body"in r&&r.body!==void 0)}function Of(r,n,i,l,o,u){let f,h;if(o){f=[];for(let p of n)if(f.push(p),p.route.id===o){h=p;break}}else f=n,h=n[n.length-1];let m=Kf(l||".",If(f),En(r.pathname,i)||r.pathname,u==="path");if(l==null&&(m.search=r.search,m.hash=r.hash),(l==null||l===""||l===".")&&h){let p=Qf(m.search);if(h.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&p){let g=new URLSearchParams(m.search),v=g.getAll("index");g.delete("index"),v.filter(_=>_).forEach(_=>g.append("index",_));let w=g.toString();m.search=w?`?${w}`:""}}return i!=="/"&&(m.pathname=N_({basename:i,pathname:m.pathname})),Pn(m)}function my(r,n,i){if(!i||!tw(i))return{path:n};if(i.formMethod&&!vw(i.formMethod))return{path:n,error:Sn(405,{method:i.formMethod})};let l=()=>({path:n,error:Sn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),f=Mg(n);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Bt(u))return l();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((w,[_,S])=>`${w}${_}=${S}
|
|
10
|
+
`,""):String(i.body);return{path:n,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Bt(u))return l();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:n,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}Re(typeof FormData=="function","FormData is not available in this environment");let h,m;if(i.formData)h=Af(i.formData),m=i.formData;else if(i.body instanceof FormData)h=Af(i.body),m=i.body;else if(i.body instanceof URLSearchParams)h=i.body,m=wy(h);else if(i.body==null)h=new URLSearchParams,m=new FormData;else try{h=new URLSearchParams(i.body),m=wy(h)}catch{return l()}let p={formMethod:u,formAction:f,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(Bt(p.formMethod))return{path:n,submission:p};let g=Ga(n);return r&&g.search&&Qf(g.search)&&h.append("index",""),g.search=`?${h}`,{path:Pn(g),submission:p}}function py(r,n,i,l,o,u,f,h,m,p,g,v,w,_,S,C,R,k,q,$){let Z=$?sn($[1])?$[1].error:$[1].data:void 0,ne=o.createURL(u.location),le=o.createURL(m),x;if(g&&u.errors){let Ue=Object.keys(u.errors)[0];x=f.findIndex(ke=>ke.route.id===Ue)}else if($&&sn($[1])){let Ue=$[0];x=f.findIndex(ke=>ke.route.id===Ue)-1}let ge=$?$[1].statusCode:void 0,pe=ge&&ge>=400,Pe={currentUrl:ne,currentParams:u.matches[0]?.params||{},nextUrl:le,nextParams:f[0].params,...h,actionResult:Z,actionStatus:ge},_e=Pl(f),Ye=f.map((Ue,ke)=>{let{route:P}=Ue,J=null;if(x!=null&&ke>x?J=!1:P.lazy?J=!0:Jf(P)?g?J=Rf(P,u.loaderData,u.errors):nw(u.loaderData,u.matches[ke],Ue)&&(J=!0):J=!1,J!==null)return xf(i,l,r,_e,Ue,p,n,J);let W=pe?!1:v||ne.pathname+ne.search===le.pathname+le.search||ne.search!==le.search||aw(u.matches[ke],Ue),Se={...Pe,defaultShouldRevalidate:W},Oe=jo(Ue,Se);return xf(i,l,r,_e,Ue,p,n,Oe,Se)}),Ge=[];return S.forEach((Ue,ke)=>{if(g||!f.some(Q=>Q.route.id===Ue.routeId)||_.has(ke))return;let P=u.fetchers.get(ke),J=P&&P.state!=="idle"&&P.data===void 0,W=Ha(R,Ue.path,k);if(!W){if(q&&J)return;Ge.push({key:ke,routeId:Ue.routeId,path:Ue.path,matches:null,match:null,request:null,controller:null});return}if(C.has(ke))return;let Se=Oo(W,Ue.path),Oe=new AbortController,O=vi(o,Ue.path,Oe.signal),V=null;if(w.has(ke))w.delete(ke),V=Si(i,l,O,W,Se,p,n);else if(J)v&&(V=Si(i,l,O,W,Se,p,n));else{let Q={...Pe,defaultShouldRevalidate:pe?!1:v};jo(Se,Q)&&(V=Si(i,l,O,W,Se,p,n,Q))}V&&Ge.push({key:ke,routeId:Ue.routeId,path:Ue.path,matches:V,match:Se,request:O,controller:Oe})}),{dsMatches:Ye,revalidatingFetchers:Ge}}function Jf(r){return r.loader!=null||r.middleware!=null&&r.middleware.length>0}function Rf(r,n,i){if(r.lazy)return!0;if(!Jf(r))return!1;let l=n!=null&&r.id in n,o=i!=null&&i[r.id]!==void 0;return!l&&o?!1:typeof r.loader=="function"&&r.loader.hydrate===!0?!0:!l&&!o}function nw(r,n,i){let l=!n||i.route.id!==n.route.id,o=!r.hasOwnProperty(i.route.id);return l||o}function aw(r,n){let i=r.route.path;return r.pathname!==n.pathname||i!=null&&i.endsWith("*")&&r.params["*"]!==n.params["*"]}function jo(r,n){if(r.route.shouldRevalidate){let i=r.route.shouldRevalidate(n);if(typeof i=="boolean")return i}return n.defaultShouldRevalidate}function yy(r,n,i,l,o,u){let f;if(r){let p=l[r];Re(p,`No route found to patch children into: routeId = ${r}`),p.children||(p.children=[]),f=p.children}else f=i;let h=[],m=[];if(n.forEach(p=>{let g=f.find(v=>Cg(p,v));g?m.push({existingRoute:g,newRoute:p}):h.push(p)}),h.length>0){let p=Nl(h,o,[r||"_","patch",String(f?.length||"0")],l);f.push(...p)}if(u&&m.length>0)for(let p=0;p<m.length;p++){let{existingRoute:g,newRoute:v}=m[p],w=g,[_]=Nl([v],o,[],{},!0);Object.assign(w,{element:_.element?_.element:w.element,errorElement:_.errorElement?_.errorElement:w.errorElement,hydrateFallbackElement:_.hydrateFallbackElement?_.hydrateFallbackElement:w.hydrateFallbackElement})}}function Cg(r,n){return"id"in r&&"id"in n&&r.id===n.id?!0:r.index===n.index&&r.path===n.path&&r.caseSensitive===n.caseSensitive?(!r.children||r.children.length===0)&&(!n.children||n.children.length===0)?!0:r.children.every((i,l)=>n.children?.some(o=>Cg(i,o))):!1}var gy=new WeakMap,jg=({key:r,route:n,manifest:i,mapRouteProperties:l})=>{let o=i[n.id];if(Re(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[r];if(!u)return;let f=gy.get(o);f||(f={},gy.set(o,f));let h=f[r];if(h)return h;let m=(async()=>{let p=v_(r),v=o[r]!==void 0&&r!=="hasErrorBoundary";if(p)pt(!p,"Route property "+r+" is not a supported lazy route property. This property will be ignored."),f[r]=Promise.resolve();else if(v)pt(!1,`Route "${o.id}" has a static property "${r}" defined. The lazy property will be ignored.`);else{let w=await u();w!=null&&(Object.assign(o,{[r]:w}),Object.assign(o,l(o)))}typeof o.lazy=="object"&&(o.lazy[r]=void 0,Object.values(o.lazy).every(w=>w===void 0)&&(o.lazy=void 0))})();return f[r]=m,m},vy=new WeakMap;function rw(r,n,i,l,o){let u=i[r.id];if(Re(u,"No route found in manifest"),!r.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof r.lazy=="function"){let g=vy.get(u);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{Re(typeof r.lazy=="function","No lazy route function found");let w=await r.lazy(),_={};for(let S in w){let C=w[S];if(C===void 0)continue;let R=__(S),q=u[S]!==void 0&&S!=="hasErrorBoundary";R?pt(!R,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):q?pt(!q,`Route "${u.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):_[S]=C}Object.assign(u,_),Object.assign(u,{...l(u),lazy:void 0})})();return vy.set(u,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let f=Object.keys(r.lazy),h=[],m;for(let g of f){if(o&&o.includes(g))continue;let v=jg({key:g,route:r,manifest:i,mapRouteProperties:l});v&&(h.push(v),g===n&&(m=v))}let p=h.length>0?Promise.all(h).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:m}}async function by(r){let n=r.matches.filter(o=>o.shouldLoad),i={};return(await Promise.all(n.map(o=>o.resolve()))).forEach((o,u)=>{i[n[u].route.id]=o}),i}async function iw(r){return r.matches.some(n=>n.route.middleware)?Dg(r,()=>by(r)):by(r)}function Dg(r,n){return lw(r,n,l=>l,pw,i);function i(l,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:l}}));{let{matches:f}=r,h=Math.min(Math.max(f.findIndex(p=>p.route.id===o),0),Math.max(f.findIndex(p=>p.shouldCallHandler()),0)),m=qa(f,f[h].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:l}})}}}async function lw(r,n,i,l,o){let{matches:u,request:f,params:h,context:m,unstable_pattern:p}=r,g=u.flatMap(w=>w.route.middleware?w.route.middleware.map(_=>[w.route.id,_]):[]);return await Ug({request:f,params:h,context:m,unstable_pattern:p},g,n,i,l,o)}async function Ug(r,n,i,l,o,u,f=0){let{request:h}=r;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let m=n[f];if(!m)return await i();let[p,g]=m,v,w=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Ug(r,n,i,l,o,u,f+1)},v.value}catch(_){return v={value:await u(_,p,v)},v.value}};try{let _=await g(r,w),S=_!=null?l(_):void 0;return o(S)?S:v?S??v.value:(v={value:await w()},v.value)}catch(_){return await u(_,p,v)}}function zg(r,n,i,l,o){let u=jg({key:"middleware",route:l.route,manifest:n,mapRouteProperties:r}),f=rw(l.route,Bt(i.method)?"action":"loader",n,r,o);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function xf(r,n,i,l,o,u,f,h,m=null){let p=!1,g=zg(r,n,i,o,u);return{...o,_lazyPromises:g,shouldLoad:h,shouldRevalidateArgs:m,shouldCallHandler(v){return p=!0,m?typeof v=="boolean"?jo(o,{...m,defaultShouldRevalidate:v}):jo(o,m):h},resolve(v){let{lazy:w,loader:_,middleware:S}=o.route,C=p||h||v&&!Bt(i.method)&&(w||_),R=S&&S.length>0&&!_&&!w;return C&&(Bt(i.method)||!R)?ow({request:i,unstable_pattern:l,match:o,lazyHandlerPromise:g?.handler,lazyRoutePromise:g?.route,handlerOverride:v,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function Si(r,n,i,l,o,u,f,h=null){return l.map(m=>m.route.id!==o.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:zg(r,n,i,m,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:xf(r,n,i,Pl(l),m,u,f,!0,h))}async function sw(r,n,i,l,o,u){i.some(p=>p._lazyPromises?.middleware)&&await Promise.all(i.map(p=>p._lazyPromises?.middleware));let f={request:n,unstable_pattern:Pl(i),params:i[0].params,context:o,matches:i},m=await r({...f,fetcherKey:l,runClientMiddleware:p=>{let g=f;return Dg(g,()=>p({...g,fetcherKey:l,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return m}async function ow({request:r,unstable_pattern:n,match:i,lazyHandlerPromise:l,lazyRoutePromise:o,handlerOverride:u,scopedContext:f}){let h,m,p=Bt(r.method),g=p?"action":"loader",v=w=>{let _,S=new Promise((k,q)=>_=q);m=()=>_(),r.signal.addEventListener("abort",m);let C=k=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${i.route.id}]`)):w({request:r,unstable_pattern:n,params:i.params,context:f},...k!==void 0?[k]:[]),R=(async()=>{try{return{type:"data",result:await(u?u(q=>C(q)):C())}}catch(k){return{type:"error",result:k}}})();return Promise.race([R,S])};try{let w=p?i.route.action:i.route.loader;if(l||o)if(w){let _,[S]=await Promise.all([v(w).catch(C=>{_=C}),l,o]);if(_!==void 0)throw _;h=S}else{await l;let _=p?i.route.action:i.route.loader;if(_)[h]=await Promise.all([v(_),o]);else if(g==="action"){let S=new URL(r.url),C=S.pathname+S.search;throw Sn(405,{method:r.method,pathname:C,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(w)h=await v(w);else{let _=new URL(r.url),S=_.pathname+_.search;throw Sn(404,{pathname:S})}}catch(w){return{type:"error",result:w}}finally{m&&r.signal.removeEventListener("abort",m)}return h}async function uw(r){let n=r.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?r.body==null?null:r.json():r.text()}async function cw(r){let{result:n,type:i}=r;if(Ng(n)){let l;try{l=await uw(n)}catch(o){return{type:"error",error:o}}return i==="error"?{type:"error",error:new Bo(n.status,n.statusText,l),statusCode:n.status,headers:n.headers}:{type:"data",data:l,statusCode:n.status,headers:n.headers}}return i==="error"?Oy(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:mw(n),statusCode:kl(n)?n.status:void 0,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:kl(n)?n.status:void 0}:Oy(n)?{type:"data",data:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function fw(r,n,i,l,o){let u=r.headers.get("Location");if(Re(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Lo(u)){let f=l.slice(0,l.findIndex(h=>h.route.id===i)+1);u=Of(new URL(n.url),f,o,u),r.headers.set("Location",u)}return r}function _y(r,n,i){if(Lo(r)){let l=r,o=l.startsWith("//")?new URL(n.protocol+l):new URL(l),u=En(o.pathname,i)!=null;if(o.origin===n.origin&&u)return o.pathname+o.search+o.hash}return r}function vi(r,n,i,l){let o=r.createURL(Mg(n)).toString(),u={signal:i};if(l&&Bt(l.formMethod)){let{formMethod:f,formEncType:h}=l;u.method=f.toUpperCase(),h==="application/json"?(u.headers=new Headers({"Content-Type":h}),u.body=JSON.stringify(l.json)):h==="text/plain"?u.body=l.text:h==="application/x-www-form-urlencoded"&&l.formData?u.body=Af(l.formData):u.body=l.formData}return new Request(o,u)}function Af(r){let n=new URLSearchParams;for(let[i,l]of r.entries())n.append(i,typeof l=="string"?l:l.name);return n}function wy(r){let n=new FormData;for(let[i,l]of r.entries())n.append(i,l);return n}function dw(r,n,i,l=!1,o=!1){let u={},f=null,h,m=!1,p={},g=i&&sn(i[1])?i[1].error:void 0;return r.forEach(v=>{if(!(v.route.id in n))return;let w=v.route.id,_=n[w];if(Re(!Er(_),"Cannot handle redirect results in processLoaderData"),sn(_)){let S=_.error;if(g!==void 0&&(S=g,g=void 0),f=f||{},o)f[w]=S;else{let C=qa(r,w);f[C.route.id]==null&&(f[C.route.id]=S)}l||(u[w]=Ag),m||(m=!0,h=kl(_.error)?_.error.status:500),_.headers&&(p[w]=_.headers)}else u[w]=_.data,_.statusCode&&_.statusCode!==200&&!m&&(h=_.statusCode),_.headers&&(p[w]=_.headers)}),g!==void 0&&i&&(f={[i[0]]:g},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:f,statusCode:h||200,loaderHeaders:p}}function Sy(r,n,i,l,o,u){let{loaderData:f,errors:h}=dw(n,i,l);return o.filter(m=>!m.matches||m.matches.some(p=>p.shouldLoad)).forEach(m=>{let{key:p,match:g,controller:v}=m;if(v&&v.signal.aborted)return;let w=u[p];if(Re(w,"Did not find corresponding fetcher result"),sn(w)){let _=qa(r.matches,g?.route.id);h&&h[_.route.id]||(h={...h,[_.route.id]:w.error}),r.fetchers.delete(p)}else if(Er(w))Re(!1,"Unhandled fetcher revalidation redirect");else{let _=ca(w.data);r.fetchers.set(p,_)}}),{loaderData:f,errors:h}}function Ey(r,n,i,l){let o=Object.entries(n).filter(([,u])=>u!==Ag).reduce((u,[f,h])=>(u[f]=h,u),{});for(let u of i){let f=u.route.id;if(!n.hasOwnProperty(f)&&r.hasOwnProperty(f)&&u.route.loader&&(o[f]=r[f]),l&&l.hasOwnProperty(f))break}return o}function Ty(r){return r?sn(r[1])?{actionData:{}}:{actionData:{[r[0]]:r[1].data}}:{}}function qa(r,n){return(n?r.slice(0,r.findIndex(l=>l.route.id===n)+1):[...r]).reverse().find(l=>l.route.hasErrorBoundary===!0)||r[0]}function oo(r){let n=r.length===1?r[0]:r.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function Sn(r,{pathname:n,routeId:i,method:l,type:o,message:u}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return r===400?(f="Bad Request",l&&n&&i?h=`You made a ${l} request to "${n}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:o==="invalid-body"&&(h="Unable to encode submission body")):r===403?(f="Forbidden",h=`Route "${i}" does not match URL "${n}"`):r===404?(f="Not Found",h=`No route matches URL "${n}"`):r===405&&(f="Method Not Allowed",l&&n&&i?h=`You made a ${l.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(h=`Invalid request method "${l.toUpperCase()}"`)),new Bo(r||500,f,new Error(h),!0)}function uo(r){let n=Object.entries(r);for(let i=n.length-1;i>=0;i--){let[l,o]=n[i];if(Er(o))return{key:l,result:o}}}function Mg(r){let n=typeof r=="string"?Ga(r):r;return Pn({...n,hash:""})}function hw(r,n){return r.pathname!==n.pathname||r.search!==n.search?!1:r.hash===""?n.hash!=="":r.hash===n.hash?!0:n.hash!==""}function mw(r){return new Bo(r.init?.status??500,r.init?.statusText??"Internal Server Error",r.data)}function pw(r){return r!=null&&typeof r=="object"&&Object.entries(r).every(([n,i])=>typeof n=="string"&&yw(i))}function yw(r){return r!=null&&typeof r=="object"&&"type"in r&&"result"in r&&(r.type==="data"||r.type==="error")}function gw(r){return Ng(r.result)&&X_.has(r.result.status)}function sn(r){return r.type==="error"}function Er(r){return(r&&r.type)==="redirect"}function Oy(r){return typeof r=="object"&&r!=null&&"type"in r&&"data"in r&&"init"in r&&r.type==="DataWithResponseInit"}function Ng(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.headers=="object"&&typeof r.body<"u"}function vw(r){return Q_.has(r.toUpperCase())}function Bt(r){return K_.has(r.toUpperCase())}function Qf(r){return new URLSearchParams(r).getAll("index").some(n=>n==="")}function Oo(r,n){let i=typeof n=="string"?Ga(n).search:n.search;if(r[r.length-1].route.index&&Qf(i||""))return r[r.length-1];let l=Tg(r);return l[l.length-1]}function Ry(r){let{formMethod:n,formAction:i,formEncType:l,text:o,formData:u,json:f}=r;if(!(!n||!i||!l)){if(o!=null)return{formMethod:n,formAction:i,formEncType:l,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:n,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:i,formEncType:l,formData:void 0,json:f,text:void 0}}}function mf(r,n){return n?{state:"loading",location:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bw(r,n){return{state:"submitting",location:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function Rl(r,n){return r?{state:"loading",formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function _w(r,n){return{state:"submitting",formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text,data:n?n.data:void 0}}function ca(r){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function ww(r,n){try{let i=r.sessionStorage.getItem(xg);if(i){let l=JSON.parse(i);for(let[o,u]of Object.entries(l||{}))u&&Array.isArray(u)&&n.set(o,new Set(u||[]))}}catch{}}function Sw(r,n){if(n.size>0){let i={};for(let[l,o]of n)i[l]=[...o];try{r.sessionStorage.setItem(xg,JSON.stringify(i))}catch(l){pt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function xy(){let r,n,i=new Promise((l,o)=>{r=async u=>{l(u);try{await i}catch{}},n=async u=>{o(u);try{await i}catch{}}});return{promise:i,resolve:r,reject:n}}var xr=U.createContext(null);xr.displayName="DataRouter";var Vl=U.createContext(null);Vl.displayName="DataRouterState";U.createContext(!1);var Xf=U.createContext({isTransitioning:!1});Xf.displayName="ViewTransition";var kg=U.createContext(new Map);kg.displayName="Fetchers";var Ew=U.createContext(null);Ew.displayName="Await";var Nn=U.createContext(null);Nn.displayName="Navigation";var Ho=U.createContext(null);Ho.displayName="Location";var Vn=U.createContext({outlet:null,matches:[],isDataRoute:!1});Vn.displayName="Route";var Zf=U.createContext(null);Zf.displayName="RouteError";function Tw(r,{relative:n}={}){Re(Gl(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=U.useContext(Nn),{hash:o,pathname:u,search:f}=Yl(r,{relative:n}),h=u;return i!=="/"&&(h=u==="/"?i:$n([i,u])),l.createHref({pathname:h,search:f,hash:o})}function Gl(){return U.useContext(Ho)!=null}function Ya(){return Re(Gl(),"useLocation() may be used only in the context of a <Router> component."),U.useContext(Ho).location}var Lg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bg(r){U.useContext(Nn).static||U.useLayoutEffect(r)}function Hg(){let{isDataRoute:r}=U.useContext(Vn);return r?Bw():Ow()}function Ow(){Re(Gl(),"useNavigate() may be used only in the context of a <Router> component.");let r=U.useContext(xr),{basename:n,navigator:i}=U.useContext(Nn),{matches:l}=U.useContext(Vn),{pathname:o}=Ya(),u=JSON.stringify(If(l)),f=U.useRef(!1);return Bg(()=>{f.current=!0}),U.useCallback((m,p={})=>{if(pt(f.current,Lg),!f.current)return;if(typeof m=="number"){i.go(m);return}let g=Kf(m,JSON.parse(u),o,p.relative==="path");r==null&&n!=="/"&&(g.pathname=g.pathname==="/"?n:$n([n,g.pathname])),(p.replace?i.replace:i.push)(g,p.state,p)},[n,i,u,o,r])}U.createContext(null);function Rw(){let{matches:r}=U.useContext(Vn),n=r[r.length-1];return n?n.params:{}}function Yl(r,{relative:n}={}){let{matches:i}=U.useContext(Vn),{pathname:l}=Ya(),o=JSON.stringify(If(i));return U.useMemo(()=>Kf(r,JSON.parse(o),l,n==="path"),[r,o,l,n])}function xw(r,n,i,l,o){Re(Gl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=U.useContext(Nn),{matches:f}=U.useContext(Vn),h=f[f.length-1],m=h?h.params:{},p=h?h.pathname:"/",g=h?h.pathnameBase:"/",v=h&&h.route;{let q=v&&v.path||"";qg(p,!v||q.endsWith("*")||q.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${q}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${q}"> to <Route path="${q==="/"?"*":`${q}/*`}">.`)}let w=Ya(),_;_=w;let S=_.pathname||"/",C=S;if(g!=="/"){let q=g.replace(/^\//,"").split("/");C="/"+S.replace(/^\//,"").split("/").slice(q.length).join("/")}let R=Ha(r,{pathname:C});return pt(v||R!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),pt(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Uw(R&&R.map(q=>Object.assign({},q,{params:Object.assign({},m,q.params),pathname:$n([g,u.encodeLocation?u.encodeLocation(q.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathname]),pathnameBase:q.pathnameBase==="/"?g:$n([g,u.encodeLocation?u.encodeLocation(q.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathnameBase])})),f,i,l,o)}function Aw(){let r=Lw(),n=kl(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),i=r instanceof Error?r.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",r),f=U.createElement(U.Fragment,null,U.createElement("p",null,"💿 Hey developer 👋"),U.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",U.createElement("code",{style:u},"ErrorBoundary")," or"," ",U.createElement("code",{style:u},"errorElement")," prop on your route.")),U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},n),i?U.createElement("pre",{style:o},i):null,f)}var Cw=U.createElement(Aw,null),jw=class extends U.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,n){return n.location!==r.location||n.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:n.error,location:n.location,revalidation:r.revalidation||n.revalidation}}componentDidCatch(r,n){this.props.onError?this.props.onError(r,n):console.error("React Router caught the following error during render",r)}render(){return this.state.error!==void 0?U.createElement(Vn.Provider,{value:this.props.routeContext},U.createElement(Zf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Dw({routeContext:r,match:n,children:i}){let l=U.useContext(xr);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),U.createElement(Vn.Provider,{value:r},i)}function Uw(r,n=[],i=null,l=null,o=null){if(r==null){if(!i)return null;if(i.errors)r=i.matches;else if(n.length===0&&!i.initialized&&i.matches.length>0)r=i.matches;else return null}let u=r,f=i?.errors;if(f!=null){let g=u.findIndex(v=>v.route.id&&f?.[v.route.id]!==void 0);Re(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let h=!1,m=-1;if(i)for(let g=0;g<u.length;g++){let v=u[g];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(m=g),v.route.id){let{loaderData:w,errors:_}=i,S=v.route.loader&&!w.hasOwnProperty(v.route.id)&&(!_||_[v.route.id]===void 0);if(v.route.lazy||S){h=!0,m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}let p=i&&l?(g,v)=>{l(g,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Pl(i.matches),errorInfo:v})}:void 0;return u.reduceRight((g,v,w)=>{let _,S=!1,C=null,R=null;i&&(_=f&&v.route.id?f[v.route.id]:void 0,C=v.route.errorElement||Cw,h&&(m<0&&w===0?(qg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,R=null):m===w&&(S=!0,R=v.route.hydrateFallbackElement||null)));let k=n.concat(u.slice(0,w+1)),q=()=>{let $;return _?$=C:S?$=R:v.route.Component?$=U.createElement(v.route.Component,null):v.route.element?$=v.route.element:$=g,U.createElement(Dw,{match:v,routeContext:{outlet:g,matches:k,isDataRoute:i!=null},children:$})};return i&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?U.createElement(jw,{location:i.location,revalidation:i.revalidation,component:C,error:_,children:q(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:p}):q()},null)}function Ff(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zw(r){let n=U.useContext(xr);return Re(n,Ff(r)),n}function Mw(r){let n=U.useContext(Vl);return Re(n,Ff(r)),n}function Nw(r){let n=U.useContext(Vn);return Re(n,Ff(r)),n}function Wf(r){let n=Nw(r),i=n.matches[n.matches.length-1];return Re(i.route.id,`${r} can only be used on routes that contain a unique "id"`),i.route.id}function kw(){return Wf("useRouteId")}function Lw(){let r=U.useContext(Zf),n=Mw("useRouteError"),i=Wf("useRouteError");return r!==void 0?r:n.errors?.[i]}function Bw(){let{router:r}=zw("useNavigate"),n=Wf("useNavigate"),i=U.useRef(!1);return Bg(()=>{i.current=!0}),U.useCallback(async(o,u={})=>{pt(i.current,Lg),i.current&&(typeof o=="number"?await r.navigate(o):await r.navigate(o,{fromRouteId:n,...u}))},[r,n])}var Ay={};function qg(r,n,i){!n&&!Ay[r]&&(Ay[r]=!0,pt(!1,i))}var Cy={};function jy(r,n){!r&&!Cy[n]&&(Cy[n]=!0,console.warn(n))}var Hw="useOptimistic",Dy=i_[Hw];function qw(r){return Dy?Dy(r):[r,()=>{}]}function $w(r){let n={hasErrorBoundary:r.hasErrorBoundary||r.ErrorBoundary!=null||r.errorElement!=null};return r.Component&&(r.element&&pt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:U.createElement(r.Component),Component:void 0})),r.HydrateFallback&&(r.hydrateFallbackElement&&pt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:U.createElement(r.HydrateFallback),HydrateFallback:void 0})),r.ErrorBoundary&&(r.errorElement&&pt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:U.createElement(r.ErrorBoundary),ErrorBoundary:void 0})),n}var Pw=["HydrateFallback","hydrateFallbackElement"],Vw=class{constructor(){this.status="pending",this.promise=new Promise((n,i)=>{this.resolve=l=>{this.status==="pending"&&(this.status="resolved",n(l))},this.reject=l=>{this.status==="pending"&&(this.status="rejected",i(l))}})}};function Gw({router:r,flushSync:n,unstable_onError:i,unstable_useTransitions:l}){let[o,u]=U.useState(r.state),[f,h]=qw(o),[m,p]=U.useState(),[g,v]=U.useState({isTransitioning:!1}),[w,_]=U.useState(),[S,C]=U.useState(),[R,k]=U.useState(),q=U.useRef(new Map),$=U.useCallback((x,{deletedFetchers:ge,newErrors:pe,flushSync:Pe,viewTransitionOpts:_e})=>{pe&&i&&Object.values(pe).forEach(Ge=>i(Ge,{location:x.location,params:x.matches[0]?.params??{},unstable_pattern:Pl(x.matches)})),x.fetchers.forEach((Ge,Ue)=>{Ge.data!==void 0&&q.current.set(Ue,Ge.data)}),ge.forEach(Ge=>q.current.delete(Ge)),jy(Pe===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Ye=r.window!=null&&r.window.document!=null&&typeof r.window.document.startViewTransition=="function";if(jy(_e==null||Ye,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_e||!Ye){n&&Pe?n(()=>u(x)):l===!1?u(x):U.startTransition(()=>{l===!0&&h(Ge=>Uy(Ge,x)),u(x)});return}if(n&&Pe){n(()=>{S&&(w?.resolve(),S.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation})});let Ge=r.window.document.startViewTransition(()=>{n(()=>u(x))});Ge.finished.finally(()=>{n(()=>{_(void 0),C(void 0),p(void 0),v({isTransitioning:!1})})}),n(()=>C(Ge));return}S?(w?.resolve(),S.skipTransition(),k({state:x,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation})):(p(x),v({isTransitioning:!0,flushSync:!1,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation}))},[r.window,n,S,w,l,h,i]);U.useLayoutEffect(()=>r.subscribe($),[r,$]),U.useEffect(()=>{g.isTransitioning&&!g.flushSync&&_(new Vw)},[g]),U.useEffect(()=>{if(w&&m&&r.window){let x=m,ge=w.promise,pe=r.window.document.startViewTransition(async()=>{l===!1?u(x):U.startTransition(()=>{l===!0&&h(Pe=>Uy(Pe,x)),u(x)}),await ge});pe.finished.finally(()=>{_(void 0),C(void 0),p(void 0),v({isTransitioning:!1})}),C(pe)}},[m,w,r.window,l,h]),U.useEffect(()=>{w&&m&&f.location.key===m.location.key&&w.resolve()},[w,S,f.location,m]),U.useEffect(()=>{!g.isTransitioning&&R&&(p(R.state),v({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),k(void 0))},[g.isTransitioning,R]);let Z=U.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:x=>r.navigate(x),push:(x,ge,pe)=>r.navigate(x,{state:ge,preventScrollReset:pe?.preventScrollReset}),replace:(x,ge,pe)=>r.navigate(x,{replace:!0,state:ge,preventScrollReset:pe?.preventScrollReset})}),[r]),ne=r.basename||"/",le=U.useMemo(()=>({router:r,navigator:Z,static:!1,basename:ne,unstable_onError:i}),[r,Z,ne,i]);return U.createElement(U.Fragment,null,U.createElement(xr.Provider,{value:le},U.createElement(Vl.Provider,{value:f},U.createElement(kg.Provider,{value:q.current},U.createElement(Xf.Provider,{value:g},U.createElement(Kw,{basename:ne,location:f.location,navigationType:f.historyAction,navigator:Z,unstable_useTransitions:l===!0},U.createElement(Yw,{routes:r.routes,future:r.future,state:f,unstable_onError:i})))))),null)}function Uy(r,n){return{...r,navigation:n.navigation.state!=="idle"?n.navigation:r.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:r.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:r.actionData,fetchers:n.fetchers}}var Yw=U.memo(Iw);function Iw({routes:r,future:n,state:i,unstable_onError:l}){return xw(r,void 0,i,l,n)}function Kw({basename:r="/",children:n=null,location:i,navigationType:l="POP",navigator:o,static:u=!1,unstable_useTransitions:f}){Re(!Gl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=r.replace(/^\/*/,"/"),m=U.useMemo(()=>({basename:h,navigator:o,static:u,unstable_useTransitions:f,future:{}}),[h,o,u,f]);typeof i=="string"&&(i=Ga(i));let{pathname:p="/",search:g="",hash:v="",state:w=null,key:_="default"}=i,S=U.useMemo(()=>{let C=En(p,h);return C==null?null:{location:{pathname:C,search:g,hash:v,state:w,key:_},navigationType:l}},[h,p,g,v,w,_,l]);return pt(S!=null,`<Router basename="${h}"> is not able to match the URL "${p}${g}${v}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:U.createElement(Nn.Provider,{value:m},U.createElement(Ho.Provider,{children:n,value:S}))}var Ro="get",xo="application/x-www-form-urlencoded";function qo(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function Jw(r){return qo(r)&&r.tagName.toLowerCase()==="button"}function Qw(r){return qo(r)&&r.tagName.toLowerCase()==="form"}function Xw(r){return qo(r)&&r.tagName.toLowerCase()==="input"}function Zw(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Fw(r,n){return r.button===0&&(!n||n==="_self")&&!Zw(r)}var co=null;function Ww(){if(co===null)try{new FormData(document.createElement("form"),0),co=!1}catch{co=!0}return co}var eS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pf(r){return r!=null&&!eS.has(r)?(pt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xo}"`),null):r}function tS(r,n){let i,l,o,u,f;if(Qw(r)){let h=r.getAttribute("action");l=h?En(h,n):null,i=r.getAttribute("method")||Ro,o=pf(r.getAttribute("enctype"))||xo,u=new FormData(r)}else if(Jw(r)||Xw(r)&&(r.type==="submit"||r.type==="image")){let h=r.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=r.getAttribute("formaction")||h.getAttribute("action");if(l=m?En(m,n):null,i=r.getAttribute("formmethod")||h.getAttribute("method")||Ro,o=pf(r.getAttribute("formenctype"))||pf(h.getAttribute("enctype"))||xo,u=new FormData(h,r),!Ww()){let{name:p,type:g,value:v}=r;if(g==="image"){let w=p?`${p}.`:"";u.append(`${w}x`,"0"),u.append(`${w}y`,"0")}else p&&u.append(p,v)}}else{if(qo(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Ro,l=null,o=xo,f=r}return u&&o==="text/plain"&&(f=u,u=void 0),{action:l,method:i.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ed(r,n){if(r===!1||r===null||typeof r>"u")throw new Error(n)}function nS(r,n,i){let l=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return l.pathname==="/"?l.pathname=`_root.${i}`:n&&En(l.pathname,n)==="/"?l.pathname=`${n.replace(/\/$/,"")}/_root.${i}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${i}`,l}async function aS(r,n){if(r.id in n)return n[r.id];try{let i=await import(r.module);return n[r.id]=i,i}catch(i){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rS(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function iS(r,n,i){let l=await Promise.all(r.map(async o=>{let u=n.routes[o.route.id];if(u){let f=await aS(u,i);return f.links?f.links():[]}return[]}));return uS(l.flat(1).filter(rS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function zy(r,n,i,l,o,u){let f=(m,p)=>i[p]?m.route.id!==i[p].route.id:!0,h=(m,p)=>i[p].pathname!==m.pathname||i[p].route.path?.endsWith("*")&&i[p].params["*"]!==m.params["*"];return u==="assets"?n.filter((m,p)=>f(m,p)||h(m,p)):u==="data"?n.filter((m,p)=>{let g=l.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(f(m,p)||h(m,p))return!0;if(m.route.shouldRevalidate){let v=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function lS(r,n,{includeHydrateFallback:i}={}){return sS(r.map(l=>{let o=n.routes[l.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function sS(r){return[...new Set(r)]}function oS(r){let n={},i=Object.keys(r).sort();for(let l of i)n[l]=r[l];return n}function uS(r,n){let i=new Set;return new Set(n),r.reduce((l,o)=>{let u=JSON.stringify(oS(o));return i.has(u)||(i.add(u),l.push({key:u,link:o})),l},[])}function $g(){let r=U.useContext(xr);return ed(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function cS(){let r=U.useContext(Vl);return ed(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var td=U.createContext(void 0);td.displayName="FrameworkContext";function Pg(){let r=U.useContext(td);return ed(r,"You must render this element inside a <HydratedRouter> element"),r}function fS(r,n){let i=U.useContext(td),[l,o]=U.useState(!1),[u,f]=U.useState(!1),{onFocus:h,onBlur:m,onMouseEnter:p,onMouseLeave:g,onTouchStart:v}=n,w=U.useRef(null);U.useEffect(()=>{if(r==="render"&&f(!0),r==="viewport"){let C=k=>{k.forEach(q=>{f(q.isIntersecting)})},R=new IntersectionObserver(C,{threshold:.5});return w.current&&R.observe(w.current),()=>{R.disconnect()}}},[r]),U.useEffect(()=>{if(l){let C=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(C)}}},[l]);let _=()=>{o(!0)},S=()=>{o(!1),f(!1)};return i?r!=="intent"?[u,w,{}]:[u,w,{onFocus:xl(h,_),onBlur:xl(m,S),onMouseEnter:xl(p,_),onMouseLeave:xl(g,S),onTouchStart:xl(v,_)}]:[!1,w,{}]}function xl(r,n){return i=>{r&&r(i),i.defaultPrevented||n(i)}}function dS({page:r,...n}){let{router:i}=$g(),l=U.useMemo(()=>Ha(i.routes,r,i.basename),[i.routes,r,i.basename]);return l?U.createElement(mS,{page:r,matches:l,...n}):null}function hS(r){let{manifest:n,routeModules:i}=Pg(),[l,o]=U.useState([]);return U.useEffect(()=>{let u=!1;return iS(r,n,i).then(f=>{u||o(f)}),()=>{u=!0}},[r,n,i]),l}function mS({page:r,matches:n,...i}){let l=Ya(),{manifest:o,routeModules:u}=Pg(),{basename:f}=$g(),{loaderData:h,matches:m}=cS(),p=U.useMemo(()=>zy(r,n,m,o,l,"data"),[r,n,m,o,l]),g=U.useMemo(()=>zy(r,n,m,o,l,"assets"),[r,n,m,o,l]),v=U.useMemo(()=>{if(r===l.pathname+l.search+l.hash)return[];let S=new Set,C=!1;if(n.forEach(k=>{let q=o.routes[k.route.id];!q||!q.hasLoader||(!p.some($=>$.route.id===k.route.id)&&k.route.id in h&&u[k.route.id]?.shouldRevalidate||q.hasClientLoader?C=!0:S.add(k.route.id))}),S.size===0)return[];let R=nS(r,f,"data");return C&&S.size>0&&R.searchParams.set("_routes",n.filter(k=>S.has(k.route.id)).map(k=>k.route.id).join(",")),[R.pathname+R.search]},[f,h,l,o,p,n,r,u]),w=U.useMemo(()=>lS(g,o),[g,o]),_=hS(g);return U.createElement(U.Fragment,null,v.map(S=>U.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...i})),w.map(S=>U.createElement("link",{key:S,rel:"modulepreload",href:S,...i})),_.map(({key:S,link:C})=>U.createElement("link",{key:S,nonce:i.nonce,...C})))}function pS(...r){return n=>{r.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var Vg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Vg&&(window.__reactRouterVersion="7.10.0")}catch{}function yS(r,n){return ew({basename:n?.basename,getContext:n?.getContext,future:n?.future,history:m_({window:n?.window}),hydrationData:gS(),routes:r,mapRouteProperties:$w,hydrationRouteProperties:Pw,dataStrategy:n?.dataStrategy,patchRoutesOnNavigation:n?.patchRoutesOnNavigation,window:n?.window,unstable_instrumentations:n?.unstable_instrumentations}).initialize()}function gS(){let r=window?.__staticRouterHydrationData;return r&&r.errors&&(r={...r,errors:vS(r.errors)}),r}function vS(r){if(!r)return null;let n=Object.entries(r),i={};for(let[l,o]of n)if(o&&o.__type==="RouteErrorResponse")i[l]=new Bo(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let u=window[o.__subType];if(typeof u=="function")try{let f=new u(o.message);f.stack="",i[l]=f}catch{}}if(i[l]==null){let u=new Error(o.message);u.stack="",i[l]=u}}else i[l]=o;return i}var Gg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ll=U.forwardRef(function({onClick:n,discover:i="render",prefetch:l="none",relative:o,reloadDocument:u,replace:f,state:h,target:m,to:p,preventScrollReset:g,viewTransition:v,...w},_){let{basename:S,unstable_useTransitions:C}=U.useContext(Nn),R=typeof p=="string"&&Gg.test(p),k,q=!1;if(typeof p=="string"&&R&&(k=p,Vg))try{let Pe=new URL(window.location.href),_e=p.startsWith("//")?new URL(Pe.protocol+p):new URL(p),Ye=En(_e.pathname,S);_e.origin===Pe.origin&&Ye!=null?p=Ye+_e.search+_e.hash:q=!0}catch{pt(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let $=Tw(p,{relative:o}),[Z,ne,le]=fS(l,w),x=SS(p,{replace:f,state:h,target:m,preventScrollReset:g,relative:o,viewTransition:v,unstable_useTransitions:C});function ge(Pe){n&&n(Pe),Pe.defaultPrevented||x(Pe)}let pe=U.createElement("a",{...w,...le,href:k||$,onClick:q||u?n:ge,ref:pS(_,ne),target:m,"data-discover":!R&&i==="render"?"true":void 0});return Z&&!R?U.createElement(U.Fragment,null,pe,U.createElement(dS,{page:$})):pe});Ll.displayName="Link";var bS=U.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:l="",end:o=!1,style:u,to:f,viewTransition:h,children:m,...p},g){let v=Yl(f,{relative:p.relative}),w=Ya(),_=U.useContext(Vl),{navigator:S,basename:C}=U.useContext(Nn),R=_!=null&&xS(v)&&h===!0,k=S.encodeLocation?S.encodeLocation(v).pathname:v.pathname,q=w.pathname,$=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;i||(q=q.toLowerCase(),$=$?$.toLowerCase():null,k=k.toLowerCase()),$&&C&&($=En($,C)||$);const Z=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let ne=q===k||!o&&q.startsWith(k)&&q.charAt(Z)==="/",le=$!=null&&($===k||!o&&$.startsWith(k)&&$.charAt(k.length)==="/"),x={isActive:ne,isPending:le,isTransitioning:R},ge=ne?n:void 0,pe;typeof l=="function"?pe=l(x):pe=[l,ne?"active":null,le?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let Pe=typeof u=="function"?u(x):u;return U.createElement(Ll,{...p,"aria-current":ge,className:pe,ref:g,style:Pe,to:f,viewTransition:h},typeof m=="function"?m(x):m)});bS.displayName="NavLink";var _S=U.forwardRef(({discover:r="render",fetcherKey:n,navigate:i,reloadDocument:l,replace:o,state:u,method:f=Ro,action:h,onSubmit:m,relative:p,preventScrollReset:g,viewTransition:v,...w},_)=>{let{unstable_useTransitions:S}=U.useContext(Nn),C=OS(),R=RS(h,{relative:p}),k=f.toLowerCase()==="get"?"get":"post",q=typeof h=="string"&&Gg.test(h),$=Z=>{if(m&&m(Z),Z.defaultPrevented)return;Z.preventDefault();let ne=Z.nativeEvent.submitter,le=ne?.getAttribute("formmethod")||f,x=()=>C(ne||Z.currentTarget,{fetcherKey:n,method:le,navigate:i,replace:o,state:u,relative:p,preventScrollReset:g,viewTransition:v});S&&i!==!1?U.startTransition(()=>x()):x()};return U.createElement("form",{ref:_,method:k,action:R,onSubmit:l?m:$,...w,"data-discover":!q&&r==="render"?"true":void 0})});_S.displayName="Form";function wS(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yg(r){let n=U.useContext(xr);return Re(n,wS(r)),n}function SS(r,{target:n,replace:i,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_useTransitions:h}={}){let m=Hg(),p=Ya(),g=Yl(r,{relative:u});return U.useCallback(v=>{if(Fw(v,n)){v.preventDefault();let w=i!==void 0?i:Pn(p)===Pn(g),_=()=>m(r,{replace:w,state:l,preventScrollReset:o,relative:u,viewTransition:f});h?U.startTransition(()=>_()):_()}},[p,m,g,i,l,n,r,o,u,f,h])}var ES=0,TS=()=>`__${String(++ES)}__`;function OS(){let{router:r}=Yg("useSubmit"),{basename:n}=U.useContext(Nn),i=kw(),l=r.fetch,o=r.navigate;return U.useCallback(async(u,f={})=>{let{action:h,method:m,encType:p,formData:g,body:v}=tS(u,n);if(f.navigate===!1){let w=f.fetcherKey||TS();await l(w,i,f.action||h,{preventScrollReset:f.preventScrollReset,formData:g,body:v,formMethod:f.method||m,formEncType:f.encType||p,flushSync:f.flushSync})}else await o(f.action||h,{preventScrollReset:f.preventScrollReset,formData:g,body:v,formMethod:f.method||m,formEncType:f.encType||p,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,o,n,i])}function RS(r,{relative:n}={}){let{basename:i}=U.useContext(Nn),l=U.useContext(Vn);Re(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),u={...Yl(r||".",{relative:n})},f=Ya();if(r==null){u.search=f.search;let h=new URLSearchParams(u.search),m=h.getAll("index");if(m.some(g=>g==="")){h.delete("index"),m.filter(v=>v).forEach(v=>h.append("index",v));let g=h.toString();u.search=g?`?${g}`:""}}return(!r||r===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:$n([i,u.pathname])),Pn(u)}function xS(r,{relative:n}={}){let i=U.useContext(Xf);Re(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=Yg("useViewTransitionState"),o=Yl(r,{relative:n});if(!i.isTransitioning)return!1;let u=En(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=En(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Co(o.pathname,f)!=null||Co(o.pathname,u)!=null}var Ig=bg();function AS(r){return U.createElement(Gw,{flushSync:Ig.flushSync,...r})}var Cf=function(r,n){return Cf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(i[o]=l[o])},Cf(r,n)};function Kg(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Cf(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}var Do=function(){return Do=Object.assign||function(n){for(var i,l=1,o=arguments.length;l<o;l++){i=arguments[l];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(n[u]=i[u])}return n},Do.apply(this,arguments)};function xi(r,n){var i={};for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&n.indexOf(l)<0&&(i[l]=r[l]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(r);o<l.length;o++)n.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(r,l[o])&&(i[l[o]]=r[l[o]]);return i}function Jg(r,n,i,l){var o=arguments.length,u=o<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,i):l,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,n,i,l);else for(var h=r.length-1;h>=0;h--)(f=r[h])&&(u=(o<3?f(u):o>3?f(n,i,u):f(n,i))||u);return o>3&&u&&Object.defineProperty(n,i,u),u}function Qg(r,n){return function(i,l){n(i,l,r)}}function Xg(r,n,i,l,o,u){function f(k){if(k!==void 0&&typeof k!="function")throw new TypeError("Function expected");return k}for(var h=l.kind,m=h==="getter"?"get":h==="setter"?"set":"value",p=!n&&r?l.static?r:r.prototype:null,g=n||(p?Object.getOwnPropertyDescriptor(p,l.name):{}),v,w=!1,_=i.length-1;_>=0;_--){var S={};for(var C in l)S[C]=C==="access"?{}:l[C];for(var C in l.access)S.access[C]=l.access[C];S.addInitializer=function(k){if(w)throw new TypeError("Cannot add initializers after decoration has completed");u.push(f(k||null))};var R=(0,i[_])(h==="accessor"?{get:g.get,set:g.set}:g[m],S);if(h==="accessor"){if(R===void 0)continue;if(R===null||typeof R!="object")throw new TypeError("Object expected");(v=f(R.get))&&(g.get=v),(v=f(R.set))&&(g.set=v),(v=f(R.init))&&o.unshift(v)}else(v=f(R))&&(h==="field"?o.unshift(v):g[m]=v)}p&&Object.defineProperty(p,l.name,g),w=!0}function Zg(r,n,i){for(var l=arguments.length>2,o=0;o<n.length;o++)i=l?n[o].call(r,i):n[o].call(r);return l?i:void 0}function Fg(r){return typeof r=="symbol"?r:"".concat(r)}function Wg(r,n,i){return typeof n=="symbol"&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:i?"".concat(i," ",n):n})}function ev(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)}function ie(r,n,i,l){function o(u){return u instanceof i?u:new i(function(f){f(u)})}return new(i||(i=Promise))(function(u,f){function h(g){try{p(l.next(g))}catch(v){f(v)}}function m(g){try{p(l.throw(g))}catch(v){f(v)}}function p(g){g.done?u(g.value):o(g.value).then(h,m)}p((l=l.apply(r,n||[])).next())})}function tv(r,n){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},l,o,u,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=h(0),f.throw=h(1),f.return=h(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(p){return function(g){return m([p,g])}}function m(p){if(l)throw new TypeError("Generator is already executing.");for(;f&&(f=0,p[0]&&(i=0)),i;)try{if(l=1,o&&(u=p[0]&2?o.return:p[0]?o.throw||((u=o.return)&&u.call(o),0):o.next)&&!(u=u.call(o,p[1])).done)return u;switch(o=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,o=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){i.label=p[1];break}if(p[0]===6&&i.label<u[1]){i.label=u[1],u=p;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(p);break}u[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(g){p=[6,g],o=0}finally{l=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}var $o=Object.create?(function(r,n,i,l){l===void 0&&(l=i);var o=Object.getOwnPropertyDescriptor(n,i);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,l,o)}):(function(r,n,i,l){l===void 0&&(l=i),r[l]=n[i]});function nv(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&$o(n,r,i)}function Uo(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],l=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&l>=r.length&&(r=void 0),{value:r&&r[l++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function nd(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var l=i.call(r),o,u=[],f;try{for(;(n===void 0||n-- >0)&&!(o=l.next()).done;)u.push(o.value)}catch(h){f={error:h}}finally{try{o&&!o.done&&(i=l.return)&&i.call(l)}finally{if(f)throw f.error}}return u}function av(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(nd(arguments[n]));return r}function rv(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var l=Array(r),o=0,n=0;n<i;n++)for(var u=arguments[n],f=0,h=u.length;f<h;f++,o++)l[o]=u[f];return l}function iv(r,n,i){if(i||arguments.length===2)for(var l=0,o=n.length,u;l<o;l++)(u||!(l in n))&&(u||(u=Array.prototype.slice.call(n,0,l)),u[l]=n[l]);return r.concat(u||Array.prototype.slice.call(n))}function Oi(r){return this instanceof Oi?(this.v=r,this):new Oi(r)}function lv(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=i.apply(r,n||[]),o,u=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),h("next"),h("throw"),h("return",f),o[Symbol.asyncIterator]=function(){return this},o;function f(_){return function(S){return Promise.resolve(S).then(_,v)}}function h(_,S){l[_]&&(o[_]=function(C){return new Promise(function(R,k){u.push([_,C,R,k])>1||m(_,C)})},S&&(o[_]=S(o[_])))}function m(_,S){try{p(l[_](S))}catch(C){w(u[0][3],C)}}function p(_){_.value instanceof Oi?Promise.resolve(_.value.v).then(g,v):w(u[0][2],_)}function g(_){m("next",_)}function v(_){m("throw",_)}function w(_,S){_(S),u.shift(),u.length&&m(u[0][0],u[0][1])}}function sv(r){var n,i;return n={},l("next"),l("throw",function(o){throw o}),l("return"),n[Symbol.iterator]=function(){return this},n;function l(o,u){n[o]=r[o]?function(f){return(i=!i)?{value:Oi(r[o](f)),done:!1}:u?u(f):f}:u}}function ov(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Uo=="function"?Uo(r):r[Symbol.iterator](),i={},l("next"),l("throw"),l("return"),i[Symbol.asyncIterator]=function(){return this},i);function l(u){i[u]=r[u]&&function(f){return new Promise(function(h,m){f=r[u](f),o(h,m,f.done,f.value)})}}function o(u,f,h,m){Promise.resolve(m).then(function(p){u({value:p,done:h})},f)}}function uv(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r}var CS=Object.create?(function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}):function(r,n){r.default=n},jf=function(r){return jf=Object.getOwnPropertyNames||function(n){var i=[];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(i[i.length]=l);return i},jf(r)};function cv(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i=jf(r),l=0;l<i.length;l++)i[l]!=="default"&&$o(n,r,i[l]);return CS(n,r),n}function fv(r){return r&&r.__esModule?r:{default:r}}function dv(r,n,i,l){if(i==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!l:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?l:i==="a"?l.call(r):l?l.value:n.get(r)}function hv(r,n,i,l,o){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!o:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?o.call(r,i):o?o.value=i:n.set(r,i),i}function mv(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)}function pv(r,n,i){if(n!=null){if(typeof n!="object"&&typeof n!="function")throw new TypeError("Object expected.");var l,o;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");l=n[Symbol.asyncDispose]}if(l===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");l=n[Symbol.dispose],i&&(o=l)}if(typeof l!="function")throw new TypeError("Object not disposable.");o&&(l=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),r.stack.push({value:n,dispose:l,async:i})}else i&&r.stack.push({async:!0});return n}var jS=typeof SuppressedError=="function"?SuppressedError:function(r,n,i){var l=new Error(i);return l.name="SuppressedError",l.error=r,l.suppressed=n,l};function yv(r){function n(u){r.error=r.hasError?new jS(u,r.error,"An error was suppressed during disposal."):u,r.hasError=!0}var i,l=0;function o(){for(;i=r.stack.pop();)try{if(!i.async&&l===1)return l=0,r.stack.push(i),Promise.resolve().then(o);if(i.dispose){var u=i.dispose.call(i.value);if(i.async)return l|=2,Promise.resolve(u).then(o,function(f){return n(f),o()})}else l|=1}catch(f){n(f)}if(l===1)return r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}return o()}function gv(r,n){return typeof r=="string"&&/^\.\.?\//.test(r)?r.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(i,l,o,u,f){return l?n?".jsx":".js":o&&(!u||!f)?i:o+u+"."+f.toLowerCase()+"js"}):r}const DS={__extends:Kg,__assign:Do,__rest:xi,__decorate:Jg,__param:Qg,__esDecorate:Xg,__runInitializers:Zg,__propKey:Fg,__setFunctionName:Wg,__metadata:ev,__awaiter:ie,__generator:tv,__createBinding:$o,__exportStar:nv,__values:Uo,__read:nd,__spread:av,__spreadArrays:rv,__spreadArray:iv,__await:Oi,__asyncGenerator:lv,__asyncDelegator:sv,__asyncValues:ov,__makeTemplateObject:uv,__importStar:cv,__importDefault:fv,__classPrivateFieldGet:dv,__classPrivateFieldSet:hv,__classPrivateFieldIn:mv,__addDisposableResource:pv,__disposeResources:yv,__rewriteRelativeImportExtension:gv},US=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:pv,get __assign(){return Do},__asyncDelegator:sv,__asyncGenerator:lv,__asyncValues:ov,__await:Oi,__awaiter:ie,__classPrivateFieldGet:dv,__classPrivateFieldIn:mv,__classPrivateFieldSet:hv,__createBinding:$o,__decorate:Jg,__disposeResources:yv,__esDecorate:Xg,__exportStar:nv,__extends:Kg,__generator:tv,__importDefault:fv,__importStar:cv,__makeTemplateObject:uv,__metadata:ev,__param:Qg,__propKey:Fg,__read:nd,__rest:xi,__rewriteRelativeImportExtension:gv,__runInitializers:Zg,__setFunctionName:Wg,__spread:av,__spreadArray:iv,__spreadArrays:rv,__values:Uo,default:DS},Symbol.toStringTag,{value:"Module"})),zS=r=>r?(...n)=>r(...n):(...n)=>fetch(...n);class ad extends Error{constructor(n,i="FunctionsError",l){super(n),this.name=i,this.context=l}}class MS extends ad{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class My extends ad{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class Ny extends ad{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var Df;(function(r){r.Any="any",r.ApNortheast1="ap-northeast-1",r.ApNortheast2="ap-northeast-2",r.ApSouth1="ap-south-1",r.ApSoutheast1="ap-southeast-1",r.ApSoutheast2="ap-southeast-2",r.CaCentral1="ca-central-1",r.EuCentral1="eu-central-1",r.EuWest1="eu-west-1",r.EuWest2="eu-west-2",r.EuWest3="eu-west-3",r.SaEast1="sa-east-1",r.UsEast1="us-east-1",r.UsWest1="us-west-1",r.UsWest2="us-west-2"})(Df||(Df={}));class NS{constructor(n,{headers:i={},customFetch:l,region:o=Df.Any}={}){this.url=n,this.headers=i,this.region=o,this.fetch=zS(l)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return ie(this,arguments,void 0,function*(i,l={}){var o;let u,f;try{const{headers:h,method:m,body:p,signal:g,timeout:v}=l;let w={},{region:_}=l;_||(_=this.region);const S=new URL(`${this.url}/${i}`);_&&_!=="any"&&(w["x-region"]=_,S.searchParams.set("forceFunctionRegion",_));let C;p&&(h&&!Object.prototype.hasOwnProperty.call(h,"Content-Type")||!h)?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(w["Content-Type"]="application/octet-stream",C=p):typeof p=="string"?(w["Content-Type"]="text/plain",C=p):typeof FormData<"u"&&p instanceof FormData?C=p:(w["Content-Type"]="application/json",C=JSON.stringify(p)):C=p;let R=g;v&&(f=new AbortController,u=setTimeout(()=>f.abort(),v),g?(R=f.signal,g.addEventListener("abort",()=>f.abort())):R=f.signal);const k=yield this.fetch(S.toString(),{method:m||"POST",headers:Object.assign(Object.assign(Object.assign({},w),this.headers),h),body:C,signal:R}).catch(ne=>{throw new MS(ne)}),q=k.headers.get("x-relay-error");if(q&&q==="true")throw new My(k);if(!k.ok)throw new Ny(k);let $=((o=k.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),Z;return $==="application/json"?Z=yield k.json():$==="application/octet-stream"||$==="application/pdf"?Z=yield k.blob():$==="text/event-stream"?Z=k:$==="multipart/form-data"?Z=yield k.formData():Z=yield k.text(),{data:Z,error:null,response:k}}catch(h){return{data:null,error:h,response:h instanceof Ny||h instanceof My?h.context:void 0}}finally{u&&clearTimeout(u)}})}}var Nt={};const Ai=t_(US);var fo={},ho={},mo={},po={},yo={},go={},ky;function vv(){if(ky)return go;ky=1,Object.defineProperty(go,"__esModule",{value:!0});class r extends Error{constructor(i){super(i.message),this.name="PostgrestError",this.details=i.details,this.hint=i.hint,this.code=i.code}}return go.default=r,go}var Ly;function bv(){if(Ly)return yo;Ly=1,Object.defineProperty(yo,"__esModule",{value:!0});const n=Ai.__importDefault(vv());class i{constructor(o){var u,f;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(u=o.shouldThrowOnError)!==null&&u!==void 0?u:!1,this.signal=o.signal,this.isMaybeSingle=(f=o.isMaybeSingle)!==null&&f!==void 0?f:!1,o.fetch?this.fetch=o.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,u){return this.headers=new Headers(this.headers),this.headers.set(o,u),this}then(o,u){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const f=this.fetch;let h=f(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async m=>{var p,g,v,w;let _=null,S=null,C=null,R=m.status,k=m.statusText;if(m.ok){if(this.method!=="HEAD"){const ne=await m.text();ne===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((p=this.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?S=ne:S=JSON.parse(ne))}const $=(g=this.headers.get("Prefer"))===null||g===void 0?void 0:g.match(/count=(exact|planned|estimated)/),Z=(v=m.headers.get("content-range"))===null||v===void 0?void 0:v.split("/");$&&Z&&Z.length>1&&(C=parseInt(Z[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(S)&&(S.length>1?(_={code:"PGRST116",details:`Results contain ${S.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},S=null,C=null,R=406,k="Not Acceptable"):S.length===1?S=S[0]:S=null)}else{const $=await m.text();try{_=JSON.parse($),Array.isArray(_)&&m.status===404&&(S=[],_=null,R=200,k="OK")}catch{m.status===404&&$===""?(R=204,k="No Content"):_={message:$}}if(_&&this.isMaybeSingle&&(!((w=_?.details)===null||w===void 0)&&w.includes("0 rows"))&&(_=null,R=200,k="OK"),_&&this.shouldThrowOnError)throw new n.default(_)}return{error:_,data:S,count:C,status:R,statusText:k}});return this.shouldThrowOnError||(h=h.catch(m=>{var p,g,v,w,_,S;let C="";const R=m?.cause;if(R){const k=(p=R?.message)!==null&&p!==void 0?p:"",q=(g=R?.code)!==null&&g!==void 0?g:"";C=`${(v=m?.name)!==null&&v!==void 0?v:"FetchError"}: ${m?.message}`,C+=`
|
|
13
|
+
|
|
14
|
+
Caused by: ${(w=R?.name)!==null&&w!==void 0?w:"Error"}: ${k}`,q&&(C+=` (${q})`),R?.stack&&(C+=`
|
|
15
|
+
${R.stack}`)}else C=(_=m?.stack)!==null&&_!==void 0?_:"";return{error:{message:`${(S=m?.name)!==null&&S!==void 0?S:"FetchError"}: ${m?.message}`,details:C,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),h.then(o,u)}returns(){return this}overrideTypes(){return this}}return yo.default=i,yo}var By;function _v(){if(By)return po;By=1,Object.defineProperty(po,"__esModule",{value:!0});const n=Ai.__importDefault(bv());class i extends n.default{select(o){let u=!1;const f=(o??"*").split("").map(h=>/\s/.test(h)&&!u?"":(h==='"'&&(u=!u),h)).join("");return this.url.searchParams.set("select",f),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:u=!0,nullsFirst:f,foreignTable:h,referencedTable:m=h}={}){const p=m?`${m}.order`:"order",g=this.url.searchParams.get(p);return this.url.searchParams.set(p,`${g?`${g},`:""}${o}.${u?"asc":"desc"}${f===void 0?"":f?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:u,referencedTable:f=u}={}){const h=typeof f>"u"?"limit":`${f}.limit`;return this.url.searchParams.set(h,`${o}`),this}range(o,u,{foreignTable:f,referencedTable:h=f}={}){const m=typeof h>"u"?"offset":`${h}.offset`,p=typeof h>"u"?"limit":`${h}.limit`;return this.url.searchParams.set(m,`${o}`),this.url.searchParams.set(p,`${u-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:o=!1,verbose:u=!1,settings:f=!1,buffers:h=!1,wal:m=!1,format:p="text"}={}){var g;const v=[o?"analyze":null,u?"verbose":null,f?"settings":null,h?"buffers":null,m?"wal":null].filter(Boolean).join("|"),w=(g=this.headers.get("Accept"))!==null&&g!==void 0?g:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${p}; for="${w}"; options=${v};`),p==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}}return po.default=i,po}var Hy;function rd(){if(Hy)return mo;Hy=1,Object.defineProperty(mo,"__esModule",{value:!0});const n=Ai.__importDefault(_v()),i=new RegExp("[,()]");class l extends n.default{eq(u,f){return this.url.searchParams.append(u,`eq.${f}`),this}neq(u,f){return this.url.searchParams.append(u,`neq.${f}`),this}gt(u,f){return this.url.searchParams.append(u,`gt.${f}`),this}gte(u,f){return this.url.searchParams.append(u,`gte.${f}`),this}lt(u,f){return this.url.searchParams.append(u,`lt.${f}`),this}lte(u,f){return this.url.searchParams.append(u,`lte.${f}`),this}like(u,f){return this.url.searchParams.append(u,`like.${f}`),this}likeAllOf(u,f){return this.url.searchParams.append(u,`like(all).{${f.join(",")}}`),this}likeAnyOf(u,f){return this.url.searchParams.append(u,`like(any).{${f.join(",")}}`),this}ilike(u,f){return this.url.searchParams.append(u,`ilike.${f}`),this}ilikeAllOf(u,f){return this.url.searchParams.append(u,`ilike(all).{${f.join(",")}}`),this}ilikeAnyOf(u,f){return this.url.searchParams.append(u,`ilike(any).{${f.join(",")}}`),this}regexMatch(u,f){return this.url.searchParams.append(u,`match.${f}`),this}regexIMatch(u,f){return this.url.searchParams.append(u,`imatch.${f}`),this}is(u,f){return this.url.searchParams.append(u,`is.${f}`),this}isDistinct(u,f){return this.url.searchParams.append(u,`isdistinct.${f}`),this}in(u,f){const h=Array.from(new Set(f)).map(m=>typeof m=="string"&&i.test(m)?`"${m}"`:`${m}`).join(",");return this.url.searchParams.append(u,`in.(${h})`),this}contains(u,f){return typeof f=="string"?this.url.searchParams.append(u,`cs.${f}`):Array.isArray(f)?this.url.searchParams.append(u,`cs.{${f.join(",")}}`):this.url.searchParams.append(u,`cs.${JSON.stringify(f)}`),this}containedBy(u,f){return typeof f=="string"?this.url.searchParams.append(u,`cd.${f}`):Array.isArray(f)?this.url.searchParams.append(u,`cd.{${f.join(",")}}`):this.url.searchParams.append(u,`cd.${JSON.stringify(f)}`),this}rangeGt(u,f){return this.url.searchParams.append(u,`sr.${f}`),this}rangeGte(u,f){return this.url.searchParams.append(u,`nxl.${f}`),this}rangeLt(u,f){return this.url.searchParams.append(u,`sl.${f}`),this}rangeLte(u,f){return this.url.searchParams.append(u,`nxr.${f}`),this}rangeAdjacent(u,f){return this.url.searchParams.append(u,`adj.${f}`),this}overlaps(u,f){return typeof f=="string"?this.url.searchParams.append(u,`ov.${f}`):this.url.searchParams.append(u,`ov.{${f.join(",")}}`),this}textSearch(u,f,{config:h,type:m}={}){let p="";m==="plain"?p="pl":m==="phrase"?p="ph":m==="websearch"&&(p="w");const g=h===void 0?"":`(${h})`;return this.url.searchParams.append(u,`${p}fts${g}.${f}`),this}match(u){return Object.entries(u).forEach(([f,h])=>{this.url.searchParams.append(f,`eq.${h}`)}),this}not(u,f,h){return this.url.searchParams.append(u,`not.${f}.${h}`),this}or(u,{foreignTable:f,referencedTable:h=f}={}){const m=h?`${h}.or`:"or";return this.url.searchParams.append(m,`(${u})`),this}filter(u,f,h){return this.url.searchParams.append(u,`${f}.${h}`),this}}return mo.default=l,mo}var qy;function wv(){if(qy)return ho;qy=1,Object.defineProperty(ho,"__esModule",{value:!0});const n=Ai.__importDefault(rd());class i{constructor(o,{headers:u={},schema:f,fetch:h}){this.url=o,this.headers=new Headers(u),this.schema=f,this.fetch=h}select(o,u){const{head:f=!1,count:h}=u??{},m=f?"HEAD":"GET";let p=!1;const g=(o??"*").split("").map(v=>/\s/.test(v)&&!p?"":(v==='"'&&(p=!p),v)).join("");return this.url.searchParams.set("select",g),h&&this.headers.append("Prefer",`count=${h}`),new n.default({method:m,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(o,{count:u,defaultToNull:f=!0}={}){var h;const m="POST";if(u&&this.headers.append("Prefer",`count=${u}`),f||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const p=o.reduce((g,v)=>g.concat(Object.keys(v)),[]);if(p.length>0){const g=[...new Set(p)].map(v=>`"${v}"`);this.url.searchParams.set("columns",g.join(","))}}return new n.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch})}upsert(o,{onConflict:u,ignoreDuplicates:f=!1,count:h,defaultToNull:m=!0}={}){var p;const g="POST";if(this.headers.append("Prefer",`resolution=${f?"ignore":"merge"}-duplicates`),u!==void 0&&this.url.searchParams.set("on_conflict",u),h&&this.headers.append("Prefer",`count=${h}`),m||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const v=o.reduce((w,_)=>w.concat(Object.keys(_)),[]);if(v.length>0){const w=[...new Set(v)].map(_=>`"${_}"`);this.url.searchParams.set("columns",w.join(","))}}return new n.default({method:g,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(p=this.fetch)!==null&&p!==void 0?p:fetch})}update(o,{count:u}={}){var f;const h="PATCH";return u&&this.headers.append("Prefer",`count=${u}`),new n.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch})}delete({count:o}={}){var u;const f="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new n.default({method:f,url:this.url,headers:this.headers,schema:this.schema,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}}return ho.default=i,ho}var $y;function kS(){if($y)return fo;$y=1,Object.defineProperty(fo,"__esModule",{value:!0});const r=Ai,n=r.__importDefault(wv()),i=r.__importDefault(rd());class l{constructor(u,{headers:f={},schema:h,fetch:m}={}){this.url=u,this.headers=new Headers(f),this.schemaName=h,this.fetch=m}from(u){if(!u||typeof u!="string"||u.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const f=new URL(`${this.url}/${u}`);return new n.default(f,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(u){return new l(this.url,{headers:this.headers,schema:u,fetch:this.fetch})}rpc(u,f={},{head:h=!1,get:m=!1,count:p}={}){var g;let v;const w=new URL(`${this.url}/rpc/${u}`);let _;h||m?(v=h?"HEAD":"GET",Object.entries(f).filter(([C,R])=>R!==void 0).map(([C,R])=>[C,Array.isArray(R)?`{${R.join(",")}}`:`${R}`]).forEach(([C,R])=>{w.searchParams.append(C,R)})):(v="POST",_=f);const S=new Headers(this.headers);return p&&S.set("Prefer",`count=${p}`),new i.default({method:v,url:w,headers:S,schema:this.schemaName,body:_,fetch:(g=this.fetch)!==null&&g!==void 0?g:fetch})}}return fo.default=l,fo}var Py;function LS(){if(Py)return Nt;Py=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.PostgrestError=Nt.PostgrestBuilder=Nt.PostgrestTransformBuilder=Nt.PostgrestFilterBuilder=Nt.PostgrestQueryBuilder=Nt.PostgrestClient=void 0;const r=Ai,n=r.__importDefault(kS());Nt.PostgrestClient=n.default;const i=r.__importDefault(wv());Nt.PostgrestQueryBuilder=i.default;const l=r.__importDefault(rd());Nt.PostgrestFilterBuilder=l.default;const o=r.__importDefault(_v());Nt.PostgrestTransformBuilder=o.default;const u=r.__importDefault(bv());Nt.PostgrestBuilder=u.default;const f=r.__importDefault(vv());return Nt.PostgrestError=f.default,Nt.default={PostgrestClient:n.default,PostgrestQueryBuilder:i.default,PostgrestFilterBuilder:l.default,PostgrestTransformBuilder:o.default,PostgrestBuilder:u.default,PostgrestError:f.default},Nt}var Sv=LS();const Ev=vg(Sv),BS=gg({__proto__:null,default:Ev},[Sv]),{PostgrestClient:HS,PostgrestQueryBuilder:X1,PostgrestFilterBuilder:Z1,PostgrestTransformBuilder:F1,PostgrestBuilder:W1,PostgrestError:eO}=Ev||BS;class qS{constructor(){}static detectEnvironment(){var n;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((n=navigator.userAgent)===null||n===void 0)&&n.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const i=process.versions;if(i&&i.node){const l=i.node,o=parseInt(l.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
16
|
+
import ws from "ws"
|
|
17
|
+
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const n=this.detectEnvironment();if(n.constructor)return n.constructor;let i=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(i+=`
|
|
18
|
+
|
|
19
|
+
Suggested solution: ${n.workaround}`),new Error(i)}static createWebSocket(n,i){const l=this.getWebSocketConstructor();return new l(n,i)}static isWebSocketSupported(){try{const n=this.detectEnvironment();return n.type==="native"||n.type==="ws"}catch{return!1}}}const $S="2.86.0",PS=`realtime-js/${$S}`,Tv="1.0.0",VS="2.0.0",Vy=Tv,Uf=1e4,GS=1e3,YS=100;var _r;(function(r){r[r.connecting=0]="connecting",r[r.open=1]="open",r[r.closing=2]="closing",r[r.closed=3]="closed"})(_r||(_r={}));var Et;(function(r){r.closed="closed",r.errored="errored",r.joined="joined",r.joining="joining",r.leaving="leaving"})(Et||(Et={}));var Mn;(function(r){r.close="phx_close",r.error="phx_error",r.join="phx_join",r.reply="phx_reply",r.leave="phx_leave",r.access_token="access_token"})(Mn||(Mn={}));var zf;(function(r){r.websocket="websocket"})(zf||(zf={}));var wr;(function(r){r.Connecting="connecting",r.Open="open",r.Closing="closing",r.Closed="closed"})(wr||(wr={}));class IS{constructor(n){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=n??[]}encode(n,i){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return i(this._binaryEncodeUserBroadcastPush(n));let l=[n.join_ref,n.ref,n.topic,n.event,n.payload];return i(JSON.stringify(l))}_binaryEncodeUserBroadcastPush(n){var i;return this._isArrayBuffer((i=n.payload)===null||i===void 0?void 0:i.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var i,l;const o=(l=(i=n.payload)===null||i===void 0?void 0:i.payload)!==null&&l!==void 0?l:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(n){var i,l;const o=(l=(i=n.payload)===null||i===void 0?void 0:i.payload)!==null&&l!==void 0?l:{},f=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,f)}_encodeUserBroadcastPush(n,i,l){var o,u;const f=n.topic,h=(o=n.ref)!==null&&o!==void 0?o:"",m=(u=n.join_ref)!==null&&u!==void 0?u:"",p=n.payload.event,g=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},v=Object.keys(g).length===0?"":JSON.stringify(g);if(m.length>255)throw new Error(`joinRef length ${m.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`ref length ${h.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`topic length ${f.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(v.length>255)throw new Error(`metadata length ${v.length} exceeds maximum of 255`);const w=this.USER_BROADCAST_PUSH_META_LENGTH+m.length+h.length+f.length+p.length+v.length,_=new ArrayBuffer(this.HEADER_LENGTH+w);let S=new DataView(_),C=0;S.setUint8(C++,this.KINDS.userBroadcastPush),S.setUint8(C++,m.length),S.setUint8(C++,h.length),S.setUint8(C++,f.length),S.setUint8(C++,p.length),S.setUint8(C++,v.length),S.setUint8(C++,i),Array.from(m,k=>S.setUint8(C++,k.charCodeAt(0))),Array.from(h,k=>S.setUint8(C++,k.charCodeAt(0))),Array.from(f,k=>S.setUint8(C++,k.charCodeAt(0))),Array.from(p,k=>S.setUint8(C++,k.charCodeAt(0))),Array.from(v,k=>S.setUint8(C++,k.charCodeAt(0)));var R=new Uint8Array(_.byteLength+l.byteLength);return R.set(new Uint8Array(_),0),R.set(new Uint8Array(l),_.byteLength),R.buffer}decode(n,i){if(this._isArrayBuffer(n)){let l=this._binaryDecode(n);return i(l)}if(typeof n=="string"){const l=JSON.parse(n),[o,u,f,h,m]=l;return i({join_ref:o,ref:u,topic:f,event:h,payload:m})}return i({})}_binaryDecode(n){const i=new DataView(n),l=i.getUint8(0),o=new TextDecoder;switch(l){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(n,i,o)}}_decodeUserBroadcast(n,i,l){const o=i.getUint8(1),u=i.getUint8(2),f=i.getUint8(3),h=i.getUint8(4);let m=this.HEADER_LENGTH+4;const p=l.decode(n.slice(m,m+o));m=m+o;const g=l.decode(n.slice(m,m+u));m=m+u;const v=l.decode(n.slice(m,m+f));m=m+f;const w=n.slice(m,n.byteLength),_=h===this.JSON_ENCODING?JSON.parse(l.decode(w)):w,S={type:this.BROADCAST_EVENT,event:g,payload:_};return f>0&&(S.meta=JSON.parse(v)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:S}}_isArrayBuffer(n){var i;return n instanceof ArrayBuffer||((i=n?.constructor)===null||i===void 0?void 0:i.name)==="ArrayBuffer"}_pick(n,i){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([l])=>i.includes(l)))}}class Ov{constructor(n,i){this.callback=n,this.timerCalc=i,this.timer=void 0,this.tries=0,this.callback=n,this.timerCalc=i}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var et;(function(r){r.abstime="abstime",r.bool="bool",r.date="date",r.daterange="daterange",r.float4="float4",r.float8="float8",r.int2="int2",r.int4="int4",r.int4range="int4range",r.int8="int8",r.int8range="int8range",r.json="json",r.jsonb="jsonb",r.money="money",r.numeric="numeric",r.oid="oid",r.reltime="reltime",r.text="text",r.time="time",r.timestamp="timestamp",r.timestamptz="timestamptz",r.timetz="timetz",r.tsrange="tsrange",r.tstzrange="tstzrange"})(et||(et={}));const Gy=(r,n,i={})=>{var l;const o=(l=i.skipTypes)!==null&&l!==void 0?l:[];return n?Object.keys(n).reduce((u,f)=>(u[f]=KS(f,r,n,o),u),{}):{}},KS=(r,n,i,l)=>{const o=n.find(h=>h.name===r),u=o?.type,f=i[r];return u&&!l.includes(u)?Rv(u,f):Mf(f)},Rv=(r,n)=>{if(r.charAt(0)==="_"){const i=r.slice(1,r.length);return ZS(n,i)}switch(r){case et.bool:return JS(n);case et.float4:case et.float8:case et.int2:case et.int4:case et.int8:case et.numeric:case et.oid:return QS(n);case et.json:case et.jsonb:return XS(n);case et.timestamp:return FS(n);case et.abstime:case et.date:case et.daterange:case et.int4range:case et.int8range:case et.money:case et.reltime:case et.text:case et.time:case et.timestamptz:case et.timetz:case et.tsrange:case et.tstzrange:return Mf(n);default:return Mf(n)}},Mf=r=>r,JS=r=>{switch(r){case"t":return!0;case"f":return!1;default:return r}},QS=r=>{if(typeof r=="string"){const n=parseFloat(r);if(!Number.isNaN(n))return n}return r},XS=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(n){return console.log(`JSON parse error: ${n}`),r}return r},ZS=(r,n)=>{if(typeof r!="string")return r;const i=r.length-1,l=r[i];if(r[0]==="{"&&l==="}"){let u;const f=r.slice(1,i);try{u=JSON.parse("["+f+"]")}catch{u=f?f.split(","):[]}return u.map(h=>Rv(n,h))}return r},FS=r=>typeof r=="string"?r.replace(" ","T"):r,xv=r=>{const n=new URL(r);return n.protocol=n.protocol.replace(/^ws/i,"http"),n.pathname=n.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),n.pathname===""||n.pathname==="/"?n.pathname="/api/broadcast":n.pathname=n.pathname+"/api/broadcast",n.href};class yf{constructor(n,i,l={},o=Uf){this.channel=n,this.event=i,this.payload=l,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(n){this.timeout=n,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(n){this.payload=Object.assign(Object.assign({},this.payload),n)}receive(n,i){var l;return this._hasReceived(n)&&i((l=this.receivedResp)===null||l===void 0?void 0:l.response),this.recHooks.push({status:n,callback:i}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const n=i=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=i,this._matchReceive(i)};this.channel._on(this.refEvent,{},n),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(n,i){this.refEvent&&this.channel._trigger(this.refEvent,{status:n,response:i})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:n,response:i}){this.recHooks.filter(l=>l.status===n).forEach(l=>l.callback(i))}_hasReceived(n){return this.receivedResp&&this.receivedResp.status===n}}var Yy;(function(r){r.SYNC="sync",r.JOIN="join",r.LEAVE="leave"})(Yy||(Yy={}));class Ul{constructor(n,i){this.channel=n,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const l=i?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(l.state,{},o=>{const{onJoin:u,onLeave:f,onSync:h}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Ul.syncState(this.state,o,u,f),this.pendingDiffs.forEach(m=>{this.state=Ul.syncDiff(this.state,m,u,f)}),this.pendingDiffs=[],h()}),this.channel._on(l.diff,{},o=>{const{onJoin:u,onLeave:f,onSync:h}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=Ul.syncDiff(this.state,o,u,f),h())}),this.onJoin((o,u,f)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:u,newPresences:f})}),this.onLeave((o,u,f)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:u,leftPresences:f})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(n,i,l,o){const u=this.cloneDeep(n),f=this.transformState(i),h={},m={};return this.map(u,(p,g)=>{f[p]||(m[p]=g)}),this.map(f,(p,g)=>{const v=u[p];if(v){const w=g.map(R=>R.presence_ref),_=v.map(R=>R.presence_ref),S=g.filter(R=>_.indexOf(R.presence_ref)<0),C=v.filter(R=>w.indexOf(R.presence_ref)<0);S.length>0&&(h[p]=S),C.length>0&&(m[p]=C)}else h[p]=g}),this.syncDiff(u,{joins:h,leaves:m},l,o)}static syncDiff(n,i,l,o){const{joins:u,leaves:f}={joins:this.transformState(i.joins),leaves:this.transformState(i.leaves)};return l||(l=()=>{}),o||(o=()=>{}),this.map(u,(h,m)=>{var p;const g=(p=n[h])!==null&&p!==void 0?p:[];if(n[h]=this.cloneDeep(m),g.length>0){const v=n[h].map(_=>_.presence_ref),w=g.filter(_=>v.indexOf(_.presence_ref)<0);n[h].unshift(...w)}l(h,g,m)}),this.map(f,(h,m)=>{let p=n[h];if(!p)return;const g=m.map(v=>v.presence_ref);p=p.filter(v=>g.indexOf(v.presence_ref)<0),n[h]=p,o(h,p,m),p.length===0&&delete n[h]}),n}static map(n,i){return Object.getOwnPropertyNames(n).map(l=>i(l,n[l]))}static transformState(n){return n=this.cloneDeep(n),Object.getOwnPropertyNames(n).reduce((i,l)=>{const o=n[l];return"metas"in o?i[l]=o.metas.map(u=>(u.presence_ref=u.phx_ref,delete u.phx_ref,delete u.phx_ref_prev,u)):i[l]=o,i},{})}static cloneDeep(n){return JSON.parse(JSON.stringify(n))}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Iy;(function(r){r.ALL="*",r.INSERT="INSERT",r.UPDATE="UPDATE",r.DELETE="DELETE"})(Iy||(Iy={}));var zl;(function(r){r.BROADCAST="broadcast",r.PRESENCE="presence",r.POSTGRES_CHANGES="postgres_changes",r.SYSTEM="system"})(zl||(zl={}));var fa;(function(r){r.SUBSCRIBED="SUBSCRIBED",r.TIMED_OUT="TIMED_OUT",r.CLOSED="CLOSED",r.CHANNEL_ERROR="CHANNEL_ERROR"})(fa||(fa={}));class id{constructor(n,i={config:{}},l){var o,u;if(this.topic=n,this.params=i,this.socket=l,this.bindings={},this.state=Et.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=n.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},i.config),this.timeout=this.socket.timeout,this.joinPush=new yf(this,Mn.join,this.params,this.timeout),this.rejoinTimer=new Ov(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Et.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(f=>f.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Et.closed,this.socket._remove(this)}),this._onError(f=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,f),this.state=Et.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Et.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",f=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,f),this.state=Et.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Mn.reply,{},(f,h)=>{this._trigger(this._replyEventName(h),f)}),this.presence=new Ul(this),this.broadcastEndpointURL=xv(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((u=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||u===void 0)&&u.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(n,i=this.timeout){var l,o,u;if(this.socket.isConnected()||this.socket.connect(),this.state==Et.closed){const{config:{broadcast:f,presence:h,private:m}}=this.params,p=(o=(l=this.bindings.postgres_changes)===null||l===void 0?void 0:l.map(_=>_.filter))!==null&&o!==void 0?o:[],g=!!this.bindings[zl.PRESENCE]&&this.bindings[zl.PRESENCE].length>0||((u=this.params.config.presence)===null||u===void 0?void 0:u.enabled)===!0,v={},w={broadcast:f,presence:Object.assign(Object.assign({},h),{enabled:g}),postgres_changes:p,private:m};this.socket.accessTokenValue&&(v.access_token=this.socket.accessTokenValue),this._onError(_=>n?.(fa.CHANNEL_ERROR,_)),this._onClose(()=>n?.(fa.CLOSED)),this.updateJoinPayload(Object.assign({config:w},v)),this.joinedOnce=!0,this._rejoin(i),this.joinPush.receive("ok",async({postgres_changes:_})=>{var S;if(this.socket.setAuth(),_===void 0){n?.(fa.SUBSCRIBED);return}else{const C=this.bindings.postgres_changes,R=(S=C?.length)!==null&&S!==void 0?S:0,k=[];for(let q=0;q<R;q++){const $=C[q],{filter:{event:Z,schema:ne,table:le,filter:x}}=$,ge=_&&_[q];if(ge&&ge.event===Z&&ge.schema===ne&&ge.table===le&&ge.filter===x)k.push(Object.assign(Object.assign({},$),{id:ge.id}));else{this.unsubscribe(),this.state=Et.errored,n?.(fa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=k,n&&n(fa.SUBSCRIBED);return}}).receive("error",_=>{this.state=Et.errored,n?.(fa.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(_).join(", ")||"error")))}).receive("timeout",()=>{n?.(fa.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(n,i={}){return await this.send({type:"presence",event:"track",payload:n},i.timeout||this.timeout)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,i,l){return this.state===Et.joined&&n===zl.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(n,i,l)}async httpSend(n,i,l={}){var o;const u=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(i==null)return Promise.reject("Payload is required for httpSend()");const f={method:"POST",headers:{Authorization:u,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:i,private:this.private}]})},h=await this._fetchWithTimeout(this.broadcastEndpointURL,f,(o=l.timeout)!==null&&o!==void 0?o:this.timeout);if(h.status===202)return{success:!0};let m=h.statusText;try{const p=await h.json();m=p.error||p.message||m}catch{}return Promise.reject(new Error(m))}async send(n,i={}){var l,o;if(!this._canPush()&&n.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:u,payload:f}=n,m={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:u,payload:f,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,m,(l=i.timeout)!==null&&l!==void 0?l:this.timeout);return await((o=p.body)===null||o===void 0?void 0:o.cancel()),p.ok?"ok":"error"}catch(p){return p.name==="AbortError"?"timed out":"error"}}else return new Promise(u=>{var f,h,m;const p=this._push(n.type,n,i.timeout||this.timeout);n.type==="broadcast"&&!(!((m=(h=(f=this.params)===null||f===void 0?void 0:f.config)===null||h===void 0?void 0:h.broadcast)===null||m===void 0)&&m.ack)&&u("ok"),p.receive("ok",()=>u("ok")),p.receive("error",()=>u("error")),p.receive("timeout",()=>u("timed out"))})}updateJoinPayload(n){this.joinPush.updatePayload(n)}unsubscribe(n=this.timeout){this.state=Et.leaving;const i=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Mn.close,"leave",this._joinRef())};this.joinPush.destroy();let l=null;return new Promise(o=>{l=new yf(this,Mn.leave,{},n),l.receive("ok",()=>{i(),o("ok")}).receive("timeout",()=>{i(),o("timed out")}).receive("error",()=>{o("error")}),l.send(),this._canPush()||l.trigger("ok",{})}).finally(()=>{l?.destroy()})}teardown(){this.pushBuffer.forEach(n=>n.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Et.closed,this.bindings={}}async _fetchWithTimeout(n,i,l){const o=new AbortController,u=setTimeout(()=>o.abort(),l),f=await this.socket.fetch(n,Object.assign(Object.assign({},i),{signal:o.signal}));return clearTimeout(u),f}_push(n,i,l=this.timeout){if(!this.joinedOnce)throw`tried to push '${n}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new yf(this,n,i,l);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(n){if(n.startTimeout(),this.pushBuffer.push(n),this.pushBuffer.length>YS){const i=this.pushBuffer.shift();i&&(i.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload))}}_onMessage(n,i,l){return i}_isMember(n){return this.topic===n}_joinRef(){return this.joinPush.ref}_trigger(n,i,l){var o,u;const f=n.toLocaleLowerCase(),{close:h,error:m,leave:p,join:g}=Mn;if(l&&[h,m,p,g].indexOf(f)>=0&&l!==this._joinRef())return;let w=this._onMessage(f,i,l);if(i&&!w)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(f)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(_=>{var S,C,R;return((S=_.filter)===null||S===void 0?void 0:S.event)==="*"||((R=(C=_.filter)===null||C===void 0?void 0:C.event)===null||R===void 0?void 0:R.toLocaleLowerCase())===f}).map(_=>_.callback(w,l)):(u=this.bindings[f])===null||u===void 0||u.filter(_=>{var S,C,R,k,q,$;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in _){const Z=_.id,ne=(S=_.filter)===null||S===void 0?void 0:S.event;return Z&&((C=i.ids)===null||C===void 0?void 0:C.includes(Z))&&(ne==="*"||ne?.toLocaleLowerCase()===((R=i.data)===null||R===void 0?void 0:R.type.toLocaleLowerCase()))}else{const Z=(q=(k=_?.filter)===null||k===void 0?void 0:k.event)===null||q===void 0?void 0:q.toLocaleLowerCase();return Z==="*"||Z===(($=i?.event)===null||$===void 0?void 0:$.toLocaleLowerCase())}else return _.type.toLocaleLowerCase()===f}).map(_=>{if(typeof w=="object"&&"ids"in w){const S=w.data,{schema:C,table:R,commit_timestamp:k,type:q,errors:$}=S;w=Object.assign(Object.assign({},{schema:C,table:R,commit_timestamp:k,eventType:q,new:{},old:{},errors:$}),this._getPayloadRecords(S))}_.callback(w,l)})}_isClosed(){return this.state===Et.closed}_isJoined(){return this.state===Et.joined}_isJoining(){return this.state===Et.joining}_isLeaving(){return this.state===Et.leaving}_replyEventName(n){return`chan_reply_${n}`}_on(n,i,l){const o=n.toLocaleLowerCase(),u={type:o,filter:i,callback:l};return this.bindings[o]?this.bindings[o].push(u):this.bindings[o]=[u],this}_off(n,i){const l=n.toLocaleLowerCase();return this.bindings[l]&&(this.bindings[l]=this.bindings[l].filter(o=>{var u;return!(((u=o.type)===null||u===void 0?void 0:u.toLocaleLowerCase())===l&&id.isEqual(o.filter,i))})),this}static isEqual(n,i){if(Object.keys(n).length!==Object.keys(i).length)return!1;for(const l in n)if(n[l]!==i[l])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(n){this._on(Mn.close,{},n)}_onError(n){this._on(Mn.error,{},i=>n(i))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(n=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Et.joining,this.joinPush.resend(n))}_getPayloadRecords(n){const i={new:{},old:{}};return(n.type==="INSERT"||n.type==="UPDATE")&&(i.new=Gy(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(i.old=Gy(n.columns,n.old_record)),i}}const gf=()=>{},vo={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},WS=[1e3,2e3,5e3,1e4],eE=1e4,tE=`
|
|
20
|
+
addEventListener("message", (e) => {
|
|
21
|
+
if (e.data.event === "start") {
|
|
22
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
23
|
+
}
|
|
24
|
+
});`;class nE{constructor(n,i){var l;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Uf,this.transport=null,this.heartbeatIntervalMs=vo.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=gf,this.ref=0,this.reconnectTimer=null,this.vsn=Vy,this.logger=gf,this.conn=null,this.sendBuffer=[],this.serializer=new IS,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=o=>o?(...u)=>o(...u):(...u)=>fetch(...u),!(!((l=i?.params)===null||l===void 0)&&l.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=i.params.apikey,this.endPoint=`${n}/${zf.websocket}`,this.httpEndpoint=xv(n),this._initializeOptions(i),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(i?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=qS.createWebSocket(this.endpointURL())}catch(n){this._setConnectionState("disconnected");const i=n.message;throw i.includes("Node.js")?new Error(`${i}
|
|
25
|
+
|
|
26
|
+
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
27
|
+
|
|
28
|
+
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
29
|
+
Option 2: Install and provide the "ws" package:
|
|
30
|
+
|
|
31
|
+
npm install ws
|
|
32
|
+
|
|
33
|
+
import ws from "ws"
|
|
34
|
+
const client = new RealtimeClient(url, {
|
|
35
|
+
...options,
|
|
36
|
+
transport: ws
|
|
37
|
+
})`):new Error(`WebSocket not available: ${i}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(n,i){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const l=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(l),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(n?this.conn.close(n,i??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(n){const i=await n.unsubscribe();return this.channels.length===0&&this.disconnect(),i}async removeAllChannels(){const n=await Promise.all(this.channels.map(i=>i.unsubscribe()));return this.channels=[],this.disconnect(),n}log(n,i,l){this.logger(n,i,l)}connectionState(){switch(this.conn&&this.conn.readyState){case _r.connecting:return wr.Connecting;case _r.open:return wr.Open;case _r.closing:return wr.Closing;default:return wr.Closed}}isConnected(){return this.connectionState()===wr.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(n,i={config:{}}){const l=`realtime:${n}`,o=this.getChannels().find(u=>u.topic===l);if(o)return o;{const u=new id(`realtime:${n}`,i,this);return this.channels.push(u),u}}push(n){const{topic:i,event:l,payload:o,ref:u}=n,f=()=>{this.encode(n,h=>{var m;(m=this.conn)===null||m===void 0||m.send(h)})};this.log("push",`${i} ${l} (${u})`,o),this.isConnected()?f():this.sendBuffer.push(f)}async setAuth(n=null){this._authPromise=this._performAuth(n);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var n;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(i){this.log("error","error in heartbeat callback",i)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(i){this.log("error","error in heartbeat callback",i)}this._wasManualDisconnect=!1,(n=this.conn)===null||n===void 0||n.close(GS,"heartbeat timeout"),setTimeout(()=>{var i;this.isConnected()||(i=this.reconnectTimer)===null||i===void 0||i.scheduleTimeout()},vo.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(i){this.log("error","error in heartbeat callback",i)}this._setAuthSafely("heartbeat")}onHeartbeat(n){this.heartbeatCallback=n}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(n=>n()),this.sendBuffer=[])}_makeRef(){let n=this.ref+1;return n===this.ref?this.ref=0:this.ref=n,this.ref.toString()}_leaveOpenTopic(n){let i=this.channels.find(l=>l.topic===n&&(l._isJoined()||l._isJoining()));i&&(this.log("transport",`leaving duplicate topic "${n}"`),i.unsubscribe())}_remove(n){this.channels=this.channels.filter(i=>i.topic!==n.topic)}_onConnMessage(n){this.decode(n.data,i=>{if(i.topic==="phoenix"&&i.event==="phx_reply")try{this.heartbeatCallback(i.payload.status==="ok"?"ok":"error")}catch(p){this.log("error","error in heartbeat callback",p)}i.ref&&i.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:l,event:o,payload:u,ref:f}=i,h=f?`(${f})`:"",m=u.status||"";this.log("receive",`${m} ${l} ${o} ${h}`.trim(),u),this.channels.filter(p=>p._isMember(l)).forEach(p=>p._trigger(o,u,f)),this._triggerStateCallbacks("message",i)})}_clearTimer(n){var i;n==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):n==="reconnect"&&((i=this.reconnectTimer)===null||i===void 0||i.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=n=>this._onConnError(n),this.conn.onmessage=n=>this._onConnMessage(n),this.conn.onclose=n=>this._onConnClose(n))}_teardownConnection(){if(this.conn){if(this.conn.readyState===_r.open||this.conn.readyState===_r.connecting)try{this.conn.close()}catch(n){this.log("error","Error closing connection",n)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(n=>n.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(i=>{this.log("error","error waiting for auth on connect",i),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const n=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(n),this.workerRef.onerror=i=>{this.log("worker","worker error",i.message),this.workerRef.terminate()},this.workerRef.onmessage=i=>{i.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(n){var i;this._setConnectionState("disconnected"),this.log("transport","close",n),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(i=this.reconnectTimer)===null||i===void 0||i.scheduleTimeout(),this._triggerStateCallbacks("close",n)}_onConnError(n){this._setConnectionState("disconnected"),this.log("transport",`${n}`),this._triggerChanError(),this._triggerStateCallbacks("error",n)}_triggerChanError(){this.channels.forEach(n=>n._trigger(Mn.error))}_appendParams(n,i){if(Object.keys(i).length===0)return n;const l=n.match(/\?/)?"&":"?",o=new URLSearchParams(i);return`${n}${l}${o}`}_workerObjectUrl(n){let i;if(n)i=n;else{const l=new Blob([tE],{type:"application/javascript"});i=URL.createObjectURL(l)}return i}_setConnectionState(n,i=!1){this._connectionState=n,n==="connecting"?this._wasManualDisconnect=!1:n==="disconnecting"&&(this._wasManualDisconnect=i)}async _performAuth(n=null){let i;n?i=n:this.accessToken?i=await this.accessToken():i=this.accessTokenValue,this.accessTokenValue!=i&&(this.accessTokenValue=i,this.channels.forEach(l=>{const o={access_token:i,version:PS};i&&l.updateJoinPayload(o),l.joinedOnce&&l._isJoined()&&l._push(Mn.access_token,{access_token:i})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this.setAuth().catch(i=>{this.log("error",`error setting auth in ${n}`,i)})}_triggerStateCallbacks(n,i){try{this.stateChangeCallbacks[n].forEach(l=>{try{l(i)}catch(o){this.log("error",`error in ${n} callback`,o)}})}catch(l){this.log("error",`error triggering ${n} callbacks`,l)}}_setupReconnectionTimer(){this.reconnectTimer=new Ov(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},vo.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(n){var i,l,o,u,f,h,m,p,g,v,w,_;switch(this.transport=(i=n?.transport)!==null&&i!==void 0?i:null,this.timeout=(l=n?.timeout)!==null&&l!==void 0?l:Uf,this.heartbeatIntervalMs=(o=n?.heartbeatIntervalMs)!==null&&o!==void 0?o:vo.HEARTBEAT_INTERVAL,this.worker=(u=n?.worker)!==null&&u!==void 0?u:!1,this.accessToken=(f=n?.accessToken)!==null&&f!==void 0?f:null,this.heartbeatCallback=(h=n?.heartbeatCallback)!==null&&h!==void 0?h:gf,this.vsn=(m=n?.vsn)!==null&&m!==void 0?m:Vy,n?.params&&(this.params=n.params),n?.logger&&(this.logger=n.logger),(n?.logLevel||n?.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(p=n?.reconnectAfterMs)!==null&&p!==void 0?p:(S=>WS[S-1]||eE),this.vsn){case Tv:this.encode=(g=n?.encode)!==null&&g!==void 0?g:((S,C)=>C(JSON.stringify(S))),this.decode=(v=n?.decode)!==null&&v!==void 0?v:((S,C)=>C(JSON.parse(S)));break;case VS:this.encode=(w=n?.encode)!==null&&w!==void 0?w:this.serializer.encode.bind(this.serializer),this.decode=(_=n?.decode)!==null&&_!==void 0?_:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=n?.workerUrl}}}class Po extends Error{constructor(n){super(n),this.__isStorageError=!0,this.name="StorageError"}}function st(r){return typeof r=="object"&&r!==null&&"__isStorageError"in r}class aE extends Po{constructor(n,i,l){super(n),this.name="StorageApiError",this.status=i,this.statusCode=l}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class Nf extends Po{constructor(n,i){super(n),this.name="StorageUnknownError",this.originalError=i}}const ld=r=>r?(...n)=>r(...n):(...n)=>fetch(...n),rE=()=>Response,kf=r=>{if(Array.isArray(r))return r.map(i=>kf(i));if(typeof r=="function"||r!==Object(r))return r;const n={};return Object.entries(r).forEach(([i,l])=>{const o=i.replace(/([-_][a-z])/gi,u=>u.toUpperCase().replace(/[-_]/g,""));n[o]=kf(l)}),n},iE=r=>{if(typeof r!="object"||r===null)return!1;const n=Object.getPrototypeOf(r);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},lE=r=>!r||typeof r!="string"||r.length===0||r.length>100||r.trim()!==r||r.includes("/")||r.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(r),vf=r=>{var n;return r.msg||r.message||r.error_description||(typeof r.error=="string"?r.error:(n=r.error)===null||n===void 0?void 0:n.message)||JSON.stringify(r)},sE=(r,n,i)=>ie(void 0,void 0,void 0,function*(){const l=yield rE();r instanceof l&&!i?.noResolveJson?r.json().then(o=>{const u=r.status||500,f=o?.statusCode||u+"";n(new aE(vf(o),u,f))}).catch(o=>{n(new Nf(vf(o),o))}):n(new Nf(vf(r),r))}),oE=(r,n,i,l)=>{const o={method:r,headers:n?.headers||{}};return r==="GET"||!l?o:(iE(l)?(o.headers=Object.assign({"Content-Type":"application/json"},n?.headers),o.body=JSON.stringify(l)):o.body=l,n?.duplex&&(o.duplex=n.duplex),Object.assign(Object.assign({},o),i))};function Il(r,n,i,l,o,u){return ie(this,void 0,void 0,function*(){return new Promise((f,h)=>{r(i,oE(n,l,o,u)).then(m=>{if(!m.ok)throw m;return l?.noResolveJson?m:m.json()}).then(m=>f(m)).catch(m=>sE(m,h,l))})})}function Bl(r,n,i,l){return ie(this,void 0,void 0,function*(){return Il(r,"GET",n,i,l)})}function zn(r,n,i,l,o){return ie(this,void 0,void 0,function*(){return Il(r,"POST",n,l,o,i)})}function Lf(r,n,i,l,o){return ie(this,void 0,void 0,function*(){return Il(r,"PUT",n,l,o,i)})}function uE(r,n,i,l){return ie(this,void 0,void 0,function*(){return Il(r,"HEAD",n,Object.assign(Object.assign({},i),{noResolveJson:!0}),l)})}function sd(r,n,i,l,o){return ie(this,void 0,void 0,function*(){return Il(r,"DELETE",n,l,o,i)})}class cE{constructor(n,i){this.downloadFn=n,this.shouldThrowOnError=i}then(n,i){return this.execute().then(n,i)}execute(){return ie(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(st(n))return{data:null,error:n};throw n}})}}var Av;class fE{constructor(n,i){this.downloadFn=n,this.shouldThrowOnError=i,this[Av]="BlobDownloadBuilder",this.promise=null}asStream(){return new cE(this.downloadFn,this.shouldThrowOnError)}then(n,i){return this.getPromise().then(n,i)}catch(n){return this.getPromise().catch(n)}finally(n){return this.getPromise().finally(n)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return ie(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(st(n))return{data:null,error:n};throw n}})}}Av=Symbol.toStringTag;const dE={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ky={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class hE{constructor(n,i={},l,o){this.shouldThrowOnError=!1,this.url=n,this.headers=i,this.bucketId=l,this.fetch=ld(o)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(n,i,l,o){return ie(this,void 0,void 0,function*(){try{let u;const f=Object.assign(Object.assign({},Ky),o);let h=Object.assign(Object.assign({},this.headers),n==="POST"&&{"x-upsert":String(f.upsert)});const m=f.metadata;typeof Blob<"u"&&l instanceof Blob?(u=new FormData,u.append("cacheControl",f.cacheControl),m&&u.append("metadata",this.encodeMetadata(m)),u.append("",l)):typeof FormData<"u"&&l instanceof FormData?(u=l,u.has("cacheControl")||u.append("cacheControl",f.cacheControl),m&&!u.has("metadata")&&u.append("metadata",this.encodeMetadata(m))):(u=l,h["cache-control"]=`max-age=${f.cacheControl}`,h["content-type"]=f.contentType,m&&(h["x-metadata"]=this.toBase64(this.encodeMetadata(m))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!f.duplex&&(f.duplex="half")),o?.headers&&(h=Object.assign(Object.assign({},h),o.headers));const p=this._removeEmptyFolders(i),g=this._getFinalPath(p),v=yield(n=="PUT"?Lf:zn)(this.fetch,`${this.url}/object/${g}`,u,Object.assign({headers:h},f?.duplex?{duplex:f.duplex}:{}));return{data:{path:p,id:v.Id,fullPath:v.Key},error:null}}catch(u){if(this.shouldThrowOnError)throw u;if(st(u))return{data:null,error:u};throw u}})}upload(n,i,l){return ie(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",n,i,l)})}uploadToSignedUrl(n,i,l,o){return ie(this,void 0,void 0,function*(){const u=this._removeEmptyFolders(n),f=this._getFinalPath(u),h=new URL(this.url+`/object/upload/sign/${f}`);h.searchParams.set("token",i);try{let m;const p=Object.assign({upsert:Ky.upsert},o),g=Object.assign(Object.assign({},this.headers),{"x-upsert":String(p.upsert)});typeof Blob<"u"&&l instanceof Blob?(m=new FormData,m.append("cacheControl",p.cacheControl),m.append("",l)):typeof FormData<"u"&&l instanceof FormData?(m=l,m.append("cacheControl",p.cacheControl)):(m=l,g["cache-control"]=`max-age=${p.cacheControl}`,g["content-type"]=p.contentType);const v=yield Lf(this.fetch,h.toString(),m,{headers:g});return{data:{path:u,fullPath:v.Key},error:null}}catch(m){if(this.shouldThrowOnError)throw m;if(st(m))return{data:null,error:m};throw m}})}createSignedUploadUrl(n,i){return ie(this,void 0,void 0,function*(){try{let l=this._getFinalPath(n);const o=Object.assign({},this.headers);i?.upsert&&(o["x-upsert"]="true");const u=yield zn(this.fetch,`${this.url}/object/upload/sign/${l}`,{},{headers:o}),f=new URL(this.url+u.url),h=f.searchParams.get("token");if(!h)throw new Po("No token returned by API");return{data:{signedUrl:f.toString(),path:n,token:h},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(st(l))return{data:null,error:l};throw l}})}update(n,i,l){return ie(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",n,i,l)})}move(n,i,l){return ie(this,void 0,void 0,function*(){try{return{data:yield zn(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:n,destinationKey:i,destinationBucket:l?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(st(o))return{data:null,error:o};throw o}})}copy(n,i,l){return ie(this,void 0,void 0,function*(){try{return{data:{path:(yield zn(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:n,destinationKey:i,destinationBucket:l?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(st(o))return{data:null,error:o};throw o}})}createSignedUrl(n,i,l){return ie(this,void 0,void 0,function*(){try{let o=this._getFinalPath(n),u=yield zn(this.fetch,`${this.url}/object/sign/${o}`,Object.assign({expiresIn:i},l?.transform?{transform:l.transform}:{}),{headers:this.headers});const f=l?.download?`&download=${l.download===!0?"":l.download}`:"";return u={signedUrl:encodeURI(`${this.url}${u.signedURL}${f}`)},{data:u,error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(st(o))return{data:null,error:o};throw o}})}createSignedUrls(n,i,l){return ie(this,void 0,void 0,function*(){try{const o=yield zn(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:i,paths:n},{headers:this.headers}),u=l?.download?`&download=${l.download===!0?"":l.download}`:"";return{data:o.map(f=>Object.assign(Object.assign({},f),{signedUrl:f.signedURL?encodeURI(`${this.url}${f.signedURL}${u}`):null})),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(st(o))return{data:null,error:o};throw o}})}download(n,i){const o=typeof i?.transform<"u"?"render/image/authenticated":"object",u=this.transformOptsToQueryString(i?.transform||{}),f=u?`?${u}`:"",h=this._getFinalPath(n),m=()=>Bl(this.fetch,`${this.url}/${o}/${h}${f}`,{headers:this.headers,noResolveJson:!0});return new fE(m,this.shouldThrowOnError)}info(n){return ie(this,void 0,void 0,function*(){const i=this._getFinalPath(n);try{const l=yield Bl(this.fetch,`${this.url}/object/info/${i}`,{headers:this.headers});return{data:kf(l),error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(st(l))return{data:null,error:l};throw l}})}exists(n){return ie(this,void 0,void 0,function*(){const i=this._getFinalPath(n);try{return yield uE(this.fetch,`${this.url}/object/${i}`,{headers:this.headers}),{data:!0,error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(st(l)&&l instanceof Nf){const o=l.originalError;if([400,404].includes(o?.status))return{data:!1,error:l}}throw l}})}getPublicUrl(n,i){const l=this._getFinalPath(n),o=[],u=i?.download?`download=${i.download===!0?"":i.download}`:"";u!==""&&o.push(u);const h=typeof i?.transform<"u"?"render/image":"object",m=this.transformOptsToQueryString(i?.transform||{});m!==""&&o.push(m);let p=o.join("&");return p!==""&&(p=`?${p}`),{data:{publicUrl:encodeURI(`${this.url}/${h}/public/${l}${p}`)}}}remove(n){return ie(this,void 0,void 0,function*(){try{return{data:yield sd(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:n},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}list(n,i,l){return ie(this,void 0,void 0,function*(){try{const o=Object.assign(Object.assign(Object.assign({},dE),i),{prefix:n||""});return{data:yield zn(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},l),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(st(o))return{data:null,error:o};throw o}})}listV2(n,i){return ie(this,void 0,void 0,function*(){try{const l=Object.assign({},n);return{data:yield zn(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,l,{headers:this.headers},i),error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(st(l))return{data:null,error:l};throw l}})}encodeMetadata(n){return JSON.stringify(n)}toBase64(n){return typeof Buffer<"u"?Buffer.from(n).toString("base64"):btoa(n)}_getFinalPath(n){return`${this.bucketId}/${n.replace(/^\/+/,"")}`}_removeEmptyFolders(n){return n.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(n){const i=[];return n.width&&i.push(`width=${n.width}`),n.height&&i.push(`height=${n.height}`),n.resize&&i.push(`resize=${n.resize}`),n.format&&i.push(`format=${n.format}`),n.quality&&i.push(`quality=${n.quality}`),i.join("&")}}const Cv="2.86.0",jv={"X-Client-Info":`storage-js/${Cv}`};class mE{constructor(n,i={},l,o){this.shouldThrowOnError=!1;const u=new URL(n);o?.useNewHostname&&/supabase\.(co|in|red)$/.test(u.hostname)&&!u.hostname.includes("storage.supabase.")&&(u.hostname=u.hostname.replace("supabase.","storage.supabase.")),this.url=u.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},jv),i),this.fetch=ld(l)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(n){return ie(this,void 0,void 0,function*(){try{const i=this.listBucketOptionsToQueryString(n);return{data:yield Bl(this.fetch,`${this.url}/bucket${i}`,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}getBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:yield Bl(this.fetch,`${this.url}/bucket/${n}`,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}createBucket(n){return ie(this,arguments,void 0,function*(i,l={public:!1}){try{return{data:yield zn(this.fetch,`${this.url}/bucket`,{id:i,name:i,type:l.type,public:l.public,file_size_limit:l.fileSizeLimit,allowed_mime_types:l.allowedMimeTypes},{headers:this.headers}),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(st(o))return{data:null,error:o};throw o}})}updateBucket(n,i){return ie(this,void 0,void 0,function*(){try{return{data:yield Lf(this.fetch,`${this.url}/bucket/${n}`,{id:n,name:n,public:i.public,file_size_limit:i.fileSizeLimit,allowed_mime_types:i.allowedMimeTypes},{headers:this.headers}),error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(st(l))return{data:null,error:l};throw l}})}emptyBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:yield zn(this.fetch,`${this.url}/bucket/${n}/empty`,{},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}deleteBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:yield sd(this.fetch,`${this.url}/bucket/${n}`,{},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}listBucketOptionsToQueryString(n){const i={};return n&&("limit"in n&&(i.limit=String(n.limit)),"offset"in n&&(i.offset=String(n.offset)),n.search&&(i.search=n.search),n.sortColumn&&(i.sortColumn=n.sortColumn),n.sortOrder&&(i.sortOrder=n.sortOrder)),Object.keys(i).length>0?"?"+new URLSearchParams(i).toString():""}}var Hl=class extends Error{constructor(r,n){super(r),this.name="IcebergError",this.status=n.status,this.icebergType=n.icebergType,this.icebergCode=n.icebergCode,this.details=n.details,this.isCommitStateUnknown=n.icebergType==="CommitStateUnknownException"||[500,502,504].includes(n.status)&&n.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function pE(r,n,i){const l=new URL(n,r);if(i)for(const[o,u]of Object.entries(i))u!==void 0&&l.searchParams.set(o,u);return l.toString()}async function yE(r){return!r||r.type==="none"?{}:r.type==="bearer"?{Authorization:`Bearer ${r.token}`}:r.type==="header"?{[r.name]:r.value}:r.type==="custom"?await r.getHeaders():{}}function gE(r){const n=r.fetchImpl??globalThis.fetch;return{async request({method:i,path:l,query:o,body:u,headers:f}){const h=pE(r.baseUrl,l,o),m=await yE(r.auth),p=await n(h,{method:i,headers:{...u?{"Content-Type":"application/json"}:{},...m,...f},body:u?JSON.stringify(u):void 0}),g=await p.text(),v=(p.headers.get("content-type")||"").includes("application/json"),w=v&&g?JSON.parse(g):g;if(!p.ok){const _=v?w:void 0,S=_?.error;throw new Hl(S?.message??`Request failed with status ${p.status}`,{status:p.status,icebergType:S?.type,icebergCode:S?.code,details:_})}return{status:p.status,headers:p.headers,data:w}}}}function bo(r){return r.join("")}var vE=class{constructor(r,n=""){this.client=r,this.prefix=n}async listNamespaces(r){const n=r?{parent:bo(r.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(l=>({namespace:l}))}async createNamespace(r,n){const i={namespace:r.namespace,properties:n?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:i})).data}async dropNamespace(r){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bo(r.namespace)}`})}async loadNamespaceMetadata(r){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bo(r.namespace)}`})).data.properties}}async namespaceExists(r){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bo(r.namespace)}`}),!0}catch(n){if(n instanceof Hl&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(r,n){try{return await this.createNamespace(r,n)}catch(i){if(i instanceof Hl&&i.status===409)return;throw i}}};function di(r){return r.join("")}var bE=class{constructor(r,n="",i){this.client=r,this.prefix=n,this.accessDelegation=i}async listTables(r){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${di(r.namespace)}/tables`})).data.identifiers}async createTable(r,n){const i={};return this.accessDelegation&&(i["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${di(r.namespace)}/tables`,body:n,headers:i})).data.metadata}async updateTable(r,n){const i=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${di(r.namespace)}/tables/${r.name}`,body:n});return{"metadata-location":i.data["metadata-location"],metadata:i.data.metadata}}async dropTable(r,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${di(r.namespace)}/tables/${r.name}`,query:{purgeRequested:String(n?.purge??!1)}})}async loadTable(r){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${di(r.namespace)}/tables/${r.name}`,headers:n})).data.metadata}async tableExists(r){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${di(r.namespace)}/tables/${r.name}`,headers:n}),!0}catch(i){if(i instanceof Hl&&i.status===404)return!1;throw i}}async createTableIfNotExists(r,n){try{return await this.createTable(r,n)}catch(i){if(i instanceof Hl&&i.status===409)return await this.loadTable({namespace:r.namespace,name:n.name});throw i}}},_E=class{constructor(r){let n="v1";r.catalogName&&(n+=`/${r.catalogName}`);const i=r.baseUrl.endsWith("/")?r.baseUrl:`${r.baseUrl}/`;this.client=gE({baseUrl:i,auth:r.auth,fetchImpl:r.fetch}),this.accessDelegation=r.accessDelegation?.join(","),this.namespaceOps=new vE(this.client,n),this.tableOps=new bE(this.client,n,this.accessDelegation)}async listNamespaces(r){return this.namespaceOps.listNamespaces(r)}async createNamespace(r,n){return this.namespaceOps.createNamespace(r,n)}async dropNamespace(r){await this.namespaceOps.dropNamespace(r)}async loadNamespaceMetadata(r){return this.namespaceOps.loadNamespaceMetadata(r)}async listTables(r){return this.tableOps.listTables(r)}async createTable(r,n){return this.tableOps.createTable(r,n)}async updateTable(r,n){return this.tableOps.updateTable(r,n)}async dropTable(r,n){await this.tableOps.dropTable(r,n)}async loadTable(r){return this.tableOps.loadTable(r)}async namespaceExists(r){return this.namespaceOps.namespaceExists(r)}async tableExists(r){return this.tableOps.tableExists(r)}async createNamespaceIfNotExists(r,n){return this.namespaceOps.createNamespaceIfNotExists(r,n)}async createTableIfNotExists(r,n){return this.tableOps.createTableIfNotExists(r,n)}};class wE{constructor(n,i={},l){this.shouldThrowOnError=!1,this.url=n.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},jv),i),this.fetch=ld(l)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:yield zn(this.fetch,`${this.url}/bucket`,{name:n},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}listBuckets(n){return ie(this,void 0,void 0,function*(){try{const i=new URLSearchParams;n?.limit!==void 0&&i.set("limit",n.limit.toString()),n?.offset!==void 0&&i.set("offset",n.offset.toString()),n?.sortColumn&&i.set("sortColumn",n.sortColumn),n?.sortOrder&&i.set("sortOrder",n.sortOrder),n?.search&&i.set("search",n.search);const l=i.toString(),o=l?`${this.url}/bucket?${l}`:`${this.url}/bucket`;return{data:yield Bl(this.fetch,o,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}deleteBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:yield sd(this.fetch,`${this.url}/bucket/${n}`,{},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(st(i))return{data:null,error:i};throw i}})}from(n){if(!lE(n))throw new Po("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");return new _E({baseUrl:this.url,catalogName:n,auth:{type:"custom",getHeaders:()=>ie(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch})}}const od={"X-Client-Info":`storage-js/${Cv}`,"Content-Type":"application/json"};class Dv extends Error{constructor(n){super(n),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function on(r){return typeof r=="object"&&r!==null&&"__isStorageVectorsError"in r}class bf extends Dv{constructor(n,i,l){super(n),this.name="StorageVectorsApiError",this.status=i,this.statusCode=l}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class SE extends Dv{constructor(n,i){super(n),this.name="StorageVectorsUnknownError",this.originalError=i}}var Jy;(function(r){r.InternalError="InternalError",r.S3VectorConflictException="S3VectorConflictException",r.S3VectorNotFoundException="S3VectorNotFoundException",r.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",r.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",r.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Jy||(Jy={}));const ud=r=>r?(...n)=>r(...n):(...n)=>fetch(...n),EE=r=>{if(typeof r!="object"||r===null)return!1;const n=Object.getPrototypeOf(r);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},Qy=r=>r.msg||r.message||r.error_description||r.error||JSON.stringify(r),TE=(r,n,i)=>ie(void 0,void 0,void 0,function*(){if(r&&typeof r=="object"&&"status"in r&&"ok"in r&&typeof r.status=="number"&&!i?.noResolveJson){const o=r.status||500,u=r;if(typeof u.json=="function")u.json().then(f=>{const h=f?.statusCode||f?.code||o+"";n(new bf(Qy(f),o,h))}).catch(()=>{const f=o+"",h=u.statusText||`HTTP ${o} error`;n(new bf(h,o,f))});else{const f=o+"",h=u.statusText||`HTTP ${o} error`;n(new bf(h,o,f))}}else n(new SE(Qy(r),r))}),OE=(r,n,i,l)=>{const o={method:r,headers:n?.headers||{}};return l?(EE(l)?(o.headers=Object.assign({"Content-Type":"application/json"},n?.headers),o.body=JSON.stringify(l)):o.body=l,Object.assign(Object.assign({},o),i)):o};function RE(r,n,i,l,o,u){return ie(this,void 0,void 0,function*(){return new Promise((f,h)=>{r(i,OE(n,l,o,u)).then(m=>{if(!m.ok)throw m;if(l?.noResolveJson)return m;const p=m.headers.get("content-type");return!p||!p.includes("application/json")?{}:m.json()}).then(m=>f(m)).catch(m=>TE(m,h,l))})})}function un(r,n,i,l,o){return ie(this,void 0,void 0,function*(){return RE(r,"POST",n,l,o,i)})}class xE{constructor(n,i={},l){this.shouldThrowOnError=!1,this.url=n.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},od),i),this.fetch=ud(l)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(n){return ie(this,void 0,void 0,function*(){try{return{data:(yield un(this.fetch,`${this.url}/CreateIndex`,n,{headers:this.headers}))||{},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}getIndex(n,i){return ie(this,void 0,void 0,function*(){try{return{data:yield un(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:n,indexName:i},{headers:this.headers}),error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(on(l))return{data:null,error:l};throw l}})}listIndexes(n){return ie(this,void 0,void 0,function*(){try{return{data:yield un(this.fetch,`${this.url}/ListIndexes`,n,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}deleteIndex(n,i){return ie(this,void 0,void 0,function*(){try{return{data:(yield un(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:n,indexName:i},{headers:this.headers}))||{},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(on(l))return{data:null,error:l};throw l}})}}class AE{constructor(n,i={},l){this.shouldThrowOnError=!1,this.url=n.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},od),i),this.fetch=ud(l)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(n){return ie(this,void 0,void 0,function*(){try{if(n.vectors.length<1||n.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield un(this.fetch,`${this.url}/PutVectors`,n,{headers:this.headers}))||{},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}getVectors(n){return ie(this,void 0,void 0,function*(){try{return{data:yield un(this.fetch,`${this.url}/GetVectors`,n,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}listVectors(n){return ie(this,void 0,void 0,function*(){try{if(n.segmentCount!==void 0){if(n.segmentCount<1||n.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(n.segmentIndex!==void 0&&(n.segmentIndex<0||n.segmentIndex>=n.segmentCount))throw new Error(`segmentIndex must be between 0 and ${n.segmentCount-1}`)}return{data:yield un(this.fetch,`${this.url}/ListVectors`,n,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}queryVectors(n){return ie(this,void 0,void 0,function*(){try{return{data:yield un(this.fetch,`${this.url}/QueryVectors`,n,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}deleteVectors(n){return ie(this,void 0,void 0,function*(){try{if(n.keys.length<1||n.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield un(this.fetch,`${this.url}/DeleteVectors`,n,{headers:this.headers}))||{},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}}class CE{constructor(n,i={},l){this.shouldThrowOnError=!1,this.url=n.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},od),i),this.fetch=ud(l)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:(yield un(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:n},{headers:this.headers}))||{},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}getBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:yield un(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:n},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}listBuckets(){return ie(this,arguments,void 0,function*(n={}){try{return{data:yield un(this.fetch,`${this.url}/ListVectorBuckets`,n,{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}deleteBucket(n){return ie(this,void 0,void 0,function*(){try{return{data:(yield un(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:n},{headers:this.headers}))||{},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(on(i))return{data:null,error:i};throw i}})}}class jE extends CE{constructor(n,i={}){super(n,i.headers||{},i.fetch)}from(n){return new DE(this.url,this.headers,n,this.fetch)}createBucket(n){const i=Object.create(null,{createBucket:{get:()=>super.createBucket}});return ie(this,void 0,void 0,function*(){return i.createBucket.call(this,n)})}getBucket(n){const i=Object.create(null,{getBucket:{get:()=>super.getBucket}});return ie(this,void 0,void 0,function*(){return i.getBucket.call(this,n)})}listBuckets(){const n=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return ie(this,arguments,void 0,function*(i={}){return n.listBuckets.call(this,i)})}deleteBucket(n){const i=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return ie(this,void 0,void 0,function*(){return i.deleteBucket.call(this,n)})}}class DE extends xE{constructor(n,i,l,o){super(n,i,o),this.vectorBucketName=l}createIndex(n){const i=Object.create(null,{createIndex:{get:()=>super.createIndex}});return ie(this,void 0,void 0,function*(){return i.createIndex.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const n=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return ie(this,arguments,void 0,function*(i={}){return n.listIndexes.call(this,Object.assign(Object.assign({},i),{vectorBucketName:this.vectorBucketName}))})}getIndex(n){const i=Object.create(null,{getIndex:{get:()=>super.getIndex}});return ie(this,void 0,void 0,function*(){return i.getIndex.call(this,this.vectorBucketName,n)})}deleteIndex(n){const i=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return ie(this,void 0,void 0,function*(){return i.deleteIndex.call(this,this.vectorBucketName,n)})}index(n){return new UE(this.url,this.headers,this.vectorBucketName,n,this.fetch)}}class UE extends AE{constructor(n,i,l,o,u){super(n,i,u),this.vectorBucketName=l,this.indexName=o}putVectors(n){const i=Object.create(null,{putVectors:{get:()=>super.putVectors}});return ie(this,void 0,void 0,function*(){return i.putVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(n){const i=Object.create(null,{getVectors:{get:()=>super.getVectors}});return ie(this,void 0,void 0,function*(){return i.getVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const n=Object.create(null,{listVectors:{get:()=>super.listVectors}});return ie(this,arguments,void 0,function*(i={}){return n.listVectors.call(this,Object.assign(Object.assign({},i),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(n){const i=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return ie(this,void 0,void 0,function*(){return i.queryVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(n){const i=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return ie(this,void 0,void 0,function*(){return i.deleteVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class zE extends mE{constructor(n,i={},l,o){super(n,i,l,o)}from(n){return new hE(this.url,this.headers,n,this.fetch)}get vectors(){return new jE(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new wE(this.url+"/iceberg",this.headers,this.fetch)}}const ME="2.86.0";let Dl="";typeof Deno<"u"?Dl="deno":typeof document<"u"?Dl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Dl="react-native":Dl="node";const NE={"X-Client-Info":`supabase-js-${Dl}/${ME}`},kE={headers:NE},LE={schema:"public"},BE={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HE={},qE=r=>r?(...n)=>r(...n):(...n)=>fetch(...n),$E=()=>Headers,PE=(r,n,i)=>{const l=qE(i),o=$E();return async(u,f)=>{var h;const m=(h=await n())!==null&&h!==void 0?h:r;let p=new o(f?.headers);return p.has("apikey")||p.set("apikey",r),p.has("Authorization")||p.set("Authorization",`Bearer ${m}`),l(u,Object.assign(Object.assign({},f),{headers:p}))}};function VE(r){return r.endsWith("/")?r:r+"/"}function GE(r,n){var i,l;const{db:o,auth:u,realtime:f,global:h}=r,{db:m,auth:p,realtime:g,global:v}=n,w={db:Object.assign(Object.assign({},m),o),auth:Object.assign(Object.assign({},p),u),realtime:Object.assign(Object.assign({},g),f),storage:{},global:Object.assign(Object.assign(Object.assign({},v),h),{headers:Object.assign(Object.assign({},(i=v?.headers)!==null&&i!==void 0?i:{}),(l=h?.headers)!==null&&l!==void 0?l:{})}),accessToken:async()=>""};return r.accessToken?w.accessToken=r.accessToken:delete w.accessToken,w}function YE(r){const n=r?.trim();if(!n)throw new Error("supabaseUrl is required.");if(!n.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(VE(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const Uv="2.86.0",bi=30*1e3,Bf=3,_f=Bf*bi,IE="http://localhost:9999",KE="supabase.auth.token",JE={"X-Client-Info":`gotrue-js/${Uv}`},Hf="X-Supabase-Api-Version",zv={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},QE=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,XE=600*1e3;class ql extends Error{constructor(n,i,l){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=i,this.code=l}}function fe(r){return typeof r=="object"&&r!==null&&"__isAuthError"in r}class ZE extends ql{constructor(n,i,l){super(n,i,l),this.name="AuthApiError",this.status=i,this.code=l}}function FE(r){return fe(r)&&r.name==="AuthApiError"}class Sr extends ql{constructor(n,i){super(n),this.name="AuthUnknownError",this.originalError=i}}class Ia extends ql{constructor(n,i,l,o){super(n,l,o),this.name=i,this.status=l}}class rn extends Ia{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function WE(r){return fe(r)&&r.name==="AuthSessionMissingError"}class hi extends Ia{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class _o extends Ia{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class wo extends Ia{constructor(n,i=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=i}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function eT(r){return fe(r)&&r.name==="AuthImplicitGrantRedirectError"}class Xy extends Ia{constructor(n,i=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=i}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class qf extends Ia{constructor(n,i){super(n,"AuthRetryableFetchError",i,void 0)}}function wf(r){return fe(r)&&r.name==="AuthRetryableFetchError"}class Zy extends Ia{constructor(n,i,l){super(n,"AuthWeakPasswordError",i,"weak_password"),this.reasons=l}}class $f extends Ia{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const zo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Fy=`
|
|
38
|
+
\r=`.split(""),tT=(()=>{const r=new Array(128);for(let n=0;n<r.length;n+=1)r[n]=-1;for(let n=0;n<Fy.length;n+=1)r[Fy[n].charCodeAt(0)]=-2;for(let n=0;n<zo.length;n+=1)r[zo[n].charCodeAt(0)]=n;return r})();function Wy(r,n,i){if(r!==null)for(n.queue=n.queue<<8|r,n.queuedBits+=8;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;i(zo[l]),n.queuedBits-=6}else if(n.queuedBits>0)for(n.queue=n.queue<<6-n.queuedBits,n.queuedBits=6;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;i(zo[l]),n.queuedBits-=6}}function Mv(r,n,i){const l=tT[r];if(l>-1)for(n.queue=n.queue<<6|l,n.queuedBits+=6;n.queuedBits>=8;)i(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(l===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(r)}"`)}}function eg(r){const n=[],i=f=>{n.push(String.fromCodePoint(f))},l={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},u=f=>{rT(f,l,i)};for(let f=0;f<r.length;f+=1)Mv(r.charCodeAt(f),o,u);return n.join("")}function nT(r,n){if(r<=127){n(r);return}else if(r<=2047){n(192|r>>6),n(128|r&63);return}else if(r<=65535){n(224|r>>12),n(128|r>>6&63),n(128|r&63);return}else if(r<=1114111){n(240|r>>18),n(128|r>>12&63),n(128|r>>6&63),n(128|r&63);return}throw new Error(`Unrecognized Unicode codepoint: ${r.toString(16)}`)}function aT(r,n){for(let i=0;i<r.length;i+=1){let l=r.charCodeAt(i);if(l>55295&&l<=56319){const o=(l-55296)*1024&65535;l=(r.charCodeAt(i+1)-56320&65535|o)+65536,i+=1}nT(l,n)}}function rT(r,n,i){if(n.utf8seq===0){if(r<=127){i(r);return}for(let l=1;l<6;l+=1)if((r>>7-l&1)===0){n.utf8seq=l;break}if(n.utf8seq===2)n.codepoint=r&31;else if(n.utf8seq===3)n.codepoint=r&15;else if(n.utf8seq===4)n.codepoint=r&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(r<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|r&63,n.utf8seq-=1,n.utf8seq===0&&i(n.codepoint)}}function Ei(r){const n=[],i={queue:0,queuedBits:0},l=o=>{n.push(o)};for(let o=0;o<r.length;o+=1)Mv(r.charCodeAt(o),i,l);return new Uint8Array(n)}function iT(r){const n=[];return aT(r,i=>n.push(i)),new Uint8Array(n)}function Tr(r){const n=[],i={queue:0,queuedBits:0},l=o=>{n.push(o)};return r.forEach(o=>Wy(o,i,l)),Wy(null,i,l),n.join("")}function lT(r){return Math.round(Date.now()/1e3)+r}function sT(){return Symbol("auth-callback")}const Ut=()=>typeof window<"u"&&typeof document<"u",gr={tested:!1,writable:!1},Nv=()=>{if(!Ut())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(gr.tested)return gr.writable;const r=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(r,r),globalThis.localStorage.removeItem(r),gr.tested=!0,gr.writable=!0}catch{gr.tested=!0,gr.writable=!1}return gr.writable};function oT(r){const n={},i=new URL(r);if(i.hash&&i.hash[0]==="#")try{new URLSearchParams(i.hash.substring(1)).forEach((o,u)=>{n[u]=o})}catch{}return i.searchParams.forEach((l,o)=>{n[o]=l}),n}const kv=r=>r?(...n)=>r(...n):(...n)=>fetch(...n),uT=r=>typeof r=="object"&&r!==null&&"status"in r&&"ok"in r&&"json"in r&&typeof r.json=="function",_i=async(r,n,i)=>{await r.setItem(n,JSON.stringify(i))},vr=async(r,n)=>{const i=await r.getItem(n);if(!i)return null;try{return JSON.parse(i)}catch{return i}},Ba=async(r,n)=>{await r.removeItem(n)};class Vo{constructor(){this.promise=new Vo.promiseConstructor((n,i)=>{this.resolve=n,this.reject=i})}}Vo.promiseConstructor=Promise;function Sf(r){const n=r.split(".");if(n.length!==3)throw new $f("Invalid JWT structure");for(let l=0;l<n.length;l++)if(!QE.test(n[l]))throw new $f("JWT not in base64url format");return{header:JSON.parse(eg(n[0])),payload:JSON.parse(eg(n[1])),signature:Ei(n[2]),raw:{header:n[0],payload:n[1]}}}async function cT(r){return await new Promise(n=>{setTimeout(()=>n(null),r)})}function fT(r,n){return new Promise((l,o)=>{(async()=>{for(let u=0;u<1/0;u++)try{const f=await r(u);if(!n(u,null,f)){l(f);return}}catch(f){if(!n(u,f)){o(f);return}}})()})}function dT(r){return("0"+r.toString(16)).substr(-2)}function hT(){const n=new Uint32Array(56);if(typeof crypto>"u"){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",l=i.length;let o="";for(let u=0;u<56;u++)o+=i.charAt(Math.floor(Math.random()*l));return o}return crypto.getRandomValues(n),Array.from(n,dT).join("")}async function mT(r){const i=new TextEncoder().encode(r),l=await crypto.subtle.digest("SHA-256",i),o=new Uint8Array(l);return Array.from(o).map(u=>String.fromCharCode(u)).join("")}async function pT(r){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),r;const i=await mT(r);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function mi(r,n,i=!1){const l=hT();let o=l;i&&(o+="/PASSWORD_RECOVERY"),await _i(r,`${n}-code-verifier`,o);const u=await pT(l);return[u,l===u?"plain":"s256"]}const yT=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function gT(r){const n=r.headers.get(Hf);if(!n||!n.match(yT))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}function vT(r){if(!r)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(r<=n)throw new Error("JWT has expired")}function bT(r){switch(r){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const _T=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function pi(r){if(!_T.test(r))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ef(){const r={};return new Proxy(r,{get:(n,i)=>{if(i==="__isUserNotAvailableProxy")return!0;if(typeof i=="symbol"){const l=i.toString();if(l==="Symbol(Symbol.toPrimitive)"||l==="Symbol(Symbol.toStringTag)"||l==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${i}" property of the session object is not supported. Please use getUser() instead.`)},set:(n,i)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${i}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(n,i)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${i}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function wT(r,n){return new Proxy(r,{get:(i,l,o)=>{if(l==="__isInsecureUserWarningProxy")return!0;if(typeof l=="symbol"){const u=l.toString();if(u==="Symbol(Symbol.toPrimitive)"||u==="Symbol(Symbol.toStringTag)"||u==="Symbol(util.inspect.custom)"||u==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(i,l,o)}return!n.value&&typeof l=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),n.value=!0),Reflect.get(i,l,o)}})}function tg(r){return JSON.parse(JSON.stringify(r))}const br=r=>r.msg||r.message||r.error_description||r.error||JSON.stringify(r),ST=[502,503,504];async function ng(r){var n;if(!uT(r))throw new qf(br(r),0);if(ST.includes(r.status))throw new qf(br(r),r.status);let i;try{i=await r.json()}catch(u){throw new Sr(br(u),u)}let l;const o=gT(r);if(o&&o.getTime()>=zv["2024-01-01"].timestamp&&typeof i=="object"&&i&&typeof i.code=="string"?l=i.code:typeof i=="object"&&i&&typeof i.error_code=="string"&&(l=i.error_code),l){if(l==="weak_password")throw new Zy(br(i),r.status,((n=i.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(l==="session_not_found")throw new rn}else if(typeof i=="object"&&i&&typeof i.weak_password=="object"&&i.weak_password&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.reasons.reduce((u,f)=>u&&typeof f=="string",!0))throw new Zy(br(i),r.status,i.weak_password.reasons);throw new ZE(br(i),r.status||500,l)}const ET=(r,n,i,l)=>{const o={method:r,headers:n?.headers||{}};return r==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n?.headers),o.body=JSON.stringify(l),Object.assign(Object.assign({},o),i))};async function ve(r,n,i,l){var o;const u=Object.assign({},l?.headers);u[Hf]||(u[Hf]=zv["2024-01-01"].name),l?.jwt&&(u.Authorization=`Bearer ${l.jwt}`);const f=(o=l?.query)!==null&&o!==void 0?o:{};l?.redirectTo&&(f.redirect_to=l.redirectTo);const h=Object.keys(f).length?"?"+new URLSearchParams(f).toString():"",m=await TT(r,n,i+h,{headers:u,noResolveJson:l?.noResolveJson},{},l?.body);return l?.xform?l?.xform(m):{data:Object.assign({},m),error:null}}async function TT(r,n,i,l,o,u){const f=ET(n,l,o,u);let h;try{h=await r(i,Object.assign({},f))}catch(m){throw console.error(m),new qf(br(m),0)}if(h.ok||await ng(h),l?.noResolveJson)return h;try{return await h.json()}catch(m){await ng(m)}}function Dn(r){var n;let i=null;xT(r)&&(i=Object.assign({},r),r.expires_at||(i.expires_at=lT(r.expires_in)));const l=(n=r.user)!==null&&n!==void 0?n:r;return{data:{session:i,user:l},error:null}}function ag(r){const n=Dn(r);return!n.error&&r.weak_password&&typeof r.weak_password=="object"&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.message&&typeof r.weak_password.message=="string"&&r.weak_password.reasons.reduce((i,l)=>i&&typeof l=="string",!0)&&(n.data.weak_password=r.weak_password),n}function $a(r){var n;return{data:{user:(n=r.user)!==null&&n!==void 0?n:r},error:null}}function OT(r){return{data:r,error:null}}function RT(r){const{action_link:n,email_otp:i,hashed_token:l,redirect_to:o,verification_type:u}=r,f=xi(r,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),h={action_link:n,email_otp:i,hashed_token:l,redirect_to:o,verification_type:u},m=Object.assign({},f);return{data:{properties:h,user:m},error:null}}function rg(r){return r}function xT(r){return r.access_token&&r.refresh_token&&r.expires_in}const Tf=["global","local","others"];class AT{constructor({url:n="",headers:i={},fetch:l}){this.url=n,this.headers=i,this.fetch=kv(l),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(n,i=Tf[0]){if(Tf.indexOf(i)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Tf.join(", ")}`);try{return await ve(this.fetch,"POST",`${this.url}/logout?scope=${i}`,{headers:this.headers,jwt:n,noResolveJson:!0}),{data:null,error:null}}catch(l){if(fe(l))return{data:null,error:l};throw l}}async inviteUserByEmail(n,i={}){try{return await ve(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:i.data},headers:this.headers,redirectTo:i.redirectTo,xform:$a})}catch(l){if(fe(l))return{data:{user:null},error:l};throw l}}async generateLink(n){try{const{options:i}=n,l=xi(n,["options"]),o=Object.assign(Object.assign({},l),i);return"newEmail"in l&&(o.new_email=l?.newEmail,delete o.newEmail),await ve(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:RT,redirectTo:i?.redirectTo})}catch(i){if(fe(i))return{data:{properties:null,user:null},error:i};throw i}}async createUser(n){try{return await ve(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:$a})}catch(i){if(fe(i))return{data:{user:null},error:i};throw i}}async listUsers(n){var i,l,o,u,f,h,m;try{const p={nextPage:null,lastPage:0,total:0},g=await ve(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(i=n?.page)===null||i===void 0?void 0:i.toString())!==null&&l!==void 0?l:"",per_page:(u=(o=n?.perPage)===null||o===void 0?void 0:o.toString())!==null&&u!==void 0?u:""},xform:rg});if(g.error)throw g.error;const v=await g.json(),w=(f=g.headers.get("x-total-count"))!==null&&f!==void 0?f:0,_=(m=(h=g.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&m!==void 0?m:[];return _.length>0&&(_.forEach(S=>{const C=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),R=JSON.parse(S.split(";")[1].split("=")[1]);p[`${R}Page`]=C}),p.total=parseInt(w)),{data:Object.assign(Object.assign({},v),p),error:null}}catch(p){if(fe(p))return{data:{users:[]},error:p};throw p}}async getUserById(n){pi(n);try{return await ve(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:$a})}catch(i){if(fe(i))return{data:{user:null},error:i};throw i}}async updateUserById(n,i){pi(n);try{return await ve(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:i,headers:this.headers,xform:$a})}catch(l){if(fe(l))return{data:{user:null},error:l};throw l}}async deleteUser(n,i=!1){pi(n);try{return await ve(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:i},xform:$a})}catch(l){if(fe(l))return{data:{user:null},error:l};throw l}}async _listFactors(n){pi(n.userId);try{const{data:i,error:l}=await ve(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:i,error:l}}catch(i){if(fe(i))return{data:null,error:i};throw i}}async _deleteFactor(n){pi(n.userId),pi(n.id);try{return{data:await ve(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(i){if(fe(i))return{data:null,error:i};throw i}}async _listOAuthClients(n){var i,l,o,u,f,h,m;try{const p={nextPage:null,lastPage:0,total:0},g=await ve(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(i=n?.page)===null||i===void 0?void 0:i.toString())!==null&&l!==void 0?l:"",per_page:(u=(o=n?.perPage)===null||o===void 0?void 0:o.toString())!==null&&u!==void 0?u:""},xform:rg});if(g.error)throw g.error;const v=await g.json(),w=(f=g.headers.get("x-total-count"))!==null&&f!==void 0?f:0,_=(m=(h=g.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&m!==void 0?m:[];return _.length>0&&(_.forEach(S=>{const C=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),R=JSON.parse(S.split(";")[1].split("=")[1]);p[`${R}Page`]=C}),p.total=parseInt(w)),{data:Object.assign(Object.assign({},v),p),error:null}}catch(p){if(fe(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(n){try{return await ve(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(fe(i))return{data:null,error:i};throw i}}async _getOAuthClient(n){try{return await ve(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(fe(i))return{data:null,error:i};throw i}}async _updateOAuthClient(n,i){try{return await ve(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:i,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(fe(l))return{data:null,error:l};throw l}}async _deleteOAuthClient(n){try{return await ve(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(i){if(fe(i))return{data:null,error:i};throw i}}async _regenerateOAuthClientSecret(n){try{return await ve(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(fe(i))return{data:null,error:i};throw i}}}function ig(r={}){return{getItem:n=>r[n]||null,setItem:(n,i)=>{r[n]=i},removeItem:n=>{delete r[n]}}}const yi={debug:!!(globalThis&&Nv()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Lv extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}class CT extends Lv{}async function jT(r,n,i){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",r,n);const l=new globalThis.AbortController;return n>0&&setTimeout(()=>{l.abort(),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",r)},n),await Promise.resolve().then(()=>globalThis.navigator.locks.request(r,n===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:l.signal},async o=>{if(o){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",r,o.name);try{return await i()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",r,o.name)}}else{if(n===0)throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",r),new CT(`Acquiring an exclusive Navigator LockManager lock "${r}" immediately failed`);if(yi.debug)try{const u=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(u,null," "))}catch(u){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",u)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await i()}}))}function DT(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Bv(r){if(!/^0x[a-fA-F0-9]{40}$/.test(r))throw new Error(`@supabase/auth-js: Address "${r}" is invalid.`);return r.toLowerCase()}function UT(r){return parseInt(r,16)}function zT(r){const n=new TextEncoder().encode(r);return"0x"+Array.from(n,l=>l.toString(16).padStart(2,"0")).join("")}function MT(r){var n;const{chainId:i,domain:l,expirationTime:o,issuedAt:u=new Date,nonce:f,notBefore:h,requestId:m,resources:p,scheme:g,uri:v,version:w}=r;{if(!Number.isInteger(i))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${i}`);if(!l)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(f&&f.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${f}`);if(!v)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(w!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${w}`);if(!((n=r.statement)===null||n===void 0)&&n.includes(`
|
|
39
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${r.statement}`)}const _=Bv(r.address),S=g?`${g}://${l}`:l,C=r.statement?`${r.statement}
|
|
40
|
+
`:"",R=`${S} wants you to sign in with your Ethereum account:
|
|
41
|
+
${_}
|
|
42
|
+
|
|
43
|
+
${C}`;let k=`URI: ${v}
|
|
44
|
+
Version: ${w}
|
|
45
|
+
Chain ID: ${i}${f?`
|
|
46
|
+
Nonce: ${f}`:""}
|
|
47
|
+
Issued At: ${u.toISOString()}`;if(o&&(k+=`
|
|
48
|
+
Expiration Time: ${o.toISOString()}`),h&&(k+=`
|
|
49
|
+
Not Before: ${h.toISOString()}`),m&&(k+=`
|
|
50
|
+
Request ID: ${m}`),p){let q=`
|
|
51
|
+
Resources:`;for(const $ of p){if(!$||typeof $!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${$}`);q+=`
|
|
52
|
+
- ${$}`}k+=q}return`${R}
|
|
53
|
+
${k}`}class wt extends Error{constructor({message:n,code:i,cause:l,name:o}){var u;super(n,{cause:l}),this.__isWebAuthnError=!0,this.name=(u=o??(l instanceof Error?l.name:void 0))!==null&&u!==void 0?u:"Unknown Error",this.code=i}}class Mo extends wt{constructor(n,i){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i,message:n}),this.name="WebAuthnUnknownError",this.originalError=i}}function NT({error:r,options:n}){var i,l,o;const{publicKey:u}=n;if(!u)throw Error("options was missing required publicKey property");if(r.name==="AbortError"){if(n.signal instanceof AbortSignal)return new wt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:r})}else if(r.name==="ConstraintError"){if(((i=u.authenticatorSelection)===null||i===void 0?void 0:i.requireResidentKey)===!0)return new wt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:r});if(n.mediation==="conditional"&&((l=u.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new wt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:r});if(((o=u.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new wt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:r})}else{if(r.name==="InvalidStateError")return new wt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:r});if(r.name==="NotAllowedError")return new wt({message:r.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r});if(r.name==="NotSupportedError")return u.pubKeyCredParams.filter(h=>h.type==="public-key").length===0?new wt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:r}):new wt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:r});if(r.name==="SecurityError"){const f=window.location.hostname;if(Hv(f)){if(u.rp.id!==f)return new wt({message:`The RP ID "${u.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:r})}else return new wt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:r})}else if(r.name==="TypeError"){if(u.user.id.byteLength<1||u.user.id.byteLength>64)return new wt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:r})}else if(r.name==="UnknownError")return new wt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:r})}return new wt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r})}function kT({error:r,options:n}){const{publicKey:i}=n;if(!i)throw Error("options was missing required publicKey property");if(r.name==="AbortError"){if(n.signal instanceof AbortSignal)return new wt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:r})}else{if(r.name==="NotAllowedError")return new wt({message:r.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r});if(r.name==="SecurityError"){const l=window.location.hostname;if(Hv(l)){if(i.rpId!==l)return new wt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:r})}else return new wt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:r})}else if(r.name==="UnknownError")return new wt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:r})}return new wt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r})}class LT{createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}const n=new AbortController;return this.controller=n,n.signal}cancelCeremony(){if(this.controller){const n=new Error("Manually cancelling existing WebAuthn API call");n.name="AbortError",this.controller.abort(n),this.controller=void 0}}}const BT=new LT;function HT(r){if(!r)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(r);const{challenge:n,user:i,excludeCredentials:l}=r,o=xi(r,["challenge","user","excludeCredentials"]),u=Ei(n).buffer,f=Object.assign(Object.assign({},i),{id:Ei(i.id).buffer}),h=Object.assign(Object.assign({},o),{challenge:u,user:f});if(l&&l.length>0){h.excludeCredentials=new Array(l.length);for(let m=0;m<l.length;m++){const p=l[m];h.excludeCredentials[m]=Object.assign(Object.assign({},p),{id:Ei(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return h}function qT(r){if(!r)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(r);const{challenge:n,allowCredentials:i}=r,l=xi(r,["challenge","allowCredentials"]),o=Ei(n).buffer,u=Object.assign(Object.assign({},l),{challenge:o});if(i&&i.length>0){u.allowCredentials=new Array(i.length);for(let f=0;f<i.length;f++){const h=i[f];u.allowCredentials[f]=Object.assign(Object.assign({},h),{id:Ei(h.id).buffer,type:h.type||"public-key",transports:h.transports})}}return u}function $T(r){var n;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();const i=r;return{id:r.id,rawId:r.id,response:{attestationObject:Tr(new Uint8Array(r.response.attestationObject)),clientDataJSON:Tr(new Uint8Array(r.response.clientDataJSON))},type:"public-key",clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:(n=i.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function PT(r){var n;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();const i=r,l=r.getClientExtensionResults(),o=r.response;return{id:r.id,rawId:r.id,response:{authenticatorData:Tr(new Uint8Array(o.authenticatorData)),clientDataJSON:Tr(new Uint8Array(o.clientDataJSON)),signature:Tr(new Uint8Array(o.signature)),userHandle:o.userHandle?Tr(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:l,authenticatorAttachment:(n=i.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function Hv(r){return r==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(r)}function lg(){var r,n;return!!(Ut()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((r=navigator?.credentials)===null||r===void 0?void 0:r.create)=="function"&&typeof((n=navigator?.credentials)===null||n===void 0?void 0:n.get)=="function")}async function VT(r){try{const n=await navigator.credentials.create(r);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Mo("Browser returned unexpected credential type",n)}:{data:null,error:new Mo("Empty credential response",n)}}catch(n){return{data:null,error:NT({error:n,options:r})}}}async function GT(r){try{const n=await navigator.credentials.get(r);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Mo("Browser returned unexpected credential type",n)}:{data:null,error:new Mo("Empty credential response",n)}}catch(n){return{data:null,error:kT({error:n,options:r})}}}const YT={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},IT={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function No(...r){const n=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),i=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),l={};for(const o of r)if(o)for(const u in o){const f=o[u];if(f!==void 0)if(Array.isArray(f))l[u]=f;else if(i(f))l[u]=f;else if(n(f)){const h=l[u];n(h)?l[u]=No(h,f):l[u]=No(f)}else l[u]=f}return l}function KT(r,n){return No(YT,r,n||{})}function JT(r,n){return No(IT,r,n||{})}class QT{constructor(n){this.client=n,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(n){return this.client.mfa.enroll(Object.assign(Object.assign({},n),{factorType:"webauthn"}))}async _challenge({factorId:n,webauthn:i,friendlyName:l,signal:o},u){try{const{data:f,error:h}=await this.client.mfa.challenge({factorId:n,webauthn:i});if(!f)return{data:null,error:h};const m=o??BT.createNewAbortSignal();if(f.webauthn.type==="create"){const{user:p}=f.webauthn.credential_options.publicKey;p.name||(p.name=`${p.id}:${l}`),p.displayName||(p.displayName=p.name)}switch(f.webauthn.type){case"create":{const p=KT(f.webauthn.credential_options.publicKey,u?.create),{data:g,error:v}=await VT({publicKey:p,signal:m});return g?{data:{factorId:n,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:g}},error:null}:{data:null,error:v}}case"request":{const p=JT(f.webauthn.credential_options.publicKey,u?.request),{data:g,error:v}=await GT(Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:p,signal:m}));return g?{data:{factorId:n,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:g}},error:null}:{data:null,error:v}}}}catch(f){return fe(f)?{data:null,error:f}:{data:null,error:new Sr("Unexpected error in challenge",f)}}}async _verify({challengeId:n,factorId:i,webauthn:l}){return this.client.mfa.verify({factorId:i,challengeId:n,webauthn:l})}async _authenticate({factorId:n,webauthn:{rpId:i=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},u){if(!i)return{data:null,error:new ql("rpId is required for WebAuthn authentication")};try{if(!lg())return{data:null,error:new Sr("Browser does not support WebAuthn",null)};const{data:f,error:h}=await this.challenge({factorId:n,webauthn:{rpId:i,rpOrigins:l},signal:o},{request:u});if(!f)return{data:null,error:h};const{webauthn:m}=f;return this._verify({factorId:n,challengeId:f.challengeId,webauthn:{type:m.type,rpId:i,rpOrigins:l,credential_response:m.credential_response}})}catch(f){return fe(f)?{data:null,error:f}:{data:null,error:new Sr("Unexpected error in authenticate",f)}}}async _register({friendlyName:n,webauthn:{rpId:i=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},u){if(!i)return{data:null,error:new ql("rpId is required for WebAuthn registration")};try{if(!lg())return{data:null,error:new Sr("Browser does not support WebAuthn",null)};const{data:f,error:h}=await this._enroll({friendlyName:n});if(!f)return await this.client.mfa.listFactors().then(g=>{var v;return(v=g.data)===null||v===void 0?void 0:v.all.find(w=>w.factor_type==="webauthn"&&w.friendly_name===n&&w.status!=="unverified")}).then(g=>g?this.client.mfa.unenroll({factorId:g?.id}):void 0),{data:null,error:h};const{data:m,error:p}=await this._challenge({factorId:f.id,friendlyName:f.friendly_name,webauthn:{rpId:i,rpOrigins:l},signal:o},{create:u});return m?this._verify({factorId:f.id,challengeId:m.challengeId,webauthn:{rpId:i,rpOrigins:l,type:m.webauthn.type,credential_response:m.webauthn.credential_response}}):{data:null,error:p}}catch(f){return fe(f)?{data:null,error:f}:{data:null,error:new Sr("Unexpected error in register",f)}}}}DT();const XT={url:IE,storageKey:KE,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:JE,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function sg(r,n,i){return await i()}const gi={};class $l{get jwks(){var n,i;return(i=(n=gi[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&i!==void 0?i:{keys:[]}}set jwks(n){gi[this.storageKey]=Object.assign(Object.assign({},gi[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,i;return(i=(n=gi[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&i!==void 0?i:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){gi[this.storageKey]=Object.assign(Object.assign({},gi[this.storageKey]),{cachedAt:n})}constructor(n){var i,l,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const u=Object.assign(Object.assign({},XT),n);if(this.storageKey=u.storageKey,this.instanceID=(i=$l.nextInstanceID[this.storageKey])!==null&&i!==void 0?i:0,$l.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!u.debug,typeof u.debug=="function"&&(this.logger=u.debug),this.instanceID>0&&Ut()){const f=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(f),this.logDebugMessages&&console.trace(f)}if(this.persistSession=u.persistSession,this.autoRefreshToken=u.autoRefreshToken,this.admin=new AT({url:u.url,headers:u.headers,fetch:u.fetch}),this.url=u.url,this.headers=u.headers,this.fetch=kv(u.fetch),this.lock=u.lock||sg,this.detectSessionInUrl=u.detectSessionInUrl,this.flowType=u.flowType,this.hasCustomAuthorizationHeader=u.hasCustomAuthorizationHeader,this.throwOnError=u.throwOnError,u.lock?this.lock=u.lock:Ut()&&(!((l=globalThis?.navigator)===null||l===void 0)&&l.locks)?this.lock=jT:this.lock=sg,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new QT(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(u.storage?this.storage=u.storage:Nv()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ig(this.memoryStorage)),u.userStorage&&(this.userStorage=u.userStorage)):(this.memoryStorage={},this.storage=ig(this.memoryStorage)),Ut()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(f){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",f)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async f=>{this._debug("received broadcast notification from other tab or client",f),await this._notifyAllSubscribers(f.data.event,f.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Uv}) ${new Date().toISOString()}`}_debug(...n){return this.logDebugMessages&&this.logger(this._logPrefix(),...n),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var n;try{let i={},l="none";if(Ut()&&(i=oT(window.location.href),this._isImplicitGrantCallback(i)?l="implicit":await this._isPKCECallback(i)&&(l="pkce")),Ut()&&this.detectSessionInUrl&&l!=="none"){const{data:o,error:u}=await this._getSessionFromURL(i,l);if(u){if(this._debug("#_initialize()","error detecting session from URL",u),eT(u)){const m=(n=u.details)===null||n===void 0?void 0:n.code;if(m==="identity_already_exists"||m==="identity_not_found"||m==="single_identity_not_deletable")return{error:u}}return await this._removeSession(),{error:u}}const{session:f,redirectType:h}=o;return this._debug("#_initialize()","detected session in URL",f,"redirect type",h),await this._saveSession(f),setTimeout(async()=>{h==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",f):await this._notifyAllSubscribers("SIGNED_IN",f)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(i){return fe(i)?this._returnResult({error:i}):this._returnResult({error:new Sr("Unexpected error during initialization",i)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var i,l,o;try{const u=await ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(l=(i=n?.options)===null||i===void 0?void 0:i.data)!==null&&l!==void 0?l:{},gotrue_meta_security:{captcha_token:(o=n?.options)===null||o===void 0?void 0:o.captchaToken}},xform:Dn}),{data:f,error:h}=u;if(h||!f)return this._returnResult({data:{user:null,session:null},error:h});const m=f.session,p=f.user;return f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",m)),this._returnResult({data:{user:p,session:m},error:null})}catch(u){if(fe(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signUp(n){var i,l,o;try{let u;if("email"in n){const{email:g,password:v,options:w}=n;let _=null,S=null;this.flowType==="pkce"&&([_,S]=await mi(this.storage,this.storageKey)),u=await ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:w?.emailRedirectTo,body:{email:g,password:v,data:(i=w?.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:w?.captchaToken},code_challenge:_,code_challenge_method:S},xform:Dn})}else if("phone"in n){const{phone:g,password:v,options:w}=n;u=await ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:g,password:v,data:(l=w?.data)!==null&&l!==void 0?l:{},channel:(o=w?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:w?.captchaToken}},xform:Dn})}else throw new _o("You must provide either an email or phone number and a password");const{data:f,error:h}=u;if(h||!f)return this._returnResult({data:{user:null,session:null},error:h});const m=f.session,p=f.user;return f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",m)),this._returnResult({data:{user:p,session:m},error:null})}catch(u){if(fe(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signInWithPassword(n){try{let i;if("email"in n){const{email:u,password:f,options:h}=n;i=await ve(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:u,password:f,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ag})}else if("phone"in n){const{phone:u,password:f,options:h}=n;i=await ve(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:u,password:f,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ag})}else throw new _o("You must provide either an email or phone number and a password");const{data:l,error:o}=i;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!l||!l.session||!l.user){const u=new hi;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:Object.assign({user:l.user,session:l.session},l.weak_password?{weakPassword:l.weak_password}:null),error:o})}catch(i){if(fe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithOAuth(n){var i,l,o,u;return await this._handleProviderSignIn(n.provider,{redirectTo:(i=n.options)===null||i===void 0?void 0:i.redirectTo,scopes:(l=n.options)===null||l===void 0?void 0:l.scopes,queryParams:(o=n.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(u=n.options)===null||u===void 0?void 0:u.skipBrowserRedirect})}async exchangeCodeForSession(n){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(n))}async signInWithWeb3(n){const{chain:i}=n;switch(i){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${i}"`)}}async signInWithEthereum(n){var i,l,o,u,f,h,m,p,g,v,w;let _,S;if("message"in n)_=n.message,S=n.signature;else{const{chain:C,wallet:R,statement:k,options:q}=n;let $;if(Ut())if(typeof R=="object")$=R;else{const pe=window;if("ethereum"in pe&&typeof pe.ethereum=="object"&&"request"in pe.ethereum&&typeof pe.ethereum.request=="function")$=pe.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof R!="object"||!q?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");$=R}const Z=new URL((i=q?.url)!==null&&i!==void 0?i:window.location.href),ne=await $.request({method:"eth_requestAccounts"}).then(pe=>pe).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!ne||ne.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const le=Bv(ne[0]);let x=(l=q?.signInWithEthereum)===null||l===void 0?void 0:l.chainId;if(!x){const pe=await $.request({method:"eth_chainId"});x=UT(pe)}const ge={domain:Z.host,address:le,statement:k,uri:Z.href,version:"1",chainId:x,nonce:(o=q?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(f=(u=q?.signInWithEthereum)===null||u===void 0?void 0:u.issuedAt)!==null&&f!==void 0?f:new Date,expirationTime:(h=q?.signInWithEthereum)===null||h===void 0?void 0:h.expirationTime,notBefore:(m=q?.signInWithEthereum)===null||m===void 0?void 0:m.notBefore,requestId:(p=q?.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(g=q?.signInWithEthereum)===null||g===void 0?void 0:g.resources};_=MT(ge),S=await $.request({method:"personal_sign",params:[zT(_),le]})}try{const{data:C,error:R}=await ve(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:_,signature:S},!((v=n.options)===null||v===void 0)&&v.captchaToken?{gotrue_meta_security:{captcha_token:(w=n.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:Dn});if(R)throw R;if(!C||!C.session||!C.user){const k=new hi;return this._returnResult({data:{user:null,session:null},error:k})}return C.session&&(await this._saveSession(C.session),await this._notifyAllSubscribers("SIGNED_IN",C.session)),this._returnResult({data:Object.assign({},C),error:R})}catch(C){if(fe(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async signInWithSolana(n){var i,l,o,u,f,h,m,p,g,v,w,_;let S,C;if("message"in n)S=n.message,C=n.signature;else{const{chain:R,wallet:k,statement:q,options:$}=n;let Z;if(Ut())if(typeof k=="object")Z=k;else{const le=window;if("solana"in le&&typeof le.solana=="object"&&("signIn"in le.solana&&typeof le.solana.signIn=="function"||"signMessage"in le.solana&&typeof le.solana.signMessage=="function"))Z=le.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!$?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");Z=k}const ne=new URL((i=$?.url)!==null&&i!==void 0?i:window.location.href);if("signIn"in Z&&Z.signIn){const le=await Z.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},$?.signInWithSolana),{version:"1",domain:ne.host,uri:ne.href}),q?{statement:q}:null));let x;if(Array.isArray(le)&&le[0]&&typeof le[0]=="object")x=le[0];else if(le&&typeof le=="object"&&"signedMessage"in le&&"signature"in le)x=le;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in x&&"signature"in x&&(typeof x.signedMessage=="string"||x.signedMessage instanceof Uint8Array)&&x.signature instanceof Uint8Array)S=typeof x.signedMessage=="string"?x.signedMessage:new TextDecoder().decode(x.signedMessage),C=x.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in Z)||typeof Z.signMessage!="function"||!("publicKey"in Z)||typeof Z!="object"||!Z.publicKey||!("toBase58"in Z.publicKey)||typeof Z.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");S=[`${ne.host} wants you to sign in with your Solana account:`,Z.publicKey.toBase58(),...q?["",q,""]:[""],"Version: 1",`URI: ${ne.href}`,`Issued At: ${(o=(l=$?.signInWithSolana)===null||l===void 0?void 0:l.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((u=$?.signInWithSolana)===null||u===void 0)&&u.notBefore?[`Not Before: ${$.signInWithSolana.notBefore}`]:[],...!((f=$?.signInWithSolana)===null||f===void 0)&&f.expirationTime?[`Expiration Time: ${$.signInWithSolana.expirationTime}`]:[],...!((h=$?.signInWithSolana)===null||h===void 0)&&h.chainId?[`Chain ID: ${$.signInWithSolana.chainId}`]:[],...!((m=$?.signInWithSolana)===null||m===void 0)&&m.nonce?[`Nonce: ${$.signInWithSolana.nonce}`]:[],...!((p=$?.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${$.signInWithSolana.requestId}`]:[],...!((v=(g=$?.signInWithSolana)===null||g===void 0?void 0:g.resources)===null||v===void 0)&&v.length?["Resources",...$.signInWithSolana.resources.map(x=>`- ${x}`)]:[]].join(`
|
|
54
|
+
`);const le=await Z.signMessage(new TextEncoder().encode(S),"utf8");if(!le||!(le instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");C=le}}try{const{data:R,error:k}=await ve(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:S,signature:Tr(C)},!((w=n.options)===null||w===void 0)&&w.captchaToken?{gotrue_meta_security:{captcha_token:(_=n.options)===null||_===void 0?void 0:_.captchaToken}}:null),xform:Dn});if(k)throw k;if(!R||!R.session||!R.user){const q=new hi;return this._returnResult({data:{user:null,session:null},error:q})}return R.session&&(await this._saveSession(R.session),await this._notifyAllSubscribers("SIGNED_IN",R.session)),this._returnResult({data:Object.assign({},R),error:k})}catch(R){if(fe(R))return this._returnResult({data:{user:null,session:null},error:R});throw R}}async _exchangeCodeForSession(n){const i=await vr(this.storage,`${this.storageKey}-code-verifier`),[l,o]=(i??"").split("/");try{const{data:u,error:f}=await ve(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:l},xform:Dn});if(await Ba(this.storage,`${this.storageKey}-code-verifier`),f)throw f;if(!u||!u.session||!u.user){const h=new hi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:h})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:Object.assign(Object.assign({},u),{redirectType:o??null}),error:f})}catch(u){if(fe(u))return this._returnResult({data:{user:null,session:null,redirectType:null},error:u});throw u}}async signInWithIdToken(n){try{const{options:i,provider:l,token:o,access_token:u,nonce:f}=n,h=await ve(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:l,id_token:o,access_token:u,nonce:f,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Dn}),{data:m,error:p}=h;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!m||!m.session||!m.user){const g=new hi;return this._returnResult({data:{user:null,session:null},error:g})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:m,error:p})}catch(i){if(fe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithOtp(n){var i,l,o,u,f;try{if("email"in n){const{email:h,options:m}=n;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await mi(this.storage,this.storageKey));const{error:v}=await ve(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:h,data:(i=m?.data)!==null&&i!==void 0?i:{},create_user:(l=m?.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:m?.captchaToken},code_challenge:p,code_challenge_method:g},redirectTo:m?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:v})}if("phone"in n){const{phone:h,options:m}=n,{data:p,error:g}=await ve(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:h,data:(o=m?.data)!==null&&o!==void 0?o:{},create_user:(u=m?.shouldCreateUser)!==null&&u!==void 0?u:!0,gotrue_meta_security:{captcha_token:m?.captchaToken},channel:(f=m?.channel)!==null&&f!==void 0?f:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p?.message_id},error:g})}throw new _o("You must provide either an email or phone number.")}catch(h){if(fe(h))return this._returnResult({data:{user:null,session:null},error:h});throw h}}async verifyOtp(n){var i,l;try{let o,u;"options"in n&&(o=(i=n.options)===null||i===void 0?void 0:i.redirectTo,u=(l=n.options)===null||l===void 0?void 0:l.captchaToken);const{data:f,error:h}=await ve(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:u}}),redirectTo:o,xform:Dn});if(h)throw h;if(!f)throw new Error("An error occurred on token verification.");const m=f.session,p=f.user;return m?.access_token&&(await this._saveSession(m),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",m)),this._returnResult({data:{user:p,session:m},error:null})}catch(o){if(fe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(n){var i,l,o,u,f;try{let h=null,m=null;this.flowType==="pkce"&&([h,m]=await mi(this.storage,this.storageKey));const p=await ve(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in n?{provider_id:n.providerId}:null),"domain"in n?{domain:n.domain}:null),{redirect_to:(l=(i=n.options)===null||i===void 0?void 0:i.redirectTo)!==null&&l!==void 0?l:void 0}),!((o=n?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:n.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:h,code_challenge_method:m}),headers:this.headers,xform:OT});return!((u=p.data)===null||u===void 0)&&u.url&&Ut()&&!(!((f=n.options)===null||f===void 0)&&f.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(h){if(fe(h))return this._returnResult({data:null,error:h});throw h}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async n=>{const{data:{session:i},error:l}=n;if(l)throw l;if(!i)throw new rn;const{error:o}=await ve(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:i.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(n){if(fe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){try{const i=`${this.url}/resend`;if("email"in n){const{email:l,type:o,options:u}=n,{error:f}=await ve(this.fetch,"POST",i,{headers:this.headers,body:{email:l,type:o,gotrue_meta_security:{captcha_token:u?.captchaToken}},redirectTo:u?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}else if("phone"in n){const{phone:l,type:o,options:u}=n,{data:f,error:h}=await ve(this.fetch,"POST",i,{headers:this.headers,body:{phone:l,type:o,gotrue_meta_security:{captcha_token:u?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:f?.message_id},error:h})}throw new _o("You must provide either an email or phone number and a type")}catch(i){if(fe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async i=>i))}async _acquireLock(n,i){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const l=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await l,await i()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,n,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const l=i();for(this.pendingInLock.push((async()=>{try{await l}catch{}})()),await l;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await l}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(n){this._debug("#_useSession","begin");try{const i=await this.__loadSession();return await n(i)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let n=null;const i=await vr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",i),i!==null&&(this._isValidSession(i)?n=i:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!n)return{data:{session:null},error:null};const l=n.expires_at?n.expires_at*1e3-Date.now()<_f:!1;if(this._debug("#__loadSession()",`session has${l?"":" not"} expired`,"expires_at",n.expires_at),!l){if(this.userStorage){const f=await vr(this.userStorage,this.storageKey+"-user");f?.user?n.user=f.user:n.user=Ef()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const f={value:this.suppressGetSessionWarning};n.user=wT(n.user,f),f.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:n},error:null}}const{data:o,error:u}=await this._callRefreshToken(n.refresh_token);return u?this._returnResult({data:{session:null},error:u}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(n){return n?await this._getUser(n):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(n){try{return n?await ve(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:$a}):await this._useSession(async i=>{var l,o,u;const{data:f,error:h}=i;if(h)throw h;return!(!((l=f.session)===null||l===void 0)&&l.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new rn}:await ve(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(u=(o=f.session)===null||o===void 0?void 0:o.access_token)!==null&&u!==void 0?u:void 0,xform:$a})})}catch(i){if(fe(i))return WE(i)&&(await this._removeSession(),await Ba(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:i});throw i}}async updateUser(n,i={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(n,i))}async _updateUser(n,i={}){try{return await this._useSession(async l=>{const{data:o,error:u}=l;if(u)throw u;if(!o.session)throw new rn;const f=o.session;let h=null,m=null;this.flowType==="pkce"&&n.email!=null&&([h,m]=await mi(this.storage,this.storageKey));const{data:p,error:g}=await ve(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:Object.assign(Object.assign({},n),{code_challenge:h,code_challenge_method:m}),jwt:f.access_token,xform:$a});if(g)throw g;return f.user=p.user,await this._saveSession(f),await this._notifyAllSubscribers("USER_UPDATED",f),this._returnResult({data:{user:f.user},error:null})})}catch(l){if(fe(l))return this._returnResult({data:{user:null},error:l});throw l}}async setSession(n){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(n))}async _setSession(n){try{if(!n.access_token||!n.refresh_token)throw new rn;const i=Date.now()/1e3;let l=i,o=!0,u=null;const{payload:f}=Sf(n.access_token);if(f.exp&&(l=f.exp,o=l<=i),o){const{data:h,error:m}=await this._callRefreshToken(n.refresh_token);if(m)return this._returnResult({data:{user:null,session:null},error:m});if(!h)return{data:{user:null,session:null},error:null};u=h}else{const{data:h,error:m}=await this._getUser(n.access_token);if(m)throw m;u={access_token:n.access_token,refresh_token:n.refresh_token,user:h.user,token_type:"bearer",expires_in:l-i,expires_at:l},await this._saveSession(u),await this._notifyAllSubscribers("SIGNED_IN",u)}return this._returnResult({data:{user:u.user,session:u},error:null})}catch(i){if(fe(i))return this._returnResult({data:{session:null,user:null},error:i});throw i}}async refreshSession(n){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(n))}async _refreshSession(n){try{return await this._useSession(async i=>{var l;if(!n){const{data:f,error:h}=i;if(h)throw h;n=(l=f.session)!==null&&l!==void 0?l:void 0}if(!n?.refresh_token)throw new rn;const{data:o,error:u}=await this._callRefreshToken(n.refresh_token);return u?this._returnResult({data:{user:null,session:null},error:u}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(i){if(fe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async _getSessionFromURL(n,i){try{if(!Ut())throw new wo("No browser detected.");if(n.error||n.error_description||n.error_code)throw new wo(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(i){case"implicit":if(this.flowType==="pkce")throw new Xy("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new wo("Not a valid implicit grant flow url.");break;default:}if(i==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new Xy("No code detected.");const{data:q,error:$}=await this._exchangeCodeForSession(n.code);if($)throw $;const Z=new URL(window.location.href);return Z.searchParams.delete("code"),window.history.replaceState(window.history.state,"",Z.toString()),{data:{session:q.session,redirectType:null},error:null}}const{provider_token:l,provider_refresh_token:o,access_token:u,refresh_token:f,expires_in:h,expires_at:m,token_type:p}=n;if(!u||!h||!f||!p)throw new wo("No session defined in URL");const g=Math.round(Date.now()/1e3),v=parseInt(h);let w=g+v;m&&(w=parseInt(m));const _=w-g;_*1e3<=bi&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${_}s, should have been closer to ${v}s`);const S=w-v;g-S>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",S,w,g):g-S<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",S,w,g);const{data:C,error:R}=await this._getUser(u);if(R)throw R;const k={provider_token:l,provider_refresh_token:o,access_token:u,expires_in:v,expires_at:w,refresh_token:f,token_type:p,user:C.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:k,redirectType:n.type},error:null})}catch(l){if(fe(l))return this._returnResult({data:{session:null,redirectType:null},error:l});throw l}}_isImplicitGrantCallback(n){return!!(n.access_token||n.error_description)}async _isPKCECallback(n){const i=await vr(this.storage,`${this.storageKey}-code-verifier`);return!!(n.code&&i)}async signOut(n={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(n))}async _signOut({scope:n}={scope:"global"}){return await this._useSession(async i=>{var l;const{data:o,error:u}=i;if(u)return this._returnResult({error:u});const f=(l=o.session)===null||l===void 0?void 0:l.access_token;if(f){const{error:h}=await this.admin.signOut(f,n);if(h&&!(FE(h)&&(h.status===404||h.status===401||h.status===403)))return this._returnResult({error:h})}return n!=="others"&&(await this._removeSession(),await Ba(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(n){const i=sT(),l={id:i,callback:n,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",i),this.stateChangeEmitters.delete(i)}};return this._debug("#onAuthStateChange()","registered callback with id",i),this.stateChangeEmitters.set(i,l),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(i)})))(),{data:{subscription:l}}}async _emitInitialSession(n){return await this._useSession(async i=>{var l,o;try{const{data:{session:u},error:f}=i;if(f)throw f;await((l=this.stateChangeEmitters.get(n))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",u)),this._debug("INITIAL_SESSION","callback id",n,"session",u)}catch(u){await((o=this.stateChangeEmitters.get(n))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",u),console.error(u)}})}async resetPasswordForEmail(n,i={}){let l=null,o=null;this.flowType==="pkce"&&([l,o]=await mi(this.storage,this.storageKey,!0));try{return await ve(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:l,code_challenge_method:o,gotrue_meta_security:{captcha_token:i.captchaToken}},headers:this.headers,redirectTo:i.redirectTo})}catch(u){if(fe(u))return this._returnResult({data:null,error:u});throw u}}async getUserIdentities(){var n;try{const{data:i,error:l}=await this.getUser();if(l)throw l;return this._returnResult({data:{identities:(n=i.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var i;try{const{data:l,error:o}=await this._useSession(async u=>{var f,h,m,p,g;const{data:v,error:w}=u;if(w)throw w;const _=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(f=n.options)===null||f===void 0?void 0:f.redirectTo,scopes:(h=n.options)===null||h===void 0?void 0:h.scopes,queryParams:(m=n.options)===null||m===void 0?void 0:m.queryParams,skipBrowserRedirect:!0});return await ve(this.fetch,"GET",_,{headers:this.headers,jwt:(g=(p=v.session)===null||p===void 0?void 0:p.access_token)!==null&&g!==void 0?g:void 0})});if(o)throw o;return Ut()&&!(!((i=n.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(l?.url),this._returnResult({data:{provider:n.provider,url:l?.url},error:null})}catch(l){if(fe(l))return this._returnResult({data:{provider:n.provider,url:null},error:l});throw l}}async linkIdentityIdToken(n){return await this._useSession(async i=>{var l;try{const{error:o,data:{session:u}}=i;if(o)throw o;const{options:f,provider:h,token:m,access_token:p,nonce:g}=n,v=await ve(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(l=u?.access_token)!==null&&l!==void 0?l:void 0,body:{provider:h,id_token:m,access_token:p,nonce:g,link_identity:!0,gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:Dn}),{data:w,error:_}=v;return _?this._returnResult({data:{user:null,session:null},error:_}):!w||!w.session||!w.user?this._returnResult({data:{user:null,session:null},error:new hi}):(w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("USER_UPDATED",w.session)),this._returnResult({data:w,error:_}))}catch(o){if(fe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(n){try{return await this._useSession(async i=>{var l,o;const{data:u,error:f}=i;if(f)throw f;return await ve(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(o=(l=u.session)===null||l===void 0?void 0:l.access_token)!==null&&o!==void 0?o:void 0})})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}}async _refreshAccessToken(n){const i=`#_refreshAccessToken(${n.substring(0,5)}...)`;this._debug(i,"begin");try{const l=Date.now();return await fT(async o=>(o>0&&await cT(200*Math.pow(2,o-1)),this._debug(i,"refreshing attempt",o),await ve(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:Dn})),(o,u)=>{const f=200*Math.pow(2,o);return u&&wf(u)&&Date.now()+f-l<bi})}catch(l){if(this._debug(i,"error",l),fe(l))return this._returnResult({data:{session:null,user:null},error:l});throw l}finally{this._debug(i,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,i){const l=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:i.redirectTo,scopes:i.scopes,queryParams:i.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",i,"url",l),Ut()&&!i.skipBrowserRedirect&&window.location.assign(l),{data:{provider:n,url:l},error:null}}async _recoverAndRefresh(){var n,i;const l="#_recoverAndRefresh()";this._debug(l,"begin");try{const o=await vr(this.storage,this.storageKey);if(o&&this.userStorage){let f=await vr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!f&&(f={user:o.user},await _i(this.userStorage,this.storageKey+"-user",f)),o.user=(n=f?.user)!==null&&n!==void 0?n:Ef()}else if(o&&!o.user&&!o.user){const f=await vr(this.storage,this.storageKey+"-user");f&&f?.user?(o.user=f.user,await Ba(this.storage,this.storageKey+"-user"),await _i(this.storage,this.storageKey,o)):o.user=Ef()}if(this._debug(l,"session from storage",o),!this._isValidSession(o)){this._debug(l,"session is not valid"),o!==null&&await this._removeSession();return}const u=((i=o.expires_at)!==null&&i!==void 0?i:1/0)*1e3-Date.now()<_f;if(this._debug(l,`session has${u?"":" not"} expired with margin of ${_f}s`),u){if(this.autoRefreshToken&&o.refresh_token){const{error:f}=await this._callRefreshToken(o.refresh_token);f&&(console.error(f),wf(f)||(this._debug(l,"refresh failed with a non-retryable error, removing the session",f),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:f,error:h}=await this._getUser(o.access_token);!h&&f?.user?(o.user=f.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(l,"could not get user data, skipping SIGNED_IN notification")}catch(f){console.error("Error getting user data:",f),this._debug(l,"error getting user data, skipping SIGNED_IN notification",f)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(l,"error",o),console.error(o);return}finally{this._debug(l,"end")}}async _callRefreshToken(n){var i,l;if(!n)throw new rn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${n.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Vo;const{data:u,error:f}=await this._refreshAccessToken(n);if(f)throw f;if(!u.session)throw new rn;await this._saveSession(u.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",u.session);const h={data:u.session,error:null};return this.refreshingDeferred.resolve(h),h}catch(u){if(this._debug(o,"error",u),fe(u)){const f={data:null,error:u};return wf(u)||await this._removeSession(),(i=this.refreshingDeferred)===null||i===void 0||i.resolve(f),f}throw(l=this.refreshingDeferred)===null||l===void 0||l.reject(u),u}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(n,i,l=!0){const o=`#_notifyAllSubscribers(${n})`;this._debug(o,"begin",i,`broadcast = ${l}`);try{this.broadcastChannel&&l&&this.broadcastChannel.postMessage({event:n,session:i});const u=[],f=Array.from(this.stateChangeEmitters.values()).map(async h=>{try{await h.callback(n,i)}catch(m){u.push(m)}});if(await Promise.all(f),u.length>0){for(let h=0;h<u.length;h+=1)console.error(u[h]);throw u[0]}}finally{this._debug(o,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0;const i=Object.assign({},n),l=i.user&&i.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!l&&i.user&&await _i(this.userStorage,this.storageKey+"-user",{user:i.user});const o=Object.assign({},i);delete o.user;const u=tg(o);await _i(this.storage,this.storageKey,u)}else{const o=tg(i);await _i(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await Ba(this.storage,this.storageKey),await Ba(this.storage,this.storageKey+"-code-verifier"),await Ba(this.storage,this.storageKey+"-user"),this.userStorage&&await Ba(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const n=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{n&&Ut()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",n)}catch(i){console.error("removing visibilitychange callback failed",i)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),bi);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const n=Date.now();try{return await this._useSession(async i=>{const{data:{session:l}}=i;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((l.expires_at*1e3-n)/bi);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${bi}ms, refresh threshold is ${Bf} ticks`),o<=Bf&&await this._callRefreshToken(l.refresh_token)})}catch(i){console.error("Auto refresh tick failed with error. This is likely a transient error.",i)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(n){if(n.isAcquireTimeout||n instanceof Lv)this._debug("auto refresh token tick lock not available");else throw n}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ut()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(n){console.error("_handleVisibilityChange",n)}}async _onVisibilityChanged(n){const i=`#_onVisibilityChanged(${n})`;this._debug(i,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),n||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(i,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(n,i,l){const o=[`provider=${encodeURIComponent(i)}`];if(l?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(l.redirectTo)}`),l?.scopes&&o.push(`scopes=${encodeURIComponent(l.scopes)}`),this.flowType==="pkce"){const[u,f]=await mi(this.storage,this.storageKey),h=new URLSearchParams({code_challenge:`${encodeURIComponent(u)}`,code_challenge_method:`${encodeURIComponent(f)}`});o.push(h.toString())}if(l?.queryParams){const u=new URLSearchParams(l.queryParams);o.push(u.toString())}return l?.skipBrowserRedirect&&o.push(`skip_http_redirect=${l.skipBrowserRedirect}`),`${n}?${o.join("&")}`}async _unenroll(n){try{return await this._useSession(async i=>{var l;const{data:o,error:u}=i;return u?this._returnResult({data:null,error:u}):await ve(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(l=o?.session)===null||l===void 0?void 0:l.access_token})})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}}async _enroll(n){try{return await this._useSession(async i=>{var l,o;const{data:u,error:f}=i;if(f)return this._returnResult({data:null,error:f});const h=Object.assign({friendly_name:n.friendlyName,factor_type:n.factorType},n.factorType==="phone"?{phone:n.phone}:n.factorType==="totp"?{issuer:n.issuer}:{}),{data:m,error:p}=await ve(this.fetch,"POST",`${this.url}/factors`,{body:h,headers:this.headers,jwt:(l=u?.session)===null||l===void 0?void 0:l.access_token});return p?this._returnResult({data:null,error:p}):(n.factorType==="totp"&&m.type==="totp"&&(!((o=m?.totp)===null||o===void 0)&&o.qr_code)&&(m.totp.qr_code=`data:image/svg+xml;utf-8,${m.totp.qr_code}`),this._returnResult({data:m,error:null}))})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}}async _verify(n){return this._acquireLock(-1,async()=>{try{return await this._useSession(async i=>{var l;const{data:o,error:u}=i;if(u)return this._returnResult({data:null,error:u});const f=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?$T(n.webauthn.credential_response):PT(n.webauthn.credential_response)})}:{code:n.code}),{data:h,error:m}=await ve(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:f,headers:this.headers,jwt:(l=o?.session)===null||l===void 0?void 0:l.access_token});return m?this._returnResult({data:null,error:m}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+h.expires_in},h)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",h),this._returnResult({data:h,error:m}))})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}})}async _challenge(n){return this._acquireLock(-1,async()=>{try{return await this._useSession(async i=>{var l;const{data:o,error:u}=i;if(u)return this._returnResult({data:null,error:u});const f=await ve(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(l=o?.session)===null||l===void 0?void 0:l.access_token});if(f.error)return f;const{data:h}=f;if(h.type!=="webauthn")return{data:h,error:null};switch(h.webauthn.type){case"create":return{data:Object.assign(Object.assign({},h),{webauthn:Object.assign(Object.assign({},h.webauthn),{credential_options:Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:HT(h.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},h),{webauthn:Object.assign(Object.assign({},h.webauthn),{credential_options:Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:qT(h.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}})}async _challengeAndVerify(n){const{data:i,error:l}=await this._challenge({factorId:n.factorId});return l?this._returnResult({data:null,error:l}):await this._verify({factorId:n.factorId,challengeId:i.id,code:n.code})}async _listFactors(){var n;const{data:{user:i},error:l}=await this.getUser();if(l)return{data:null,error:l};const o={all:[],phone:[],totp:[],webauthn:[]};for(const u of(n=i?.factors)!==null&&n!==void 0?n:[])o.all.push(u),u.status==="verified"&&o[u.factor_type].push(u);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(){var n,i;const{data:{session:l},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!l)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:u}=Sf(l.access_token);let f=null;u.aal&&(f=u.aal);let h=f;((i=(n=l.user.factors)===null||n===void 0?void 0:n.filter(g=>g.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(h="aal2");const p=u.amr||[];return{data:{currentLevel:f,nextLevel:h,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;return o?this._returnResult({data:null,error:o}):l?await ve(this.fetch,"GET",`${this.url}/oauth/authorizations/${n}`,{headers:this.headers,jwt:l.access_token,xform:u=>({data:u,error:null})}):this._returnResult({data:null,error:new rn})})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}}async _approveAuthorization(n,i){try{return await this._useSession(async l=>{const{data:{session:o},error:u}=l;if(u)return this._returnResult({data:null,error:u});if(!o)return this._returnResult({data:null,error:new rn});const f=await ve(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:h=>({data:h,error:null})});return f.data&&f.data.redirect_url&&Ut()&&!i?.skipBrowserRedirect&&window.location.assign(f.data.redirect_url),f})}catch(l){if(fe(l))return this._returnResult({data:null,error:l});throw l}}async _denyAuthorization(n,i){try{return await this._useSession(async l=>{const{data:{session:o},error:u}=l;if(u)return this._returnResult({data:null,error:u});if(!o)return this._returnResult({data:null,error:new rn});const f=await ve(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:h=>({data:h,error:null})});return f.data&&f.data.redirect_url&&Ut()&&!i?.skipBrowserRedirect&&window.location.assign(f.data.redirect_url),f})}catch(l){if(fe(l))return this._returnResult({data:null,error:l});throw l}}async _listOAuthGrants(){try{return await this._useSession(async n=>{const{data:{session:i},error:l}=n;return l?this._returnResult({data:null,error:l}):i?await ve(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:i.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new rn})})}catch(n){if(fe(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async i=>{const{data:{session:l},error:o}=i;return o?this._returnResult({data:null,error:o}):l?(await ve(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:l.access_token,query:{client_id:n.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new rn})})}catch(i){if(fe(i))return this._returnResult({data:null,error:i});throw i}}async fetchJwk(n,i={keys:[]}){let l=i.keys.find(h=>h.kid===n);if(l)return l;const o=Date.now();if(l=this.jwks.keys.find(h=>h.kid===n),l&&this.jwks_cached_at+XE>o)return l;const{data:u,error:f}=await ve(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(f)throw f;return!u.keys||u.keys.length===0||(this.jwks=u,this.jwks_cached_at=o,l=u.keys.find(h=>h.kid===n),!l)?null:l}async getClaims(n,i={}){try{let l=n;if(!l){const{data:_,error:S}=await this.getSession();if(S||!_.session)return this._returnResult({data:null,error:S});l=_.session.access_token}const{header:o,payload:u,signature:f,raw:{header:h,payload:m}}=Sf(l);i?.allowExpired||vT(u.exp);const p=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,i?.keys?{keys:i.keys}:i?.jwks);if(!p){const{error:_}=await this.getUser(l);if(_)throw _;return{data:{claims:u,header:o,signature:f},error:null}}const g=bT(o.alg),v=await crypto.subtle.importKey("jwk",p,g,!0,["verify"]);if(!await crypto.subtle.verify(g,v,f,iT(`${h}.${m}`)))throw new $f("Invalid JWT signature");return{data:{claims:u,header:o,signature:f},error:null}}catch(l){if(fe(l))return this._returnResult({data:null,error:l});throw l}}}$l.nextInstanceID={};const ZT=$l;class FT extends ZT{constructor(n){super(n)}}class WT{constructor(n,i,l){var o,u,f;this.supabaseUrl=n,this.supabaseKey=i;const h=YE(n);if(!i)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",h),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",h),this.storageUrl=new URL("storage/v1",h),this.functionsUrl=new URL("functions/v1",h);const m=`sb-${h.hostname.split(".")[0]}-auth-token`,p={db:LE,realtime:HE,auth:Object.assign(Object.assign({},BE),{storageKey:m}),global:kE},g=GE(l??{},p);this.storageKey=(o=g.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(u=g.global.headers)!==null&&u!==void 0?u:{},g.accessToken?(this.accessToken=g.accessToken,this.auth=new Proxy({},{get:(v,w)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(w)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((f=g.auth)!==null&&f!==void 0?f:{},this.headers,g.global.fetch),this.fetch=PE(i,this._getAccessToken.bind(this),g.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},g.realtime)),this.accessToken&&this.accessToken().then(v=>this.realtime.setAuth(v)).catch(v=>console.warn("Failed to set initial Realtime auth token:",v)),this.rest=new HS(new URL("rest/v1",h).href,{headers:this.headers,schema:g.db.schema,fetch:this.fetch}),this.storage=new zE(this.storageUrl.href,this.headers,this.fetch,l?.storage),g.accessToken||this._listenForAuthEvents()}get functions(){return new NS(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(n){return this.rest.from(n)}schema(n){return this.rest.schema(n)}rpc(n,i={},l={head:!1,get:!1,count:void 0}){return this.rest.rpc(n,i,l)}channel(n,i={config:{}}){return this.realtime.channel(n,i)}getChannels(){return this.realtime.getChannels()}removeChannel(n){return this.realtime.removeChannel(n)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var n,i;if(this.accessToken)return await this.accessToken();const{data:l}=await this.auth.getSession();return(i=(n=l.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:n,persistSession:i,detectSessionInUrl:l,storage:o,userStorage:u,storageKey:f,flowType:h,lock:m,debug:p,throwOnError:g},v,w){const _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new FT({url:this.authUrl.href,headers:Object.assign(Object.assign({},_),v),storageKey:f,autoRefreshToken:n,persistSession:i,detectSessionInUrl:l,storage:o,userStorage:u,flowType:h,lock:m,debug:p,throwOnError:g,fetch:w,hasCustomAuthorizationHeader:Object.keys(this.headers).some(S=>S.toLowerCase()==="authorization")})}_initRealtimeClient(n){return new nE(this.realtimeUrl.href,Object.assign(Object.assign({},n),{params:Object.assign({apikey:this.supabaseKey},n?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((i,l)=>{this._handleTokenChanged(i,"CLIENT",l?.access_token)})}_handleTokenChanged(n,i,l){(n==="TOKEN_REFRESHED"||n==="SIGNED_IN")&&this.changedAccessToken!==l?(this.changedAccessToken=l,this.realtime.setAuth(l)):n==="SIGNED_OUT"&&(this.realtime.setAuth(),i=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const e1=(r,n,i)=>new WT(r,n,i);function t1(){if(typeof window<"u"||typeof process>"u")return!1;const r=process.version;if(r==null)return!1;const n=r.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}t1()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Un=e1("https://smkbiguvgiscojwxgbae.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InNta2JpZ3V2Z2lzY29qd3hnYmFlIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc2MzQxMTgyMywiZXhwIjoyMDc4OTg3ODIzfQ.uDFNhOGqGb4kv3DWcVHdRoPjCSUhL_IJURaTRtqJZNE"),og=r=>{let n;const i=new Set,l=(p,g)=>{const v=typeof p=="function"?p(n):p;if(!Object.is(v,n)){const w=n;n=g??(typeof v!="object"||v===null)?v:Object.assign({},n,v),i.forEach(_=>_(n,w))}},o=()=>n,h={setState:l,getState:o,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=n=r(l,o,h);return h},n1=(r=>r?og(r):og),a1=r=>r;function r1(r,n=a1){const i=Al.useSyncExternalStore(r.subscribe,Al.useCallback(()=>n(r.getState()),[r,n]),Al.useCallback(()=>n(r.getInitialState()),[r,n]));return Al.useDebugValue(i),i}const ug=r=>{const n=n1(r),i=l=>r1(n,l);return Object.assign(i,n),i},cd=(r=>r?ug(r):ug),fd=cd(r=>({user:null,loading:!1,setUser:n=>r({user:n}),signIn:async(n,i)=>{r({loading:!0});const{data:l,error:o}=await Un.auth.signInWithPassword({email:n,password:i});return r({user:l.user,loading:!1}),{data:l,error:o}},signUp:async(n,i,l)=>{r({loading:!0});const{data:o,error:u}=await Un.auth.signUp({email:n,password:i,options:{captchaToken:l}});return r({user:o.user,loading:!1}),{data:o,error:u}},loginAsGuest:async()=>{r({loading:!0});const{data:n,error:i}=await Un.auth.signInAnonymously();return i&&console.error("Error login anónimo:",i),r({user:n.user,loading:!1}),{data:n,error:i}},convertGuestToUser:async(n,i)=>{r({loading:!0});const{data:{session:l}}=await Un.auth.getSession(),o=l?.user?.id,{data:u,error:f}=await Un.auth.updateUser({email:n,password:i});if(f){if(f.message.includes("already registered")||f.message.includes("unique constraint")||f.status===422){console.log("Email exists. Attempting to link/merge account...");const{data:h,error:m}=await Un.auth.signInWithPassword({email:n,password:i});if(m)throw r({loading:!1}),new Error("El usuario ya existe y la contraseña es incorrecta.");if(h.user&&o){console.log(`Merging data from ${o} to ${h.user.id}`);const{error:p}=await Un.from("projects").update({user_id:h.user.id}).eq("user_id",o);p&&console.warn("Project merge warning:",p);const{error:g}=await Un.from("runs").update({user_id:h.user.id}).eq("user_id",o);g&&console.warn("Run merge warning:",g)}return r({user:h.user,loading:!1}),{data:h,error:null}}return r({loading:!1}),{data:u,error:f}}return r({user:u.user,loading:!1}),{data:u,error:f}},signOut:async()=>{await Un.auth.signOut(),r({user:null})}})),Ti=U.forwardRef(({hoverable:r,style:n,children:i,...l},o)=>B.jsx("div",{ref:o,style:{backgroundColor:"var(--bg-panel)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:"var(--space-4)",transition:"transform 0.2s, border-color 0.2s, box-shadow 0.2s",cursor:r?"pointer":"default",...n},onMouseEnter:u=>{r&&(u.currentTarget.style.transform="translateY(-2px)",u.currentTarget.style.borderColor="var(--border-focus)",u.currentTarget.style.boxShadow="var(--shadow-md)")},onMouseLeave:u=>{r&&(u.currentTarget.style.transform="translateY(0)",u.currentTarget.style.borderColor="var(--border-subtle)",u.currentTarget.style.boxShadow="none")},...l,children:i}));Ti.displayName="Card";const Rr=U.forwardRef(({label:r,error:n,fullWidth:i=!0,style:l,...o},u)=>B.jsxs("div",{style:{display:"flex",flexDirection:"column",width:i?"100%":"auto"},children:[r&&B.jsx("label",{style:{marginBottom:"var(--space-1)",fontSize:"0.875rem",fontWeight:500,color:"var(--text-secondary)"},children:r}),B.jsx("input",{ref:u,style:{width:"100%",padding:"var(--space-2) var(--space-3)",backgroundColor:"var(--bg-app)",border:n?"1px solid var(--error)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",color:"var(--text-primary)",fontSize:"1rem",outline:"none",transition:"border-color 0.2s",...l},onFocus:f=>{n||(f.currentTarget.style.borderColor="var(--border-focus)")},onBlur:f=>{n||(f.currentTarget.style.borderColor="var(--border-subtle)")},...o}),n&&B.jsx("span",{style:{color:"var(--error)",fontSize:"0.8rem",marginTop:"4px"},children:n})]}));Rr.displayName="Input";const Or=U.forwardRef(({className:r,variant:n="primary",size:i="md",fullWidth:l=!1,style:o,...u},f)=>{let h="var(--accent-primary)",m="var(--accent-text)",p="none",g="var(--space-2) var(--space-4)",v="1rem";n==="secondary"?(h="var(--bg-element)",m="var(--text-primary)"):n==="outline"?(h="transparent",p="1px solid var(--border-subtle)",m="var(--text-primary)"):n==="ghost"?(h="transparent",m="var(--text-secondary)"):n==="danger"&&(h="transparent",m="var(--error)",p="1px solid var(--error)"),i==="sm"?(g="var(--space-1) var(--space-3)",v="0.875rem"):i==="lg"&&(g="var(--space-3) var(--space-5)",v="1.125rem");const w={display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-md)",fontWeight:500,cursor:u.disabled?"not-allowed":"pointer",opacity:u.disabled?.6:1,transition:"all 0.2s ease",backgroundColor:h,color:m,border:p,padding:g,fontSize:v,width:l?"100%":"auto",...o};return B.jsx("button",{ref:f,style:w,onMouseEnter:_=>{!u.disabled&&n==="primary"&&(_.currentTarget.style.backgroundColor="var(--accent-primary-hover)"),!u.disabled&&n==="outline"&&(_.currentTarget.style.borderColor="var(--border-focus)")},onMouseLeave:_=>{!u.disabled&&n==="primary"&&(_.currentTarget.style.backgroundColor="var(--accent-primary)"),!u.disabled&&n==="outline"&&(_.currentTarget.style.borderColor="var(--border-subtle)")},...u})});Or.displayName="Button";function wn(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Pf(r,n){return Pf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},Pf(r,n)}function i1(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,Pf(r,n)}var l1=Object.defineProperty,s1=Object.defineProperties,o1=Object.getOwnPropertyDescriptors,ko=Object.getOwnPropertySymbols,qv=Object.prototype.hasOwnProperty,$v=Object.prototype.propertyIsEnumerable,Vf=(r,n,i)=>n in r?l1(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i,ln=(r,n)=>{for(var i in n||(n={}))qv.call(n,i)&&Vf(r,i,n[i]);if(ko)for(var i of ko(n))$v.call(n,i)&&Vf(r,i,n[i]);return r},Pv=(r,n)=>s1(r,o1(n)),u1=(r,n)=>{var i={};for(var l in r)qv.call(r,l)&&n.indexOf(l)<0&&(i[l]=r[l]);if(r!=null&&ko)for(var l of ko(r))n.indexOf(l)<0&&$v.call(r,l)&&(i[l]=r[l]);return i},Rt=(r,n,i)=>(Vf(r,typeof n!="symbol"?n+"":n,i),i),Ri=(r,n,i)=>new Promise((l,o)=>{var u=m=>{try{h(i.next(m))}catch(p){o(p)}},f=m=>{try{h(i.throw(m))}catch(p){o(p)}},h=m=>m.done?l(m.value):Promise.resolve(m.value).then(u,f);h((i=i.apply(r,n)).next())}),c1="hCaptcha-script",Ao="hCaptchaOnLoad",cg="script-error",Pa="@hCaptcha/loader";function f1(r){return Object.entries(r).filter(([,n])=>n||n===!1).map(([n,i])=>`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`).join("&")}function Vv(r){let n=r&&r.ownerDocument||document,i=n.defaultView||n.parentWindow||window;return{document:n,window:i}}function Gv(r){return r||document.head}function d1(r){var n;r.setTag("source",Pa),r.setTag("url",document.URL),r.setContext("os",{UA:navigator.userAgent}),r.setContext("browser",ln({},h1())),r.setContext("device",Pv(ln({},p1()),{screen_width_pixels:screen.width,screen_height_pixels:screen.height,language:navigator.language,orientation:((n=screen.orientation)==null?void 0:n.type)||"Unknown",processor_count:navigator.hardwareConcurrency,platform:navigator.platform}))}function h1(){var r,n,i,l,o,u;let f=navigator.userAgent,h,m;return f.indexOf("Firefox")!==-1?(h="Firefox",m=(r=f.match(/Firefox\/([\d.]+)/))==null?void 0:r[1]):f.indexOf("Edg")!==-1?(h="Microsoft Edge",m=(n=f.match(/Edg\/([\d.]+)/))==null?void 0:n[1]):f.indexOf("Chrome")!==-1&&f.indexOf("Safari")!==-1?(h="Chrome",m=(i=f.match(/Chrome\/([\d.]+)/))==null?void 0:i[1]):f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1?(h="Safari",m=(l=f.match(/Version\/([\d.]+)/))==null?void 0:l[1]):f.indexOf("Opera")!==-1||f.indexOf("OPR")!==-1?(h="Opera",m=(o=f.match(/(Opera|OPR)\/([\d.]+)/))==null?void 0:o[2]):f.indexOf("MSIE")!==-1||f.indexOf("Trident")!==-1?(h="Internet Explorer",m=(u=f.match(/(MSIE |rv:)([\d.]+)/))==null?void 0:u[2]):(h="Unknown",m="Unknown"),{name:h,version:m}}function m1(r){return new Promise(n=>setTimeout(n,r))}function p1(){let r=navigator.userAgent,n;r.indexOf("Win")!==-1?n="Windows":r.indexOf("Mac")!==-1?n="Mac":r.indexOf("Linux")!==-1?n="Linux":r.indexOf("Android")!==-1?n="Android":r.indexOf("like Mac")!==-1||r.indexOf("iPhone")!==-1||r.indexOf("iPad")!==-1?n="iOS":n="Unknown";let i;return/Mobile|iPhone|iPod|Android/i.test(r)?i="Mobile":/Tablet|iPad/i.test(r)?i="Tablet":i="Desktop",{model:n,family:n,device:i}}var y1=class Yv{constructor(n){Rt(this,"_parent"),Rt(this,"breadcrumbs",[]),Rt(this,"context",{}),Rt(this,"extra",{}),Rt(this,"tags",{}),Rt(this,"request"),Rt(this,"user"),this._parent=n}get parent(){return this._parent}child(){return new Yv(this)}setRequest(n){return this.request=n,this}removeRequest(){return this.request=void 0,this}addBreadcrumb(n){return typeof n.timestamp>"u"&&(n.timestamp=new Date().toISOString()),this.breadcrumbs.push(n),this}setExtra(n,i){return this.extra[n]=i,this}removeExtra(n){return delete this.extra[n],this}setContext(n,i){return typeof i.type>"u"&&(i.type=n),this.context[n]=i,this}removeContext(n){return delete this.context[n],this}setTags(n){return this.tags=ln(ln({},this.tags),n),this}setTag(n,i){return this.tags[n]=i,this}removeTag(n){return delete this.tags[n],this}setUser(n){return this.user=n,this}removeUser(){return this.user=void 0,this}toBody(){let n=[],i=this;for(;i;)n.push(i),i=i.parent;return n.reverse().reduce((l,o)=>{var u;return l.breadcrumbs=[...(u=l.breadcrumbs)!=null?u:[],...o.breadcrumbs],l.extra=ln(ln({},l.extra),o.extra),l.contexts=ln(ln({},l.contexts),o.context),l.tags=ln(ln({},l.tags),o.tags),o.user&&(l.user=o.user),o.request&&(l.request=o.request),l},{breadcrumbs:[],extra:{},contexts:{},tags:{},request:void 0,user:void 0})}clear(){this.breadcrumbs=[],this.context={},this.tags={},this.user=void 0}},g1=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,v1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,b1=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,_1=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,So="?",fg="An unknown error occurred",w1="0.0.4";function S1(r){for(let n=0;n<r.length;n++)r[n]=Math.floor(Math.random()*256);return r}function kt(r){return(r+256).toString(16).substring(1)}function E1(){let r=S1(new Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,kt(r[0])+kt(r[1])+kt(r[2])+kt(r[3])+"-"+kt(r[4])+kt(r[5])+"-"+kt(r[6])+kt(r[7])+"-"+kt(r[8])+kt(r[9])+"-"+kt(r[10])+kt(r[11])+kt(r[12])+kt(r[13])+kt(r[14])+kt(r[15])}var T1=[[g1,"chrome"],[b1,"winjs"],[v1,"gecko"]];function O1(r){var n,i,l,o;if(!r.stack)return null;let u=[],f=(l=(i=(n=r.stack).split)==null?void 0:i.call(n,`
|
|
55
|
+
`))!=null?l:[];for(let h=0;h<f.length;++h){let m=null,p=null,g=null;for(let[v,w]of T1)if(p=v.exec(f[h]),p){g=w;break}if(!(!p||!g)){if(g==="chrome")m={filename:(o=p[2])!=null&&o.startsWith("address at ")?p[2].substring(11):p[2],function:p[1]||So,lineno:p[3]?+p[3]:null,colno:p[4]?+p[4]:null};else if(g==="winjs")m={filename:p[2],function:p[1]||So,lineno:+p[3],colno:p[4]?+p[4]:null};else if(g==="gecko")h===0&&!p[5]&&r.columnNumber!==void 0&&u.length>0&&(u[0].column=r.columnNumber+1),m={filename:p[3],function:p[1]||So,lineno:p[4]?+p[4]:null,colno:p[5]?+p[5]:null};else continue;!m.function&&m.lineno&&(m.function=So),u.push(m)}}return u.length?u.reverse():null}function R1(r){let n=O1(r);return{type:r.name,value:r.message,stacktrace:{frames:n??[]}}}function x1(r){let n=_1.exec(r),i=n?n.slice(1):[];if(i.length!==6)throw new Error("Invalid DSN");let l=i[5].split("/"),o=l.slice(0,-1).join("/");return i[0]+"://"+i[3]+(i[4]?":"+i[4]:"")+(o?"/"+o:"")+"/api/"+l.pop()+"/envelope/?sentry_version=7&sentry_key="+i[1]+(i[2]?"&sentry_secret="+i[2]:"")}function A1(r,n,i){var l,o;let u=ln({event_id:E1().replaceAll("-",""),platform:"javascript",sdk:{name:"@hcaptcha/sentry",version:w1},environment:n,release:i,timestamp:Date.now()/1e3},r.scope.toBody());if(r.type==="exception"){u.message=(o=(l=r.error)==null?void 0:l.message)!=null?o:"Unknown error",u.fingerprint=[u.message];let f=[],h=r.error;for(let m=0;m<5&&h&&(f.push(R1(h)),!(!h.cause||!(h.cause instanceof Error)));m++)h=h.cause;u.exception={values:f.reverse()}}return r.type==="message"&&(u.message=r.message,u.level=r.level),u}function C1(r){if(r instanceof Error)return r;if(typeof r=="string")return new Error(r);if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let i=r,{message:l}=i,o=u1(i,["message"]),u=new Error(typeof l=="string"?l:fg);return Object.assign(u,o)}let n=new Error(fg);return Object.assign(n,{cause:r})}function j1(r,n,i){return Ri(this,null,function*(){var l,o;try{if(typeof fetch<"u"&&typeof AbortSignal<"u"){let u;if(i){let m=new AbortController;u=m.signal,setTimeout(()=>m.abort(),i)}let f=yield fetch(r,Pv(ln({},n),{signal:u})),h=yield f.text();return{status:f.status,body:h}}return yield new Promise((u,f)=>{var h,m;let p=new XMLHttpRequest;if(p.open((h=n?.method)!=null?h:"GET",r),p.onload=()=>u({status:p.status,body:p.responseText}),p.onerror=()=>f(new Error("XHR Network Error")),n?.headers)for(let[g,v]of Object.entries(n.headers))p.setRequestHeader(g,v);if(i){let g=setTimeout(()=>{p.abort(),f(new Error("Request timed out"))},i);p.onloadend=()=>{clearTimeout(g)}}p.send((m=n?.body)==null?void 0:m.toString())})}catch(u){return{status:0,body:(o=(l=u?.toString)==null?void 0:l.call(u))!=null?o:"Unknown error"}}})}var Kt,Gf=(Kt=class{constructor(r){Rt(this,"apiURL"),Rt(this,"dsn"),Rt(this,"environment"),Rt(this,"release"),Rt(this,"sampleRate"),Rt(this,"debug"),Rt(this,"_scope"),Rt(this,"shouldBuffer",!1),Rt(this,"bufferlimit",20),Rt(this,"buffer",[]);var n,i,l,o,u;this.environment=r.environment,this.release=r.release,this.sampleRate=(n=r.sampleRate)!=null?n:1,this.debug=(i=r.debug)!=null?i:!1,this._scope=(l=r.scope)!=null?l:new y1,this.apiURL=x1(r.dsn),this.dsn=r.dsn,this.shouldBuffer=(o=r.buffer)!=null?o:!1,this.bufferlimit=(u=r.bufferLimit)!=null?u:20}static init(r){Kt._instance||(Kt._instance=new Kt(r))}static get instance(){if(!Kt._instance)throw new Error("Sentry has not been initialized");return Kt._instance}log(...r){this.debug&&console.log(...r)}get scope(){return this._scope}static get scope(){return Kt.instance.scope}withScope(r){let n=this._scope.child();r(n)}static withScope(r){Kt.instance.withScope(r)}captureException(r,n){this.captureEvent({type:"exception",level:"error",error:C1(r),scope:n??this._scope})}static captureException(r,n){Kt.instance.captureException(r,n)}captureMessage(r,n="info",i){this.captureEvent({type:"message",level:n,message:r,scope:i??this._scope})}static captureMessage(r,n="info",i){Kt.instance.captureMessage(r,n,i)}captureEvent(r){if(Math.random()>=this.sampleRate){this.log("Dropped event due to sample rate");return}if(this.shouldBuffer){if(this.buffer.length>=this.bufferlimit)return;this.buffer.push(r)}else this.sendEvent(r)}sendEvent(r,n=5e3){return Ri(this,null,function*(){try{this.log("Sending sentry event",r);let i=A1(r,this.environment,this.release),l={event_id:i.event_id,dsn:this.dsn},o={type:"event"},u=JSON.stringify(l)+`
|
|
56
|
+
`+JSON.stringify(o)+`
|
|
57
|
+
`+JSON.stringify(i),f=yield j1(this.apiURL,{method:"POST",headers:{"Content-Type":"application/x-sentry-envelope"},body:u},n);this.log("Sentry response",f.status),f.status!==200&&(console.log(f.body),console.error("Failed to send event to Sentry",f))}catch(i){console.error("Failed to send event",i)}})}flush(r=5e3){return Ri(this,null,function*(){try{this.log("Flushing sentry events",this.buffer.length);let n=this.buffer.splice(0,this.buffer.length).map(i=>this.sendEvent(i,r));yield Promise.all(n),this.log("Flushed all events")}catch(n){console.error("Failed to flush events",n)}})}static flush(r=5e3){return Kt.instance.flush(r)}static reset(){Kt._instance=void 0}},Rt(Kt,"_instance"),Kt),D1="https://d233059272824702afc8c43834c4912d@sentry.hcaptcha.com/6",U1="2.3.0",z1="production";function M1(r=!0){if(!r)return dg();Gf.init({dsn:D1,release:U1,environment:z1});let n=Gf.scope;return d1(n),dg(n)}function dg(r=null){return{addBreadcrumb:n=>{r&&r.addBreadcrumb(n)},captureRequest:n=>{r&&r.setRequest(n)},captureException:n=>{r&&Gf.captureException(n,r)}}}function N1({scriptLocation:r,query:n,loadAsync:i=!0,crossOrigin:l="anonymous",apihost:o="https://js.hcaptcha.com",cleanup:u=!1,secureApi:f=!1,scriptSource:h=""}={},m){let p=Gv(r),g=Vv(p);return new Promise((v,w)=>{let _=g.document.createElement("script");_.id=c1,h?_.src=`${h}?onload=${Ao}`:f?_.src=`${o}/1/secure-api.js?onload=${Ao}`:_.src=`${o}/1/api.js?onload=${Ao}`,_.crossOrigin=l,_.async=i;let S=(C,R)=>{try{!f&&u&&p.removeChild(_),R(C)}catch(k){w(k)}};_.onload=C=>S(C,v),_.onerror=C=>{m&&m(_.src),S(C,w)},_.src+=n!==""?`&${n}`:"",p.appendChild(_)})}var Eo=[];function k1(r={cleanup:!1},n){try{n.addBreadcrumb({category:Pa,message:"hCaptcha loader params",data:r});let i=Gv(r.scriptLocation),l=Vv(i),o=Eo.find(({scope:f})=>f===l.window);if(o)return n.addBreadcrumb({category:Pa,message:"hCaptcha already loaded"}),o.promise;let u=new Promise((f,h)=>Ri(this,null,function*(){try{l.window[Ao]=()=>{n.addBreadcrumb({category:Pa,message:"hCaptcha script called onload function"}),f(l.window.hcaptcha)};let m=f1({custom:r.custom,render:r.render,sentry:r.sentry,assethost:r.assethost,imghost:r.imghost,reportapi:r.reportapi,endpoint:r.endpoint,host:r.host,recaptchacompat:r.recaptchacompat,hl:r.hl,uj:r.uj});yield N1(ln({query:m},r),p=>{n.captureRequest({url:p,method:"GET"})}),n.addBreadcrumb({category:Pa,message:"hCaptcha loaded",data:o})}catch{n.addBreadcrumb({category:Pa,message:"hCaptcha failed to load"});let p=Eo.findIndex(g=>g.scope===l.window);p!==-1&&Eo.splice(p,1),h(new Error(cg))}}));return Eo.push({promise:u,scope:l.window}),u}catch(i){return n.captureException(i),Promise.reject(new Error(cg))}}function Iv(r,n,i=0){return Ri(this,null,function*(){var l,o;let u=(l=r.maxRetries)!=null?l:2,f=(o=r.retryDelay)!=null?o:1e3,h=i<u?"Retry loading hCaptcha Api":"Exceeded maximum retries";try{return yield k1(r,n)}catch(m){return n.addBreadcrumb({category:Pa,message:h}),i>=u?(n.captureException(m),Promise.reject(m)):(n.addBreadcrumb({category:Pa,message:`Waiting ${f}ms before retry attempt ${i+1}`}),yield m1(f),i+=1,Iv(r,n,i))}})}function L1(){return Ri(this,arguments,function*(r={}){let n=M1(r.sentry);return yield Iv(r,n)})}function hg(r){var n=r&&r.ownerDocument||document,i=n.defaultView||n.parentWindow||window;return{document:n,window:i}}function mg(r){return r||document.head}var B1=(function(r){i1(n,r);function n(l){var o;return o=r.call(this,l)||this,o._hcaptcha=void 0,o.renderCaptcha=o.renderCaptcha.bind(wn(o)),o.resetCaptcha=o.resetCaptcha.bind(wn(o)),o.removeCaptcha=o.removeCaptcha.bind(wn(o)),o.isReady=o.isReady.bind(wn(o)),o._onReady=null,o.loadCaptcha=o.loadCaptcha.bind(wn(o)),o.handleOnLoad=o.handleOnLoad.bind(wn(o)),o.handleSubmit=o.handleSubmit.bind(wn(o)),o.handleExpire=o.handleExpire.bind(wn(o)),o.handleError=o.handleError.bind(wn(o)),o.handleOpen=o.handleOpen.bind(wn(o)),o.handleClose=o.handleClose.bind(wn(o)),o.handleChallengeExpired=o.handleChallengeExpired.bind(wn(o)),o.ref=U.createRef(),o.apiScriptRequested=!1,o.sentryHub=null,o.captchaId="",o._pendingExecute=null,o.state={isApiReady:!1,isRemoved:!1,elementId:l.id},o}var i=n.prototype;return i.componentDidMount=function(){var o=this,u=mg(this.props.scriptLocation),f=hg(u);this._hcaptcha=f.window.hcaptcha||void 0;var h=typeof this._hcaptcha<"u";if(h){this.setState({isApiReady:!0},function(){o.renderCaptcha()});return}this.loadCaptcha()},i.componentWillUnmount=function(){var o=this._hcaptcha,u=this.captchaId;this._cancelPendingExecute("react-component-unmounted"),this.isReady()&&(o.reset(u),o.remove(u))},i.shouldComponentUpdate=function(o,u){return!(this.state.isApiReady!==u.isApiReady||this.state.isRemoved!==u.isRemoved)},i.componentDidUpdate=function(o){var u=this,f=["sitekey","size","theme","tabindex","languageOverride","endpoint"],h=f.every(function(m){return o[m]===u.props[m]});h||this.removeCaptcha(function(){u.renderCaptcha()})},i.loadCaptcha=function(){if(!this.apiScriptRequested){var o=this.props,u=o.apihost,f=o.assethost,h=o.endpoint,m=o.host,p=o.imghost,g=o.languageOverride,v=o.reCaptchaCompat,w=o.reportapi,_=o.sentry,S=o.custom,C=o.loadAsync,R=o.scriptLocation,k=o.scriptSource,q=o.secureApi,$=o.cleanup,Z=$===void 0?!0:$,ne=o.userJourneys,le={render:"explicit",apihost:u,assethost:f,endpoint:h,hl:g,host:m,imghost:p,recaptchacompat:v===!1?"off":null,reportapi:w,sentry:_,custom:S,loadAsync:C,scriptLocation:R,scriptSource:k,secureApi:q,cleanup:Z,uj:ne!==void 0?ne:!1};L1(le).then(this.handleOnLoad,this.handleError).catch(this.handleError),this.apiScriptRequested=!0}},i.renderCaptcha=function(o){var u=this,f=this.props.onReady,h=this.state.isApiReady,m=this.captchaId;if(!(!h||m)){var p=Object.assign({"open-callback":this.handleOpen,"close-callback":this.handleClose,"error-callback":this.handleError,"chalexpired-callback":this.handleChallengeExpired,"expired-callback":this.handleExpire,callback:this.handleSubmit},this.props,{hl:this.props.hl||this.props.languageOverride,languageOverride:void 0}),g=this._hcaptcha,v=g.render(this.ref.current,p);this.captchaId=v,this.setState({isRemoved:!1},function(){o&&o(),f&&f(),u._onReady&&u._onReady(v)})}},i.resetCaptcha=function(){var o=this._hcaptcha,u=this.captchaId;this.isReady()&&(o.reset(u),this._cancelPendingExecute("hcaptcha-reset"))},i.removeCaptcha=function(o){var u=this,f=this._hcaptcha,h=this.captchaId;this._cancelPendingExecute("hcaptcha-removed"),this.isReady()&&this.setState({isRemoved:!0},function(){u.captchaId="",f.remove(h),o&&o()})},i.handleOnLoad=function(){var o=this;this.setState({isApiReady:!0},function(){var u=mg(o.props.scriptLocation),f=hg(u);o._hcaptcha=f.window.hcaptcha,o.renderCaptcha(function(){var h=o.props.onLoad;h&&h()})})},i.handleSubmit=function(o){var u=this.props.onVerify,f=this.state.isRemoved,h=this._hcaptcha,m=this.captchaId;if(!(typeof h>"u"||f)){var p=h.getResponse(m),g=h.getRespKey(m);u&&u(p,g)}},i.handleExpire=function(){var o=this.props.onExpire,u=this._hcaptcha,f=this.captchaId;this.isReady()&&(u.reset(f),o&&o())},i.handleError=function(o){var u=this.props.onError,f=this._hcaptcha,h=this.captchaId;this.isReady()&&f.reset(h),u&&u(o)},i.isReady=function(){var o=this.state,u=o.isApiReady,f=o.isRemoved;return u&&!f},i._cancelPendingExecute=function(o){if(this._pendingExecute){var u=this._pendingExecute;this._pendingExecute=null;var f=new Error(o);u.reject(f)}},i.handleOpen=function(){!this.isReady()||!this.props.onOpen||this.props.onOpen()},i.handleClose=function(){!this.isReady()||!this.props.onClose||this.props.onClose()},i.handleChallengeExpired=function(){!this.isReady()||!this.props.onChalExpired||this.props.onChalExpired()},i.execute=function(o){var u=this;o===void 0&&(o=null),o=typeof o=="object"?o:null;try{var f=this._hcaptcha,h=this.captchaId;if(o&&o.async&&this._pendingExecute&&this._cancelPendingExecute("hcaptcha-execute-replaced"),!this.isReady())return o&&o.async?new Promise(function(p,g){u._pendingExecute={resolve:p,reject:g},u._onReady=function(v){if(u._pendingExecute)try{var w=f.execute(v,o);w&&typeof w.then=="function"?w.then(function(_){u._pendingExecute=null,p(_)}).catch(function(_){u._pendingExecute=null,g(_)}):(u._pendingExecute=null,g(new Error("hcaptcha-execute-no-promise")))}catch(_){u._pendingExecute=null,g(_)}}}):(this._onReady=function(p){f.execute(p,o)},null);var m=f.execute(h,o);return o&&o.async&&m&&typeof m.then=="function"?new Promise(function(p,g){u._pendingExecute={resolve:p,reject:g},m.then(function(v){u._pendingExecute=null,p(v)}).catch(function(v){u._pendingExecute=null,g(v)})}):m}catch(p){return o&&o.async?Promise.reject(p):null}},i.close=function(){var o=this._hcaptcha,u=this.captchaId;if(this._cancelPendingExecute("hcaptcha-closed"),!!this.isReady())return o.close(u)},i.setData=function(o){var u=this._hcaptcha,f=this.captchaId;this.isReady()&&(o&&typeof o!="object"&&(o=null),u.setData(f,o))},i.getResponse=function(){var o=this._hcaptcha;return o.getResponse(this.captchaId)},i.getRespKey=function(){var o=this._hcaptcha;return o.getRespKey(this.captchaId)},i.render=function(){var o=this.state.elementId;return U.createElement("div",{ref:this.ref,id:o})},n})(U.Component);function H1(){const r=Hg(),{signIn:n,signUp:i,loading:l}=fd(),[o,u]=U.useState(!1),[f,h]=U.useState(""),[m,p]=U.useState(""),[g,v]=U.useState(""),[w,_]=U.useState(""),S=async C=>{if(C.preventDefault(),v(""),!f||!m){v("Por favor completá todos los campos.");return}try{if(o){if(!w){v("Por favor completá el CAPTCHA.");return}const{error:R}=await i(f,m,w);if(R)throw R;r("/projects")}else{const{error:R}=await n(f,m);if(R)throw R;r("/projects")}}catch(R){v(R.message||"Ocurrió un error inesperado.")}};return B.jsx("div",{style:{width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-app)",color:"var(--text-primary)"},children:B.jsxs(Ti,{style:{width:"100%",maxWidth:"400px",textAlign:"center",boxShadow:"var(--shadow-lg)"},children:[B.jsxs("div",{style:{marginBottom:"2rem"},children:[B.jsx("h1",{style:{fontSize:"2rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"2px",margin:0},children:"WADI"}),B.jsx("p",{style:{color:"var(--text-secondary)",marginTop:"0.5rem"},children:o?"Creá tu cuenta":"Bienvenido de nuevo"})]}),g&&B.jsx("div",{style:{background:"rgba(255, 80, 80, 0.1)",border:"1px solid rgba(255, 80, 80, 0.3)",color:"#ff6b6b",padding:"10px",borderRadius:"8px",marginBottom:"1rem",fontSize:"0.9rem"},children:g}),B.jsxs("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[B.jsx(Rr,{label:"Email",type:"email",value:f,onChange:C=>h(C.target.value),placeholder:"nombre@ejemplo.com"}),B.jsx(Rr,{label:"Contraseña",type:"password",value:m,onChange:C=>p(C.target.value),placeholder:"••••••••"}),o&&B.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:"1rem"},children:B.jsx(B1,{sitekey:"10000000-ffff-ffff-ffff-000000000001",onVerify:C=>_(C)})}),B.jsx(Or,{type:"submit",disabled:l,fullWidth:!0,style:{marginTop:"1rem"},children:l?"Procesando...":o?"Registrarse":"Continuar"})]}),B.jsxs("div",{style:{marginTop:"1.5rem",fontSize:"0.9rem",color:"var(--text-secondary)"},children:[o?"¿Ya tenés cuenta? ":"¿No tenés cuenta? ",B.jsx("button",{type:"button",onClick:()=>{u(!o),v(""),_("")},style:{background:"none",border:"none",color:"var(--accent-primary)",fontWeight:600,cursor:"pointer",padding:0},children:o?"Iniciar Sesión":"Registrate"})]})]})})}const pg="https://wadi-wxg7.onrender.com/api",q1=cd(r=>({projects:[],loading:!1,fetchProjects:async()=>{r({loading:!0});try{const n=await fetch(`${pg}/api/projects`);if(!n.ok)throw new Error(`Error: ${n.status}`);const i=n.headers.get("content-type");if(!i||!i.includes("application/json"))throw new Error("Respuesta inválida del servidor (no es JSON)");const l=await n.json();r({projects:l,loading:!1})}catch(n){console.error("Failed to fetch projects",n),r({loading:!1})}},createProject:async(n,i)=>{try{const l=await fetch(`${pg}/api/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n,description:i})});if(!l.ok){let f=`Error: ${l.status}`;try{const h=await l.json();h.message&&(f=h.message)}catch{}throw new Error(f)}const o=l.headers.get("content-type");if(!o||!o.includes("application/json"))throw new Error("El servidor devolvió un error inesperado (HTML).");const u=await l.json();r(f=>({projects:[u,...f.projects]}))}catch(l){throw console.error("Failed to create project",l),l}}}));function $1(){const[r,n]=U.useState(()=>localStorage.getItem("theme")||"dark");U.useEffect(()=>{document.documentElement.setAttribute("data-theme",r),localStorage.setItem("theme",r)},[r]);const i=()=>{n(l=>l==="dark"?"light":"dark")};return B.jsx("button",{onClick:i,"aria-label":"Toggle Theme",style:{padding:"0.5rem",borderRadius:"var(--radius-md)",color:"var(--text-secondary)"},children:r==="dark"?"☀️ Light":"🌙 Dark"})}const Kv=({isOpen:r,onClose:n,title:i,children:l})=>r?Ig.createPortal(B.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100,backdropFilter:"blur(4px)"},onClick:n,children:B.jsxs(Ti,{style:{width:"100%",maxWidth:"480px",transform:"none",cursor:"default",boxShadow:"var(--shadow-lg)"},onClick:o=>o.stopPropagation(),children:[i&&B.jsx("h3",{style:{marginBottom:"var(--space-4)",fontSize:"1.25rem"},children:i}),l]})}),document.body):null;function P1(){const r=Ya(),{user:n,convertGuestToUser:i,signOut:l}=fd(),o=n?.is_anonymous,[u,f]=U.useState(!1),[h,m]=U.useState(""),[p,g]=U.useState(""),[v,w]=U.useState(!1),_=R=>r.pathname===R,S=[{label:"Dashboard",path:"/projects"}],C=async R=>{R.preventDefault(),w(!0);try{const{error:k}=await i(h,p);if(k)throw k;f(!1)}catch(k){alert(k.message)}finally{w(!1)}};return B.jsxs("aside",{style:{width:"260px",height:"100vh",backgroundColor:"var(--bg-panel)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",padding:"var(--space-4)"},children:[B.jsxs("div",{style:{marginBottom:"var(--space-6)"},children:[B.jsx("h2",{style:{fontSize:"1.25rem",color:"var(--accent-primary)"},children:"WADI"}),B.jsx("small",{children:"Agentic Workspace"})]}),B.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-3)",marginBottom:"var(--space-4)"},children:B.jsxs(Ll,{to:"/projects",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--space-2)",backgroundColor:"var(--accent-primary)",color:"var(--accent-text)",padding:"var(--space-2)",borderRadius:"var(--radius-md)",fontWeight:500,textDecoration:"none"},children:[B.jsx("span",{children:"+"})," Nueva Conversación"]})}),B.jsxs("nav",{style:{flex:1,display:"flex",flexDirection:"column",gap:"var(--space-1)",overflowY:"auto"},children:[B.jsx("div",{style:{fontSize:"0.75rem",textTransform:"uppercase",color:"var(--text-tertiary)",marginBottom:"var(--space-2)",marginTop:"var(--space-2)"},children:"Historial"}),S.map(R=>B.jsx(Ll,{to:R.path,style:{padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-md)",backgroundColor:_(R.path)?"var(--bg-element)":"transparent",color:_(R.path)?"var(--text-primary)":"var(--text-secondary)",transition:"background-color 0.2s",display:"flex",alignItems:"center",gap:"var(--space-2)",textDecoration:"none"},children:"Punto de Control"},R.path))]}),B.jsxs("div",{style:{marginTop:"auto",borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--space-4)",display:"flex",flexDirection:"column",gap:"var(--space-4)"},children:[B.jsx($1,{}),o?B.jsxs("div",{style:{backgroundColor:"var(--bg-element)",padding:"var(--space-3)",borderRadius:"var(--radius-md)"},children:[B.jsx("p",{style:{fontSize:"0.85rem",color:"var(--text-secondary)",marginBottom:"var(--space-2)"},children:"Modo Invitado"}),B.jsx(Or,{variant:"outline",size:"sm",fullWidth:!0,onClick:()=>f(!0),style:{fontSize:"0.8rem"},children:"☁️ Guardar mis chats"})]}):B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",justifyContent:"space-between"},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[B.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"var(--accent-primary)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.875rem",fontWeight:"bold"},children:n?.email?.charAt(0).toUpperCase()||"U"}),B.jsx("div",{style:{display:"flex",flexDirection:"column",maxWidth:"120px"},children:B.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?.email})})]}),B.jsx("button",{onClick:()=>l(),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--text-tertiary)",fontSize:"1.2rem"},title:"Cerrar sesión",children:"⏏️"})]})]}),B.jsxs(Kv,{isOpen:u,onClose:()=>f(!1),title:"Guardar Cuenta",children:[B.jsx("p",{style:{fontSize:"0.9rem",color:"var(--text-secondary)",marginBottom:"1rem"},children:"Registrate para no perder tus chats y acceder desde cualquier dispositivo."}),B.jsxs("form",{onSubmit:C,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[B.jsx(Rr,{label:"Email",type:"email",value:h,onChange:R=>m(R.target.value),required:!0}),B.jsx(Rr,{label:"Contraseña",type:"password",value:p,onChange:R=>g(R.target.value),required:!0}),B.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[B.jsx(Or,{type:"button",variant:"ghost",onClick:()=>f(!1),children:"Cancelar"}),B.jsx(Or,{type:"submit",disabled:v,children:v?"Guardando...":"Crear Cuenta"})]})]})]})]})}function Jv({children:r}){return B.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",overflow:"hidden"},children:[B.jsx(P1,{}),B.jsx("main",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"var(--bg-app)",overflow:"hidden",position:"relative"},children:r})]})}function yg(){const{projects:r,fetchProjects:n,createProject:i,loading:l}=q1(),[o,u]=U.useState(""),[f,h]=U.useState(""),[m,p]=U.useState(!1),[g,v]=U.useState("");U.useEffect(()=>{n()},[n]);const w=async S=>{if(S.preventDefault(),!o.trim()){v("El nombre es obligatorio");return}v("");try{await i(o,f),u(""),h(""),p(!1)}catch(C){console.error("Error creating project:",C)}},_=()=>{v(""),p(!0)};return B.jsx(Jv,{children:B.jsxs("div",{style:{width:"100%",maxWidth:"900px",margin:"0 auto",padding:"var(--space-6) var(--space-4)"},children:[B.jsx("header",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"var(--space-8)"}}),B.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--space-10)"},children:[B.jsx("div",{style:{width:"64px",height:"64px",backgroundColor:"var(--bg-element)",borderRadius:"50%",margin:"0 auto var(--space-4)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2rem"},children:"🚀"}),B.jsx("h1",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"var(--space-2)"},children:"Punto de Control"}),B.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"1.1rem"},children:"¿En qué trabajamos hoy?"})]}),B.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"var(--space-4)",marginBottom:"var(--space-10)"},children:[B.jsxs(Ti,{hoverable:!0,onClick:_,style:{display:"flex",flexDirection:"column",gap:"var(--space-2)",alignItems:"flex-start",textAlign:"left"},children:[B.jsx("div",{style:{color:"var(--accent-primary)",fontSize:"1.5rem"},children:"✨"}),B.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:"Crear nuevo proyecto"}),B.jsx("span",{style:{fontSize:"0.9rem",color:"var(--text-tertiary)",lineHeight:1.4},children:"Inicia una nueva sesión de trabajo desde cero."})]}),B.jsxs(Ti,{style:{display:"flex",flexDirection:"column",gap:"var(--space-2)",opacity:.7},children:[B.jsx("div",{style:{color:"var(--success)",fontSize:"1.5rem"},children:"📚"}),B.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:"Explorar recursos"}),B.jsx("span",{style:{fontSize:"0.9rem",color:"var(--text-tertiary)",lineHeight:1.4},children:"Documentación y guías (Próximamente)."})]})]}),B.jsxs("div",{children:[B.jsx("h3",{style:{fontSize:"1rem",fontWeight:600,color:"var(--text-secondary)",marginBottom:"var(--space-4)",textTransform:"uppercase",letterSpacing:"1px"},children:"Recientes"}),l&&B.jsx("p",{style:{color:"var(--text-tertiary)"},children:"Cargando..."}),B.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[r.map(S=>B.jsx(Ll,{to:`/projects/${S.id}`,style:{textDecoration:"none"},children:B.jsxs(Ti,{hoverable:!0,style:{padding:"var(--space-3) var(--space-4)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)"},children:[B.jsx("span",{style:{fontSize:"1.2rem"},children:"📄"}),B.jsxs("div",{children:[B.jsx("div",{style:{fontWeight:500,color:"var(--text-primary)"},children:S.name}),S.description&&B.jsx("div",{style:{fontSize:"0.85rem",color:"var(--text-tertiary)"},children:S.description})]})]}),B.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-tertiary)"},children:new Date(S.created_at).toLocaleDateString()})]})},S.id)),r.length===0&&!l&&B.jsx("p",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:"No hay proyectos recientes. ¡Crea el primero arriba!"})]})]}),B.jsx(Kv,{isOpen:m,onClose:()=>p(!1),title:"Nuevo Proyecto",children:B.jsxs("form",{onSubmit:w,style:{display:"flex",flexDirection:"column",gap:"var(--space-3)"},children:[B.jsx(Rr,{label:"Nombre del proyecto",placeholder:"Ej. Análisis de datos",value:o,onChange:S=>{u(S.target.value),S.target.value.trim()&&v("")},error:g,autoFocus:!0}),B.jsx(Rr,{label:"Descripción (opcional)",placeholder:"Breve descripción del objetivo",value:f,onChange:S=>h(S.target.value)}),B.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--space-2)",marginTop:"var(--space-2)"},children:[B.jsx(Or,{type:"button",variant:"ghost",onClick:()=>p(!1),children:"Cancelar"}),B.jsx(Or,{type:"submit",variant:"primary",children:"Crear"})]})]})})]})})}const V1=cd(r=>({runs:[],loading:!1,fetchRuns:async n=>{r({loading:!0});const l=await(await fetch(`https://wadi-wxg7.onrender.com/api/api/projects/${n}/runs`)).json();r({runs:l,loading:!1})},createRun:async(n,i)=>{const o=await(await fetch(`https://wadi-wxg7.onrender.com/api/api/projects/${n}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:i})})).json();r(u=>({runs:[o,...u.runs]}))}}));function G1({role:r,content:n,timestamp:i}){const l=r==="user";return B.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:l?"flex-end":"flex-start",marginBottom:"var(--space-4)",maxWidth:"80%",alignSelf:l?"flex-end":"flex-start",width:"100%"},children:[B.jsx("div",{style:{backgroundColor:l?"var(--msg-user-bg)":"var(--msg-ai-bg)",color:l?"var(--msg-user-text)":"var(--msg-ai-text)",padding:"var(--space-3) var(--space-4)",borderRadius:"var(--radius-lg)",borderBottomRightRadius:l?"2px":"var(--radius-lg)",borderBottomLeftRadius:l?"var(--radius-lg)":"2px",lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word",boxShadow:"var(--shadow-sm)"},children:n}),i&&B.jsx("small",{style:{marginTop:"var(--space-1)",marginRight:l?"var(--space-1)":0,marginLeft:l?0:"var(--space-1)",opacity:.7},children:i})]})}function Y1({onSend:r,disabled:n,placeholder:i,suggestions:l}){const[o,u]=U.useState(""),f=()=>{!o.trim()||n||(r(o),u(""))},h=m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),f())};return B.jsxs("div",{style:{padding:"var(--space-4)",borderTop:"1px solid var(--border-subtle)",backgroundColor:"var(--bg-app)",display:"flex",flexDirection:"column",gap:"var(--space-3)",position:"sticky",bottom:0,zIndex:10},children:[l&&l.length>0&&B.jsx("div",{style:{display:"flex",gap:"var(--space-2)",overflowX:"auto",paddingBottom:"var(--space-1)"},children:l.map((m,p)=>B.jsx("button",{onClick:()=>r(m),disabled:n,style:{fontSize:"0.85rem",padding:"var(--space-1) var(--space-3)",backgroundColor:"var(--bg-element)",color:"var(--text-secondary)",borderRadius:"var(--radius-full)",border:"1px solid var(--border-subtle)",whiteSpace:"nowrap"},children:m},p))}),B.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:"var(--space-2)",backgroundColor:"var(--bg-element)",padding:"var(--space-2)",borderRadius:"var(--radius-xl)",border:"1px solid var(--border-subtle)",transition:"border-color 0.2s"},onFocus:m=>m.currentTarget.style.borderColor="var(--border-focus)",onBlur:m=>m.currentTarget.style.borderColor="var(--border-subtle)",children:[B.jsx("textarea",{value:o,onChange:m=>u(m.target.value),onKeyDown:h,placeholder:i||"Type a message...",disabled:n,rows:1,style:{flex:1,resize:"none",maxHeight:"150px",minHeight:"24px",padding:"var(--space-1) var(--space-2)",background:"transparent",border:"none",outline:"none"},onInput:m=>{const p=m.target;p.style.height="auto",p.style.height=`${Math.min(p.scrollHeight,150)}px`}}),B.jsx("button",{onClick:f,disabled:!o.trim()||n,style:{padding:"var(--space-2)",borderRadius:"50%",backgroundColor:o.trim()?"var(--accent-primary)":"transparent",color:o.trim()?"white":"var(--text-tertiary)",display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",transition:"background-color 0.2s"},"aria-label":"Send",children:B.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[B.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),B.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),B.jsx("small",{style:{textAlign:"center",opacity:.5,fontSize:"0.7rem"},children:"AI can make mistakes. Please verify important information."})]})}function I1({title:r,status:n,messages:i,onSendMessage:l,isThinking:o,suggestions:u}){const f=U.useRef(null);return U.useEffect(()=>{f.current?.scrollIntoView({behavior:"smooth"})},[i,o]),B.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",maxWidth:"900px",margin:"0 auto"},children:[B.jsxs("header",{style:{padding:"var(--space-4)",borderBottom:"1px solid var(--border-subtle)",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"var(--bg-app)",zIndex:5},children:[B.jsxs("div",{children:[B.jsx("h2",{style:{fontSize:"1.1rem"},children:r||"New Conversation"}),B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)"},children:[B.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:"var(--success)"}}),B.jsx("small",{children:n||"Online"})]})]}),B.jsx("div",{className:"actions",children:B.jsx("button",{style:{padding:"var(--space-2)",color:"var(--text-secondary)"},children:B.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[B.jsx("circle",{cx:"12",cy:"12",r:"1"}),B.jsx("circle",{cx:"12",cy:"5",r:"1"}),B.jsx("circle",{cx:"12",cy:"19",r:"1"})]})})})]}),B.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"var(--space-4)",display:"flex",flexDirection:"column"},children:[i.length===0&&B.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.5,textAlign:"center"},children:[B.jsx("div",{style:{fontSize:"3rem",marginBottom:"var(--space-4)"},children:"👋"}),B.jsx("h3",{children:"Welcome to WADI"}),B.jsx("p",{children:"Start a conversation to begin."})]}),i.map(h=>B.jsx(G1,{role:h.role,content:h.content,timestamp:h.timestamp},h.id)),o&&B.jsxs("div",{className:"flex items-center gap-2",style:{padding:"var(--space-4)",opacity:.7},children:[B.jsx("div",{className:"typing-dot",style:{animation:"pulse 1s infinite"},children:"●"}),B.jsx("small",{children:"Thinking..."})]}),B.jsx("div",{ref:f})]}),B.jsx(Y1,{onSend:l,disabled:o,suggestions:u})]})}function K1(){const{id:r}=Rw(),{runs:n,fetchRuns:i,createRun:l,loading:o}=V1();U.useEffect(()=>{r&&i(r)},[r,i]);const u=async h=>{!r||!h.trim()||await l(r,h)},f=U.useMemo(()=>{const h=[];return n.slice().reverse().forEach(p=>{h.push({id:`${p.id}-user`,role:"user",content:p.input,timestamp:new Date(p.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),p.output&&h.push({id:`${p.id}-ai`,role:"assistant",content:p.output,timestamp:new Date(p.created_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})}),h},[n]);return B.jsx(Jv,{children:B.jsx(I1,{title:`Project ${r}`,status:o?"Processing...":"Ready",messages:f,onSendMessage:u,isThinking:o,suggestions:["Analyze this code","Explain the architecture","Suggest improvements","Write a test case"]})})}const To=({children:r})=>{const[n,i]=U.useState(!1),{setUser:l,loginAsGuest:o}=fd();return U.useEffect(()=>{Un.auth.getSession().then(({data:{session:f}})=>{l(f?.user||null),f?i(!0):o().then(()=>i(!0))});const{data:{subscription:u}}=Un.auth.onAuthStateChange((f,h)=>{l(h?.user||null)});return()=>u.unsubscribe()},[l,o]),n?B.jsx(B.Fragment,{children:r}):B.jsx("div",{style:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-app)",color:"var(--text-primary)"},children:"Cargando WADI..."})},J1=yS([{path:"/",element:B.jsx(To,{children:B.jsx(yg,{})})},{path:"/login",element:B.jsx(To,{children:B.jsx(H1,{})})},{path:"/projects",element:B.jsx(To,{children:B.jsx(yg,{})})},{path:"/projects/:id",element:B.jsx(To,{children:B.jsx(K1,{})})}]);f_.createRoot(document.getElementById("root")).render(B.jsx(U.StrictMode,{children:B.jsx(AS,{router:J1})}));
|