likec4 1.6.1 → 1.7.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/dist/__app__/index.html +1 -1
- package/dist/__app__/react/likec4.tsx +6 -2
- package/dist/__app__/src/chunks/IconCopy-BoSoNPZ_.js +21 -0
- package/dist/__app__/src/chunks/LikeC4Diagram-DytrE8GE.js +9769 -0
- package/dist/__app__/src/chunks/StaticLikeC4Diagram-DdbjVDqf.js +32 -0
- package/dist/__app__/src/chunks/chunk-RAAYCPUM-CpeCcSnm.js +13 -0
- package/dist/__app__/src/chunks/chunk-SGAFZVQH-F2W_It6h.js +8 -0
- package/dist/__app__/src/chunks/const-DiwrD95Q.js +6 -0
- package/dist/__app__/src/chunks/createReactComponent-BWheWDGL.js +64 -0
- package/dist/__app__/src/chunks/index-BxglQLE6.js +10 -0
- package/dist/__app__/src/chunks/index-fBIC0lf6.js +12 -0
- package/dist/__app__/src/{index-Wk755r9n.js → chunks/index-nxRBtTOQ.js} +1 -2
- package/dist/__app__/src/chunks/likec4-DiOy4PZ9.js +6451 -0
- package/dist/__app__/src/chunks/mantine-u17mT9KZ.js +12251 -0
- package/dist/__app__/src/chunks/react-resizable-panels.browser.esm-BaxT8im_.js +1528 -0
- package/dist/__app__/src/chunks/tanstack-router-Cg36mbgZ.js +2484 -0
- package/dist/__app__/src/components/ColorSchemeToggle.js +38 -0
- package/dist/__app__/src/components/CopyToClipboard.js +17 -0
- package/dist/__app__/src/components/NotFound.js +40 -0
- package/dist/__app__/src/components/RenderIcon.js +9 -0
- package/dist/__app__/src/components/sidebar/Drawer.js +186 -0
- package/dist/__app__/src/components/view-page/Header.js +416 -0
- package/dist/__app__/src/hooks.js +16 -0
- package/dist/__app__/src/main.js +5 -33875
- package/dist/__app__/src/routeTree.gen.js +57 -0
- package/dist/__app__/src/router.js +26 -0
- package/dist/__app__/src/routes/__root.js +42 -0
- package/dist/__app__/src/routes/embed._viewId.js +45 -0
- package/dist/__app__/src/routes/export._viewId.js +60 -0
- package/dist/__app__/src/routes/index.css.js +7 -0
- package/dist/__app__/src/routes/index.js +89 -0
- package/dist/__app__/src/routes/view._viewId.d2.js +53 -0
- package/dist/__app__/src/routes/view._viewId.dot.js +58 -0
- package/dist/__app__/src/routes/view._viewId.editor.js +43 -0
- package/dist/__app__/src/routes/view._viewId.index.js +39 -0
- package/dist/__app__/src/routes/view._viewId.js +173 -0
- package/dist/__app__/src/routes/view._viewId.mmd.js +102 -0
- package/dist/__app__/src/routes/view.css.js +12 -0
- package/dist/__app__/src/routes/view_viewId_.css.js +7 -0
- package/dist/__app__/src/routes/webcomponent._.js +61 -0
- package/dist/__app__/src/style.css +1 -1
- package/dist/__app__/src/theme.js +21 -0
- package/dist/__app__/tsconfig.tsbuildinfo +1 -1
- package/dist/__app__/webcomponent/webcomponent.js +831 -846
- package/dist/cli/index.mjs +296 -354
- package/icons/all.d.ts +957 -0
- package/icons/all.js +1902 -0
- package/icons/aws/activate.js +21 -8
- package/icons/aws/alexa-for-business.js +21 -8
- package/icons/aws/amplify.js +21 -8
- package/icons/aws/apache-mxnet-on-aws.js +21 -8
- package/icons/aws/api-gateway.js +21 -8
- package/icons/aws/app-config.js +21 -8
- package/icons/aws/app-flow.js +21 -8
- package/icons/aws/app-mesh.js +21 -8
- package/icons/aws/app-runner.js +21 -8
- package/icons/aws/app-stream.js +21 -8
- package/icons/aws/app-sync.js +21 -8
- package/icons/aws/application-auto-scaling.js +21 -8
- package/icons/aws/application-composer.js +21 -8
- package/icons/aws/application-cost-profiler.js +21 -8
- package/icons/aws/application-discovery-service.js +21 -8
- package/icons/aws/application-migration-service.js +21 -8
- package/icons/aws/artifact.js +21 -8
- package/icons/aws/athena.js +21 -8
- package/icons/aws/audit-manager.js +21 -8
- package/icons/aws/augmented-ai-a2i.js +21 -8
- package/icons/aws/aurora.js +21 -8
- package/icons/aws/auto-scaling.js +21 -8
- package/icons/aws/backint-agent.js +21 -8
- package/icons/aws/backup.js +21 -8
- package/icons/aws/batch.js +21 -8
- package/icons/aws/billing-conductor.js +21 -8
- package/icons/aws/bottlerocket.js +21 -8
- package/icons/aws/braket.js +21 -8
- package/icons/aws/budgets.js +21 -8
- package/icons/aws/certificate-manager.js +21 -8
- package/icons/aws/chatbot.js +21 -8
- package/icons/aws/chime-sdk.js +21 -8
- package/icons/aws/chime-voice-connector.js +21 -8
- package/icons/aws/chime.js +21 -8
- package/icons/aws/clean-rooms.js +21 -8
- package/icons/aws/client-vpn.js +21 -8
- package/icons/aws/cloud-control-api.js +21 -8
- package/icons/aws/cloud-development-kit.js +21 -8
- package/icons/aws/cloud-directory.js +21 -8
- package/icons/aws/cloud-formation.js +21 -8
- package/icons/aws/cloud-front.js +21 -8
- package/icons/aws/cloud-hsm.js +21 -8
- package/icons/aws/cloud-map.js +21 -8
- package/icons/aws/cloud-search.js +21 -8
- package/icons/aws/cloud-shell.js +21 -8
- package/icons/aws/cloud-trail.js +21 -8
- package/icons/aws/cloud-wan.js +21 -8
- package/icons/aws/cloud-watch.js +21 -8
- package/icons/aws/cloud9.js +21 -8
- package/icons/aws/code-artifact.js +21 -8
- package/icons/aws/code-build.js +21 -8
- package/icons/aws/code-catalyst.js +21 -8
- package/icons/aws/code-commit.js +21 -8
- package/icons/aws/code-deploy.js +21 -8
- package/icons/aws/code-guru.js +21 -8
- package/icons/aws/code-pipeline.js +21 -8
- package/icons/aws/code-star.js +21 -8
- package/icons/aws/code-whisperer.js +21 -8
- package/icons/aws/cognito.js +21 -8
- package/icons/aws/command-line-interface.js +21 -8
- package/icons/aws/comprehend-medical.js +21 -8
- package/icons/aws/comprehend.js +21 -8
- package/icons/aws/compute-optimizer.js +21 -8
- package/icons/aws/config.js +21 -8
- package/icons/aws/connect.js +21 -8
- package/icons/aws/console-mobile-application.js +21 -8
- package/icons/aws/control-tower.js +21 -8
- package/icons/aws/corretto.js +21 -8
- package/icons/aws/cost-and-usage-report.js +21 -8
- package/icons/aws/cost-explorer.js +21 -8
- package/icons/aws/data-exchange.js +21 -8
- package/icons/aws/data-pipeline.js +21 -8
- package/icons/aws/data-sync.js +21 -8
- package/icons/aws/data-zone.js +21 -8
- package/icons/aws/database-migration-service.js +21 -8
- package/icons/aws/deep-composer.js +21 -8
- package/icons/aws/deep-learning-amis.js +21 -8
- package/icons/aws/deep-learning-containers.js +21 -8
- package/icons/aws/deep-lens.js +21 -8
- package/icons/aws/deep-racer.js +21 -8
- package/icons/aws/detective.js +21 -8
- package/icons/aws/dev-ops-guru.js +21 -8
- package/icons/aws/device-farm.js +21 -8
- package/icons/aws/direct-connect.js +21 -8
- package/icons/aws/directory-service.js +21 -8
- package/icons/aws/distro-for-open-telemetry.js +21 -8
- package/icons/aws/document-db.js +21 -8
- package/icons/aws/dynamo-db.js +21 -8
- package/icons/aws/ec2-auto-scaling.js +21 -8
- package/icons/aws/ec2-image-builder.js +21 -8
- package/icons/aws/ec2.js +21 -8
- package/icons/aws/ecs-anywhere.js +21 -8
- package/icons/aws/efs.js +21 -8
- package/icons/aws/eks-anywhere.js +21 -8
- package/icons/aws/eks-cloud.js +21 -8
- package/icons/aws/eks-distro.js +21 -8
- package/icons/aws/elasti-cache.js +21 -8
- package/icons/aws/elastic-beanstalk.js +21 -8
- package/icons/aws/elastic-block-store.js +21 -8
- package/icons/aws/elastic-container-registry.js +21 -8
- package/icons/aws/elastic-container-service.js +21 -8
- package/icons/aws/elastic-disaster-recovery.js +21 -8
- package/icons/aws/elastic-fabric-adapter.js +21 -8
- package/icons/aws/elastic-inference.js +21 -8
- package/icons/aws/elastic-kubernetes-service.js +21 -8
- package/icons/aws/elastic-load-balancing.js +21 -8
- package/icons/aws/elastic-transcoder.js +21 -8
- package/icons/aws/elemental-appliances-software.js +21 -8
- package/icons/aws/elemental-conductor.js +21 -8
- package/icons/aws/elemental-delta.js +21 -8
- package/icons/aws/elemental-link.js +21 -8
- package/icons/aws/elemental-live.js +21 -8
- package/icons/aws/elemental-media-connect.js +21 -8
- package/icons/aws/elemental-media-convert.js +21 -8
- package/icons/aws/elemental-media-live.js +21 -8
- package/icons/aws/elemental-media-package.js +21 -8
- package/icons/aws/elemental-media-store.js +21 -8
- package/icons/aws/elemental-media-tailor.js +21 -8
- package/icons/aws/elemental-server.js +21 -8
- package/icons/aws/emr.js +21 -8
- package/icons/aws/event-bridge.js +21 -8
- package/icons/aws/express-workflows.js +21 -8
- package/icons/aws/fargate.js +21 -8
- package/icons/aws/fault-injection-simulator.js +21 -8
- package/icons/aws/file-cache.js +21 -8
- package/icons/aws/fin-space.js +21 -8
- package/icons/aws/firewall-manager.js +21 -8
- package/icons/aws/forecast.js +21 -8
- package/icons/aws/fraud-detector.js +21 -8
- package/icons/aws/free-rtos.js +21 -8
- package/icons/aws/fsx-for-lustre.js +21 -8
- package/icons/aws/fsx-for-net-app-ontap.js +21 -8
- package/icons/aws/fsx-for-open-zfs.js +21 -8
- package/icons/aws/fsx-for-wfs.js +21 -8
- package/icons/aws/fsx.js +21 -8
- package/icons/aws/game-kit.js +21 -8
- package/icons/aws/game-lift.js +21 -8
- package/icons/aws/game-sparks.js +21 -8
- package/icons/aws/genomics-cli.js +21 -8
- package/icons/aws/global-accelerator.js +21 -8
- package/icons/aws/glue-data-brew.js +21 -8
- package/icons/aws/glue-elastic-views.js +21 -8
- package/icons/aws/glue.js +21 -8
- package/icons/aws/ground-station.js +21 -8
- package/icons/aws/guard-duty.js +21 -8
- package/icons/aws/health-lake.js +21 -8
- package/icons/aws/honeycode.js +21 -8
- package/icons/aws/iam-identity-center.js +21 -8
- package/icons/aws/identity-and-access-management.js +21 -8
- package/icons/aws/inspector.js +21 -8
- package/icons/aws/interactive-video-service.js +21 -8
- package/icons/aws/io-t-1-click.js +21 -8
- package/icons/aws/io-t-analytics.js +21 -8
- package/icons/aws/io-t-button.js +21 -8
- package/icons/aws/io-t-core.js +21 -8
- package/icons/aws/io-t-device-defender.js +21 -8
- package/icons/aws/io-t-device-management.js +21 -8
- package/icons/aws/io-t-edu-kit.js +21 -8
- package/icons/aws/io-t-events.js +21 -8
- package/icons/aws/io-t-express-link.js +21 -8
- package/icons/aws/io-t-fleet-wise.js +21 -8
- package/icons/aws/io-t-greengrass.js +21 -8
- package/icons/aws/io-t-robo-runner.js +21 -8
- package/icons/aws/io-t-site-wise.js +21 -8
- package/icons/aws/io-t-things-graph.js +21 -8
- package/icons/aws/io-t-twin-maker.js +30 -8
- package/icons/aws/iq.js +21 -8
- package/icons/aws/kendra.js +21 -8
- package/icons/aws/key-management-service.js +21 -8
- package/icons/aws/keyspaces.js +21 -8
- package/icons/aws/kinesis-data-analytics.js +21 -8
- package/icons/aws/kinesis-data-streams.js +21 -8
- package/icons/aws/kinesis-firehose.js +21 -8
- package/icons/aws/kinesis-video-streams.js +21 -8
- package/icons/aws/kinesis.js +21 -8
- package/icons/aws/lake-formation.js +21 -8
- package/icons/aws/lambda.js +21 -8
- package/icons/aws/launch-wizard.js +21 -8
- package/icons/aws/lex.js +21 -8
- package/icons/aws/license-manager.js +21 -8
- package/icons/aws/lightsail.js +21 -8
- package/icons/aws/local-zones.js +21 -8
- package/icons/aws/location-service.js +21 -8
- package/icons/aws/lookout-for-equipment.js +21 -8
- package/icons/aws/lookout-for-metrics.js +21 -8
- package/icons/aws/lookout-for-vision.js +21 -8
- package/icons/aws/lumberyard.js +21 -8
- package/icons/aws/macie.js +21 -8
- package/icons/aws/mainframe-modernization.js +21 -8
- package/icons/aws/managed-blockchain.js +21 -8
- package/icons/aws/managed-grafana.js +21 -8
- package/icons/aws/managed-service-for-prometheus.js +21 -8
- package/icons/aws/managed-services.js +21 -8
- package/icons/aws/managed-streaming-for-apache-kafka.js +21 -8
- package/icons/aws/managed-workflows-for-apache-airflow.js +21 -8
- package/icons/aws/management-console.js +21 -8
- package/icons/aws/marketplace-dark.js +15 -8
- package/icons/aws/marketplace-light.js +15 -8
- package/icons/aws/memory-db-for-redis.js +21 -8
- package/icons/aws/migration-evaluator.js +21 -8
- package/icons/aws/migration-hub.js +21 -8
- package/icons/aws/monitron.js +21 -8
- package/icons/aws/mq.js +21 -8
- package/icons/aws/neptune.js +21 -8
- package/icons/aws/network-firewall.js +21 -8
- package/icons/aws/neuron.js +21 -8
- package/icons/aws/nice-dcv.js +21 -8
- package/icons/aws/nice-engin-frame.js +21 -8
- package/icons/aws/nimble-studio.js +21 -8
- package/icons/aws/nitro-enclaves.js +21 -8
- package/icons/aws/omics.js +21 -8
- package/icons/aws/open-3d-engine.js +21 -8
- package/icons/aws/open-search-service.js +21 -8
- package/icons/aws/ops-works.js +21 -8
- package/icons/aws/organizations.js +21 -8
- package/icons/aws/outposts-family.js +21 -8
- package/icons/aws/outposts-rack.js +21 -8
- package/icons/aws/outposts-servers.js +21 -8
- package/icons/aws/panorama.js +21 -8
- package/icons/aws/parallel-cluster.js +21 -8
- package/icons/aws/personal-health-dashboard.js +21 -8
- package/icons/aws/personalize.js +21 -8
- package/icons/aws/pinpoint-apis.js +21 -8
- package/icons/aws/pinpoint.js +21 -8
- package/icons/aws/polly.js +21 -8
- package/icons/aws/private-5g.js +21 -8
- package/icons/aws/private-certificate-authority.js +17 -8
- package/icons/aws/private-link.js +21 -8
- package/icons/aws/professional-services.js +21 -8
- package/icons/aws/proton.js +21 -8
- package/icons/aws/quantum-ledger-database.js +21 -8
- package/icons/aws/quick-sight.js +21 -8
- package/icons/aws/rds-on-vmware.js +21 -8
- package/icons/aws/rds.js +21 -8
- package/icons/aws/re-post.js +21 -8
- package/icons/aws/red-hat-open-shift-service-on-aws.js +21 -8
- package/icons/aws/redshift.js +21 -8
- package/icons/aws/rekognition.js +21 -8
- package/icons/aws/reserved-instance-reporting.js +21 -8
- package/icons/aws/resilience-hub.js +21 -8
- package/icons/aws/resource-access-manager.js +21 -8
- package/icons/aws/resource-explorer.js +21 -8
- package/icons/aws/robo-maker.js +21 -8
- package/icons/aws/route-53.js +21 -8
- package/icons/aws/s3-on-outposts.js +21 -8
- package/icons/aws/sage-maker-ground-truth.js +21 -8
- package/icons/aws/sage-maker-studio-lab.js +21 -8
- package/icons/aws/sage-maker.js +21 -8
- package/icons/aws/savings-plans.js +21 -8
- package/icons/aws/secrets-manager.js +21 -8
- package/icons/aws/security-hub.js +21 -8
- package/icons/aws/security-lake.js +21 -8
- package/icons/aws/server-migration-service.js +21 -8
- package/icons/aws/serverless-application-repository.js +21 -8
- package/icons/aws/service-catalog.js +21 -8
- package/icons/aws/service-management-connector.js +17 -8
- package/icons/aws/shield.js +21 -8
- package/icons/aws/signer.js +21 -8
- package/icons/aws/sim-space-weaver.js +21 -8
- package/icons/aws/simple-email-service.js +21 -8
- package/icons/aws/simple-notification-service.js +21 -8
- package/icons/aws/simple-queue-service.js +21 -8
- package/icons/aws/simple-storage-service-glacier.js +21 -8
- package/icons/aws/simple-storage-service.js +21 -8
- package/icons/aws/site-to-site-vpn.js +21 -8
- package/icons/aws/snowball-edge.js +21 -8
- package/icons/aws/snowball.js +21 -8
- package/icons/aws/snowcone.js +21 -8
- package/icons/aws/snowmobile.js +21 -8
- package/icons/aws/step-functions.js +21 -8
- package/icons/aws/storage-gateway.js +21 -8
- package/icons/aws/sumerian.js +21 -8
- package/icons/aws/supply-chain.js +21 -8
- package/icons/aws/support.js +21 -8
- package/icons/aws/systems-manager.js +21 -8
- package/icons/aws/tensor-flow-on-aws.js +21 -8
- package/icons/aws/textract.js +21 -8
- package/icons/aws/thinkbox-deadline.js +21 -8
- package/icons/aws/thinkbox-frost.js +21 -8
- package/icons/aws/thinkbox-krakatoa.js +21 -8
- package/icons/aws/thinkbox-sequoia.js +21 -8
- package/icons/aws/thinkbox-stoke.js +21 -8
- package/icons/aws/thinkbox-xmesh.js +21 -8
- package/icons/aws/timestream.js +21 -8
- package/icons/aws/tools-and-sdks.js +21 -8
- package/icons/aws/torch-serve.js +21 -8
- package/icons/aws/training-certification.js +21 -8
- package/icons/aws/transcribe.js +21 -8
- package/icons/aws/transfer-family.js +21 -8
- package/icons/aws/transit-gateway.js +21 -8
- package/icons/aws/translate.js +21 -8
- package/icons/aws/trusted-advisor.js +21 -8
- package/icons/aws/verified-access.js +21 -8
- package/icons/aws/verified-permissions.js +21 -8
- package/icons/aws/virtual-private-cloud.js +21 -8
- package/icons/aws/vmware-cloud-on-aws.js +21 -8
- package/icons/aws/vpc-lattice.js +21 -8
- package/icons/aws/waf.js +21 -8
- package/icons/aws/wavelength.js +21 -8
- package/icons/aws/well-architected-tool.js +21 -8
- package/icons/aws/wickr.js +21 -8
- package/icons/aws/work-docs-sdk.js +21 -8
- package/icons/aws/work-docs.js +21 -8
- package/icons/aws/work-link.js +21 -8
- package/icons/aws/work-mail.js +21 -8
- package/icons/aws/work-spaces-family.js +21 -8
- package/icons/aws/x-ray.js +21 -8
- package/icons/gcp/access-context-manager.js +17 -8
- package/icons/gcp/administration.js +46 -8
- package/icons/gcp/advanced-agent-modeling.js +31 -8
- package/icons/gcp/advanced-solutions-lab.js +48 -8
- package/icons/gcp/agent-assist.js +12 -8
- package/icons/gcp/ai-hub.js +23 -8
- package/icons/gcp/ai-platform-unified.js +40 -8
- package/icons/gcp/ai-platform.js +23 -8
- package/icons/gcp/analytics-hub.js +28 -8
- package/icons/gcp/anthos-config-management.js +28 -8
- package/icons/gcp/anthos-service-mesh.js +13 -8
- package/icons/gcp/anthos.js +11 -8
- package/icons/gcp/api-analytics.js +26 -8
- package/icons/gcp/api-monetization.js +23 -8
- package/icons/gcp/api.js +29 -8
- package/icons/gcp/apigee-api-platform.js +35 -8
- package/icons/gcp/apigee-sense.js +28 -8
- package/icons/gcp/app-engine.js +39 -8
- package/icons/gcp/artifact-registry.js +33 -8
- package/icons/gcp/asset-inventory.js +19 -8
- package/icons/gcp/assured-workloads.js +32 -8
- package/icons/gcp/auto-ml-natural-language.js +9 -8
- package/icons/gcp/auto-ml-tables.js +19 -8
- package/icons/gcp/auto-ml-translation.js +25 -8
- package/icons/gcp/auto-ml-video-intelligence.js +25 -8
- package/icons/gcp/auto-ml-vision.js +18 -8
- package/icons/gcp/auto-ml.js +14 -8
- package/icons/gcp/bare-metal-solutions.js +10 -8
- package/icons/gcp/batch.js +12 -8
- package/icons/gcp/beyondcorp.js +13 -8
- package/icons/gcp/big-query.js +28 -8
- package/icons/gcp/bigtable.js +116 -8
- package/icons/gcp/billing.js +34 -8
- package/icons/gcp/binary-authorization.js +22 -8
- package/icons/gcp/catalog.js +29 -8
- package/icons/gcp/certificate-authority-service.js +33 -8
- package/icons/gcp/certificate-manager.js +24 -8
- package/icons/gcp/cloud-api-gateway.js +13 -8
- package/icons/gcp/cloud-apis.js +18 -8
- package/icons/gcp/cloud-armor.js +27 -8
- package/icons/gcp/cloud-asset-inventory.js +10 -8
- package/icons/gcp/cloud-audit-logs.js +45 -8
- package/icons/gcp/cloud-build.js +19 -8
- package/icons/gcp/cloud-cdn.js +22 -8
- package/icons/gcp/cloud-code.js +16 -8
- package/icons/gcp/cloud-composer.js +13 -8
- package/icons/gcp/cloud-data-fusion.js +15 -8
- package/icons/gcp/cloud-deploy.js +10 -8
- package/icons/gcp/cloud-deployment-manager.js +24 -8
- package/icons/gcp/cloud-dns.js +21 -8
- package/icons/gcp/cloud-domains.js +26 -8
- package/icons/gcp/cloud-ekm.js +13 -8
- package/icons/gcp/cloud-endpoints.js +18 -8
- package/icons/gcp/cloud-external-ip-addresses.js +21 -8
- package/icons/gcp/cloud-firewall-rules.js +15 -8
- package/icons/gcp/cloud-for-marketing.js +13 -8
- package/icons/gcp/cloud-functions.js +25 -8
- package/icons/gcp/cloud-generic.js +13 -8
- package/icons/gcp/cloud-gpu.js +18 -8
- package/icons/gcp/cloud-healthcare-api.js +32 -8
- package/icons/gcp/cloud-healthcare-marketplace.js +10 -8
- package/icons/gcp/cloud-hsm.js +37 -8
- package/icons/gcp/cloud-ids.js +42 -8
- package/icons/gcp/cloud-inference-api.js +27 -8
- package/icons/gcp/cloud-interconnect.js +15 -8
- package/icons/gcp/cloud-jobs-api.js +37 -8
- package/icons/gcp/cloud-load-balancing.js +20 -8
- package/icons/gcp/cloud-logging.js +19 -8
- package/icons/gcp/cloud-media-edge.js +23 -8
- package/icons/gcp/cloud-monitoring.js +26 -8
- package/icons/gcp/cloud-nat.js +31 -8
- package/icons/gcp/cloud-natural-language-api.js +17 -8
- package/icons/gcp/cloud-network.js +17 -8
- package/icons/gcp/cloud-ops.js +32 -8
- package/icons/gcp/cloud-optimization-ai-fleet-routing-api.js +22 -8
- package/icons/gcp/cloud-optimization-ai.js +28 -8
- package/icons/gcp/cloud-router.js +13 -8
- package/icons/gcp/cloud-routes.js +18 -8
- package/icons/gcp/cloud-run-for-anthos.js +21 -8
- package/icons/gcp/cloud-run.js +13 -8
- package/icons/gcp/cloud-scheduler.js +36 -8
- package/icons/gcp/cloud-security-scanner.js +21 -8
- package/icons/gcp/cloud-shell.js +16 -8
- package/icons/gcp/cloud-spanner.js +42 -8
- package/icons/gcp/cloud-sql.js +16 -8
- package/icons/gcp/cloud-storage.js +22 -8
- package/icons/gcp/cloud-tasks.js +29 -8
- package/icons/gcp/cloud-test-lab.js +39 -8
- package/icons/gcp/cloud-tpu.js +103 -8
- package/icons/gcp/cloud-translation-api.js +16 -8
- package/icons/gcp/cloud-vision-api.js +16 -8
- package/icons/gcp/cloud-vpn.js +23 -8
- package/icons/gcp/compute-engine.js +17 -8
- package/icons/gcp/configuration-management.js +22 -8
- package/icons/gcp/connectivity-test.js +6 -8
- package/icons/gcp/connectors.js +13 -8
- package/icons/gcp/contact-center-ai.js +6 -8
- package/icons/gcp/container-optimized-os.js +13 -8
- package/icons/gcp/container-registry.js +27 -8
- package/icons/gcp/data-catalog.js +25 -8
- package/icons/gcp/data-labeling.js +19 -8
- package/icons/gcp/data-layers.js +11 -8
- package/icons/gcp/data-loss-prevention-api.js +54 -8
- package/icons/gcp/data-qn-a.js +24 -8
- package/icons/gcp/data-studio.js +16 -8
- package/icons/gcp/data-transfer.js +17 -8
- package/icons/gcp/database-migration-service.js +24 -8
- package/icons/gcp/dataflow.js +44 -8
- package/icons/gcp/datalab.js +13 -8
- package/icons/gcp/dataplex.js +15 -8
- package/icons/gcp/datapol.js +49 -8
- package/icons/gcp/dataprep.js +25 -8
- package/icons/gcp/dataproc-metastore.js +12 -8
- package/icons/gcp/dataproc.js +43 -8
- package/icons/gcp/datashare.js +37 -8
- package/icons/gcp/datastore.js +39 -8
- package/icons/gcp/datastream.js +35 -8
- package/icons/gcp/debugger.js +31 -8
- package/icons/gcp/developer-portal.js +24 -8
- package/icons/gcp/dialogflow-cx.js +28 -8
- package/icons/gcp/dialogflow-insights.js +33 -8
- package/icons/gcp/dialogflow.js +16 -8
- package/icons/gcp/document-ai.js +27 -8
- package/icons/gcp/early-access-center.js +12 -8
- package/icons/gcp/error-reporting.js +14 -8
- package/icons/gcp/eventarc.js +24 -8
- package/icons/gcp/filestore.js +14 -8
- package/icons/gcp/financial-services-marketplace.js +21 -8
- package/icons/gcp/firestore.js +14 -8
- package/icons/gcp/fleet-engine.js +10 -8
- package/icons/gcp/free-trial.js +36 -8
- package/icons/gcp/game-servers.js +32 -8
- package/icons/gcp/gce-systems-management.js +13 -8
- package/icons/gcp/genomics.js +23 -8
- package/icons/gcp/gke-on-prem.js +31 -8
- package/icons/gcp/google-cloud-marketplace.js +29 -8
- package/icons/gcp/google-kubernetes-engine.js +23 -8
- package/icons/gcp/google-maps-platform.js +47 -8
- package/icons/gcp/healthcare-nlp-api.js +13 -8
- package/icons/gcp/home.js +25 -8
- package/icons/gcp/identity-and-access-management.js +23 -8
- package/icons/gcp/identity-aware-proxy.js +32 -8
- package/icons/gcp/identity-platform.js +26 -8
- package/icons/gcp/iot-core.js +23 -8
- package/icons/gcp/iot-edge.js +86 -8
- package/icons/gcp/key-access-justifications.js +46 -8
- package/icons/gcp/key-management-service.js +23 -8
- package/icons/gcp/kuberun.js +26 -8
- package/icons/gcp/launcher.js +35 -8
- package/icons/gcp/local-ssd.js +13 -8
- package/icons/gcp/looker.js +46 -8
- package/icons/gcp/managed-service-for-microsoft-active-directory.js +24 -8
- package/icons/gcp/media-translation-api.js +28 -8
- package/icons/gcp/memorystore.js +26 -8
- package/icons/gcp/migrate-for-anthos.js +13 -8
- package/icons/gcp/migrate-for-compute-engine.js +13 -8
- package/icons/gcp/my-cloud.js +21 -8
- package/icons/gcp/network-connectivity-center.js +84 -8
- package/icons/gcp/network-intelligence-center.js +13 -8
- package/icons/gcp/network-security.js +32 -8
- package/icons/gcp/network-tiers.js +23 -8
- package/icons/gcp/network-topology.js +13 -8
- package/icons/gcp/onboarding.js +25 -8
- package/icons/gcp/os-configuration-management.js +13 -8
- package/icons/gcp/os-inventory-management.js +15 -8
- package/icons/gcp/os-patch-management.js +13 -8
- package/icons/gcp/partner-interconnect.js +21 -8
- package/icons/gcp/partner-portal.js +35 -8
- package/icons/gcp/performance-dashboard.js +13 -8
- package/icons/gcp/permissions.js +35 -8
- package/icons/gcp/persistent-disk.js +10 -8
- package/icons/gcp/phishing-protection.js +36 -8
- package/icons/gcp/policy-analyzer.js +13 -8
- package/icons/gcp/premium-network-tier.js +19 -8
- package/icons/gcp/private-connectivity.js +18 -8
- package/icons/gcp/private-service-connect.js +27 -8
- package/icons/gcp/producer-portal.js +21 -8
- package/icons/gcp/profiler.js +21 -8
- package/icons/gcp/project.js +28 -8
- package/icons/gcp/pub-sub.js +41 -8
- package/icons/gcp/quantum-engine.js +27 -8
- package/icons/gcp/quotas.js +26 -8
- package/icons/gcp/real-world-insights.js +19 -8
- package/icons/gcp/recommendations-ai.js +24 -8
- package/icons/gcp/release-notes.js +12 -8
- package/icons/gcp/retail-api.js +22 -8
- package/icons/gcp/risk-manager.js +12 -8
- package/icons/gcp/runtime-config.js +19 -8
- package/icons/gcp/secret-manager.js +13 -8
- package/icons/gcp/security-command-center.js +18 -8
- package/icons/gcp/security-health-advisor.js +43 -8
- package/icons/gcp/security-key-enforcement.js +21 -8
- package/icons/gcp/security.js +27 -8
- package/icons/gcp/service-discovery.js +26 -8
- package/icons/gcp/speech-to-text.js +21 -8
- package/icons/gcp/stackdriver.js +10 -8
- package/icons/gcp/standard-network-tier.js +13 -8
- package/icons/gcp/stream-suite.js +16 -8
- package/icons/gcp/support.js +29 -8
- package/icons/gcp/tensorflow-enterprise.js +13 -8
- package/icons/gcp/text-to-speech.js +24 -8
- package/icons/gcp/tools-for-powershell.js +29 -8
- package/icons/gcp/trace.js +17 -8
- package/icons/gcp/traffic-director.js +20 -8
- package/icons/gcp/transfer-appliance.js +20 -8
- package/icons/gcp/transfer.js +13 -8
- package/icons/gcp/user-preferences.js +35 -8
- package/icons/gcp/vertex-ai.js +48 -8
- package/icons/gcp/video-intelligence-api.js +15 -8
- package/icons/gcp/virtual-private-cloud.js +19 -8
- package/icons/gcp/visual-inspection.js +24 -8
- package/icons/gcp/vmware-engine.js +13 -8
- package/icons/gcp/web-risk.js +27 -8
- package/icons/gcp/web-security-scanner.js +27 -8
- package/icons/gcp/workflows.js +82 -8
- package/icons/gcp/workload-identity-pool.js +24 -8
- package/icons/tech/aarch64.js +48 -8
- package/icons/tech/adobe-illustrator.js +14 -8
- package/icons/tech/adobe-photoshop.js +14 -8
- package/icons/tech/adobe-premiere-pro.js +16 -8
- package/icons/tech/adobe-xd.js +12 -8
- package/icons/tech/adonis-js.js +14 -8
- package/icons/tech/after-effects.js +16 -8
- package/icons/tech/airflow.js +64 -8
- package/icons/tech/akka.js +21 -8
- package/icons/tech/algolia.js +12 -8
- package/icons/tech/alpine-js.js +17 -8
- package/icons/tech/amazon-web-services.js +21 -8
- package/icons/tech/anaconda.js +12 -8
- package/icons/tech/android-studio.js +44 -8
- package/icons/tech/android.js +35 -8
- package/icons/tech/angular-js.js +24 -8
- package/icons/tech/angular.js +37 -8
- package/icons/tech/ansible.js +15 -8
- package/icons/tech/ant-design.js +112 -8
- package/icons/tech/apache.js +156 -8
- package/icons/tech/apl.js +21 -8
- package/icons/tech/appcelerator.js +12 -8
- package/icons/tech/apple-safari.js +39 -10
- package/icons/tech/apple.js +6 -8
- package/icons/tech/appwrite.js +21 -8
- package/icons/tech/arch-linux.js +29 -8
- package/icons/tech/arduino.js +9 -8
- package/icons/tech/argo-cd.js +134 -8
- package/icons/tech/astro.js +62 -8
- package/icons/tech/atom.js +14 -8
- package/icons/tech/autodesk-maya.js +55 -8
- package/icons/tech/autodesk-shot-grid.js +15 -8
- package/icons/tech/awk.js +34 -8
- package/icons/tech/azios.js +12 -8
- package/icons/tech/azure-devops.js +33 -8
- package/icons/tech/azure-sql-database.js +95 -8
- package/icons/tech/azure.js +55 -8
- package/icons/tech/babel.js +15 -8
- package/icons/tech/backbone-js.js +16 -8
- package/icons/tech/ballerina.js +12 -8
- package/icons/tech/bamboo.js +62 -8
- package/icons/tech/bash.js +22 -8
- package/icons/tech/behance.js +19 -8
- package/icons/tech/bitbucket.js +37 -8
- package/icons/tech/blender.js +21 -8
- package/icons/tech/bootstrap.js +78 -8
- package/icons/tech/bower.js +123 -8
- package/icons/tech/browserstack.js +77 -8
- package/icons/tech/bulma.js +6 -8
- package/icons/tech/bun.js +68 -8
- package/icons/tech/c.js +28 -8
- package/icons/tech/cairo-graphics.js +21 -8
- package/icons/tech/cake-php.js +12 -8
- package/icons/tech/canva.js +9 -8
- package/icons/tech/capacitor.js +25 -8
- package/icons/tech/cassandra.js +101 -8
- package/icons/tech/cent-os.js +22 -8
- package/icons/tech/chrome.js +156 -8
- package/icons/tech/circle-ci.js +12 -8
- package/icons/tech/clarity.js +35 -8
- package/icons/tech/clion.js +98 -8
- package/icons/tech/clojure-script.js +39 -8
- package/icons/tech/clojure.js +42 -8
- package/icons/tech/cloudflare-workers.js +196 -8
- package/icons/tech/cloudflare.js +22 -8
- package/icons/tech/cmake.js +11 -8
- package/icons/tech/code-igniter.js +12 -8
- package/icons/tech/code-pen.js +12 -8
- package/icons/tech/codeac.js +12 -8
- package/icons/tech/codecov.js +12 -8
- package/icons/tech/coffee-script.js +12 -8
- package/icons/tech/composer.js +59 -8
- package/icons/tech/confluence.js +57 -8
- package/icons/tech/consul.js +12 -8
- package/icons/tech/contao.js +15 -8
- package/icons/tech/corejs.js +6 -8
- package/icons/tech/cosmosdb.js +52 -8
- package/icons/tech/couchdb.js +12 -8
- package/icons/tech/cplusplus.js +35 -8
- package/icons/tech/crystal.js +12 -8
- package/icons/tech/csharp.js +28 -8
- package/icons/tech/css3.js +25 -8
- package/icons/tech/cucumber.js +12 -8
- package/icons/tech/cypress.js +34 -12
- package/icons/tech/d3js.js +145 -8
- package/icons/tech/dart.js +24 -8
- package/icons/tech/data-grip.js +109 -8
- package/icons/tech/data-spell.js +102 -8
- package/icons/tech/dbeaver.js +56 -8
- package/icons/tech/debian.js +12 -8
- package/icons/tech/deno.js +6 -8
- package/icons/tech/devicon.js +25 -8
- package/icons/tech/digital-ocean.js +9 -8
- package/icons/tech/discord-js.js +56 -8
- package/icons/tech/django-rest.js +35 -8
- package/icons/tech/django.js +9 -8
- package/icons/tech/docker.js +133 -8
- package/icons/tech/doctrine.js +21 -8
- package/icons/tech/dropwizard.js +70 -8
- package/icons/tech/drupal.js +56 -8
- package/icons/tech/eclipse-ceylon.js +44 -8
- package/icons/tech/eclipse-ide.js +93 -8
- package/icons/tech/eclipse-vert-x.js +29 -8
- package/icons/tech/elasticbeats.js +22 -8
- package/icons/tech/elasticsearch.js +28 -8
- package/icons/tech/electron.js +11 -8
- package/icons/tech/eleventy-11ty.js +15 -8
- package/icons/tech/elixir.js +211 -8
- package/icons/tech/elm.js +19 -8
- package/icons/tech/embedded-c.js +42 -8
- package/icons/tech/ember-js.js +16 -8
- package/icons/tech/envoy.js +28 -8
- package/icons/tech/erlang.js +12 -8
- package/icons/tech/eslint.js +21 -8
- package/icons/tech/express.js +6 -8
- package/icons/tech/facebook.js +15 -8
- package/icons/tech/fast-api.js +12 -8
- package/icons/tech/fastify.js +15 -8
- package/icons/tech/fauna.js +12 -8
- package/icons/tech/feathers.js +6 -8
- package/icons/tech/fedora.js +53 -8
- package/icons/tech/figma.js +24 -8
- package/icons/tech/file-zilla.js +18 -8
- package/icons/tech/firebase.js +12 -8
- package/icons/tech/firefox.js +1381 -8
- package/icons/tech/flask.js +12 -8
- package/icons/tech/flutter.js +16 -8
- package/icons/tech/fortran.js +15 -8
- package/icons/tech/foundation.js +240 -8
- package/icons/tech/fsharp.js +10 -8
- package/icons/tech/gatling.js +12 -8
- package/icons/tech/gatsby.js +12 -8
- package/icons/tech/gazebo.js +23 -8
- package/icons/tech/gcc.js +44 -8
- package/icons/tech/gentoo.js +14 -8
- package/icons/tech/ghost.js +27 -8
- package/icons/tech/gimp.js +370 -8
- package/icons/tech/git.js +12 -8
- package/icons/tech/gitbook.js +13 -8
- package/icons/tech/github-actions.js +21 -8
- package/icons/tech/github-codespaces.js +85 -8
- package/icons/tech/github.js +16 -8
- package/icons/tech/gitlab.js +35 -8
- package/icons/tech/gitpod.js +32 -8
- package/icons/tech/gitter.js +6 -8
- package/icons/tech/gnu-emacs.js +15 -8
- package/icons/tech/go-land.js +82 -8
- package/icons/tech/go.js +285 -8
- package/icons/tech/godot-engine.js +56 -8
- package/icons/tech/google-cloud.js +29 -8
- package/icons/tech/google.js +42 -8
- package/icons/tech/gradle.js +12 -8
- package/icons/tech/grafana.js +30 -8
- package/icons/tech/grails.js +21 -8
- package/icons/tech/graphql.js +15 -8
- package/icons/tech/groovy.js +715 -8
- package/icons/tech/grunt-js.js +260 -8
- package/icons/tech/gulp-js.js +14 -8
- package/icons/tech/hadoop.js +36 -8
- package/icons/tech/handlebars.js +9 -8
- package/icons/tech/hardhat.js +98 -8
- package/icons/tech/harvester.js +10 -8
- package/icons/tech/hashicorp-vault.js +12 -8
- package/icons/tech/haskell.js +10 -8
- package/icons/tech/haxe.js +17 -8
- package/icons/tech/helm.js +12 -8
- package/icons/tech/heroku.js +12 -8
- package/icons/tech/hibernate.js +15 -8
- package/icons/tech/homebrew.js +36 -8
- package/icons/tech/html5.js +23 -8
- package/icons/tech/hugo.js +22 -8
- package/icons/tech/ibm-spss-statistics.js +21 -8
- package/icons/tech/ie10.js +12 -8
- package/icons/tech/ifttt.js +6 -8
- package/icons/tech/influxdb.js +14 -8
- package/icons/tech/inkscape.js +534 -8
- package/icons/tech/insomnia.js +44 -8
- package/icons/tech/intellij-idea.js +92 -8
- package/icons/tech/ionic.js +9 -8
- package/icons/tech/jaeger.js +102 -8
- package/icons/tech/jamstack.js +12 -8
- package/icons/tech/jasmine.js +10 -8
- package/icons/tech/java.js +42 -8
- package/icons/tech/javascript.js +15 -8
- package/icons/tech/jeet.js +135 -8
- package/icons/tech/jekyll.js +187 -8
- package/icons/tech/jenkins.js +126 -8
- package/icons/tech/jest.js +12 -8
- package/icons/tech/jetbrains.js +118 -8
- package/icons/tech/jira-align.js +57 -8
- package/icons/tech/jira.js +62 -8
- package/icons/tech/jquery.js +12 -8
- package/icons/tech/json.js +57 -8
- package/icons/tech/jule.js +12 -8
- package/icons/tech/julia.js +49 -8
- package/icons/tech/junit.js +30 -8
- package/icons/tech/jupyter.js +35 -8
- package/icons/tech/k3os.js +6 -8
- package/icons/tech/k3s.js +12 -8
- package/icons/tech/kafka.js +12 -8
- package/icons/tech/kaggle.js +12 -8
- package/icons/tech/karate.js +15 -8
- package/icons/tech/karma.js +21 -8
- package/icons/tech/keras.js +15 -8
- package/icons/tech/kibana.js +10 -8
- package/icons/tech/knex-js.js +12 -8
- package/icons/tech/knockout.js +13 -8
- package/icons/tech/kotlin.js +25 -8
- package/icons/tech/krakenjs.js +14 -8
- package/icons/tech/ktor.js +48 -8
- package/icons/tech/kubernetes.js +10 -8
- package/icons/tech/labview.js +69 -44
- package/icons/tech/laravel.js +15 -8
- package/icons/tech/latex.js +12 -8
- package/icons/tech/less-js.js +14 -8
- package/icons/tech/linkedin.js +21 -8
- package/icons/tech/linux.js +5267 -8
- package/icons/tech/liquibase.js +12 -8
- package/icons/tech/livewire.js +79 -8
- package/icons/tech/llvm.js +36 -8
- package/icons/tech/logstash.js +10 -8
- package/icons/tech/lua.js +28 -8
- package/icons/tech/lumen.js +12 -8
- package/icons/tech/magento.js +12 -8
- package/icons/tech/markdown.js +44 -33
- package/icons/tech/material-ui.js +11 -8
- package/icons/tech/materialize.js +21 -8
- package/icons/tech/matlab.js +73 -8
- package/icons/tech/matplotlib.js +182 -8
- package/icons/tech/maven.js +620 -8
- package/icons/tech/meteor-js.js +12 -8
- package/icons/tech/microsoft-sql-server.js +6 -8
- package/icons/tech/minitab.js +45 -8
- package/icons/tech/mob-x.js +57 -8
- package/icons/tech/mocha.js +21 -8
- package/icons/tech/modx.js +11 -8
- package/icons/tech/moleculer.js +12 -8
- package/icons/tech/mongodb.js +135 -8
- package/icons/tech/mongoose-js.js +29 -8
- package/icons/tech/moodle.js +139 -8
- package/icons/tech/ms-dos.js +78 -8
- package/icons/tech/mysql.js +12 -8
- package/icons/tech/nano.js +12 -8
- package/icons/tech/nerog.js +136 -8
- package/icons/tech/nestjs.js +12 -8
- package/icons/tech/net-core.js +9 -8
- package/icons/tech/net.js +551 -8
- package/icons/tech/network-x.js +58 -8
- package/icons/tech/new4j.js +21 -8
- package/icons/tech/nextjs.js +6 -8
- package/icons/tech/nginx.js +12 -8
- package/icons/tech/nhibernate.js +21 -8
- package/icons/tech/nim.js +29 -8
- package/icons/tech/nimble.js +84 -8
- package/icons/tech/nix.js +25 -8
- package/icons/tech/nodejs.js +12 -8
- package/icons/tech/nodemon.js +21 -8
- package/icons/tech/nodewebkit.js +42 -8
- package/icons/tech/npm.js +12 -8
- package/icons/tech/nuget.js +12 -8
- package/icons/tech/num-py.js +29 -12
- package/icons/tech/nuxt-js.js +28 -8
- package/icons/tech/objective-c.js +9 -8
- package/icons/tech/ocaml.js +96 -8
- package/icons/tech/oh-my-zsh.js +38 -8
- package/icons/tech/okta.js +21 -8
- package/icons/tech/open-al.js +22 -8
- package/icons/tech/open-api.js +139 -8
- package/icons/tech/open-cl.js +42 -8
- package/icons/tech/open-cv.js +28 -8
- package/icons/tech/open-gl.js +35 -8
- package/icons/tech/open-stack.js +12 -8
- package/icons/tech/open-suse.js +15 -8
- package/icons/tech/open-telemetry.js +21 -8
- package/icons/tech/opera.js +32 -8
- package/icons/tech/oracle.js +12 -8
- package/icons/tech/p5js.js +12 -8
- package/icons/tech/packer.js +15 -8
- package/icons/tech/pandas.js +62 -18
- package/icons/tech/perl.js +21 -8
- package/icons/tech/pf-sense.js +6 -8
- package/icons/tech/phalcon.js +32 -8
- package/icons/tech/phoenix-framework.js +12 -8
- package/icons/tech/photon-engine.js +41 -8
- package/icons/tech/php-storm.js +93 -8
- package/icons/tech/php.js +62 -8
- package/icons/tech/playwrite.js +56 -8
- package/icons/tech/ploty.js +28 -8
- package/icons/tech/podman.js +150 -8
- package/icons/tech/polygon.js +15 -8
- package/icons/tech/portainer.js +12 -8
- package/icons/tech/postcss.js +28 -8
- package/icons/tech/postgresql.js +23 -8
- package/icons/tech/postman.js +28 -8
- package/icons/tech/powershell.js +79 -8
- package/icons/tech/processing.js +201 -22
- package/icons/tech/prometheus.js +12 -8
- package/icons/tech/protractor.js +12 -8
- package/icons/tech/purescript.js +16 -8
- package/icons/tech/putty.js +56 -8
- package/icons/tech/pycharm.js +81 -8
- package/icons/tech/pyscript.js +15 -8
- package/icons/tech/pytest.js +21 -8
- package/icons/tech/python-poetry.js +155 -16
- package/icons/tech/python.js +78 -8
- package/icons/tech/pytorch.js +15 -8
- package/icons/tech/qodana.js +52 -8
- package/icons/tech/qt.js +12 -8
- package/icons/tech/quarkus.js +23 -8
- package/icons/tech/quasar.js +15 -8
- package/icons/tech/qwik.js +37 -8
- package/icons/tech/r.js +57 -8
- package/icons/tech/rabbitmq.js +12 -8
- package/icons/tech/rancher.js +6 -8
- package/icons/tech/raspberrypi.js +28 -8
- package/icons/tech/reach.js +27 -8
- package/icons/tech/react-bootstrap.js +12 -8
- package/icons/tech/react.js +9 -8
- package/icons/tech/realm.js +63 -8
- package/icons/tech/red-cube-s-epic-compiler-thingy-programming-re-ct.js +17 -8
- package/icons/tech/redhat.js +22 -8
- package/icons/tech/redis.js +59 -8
- package/icons/tech/redux.js +12 -8
- package/icons/tech/ren-py.js +541 -8
- package/icons/tech/rider.js +32 -8
- package/icons/tech/robot-operating-system-ros.js +15 -8
- package/icons/tech/rocksdb.js +9 -8
- package/icons/tech/rollup-js.js +155 -8
- package/icons/tech/rspec.js +35 -8
- package/icons/tech/rstudio.js +30 -8
- package/icons/tech/ruby-mine.js +52 -8
- package/icons/tech/ruby-on-rails.js +14 -8
- package/icons/tech/ruby.js +353 -8
- package/icons/tech/rust.js +6 -8
- package/icons/tech/salesforce.js +28 -8
- package/icons/tech/sanity.js +22 -8
- package/icons/tech/sass.js +14 -8
- package/icons/tech/scala.js +21 -8
- package/icons/tech/scalingo.js +29 -8
- package/icons/tech/sdl.js +42 -8
- package/icons/tech/selenium.js +15 -8
- package/icons/tech/sema-software.js +15 -8
- package/icons/tech/sequelize.js +34 -8
- package/icons/tech/shopware.js +9 -8
- package/icons/tech/sketch.js +14 -8
- package/icons/tech/slack.js +35 -8
- package/icons/tech/socket-io.js +45 -33
- package/icons/tech/solid-js.js +121 -8
- package/icons/tech/solidity.js +13 -8
- package/icons/tech/sonarqube.js +12 -8
- package/icons/tech/sourcetree.js +12 -8
- package/icons/tech/spark.js +12 -8
- package/icons/tech/splunk.js +12 -8
- package/icons/tech/spring.js +12 -8
- package/icons/tech/sql-developer.js +43 -8
- package/icons/tech/sqlalchemy.js +21 -8
- package/icons/tech/sqlite.js +45 -8
- package/icons/tech/ssh.js +12 -8
- package/icons/tech/stackoverflow.js +15 -8
- package/icons/tech/stata.js +12 -8
- package/icons/tech/storybook.js +12 -8
- package/icons/tech/streamlit.js +31 -8
- package/icons/tech/stylus.js +9 -8
- package/icons/tech/subversion.js +12 -8
- package/icons/tech/svelte.js +23 -8
- package/icons/tech/swagger.js +21 -8
- package/icons/tech/swift.js +21 -8
- package/icons/tech/symfony.js +12 -8
- package/icons/tech/tailwind-css.js +12 -8
- package/icons/tech/tauri.js +35 -8
- package/icons/tech/tensorflow.js +12 -8
- package/icons/tech/terraform.js +16 -8
- package/icons/tech/tex.js +6 -8
- package/icons/tech/the-algorithms.js +12 -8
- package/icons/tech/three-js.js +139 -108
- package/icons/tech/titanium-sdk.js +12 -8
- package/icons/tech/tomcat.js +26 -8
- package/icons/tech/tortoise-git.js +37 -8
- package/icons/tech/tower.js +357 -8
- package/icons/tech/traefik-mesh.js +12 -8
- package/icons/tech/traefik-proxy.js +12 -8
- package/icons/tech/travis-ci.js +12 -8
- package/icons/tech/trello.js +12 -8
- package/icons/tech/twitter.js +12 -8
- package/icons/tech/typescript.js +16 -8
- package/icons/tech/typo3.js +12 -8
- package/icons/tech/ubuntu.js +12 -8
- package/icons/tech/uml.js +29 -8
- package/icons/tech/unity.js +22 -8
- package/icons/tech/unix.js +12 -8
- package/icons/tech/unreal-engine.js +9 -8
- package/icons/tech/uwsgi.js +38 -8
- package/icons/tech/v8.js +109 -8
- package/icons/tech/vagrant.js +21 -8
- package/icons/tech/vala.js +57 -8
- package/icons/tech/vercel.js +6 -8
- package/icons/tech/veutify.js +11 -8
- package/icons/tech/vim.js +82 -8
- package/icons/tech/visualstudio.js +12 -8
- package/icons/tech/vite.js +6 -8
- package/icons/tech/vitejs.js +56 -8
- package/icons/tech/vscode.js +114 -12
- package/icons/tech/vsphere.js +25 -8
- package/icons/tech/vue-storefront.js +22 -8
- package/icons/tech/vue.js +16 -8
- package/icons/tech/vyper.js +17 -8
- package/icons/tech/webassembly.js +12 -8
- package/icons/tech/webflow.js +12 -8
- package/icons/tech/weblate.js +80 -8
- package/icons/tech/webpack.js +21 -8
- package/icons/tech/webstorm.js +80 -8
- package/icons/tech/windows11.js +12 -8
- package/icons/tech/windows8.js +12 -8
- package/icons/tech/woo-commerce.js +22 -8
- package/icons/tech/wordpress.js +70 -8
- package/icons/tech/xamarin.js +12 -8
- package/icons/tech/xcode.js +575 -8
- package/icons/tech/xml.js +51 -8
- package/icons/tech/yaml.js +16 -8
- package/icons/tech/yarn.js +9 -8
- package/icons/tech/yii-framework.js +35 -8
- package/icons/tech/yuno-host.js +15 -8
- package/icons/tech/zend-framework.js +14 -8
- package/icons/tech/zig.js +28 -8
- package/package.json +35 -26
- package/react/LikeC4Browser.d.ts +1 -1
- package/react/LikeC4ViewElement.d.ts +4 -2
- package/react/index.d.ts +1 -0
- package/react/index.mjs +1452 -1312
- package/react/styles.d.ts +2 -2
- package/react/types.d.ts +4 -2
- package/dist/__app__/react/components.mjs +0 -25397
- /package/dist/__app__/src/{-view-lazy-data-WZmbIsHq.js → routes/-view-lazy-data.js} +0 -0
|
@@ -0,0 +1,2484 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import { flushSync } from "react-dom";
|
|
4
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
5
|
+
const pushStateEvent = "pushstate", popStateEvent = "popstate", beforeUnloadEvent = "beforeunload", beforeUnloadListener = (event) => (event.preventDefault(),
|
|
6
|
+
event.returnValue = ""), stopBlocking = () => {
|
|
7
|
+
removeEventListener(beforeUnloadEvent, beforeUnloadListener, {
|
|
8
|
+
capture: !0
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
function createHistory(opts) {
|
|
12
|
+
let location = opts.getLocation();
|
|
13
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
14
|
+
let blockers = [];
|
|
15
|
+
const notify = () => {
|
|
16
|
+
location = opts.getLocation(), subscribers.forEach((subscriber) => subscriber());
|
|
17
|
+
}, tryNavigation = async (task, navigateOpts) => {
|
|
18
|
+
var _a;
|
|
19
|
+
if (!(navigateOpts?.ignoreBlocker ?? !1) && typeof document < "u" && blockers.length) {
|
|
20
|
+
for (const blocker of blockers)
|
|
21
|
+
if (!await blocker()) {
|
|
22
|
+
(_a = opts.onBlocked) == null || _a.call(opts, notify);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
task();
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
get location() {
|
|
30
|
+
return location;
|
|
31
|
+
},
|
|
32
|
+
subscribers,
|
|
33
|
+
subscribe: (cb) => (subscribers.add(cb), () => {
|
|
34
|
+
subscribers.delete(cb);
|
|
35
|
+
}),
|
|
36
|
+
push: (path, state, navigateOpts) => {
|
|
37
|
+
state = assignKey(state), tryNavigation(() => {
|
|
38
|
+
opts.pushState(path, state), notify();
|
|
39
|
+
}, navigateOpts);
|
|
40
|
+
},
|
|
41
|
+
replace: (path, state, navigateOpts) => {
|
|
42
|
+
state = assignKey(state), tryNavigation(() => {
|
|
43
|
+
opts.replaceState(path, state), notify();
|
|
44
|
+
}, navigateOpts);
|
|
45
|
+
},
|
|
46
|
+
go: (index, navigateOpts) => {
|
|
47
|
+
tryNavigation(() => {
|
|
48
|
+
opts.go(index), notify();
|
|
49
|
+
}, navigateOpts);
|
|
50
|
+
},
|
|
51
|
+
back: (navigateOpts) => {
|
|
52
|
+
tryNavigation(() => {
|
|
53
|
+
opts.back(), notify();
|
|
54
|
+
}, navigateOpts);
|
|
55
|
+
},
|
|
56
|
+
forward: (navigateOpts) => {
|
|
57
|
+
tryNavigation(() => {
|
|
58
|
+
opts.forward(), notify();
|
|
59
|
+
}, navigateOpts);
|
|
60
|
+
},
|
|
61
|
+
createHref: (str) => opts.createHref(str),
|
|
62
|
+
block: (blocker) => (blockers.push(blocker), blockers.length === 1 && addEventListener(beforeUnloadEvent, beforeUnloadListener, {
|
|
63
|
+
capture: !0
|
|
64
|
+
}), () => {
|
|
65
|
+
blockers = blockers.filter((b) => b !== blocker), blockers.length || stopBlocking();
|
|
66
|
+
}),
|
|
67
|
+
flush: () => {
|
|
68
|
+
var _a;
|
|
69
|
+
return (_a = opts.flush) == null ? void 0 : _a.call(opts);
|
|
70
|
+
},
|
|
71
|
+
destroy: () => {
|
|
72
|
+
var _a;
|
|
73
|
+
return (_a = opts.destroy) == null ? void 0 : _a.call(opts);
|
|
74
|
+
},
|
|
75
|
+
notify
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function assignKey(state) {
|
|
79
|
+
return state || (state = {}), {
|
|
80
|
+
...state,
|
|
81
|
+
key: createRandomKey()
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function createBrowserHistory(opts) {
|
|
85
|
+
const win = opts?.window ?? (typeof document < "u" ? window : void 0), originalPushState = win.history.pushState, originalReplaceState = win.history.
|
|
86
|
+
replaceState, createHref = opts?.createHref ?? ((path) => path), parseLocation = opts?.parseLocation ?? (() => parseHref(
|
|
87
|
+
`${win.location.pathname}${win.location.search}${win.location.hash}`,
|
|
88
|
+
win.history.state
|
|
89
|
+
));
|
|
90
|
+
let currentLocation = parseLocation(), rollbackLocation;
|
|
91
|
+
const getLocation = () => currentLocation;
|
|
92
|
+
let next, scheduled;
|
|
93
|
+
const flush = () => {
|
|
94
|
+
if (!next)
|
|
95
|
+
return;
|
|
96
|
+
(next.isPush ? originalPushState : originalReplaceState).call(win.history, next.state, "", next.href), next = void 0, scheduled = void 0, rollbackLocation =
|
|
97
|
+
void 0;
|
|
98
|
+
}, queueHistoryAction = (type, destHref, state) => {
|
|
99
|
+
const href = createHref(destHref);
|
|
100
|
+
scheduled || (rollbackLocation = currentLocation), currentLocation = parseHref(destHref, state), next = {
|
|
101
|
+
href,
|
|
102
|
+
state,
|
|
103
|
+
isPush: next?.isPush || type === "push"
|
|
104
|
+
}, scheduled || (scheduled = Promise.resolve().then(() => flush()));
|
|
105
|
+
}, onPushPop = () => {
|
|
106
|
+
currentLocation = parseLocation(), history.notify();
|
|
107
|
+
}, history = createHistory({
|
|
108
|
+
getLocation,
|
|
109
|
+
pushState: (href, state) => queueHistoryAction("push", href, state),
|
|
110
|
+
replaceState: (href, state) => queueHistoryAction("replace", href, state),
|
|
111
|
+
back: () => win.history.back(),
|
|
112
|
+
forward: () => win.history.forward(),
|
|
113
|
+
go: (n2) => win.history.go(n2),
|
|
114
|
+
createHref: (href) => createHref(href),
|
|
115
|
+
flush,
|
|
116
|
+
destroy: () => {
|
|
117
|
+
win.history.pushState = originalPushState, win.history.replaceState = originalReplaceState, win.removeEventListener(pushStateEvent, onPushPop), win.
|
|
118
|
+
removeEventListener(popStateEvent, onPushPop);
|
|
119
|
+
},
|
|
120
|
+
onBlocked: (onUpdate) => {
|
|
121
|
+
rollbackLocation && currentLocation !== rollbackLocation && (currentLocation = rollbackLocation, onUpdate());
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
return win.addEventListener(pushStateEvent, onPushPop), win.addEventListener(popStateEvent, onPushPop), win.history.pushState = function(...args) {
|
|
125
|
+
const res = originalPushState.apply(win.history, args);
|
|
126
|
+
return onPushPop(), res;
|
|
127
|
+
}, win.history.replaceState = function(...args) {
|
|
128
|
+
const res = originalReplaceState.apply(win.history, args);
|
|
129
|
+
return onPushPop(), res;
|
|
130
|
+
}, history;
|
|
131
|
+
}
|
|
132
|
+
function createHashHistory(opts) {
|
|
133
|
+
const win = typeof document < "u" ? window : void 0;
|
|
134
|
+
return createBrowserHistory({
|
|
135
|
+
window: win,
|
|
136
|
+
parseLocation: () => {
|
|
137
|
+
const hashHref = win.location.hash.split("#").slice(1).join("#") ?? "/";
|
|
138
|
+
return parseHref(hashHref, win.history.state);
|
|
139
|
+
},
|
|
140
|
+
createHref: (href) => `${win.location.pathname}${win.location.search}#${href}`
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function createMemoryHistory(opts = {
|
|
144
|
+
initialEntries: ["/"]
|
|
145
|
+
}) {
|
|
146
|
+
const entries = opts.initialEntries;
|
|
147
|
+
let index = opts.initialIndex ?? entries.length - 1, currentState = {
|
|
148
|
+
key: createRandomKey()
|
|
149
|
+
};
|
|
150
|
+
return createHistory({
|
|
151
|
+
getLocation: () => parseHref(entries[index], currentState),
|
|
152
|
+
pushState: (path, state) => {
|
|
153
|
+
currentState = state, index < entries.length - 1 && entries.splice(index + 1), entries.push(path), index = Math.max(entries.length - 1, 0);
|
|
154
|
+
},
|
|
155
|
+
replaceState: (path, state) => {
|
|
156
|
+
currentState = state, entries[index] = path;
|
|
157
|
+
},
|
|
158
|
+
back: () => {
|
|
159
|
+
currentState = assignKey(currentState), index = Math.max(index - 1, 0);
|
|
160
|
+
},
|
|
161
|
+
forward: () => {
|
|
162
|
+
currentState = assignKey(currentState), index = Math.min(index + 1, entries.length - 1);
|
|
163
|
+
},
|
|
164
|
+
go: (n2) => {
|
|
165
|
+
currentState = assignKey(currentState), index = Math.min(Math.max(index + n2, 0), entries.length - 1);
|
|
166
|
+
},
|
|
167
|
+
createHref: (path) => path
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function parseHref(href, state) {
|
|
171
|
+
const hashIndex = href.indexOf("#"), searchIndex = href.indexOf("?");
|
|
172
|
+
return {
|
|
173
|
+
href,
|
|
174
|
+
pathname: href.substring(
|
|
175
|
+
0,
|
|
176
|
+
hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length
|
|
177
|
+
),
|
|
178
|
+
hash: hashIndex > -1 ? href.substring(hashIndex) : "",
|
|
179
|
+
search: searchIndex > -1 ? href.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
|
|
180
|
+
state: state || {}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function createRandomKey() {
|
|
184
|
+
return (Math.random() + 1).toString(36).substring(7);
|
|
185
|
+
}
|
|
186
|
+
var prefix = "Invariant failed";
|
|
187
|
+
function invariant(condition, message) {
|
|
188
|
+
if (!condition)
|
|
189
|
+
throw new Error(prefix);
|
|
190
|
+
}
|
|
191
|
+
const routerContext = React.createContext(null);
|
|
192
|
+
function getRouterContext() {
|
|
193
|
+
return typeof document > "u" ? routerContext : window.__TSR_ROUTER_CONTEXT__ ? window.__TSR_ROUTER_CONTEXT__ : (window.__TSR_ROUTER_CONTEXT__ = routerContext,
|
|
194
|
+
routerContext);
|
|
195
|
+
}
|
|
196
|
+
function useRouter(opts) {
|
|
197
|
+
return React.useContext(getRouterContext());
|
|
198
|
+
}
|
|
199
|
+
var withSelector = { exports: {} }, withSelector_production_min = {}, shim = { exports: {} }, useSyncExternalStoreShim_production_min = {};
|
|
200
|
+
/**
|
|
201
|
+
* @license React
|
|
202
|
+
* use-sync-external-store-shim.production.min.js
|
|
203
|
+
*
|
|
204
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the MIT license found in the
|
|
207
|
+
* LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/
|
|
209
|
+
var e = React__default;
|
|
210
|
+
function h$1(a, b) {
|
|
211
|
+
return a === b && (a !== 0 || 1 / a === 1 / b) || a !== a && b !== b;
|
|
212
|
+
}
|
|
213
|
+
var k = typeof Object.is == "function" ? Object.is : h$1, l = e.useState, m = e.useEffect, n$1 = e.useLayoutEffect, p$1 = e.useDebugValue;
|
|
214
|
+
function q$1(a, b) {
|
|
215
|
+
var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
|
|
216
|
+
return n$1(function() {
|
|
217
|
+
c.value = d, c.getSnapshot = b, r$1(c) && g({ inst: c });
|
|
218
|
+
}, [a, d, b]), m(function() {
|
|
219
|
+
return r$1(c) && g({ inst: c }), a(function() {
|
|
220
|
+
r$1(c) && g({ inst: c });
|
|
221
|
+
});
|
|
222
|
+
}, [a]), p$1(d), d;
|
|
223
|
+
}
|
|
224
|
+
function r$1(a) {
|
|
225
|
+
var b = a.getSnapshot;
|
|
226
|
+
a = a.value;
|
|
227
|
+
try {
|
|
228
|
+
var d = b();
|
|
229
|
+
return !k(a, d);
|
|
230
|
+
} catch {
|
|
231
|
+
return !0;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function t$1(a, b) {
|
|
235
|
+
return b();
|
|
236
|
+
}
|
|
237
|
+
var u$1 = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t$1 : q$1;
|
|
238
|
+
useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u$1;
|
|
239
|
+
shim.exports = useSyncExternalStoreShim_production_min;
|
|
240
|
+
var shimExports = shim.exports;
|
|
241
|
+
/**
|
|
242
|
+
* @license React
|
|
243
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
244
|
+
*
|
|
245
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the MIT license found in the
|
|
248
|
+
* LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/
|
|
250
|
+
var h = React__default, n = shimExports;
|
|
251
|
+
function p(a, b) {
|
|
252
|
+
return a === b && (a !== 0 || 1 / a === 1 / b) || a !== a && b !== b;
|
|
253
|
+
}
|
|
254
|
+
var q = typeof Object.is == "function" ? Object.is : p, r = n.useSyncExternalStore, t = h.useRef, u = h.useEffect, v = h.useMemo, w = h.useDebugValue;
|
|
255
|
+
withSelector_production_min.useSyncExternalStoreWithSelector = function(a, b, e2, l2, g) {
|
|
256
|
+
var c = t(null);
|
|
257
|
+
if (c.current === null) {
|
|
258
|
+
var f = { hasValue: !1, value: null };
|
|
259
|
+
c.current = f;
|
|
260
|
+
} else f = c.current;
|
|
261
|
+
c = v(function() {
|
|
262
|
+
function a2(a3) {
|
|
263
|
+
if (!c2) {
|
|
264
|
+
if (c2 = !0, d2 = a3, a3 = l2(a3), g !== void 0 && f.hasValue) {
|
|
265
|
+
var b2 = f.value;
|
|
266
|
+
if (g(b2, a3)) return k2 = b2;
|
|
267
|
+
}
|
|
268
|
+
return k2 = a3;
|
|
269
|
+
}
|
|
270
|
+
if (b2 = k2, q(d2, a3)) return b2;
|
|
271
|
+
var e3 = l2(a3);
|
|
272
|
+
return g !== void 0 && g(b2, e3) ? b2 : (d2 = a3, k2 = e3);
|
|
273
|
+
}
|
|
274
|
+
var c2 = !1, d2, k2, m2 = e2 === void 0 ? null : e2;
|
|
275
|
+
return [function() {
|
|
276
|
+
return a2(b());
|
|
277
|
+
}, m2 === null ? void 0 : function() {
|
|
278
|
+
return a2(m2());
|
|
279
|
+
}];
|
|
280
|
+
}, [b, e2, l2, g]);
|
|
281
|
+
var d = r(a, c[0], c[1]);
|
|
282
|
+
return u(function() {
|
|
283
|
+
f.hasValue = !0, f.value = d;
|
|
284
|
+
}, [d]), w(d), d;
|
|
285
|
+
};
|
|
286
|
+
withSelector.exports = withSelector_production_min;
|
|
287
|
+
var withSelectorExports = withSelector.exports;
|
|
288
|
+
class Store {
|
|
289
|
+
constructor(initialState, options) {
|
|
290
|
+
this.listeners = /* @__PURE__ */ new Set(), this._batching = !1, this._flushing = 0, this.subscribe = (listener) => {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
this.listeners.add(listener);
|
|
293
|
+
const unsub = (_b = (_a = this.options) == null ? void 0 : _a.onSubscribe) == null ? void 0 : _b.call(_a, listener, this);
|
|
294
|
+
return () => {
|
|
295
|
+
this.listeners.delete(listener), unsub?.();
|
|
296
|
+
};
|
|
297
|
+
}, this.setState = (updater) => {
|
|
298
|
+
var _a, _b, _c;
|
|
299
|
+
const previous = this.state;
|
|
300
|
+
this.state = (_a = this.options) != null && _a.updateFn ? this.options.updateFn(previous)(updater) : updater(previous), (_c = (_b = this.options) ==
|
|
301
|
+
null ? void 0 : _b.onUpdate) == null || _c.call(_b), this._flush();
|
|
302
|
+
}, this._flush = () => {
|
|
303
|
+
if (this._batching) return;
|
|
304
|
+
const flushId = ++this._flushing;
|
|
305
|
+
this.listeners.forEach((listener) => {
|
|
306
|
+
this._flushing === flushId && listener();
|
|
307
|
+
});
|
|
308
|
+
}, this.batch = (cb) => {
|
|
309
|
+
if (this._batching) return cb();
|
|
310
|
+
this._batching = !0, cb(), this._batching = !1, this._flush();
|
|
311
|
+
}, this.state = initialState, this.options = options;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function useStore(store, selector = (d) => d) {
|
|
315
|
+
return withSelectorExports.useSyncExternalStoreWithSelector(
|
|
316
|
+
store.subscribe,
|
|
317
|
+
() => store.state,
|
|
318
|
+
() => store.state,
|
|
319
|
+
selector,
|
|
320
|
+
shallow
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
function shallow(objA, objB) {
|
|
324
|
+
if (Object.is(objA, objB))
|
|
325
|
+
return !0;
|
|
326
|
+
if (typeof objA != "object" || objA === null || typeof objB != "object" || objB === null)
|
|
327
|
+
return !1;
|
|
328
|
+
const keysA = Object.keys(objA);
|
|
329
|
+
if (keysA.length !== Object.keys(objB).length)
|
|
330
|
+
return !1;
|
|
331
|
+
for (let i = 0; i < keysA.length; i++)
|
|
332
|
+
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]]))
|
|
333
|
+
return !1;
|
|
334
|
+
return !0;
|
|
335
|
+
}
|
|
336
|
+
const rootRouteId = "__root__";
|
|
337
|
+
function encode(obj, pfx) {
|
|
338
|
+
let k2, i, tmp, str = "";
|
|
339
|
+
for (k2 in obj)
|
|
340
|
+
if ((tmp = obj[k2]) !== void 0)
|
|
341
|
+
if (Array.isArray(tmp))
|
|
342
|
+
for (i = 0; i < tmp.length; i++)
|
|
343
|
+
str && (str += "&"), str += encodeURIComponent(k2) + "=" + encodeURIComponent(tmp[i]);
|
|
344
|
+
else
|
|
345
|
+
str && (str += "&"), str += encodeURIComponent(k2) + "=" + encodeURIComponent(tmp);
|
|
346
|
+
return "" + str;
|
|
347
|
+
}
|
|
348
|
+
function toValue(mix) {
|
|
349
|
+
if (!mix) return "";
|
|
350
|
+
const str = decodeURIComponent(mix);
|
|
351
|
+
return str === "false" ? !1 : str === "true" ? !0 : +str * 0 === 0 && +str + "" === str ? +str : str;
|
|
352
|
+
}
|
|
353
|
+
function decode(str, pfx) {
|
|
354
|
+
let tmp, k2;
|
|
355
|
+
const out = {}, arr = str.split("&");
|
|
356
|
+
for (; tmp = arr.shift(); ) {
|
|
357
|
+
const equalIndex = tmp.indexOf("=");
|
|
358
|
+
if (equalIndex !== -1) {
|
|
359
|
+
k2 = tmp.slice(0, equalIndex);
|
|
360
|
+
const value = tmp.slice(equalIndex + 1);
|
|
361
|
+
out[k2] !== void 0 ? out[k2] = [].concat(out[k2], toValue(value)) : out[k2] = toValue(value);
|
|
362
|
+
} else
|
|
363
|
+
k2 = tmp, out[k2] = "";
|
|
364
|
+
}
|
|
365
|
+
return out;
|
|
366
|
+
}
|
|
367
|
+
const defaultParseSearch = parseSearchWith(JSON.parse), defaultStringifySearch = stringifySearchWith(
|
|
368
|
+
JSON.stringify,
|
|
369
|
+
JSON.parse
|
|
370
|
+
);
|
|
371
|
+
function parseSearchWith(parser) {
|
|
372
|
+
return (searchStr) => {
|
|
373
|
+
searchStr.substring(0, 1) === "?" && (searchStr = searchStr.substring(1));
|
|
374
|
+
const query = decode(searchStr);
|
|
375
|
+
for (const key in query) {
|
|
376
|
+
const value = query[key];
|
|
377
|
+
if (typeof value == "string")
|
|
378
|
+
try {
|
|
379
|
+
query[key] = parser(value);
|
|
380
|
+
} catch {
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return query;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function stringifySearchWith(stringify, parser) {
|
|
387
|
+
function stringifyValue(val) {
|
|
388
|
+
if (typeof val == "object" && val !== null)
|
|
389
|
+
try {
|
|
390
|
+
return stringify(val);
|
|
391
|
+
} catch {
|
|
392
|
+
}
|
|
393
|
+
else if (typeof val == "string" && typeof parser == "function")
|
|
394
|
+
try {
|
|
395
|
+
return parser(val), stringify(val);
|
|
396
|
+
} catch {
|
|
397
|
+
}
|
|
398
|
+
return val;
|
|
399
|
+
}
|
|
400
|
+
return (search) => {
|
|
401
|
+
search = { ...search }, Object.keys(search).forEach((key) => {
|
|
402
|
+
const val = search[key];
|
|
403
|
+
typeof val > "u" || val === void 0 ? delete search[key] : search[key] = stringifyValue(val);
|
|
404
|
+
});
|
|
405
|
+
const searchStr = encode(search).toString();
|
|
406
|
+
return searchStr ? `?${searchStr}` : "";
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
function last(arr) {
|
|
410
|
+
return arr[arr.length - 1];
|
|
411
|
+
}
|
|
412
|
+
function isFunction(d) {
|
|
413
|
+
return typeof d == "function";
|
|
414
|
+
}
|
|
415
|
+
function functionalUpdate(updater, previous) {
|
|
416
|
+
return isFunction(updater) ? updater(previous) : updater;
|
|
417
|
+
}
|
|
418
|
+
function pick(parent, keys) {
|
|
419
|
+
return keys.reduce((obj, key) => (obj[key] = parent[key], obj), {});
|
|
420
|
+
}
|
|
421
|
+
function replaceEqualDeep(prev, _next) {
|
|
422
|
+
if (prev === _next)
|
|
423
|
+
return prev;
|
|
424
|
+
const next = _next, array = isPlainArray(prev) && isPlainArray(next);
|
|
425
|
+
if (array || isPlainObject(prev) && isPlainObject(next)) {
|
|
426
|
+
const prevItems = array ? prev : Object.keys(prev), prevSize = prevItems.length, nextItems = array ? next : Object.keys(next), nextSize = nextItems.
|
|
427
|
+
length, copy = array ? [] : {};
|
|
428
|
+
let equalItems = 0;
|
|
429
|
+
for (let i = 0; i < nextSize; i++) {
|
|
430
|
+
const key = array ? i : nextItems[i];
|
|
431
|
+
(!array && prevItems.includes(key) || array) && prev[key] === void 0 && next[key] === void 0 ? (copy[key] = void 0, equalItems++) : (copy[key] =
|
|
432
|
+
replaceEqualDeep(prev[key], next[key]), copy[key] === prev[key] && prev[key] !== void 0 && equalItems++);
|
|
433
|
+
}
|
|
434
|
+
return prevSize === nextSize && equalItems === prevSize ? prev : copy;
|
|
435
|
+
}
|
|
436
|
+
return next;
|
|
437
|
+
}
|
|
438
|
+
function isPlainObject(o) {
|
|
439
|
+
if (!hasObjectPrototype(o))
|
|
440
|
+
return !1;
|
|
441
|
+
const ctor = o.constructor;
|
|
442
|
+
if (typeof ctor > "u")
|
|
443
|
+
return !0;
|
|
444
|
+
const prot = ctor.prototype;
|
|
445
|
+
return !(!hasObjectPrototype(prot) || !prot.hasOwnProperty("isPrototypeOf"));
|
|
446
|
+
}
|
|
447
|
+
function hasObjectPrototype(o) {
|
|
448
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
449
|
+
}
|
|
450
|
+
function isPlainArray(value) {
|
|
451
|
+
return Array.isArray(value) && value.length === Object.keys(value).length;
|
|
452
|
+
}
|
|
453
|
+
function deepEqual(a, b, partial = !1) {
|
|
454
|
+
if (a === b)
|
|
455
|
+
return !0;
|
|
456
|
+
if (typeof a != typeof b)
|
|
457
|
+
return !1;
|
|
458
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
459
|
+
const aKeys = Object.keys(a).filter((key) => a[key] !== void 0), bKeys = Object.keys(b).filter((key) => b[key] !== void 0);
|
|
460
|
+
return !partial && aKeys.length !== bKeys.length ? !1 : !bKeys.some(
|
|
461
|
+
(key) => !(key in a) || !deepEqual(a[key], b[key], partial)
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
return Array.isArray(a) && Array.isArray(b) ? a.length !== b.length ? !1 : !a.some((item, index) => !deepEqual(item, b[index], partial)) : !1;
|
|
465
|
+
}
|
|
466
|
+
const useLayoutEffect$1 = typeof window < "u" ? React.useLayoutEffect : React.useEffect;
|
|
467
|
+
function createControlledPromise(onResolve) {
|
|
468
|
+
let resolveLoadPromise, rejectLoadPromise;
|
|
469
|
+
const controlledPromise = new Promise((resolve, reject) => {
|
|
470
|
+
resolveLoadPromise = resolve, rejectLoadPromise = reject;
|
|
471
|
+
});
|
|
472
|
+
return controlledPromise.status = "pending", controlledPromise.resolve = (value) => {
|
|
473
|
+
controlledPromise.status = "resolved", controlledPromise.value = value, resolveLoadPromise(value), onResolve?.(value);
|
|
474
|
+
}, controlledPromise.reject = (e2) => {
|
|
475
|
+
controlledPromise.status = "rejected", rejectLoadPromise(e2);
|
|
476
|
+
}, controlledPromise;
|
|
477
|
+
}
|
|
478
|
+
function usePrevious(value) {
|
|
479
|
+
const ref = React.useRef({
|
|
480
|
+
value,
|
|
481
|
+
prev: null
|
|
482
|
+
}), current = ref.current.value;
|
|
483
|
+
return value !== current && (ref.current = {
|
|
484
|
+
value,
|
|
485
|
+
prev: current
|
|
486
|
+
}), ref.current.prev;
|
|
487
|
+
}
|
|
488
|
+
function joinPaths(paths) {
|
|
489
|
+
return cleanPath(
|
|
490
|
+
paths.filter((val) => val !== void 0).join("/")
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
function cleanPath(path) {
|
|
494
|
+
return path.replace(/\/{2,}/g, "/");
|
|
495
|
+
}
|
|
496
|
+
function trimPathLeft(path) {
|
|
497
|
+
return path === "/" ? path : path.replace(/^\/{1,}/, "");
|
|
498
|
+
}
|
|
499
|
+
function trimPathRight(path) {
|
|
500
|
+
return path === "/" ? path : path.replace(/\/{1,}$/, "");
|
|
501
|
+
}
|
|
502
|
+
function trimPath(path) {
|
|
503
|
+
return trimPathRight(trimPathLeft(path));
|
|
504
|
+
}
|
|
505
|
+
function removeTrailingSlash(value, basepath) {
|
|
506
|
+
return value.endsWith("/") && value !== "/" && value !== `${basepath}/` ? value.slice(0, -1) : value;
|
|
507
|
+
}
|
|
508
|
+
function exactPathTest(pathName1, pathName2, basepath) {
|
|
509
|
+
return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);
|
|
510
|
+
}
|
|
511
|
+
function resolvePath({
|
|
512
|
+
basepath,
|
|
513
|
+
base,
|
|
514
|
+
to,
|
|
515
|
+
trailingSlash = "never"
|
|
516
|
+
}) {
|
|
517
|
+
var _a, _b;
|
|
518
|
+
base = removeBasepath(basepath, base), to = removeBasepath(basepath, to);
|
|
519
|
+
let baseSegments = parsePathname(base);
|
|
520
|
+
const toSegments = parsePathname(to);
|
|
521
|
+
baseSegments.length > 1 && ((_a = last(baseSegments)) == null ? void 0 : _a.value) === "/" && baseSegments.pop(), toSegments.forEach((toSegment, index) => {
|
|
522
|
+
toSegment.value === "/" ? index ? index === toSegments.length - 1 && baseSegments.push(toSegment) : baseSegments = [toSegment] : toSegment.value ===
|
|
523
|
+
".." ? baseSegments.pop() : toSegment.value === "." || baseSegments.push(toSegment);
|
|
524
|
+
}), baseSegments.length > 1 && (((_b = last(baseSegments)) == null ? void 0 : _b.value) === "/" ? trailingSlash === "never" && baseSegments.pop() : trailingSlash ===
|
|
525
|
+
"always" && baseSegments.push({ type: "pathname", value: "/" }));
|
|
526
|
+
const joined = joinPaths([basepath, ...baseSegments.map((d) => d.value)]);
|
|
527
|
+
return cleanPath(joined);
|
|
528
|
+
}
|
|
529
|
+
function parsePathname(pathname) {
|
|
530
|
+
if (!pathname)
|
|
531
|
+
return [];
|
|
532
|
+
pathname = cleanPath(pathname);
|
|
533
|
+
const segments = [];
|
|
534
|
+
if (pathname.slice(0, 1) === "/" && (pathname = pathname.substring(1), segments.push({
|
|
535
|
+
type: "pathname",
|
|
536
|
+
value: "/"
|
|
537
|
+
})), !pathname)
|
|
538
|
+
return segments;
|
|
539
|
+
const split = pathname.split("/").filter(Boolean);
|
|
540
|
+
return segments.push(
|
|
541
|
+
...split.map((part) => part === "$" || part === "*" ? {
|
|
542
|
+
type: "wildcard",
|
|
543
|
+
value: part
|
|
544
|
+
} : part.charAt(0) === "$" ? {
|
|
545
|
+
type: "param",
|
|
546
|
+
value: part
|
|
547
|
+
} : {
|
|
548
|
+
type: "pathname",
|
|
549
|
+
value: decodeURIComponent(part)
|
|
550
|
+
})
|
|
551
|
+
), pathname.slice(-1) === "/" && (pathname = pathname.substring(1), segments.push({
|
|
552
|
+
type: "pathname",
|
|
553
|
+
value: "/"
|
|
554
|
+
})), segments;
|
|
555
|
+
}
|
|
556
|
+
function interpolatePath({
|
|
557
|
+
path,
|
|
558
|
+
params,
|
|
559
|
+
leaveWildcards,
|
|
560
|
+
leaveParams
|
|
561
|
+
}) {
|
|
562
|
+
const interpolatedPathSegments = parsePathname(path), encodedParams = {};
|
|
563
|
+
for (const [key, value] of Object.entries(params)) {
|
|
564
|
+
const isValueString = typeof value == "string";
|
|
565
|
+
["*", "_splat"].includes(key) ? encodedParams[key] = isValueString ? encodeURI(value) : value : encodedParams[key] = isValueString ? encodeURIComponent(
|
|
566
|
+
value) : value;
|
|
567
|
+
}
|
|
568
|
+
return joinPaths(
|
|
569
|
+
interpolatedPathSegments.map((segment) => {
|
|
570
|
+
if (segment.type === "wildcard") {
|
|
571
|
+
const value = encodedParams._splat;
|
|
572
|
+
return leaveWildcards ? `${segment.value}${value ?? ""}` : value;
|
|
573
|
+
}
|
|
574
|
+
if (segment.type === "param") {
|
|
575
|
+
if (leaveParams) {
|
|
576
|
+
const value = encodedParams[segment.value];
|
|
577
|
+
return `${segment.value}${value ?? ""}`;
|
|
578
|
+
}
|
|
579
|
+
return encodedParams[segment.value.substring(1)] ?? "undefined";
|
|
580
|
+
}
|
|
581
|
+
return segment.value;
|
|
582
|
+
})
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
function matchPathname(basepath, currentPathname, matchLocation) {
|
|
586
|
+
const pathParams = matchByPath(basepath, currentPathname, matchLocation);
|
|
587
|
+
if (!(matchLocation.to && !pathParams))
|
|
588
|
+
return pathParams ?? {};
|
|
589
|
+
}
|
|
590
|
+
function removeBasepath(basepath, pathname) {
|
|
591
|
+
switch (!0) {
|
|
592
|
+
case basepath === "/":
|
|
593
|
+
return pathname;
|
|
594
|
+
case pathname === basepath:
|
|
595
|
+
return "";
|
|
596
|
+
case pathname.length < basepath.length:
|
|
597
|
+
return pathname;
|
|
598
|
+
case pathname[basepath.length] !== "/":
|
|
599
|
+
return pathname;
|
|
600
|
+
case pathname.startsWith(basepath):
|
|
601
|
+
return pathname.slice(basepath.length);
|
|
602
|
+
default:
|
|
603
|
+
return pathname;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function matchByPath(basepath, from, matchLocation) {
|
|
607
|
+
from = removeBasepath(basepath, from);
|
|
608
|
+
const to = removeBasepath(basepath, `${matchLocation.to ?? "$"}`), baseSegments = parsePathname(from), routeSegments = parsePathname(to);
|
|
609
|
+
from.startsWith("/") || baseSegments.unshift({
|
|
610
|
+
type: "pathname",
|
|
611
|
+
value: "/"
|
|
612
|
+
}), to.startsWith("/") || routeSegments.unshift({
|
|
613
|
+
type: "pathname",
|
|
614
|
+
value: "/"
|
|
615
|
+
});
|
|
616
|
+
const params = {};
|
|
617
|
+
return (() => {
|
|
618
|
+
for (let i = 0; i < Math.max(baseSegments.length, routeSegments.length); i++) {
|
|
619
|
+
const baseSegment = baseSegments[i], routeSegment = routeSegments[i], isLastBaseSegment = i >= baseSegments.length - 1, isLastRouteSegment = i >=
|
|
620
|
+
routeSegments.length - 1;
|
|
621
|
+
if (routeSegment) {
|
|
622
|
+
if (routeSegment.type === "wildcard") {
|
|
623
|
+
if (baseSegment?.value) {
|
|
624
|
+
const _splat = decodeURI(
|
|
625
|
+
joinPaths(baseSegments.slice(i).map((d) => d.value))
|
|
626
|
+
);
|
|
627
|
+
return params["*"] = _splat, params._splat = _splat, !0;
|
|
628
|
+
}
|
|
629
|
+
return !1;
|
|
630
|
+
}
|
|
631
|
+
if (routeSegment.type === "pathname") {
|
|
632
|
+
if (routeSegment.value === "/" && !baseSegment?.value)
|
|
633
|
+
return !0;
|
|
634
|
+
if (baseSegment) {
|
|
635
|
+
if (matchLocation.caseSensitive) {
|
|
636
|
+
if (routeSegment.value !== baseSegment.value)
|
|
637
|
+
return !1;
|
|
638
|
+
} else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase())
|
|
639
|
+
return !1;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
if (!baseSegment)
|
|
643
|
+
return !1;
|
|
644
|
+
if (routeSegment.type === "param") {
|
|
645
|
+
if (baseSegment.value === "/")
|
|
646
|
+
return !1;
|
|
647
|
+
baseSegment.value.charAt(0) !== "$" && (params[routeSegment.value.substring(1)] = decodeURIComponent(
|
|
648
|
+
baseSegment.value
|
|
649
|
+
));
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (!isLastBaseSegment && isLastRouteSegment)
|
|
653
|
+
return params["**"] = joinPaths(baseSegments.slice(i + 1).map((d) => d.value)), !!matchLocation.fuzzy && routeSegment?.value !== "/";
|
|
654
|
+
}
|
|
655
|
+
return !0;
|
|
656
|
+
})() ? params : void 0;
|
|
657
|
+
}
|
|
658
|
+
function isRedirect(obj) {
|
|
659
|
+
return !!obj?.isRedirect;
|
|
660
|
+
}
|
|
661
|
+
function isResolvedRedirect(obj) {
|
|
662
|
+
return !!obj?.isRedirect && obj.href;
|
|
663
|
+
}
|
|
664
|
+
function CatchBoundary(props) {
|
|
665
|
+
const errorComponent = props.errorComponent ?? ErrorComponent;
|
|
666
|
+
return /* @__PURE__ */ jsx(
|
|
667
|
+
CatchBoundaryImpl,
|
|
668
|
+
{
|
|
669
|
+
getResetKey: props.getResetKey,
|
|
670
|
+
onCatch: props.onCatch,
|
|
671
|
+
children: ({ error, reset }) => error ? React.createElement(errorComponent, {
|
|
672
|
+
error,
|
|
673
|
+
reset
|
|
674
|
+
}) : props.children
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
class CatchBoundaryImpl extends React.Component {
|
|
679
|
+
constructor() {
|
|
680
|
+
super(...arguments), this.state = { error: null };
|
|
681
|
+
}
|
|
682
|
+
static getDerivedStateFromProps(props) {
|
|
683
|
+
return { resetKey: props.getResetKey() };
|
|
684
|
+
}
|
|
685
|
+
static getDerivedStateFromError(error) {
|
|
686
|
+
return { error };
|
|
687
|
+
}
|
|
688
|
+
reset() {
|
|
689
|
+
this.setState({ error: null });
|
|
690
|
+
}
|
|
691
|
+
componentDidUpdate(prevProps, prevState) {
|
|
692
|
+
prevState.error && prevState.resetKey !== this.state.resetKey && this.reset();
|
|
693
|
+
}
|
|
694
|
+
componentDidCatch(error, errorInfo) {
|
|
695
|
+
this.props.onCatch && this.props.onCatch(error, errorInfo);
|
|
696
|
+
}
|
|
697
|
+
render() {
|
|
698
|
+
return this.props.children({
|
|
699
|
+
error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error,
|
|
700
|
+
reset: () => {
|
|
701
|
+
this.reset();
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function ErrorComponent({ error }) {
|
|
707
|
+
const [show, setShow] = React.useState(!1);
|
|
708
|
+
return /* @__PURE__ */ jsxs("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [
|
|
709
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [
|
|
710
|
+
/* @__PURE__ */ jsx("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }),
|
|
711
|
+
/* @__PURE__ */ jsx(
|
|
712
|
+
"button",
|
|
713
|
+
{
|
|
714
|
+
style: {
|
|
715
|
+
appearance: "none",
|
|
716
|
+
fontSize: ".6em",
|
|
717
|
+
border: "1px solid currentColor",
|
|
718
|
+
padding: ".1rem .2rem",
|
|
719
|
+
fontWeight: "bold",
|
|
720
|
+
borderRadius: ".25rem"
|
|
721
|
+
},
|
|
722
|
+
onClick: () => setShow((d) => !d),
|
|
723
|
+
children: show ? "Hide Error" : "Show Error"
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
] }),
|
|
727
|
+
/* @__PURE__ */ jsx("div", { style: { height: ".25rem" } }),
|
|
728
|
+
show ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
729
|
+
"pre",
|
|
730
|
+
{
|
|
731
|
+
style: {
|
|
732
|
+
fontSize: ".7em",
|
|
733
|
+
border: "1px solid red",
|
|
734
|
+
borderRadius: ".25rem",
|
|
735
|
+
padding: ".3rem",
|
|
736
|
+
color: "red",
|
|
737
|
+
overflow: "auto"
|
|
738
|
+
},
|
|
739
|
+
children: error.message ? /* @__PURE__ */ jsx("code", { children: error.message }) : null
|
|
740
|
+
}
|
|
741
|
+
) }) : null
|
|
742
|
+
] });
|
|
743
|
+
}
|
|
744
|
+
function useRouterState(opts) {
|
|
745
|
+
const contextRouter = useRouter();
|
|
746
|
+
return useStore((opts?.router || contextRouter).__store, opts?.select);
|
|
747
|
+
}
|
|
748
|
+
function notFound(options = {}) {
|
|
749
|
+
if (options.isNotFound = !0, options.throw) throw options;
|
|
750
|
+
return options;
|
|
751
|
+
}
|
|
752
|
+
function isNotFound(obj) {
|
|
753
|
+
return !!obj?.isNotFound;
|
|
754
|
+
}
|
|
755
|
+
function CatchNotFound(props) {
|
|
756
|
+
const resetKey = useRouterState({
|
|
757
|
+
select: (s) => `not-found-${s.location.pathname}-${s.status}`
|
|
758
|
+
});
|
|
759
|
+
return /* @__PURE__ */ jsx(
|
|
760
|
+
CatchBoundary,
|
|
761
|
+
{
|
|
762
|
+
getResetKey: () => resetKey,
|
|
763
|
+
onCatch: (error, errorInfo) => {
|
|
764
|
+
var _a;
|
|
765
|
+
if (isNotFound(error))
|
|
766
|
+
(_a = props.onCatch) == null || _a.call(props, error, errorInfo);
|
|
767
|
+
else
|
|
768
|
+
throw error;
|
|
769
|
+
},
|
|
770
|
+
errorComponent: ({ error }) => {
|
|
771
|
+
var _a;
|
|
772
|
+
return (_a = props.fallback) == null ? void 0 : _a.call(props, error);
|
|
773
|
+
},
|
|
774
|
+
children: props.children
|
|
775
|
+
}
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
function DefaultGlobalNotFound() {
|
|
779
|
+
return /* @__PURE__ */ jsx("p", { children: "Not Found" });
|
|
780
|
+
}
|
|
781
|
+
const componentTypes = [
|
|
782
|
+
"component",
|
|
783
|
+
"errorComponent",
|
|
784
|
+
"pendingComponent",
|
|
785
|
+
"notFoundComponent"
|
|
786
|
+
];
|
|
787
|
+
function createRouter(options) {
|
|
788
|
+
return new Router(options);
|
|
789
|
+
}
|
|
790
|
+
class Router {
|
|
791
|
+
/**
|
|
792
|
+
* @deprecated Use the `createRouter` function instead
|
|
793
|
+
*/
|
|
794
|
+
constructor(options) {
|
|
795
|
+
this.tempLocationKey = `${Math.round(
|
|
796
|
+
Math.random() * 1e7
|
|
797
|
+
)}`, this.resetNextScroll = !0, this.shouldViewTransition = void 0, this.subscribers = /* @__PURE__ */ new Set(), this.startReactTransition = (fn) => fn(),
|
|
798
|
+
this.update = (newOptions) => {
|
|
799
|
+
newOptions.notFoundRoute && console.warn(
|
|
800
|
+
"The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-er\
|
|
801
|
+
rors#migrating-from-notfoundroute for more info."
|
|
802
|
+
);
|
|
803
|
+
const previousOptions = this.options;
|
|
804
|
+
this.options = {
|
|
805
|
+
...this.options,
|
|
806
|
+
...newOptions
|
|
807
|
+
}, this.isServer = this.options.isServer ?? typeof document > "u", (!this.basepath || newOptions.basepath && newOptions.basepath !== previousOptions.
|
|
808
|
+
basepath) && (newOptions.basepath === void 0 || newOptions.basepath === "" || newOptions.basepath === "/" ? this.basepath = "/" : this.basepath =
|
|
809
|
+
`/${trimPath(newOptions.basepath)}`), // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
810
|
+
(!this.history || this.options.history && this.options.history !== this.history) && (this.history = this.options.history ?? (this.isServer ? createMemoryHistory(
|
|
811
|
+
{
|
|
812
|
+
initialEntries: [this.basepath || "/"]
|
|
813
|
+
}) : createBrowserHistory()), this.latestLocation = this.parseLocation()), this.options.routeTree !== this.routeTree && (this.routeTree = this.options.
|
|
814
|
+
routeTree, this.buildRouteTree()), this.__store || (this.__store = new Store(getInitialRouterState(this.latestLocation), {
|
|
815
|
+
onUpdate: () => {
|
|
816
|
+
this.__store.state = {
|
|
817
|
+
...this.state,
|
|
818
|
+
cachedMatches: this.state.cachedMatches.filter(
|
|
819
|
+
(d) => !["redirected"].includes(d.status)
|
|
820
|
+
)
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
}));
|
|
824
|
+
}, this.buildRouteTree = () => {
|
|
825
|
+
this.routesById = {}, this.routesByPath = {};
|
|
826
|
+
const notFoundRoute = this.options.notFoundRoute;
|
|
827
|
+
notFoundRoute && (notFoundRoute.init({ originalIndex: 99999999999 }), this.routesById[notFoundRoute.id] = notFoundRoute);
|
|
828
|
+
const recurseRoutes = (childRoutes) => {
|
|
829
|
+
childRoutes.forEach((childRoute, i) => {
|
|
830
|
+
childRoute.init({ originalIndex: i });
|
|
831
|
+
const existingRoute = this.routesById[childRoute.id];
|
|
832
|
+
if (invariant(
|
|
833
|
+
!existingRoute
|
|
834
|
+
), this.routesById[childRoute.id] = childRoute, !childRoute.isRoot && childRoute.path) {
|
|
835
|
+
const trimmedFullPath = trimPathRight(childRoute.fullPath);
|
|
836
|
+
(!this.routesByPath[trimmedFullPath] || childRoute.fullPath.endsWith("/")) && (this.routesByPath[trimmedFullPath] = childRoute);
|
|
837
|
+
}
|
|
838
|
+
const children = childRoute.children;
|
|
839
|
+
children?.length && recurseRoutes(children);
|
|
840
|
+
});
|
|
841
|
+
};
|
|
842
|
+
recurseRoutes([this.routeTree]);
|
|
843
|
+
const scoredRoutes = [];
|
|
844
|
+
Object.values(this.routesById).forEach((d, i) => {
|
|
845
|
+
var _a;
|
|
846
|
+
if (d.isRoot || !d.path)
|
|
847
|
+
return;
|
|
848
|
+
const trimmed = trimPathLeft(d.fullPath), parsed = parsePathname(trimmed);
|
|
849
|
+
for (; parsed.length > 1 && ((_a = parsed[0]) == null ? void 0 : _a.value) === "/"; )
|
|
850
|
+
parsed.shift();
|
|
851
|
+
const scores = parsed.map((segment) => segment.value === "/" ? 0.75 : segment.type === "param" ? 0.5 : segment.type === "wildcard" ? 0.25 : 1);
|
|
852
|
+
scoredRoutes.push({ child: d, trimmed, parsed, index: i, scores });
|
|
853
|
+
}), this.flatRoutes = scoredRoutes.sort((a, b) => {
|
|
854
|
+
const minLength = Math.min(a.scores.length, b.scores.length);
|
|
855
|
+
for (let i = 0; i < minLength; i++)
|
|
856
|
+
if (a.scores[i] !== b.scores[i])
|
|
857
|
+
return b.scores[i] - a.scores[i];
|
|
858
|
+
if (a.scores.length !== b.scores.length)
|
|
859
|
+
return b.scores.length - a.scores.length;
|
|
860
|
+
for (let i = 0; i < minLength; i++)
|
|
861
|
+
if (a.parsed[i].value !== b.parsed[i].value)
|
|
862
|
+
return a.parsed[i].value > b.parsed[i].value ? 1 : -1;
|
|
863
|
+
return a.index - b.index;
|
|
864
|
+
}).map((d, i) => (d.child.rank = i, d.child));
|
|
865
|
+
}, this.subscribe = (eventType, fn) => {
|
|
866
|
+
const listener = {
|
|
867
|
+
eventType,
|
|
868
|
+
fn
|
|
869
|
+
};
|
|
870
|
+
return this.subscribers.add(listener), () => {
|
|
871
|
+
this.subscribers.delete(listener);
|
|
872
|
+
};
|
|
873
|
+
}, this.emit = (routerEvent) => {
|
|
874
|
+
this.subscribers.forEach((listener) => {
|
|
875
|
+
listener.eventType === routerEvent.type && listener.fn(routerEvent);
|
|
876
|
+
});
|
|
877
|
+
}, this.parseLocation = (previousLocation) => {
|
|
878
|
+
const parse = ({
|
|
879
|
+
pathname,
|
|
880
|
+
search,
|
|
881
|
+
hash,
|
|
882
|
+
state
|
|
883
|
+
}) => {
|
|
884
|
+
const parsedSearch = this.options.parseSearch(search), searchStr = this.options.stringifySearch(parsedSearch);
|
|
885
|
+
return {
|
|
886
|
+
pathname,
|
|
887
|
+
searchStr,
|
|
888
|
+
search: replaceEqualDeep(previousLocation?.search, parsedSearch),
|
|
889
|
+
hash: hash.split("#").reverse()[0] ?? "",
|
|
890
|
+
href: `${pathname}${searchStr}${hash}`,
|
|
891
|
+
state: replaceEqualDeep(previousLocation?.state, state)
|
|
892
|
+
};
|
|
893
|
+
}, location = parse(this.history.location), { __tempLocation, __tempKey } = location.state;
|
|
894
|
+
if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {
|
|
895
|
+
const parsedTempLocation = parse(__tempLocation);
|
|
896
|
+
return parsedTempLocation.state.key = location.state.key, delete parsedTempLocation.state.__tempLocation, {
|
|
897
|
+
...parsedTempLocation,
|
|
898
|
+
maskedLocation: location
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
return location;
|
|
902
|
+
}, this.resolvePathWithBase = (from, path) => resolvePath({
|
|
903
|
+
basepath: this.basepath,
|
|
904
|
+
base: from,
|
|
905
|
+
to: cleanPath(path),
|
|
906
|
+
trailingSlash: this.options.trailingSlash
|
|
907
|
+
}), this.matchRoutes = (pathname, locationSearch, opts) => {
|
|
908
|
+
let routeParams = {};
|
|
909
|
+
const foundRoute = this.flatRoutes.find((route) => {
|
|
910
|
+
const matchedParams = matchPathname(
|
|
911
|
+
this.basepath,
|
|
912
|
+
trimPathRight(pathname),
|
|
913
|
+
{
|
|
914
|
+
to: route.fullPath,
|
|
915
|
+
caseSensitive: route.options.caseSensitive ?? this.options.caseSensitive,
|
|
916
|
+
fuzzy: !0
|
|
917
|
+
}
|
|
918
|
+
);
|
|
919
|
+
return matchedParams ? (routeParams = matchedParams, !0) : !1;
|
|
920
|
+
});
|
|
921
|
+
let routeCursor = foundRoute || this.routesById[rootRouteId];
|
|
922
|
+
const matchedRoutes = [routeCursor];
|
|
923
|
+
let isGlobalNotFound = !1;
|
|
924
|
+
for (// If we found a route, and it's not an index route and we have left over path
|
|
925
|
+
(foundRoute ? foundRoute.path !== "/" && routeParams["**"] : (
|
|
926
|
+
// Or if we didn't find a route and we have left over path
|
|
927
|
+
trimPathRight(pathname)
|
|
928
|
+
)) && (this.options.notFoundRoute ? matchedRoutes.push(this.options.notFoundRoute) : isGlobalNotFound = !0); routeCursor.parentRoute; )
|
|
929
|
+
routeCursor = routeCursor.parentRoute, matchedRoutes.unshift(routeCursor);
|
|
930
|
+
const globalNotFoundRouteId = (() => {
|
|
931
|
+
if (isGlobalNotFound) {
|
|
932
|
+
if (this.options.notFoundMode !== "root")
|
|
933
|
+
for (let i = matchedRoutes.length - 1; i >= 0; i--) {
|
|
934
|
+
const route = matchedRoutes[i];
|
|
935
|
+
if (route.children)
|
|
936
|
+
return route.id;
|
|
937
|
+
}
|
|
938
|
+
return rootRouteId;
|
|
939
|
+
}
|
|
940
|
+
})(), parseErrors = matchedRoutes.map((route) => {
|
|
941
|
+
var _a;
|
|
942
|
+
let parsedParamsError;
|
|
943
|
+
const parseParams = ((_a = route.options.params) == null ? void 0 : _a.parse) ?? route.options.parseParams;
|
|
944
|
+
if (parseParams)
|
|
945
|
+
try {
|
|
946
|
+
const parsedParams = parseParams(routeParams);
|
|
947
|
+
Object.assign(routeParams, parsedParams);
|
|
948
|
+
} catch (err) {
|
|
949
|
+
if (parsedParamsError = new PathParamError(err.message, {
|
|
950
|
+
cause: err
|
|
951
|
+
}), opts?.throwOnError)
|
|
952
|
+
throw parsedParamsError;
|
|
953
|
+
return parsedParamsError;
|
|
954
|
+
}
|
|
955
|
+
}), matches = [];
|
|
956
|
+
return matchedRoutes.forEach((route, index) => {
|
|
957
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
958
|
+
const parentMatch = matches[index - 1], [preMatchSearch, searchError] = (() => {
|
|
959
|
+
const parentSearch = parentMatch?.search ?? locationSearch;
|
|
960
|
+
try {
|
|
961
|
+
const validator = typeof route.options.validateSearch == "object" ? route.options.validateSearch.parse : route.options.validateSearch, search = validator?.(
|
|
962
|
+
parentSearch) ?? {};
|
|
963
|
+
return [
|
|
964
|
+
{
|
|
965
|
+
...parentSearch,
|
|
966
|
+
...search
|
|
967
|
+
},
|
|
968
|
+
void 0
|
|
969
|
+
];
|
|
970
|
+
} catch (err) {
|
|
971
|
+
const searchParamError = new SearchParamError(err.message, {
|
|
972
|
+
cause: err
|
|
973
|
+
});
|
|
974
|
+
if (opts?.throwOnError)
|
|
975
|
+
throw searchParamError;
|
|
976
|
+
return [parentSearch, searchParamError];
|
|
977
|
+
}
|
|
978
|
+
})(), loaderDeps = ((_b = (_a = route.options).loaderDeps) == null ? void 0 : _b.call(_a, {
|
|
979
|
+
search: preMatchSearch
|
|
980
|
+
})) ?? "", loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : "", interpolatedPath = interpolatePath({
|
|
981
|
+
path: route.fullPath,
|
|
982
|
+
params: routeParams
|
|
983
|
+
}), matchId = interpolatePath({
|
|
984
|
+
path: route.id,
|
|
985
|
+
params: routeParams,
|
|
986
|
+
leaveWildcards: !0
|
|
987
|
+
}) + loaderDepsHash, existingMatch = this.getMatch(matchId), cause = this.state.matches.find((d) => d.id === matchId) ? "stay" : "enter";
|
|
988
|
+
let match;
|
|
989
|
+
if (existingMatch)
|
|
990
|
+
match = {
|
|
991
|
+
...existingMatch,
|
|
992
|
+
cause,
|
|
993
|
+
params: routeParams
|
|
994
|
+
};
|
|
995
|
+
else {
|
|
996
|
+
const status = route.options.loader || route.options.beforeLoad || route.lazyFn ? "pending" : "success";
|
|
997
|
+
match = {
|
|
998
|
+
id: matchId,
|
|
999
|
+
index,
|
|
1000
|
+
routeId: route.id,
|
|
1001
|
+
params: routeParams,
|
|
1002
|
+
pathname: joinPaths([this.basepath, interpolatedPath]),
|
|
1003
|
+
updatedAt: Date.now(),
|
|
1004
|
+
search: {},
|
|
1005
|
+
searchError: void 0,
|
|
1006
|
+
status,
|
|
1007
|
+
isFetching: !1,
|
|
1008
|
+
error: void 0,
|
|
1009
|
+
paramsError: parseErrors[index],
|
|
1010
|
+
routeContext: void 0,
|
|
1011
|
+
context: void 0,
|
|
1012
|
+
abortController: new AbortController(),
|
|
1013
|
+
fetchCount: 0,
|
|
1014
|
+
cause,
|
|
1015
|
+
loaderDeps,
|
|
1016
|
+
invalid: !1,
|
|
1017
|
+
preload: !1,
|
|
1018
|
+
links: (_d = (_c = route.options).links) == null ? void 0 : _d.call(_c),
|
|
1019
|
+
scripts: (_f = (_e = route.options).scripts) == null ? void 0 : _f.call(_e),
|
|
1020
|
+
staticData: route.options.staticData || {},
|
|
1021
|
+
loadPromise: createControlledPromise()
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
match.status === "success" && (match.meta = (_h = (_g = route.options).meta) == null ? void 0 : _h.call(_g, {
|
|
1025
|
+
matches,
|
|
1026
|
+
match,
|
|
1027
|
+
params: match.params,
|
|
1028
|
+
loaderData: match.loaderData
|
|
1029
|
+
}), match.headers = (_j = (_i = route.options).headers) == null ? void 0 : _j.call(_i, {
|
|
1030
|
+
loaderData: match.loaderData
|
|
1031
|
+
})), opts?.preload || (match.globalNotFound = globalNotFoundRouteId === route.id), match.search = replaceEqualDeep(match.search, preMatchSearch),
|
|
1032
|
+
match.searchError = searchError, matches.push(match);
|
|
1033
|
+
}), matches;
|
|
1034
|
+
}, this.cancelMatch = (id) => {
|
|
1035
|
+
const match = this.getMatch(id);
|
|
1036
|
+
match && (match.abortController.abort(), clearTimeout(match.pendingTimeout));
|
|
1037
|
+
}, this.cancelMatches = () => {
|
|
1038
|
+
var _a;
|
|
1039
|
+
(_a = this.state.pendingMatches) == null || _a.forEach((match) => {
|
|
1040
|
+
this.cancelMatch(match.id);
|
|
1041
|
+
});
|
|
1042
|
+
}, this.buildLocation = (opts) => {
|
|
1043
|
+
const build = (dest = {}, matches) => {
|
|
1044
|
+
var _a, _b, _c;
|
|
1045
|
+
const fromMatches = dest._fromLocation != null ? this.matchRoutes(
|
|
1046
|
+
dest._fromLocation.pathname,
|
|
1047
|
+
dest.fromSearch || dest._fromLocation.search
|
|
1048
|
+
) : this.state.matches, fromMatch = dest.from != null ? fromMatches.find(
|
|
1049
|
+
(d) => matchPathname(this.basepath, trimPathRight(d.pathname), {
|
|
1050
|
+
to: dest.from,
|
|
1051
|
+
caseSensitive: !1,
|
|
1052
|
+
fuzzy: !1
|
|
1053
|
+
})
|
|
1054
|
+
) : void 0, fromPath = fromMatch?.pathname || this.latestLocation.pathname;
|
|
1055
|
+
invariant(
|
|
1056
|
+
dest.from == null || fromMatch != null
|
|
1057
|
+
);
|
|
1058
|
+
const fromSearch = ((_a = last(fromMatches)) == null ? void 0 : _a.search) || this.latestLocation.search, stayingMatches = matches?.filter(
|
|
1059
|
+
(d) => fromMatches.find((e2) => e2.routeId === d.routeId)
|
|
1060
|
+
), fromRouteByFromPathRouteId = this.routesById[(_b = stayingMatches?.find((d) => d.pathname === fromPath)) == null ? void 0 : _b.routeId];
|
|
1061
|
+
let pathname = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(
|
|
1062
|
+
fromPath,
|
|
1063
|
+
fromRouteByFromPathRouteId?.to ?? fromPath
|
|
1064
|
+
);
|
|
1065
|
+
const prevParams = { ...(_c = last(fromMatches)) == null ? void 0 : _c.params };
|
|
1066
|
+
let nextParams = (dest.params ?? !0) === !0 ? prevParams : { ...prevParams, ...functionalUpdate(dest.params, prevParams) };
|
|
1067
|
+
Object.keys(nextParams).length > 0 && matches?.map((d) => {
|
|
1068
|
+
var _a2;
|
|
1069
|
+
const route = this.looseRoutesById[d.routeId];
|
|
1070
|
+
return ((_a2 = route?.options.params) == null ? void 0 : _a2.stringify) ?? route.options.stringifyParams;
|
|
1071
|
+
}).filter(Boolean).forEach((fn) => {
|
|
1072
|
+
nextParams = { ...nextParams, ...fn(nextParams) };
|
|
1073
|
+
}), pathname = interpolatePath({
|
|
1074
|
+
path: pathname,
|
|
1075
|
+
params: nextParams ?? {},
|
|
1076
|
+
leaveWildcards: !1,
|
|
1077
|
+
leaveParams: opts.leaveParams
|
|
1078
|
+
});
|
|
1079
|
+
const preSearchFilters = stayingMatches?.map(
|
|
1080
|
+
(match) => this.looseRoutesById[match.routeId].options.preSearchFilters ?? []
|
|
1081
|
+
).flat().filter(Boolean) ?? [], postSearchFilters = stayingMatches?.map(
|
|
1082
|
+
(match) => this.looseRoutesById[match.routeId].options.postSearchFilters ?? []
|
|
1083
|
+
).flat().filter(Boolean) ?? [], preFilteredSearch = preSearchFilters.length ? preSearchFilters.reduce((prev, next) => next(prev), fromSearch) :
|
|
1084
|
+
fromSearch, destSearch = dest.search === !0 ? preFilteredSearch : dest.search ? functionalUpdate(dest.search, preFilteredSearch) : preSearchFilters.
|
|
1085
|
+
length ? preFilteredSearch : {}, postFilteredSearch = postSearchFilters.length ? postSearchFilters.reduce((prev, next) => next(prev), destSearch) :
|
|
1086
|
+
destSearch, search = replaceEqualDeep(fromSearch, postFilteredSearch), searchStr = this.options.stringifySearch(search), hash = dest.hash === !0 ?
|
|
1087
|
+
this.latestLocation.hash : dest.hash ? functionalUpdate(dest.hash, this.latestLocation.hash) : void 0, hashStr = hash ? `#${hash}` : "";
|
|
1088
|
+
let nextState = dest.state === !0 ? this.latestLocation.state : dest.state ? functionalUpdate(dest.state, this.latestLocation.state) : {};
|
|
1089
|
+
return nextState = replaceEqualDeep(this.latestLocation.state, nextState), {
|
|
1090
|
+
pathname,
|
|
1091
|
+
search,
|
|
1092
|
+
searchStr,
|
|
1093
|
+
state: nextState,
|
|
1094
|
+
hash: hash ?? "",
|
|
1095
|
+
href: `${pathname}${searchStr}${hashStr}`,
|
|
1096
|
+
unmaskOnReload: dest.unmaskOnReload
|
|
1097
|
+
};
|
|
1098
|
+
}, buildWithMatches = (dest = {}, maskedDest) => {
|
|
1099
|
+
var _a;
|
|
1100
|
+
const next = build(dest);
|
|
1101
|
+
let maskedNext = maskedDest ? build(maskedDest) : void 0;
|
|
1102
|
+
if (!maskedNext) {
|
|
1103
|
+
let params = {};
|
|
1104
|
+
const foundMask = (_a = this.options.routeMasks) == null ? void 0 : _a.find((d) => {
|
|
1105
|
+
const match = matchPathname(this.basepath, next.pathname, {
|
|
1106
|
+
to: d.from,
|
|
1107
|
+
caseSensitive: !1,
|
|
1108
|
+
fuzzy: !1
|
|
1109
|
+
});
|
|
1110
|
+
return match ? (params = match, !0) : !1;
|
|
1111
|
+
});
|
|
1112
|
+
if (foundMask) {
|
|
1113
|
+
const { from, ...maskProps } = foundMask;
|
|
1114
|
+
maskedDest = {
|
|
1115
|
+
...pick(opts, ["from"]),
|
|
1116
|
+
...maskProps,
|
|
1117
|
+
params
|
|
1118
|
+
}, maskedNext = build(maskedDest);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
const nextMatches = this.matchRoutes(next.pathname, next.search), maskedMatches = maskedNext ? this.matchRoutes(maskedNext.pathname, maskedNext.
|
|
1122
|
+
search) : void 0, maskedFinal = maskedNext ? build(maskedDest, maskedMatches) : void 0, final = build(dest, nextMatches);
|
|
1123
|
+
return maskedFinal && (final.maskedLocation = maskedFinal), final;
|
|
1124
|
+
};
|
|
1125
|
+
return opts.mask ? buildWithMatches(opts, {
|
|
1126
|
+
...pick(opts, ["from"]),
|
|
1127
|
+
...opts.mask
|
|
1128
|
+
}) : buildWithMatches(opts);
|
|
1129
|
+
}, this.commitLocation = ({
|
|
1130
|
+
viewTransition,
|
|
1131
|
+
ignoreBlocker,
|
|
1132
|
+
...next
|
|
1133
|
+
}) => {
|
|
1134
|
+
const isSameState = () => {
|
|
1135
|
+
next.state.key = this.latestLocation.state.key;
|
|
1136
|
+
const isEqual = deepEqual(next.state, this.latestLocation.state);
|
|
1137
|
+
return delete next.state.key, isEqual;
|
|
1138
|
+
}, isSameUrl = this.latestLocation.href === next.href, previousCommitPromise = this.commitLocationPromise;
|
|
1139
|
+
if (this.commitLocationPromise = createControlledPromise(() => {
|
|
1140
|
+
previousCommitPromise?.resolve();
|
|
1141
|
+
}), isSameUrl && isSameState())
|
|
1142
|
+
this.load();
|
|
1143
|
+
else {
|
|
1144
|
+
let { maskedLocation, ...nextHistory } = next;
|
|
1145
|
+
maskedLocation && (nextHistory = {
|
|
1146
|
+
...maskedLocation,
|
|
1147
|
+
state: {
|
|
1148
|
+
...maskedLocation.state,
|
|
1149
|
+
__tempKey: void 0,
|
|
1150
|
+
__tempLocation: {
|
|
1151
|
+
...nextHistory,
|
|
1152
|
+
search: nextHistory.searchStr,
|
|
1153
|
+
state: {
|
|
1154
|
+
...nextHistory.state,
|
|
1155
|
+
__tempKey: void 0,
|
|
1156
|
+
__tempLocation: void 0,
|
|
1157
|
+
key: void 0
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}, (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? !1) && (nextHistory.state.__tempKey = this.tempLocationKey)), this.shouldViewTransition =
|
|
1162
|
+
viewTransition, this.history[next.replace ? "replace" : "push"](
|
|
1163
|
+
nextHistory.href,
|
|
1164
|
+
nextHistory.state,
|
|
1165
|
+
{ ignoreBlocker }
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
return this.resetNextScroll = next.resetScroll ?? !0, this.history.subscribers.size || this.load(), this.commitLocationPromise;
|
|
1169
|
+
}, this.buildAndCommitLocation = ({
|
|
1170
|
+
replace,
|
|
1171
|
+
resetScroll,
|
|
1172
|
+
viewTransition,
|
|
1173
|
+
ignoreBlocker,
|
|
1174
|
+
...rest
|
|
1175
|
+
} = {}) => {
|
|
1176
|
+
const location = this.buildLocation(rest);
|
|
1177
|
+
return this.commitLocation({
|
|
1178
|
+
...location,
|
|
1179
|
+
viewTransition,
|
|
1180
|
+
replace,
|
|
1181
|
+
resetScroll,
|
|
1182
|
+
ignoreBlocker
|
|
1183
|
+
});
|
|
1184
|
+
}, this.navigate = ({ from, to, __isRedirect, ...rest }) => {
|
|
1185
|
+
const toString = String(to);
|
|
1186
|
+
let isExternal;
|
|
1187
|
+
try {
|
|
1188
|
+
new URL(`${toString}`), isExternal = !0;
|
|
1189
|
+
} catch {
|
|
1190
|
+
}
|
|
1191
|
+
return invariant(
|
|
1192
|
+
!isExternal
|
|
1193
|
+
), this.buildAndCommitLocation({
|
|
1194
|
+
...rest,
|
|
1195
|
+
from,
|
|
1196
|
+
to
|
|
1197
|
+
// to: toString,
|
|
1198
|
+
});
|
|
1199
|
+
}, this.load = async () => {
|
|
1200
|
+
this.latestLocation = this.parseLocation(this.latestLocation), this.__store.setState((s) => ({
|
|
1201
|
+
...s,
|
|
1202
|
+
loadedAt: Date.now()
|
|
1203
|
+
}));
|
|
1204
|
+
let redirect, notFound2;
|
|
1205
|
+
const loadPromise = new Promise((resolve) => {
|
|
1206
|
+
this.startReactTransition(async () => {
|
|
1207
|
+
var _a;
|
|
1208
|
+
try {
|
|
1209
|
+
const next = this.latestLocation, prevLocation = this.state.resolvedLocation, pathDidChange = prevLocation.href !== next.href;
|
|
1210
|
+
this.cancelMatches();
|
|
1211
|
+
let pendingMatches;
|
|
1212
|
+
this.__store.batch(() => {
|
|
1213
|
+
pendingMatches = this.matchRoutes(next.pathname, next.search), this.__store.setState((s) => ({
|
|
1214
|
+
...s,
|
|
1215
|
+
status: "pending",
|
|
1216
|
+
isLoading: !0,
|
|
1217
|
+
location: next,
|
|
1218
|
+
pendingMatches,
|
|
1219
|
+
// If a cached moved to pendingMatches, remove it from cachedMatches
|
|
1220
|
+
cachedMatches: s.cachedMatches.filter((d) => !pendingMatches.find((e2) => e2.id === d.id))
|
|
1221
|
+
}));
|
|
1222
|
+
}), this.state.redirect || this.emit({
|
|
1223
|
+
type: "onBeforeNavigate",
|
|
1224
|
+
fromLocation: prevLocation,
|
|
1225
|
+
toLocation: next,
|
|
1226
|
+
pathChanged: pathDidChange
|
|
1227
|
+
}), this.emit({
|
|
1228
|
+
type: "onBeforeLoad",
|
|
1229
|
+
fromLocation: prevLocation,
|
|
1230
|
+
toLocation: next,
|
|
1231
|
+
pathChanged: pathDidChange
|
|
1232
|
+
}), await this.loadMatches({
|
|
1233
|
+
matches: pendingMatches,
|
|
1234
|
+
location: next,
|
|
1235
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
1236
|
+
onReady: async () => {
|
|
1237
|
+
this.startViewTransition(async () => {
|
|
1238
|
+
let exitingMatches, enteringMatches, stayingMatches;
|
|
1239
|
+
this.__store.batch(() => {
|
|
1240
|
+
this.__store.setState((s) => {
|
|
1241
|
+
const previousMatches = s.matches, newMatches = s.pendingMatches || s.matches;
|
|
1242
|
+
return exitingMatches = previousMatches.filter(
|
|
1243
|
+
(match) => !newMatches.find((d) => d.id === match.id)
|
|
1244
|
+
), enteringMatches = newMatches.filter(
|
|
1245
|
+
(match) => !previousMatches.find((d) => d.id === match.id)
|
|
1246
|
+
), stayingMatches = previousMatches.filter(
|
|
1247
|
+
(match) => newMatches.find((d) => d.id === match.id)
|
|
1248
|
+
), {
|
|
1249
|
+
...s,
|
|
1250
|
+
isLoading: !1,
|
|
1251
|
+
matches: newMatches,
|
|
1252
|
+
pendingMatches: void 0,
|
|
1253
|
+
cachedMatches: [
|
|
1254
|
+
...s.cachedMatches,
|
|
1255
|
+
...exitingMatches.filter((d) => d.status !== "error")
|
|
1256
|
+
]
|
|
1257
|
+
};
|
|
1258
|
+
}), this.cleanCache();
|
|
1259
|
+
}), [
|
|
1260
|
+
[exitingMatches, "onLeave"],
|
|
1261
|
+
[enteringMatches, "onEnter"],
|
|
1262
|
+
[stayingMatches, "onStay"]
|
|
1263
|
+
].forEach(([matches, hook]) => {
|
|
1264
|
+
matches.forEach((match) => {
|
|
1265
|
+
var _a2, _b;
|
|
1266
|
+
(_b = (_a2 = this.looseRoutesById[match.routeId].options)[hook]) == null || _b.call(_a2, match);
|
|
1267
|
+
});
|
|
1268
|
+
});
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
} catch (err) {
|
|
1273
|
+
isResolvedRedirect(err) ? (redirect = err, this.isServer || this.navigate({ ...err, replace: !0, __isRedirect: !0 })) : isNotFound(err) &&
|
|
1274
|
+
(notFound2 = err), this.__store.setState((s) => ({
|
|
1275
|
+
...s,
|
|
1276
|
+
statusCode: redirect ? redirect.statusCode : notFound2 ? 404 : s.matches.some((d) => d.status === "error") ? 500 : 200,
|
|
1277
|
+
redirect
|
|
1278
|
+
}));
|
|
1279
|
+
}
|
|
1280
|
+
this.latestLoadPromise === loadPromise && ((_a = this.commitLocationPromise) == null || _a.resolve(), this.latestLoadPromise = void 0, this.
|
|
1281
|
+
commitLocationPromise = void 0), resolve();
|
|
1282
|
+
});
|
|
1283
|
+
});
|
|
1284
|
+
for (this.latestLoadPromise = loadPromise, await loadPromise; this.latestLoadPromise && loadPromise !== this.latestLoadPromise; )
|
|
1285
|
+
await this.latestLoadPromise;
|
|
1286
|
+
}, this.startViewTransition = (fn) => {
|
|
1287
|
+
var _a, _b;
|
|
1288
|
+
const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;
|
|
1289
|
+
delete this.shouldViewTransition, (_b = (_a = shouldViewTransition && typeof document < "u" ? document : void 0) == null ? void 0 : _a.startViewTransition) !=
|
|
1290
|
+
null && _b.call(_a, fn) || fn();
|
|
1291
|
+
}, this.updateMatch = (id, updater) => {
|
|
1292
|
+
var _a;
|
|
1293
|
+
let updated;
|
|
1294
|
+
const isPending = (_a = this.state.pendingMatches) == null ? void 0 : _a.find((d) => d.id === id), isMatched = this.state.matches.find((d) => d.
|
|
1295
|
+
id === id), matchesKey = isPending ? "pendingMatches" : isMatched ? "matches" : "cachedMatches";
|
|
1296
|
+
return this.__store.setState((s) => {
|
|
1297
|
+
var _a2;
|
|
1298
|
+
return {
|
|
1299
|
+
...s,
|
|
1300
|
+
[matchesKey]: (_a2 = s[matchesKey]) == null ? void 0 : _a2.map(
|
|
1301
|
+
(d) => d.id === id ? updated = updater(d) : d
|
|
1302
|
+
)
|
|
1303
|
+
};
|
|
1304
|
+
}), updated;
|
|
1305
|
+
}, this.getMatch = (matchId) => [
|
|
1306
|
+
...this.state.cachedMatches,
|
|
1307
|
+
...this.state.pendingMatches ?? [],
|
|
1308
|
+
...this.state.matches
|
|
1309
|
+
].find((d) => d.id === matchId), this.loadMatches = async ({
|
|
1310
|
+
location,
|
|
1311
|
+
matches,
|
|
1312
|
+
preload,
|
|
1313
|
+
onReady,
|
|
1314
|
+
updateMatch = this.updateMatch
|
|
1315
|
+
}) => {
|
|
1316
|
+
let firstBadMatchIndex, rendered = !1;
|
|
1317
|
+
const triggerOnReady = async () => {
|
|
1318
|
+
rendered || (rendered = !0, await onReady?.());
|
|
1319
|
+
};
|
|
1320
|
+
!this.isServer && !this.state.matches.length && triggerOnReady();
|
|
1321
|
+
const handleRedirectAndNotFound = (match, err) => {
|
|
1322
|
+
var _a, _b, _c;
|
|
1323
|
+
if (isResolvedRedirect(err)) throw err;
|
|
1324
|
+
if (isRedirect(err) || isNotFound(err)) {
|
|
1325
|
+
if (updateMatch(match.id, (prev) => ({
|
|
1326
|
+
...prev,
|
|
1327
|
+
status: isRedirect(err) ? "redirected" : isNotFound(err) ? "notFound" : "error",
|
|
1328
|
+
isFetching: !1,
|
|
1329
|
+
error: err,
|
|
1330
|
+
beforeLoadPromise: void 0,
|
|
1331
|
+
loaderPromise: void 0
|
|
1332
|
+
})), err.routeId || (err.routeId = match.routeId), (_a = match.beforeLoadPromise) == null || _a.resolve(), (_b = match.loaderPromise) == null ||
|
|
1333
|
+
_b.resolve(), (_c = match.loadPromise) == null || _c.resolve(), isRedirect(err))
|
|
1334
|
+
throw rendered = !0, err = this.resolveRedirect({ ...err, _fromLocation: location }), err;
|
|
1335
|
+
if (isNotFound(err))
|
|
1336
|
+
throw this._handleNotFound(matches, err, {
|
|
1337
|
+
updateMatch
|
|
1338
|
+
}), err;
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
try {
|
|
1342
|
+
await new Promise((resolveAll, rejectAll) => {
|
|
1343
|
+
(async () => {
|
|
1344
|
+
var _a, _b, _c;
|
|
1345
|
+
try {
|
|
1346
|
+
const handleSerialError = (index, err, routerCode) => {
|
|
1347
|
+
var _a2, _b2;
|
|
1348
|
+
const { id: matchId, routeId } = matches[index], route = this.looseRoutesById[routeId];
|
|
1349
|
+
if (err instanceof Promise)
|
|
1350
|
+
throw err;
|
|
1351
|
+
err.routerCode = routerCode, firstBadMatchIndex = firstBadMatchIndex ?? index, handleRedirectAndNotFound(this.getMatch(matchId), err);
|
|
1352
|
+
try {
|
|
1353
|
+
(_b2 = (_a2 = route.options).onError) == null || _b2.call(_a2, err);
|
|
1354
|
+
} catch (errorHandlerErr) {
|
|
1355
|
+
err = errorHandlerErr, handleRedirectAndNotFound(this.getMatch(matchId), err);
|
|
1356
|
+
}
|
|
1357
|
+
updateMatch(matchId, (prev) => {
|
|
1358
|
+
var _a3;
|
|
1359
|
+
return (_a3 = prev.beforeLoadPromise) == null || _a3.resolve(), {
|
|
1360
|
+
...prev,
|
|
1361
|
+
error: err,
|
|
1362
|
+
status: "error",
|
|
1363
|
+
isFetching: !1,
|
|
1364
|
+
updatedAt: Date.now(),
|
|
1365
|
+
abortController: new AbortController(),
|
|
1366
|
+
beforeLoadPromise: void 0
|
|
1367
|
+
};
|
|
1368
|
+
});
|
|
1369
|
+
};
|
|
1370
|
+
for (const [index, { id: matchId, routeId }] of matches.entries()) {
|
|
1371
|
+
const existingMatch = this.getMatch(matchId);
|
|
1372
|
+
if (
|
|
1373
|
+
// If we are in the middle of a load, either of these will be present
|
|
1374
|
+
// (not to be confused with `loadPromise`, which is always defined)
|
|
1375
|
+
existingMatch.beforeLoadPromise || existingMatch.loaderPromise
|
|
1376
|
+
)
|
|
1377
|
+
await existingMatch.beforeLoadPromise;
|
|
1378
|
+
else {
|
|
1379
|
+
try {
|
|
1380
|
+
updateMatch(matchId, (prev) => ({
|
|
1381
|
+
...prev,
|
|
1382
|
+
loadPromise: createControlledPromise(() => {
|
|
1383
|
+
var _a2;
|
|
1384
|
+
(_a2 = prev.loadPromise) == null || _a2.resolve();
|
|
1385
|
+
}),
|
|
1386
|
+
beforeLoadPromise: createControlledPromise()
|
|
1387
|
+
}));
|
|
1388
|
+
const route = this.looseRoutesById[routeId], abortController = new AbortController(), parentMatchId = (_a = matches[index - 1]) ==
|
|
1389
|
+
null ? void 0 : _a.id, getParentContext = () => parentMatchId ? this.getMatch(parentMatchId).context ?? this.options.context ?? {} :
|
|
1390
|
+
this.options.context ?? {}, pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs, shouldPending = !!(onReady && !this.
|
|
1391
|
+
isServer && !preload && (route.options.loader || route.options.beforeLoad) && typeof pendingMs == "number" && pendingMs !== 1 / 0 &&
|
|
1392
|
+
(route.options.pendingComponent ?? this.options.defaultPendingComponent));
|
|
1393
|
+
let pendingTimeout;
|
|
1394
|
+
shouldPending && (pendingTimeout = setTimeout(() => {
|
|
1395
|
+
try {
|
|
1396
|
+
triggerOnReady();
|
|
1397
|
+
} catch {
|
|
1398
|
+
}
|
|
1399
|
+
}, pendingMs));
|
|
1400
|
+
const { paramsError, searchError } = this.getMatch(matchId);
|
|
1401
|
+
paramsError && handleSerialError(index, paramsError, "PARSE_PARAMS"), searchError && handleSerialError(index, searchError, "VALIDA\
|
|
1402
|
+
TE_SEARCH");
|
|
1403
|
+
const parentContext = getParentContext();
|
|
1404
|
+
updateMatch(matchId, (prev) => ({
|
|
1405
|
+
...prev,
|
|
1406
|
+
isFetching: "beforeLoad",
|
|
1407
|
+
fetchCount: prev.fetchCount + 1,
|
|
1408
|
+
routeContext: replaceEqualDeep(
|
|
1409
|
+
prev.routeContext,
|
|
1410
|
+
parentContext
|
|
1411
|
+
),
|
|
1412
|
+
context: replaceEqualDeep(prev.context, parentContext),
|
|
1413
|
+
abortController,
|
|
1414
|
+
pendingTimeout
|
|
1415
|
+
}));
|
|
1416
|
+
const { search, params, routeContext, cause } = this.getMatch(matchId), beforeLoadFnContext = {
|
|
1417
|
+
search,
|
|
1418
|
+
abortController,
|
|
1419
|
+
params,
|
|
1420
|
+
preload: !!preload,
|
|
1421
|
+
context: routeContext,
|
|
1422
|
+
location,
|
|
1423
|
+
navigate: (opts) => this.navigate({ ...opts, _fromLocation: location }),
|
|
1424
|
+
buildLocation: this.buildLocation,
|
|
1425
|
+
cause: preload ? "preload" : cause
|
|
1426
|
+
}, beforeLoadContext = await ((_c = (_b = route.options).beforeLoad) == null ? void 0 : _c.call(_b, beforeLoadFnContext)) ?? {};
|
|
1427
|
+
(isRedirect(beforeLoadContext) || isNotFound(beforeLoadContext)) && handleSerialError(index, beforeLoadContext, "BEFORE_LOAD"), updateMatch(
|
|
1428
|
+
matchId, (prev) => {
|
|
1429
|
+
const routeContext2 = {
|
|
1430
|
+
...prev.routeContext,
|
|
1431
|
+
...beforeLoadContext
|
|
1432
|
+
};
|
|
1433
|
+
return {
|
|
1434
|
+
...prev,
|
|
1435
|
+
routeContext: replaceEqualDeep(
|
|
1436
|
+
prev.routeContext,
|
|
1437
|
+
routeContext2
|
|
1438
|
+
),
|
|
1439
|
+
context: replaceEqualDeep(prev.context, routeContext2),
|
|
1440
|
+
abortController
|
|
1441
|
+
};
|
|
1442
|
+
});
|
|
1443
|
+
} catch (err) {
|
|
1444
|
+
handleSerialError(index, err, "BEFORE_LOAD");
|
|
1445
|
+
}
|
|
1446
|
+
updateMatch(matchId, (prev) => {
|
|
1447
|
+
var _a2;
|
|
1448
|
+
return (_a2 = prev.beforeLoadPromise) == null || _a2.resolve(), {
|
|
1449
|
+
...prev,
|
|
1450
|
+
beforeLoadPromise: void 0,
|
|
1451
|
+
isFetching: !1
|
|
1452
|
+
};
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
const validResolvedMatches = matches.slice(0, firstBadMatchIndex), matchPromises = [];
|
|
1457
|
+
validResolvedMatches.forEach(({ id: matchId, routeId }, index) => {
|
|
1458
|
+
matchPromises.push(
|
|
1459
|
+
(async () => {
|
|
1460
|
+
const { loaderPromise: prevLoaderPromise } = this.getMatch(matchId);
|
|
1461
|
+
if (prevLoaderPromise)
|
|
1462
|
+
await prevLoaderPromise;
|
|
1463
|
+
else {
|
|
1464
|
+
const parentMatchPromise = matchPromises[index - 1], route = this.looseRoutesById[routeId], getLoaderContext = () => {
|
|
1465
|
+
const {
|
|
1466
|
+
params,
|
|
1467
|
+
loaderDeps,
|
|
1468
|
+
abortController,
|
|
1469
|
+
context,
|
|
1470
|
+
cause
|
|
1471
|
+
} = this.getMatch(matchId);
|
|
1472
|
+
return {
|
|
1473
|
+
params,
|
|
1474
|
+
deps: loaderDeps,
|
|
1475
|
+
preload: !!preload,
|
|
1476
|
+
parentMatchPromise,
|
|
1477
|
+
abortController,
|
|
1478
|
+
context,
|
|
1479
|
+
location,
|
|
1480
|
+
navigate: (opts) => this.navigate({ ...opts, _fromLocation: location }),
|
|
1481
|
+
cause: preload ? "preload" : cause,
|
|
1482
|
+
route
|
|
1483
|
+
};
|
|
1484
|
+
}, age = Date.now() - this.getMatch(matchId).updatedAt, staleAge = preload ? route.options.preloadStaleTime ?? this.options.defaultPreloadStaleTime ??
|
|
1485
|
+
3e4 : route.options.staleTime ?? this.options.defaultStaleTime ?? 0, shouldReloadOption = route.options.shouldReload, shouldReload = typeof shouldReloadOption ==
|
|
1486
|
+
"function" ? shouldReloadOption(getLoaderContext()) : shouldReloadOption;
|
|
1487
|
+
updateMatch(matchId, (prev) => ({
|
|
1488
|
+
...prev,
|
|
1489
|
+
loaderPromise: createControlledPromise(),
|
|
1490
|
+
preload: !!preload && !this.state.matches.find((d) => d.id === matchId)
|
|
1491
|
+
}));
|
|
1492
|
+
const runLoader = async () => {
|
|
1493
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h;
|
|
1494
|
+
try {
|
|
1495
|
+
const potentialPendingMinPromise = async () => {
|
|
1496
|
+
const latestMatch = this.getMatch(matchId);
|
|
1497
|
+
latestMatch.minPendingPromise && await latestMatch.minPendingPromise;
|
|
1498
|
+
};
|
|
1499
|
+
try {
|
|
1500
|
+
route._lazyPromise = route._lazyPromise || (route.lazyFn ? route.lazyFn().then((lazyRoute) => {
|
|
1501
|
+
Object.assign(
|
|
1502
|
+
route.options,
|
|
1503
|
+
lazyRoute.options
|
|
1504
|
+
);
|
|
1505
|
+
}) : Promise.resolve());
|
|
1506
|
+
const componentsPromise = this.getMatch(matchId).componentsPromise || route._lazyPromise.then(
|
|
1507
|
+
() => Promise.all(
|
|
1508
|
+
componentTypes.map(async (type) => {
|
|
1509
|
+
const component = route.options[type];
|
|
1510
|
+
component?.preload && await component.preload();
|
|
1511
|
+
})
|
|
1512
|
+
)
|
|
1513
|
+
);
|
|
1514
|
+
updateMatch(matchId, (prev) => ({
|
|
1515
|
+
...prev,
|
|
1516
|
+
isFetching: "loader",
|
|
1517
|
+
componentsPromise
|
|
1518
|
+
})), await route._lazyPromise;
|
|
1519
|
+
let loaderData = await ((_b2 = (_a2 = route.options).loader) == null ? void 0 : _b2.call(_a2, getLoaderContext()));
|
|
1520
|
+
this.serializeLoaderData && (loaderData = this.serializeLoaderData(loaderData, {
|
|
1521
|
+
router: this,
|
|
1522
|
+
match: this.getMatch(matchId)
|
|
1523
|
+
})), handleRedirectAndNotFound(
|
|
1524
|
+
this.getMatch(matchId),
|
|
1525
|
+
loaderData
|
|
1526
|
+
), await potentialPendingMinPromise();
|
|
1527
|
+
const meta = (_d = (_c2 = route.options).meta) == null ? void 0 : _d.call(_c2, {
|
|
1528
|
+
matches,
|
|
1529
|
+
match: this.getMatch(matchId),
|
|
1530
|
+
params: this.getMatch(matchId).params,
|
|
1531
|
+
loaderData
|
|
1532
|
+
}), headers = (_f = (_e = route.options).headers) == null ? void 0 : _f.call(_e, {
|
|
1533
|
+
loaderData
|
|
1534
|
+
});
|
|
1535
|
+
updateMatch(matchId, (prev) => ({
|
|
1536
|
+
...prev,
|
|
1537
|
+
error: void 0,
|
|
1538
|
+
status: "success",
|
|
1539
|
+
isFetching: !1,
|
|
1540
|
+
updatedAt: Date.now(),
|
|
1541
|
+
loaderData,
|
|
1542
|
+
meta,
|
|
1543
|
+
headers
|
|
1544
|
+
}));
|
|
1545
|
+
} catch (e2) {
|
|
1546
|
+
let error = e2;
|
|
1547
|
+
await potentialPendingMinPromise(), handleRedirectAndNotFound(this.getMatch(matchId), e2);
|
|
1548
|
+
try {
|
|
1549
|
+
(_h = (_g = route.options).onError) == null || _h.call(_g, e2);
|
|
1550
|
+
} catch (onErrorError) {
|
|
1551
|
+
error = onErrorError, handleRedirectAndNotFound(
|
|
1552
|
+
this.getMatch(matchId),
|
|
1553
|
+
onErrorError
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
updateMatch(matchId, (prev) => ({
|
|
1557
|
+
...prev,
|
|
1558
|
+
error,
|
|
1559
|
+
status: "error",
|
|
1560
|
+
isFetching: !1
|
|
1561
|
+
}));
|
|
1562
|
+
}
|
|
1563
|
+
await this.getMatch(matchId).componentsPromise;
|
|
1564
|
+
} catch (err) {
|
|
1565
|
+
handleRedirectAndNotFound(this.getMatch(matchId), err);
|
|
1566
|
+
}
|
|
1567
|
+
}, { status, invalid } = this.getMatch(matchId);
|
|
1568
|
+
status === "success" && (invalid || (shouldReload ?? age > staleAge)) ? (async () => {
|
|
1569
|
+
try {
|
|
1570
|
+
await runLoader();
|
|
1571
|
+
} catch {
|
|
1572
|
+
}
|
|
1573
|
+
})() : status !== "success" && await runLoader();
|
|
1574
|
+
const { loaderPromise, loadPromise } = this.getMatch(matchId);
|
|
1575
|
+
loaderPromise?.resolve(), loadPromise?.resolve();
|
|
1576
|
+
}
|
|
1577
|
+
updateMatch(matchId, (prev) => ({
|
|
1578
|
+
...prev,
|
|
1579
|
+
isFetching: !1,
|
|
1580
|
+
loaderPromise: void 0
|
|
1581
|
+
}));
|
|
1582
|
+
})()
|
|
1583
|
+
);
|
|
1584
|
+
}), await Promise.all(matchPromises), resolveAll();
|
|
1585
|
+
} catch (err) {
|
|
1586
|
+
rejectAll(err);
|
|
1587
|
+
}
|
|
1588
|
+
})();
|
|
1589
|
+
}), await triggerOnReady();
|
|
1590
|
+
} catch (err) {
|
|
1591
|
+
if (isRedirect(err) || isNotFound(err))
|
|
1592
|
+
throw isNotFound(err) && !preload && await triggerOnReady(), err;
|
|
1593
|
+
}
|
|
1594
|
+
return matches;
|
|
1595
|
+
}, this.invalidate = () => {
|
|
1596
|
+
const invalidate = (d) => ({
|
|
1597
|
+
...d,
|
|
1598
|
+
invalid: !0,
|
|
1599
|
+
...d.status === "error" ? { status: "pending", error: void 0 } : {}
|
|
1600
|
+
});
|
|
1601
|
+
return this.__store.setState((s) => {
|
|
1602
|
+
var _a;
|
|
1603
|
+
return {
|
|
1604
|
+
...s,
|
|
1605
|
+
matches: s.matches.map(invalidate),
|
|
1606
|
+
cachedMatches: s.cachedMatches.map(invalidate),
|
|
1607
|
+
pendingMatches: (_a = s.pendingMatches) == null ? void 0 : _a.map(invalidate)
|
|
1608
|
+
};
|
|
1609
|
+
}), this.load();
|
|
1610
|
+
}, this.resolveRedirect = (err) => {
|
|
1611
|
+
const redirect = err;
|
|
1612
|
+
return redirect.href || (redirect.href = this.buildLocation(redirect).href), redirect;
|
|
1613
|
+
}, this.cleanCache = () => {
|
|
1614
|
+
this.__store.setState((s) => ({
|
|
1615
|
+
...s,
|
|
1616
|
+
cachedMatches: s.cachedMatches.filter((d) => {
|
|
1617
|
+
const route = this.looseRoutesById[d.routeId];
|
|
1618
|
+
if (!route.options.loader)
|
|
1619
|
+
return !1;
|
|
1620
|
+
const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ??
|
|
1621
|
+
5 * 60 * 1e3;
|
|
1622
|
+
return d.status !== "error" && Date.now() - d.updatedAt < gcTime;
|
|
1623
|
+
})
|
|
1624
|
+
}));
|
|
1625
|
+
}, this.preloadRoute = async (opts) => {
|
|
1626
|
+
const next = this.buildLocation(opts);
|
|
1627
|
+
let matches = this.matchRoutes(next.pathname, next.search, {
|
|
1628
|
+
throwOnError: !0,
|
|
1629
|
+
preload: !0
|
|
1630
|
+
});
|
|
1631
|
+
const loadedMatchIds = Object.fromEntries(
|
|
1632
|
+
[
|
|
1633
|
+
...this.state.matches,
|
|
1634
|
+
...this.state.pendingMatches ?? [],
|
|
1635
|
+
...this.state.cachedMatches
|
|
1636
|
+
].map((d) => [d.id, !0])
|
|
1637
|
+
);
|
|
1638
|
+
this.__store.batch(() => {
|
|
1639
|
+
matches.forEach((match) => {
|
|
1640
|
+
loadedMatchIds[match.id] || this.__store.setState((s) => ({
|
|
1641
|
+
...s,
|
|
1642
|
+
cachedMatches: [...s.cachedMatches, match]
|
|
1643
|
+
}));
|
|
1644
|
+
});
|
|
1645
|
+
});
|
|
1646
|
+
const activeMatchIds = new Set(
|
|
1647
|
+
[...this.state.matches, ...this.state.pendingMatches ?? []].map(
|
|
1648
|
+
(d) => d.id
|
|
1649
|
+
)
|
|
1650
|
+
);
|
|
1651
|
+
try {
|
|
1652
|
+
return matches = await this.loadMatches({
|
|
1653
|
+
matches,
|
|
1654
|
+
location: next,
|
|
1655
|
+
preload: !0,
|
|
1656
|
+
updateMatch: (id, updater) => {
|
|
1657
|
+
activeMatchIds.has(id) ? matches = matches.map((d) => d.id === id ? updater(d) : d) : this.updateMatch(id, updater);
|
|
1658
|
+
}
|
|
1659
|
+
}), matches;
|
|
1660
|
+
} catch (err) {
|
|
1661
|
+
if (isRedirect(err))
|
|
1662
|
+
return await this.preloadRoute({
|
|
1663
|
+
...err,
|
|
1664
|
+
_fromLocation: next
|
|
1665
|
+
});
|
|
1666
|
+
console.error(err);
|
|
1667
|
+
return;
|
|
1668
|
+
}
|
|
1669
|
+
}, this.matchRoute = (location, opts) => {
|
|
1670
|
+
const matchLocation = {
|
|
1671
|
+
...location,
|
|
1672
|
+
to: location.to ? this.resolvePathWithBase(location.from || "", location.to) : void 0,
|
|
1673
|
+
params: location.params || {},
|
|
1674
|
+
leaveParams: !0
|
|
1675
|
+
}, next = this.buildLocation(matchLocation);
|
|
1676
|
+
if (opts?.pending && this.state.status !== "pending")
|
|
1677
|
+
return !1;
|
|
1678
|
+
const baseLocation = (opts?.pending === void 0 ? !this.state.isLoading : opts.pending) ? this.latestLocation : this.state.resolvedLocation, match = matchPathname(
|
|
1679
|
+
this.basepath, baseLocation.pathname, {
|
|
1680
|
+
...opts,
|
|
1681
|
+
to: next.pathname
|
|
1682
|
+
});
|
|
1683
|
+
return !match || location.params && !deepEqual(match, location.params, !0) ? !1 : match && (opts?.includeSearch ?? !0) ? deepEqual(baseLocation.
|
|
1684
|
+
search, next.search, !0) ? match : !1 : match;
|
|
1685
|
+
}, this.dehydrate = () => {
|
|
1686
|
+
var _a;
|
|
1687
|
+
const pickError = ((_a = this.options.errorSerializer) == null ? void 0 : _a.serialize) ?? defaultSerializeError;
|
|
1688
|
+
return {
|
|
1689
|
+
state: {
|
|
1690
|
+
dehydratedMatches: this.state.matches.map((d) => ({
|
|
1691
|
+
...pick(d, ["id", "status", "updatedAt"]),
|
|
1692
|
+
// If an error occurs server-side during SSRing,
|
|
1693
|
+
// send a small subset of the error to the client
|
|
1694
|
+
error: d.error ? {
|
|
1695
|
+
data: pickError(d.error),
|
|
1696
|
+
__isServerError: !0
|
|
1697
|
+
} : void 0
|
|
1698
|
+
// NOTE: We don't send the loader data here, because
|
|
1699
|
+
// there is a potential that it needs to be streamed.
|
|
1700
|
+
// Instead, we render it next to the route match in the HTML
|
|
1701
|
+
// which gives us the potential to stream it via suspense.
|
|
1702
|
+
}))
|
|
1703
|
+
},
|
|
1704
|
+
manifest: this.manifest
|
|
1705
|
+
};
|
|
1706
|
+
}, this.hydrate = () => {
|
|
1707
|
+
var _a, _b, _c;
|
|
1708
|
+
let ctx;
|
|
1709
|
+
typeof document < "u" && (ctx = this.options.transformer.parse((_a = window.__TSR__) == null ? void 0 : _a.dehydrated)), invariant(
|
|
1710
|
+
ctx
|
|
1711
|
+
), this.dehydratedData = ctx.payload, (_c = (_b = this.options).hydrate) == null || _c.call(_b, ctx.payload);
|
|
1712
|
+
const dehydratedState = ctx.router.state, matches = this.matchRoutes(
|
|
1713
|
+
this.state.location.pathname,
|
|
1714
|
+
this.state.location.search
|
|
1715
|
+
).map((match) => {
|
|
1716
|
+
const dehydratedMatch = dehydratedState.dehydratedMatches.find(
|
|
1717
|
+
(d) => d.id === match.id
|
|
1718
|
+
);
|
|
1719
|
+
return invariant(
|
|
1720
|
+
dehydratedMatch
|
|
1721
|
+
), {
|
|
1722
|
+
...match,
|
|
1723
|
+
...dehydratedMatch
|
|
1724
|
+
};
|
|
1725
|
+
});
|
|
1726
|
+
this.__store.setState((s) => ({
|
|
1727
|
+
...s,
|
|
1728
|
+
matches
|
|
1729
|
+
})), this.manifest = ctx.router.manifest;
|
|
1730
|
+
}, this.injectedHtml = [], this.injectHtml = (html) => {
|
|
1731
|
+
const cb = () => (this.injectedHtml = this.injectedHtml.filter((d) => d !== cb), html);
|
|
1732
|
+
this.injectedHtml.push(cb);
|
|
1733
|
+
}, this.streamedKeys = /* @__PURE__ */ new Set(), this.getStreamedValue = (key) => {
|
|
1734
|
+
var _a;
|
|
1735
|
+
if (this.isServer)
|
|
1736
|
+
return;
|
|
1737
|
+
const streamedValue = (_a = window.__TSR__) == null ? void 0 : _a.streamedValues[key];
|
|
1738
|
+
if (streamedValue)
|
|
1739
|
+
return streamedValue.parsed || (streamedValue.parsed = this.options.transformer.parse(streamedValue.value)), streamedValue.parsed;
|
|
1740
|
+
}, this.streamValue = (key, value) => {
|
|
1741
|
+
var _a;
|
|
1742
|
+
this.streamedKeys.has(key), this.streamedKeys.add(key);
|
|
1743
|
+
const children = `__TSR__.streamedValues['${key}'] = { value: ${(_a = this.serializer) == null ? void 0 : _a.call(this, this.options.transformer.
|
|
1744
|
+
stringify(value))}}`;
|
|
1745
|
+
this.injectHtml(
|
|
1746
|
+
`<script class='tsr-once'>${children}; __TSR__.cleanScripts()<\/script>`
|
|
1747
|
+
);
|
|
1748
|
+
}, this._handleNotFound = (matches, err, {
|
|
1749
|
+
updateMatch = this.updateMatch
|
|
1750
|
+
} = {}) => {
|
|
1751
|
+
const matchesByRouteId = Object.fromEntries(
|
|
1752
|
+
matches.map((match2) => [match2.routeId, match2])
|
|
1753
|
+
);
|
|
1754
|
+
let routeCursor = (err.global ? this.looseRoutesById[rootRouteId] : this.looseRoutesById[err.routeId]) || this.looseRoutesById[rootRouteId];
|
|
1755
|
+
for (; !routeCursor.options.notFoundComponent && !this.options.defaultNotFoundComponent && routeCursor.id !== rootRouteId; )
|
|
1756
|
+
routeCursor = routeCursor.parentRoute, invariant(
|
|
1757
|
+
routeCursor
|
|
1758
|
+
);
|
|
1759
|
+
const match = matchesByRouteId[routeCursor.id];
|
|
1760
|
+
invariant(match), updateMatch(match.id, (prev) => ({
|
|
1761
|
+
...prev,
|
|
1762
|
+
status: "notFound",
|
|
1763
|
+
error: err,
|
|
1764
|
+
isFetching: !1
|
|
1765
|
+
})), err.routerCode === "BEFORE_LOAD" && routeCursor.parentRoute && (err.routeId = routeCursor.parentRoute.id, this._handleNotFound(matches, err,
|
|
1766
|
+
{
|
|
1767
|
+
updateMatch
|
|
1768
|
+
}));
|
|
1769
|
+
}, this.hasNotFoundMatch = () => this.__store.state.matches.some(
|
|
1770
|
+
(d) => d.status === "notFound" || d.globalNotFound
|
|
1771
|
+
), this.update({
|
|
1772
|
+
defaultPreloadDelay: 50,
|
|
1773
|
+
defaultPendingMs: 1e3,
|
|
1774
|
+
defaultPendingMinMs: 500,
|
|
1775
|
+
context: void 0,
|
|
1776
|
+
...options,
|
|
1777
|
+
stringifySearch: options.stringifySearch ?? defaultStringifySearch,
|
|
1778
|
+
parseSearch: options.parseSearch ?? defaultParseSearch
|
|
1779
|
+
}), typeof document < "u" && (window.__TSR__ROUTER__ = this);
|
|
1780
|
+
}
|
|
1781
|
+
get state() {
|
|
1782
|
+
return this.__store.state;
|
|
1783
|
+
}
|
|
1784
|
+
get looseRoutesById() {
|
|
1785
|
+
return this.routesById;
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
class SearchParamError extends Error {
|
|
1789
|
+
}
|
|
1790
|
+
class PathParamError extends Error {
|
|
1791
|
+
}
|
|
1792
|
+
function getInitialRouterState(location) {
|
|
1793
|
+
return {
|
|
1794
|
+
loadedAt: 0,
|
|
1795
|
+
isLoading: !1,
|
|
1796
|
+
isTransitioning: !1,
|
|
1797
|
+
status: "idle",
|
|
1798
|
+
resolvedLocation: { ...location },
|
|
1799
|
+
location,
|
|
1800
|
+
matches: [],
|
|
1801
|
+
pendingMatches: [],
|
|
1802
|
+
cachedMatches: [],
|
|
1803
|
+
statusCode: 200
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
function defaultSerializeError(err) {
|
|
1807
|
+
return err instanceof Error ? {
|
|
1808
|
+
name: err.name,
|
|
1809
|
+
message: err.message
|
|
1810
|
+
} : {
|
|
1811
|
+
data: err
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
function isServerSideError(error) {
|
|
1815
|
+
return !(typeof error == "object" && error && "data" in error) || !("__isServerError" in error && error.__isServerError) || !(typeof error.data == "\
|
|
1816
|
+
object" && error.data) ? !1 : error.__isServerError === !0;
|
|
1817
|
+
}
|
|
1818
|
+
function defaultDeserializeError(serializedData) {
|
|
1819
|
+
if ("name" in serializedData && "message" in serializedData) {
|
|
1820
|
+
const error = new Error(serializedData.message);
|
|
1821
|
+
return error.name = serializedData.name, error;
|
|
1822
|
+
}
|
|
1823
|
+
return serializedData.data;
|
|
1824
|
+
}
|
|
1825
|
+
const matchContext = React.createContext(void 0);
|
|
1826
|
+
function useMatch(opts) {
|
|
1827
|
+
const nearestMatchId = React.useContext(matchContext);
|
|
1828
|
+
return useRouterState({
|
|
1829
|
+
select: (state) => {
|
|
1830
|
+
const match = state.matches.find(
|
|
1831
|
+
(d) => opts.from ? opts.from === d.routeId : d.id === nearestMatchId
|
|
1832
|
+
);
|
|
1833
|
+
if (invariant(
|
|
1834
|
+
!((opts.shouldThrow ?? !0) && !match)
|
|
1835
|
+
), match !== void 0)
|
|
1836
|
+
return opts.select ? opts.select(match) : match;
|
|
1837
|
+
}
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
function useLoaderDeps(opts) {
|
|
1841
|
+
return useMatch({
|
|
1842
|
+
...opts,
|
|
1843
|
+
select: (s) => typeof opts.select == "function" ? opts.select(s.loaderDeps) : s.loaderDeps
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
function useLoaderData(opts) {
|
|
1847
|
+
return useMatch({
|
|
1848
|
+
...opts,
|
|
1849
|
+
select: (s) => typeof opts.select == "function" ? opts.select(s.loaderData) : s.loaderData
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
function useParams(opts) {
|
|
1853
|
+
return useMatch({
|
|
1854
|
+
...opts,
|
|
1855
|
+
select: (match) => opts.select ? opts.select(match.params) : match.params
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
function useSearch(opts) {
|
|
1859
|
+
return useMatch({
|
|
1860
|
+
...opts,
|
|
1861
|
+
select: (match) => opts.select ? opts.select(match.search) : match.search
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
function useNavigate(_defaultOpts) {
|
|
1865
|
+
const router = useRouter();
|
|
1866
|
+
return React.useCallback(
|
|
1867
|
+
(options) => router.navigate({
|
|
1868
|
+
...options
|
|
1869
|
+
}),
|
|
1870
|
+
[router]
|
|
1871
|
+
);
|
|
1872
|
+
}
|
|
1873
|
+
class Route {
|
|
1874
|
+
/**
|
|
1875
|
+
* @deprecated Use the `createRoute` function instead.
|
|
1876
|
+
*/
|
|
1877
|
+
constructor(options) {
|
|
1878
|
+
this.init = (opts) => {
|
|
1879
|
+
var _a, _b;
|
|
1880
|
+
this.originalIndex = opts.originalIndex;
|
|
1881
|
+
const options2 = this.options, isRoot = !options2?.path && !options2?.id;
|
|
1882
|
+
this.parentRoute = (_b = (_a = this.options) == null ? void 0 : _a.getParentRoute) == null ? void 0 : _b.call(_a), isRoot ? this.path = rootRouteId :
|
|
1883
|
+
invariant(
|
|
1884
|
+
this.parentRoute
|
|
1885
|
+
);
|
|
1886
|
+
let path = isRoot ? rootRouteId : options2.path;
|
|
1887
|
+
path && path !== "/" && (path = trimPathLeft(path));
|
|
1888
|
+
const customId = options2?.id || path;
|
|
1889
|
+
let id = isRoot ? rootRouteId : joinPaths([
|
|
1890
|
+
this.parentRoute.id === rootRouteId ? "" : this.parentRoute.id,
|
|
1891
|
+
customId
|
|
1892
|
+
]);
|
|
1893
|
+
path === rootRouteId && (path = "/"), id !== rootRouteId && (id = joinPaths(["/", id]));
|
|
1894
|
+
const fullPath = id === rootRouteId ? "/" : joinPaths([this.parentRoute.fullPath, path]);
|
|
1895
|
+
this.path = path, this.id = id, this.fullPath = fullPath, this.to = fullPath;
|
|
1896
|
+
}, this.updateLoader = (options2) => (Object.assign(this.options, options2), this), this.update = (options2) => (Object.assign(this.options, options2),
|
|
1897
|
+
this), this.lazy = (lazyFn) => (this.lazyFn = lazyFn, this), this.useMatch = (opts) => useMatch({ ...opts, from: this.id }), this.useRouteContext =
|
|
1898
|
+
(opts) => useMatch({
|
|
1899
|
+
...opts,
|
|
1900
|
+
from: this.id,
|
|
1901
|
+
select: (d) => opts?.select ? opts.select(d.context) : d.context
|
|
1902
|
+
}), this.useSearch = (opts) => useSearch({ ...opts, from: this.id }), this.useParams = (opts) => useParams({ ...opts, from: this.id }), this.useLoaderDeps =
|
|
1903
|
+
(opts) => useLoaderDeps({ ...opts, from: this.id }), this.useLoaderData = (opts) => useLoaderData({ ...opts, from: this.id }), this.useNavigate = () => useNavigate(),
|
|
1904
|
+
this.options = options || {}, this.isRoot = !options?.getParentRoute, invariant(
|
|
1905
|
+
!(options?.id && options?.path)
|
|
1906
|
+
), this.$$typeof = Symbol.for("react.memo");
|
|
1907
|
+
}
|
|
1908
|
+
addChildren(children) {
|
|
1909
|
+
return this.children = Array.isArray(children) ? children : Object.values(children), this;
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
function createRoute(options) {
|
|
1913
|
+
return new Route(options);
|
|
1914
|
+
}
|
|
1915
|
+
function createRootRouteWithContext() {
|
|
1916
|
+
return (options) => createRootRoute(options);
|
|
1917
|
+
}
|
|
1918
|
+
class RootRoute extends Route {
|
|
1919
|
+
/**
|
|
1920
|
+
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
|
|
1921
|
+
*/
|
|
1922
|
+
constructor(options) {
|
|
1923
|
+
super(options);
|
|
1924
|
+
}
|
|
1925
|
+
addChildren(children) {
|
|
1926
|
+
return super.addChildren(children);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
function createRootRoute(options) {
|
|
1930
|
+
return new RootRoute(options);
|
|
1931
|
+
}
|
|
1932
|
+
function createFileRoute(path) {
|
|
1933
|
+
return new FileRoute(path, {
|
|
1934
|
+
silent: !0
|
|
1935
|
+
}).createRoute;
|
|
1936
|
+
}
|
|
1937
|
+
class FileRoute {
|
|
1938
|
+
constructor(path, _opts) {
|
|
1939
|
+
this.path = path, this.createRoute = (options) => {
|
|
1940
|
+
const route = createRoute(options);
|
|
1941
|
+
return route.isRoot = !1, route;
|
|
1942
|
+
}, this.silent = _opts?.silent;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
const preloadWarning = "Error preloading route! ☝️";
|
|
1946
|
+
function useLinkProps(options) {
|
|
1947
|
+
const router = useRouter(), [isTransitioning, setIsTransitioning] = React.useState(!1), {
|
|
1948
|
+
// custom props
|
|
1949
|
+
activeProps = () => ({ className: "active" }),
|
|
1950
|
+
inactiveProps = () => ({}),
|
|
1951
|
+
activeOptions,
|
|
1952
|
+
hash,
|
|
1953
|
+
search,
|
|
1954
|
+
params,
|
|
1955
|
+
to,
|
|
1956
|
+
state,
|
|
1957
|
+
mask,
|
|
1958
|
+
preload: userPreload,
|
|
1959
|
+
preloadDelay: userPreloadDelay,
|
|
1960
|
+
replace,
|
|
1961
|
+
startTransition,
|
|
1962
|
+
resetScroll,
|
|
1963
|
+
viewTransition,
|
|
1964
|
+
// element props
|
|
1965
|
+
children,
|
|
1966
|
+
target,
|
|
1967
|
+
disabled,
|
|
1968
|
+
style,
|
|
1969
|
+
className,
|
|
1970
|
+
onClick,
|
|
1971
|
+
onFocus,
|
|
1972
|
+
onMouseEnter,
|
|
1973
|
+
onMouseLeave,
|
|
1974
|
+
onTouchStart,
|
|
1975
|
+
ignoreBlocker,
|
|
1976
|
+
...rest
|
|
1977
|
+
} = options;
|
|
1978
|
+
let type = "internal";
|
|
1979
|
+
try {
|
|
1980
|
+
new URL(`${to}`), type = "external";
|
|
1981
|
+
} catch {
|
|
1982
|
+
}
|
|
1983
|
+
const next = router.buildLocation(options), preload = userPreload ?? router.options.defaultPreload, preloadDelay = userPreloadDelay ?? router.options.
|
|
1984
|
+
defaultPreloadDelay ?? 0, isActive = useRouterState({
|
|
1985
|
+
select: (s) => {
|
|
1986
|
+
const currentPathSplit = removeTrailingSlash(
|
|
1987
|
+
s.location.pathname,
|
|
1988
|
+
router.basepath
|
|
1989
|
+
).split("/"), pathIsFuzzyEqual = removeTrailingSlash(
|
|
1990
|
+
next.pathname,
|
|
1991
|
+
router.basepath
|
|
1992
|
+
).split("/").every(
|
|
1993
|
+
(d, i) => d === currentPathSplit[i]
|
|
1994
|
+
), pathTest = activeOptions?.exact ? exactPathTest(s.location.pathname, next.pathname, router.basepath) : pathIsFuzzyEqual, hashTest = activeOptions?.
|
|
1995
|
+
includeHash ? s.location.hash === next.hash : !0, searchTest = activeOptions?.includeSearch ?? !0 ? deepEqual(s.location.search, next.search, !activeOptions?.
|
|
1996
|
+
exact) : !0;
|
|
1997
|
+
return pathTest && hashTest && searchTest;
|
|
1998
|
+
}
|
|
1999
|
+
});
|
|
2000
|
+
if (type === "external")
|
|
2001
|
+
return {
|
|
2002
|
+
...rest,
|
|
2003
|
+
type,
|
|
2004
|
+
href: to,
|
|
2005
|
+
...children && { children },
|
|
2006
|
+
...target && { target },
|
|
2007
|
+
...disabled && { disabled },
|
|
2008
|
+
...style && { style },
|
|
2009
|
+
...className && { className },
|
|
2010
|
+
...onClick && { onClick },
|
|
2011
|
+
...onFocus && { onFocus },
|
|
2012
|
+
...onMouseEnter && { onMouseEnter },
|
|
2013
|
+
...onMouseLeave && { onMouseLeave },
|
|
2014
|
+
...onTouchStart && { onTouchStart }
|
|
2015
|
+
};
|
|
2016
|
+
const handleClick = (e2) => {
|
|
2017
|
+
if (!disabled && !isCtrlEvent(e2) && !e2.defaultPrevented && (!target || target === "_self") && e2.button === 0) {
|
|
2018
|
+
e2.preventDefault(), flushSync(() => {
|
|
2019
|
+
setIsTransitioning(!0);
|
|
2020
|
+
});
|
|
2021
|
+
const unsub = router.subscribe("onResolved", () => {
|
|
2022
|
+
unsub(), setIsTransitioning(!1);
|
|
2023
|
+
});
|
|
2024
|
+
router.commitLocation({
|
|
2025
|
+
...next,
|
|
2026
|
+
replace,
|
|
2027
|
+
resetScroll,
|
|
2028
|
+
startTransition,
|
|
2029
|
+
viewTransition,
|
|
2030
|
+
ignoreBlocker
|
|
2031
|
+
});
|
|
2032
|
+
}
|
|
2033
|
+
}, doPreload = () => {
|
|
2034
|
+
router.preloadRoute(options).catch((err) => {
|
|
2035
|
+
console.warn(err), console.warn(preloadWarning);
|
|
2036
|
+
});
|
|
2037
|
+
}, handleFocus = (e2) => {
|
|
2038
|
+
disabled || preload && doPreload();
|
|
2039
|
+
}, handleTouchStart = handleFocus, handleEnter = (e2) => {
|
|
2040
|
+
if (disabled) return;
|
|
2041
|
+
const eventTarget = e2.target || {};
|
|
2042
|
+
if (preload) {
|
|
2043
|
+
if (eventTarget.preloadTimeout)
|
|
2044
|
+
return;
|
|
2045
|
+
eventTarget.preloadTimeout = setTimeout(() => {
|
|
2046
|
+
eventTarget.preloadTimeout = null, doPreload();
|
|
2047
|
+
}, preloadDelay);
|
|
2048
|
+
}
|
|
2049
|
+
}, handleLeave = (e2) => {
|
|
2050
|
+
if (disabled) return;
|
|
2051
|
+
const eventTarget = e2.target || {};
|
|
2052
|
+
eventTarget.preloadTimeout && (clearTimeout(eventTarget.preloadTimeout), eventTarget.preloadTimeout = null);
|
|
2053
|
+
}, composeHandlers = (handlers) => (e2) => {
|
|
2054
|
+
var _a;
|
|
2055
|
+
(_a = e2.persist) == null || _a.call(e2), handlers.filter(Boolean).forEach((handler) => {
|
|
2056
|
+
e2.defaultPrevented || handler(e2);
|
|
2057
|
+
});
|
|
2058
|
+
}, resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? {} : {}, resolvedInactiveProps = isActive ? {} : functionalUpdate(inactiveProps,
|
|
2059
|
+
{}), resolvedClassName = [
|
|
2060
|
+
className,
|
|
2061
|
+
resolvedActiveProps.className,
|
|
2062
|
+
resolvedInactiveProps.className
|
|
2063
|
+
].filter(Boolean).join(" "), resolvedStyle = {
|
|
2064
|
+
...style,
|
|
2065
|
+
...resolvedActiveProps.style,
|
|
2066
|
+
...resolvedInactiveProps.style
|
|
2067
|
+
};
|
|
2068
|
+
return {
|
|
2069
|
+
...resolvedActiveProps,
|
|
2070
|
+
...resolvedInactiveProps,
|
|
2071
|
+
...rest,
|
|
2072
|
+
href: disabled ? void 0 : next.maskedLocation ? router.history.createHref(next.maskedLocation.href) : router.history.createHref(next.href),
|
|
2073
|
+
onClick: composeHandlers([onClick, handleClick]),
|
|
2074
|
+
onFocus: composeHandlers([onFocus, handleFocus]),
|
|
2075
|
+
onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
|
|
2076
|
+
onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
|
|
2077
|
+
onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
|
|
2078
|
+
disabled: !!disabled,
|
|
2079
|
+
target,
|
|
2080
|
+
...Object.keys(resolvedStyle).length && { style: resolvedStyle },
|
|
2081
|
+
...resolvedClassName && { className: resolvedClassName },
|
|
2082
|
+
...disabled && {
|
|
2083
|
+
role: "link",
|
|
2084
|
+
"aria-disabled": !0
|
|
2085
|
+
},
|
|
2086
|
+
...isActive && { "data-status": "active", "aria-current": "page" },
|
|
2087
|
+
...isTransitioning && { "data-transitioning": "transitioning" }
|
|
2088
|
+
};
|
|
2089
|
+
}
|
|
2090
|
+
const Link = React.forwardRef((props, ref) => {
|
|
2091
|
+
const { _asChild, ...rest } = props, { type, ...linkProps } = useLinkProps(rest), children = typeof rest.children == "function" ? rest.children({
|
|
2092
|
+
isActive: linkProps["data-status"] === "active"
|
|
2093
|
+
}) : rest.children;
|
|
2094
|
+
return typeof _asChild > "u" && delete linkProps.disabled, React.createElement(
|
|
2095
|
+
_asChild || "a",
|
|
2096
|
+
{
|
|
2097
|
+
...linkProps,
|
|
2098
|
+
ref
|
|
2099
|
+
},
|
|
2100
|
+
children
|
|
2101
|
+
);
|
|
2102
|
+
});
|
|
2103
|
+
function isCtrlEvent(e2) {
|
|
2104
|
+
return !!(e2.metaKey || e2.altKey || e2.ctrlKey || e2.shiftKey);
|
|
2105
|
+
}
|
|
2106
|
+
function Transitioner() {
|
|
2107
|
+
const router = useRouter(), mountLoadForRouter = React.useRef({ router, mounted: !1 }), routerState = useRouterState({
|
|
2108
|
+
select: (s) => pick(s, ["isLoading", "location", "resolvedLocation", "isTransitioning"])
|
|
2109
|
+
}), [isTransitioning, startReactTransition_] = React.useTransition(), hasPendingMatches = useRouterState({
|
|
2110
|
+
select: (s) => s.matches.some((d) => d.status === "pending")
|
|
2111
|
+
}), previousIsLoading = usePrevious(routerState.isLoading), isAnyPending = routerState.isLoading || isTransitioning || hasPendingMatches, previousIsAnyPending = usePrevious(
|
|
2112
|
+
isAnyPending);
|
|
2113
|
+
return router.isServer || (router.startReactTransition = startReactTransition_), React.useEffect(() => {
|
|
2114
|
+
const unsub = router.history.subscribe(router.load), nextLocation = router.buildLocation({
|
|
2115
|
+
to: router.latestLocation.pathname,
|
|
2116
|
+
search: !0,
|
|
2117
|
+
params: !0,
|
|
2118
|
+
hash: !0,
|
|
2119
|
+
state: !0
|
|
2120
|
+
});
|
|
2121
|
+
return trimPathRight(router.latestLocation.href) !== trimPathRight(nextLocation.href) && router.commitLocation({ ...nextLocation, replace: !0 }), () => {
|
|
2122
|
+
unsub();
|
|
2123
|
+
};
|
|
2124
|
+
}, [router, router.history]), useLayoutEffect$1(() => {
|
|
2125
|
+
var _a;
|
|
2126
|
+
if ((_a = window.__TSR__) != null && _a.dehydrated || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted)
|
|
2127
|
+
return;
|
|
2128
|
+
mountLoadForRouter.current = { router, mounted: !0 }, (async () => {
|
|
2129
|
+
try {
|
|
2130
|
+
await router.load();
|
|
2131
|
+
} catch (err) {
|
|
2132
|
+
console.error(err);
|
|
2133
|
+
}
|
|
2134
|
+
})();
|
|
2135
|
+
}, [router]), useLayoutEffect$1(() => {
|
|
2136
|
+
if (previousIsLoading && !routerState.isLoading) {
|
|
2137
|
+
const toLocation = router.state.location, fromLocation = router.state.resolvedLocation, pathChanged = fromLocation.href !== toLocation.href;
|
|
2138
|
+
router.emit({
|
|
2139
|
+
type: "onLoad",
|
|
2140
|
+
// When the new URL has committed, when the new matches have been loaded into state.matches
|
|
2141
|
+
fromLocation,
|
|
2142
|
+
toLocation,
|
|
2143
|
+
pathChanged
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
}, [previousIsLoading, router, routerState.isLoading]), useLayoutEffect$1(() => {
|
|
2147
|
+
if (previousIsAnyPending && !isAnyPending) {
|
|
2148
|
+
const toLocation = router.state.location, fromLocation = router.state.resolvedLocation, pathChanged = fromLocation.href !== toLocation.href;
|
|
2149
|
+
if (router.emit({
|
|
2150
|
+
type: "onResolved",
|
|
2151
|
+
fromLocation,
|
|
2152
|
+
toLocation,
|
|
2153
|
+
pathChanged
|
|
2154
|
+
}), router.__store.setState((s) => ({
|
|
2155
|
+
...s,
|
|
2156
|
+
status: "idle",
|
|
2157
|
+
resolvedLocation: s.location
|
|
2158
|
+
})), document.querySelector && router.state.location.hash !== "") {
|
|
2159
|
+
const el = document.getElementById(router.state.location.hash);
|
|
2160
|
+
el && el.scrollIntoView();
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
}, [isAnyPending, previousIsAnyPending, router]), null;
|
|
2164
|
+
}
|
|
2165
|
+
function SafeFragment(props) {
|
|
2166
|
+
return /* @__PURE__ */ jsx(Fragment, { children: props.children });
|
|
2167
|
+
}
|
|
2168
|
+
function renderRouteNotFound(router, route, data) {
|
|
2169
|
+
return route.options.notFoundComponent ? /* @__PURE__ */ jsx(route.options.notFoundComponent, { data }) : router.options.defaultNotFoundComponent ? /* @__PURE__ */ jsx(
|
|
2170
|
+
router.options.defaultNotFoundComponent, { data }) : /* @__PURE__ */ jsx(DefaultGlobalNotFound, {});
|
|
2171
|
+
}
|
|
2172
|
+
function Match({ matchId }) {
|
|
2173
|
+
var _a, _b;
|
|
2174
|
+
const router = useRouter(), routeId = useRouterState({
|
|
2175
|
+
select: (s) => {
|
|
2176
|
+
var _a2;
|
|
2177
|
+
return (_a2 = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;
|
|
2178
|
+
}
|
|
2179
|
+
});
|
|
2180
|
+
invariant(
|
|
2181
|
+
routeId
|
|
2182
|
+
);
|
|
2183
|
+
const route = router.routesById[routeId], PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent, pendingElement = PendingComponent ?
|
|
2184
|
+
/* @__PURE__ */ jsx(PendingComponent, {}) : null, routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent, routeOnCatch = route.
|
|
2185
|
+
options.onCatch ?? router.options.defaultOnCatch, routeNotFoundComponent = route.isRoot ? (
|
|
2186
|
+
// If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component
|
|
2187
|
+
route.options.notFoundComponent ?? ((_a = router.options.notFoundRoute) == null ? void 0 : _a.options.component)
|
|
2188
|
+
) : route.options.notFoundComponent, ResolvedSuspenseBoundary = (
|
|
2189
|
+
// If we're on the root route, allow forcefully wrapping in suspense
|
|
2190
|
+
(!route.isRoot || route.options.wrapInSuspense) && (route.options.wrapInSuspense ?? PendingComponent ?? ((_b = route.options.errorComponent) == null ?
|
|
2191
|
+
void 0 : _b.preload)) ? React.Suspense : SafeFragment
|
|
2192
|
+
), ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment, ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment,
|
|
2193
|
+
resetKey = useRouterState({
|
|
2194
|
+
select: (s) => s.loadedAt
|
|
2195
|
+
});
|
|
2196
|
+
return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(ResolvedSuspenseBoundary, { fallback: pendingElement,
|
|
2197
|
+
children: /* @__PURE__ */ jsx(
|
|
2198
|
+
ResolvedCatchBoundary,
|
|
2199
|
+
{
|
|
2200
|
+
getResetKey: () => resetKey,
|
|
2201
|
+
errorComponent: routeErrorComponent || ErrorComponent,
|
|
2202
|
+
onCatch: (error, errorInfo) => {
|
|
2203
|
+
if (isNotFound(error)) throw error;
|
|
2204
|
+
routeOnCatch?.(error, errorInfo);
|
|
2205
|
+
},
|
|
2206
|
+
children: /* @__PURE__ */ jsx(
|
|
2207
|
+
ResolvedNotFoundBoundary,
|
|
2208
|
+
{
|
|
2209
|
+
fallback: (error) => {
|
|
2210
|
+
if (!routeNotFoundComponent || error.routeId && error.routeId !== routeId || !error.routeId && !route.isRoot)
|
|
2211
|
+
throw error;
|
|
2212
|
+
return React.createElement(routeNotFoundComponent, error);
|
|
2213
|
+
},
|
|
2214
|
+
children: /* @__PURE__ */ jsx(MatchInner, { matchId })
|
|
2215
|
+
}
|
|
2216
|
+
)
|
|
2217
|
+
}
|
|
2218
|
+
) }) });
|
|
2219
|
+
}
|
|
2220
|
+
function MatchInner({ matchId }) {
|
|
2221
|
+
var _a, _b;
|
|
2222
|
+
const router = useRouter(), routeId = useRouterState({
|
|
2223
|
+
select: (s) => {
|
|
2224
|
+
var _a2;
|
|
2225
|
+
return (_a2 = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;
|
|
2226
|
+
}
|
|
2227
|
+
}), route = router.routesById[routeId], matchIndex = useRouterState({
|
|
2228
|
+
select: (s) => s.matches.findIndex((d) => d.id === matchId)
|
|
2229
|
+
}), match = useRouterState({
|
|
2230
|
+
select: (s) => {
|
|
2231
|
+
const match2 = s.matches[matchIndex];
|
|
2232
|
+
return pick(match2, [
|
|
2233
|
+
"id",
|
|
2234
|
+
"status",
|
|
2235
|
+
"error",
|
|
2236
|
+
"loadPromise",
|
|
2237
|
+
"minPendingPromise"
|
|
2238
|
+
]);
|
|
2239
|
+
}
|
|
2240
|
+
}), RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent;
|
|
2241
|
+
if (match.status === "notFound") {
|
|
2242
|
+
let error;
|
|
2243
|
+
return isServerSideError(match.error) ? error = (((_a = router.options.errorSerializer) == null ? void 0 : _a.deserialize) ?? defaultDeserializeError)(
|
|
2244
|
+
match.error.data) : error = match.error, invariant(isNotFound(error)), renderRouteNotFound(router, route, error);
|
|
2245
|
+
}
|
|
2246
|
+
if (match.status === "redirected")
|
|
2247
|
+
throw invariant(isRedirect(match.error)), match.loadPromise;
|
|
2248
|
+
if (match.status === "error") {
|
|
2249
|
+
if (router.isServer)
|
|
2250
|
+
return /* @__PURE__ */ jsx(
|
|
2251
|
+
RouteErrorComponent,
|
|
2252
|
+
{
|
|
2253
|
+
error: match.error,
|
|
2254
|
+
info: {
|
|
2255
|
+
componentStack: ""
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
);
|
|
2259
|
+
throw isServerSideError(match.error) ? (((_b = router.options.errorSerializer) == null ? void 0 : _b.deserialize) ?? defaultDeserializeError)(match.
|
|
2260
|
+
error.data) : match.error;
|
|
2261
|
+
}
|
|
2262
|
+
if (match.status === "pending") {
|
|
2263
|
+
const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs;
|
|
2264
|
+
if (pendingMinMs && !match.minPendingPromise && !router.isServer) {
|
|
2265
|
+
const minPendingPromise = createControlledPromise();
|
|
2266
|
+
Promise.resolve().then(() => {
|
|
2267
|
+
router.updateMatch(match.id, (prev) => ({
|
|
2268
|
+
...prev,
|
|
2269
|
+
minPendingPromise
|
|
2270
|
+
}));
|
|
2271
|
+
}), setTimeout(() => {
|
|
2272
|
+
minPendingPromise.resolve(), router.updateMatch(match.id, (prev) => ({
|
|
2273
|
+
...prev,
|
|
2274
|
+
minPendingPromise: void 0
|
|
2275
|
+
}));
|
|
2276
|
+
}, pendingMinMs);
|
|
2277
|
+
}
|
|
2278
|
+
throw match.loadPromise;
|
|
2279
|
+
}
|
|
2280
|
+
const Comp = route.options.component ?? router.options.defaultComponent;
|
|
2281
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2282
|
+
Comp ? /* @__PURE__ */ jsx(Comp, {}) : /* @__PURE__ */ jsx(Outlet, {}),
|
|
2283
|
+
router.AfterEachMatch ? /* @__PURE__ */ jsx(router.AfterEachMatch, { match, matchIndex }) : null
|
|
2284
|
+
] });
|
|
2285
|
+
}
|
|
2286
|
+
const Outlet = React.memo(function() {
|
|
2287
|
+
const router = useRouter(), matchId = React.useContext(matchContext), routeId = useRouterState({
|
|
2288
|
+
select: (s) => {
|
|
2289
|
+
var _a;
|
|
2290
|
+
return (_a = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a.routeId;
|
|
2291
|
+
}
|
|
2292
|
+
}), route = router.routesById[routeId], { parentGlobalNotFound } = useRouterState({
|
|
2293
|
+
select: (s) => {
|
|
2294
|
+
const parentMatch = s.matches.find((d) => d.id === matchId);
|
|
2295
|
+
return invariant(
|
|
2296
|
+
parentMatch
|
|
2297
|
+
), {
|
|
2298
|
+
parentGlobalNotFound: parentMatch.globalNotFound
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
}), childMatchId = useRouterState({
|
|
2302
|
+
select: (s) => {
|
|
2303
|
+
var _a;
|
|
2304
|
+
const matches = s.matches, index = matches.findIndex((d) => d.id === matchId);
|
|
2305
|
+
return (_a = matches[index + 1]) == null ? void 0 : _a.id;
|
|
2306
|
+
}
|
|
2307
|
+
});
|
|
2308
|
+
if (parentGlobalNotFound)
|
|
2309
|
+
return renderRouteNotFound(router, route, void 0);
|
|
2310
|
+
if (!childMatchId)
|
|
2311
|
+
return null;
|
|
2312
|
+
const nextMatch = /* @__PURE__ */ jsx(Match, { matchId: childMatchId }), pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(
|
|
2313
|
+
router.options.defaultPendingComponent, {}) : null;
|
|
2314
|
+
return matchId === rootRouteId ? /* @__PURE__ */ jsx(React.Suspense, { fallback: pendingElement, children: nextMatch }) : nextMatch;
|
|
2315
|
+
});
|
|
2316
|
+
function Matches() {
|
|
2317
|
+
const router = useRouter(), pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(router.options.defaultPendingComponent, {}) :
|
|
2318
|
+
null, ResolvedSuspense = router.state.matches.length ? SafeFragment : React.Suspense, inner = /* @__PURE__ */ jsxs(ResolvedSuspense, { fallback: pendingElement,
|
|
2319
|
+
children: [
|
|
2320
|
+
/* @__PURE__ */ jsx(Transitioner, {}),
|
|
2321
|
+
/* @__PURE__ */ jsx(MatchesInner, {})
|
|
2322
|
+
] });
|
|
2323
|
+
return router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;
|
|
2324
|
+
}
|
|
2325
|
+
function MatchesInner() {
|
|
2326
|
+
const matchId = useRouterState({
|
|
2327
|
+
select: (s) => {
|
|
2328
|
+
var _a;
|
|
2329
|
+
return (_a = s.matches[0]) == null ? void 0 : _a.id;
|
|
2330
|
+
}
|
|
2331
|
+
}), resetKey = useRouterState({
|
|
2332
|
+
select: (s) => s.loadedAt
|
|
2333
|
+
});
|
|
2334
|
+
return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(
|
|
2335
|
+
CatchBoundary,
|
|
2336
|
+
{
|
|
2337
|
+
getResetKey: () => resetKey,
|
|
2338
|
+
errorComponent: ErrorComponent,
|
|
2339
|
+
onCatch: (error) => {
|
|
2340
|
+
error.message || error.toString();
|
|
2341
|
+
},
|
|
2342
|
+
children: matchId ? /* @__PURE__ */ jsx(Match, { matchId }) : null
|
|
2343
|
+
}
|
|
2344
|
+
) });
|
|
2345
|
+
}
|
|
2346
|
+
function RouterContextProvider({
|
|
2347
|
+
router,
|
|
2348
|
+
children,
|
|
2349
|
+
...rest
|
|
2350
|
+
}) {
|
|
2351
|
+
router.update({
|
|
2352
|
+
...router.options,
|
|
2353
|
+
...rest,
|
|
2354
|
+
context: {
|
|
2355
|
+
...router.options.context,
|
|
2356
|
+
...rest.context
|
|
2357
|
+
}
|
|
2358
|
+
});
|
|
2359
|
+
const routerContext2 = getRouterContext(), provider = /* @__PURE__ */ jsx(routerContext2.Provider, { value: router, children });
|
|
2360
|
+
return router.options.Wrap ? /* @__PURE__ */ jsx(router.options.Wrap, { children: provider }) : provider;
|
|
2361
|
+
}
|
|
2362
|
+
function RouterProvider({ router, ...rest }) {
|
|
2363
|
+
return /* @__PURE__ */ jsx(RouterContextProvider, { router, ...rest, children: /* @__PURE__ */ jsx(Matches, {}) });
|
|
2364
|
+
}
|
|
2365
|
+
const useLayoutEffect = typeof window < "u" ? React.useLayoutEffect : React.useEffect, windowKey = "window", delimiter = "___";
|
|
2366
|
+
let weakScrolledElements = /* @__PURE__ */ new WeakSet();
|
|
2367
|
+
const sessionsStorage = typeof window < "u" && window.sessionStorage, cache = sessionsStorage ? (() => {
|
|
2368
|
+
const storageKey = "tsr-scroll-restoration-v2";
|
|
2369
|
+
return {
|
|
2370
|
+
state: JSON.parse(
|
|
2371
|
+
window.sessionStorage.getItem(storageKey) || "null"
|
|
2372
|
+
) || { cached: {}, next: {} },
|
|
2373
|
+
set: (updater) => {
|
|
2374
|
+
cache.state = functionalUpdate(updater, cache.state), window.sessionStorage.setItem(storageKey, JSON.stringify(cache.state));
|
|
2375
|
+
}
|
|
2376
|
+
};
|
|
2377
|
+
})() : void 0, defaultGetKey = (location) => location.state.key || location.href;
|
|
2378
|
+
function useScrollRestoration(options) {
|
|
2379
|
+
const router = useRouter();
|
|
2380
|
+
useLayoutEffect(() => {
|
|
2381
|
+
const getKey = options?.getKey || defaultGetKey, { history } = window;
|
|
2382
|
+
history.scrollRestoration = "manual";
|
|
2383
|
+
const onScroll = (event) => {
|
|
2384
|
+
if (weakScrolledElements.has(event.target)) return;
|
|
2385
|
+
weakScrolledElements.add(event.target);
|
|
2386
|
+
let elementSelector = "";
|
|
2387
|
+
if (event.target === document || event.target === window)
|
|
2388
|
+
elementSelector = windowKey;
|
|
2389
|
+
else {
|
|
2390
|
+
const attrId = event.target.getAttribute(
|
|
2391
|
+
"data-scroll-restoration-id"
|
|
2392
|
+
);
|
|
2393
|
+
attrId ? elementSelector = `[data-scroll-restoration-id="${attrId}"]` : elementSelector = getCssSelector(event.target);
|
|
2394
|
+
}
|
|
2395
|
+
cache.state.next[elementSelector] || cache.set((c) => ({
|
|
2396
|
+
...c,
|
|
2397
|
+
next: {
|
|
2398
|
+
...c.next,
|
|
2399
|
+
[elementSelector]: {
|
|
2400
|
+
scrollX: NaN,
|
|
2401
|
+
scrollY: NaN
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
}));
|
|
2405
|
+
};
|
|
2406
|
+
typeof document < "u" && document.addEventListener("scroll", onScroll, !0);
|
|
2407
|
+
const unsubOnBeforeLoad = router.subscribe("onBeforeLoad", (event) => {
|
|
2408
|
+
if (event.pathChanged) {
|
|
2409
|
+
const restoreKey = getKey(event.fromLocation);
|
|
2410
|
+
for (const elementSelector in cache.state.next) {
|
|
2411
|
+
const entry = cache.state.next[elementSelector];
|
|
2412
|
+
if (elementSelector === windowKey)
|
|
2413
|
+
entry.scrollX = window.scrollX || 0, entry.scrollY = window.scrollY || 0;
|
|
2414
|
+
else if (elementSelector) {
|
|
2415
|
+
const element = document.querySelector(elementSelector);
|
|
2416
|
+
entry.scrollX = element?.scrollLeft || 0, entry.scrollY = element?.scrollTop || 0;
|
|
2417
|
+
}
|
|
2418
|
+
cache.set((c) => {
|
|
2419
|
+
const next = { ...c.next };
|
|
2420
|
+
return delete next[elementSelector], {
|
|
2421
|
+
...c,
|
|
2422
|
+
next,
|
|
2423
|
+
cached: {
|
|
2424
|
+
...c.cached,
|
|
2425
|
+
[[restoreKey, elementSelector].join(delimiter)]: entry
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}), unsubOnResolved = router.subscribe("onResolved", (event) => {
|
|
2432
|
+
if (event.pathChanged) {
|
|
2433
|
+
if (!router.resetNextScroll)
|
|
2434
|
+
return;
|
|
2435
|
+
router.resetNextScroll = !0;
|
|
2436
|
+
const restoreKey = getKey(event.toLocation);
|
|
2437
|
+
let windowRestored = !1;
|
|
2438
|
+
for (const cacheKey in cache.state.cached) {
|
|
2439
|
+
const entry = cache.state.cached[cacheKey], [key, elementSelector] = cacheKey.split(delimiter);
|
|
2440
|
+
if (key === restoreKey) {
|
|
2441
|
+
if (elementSelector === windowKey)
|
|
2442
|
+
windowRestored = !0, window.scrollTo(entry.scrollX, entry.scrollY);
|
|
2443
|
+
else if (elementSelector) {
|
|
2444
|
+
const element = document.querySelector(elementSelector);
|
|
2445
|
+
element && (element.scrollLeft = entry.scrollX, element.scrollTop = entry.scrollY);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
windowRestored || window.scrollTo(0, 0), cache.set((c) => ({ ...c, next: {} })), weakScrolledElements = /* @__PURE__ */ new WeakSet();
|
|
2450
|
+
}
|
|
2451
|
+
});
|
|
2452
|
+
return () => {
|
|
2453
|
+
document.removeEventListener("scroll", onScroll), unsubOnBeforeLoad(), unsubOnResolved();
|
|
2454
|
+
};
|
|
2455
|
+
}, [options?.getKey, router]);
|
|
2456
|
+
}
|
|
2457
|
+
function ScrollRestoration(props) {
|
|
2458
|
+
return useScrollRestoration(props), null;
|
|
2459
|
+
}
|
|
2460
|
+
function getCssSelector(el) {
|
|
2461
|
+
const path = [];
|
|
2462
|
+
let parent;
|
|
2463
|
+
for (; parent = el.parentNode; )
|
|
2464
|
+
path.unshift(
|
|
2465
|
+
`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})`
|
|
2466
|
+
), el = parent;
|
|
2467
|
+
return `${path.join(" > ")}`.toLowerCase();
|
|
2468
|
+
}
|
|
2469
|
+
export {
|
|
2470
|
+
Link as L,
|
|
2471
|
+
Outlet as O,
|
|
2472
|
+
RouterProvider as R,
|
|
2473
|
+
ScrollRestoration as S,
|
|
2474
|
+
createHashHistory as a,
|
|
2475
|
+
createBrowserHistory as b,
|
|
2476
|
+
createRouter as c,
|
|
2477
|
+
createRootRouteWithContext as d,
|
|
2478
|
+
createFileRoute as e,
|
|
2479
|
+
useParams as f,
|
|
2480
|
+
useRouterState as g,
|
|
2481
|
+
isNotFound as i,
|
|
2482
|
+
notFound as n,
|
|
2483
|
+
useRouter as u
|
|
2484
|
+
};
|