clawcrib 0.1.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/README.md +27 -0
- package/bin/clawcrib.mjs +149 -0
- package/dist/.next/BUILD_ID +1 -0
- package/dist/.next/app-path-routes-manifest.json +28 -0
- package/dist/.next/build-manifest.json +21 -0
- package/dist/.next/package.json +1 -0
- package/dist/.next/prerender-manifest.json +354 -0
- package/dist/.next/required-server-files.json +331 -0
- package/dist/.next/routes-manifest.json +244 -0
- package/dist/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/_global-error/page/build-manifest.json +18 -0
- package/dist/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/dist/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/_global-error/page.js +10 -0
- package/dist/.next/server/app/_global-error/page.js.map +5 -0
- package/dist/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/dist/.next/server/app/_global-error/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/_global-error.html +2 -0
- package/dist/.next/server/app/_global-error.meta +15 -0
- package/dist/.next/server/app/_global-error.rsc +12 -0
- package/dist/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/dist/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
- package/dist/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/dist/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
- package/dist/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/dist/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/_not-found/page/build-manifest.json +18 -0
- package/dist/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/_not-found/page.js +16 -0
- package/dist/.next/server/app/_not-found/page.js.map +5 -0
- package/dist/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/_not-found.html +7 -0
- package/dist/.next/server/app/_not-found.meta +16 -0
- package/dist/.next/server/app/_not-found.rsc +25 -0
- package/dist/.next/server/app/_not-found.segments/_full.segment.rsc +25 -0
- package/dist/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/_not-found.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +6 -0
- package/dist/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
- package/dist/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -0
- package/dist/.next/server/app/agent/[name]/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/agent/[name]/page/build-manifest.json +18 -0
- package/dist/.next/server/app/agent/[name]/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/agent/[name]/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/agent/[name]/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/agent/[name]/page.js +18 -0
- package/dist/.next/server/app/agent/[name]/page.js.map +5 -0
- package/dist/.next/server/app/agent/[name]/page.js.nft.json +1 -0
- package/dist/.next/server/app/agent/[name]/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/chat/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/chat/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/chat/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/chat/route.js +7 -0
- package/dist/.next/server/app/api/chat/route.js.map +5 -0
- package/dist/.next/server/app/api/chat/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/chat/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/crib/profiles/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/crib/profiles/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/crib/profiles/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/crib/profiles/route.js +7 -0
- package/dist/.next/server/app/api/crib/profiles/route.js.map +5 -0
- package/dist/.next/server/app/api/crib/profiles/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/crib/profiles/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/crib/stream/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/crib/stream/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/crib/stream/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/crib/stream/route.js +7 -0
- package/dist/.next/server/app/api/crib/stream/route.js.map +5 -0
- package/dist/.next/server/app/api/crib/stream/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/crib/stream/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/seed-learn/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/seed-learn/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/seed-learn/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/seed-learn/route.js +9 -0
- package/dist/.next/server/app/api/seed-learn/route.js.map +5 -0
- package/dist/.next/server/app/api/seed-learn/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/seed-learn/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route.js +8 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route.js.map +5 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/v1/agents/[handle]/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/v1/agents/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/v1/agents/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/v1/agents/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/v1/agents/route.js +8 -0
- package/dist/.next/server/app/api/v1/agents/route.js.map +5 -0
- package/dist/.next/server/app/api/v1/agents/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/v1/agents/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route.js +8 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route.js.map +5 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/v1/cribs/[slug]/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/v1/cribs/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/v1/cribs/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/v1/cribs/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/v1/cribs/route.js +8 -0
- package/dist/.next/server/app/api/v1/cribs/route.js.map +5 -0
- package/dist/.next/server/app/api/v1/cribs/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/v1/cribs/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/v1/heartbeat/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/v1/heartbeat/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/v1/heartbeat/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/v1/heartbeat/route.js +8 -0
- package/dist/.next/server/app/api/v1/heartbeat/route.js.map +5 -0
- package/dist/.next/server/app/api/v1/heartbeat/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/v1/heartbeat/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/api/v1/stats/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/api/v1/stats/route/build-manifest.json +11 -0
- package/dist/.next/server/app/api/v1/stats/route/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/api/v1/stats/route.js +8 -0
- package/dist/.next/server/app/api/v1/stats/route.js.map +5 -0
- package/dist/.next/server/app/api/v1/stats/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/v1/stats/route_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/browse/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/browse/page/build-manifest.json +18 -0
- package/dist/.next/server/app/browse/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/browse/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/browse/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/browse/page.js +18 -0
- package/dist/.next/server/app/browse/page.js.map +5 -0
- package/dist/.next/server/app/browse/page.js.nft.json +1 -0
- package/dist/.next/server/app/browse/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/browse.html +7 -0
- package/dist/.next/server/app/browse.meta +15 -0
- package/dist/.next/server/app/browse.rsc +26 -0
- package/dist/.next/server/app/browse.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/browse.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/browse.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/browse.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/browse.segments/browse/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/browse.segments/browse.segment.rsc +4 -0
- package/dist/.next/server/app/builder/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/builder/page/build-manifest.json +18 -0
- package/dist/.next/server/app/builder/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/builder/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/builder/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/builder/page.js +19 -0
- package/dist/.next/server/app/builder/page.js.map +5 -0
- package/dist/.next/server/app/builder/page.js.nft.json +1 -0
- package/dist/.next/server/app/builder/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/builder.html +7 -0
- package/dist/.next/server/app/builder.meta +15 -0
- package/dist/.next/server/app/builder.rsc +28 -0
- package/dist/.next/server/app/builder.segments/_full.segment.rsc +28 -0
- package/dist/.next/server/app/builder.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/builder.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/builder.segments/_tree.segment.rsc +6 -0
- package/dist/.next/server/app/builder.segments/builder/__PAGE__.segment.rsc +10 -0
- package/dist/.next/server/app/builder.segments/builder.segment.rsc +4 -0
- package/dist/.next/server/app/crib/[slug]/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/crib/[slug]/page/build-manifest.json +18 -0
- package/dist/.next/server/app/crib/[slug]/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/crib/[slug]/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/crib/[slug]/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/crib/[slug]/page.js +19 -0
- package/dist/.next/server/app/crib/[slug]/page.js.map +5 -0
- package/dist/.next/server/app/crib/[slug]/page.js.nft.json +1 -0
- package/dist/.next/server/app/crib/[slug]/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/crib/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/crib/page/build-manifest.json +18 -0
- package/dist/.next/server/app/crib/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/crib/page/react-loadable-manifest.json +17 -0
- package/dist/.next/server/app/crib/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/crib/page.js +18 -0
- package/dist/.next/server/app/crib/page.js.map +5 -0
- package/dist/.next/server/app/crib/page.js.nft.json +1 -0
- package/dist/.next/server/app/crib/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/crib.html +1 -0
- package/dist/.next/server/app/crib.meta +15 -0
- package/dist/.next/server/app/crib.rsc +26 -0
- package/dist/.next/server/app/crib.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/crib.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/crib.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/crib.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/crib.segments/crib/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/crib.segments/crib.segment.rsc +4 -0
- package/dist/.next/server/app/demo/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/demo/page/build-manifest.json +18 -0
- package/dist/.next/server/app/demo/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/demo/page/react-loadable-manifest.json +17 -0
- package/dist/.next/server/app/demo/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/demo/page.js +18 -0
- package/dist/.next/server/app/demo/page.js.map +5 -0
- package/dist/.next/server/app/demo/page.js.nft.json +1 -0
- package/dist/.next/server/app/demo/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/demo.html +1 -0
- package/dist/.next/server/app/demo.meta +15 -0
- package/dist/.next/server/app/demo.rsc +26 -0
- package/dist/.next/server/app/demo.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/demo.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/demo.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/demo.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/demo.segments/demo/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/demo.segments/demo.segment.rsc +4 -0
- package/dist/.next/server/app/feedback/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/feedback/page/build-manifest.json +18 -0
- package/dist/.next/server/app/feedback/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/feedback/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/feedback/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/feedback/page.js +18 -0
- package/dist/.next/server/app/feedback/page.js.map +5 -0
- package/dist/.next/server/app/feedback/page.js.nft.json +1 -0
- package/dist/.next/server/app/feedback/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/feedback.html +7 -0
- package/dist/.next/server/app/feedback.meta +15 -0
- package/dist/.next/server/app/feedback.rsc +26 -0
- package/dist/.next/server/app/feedback.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/feedback.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/feedback.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/feedback.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/feedback.segments/feedback.segment.rsc +4 -0
- package/dist/.next/server/app/gltest/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/gltest/page/build-manifest.json +18 -0
- package/dist/.next/server/app/gltest/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/gltest/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/gltest/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/gltest/page.js +18 -0
- package/dist/.next/server/app/gltest/page.js.map +5 -0
- package/dist/.next/server/app/gltest/page.js.nft.json +1 -0
- package/dist/.next/server/app/gltest/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/gltest.html +1 -0
- package/dist/.next/server/app/gltest.meta +16 -0
- package/dist/.next/server/app/gltest.rsc +26 -0
- package/dist/.next/server/app/gltest.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/gltest.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/gltest.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/gltest.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/gltest.segments/gltest/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/gltest.segments/gltest.segment.rsc +4 -0
- package/dist/.next/server/app/help/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/help/page/build-manifest.json +18 -0
- package/dist/.next/server/app/help/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/help/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/help/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/help/page.js +19 -0
- package/dist/.next/server/app/help/page.js.map +5 -0
- package/dist/.next/server/app/help/page.js.nft.json +1 -0
- package/dist/.next/server/app/help/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/help.html +7 -0
- package/dist/.next/server/app/help.meta +15 -0
- package/dist/.next/server/app/help.rsc +26 -0
- package/dist/.next/server/app/help.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/help.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/help.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/help.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/help.segments/help/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/help.segments/help.segment.rsc +4 -0
- package/dist/.next/server/app/icon.svg/route/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/icon.svg/route/build-manifest.json +11 -0
- package/dist/.next/server/app/icon.svg/route.js +7 -0
- package/dist/.next/server/app/icon.svg/route.js.map +5 -0
- package/dist/.next/server/app/icon.svg/route.js.nft.json +1 -0
- package/dist/.next/server/app/icon.svg.body +69 -0
- package/dist/.next/server/app/icon.svg.meta +1 -0
- package/dist/.next/server/app/index.html +1 -0
- package/dist/.next/server/app/index.meta +14 -0
- package/dist/.next/server/app/index.rsc +26 -0
- package/dist/.next/server/app/index.segments/__PAGE__.segment.rsc +9 -0
- package/dist/.next/server/app/index.segments/_full.segment.rsc +26 -0
- package/dist/.next/server/app/index.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/index.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/index.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/learn/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/learn/page/build-manifest.json +18 -0
- package/dist/.next/server/app/learn/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/learn/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/learn/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/learn/page.js +18 -0
- package/dist/.next/server/app/learn/page.js.map +5 -0
- package/dist/.next/server/app/learn/page.js.nft.json +1 -0
- package/dist/.next/server/app/learn/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/learn.html +7 -0
- package/dist/.next/server/app/learn.meta +15 -0
- package/dist/.next/server/app/learn.rsc +24 -0
- package/dist/.next/server/app/learn.segments/_full.segment.rsc +24 -0
- package/dist/.next/server/app/learn.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/learn.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/learn.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/learn.segments/learn/__PAGE__.segment.rsc +6 -0
- package/dist/.next/server/app/learn.segments/learn.segment.rsc +4 -0
- package/dist/.next/server/app/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/page/build-manifest.json +18 -0
- package/dist/.next/server/app/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/page.js +18 -0
- package/dist/.next/server/app/page.js.map +5 -0
- package/dist/.next/server/app/page.js.nft.json +1 -0
- package/dist/.next/server/app/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/privacy/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/privacy/page/build-manifest.json +18 -0
- package/dist/.next/server/app/privacy/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/privacy/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/privacy/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/privacy/page.js +18 -0
- package/dist/.next/server/app/privacy/page.js.map +5 -0
- package/dist/.next/server/app/privacy/page.js.nft.json +1 -0
- package/dist/.next/server/app/privacy/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/privacy.html +7 -0
- package/dist/.next/server/app/privacy.meta +15 -0
- package/dist/.next/server/app/privacy.rsc +49 -0
- package/dist/.next/server/app/privacy.segments/_full.segment.rsc +49 -0
- package/dist/.next/server/app/privacy.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/privacy.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/privacy.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +26 -0
- package/dist/.next/server/app/privacy.segments/privacy.segment.rsc +4 -0
- package/dist/.next/server/app/terms/page/app-paths-manifest.json +3 -0
- package/dist/.next/server/app/terms/page/build-manifest.json +18 -0
- package/dist/.next/server/app/terms/page/next-font-manifest.json +11 -0
- package/dist/.next/server/app/terms/page/react-loadable-manifest.json +1 -0
- package/dist/.next/server/app/terms/page/server-reference-manifest.json +4 -0
- package/dist/.next/server/app/terms/page.js +18 -0
- package/dist/.next/server/app/terms/page.js.map +5 -0
- package/dist/.next/server/app/terms/page.js.nft.json +1 -0
- package/dist/.next/server/app/terms/page_client-reference-manifest.js +2 -0
- package/dist/.next/server/app/terms.html +7 -0
- package/dist/.next/server/app/terms.meta +15 -0
- package/dist/.next/server/app/terms.rsc +46 -0
- package/dist/.next/server/app/terms.segments/_full.segment.rsc +46 -0
- package/dist/.next/server/app/terms.segments/_head.segment.rsc +6 -0
- package/dist/.next/server/app/terms.segments/_index.segment.rsc +11 -0
- package/dist/.next/server/app/terms.segments/_tree.segment.rsc +5 -0
- package/dist/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +22 -0
- package/dist/.next/server/app/terms.segments/terms.segment.rsc +4 -0
- package/dist/.next/server/app-paths-manifest.json +28 -0
- package/dist/.next/server/chunks/[externals]__26f7eb63._.js +3 -0
- package/dist/.next/server/chunks/[externals]__94ec4388._.js +3 -0
- package/dist/.next/server/chunks/[externals]_next_dist_5e1fe3b2._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__0b3464ad._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__44bc039f._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__63d66305._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__664944da._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__8f5ebbc3._.js +7 -0
- package/dist/.next/server/chunks/[root-of-the-server]__b922dae0._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__c60a61a1._.js +8 -0
- package/dist/.next/server/chunks/[root-of-the-server]__e4ef116e._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__ec9868a8._.js +3 -0
- package/dist/.next/server/chunks/[root-of-the-server]__ecc70079._.js +3 -0
- package/dist/.next/server/chunks/[turbopack]_runtime.js +795 -0
- package/dist/.next/server/chunks/_a7270702._.js +5 -0
- package/dist/.next/server/chunks/_bf13447d._.js +5 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_chat_route_actions_ac0c75e3.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_crib_profiles_route_actions_308de254.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_crib_stream_route_actions_bbf9b7bc.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_seed-learn_route_actions_0699fef4.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_v1_agents_[handle]_route_actions_0c549019.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_v1_agents_route_actions_721a8d91.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_v1_cribs_[slug]_route_actions_7da88aef.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_v1_cribs_route_actions_3e0e4f62.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_v1_heartbeat_route_actions_68e6be72.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_api_v1_stats_route_actions_6eecb829.js +3 -0
- package/dist/.next/server/chunks/_next-internal_server_app_icon_svg_route_actions_d76bbd00.js +3 -0
- package/dist/.next/server/chunks/node_modules_next_1402a1da._.js +17 -0
- package/dist/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1cb6f5ec.js +138 -0
- package/dist/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_b0bc0442.js +4 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__0d14f48b._.js +11 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__1eed2761._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__2734027d._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__2e88568e._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__303358d0._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__30f2aed4._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__4158500d._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__5d87b943._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__6c6c4815._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__72d10e7e._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__76b71b25._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__7bce49e2._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__83594e65._.js +5 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__89e1cc69._.js +11 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__89f9832c._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__9e78ee63._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__a457c799._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__a83a39ca._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__b704ba4a._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__c5a73a50._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__cb11b5eb._.js +4 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__ccfb3607._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__d62d6ecd._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__e43a75f6._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__e79298db._.js +3 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__fc6e09e6._.js +51 -0
- package/dist/.next/server/chunks/ssr/[root-of-the-server]__feca0381._.js +3 -0
- package/dist/.next/server/chunks/ssr/[turbopack]_runtime.js +795 -0
- package/dist/.next/server/chunks/ssr/_1436224b._.js +3 -0
- package/dist/.next/server/chunks/ssr/_1fad76ec._.js +4 -0
- package/dist/.next/server/chunks/ssr/_22adca49._.js +4 -0
- package/dist/.next/server/chunks/ssr/_305fab72._.js +3 -0
- package/dist/.next/server/chunks/ssr/_326fa6da._.js +4 -0
- package/dist/.next/server/chunks/ssr/_32e7f94c._.js +4 -0
- package/dist/.next/server/chunks/ssr/_3449c279._.js +9 -0
- package/dist/.next/server/chunks/ssr/_50a446b6._.js +4 -0
- package/dist/.next/server/chunks/ssr/_537b36f0._.js +3 -0
- package/dist/.next/server/chunks/ssr/_5a1c26a3._.js +3 -0
- package/dist/.next/server/chunks/ssr/_5b825777._.js +3 -0
- package/dist/.next/server/chunks/ssr/_6034e2f0._.js +3 -0
- package/dist/.next/server/chunks/ssr/_6e1cb0fc._.js +4 -0
- package/dist/.next/server/chunks/ssr/_7db9aade._.js +4 -0
- package/dist/.next/server/chunks/ssr/_84cdd45e._.js +4 -0
- package/dist/.next/server/chunks/ssr/_8d6b2d48._.js +3 -0
- package/dist/.next/server/chunks/ssr/_8e49afb6._.js +11 -0
- package/dist/.next/server/chunks/ssr/_978d53ef._.js +3 -0
- package/dist/.next/server/chunks/ssr/_a46dee72._.js +3 -0
- package/dist/.next/server/chunks/ssr/_a4ec9584._.js +3 -0
- package/dist/.next/server/chunks/ssr/_a523705e._.js +3 -0
- package/dist/.next/server/chunks/ssr/_a8f5ed56._.js +473 -0
- package/dist/.next/server/chunks/ssr/_af002283._.js +4 -0
- package/dist/.next/server/chunks/ssr/_b0f0f24f._.js +3 -0
- package/dist/.next/server/chunks/ssr/_b1786cf5._.js +4 -0
- package/dist/.next/server/chunks/ssr/_bce53e9d._.js +3 -0
- package/dist/.next/server/chunks/ssr/_bdd93ed8._.js +4 -0
- package/dist/.next/server/chunks/ssr/_be519242._.js +3 -0
- package/dist/.next/server/chunks/ssr/_bff3a5c8._.js +4 -0
- package/dist/.next/server/chunks/ssr/_cfc98e1a._.js +3 -0
- package/dist/.next/server/chunks/ssr/_dc6d9d10._.js +4 -0
- package/dist/.next/server/chunks/ssr/_e01a61c0._.js +3 -0
- package/dist/.next/server/chunks/ssr/_e078e27a._.js +3 -0
- package/dist/.next/server/chunks/ssr/_e23aa0ff._.js +4 -0
- package/dist/.next/server/chunks/ssr/_ea501b94._.js +4 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_75761787.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_agent_[name]_page_actions_6440b611.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_browse_page_actions_8ceec5b3.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_builder_page_actions_e20876c5.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_crib_[slug]_page_actions_7c32236c.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_crib_page_actions_378e2f5e.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_demo_page_actions_0903ddc0.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_feedback_page_actions_ad090f73.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_gltest_page_actions_349b4191.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_help_page_actions_0e668f4d.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_learn_page_actions_365b1268.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_page_actions_39d4fc33.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_privacy_page_actions_78bfea85.js +3 -0
- package/dist/.next/server/chunks/ssr/_next-internal_server_app_terms_page_actions_3b82705a.js +3 -0
- package/dist/.next/server/chunks/ssr/convex__generated_api_883e6779.js +4 -0
- package/dist/.next/server/chunks/ssr/node_modules_04a97984._.js +395 -0
- package/dist/.next/server/chunks/ssr/node_modules_3cf9a583._.js +11 -0
- package/dist/.next/server/chunks/ssr/node_modules_@convex-dev_auth_dist_react_index_c572ed70.js +4 -0
- package/dist/.next/server/chunks/ssr/node_modules_a18674a0._.js +395 -0
- package/dist/.next/server/chunks/ssr/node_modules_d6c03641._.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_framer-motion_dist_es_render_components_motion_proxy_mjs_b72b0714._.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_920e7746._.js +6 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js +4 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_174ae28d._.js +10 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_61a87db9._.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_65e60196._.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_6e285db9._.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_2fffaa3a._.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_15817684.js +3 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_92969d11.js +4 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_esm_eedfc1fd._.js +6 -0
- package/dist/.next/server/chunks/ssr/node_modules_next_dist_f9713a08._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_app_0db9afea._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_app_builder_layout_tsx_1bea4aaa._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_app_crib_[slug]_error_tsx_50c1779a._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_app_error_tsx_ef715cc8._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_app_feedback_page_tsx_d44f95de._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_app_gltest_page_tsx_8e1c7fda._.js +183 -0
- package/dist/.next/server/chunks/ssr/src_app_help_layout_tsx_4a130e98._.js +3 -0
- package/dist/.next/server/chunks/ssr/src_components_ConvexClientProvider_tsx_df965ff3._.js +4 -0
- package/dist/.next/server/chunks/ssr/src_lib_63f56dbd._.js +7 -0
- package/dist/.next/server/chunks/ssr/src_lib_data_ts_10e26668._.js +714 -0
- package/dist/.next/server/chunks/ssr/src_lib_e61a13e2._.js +7 -0
- package/dist/.next/server/chunks/ssr/src_lib_org-templates_ts_5900b973._.js +3 -0
- package/dist/.next/server/edge/chunks/[root-of-the-server]__25fe7590._.js +15 -0
- package/dist/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_78fa9d6a.js +3 -0
- package/dist/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_99e3e1b8.js +6 -0
- package/dist/.next/server/functions-config-manifest.json +7 -0
- package/dist/.next/server/middleware-build-manifest.js +22 -0
- package/dist/.next/server/middleware-manifest.json +33 -0
- package/dist/.next/server/next-font-manifest.js +1 -0
- package/dist/.next/server/next-font-manifest.json +63 -0
- package/dist/.next/server/pages/404.html +7 -0
- package/dist/.next/server/pages/500.html +2 -0
- package/dist/.next/server/pages-manifest.json +4 -0
- package/dist/.next/server/server-reference-manifest.js +1 -0
- package/dist/.next/server/server-reference-manifest.json +5 -0
- package/dist/.next/static/LDs2QlURjFsxe6doQgQaH/_buildManifest.js +11 -0
- package/dist/.next/static/LDs2QlURjFsxe6doQgQaH/_clientMiddlewareManifest.json +6 -0
- package/dist/.next/static/LDs2QlURjFsxe6doQgQaH/_ssgManifest.js +1 -0
- package/dist/.next/static/chunks/045c83caa4d15373.js +1 -0
- package/dist/.next/static/chunks/04696d7c5884aa95.js +5 -0
- package/dist/.next/static/chunks/0841814a9bcfce10.js +1 -0
- package/dist/.next/static/chunks/0bd6498bda341889.js +1 -0
- package/dist/.next/static/chunks/108e0ffb63379a48.js +1 -0
- package/dist/.next/static/chunks/11ce1c153def8992.js +1 -0
- package/dist/.next/static/chunks/123ff9bd00156eb9.css +1 -0
- package/dist/.next/static/chunks/169b21b9dab86074.js +1 -0
- package/dist/.next/static/chunks/251e16428085edaf.js +1 -0
- package/dist/.next/static/chunks/33483ea0d00e5c1c.js +393 -0
- package/dist/.next/static/chunks/3cb5ccf4d1eaa633.js +7 -0
- package/dist/.next/static/chunks/46b6f1723e3c2623.js +1 -0
- package/dist/.next/static/chunks/4fa33c2b3825a6a7.js +38 -0
- package/dist/.next/static/chunks/52242a935b4dd54c.js +1 -0
- package/dist/.next/static/chunks/52d3163ddaacab21.js +3 -0
- package/dist/.next/static/chunks/5e108d2a5086dd3c.js +1 -0
- package/dist/.next/static/chunks/619d93506b5beb32.js +2 -0
- package/dist/.next/static/chunks/69a6c697ffcdb2dc.js +1 -0
- package/dist/.next/static/chunks/6b3aa1f3b4ac9239.js +1 -0
- package/dist/.next/static/chunks/792fa1e02f287bb2.js +38 -0
- package/dist/.next/static/chunks/8023316021b59dc8.js +2 -0
- package/dist/.next/static/chunks/82abf2d65f5428ae.js +4 -0
- package/dist/.next/static/chunks/87c6fa7148018b34.css +2 -0
- package/dist/.next/static/chunks/8a5bd6fe3abc8091.css +1 -0
- package/dist/.next/static/chunks/8ba9a4146e696c8b.js +1 -0
- package/dist/.next/static/chunks/909f8c33ddb338d5.js +5 -0
- package/dist/.next/static/chunks/94371ab8e9f84fa1.js +181 -0
- package/dist/.next/static/chunks/a5babc3f7ef11b25.js +9 -0
- package/dist/.next/static/chunks/a6dad97d9634a72d.js +1 -0
- package/dist/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- package/dist/.next/static/chunks/a9b5a3c7d494490d.js +393 -0
- package/dist/.next/static/chunks/ab7596543940b500.js +2 -0
- package/dist/.next/static/chunks/c4fa140911cde35c.js +1 -0
- package/dist/.next/static/chunks/d4bd47435d743ec6.js +13 -0
- package/dist/.next/static/chunks/d91ff7ede64e0c7f.js +434 -0
- package/dist/.next/static/chunks/da5ac7a908f78d62.js +1 -0
- package/dist/.next/static/chunks/e140284ead06b77a.js +712 -0
- package/dist/.next/static/chunks/e3207aa0613573c2.js +9 -0
- package/dist/.next/static/chunks/eb5f77ae3460c46e.js +1 -0
- package/dist/.next/static/chunks/edfa7bbc21dc3450.js +1 -0
- package/dist/.next/static/chunks/f188e57e58a39d0f.js +1 -0
- package/dist/.next/static/chunks/f4e68e70f75d360a.js +1707 -0
- package/dist/.next/static/chunks/fcf47bfad683b072.js +9 -0
- package/dist/.next/static/chunks/fd7c6cd7808e9045.js +49 -0
- package/dist/.next/static/chunks/ff1a16fafef87110.js +1 -0
- package/dist/.next/static/chunks/turbopack-aadb2fcebd6885bc.js +4 -0
- package/dist/.next/static/media/04c5164763c40239-s.690580e8.woff2 +0 -0
- package/dist/.next/static/media/051742360c26797e-s.p.102b7f24.woff2 +0 -0
- package/dist/.next/static/media/1bffadaabf893a1e-s.7cd81963.woff2 +0 -0
- package/dist/.next/static/media/26f284dcc38c84c0-s.303a03d6.woff2 +0 -0
- package/dist/.next/static/media/2bbe8d2671613f1f-s.76dcb0b2.woff2 +0 -0
- package/dist/.next/static/media/2c55a0e60120577a-s.2a48534a.woff2 +0 -0
- package/dist/.next/static/media/5476f68d60460930-s.c995e352.woff2 +0 -0
- package/dist/.next/static/media/6a5386fd6038edbe-s.719084df.woff2 +0 -0
- package/dist/.next/static/media/7e7f32a39836f228-s.0b4edfe7.woff2 +0 -0
- package/dist/.next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2 +0 -0
- package/dist/.next/static/media/9c72aa0f40e4eef8-s.18a48cbc.woff2 +0 -0
- package/dist/.next/static/media/ad66f9afd8947f86-s.7a40eb73.woff2 +0 -0
- package/dist/.next/static/media/fa39153a3fc630ba-s.bff0868b.woff2 +0 -0
- package/dist/.next/static/media/icon.b0846afb.svg +69 -0
- package/dist/node_modules/@img/colour/color.cjs +1594 -0
- package/dist/node_modules/@img/colour/index.cjs +1 -0
- package/dist/node_modules/@img/colour/package.json +45 -0
- package/dist/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
- package/dist/node_modules/@img/sharp-darwin-arm64/package.json +40 -0
- package/dist/node_modules/@img/sharp-libvips-darwin-arm64/README.md +46 -0
- package/dist/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +220 -0
- package/dist/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js +1 -0
- package/dist/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib +0 -0
- package/dist/node_modules/@img/sharp-libvips-darwin-arm64/package.json +36 -0
- package/dist/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +30 -0
- package/dist/node_modules/@next/env/dist/index.js +1 -0
- package/dist/node_modules/@next/env/package.json +36 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +6 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +38 -0
- package/dist/node_modules/@swc/helpers/package.json +471 -0
- package/dist/node_modules/client-only/index.js +0 -0
- package/dist/node_modules/client-only/package.json +19 -0
- package/dist/node_modules/convex/dist/esm/browser/http_client.js +463 -0
- package/dist/node_modules/convex/dist/esm/browser/index-node.js +5 -0
- package/dist/node_modules/convex/dist/esm/browser/index.js +5 -0
- package/dist/node_modules/convex/dist/esm/browser/logging.js +122 -0
- package/dist/node_modules/convex/dist/esm/browser/query_options.js +5 -0
- package/dist/node_modules/convex/dist/esm/browser/simple_client-node.js +3867 -0
- package/dist/node_modules/convex/dist/esm/browser/simple_client.js +403 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/authentication_manager.js +322 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/client.js +739 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/function_result.js +2 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/local_state.js +296 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/metrics.js +31 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/optimistic_updates.js +2 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/optimistic_updates_impl.js +167 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/paginated_query_client.js +365 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/pagination.js +14 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/protocol.js +72 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/remote_query_set.js +78 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/request_manager.js +209 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/session.js +11 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/udf_path_utils.js +38 -0
- package/dist/node_modules/convex/dist/esm/browser/sync/web_socket_manager.js +651 -0
- package/dist/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/dist/node_modules/detect-libc/lib/elf.js +39 -0
- package/dist/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/dist/node_modules/detect-libc/lib/process.js +24 -0
- package/dist/node_modules/detect-libc/package.json +44 -0
- package/dist/node_modules/next/dist/build/adapter/build-complete.js +993 -0
- package/dist/node_modules/next/dist/build/after-production-compile.js +95 -0
- package/dist/node_modules/next/dist/build/analysis/extract-const-value.js +205 -0
- package/dist/node_modules/next/dist/build/analysis/get-page-static-info.js +601 -0
- package/dist/node_modules/next/dist/build/analysis/parse-module.js +20 -0
- package/dist/node_modules/next/dist/build/analyze/index.js +242 -0
- package/dist/node_modules/next/dist/build/babel/loader/get-config.js +429 -0
- package/dist/node_modules/next/dist/build/babel/loader/index.js +56 -0
- package/dist/node_modules/next/dist/build/babel/loader/transform.js +103 -0
- package/dist/node_modules/next/dist/build/babel/loader/util.js +20 -0
- package/dist/node_modules/next/dist/build/babel/plugins/commonjs.js +42 -0
- package/dist/node_modules/next/dist/build/babel/plugins/jsx-pragma.js +74 -0
- package/dist/node_modules/next/dist/build/babel/plugins/next-font-unsupported.js +36 -0
- package/dist/node_modules/next/dist/build/babel/plugins/next-page-config.js +104 -0
- package/dist/node_modules/next/dist/build/babel/plugins/next-page-disallow-re-export-all-exports.js +29 -0
- package/dist/node_modules/next/dist/build/babel/plugins/next-ssg-transform.js +345 -0
- package/dist/node_modules/next/dist/build/babel/plugins/optimize-hook-destructuring.js +60 -0
- package/dist/node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js +145 -0
- package/dist/node_modules/next/dist/build/babel/preset.js +250 -0
- package/dist/node_modules/next/dist/build/build-context.js +58 -0
- package/dist/node_modules/next/dist/build/collect-build-traces.js +536 -0
- package/dist/node_modules/next/dist/build/compiler.js +88 -0
- package/dist/node_modules/next/dist/build/create-compiler-aliases.js +436 -0
- package/dist/node_modules/next/dist/build/define-env.js +237 -0
- package/dist/node_modules/next/dist/build/duration-to-string.js +99 -0
- package/dist/node_modules/next/dist/build/entries.js +798 -0
- package/dist/node_modules/next/dist/build/generate-build-id.js +31 -0
- package/dist/node_modules/next/dist/build/generate-routes-manifest.js +91 -0
- package/dist/node_modules/next/dist/build/get-babel-config-file.js +35 -0
- package/dist/node_modules/next/dist/build/get-babel-loader-config.js +109 -0
- package/dist/node_modules/next/dist/build/get-static-info-including-layouts.js +81 -0
- package/dist/node_modules/next/dist/build/handle-entrypoints.js +176 -0
- package/dist/node_modules/next/dist/build/handle-externals.js +290 -0
- package/dist/node_modules/next/dist/build/index.js +2683 -0
- package/dist/node_modules/next/dist/build/is-writeable.js +26 -0
- package/dist/node_modules/next/dist/build/jest/__mocks__/empty.js +10 -0
- package/dist/node_modules/next/dist/build/jest/__mocks__/fileMock.js +15 -0
- package/dist/node_modules/next/dist/build/jest/__mocks__/nextFontMock.js +20 -0
- package/dist/node_modules/next/dist/build/jest/__mocks__/styleMock.js +10 -0
- package/dist/node_modules/next/dist/build/jest/jest.js +227 -0
- package/dist/node_modules/next/dist/build/jest/object-proxy.js +50 -0
- package/dist/node_modules/next/dist/build/load-entrypoint.js +30 -0
- package/dist/node_modules/next/dist/build/load-jsconfig.js +162 -0
- package/dist/node_modules/next/dist/build/lockfile.js +160 -0
- package/dist/node_modules/next/dist/build/manifests/formatter/format-manifest.js +19 -0
- package/dist/node_modules/next/dist/build/next-config-ts/require-hook.js +85 -0
- package/dist/node_modules/next/dist/build/next-config-ts/transpile-config.js +172 -0
- package/dist/node_modules/next/dist/build/next-dir-paths.js +37 -0
- package/dist/node_modules/next/dist/build/normalize-catchall-routes.js +76 -0
- package/dist/node_modules/next/dist/build/output/format.js +84 -0
- package/dist/node_modules/next/dist/build/output/index.js +186 -0
- package/dist/node_modules/next/dist/build/output/log.js +135 -0
- package/dist/node_modules/next/dist/build/output/store.js +204 -0
- package/dist/node_modules/next/dist/build/page-extensions-type.js +6 -0
- package/dist/node_modules/next/dist/build/polyfills/fetch/index.js +6 -0
- package/dist/node_modules/next/dist/build/polyfills/fetch/whatwg-fetch.js +7 -0
- package/dist/node_modules/next/dist/build/polyfills/object-assign.js +6 -0
- package/dist/node_modules/next/dist/build/polyfills/object.assign/auto.js +4 -0
- package/dist/node_modules/next/dist/build/polyfills/object.assign/implementation.js +4 -0
- package/dist/node_modules/next/dist/build/polyfills/object.assign/index.js +19 -0
- package/dist/node_modules/next/dist/build/polyfills/object.assign/polyfill.js +6 -0
- package/dist/node_modules/next/dist/build/polyfills/object.assign/shim.js +6 -0
- package/dist/node_modules/next/dist/build/polyfills/polyfill-module.js +1 -0
- package/dist/node_modules/next/dist/build/polyfills/polyfill-nomodule.js +1 -0
- package/dist/node_modules/next/dist/build/polyfills/process.js +5 -0
- package/dist/node_modules/next/dist/build/preview-key-utils.js +91 -0
- package/dist/node_modules/next/dist/build/progress.js +151 -0
- package/dist/node_modules/next/dist/build/rendering-mode.js +26 -0
- package/dist/node_modules/next/dist/build/segment-config/app/app-segment-config.js +145 -0
- package/dist/node_modules/next/dist/build/segment-config/app/app-segments.js +137 -0
- package/dist/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +52 -0
- package/dist/node_modules/next/dist/build/segment-config/middleware/middleware-config.js +121 -0
- package/dist/node_modules/next/dist/build/segment-config/pages/pages-segment-config.js +62 -0
- package/dist/node_modules/next/dist/build/sort-by-page-exts.js +30 -0
- package/dist/node_modules/next/dist/build/spinner.js +138 -0
- package/dist/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +137 -0
- package/dist/node_modules/next/dist/build/static-paths/app.js +682 -0
- package/dist/node_modules/next/dist/build/static-paths/pages.js +169 -0
- package/dist/node_modules/next/dist/build/static-paths/types.js +6 -0
- package/dist/node_modules/next/dist/build/static-paths/utils.js +119 -0
- package/dist/node_modules/next/dist/build/swc/helpers.js +15 -0
- package/dist/node_modules/next/dist/build/swc/index.js +1271 -0
- package/dist/node_modules/next/dist/build/swc/install-bindings.js +30 -0
- package/dist/node_modules/next/dist/build/swc/jest-transformer.js +75 -0
- package/dist/node_modules/next/dist/build/swc/options.js +386 -0
- package/dist/node_modules/next/dist/build/swc/types.js +6 -0
- package/dist/node_modules/next/dist/build/templates/app-page.js +1073 -0
- package/dist/node_modules/next/dist/build/templates/app-route.js +420 -0
- package/dist/node_modules/next/dist/build/templates/edge-app-route.js +85 -0
- package/dist/node_modules/next/dist/build/templates/edge-ssr-app.js +311 -0
- package/dist/node_modules/next/dist/build/templates/edge-ssr.js +335 -0
- package/dist/node_modules/next/dist/build/templates/edge-wrapper.js +24 -0
- package/dist/node_modules/next/dist/build/templates/helpers.js +36 -0
- package/dist/node_modules/next/dist/build/templates/middleware.js +115 -0
- package/dist/node_modules/next/dist/build/templates/pages-api.js +194 -0
- package/dist/node_modules/next/dist/build/templates/pages-edge-api.js +39 -0
- package/dist/node_modules/next/dist/build/templates/pages.js +155 -0
- package/dist/node_modules/next/dist/build/turbopack-analyze/index.js +116 -0
- package/dist/node_modules/next/dist/build/turbopack-build/impl.js +244 -0
- package/dist/node_modules/next/dist/build/turbopack-build/index.js +85 -0
- package/dist/node_modules/next/dist/build/turborepo-access-trace/env.js +29 -0
- package/dist/node_modules/next/dist/build/turborepo-access-trace/helpers.js +104 -0
- package/dist/node_modules/next/dist/build/turborepo-access-trace/index.js +30 -0
- package/dist/node_modules/next/dist/build/turborepo-access-trace/result.js +51 -0
- package/dist/node_modules/next/dist/build/turborepo-access-trace/tcp.js +41 -0
- package/dist/node_modules/next/dist/build/turborepo-access-trace/types.js +8 -0
- package/dist/node_modules/next/dist/build/type-check.js +151 -0
- package/dist/node_modules/next/dist/build/utils.js +1261 -0
- package/dist/node_modules/next/dist/build/validate-app-paths.js +242 -0
- package/dist/node_modules/next/dist/build/webpack/alias/react-dom-server-experimental.js +32 -0
- package/dist/node_modules/next/dist/build/webpack/alias/react-dom-server.js +32 -0
- package/dist/node_modules/next/dist/build/webpack/cache-invalidation.js +91 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/base.js +82 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/index.js +562 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/client.js +49 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/file-resolve.js +21 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js +37 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/global.js +65 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/index.js +22 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/modules.js +86 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/loaders/next-font.js +62 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/messages.js +45 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js +190 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/images/index.js +42 -0
- package/dist/node_modules/next/dist/build/webpack/config/blocks/images/messages.js +16 -0
- package/dist/node_modules/next/dist/build/webpack/config/helpers.js +78 -0
- package/dist/node_modules/next/dist/build/webpack/config/index.js +46 -0
- package/dist/node_modules/next/dist/build/webpack/config/utils.js +13 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/CssSyntaxError.js +32 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/camelcase.js +93 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js +287 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/index.js +36 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/postcss-icss-parser.js +105 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/postcss-import-parser.js +220 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/plugins/postcss-url-parser.js +307 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/runtime/api.js +83 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/runtime/getUrl.js +23 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/css-loader/src/utils.js +459 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/devtool/devtool-style-inject.js +129 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/empty-loader.js +14 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/error-loader.js +36 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/get-module-build-info.js +15 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/codegen.js +156 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/index.js +27 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/interface.js +17 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/loader.js +429 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/minify.js +94 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/lightningcss-loader/src/utils.js +58 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/metadata/discover.js +122 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/metadata/resolve-route-data.js +171 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/metadata/types.js +7 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/modularize-import-loader.js +39 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-app-loader/create-app-route-code.js +65 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js +765 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-barrel-loader.js +268 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js +37 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js +51 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-edge-function-loader.js +52 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js +93 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-error-browser-binary-loader.js +21 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js +32 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js +45 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js +49 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-css-loader.js +56 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper.js +33 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-validate.js +27 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper.js +13 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js +211 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/module-proxy.js +14 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/server-reference.js +13 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-loader/track-dynamic-import.js +13 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-flight-server-reference-proxy-loader.js +29 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js +133 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-font-loader/postcss-next-font.js +169 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-image-loader/blur.js +73 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-image-loader/index.js +80 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-invalid-import-error-loader.js +28 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-metadata-image-loader.js +158 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-metadata-route-loader.js +342 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-middleware-asset-loader.js +46 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-middleware-loader.js +59 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-middleware-wasm-loader.js +46 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-root-params-loader.js +164 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-route-loader/index.js +141 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-style-loader/index.js +220 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.js +61 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js +221 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.js +27 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js +241 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/Error.js +40 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/Warning.js +35 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js +125 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/utils.js +86 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js +101 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/file-protocol.js +78 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/join-function.js +190 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss.js +92 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/lib/value-processor.js +97 -0
- package/dist/node_modules/next/dist/build/webpack/loaders/utils.js +100 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/build-manifest-plugin-utils.js +79 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/build-manifest-plugin.js +183 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/copy-file-plugin.js +67 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/css-chunking-plugin.js +277 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/css-minimizer-plugin.js +92 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/devtools-ignore-list-plugin.js +78 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/eval-source-map-dev-tool-plugin.js +191 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/flight-client-entry-plugin.js +793 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/flight-manifest-plugin.js +420 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/force-complete-runtime.js +42 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/jsconfig-paths-plugin.js +219 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/memory-with-gc-cache-plugin.js +114 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/middleware-plugin.js +614 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/mini-css-extract-plugin.js +24 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js +188 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/next-font-manifest-plugin.js +120 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +542 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/next-types-plugin/index.js +428 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/next-types-plugin/shared.js +14 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +57 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/optional-peer-dependency-resolve-plugin.js +45 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/pages-manifest-plugin.js +146 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/profiling-plugin.js +282 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/react-loadable-plugin.js +169 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/slow-module-detection-plugin.js +190 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/subresource-integrity-plugin.js +62 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/telemetry-plugin/telemetry-plugin.js +188 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/telemetry-plugin/update-telemetry-loader-context-from-swc.js +28 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/telemetry-plugin/use-cache-tracker-utils.js +43 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/getModuleTrace.js +89 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/index.js +43 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parse-dynamic-code-evaluation-error.js +19 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseBabel.js +29 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseCss.js +29 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +26 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextFontError.js +33 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextInvalidImportError.js +26 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js +166 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/parseScss.js +42 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/simpleWebpackError.js +18 -0
- package/dist/node_modules/next/dist/build/webpack/plugins/wellknown-errors-plugin/webpackModuleError.js +138 -0
- package/dist/node_modules/next/dist/build/webpack/stringify-request.js +15 -0
- package/dist/node_modules/next/dist/build/webpack/utils.js +109 -0
- package/dist/node_modules/next/dist/build/webpack-build/impl.js +381 -0
- package/dist/node_modules/next/dist/build/webpack-build/index.js +179 -0
- package/dist/node_modules/next/dist/build/webpack-config-rules/resolve.js +55 -0
- package/dist/node_modules/next/dist/build/webpack-config.js +2343 -0
- package/dist/node_modules/next/dist/build/worker.js +35 -0
- package/dist/node_modules/next/dist/build/write-build-id.js +19 -0
- package/dist/node_modules/next/dist/cli/next-test.js +169 -0
- package/dist/node_modules/next/dist/client/add-base-path.js +24 -0
- package/dist/node_modules/next/dist/client/app-build-id.js +49 -0
- package/dist/node_modules/next/dist/client/app-call-server.js +34 -0
- package/dist/node_modules/next/dist/client/app-find-source-map-url.js +38 -0
- package/dist/node_modules/next/dist/client/assign-location.js +29 -0
- package/dist/node_modules/next/dist/client/components/app-router-announcer.js +78 -0
- package/dist/node_modules/next/dist/client/components/app-router-headers.js +128 -0
- package/dist/node_modules/next/dist/client/components/app-router-instance.js +319 -0
- package/dist/node_modules/next/dist/client/components/app-router-utils.js +62 -0
- package/dist/node_modules/next/dist/client/components/app-router.js +495 -0
- package/dist/node_modules/next/dist/client/components/builtin/default.js +35 -0
- package/dist/node_modules/next/dist/client/components/builtin/global-error.js +82 -0
- package/dist/node_modules/next/dist/client/components/dev-root-http-access-fallback-boundary.js +52 -0
- package/dist/node_modules/next/dist/client/components/error-boundary.js +134 -0
- package/dist/node_modules/next/dist/client/components/errors/graceful-degrade-boundary.js +86 -0
- package/dist/node_modules/next/dist/client/components/errors/root-error-boundary.js +41 -0
- package/dist/node_modules/next/dist/client/components/forbidden.js +48 -0
- package/dist/node_modules/next/dist/client/components/handle-isr-error.js +31 -0
- package/dist/node_modules/next/dist/client/components/hooks-server-context.js +42 -0
- package/dist/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js +125 -0
- package/dist/node_modules/next/dist/client/components/http-access-fallback/http-access-fallback.js +72 -0
- package/dist/node_modules/next/dist/client/components/is-next-router-error.js +23 -0
- package/dist/node_modules/next/dist/client/components/links.js +292 -0
- package/dist/node_modules/next/dist/client/components/match-segments.js +32 -0
- package/dist/node_modules/next/dist/client/components/nav-failure-handler.js +61 -0
- package/dist/node_modules/next/dist/client/components/navigation-devtools.js +126 -0
- package/dist/node_modules/next/dist/client/components/navigation-untracked.js +65 -0
- package/dist/node_modules/next/dist/client/components/navigation.js +198 -0
- package/dist/node_modules/next/dist/client/components/navigation.react-server.js +72 -0
- package/dist/node_modules/next/dist/client/components/not-found.js +42 -0
- package/dist/node_modules/next/dist/client/components/readonly-url-search-params.js +41 -0
- package/dist/node_modules/next/dist/client/components/redirect-boundary.js +107 -0
- package/dist/node_modules/next/dist/client/components/redirect-error.js +52 -0
- package/dist/node_modules/next/dist/client/components/redirect-status-code.js +24 -0
- package/dist/node_modules/next/dist/client/components/redirect.js +91 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js +128 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js +21 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +59 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js +32 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +340 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/handle-mutable.js +66 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js +51 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +1129 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/find-head-in-cache.js +64 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/has-interception-route-in-current-tree.js +38 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +23 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +168 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +68 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +78 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +292 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +56 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +61 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/router-reducer.js +66 -0
- package/dist/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +60 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/cache-key.js +28 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/cache-map.js +305 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/cache.js +1432 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/lru.js +145 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/navigation.js +459 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/prefetch.js +31 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/scheduler.js +1150 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/types.js +69 -0
- package/dist/node_modules/next/dist/client/components/segment-cache/vary-path.js +216 -0
- package/dist/node_modules/next/dist/client/components/static-generation-bailout.js +42 -0
- package/dist/node_modules/next/dist/client/components/unauthorized.js +49 -0
- package/dist/node_modules/next/dist/client/components/unrecognized-action-error.js +39 -0
- package/dist/node_modules/next/dist/client/components/unresolved-thenable.js +23 -0
- package/dist/node_modules/next/dist/client/components/unstable-rethrow.browser.js +28 -0
- package/dist/node_modules/next/dist/client/components/unstable-rethrow.js +25 -0
- package/dist/node_modules/next/dist/client/components/unstable-rethrow.server.js +32 -0
- package/dist/node_modules/next/dist/client/components/use-action-queue.js +102 -0
- package/dist/node_modules/next/dist/client/dev/debug-channel.js +72 -0
- package/dist/node_modules/next/dist/client/flight-data-helpers.js +219 -0
- package/dist/node_modules/next/dist/client/has-base-path.js +23 -0
- package/dist/node_modules/next/dist/client/lib/console.js +177 -0
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +36 -0
- package/dist/node_modules/next/dist/client/remove-base-path.js +32 -0
- package/dist/node_modules/next/dist/client/route-params.js +230 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +339 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/cookies/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/ponyfill/index.js +46 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/ponyfill/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/abort-controller.js.text.js +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/console.js.text.js +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/events.js.text.js +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/index.js +5 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/load.js +18713 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/stream.js +44 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/timers.js.text.js +1 -0
- package/dist/node_modules/next/dist/compiled/@edge-runtime/primitives/url.js.text.js +1 -0
- package/dist/node_modules/next/dist/compiled/@hapi/accept/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/@hapi/accept/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/@napi-rs/triples/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/@napi-rs/triples/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/@opentelemetry/api/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/@opentelemetry/api/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/async-retry/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/async-retry/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/async-sema/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/async-sema/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/babel/code-frame.js +1 -0
- package/dist/node_modules/next/dist/compiled/babel/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/babel-code-frame/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/babel-code-frame/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/busboy/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/busboy/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/bytes/index.js +8 -0
- package/dist/node_modules/next/dist/compiled/bytes/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/ci-info/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/ci-info/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/commander/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/commander/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/comment-json/index.js +7 -0
- package/dist/node_modules/next/dist/compiled/comment-json/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/compression/index.js +58 -0
- package/dist/node_modules/next/dist/compiled/compression/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/conf/index.js +15 -0
- package/dist/node_modules/next/dist/compiled/conf/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/content-disposition/index.js +6 -0
- package/dist/node_modules/next/dist/compiled/content-disposition/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/cookie/index.js +7 -0
- package/dist/node_modules/next/dist/compiled/cookie/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/cross-spawn/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/cross-spawn/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/debug/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/debug/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/edge-runtime/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/edge-runtime/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/find-up/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/find-up/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/fresh/index.js +8 -0
- package/dist/node_modules/next/dist/compiled/fresh/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/http-proxy/index.js +34 -0
- package/dist/node_modules/next/dist/compiled/http-proxy/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/image-detector/detector.js +1 -0
- package/dist/node_modules/next/dist/compiled/image-size/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/image-size/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/ipaddr.js/ipaddr.js +1 -0
- package/dist/node_modules/next/dist/compiled/ipaddr.js/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/is-animated/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/is-animated/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/is-docker/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/is-docker/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/is-wsl/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/is-wsl/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/jsonwebtoken/index.js +11 -0
- package/dist/node_modules/next/dist/compiled/jsonwebtoken/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/nanoid/index.cjs +1 -0
- package/dist/node_modules/next/dist/compiled/nanoid/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +24 -0
- package/dist/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +24 -0
- package/dist/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +6 -0
- package/dist/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +20 -0
- package/dist/node_modules/next/dist/compiled/p-limit/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/p-limit/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/p-queue/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/p-queue/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/path-browserify/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/path-browserify/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/path-to-regexp/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/picomatch/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/picomatch/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +133 -0
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +130 -0
- package/dist/node_modules/next/dist/compiled/react-is/index.js +7 -0
- package/dist/node_modules/next/dist/compiled/react-is/package.json +26 -0
- package/dist/node_modules/next/dist/compiled/regenerator-runtime/package.json +19 -0
- package/dist/node_modules/next/dist/compiled/regenerator-runtime/runtime.js +729 -0
- package/dist/node_modules/next/dist/compiled/semver/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/semver/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/send/index.js +70 -0
- package/dist/node_modules/next/dist/compiled/send/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/source-map/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/source-map/source-map.js +1 -0
- package/dist/node_modules/next/dist/compiled/stacktrace-parser/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js +1 -0
- package/dist/node_modules/next/dist/compiled/string-hash/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/string-hash/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/strip-ansi/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/strip-ansi/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/superstruct/index.cjs +1 -0
- package/dist/node_modules/next/dist/compiled/superstruct/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/tar/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/tar/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/text-table/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/text-table/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/watchpack/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/watchpack/watchpack.js +1 -0
- package/dist/node_modules/next/dist/compiled/ws/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/ws/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/zod/index.cjs +1 -0
- package/dist/node_modules/next/dist/compiled/zod/package.json +1 -0
- package/dist/node_modules/next/dist/compiled/zod-validation-error/index.js +1 -0
- package/dist/node_modules/next/dist/compiled/zod-validation-error/package.json +1 -0
- package/dist/node_modules/next/dist/experimental/testmode/context.js +57 -0
- package/dist/node_modules/next/dist/experimental/testmode/fetch.js +142 -0
- package/dist/node_modules/next/dist/experimental/testmode/httpget.js +26 -0
- package/dist/node_modules/next/dist/experimental/testmode/server-edge.js +32 -0
- package/dist/node_modules/next/dist/experimental/testmode/server.js +62 -0
- package/dist/node_modules/next/dist/export/helpers/create-incremental-cache.js +61 -0
- package/dist/node_modules/next/dist/lib/batcher.js +65 -0
- package/dist/node_modules/next/dist/lib/build-custom-route.js +46 -0
- package/dist/node_modules/next/dist/lib/bundler.js +97 -0
- package/dist/node_modules/next/dist/lib/client-and-server-references.js +54 -0
- package/dist/node_modules/next/dist/lib/coalesced-function.js +39 -0
- package/dist/node_modules/next/dist/lib/compile-error.js +14 -0
- package/dist/node_modules/next/dist/lib/constants.js +405 -0
- package/dist/node_modules/next/dist/lib/create-client-router-filter.js +67 -0
- package/dist/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
- package/dist/node_modules/next/dist/lib/detached-promise.js +32 -0
- package/dist/node_modules/next/dist/lib/detect-typo.js +51 -0
- package/dist/node_modules/next/dist/lib/download-swc.js +183 -0
- package/dist/node_modules/next/dist/lib/error-telemetry-utils.js +42 -0
- package/dist/node_modules/next/dist/lib/fallback.js +100 -0
- package/dist/node_modules/next/dist/lib/fatal-error.js +14 -0
- package/dist/node_modules/next/dist/lib/file-exists.js +53 -0
- package/dist/node_modules/next/dist/lib/find-config.js +102 -0
- package/dist/node_modules/next/dist/lib/find-pages-dir.js +65 -0
- package/dist/node_modules/next/dist/lib/find-root.js +122 -0
- package/dist/node_modules/next/dist/lib/format-cli-help-output.js +84 -0
- package/dist/node_modules/next/dist/lib/format-dynamic-import-path.js +24 -0
- package/dist/node_modules/next/dist/lib/format-server-error.js +74 -0
- package/dist/node_modules/next/dist/lib/framework/boundary-components.js +62 -0
- package/dist/node_modules/next/dist/lib/framework/boundary-constants.js +36 -0
- package/dist/node_modules/next/dist/lib/fs/rename.js +87 -0
- package/dist/node_modules/next/dist/lib/fs/write-atomic.js +28 -0
- package/dist/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +69 -0
- package/dist/node_modules/next/dist/lib/get-files-in-dir.js +33 -0
- package/dist/node_modules/next/dist/lib/get-network-host.js +44 -0
- package/dist/node_modules/next/dist/lib/get-package-version.js +118 -0
- package/dist/node_modules/next/dist/lib/get-project-dir.js +51 -0
- package/dist/node_modules/next/dist/lib/has-necessary-dependencies.js +49 -0
- package/dist/node_modules/next/dist/lib/helpers/get-cache-directory.js +66 -0
- package/dist/node_modules/next/dist/lib/helpers/get-npx-command.js +29 -0
- package/dist/node_modules/next/dist/lib/helpers/get-online.js +50 -0
- package/dist/node_modules/next/dist/lib/helpers/get-pkg-manager.js +63 -0
- package/dist/node_modules/next/dist/lib/helpers/get-registry.js +45 -0
- package/dist/node_modules/next/dist/lib/helpers/get-reserved-port.js +116 -0
- package/dist/node_modules/next/dist/lib/helpers/install.js +83 -0
- package/dist/node_modules/next/dist/lib/import-next-warning.js +50 -0
- package/dist/node_modules/next/dist/lib/inline-static-env.js +112 -0
- package/dist/node_modules/next/dist/lib/install-dependencies.js +40 -0
- package/dist/node_modules/next/dist/lib/interop-default.js +15 -0
- package/dist/node_modules/next/dist/lib/is-api-route.js +15 -0
- package/dist/node_modules/next/dist/lib/is-app-page-route.js +15 -0
- package/dist/node_modules/next/dist/lib/is-app-route-route.js +15 -0
- package/dist/node_modules/next/dist/lib/is-edge-runtime.js +16 -0
- package/dist/node_modules/next/dist/lib/is-error.js +78 -0
- package/dist/node_modules/next/dist/lib/is-internal-component.js +36 -0
- package/dist/node_modules/next/dist/lib/is-serializable-props.js +106 -0
- package/dist/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
- package/dist/node_modules/next/dist/lib/load-custom-routes.js +550 -0
- package/dist/node_modules/next/dist/lib/memory/gc-observer.js +53 -0
- package/dist/node_modules/next/dist/lib/memory/shutdown.js +29 -0
- package/dist/node_modules/next/dist/lib/memory/startup.js +47 -0
- package/dist/node_modules/next/dist/lib/memory/trace.js +109 -0
- package/dist/node_modules/next/dist/lib/metadata/constants.js +40 -0
- package/dist/node_modules/next/dist/lib/metadata/default-metadata.js +82 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/alternate.js +55 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/basic.js +307 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/icon-mark.js +22 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/icons.js +64 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/meta.js +123 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/opengraph.js +478 -0
- package/dist/node_modules/next/dist/lib/metadata/generate/utils.js +52 -0
- package/dist/node_modules/next/dist/lib/metadata/get-metadata-route.js +114 -0
- package/dist/node_modules/next/dist/lib/metadata/is-metadata-route.js +221 -0
- package/dist/node_modules/next/dist/lib/metadata/metadata-context.js +18 -0
- package/dist/node_modules/next/dist/lib/metadata/metadata.js +243 -0
- package/dist/node_modules/next/dist/lib/metadata/resolve-metadata.js +859 -0
- package/dist/node_modules/next/dist/lib/metadata/resolvers/resolve-basics.js +232 -0
- package/dist/node_modules/next/dist/lib/metadata/resolvers/resolve-icons.js +56 -0
- package/dist/node_modules/next/dist/lib/metadata/resolvers/resolve-opengraph.js +199 -0
- package/dist/node_modules/next/dist/lib/metadata/resolvers/resolve-title.js +40 -0
- package/dist/node_modules/next/dist/lib/metadata/resolvers/resolve-url.js +135 -0
- package/dist/node_modules/next/dist/lib/metadata/types/alternative-urls-types.js +7 -0
- package/dist/node_modules/next/dist/lib/metadata/types/extra-types.js +9 -0
- package/dist/node_modules/next/dist/lib/metadata/types/icons.js +6 -0
- package/dist/node_modules/next/dist/lib/metadata/types/manifest-types.js +6 -0
- package/dist/node_modules/next/dist/lib/metadata/types/metadata-interface.js +18 -0
- package/dist/node_modules/next/dist/lib/metadata/types/metadata-types.js +10 -0
- package/dist/node_modules/next/dist/lib/metadata/types/opengraph-types.js +6 -0
- package/dist/node_modules/next/dist/lib/metadata/types/resolvers.js +6 -0
- package/dist/node_modules/next/dist/lib/metadata/types/twitter-types.js +7 -0
- package/dist/node_modules/next/dist/lib/mime-type.js +20 -0
- package/dist/node_modules/next/dist/lib/mkcert.js +204 -0
- package/dist/node_modules/next/dist/lib/multi-file-writer.js +75 -0
- package/dist/node_modules/next/dist/lib/needs-experimental-react.js +16 -0
- package/dist/node_modules/next/dist/lib/non-nullable.js +15 -0
- package/dist/node_modules/next/dist/lib/normalize-path.js +21 -0
- package/dist/node_modules/next/dist/lib/oxford-comma-list.js +15 -0
- package/dist/node_modules/next/dist/lib/page-types.js +18 -0
- package/dist/node_modules/next/dist/lib/patch-incorrect-lockfile.js +185 -0
- package/dist/node_modules/next/dist/lib/pick.js +19 -0
- package/dist/node_modules/next/dist/lib/picocolors.js +177 -0
- package/dist/node_modules/next/dist/lib/pretty-bytes.js +74 -0
- package/dist/node_modules/next/dist/lib/realpath.js +20 -0
- package/dist/node_modules/next/dist/lib/recursive-copy.js +76 -0
- package/dist/node_modules/next/dist/lib/recursive-delete.js +137 -0
- package/dist/node_modules/next/dist/lib/recursive-readdir.js +124 -0
- package/dist/node_modules/next/dist/lib/redirect-status.js +46 -0
- package/dist/node_modules/next/dist/lib/require-instrumentation-client.js +26 -0
- package/dist/node_modules/next/dist/lib/resolve-build-paths.js +149 -0
- package/dist/node_modules/next/dist/lib/resolve-from.js +65 -0
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.js +107 -0
- package/dist/node_modules/next/dist/lib/scheduler.js +64 -0
- package/dist/node_modules/next/dist/lib/semver-noop.js +18 -0
- package/dist/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
- package/dist/node_modules/next/dist/lib/setup-exception-listeners.js +11 -0
- package/dist/node_modules/next/dist/lib/static-env.js +92 -0
- package/dist/node_modules/next/dist/lib/try-to-parse-path.js +68 -0
- package/dist/node_modules/next/dist/lib/turbopack-warning.js +186 -0
- package/dist/node_modules/next/dist/lib/typescript/diagnosticFormatter.js +240 -0
- package/dist/node_modules/next/dist/lib/typescript/getTypeScriptConfiguration.js +73 -0
- package/dist/node_modules/next/dist/lib/typescript/getTypeScriptIntent.js +52 -0
- package/dist/node_modules/next/dist/lib/typescript/missingDependencyError.js +27 -0
- package/dist/node_modules/next/dist/lib/typescript/runTypeCheck.js +151 -0
- package/dist/node_modules/next/dist/lib/typescript/type-paths.js +56 -0
- package/dist/node_modules/next/dist/lib/typescript/writeAppTypeDeclarations.js +65 -0
- package/dist/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +394 -0
- package/dist/node_modules/next/dist/lib/url.js +75 -0
- package/dist/node_modules/next/dist/lib/verify-partytown-setup.js +115 -0
- package/dist/node_modules/next/dist/lib/verify-root-layout.js +165 -0
- package/dist/node_modules/next/dist/lib/verify-typescript-setup.js +178 -0
- package/dist/node_modules/next/dist/lib/wait.js +19 -0
- package/dist/node_modules/next/dist/lib/with-promise-cache.js +24 -0
- package/dist/node_modules/next/dist/lib/worker.js +223 -0
- package/dist/node_modules/next/dist/next-devtools/server/shared.js +61 -0
- package/dist/node_modules/next/dist/server/ReactDOMServerPages.js +16 -0
- package/dist/node_modules/next/dist/server/accept-header.js +132 -0
- package/dist/node_modules/next/dist/server/after/after-context.js +140 -0
- package/dist/node_modules/next/dist/server/after/after.js +26 -0
- package/dist/node_modules/next/dist/server/after/awaiter.js +74 -0
- package/dist/node_modules/next/dist/server/after/builtin-request-context.js +38 -0
- package/dist/node_modules/next/dist/server/after/index.js +21 -0
- package/dist/node_modules/next/dist/server/after/run-with-after.js +35 -0
- package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.js +22 -0
- package/dist/node_modules/next/dist/server/api-utils/index.js +201 -0
- package/dist/node_modules/next/dist/server/api-utils/node/api-resolver.js +395 -0
- package/dist/node_modules/next/dist/server/api-utils/node/parse-body.js +79 -0
- package/dist/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +86 -0
- package/dist/node_modules/next/dist/server/api-utils/web.js +17 -0
- package/dist/node_modules/next/dist/server/app-render/action-async-storage-instance.js +14 -0
- package/dist/node_modules/next/dist/server/app-render/action-async-storage.external.js +13 -0
- package/dist/node_modules/next/dist/server/app-render/action-handler.js +952 -0
- package/dist/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +14 -0
- package/dist/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +13 -0
- package/dist/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +249 -0
- package/dist/node_modules/next/dist/server/app-render/app-render-render-utils.js +112 -0
- package/dist/node_modules/next/dist/server/app-render/app-render-scheduling.js +188 -0
- package/dist/node_modules/next/dist/server/app-render/app-render.js +3526 -0
- package/dist/node_modules/next/dist/server/app-render/async-local-storage.js +76 -0
- package/dist/node_modules/next/dist/server/app-render/cache-signal.js +181 -0
- package/dist/node_modules/next/dist/server/app-render/collect-segment-data.js +276 -0
- package/dist/node_modules/next/dist/server/app-render/console-async-storage-instance.js +14 -0
- package/dist/node_modules/next/dist/server/app-render/console-async-storage.external.js +13 -0
- package/dist/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +33 -0
- package/dist/node_modules/next/dist/server/app-render/create-component-tree.js +754 -0
- package/dist/node_modules/next/dist/server/app-render/create-error-handler.js +187 -0
- package/dist/node_modules/next/dist/server/app-render/create-flight-router-state-from-loader-tree.js +76 -0
- package/dist/node_modules/next/dist/server/app-render/csrf-protection.js +75 -0
- package/dist/node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js +14 -0
- package/dist/node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js +13 -0
- package/dist/node_modules/next/dist/server/app-render/dynamic-rendering.js +828 -0
- package/dist/node_modules/next/dist/server/app-render/encryption-utils-server.js +114 -0
- package/dist/node_modules/next/dist/server/app-render/encryption-utils.js +93 -0
- package/dist/node_modules/next/dist/server/app-render/encryption.js +238 -0
- package/dist/node_modules/next/dist/server/app-render/entry-base.js +237 -0
- package/dist/node_modules/next/dist/server/app-render/flight-render-result.js +28 -0
- package/dist/node_modules/next/dist/server/app-render/get-asset-query-string.js +29 -0
- package/dist/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +49 -0
- package/dist/node_modules/next/dist/server/app-render/get-layer-assets.js +65 -0
- package/dist/node_modules/next/dist/server/app-render/get-preloadable-fonts.js +39 -0
- package/dist/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +44 -0
- package/dist/node_modules/next/dist/server/app-render/get-short-dynamic-param-type.js +25 -0
- package/dist/node_modules/next/dist/server/app-render/has-loading-component-in-tree.js +19 -0
- package/dist/node_modules/next/dist/server/app-render/interop-default.js +17 -0
- package/dist/node_modules/next/dist/server/app-render/make-get-server-inserted-html.js +92 -0
- package/dist/node_modules/next/dist/server/app-render/manifests-singleton.js +257 -0
- package/dist/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +28 -0
- package/dist/node_modules/next/dist/server/app-render/module-loading/track-dynamic-import.js +57 -0
- package/dist/node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js +32 -0
- package/dist/node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js +66 -0
- package/dist/node_modules/next/dist/server/app-render/parse-and-validate-flight-router-state.js +49 -0
- package/dist/node_modules/next/dist/server/app-render/postponed-state.js +156 -0
- package/dist/node_modules/next/dist/server/app-render/prospective-render-utils.js +73 -0
- package/dist/node_modules/next/dist/server/app-render/react-large-shell-error.js +17 -0
- package/dist/node_modules/next/dist/server/app-render/react-server.node.js +39 -0
- package/dist/node_modules/next/dist/server/app-render/render-css-resource.js +52 -0
- package/dist/node_modules/next/dist/server/app-render/required-scripts.js +76 -0
- package/dist/node_modules/next/dist/server/app-render/rsc/postpone.js +18 -0
- package/dist/node_modules/next/dist/server/app-render/rsc/preloads.js +74 -0
- package/dist/node_modules/next/dist/server/app-render/rsc/taint.js +79 -0
- package/dist/node_modules/next/dist/server/app-render/segment-explorer-path.js +103 -0
- package/dist/node_modules/next/dist/server/app-render/server-inserted-html.js +77 -0
- package/dist/node_modules/next/dist/server/app-render/staged-rendering.js +273 -0
- package/dist/node_modules/next/dist/server/app-render/staged-validation.js +32 -0
- package/dist/node_modules/next/dist/server/app-render/strip-flight-headers.js +18 -0
- package/dist/node_modules/next/dist/server/app-render/types.js +59 -0
- package/dist/node_modules/next/dist/server/app-render/use-flight-response.js +212 -0
- package/dist/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +185 -0
- package/dist/node_modules/next/dist/server/app-render/work-async-storage-instance.js +14 -0
- package/dist/node_modules/next/dist/server/app-render/work-async-storage.external.js +13 -0
- package/dist/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js +14 -0
- package/dist/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +252 -0
- package/dist/node_modules/next/dist/server/async-storage/draft-mode-provider.js +62 -0
- package/dist/node_modules/next/dist/server/async-storage/request-store.js +144 -0
- package/dist/node_modules/next/dist/server/async-storage/with-store.js +6 -0
- package/dist/node_modules/next/dist/server/async-storage/work-store.js +94 -0
- package/dist/node_modules/next/dist/server/base-http/helpers.js +36 -0
- package/dist/node_modules/next/dist/server/base-http/index.js +54 -0
- package/dist/node_modules/next/dist/server/base-http/node.js +147 -0
- package/dist/node_modules/next/dist/server/base-http/web.js +124 -0
- package/dist/node_modules/next/dist/server/base-server.js +1862 -0
- package/dist/node_modules/next/dist/server/body-streams.js +114 -0
- package/dist/node_modules/next/dist/server/cache-dir.js +26 -0
- package/dist/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
- package/dist/node_modules/next/dist/server/ci-info.js +41 -0
- package/dist/node_modules/next/dist/server/client-component-renderer-logger.js +70 -0
- package/dist/node_modules/next/dist/server/config-schema.js +632 -0
- package/dist/node_modules/next/dist/server/config-shared.js +319 -0
- package/dist/node_modules/next/dist/server/config-utils.js +185 -0
- package/dist/node_modules/next/dist/server/config.js +1474 -0
- package/dist/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +96 -0
- package/dist/node_modules/next/dist/server/crypto-utils.js +70 -0
- package/dist/node_modules/next/dist/server/dev/browser-logs/file-logger.js +183 -0
- package/dist/node_modules/next/dist/server/dev/browser-logs/receive-logs.js +512 -0
- package/dist/node_modules/next/dist/server/dev/browser-logs/source-map.js +225 -0
- package/dist/node_modules/next/dist/server/dev/debug-channel.js +87 -0
- package/dist/node_modules/next/dist/server/dev/dev-indicator-server-state.js +15 -0
- package/dist/node_modules/next/dist/server/dev/get-source-map-from-file.js +100 -0
- package/dist/node_modules/next/dist/server/dev/hot-middleware.js +274 -0
- package/dist/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
- package/dist/node_modules/next/dist/server/dev/hot-reloader-shared-utils.js +56 -0
- package/dist/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1247 -0
- package/dist/node_modules/next/dist/server/dev/hot-reloader-types.js +58 -0
- package/dist/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1382 -0
- package/dist/node_modules/next/dist/server/dev/log-requests.js +141 -0
- package/dist/node_modules/next/dist/server/dev/messages.js +74 -0
- package/dist/node_modules/next/dist/server/dev/middleware-turbopack.js +393 -0
- package/dist/node_modules/next/dist/server/dev/middleware-webpack.js +473 -0
- package/dist/node_modules/next/dist/server/dev/node-stack-frames.js +72 -0
- package/dist/node_modules/next/dist/server/dev/on-demand-entry-handler.js +704 -0
- package/dist/node_modules/next/dist/server/dev/parse-version-info.js +108 -0
- package/dist/node_modules/next/dist/server/dev/require-cache.js +49 -0
- package/dist/node_modules/next/dist/server/dev/serialized-errors.js +67 -0
- package/dist/node_modules/next/dist/server/dev/static-paths-worker.js +103 -0
- package/dist/node_modules/next/dist/server/dev/turbopack-utils.js +696 -0
- package/dist/node_modules/next/dist/server/dynamic-rendering-utils.js +86 -0
- package/dist/node_modules/next/dist/server/font-utils.js +43 -0
- package/dist/node_modules/next/dist/server/get-app-route-from-entrypoint.js +30 -0
- package/dist/node_modules/next/dist/server/get-page-files.js +23 -0
- package/dist/node_modules/next/dist/server/get-route-from-entrypoint.js +35 -0
- package/dist/node_modules/next/dist/server/htmlescape.js +37 -0
- package/dist/node_modules/next/dist/server/image-optimizer.js +1090 -0
- package/dist/node_modules/next/dist/server/instrumentation/types.js +6 -0
- package/dist/node_modules/next/dist/server/instrumentation/utils.js +21 -0
- package/dist/node_modules/next/dist/server/internal-utils.js +39 -0
- package/dist/node_modules/next/dist/server/is-private-ip.js +36 -0
- package/dist/node_modules/next/dist/server/lib/app-dir-module.js +59 -0
- package/dist/node_modules/next/dist/server/lib/app-info-log.js +154 -0
- package/dist/node_modules/next/dist/server/lib/async-callback-set.js +29 -0
- package/dist/node_modules/next/dist/server/lib/cache-control.js +22 -0
- package/dist/node_modules/next/dist/server/lib/cache-handlers/default.external.js +18 -0
- package/dist/node_modules/next/dist/server/lib/cache-handlers/default.js +160 -0
- package/dist/node_modules/next/dist/server/lib/cache-handlers/types.js +8 -0
- package/dist/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +116 -0
- package/dist/node_modules/next/dist/server/lib/clone-response.js +77 -0
- package/dist/node_modules/next/dist/server/lib/cpu-profile.js +28 -0
- package/dist/node_modules/next/dist/server/lib/decode-query-path-parameter.js +26 -0
- package/dist/node_modules/next/dist/server/lib/dedupe-fetch.js +163 -0
- package/dist/node_modules/next/dist/server/lib/dev-bundler-service.js +95 -0
- package/dist/node_modules/next/dist/server/lib/etag.js +56 -0
- package/dist/node_modules/next/dist/server/lib/experimental/create-env-definitions.js +48 -0
- package/dist/node_modules/next/dist/server/lib/experimental/ppr.js +47 -0
- package/dist/node_modules/next/dist/server/lib/find-page-file.js +127 -0
- package/dist/node_modules/next/dist/server/lib/fix-mojibake.js +25 -0
- package/dist/node_modules/next/dist/server/lib/format-hostname.js +16 -0
- package/dist/node_modules/next/dist/server/lib/i18n-provider.js +129 -0
- package/dist/node_modules/next/dist/server/lib/implicit-tags.js +77 -0
- package/dist/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +333 -0
- package/dist/node_modules/next/dist/server/lib/incremental-cache/index.js +479 -0
- package/dist/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +40 -0
- package/dist/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +73 -0
- package/dist/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js +55 -0
- package/dist/node_modules/next/dist/server/lib/is-ipv6.js +41 -0
- package/dist/node_modules/next/dist/server/lib/lazy-result.js +46 -0
- package/dist/node_modules/next/dist/server/lib/lru-cache.js +183 -0
- package/dist/node_modules/next/dist/server/lib/match-next-data-pathname.js +18 -0
- package/dist/node_modules/next/dist/server/lib/mock-request.js +416 -0
- package/dist/node_modules/next/dist/server/lib/module-loader/module-loader.js +8 -0
- package/dist/node_modules/next/dist/server/lib/module-loader/node-module-loader.js +25 -0
- package/dist/node_modules/next/dist/server/lib/module-loader/route-module-loader.js +26 -0
- package/dist/node_modules/next/dist/server/lib/node-fs-methods.js +28 -0
- package/dist/node_modules/next/dist/server/lib/parse-stack.js +46 -0
- package/dist/node_modules/next/dist/server/lib/patch-fetch.js +945 -0
- package/dist/node_modules/next/dist/server/lib/patch-set-header.js +38 -0
- package/dist/node_modules/next/dist/server/lib/render-server.js +152 -0
- package/dist/node_modules/next/dist/server/lib/router-server.js +672 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/block-cross-site.js +76 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/build-data-route.js +48 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +50 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/cache-life-type-utils.js +211 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/decode-path-params.js +42 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/filesystem.js +590 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js +89 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js +96 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/is-postpone.js +16 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/proxy-request.js +118 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +608 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/route-types-utils.js +286 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/router-server-context.js +26 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/typegen.js +613 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/types.js +6 -0
- package/dist/node_modules/next/dist/server/lib/server-action-request-meta.js +53 -0
- package/dist/node_modules/next/dist/server/lib/server-ipc/utils.js +80 -0
- package/dist/node_modules/next/dist/server/lib/source-maps.js +196 -0
- package/dist/node_modules/next/dist/server/lib/start-server.js +460 -0
- package/dist/node_modules/next/dist/server/lib/streaming-metadata.js +38 -0
- package/dist/node_modules/next/dist/server/lib/to-route.js +37 -0
- package/dist/node_modules/next/dist/server/lib/trace/constants.js +203 -0
- package/dist/node_modules/next/dist/server/lib/trace/tracer.js +270 -0
- package/dist/node_modules/next/dist/server/lib/trace/utils.js +16 -0
- package/dist/node_modules/next/dist/server/lib/types.js +6 -0
- package/dist/node_modules/next/dist/server/lib/utils.js +249 -0
- package/dist/node_modules/next/dist/server/lib/worker-utils.js +36 -0
- package/dist/node_modules/next/dist/server/load-components.js +177 -0
- package/dist/node_modules/next/dist/server/load-default-error-components.js +41 -0
- package/dist/node_modules/next/dist/server/load-manifest.external.js +97 -0
- package/dist/node_modules/next/dist/server/match-bundle.js +25 -0
- package/dist/node_modules/next/dist/server/mcp/get-mcp-middleware.js +49 -0
- package/dist/node_modules/next/dist/server/mcp/get-or-create-mcp-server.js +41 -0
- package/dist/node_modules/next/dist/server/mcp/mcp-telemetry-tracker.js +82 -0
- package/dist/node_modules/next/dist/server/mcp/tools/get-errors.js +107 -0
- package/dist/node_modules/next/dist/server/mcp/tools/get-logs.js +61 -0
- package/dist/node_modules/next/dist/server/mcp/tools/get-page-metadata.js +180 -0
- package/dist/node_modules/next/dist/server/mcp/tools/get-project-metadata.js +55 -0
- package/dist/node_modules/next/dist/server/mcp/tools/get-routes.js +171 -0
- package/dist/node_modules/next/dist/server/mcp/tools/get-server-action-by-id.js +113 -0
- package/dist/node_modules/next/dist/server/mcp/tools/next-instance-error-state.js +31 -0
- package/dist/node_modules/next/dist/server/mcp/tools/utils/browser-communication.js +90 -0
- package/dist/node_modules/next/dist/server/mcp/tools/utils/format-errors.js +147 -0
- package/dist/node_modules/next/dist/server/next-server.js +1459 -0
- package/dist/node_modules/next/dist/server/next-typescript.js +13 -0
- package/dist/node_modules/next/dist/server/next.js +452 -0
- package/dist/node_modules/next/dist/server/node-environment-baseline.js +25 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/console-dim.external.js +246 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/console-exit.js +49 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/console-file.js +56 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/date.js +52 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/error-inspect.js +8 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +570 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/global-behaviors.js +33 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/node-crypto.js +103 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/random.js +28 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.js +489 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/utils.js +186 -0
- package/dist/node_modules/next/dist/server/node-environment-extensions/web-crypto.js +45 -0
- package/dist/node_modules/next/dist/server/node-environment.js +19 -0
- package/dist/node_modules/next/dist/server/node-polyfill-crypto.js +21 -0
- package/dist/node_modules/next/dist/server/normalizers/absolute-filename-normalizer.js +33 -0
- package/dist/node_modules/next/dist/server/normalizers/built/app/app-bundle-path-normalizer.js +54 -0
- package/dist/node_modules/next/dist/server/normalizers/built/app/app-filename-normalizer.js +22 -0
- package/dist/node_modules/next/dist/server/normalizers/built/app/app-page-normalizer.js +40 -0
- package/dist/node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js +55 -0
- package/dist/node_modules/next/dist/server/normalizers/built/app/index.js +42 -0
- package/dist/node_modules/next/dist/server/normalizers/built/pages/index.js +44 -0
- package/dist/node_modules/next/dist/server/normalizers/built/pages/pages-bundle-path-normalizer.js +55 -0
- package/dist/node_modules/next/dist/server/normalizers/built/pages/pages-filename-normalizer.js +22 -0
- package/dist/node_modules/next/dist/server/normalizers/built/pages/pages-page-normalizer.js +19 -0
- package/dist/node_modules/next/dist/server/normalizers/built/pages/pages-pathname-normalizer.js +19 -0
- package/dist/node_modules/next/dist/server/normalizers/locale-route-normalizer.js +26 -0
- package/dist/node_modules/next/dist/server/normalizers/normalizer.js +6 -0
- package/dist/node_modules/next/dist/server/normalizers/normalizers.js +23 -0
- package/dist/node_modules/next/dist/server/normalizers/prefixing-normalizer.js +26 -0
- package/dist/node_modules/next/dist/server/normalizers/request/base-path.js +25 -0
- package/dist/node_modules/next/dist/server/normalizers/request/next-data.js +38 -0
- package/dist/node_modules/next/dist/server/normalizers/request/pathname-normalizer.js +6 -0
- package/dist/node_modules/next/dist/server/normalizers/request/prefix.js +39 -0
- package/dist/node_modules/next/dist/server/normalizers/request/rsc.js +19 -0
- package/dist/node_modules/next/dist/server/normalizers/request/segment-prefix-rsc.js +32 -0
- package/dist/node_modules/next/dist/server/normalizers/request/suffix.js +27 -0
- package/dist/node_modules/next/dist/server/normalizers/underscore-normalizer.js +17 -0
- package/dist/node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js +17 -0
- package/dist/node_modules/next/dist/server/og/image-response.js +53 -0
- package/dist/node_modules/next/dist/server/patch-error-inspect.js +436 -0
- package/dist/node_modules/next/dist/server/pipe-readable.js +140 -0
- package/dist/node_modules/next/dist/server/post-process.js +39 -0
- package/dist/node_modules/next/dist/server/render-result.js +195 -0
- package/dist/node_modules/next/dist/server/render.js +1138 -0
- package/dist/node_modules/next/dist/server/request/connection.js +111 -0
- package/dist/node_modules/next/dist/server/request/cookies.js +220 -0
- package/dist/node_modules/next/dist/server/request/draft-mode.js +207 -0
- package/dist/node_modules/next/dist/server/request/fallback-params.js +69 -0
- package/dist/node_modules/next/dist/server/request/headers.js +219 -0
- package/dist/node_modules/next/dist/server/request/params.js +415 -0
- package/dist/node_modules/next/dist/server/request/pathname.js +104 -0
- package/dist/node_modules/next/dist/server/request/root-params.js +157 -0
- package/dist/node_modules/next/dist/server/request/search-params.js +432 -0
- package/dist/node_modules/next/dist/server/request/utils.js +51 -0
- package/dist/node_modules/next/dist/server/request-meta.js +55 -0
- package/dist/node_modules/next/dist/server/require-hook.js +71 -0
- package/dist/node_modules/next/dist/server/require.js +109 -0
- package/dist/node_modules/next/dist/server/response-cache/index.js +311 -0
- package/dist/node_modules/next/dist/server/response-cache/types.js +41 -0
- package/dist/node_modules/next/dist/server/response-cache/utils.js +103 -0
- package/dist/node_modules/next/dist/server/response-cache/web.js +101 -0
- package/dist/node_modules/next/dist/server/resume-data-cache/cache-store.js +84 -0
- package/dist/node_modules/next/dist/server/resume-data-cache/resume-data-cache.js +115 -0
- package/dist/node_modules/next/dist/server/revalidation-utils.js +152 -0
- package/dist/node_modules/next/dist/server/route-definitions/app-page-route-definition.js +16 -0
- package/dist/node_modules/next/dist/server/route-definitions/app-route-route-definition.js +6 -0
- package/dist/node_modules/next/dist/server/route-definitions/locale-route-definition.js +6 -0
- package/dist/node_modules/next/dist/server/route-definitions/pages-api-route-definition.js +6 -0
- package/dist/node_modules/next/dist/server/route-definitions/pages-route-definition.js +6 -0
- package/dist/node_modules/next/dist/server/route-definitions/route-definition.js +6 -0
- package/dist/node_modules/next/dist/server/route-kind.js +32 -0
- package/dist/node_modules/next/dist/server/route-matcher-managers/default-route-matcher-manager.js +239 -0
- package/dist/node_modules/next/dist/server/route-matcher-managers/dev-route-matcher-manager.js +120 -0
- package/dist/node_modules/next/dist/server/route-matcher-managers/route-matcher-manager.js +6 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/app-page-route-matcher-provider.js +55 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/app-route-route-matcher-provider.js +43 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-page-route-matcher-provider.js +90 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.js +112 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-api-route-matcher-provider.js +77 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-route-matcher-provider.js +77 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/file-cache-route-matcher-provider.js +28 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/batched-file-reader.js +106 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/default-file-reader.js +42 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/file-reader.js +6 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/helpers/cached-route-matcher-provider.js +30 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/manifest-loader.js +6 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/node-manifest-loader.js +34 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.js +20 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/manifest-route-matcher-provider.js +21 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/pages-api-route-matcher-provider.js +55 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/pages-route-matcher-provider.js +64 -0
- package/dist/node_modules/next/dist/server/route-matcher-providers/route-matcher-provider.js +6 -0
- package/dist/node_modules/next/dist/server/route-matchers/app-page-route-matcher.js +18 -0
- package/dist/node_modules/next/dist/server/route-matchers/app-route-route-matcher.js +15 -0
- package/dist/node_modules/next/dist/server/route-matchers/locale-route-matcher.js +68 -0
- package/dist/node_modules/next/dist/server/route-matchers/pages-api-route-matcher.js +30 -0
- package/dist/node_modules/next/dist/server/route-matchers/pages-route-matcher.js +30 -0
- package/dist/node_modules/next/dist/server/route-matchers/route-matcher.js +54 -0
- package/dist/node_modules/next/dist/server/route-matches/app-page-route-match.js +6 -0
- package/dist/node_modules/next/dist/server/route-matches/app-route-route-match.js +6 -0
- package/dist/node_modules/next/dist/server/route-matches/locale-route-match.js +6 -0
- package/dist/node_modules/next/dist/server/route-matches/pages-api-route-match.js +16 -0
- package/dist/node_modules/next/dist/server/route-matches/pages-route-match.js +6 -0
- package/dist/node_modules/next/dist/server/route-matches/route-match.js +6 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/helpers/prerender-manifest-matcher.js +48 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/module.compiled.js +36 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/module.js +132 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/module.render.js +24 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/app-router-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/entrypoints.js +87 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/head-manager-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/hooks-client-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/image-config-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/router-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/server-inserted-html.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/entrypoints.js +140 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-dom.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-server.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-static.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/entrypoints.js +125 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom-server.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/helpers/auto-implement-methods.js +85 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/helpers/clean-url.js +24 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js +29 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/helpers/is-static-gen-enabled.js +15 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/helpers/parsed-url-query-to-params.js +20 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/module.compiled.js +36 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/module.js +889 -0
- package/dist/node_modules/next/dist/server/route-modules/app-route/shared-modules.js +56 -0
- package/dist/node_modules/next/dist/server/route-modules/checks.js +45 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/builtin/_error.js +100 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/module.compiled.js +20 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/module.js +92 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/module.render.js +24 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/pages-handler.js +522 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/app-router-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/entrypoints.js +102 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/head-manager-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/hooks-client-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/html-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/image-config-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/router-context.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages/vendored/contexts/server-inserted-html.js +4 -0
- package/dist/node_modules/next/dist/server/route-modules/pages-api/module.compiled.js +20 -0
- package/dist/node_modules/next/dist/server/route-modules/pages-api/module.js +58 -0
- package/dist/node_modules/next/dist/server/route-modules/route-module.js +597 -0
- package/dist/node_modules/next/dist/server/runtime-reacts.external.js +46 -0
- package/dist/node_modules/next/dist/server/send-payload.js +88 -0
- package/dist/node_modules/next/dist/server/send-response.js +70 -0
- package/dist/node_modules/next/dist/server/serve-static.js +66 -0
- package/dist/node_modules/next/dist/server/server-route-utils.js +30 -0
- package/dist/node_modules/next/dist/server/server-utils.js +323 -0
- package/dist/node_modules/next/dist/server/setup-http-agent-env.js +31 -0
- package/dist/node_modules/next/dist/server/stream-utils/encoded-tags.js +114 -0
- package/dist/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +737 -0
- package/dist/node_modules/next/dist/server/stream-utils/uint8array-helpers.js +69 -0
- package/dist/node_modules/next/dist/server/typescript/constant.js +97 -0
- package/dist/node_modules/next/dist/server/typescript/index.js +199 -0
- package/dist/node_modules/next/dist/server/typescript/rules/client-boundary.js +97 -0
- package/dist/node_modules/next/dist/server/typescript/rules/config.js +501 -0
- package/dist/node_modules/next/dist/server/typescript/rules/entry.js +149 -0
- package/dist/node_modules/next/dist/server/typescript/rules/error.js +38 -0
- package/dist/node_modules/next/dist/server/typescript/rules/metadata.js +234 -0
- package/dist/node_modules/next/dist/server/typescript/rules/server-boundary.js +115 -0
- package/dist/node_modules/next/dist/server/typescript/rules/server.js +79 -0
- package/dist/node_modules/next/dist/server/typescript/utils.js +212 -0
- package/dist/node_modules/next/dist/server/use-cache/cache-life.js +161 -0
- package/dist/node_modules/next/dist/server/use-cache/cache-tag.js +50 -0
- package/dist/node_modules/next/dist/server/use-cache/constants.js +28 -0
- package/dist/node_modules/next/dist/server/use-cache/handlers.js +121 -0
- package/dist/node_modules/next/dist/server/use-cache/use-cache-errors.js +36 -0
- package/dist/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1336 -0
- package/dist/node_modules/next/dist/server/utils.js +73 -0
- package/dist/node_modules/next/dist/server/web/adapter.js +388 -0
- package/dist/node_modules/next/dist/server/web/edge-route-module-wrapper.js +122 -0
- package/dist/node_modules/next/dist/server/web/error.js +54 -0
- package/dist/node_modules/next/dist/server/web/exports/index.js +56 -0
- package/dist/node_modules/next/dist/server/web/get-edge-preview-props.js +23 -0
- package/dist/node_modules/next/dist/server/web/globals.js +128 -0
- package/dist/node_modules/next/dist/server/web/http.js +39 -0
- package/dist/node_modules/next/dist/server/web/internal-edge-wait-until.js +64 -0
- package/dist/node_modules/next/dist/server/web/next-url.js +195 -0
- package/dist/node_modules/next/dist/server/web/sandbox/context.js +462 -0
- package/dist/node_modules/next/dist/server/web/sandbox/fetch-inline-assets.js +35 -0
- package/dist/node_modules/next/dist/server/web/sandbox/index.js +28 -0
- package/dist/node_modules/next/dist/server/web/sandbox/resource-managers.js +88 -0
- package/dist/node_modules/next/dist/server/web/sandbox/sandbox.js +134 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +192 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/adapters/next-request.js +142 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +30 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +211 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/cookies.js +29 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/fetch-event.js +98 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/image-response.js +22 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/request.js +99 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/response.js +136 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/revalidate.js +206 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +284 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/unstable-no-store.js +49 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/url-pattern.js +14 -0
- package/dist/node_modules/next/dist/server/web/spec-extension/user-agent.js +46 -0
- package/dist/node_modules/next/dist/server/web/types.js +6 -0
- package/dist/node_modules/next/dist/server/web/utils.js +151 -0
- package/dist/node_modules/next/dist/server/web/web-on-close.js +87 -0
- package/dist/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
- package/dist/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +50 -0
- package/dist/node_modules/next/dist/shared/lib/app-router-types.js +27 -0
- package/dist/node_modules/next/dist/shared/lib/constants.js +448 -0
- package/dist/node_modules/next/dist/shared/lib/deep-freeze.js +30 -0
- package/dist/node_modules/next/dist/shared/lib/deployment-id.js +36 -0
- package/dist/node_modules/next/dist/shared/lib/dset.js +34 -0
- package/dist/node_modules/next/dist/shared/lib/encode-uri-path.js +15 -0
- package/dist/node_modules/next/dist/shared/lib/entry-constants.js +36 -0
- package/dist/node_modules/next/dist/shared/lib/error-source.js +36 -0
- package/dist/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +39 -0
- package/dist/node_modules/next/dist/shared/lib/errors/constants.js +19 -0
- package/dist/node_modules/next/dist/shared/lib/errors/empty-generate-static-params-error.js +24 -0
- package/dist/node_modules/next/dist/shared/lib/errors/hard-deprecated-config-error.js +20 -0
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +22 -0
- package/dist/node_modules/next/dist/shared/lib/get-hostname.js +23 -0
- package/dist/node_modules/next/dist/shared/lib/hash.js +42 -0
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +18 -0
- package/dist/node_modules/next/dist/shared/lib/head.js +163 -0
- package/dist/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +60 -0
- package/dist/node_modules/next/dist/shared/lib/html-context.shared-runtime.js +40 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +25 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js +59 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +54 -0
- package/dist/node_modules/next/dist/shared/lib/image-blur-svg.js +22 -0
- package/dist/node_modules/next/dist/shared/lib/image-config-context.shared-runtime.js +19 -0
- package/dist/node_modules/next/dist/shared/lib/image-config.js +75 -0
- package/dist/node_modules/next/dist/shared/lib/invariant-error.js +18 -0
- package/dist/node_modules/next/dist/shared/lib/is-internal.js +39 -0
- package/dist/node_modules/next/dist/shared/lib/is-plain-object.js +42 -0
- package/dist/node_modules/next/dist/shared/lib/is-thenable.js +20 -0
- package/dist/node_modules/next/dist/shared/lib/isomorphic/path.js +14 -0
- package/dist/node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js +37 -0
- package/dist/node_modules/next/dist/shared/lib/loadable-context.shared-runtime.js +19 -0
- package/dist/node_modules/next/dist/shared/lib/loadable.shared-runtime.js +246 -0
- package/dist/node_modules/next/dist/shared/lib/magic-identifier.js +218 -0
- package/dist/node_modules/next/dist/shared/lib/match-local-pattern.js +46 -0
- package/dist/node_modules/next/dist/shared/lib/match-remote-pattern.js +63 -0
- package/dist/node_modules/next/dist/shared/lib/modern-browserslist-target.js +15 -0
- package/dist/node_modules/next/dist/shared/lib/no-fallback-error.external.js +18 -0
- package/dist/node_modules/next/dist/shared/lib/normalized-asset-prefix.js +28 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js +26 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +18 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +18 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/get-page-paths.js +40 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-data-path.js +23 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-page-path.js +26 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +19 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/remove-page-path-tail.js +20 -0
- package/dist/node_modules/next/dist/shared/lib/promise-with-resolvers.js +26 -0
- package/dist/node_modules/next/dist/shared/lib/router/adapters.js +136 -0
- package/dist/node_modules/next/dist/shared/lib/router/routes/app.js +122 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +28 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +20 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +20 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +51 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/as-path-to-search-params.js +17 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +24 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +16 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +27 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +111 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +167 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +52 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js +25 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.js +17 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +30 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +108 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.js +57 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +26 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js +31 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +29 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +36 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +20 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.js +49 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +292 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +79 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/relativize-url.js +40 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +39 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +21 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +116 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +113 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +45 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +256 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +244 -0
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +18 -0
- package/dist/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js +52 -0
- package/dist/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js +99 -0
- package/dist/node_modules/next/dist/shared/lib/segment.js +102 -0
- package/dist/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js +35 -0
- package/dist/node_modules/next/dist/shared/lib/server-reference-info.js +52 -0
- package/dist/node_modules/next/dist/shared/lib/side-effect.js +63 -0
- package/dist/node_modules/next/dist/shared/lib/size-limit.js +35 -0
- package/dist/node_modules/next/dist/shared/lib/turbopack/internal-error.js +53 -0
- package/dist/node_modules/next/dist/shared/lib/turbopack/utils.js +279 -0
- package/dist/node_modules/next/dist/shared/lib/utils/warn-once.js +22 -0
- package/dist/node_modules/next/dist/shared/lib/utils.js +207 -0
- package/dist/node_modules/next/dist/shared/lib/zod.js +101 -0
- package/dist/node_modules/next/dist/telemetry/anonymous-meta.js +89 -0
- package/dist/node_modules/next/dist/telemetry/detached-flush.js +56 -0
- package/dist/node_modules/next/dist/telemetry/events/build.js +174 -0
- package/dist/node_modules/next/dist/telemetry/events/index.js +41 -0
- package/dist/node_modules/next/dist/telemetry/events/plugins.js +51 -0
- package/dist/node_modules/next/dist/telemetry/events/swc-load-failure.js +55 -0
- package/dist/node_modules/next/dist/telemetry/events/version.js +66 -0
- package/dist/node_modules/next/dist/telemetry/flush-telemetry.js +19 -0
- package/dist/node_modules/next/dist/telemetry/post-telemetry-payload.js +48 -0
- package/dist/node_modules/next/dist/telemetry/project-id.js +48 -0
- package/dist/node_modules/next/dist/telemetry/storage.js +301 -0
- package/dist/node_modules/next/dist/trace/index.js +54 -0
- package/dist/node_modules/next/dist/trace/report/index.js +37 -0
- package/dist/node_modules/next/dist/trace/report/to-json-build.js +137 -0
- package/dist/node_modules/next/dist/trace/report/to-json.js +151 -0
- package/dist/node_modules/next/dist/trace/report/to-telemetry.js +36 -0
- package/dist/node_modules/next/dist/trace/shared.js +39 -0
- package/dist/node_modules/next/dist/trace/trace.js +197 -0
- package/dist/node_modules/next/package.json +380 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +16 -0
- package/dist/node_modules/react/cjs/react-jsx-dev-runtime.production.js +14 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +34 -0
- package/dist/node_modules/react/cjs/react.production.js +542 -0
- package/dist/node_modules/react/compiler-runtime.js +14 -0
- package/dist/node_modules/react/index.js +7 -0
- package/dist/node_modules/react/jsx-dev-runtime.js +7 -0
- package/dist/node_modules/react/jsx-runtime.js +7 -0
- package/dist/node_modules/react/package.json +51 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +6603 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +6692 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +7410 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.edge.production.js +7512 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.node.production.js +7707 -0
- package/dist/node_modules/react-dom/cjs/react-dom.production.js +210 -0
- package/dist/node_modules/react-dom/index.js +38 -0
- package/dist/node_modules/react-dom/package.json +117 -0
- package/dist/node_modules/react-dom/server.browser.js +16 -0
- package/dist/node_modules/react-dom/server.edge.js +17 -0
- package/dist/node_modules/react-dom/server.node.js +18 -0
- package/dist/node_modules/react-dom/static.node.js +14 -0
- package/dist/node_modules/sharp/lib/channel.js +177 -0
- package/dist/node_modules/sharp/lib/colour.js +195 -0
- package/dist/node_modules/sharp/lib/composite.js +212 -0
- package/dist/node_modules/sharp/lib/constructor.js +499 -0
- package/dist/node_modules/sharp/lib/index.js +16 -0
- package/dist/node_modules/sharp/lib/input.js +809 -0
- package/dist/node_modules/sharp/lib/is.js +143 -0
- package/dist/node_modules/sharp/lib/libvips.js +207 -0
- package/dist/node_modules/sharp/lib/operation.js +1016 -0
- package/dist/node_modules/sharp/lib/output.js +1666 -0
- package/dist/node_modules/sharp/lib/resize.js +595 -0
- package/dist/node_modules/sharp/lib/sharp.js +121 -0
- package/dist/node_modules/sharp/lib/utility.js +291 -0
- package/dist/node_modules/sharp/node_modules/semver/classes/comparator.js +143 -0
- package/dist/node_modules/sharp/node_modules/semver/classes/range.js +557 -0
- package/dist/node_modules/sharp/node_modules/semver/classes/semver.js +333 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/cmp.js +54 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/coerce.js +62 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/compare.js +7 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/eq.js +5 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/gt.js +5 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/gte.js +5 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/lt.js +5 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/lte.js +5 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/neq.js +5 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/parse.js +18 -0
- package/dist/node_modules/sharp/node_modules/semver/functions/satisfies.js +12 -0
- package/dist/node_modules/sharp/node_modules/semver/internal/constants.js +37 -0
- package/dist/node_modules/sharp/node_modules/semver/internal/debug.js +11 -0
- package/dist/node_modules/sharp/node_modules/semver/internal/identifiers.js +29 -0
- package/dist/node_modules/sharp/node_modules/semver/internal/lrucache.js +42 -0
- package/dist/node_modules/sharp/node_modules/semver/internal/parse-options.js +17 -0
- package/dist/node_modules/sharp/node_modules/semver/internal/re.js +223 -0
- package/dist/node_modules/sharp/node_modules/semver/package.json +78 -0
- package/dist/node_modules/sharp/package.json +202 -0
- package/dist/node_modules/styled-jsx/dist/index/index.js +499 -0
- package/dist/node_modules/styled-jsx/index.js +1 -0
- package/dist/node_modules/styled-jsx/package.json +132 -0
- package/dist/node_modules/styled-jsx/style.js +1 -0
- package/dist/package.json +50 -0
- package/dist/public/brand-v2-preview.html +778 -0
- package/dist/public/clawcrib_logo.png +0 -0
- package/dist/public/colors.css +134 -0
- package/dist/public/demo-icons.html +351 -0
- package/dist/public/favicon.svg +69 -0
- package/dist/public/file.svg +1 -0
- package/dist/public/globe.svg +1 -0
- package/dist/public/landing-blueprint.jpg +0 -0
- package/dist/public/landing-crib-3d.jpg +0 -0
- package/dist/public/logo-bracket-claw.svg +69 -0
- package/dist/public/logo-icon.svg +31 -0
- package/dist/public/logo-minimal.svg +24 -0
- package/dist/public/logo-monogram.svg +41 -0
- package/dist/public/logo-primary.svg +34 -0
- package/dist/public/next.svg +1 -0
- package/dist/public/openclaw_logo.jpeg +0 -0
- package/dist/public/robots.txt +7 -0
- package/dist/public/sitemap.xml +63 -0
- package/dist/public/textures/Carpet004/Carpet004_1K-JPG_Color.jpg +0 -0
- package/dist/public/textures/Carpet004/Carpet004_1K-JPG_NormalGL.jpg +0 -0
- package/dist/public/textures/Carpet004/Carpet004_1K-JPG_Roughness.jpg +0 -0
- package/dist/public/textures/Fabric030/Fabric030_1K-JPG_Color.jpg +0 -0
- package/dist/public/textures/Fabric030/Fabric030_1K-JPG_NormalGL.jpg +0 -0
- package/dist/public/textures/Fabric030/Fabric030_1K-JPG_Roughness.jpg +0 -0
- package/dist/public/textures/Plaster001/Plaster001_1K-JPG_Color.jpg +0 -0
- package/dist/public/textures/Plaster001/Plaster001_1K-JPG_NormalGL.jpg +0 -0
- package/dist/public/textures/Plaster001/Plaster001_1K-JPG_Roughness.jpg +0 -0
- package/dist/public/textures/WoodFloor051/WoodFloor051_1K-JPG_Color.jpg +0 -0
- package/dist/public/textures/WoodFloor051/WoodFloor051_1K-JPG_NormalGL.jpg +0 -0
- package/dist/public/textures/WoodFloor051/WoodFloor051_1K-JPG_Roughness.jpg +0 -0
- package/dist/public/vercel.svg +1 -0
- package/dist/public/window.svg +1 -0
- package/dist/server.js +38 -0
- package/package.json +29 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
module.exports=[61917,(a,b,c)=>{"use strict";function d(a,b){var c=a.length;for(a.push(b);0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break}}function e(a){return 0===a.length?null:a[0]}function f(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;for(var d=0,e=a.length,f=e>>>1;d<f;){var h=2*(d+1)-1,i=a[h],j=h+1,k=a[j];if(0>g(i,c))j<e&&0>g(k,i)?(a[d]=k,a[j]=c,d=j):(a[d]=i,a[h]=c,d=h);else if(j<e&&0>g(k,c))a[d]=k,a[j]=c,d=j;else break}}return b}function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(c.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var h,i=performance;c.unstable_now=function(){return i.now()}}else{var j=Date,k=j.now();c.unstable_now=function(){return j.now()-k}}var l=[],m=[],n=1,o=null,p=3,q=!1,r=!1,s=!1,t=!1,u="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,w="u">typeof setImmediate?setImmediate:null;function x(a){for(var b=e(m);null!==b;){if(null===b.callback)f(m);else if(b.startTime<=a)f(m),b.sortIndex=b.expirationTime,d(l,b);else break;b=e(m)}}function y(a){if(s=!1,x(a),!r)if(null!==e(l))r=!0,z||(z=!0,h());else{var b=e(m);null!==b&&H(y,b.startTime-a)}}var z=!1,A=-1,B=5,C=-1;function D(){return!!t||!(c.unstable_now()-C<B)}function E(){if(t=!1,z){var a=c.unstable_now();C=a;var b=!0;try{a:{r=!1,s&&(s=!1,v(A),A=-1),q=!0;var d=p;try{b:{for(x(a),o=e(l);null!==o&&!(o.expirationTime>a&&D());){var g=o.callback;if("function"==typeof g){o.callback=null,p=o.priorityLevel;var i=g(o.expirationTime<=a);if(a=c.unstable_now(),"function"==typeof i){o.callback=i,x(a),b=!0;break b}o===e(l)&&f(l),x(a)}else f(l);o=e(l)}if(null!==o)b=!0;else{var j=e(m);null!==j&&H(y,j.startTime-a),b=!1}}break a}finally{o=null,p=d,q=!1}}}finally{b?h():z=!1}}}if("function"==typeof w)h=function(){w(E)};else if("u">typeof MessageChannel){var F=new MessageChannel,G=F.port2;F.port1.onmessage=E,h=function(){G.postMessage(null)}}else h=function(){u(E,0)};function H(a,b){A=u(function(){a(c.unstable_now())},b)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(a){a.callback=null},c.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<a?Math.floor(1e3/a):5},c.unstable_getCurrentPriorityLevel=function(){return p},c.unstable_next=function(a){switch(p){case 1:case 2:case 3:var b=3;break;default:b=p}var c=p;p=b;try{return a()}finally{p=c}},c.unstable_requestPaint=function(){t=!0},c.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=p;p=a;try{return b()}finally{p=c}},c.unstable_scheduleCallback=function(a,b,f){var g=c.unstable_now();switch(f="object"==typeof f&&null!==f&&"number"==typeof(f=f.delay)&&0<f?g+f:g,a){case 1:var i=-1;break;case 2:i=250;break;case 5:i=0x3fffffff;break;case 4:i=1e4;break;default:i=5e3}return i=f+i,a={id:n++,callback:b,priorityLevel:a,startTime:f,expirationTime:i,sortIndex:-1},f>g?(a.sortIndex=f,d(m,a),null===e(l)&&a===e(m)&&(s?(v(A),A=-1):s=!0,H(y,f-g))):(a.sortIndex=i,d(l,a),r||q||(r=!0,z||(z=!0,h()))),a},c.unstable_shouldYield=D,c.unstable_wrapCallback=function(a){var b=p;return function(){var c=p;p=b;try{return a.apply(this,arguments)}finally{p=c}}}},90693,(a,b,c)=>{"use strict";b.exports=a.r(61917)},10129,35258,66110,48604,a=>{"use strict";let b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;var r,s,t,u,v=a.i(72131);let w={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},x={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},y="attached",z="detached",A="srgb",B="srgb-linear",C="linear",D="srgb",E="300 es",F={COMPUTE:"compute",RENDER:"render"},G={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},H={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},I={TEXTURE_COMPARE:"depthTextureCompare"},J={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function K(a,b){return new J[a](b)}function L(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)}function M(a){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}function N(){let a=M("canvas");return a.style.display="block",a}let O={},P=null;function Q(a){P=a}function R(){return P}function S(...a){let b="THREE."+a.shift();P?P("log",b,...a):console.log(b,...a)}function T(a){let b=a[0];if("string"==typeof b&&b.startsWith("TSL:")){let b=a[1];b&&b.isStackTrace?a[0]+=" "+b.getLocation():a[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return a}function U(...a){let b="THREE."+(a=T(a)).shift();if(P)P("warn",b,...a);else{let c=a[0];c&&c.isStackTrace?console.warn(c.getError(b)):console.warn(b,...a)}}function V(...a){let b="THREE."+(a=T(a)).shift();if(P)P("error",b,...a);else{let c=a[0];c&&c.isStackTrace?console.error(c.getError(b)):console.error(b,...a)}}function W(...a){let b=a.join(" ");b in O||(O[b]=!0,U(...a))}function X(a,b,c){return new Promise(function(d,e){setTimeout(function f(){switch(a.clientWaitSync(b,a.SYNC_FLUSH_COMMANDS_BIT,0)){case a.WAIT_FAILED:e();break;case a.TIMEOUT_EXPIRED:setTimeout(f,c);break;default:d()}},c)})}let Y={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};class Z{addEventListener(a,b){void 0===this._listeners&&(this._listeners={});let c=this._listeners;void 0===c[a]&&(c[a]=[]),-1===c[a].indexOf(b)&&c[a].push(b)}hasEventListener(a,b){let c=this._listeners;return void 0!==c&&void 0!==c[a]&&-1!==c[a].indexOf(b)}removeEventListener(a,b){let c=this._listeners;if(void 0===c)return;let d=c[a];if(void 0!==d){let a=d.indexOf(b);-1!==a&&d.splice(a,1)}}dispatchEvent(a){let b=this._listeners;if(void 0===b)return;let c=b[a.type];if(void 0!==c){a.target=this;let b=c.slice(0);for(let c=0,d=b.length;c<d;c++)b[c].call(this,a);a.target=null}}}let $=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],_=1234567,aa=Math.PI/180,ab=180/Math.PI;function ac(){let a=0xffffffff*Math.random()|0,b=0xffffffff*Math.random()|0,c=0xffffffff*Math.random()|0,d=0xffffffff*Math.random()|0;return($[255&a]+$[a>>8&255]+$[a>>16&255]+$[a>>24&255]+"-"+$[255&b]+$[b>>8&255]+"-"+$[b>>16&15|64]+$[b>>24&255]+"-"+$[63&c|128]+$[c>>8&255]+"-"+$[c>>16&255]+$[c>>24&255]+$[255&d]+$[d>>8&255]+$[d>>16&255]+$[d>>24&255]).toLowerCase()}function ad(a,b,c){return Math.max(b,Math.min(c,a))}function ae(a,b){return(a%b+b)%b}function af(a,b,c){return(1-c)*a+c*b}function ag(a,b){switch(b.constructor){case Float32Array:return a;case Uint32Array:return a/0xffffffff;case Uint16Array:return a/65535;case Uint8Array:return a/255;case Int32Array:return Math.max(a/0x7fffffff,-1);case Int16Array:return Math.max(a/32767,-1);case Int8Array:return Math.max(a/127,-1);default:throw Error("Invalid component type.")}}function ah(a,b){switch(b.constructor){case Float32Array:return a;case Uint32Array:return Math.round(0xffffffff*a);case Uint16Array:return Math.round(65535*a);case Uint8Array:return Math.round(255*a);case Int32Array:return Math.round(0x7fffffff*a);case Int16Array:return Math.round(32767*a);case Int8Array:return Math.round(127*a);default:throw Error("Invalid component type.")}}let ai={DEG2RAD:aa,RAD2DEG:ab,generateUUID:ac,clamp:ad,euclideanModulo:ae,mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},inverseLerp:function(a,b,c){return a!==b?(c-a)/(b-a):0},lerp:af,damp:function(a,b,c,d){return af(a,b,1-Math.exp(-c*d))},pingpong:function(a,b=1){return b-Math.abs(ae(a,2*b)-b)},smoothstep:function(a,b,c){return a<=b?0:a>=c?1:(a=(a-b)/(c-b))*a*(3-2*a)},smootherstep:function(a,b,c){return a<=b?0:a>=c?1:(a=(a-b)/(c-b))*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},seededRandom:function(a){void 0!==a&&(_=a);let b=_+=0x6d2b79f5;return b=Math.imul(b^b>>>15,1|b),(((b^=b+Math.imul(b^b>>>7,61|b))^b>>>14)>>>0)/0x100000000},degToRad:function(a){return a*aa},radToDeg:function(a){return a*ab},isPowerOfTwo:function(a){return(a&a-1)==0&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))},setQuaternionFromProperEuler:function(a,b,c,d,e){let f=Math.cos,g=Math.sin,h=f(c/2),i=g(c/2),j=f((b+d)/2),k=g((b+d)/2),l=f((b-d)/2),m=g((b-d)/2),n=f((d-b)/2),o=g((d-b)/2);switch(e){case"XYX":a.set(h*k,i*l,i*m,h*j);break;case"YZY":a.set(i*m,h*k,i*l,h*j);break;case"ZXZ":a.set(i*l,i*m,h*k,h*j);break;case"XZX":a.set(h*k,i*o,i*n,h*j);break;case"YXY":a.set(i*n,h*k,i*o,h*j);break;case"ZYZ":a.set(i*o,i*n,h*k,h*j);break;default:U("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+e)}},normalize:ah,denormalize:ag};class aj{constructor(a=0,b=0){aj.prototype.isVector2=!0,this.x=a,this.y=b}get width(){return this.x}set width(a){this.x=a}get height(){return this.y}set height(a){this.y=a}set(a,b){return this.x=a,this.y=b,this}setScalar(a){return this.x=a,this.y=a,this}setX(a){return this.x=a,this}setY(a){return this.y=a,this}setComponent(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a)}return this}getComponent(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a)}}clone(){return new this.constructor(this.x,this.y)}copy(a){return this.x=a.x,this.y=a.y,this}add(a){return this.x+=a.x,this.y+=a.y,this}addScalar(a){return this.x+=a,this.y+=a,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this}addScaledVector(a,b){return this.x+=a.x*b,this.y+=a.y*b,this}sub(a){return this.x-=a.x,this.y-=a.y,this}subScalar(a){return this.x-=a,this.y-=a,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this}multiply(a){return this.x*=a.x,this.y*=a.y,this}multiplyScalar(a){return this.x*=a,this.y*=a,this}divide(a){return this.x/=a.x,this.y/=a.y,this}divideScalar(a){return this.multiplyScalar(1/a)}applyMatrix3(a){let b=this.x,c=this.y,d=a.elements;return this.x=d[0]*b+d[3]*c+d[6],this.y=d[1]*b+d[4]*c+d[7],this}min(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this}max(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this}clamp(a,b){return this.x=ad(this.x,a.x,b.x),this.y=ad(this.y,a.y,b.y),this}clampScalar(a,b){return this.x=ad(this.x,a,b),this.y=ad(this.y,a,b),this}clampLength(a,b){let c=this.length();return this.divideScalar(c||1).multiplyScalar(ad(c,a,b))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(a){return this.x*a.x+this.y*a.y}cross(a){return this.x*a.y-this.y*a.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(a){let b=Math.sqrt(this.lengthSq()*a.lengthSq());return 0===b?Math.PI/2:Math.acos(ad(this.dot(a)/b,-1,1))}distanceTo(a){return Math.sqrt(this.distanceToSquared(a))}distanceToSquared(a){let b=this.x-a.x,c=this.y-a.y;return b*b+c*c}manhattanDistanceTo(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)}setLength(a){return this.normalize().multiplyScalar(a)}lerp(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this}lerpVectors(a,b,c){return this.x=a.x+(b.x-a.x)*c,this.y=a.y+(b.y-a.y)*c,this}equals(a){return a.x===this.x&&a.y===this.y}fromArray(a,b=0){return this.x=a[b],this.y=a[b+1],this}toArray(a=[],b=0){return a[b]=this.x,a[b+1]=this.y,a}fromBufferAttribute(a,b){return this.x=a.getX(b),this.y=a.getY(b),this}rotateAround(a,b){let c=Math.cos(b),d=Math.sin(b),e=this.x-a.x,f=this.y-a.y;return this.x=e*c-f*d+a.x,this.y=e*d+f*c+a.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ak{constructor(a=0,b=0,c=0,d=1){this.isQuaternion=!0,this._x=a,this._y=b,this._z=c,this._w=d}static slerpFlat(a,b,c,d,e,f,g){let h=c[d+0],i=c[d+1],j=c[d+2],k=c[d+3],l=e[f+0],m=e[f+1],n=e[f+2],o=e[f+3];if(k!==o||h!==l||i!==m||j!==n){let a=h*l+i*m+j*n+k*o;a<0&&(l=-l,m=-m,n=-n,o=-o,a=-a);let b=1-g;if(a<.9995){let c=Math.acos(a),d=Math.sin(c);h=h*(b=Math.sin(b*c)/d)+l*(g=Math.sin(g*c)/d),i=i*b+m*g,j=j*b+n*g,k=k*b+o*g}else{let a=1/Math.sqrt((h=h*b+l*g)*h+(i=i*b+m*g)*i+(j=j*b+n*g)*j+(k=k*b+o*g)*k);h*=a,i*=a,j*=a,k*=a}}a[b]=h,a[b+1]=i,a[b+2]=j,a[b+3]=k}static multiplyQuaternionsFlat(a,b,c,d,e,f){let g=c[d],h=c[d+1],i=c[d+2],j=c[d+3],k=e[f],l=e[f+1],m=e[f+2],n=e[f+3];return a[b]=g*n+j*k+h*m-i*l,a[b+1]=h*n+j*l+i*k-g*m,a[b+2]=i*n+j*m+g*l-h*k,a[b+3]=j*n-g*k-h*l-i*m,a}get x(){return this._x}set x(a){this._x=a,this._onChangeCallback()}get y(){return this._y}set y(a){this._y=a,this._onChangeCallback()}get z(){return this._z}set z(a){this._z=a,this._onChangeCallback()}get w(){return this._w}set w(a){this._w=a,this._onChangeCallback()}set(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._w=d,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(a){return this._x=a.x,this._y=a.y,this._z=a.z,this._w=a.w,this._onChangeCallback(),this}setFromEuler(a,b=!0){let c=a._x,d=a._y,e=a._z,f=a._order,g=Math.cos,h=Math.sin,i=g(c/2),j=g(d/2),k=g(e/2),l=h(c/2),m=h(d/2),n=h(e/2);switch(f){case"XYZ":this._x=l*j*k+i*m*n,this._y=i*m*k-l*j*n,this._z=i*j*n+l*m*k,this._w=i*j*k-l*m*n;break;case"YXZ":this._x=l*j*k+i*m*n,this._y=i*m*k-l*j*n,this._z=i*j*n-l*m*k,this._w=i*j*k+l*m*n;break;case"ZXY":this._x=l*j*k-i*m*n,this._y=i*m*k+l*j*n,this._z=i*j*n+l*m*k,this._w=i*j*k-l*m*n;break;case"ZYX":this._x=l*j*k-i*m*n,this._y=i*m*k+l*j*n,this._z=i*j*n-l*m*k,this._w=i*j*k+l*m*n;break;case"YZX":this._x=l*j*k+i*m*n,this._y=i*m*k+l*j*n,this._z=i*j*n-l*m*k,this._w=i*j*k-l*m*n;break;case"XZY":this._x=l*j*k-i*m*n,this._y=i*m*k-l*j*n,this._z=i*j*n+l*m*k,this._w=i*j*k+l*m*n;break;default:U("Quaternion: .setFromEuler() encountered an unknown order: "+f)}return!0===b&&this._onChangeCallback(),this}setFromAxisAngle(a,b){let c=b/2,d=Math.sin(c);return this._x=a.x*d,this._y=a.y*d,this._z=a.z*d,this._w=Math.cos(c),this._onChangeCallback(),this}setFromRotationMatrix(a){let b=a.elements,c=b[0],d=b[4],e=b[8],f=b[1],g=b[5],h=b[9],i=b[2],j=b[6],k=b[10],l=c+g+k;if(l>0){let a=.5/Math.sqrt(l+1);this._w=.25/a,this._x=(j-h)*a,this._y=(e-i)*a,this._z=(f-d)*a}else if(c>g&&c>k){let a=2*Math.sqrt(1+c-g-k);this._w=(j-h)/a,this._x=.25*a,this._y=(d+f)/a,this._z=(e+i)/a}else if(g>k){let a=2*Math.sqrt(1+g-c-k);this._w=(e-i)/a,this._x=(d+f)/a,this._y=.25*a,this._z=(h+j)/a}else{let a=2*Math.sqrt(1+k-c-g);this._w=(f-d)/a,this._x=(e+i)/a,this._y=(h+j)/a,this._z=.25*a}return this._onChangeCallback(),this}setFromUnitVectors(a,b){let c=a.dot(b)+1;return c<1e-8?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x),this._w=c,this.normalize()}angleTo(a){return 2*Math.acos(Math.abs(ad(this.dot(a),-1,1)))}rotateTowards(a,b){let c=this.angleTo(a);if(0===c)return this;let d=Math.min(1,b/c);return this.slerp(a,d),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let a=this.length();return 0===a?(this._x=0,this._y=0,this._z=0,this._w=1):(a=1/a,this._x=this._x*a,this._y=this._y*a,this._z=this._z*a,this._w=this._w*a),this._onChangeCallback(),this}multiply(a){return this.multiplyQuaternions(this,a)}premultiply(a){return this.multiplyQuaternions(a,this)}multiplyQuaternions(a,b){let c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,i=b._z,j=b._w;return this._x=c*j+f*g+d*i-e*h,this._y=d*j+f*h+e*g-c*i,this._z=e*j+f*i+c*h-d*g,this._w=f*j-c*g-d*h-e*i,this._onChangeCallback(),this}slerp(a,b){let c=a._x,d=a._y,e=a._z,f=a._w,g=this.dot(a);g<0&&(c=-c,d=-d,e=-e,f=-f,g=-g);let h=1-b;if(g<.9995){let a=Math.acos(g),i=Math.sin(a);h=Math.sin(h*a)/i,b=Math.sin(b*a)/i,this._x=this._x*h+c*b,this._y=this._y*h+d*b,this._z=this._z*h+e*b,this._w=this._w*h+f*b,this._onChangeCallback()}else this._x=this._x*h+c*b,this._y=this._y*h+d*b,this._z=this._z*h+e*b,this._w=this._w*h+f*b,this.normalize();return this}slerpQuaternions(a,b,c){return this.copy(a).slerp(b,c)}random(){let a=2*Math.PI*Math.random(),b=2*Math.PI*Math.random(),c=Math.random(),d=Math.sqrt(1-c),e=Math.sqrt(c);return this.set(d*Math.sin(a),d*Math.cos(a),e*Math.sin(b),e*Math.cos(b))}equals(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w}fromArray(a,b=0){return this._x=a[b],this._y=a[b+1],this._z=a[b+2],this._w=a[b+3],this._onChangeCallback(),this}toArray(a=[],b=0){return a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._w,a}fromBufferAttribute(a,b){return this._x=a.getX(b),this._y=a.getY(b),this._z=a.getZ(b),this._w=a.getW(b),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(a){return this._onChangeCallback=a,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class al{constructor(a=0,b=0,c=0){al.prototype.isVector3=!0,this.x=a,this.y=b,this.z=c}set(a,b,c){return void 0===c&&(c=this.z),this.x=a,this.y=b,this.z=c,this}setScalar(a){return this.x=a,this.y=a,this.z=a,this}setX(a){return this.x=a,this}setY(a){return this.y=a,this}setZ(a){return this.z=a,this}setComponent(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a)}return this}getComponent(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(a){return this.x=a.x,this.y=a.y,this.z=a.z,this}add(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z,this}addScalar(a){return this.x+=a,this.y+=a,this.z+=a,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this}addScaledVector(a,b){return this.x+=a.x*b,this.y+=a.y*b,this.z+=a.z*b,this}sub(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z,this}subScalar(a){return this.x-=a,this.y-=a,this.z-=a,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this}multiply(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z,this}multiplyScalar(a){return this.x*=a,this.y*=a,this.z*=a,this}multiplyVectors(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this}applyEuler(a){return this.applyQuaternion(an.setFromEuler(a))}applyAxisAngle(a,b){return this.applyQuaternion(an.setFromAxisAngle(a,b))}applyMatrix3(a){let b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[3]*c+e[6]*d,this.y=e[1]*b+e[4]*c+e[7]*d,this.z=e[2]*b+e[5]*c+e[8]*d,this}applyNormalMatrix(a){return this.applyMatrix3(a).normalize()}applyMatrix4(a){let b=this.x,c=this.y,d=this.z,e=a.elements,f=1/(e[3]*b+e[7]*c+e[11]*d+e[15]);return this.x=(e[0]*b+e[4]*c+e[8]*d+e[12])*f,this.y=(e[1]*b+e[5]*c+e[9]*d+e[13])*f,this.z=(e[2]*b+e[6]*c+e[10]*d+e[14])*f,this}applyQuaternion(a){let b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z,h=a.w,i=2*(f*d-g*c),j=2*(g*b-e*d),k=2*(e*c-f*b);return this.x=b+h*i+f*k-g*j,this.y=c+h*j+g*i-e*k,this.z=d+h*k+e*j-f*i,this}project(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)}unproject(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)}transformDirection(a){let b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[4]*c+e[8]*d,this.y=e[1]*b+e[5]*c+e[9]*d,this.z=e[2]*b+e[6]*c+e[10]*d,this.normalize()}divide(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this}divideScalar(a){return this.multiplyScalar(1/a)}min(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this.z=Math.min(this.z,a.z),this}max(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this.z=Math.max(this.z,a.z),this}clamp(a,b){return this.x=ad(this.x,a.x,b.x),this.y=ad(this.y,a.y,b.y),this.z=ad(this.z,a.z,b.z),this}clampScalar(a,b){return this.x=ad(this.x,a,b),this.y=ad(this.y,a,b),this.z=ad(this.z,a,b),this}clampLength(a,b){let c=this.length();return this.divideScalar(c||1).multiplyScalar(ad(c,a,b))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(a){return this.x*a.x+this.y*a.y+this.z*a.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(a){return this.normalize().multiplyScalar(a)}lerp(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this}lerpVectors(a,b,c){return this.x=a.x+(b.x-a.x)*c,this.y=a.y+(b.y-a.y)*c,this.z=a.z+(b.z-a.z)*c,this}cross(a){return this.crossVectors(this,a)}crossVectors(a,b){let c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;return this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f,this}projectOnVector(a){let b=a.lengthSq();if(0===b)return this.set(0,0,0);let c=a.dot(this)/b;return this.copy(a).multiplyScalar(c)}projectOnPlane(a){return am.copy(this).projectOnVector(a),this.sub(am)}reflect(a){return this.sub(am.copy(a).multiplyScalar(2*this.dot(a)))}angleTo(a){let b=Math.sqrt(this.lengthSq()*a.lengthSq());return 0===b?Math.PI/2:Math.acos(ad(this.dot(a)/b,-1,1))}distanceTo(a){return Math.sqrt(this.distanceToSquared(a))}distanceToSquared(a){let b=this.x-a.x,c=this.y-a.y,d=this.z-a.z;return b*b+c*c+d*d}manhattanDistanceTo(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)}setFromSpherical(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)}setFromSphericalCoords(a,b,c){let d=Math.sin(b)*a;return this.x=d*Math.sin(c),this.y=Math.cos(b)*a,this.z=d*Math.cos(c),this}setFromCylindrical(a){return this.setFromCylindricalCoords(a.radius,a.theta,a.y)}setFromCylindricalCoords(a,b,c){return this.x=a*Math.sin(b),this.y=c,this.z=a*Math.cos(b),this}setFromMatrixPosition(a){let b=a.elements;return this.x=b[12],this.y=b[13],this.z=b[14],this}setFromMatrixScale(a){let b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length(),d=this.setFromMatrixColumn(a,2).length();return this.x=b,this.y=c,this.z=d,this}setFromMatrixColumn(a,b){return this.fromArray(a.elements,4*b)}setFromMatrix3Column(a,b){return this.fromArray(a.elements,3*b)}setFromEuler(a){return this.x=a._x,this.y=a._y,this.z=a._z,this}setFromColor(a){return this.x=a.r,this.y=a.g,this.z=a.b,this}equals(a){return a.x===this.x&&a.y===this.y&&a.z===this.z}fromArray(a,b=0){return this.x=a[b],this.y=a[b+1],this.z=a[b+2],this}toArray(a=[],b=0){return a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a}fromBufferAttribute(a,b){return this.x=a.getX(b),this.y=a.getY(b),this.z=a.getZ(b),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let a=Math.random()*Math.PI*2,b=2*Math.random()-1,c=Math.sqrt(1-b*b);return this.x=c*Math.cos(a),this.y=b,this.z=c*Math.sin(a),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let am=new al,an=new ak;class ao{constructor(a,b,c,d,e,f,g,h,i){ao.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==a&&this.set(a,b,c,d,e,f,g,h,i)}set(a,b,c,d,e,f,g,h,i){let j=this.elements;return j[0]=a,j[1]=d,j[2]=g,j[3]=b,j[4]=e,j[5]=h,j[6]=c,j[7]=f,j[8]=i,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(a){let b=this.elements,c=a.elements;return b[0]=c[0],b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=c[6],b[7]=c[7],b[8]=c[8],this}extractBasis(a,b,c){return a.setFromMatrix3Column(this,0),b.setFromMatrix3Column(this,1),c.setFromMatrix3Column(this,2),this}setFromMatrix4(a){let b=a.elements;return this.set(b[0],b[4],b[8],b[1],b[5],b[9],b[2],b[6],b[10]),this}multiply(a){return this.multiplyMatrices(this,a)}premultiply(a){return this.multiplyMatrices(a,this)}multiplyMatrices(a,b){let c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[3],h=c[6],i=c[1],j=c[4],k=c[7],l=c[2],m=c[5],n=c[8],o=d[0],p=d[3],q=d[6],r=d[1],s=d[4],t=d[7],u=d[2],v=d[5],w=d[8];return e[0]=f*o+g*r+h*u,e[3]=f*p+g*s+h*v,e[6]=f*q+g*t+h*w,e[1]=i*o+j*r+k*u,e[4]=i*p+j*s+k*v,e[7]=i*q+j*t+k*w,e[2]=l*o+m*r+n*u,e[5]=l*p+m*s+n*v,e[8]=l*q+m*t+n*w,this}multiplyScalar(a){let b=this.elements;return b[0]*=a,b[3]*=a,b[6]*=a,b[1]*=a,b[4]*=a,b[7]*=a,b[2]*=a,b[5]*=a,b[8]*=a,this}determinant(){let a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8];return b*f*j-b*g*i-c*e*j+c*g*h+d*e*i-d*f*h}invert(){let a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=j*f-g*i,l=g*h-j*e,m=i*e-f*h,n=b*k+c*l+d*m;if(0===n)return this.set(0,0,0,0,0,0,0,0,0);let o=1/n;return a[0]=k*o,a[1]=(d*i-j*c)*o,a[2]=(g*c-d*f)*o,a[3]=l*o,a[4]=(j*b-d*h)*o,a[5]=(d*e-g*b)*o,a[6]=m*o,a[7]=(c*h-i*b)*o,a[8]=(f*b-c*e)*o,this}transpose(){let a,b=this.elements;return a=b[1],b[1]=b[3],b[3]=a,a=b[2],b[2]=b[6],b[6]=a,a=b[5],b[5]=b[7],b[7]=a,this}getNormalMatrix(a){return this.setFromMatrix4(a).invert().transpose()}transposeIntoArray(a){let b=this.elements;return a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8],this}setUvTransform(a,b,c,d,e,f,g){let h=Math.cos(e),i=Math.sin(e);return this.set(c*h,c*i,-c*(h*f+i*g)+f+a,-d*i,d*h,-d*(-i*f+h*g)+g+b,0,0,1),this}scale(a,b){return this.premultiply(ap.makeScale(a,b)),this}rotate(a){return this.premultiply(ap.makeRotation(-a)),this}translate(a,b){return this.premultiply(ap.makeTranslation(a,b)),this}makeTranslation(a,b){return a.isVector2?this.set(1,0,a.x,0,1,a.y,0,0,1):this.set(1,0,a,0,1,b,0,0,1),this}makeRotation(a){let b=Math.cos(a),c=Math.sin(a);return this.set(b,-c,0,c,b,0,0,0,1),this}makeScale(a,b){return this.set(a,0,0,0,b,0,0,0,1),this}equals(a){let b=this.elements,c=a.elements;for(let a=0;a<9;a++)if(b[a]!==c[a])return!1;return!0}fromArray(a,b=0){for(let c=0;c<9;c++)this.elements[c]=a[c+b];return this}toArray(a=[],b=0){let c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a}clone(){return new this.constructor().fromArray(this.elements)}}let ap=new ao,aq=new ao().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ar=new ao().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),as=(m=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],o=[.3127,.329],(l={enabled:!0,workingColorSpace:B,spaces:{},convert:function(a,b,c){return!1!==this.enabled&&b!==c&&b&&c&&(this.spaces[b].transfer===D&&(a.r=at(a.r),a.g=at(a.g),a.b=at(a.b)),this.spaces[b].primaries!==this.spaces[c].primaries&&(a.applyMatrix3(this.spaces[b].toXYZ),a.applyMatrix3(this.spaces[c].fromXYZ)),this.spaces[c].transfer===D&&(a.r=au(a.r),a.g=au(a.g),a.b=au(a.b))),a},workingToColorSpace:function(a,b){return this.convert(a,this.workingColorSpace,b)},colorSpaceToWorking:function(a,b){return this.convert(a,b,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return""===a?C:this.spaces[a].transfer},getToneMappingMode:function(a){return this.spaces[a].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(a,b=this.workingColorSpace){return a.fromArray(this.spaces[b].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,b,c){return a.copy(this.spaces[b].toXYZ).multiply(this.spaces[c].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(a,b){return W("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),l.workingToColorSpace(a,b)},toWorkingColorSpace:function(a,b){return W("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),l.colorSpaceToWorking(a,b)}}).define({[B]:{primaries:m,whitePoint:o,transfer:C,toXYZ:aq,fromXYZ:ar,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:A},outputColorSpaceConfig:{drawingBufferColorSpace:A}},[A]:{primaries:m,whitePoint:o,transfer:D,toXYZ:aq,fromXYZ:ar,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:A}}}),l);function at(a){return a<.04045?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function au(a){return a<.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class av{static getDataURL(a,c="image/png"){let d;if(/^data:/i.test(a.src)||"u"<typeof HTMLCanvasElement)return a.src;if(a instanceof HTMLCanvasElement)d=a;else{void 0===b&&(b=M("canvas")),b.width=a.width,b.height=a.height;let c=b.getContext("2d");a instanceof ImageData?c.putImageData(a,0,0):c.drawImage(a,0,0,a.width,a.height),d=b}return d.toDataURL(c)}static sRGBToLinear(a){if("u">typeof HTMLImageElement&&a instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&a instanceof ImageBitmap){let b=M("canvas");b.width=a.width,b.height=a.height;let c=b.getContext("2d");c.drawImage(a,0,0,a.width,a.height);let d=c.getImageData(0,0,a.width,a.height),e=d.data;for(let a=0;a<e.length;a++)e[a]=255*at(e[a]/255);return c.putImageData(d,0,0),b}if(!a.data)return U("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),a;{let b=a.data.slice(0);for(let a=0;a<b.length;a++)b instanceof Uint8Array||b instanceof Uint8ClampedArray?b[a]=Math.floor(255*at(b[a]/255)):b[a]=at(b[a]);return{data:b,width:a.width,height:a.height}}}}let aw=0;class ax{constructor(a=null){this.isSource=!0,Object.defineProperty(this,"id",{value:aw++}),this.uuid=ac(),this.data=a,this.dataReady=!0,this.version=0}getSize(a){let b=this.data;return"u">typeof HTMLVideoElement&&b instanceof HTMLVideoElement?a.set(b.videoWidth,b.videoHeight,0):"u">typeof VideoFrame&&b instanceof VideoFrame?a.set(b.displayHeight,b.displayWidth,0):null!==b?a.set(b.width,b.height,b.depth||0):a.set(0,0,0),a}set needsUpdate(a){!0===a&&this.version++}toJSON(a){let b=void 0===a||"string"==typeof a;if(!b&&void 0!==a.images[this.uuid])return a.images[this.uuid];let c={uuid:this.uuid,url:""},d=this.data;if(null!==d){let a;if(Array.isArray(d)){a=[];for(let b=0,c=d.length;b<c;b++)d[b].isDataTexture?a.push(ay(d[b].image)):a.push(ay(d[b]))}else a=ay(d);c.url=a}return b||(a.images[this.uuid]=c),c}}function ay(a){return"u">typeof HTMLImageElement&&a instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&a instanceof ImageBitmap?av.getDataURL(a):a.data?{data:Array.from(a.data),width:a.width,height:a.height,type:a.data.constructor.name}:(U("Texture: Unable to serialize Texture."),{})}let az=0,aA=new al;class aB extends Z{constructor(a=aB.DEFAULT_IMAGE,b=aB.DEFAULT_MAPPING,c=1001,d=1001,e=1006,f=1008,g=1023,h=1009,i=aB.DEFAULT_ANISOTROPY,j=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:az++}),this.uuid=ac(),this.name="",this.source=new ax(a),this.mipmaps=[],this.mapping=b,this.channel=0,this.wrapS=c,this.wrapT=d,this.magFilter=e,this.minFilter=f,this.anisotropy=i,this.format=g,this.internalFormat=null,this.type=h,this.offset=new aj(0,0),this.repeat=new aj(1,1),this.center=new aj(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ao,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=j,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!a&&!!a.depth&&a.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(aA).x}get height(){return this.source.getSize(aA).y}get depth(){return this.source.getSize(aA).z}get image(){return this.source.data}set image(a=null){this.source.data=a}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(a,b){this.updateRanges.push({start:a,count:b})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(a){return this.name=a.name,this.source=a.source,this.mipmaps=a.mipmaps.slice(0),this.mapping=a.mapping,this.channel=a.channel,this.wrapS=a.wrapS,this.wrapT=a.wrapT,this.magFilter=a.magFilter,this.minFilter=a.minFilter,this.anisotropy=a.anisotropy,this.format=a.format,this.internalFormat=a.internalFormat,this.type=a.type,this.offset.copy(a.offset),this.repeat.copy(a.repeat),this.center.copy(a.center),this.rotation=a.rotation,this.matrixAutoUpdate=a.matrixAutoUpdate,this.matrix.copy(a.matrix),this.generateMipmaps=a.generateMipmaps,this.premultiplyAlpha=a.premultiplyAlpha,this.flipY=a.flipY,this.unpackAlignment=a.unpackAlignment,this.colorSpace=a.colorSpace,this.renderTarget=a.renderTarget,this.isRenderTargetTexture=a.isRenderTargetTexture,this.isArrayTexture=a.isArrayTexture,this.userData=JSON.parse(JSON.stringify(a.userData)),this.needsUpdate=!0,this}setValues(a){for(let b in a){let c=a[b];if(void 0===c){U(`Texture.setValues(): parameter '${b}' has value of undefined.`);continue}let d=this[b];if(void 0===d){U(`Texture.setValues(): property '${b}' does not exist.`);continue}d&&c&&d.isVector2&&c.isVector2||d&&c&&d.isVector3&&c.isVector3||d&&c&&d.isMatrix3&&c.isMatrix3?d.copy(c):this[b]=c}}toJSON(a){let b=void 0===a||"string"==typeof a;if(!b&&void 0!==a.textures[this.uuid])return a.textures[this.uuid];let c={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(a).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(c.userData=this.userData),b||(a.textures[this.uuid]=c),c}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(a){if(300!==this.mapping)return a;if(a.applyMatrix3(this.matrix),a.x<0||a.x>1)switch(this.wrapS){case 1e3:a.x=a.x-Math.floor(a.x);break;case 1001:a.x=a.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(a.x)%2)?a.x=Math.ceil(a.x)-a.x:a.x=a.x-Math.floor(a.x)}if(a.y<0||a.y>1)switch(this.wrapT){case 1e3:a.y=a.y-Math.floor(a.y);break;case 1001:a.y=a.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(a.y)%2)?a.y=Math.ceil(a.y)-a.y:a.y=a.y-Math.floor(a.y)}return this.flipY&&(a.y=1-a.y),a}set needsUpdate(a){!0===a&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(a){!0===a&&this.pmremVersion++}}aB.DEFAULT_IMAGE=null,aB.DEFAULT_MAPPING=300,aB.DEFAULT_ANISOTROPY=1;class aC{constructor(a=0,b=0,c=0,d=1){aC.prototype.isVector4=!0,this.x=a,this.y=b,this.z=c,this.w=d}get width(){return this.z}set width(a){this.z=a}get height(){return this.w}set height(a){this.w=a}set(a,b,c,d){return this.x=a,this.y=b,this.z=c,this.w=d,this}setScalar(a){return this.x=a,this.y=a,this.z=a,this.w=a,this}setX(a){return this.x=a,this}setY(a){return this.y=a,this}setZ(a){return this.z=a,this}setW(a){return this.w=a,this}setComponent(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a)}return this}getComponent(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(a){return this.x=a.x,this.y=a.y,this.z=a.z,this.w=void 0!==a.w?a.w:1,this}add(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z,this.w+=a.w,this}addScalar(a){return this.x+=a,this.y+=a,this.z+=a,this.w+=a,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this}addScaledVector(a,b){return this.x+=a.x*b,this.y+=a.y*b,this.z+=a.z*b,this.w+=a.w*b,this}sub(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z,this.w-=a.w,this}subScalar(a){return this.x-=a,this.y-=a,this.z-=a,this.w-=a,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this}multiply(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z,this.w*=a.w,this}multiplyScalar(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this}applyMatrix4(a){let b=this.x,c=this.y,d=this.z,e=this.w,f=a.elements;return this.x=f[0]*b+f[4]*c+f[8]*d+f[12]*e,this.y=f[1]*b+f[5]*c+f[9]*d+f[13]*e,this.z=f[2]*b+f[6]*c+f[10]*d+f[14]*e,this.w=f[3]*b+f[7]*c+f[11]*d+f[15]*e,this}divide(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this.w/=a.w,this}divideScalar(a){return this.multiplyScalar(1/a)}setAxisAngleFromQuaternion(a){this.w=2*Math.acos(a.w);let b=Math.sqrt(1-a.w*a.w);return b<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b),this}setAxisAngleFromRotationMatrix(a){let b,c,d,e,f=a.elements,g=f[0],h=f[4],i=f[8],j=f[1],k=f[5],l=f[9],m=f[2],n=f[6],o=f[10];if(.01>Math.abs(h-j)&&.01>Math.abs(i-m)&&.01>Math.abs(l-n)){if(.1>Math.abs(h+j)&&.1>Math.abs(i+m)&&.1>Math.abs(l+n)&&.1>Math.abs(g+k+o-3))return this.set(1,0,0,0),this;b=Math.PI;let a=(g+1)/2,f=(k+1)/2,p=(o+1)/2,q=(h+j)/4,r=(i+m)/4,s=(l+n)/4;return a>f&&a>p?a<.01?(c=0,d=.707106781,e=.707106781):(d=q/(c=Math.sqrt(a)),e=r/c):f>p?f<.01?(c=.707106781,d=0,e=.707106781):(c=q/(d=Math.sqrt(f)),e=s/d):p<.01?(c=.707106781,d=.707106781,e=0):(c=r/(e=Math.sqrt(p)),d=s/e),this.set(c,d,e,b),this}let p=Math.sqrt((n-l)*(n-l)+(i-m)*(i-m)+(j-h)*(j-h));return .001>Math.abs(p)&&(p=1),this.x=(n-l)/p,this.y=(i-m)/p,this.z=(j-h)/p,this.w=Math.acos((g+k+o-1)/2),this}setFromMatrixPosition(a){let b=a.elements;return this.x=b[12],this.y=b[13],this.z=b[14],this.w=b[15],this}min(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this.z=Math.min(this.z,a.z),this.w=Math.min(this.w,a.w),this}max(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this.z=Math.max(this.z,a.z),this.w=Math.max(this.w,a.w),this}clamp(a,b){return this.x=ad(this.x,a.x,b.x),this.y=ad(this.y,a.y,b.y),this.z=ad(this.z,a.z,b.z),this.w=ad(this.w,a.w,b.w),this}clampScalar(a,b){return this.x=ad(this.x,a,b),this.y=ad(this.y,a,b),this.z=ad(this.z,a,b),this.w=ad(this.w,a,b),this}clampLength(a,b){let c=this.length();return this.divideScalar(c||1).multiplyScalar(ad(c,a,b))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(a){return this.normalize().multiplyScalar(a)}lerp(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this.w+=(a.w-this.w)*b,this}lerpVectors(a,b,c){return this.x=a.x+(b.x-a.x)*c,this.y=a.y+(b.y-a.y)*c,this.z=a.z+(b.z-a.z)*c,this.w=a.w+(b.w-a.w)*c,this}equals(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w}fromArray(a,b=0){return this.x=a[b],this.y=a[b+1],this.z=a[b+2],this.w=a[b+3],this}toArray(a=[],b=0){return a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a[b+3]=this.w,a}fromBufferAttribute(a,b){return this.x=a.getX(b),this.y=a.getY(b),this.z=a.getZ(b),this.w=a.getW(b),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class aD extends Z{constructor(a=1,b=1,c={}){super(),c=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},c),this.isRenderTarget=!0,this.width=a,this.height=b,this.depth=c.depth,this.scissor=new aC(0,0,a,b),this.scissorTest=!1,this.viewport=new aC(0,0,a,b),this.textures=[];const d=new aB({width:a,height:b,depth:c.depth}),e=c.count;for(let a=0;a<e;a++)this.textures[a]=d.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(c),this.depthBuffer=c.depthBuffer,this.stencilBuffer=c.stencilBuffer,this.resolveDepthBuffer=c.resolveDepthBuffer,this.resolveStencilBuffer=c.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=c.depthTexture,this.samples=c.samples,this.multiview=c.multiview}_setTextureOptions(a={}){let b={minFilter:1006,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==a.mapping&&(b.mapping=a.mapping),void 0!==a.wrapS&&(b.wrapS=a.wrapS),void 0!==a.wrapT&&(b.wrapT=a.wrapT),void 0!==a.wrapR&&(b.wrapR=a.wrapR),void 0!==a.magFilter&&(b.magFilter=a.magFilter),void 0!==a.minFilter&&(b.minFilter=a.minFilter),void 0!==a.format&&(b.format=a.format),void 0!==a.type&&(b.type=a.type),void 0!==a.anisotropy&&(b.anisotropy=a.anisotropy),void 0!==a.colorSpace&&(b.colorSpace=a.colorSpace),void 0!==a.flipY&&(b.flipY=a.flipY),void 0!==a.generateMipmaps&&(b.generateMipmaps=a.generateMipmaps),void 0!==a.internalFormat&&(b.internalFormat=a.internalFormat);for(let a=0;a<this.textures.length;a++)this.textures[a].setValues(b)}get texture(){return this.textures[0]}set texture(a){this.textures[0]=a}set depthTexture(a){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==a&&(a.renderTarget=this),this._depthTexture=a}get depthTexture(){return this._depthTexture}setSize(a,b,c=1){if(this.width!==a||this.height!==b||this.depth!==c){this.width=a,this.height=b,this.depth=c;for(let d=0,e=this.textures.length;d<e;d++)this.textures[d].image.width=a,this.textures[d].image.height=b,this.textures[d].image.depth=c,!0!==this.textures[d].isData3DTexture&&(this.textures[d].isArrayTexture=this.textures[d].image.depth>1);this.dispose()}this.viewport.set(0,0,a,b),this.scissor.set(0,0,a,b)}clone(){return new this.constructor().copy(this)}copy(a){this.width=a.width,this.height=a.height,this.depth=a.depth,this.scissor.copy(a.scissor),this.scissorTest=a.scissorTest,this.viewport.copy(a.viewport),this.textures.length=0;for(let b=0,c=a.textures.length;b<c;b++){this.textures[b]=a.textures[b].clone(),this.textures[b].isRenderTargetTexture=!0,this.textures[b].renderTarget=this;let c=Object.assign({},a.textures[b].image);this.textures[b].source=new ax(c)}return this.depthBuffer=a.depthBuffer,this.stencilBuffer=a.stencilBuffer,this.resolveDepthBuffer=a.resolveDepthBuffer,this.resolveStencilBuffer=a.resolveStencilBuffer,null!==a.depthTexture&&(this.depthTexture=a.depthTexture.clone()),this.samples=a.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class aE extends aD{constructor(a=1,b=1,c={}){super(a,b,c),this.isWebGLRenderTarget=!0}}class aF extends aB{constructor(a=null,b=1,c=1,d=1){super(null),this.isDataArrayTexture=!0,this.image={data:a,width:b,height:c,depth:d},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(a){this.layerUpdates.add(a)}clearLayerUpdates(){this.layerUpdates.clear()}}class aG extends aE{constructor(a=1,b=1,c=1,d={}){super(a,b,d),this.isWebGLArrayRenderTarget=!0,this.depth=c,this.texture=new aF(null,a,b,c),this._setTextureOptions(d),this.texture.isRenderTargetTexture=!0}}class aH extends aB{constructor(a=null,b=1,c=1,d=1){super(null),this.isData3DTexture=!0,this.image={data:a,width:b,height:c,depth:d},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class aI extends aE{constructor(a=1,b=1,c=1,d={}){super(a,b,d),this.isWebGL3DRenderTarget=!0,this.depth=c,this.texture=new aH(null,a,b,c),this._setTextureOptions(d),this.texture.isRenderTargetTexture=!0}}class aJ{constructor(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){aJ.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==a&&this.set(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)}set(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){let q=this.elements;return q[0]=a,q[4]=b,q[8]=c,q[12]=d,q[1]=e,q[5]=f,q[9]=g,q[13]=h,q[2]=i,q[6]=j,q[10]=k,q[14]=l,q[3]=m,q[7]=n,q[11]=o,q[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new aJ().fromArray(this.elements)}copy(a){let b=this.elements,c=a.elements;return b[0]=c[0],b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=c[6],b[7]=c[7],b[8]=c[8],b[9]=c[9],b[10]=c[10],b[11]=c[11],b[12]=c[12],b[13]=c[13],b[14]=c[14],b[15]=c[15],this}copyPosition(a){let b=this.elements,c=a.elements;return b[12]=c[12],b[13]=c[13],b[14]=c[14],this}setFromMatrix3(a){let b=a.elements;return this.set(b[0],b[3],b[6],0,b[1],b[4],b[7],0,b[2],b[5],b[8],0,0,0,0,1),this}extractBasis(a,b,c){return 0===this.determinant()?(a.set(1,0,0),b.set(0,1,0),c.set(0,0,1)):(a.setFromMatrixColumn(this,0),b.setFromMatrixColumn(this,1),c.setFromMatrixColumn(this,2)),this}makeBasis(a,b,c){return this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1),this}extractRotation(a){if(0===a.determinant())return this.identity();let b=this.elements,c=a.elements,d=1/aK.setFromMatrixColumn(a,0).length(),e=1/aK.setFromMatrixColumn(a,1).length(),f=1/aK.setFromMatrixColumn(a,2).length();return b[0]=c[0]*d,b[1]=c[1]*d,b[2]=c[2]*d,b[3]=0,b[4]=c[4]*e,b[5]=c[5]*e,b[6]=c[6]*e,b[7]=0,b[8]=c[8]*f,b[9]=c[9]*f,b[10]=c[10]*f,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,this}makeRotationFromEuler(a){let b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),g=Math.sin(c),h=Math.cos(d),i=Math.sin(d),j=Math.cos(e),k=Math.sin(e);if("XYZ"===a.order){let a=f*j,c=f*k,d=g*j,e=g*k;b[0]=h*j,b[4]=-h*k,b[8]=i,b[1]=c+d*i,b[5]=a-e*i,b[9]=-g*h,b[2]=e-a*i,b[6]=d+c*i,b[10]=f*h}else if("YXZ"===a.order){let a=h*j,c=h*k,d=i*j,e=i*k;b[0]=a+e*g,b[4]=d*g-c,b[8]=f*i,b[1]=f*k,b[5]=f*j,b[9]=-g,b[2]=c*g-d,b[6]=e+a*g,b[10]=f*h}else if("ZXY"===a.order){let a=h*j,c=h*k,d=i*j,e=i*k;b[0]=a-e*g,b[4]=-f*k,b[8]=d+c*g,b[1]=c+d*g,b[5]=f*j,b[9]=e-a*g,b[2]=-f*i,b[6]=g,b[10]=f*h}else if("ZYX"===a.order){let a=f*j,c=f*k,d=g*j,e=g*k;b[0]=h*j,b[4]=d*i-c,b[8]=a*i+e,b[1]=h*k,b[5]=e*i+a,b[9]=c*i-d,b[2]=-i,b[6]=g*h,b[10]=f*h}else if("YZX"===a.order){let a=f*h,c=f*i,d=g*h,e=g*i;b[0]=h*j,b[4]=e-a*k,b[8]=d*k+c,b[1]=k,b[5]=f*j,b[9]=-g*j,b[2]=-i*j,b[6]=c*k+d,b[10]=a-e*k}else if("XZY"===a.order){let a=f*h,c=f*i,d=g*h,e=g*i;b[0]=h*j,b[4]=-k,b[8]=i*j,b[1]=a*k+e,b[5]=f*j,b[9]=c*k-d,b[2]=d*k-c,b[6]=g*j,b[10]=e*k+a}return b[3]=0,b[7]=0,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,this}makeRotationFromQuaternion(a){return this.compose(aM,a,aN)}lookAt(a,b,c){let d=this.elements;return aQ.subVectors(a,b),0===aQ.lengthSq()&&(aQ.z=1),aQ.normalize(),aO.crossVectors(c,aQ),0===aO.lengthSq()&&(1===Math.abs(c.z)?aQ.x+=1e-4:aQ.z+=1e-4,aQ.normalize(),aO.crossVectors(c,aQ)),aO.normalize(),aP.crossVectors(aQ,aO),d[0]=aO.x,d[4]=aP.x,d[8]=aQ.x,d[1]=aO.y,d[5]=aP.y,d[9]=aQ.y,d[2]=aO.z,d[6]=aP.z,d[10]=aQ.z,this}multiply(a){return this.multiplyMatrices(this,a)}premultiply(a){return this.multiplyMatrices(a,this)}multiplyMatrices(a,b){let c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],i=c[12],j=c[1],k=c[5],l=c[9],m=c[13],n=c[2],o=c[6],p=c[10],q=c[14],r=c[3],s=c[7],t=c[11],u=c[15],v=d[0],w=d[4],x=d[8],y=d[12],z=d[1],A=d[5],B=d[9],C=d[13],D=d[2],E=d[6],F=d[10],G=d[14],H=d[3],I=d[7],J=d[11],K=d[15];return e[0]=f*v+g*z+h*D+i*H,e[4]=f*w+g*A+h*E+i*I,e[8]=f*x+g*B+h*F+i*J,e[12]=f*y+g*C+h*G+i*K,e[1]=j*v+k*z+l*D+m*H,e[5]=j*w+k*A+l*E+m*I,e[9]=j*x+k*B+l*F+m*J,e[13]=j*y+k*C+l*G+m*K,e[2]=n*v+o*z+p*D+q*H,e[6]=n*w+o*A+p*E+q*I,e[10]=n*x+o*B+p*F+q*J,e[14]=n*y+o*C+p*G+q*K,e[3]=r*v+s*z+t*D+u*H,e[7]=r*w+s*A+t*E+u*I,e[11]=r*x+s*B+t*F+u*J,e[15]=r*y+s*C+t*G+u*K,this}multiplyScalar(a){let b=this.elements;return b[0]*=a,b[4]*=a,b[8]*=a,b[12]*=a,b[1]*=a,b[5]*=a,b[9]*=a,b[13]*=a,b[2]*=a,b[6]*=a,b[10]*=a,b[14]*=a,b[3]*=a,b[7]*=a,b[11]*=a,b[15]*=a,this}determinant(){let a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],j=a[2],k=a[6],l=a[10],m=a[14],n=a[3],o=a[7],p=a[11],q=a[15],r=h*m-i*l,s=g*m-i*k,t=g*l-h*k,u=f*m-i*j,v=f*l-h*j,w=f*k-g*j;return b*(o*r-p*s+q*t)-c*(n*r-p*u+q*v)+d*(n*s-o*u+q*w)-e*(n*t-o*v+p*w)}transpose(){let a,b=this.elements;return a=b[1],b[1]=b[4],b[4]=a,a=b[2],b[2]=b[8],b[8]=a,a=b[6],b[6]=b[9],b[9]=a,a=b[3],b[3]=b[12],b[12]=a,a=b[7],b[7]=b[13],b[13]=a,a=b[11],b[11]=b[14],b[14]=a,this}setPosition(a,b,c){let d=this.elements;return a.isVector3?(d[12]=a.x,d[13]=a.y,d[14]=a.z):(d[12]=a,d[13]=b,d[14]=c),this}invert(){let a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15],r=b*g-c*f,s=b*h-d*f,t=b*i-e*f,u=c*h-d*g,v=c*i-e*g,w=d*i-e*h,x=j*o-k*n,y=j*p-l*n,z=j*q-m*n,A=k*p-l*o,B=k*q-m*o,C=l*q-m*p,D=r*C-s*B+t*A+u*z-v*y+w*x;if(0===D)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let E=1/D;return a[0]=(g*C-h*B+i*A)*E,a[1]=(d*B-c*C-e*A)*E,a[2]=(o*w-p*v+q*u)*E,a[3]=(l*v-k*w-m*u)*E,a[4]=(h*z-f*C-i*y)*E,a[5]=(b*C-d*z+e*y)*E,a[6]=(p*t-n*w-q*s)*E,a[7]=(j*w-l*t+m*s)*E,a[8]=(f*B-g*z+i*x)*E,a[9]=(c*z-b*B-e*x)*E,a[10]=(n*v-o*t+q*r)*E,a[11]=(k*t-j*v-m*r)*E,a[12]=(g*y-f*A-h*x)*E,a[13]=(b*A-c*y+d*x)*E,a[14]=(o*s-n*u-p*r)*E,a[15]=(j*u-k*s+l*r)*E,this}scale(a){let b=this.elements,c=a.x,d=a.y,e=a.z;return b[0]*=c,b[4]*=d,b[8]*=e,b[1]*=c,b[5]*=d,b[9]*=e,b[2]*=c,b[6]*=d,b[10]*=e,b[3]*=c,b[7]*=d,b[11]*=e,this}getMaxScaleOnAxis(){let a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))}makeTranslation(a,b,c){return a.isVector3?this.set(1,0,0,a.x,0,1,0,a.y,0,0,1,a.z,0,0,0,1):this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1),this}makeRotationX(a){let b=Math.cos(a),c=Math.sin(a);return this.set(1,0,0,0,0,b,-c,0,0,c,b,0,0,0,0,1),this}makeRotationY(a){let b=Math.cos(a),c=Math.sin(a);return this.set(b,0,c,0,0,1,0,0,-c,0,b,0,0,0,0,1),this}makeRotationZ(a){let b=Math.cos(a),c=Math.sin(a);return this.set(b,-c,0,0,c,b,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(a,b){let c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,j=e*g;return this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,j*g+c,j*h-d*f,0,i*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1),this}makeScale(a,b,c){return this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1),this}makeShear(a,b,c,d,e,f){return this.set(1,c,e,0,a,1,f,0,b,d,1,0,0,0,0,1),this}compose(a,b,c){let d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,i=e+e,j=f+f,k=g+g,l=e*i,m=e*j,n=e*k,o=f*j,p=f*k,q=g*k,r=h*i,s=h*j,t=h*k,u=c.x,v=c.y,w=c.z;return d[0]=(1-(o+q))*u,d[1]=(m+t)*u,d[2]=(n-s)*u,d[3]=0,d[4]=(m-t)*v,d[5]=(1-(l+q))*v,d[6]=(p+r)*v,d[7]=0,d[8]=(n+s)*w,d[9]=(p-r)*w,d[10]=(1-(l+o))*w,d[11]=0,d[12]=a.x,d[13]=a.y,d[14]=a.z,d[15]=1,this}decompose(a,b,c){let d=this.elements;a.x=d[12],a.y=d[13],a.z=d[14];let e=this.determinant();if(0===e)return c.set(1,1,1),b.identity(),this;let f=aK.set(d[0],d[1],d[2]).length(),g=aK.set(d[4],d[5],d[6]).length(),h=aK.set(d[8],d[9],d[10]).length();e<0&&(f=-f),aL.copy(this);let i=1/f,j=1/g,k=1/h;return aL.elements[0]*=i,aL.elements[1]*=i,aL.elements[2]*=i,aL.elements[4]*=j,aL.elements[5]*=j,aL.elements[6]*=j,aL.elements[8]*=k,aL.elements[9]*=k,aL.elements[10]*=k,b.setFromRotationMatrix(aL),c.x=f,c.y=g,c.z=h,this}makePerspective(a,b,c,d,e,f,g=2e3,h=!1){let i,j,k=this.elements;if(h)i=e/(f-e),j=f*e/(f-e);else if(2e3===g)i=-(f+e)/(f-e),j=-2*f*e/(f-e);else if(2001===g)i=-f/(f-e),j=-f*e/(f-e);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+g);return k[0]=2*e/(b-a),k[4]=0,k[8]=(b+a)/(b-a),k[12]=0,k[1]=0,k[5]=2*e/(c-d),k[9]=(c+d)/(c-d),k[13]=0,k[2]=0,k[6]=0,k[10]=i,k[14]=j,k[3]=0,k[7]=0,k[11]=-1,k[15]=0,this}makeOrthographic(a,b,c,d,e,f,g=2e3,h=!1){let i,j,k=this.elements;if(h)i=1/(f-e),j=f/(f-e);else if(2e3===g)i=-2/(f-e),j=-(f+e)/(f-e);else if(2001===g)i=-1/(f-e),j=-e/(f-e);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+g);return k[0]=2/(b-a),k[4]=0,k[8]=0,k[12]=-(b+a)/(b-a),k[1]=0,k[5]=2/(c-d),k[9]=0,k[13]=-(c+d)/(c-d),k[2]=0,k[6]=0,k[10]=i,k[14]=j,k[3]=0,k[7]=0,k[11]=0,k[15]=1,this}equals(a){let b=this.elements,c=a.elements;for(let a=0;a<16;a++)if(b[a]!==c[a])return!1;return!0}fromArray(a,b=0){for(let c=0;c<16;c++)this.elements[c]=a[c+b];return this}toArray(a=[],b=0){let c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a[b+9]=c[9],a[b+10]=c[10],a[b+11]=c[11],a[b+12]=c[12],a[b+13]=c[13],a[b+14]=c[14],a[b+15]=c[15],a}}let aK=new al,aL=new aJ,aM=new al(0,0,0),aN=new al(1,1,1),aO=new al,aP=new al,aQ=new al,aR=new aJ,aS=new ak;class aT{constructor(a=0,b=0,c=0,d=aT.DEFAULT_ORDER){this.isEuler=!0,this._x=a,this._y=b,this._z=c,this._order=d}get x(){return this._x}set x(a){this._x=a,this._onChangeCallback()}get y(){return this._y}set y(a){this._y=a,this._onChangeCallback()}get z(){return this._z}set z(a){this._z=a,this._onChangeCallback()}get order(){return this._order}set order(a){this._order=a,this._onChangeCallback()}set(a,b,c,d=this._order){return this._x=a,this._y=b,this._z=c,this._order=d,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(a){return this._x=a._x,this._y=a._y,this._z=a._z,this._order=a._order,this._onChangeCallback(),this}setFromRotationMatrix(a,b=this._order,c=!0){let d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],i=d[5],j=d[9],k=d[2],l=d[6],m=d[10];switch(b){case"XYZ":this._y=Math.asin(ad(g,-1,1)),.9999999>Math.abs(g)?(this._x=Math.atan2(-j,m),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(l,i),this._z=0);break;case"YXZ":this._x=Math.asin(-ad(j,-1,1)),.9999999>Math.abs(j)?(this._y=Math.atan2(g,m),this._z=Math.atan2(h,i)):(this._y=Math.atan2(-k,e),this._z=0);break;case"ZXY":this._x=Math.asin(ad(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(-k,m),this._z=Math.atan2(-f,i)):(this._y=0,this._z=Math.atan2(h,e));break;case"ZYX":this._y=Math.asin(-ad(k,-1,1)),.9999999>Math.abs(k)?(this._x=Math.atan2(l,m),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,i));break;case"YZX":this._z=Math.asin(ad(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(-j,i),this._y=Math.atan2(-k,e)):(this._x=0,this._y=Math.atan2(g,m));break;case"XZY":this._z=Math.asin(-ad(f,-1,1)),.9999999>Math.abs(f)?(this._x=Math.atan2(l,i),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-j,m),this._y=0);break;default:U("Euler: .setFromRotationMatrix() encountered an unknown order: "+b)}return this._order=b,!0===c&&this._onChangeCallback(),this}setFromQuaternion(a,b,c){return aR.makeRotationFromQuaternion(a),this.setFromRotationMatrix(aR,b,c)}setFromVector3(a,b=this._order){return this.set(a.x,a.y,a.z,b)}reorder(a){return aS.setFromEuler(this),this.setFromQuaternion(aS,a)}equals(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order}fromArray(a){return this._x=a[0],this._y=a[1],this._z=a[2],void 0!==a[3]&&(this._order=a[3]),this._onChangeCallback(),this}toArray(a=[],b=0){return a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._order,a}_onChange(a){return this._onChangeCallback=a,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}aT.DEFAULT_ORDER="XYZ";class aU{constructor(){this.mask=1}set(a){this.mask=1<<a>>>0}enable(a){this.mask|=1<<a}enableAll(){this.mask=-1}toggle(a){this.mask^=1<<a}disable(a){this.mask&=~(1<<a)}disableAll(){this.mask=0}test(a){return(this.mask&a.mask)!=0}isEnabled(a){return(this.mask&1<<a)!=0}}let aV=0,aW=new al,aX=new ak,aY=new aJ,aZ=new al,a$=new al,a_=new al,a0=new ak,a1=new al(1,0,0),a2=new al(0,1,0),a3=new al(0,0,1),a4={type:"added"},a5={type:"removed"},a6={type:"childadded",child:null},a7={type:"childremoved",child:null};class a8 extends Z{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:aV++}),this.uuid=ac(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=a8.DEFAULT_UP.clone();const a=new al,b=new aT,c=new ak,d=new al(1,1,1);b._onChange(function(){c.setFromEuler(b,!1)}),c._onChange(function(){b.setFromQuaternion(c,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:a},rotation:{configurable:!0,enumerable:!0,value:b},quaternion:{configurable:!0,enumerable:!0,value:c},scale:{configurable:!0,enumerable:!0,value:d},modelViewMatrix:{value:new aJ},normalMatrix:{value:new ao}}),this.matrix=new aJ,this.matrixWorld=new aJ,this.matrixAutoUpdate=a8.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=a8.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new aU,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(a){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(a),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(a){return this.quaternion.premultiply(a),this}setRotationFromAxisAngle(a,b){this.quaternion.setFromAxisAngle(a,b)}setRotationFromEuler(a){this.quaternion.setFromEuler(a,!0)}setRotationFromMatrix(a){this.quaternion.setFromRotationMatrix(a)}setRotationFromQuaternion(a){this.quaternion.copy(a)}rotateOnAxis(a,b){return aX.setFromAxisAngle(a,b),this.quaternion.multiply(aX),this}rotateOnWorldAxis(a,b){return aX.setFromAxisAngle(a,b),this.quaternion.premultiply(aX),this}rotateX(a){return this.rotateOnAxis(a1,a)}rotateY(a){return this.rotateOnAxis(a2,a)}rotateZ(a){return this.rotateOnAxis(a3,a)}translateOnAxis(a,b){return aW.copy(a).applyQuaternion(this.quaternion),this.position.add(aW.multiplyScalar(b)),this}translateX(a){return this.translateOnAxis(a1,a)}translateY(a){return this.translateOnAxis(a2,a)}translateZ(a){return this.translateOnAxis(a3,a)}localToWorld(a){return this.updateWorldMatrix(!0,!1),a.applyMatrix4(this.matrixWorld)}worldToLocal(a){return this.updateWorldMatrix(!0,!1),a.applyMatrix4(aY.copy(this.matrixWorld).invert())}lookAt(a,b,c){a.isVector3?aZ.copy(a):aZ.set(a,b,c);let d=this.parent;this.updateWorldMatrix(!0,!1),a$.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?aY.lookAt(a$,aZ,this.up):aY.lookAt(aZ,a$,this.up),this.quaternion.setFromRotationMatrix(aY),d&&(aY.extractRotation(d.matrixWorld),aX.setFromRotationMatrix(aY),this.quaternion.premultiply(aX.invert()))}add(a){if(arguments.length>1){for(let a=0;a<arguments.length;a++)this.add(arguments[a]);return this}return a===this?V("Object3D.add: object can't be added as a child of itself.",a):a&&a.isObject3D?(a.removeFromParent(),a.parent=this,this.children.push(a),a.dispatchEvent(a4),a6.child=a,this.dispatchEvent(a6),a6.child=null):V("Object3D.add: object not an instance of THREE.Object3D.",a),this}remove(a){if(arguments.length>1){for(let a=0;a<arguments.length;a++)this.remove(arguments[a]);return this}let b=this.children.indexOf(a);return -1!==b&&(a.parent=null,this.children.splice(b,1),a.dispatchEvent(a5),a7.child=a,this.dispatchEvent(a7),a7.child=null),this}removeFromParent(){let a=this.parent;return null!==a&&a.remove(this),this}clear(){return this.remove(...this.children)}attach(a){return this.updateWorldMatrix(!0,!1),aY.copy(this.matrixWorld).invert(),null!==a.parent&&(a.parent.updateWorldMatrix(!0,!1),aY.multiply(a.parent.matrixWorld)),a.applyMatrix4(aY),a.removeFromParent(),a.parent=this,this.children.push(a),a.updateWorldMatrix(!1,!0),a.dispatchEvent(a4),a6.child=a,this.dispatchEvent(a6),a6.child=null,this}getObjectById(a){return this.getObjectByProperty("id",a)}getObjectByName(a){return this.getObjectByProperty("name",a)}getObjectByProperty(a,b){if(this[a]===b)return this;for(let c=0,d=this.children.length;c<d;c++){let d=this.children[c].getObjectByProperty(a,b);if(void 0!==d)return d}}getObjectsByProperty(a,b,c=[]){this[a]===b&&c.push(this);let d=this.children;for(let e=0,f=d.length;e<f;e++)d[e].getObjectsByProperty(a,b,c);return c}getWorldPosition(a){return this.updateWorldMatrix(!0,!1),a.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(a){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(a$,a,a_),a}getWorldScale(a){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(a$,a0,a),a}getWorldDirection(a){this.updateWorldMatrix(!0,!1);let b=this.matrixWorld.elements;return a.set(b[8],b[9],b[10]).normalize()}raycast(){}traverse(a){a(this);let b=this.children;for(let c=0,d=b.length;c<d;c++)b[c].traverse(a)}traverseVisible(a){if(!1===this.visible)return;a(this);let b=this.children;for(let c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}traverseAncestors(a){let b=this.parent;null!==b&&(a(b),b.traverseAncestors(a))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let a=this.pivot;if(null!==a){let b=a.x,c=a.y,d=a.z,e=this.matrix.elements;e[12]+=b-e[0]*b-e[4]*c-e[8]*d,e[13]+=c-e[1]*b-e[5]*c-e[9]*d,e[14]+=d-e[2]*b-e[6]*c-e[10]*d}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(a){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||a)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,a=!0);let b=this.children;for(let c=0,d=b.length;c<d;c++)b[c].updateMatrixWorld(a)}updateWorldMatrix(a,b){let c=this.parent;if(!0===a&&null!==c&&c.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===b){let a=this.children;for(let b=0,c=a.length;b<c;b++)a[b].updateWorldMatrix(!1,!0)}}toJSON(a){let b=void 0===a||"string"==typeof a,c={};b&&(a={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},c.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let d={};function e(b,c){return void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a)),c.uuid}if(d.uuid=this.uuid,d.type=this.type,""!==this.name&&(d.name=this.name),!0===this.castShadow&&(d.castShadow=!0),!0===this.receiveShadow&&(d.receiveShadow=!0),!1===this.visible&&(d.visible=!1),!1===this.frustumCulled&&(d.frustumCulled=!1),0!==this.renderOrder&&(d.renderOrder=this.renderOrder),!1!==this.static&&(d.static=this.static),Object.keys(this.userData).length>0&&(d.userData=this.userData),d.layers=this.layers.mask,d.matrix=this.matrix.toArray(),d.up=this.up.toArray(),null!==this.pivot&&(d.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(d.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(d.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(d.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(d.type="InstancedMesh",d.count=this.count,d.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(d.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(d.type="BatchedMesh",d.perObjectFrustumCulled=this.perObjectFrustumCulled,d.sortObjects=this.sortObjects,d.drawRanges=this._drawRanges,d.reservedRanges=this._reservedRanges,d.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),d.instanceInfo=this._instanceInfo.map(a=>({...a})),d.availableInstanceIds=this._availableInstanceIds.slice(),d.availableGeometryIds=this._availableGeometryIds.slice(),d.nextIndexStart=this._nextIndexStart,d.nextVertexStart=this._nextVertexStart,d.geometryCount=this._geometryCount,d.maxInstanceCount=this._maxInstanceCount,d.maxVertexCount=this._maxVertexCount,d.maxIndexCount=this._maxIndexCount,d.geometryInitialized=this._geometryInitialized,d.matricesTexture=this._matricesTexture.toJSON(a),d.indirectTexture=this._indirectTexture.toJSON(a),null!==this._colorsTexture&&(d.colorsTexture=this._colorsTexture.toJSON(a)),null!==this.boundingSphere&&(d.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(d.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?d.background=this.background.toJSON():this.background.isTexture&&(d.background=this.background.toJSON(a).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(d.environment=this.environment.toJSON(a).uuid);else if(this.isMesh||this.isLine||this.isPoints){d.geometry=e(a.geometries,this.geometry);let b=this.geometry.parameters;if(void 0!==b&&void 0!==b.shapes){let c=b.shapes;if(Array.isArray(c))for(let b=0,d=c.length;b<d;b++){let d=c[b];e(a.shapes,d)}else e(a.shapes,c)}}if(this.isSkinnedMesh&&(d.bindMode=this.bindMode,d.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(e(a.skeletons,this.skeleton),d.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let b=[];for(let c=0,d=this.material.length;c<d;c++)b.push(e(a.materials,this.material[c]));d.material=b}else d.material=e(a.materials,this.material);if(this.children.length>0){d.children=[];for(let b=0;b<this.children.length;b++)d.children.push(this.children[b].toJSON(a).object)}if(this.animations.length>0){d.animations=[];for(let b=0;b<this.animations.length;b++){let c=this.animations[b];d.animations.push(e(a.animations,c))}}if(b){let b=f(a.geometries),d=f(a.materials),e=f(a.textures),g=f(a.images),h=f(a.shapes),i=f(a.skeletons),j=f(a.animations),k=f(a.nodes);b.length>0&&(c.geometries=b),d.length>0&&(c.materials=d),e.length>0&&(c.textures=e),g.length>0&&(c.images=g),h.length>0&&(c.shapes=h),i.length>0&&(c.skeletons=i),j.length>0&&(c.animations=j),k.length>0&&(c.nodes=k)}return c.object=d,c;function f(a){let b=[];for(let c in a){let d=a[c];delete d.metadata,b.push(d)}return b}}clone(a){return new this.constructor().copy(this,a)}copy(a,b=!0){if(this.name=a.name,this.up.copy(a.up),this.position.copy(a.position),this.rotation.order=a.rotation.order,this.quaternion.copy(a.quaternion),this.scale.copy(a.scale),null!==a.pivot&&(this.pivot=a.pivot.clone()),this.matrix.copy(a.matrix),this.matrixWorld.copy(a.matrixWorld),this.matrixAutoUpdate=a.matrixAutoUpdate,this.matrixWorldAutoUpdate=a.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate,this.layers.mask=a.layers.mask,this.visible=a.visible,this.castShadow=a.castShadow,this.receiveShadow=a.receiveShadow,this.frustumCulled=a.frustumCulled,this.renderOrder=a.renderOrder,this.static=a.static,this.animations=a.animations.slice(),this.userData=JSON.parse(JSON.stringify(a.userData)),!0===b)for(let b=0;b<a.children.length;b++){let c=a.children[b];this.add(c.clone())}return this}}a8.DEFAULT_UP=new al(0,1,0),a8.DEFAULT_MATRIX_AUTO_UPDATE=!0,a8.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class a9 extends a8{constructor(){super(),this.isGroup=!0,this.type="Group"}}let ba={type:"move"};class bb{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new a9,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new a9,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new al,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new al),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new a9,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new al,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new al),this._grip}dispatchEvent(a){return null!==this._targetRay&&this._targetRay.dispatchEvent(a),null!==this._grip&&this._grip.dispatchEvent(a),null!==this._hand&&this._hand.dispatchEvent(a),this}connect(a){if(a&&a.hand){let b=this._hand;if(b)for(let c of a.hand.values())this._getHandJoint(b,c)}return this.dispatchEvent({type:"connected",data:a}),this}disconnect(a){return this.dispatchEvent({type:"disconnected",data:a}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(a,b,c){let d=null,e=null,f=null,g=this._targetRay,h=this._grip,i=this._hand;if(a&&"visible-blurred"!==b.session.visibilityState){if(i&&a.hand){for(let d of(f=!0,a.hand.values())){let a=b.getJointPose(d,c),e=this._getHandJoint(i,d);null!==a&&(e.matrix.fromArray(a.transform.matrix),e.matrix.decompose(e.position,e.rotation,e.scale),e.matrixWorldNeedsUpdate=!0,e.jointRadius=a.radius),e.visible=null!==a}let d=i.joints["index-finger-tip"],e=i.joints["thumb-tip"],g=d.position.distanceTo(e.position);i.inputState.pinching&&g>.025?(i.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:a.handedness,target:this})):!i.inputState.pinching&&g<=.015&&(i.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:a.handedness,target:this}))}else null!==h&&a.gripSpace&&null!==(e=b.getPose(a.gripSpace,c))&&(h.matrix.fromArray(e.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,e.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(e.linearVelocity)):h.hasLinearVelocity=!1,e.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(e.angularVelocity)):h.hasAngularVelocity=!1);null!==g&&(null===(d=b.getPose(a.targetRaySpace,c))&&null!==e&&(d=e),null!==d&&(g.matrix.fromArray(d.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,d.linearVelocity?(g.hasLinearVelocity=!0,g.linearVelocity.copy(d.linearVelocity)):g.hasLinearVelocity=!1,d.angularVelocity?(g.hasAngularVelocity=!0,g.angularVelocity.copy(d.angularVelocity)):g.hasAngularVelocity=!1,this.dispatchEvent(ba)))}return null!==g&&(g.visible=null!==d),null!==h&&(h.visible=null!==e),null!==i&&(i.visible=null!==f),this}_getHandJoint(a,b){if(void 0===a.joints[b.jointName]){let c=new a9;c.matrixAutoUpdate=!1,c.visible=!1,a.joints[b.jointName]=c,a.add(c)}return a.joints[b.jointName]}}let bc={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},bd={h:0,s:0,l:0},be={h:0,s:0,l:0};function bf(a,b,c){return(c<0&&(c+=1),c>1&&(c-=1),c<1/6)?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*6*(2/3-c):a}class bg{constructor(a,b,c){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(a,b,c)}set(a,b,c){return void 0===b&&void 0===c?a&&a.isColor?this.copy(a):"number"==typeof a?this.setHex(a):"string"==typeof a&&this.setStyle(a):this.setRGB(a,b,c),this}setScalar(a){return this.r=a,this.g=a,this.b=a,this}setHex(a,b=A){return a=Math.floor(a),this.r=(a>>16&255)/255,this.g=(a>>8&255)/255,this.b=(255&a)/255,as.colorSpaceToWorking(this,b),this}setRGB(a,b,c,d=as.workingColorSpace){return this.r=a,this.g=b,this.b=c,as.colorSpaceToWorking(this,d),this}setHSL(a,b,c,d=as.workingColorSpace){if(a=ae(a,1),b=ad(b,0,1),c=ad(c,0,1),0===b)this.r=this.g=this.b=c;else{let d=c<=.5?c*(1+b):c+b-c*b,e=2*c-d;this.r=bf(e,d,a+1/3),this.g=bf(e,d,a),this.b=bf(e,d,a-1/3)}return as.colorSpaceToWorking(this,d),this}setStyle(a,b=A){let c;function d(b){void 0!==b&&1>parseFloat(b)&&U("Color: Alpha component of "+a+" will be ignored.")}if(c=/^(\w+)\(([^\)]*)\)/.exec(a)){let e,f=c[1],g=c[2];switch(f){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(g))return d(e[4]),this.setRGB(Math.min(255,parseInt(e[1],10))/255,Math.min(255,parseInt(e[2],10))/255,Math.min(255,parseInt(e[3],10))/255,b);if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(g))return d(e[4]),this.setRGB(Math.min(100,parseInt(e[1],10))/100,Math.min(100,parseInt(e[2],10))/100,Math.min(100,parseInt(e[3],10))/100,b);break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(g))return d(e[4]),this.setHSL(parseFloat(e[1])/360,parseFloat(e[2])/100,parseFloat(e[3])/100,b);break;default:U("Color: Unknown color model "+a)}}else if(c=/^\#([A-Fa-f\d]+)$/.exec(a)){let d=c[1],e=d.length;if(3===e)return this.setRGB(parseInt(d.charAt(0),16)/15,parseInt(d.charAt(1),16)/15,parseInt(d.charAt(2),16)/15,b);if(6===e)return this.setHex(parseInt(d,16),b);U("Color: Invalid hex color "+a)}else if(a&&a.length>0)return this.setColorName(a,b);return this}setColorName(a,b=A){let c=bc[a.toLowerCase()];return void 0!==c?this.setHex(c,b):U("Color: Unknown color "+a),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(a){return this.r=a.r,this.g=a.g,this.b=a.b,this}copySRGBToLinear(a){return this.r=at(a.r),this.g=at(a.g),this.b=at(a.b),this}copyLinearToSRGB(a){return this.r=au(a.r),this.g=au(a.g),this.b=au(a.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(a=A){return as.workingToColorSpace(bh.copy(this),a),65536*Math.round(ad(255*bh.r,0,255))+256*Math.round(ad(255*bh.g,0,255))+Math.round(ad(255*bh.b,0,255))}getHexString(a=A){return("000000"+this.getHex(a).toString(16)).slice(-6)}getHSL(a,b=as.workingColorSpace){let c,d;as.workingToColorSpace(bh.copy(this),b);let e=bh.r,f=bh.g,g=bh.b,h=Math.max(e,f,g),i=Math.min(e,f,g),j=(i+h)/2;if(i===h)c=0,d=0;else{let a=h-i;switch(d=j<=.5?a/(h+i):a/(2-h-i),h){case e:c=(f-g)/a+6*(f<g);break;case f:c=(g-e)/a+2;break;case g:c=(e-f)/a+4}c/=6}return a.h=c,a.s=d,a.l=j,a}getRGB(a,b=as.workingColorSpace){return as.workingToColorSpace(bh.copy(this),b),a.r=bh.r,a.g=bh.g,a.b=bh.b,a}getStyle(a=A){as.workingToColorSpace(bh.copy(this),a);let b=bh.r,c=bh.g,d=bh.b;return a!==A?`color(${a} ${b.toFixed(3)} ${c.toFixed(3)} ${d.toFixed(3)})`:`rgb(${Math.round(255*b)},${Math.round(255*c)},${Math.round(255*d)})`}offsetHSL(a,b,c){return this.getHSL(bd),this.setHSL(bd.h+a,bd.s+b,bd.l+c)}add(a){return this.r+=a.r,this.g+=a.g,this.b+=a.b,this}addColors(a,b){return this.r=a.r+b.r,this.g=a.g+b.g,this.b=a.b+b.b,this}addScalar(a){return this.r+=a,this.g+=a,this.b+=a,this}sub(a){return this.r=Math.max(0,this.r-a.r),this.g=Math.max(0,this.g-a.g),this.b=Math.max(0,this.b-a.b),this}multiply(a){return this.r*=a.r,this.g*=a.g,this.b*=a.b,this}multiplyScalar(a){return this.r*=a,this.g*=a,this.b*=a,this}lerp(a,b){return this.r+=(a.r-this.r)*b,this.g+=(a.g-this.g)*b,this.b+=(a.b-this.b)*b,this}lerpColors(a,b,c){return this.r=a.r+(b.r-a.r)*c,this.g=a.g+(b.g-a.g)*c,this.b=a.b+(b.b-a.b)*c,this}lerpHSL(a,b){this.getHSL(bd),a.getHSL(be);let c=af(bd.h,be.h,b),d=af(bd.s,be.s,b),e=af(bd.l,be.l,b);return this.setHSL(c,d,e),this}setFromVector3(a){return this.r=a.x,this.g=a.y,this.b=a.z,this}applyMatrix3(a){let b=this.r,c=this.g,d=this.b,e=a.elements;return this.r=e[0]*b+e[3]*c+e[6]*d,this.g=e[1]*b+e[4]*c+e[7]*d,this.b=e[2]*b+e[5]*c+e[8]*d,this}equals(a){return a.r===this.r&&a.g===this.g&&a.b===this.b}fromArray(a,b=0){return this.r=a[b],this.g=a[b+1],this.b=a[b+2],this}toArray(a=[],b=0){return a[b]=this.r,a[b+1]=this.g,a[b+2]=this.b,a}fromBufferAttribute(a,b){return this.r=a.getX(b),this.g=a.getY(b),this.b=a.getZ(b),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let bh=new bg;bg.NAMES=bc;class bi{constructor(a,b=25e-5){this.isFogExp2=!0,this.name="",this.color=new bg(a),this.density=b}clone(){return new bi(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class bj{constructor(a,b=1,c=1e3){this.isFog=!0,this.name="",this.color=new bg(a),this.near=b,this.far=c}clone(){return new bj(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class bk extends a8{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new aT,this.environmentIntensity=1,this.environmentRotation=new aT,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(a,b){return super.copy(a,b),null!==a.background&&(this.background=a.background.clone()),null!==a.environment&&(this.environment=a.environment.clone()),null!==a.fog&&(this.fog=a.fog.clone()),this.backgroundBlurriness=a.backgroundBlurriness,this.backgroundIntensity=a.backgroundIntensity,this.backgroundRotation.copy(a.backgroundRotation),this.environmentIntensity=a.environmentIntensity,this.environmentRotation.copy(a.environmentRotation),null!==a.overrideMaterial&&(this.overrideMaterial=a.overrideMaterial.clone()),this.matrixAutoUpdate=a.matrixAutoUpdate,this}toJSON(a){let b=super.toJSON(a);return null!==this.fog&&(b.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(b.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(b.object.backgroundIntensity=this.backgroundIntensity),b.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(b.object.environmentIntensity=this.environmentIntensity),b.object.environmentRotation=this.environmentRotation.toArray(),b}}let bl=new al,bm=new al,bn=new al,bo=new al,bp=new al,bq=new al,br=new al,bs=new al,bt=new al,bu=new al,bv=new aC,bw=new aC,bx=new aC;class by{constructor(a=new al,b=new al,c=new al){this.a=a,this.b=b,this.c=c}static getNormal(a,b,c,d){d.subVectors(c,b),bl.subVectors(a,b),d.cross(bl);let e=d.lengthSq();return e>0?d.multiplyScalar(1/Math.sqrt(e)):d.set(0,0,0)}static getBarycoord(a,b,c,d,e){bl.subVectors(d,b),bm.subVectors(c,b),bn.subVectors(a,b);let f=bl.dot(bl),g=bl.dot(bm),h=bl.dot(bn),i=bm.dot(bm),j=bm.dot(bn),k=f*i-g*g;if(0===k)return e.set(0,0,0),null;let l=1/k,m=(i*h-g*j)*l,n=(f*j-g*h)*l;return e.set(1-m-n,n,m)}static containsPoint(a,b,c,d){return null!==this.getBarycoord(a,b,c,d,bo)&&bo.x>=0&&bo.y>=0&&bo.x+bo.y<=1}static getInterpolation(a,b,c,d,e,f,g,h){return null===this.getBarycoord(a,b,c,d,bo)?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(e,bo.x),h.addScaledVector(f,bo.y),h.addScaledVector(g,bo.z),h)}static getInterpolatedAttribute(a,b,c,d,e,f){return bv.setScalar(0),bw.setScalar(0),bx.setScalar(0),bv.fromBufferAttribute(a,b),bw.fromBufferAttribute(a,c),bx.fromBufferAttribute(a,d),f.setScalar(0),f.addScaledVector(bv,e.x),f.addScaledVector(bw,e.y),f.addScaledVector(bx,e.z),f}static isFrontFacing(a,b,c,d){return bl.subVectors(c,b),bm.subVectors(a,b),0>bl.cross(bm).dot(d)}set(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this}setFromPointsAndIndices(a,b,c,d){return this.a.copy(a[b]),this.b.copy(a[c]),this.c.copy(a[d]),this}setFromAttributeAndIndices(a,b,c,d){return this.a.fromBufferAttribute(a,b),this.b.fromBufferAttribute(a,c),this.c.fromBufferAttribute(a,d),this}clone(){return new this.constructor().copy(this)}copy(a){return this.a.copy(a.a),this.b.copy(a.b),this.c.copy(a.c),this}getArea(){return bl.subVectors(this.c,this.b),bm.subVectors(this.a,this.b),.5*bl.cross(bm).length()}getMidpoint(a){return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(a){return by.getNormal(this.a,this.b,this.c,a)}getPlane(a){return a.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(a,b){return by.getBarycoord(a,this.a,this.b,this.c,b)}getInterpolation(a,b,c,d,e){return by.getInterpolation(a,this.a,this.b,this.c,b,c,d,e)}containsPoint(a){return by.containsPoint(a,this.a,this.b,this.c)}isFrontFacing(a){return by.isFrontFacing(this.a,this.b,this.c,a)}intersectsBox(a){return a.intersectsTriangle(this)}closestPointToPoint(a,b){let c,d,e=this.a,f=this.b,g=this.c;bp.subVectors(f,e),bq.subVectors(g,e),bs.subVectors(a,e);let h=bp.dot(bs),i=bq.dot(bs);if(h<=0&&i<=0)return b.copy(e);bt.subVectors(a,f);let j=bp.dot(bt),k=bq.dot(bt);if(j>=0&&k<=j)return b.copy(f);let l=h*k-j*i;if(l<=0&&h>=0&&j<=0)return c=h/(h-j),b.copy(e).addScaledVector(bp,c);bu.subVectors(a,g);let m=bp.dot(bu),n=bq.dot(bu);if(n>=0&&m<=n)return b.copy(g);let o=m*i-h*n;if(o<=0&&i>=0&&n<=0)return d=i/(i-n),b.copy(e).addScaledVector(bq,d);let p=j*n-m*k;if(p<=0&&k-j>=0&&m-n>=0)return br.subVectors(g,f),d=(k-j)/(k-j+(m-n)),b.copy(f).addScaledVector(br,d);let q=1/(p+o+l);return c=o*q,d=l*q,b.copy(e).addScaledVector(bp,c).addScaledVector(bq,d)}equals(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}}class bz{constructor(a=new al(Infinity,Infinity,Infinity),b=new al(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=a,this.max=b}set(a,b){return this.min.copy(a),this.max.copy(b),this}setFromArray(a){this.makeEmpty();for(let b=0,c=a.length;b<c;b+=3)this.expandByPoint(bB.fromArray(a,b));return this}setFromBufferAttribute(a){this.makeEmpty();for(let b=0,c=a.count;b<c;b++)this.expandByPoint(bB.fromBufferAttribute(a,b));return this}setFromPoints(a){this.makeEmpty();for(let b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this}setFromCenterAndSize(a,b){let c=bB.copy(b).multiplyScalar(.5);return this.min.copy(a).sub(c),this.max.copy(a).add(c),this}setFromObject(a,b=!1){return this.makeEmpty(),this.expandByObject(a,b)}clone(){return new this.constructor().copy(this)}copy(a){return this.min.copy(a.min),this.max.copy(a.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(a){return this.isEmpty()?a.set(0,0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(a){return this.isEmpty()?a.set(0,0,0):a.subVectors(this.max,this.min)}expandByPoint(a){return this.min.min(a),this.max.max(a),this}expandByVector(a){return this.min.sub(a),this.max.add(a),this}expandByScalar(a){return this.min.addScalar(-a),this.max.addScalar(a),this}expandByObject(a,b=!1){a.updateWorldMatrix(!1,!1);let c=a.geometry;if(void 0!==c){let d=c.getAttribute("position");if(!0===b&&void 0!==d&&!0!==a.isInstancedMesh)for(let b=0,c=d.count;b<c;b++)!0===a.isMesh?a.getVertexPosition(b,bB):bB.fromBufferAttribute(d,b),bB.applyMatrix4(a.matrixWorld),this.expandByPoint(bB);else void 0!==a.boundingBox?(null===a.boundingBox&&a.computeBoundingBox(),bC.copy(a.boundingBox)):(null===c.boundingBox&&c.computeBoundingBox(),bC.copy(c.boundingBox)),bC.applyMatrix4(a.matrixWorld),this.union(bC)}let d=a.children;for(let a=0,c=d.length;a<c;a++)this.expandByObject(d[a],b);return this}containsPoint(a){return a.x>=this.min.x&&a.x<=this.max.x&&a.y>=this.min.y&&a.y<=this.max.y&&a.z>=this.min.z&&a.z<=this.max.z}containsBox(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z}getParameter(a,b){return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(a){return a.max.x>=this.min.x&&a.min.x<=this.max.x&&a.max.y>=this.min.y&&a.min.y<=this.max.y&&a.max.z>=this.min.z&&a.min.z<=this.max.z}intersectsSphere(a){return this.clampPoint(a.center,bB),bB.distanceToSquared(a.center)<=a.radius*a.radius}intersectsPlane(a){let b,c;return a.normal.x>0?(b=a.normal.x*this.min.x,c=a.normal.x*this.max.x):(b=a.normal.x*this.max.x,c=a.normal.x*this.min.x),a.normal.y>0?(b+=a.normal.y*this.min.y,c+=a.normal.y*this.max.y):(b+=a.normal.y*this.max.y,c+=a.normal.y*this.min.y),a.normal.z>0?(b+=a.normal.z*this.min.z,c+=a.normal.z*this.max.z):(b+=a.normal.z*this.max.z,c+=a.normal.z*this.min.z),b<=-a.constant&&c>=-a.constant}intersectsTriangle(a){if(this.isEmpty())return!1;this.getCenter(bJ),bK.subVectors(this.max,bJ),bD.subVectors(a.a,bJ),bE.subVectors(a.b,bJ),bF.subVectors(a.c,bJ),bG.subVectors(bE,bD),bH.subVectors(bF,bE),bI.subVectors(bD,bF);let b=[0,-bG.z,bG.y,0,-bH.z,bH.y,0,-bI.z,bI.y,bG.z,0,-bG.x,bH.z,0,-bH.x,bI.z,0,-bI.x,-bG.y,bG.x,0,-bH.y,bH.x,0,-bI.y,bI.x,0];return!!bN(b,bD,bE,bF,bK)&&!!bN(b=[1,0,0,0,1,0,0,0,1],bD,bE,bF,bK)&&(bL.crossVectors(bG,bH),bN(b=[bL.x,bL.y,bL.z],bD,bE,bF,bK))}clampPoint(a,b){return b.copy(a).clamp(this.min,this.max)}distanceToPoint(a){return this.clampPoint(a,bB).distanceTo(a)}getBoundingSphere(a){return this.isEmpty()?a.makeEmpty():(this.getCenter(a.center),a.radius=.5*this.getSize(bB).length()),a}intersect(a){return this.min.max(a.min),this.max.min(a.max),this.isEmpty()&&this.makeEmpty(),this}union(a){return this.min.min(a.min),this.max.max(a.max),this}applyMatrix4(a){return this.isEmpty()||(bA[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a),bA[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a),bA[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a),bA[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a),bA[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a),bA[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a),bA[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a),bA[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a),this.setFromPoints(bA)),this}translate(a){return this.min.add(a),this.max.add(a),this}equals(a){return a.min.equals(this.min)&&a.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(a){return this.min.fromArray(a.min),this.max.fromArray(a.max),this}}let bA=[new al,new al,new al,new al,new al,new al,new al,new al],bB=new al,bC=new bz,bD=new al,bE=new al,bF=new al,bG=new al,bH=new al,bI=new al,bJ=new al,bK=new al,bL=new al,bM=new al;function bN(a,b,c,d,e){for(let f=0,g=a.length-3;f<=g;f+=3){bM.fromArray(a,f);let g=e.x*Math.abs(bM.x)+e.y*Math.abs(bM.y)+e.z*Math.abs(bM.z),h=b.dot(bM),i=c.dot(bM),j=d.dot(bM);if(Math.max(-Math.max(h,i,j),Math.min(h,i,j))>g)return!1}return!0}let bO=function(){let a=new ArrayBuffer(4),b=new Float32Array(a),c=new Uint32Array(a),d=new Uint32Array(512),e=new Uint32Array(512);for(let a=0;a<256;++a){let b=a-127;b<-27?(d[a]=0,d[256|a]=32768,e[a]=24,e[256|a]=24):b<-14?(d[a]=1024>>-b-14,d[256|a]=1024>>-b-14|32768,e[a]=-b-1,e[256|a]=-b-1):b<=15?(d[a]=b+15<<10,d[256|a]=b+15<<10|32768,e[a]=13,e[256|a]=13):b<128?(d[a]=31744,d[256|a]=64512,e[a]=24,e[256|a]=24):(d[a]=31744,d[256|a]=64512,e[a]=13,e[256|a]=13)}let f=new Uint32Array(2048),g=new Uint32Array(64),h=new Uint32Array(64);for(let a=1;a<1024;++a){let b=a<<13,c=0;for(;(8388608&b)==0;)b<<=1,c-=8388608;b&=-8388609,c+=0x38800000,f[a]=b|c}for(let a=1024;a<2048;++a)f[a]=0x38000000+(a-1024<<13);for(let a=1;a<31;++a)g[a]=a<<23;g[31]=0x47800000,g[32]=0x80000000;for(let a=33;a<63;++a)g[a]=0x80000000+(a-32<<23);g[63]=0xc7800000;for(let a=1;a<64;++a)32!==a&&(h[a]=1024);return{floatView:b,uint32View:c,baseTable:d,shiftTable:e,mantissaTable:f,exponentTable:g,offsetTable:h}}();function bP(a){Math.abs(a)>65504&&U("DataUtils.toHalfFloat(): Value out of range."),a=ad(a,-65504,65504),bO.floatView[0]=a;let b=bO.uint32View[0],c=b>>23&511;return bO.baseTable[c]+((8388607&b)>>bO.shiftTable[c])}function bQ(a){let b=a>>10;return bO.uint32View[0]=bO.mantissaTable[bO.offsetTable[b]+(1023&a)]+bO.exponentTable[b],bO.floatView[0]}class bR{static toHalfFloat(a){return bP(a)}static fromHalfFloat(a){return bQ(a)}}let bS=new al,bT=new aj,bU=0;class bV{constructor(a,b,c=!1){if(Array.isArray(a))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:bU++}),this.name="",this.array=a,this.itemSize=b,this.count=void 0!==a?a.length/b:0,this.normalized=c,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(a){!0===a&&this.version++}setUsage(a){return this.usage=a,this}addUpdateRange(a,b){this.updateRanges.push({start:a,count:b})}clearUpdateRanges(){this.updateRanges.length=0}copy(a){return this.name=a.name,this.array=new a.array.constructor(a.array),this.itemSize=a.itemSize,this.count=a.count,this.normalized=a.normalized,this.usage=a.usage,this.gpuType=a.gpuType,this}copyAt(a,b,c){a*=this.itemSize,c*=b.itemSize;for(let d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d];return this}copyArray(a){return this.array.set(a),this}applyMatrix3(a){if(2===this.itemSize)for(let b=0,c=this.count;b<c;b++)bT.fromBufferAttribute(this,b),bT.applyMatrix3(a),this.setXY(b,bT.x,bT.y);else if(3===this.itemSize)for(let b=0,c=this.count;b<c;b++)bS.fromBufferAttribute(this,b),bS.applyMatrix3(a),this.setXYZ(b,bS.x,bS.y,bS.z);return this}applyMatrix4(a){for(let b=0,c=this.count;b<c;b++)bS.fromBufferAttribute(this,b),bS.applyMatrix4(a),this.setXYZ(b,bS.x,bS.y,bS.z);return this}applyNormalMatrix(a){for(let b=0,c=this.count;b<c;b++)bS.fromBufferAttribute(this,b),bS.applyNormalMatrix(a),this.setXYZ(b,bS.x,bS.y,bS.z);return this}transformDirection(a){for(let b=0,c=this.count;b<c;b++)bS.fromBufferAttribute(this,b),bS.transformDirection(a),this.setXYZ(b,bS.x,bS.y,bS.z);return this}set(a,b=0){return this.array.set(a,b),this}getComponent(a,b){let c=this.array[a*this.itemSize+b];return this.normalized&&(c=ag(c,this.array)),c}setComponent(a,b,c){return this.normalized&&(c=ah(c,this.array)),this.array[a*this.itemSize+b]=c,this}getX(a){let b=this.array[a*this.itemSize];return this.normalized&&(b=ag(b,this.array)),b}setX(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize]=b,this}getY(a){let b=this.array[a*this.itemSize+1];return this.normalized&&(b=ag(b,this.array)),b}setY(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize+1]=b,this}getZ(a){let b=this.array[a*this.itemSize+2];return this.normalized&&(b=ag(b,this.array)),b}setZ(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize+2]=b,this}getW(a){let b=this.array[a*this.itemSize+3];return this.normalized&&(b=ag(b,this.array)),b}setW(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize+3]=b,this}setXY(a,b,c){return a*=this.itemSize,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array)),this.array[a+0]=b,this.array[a+1]=c,this}setXYZ(a,b,c,d){return a*=this.itemSize,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array),d=ah(d,this.array)),this.array[a+0]=b,this.array[a+1]=c,this.array[a+2]=d,this}setXYZW(a,b,c,d,e){return a*=this.itemSize,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array),d=ah(d,this.array),e=ah(e,this.array)),this.array[a+0]=b,this.array[a+1]=c,this.array[a+2]=d,this.array[a+3]=e,this}onUpload(a){return this.onUploadCallback=a,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let a={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(a.name=this.name),35044!==this.usage&&(a.usage=this.usage),a}}class bW extends bV{constructor(a,b,c){super(new Int8Array(a),b,c)}}class bX extends bV{constructor(a,b,c){super(new Uint8Array(a),b,c)}}class bY extends bV{constructor(a,b,c){super(new Uint8ClampedArray(a),b,c)}}class bZ extends bV{constructor(a,b,c){super(new Int16Array(a),b,c)}}class b$ extends bV{constructor(a,b,c){super(new Uint16Array(a),b,c)}}class b_ extends bV{constructor(a,b,c){super(new Int32Array(a),b,c)}}class b0 extends bV{constructor(a,b,c){super(new Uint32Array(a),b,c)}}class b1 extends bV{constructor(a,b,c){super(new Uint16Array(a),b,c),this.isFloat16BufferAttribute=!0}getX(a){let b=bQ(this.array[a*this.itemSize]);return this.normalized&&(b=ag(b,this.array)),b}setX(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize]=bP(b),this}getY(a){let b=bQ(this.array[a*this.itemSize+1]);return this.normalized&&(b=ag(b,this.array)),b}setY(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize+1]=bP(b),this}getZ(a){let b=bQ(this.array[a*this.itemSize+2]);return this.normalized&&(b=ag(b,this.array)),b}setZ(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize+2]=bP(b),this}getW(a){let b=bQ(this.array[a*this.itemSize+3]);return this.normalized&&(b=ag(b,this.array)),b}setW(a,b){return this.normalized&&(b=ah(b,this.array)),this.array[a*this.itemSize+3]=bP(b),this}setXY(a,b,c){return a*=this.itemSize,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array)),this.array[a+0]=bP(b),this.array[a+1]=bP(c),this}setXYZ(a,b,c,d){return a*=this.itemSize,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array),d=ah(d,this.array)),this.array[a+0]=bP(b),this.array[a+1]=bP(c),this.array[a+2]=bP(d),this}setXYZW(a,b,c,d,e){return a*=this.itemSize,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array),d=ah(d,this.array),e=ah(e,this.array)),this.array[a+0]=bP(b),this.array[a+1]=bP(c),this.array[a+2]=bP(d),this.array[a+3]=bP(e),this}}class b2 extends bV{constructor(a,b,c){super(new Float32Array(a),b,c)}}let b3=new bz,b4=new al,b5=new al;class b6{constructor(a=new al,b=-1){this.isSphere=!0,this.center=a,this.radius=b}set(a,b){return this.center.copy(a),this.radius=b,this}setFromPoints(a,b){let c=this.center;void 0!==b?c.copy(b):b3.setFromPoints(a).getCenter(c);let d=0;for(let b=0,e=a.length;b<e;b++)d=Math.max(d,c.distanceToSquared(a[b]));return this.radius=Math.sqrt(d),this}copy(a){return this.center.copy(a.center),this.radius=a.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(a){return a.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(a){return a.distanceTo(this.center)-this.radius}intersectsSphere(a){let b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b}intersectsBox(a){return a.intersectsSphere(this)}intersectsPlane(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius}clampPoint(a,b){let c=this.center.distanceToSquared(a);return b.copy(a),c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center)),b}getBoundingBox(a){return this.isEmpty()?a.makeEmpty():(a.set(this.center,this.center),a.expandByScalar(this.radius)),a}applyMatrix4(a){return this.center.applyMatrix4(a),this.radius=this.radius*a.getMaxScaleOnAxis(),this}translate(a){return this.center.add(a),this}expandByPoint(a){if(this.isEmpty())return this.center.copy(a),this.radius=0,this;b4.subVectors(a,this.center);let b=b4.lengthSq();if(b>this.radius*this.radius){let a=Math.sqrt(b),c=(a-this.radius)*.5;this.center.addScaledVector(b4,c/a),this.radius+=c}return this}union(a){return a.isEmpty()||(this.isEmpty()?this.copy(a):!0===this.center.equals(a.center)?this.radius=Math.max(this.radius,a.radius):(b5.subVectors(a.center,this.center).setLength(a.radius),this.expandByPoint(b4.copy(a.center).add(b5)),this.expandByPoint(b4.copy(a.center).sub(b5)))),this}equals(a){return a.center.equals(this.center)&&a.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(a){return this.radius=a.radius,this.center.fromArray(a.center),this}}let b7=0,b8=new aJ,b9=new a8,ca=new al,cb=new bz,cc=new bz,cd=new al;class ce extends Z{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:b7++}),this.uuid=ac(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(a){return Array.isArray(a)?this.index=new(!function(a){for(let b=a.length-1;b>=0;--b)if(a[b]>=65535)return!0;return!1}(a)?b$:b0)(a,1):this.index=a,this}setIndirect(a,b=0){return this.indirect=a,this.indirectOffset=b,this}getIndirect(){return this.indirect}getAttribute(a){return this.attributes[a]}setAttribute(a,b){return this.attributes[a]=b,this}deleteAttribute(a){return delete this.attributes[a],this}hasAttribute(a){return void 0!==this.attributes[a]}addGroup(a,b,c=0){this.groups.push({start:a,count:b,materialIndex:c})}clearGroups(){this.groups=[]}setDrawRange(a,b){this.drawRange.start=a,this.drawRange.count=b}applyMatrix4(a){let b=this.attributes.position;void 0!==b&&(b.applyMatrix4(a),b.needsUpdate=!0);let c=this.attributes.normal;if(void 0!==c){let b=new ao().getNormalMatrix(a);c.applyNormalMatrix(b),c.needsUpdate=!0}let d=this.attributes.tangent;return void 0!==d&&(d.transformDirection(a),d.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(a){return b8.makeRotationFromQuaternion(a),this.applyMatrix4(b8),this}rotateX(a){return b8.makeRotationX(a),this.applyMatrix4(b8),this}rotateY(a){return b8.makeRotationY(a),this.applyMatrix4(b8),this}rotateZ(a){return b8.makeRotationZ(a),this.applyMatrix4(b8),this}translate(a,b,c){return b8.makeTranslation(a,b,c),this.applyMatrix4(b8),this}scale(a,b,c){return b8.makeScale(a,b,c),this.applyMatrix4(b8),this}lookAt(a){return b9.lookAt(a),b9.updateMatrix(),this.applyMatrix4(b9.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ca).negate(),this.translate(ca.x,ca.y,ca.z),this}setFromPoints(a){let b=this.getAttribute("position");if(void 0===b){let b=[];for(let c=0,d=a.length;c<d;c++){let d=a[c];b.push(d.x,d.y,d.z||0)}this.setAttribute("position",new b2(b,3))}else{let c=Math.min(a.length,b.count);for(let d=0;d<c;d++){let c=a[d];b.setXYZ(d,c.x,c.y,c.z||0)}a.length>b.count&&U("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),b.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new bz);let a=this.attributes.position,b=this.morphAttributes.position;if(a&&a.isGLBufferAttribute){V("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new al(-1/0,-1/0,-1/0),new al(Infinity,Infinity,Infinity));return}if(void 0!==a){if(this.boundingBox.setFromBufferAttribute(a),b)for(let a=0,c=b.length;a<c;a++){let c=b[a];cb.setFromBufferAttribute(c),this.morphTargetsRelative?(cd.addVectors(this.boundingBox.min,cb.min),this.boundingBox.expandByPoint(cd),cd.addVectors(this.boundingBox.max,cb.max),this.boundingBox.expandByPoint(cd)):(this.boundingBox.expandByPoint(cb.min),this.boundingBox.expandByPoint(cb.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&V('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new b6);let a=this.attributes.position,b=this.morphAttributes.position;if(a&&a.isGLBufferAttribute){V("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new al,1/0);return}if(a){let c=this.boundingSphere.center;if(cb.setFromBufferAttribute(a),b)for(let a=0,c=b.length;a<c;a++){let c=b[a];cc.setFromBufferAttribute(c),this.morphTargetsRelative?(cd.addVectors(cb.min,cc.min),cb.expandByPoint(cd),cd.addVectors(cb.max,cc.max),cb.expandByPoint(cd)):(cb.expandByPoint(cc.min),cb.expandByPoint(cc.max))}cb.getCenter(c);let d=0;for(let b=0,e=a.count;b<e;b++)cd.fromBufferAttribute(a,b),d=Math.max(d,c.distanceToSquared(cd));if(b)for(let e=0,f=b.length;e<f;e++){let f=b[e],g=this.morphTargetsRelative;for(let b=0,e=f.count;b<e;b++)cd.fromBufferAttribute(f,b),g&&(ca.fromBufferAttribute(a,b),cd.add(ca)),d=Math.max(d,c.distanceToSquared(cd))}this.boundingSphere.radius=Math.sqrt(d),isNaN(this.boundingSphere.radius)&&V('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let a=this.index,b=this.attributes;if(null===a||void 0===b.position||void 0===b.normal||void 0===b.uv)return void V("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let c=b.position,d=b.normal,e=b.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new bV(new Float32Array(4*c.count),4));let f=this.getAttribute("tangent"),g=[],h=[];for(let a=0;a<c.count;a++)g[a]=new al,h[a]=new al;let i=new al,j=new al,k=new al,l=new aj,m=new aj,n=new aj,o=new al,p=new al,q=this.groups;0===q.length&&(q=[{start:0,count:a.count}]);for(let b=0,d=q.length;b<d;++b){let d=q[b],f=d.start,r=d.count;for(let b=f,d=f+r;b<d;b+=3)!function(a,b,d){i.fromBufferAttribute(c,a),j.fromBufferAttribute(c,b),k.fromBufferAttribute(c,d),l.fromBufferAttribute(e,a),m.fromBufferAttribute(e,b),n.fromBufferAttribute(e,d),j.sub(i),k.sub(i),m.sub(l),n.sub(l);let f=1/(m.x*n.y-n.x*m.y);isFinite(f)&&(o.copy(j).multiplyScalar(n.y).addScaledVector(k,-m.y).multiplyScalar(f),p.copy(k).multiplyScalar(m.x).addScaledVector(j,-n.x).multiplyScalar(f),g[a].add(o),g[b].add(o),g[d].add(o),h[a].add(p),h[b].add(p),h[d].add(p))}(a.getX(b+0),a.getX(b+1),a.getX(b+2))}let r=new al,s=new al,t=new al,u=new al;function v(a){t.fromBufferAttribute(d,a),u.copy(t);let b=g[a];r.copy(b),r.sub(t.multiplyScalar(t.dot(b))).normalize(),s.crossVectors(u,b);let c=s.dot(h[a]);f.setXYZW(a,r.x,r.y,r.z,c<0?-1:1)}for(let b=0,c=q.length;b<c;++b){let c=q[b],d=c.start,e=c.count;for(let b=d,c=d+e;b<c;b+=3)v(a.getX(b+0)),v(a.getX(b+1)),v(a.getX(b+2))}}computeVertexNormals(){let a=this.index,b=this.getAttribute("position");if(void 0!==b){let c=this.getAttribute("normal");if(void 0===c)c=new bV(new Float32Array(3*b.count),3),this.setAttribute("normal",c);else for(let a=0,b=c.count;a<b;a++)c.setXYZ(a,0,0,0);let d=new al,e=new al,f=new al,g=new al,h=new al,i=new al,j=new al,k=new al;if(a)for(let l=0,m=a.count;l<m;l+=3){let m=a.getX(l+0),n=a.getX(l+1),o=a.getX(l+2);d.fromBufferAttribute(b,m),e.fromBufferAttribute(b,n),f.fromBufferAttribute(b,o),j.subVectors(f,e),k.subVectors(d,e),j.cross(k),g.fromBufferAttribute(c,m),h.fromBufferAttribute(c,n),i.fromBufferAttribute(c,o),g.add(j),h.add(j),i.add(j),c.setXYZ(m,g.x,g.y,g.z),c.setXYZ(n,h.x,h.y,h.z),c.setXYZ(o,i.x,i.y,i.z)}else for(let a=0,g=b.count;a<g;a+=3)d.fromBufferAttribute(b,a+0),e.fromBufferAttribute(b,a+1),f.fromBufferAttribute(b,a+2),j.subVectors(f,e),k.subVectors(d,e),j.cross(k),c.setXYZ(a+0,j.x,j.y,j.z),c.setXYZ(a+1,j.x,j.y,j.z),c.setXYZ(a+2,j.x,j.y,j.z);this.normalizeNormals(),c.needsUpdate=!0}}normalizeNormals(){let a=this.attributes.normal;for(let b=0,c=a.count;b<c;b++)cd.fromBufferAttribute(a,b),cd.normalize(),a.setXYZ(b,cd.x,cd.y,cd.z)}toNonIndexed(){function a(a,b){let c=a.array,d=a.itemSize,e=a.normalized,f=new c.constructor(b.length*d),g=0,h=0;for(let e=0,i=b.length;e<i;e++){g=a.isInterleavedBufferAttribute?b[e]*a.data.stride+a.offset:b[e]*d;for(let a=0;a<d;a++)f[h++]=c[g++]}return new bV(f,d,e)}if(null===this.index)return U("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let b=new ce,c=this.index.array,d=this.attributes;for(let e in d){let f=a(d[e],c);b.setAttribute(e,f)}let e=this.morphAttributes;for(let d in e){let f=[],g=e[d];for(let b=0,d=g.length;b<d;b++){let d=a(g[b],c);f.push(d)}b.morphAttributes[d]=f}b.morphTargetsRelative=this.morphTargetsRelative;let f=this.groups;for(let a=0,c=f.length;a<c;a++){let c=f[a];b.addGroup(c.start,c.count,c.materialIndex)}return b}toJSON(){let a={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),Object.keys(this.userData).length>0&&(a.userData=this.userData),void 0!==this.parameters){let b=this.parameters;for(let c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};let b=this.index;null!==b&&(a.data.index={type:b.array.constructor.name,array:Array.prototype.slice.call(b.array)});let c=this.attributes;for(let b in c){let d=c[b];a.data.attributes[b]=d.toJSON(a.data)}let d={},e=!1;for(let b in this.morphAttributes){let c=this.morphAttributes[b],f=[];for(let b=0,d=c.length;b<d;b++){let d=c[b];f.push(d.toJSON(a.data))}f.length>0&&(d[b]=f,e=!0)}e&&(a.data.morphAttributes=d,a.data.morphTargetsRelative=this.morphTargetsRelative);let f=this.groups;f.length>0&&(a.data.groups=JSON.parse(JSON.stringify(f)));let g=this.boundingSphere;return null!==g&&(a.data.boundingSphere=g.toJSON()),a}clone(){return new this.constructor().copy(this)}copy(a){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let b={};this.name=a.name;let c=a.index;null!==c&&this.setIndex(c.clone());let d=a.attributes;for(let a in d){let c=d[a];this.setAttribute(a,c.clone(b))}let e=a.morphAttributes;for(let a in e){let c=[],d=e[a];for(let a=0,e=d.length;a<e;a++)c.push(d[a].clone(b));this.morphAttributes[a]=c}this.morphTargetsRelative=a.morphTargetsRelative;let f=a.groups;for(let a=0,b=f.length;a<b;a++){let b=f[a];this.addGroup(b.start,b.count,b.materialIndex)}let g=a.boundingBox;null!==g&&(this.boundingBox=g.clone());let h=a.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.drawRange.start=a.drawRange.start,this.drawRange.count=a.drawRange.count,this.userData=a.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class cf{constructor(a,b){this.isInterleavedBuffer=!0,this.array=a,this.stride=b,this.count=void 0!==a?a.length/b:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=ac()}onUploadCallback(){}set needsUpdate(a){!0===a&&this.version++}setUsage(a){return this.usage=a,this}addUpdateRange(a,b){this.updateRanges.push({start:a,count:b})}clearUpdateRanges(){this.updateRanges.length=0}copy(a){return this.array=new a.array.constructor(a.array),this.count=a.count,this.stride=a.stride,this.usage=a.usage,this}copyAt(a,b,c){a*=this.stride,c*=b.stride;for(let d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this}set(a,b=0){return this.array.set(a,b),this}clone(a){void 0===a.arrayBuffers&&(a.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ac()),void 0===a.arrayBuffers[this.array.buffer._uuid]&&(a.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let b=new this.array.constructor(a.arrayBuffers[this.array.buffer._uuid]),c=new this.constructor(b,this.stride);return c.setUsage(this.usage),c}onUpload(a){return this.onUploadCallback=a,this}toJSON(a){return void 0===a.arrayBuffers&&(a.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ac()),void 0===a.arrayBuffers[this.array.buffer._uuid]&&(a.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}let cg=new al;class ch{constructor(a,b,c,d=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=a,this.itemSize=b,this.offset=c,this.normalized=d}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(a){this.data.needsUpdate=a}applyMatrix4(a){for(let b=0,c=this.data.count;b<c;b++)cg.fromBufferAttribute(this,b),cg.applyMatrix4(a),this.setXYZ(b,cg.x,cg.y,cg.z);return this}applyNormalMatrix(a){for(let b=0,c=this.count;b<c;b++)cg.fromBufferAttribute(this,b),cg.applyNormalMatrix(a),this.setXYZ(b,cg.x,cg.y,cg.z);return this}transformDirection(a){for(let b=0,c=this.count;b<c;b++)cg.fromBufferAttribute(this,b),cg.transformDirection(a),this.setXYZ(b,cg.x,cg.y,cg.z);return this}getComponent(a,b){let c=this.array[a*this.data.stride+this.offset+b];return this.normalized&&(c=ag(c,this.array)),c}setComponent(a,b,c){return this.normalized&&(c=ah(c,this.array)),this.data.array[a*this.data.stride+this.offset+b]=c,this}setX(a,b){return this.normalized&&(b=ah(b,this.array)),this.data.array[a*this.data.stride+this.offset]=b,this}setY(a,b){return this.normalized&&(b=ah(b,this.array)),this.data.array[a*this.data.stride+this.offset+1]=b,this}setZ(a,b){return this.normalized&&(b=ah(b,this.array)),this.data.array[a*this.data.stride+this.offset+2]=b,this}setW(a,b){return this.normalized&&(b=ah(b,this.array)),this.data.array[a*this.data.stride+this.offset+3]=b,this}getX(a){let b=this.data.array[a*this.data.stride+this.offset];return this.normalized&&(b=ag(b,this.array)),b}getY(a){let b=this.data.array[a*this.data.stride+this.offset+1];return this.normalized&&(b=ag(b,this.array)),b}getZ(a){let b=this.data.array[a*this.data.stride+this.offset+2];return this.normalized&&(b=ag(b,this.array)),b}getW(a){let b=this.data.array[a*this.data.stride+this.offset+3];return this.normalized&&(b=ag(b,this.array)),b}setXY(a,b,c){return a=a*this.data.stride+this.offset,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array)),this.data.array[a+0]=b,this.data.array[a+1]=c,this}setXYZ(a,b,c,d){return a=a*this.data.stride+this.offset,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array),d=ah(d,this.array)),this.data.array[a+0]=b,this.data.array[a+1]=c,this.data.array[a+2]=d,this}setXYZW(a,b,c,d,e){return a=a*this.data.stride+this.offset,this.normalized&&(b=ah(b,this.array),c=ah(c,this.array),d=ah(d,this.array),e=ah(e,this.array)),this.data.array[a+0]=b,this.data.array[a+1]=c,this.data.array[a+2]=d,this.data.array[a+3]=e,this}clone(a){if(void 0!==a)return void 0===a.interleavedBuffers&&(a.interleavedBuffers={}),void 0===a.interleavedBuffers[this.data.uuid]&&(a.interleavedBuffers[this.data.uuid]=this.data.clone(a)),new ch(a.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{S("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let a=[];for(let b=0;b<this.count;b++){let c=b*this.data.stride+this.offset;for(let b=0;b<this.itemSize;b++)a.push(this.data.array[c+b])}return new bV(new this.array.constructor(a),this.itemSize,this.normalized)}}toJSON(a){if(void 0!==a)return void 0===a.interleavedBuffers&&(a.interleavedBuffers={}),void 0===a.interleavedBuffers[this.data.uuid]&&(a.interleavedBuffers[this.data.uuid]=this.data.toJSON(a)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{S("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let a=[];for(let b=0;b<this.count;b++){let c=b*this.data.stride+this.offset;for(let b=0;b<this.itemSize;b++)a.push(this.data.array[c+b])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:a,normalized:this.normalized}}}}let ci=0;class cj extends Z{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ci++}),this.uuid=ac(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new bg(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(a){this._alphaTest>0!=a>0&&this.version++,this._alphaTest=a}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(a){if(void 0!==a)for(let b in a){let c=a[b];if(void 0===c){U(`Material: parameter '${b}' has value of undefined.`);continue}let d=this[b];if(void 0===d){U(`Material: '${b}' is not a property of THREE.${this.type}.`);continue}d&&d.isColor?d.set(c):d&&d.isVector3&&c&&c.isVector3?d.copy(c):this[b]=c}}toJSON(a){let b=void 0===a||"string"==typeof a;b&&(a={textures:{},images:{}});let c={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function d(a){let b=[];for(let c in a){let d=a[c];delete d.metadata,b.push(d)}return b}if(c.uuid=this.uuid,c.type=this.type,""!==this.name&&(c.name=this.name),this.color&&this.color.isColor&&(c.color=this.color.getHex()),void 0!==this.roughness&&(c.roughness=this.roughness),void 0!==this.metalness&&(c.metalness=this.metalness),void 0!==this.sheen&&(c.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(c.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(c.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(c.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(c.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(c.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(c.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(c.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(c.shininess=this.shininess),void 0!==this.clearcoat&&(c.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(c.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(c.clearcoatMap=this.clearcoatMap.toJSON(a).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(c.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(a).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(c.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(a).uuid,c.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(c.sheenColorMap=this.sheenColorMap.toJSON(a).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(c.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(a).uuid),void 0!==this.dispersion&&(c.dispersion=this.dispersion),void 0!==this.iridescence&&(c.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(c.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(c.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(c.iridescenceMap=this.iridescenceMap.toJSON(a).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(c.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(a).uuid),void 0!==this.anisotropy&&(c.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(c.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(c.anisotropyMap=this.anisotropyMap.toJSON(a).uuid),this.map&&this.map.isTexture&&(c.map=this.map.toJSON(a).uuid),this.matcap&&this.matcap.isTexture&&(c.matcap=this.matcap.toJSON(a).uuid),this.alphaMap&&this.alphaMap.isTexture&&(c.alphaMap=this.alphaMap.toJSON(a).uuid),this.lightMap&&this.lightMap.isTexture&&(c.lightMap=this.lightMap.toJSON(a).uuid,c.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(c.aoMap=this.aoMap.toJSON(a).uuid,c.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(c.bumpMap=this.bumpMap.toJSON(a).uuid,c.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(c.normalMap=this.normalMap.toJSON(a).uuid,c.normalMapType=this.normalMapType,c.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(c.displacementMap=this.displacementMap.toJSON(a).uuid,c.displacementScale=this.displacementScale,c.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(c.roughnessMap=this.roughnessMap.toJSON(a).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(c.metalnessMap=this.metalnessMap.toJSON(a).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(c.emissiveMap=this.emissiveMap.toJSON(a).uuid),this.specularMap&&this.specularMap.isTexture&&(c.specularMap=this.specularMap.toJSON(a).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(c.specularIntensityMap=this.specularIntensityMap.toJSON(a).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(c.specularColorMap=this.specularColorMap.toJSON(a).uuid),this.envMap&&this.envMap.isTexture&&(c.envMap=this.envMap.toJSON(a).uuid,void 0!==this.combine&&(c.combine=this.combine)),void 0!==this.envMapRotation&&(c.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(c.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(c.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(c.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(c.gradientMap=this.gradientMap.toJSON(a).uuid),void 0!==this.transmission&&(c.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(c.transmissionMap=this.transmissionMap.toJSON(a).uuid),void 0!==this.thickness&&(c.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(c.thicknessMap=this.thicknessMap.toJSON(a).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(c.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(c.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(c.size=this.size),null!==this.shadowSide&&(c.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(c.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(c.blending=this.blending),0!==this.side&&(c.side=this.side),!0===this.vertexColors&&(c.vertexColors=!0),this.opacity<1&&(c.opacity=this.opacity),!0===this.transparent&&(c.transparent=!0),204!==this.blendSrc&&(c.blendSrc=this.blendSrc),205!==this.blendDst&&(c.blendDst=this.blendDst),100!==this.blendEquation&&(c.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(c.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(c.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(c.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(c.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(c.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(c.depthFunc=this.depthFunc),!1===this.depthTest&&(c.depthTest=this.depthTest),!1===this.depthWrite&&(c.depthWrite=this.depthWrite),!1===this.colorWrite&&(c.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(c.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(c.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(c.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(c.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(c.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(c.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(c.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(c.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(c.rotation=this.rotation),!0===this.polygonOffset&&(c.polygonOffset=!0),0!==this.polygonOffsetFactor&&(c.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(c.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(c.linewidth=this.linewidth),void 0!==this.dashSize&&(c.dashSize=this.dashSize),void 0!==this.gapSize&&(c.gapSize=this.gapSize),void 0!==this.scale&&(c.scale=this.scale),!0===this.dithering&&(c.dithering=!0),this.alphaTest>0&&(c.alphaTest=this.alphaTest),!0===this.alphaHash&&(c.alphaHash=!0),!0===this.alphaToCoverage&&(c.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(c.premultipliedAlpha=!0),!0===this.forceSinglePass&&(c.forceSinglePass=!0),!1===this.allowOverride&&(c.allowOverride=!1),!0===this.wireframe&&(c.wireframe=!0),this.wireframeLinewidth>1&&(c.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(c.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(c.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(c.flatShading=!0),!1===this.visible&&(c.visible=!1),!1===this.toneMapped&&(c.toneMapped=!1),!1===this.fog&&(c.fog=!1),Object.keys(this.userData).length>0&&(c.userData=this.userData),b){let b=d(a.textures),e=d(a.images);b.length>0&&(c.textures=b),e.length>0&&(c.images=e)}return c}clone(){return new this.constructor().copy(this)}copy(a){this.name=a.name,this.blending=a.blending,this.side=a.side,this.vertexColors=a.vertexColors,this.opacity=a.opacity,this.transparent=a.transparent,this.blendSrc=a.blendSrc,this.blendDst=a.blendDst,this.blendEquation=a.blendEquation,this.blendSrcAlpha=a.blendSrcAlpha,this.blendDstAlpha=a.blendDstAlpha,this.blendEquationAlpha=a.blendEquationAlpha,this.blendColor.copy(a.blendColor),this.blendAlpha=a.blendAlpha,this.depthFunc=a.depthFunc,this.depthTest=a.depthTest,this.depthWrite=a.depthWrite,this.stencilWriteMask=a.stencilWriteMask,this.stencilFunc=a.stencilFunc,this.stencilRef=a.stencilRef,this.stencilFuncMask=a.stencilFuncMask,this.stencilFail=a.stencilFail,this.stencilZFail=a.stencilZFail,this.stencilZPass=a.stencilZPass,this.stencilWrite=a.stencilWrite;let b=a.clippingPlanes,c=null;if(null!==b){let a=b.length;c=Array(a);for(let d=0;d!==a;++d)c[d]=b[d].clone()}return this.clippingPlanes=c,this.clipIntersection=a.clipIntersection,this.clipShadows=a.clipShadows,this.shadowSide=a.shadowSide,this.colorWrite=a.colorWrite,this.precision=a.precision,this.polygonOffset=a.polygonOffset,this.polygonOffsetFactor=a.polygonOffsetFactor,this.polygonOffsetUnits=a.polygonOffsetUnits,this.dithering=a.dithering,this.alphaTest=a.alphaTest,this.alphaHash=a.alphaHash,this.alphaToCoverage=a.alphaToCoverage,this.premultipliedAlpha=a.premultipliedAlpha,this.forceSinglePass=a.forceSinglePass,this.allowOverride=a.allowOverride,this.visible=a.visible,this.toneMapped=a.toneMapped,this.userData=JSON.parse(JSON.stringify(a.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(a){!0===a&&this.version++}}class ck extends cj{constructor(a){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new bg(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.map=a.map,this.alphaMap=a.alphaMap,this.rotation=a.rotation,this.sizeAttenuation=a.sizeAttenuation,this.fog=a.fog,this}}let cl=new al,cm=new al,cn=new al,co=new aj,cp=new aj,cq=new aJ,cr=new al,cs=new al,ct=new al,cu=new aj,cv=new aj,cw=new aj;class cx extends a8{constructor(a=new ck){if(super(),this.isSprite=!0,this.type="Sprite",void 0===c){c=new ce;const a=new cf(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);c.setIndex([0,1,2,0,2,3]),c.setAttribute("position",new ch(a,3,0,!1)),c.setAttribute("uv",new ch(a,2,3,!1))}this.geometry=c,this.material=a,this.center=new aj(.5,.5),this.count=1}raycast(a,b){let c,d;null===a.camera&&V('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),cm.setFromMatrixScale(this.matrixWorld),cq.copy(a.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(a.camera.matrixWorldInverse,this.matrixWorld),cn.setFromMatrixPosition(this.modelViewMatrix),a.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&cm.multiplyScalar(-cn.z);let e=this.material.rotation;0!==e&&(d=Math.cos(e),c=Math.sin(e));let f=this.center;cy(cr.set(-.5,-.5,0),cn,f,cm,c,d),cy(cs.set(.5,-.5,0),cn,f,cm,c,d),cy(ct.set(.5,.5,0),cn,f,cm,c,d),cu.set(0,0),cv.set(1,0),cw.set(1,1);let g=a.ray.intersectTriangle(cr,cs,ct,!1,cl);if(null===g&&(cy(cs.set(-.5,.5,0),cn,f,cm,c,d),cv.set(0,1),null===(g=a.ray.intersectTriangle(cr,ct,cs,!1,cl))))return;let h=a.ray.origin.distanceTo(cl);h<a.near||h>a.far||b.push({distance:h,point:cl.clone(),uv:by.getInterpolation(cl,cr,cs,ct,cu,cv,cw,new aj),face:null,object:this})}copy(a,b){return super.copy(a,b),void 0!==a.center&&this.center.copy(a.center),this.material=a.material,this}}function cy(a,b,c,d,e,f){co.subVectors(a,c).addScalar(.5).multiply(d),void 0!==e?(cp.x=f*co.x-e*co.y,cp.y=e*co.x+f*co.y):cp.copy(co),a.copy(b),a.x+=cp.x,a.y+=cp.y,a.applyMatrix4(cq)}let cz=new al,cA=new al;class cB extends a8{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(a){super.copy(a,!1);let b=a.levels;for(let a=0,c=b.length;a<c;a++){let c=b[a];this.addLevel(c.object.clone(),c.distance,c.hysteresis)}return this.autoUpdate=a.autoUpdate,this}addLevel(a,b=0,c=0){let d;b=Math.abs(b);let e=this.levels;for(d=0;d<e.length&&!(b<e[d].distance);d++);return e.splice(d,0,{distance:b,hysteresis:c,object:a}),this.add(a),this}removeLevel(a){let b=this.levels;for(let c=0;c<b.length;c++)if(b[c].distance===a){let a=b.splice(c,1);return this.remove(a[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(a){let b=this.levels;if(b.length>0){let c,d;for(c=1,d=b.length;c<d;c++){let d=b[c].distance;if(b[c].object.visible&&(d-=d*b[c].hysteresis),a<d)break}return b[c-1].object}return null}raycast(a,b){if(this.levels.length>0){cz.setFromMatrixPosition(this.matrixWorld);let c=a.ray.origin.distanceTo(cz);this.getObjectForDistance(c).raycast(a,b)}}update(a){let b=this.levels;if(b.length>1){let c,d;cz.setFromMatrixPosition(a.matrixWorld),cA.setFromMatrixPosition(this.matrixWorld);let e=cz.distanceTo(cA)/a.zoom;for(c=1,b[0].object.visible=!0,d=b.length;c<d;c++){let a=b[c].distance;if(b[c].object.visible&&(a-=a*b[c].hysteresis),e>=a)b[c-1].object.visible=!1,b[c].object.visible=!0;else break}for(this._currentLevel=c-1;c<d;c++)b[c].object.visible=!1}}toJSON(a){let b=super.toJSON(a);!1===this.autoUpdate&&(b.object.autoUpdate=!1),b.object.levels=[];let c=this.levels;for(let a=0,d=c.length;a<d;a++){let d=c[a];b.object.levels.push({object:d.object.uuid,distance:d.distance,hysteresis:d.hysteresis})}return b}}let cC=new al,cD=new al,cE=new al,cF=new al,cG=new al,cH=new al,cI=new al;class cJ{constructor(a=new al,b=new al(0,0,-1)){this.origin=a,this.direction=b}set(a,b){return this.origin.copy(a),this.direction.copy(b),this}copy(a){return this.origin.copy(a.origin),this.direction.copy(a.direction),this}at(a,b){return b.copy(this.origin).addScaledVector(this.direction,a)}lookAt(a){return this.direction.copy(a).sub(this.origin).normalize(),this}recast(a){return this.origin.copy(this.at(a,cC)),this}closestPointToPoint(a,b){b.subVectors(a,this.origin);let c=b.dot(this.direction);return c<0?b.copy(this.origin):b.copy(this.origin).addScaledVector(this.direction,c)}distanceToPoint(a){return Math.sqrt(this.distanceSqToPoint(a))}distanceSqToPoint(a){let b=cC.subVectors(a,this.origin).dot(this.direction);return b<0?this.origin.distanceToSquared(a):(cC.copy(this.origin).addScaledVector(this.direction,b),cC.distanceToSquared(a))}distanceSqToSegment(a,b,c,d){let e,f,g,h;cD.copy(a).add(b).multiplyScalar(.5),cE.copy(b).sub(a).normalize(),cF.copy(this.origin).sub(cD);let i=.5*a.distanceTo(b),j=-this.direction.dot(cE),k=cF.dot(this.direction),l=-cF.dot(cE),m=cF.lengthSq(),n=Math.abs(1-j*j);if(n>0)if(e=j*l-k,f=j*k-l,h=i*n,e>=0)if(f>=-h)if(f<=h){let a=1/n;e*=a,f*=a,g=e*(e+j*f+2*k)+f*(j*e+f+2*l)+m}else g=-(e=Math.max(0,-(j*(f=i)+k)))*e+f*(f+2*l)+m;else g=-(e=Math.max(0,-(j*(f=-i)+k)))*e+f*(f+2*l)+m;else f<=-h?(f=(e=Math.max(0,-(-j*i+k)))>0?-i:Math.min(Math.max(-i,-l),i),g=-e*e+f*(f+2*l)+m):f<=h?(e=0,g=(f=Math.min(Math.max(-i,-l),i))*(f+2*l)+m):(f=(e=Math.max(0,-(j*i+k)))>0?i:Math.min(Math.max(-i,-l),i),g=-e*e+f*(f+2*l)+m);else f=j>0?-i:i,g=-(e=Math.max(0,-(j*f+k)))*e+f*(f+2*l)+m;return c&&c.copy(this.origin).addScaledVector(this.direction,e),d&&d.copy(cD).addScaledVector(cE,f),g}intersectSphere(a,b){cC.subVectors(a.center,this.origin);let c=cC.dot(this.direction),d=cC.dot(cC)-c*c,e=a.radius*a.radius;if(d>e)return null;let f=Math.sqrt(e-d),g=c-f,h=c+f;return h<0?null:g<0?this.at(h,b):this.at(g,b)}intersectsSphere(a){return!(a.radius<0)&&this.distanceSqToPoint(a.center)<=a.radius*a.radius}distanceToPlane(a){let b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;let c=-(this.origin.dot(a.normal)+a.constant)/b;return c>=0?c:null}intersectPlane(a,b){let c=this.distanceToPlane(a);return null===c?null:this.at(c,b)}intersectsPlane(a){let b=a.distanceToPoint(this.origin);return!!(0===b||a.normal.dot(this.direction)*b<0)}intersectBox(a,b){let c,d,e,f,g,h,i=1/this.direction.x,j=1/this.direction.y,k=1/this.direction.z,l=this.origin;return(i>=0?(c=(a.min.x-l.x)*i,d=(a.max.x-l.x)*i):(c=(a.max.x-l.x)*i,d=(a.min.x-l.x)*i),j>=0?(e=(a.min.y-l.y)*j,f=(a.max.y-l.y)*j):(e=(a.max.y-l.y)*j,f=(a.min.y-l.y)*j),c>f||e>d||((e>c||isNaN(c))&&(c=e),(f<d||isNaN(d))&&(d=f),k>=0?(g=(a.min.z-l.z)*k,h=(a.max.z-l.z)*k):(g=(a.max.z-l.z)*k,h=(a.min.z-l.z)*k),c>h||g>d||((g>c||c!=c)&&(c=g),(h<d||d!=d)&&(d=h),d<0)))?null:this.at(c>=0?c:d,b)}intersectsBox(a){return null!==this.intersectBox(a,cC)}intersectTriangle(a,b,c,d,e){let f;cG.subVectors(b,a),cH.subVectors(c,a),cI.crossVectors(cG,cH);let g=this.direction.dot(cI);if(g>0){if(d)return null;f=1}else{if(!(g<0))return null;f=-1,g=-g}cF.subVectors(this.origin,a);let h=f*this.direction.dot(cH.crossVectors(cF,cH));if(h<0)return null;let i=f*this.direction.dot(cG.cross(cF));if(i<0||h+i>g)return null;let j=-f*cF.dot(cI);return j<0?null:this.at(j/g,e)}applyMatrix4(a){return this.origin.applyMatrix4(a),this.direction.transformDirection(a),this}equals(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class cK extends cj{constructor(a){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new bg(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aT,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.map=a.map,this.lightMap=a.lightMap,this.lightMapIntensity=a.lightMapIntensity,this.aoMap=a.aoMap,this.aoMapIntensity=a.aoMapIntensity,this.specularMap=a.specularMap,this.alphaMap=a.alphaMap,this.envMap=a.envMap,this.envMapRotation.copy(a.envMapRotation),this.combine=a.combine,this.reflectivity=a.reflectivity,this.refractionRatio=a.refractionRatio,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.wireframeLinecap=a.wireframeLinecap,this.wireframeLinejoin=a.wireframeLinejoin,this.fog=a.fog,this}}let cL=new aJ,cM=new cJ,cN=new b6,cO=new al,cP=new al,cQ=new al,cR=new al,cS=new al,cT=new al,cU=new al,cV=new al;class cW extends a8{constructor(a=new ce,b=new cK){super(),this.isMesh=!0,this.type="Mesh",this.geometry=a,this.material=b,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(a,b){return super.copy(a,b),void 0!==a.morphTargetInfluences&&(this.morphTargetInfluences=a.morphTargetInfluences.slice()),void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary)),this.material=Array.isArray(a.material)?a.material.slice():a.material,this.geometry=a.geometry,this}updateMorphTargets(){let a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){let c=a[b[0]];if(void 0!==c){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,b=c.length;a<b;a++){let b=c[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[b]=a}}}}getVertexPosition(a,b){let c=this.geometry,d=c.attributes.position,e=c.morphAttributes.position,f=c.morphTargetsRelative;b.fromBufferAttribute(d,a);let g=this.morphTargetInfluences;if(e&&g){cT.set(0,0,0);for(let c=0,d=e.length;c<d;c++){let d=g[c],h=e[c];0!==d&&(cS.fromBufferAttribute(h,a),f?cT.addScaledVector(cS,d):cT.addScaledVector(cS.sub(b),d))}b.add(cT)}return b}raycast(a,b){let c=this.geometry,d=this.material,e=this.matrixWorld;void 0===d||(null===c.boundingSphere&&c.computeBoundingSphere(),cN.copy(c.boundingSphere),cN.applyMatrix4(e),cM.copy(a.ray).recast(a.near),!1===cN.containsPoint(cM.origin)&&(null===cM.intersectSphere(cN,cO)||cM.origin.distanceToSquared(cO)>(a.far-a.near)**2)||(cL.copy(e).invert(),cM.copy(a.ray).applyMatrix4(cL),(null===c.boundingBox||!1!==cM.intersectsBox(c.boundingBox))&&this._computeIntersections(a,b,cM)))}_computeIntersections(a,b,c){let d,e=this.geometry,f=this.material,g=e.index,h=e.attributes.position,i=e.attributes.uv,j=e.attributes.uv1,k=e.attributes.normal,l=e.groups,m=e.drawRange;if(null!==g)if(Array.isArray(f))for(let e=0,h=l.length;e<h;e++){let h=l[e],n=f[h.materialIndex],o=Math.max(h.start,m.start),p=Math.min(g.count,Math.min(h.start+h.count,m.start+m.count));for(let e=o;e<p;e+=3)(d=cX(this,n,a,c,i,j,k,g.getX(e),g.getX(e+1),g.getX(e+2)))&&(d.faceIndex=Math.floor(e/3),d.face.materialIndex=h.materialIndex,b.push(d))}else{let e=Math.max(0,m.start),h=Math.min(g.count,m.start+m.count);for(let l=e;l<h;l+=3)(d=cX(this,f,a,c,i,j,k,g.getX(l),g.getX(l+1),g.getX(l+2)))&&(d.faceIndex=Math.floor(l/3),b.push(d))}else if(void 0!==h)if(Array.isArray(f))for(let e=0,g=l.length;e<g;e++){let g=l[e],n=f[g.materialIndex],o=Math.max(g.start,m.start),p=Math.min(h.count,Math.min(g.start+g.count,m.start+m.count));for(let e=o;e<p;e+=3)(d=cX(this,n,a,c,i,j,k,e,e+1,e+2))&&(d.faceIndex=Math.floor(e/3),d.face.materialIndex=g.materialIndex,b.push(d))}else{let e=Math.max(0,m.start),g=Math.min(h.count,m.start+m.count);for(let h=e;h<g;h+=3)(d=cX(this,f,a,c,i,j,k,h,h+1,h+2))&&(d.faceIndex=Math.floor(h/3),b.push(d))}}}function cX(a,b,c,d,e,f,g,h,i,j){a.getVertexPosition(h,cP),a.getVertexPosition(i,cQ),a.getVertexPosition(j,cR);let k=function(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,0===b.side,h)))return null;cV.copy(h),cV.applyMatrix4(a.matrixWorld);let i=c.ray.origin.distanceTo(cV);return i<c.near||i>c.far?null:{distance:i,point:cV.clone(),object:a}}(a,b,c,d,cP,cQ,cR,cU);if(k){let a=new al;by.getBarycoord(cU,cP,cQ,cR,a),e&&(k.uv=by.getInterpolatedAttribute(e,h,i,j,a,new aj)),f&&(k.uv1=by.getInterpolatedAttribute(f,h,i,j,a,new aj)),g&&(k.normal=by.getInterpolatedAttribute(g,h,i,j,a,new al),k.normal.dot(d.direction)>0&&k.normal.multiplyScalar(-1));let b={a:h,b:i,c:j,normal:new al,materialIndex:0};by.getNormal(cP,cQ,cR,b.normal),k.face=b,k.barycoord=a}return k}let cY=new al,cZ=new aC,c$=new aC,c_=new al,c0=new aJ,c1=new al,c2=new b6,c3=new aJ,c4=new cJ;class c5 extends cW{constructor(a,b){super(a,b),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=y,this.bindMatrix=new aJ,this.bindMatrixInverse=new aJ,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let a=this.geometry;null===this.boundingBox&&(this.boundingBox=new bz),this.boundingBox.makeEmpty();let b=a.getAttribute("position");for(let a=0;a<b.count;a++)this.getVertexPosition(a,c1),this.boundingBox.expandByPoint(c1)}computeBoundingSphere(){let a=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new b6),this.boundingSphere.makeEmpty();let b=a.getAttribute("position");for(let a=0;a<b.count;a++)this.getVertexPosition(a,c1),this.boundingSphere.expandByPoint(c1)}copy(a,b){return super.copy(a,b),this.bindMode=a.bindMode,this.bindMatrix.copy(a.bindMatrix),this.bindMatrixInverse.copy(a.bindMatrixInverse),this.skeleton=a.skeleton,null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone()),null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone()),this}raycast(a,b){let c=this.material,d=this.matrixWorld;void 0===c||(null===this.boundingSphere&&this.computeBoundingSphere(),c2.copy(this.boundingSphere),c2.applyMatrix4(d),!1===a.ray.intersectsSphere(c2)||(c3.copy(d).invert(),c4.copy(a.ray).applyMatrix4(c3),(null===this.boundingBox||!1!==c4.intersectsBox(this.boundingBox))&&this._computeIntersections(a,b,c4)))}getVertexPosition(a,b){return super.getVertexPosition(a,b),this.applyBoneTransform(a,b),b}bind(a,b){this.skeleton=a,void 0===b&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),b=this.matrixWorld),this.bindMatrix.copy(b),this.bindMatrixInverse.copy(b).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let a=new aC,b=this.geometry.attributes.skinWeight;for(let c=0,d=b.count;c<d;c++){a.fromBufferAttribute(b,c);let d=1/a.manhattanLength();d!==1/0?a.multiplyScalar(d):a.set(1,0,0,0),b.setXYZW(c,a.x,a.y,a.z,a.w)}}updateMatrixWorld(a){super.updateMatrixWorld(a),this.bindMode===y?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===z?this.bindMatrixInverse.copy(this.bindMatrix).invert():U("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(a,b){let c=this.skeleton,d=this.geometry;cZ.fromBufferAttribute(d.attributes.skinIndex,a),c$.fromBufferAttribute(d.attributes.skinWeight,a),cY.copy(b).applyMatrix4(this.bindMatrix),b.set(0,0,0);for(let a=0;a<4;a++){let d=c$.getComponent(a);if(0!==d){let e=cZ.getComponent(a);c0.multiplyMatrices(c.bones[e].matrixWorld,c.boneInverses[e]),b.addScaledVector(c_.copy(cY).applyMatrix4(c0),d)}}return b.applyMatrix4(this.bindMatrixInverse)}}class c6 extends a8{constructor(){super(),this.isBone=!0,this.type="Bone"}}class c7 extends aB{constructor(a=null,b=1,c=1,d,e,f,g,h,i=1003,j=1003,k,l){super(null,f,g,h,i,j,d,e,k,l),this.isDataTexture=!0,this.image={data:a,width:b,height:c},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let c8=new aJ,c9=new aJ;class da{constructor(a=[],b=[]){this.uuid=ac(),this.bones=a.slice(0),this.boneInverses=b,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let a=this.bones,b=this.boneInverses;if(this.boneMatrices=new Float32Array(16*a.length),0===b.length)this.calculateInverses();else if(a.length!==b.length){U("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let a=0,b=this.bones.length;a<b;a++)this.boneInverses.push(new aJ)}}calculateInverses(){this.boneInverses.length=0;for(let a=0,b=this.bones.length;a<b;a++){let b=new aJ;this.bones[a]&&b.copy(this.bones[a].matrixWorld).invert(),this.boneInverses.push(b)}}pose(){for(let a=0,b=this.bones.length;a<b;a++){let b=this.bones[a];b&&b.matrixWorld.copy(this.boneInverses[a]).invert()}for(let a=0,b=this.bones.length;a<b;a++){let b=this.bones[a];b&&(b.parent&&b.parent.isBone?(b.matrix.copy(b.parent.matrixWorld).invert(),b.matrix.multiply(b.matrixWorld)):b.matrix.copy(b.matrixWorld),b.matrix.decompose(b.position,b.quaternion,b.scale))}}update(){let a=this.bones,b=this.boneInverses,c=this.boneMatrices,d=this.boneTexture;for(let d=0,e=a.length;d<e;d++){let e=a[d]?a[d].matrixWorld:c9;c8.multiplyMatrices(e,b[d]),c8.toArray(c,16*d)}null!==d&&(d.needsUpdate=!0)}clone(){return new da(this.bones,this.boneInverses)}computeBoneTexture(){let a=Math.sqrt(4*this.bones.length),b=new Float32Array((a=Math.max(a=4*Math.ceil(a/4),4))*a*4);b.set(this.boneMatrices);let c=new c7(b,a,a,1023,1015);return c.needsUpdate=!0,this.boneMatrices=b,this.boneTexture=c,this}getBoneByName(a){for(let b=0,c=this.bones.length;b<c;b++){let c=this.bones[b];if(c.name===a)return c}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(a,b){this.uuid=a.uuid;for(let c=0,d=a.bones.length;c<d;c++){let d=a.bones[c],e=b[d];void 0===e&&(U("Skeleton: No bone found with UUID:",d),e=new c6),this.bones.push(e),this.boneInverses.push(new aJ().fromArray(a.boneInverses[c]))}return this.init(),this}toJSON(){let a={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};a.uuid=this.uuid;let b=this.bones,c=this.boneInverses;for(let d=0,e=b.length;d<e;d++){let e=b[d];a.bones.push(e.uuid);let f=c[d];a.boneInverses.push(f.toArray())}return a}}class db extends bV{constructor(a,b,c,d=1){super(a,b,c),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=d}copy(a){return super.copy(a),this.meshPerAttribute=a.meshPerAttribute,this}toJSON(){let a=super.toJSON();return a.meshPerAttribute=this.meshPerAttribute,a.isInstancedBufferAttribute=!0,a}}let dc=new aJ,dd=new aJ,de=[],df=new bz,dg=new aJ,dh=new cW,di=new b6;class dj extends cW{constructor(a,b,c){super(a,b),this.isInstancedMesh=!0,this.instanceMatrix=new db(new Float32Array(16*c),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=c,this.boundingBox=null,this.boundingSphere=null;for(let a=0;a<c;a++)this.setMatrixAt(a,dg)}computeBoundingBox(){let a=this.geometry,b=this.count;null===this.boundingBox&&(this.boundingBox=new bz),null===a.boundingBox&&a.computeBoundingBox(),this.boundingBox.makeEmpty();for(let c=0;c<b;c++)this.getMatrixAt(c,dc),df.copy(a.boundingBox).applyMatrix4(dc),this.boundingBox.union(df)}computeBoundingSphere(){let a=this.geometry,b=this.count;null===this.boundingSphere&&(this.boundingSphere=new b6),null===a.boundingSphere&&a.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let c=0;c<b;c++)this.getMatrixAt(c,dc),di.copy(a.boundingSphere).applyMatrix4(dc),this.boundingSphere.union(di)}copy(a,b){return super.copy(a,b),this.instanceMatrix.copy(a.instanceMatrix),null!==a.previousInstanceMatrix&&(this.previousInstanceMatrix=a.previousInstanceMatrix.clone()),null!==a.morphTexture&&(this.morphTexture=a.morphTexture.clone()),null!==a.instanceColor&&(this.instanceColor=a.instanceColor.clone()),this.count=a.count,null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone()),null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone()),this}getColorAt(a,b){b.fromArray(this.instanceColor.array,3*a)}getMatrixAt(a,b){b.fromArray(this.instanceMatrix.array,16*a)}getMorphAt(a,b){let c=b.morphTargetInfluences,d=this.morphTexture.source.data.data,e=a*(c.length+1)+1;for(let a=0;a<c.length;a++)c[a]=d[e+a]}raycast(a,b){let c=this.matrixWorld,d=this.count;if((dh.geometry=this.geometry,dh.material=this.material,void 0!==dh.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),di.copy(this.boundingSphere),di.applyMatrix4(c),!1!==a.ray.intersectsSphere(di)))for(let e=0;e<d;e++){this.getMatrixAt(e,dc),dd.multiplyMatrices(c,dc),dh.matrixWorld=dd,dh.raycast(a,de);for(let a=0,c=de.length;a<c;a++){let c=de[a];c.instanceId=e,c.object=this,b.push(c)}de.length=0}}setColorAt(a,b){null===this.instanceColor&&(this.instanceColor=new db(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),b.toArray(this.instanceColor.array,3*a)}setMatrixAt(a,b){b.toArray(this.instanceMatrix.array,16*a)}setMorphAt(a,b){let c=b.morphTargetInfluences,d=c.length+1;null===this.morphTexture&&(this.morphTexture=new c7(new Float32Array(d*this.count),d,this.count,1028,1015));let e=this.morphTexture.source.data.data,f=0;for(let a=0;a<c.length;a++)f+=c[a];let g=this.geometry.morphTargetsRelative?1:1-f,h=d*a;e[h]=g,e.set(c,h+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let dk=new al,dl=new al,dm=new ao;class dn{constructor(a=new al(1,0,0),b=0){this.isPlane=!0,this.normal=a,this.constant=b}set(a,b){return this.normal.copy(a),this.constant=b,this}setComponents(a,b,c,d){return this.normal.set(a,b,c),this.constant=d,this}setFromNormalAndCoplanarPoint(a,b){return this.normal.copy(a),this.constant=-b.dot(this.normal),this}setFromCoplanarPoints(a,b,c){let d=dk.subVectors(c,b).cross(dl.subVectors(a,b)).normalize();return this.setFromNormalAndCoplanarPoint(d,a),this}copy(a){return this.normal.copy(a.normal),this.constant=a.constant,this}normalize(){let a=1/this.normal.length();return this.normal.multiplyScalar(a),this.constant*=a,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(a){return this.normal.dot(a)+this.constant}distanceToSphere(a){return this.distanceToPoint(a.center)-a.radius}projectPoint(a,b){return b.copy(a).addScaledVector(this.normal,-this.distanceToPoint(a))}intersectLine(a,b){let c=a.delta(dk),d=this.normal.dot(c);if(0===d)return 0===this.distanceToPoint(a.start)?b.copy(a.start):null;let e=-(a.start.dot(this.normal)+this.constant)/d;return e<0||e>1?null:b.copy(a.start).addScaledVector(c,e)}intersectsLine(a){let b=this.distanceToPoint(a.start),c=this.distanceToPoint(a.end);return b<0&&c>0||c<0&&b>0}intersectsBox(a){return a.intersectsPlane(this)}intersectsSphere(a){return a.intersectsPlane(this)}coplanarPoint(a){return a.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(a,b){let c=b||dm.getNormalMatrix(a),d=this.coplanarPoint(dk).applyMatrix4(a),e=this.normal.applyMatrix3(c).normalize();return this.constant=-d.dot(e),this}translate(a){return this.constant-=a.dot(this.normal),this}equals(a){return a.normal.equals(this.normal)&&a.constant===this.constant}clone(){return new this.constructor().copy(this)}}let dp=new b6,dq=new aj(.5,.5),dr=new al;class ds{constructor(a=new dn,b=new dn,c=new dn,d=new dn,e=new dn,f=new dn){this.planes=[a,b,c,d,e,f]}set(a,b,c,d,e,f){let g=this.planes;return g[0].copy(a),g[1].copy(b),g[2].copy(c),g[3].copy(d),g[4].copy(e),g[5].copy(f),this}copy(a){let b=this.planes;for(let c=0;c<6;c++)b[c].copy(a.planes[c]);return this}setFromProjectionMatrix(a,b=2e3,c=!1){let d=this.planes,e=a.elements,f=e[0],g=e[1],h=e[2],i=e[3],j=e[4],k=e[5],l=e[6],m=e[7],n=e[8],o=e[9],p=e[10],q=e[11],r=e[12],s=e[13],t=e[14],u=e[15];if(d[0].setComponents(i-f,m-j,q-n,u-r).normalize(),d[1].setComponents(i+f,m+j,q+n,u+r).normalize(),d[2].setComponents(i+g,m+k,q+o,u+s).normalize(),d[3].setComponents(i-g,m-k,q-o,u-s).normalize(),c)d[4].setComponents(h,l,p,t).normalize(),d[5].setComponents(i-h,m-l,q-p,u-t).normalize();else if(d[4].setComponents(i-h,m-l,q-p,u-t).normalize(),2e3===b)d[5].setComponents(i+h,m+l,q+p,u+t).normalize();else if(2001===b)d[5].setComponents(h,l,p,t).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+b);return this}intersectsObject(a){if(void 0!==a.boundingSphere)null===a.boundingSphere&&a.computeBoundingSphere(),dp.copy(a.boundingSphere).applyMatrix4(a.matrixWorld);else{let b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere(),dp.copy(b.boundingSphere).applyMatrix4(a.matrixWorld)}return this.intersectsSphere(dp)}intersectsSprite(a){return dp.center.set(0,0,0),dp.radius=.7071067811865476+dq.distanceTo(a.center),dp.applyMatrix4(a.matrixWorld),this.intersectsSphere(dp)}intersectsSphere(a){let b=this.planes,c=a.center,d=-a.radius;for(let a=0;a<6;a++)if(b[a].distanceToPoint(c)<d)return!1;return!0}intersectsBox(a){let b=this.planes;for(let c=0;c<6;c++){let d=b[c];if(dr.x=d.normal.x>0?a.max.x:a.min.x,dr.y=d.normal.y>0?a.max.y:a.min.y,dr.z=d.normal.z>0?a.max.z:a.min.z,0>d.distanceToPoint(dr))return!1}return!0}containsPoint(a){let b=this.planes;for(let c=0;c<6;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}clone(){return new this.constructor().copy(this)}}let dt=new aJ,du=new ds;class dv{constructor(){this.coordinateSystem=2e3}intersectsObject(a,b){if(!b.isArrayCamera||0===b.cameras.length)return!1;for(let c=0;c<b.cameras.length;c++){let d=b.cameras[c];if(dt.multiplyMatrices(d.projectionMatrix,d.matrixWorldInverse),du.setFromProjectionMatrix(dt,d.coordinateSystem,d.reversedDepth),du.intersectsObject(a))return!0}return!1}intersectsSprite(a,b){if(!b||!b.cameras||0===b.cameras.length)return!1;for(let c=0;c<b.cameras.length;c++){let d=b.cameras[c];if(dt.multiplyMatrices(d.projectionMatrix,d.matrixWorldInverse),du.setFromProjectionMatrix(dt,d.coordinateSystem,d.reversedDepth),du.intersectsSprite(a))return!0}return!1}intersectsSphere(a,b){if(!b||!b.cameras||0===b.cameras.length)return!1;for(let c=0;c<b.cameras.length;c++){let d=b.cameras[c];if(dt.multiplyMatrices(d.projectionMatrix,d.matrixWorldInverse),du.setFromProjectionMatrix(dt,d.coordinateSystem,d.reversedDepth),du.intersectsSphere(a))return!0}return!1}intersectsBox(a,b){if(!b||!b.cameras||0===b.cameras.length)return!1;for(let c=0;c<b.cameras.length;c++){let d=b.cameras[c];if(dt.multiplyMatrices(d.projectionMatrix,d.matrixWorldInverse),du.setFromProjectionMatrix(dt,d.coordinateSystem,d.reversedDepth),du.intersectsBox(a))return!0}return!1}containsPoint(a,b){if(!b||!b.cameras||0===b.cameras.length)return!1;for(let c=0;c<b.cameras.length;c++){let d=b.cameras[c];if(dt.multiplyMatrices(d.projectionMatrix,d.matrixWorldInverse),du.setFromProjectionMatrix(dt,d.coordinateSystem,d.reversedDepth),du.containsPoint(a))return!0}return!1}clone(){return new dv}}function dw(a,b){return a-b}function dx(a,b){return a.z-b.z}function dy(a,b){return b.z-a.z}let dz=new aJ,dA=new bg(1,1,1),dB=new ds,dC=new dv,dD=new bz,dE=new b6,dF=new al,dG=new al,dH=new al,dI=new class{constructor(){this.index=0,this.pool=[],this.list=[]}push(a,b,c,d){let e=this.pool,f=this.list;this.index>=e.length&&e.push({start:-1,count:-1,z:-1,index:-1});let g=e[this.index];f.push(g),this.index++,g.start=a,g.count=b,g.z=c,g.index=d}reset(){this.list.length=0,this.index=0}},dJ=new cW,dK=[];function dL(a,b){if(a.constructor!==b.constructor){let c=Math.min(a.length,b.length);for(let d=0;d<c;d++)b[d]=a[d]}else{let c=Math.min(a.length,b.length);b.set(new a.constructor(a.buffer,0,c))}}class dM extends cW{constructor(a,b,c=2*b,d){super(new ce,d),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=a,this._maxVertexCount=b,this._maxIndexCount=c,this._multiDrawCounts=new Int32Array(a),this._multiDrawStarts=new Int32Array(a),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let a=Math.sqrt(4*this._maxInstanceCount),b=new c7(new Float32Array((a=Math.max(a=4*Math.ceil(a/4),4))*a*4),a,a,1023,1015);this._matricesTexture=b}_initIndirectTexture(){let a=Math.sqrt(this._maxInstanceCount),b=new c7(new Uint32Array((a=Math.ceil(a))*a),a,a,1029,1014);this._indirectTexture=b}_initColorsTexture(){let a=Math.sqrt(this._maxInstanceCount),b=new c7(new Float32Array((a=Math.ceil(a))*a*4).fill(1),a,a,1023,1015);b.colorSpace=as.workingColorSpace,this._colorsTexture=b}_initializeGeometry(a){let b=this.geometry,c=this._maxVertexCount,d=this._maxIndexCount;if(!1===this._geometryInitialized){for(let d in a.attributes){let{array:e,itemSize:f,normalized:g}=a.getAttribute(d),h=new bV(new e.constructor(c*f),f,g);b.setAttribute(d,h)}if(null!==a.getIndex()){let a=c>65535?new Uint32Array(d):new Uint16Array(d);b.setIndex(new bV(a,1))}this._geometryInitialized=!0}}_validateGeometry(a){let b=this.geometry;if(!!a.getIndex()!=!!b.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let c in b.attributes){if(!a.hasAttribute(c))throw Error(`THREE.BatchedMesh: Added geometry missing "${c}". All geometries must have consistent attributes.`);let d=a.getAttribute(c),e=b.getAttribute(c);if(d.itemSize!==e.itemSize||d.normalized!==e.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(a){let b=this._instanceInfo;if(a<0||a>=b.length||!1===b[a].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${a}. Instance is either out of range or has been deleted.`)}validateGeometryId(a){let b=this._geometryInfo;if(a<0||a>=b.length||!1===b[a].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${a}. Geometry is either out of range or has been deleted.`)}setCustomSort(a){return this.customSort=a,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new bz);let a=this.boundingBox,b=this._instanceInfo;a.makeEmpty();for(let c=0,d=b.length;c<d;c++){if(!1===b[c].active)continue;let d=b[c].geometryIndex;this.getMatrixAt(c,dz),this.getBoundingBoxAt(d,dD).applyMatrix4(dz),a.union(dD)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new b6);let a=this.boundingSphere,b=this._instanceInfo;a.makeEmpty();for(let c=0,d=b.length;c<d;c++){if(!1===b[c].active)continue;let d=b[c].geometryIndex;this.getMatrixAt(c,dz),this.getBoundingSphereAt(d,dE).applyMatrix4(dz),a.union(dE)}}addInstance(a){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let b={visible:!0,active:!0,geometryIndex:a},c=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(dw),c=this._availableInstanceIds.shift(),this._instanceInfo[c]=b):(c=this._instanceInfo.length,this._instanceInfo.push(b));let d=this._matricesTexture;dz.identity().toArray(d.image.data,16*c),d.needsUpdate=!0;let e=this._colorsTexture;return e&&(dA.toArray(e.image.data,4*c),e.needsUpdate=!0),this._visibilityChanged=!0,c}addGeometry(a,b=-1,c=-1){let d;this._initializeGeometry(a),this._validateGeometry(a);let e={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},f=this._geometryInfo;e.vertexStart=this._nextVertexStart,e.reservedVertexCount=-1===b?a.getAttribute("position").count:b;let g=a.getIndex();if(null!==g&&(e.indexStart=this._nextIndexStart,e.reservedIndexCount=-1===c?g.count:c),-1!==e.indexStart&&e.indexStart+e.reservedIndexCount>this._maxIndexCount||e.vertexStart+e.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(dw),f[d=this._availableGeometryIds.shift()]=e):(d=this._geometryCount,this._geometryCount++,f.push(e)),this.setGeometryAt(d,a),this._nextIndexStart=e.indexStart+e.reservedIndexCount,this._nextVertexStart=e.vertexStart+e.reservedVertexCount,d}setGeometryAt(a,b){if(a>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(b);let c=this.geometry,d=null!==c.getIndex(),e=c.getIndex(),f=b.getIndex(),g=this._geometryInfo[a];if(d&&f.count>g.reservedIndexCount||b.attributes.position.count>g.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let h=g.vertexStart,i=g.reservedVertexCount;for(let a in g.vertexCount=b.getAttribute("position").count,c.attributes){let d=b.getAttribute(a),e=c.getAttribute(a);!function(a,b,c=0){let d=b.itemSize;if(a.isInterleavedBufferAttribute||a.array.constructor!==b.array.constructor){let e=a.count;for(let f=0;f<e;f++)for(let e=0;e<d;e++)b.setComponent(f+c,e,a.getComponent(f,e))}else b.array.set(a.array,c*d);b.needsUpdate=!0}(d,e,h);let f=d.itemSize;for(let a=d.count;a<i;a++){let b=h+a;for(let a=0;a<f;a++)e.setComponent(b,a,0)}e.needsUpdate=!0,e.addUpdateRange(h*f,i*f)}if(d){let a=g.indexStart,c=g.reservedIndexCount;g.indexCount=b.getIndex().count;for(let b=0;b<f.count;b++)e.setX(a+b,h+f.getX(b));for(let b=f.count;b<c;b++)e.setX(a+b,h);e.needsUpdate=!0,e.addUpdateRange(a,g.reservedIndexCount)}return g.start=d?g.indexStart:g.vertexStart,g.count=d?g.indexCount:g.vertexCount,g.boundingBox=null,null!==b.boundingBox&&(g.boundingBox=b.boundingBox.clone()),g.boundingSphere=null,null!==b.boundingSphere&&(g.boundingSphere=b.boundingSphere.clone()),this._visibilityChanged=!0,a}deleteGeometry(a){let b=this._geometryInfo;if(a>=b.length||!1===b[a].active)return this;let c=this._instanceInfo;for(let b=0,d=c.length;b<d;b++)c[b].active&&c[b].geometryIndex===a&&this.deleteInstance(b);return b[a].active=!1,this._availableGeometryIds.push(a),this._visibilityChanged=!0,this}deleteInstance(a){return this.validateInstanceId(a),this._instanceInfo[a].active=!1,this._availableInstanceIds.push(a),this._visibilityChanged=!0,this}optimize(){let a=0,b=0,c=this._geometryInfo,d=c.map((a,b)=>b).sort((a,b)=>c[a].vertexStart-c[b].vertexStart),e=this.geometry;for(let f=0,g=c.length;f<g;f++){let g=c[d[f]];if(!1!==g.active){if(null!==e.index){if(g.indexStart!==b){let{indexStart:c,vertexStart:d,reservedIndexCount:f}=g,h=e.index,i=h.array,j=a-d;for(let a=c;a<c+f;a++)i[a]=i[a]+j;h.array.copyWithin(b,c,c+f),h.addUpdateRange(b,f),h.needsUpdate=!0,g.indexStart=b}b+=g.reservedIndexCount}if(g.vertexStart!==a){let{vertexStart:b,reservedVertexCount:c}=g,d=e.attributes;for(let e in d){let f=d[e],{array:g,itemSize:h}=f;g.copyWithin(a*h,b*h,(b+c)*h),f.addUpdateRange(a*h,c*h),f.needsUpdate=!0}g.vertexStart=a}a+=g.reservedVertexCount,g.start=e.index?g.indexStart:g.vertexStart}}return this._nextIndexStart=b,this._nextVertexStart=a,this._visibilityChanged=!0,this}getBoundingBoxAt(a,b){if(a>=this._geometryCount)return null;let c=this.geometry,d=this._geometryInfo[a];if(null===d.boundingBox){let a=new bz,b=c.index,e=c.attributes.position;for(let c=d.start,f=d.start+d.count;c<f;c++){let d=c;b&&(d=b.getX(d)),a.expandByPoint(dF.fromBufferAttribute(e,d))}d.boundingBox=a}return b.copy(d.boundingBox),b}getBoundingSphereAt(a,b){if(a>=this._geometryCount)return null;let c=this.geometry,d=this._geometryInfo[a];if(null===d.boundingSphere){let b=new b6;this.getBoundingBoxAt(a,dD),dD.getCenter(b.center);let e=c.index,f=c.attributes.position,g=0;for(let a=d.start,c=d.start+d.count;a<c;a++){let c=a;e&&(c=e.getX(c)),dF.fromBufferAttribute(f,c),g=Math.max(g,b.center.distanceToSquared(dF))}b.radius=Math.sqrt(g),d.boundingSphere=b}return b.copy(d.boundingSphere),b}setMatrixAt(a,b){this.validateInstanceId(a);let c=this._matricesTexture,d=this._matricesTexture.image.data;return b.toArray(d,16*a),c.needsUpdate=!0,this}getMatrixAt(a,b){return this.validateInstanceId(a),b.fromArray(this._matricesTexture.image.data,16*a)}setColorAt(a,b){return this.validateInstanceId(a),null===this._colorsTexture&&this._initColorsTexture(),b.toArray(this._colorsTexture.image.data,4*a),this._colorsTexture.needsUpdate=!0,this}getColorAt(a,b){return this.validateInstanceId(a),b.fromArray(this._colorsTexture.image.data,4*a)}setVisibleAt(a,b){return this.validateInstanceId(a),this._instanceInfo[a].visible===b||(this._instanceInfo[a].visible=b,this._visibilityChanged=!0),this}getVisibleAt(a){return this.validateInstanceId(a),this._instanceInfo[a].visible}setGeometryIdAt(a,b){return this.validateInstanceId(a),this.validateGeometryId(b),this._instanceInfo[a].geometryIndex=b,this}getGeometryIdAt(a){return this.validateInstanceId(a),this._instanceInfo[a].geometryIndex}getGeometryRangeAt(a,b={}){this.validateGeometryId(a);let c=this._geometryInfo[a];return b.vertexStart=c.vertexStart,b.vertexCount=c.vertexCount,b.reservedVertexCount=c.reservedVertexCount,b.indexStart=c.indexStart,b.indexCount=c.indexCount,b.reservedIndexCount=c.reservedIndexCount,b.start=c.start,b.count=c.count,b}setInstanceCount(a){let b=this._availableInstanceIds,c=this._instanceInfo;for(b.sort(dw);b[b.length-1]===c.length-1;)c.pop(),b.pop();if(a<c.length)throw Error(`BatchedMesh: Instance ids outside the range ${a} are being used. Cannot shrink instance count.`);let d=new Int32Array(a),e=new Int32Array(a);dL(this._multiDrawCounts,d),dL(this._multiDrawStarts,e),this._multiDrawCounts=d,this._multiDrawStarts=e,this._maxInstanceCount=a;let f=this._indirectTexture,g=this._matricesTexture,h=this._colorsTexture;f.dispose(),this._initIndirectTexture(),dL(f.image.data,this._indirectTexture.image.data),g.dispose(),this._initMatricesTexture(),dL(g.image.data,this._matricesTexture.image.data),h&&(h.dispose(),this._initColorsTexture(),dL(h.image.data,this._colorsTexture.image.data))}setGeometrySize(a,b){let c=[...this._geometryInfo].filter(a=>a.active);if(Math.max(...c.map(a=>a.vertexStart+a.reservedVertexCount))>a)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${b}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...c.map(a=>a.indexStart+a.reservedIndexCount))>b)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${b}. Cannot shrink further.`);let d=this.geometry;d.dispose(),this._maxVertexCount=a,this._maxIndexCount=b,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new ce,this._initializeGeometry(d));let e=this.geometry;for(let a in d.index&&dL(d.index.array,e.index.array),d.attributes)dL(d.attributes[a].array,e.attributes[a].array)}raycast(a,b){let c=this._instanceInfo,d=this._geometryInfo,e=this.matrixWorld,f=this.geometry;dJ.material=this.material,dJ.geometry.index=f.index,dJ.geometry.attributes=f.attributes,null===dJ.geometry.boundingBox&&(dJ.geometry.boundingBox=new bz),null===dJ.geometry.boundingSphere&&(dJ.geometry.boundingSphere=new b6);for(let f=0,g=c.length;f<g;f++){if(!c[f].visible||!c[f].active)continue;let g=c[f].geometryIndex,h=d[g];dJ.geometry.setDrawRange(h.start,h.count),this.getMatrixAt(f,dJ.matrixWorld).premultiply(e),this.getBoundingBoxAt(g,dJ.geometry.boundingBox),this.getBoundingSphereAt(g,dJ.geometry.boundingSphere),dJ.raycast(a,dK);for(let a=0,c=dK.length;a<c;a++){let c=dK[a];c.object=this,c.batchId=f,b.push(c)}dK.length=0}dJ.material=null,dJ.geometry.index=null,dJ.geometry.attributes={},dJ.geometry.setDrawRange(0,1/0)}copy(a){return super.copy(a),this.geometry=a.geometry.clone(),this.perObjectFrustumCulled=a.perObjectFrustumCulled,this.sortObjects=a.sortObjects,this.boundingBox=null!==a.boundingBox?a.boundingBox.clone():null,this.boundingSphere=null!==a.boundingSphere?a.boundingSphere.clone():null,this._geometryInfo=a._geometryInfo.map(a=>({...a,boundingBox:null!==a.boundingBox?a.boundingBox.clone():null,boundingSphere:null!==a.boundingSphere?a.boundingSphere.clone():null})),this._instanceInfo=a._instanceInfo.map(a=>({...a})),this._availableInstanceIds=a._availableInstanceIds.slice(),this._availableGeometryIds=a._availableGeometryIds.slice(),this._nextIndexStart=a._nextIndexStart,this._nextVertexStart=a._nextVertexStart,this._geometryCount=a._geometryCount,this._maxInstanceCount=a._maxInstanceCount,this._maxVertexCount=a._maxVertexCount,this._maxIndexCount=a._maxIndexCount,this._geometryInitialized=a._geometryInitialized,this._multiDrawCounts=a._multiDrawCounts.slice(),this._multiDrawStarts=a._multiDrawStarts.slice(),this._indirectTexture=a._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=a._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=a._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(a,b,c,d,e){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let f=d.getIndex(),g=null===f?1:f.array.BYTES_PER_ELEMENT,h=1;e.wireframe&&(h=2,g=d.attributes.position.count>65535?4:2);let i=this._instanceInfo,j=this._multiDrawStarts,k=this._multiDrawCounts,l=this._geometryInfo,m=this.perObjectFrustumCulled,n=this._indirectTexture,o=n.image.data,p=c.isArrayCamera?dC:dB;m&&!c.isArrayCamera&&(dz.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse).multiply(this.matrixWorld),dB.setFromProjectionMatrix(dz,c.coordinateSystem,c.reversedDepth));let q=0;if(this.sortObjects){dz.copy(this.matrixWorld).invert(),dF.setFromMatrixPosition(c.matrixWorld).applyMatrix4(dz),dG.set(0,0,-1).transformDirection(c.matrixWorld).transformDirection(dz);for(let a=0,b=i.length;a<b;a++)if(i[a].visible&&i[a].active){let b=i[a].geometryIndex;this.getMatrixAt(a,dz),this.getBoundingSphereAt(b,dE).applyMatrix4(dz);let d=!1;if(m&&(d=!p.intersectsSphere(dE,c)),!d){let c=l[b],d=dH.subVectors(dE.center,dF).dot(dG);dI.push(c.start,c.count,d,a)}}let a=dI.list,b=this.customSort;null===b?a.sort(e.transparent?dy:dx):b.call(this,a,c);for(let b=0,c=a.length;b<c;b++){let c=a[b];j[q]=c.start*g*h,k[q]=c.count*h,o[q]=c.index,q++}dI.reset()}else for(let a=0,b=i.length;a<b;a++)if(i[a].visible&&i[a].active){let b=i[a].geometryIndex,d=!1;if(m&&(this.getMatrixAt(a,dz),this.getBoundingSphereAt(b,dE).applyMatrix4(dz),d=!p.intersectsSphere(dE,c)),!d){let c=l[b];j[q]=c.start*g*h,k[q]=c.count*h,o[q]=a,q++}}n.needsUpdate=!0,this._multiDrawCount=q,this._visibilityChanged=!1}onBeforeShadow(a,b,c,d,e,f){this.onBeforeRender(a,null,d,e,f)}}class dN extends cj{constructor(a){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new bg(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.map=a.map,this.linewidth=a.linewidth,this.linecap=a.linecap,this.linejoin=a.linejoin,this.fog=a.fog,this}}let dO=new al,dP=new al,dQ=new aJ,dR=new cJ,dS=new b6,dT=new al,dU=new al;class dV extends a8{constructor(a=new ce,b=new dN){super(),this.isLine=!0,this.type="Line",this.geometry=a,this.material=b,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(a,b){return super.copy(a,b),this.material=Array.isArray(a.material)?a.material.slice():a.material,this.geometry=a.geometry,this}computeLineDistances(){let a=this.geometry;if(null===a.index){let b=a.attributes.position,c=[0];for(let a=1,d=b.count;a<d;a++)dO.fromBufferAttribute(b,a-1),dP.fromBufferAttribute(b,a),c[a]=c[a-1],c[a]+=dO.distanceTo(dP);a.setAttribute("lineDistance",new b2(c,1))}else U("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(a,b){let c=this.geometry,d=this.matrixWorld,e=a.params.Line.threshold,f=c.drawRange;if(null===c.boundingSphere&&c.computeBoundingSphere(),dS.copy(c.boundingSphere),dS.applyMatrix4(d),dS.radius+=e,!1===a.ray.intersectsSphere(dS))return;dQ.copy(d).invert(),dR.copy(a.ray).applyMatrix4(dQ);let g=e/((this.scale.x+this.scale.y+this.scale.z)/3),h=g*g,i=this.isLineSegments?2:1,j=c.index,k=c.attributes.position;if(null!==j){let c=Math.max(0,f.start),d=Math.min(j.count,f.start+f.count);for(let e=c,f=d-1;e<f;e+=i){let c=dW(this,a,dR,h,j.getX(e),j.getX(e+1),e);c&&b.push(c)}if(this.isLineLoop){let e=dW(this,a,dR,h,j.getX(d-1),j.getX(c),d-1);e&&b.push(e)}}else{let c=Math.max(0,f.start),d=Math.min(k.count,f.start+f.count);for(let e=c,f=d-1;e<f;e+=i){let c=dW(this,a,dR,h,e,e+1,e);c&&b.push(c)}if(this.isLineLoop){let e=dW(this,a,dR,h,d-1,c,d-1);e&&b.push(e)}}}updateMorphTargets(){let a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){let c=a[b[0]];if(void 0!==c){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,b=c.length;a<b;a++){let b=c[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[b]=a}}}}}function dW(a,b,c,d,e,f,g){let h=a.geometry.attributes.position;if(dO.fromBufferAttribute(h,e),dP.fromBufferAttribute(h,f),c.distanceSqToSegment(dO,dP,dT,dU)>d)return;dT.applyMatrix4(a.matrixWorld);let i=b.ray.origin.distanceTo(dT);if(!(i<b.near)&&!(i>b.far))return{distance:i,point:dU.clone().applyMatrix4(a.matrixWorld),index:g,face:null,faceIndex:null,barycoord:null,object:a}}let dX=new al,dY=new al;class dZ extends dV{constructor(a,b){super(a,b),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let a=this.geometry;if(null===a.index){let b=a.attributes.position,c=[];for(let a=0,d=b.count;a<d;a+=2)dX.fromBufferAttribute(b,a),dY.fromBufferAttribute(b,a+1),c[a]=0===a?0:c[a-1],c[a+1]=c[a]+dX.distanceTo(dY);a.setAttribute("lineDistance",new b2(c,1))}else U("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class d$ extends dV{constructor(a,b){super(a,b),this.isLineLoop=!0,this.type="LineLoop"}}class d_ extends cj{constructor(a){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new bg(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.map=a.map,this.alphaMap=a.alphaMap,this.size=a.size,this.sizeAttenuation=a.sizeAttenuation,this.fog=a.fog,this}}let d0=new aJ,d1=new cJ,d2=new b6,d3=new al;class d4 extends a8{constructor(a=new ce,b=new d_){super(),this.isPoints=!0,this.type="Points",this.geometry=a,this.material=b,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(a,b){return super.copy(a,b),this.material=Array.isArray(a.material)?a.material.slice():a.material,this.geometry=a.geometry,this}raycast(a,b){let c=this.geometry,d=this.matrixWorld,e=a.params.Points.threshold,f=c.drawRange;if(null===c.boundingSphere&&c.computeBoundingSphere(),d2.copy(c.boundingSphere),d2.applyMatrix4(d),d2.radius+=e,!1===a.ray.intersectsSphere(d2))return;d0.copy(d).invert(),d1.copy(a.ray).applyMatrix4(d0);let g=e/((this.scale.x+this.scale.y+this.scale.z)/3),h=g*g,i=c.index,j=c.attributes.position;if(null!==i){let c=Math.max(0,f.start),e=Math.min(i.count,f.start+f.count);for(let f=c;f<e;f++){let c=i.getX(f);d3.fromBufferAttribute(j,c),d5(d3,c,h,d,a,b,this)}}else{let c=Math.max(0,f.start),e=Math.min(j.count,f.start+f.count);for(let f=c;f<e;f++)d3.fromBufferAttribute(j,f),d5(d3,f,h,d,a,b,this)}}updateMorphTargets(){let a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){let c=a[b[0]];if(void 0!==c){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,b=c.length;a<b;a++){let b=c[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[b]=a}}}}}function d5(a,b,c,d,e,f,g){let h=d1.distanceSqToPoint(a);if(h<c){let c=new al;d1.closestPointToPoint(a,c),c.applyMatrix4(d);let i=e.ray.origin.distanceTo(c);if(i<e.near||i>e.far)return;f.push({distance:i,distanceToRay:Math.sqrt(h),point:c,index:b,face:null,faceIndex:null,barycoord:null,object:g})}}class d6 extends aB{constructor(a,b,c,d,e=1006,f=1006,g,h,i){super(a,b,c,d,e,f,g,h,i),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const j=this;"requestVideoFrameCallback"in a&&(this._requestVideoFrameCallbackId=a.requestVideoFrameCallback(function b(){j.needsUpdate=!0,j._requestVideoFrameCallbackId=a.requestVideoFrameCallback(b)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let a=this.image;!1=="requestVideoFrameCallback"in a&&a.readyState>=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class d7 extends d6{constructor(a,b,c,d,e,f,g,h){super({},a,b,c,d,e,f,g,h),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(a){this.image=a,this.needsUpdate=!0}}class d8 extends aB{constructor(a,b){super({width:a,height:b}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}class d9 extends aB{constructor(a,b,c,d,e,f,g,h,i,j,k,l){super(null,f,g,h,i,j,d,e,k,l),this.isCompressedTexture=!0,this.image={width:b,height:c},this.mipmaps=a,this.flipY=!1,this.generateMipmaps=!1}}class ea extends d9{constructor(a,b,c,d,e,f){super(a,b,c,e,f),this.isCompressedArrayTexture=!0,this.image.depth=d,this.wrapR=1001,this.layerUpdates=new Set}addLayerUpdate(a){this.layerUpdates.add(a)}clearLayerUpdates(){this.layerUpdates.clear()}}class eb extends d9{constructor(a,b,c){super(void 0,a[0].width,a[0].height,b,c,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=a}}class ec extends aB{constructor(a=[],b=301,c,d,e,f,g,h,i,j){super(a,b,c,d,e,f,g,h,i,j),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(a){this.image=a}}class ed extends aB{constructor(a,b,c,d,e,f,g,h,i){super(a,b,c,d,e,f,g,h,i),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ee extends aB{constructor(a,b,c=1014,d,e,f,g=1003,h=1003,i,j=1026,k=1){if(1026!==j&&1027!==j)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:a,height:b,depth:k},d,e,f,g,h,j,c,i),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(a){return super.copy(a),this.source=new ax(Object.assign({},a.image)),this.compareFunction=a.compareFunction,this}toJSON(a){let b=super.toJSON(a);return null!==this.compareFunction&&(b.compareFunction=this.compareFunction),b}}class ef extends ee{constructor(a,b=1014,c=301,d,e,f=1003,g=1003,h,i=1026){const j={width:a,height:a,depth:1};super(a,a,b,c,d,e,f,g,h,i),this.image=[j,j,j,j,j,j],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(a){this.image=a}}class eg extends aB{constructor(a=null){super(),this.sourceTexture=a,this.isExternalTexture=!0}copy(a){return super.copy(a),this.sourceTexture=a.sourceTexture,this}}class eh extends ce{constructor(a=1,b=1,c=1,d=1,e=1,f=1){super(),this.type="BoxGeometry",this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};const g=this;d=Math.floor(d),e=Math.floor(e);const h=[],i=[],j=[],k=[];let l=0,m=0;function n(a,b,c,d,e,f,n,o,p,q,r){let s=f/p,t=n/q,u=f/2,v=n/2,w=o/2,x=p+1,y=q+1,z=0,A=0,B=new al;for(let f=0;f<y;f++){let g=f*t-v;for(let h=0;h<x;h++){let l=h*s-u;B[a]=l*d,B[b]=g*e,B[c]=w,i.push(B.x,B.y,B.z),B[a]=0,B[b]=0,B[c]=o>0?1:-1,j.push(B.x,B.y,B.z),k.push(h/p),k.push(1-f/q),z+=1}}for(let a=0;a<q;a++)for(let b=0;b<p;b++){let c=l+b+x*a,d=l+b+x*(a+1),e=l+(b+1)+x*(a+1),f=l+(b+1)+x*a;h.push(c,d,f),h.push(d,e,f),A+=6}g.addGroup(m,A,r),m+=A,l+=z}n("z","y","x",-1,-1,c,b,a,f=Math.floor(f),e,0),n("z","y","x",1,-1,c,b,-a,f,e,1),n("x","z","y",1,1,a,c,b,d,f,2),n("x","z","y",1,-1,a,c,-b,d,f,3),n("x","y","z",1,-1,a,b,c,d,e,4),n("x","y","z",-1,-1,a,b,-c,d,e,5),this.setIndex(h),this.setAttribute("position",new b2(i,3)),this.setAttribute("normal",new b2(j,3)),this.setAttribute("uv",new b2(k,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new eh(a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments)}}class ei extends ce{constructor(a=1,b=1,c=4,d=8,e=1){super(),this.type="CapsuleGeometry",this.parameters={radius:a,height:b,capSegments:c,radialSegments:d,heightSegments:e},b=Math.max(0,b),c=Math.max(1,Math.floor(c)),d=Math.max(3,Math.floor(d));const f=[],g=[],h=[],i=[],j=b/2,k=Math.PI/2*a,l=b,m=2*k+l,n=2*c+(e=Math.max(1,Math.floor(e))),o=d+1,p=new al,q=new al;for(let r=0;r<=n;r++){let s=0,t=0,u=0,v=0;if(r<=c){const b=r/c,d=b*Math.PI/2;t=-j-a*Math.cos(d),u=a*Math.sin(d),v=-a*Math.cos(d),s=b*k}else if(r<=c+e){const d=(r-c)/e;t=-j+d*b,u=a,v=0,s=k+d*l}else{const b=(r-c-e)/c,d=b*Math.PI/2;t=j+a*Math.sin(d),u=a*Math.cos(d),v=a*Math.sin(d),s=k+l+b*k}const w=Math.max(0,Math.min(1,s/m));let x=0;0===r?x=.5/d:r===n&&(x=-.5/d);for(let a=0;a<=d;a++){const b=a/d,c=b*Math.PI*2,e=Math.sin(c),f=Math.cos(c);q.x=-u*f,q.y=t,q.z=u*e,g.push(q.x,q.y,q.z),p.set(-u*f,v,u*e),p.normalize(),h.push(p.x,p.y,p.z),i.push(b+x,w)}if(r>0){const a=(r-1)*o;for(let b=0;b<d;b++){const c=a+b,d=a+b+1,e=r*o+b,g=r*o+b+1;f.push(c,d,e),f.push(d,g,e)}}}this.setIndex(f),this.setAttribute("position",new b2(g,3)),this.setAttribute("normal",new b2(h,3)),this.setAttribute("uv",new b2(i,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new ei(a.radius,a.height,a.capSegments,a.radialSegments,a.heightSegments)}}class ej extends ce{constructor(a=1,b=32,c=0,d=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d},b=Math.max(3,b);const e=[],f=[],g=[],h=[],i=new al,j=new aj;f.push(0,0,0),g.push(0,0,1),h.push(.5,.5);for(let e=0,k=3;e<=b;e++,k+=3){const l=c+e/b*d;i.x=a*Math.cos(l),i.y=a*Math.sin(l),f.push(i.x,i.y,i.z),g.push(0,0,1),j.x=(f[k]/a+1)/2,j.y=(f[k+1]/a+1)/2,h.push(j.x,j.y)}for(let a=1;a<=b;a++)e.push(a,a+1,0);this.setIndex(e),this.setAttribute("position",new b2(f,3)),this.setAttribute("normal",new b2(g,3)),this.setAttribute("uv",new b2(h,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new ej(a.radius,a.segments,a.thetaStart,a.thetaLength)}}class ek extends ce{constructor(a=1,b=1,c=1,d=32,e=1,f=!1,g=0,h=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};const i=this;d=Math.floor(d),e=Math.floor(e);const j=[],k=[],l=[],m=[];let n=0;const o=[],p=c/2;let q=0;function r(c){let e=n,f=new aj,o=new al,r=0,s=!0===c?a:b,t=!0===c?1:-1;for(let a=1;a<=d;a++)k.push(0,p*t,0),l.push(0,t,0),m.push(.5,.5),n++;let u=n;for(let a=0;a<=d;a++){let b=a/d*h+g,c=Math.cos(b),e=Math.sin(b);o.x=s*e,o.y=p*t,o.z=s*c,k.push(o.x,o.y,o.z),l.push(0,t,0),f.x=.5*c+.5,f.y=.5*e*t+.5,m.push(f.x,f.y),n++}for(let a=0;a<d;a++){let b=e+a,d=u+a;!0===c?j.push(d,d+1,b):j.push(d+1,d,b),r+=3}i.addGroup(q,r,!0===c?1:2),q+=r}(function(){let f=new al,r=new al,s=0,t=(b-a)/c;for(let i=0;i<=e;i++){let j=[],q=i/e,s=q*(b-a)+a;for(let a=0;a<=d;a++){let b=a/d,e=b*h+g,i=Math.sin(e),o=Math.cos(e);r.x=s*i,r.y=-q*c+p,r.z=s*o,k.push(r.x,r.y,r.z),f.set(i,t,o).normalize(),l.push(f.x,f.y,f.z),m.push(b,1-q),j.push(n++)}o.push(j)}for(let c=0;c<d;c++)for(let d=0;d<e;d++){let f=o[d][c],g=o[d+1][c],h=o[d+1][c+1],i=o[d][c+1];(a>0||0!==d)&&(j.push(f,g,i),s+=3),(b>0||d!==e-1)&&(j.push(g,h,i),s+=3)}i.addGroup(q,s,0),q+=s})(),!1===f&&(a>0&&r(!0),b>0&&r(!1)),this.setIndex(j),this.setAttribute("position",new b2(k,3)),this.setAttribute("normal",new b2(l,3)),this.setAttribute("uv",new b2(m,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new ek(a.radiusTop,a.radiusBottom,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength)}}class el extends ek{constructor(a=1,b=1,c=32,d=1,e=!1,f=0,g=2*Math.PI){super(0,a,b,c,d,e,f,g),this.type="ConeGeometry",this.parameters={radius:a,height:b,radialSegments:c,heightSegments:d,openEnded:e,thetaStart:f,thetaLength:g}}static fromJSON(a){return new el(a.radius,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength)}}class em extends ce{constructor(a=[],b=[],c=1,d=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:a,indices:b,radius:c,detail:d};const e=[],f=[];function g(a){e.push(a.x,a.y,a.z)}function h(b,c){let d=3*b;c.x=a[d+0],c.y=a[d+1],c.z=a[d+2]}function i(a,b,c,d){d<0&&1===a.x&&(f[b]=a.x-1),0===c.x&&0===c.z&&(f[b]=d/2/Math.PI+.5)}function j(a){return Math.atan2(a.z,-a.x)}(function(a){let c=new al,d=new al,e=new al;for(let f=0;f<b.length;f+=3)h(b[f+0],c),h(b[f+1],d),h(b[f+2],e),function(a,b,c,d){let e=d+1,f=[];for(let d=0;d<=e;d++){f[d]=[];let g=a.clone().lerp(c,d/e),h=b.clone().lerp(c,d/e),i=e-d;for(let a=0;a<=i;a++)0===a&&d===e?f[d][a]=g:f[d][a]=g.clone().lerp(h,a/i)}for(let a=0;a<e;a++)for(let b=0;b<2*(e-a)-1;b++){let c=Math.floor(b/2);b%2==0?(g(f[a][c+1]),g(f[a+1][c]),g(f[a][c])):(g(f[a][c+1]),g(f[a+1][c+1]),g(f[a+1][c]))}}(c,d,e,a)})(d),function(a){let b=new al;for(let c=0;c<e.length;c+=3)b.x=e[c+0],b.y=e[c+1],b.z=e[c+2],b.normalize().multiplyScalar(a),e[c+0]=b.x,e[c+1]=b.y,e[c+2]=b.z}(c),function(){let a=new al;for(let c=0;c<e.length;c+=3){var b;a.x=e[c+0],a.y=e[c+1],a.z=e[c+2];let d=j(a)/2/Math.PI+.5,g=Math.atan2(-(b=a).y,Math.sqrt(b.x*b.x+b.z*b.z))/Math.PI+.5;f.push(d,1-g)}(function(){let a=new al,b=new al,c=new al,d=new al,g=new aj,h=new aj,k=new aj;for(let l=0,m=0;l<e.length;l+=9,m+=6){a.set(e[l+0],e[l+1],e[l+2]),b.set(e[l+3],e[l+4],e[l+5]),c.set(e[l+6],e[l+7],e[l+8]),g.set(f[m+0],f[m+1]),h.set(f[m+2],f[m+3]),k.set(f[m+4],f[m+5]),d.copy(a).add(b).add(c).divideScalar(3);let n=j(d);i(g,m+0,a,n),i(h,m+2,b,n),i(k,m+4,c,n)}})(),function(){for(let a=0;a<f.length;a+=6){let b=f[a+0],c=f[a+2],d=f[a+4],e=Math.max(b,c,d),g=Math.min(b,c,d);e>.9&&g<.1&&(b<.2&&(f[a+0]+=1),c<.2&&(f[a+2]+=1),d<.2&&(f[a+4]+=1))}}()}(),this.setAttribute("position",new b2(e,3)),this.setAttribute("normal",new b2(e.slice(),3)),this.setAttribute("uv",new b2(f,2)),0===d?this.computeVertexNormals():this.normalizeNormals()}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new em(a.vertices,a.indices,a.radius,a.detail)}}class en extends em{constructor(a=1,b=0){const c=(1+Math.sqrt(5))/2,d=1/c;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b),this.type="DodecahedronGeometry",this.parameters={radius:a,detail:b}}static fromJSON(a){return new en(a.radius,a.detail)}}let eo=new al,ep=new al,eq=new al,er=new by;class es extends ce{constructor(a=null,b=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:a,thresholdAngle:b},null!==a){const c=Math.cos(aa*b),d=a.getIndex(),e=a.getAttribute("position"),f=d?d.count:e.count,g=[0,0,0],h=["a","b","c"],i=[,,,],j={},k=[];for(let a=0;a<f;a+=3){d?(g[0]=d.getX(a),g[1]=d.getX(a+1),g[2]=d.getX(a+2)):(g[0]=a,g[1]=a+1,g[2]=a+2);const{a:b,b:f,c:l}=er;if(b.fromBufferAttribute(e,g[0]),f.fromBufferAttribute(e,g[1]),l.fromBufferAttribute(e,g[2]),er.getNormal(eq),i[0]=`${Math.round(1e4*b.x)},${Math.round(1e4*b.y)},${Math.round(1e4*b.z)}`,i[1]=`${Math.round(1e4*f.x)},${Math.round(1e4*f.y)},${Math.round(1e4*f.z)}`,i[2]=`${Math.round(1e4*l.x)},${Math.round(1e4*l.y)},${Math.round(1e4*l.z)}`,i[0]!==i[1]&&i[1]!==i[2]&&i[2]!==i[0])for(let a=0;a<3;a++){const b=(a+1)%3,d=i[a],e=i[b],f=er[h[a]],l=er[h[b]],m=`${d}_${e}`,n=`${e}_${d}`;n in j&&j[n]?(eq.dot(j[n].normal)<=c&&(k.push(f.x,f.y,f.z),k.push(l.x,l.y,l.z)),j[n]=null):m in j||(j[m]={index0:g[a],index1:g[b],normal:eq.clone()})}}for(const a in j)if(j[a]){const{index0:b,index1:c}=j[a];eo.fromBufferAttribute(e,b),ep.fromBufferAttribute(e,c),k.push(eo.x,eo.y,eo.z),k.push(ep.x,ep.y,ep.z)}this.setAttribute("position",new b2(k,3))}}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}}class et{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){U("Curve: .getPoint() not implemented.")}getPointAt(a,b){let c=this.getUtoTmapping(a);return this.getPoint(c,b)}getPoints(a=5){let b=[];for(let c=0;c<=a;c++)b.push(this.getPoint(c/a));return b}getSpacedPoints(a=5){let b=[];for(let c=0;c<=a;c++)b.push(this.getPointAt(c/a));return b}getLength(){let a=this.getLengths();return a[a.length-1]}getLengths(a=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let b=[],c,d=this.getPoint(0),e=0;b.push(0);for(let f=1;f<=a;f++)b.push(e+=(c=this.getPoint(f/a)).distanceTo(d)),d=c;return this.cacheArcLengths=b,b}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(a,b=null){let c,d=this.getLengths(),e=0,f=d.length;c=b||a*d[f-1];let g=0,h=f-1,i;for(;g<=h;)if((i=d[e=Math.floor(g+(h-g)/2)]-c)<0)g=e+1;else if(i>0)h=e-1;else{h=e;break}if(d[e=h]===c)return e/(f-1);let j=d[e],k=d[e+1];return(e+(c-j)/(k-j))/(f-1)}getTangent(a,b){let c=a-1e-4,d=a+1e-4;c<0&&(c=0),d>1&&(d=1);let e=this.getPoint(c),f=this.getPoint(d),g=b||(e.isVector2?new aj:new al);return g.copy(f).sub(e).normalize(),g}getTangentAt(a,b){let c=this.getUtoTmapping(a);return this.getTangent(c,b)}computeFrenetFrames(a,b=!1){let c=new al,d=[],e=[],f=[],g=new al,h=new aJ;for(let b=0;b<=a;b++){let c=b/a;d[b]=this.getTangentAt(c,new al)}e[0]=new al,f[0]=new al;let i=Number.MAX_VALUE,j=Math.abs(d[0].x),k=Math.abs(d[0].y),l=Math.abs(d[0].z);j<=i&&(i=j,c.set(1,0,0)),k<=i&&(i=k,c.set(0,1,0)),l<=i&&c.set(0,0,1),g.crossVectors(d[0],c).normalize(),e[0].crossVectors(d[0],g),f[0].crossVectors(d[0],e[0]);for(let b=1;b<=a;b++){if(e[b]=e[b-1].clone(),f[b]=f[b-1].clone(),g.crossVectors(d[b-1],d[b]),g.length()>Number.EPSILON){g.normalize();let a=Math.acos(ad(d[b-1].dot(d[b]),-1,1));e[b].applyMatrix4(h.makeRotationAxis(g,a))}f[b].crossVectors(d[b],e[b])}if(!0===b){let b=Math.acos(ad(e[0].dot(e[a]),-1,1));b/=a,d[0].dot(g.crossVectors(e[0],e[a]))>0&&(b=-b);for(let c=1;c<=a;c++)e[c].applyMatrix4(h.makeRotationAxis(d[c],b*c)),f[c].crossVectors(d[c],e[c])}return{tangents:d,normals:e,binormals:f}}clone(){return new this.constructor().copy(this)}copy(a){return this.arcLengthDivisions=a.arcLengthDivisions,this}toJSON(){let a={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return a.arcLengthDivisions=this.arcLengthDivisions,a.type=this.type,a}fromJSON(a){return this.arcLengthDivisions=a.arcLengthDivisions,this}}class eu extends et{constructor(a=0,b=0,c=1,d=1,e=0,f=2*Math.PI,g=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g,this.aRotation=h}getPoint(a,b=new aj){let c=2*Math.PI,d=this.aEndAngle-this.aStartAngle,e=Math.abs(d)<Number.EPSILON;for(;d<0;)d+=c;for(;d>c;)d-=c;d<Number.EPSILON&&(d=e?0:c),!0!==this.aClockwise||e||(d===c?d=-c:d-=c);let f=this.aStartAngle+a*d,g=this.aX+this.xRadius*Math.cos(f),h=this.aY+this.yRadius*Math.sin(f);if(0!==this.aRotation){let a=Math.cos(this.aRotation),b=Math.sin(this.aRotation),c=g-this.aX,d=h-this.aY;g=c*a-d*b+this.aX,h=c*b+d*a+this.aY}return b.set(g,h)}copy(a){return super.copy(a),this.aX=a.aX,this.aY=a.aY,this.xRadius=a.xRadius,this.yRadius=a.yRadius,this.aStartAngle=a.aStartAngle,this.aEndAngle=a.aEndAngle,this.aClockwise=a.aClockwise,this.aRotation=a.aRotation,this}toJSON(){let a=super.toJSON();return a.aX=this.aX,a.aY=this.aY,a.xRadius=this.xRadius,a.yRadius=this.yRadius,a.aStartAngle=this.aStartAngle,a.aEndAngle=this.aEndAngle,a.aClockwise=this.aClockwise,a.aRotation=this.aRotation,a}fromJSON(a){return super.fromJSON(a),this.aX=a.aX,this.aY=a.aY,this.xRadius=a.xRadius,this.yRadius=a.yRadius,this.aStartAngle=a.aStartAngle,this.aEndAngle=a.aEndAngle,this.aClockwise=a.aClockwise,this.aRotation=a.aRotation,this}}class ev extends eu{constructor(a,b,c,d,e,f){super(a,b,c,c,d,e,f),this.isArcCurve=!0,this.type="ArcCurve"}}function ew(){let a=0,b=0,c=0,d=0;function e(e,f,g,h){a=e,b=g,c=-3*e+3*f-2*g-h,d=2*e-2*f+g+h}return{initCatmullRom:function(a,b,c,d,f){e(b,c,f*(c-a),f*(d-b))},initNonuniformCatmullRom:function(a,b,c,d,f,g,h){let i=(b-a)/f-(c-a)/(f+g)+(c-b)/g,j=(c-b)/g-(d-b)/(g+h)+(d-c)/h;e(b,c,i*=g,j*=g)},calc:function(e){let f=e*e;return a+b*e+c*f+f*e*d}}}let ex=new al,ey=new ew,ez=new ew,eA=new ew;class eB extends et{constructor(a=[],b=!1,c="centripetal",d=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=a,this.closed=b,this.curveType=c,this.tension=d}getPoint(a,b=new al){let c,d,e=this.points,f=e.length,g=(f-!this.closed)*a,h=Math.floor(g),i=g-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/f)+1)*f:0===i&&h===f-1&&(h=f-2,i=1),this.closed||h>0?c=e[(h-1)%f]:(ex.subVectors(e[0],e[1]).add(e[0]),c=ex);let j=e[h%f],k=e[(h+1)%f];if(this.closed||h+2<f?d=e[(h+2)%f]:(ex.subVectors(e[f-1],e[f-2]).add(e[f-1]),d=ex),"centripetal"===this.curveType||"chordal"===this.curveType){let a="chordal"===this.curveType?.5:.25,b=Math.pow(c.distanceToSquared(j),a),e=Math.pow(j.distanceToSquared(k),a),f=Math.pow(k.distanceToSquared(d),a);e<1e-4&&(e=1),b<1e-4&&(b=e),f<1e-4&&(f=e),ey.initNonuniformCatmullRom(c.x,j.x,k.x,d.x,b,e,f),ez.initNonuniformCatmullRom(c.y,j.y,k.y,d.y,b,e,f),eA.initNonuniformCatmullRom(c.z,j.z,k.z,d.z,b,e,f)}else"catmullrom"===this.curveType&&(ey.initCatmullRom(c.x,j.x,k.x,d.x,this.tension),ez.initCatmullRom(c.y,j.y,k.y,d.y,this.tension),eA.initCatmullRom(c.z,j.z,k.z,d.z,this.tension));return b.set(ey.calc(i),ez.calc(i),eA.calc(i)),b}copy(a){super.copy(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(c.clone())}return this.closed=a.closed,this.curveType=a.curveType,this.tension=a.tension,this}toJSON(){let a=super.toJSON();a.points=[];for(let b=0,c=this.points.length;b<c;b++){let c=this.points[b];a.points.push(c.toArray())}return a.closed=this.closed,a.curveType=this.curveType,a.tension=this.tension,a}fromJSON(a){super.fromJSON(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(new al().fromArray(c))}return this.closed=a.closed,this.curveType=a.curveType,this.tension=a.tension,this}}function eC(a,b,c,d,e){let f=(d-b)*.5,g=(e-c)*.5,h=a*a;return a*h*(2*c-2*d+f+g)+(-3*c+3*d-2*f-g)*h+f*a+c}function eD(a,b,c,d){let e;return(e=1-a)*e*b+2*(1-a)*a*c+a*a*d}function eE(a,b,c,d,e){let f,g;return(f=1-a)*f*f*b+3*(g=1-a)*g*a*c+3*(1-a)*a*a*d+a*a*a*e}class eF extends et{constructor(a=new aj,b=new aj,c=new aj,d=new aj){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=a,this.v1=b,this.v2=c,this.v3=d}getPoint(a,b=new aj){let c=this.v0,d=this.v1,e=this.v2,f=this.v3;return b.set(eE(a,c.x,d.x,e.x,f.x),eE(a,c.y,d.y,e.y,f.y)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this.v3.copy(a.v3),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a.v3=this.v3.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this.v3.fromArray(a.v3),this}}class eG extends et{constructor(a=new al,b=new al,c=new al,d=new al){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=a,this.v1=b,this.v2=c,this.v3=d}getPoint(a,b=new al){let c=this.v0,d=this.v1,e=this.v2,f=this.v3;return b.set(eE(a,c.x,d.x,e.x,f.x),eE(a,c.y,d.y,e.y,f.y),eE(a,c.z,d.z,e.z,f.z)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this.v3.copy(a.v3),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a.v3=this.v3.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this.v3.fromArray(a.v3),this}}class eH extends et{constructor(a=new aj,b=new aj){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=a,this.v2=b}getPoint(a,b=new aj){return 1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1)),b}getPointAt(a,b){return this.getPoint(a,b)}getTangent(a,b=new aj){return b.subVectors(this.v2,this.v1).normalize()}getTangentAt(a,b){return this.getTangent(a,b)}copy(a){return super.copy(a),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class eI extends et{constructor(a=new al,b=new al){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=a,this.v2=b}getPoint(a,b=new al){return 1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1)),b}getPointAt(a,b){return this.getPoint(a,b)}getTangent(a,b=new al){return b.subVectors(this.v2,this.v1).normalize()}getTangentAt(a,b){return this.getTangent(a,b)}copy(a){return super.copy(a),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class eJ extends et{constructor(a=new aj,b=new aj,c=new aj){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=a,this.v1=b,this.v2=c}getPoint(a,b=new aj){let c=this.v0,d=this.v1,e=this.v2;return b.set(eD(a,c.x,d.x,e.x),eD(a,c.y,d.y,e.y)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class eK extends et{constructor(a=new al,b=new al,c=new al){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=a,this.v1=b,this.v2=c}getPoint(a,b=new al){let c=this.v0,d=this.v1,e=this.v2;return b.set(eD(a,c.x,d.x,e.x),eD(a,c.y,d.y,e.y),eD(a,c.z,d.z,e.z)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class eL extends et{constructor(a=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=a}getPoint(a,b=new aj){let c=this.points,d=(c.length-1)*a,e=Math.floor(d),f=d-e,g=c[0===e?e:e-1],h=c[e],i=c[e>c.length-2?c.length-1:e+1],j=c[e>c.length-3?c.length-1:e+2];return b.set(eC(f,g.x,h.x,i.x,j.x),eC(f,g.y,h.y,i.y,j.y)),b}copy(a){super.copy(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(c.clone())}return this}toJSON(){let a=super.toJSON();a.points=[];for(let b=0,c=this.points.length;b<c;b++){let c=this.points[b];a.points.push(c.toArray())}return a}fromJSON(a){super.fromJSON(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(new aj().fromArray(c))}return this}}var eM=Object.freeze({__proto__:null,ArcCurve:ev,CatmullRomCurve3:eB,CubicBezierCurve:eF,CubicBezierCurve3:eG,EllipseCurve:eu,LineCurve:eH,LineCurve3:eI,QuadraticBezierCurve:eJ,QuadraticBezierCurve3:eK,SplineCurve:eL});class eN extends et{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(a){this.curves.push(a)}closePath(){let a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);if(!a.equals(b)){let c=!0===a.isVector2?"LineCurve":"LineCurve3";this.curves.push(new eM[c](b,a))}return this}getPoint(a,b){let c=a*this.getLength(),d=this.getCurveLengths(),e=0;for(;e<d.length;){if(d[e]>=c){let a=d[e]-c,f=this.curves[e],g=f.getLength(),h=0===g?0:1-a/g;return f.getPointAt(h,b)}e++}return null}getLength(){let a=this.getCurveLengths();return a[a.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let a=[],b=0;for(let c=0,d=this.curves.length;c<d;c++)a.push(b+=this.curves[c].getLength());return this.cacheLengths=a,a}getSpacedPoints(a=40){let b=[];for(let c=0;c<=a;c++)b.push(this.getPoint(c/a));return this.autoClose&&b.push(b[0]),b}getPoints(a=12){let b,c=[];for(let d=0,e=this.curves;d<e.length;d++){let f=e[d],g=f.isEllipseCurve?2*a:f.isLineCurve||f.isLineCurve3?1:f.isSplineCurve?a*f.points.length:a,h=f.getPoints(g);for(let a=0;a<h.length;a++){let d=h[a];b&&b.equals(d)||(c.push(d),b=d)}}return this.autoClose&&c.length>1&&!c[c.length-1].equals(c[0])&&c.push(c[0]),c}copy(a){super.copy(a),this.curves=[];for(let b=0,c=a.curves.length;b<c;b++){let c=a.curves[b];this.curves.push(c.clone())}return this.autoClose=a.autoClose,this}toJSON(){let a=super.toJSON();a.autoClose=this.autoClose,a.curves=[];for(let b=0,c=this.curves.length;b<c;b++){let c=this.curves[b];a.curves.push(c.toJSON())}return a}fromJSON(a){super.fromJSON(a),this.autoClose=a.autoClose,this.curves=[];for(let b=0,c=a.curves.length;b<c;b++){let c=a.curves[b];this.curves.push(new eM[c.type]().fromJSON(c))}return this}}class eO extends eN{constructor(a){super(),this.type="Path",this.currentPoint=new aj,a&&this.setFromPoints(a)}setFromPoints(a){this.moveTo(a[0].x,a[0].y);for(let b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y);return this}moveTo(a,b){return this.currentPoint.set(a,b),this}lineTo(a,b){let c=new eH(this.currentPoint.clone(),new aj(a,b));return this.curves.push(c),this.currentPoint.set(a,b),this}quadraticCurveTo(a,b,c,d){let e=new eJ(this.currentPoint.clone(),new aj(a,b),new aj(c,d));return this.curves.push(e),this.currentPoint.set(c,d),this}bezierCurveTo(a,b,c,d,e,f){let g=new eF(this.currentPoint.clone(),new aj(a,b),new aj(c,d),new aj(e,f));return this.curves.push(g),this.currentPoint.set(e,f),this}splineThru(a){let b=new eL([this.currentPoint.clone()].concat(a));return this.curves.push(b),this.currentPoint.copy(a[a.length-1]),this}arc(a,b,c,d,e,f){let g=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(a+g,b+h,c,d,e,f),this}absarc(a,b,c,d,e,f){return this.absellipse(a,b,c,c,d,e,f),this}ellipse(a,b,c,d,e,f,g,h){let i=this.currentPoint.x,j=this.currentPoint.y;return this.absellipse(a+i,b+j,c,d,e,f,g,h),this}absellipse(a,b,c,d,e,f,g,h){let i=new eu(a,b,c,d,e,f,g,h);if(this.curves.length>0){let a=i.getPoint(0);a.equals(this.currentPoint)||this.lineTo(a.x,a.y)}this.curves.push(i);let j=i.getPoint(1);return this.currentPoint.copy(j),this}copy(a){return super.copy(a),this.currentPoint.copy(a.currentPoint),this}toJSON(){let a=super.toJSON();return a.currentPoint=this.currentPoint.toArray(),a}fromJSON(a){return super.fromJSON(a),this.currentPoint.fromArray(a.currentPoint),this}}class eP extends eO{constructor(a){super(a),this.uuid=ac(),this.type="Shape",this.holes=[]}getPointsHoles(a){let b=[];for(let c=0,d=this.holes.length;c<d;c++)b[c]=this.holes[c].getPoints(a);return b}extractPoints(a){return{shape:this.getPoints(a),holes:this.getPointsHoles(a)}}copy(a){super.copy(a),this.holes=[];for(let b=0,c=a.holes.length;b<c;b++){let c=a.holes[b];this.holes.push(c.clone())}return this}toJSON(){let a=super.toJSON();a.uuid=this.uuid,a.holes=[];for(let b=0,c=this.holes.length;b<c;b++){let c=this.holes[b];a.holes.push(c.toJSON())}return a}fromJSON(a){super.fromJSON(a),this.uuid=a.uuid,this.holes=[];for(let b=0,c=a.holes.length;b<c;b++){let c=a.holes[b];this.holes.push(new eO().fromJSON(c))}return this}}function eQ(a,b,c,d,e){let f;if(e===function(a,b,c,d){let e=0;for(let f=b,g=c-d;f<c;f+=d)e+=(a[g]-a[f])*(a[f+1]+a[g+1]),g=f;return e}(a,b,c,d)>0)for(let e=b;e<c;e+=d)f=e1(e/d|0,a[e],a[e+1],f);else for(let e=c-d;e>=b;e-=d)f=e1(e/d|0,a[e],a[e+1],f);return f&&eX(f,f.next)&&(e2(f),f=f.next),f}function eR(a,b){if(!a)return a;b||(b=a);let c=a,d;do if(d=!1,!c.steiner&&(eX(c,c.next)||0===eW(c.prev,c,c.next))){if(e2(c),(c=b=c.prev)===c.next)break;d=!0}else c=c.next;while(d||c!==b)return b}function eS(a,b){let c=a.x-b.x;return 0===c&&0==(c=a.y-b.y)&&(c=(a.next.y-a.y)/(a.next.x-a.x)-(b.next.y-b.y)/(b.next.x-b.x)),c}function eT(a,b,c,d,e){return(a=((a=((a=((a=((a=(a-c)*e|0)|a<<8)&0xff00ff)|a<<4)&0xf0f0f0f)|a<<2)&0x33333333)|a<<1)&0x55555555)|(b=((b=((b=((b=((b=(b-d)*e|0)|b<<8)&0xff00ff)|b<<4)&0xf0f0f0f)|b<<2)&0x33333333)|b<<1)&0x55555555)<<1}function eU(a,b,c,d,e,f,g,h){return(e-g)*(b-h)>=(a-g)*(f-h)&&(a-g)*(d-h)>=(c-g)*(b-h)&&(c-g)*(f-h)>=(e-g)*(d-h)}function eV(a,b,c,d,e,f,g,h){return(a!==g||b!==h)&&eU(a,b,c,d,e,f,g,h)}function eW(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}function eX(a,b){return a.x===b.x&&a.y===b.y}function eY(a,b,c,d){let e=e$(eW(a,b,c)),f=e$(eW(a,b,d)),g=e$(eW(c,d,a)),h=e$(eW(c,d,b));return!!(e!==f&&g!==h||0===e&&eZ(a,c,b)||0===f&&eZ(a,d,b)||0===g&&eZ(c,a,d)||0===h&&eZ(c,b,d))}function eZ(a,b,c){return b.x<=Math.max(a.x,c.x)&&b.x>=Math.min(a.x,c.x)&&b.y<=Math.max(a.y,c.y)&&b.y>=Math.min(a.y,c.y)}function e$(a){return a>0?1:a<0?-1:0}function e_(a,b){return 0>eW(a.prev,a,a.next)?eW(a,b,a.next)>=0&&eW(a,a.prev,b)>=0:0>eW(a,b,a.prev)||0>eW(a,a.next,b)}function e0(a,b){let c=e3(a.i,a.x,a.y),d=e3(b.i,b.x,b.y),e=a.next,f=b.prev;return a.next=b,b.prev=a,c.next=e,e.prev=c,d.next=c,c.prev=d,f.next=d,d.prev=f,d}function e1(a,b,c,d){let e=e3(a,b,c);return d?(e.next=d.next,e.prev=d,d.next.prev=e,d.next=e):(e.prev=e,e.next=e),e}function e2(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function e3(a,b,c){return{i:a,x:b,y:c,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class e4{static triangulate(a,b,c=2){return function(a,b,c=2){let d,e,f,g=b&&b.length,h=g?b[0]*c:a.length,i=eQ(a,0,h,c,!0),j=[];if(!i||i.next===i.prev)return j;if(g&&(i=function(a,b,c,d){let e=[];for(let c=0,f=b.length;c<f;c++){let g=b[c]*d,h=c<f-1?b[c+1]*d:a.length,i=eQ(a,g,h,d,!1);i===i.next&&(i.steiner=!0),e.push(function(a){let b=a,c=a;do(b.x<c.x||b.x===c.x&&b.y<c.y)&&(c=b),b=b.next;while(b!==a)return c}(i))}e.sort(eS);for(let a=0;a<e.length;a++)c=function(a,b){let c=function(a,b){let c,d=b,e=a.x,f=a.y,g=-1/0;if(eX(a,d))return d;do{if(eX(a,d.next))return d.next;if(f<=d.y&&f>=d.next.y&&d.next.y!==d.y){let a=d.x+(f-d.y)*(d.next.x-d.x)/(d.next.y-d.y);if(a<=e&&a>g&&(g=a,c=d.x<d.next.x?d:d.next,a===e))return c}d=d.next}while(d!==b)if(!c)return null;let h=c,i=c.x,j=c.y,k=1/0;d=c;do{if(e>=d.x&&d.x>=i&&e!==d.x&&eU(f<j?e:g,f,i,j,f<j?g:e,f,d.x,d.y)){var l,m;let b=Math.abs(f-d.y)/(e-d.x);e_(d,a)&&(b<k||b===k&&(d.x>c.x||d.x===c.x&&(l=c,m=d,0>eW(l.prev,l,m.prev)&&0>eW(m.next,l,l.next))))&&(c=d,k=b)}d=d.next}while(d!==h)return c}(a,b);if(!c)return b;let d=e0(c,a);return eR(d,d.next),eR(c,c.next)}(e[a],c);return c}(a,b,i,c)),a.length>80*c){d=a[0],e=a[1];let b=d,g=e;for(let f=c;f<h;f+=c){let c=a[f],h=a[f+1];c<d&&(d=c),h<e&&(e=h),c>b&&(b=c),h>g&&(g=h)}f=0!==(f=Math.max(b-d,g-e))?32767/f:0}return function a(b,c,d,e,f,g,h){if(!b)return;!h&&g&&function(a,b,c,d){let e=a;do 0===e.z&&(e.z=eT(e.x,e.y,b,c,d)),e.prevZ=e.prev,e.nextZ=e.next,e=e.next;while(e!==a)e.prevZ.nextZ=null,e.prevZ=null,function(a){let b,c=1;do{let d,e=a;a=null;let f=null;for(b=0;e;){b++;let g=e,h=0;for(let a=0;a<c&&(h++,g=g.nextZ);a++);let i=c;for(;h>0||i>0&&g;)0!==h&&(0===i||!g||e.z<=g.z)?(d=e,e=e.nextZ,h--):(d=g,g=g.nextZ,i--),f?f.nextZ=d:a=d,d.prevZ=f,f=d;e=g}f.nextZ=null,c*=2}while(b>1)}(e)}(b,e,f,g);let i=b;for(;b.prev!==b.next;){let j=b.prev,k=b.next;if(g?function(a,b,c,d){let e=a.prev,f=a.next;if(eW(e,a,f)>=0)return!1;let g=e.x,h=a.x,i=f.x,j=e.y,k=a.y,l=f.y,m=Math.min(g,h,i),n=Math.min(j,k,l),o=Math.max(g,h,i),p=Math.max(j,k,l),q=eT(m,n,b,c,d),r=eT(o,p,b,c,d),s=a.prevZ,t=a.nextZ;for(;s&&s.z>=q&&t&&t.z<=r;){if(s.x>=m&&s.x<=o&&s.y>=n&&s.y<=p&&s!==e&&s!==f&&eV(g,j,h,k,i,l,s.x,s.y)&&eW(s.prev,s,s.next)>=0||(s=s.prevZ,t.x>=m&&t.x<=o&&t.y>=n&&t.y<=p&&t!==e&&t!==f&&eV(g,j,h,k,i,l,t.x,t.y)&&eW(t.prev,t,t.next)>=0))return!1;t=t.nextZ}for(;s&&s.z>=q;){if(s.x>=m&&s.x<=o&&s.y>=n&&s.y<=p&&s!==e&&s!==f&&eV(g,j,h,k,i,l,s.x,s.y)&&eW(s.prev,s,s.next)>=0)return!1;s=s.prevZ}for(;t&&t.z<=r;){if(t.x>=m&&t.x<=o&&t.y>=n&&t.y<=p&&t!==e&&t!==f&&eV(g,j,h,k,i,l,t.x,t.y)&&eW(t.prev,t,t.next)>=0)return!1;t=t.nextZ}return!0}(b,e,f,g):function(a){let b=a.prev,c=a.next;if(eW(b,a,c)>=0)return!1;let d=b.x,e=a.x,f=c.x,g=b.y,h=a.y,i=c.y,j=Math.min(d,e,f),k=Math.min(g,h,i),l=Math.max(d,e,f),m=Math.max(g,h,i),n=c.next;for(;n!==b;){if(n.x>=j&&n.x<=l&&n.y>=k&&n.y<=m&&eV(d,g,e,h,f,i,n.x,n.y)&&eW(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}(b)){c.push(j.i,b.i,k.i),e2(b),b=k.next,i=k.next;continue}if((b=k)===i){h?1===h?a(b=function(a,b){let c=a;do{let d=c.prev,e=c.next.next;!eX(d,e)&&eY(d,c,c.next,e)&&e_(d,e)&&e_(e,d)&&(b.push(d.i,c.i,e.i),e2(c),e2(c.next),c=a=e),c=c.next}while(c!==a)return eR(c)}(eR(b),c),c,d,e,f,g,2):2===h&&function(b,c,d,e,f,g){let h=b;do{let b=h.next.next;for(;b!==h.prev;){var i,j;if(h.i!==b.i&&(i=h,j=b,i.next.i!==j.i&&i.prev.i!==j.i&&!function(a,b){let c=a;do{if(c.i!==a.i&&c.next.i!==a.i&&c.i!==b.i&&c.next.i!==b.i&&eY(c,c.next,a,b))return!0;c=c.next}while(c!==a)return!1}(i,j)&&(e_(i,j)&&e_(j,i)&&function(a,b){let c=a,d=!1,e=(a.x+b.x)/2,f=(a.y+b.y)/2;do c.y>f!=c.next.y>f&&c.next.y!==c.y&&e<(c.next.x-c.x)*(f-c.y)/(c.next.y-c.y)+c.x&&(d=!d),c=c.next;while(c!==a)return d}(i,j)&&(eW(i.prev,i,j.prev)||eW(i,j.prev,j))||eX(i,j)&&eW(i.prev,i,i.next)>0&&eW(j.prev,j,j.next)>0))){let i=e0(h,b);h=eR(h,h.next),i=eR(i,i.next),a(h,c,d,e,f,g,0),a(i,c,d,e,f,g,0);return}b=b.next}h=h.next}while(h!==b)}(b,c,d,e,f,g):a(eR(b),c,d,e,f,g,1);break}}}(i,j,c,d,e,f,0),j}(a,b,c)}}class e5{static area(a){let b=a.length,c=0;for(let d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return .5*c}static isClockWise(a){return 0>e5.area(a)}static triangulateShape(a,b){let c=[],d=[],e=[];e6(a),e7(c,a);let f=a.length;b.forEach(e6);for(let a=0;a<b.length;a++)d.push(f),f+=b[a].length,e7(c,b[a]);let g=e4.triangulate(c,d);for(let a=0;a<g.length;a+=3)e.push(g.slice(a,a+3));return e}}function e6(a){let b=a.length;b>2&&a[b-1].equals(a[0])&&a.pop()}function e7(a,b){for(let c=0;c<b.length;c++)a.push(b[c].x),a.push(b[c].y)}class e8 extends ce{constructor(a=new eP([new aj(.5,.5),new aj(-.5,.5),new aj(-.5,-.5),new aj(.5,-.5)]),b={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:a,options:b},a=Array.isArray(a)?a:[a];const c=this,d=[],e=[];for(let f=0,g=a.length;f<g;f++)!function(a){let f,g,h,i,j,k=[],l=void 0!==b.curveSegments?b.curveSegments:12,m=void 0!==b.steps?b.steps:1,n=void 0!==b.depth?b.depth:1,o=void 0===b.bevelEnabled||b.bevelEnabled,p=void 0!==b.bevelThickness?b.bevelThickness:.2,q=void 0!==b.bevelSize?b.bevelSize:p-.1,r=void 0!==b.bevelOffset?b.bevelOffset:0,s=void 0!==b.bevelSegments?b.bevelSegments:3,t=b.extrudePath,u=void 0!==b.UVGenerator?b.UVGenerator:e9,v,w=!1;if(t){v=t.getSpacedPoints(m),w=!0,o=!1;let a=!!t.isCatmullRomCurve3&&t.closed;f=t.computeFrenetFrames(m,a),g=new al,h=new al,i=new al}o||(s=0,p=0,q=0,r=0);let x=a.extractPoints(l),y=x.shape,z=x.holes;if(!e5.isClockWise(y)){y=y.reverse();for(let a=0,b=z.length;a<b;a++){let b=z[a];e5.isClockWise(b)&&(z[a]=b.reverse())}}function A(a){let b=1e-10*1e-10,c=a[0];for(let d=1;d<=a.length;d++){let e=d%a.length,f=a[e],g=f.x-c.x,h=f.y-c.y,i=g*g+h*h,j=Math.max(Math.abs(f.x),Math.abs(f.y),Math.abs(c.x),Math.abs(c.y));if(i<=b*j*j){a.splice(e,1),d--;continue}c=f}}A(y),z.forEach(A);let B=z.length,C=y;for(let a=0;a<B;a++){let b=z[a];y=y.concat(b)}function D(a,b,c){return b||V("ExtrudeGeometry: vec does not exist"),a.clone().addScaledVector(b,c)}let E=y.length;function F(a,b,c){let d,e,f,g=a.x-b.x,h=a.y-b.y,i=c.x-a.x,j=c.y-a.y,k=g*g+h*h;if(Math.abs(g*j-h*i)>Number.EPSILON){let l=Math.sqrt(k),m=Math.sqrt(i*i+j*j),n=b.x-h/l,o=b.y+g/l,p=((c.x-j/m-n)*j-(c.y+i/m-o)*i)/(g*j-h*i),q=(d=n+g*p-a.x)*d+(e=o+h*p-a.y)*e;if(q<=2)return new aj(d,e);f=Math.sqrt(q/2)}else{let a=!1;g>Number.EPSILON?i>Number.EPSILON&&(a=!0):g<-Number.EPSILON?i<-Number.EPSILON&&(a=!0):Math.sign(h)===Math.sign(j)&&(a=!0),a?(d=-h,e=g,f=Math.sqrt(k)):(d=g,e=h,f=Math.sqrt(k/2))}return new aj(d/f,e/f)}let G=[];for(let a=0,b=C.length,c=b-1,d=a+1;a<b;a++,c++,d++)c===b&&(c=0),d===b&&(d=0),G[a]=F(C[a],C[c],C[d]);let H=[],I,J=G.concat();for(let a=0;a<B;a++){let b=z[a];I=[];for(let a=0,c=b.length,d=c-1,e=a+1;a<c;a++,d++,e++)d===c&&(d=0),e===c&&(e=0),I[a]=F(b[a],b[d],b[e]);H.push(I),J=J.concat(I)}if(0===s)j=e5.triangulateShape(C,z);else{let a=[],b=[];for(let c=0;c<s;c++){let d=c/s,e=p*Math.cos(d*Math.PI/2),f=q*Math.sin(d*Math.PI/2)+r;for(let b=0,c=C.length;b<c;b++){let c=D(C[b],G[b],f);N(c.x,c.y,-e),0===d&&a.push(c)}for(let a=0;a<B;a++){let c=z[a];I=H[a];let g=[];for(let a=0,b=c.length;a<b;a++){let b=D(c[a],I[a],f);N(b.x,b.y,-e),0===d&&g.push(b)}0===d&&b.push(g)}}j=e5.triangulateShape(a,b)}let K=j.length,L=q+r;for(let a=0;a<E;a++){let b=o?D(y[a],J[a],L):y[a];w?(h.copy(f.normals[0]).multiplyScalar(b.x),g.copy(f.binormals[0]).multiplyScalar(b.y),i.copy(v[0]).add(h).add(g),N(i.x,i.y,i.z)):N(b.x,b.y,0)}for(let a=1;a<=m;a++)for(let b=0;b<E;b++){let c=o?D(y[b],J[b],L):y[b];w?(h.copy(f.normals[a]).multiplyScalar(c.x),g.copy(f.binormals[a]).multiplyScalar(c.y),i.copy(v[a]).add(h).add(g),N(i.x,i.y,i.z)):N(c.x,c.y,n/m*a)}for(let a=s-1;a>=0;a--){let b=a/s,c=p*Math.cos(b*Math.PI/2),d=q*Math.sin(b*Math.PI/2)+r;for(let a=0,b=C.length;a<b;a++){let b=D(C[a],G[a],d);N(b.x,b.y,n+c)}for(let a=0,b=z.length;a<b;a++){let b=z[a];I=H[a];for(let a=0,e=b.length;a<e;a++){let e=D(b[a],I[a],d);w?N(e.x,e.y+v[m-1].y,v[m-1].x+c):N(e.x,e.y,n+c)}}}function M(a,b){let e=a.length;for(;--e>=0;){let f=e,g=e-1;g<0&&(g=a.length-1);for(let a=0,e=m+2*s;a<e;a++){let e=E*a,h=E*(a+1);!function(a,b,e,f){P(a),P(b),P(f),P(b),P(e),P(f);let g=d.length/3,h=u.generateSideWallUV(c,d,g-6,g-3,g-2,g-1);Q(h[0]),Q(h[1]),Q(h[3]),Q(h[1]),Q(h[2]),Q(h[3])}(b+f+e,b+g+e,b+g+h,b+f+h)}}}function N(a,b,c){k.push(a),k.push(b),k.push(c)}function O(a,b,e){P(a),P(b),P(e);let f=d.length/3,g=u.generateTopUV(c,d,f-3,f-2,f-1);Q(g[0]),Q(g[1]),Q(g[2])}function P(a){d.push(k[3*a+0]),d.push(k[3*a+1]),d.push(k[3*a+2])}function Q(a){e.push(a.x),e.push(a.y)}(function(){let a=d.length/3;if(o){let a=0*E;for(let b=0;b<K;b++){let c=j[b];O(c[2]+a,c[1]+a,c[0]+a)}a=E*(m+2*s);for(let b=0;b<K;b++){let c=j[b];O(c[0]+a,c[1]+a,c[2]+a)}}else{for(let a=0;a<K;a++){let b=j[a];O(b[2],b[1],b[0])}for(let a=0;a<K;a++){let b=j[a];O(b[0]+E*m,b[1]+E*m,b[2]+E*m)}}c.addGroup(a,d.length/3-a,0)})(),function(){let a=d.length/3,b=0;M(C,0),b+=C.length;for(let a=0,c=z.length;a<c;a++){let c=z[a];M(c,b),b+=c.length}c.addGroup(a,d.length/3-a,1)}()}(a[f]);this.setAttribute("position",new b2(d,3)),this.setAttribute("uv",new b2(e,2)),this.computeVertexNormals()}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}toJSON(){let a=super.toJSON();return function(a,b,c){if(c.shapes=[],Array.isArray(a))for(let b=0,d=a.length;b<d;b++){let d=a[b];c.shapes.push(d.uuid)}else c.shapes.push(a.uuid);return c.options=Object.assign({},b),void 0!==b.extrudePath&&(c.options.extrudePath=b.extrudePath.toJSON()),c}(this.parameters.shapes,this.parameters.options,a)}static fromJSON(a,b){let c=[];for(let d=0,e=a.shapes.length;d<e;d++){let e=b[a.shapes[d]];c.push(e)}let d=a.options.extrudePath;return void 0!==d&&(a.options.extrudePath=new eM[d.type]().fromJSON(d)),new e8(c,a.options)}}let e9={generateTopUV:function(a,b,c,d,e){let f=b[3*c],g=b[3*c+1],h=b[3*d],i=b[3*d+1],j=b[3*e],k=b[3*e+1];return[new aj(f,g),new aj(h,i),new aj(j,k)]},generateSideWallUV:function(a,b,c,d,e,f){let g=b[3*c],h=b[3*c+1],i=b[3*c+2],j=b[3*d],k=b[3*d+1],l=b[3*d+2],m=b[3*e],n=b[3*e+1],o=b[3*e+2],p=b[3*f],q=b[3*f+1],r=b[3*f+2];return Math.abs(h-k)<Math.abs(g-j)?[new aj(g,1-i),new aj(j,1-l),new aj(m,1-o),new aj(p,1-r)]:[new aj(h,1-i),new aj(k,1-l),new aj(n,1-o),new aj(q,1-r)]}};class fa extends em{constructor(a=1,b=0){const c=(1+Math.sqrt(5))/2;super([-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b),this.type="IcosahedronGeometry",this.parameters={radius:a,detail:b}}static fromJSON(a){return new fa(a.radius,a.detail)}}class fb extends ce{constructor(a=[new aj(0,-.5),new aj(.5,0),new aj(0,.5)],b=12,c=0,d=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:a,segments:b,phiStart:c,phiLength:d},b=Math.floor(b),d=ad(d,0,2*Math.PI);const e=[],f=[],g=[],h=[],i=[],j=1/b,k=new al,l=new aj,m=new al,n=new al,o=new al;let p=0,q=0;for(let b=0;b<=a.length-1;b++)switch(b){case 0:p=a[b+1].x-a[b].x,m.x=+(q=a[b+1].y-a[b].y),m.y=-p,m.z=0*q,o.copy(m),m.normalize(),h.push(m.x,m.y,m.z);break;case a.length-1:h.push(o.x,o.y,o.z);break;default:p=a[b+1].x-a[b].x,m.x=+(q=a[b+1].y-a[b].y),m.y=-p,m.z=0*q,n.copy(m),m.x+=o.x,m.y+=o.y,m.z+=o.z,m.normalize(),h.push(m.x,m.y,m.z),o.copy(n)}for(let e=0;e<=b;e++){const m=c+e*j*d,n=Math.sin(m),o=Math.cos(m);for(let c=0;c<=a.length-1;c++){k.x=a[c].x*n,k.y=a[c].y,k.z=a[c].x*o,f.push(k.x,k.y,k.z),l.x=e/b,l.y=c/(a.length-1),g.push(l.x,l.y);const d=h[3*c+0]*n,j=h[3*c+1],m=h[3*c+0]*o;i.push(d,j,m)}}for(let c=0;c<b;c++)for(let b=0;b<a.length-1;b++){const d=b+c*a.length,f=d+a.length,g=d+a.length+1,h=d+1;e.push(d,f,h),e.push(g,h,f)}this.setIndex(e),this.setAttribute("position",new b2(f,3)),this.setAttribute("uv",new b2(g,2)),this.setAttribute("normal",new b2(i,3))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new fb(a.points,a.segments,a.phiStart,a.phiLength)}}class fc extends em{constructor(a=1,b=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b),this.type="OctahedronGeometry",this.parameters={radius:a,detail:b}}static fromJSON(a){return new fc(a.radius,a.detail)}}class fd extends ce{constructor(a=1,b=1,c=1,d=1){super(),this.type="PlaneGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};const e=a/2,f=b/2,g=Math.floor(c),h=Math.floor(d),i=g+1,j=h+1,k=a/g,l=b/h,m=[],n=[],o=[],p=[];for(let a=0;a<j;a++){const b=a*l-f;for(let c=0;c<i;c++){const d=c*k-e;n.push(d,-b,0),o.push(0,0,1),p.push(c/g),p.push(1-a/h)}}for(let a=0;a<h;a++)for(let b=0;b<g;b++){const c=b+i*a,d=b+i*(a+1),e=b+1+i*(a+1),f=b+1+i*a;m.push(c,d,f),m.push(d,e,f)}this.setIndex(m),this.setAttribute("position",new b2(n,3)),this.setAttribute("normal",new b2(o,3)),this.setAttribute("uv",new b2(p,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new fd(a.width,a.height,a.widthSegments,a.heightSegments)}}class fe extends ce{constructor(a=.5,b=1,c=32,d=1,e=0,f=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f},c=Math.max(3,c);const g=[],h=[],i=[],j=[];let k=a;const l=(b-a)/(d=Math.max(1,d)),m=new al,n=new aj;for(let a=0;a<=d;a++){for(let a=0;a<=c;a++){const d=e+a/c*f;m.x=k*Math.cos(d),m.y=k*Math.sin(d),h.push(m.x,m.y,m.z),i.push(0,0,1),n.x=(m.x/b+1)/2,n.y=(m.y/b+1)/2,j.push(n.x,n.y)}k+=l}for(let a=0;a<d;a++){const b=a*(c+1);for(let a=0;a<c;a++){const d=a+b,e=d+c+1,f=d+c+2,h=d+1;g.push(d,e,h),g.push(e,f,h)}}this.setIndex(g),this.setAttribute("position",new b2(h,3)),this.setAttribute("normal",new b2(i,3)),this.setAttribute("uv",new b2(j,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new fe(a.innerRadius,a.outerRadius,a.thetaSegments,a.phiSegments,a.thetaStart,a.thetaLength)}}class ff extends ce{constructor(a=new eP([new aj(0,.5),new aj(-.5,-.5),new aj(.5,-.5)]),b=12){super(),this.type="ShapeGeometry",this.parameters={shapes:a,curveSegments:b};const c=[],d=[],e=[],f=[];let g=0,h=0;if(!1===Array.isArray(a))i(a);else for(let b=0;b<a.length;b++)i(a[b]),this.addGroup(g,h,b),g+=h,h=0;function i(a){let g=d.length/3,i=a.extractPoints(b),j=i.shape,k=i.holes;!1===e5.isClockWise(j)&&(j=j.reverse());for(let a=0,b=k.length;a<b;a++){let b=k[a];!0===e5.isClockWise(b)&&(k[a]=b.reverse())}let l=e5.triangulateShape(j,k);for(let a=0,b=k.length;a<b;a++){let b=k[a];j=j.concat(b)}for(let a=0,b=j.length;a<b;a++){let b=j[a];d.push(b.x,b.y,0),e.push(0,0,1),f.push(b.x,b.y)}for(let a=0,b=l.length;a<b;a++){let b=l[a],d=b[0]+g,e=b[1]+g,f=b[2]+g;c.push(d,e,f),h+=3}}this.setIndex(c),this.setAttribute("position",new b2(d,3)),this.setAttribute("normal",new b2(e,3)),this.setAttribute("uv",new b2(f,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}toJSON(){let a=super.toJSON();return function(a,b){if(b.shapes=[],Array.isArray(a))for(let c=0,d=a.length;c<d;c++){let d=a[c];b.shapes.push(d.uuid)}else b.shapes.push(a.uuid);return b}(this.parameters.shapes,a)}static fromJSON(a,b){let c=[];for(let d=0,e=a.shapes.length;d<e;d++){let e=b[a.shapes[d]];c.push(e)}return new ff(c,a.curveSegments)}}class fg extends ce{constructor(a=1,b=32,c=16,d=0,e=2*Math.PI,f=0,g=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g},b=Math.max(3,Math.floor(b)),c=Math.max(2,Math.floor(c));const h=Math.min(f+g,Math.PI);let i=0;const j=[],k=new al,l=new al,m=[],n=[],o=[],p=[];for(let m=0;m<=c;m++){const q=[],r=m/c;let s=0;0===m&&0===f?s=.5/b:m===c&&h===Math.PI&&(s=-.5/b);for(let c=0;c<=b;c++){const h=c/b;k.x=-a*Math.cos(d+h*e)*Math.sin(f+r*g),k.y=a*Math.cos(f+r*g),k.z=a*Math.sin(d+h*e)*Math.sin(f+r*g),n.push(k.x,k.y,k.z),l.copy(k).normalize(),o.push(l.x,l.y,l.z),p.push(h+s,1-r),q.push(i++)}j.push(q)}for(let a=0;a<c;a++)for(let d=0;d<b;d++){const b=j[a][d+1],e=j[a][d],g=j[a+1][d],i=j[a+1][d+1];(0!==a||f>0)&&m.push(b,e,i),(a!==c-1||h<Math.PI)&&m.push(e,g,i)}this.setIndex(m),this.setAttribute("position",new b2(n,3)),this.setAttribute("normal",new b2(o,3)),this.setAttribute("uv",new b2(p,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new fg(a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength)}}class fh extends em{constructor(a=1,b=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b),this.type="TetrahedronGeometry",this.parameters={radius:a,detail:b}}static fromJSON(a){return new fh(a.radius,a.detail)}}class fi extends ce{constructor(a=1,b=.4,c=12,d=48,e=2*Math.PI,f=0,g=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e,thetaStart:f,thetaLength:g},c=Math.floor(c),d=Math.floor(d);const h=[],i=[],j=[],k=[],l=new al,m=new al,n=new al;for(let h=0;h<=c;h++){const o=f+h/c*g;for(let f=0;f<=d;f++){const g=f/d*e;m.x=(a+b*Math.cos(o))*Math.cos(g),m.y=(a+b*Math.cos(o))*Math.sin(g),m.z=b*Math.sin(o),i.push(m.x,m.y,m.z),l.x=a*Math.cos(g),l.y=a*Math.sin(g),n.subVectors(m,l).normalize(),j.push(n.x,n.y,n.z),k.push(f/d),k.push(h/c)}}for(let a=1;a<=c;a++)for(let b=1;b<=d;b++){const c=(d+1)*a+b-1,e=(d+1)*(a-1)+b-1,f=(d+1)*(a-1)+b,g=(d+1)*a+b;h.push(c,e,g),h.push(e,f,g)}this.setIndex(h),this.setAttribute("position",new b2(i,3)),this.setAttribute("normal",new b2(j,3)),this.setAttribute("uv",new b2(k,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new fi(a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc)}}class fj extends ce{constructor(a=1,b=.4,c=64,d=8,e=2,f=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:a,tube:b,tubularSegments:c,radialSegments:d,p:e,q:f},c=Math.floor(c),d=Math.floor(d);const g=[],h=[],i=[],j=[],k=new al,l=new al,m=new al,n=new al,o=new al,p=new al,q=new al;for(let g=0;g<=c;++g){const s=g/c*e*Math.PI*2;r(s,e,f,a,m),r(s+.01,e,f,a,n),p.subVectors(n,m),q.addVectors(n,m),o.crossVectors(p,q),q.crossVectors(o,p),o.normalize(),q.normalize();for(let a=0;a<=d;++a){const e=a/d*Math.PI*2,f=-b*Math.cos(e),n=b*Math.sin(e);k.x=m.x+(f*q.x+n*o.x),k.y=m.y+(f*q.y+n*o.y),k.z=m.z+(f*q.z+n*o.z),h.push(k.x,k.y,k.z),l.subVectors(k,m).normalize(),i.push(l.x,l.y,l.z),j.push(g/c),j.push(a/d)}}for(let a=1;a<=c;a++)for(let b=1;b<=d;b++){const c=(d+1)*(a-1)+(b-1),e=(d+1)*a+(b-1),f=(d+1)*a+b,h=(d+1)*(a-1)+b;g.push(c,e,h),g.push(e,f,h)}function r(a,b,c,d,e){let f=Math.cos(a),g=Math.sin(a),h=c/b*a,i=Math.cos(h);e.x=d*(2+i)*.5*f,e.y=d*(2+i)*g*.5,e.z=d*Math.sin(h)*.5}this.setIndex(g),this.setAttribute("position",new b2(h,3)),this.setAttribute("normal",new b2(i,3)),this.setAttribute("uv",new b2(j,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}static fromJSON(a){return new fj(a.radius,a.tube,a.tubularSegments,a.radialSegments,a.p,a.q)}}class fk extends ce{constructor(a=new eK(new al(-1,-1,0),new al(-1,1,0),new al(1,1,0)),b=64,c=1,d=8,e=!1){super(),this.type="TubeGeometry",this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};const f=a.computeFrenetFrames(b,e);this.tangents=f.tangents,this.normals=f.normals,this.binormals=f.binormals;const g=new al,h=new al,i=new aj;let j=new al;const k=[],l=[],m=[],n=[];function o(e){j=a.getPointAt(e/b,j);let i=f.normals[e],m=f.binormals[e];for(let a=0;a<=d;a++){let b=a/d*Math.PI*2,e=Math.sin(b),f=-Math.cos(b);h.x=f*i.x+e*m.x,h.y=f*i.y+e*m.y,h.z=f*i.z+e*m.z,h.normalize(),l.push(h.x,h.y,h.z),g.x=j.x+c*h.x,g.y=j.y+c*h.y,g.z=j.z+c*h.z,k.push(g.x,g.y,g.z)}}(function(){for(let a=0;a<b;a++)o(a);o(!1===e?b:0),function(){for(let a=0;a<=b;a++)for(let c=0;c<=d;c++)i.x=a/b,i.y=c/d,m.push(i.x,i.y)}(),function(){for(let a=1;a<=b;a++)for(let b=1;b<=d;b++){let c=(d+1)*(a-1)+(b-1),e=(d+1)*a+(b-1),f=(d+1)*a+b,g=(d+1)*(a-1)+b;n.push(c,e,g),n.push(e,f,g)}}()})(),this.setIndex(n),this.setAttribute("position",new b2(k,3)),this.setAttribute("normal",new b2(l,3)),this.setAttribute("uv",new b2(m,2))}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}toJSON(){let a=super.toJSON();return a.path=this.parameters.path.toJSON(),a}static fromJSON(a){return new fk(new eM[a.path.type]().fromJSON(a.path),a.tubularSegments,a.radius,a.radialSegments,a.closed)}}class fl extends ce{constructor(a=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:a},null!==a){const b=[],c=new Set,d=new al,e=new al;if(null!==a.index){const f=a.attributes.position,g=a.index;let h=a.groups;0===h.length&&(h=[{start:0,count:g.count,materialIndex:0}]);for(let a=0,i=h.length;a<i;++a){const i=h[a],j=i.start,k=i.count;for(let a=j,h=j+k;a<h;a+=3)for(let h=0;h<3;h++){const i=g.getX(a+h),j=g.getX(a+(h+1)%3);d.fromBufferAttribute(f,i),e.fromBufferAttribute(f,j),!0===fm(d,e,c)&&(b.push(d.x,d.y,d.z),b.push(e.x,e.y,e.z))}}}else{const f=a.attributes.position;for(let a=0,g=f.count/3;a<g;a++)for(let g=0;g<3;g++){const h=3*a+g,i=3*a+(g+1)%3;d.fromBufferAttribute(f,h),e.fromBufferAttribute(f,i),!0===fm(d,e,c)&&(b.push(d.x,d.y,d.z),b.push(e.x,e.y,e.z))}}this.setAttribute("position",new b2(b,3))}}copy(a){return super.copy(a),this.parameters=Object.assign({},a.parameters),this}}function fm(a,b,c){let d=`${a.x},${a.y},${a.z}-${b.x},${b.y},${b.z}`,e=`${b.x},${b.y},${b.z}-${a.x},${a.y},${a.z}`;return!0!==c.has(d)&&!0!==c.has(e)&&(c.add(d),c.add(e),!0)}var fn=Object.freeze({__proto__:null,BoxGeometry:eh,CapsuleGeometry:ei,CircleGeometry:ej,ConeGeometry:el,CylinderGeometry:ek,DodecahedronGeometry:en,EdgesGeometry:es,ExtrudeGeometry:e8,IcosahedronGeometry:fa,LatheGeometry:fb,OctahedronGeometry:fc,PlaneGeometry:fd,PolyhedronGeometry:em,RingGeometry:fe,ShapeGeometry:ff,SphereGeometry:fg,TetrahedronGeometry:fh,TorusGeometry:fi,TorusKnotGeometry:fj,TubeGeometry:fk,WireframeGeometry:fl});class fo extends cj{constructor(a){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new bg(0),this.transparent=!0,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.fog=a.fog,this}}function fp(a){let b={};for(let c in a)for(let d in b[c]={},a[c]){let e=a[c][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)?e.isRenderTargetTexture?(U("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),b[c][d]=null):b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}return b}function fq(a){let b={};for(let c=0;c<a.length;c++){let d=fp(a[c]);for(let a in d)b[a]=d[a]}return b}function fr(a){let b=a.getRenderTarget();return null===b?a.outputColorSpace:!0===b.isXRRenderTarget?b.texture.colorSpace:as.workingColorSpace}let fs={clone:fp,merge:fq};class ft extends cj{constructor(a){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==a&&this.setValues(a)}copy(a){return super.copy(a),this.fragmentShader=a.fragmentShader,this.vertexShader=a.vertexShader,this.uniforms=fp(a.uniforms),this.uniformsGroups=function(a){let b=[];for(let c=0;c<a.length;c++)b.push(a[c].clone());return b}(a.uniformsGroups),this.defines=Object.assign({},a.defines),this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.fog=a.fog,this.lights=a.lights,this.clipping=a.clipping,this.extensions=Object.assign({},a.extensions),this.glslVersion=a.glslVersion,this.defaultAttributeValues=Object.assign({},a.defaultAttributeValues),this.index0AttributeName=a.index0AttributeName,this.uniformsNeedUpdate=a.uniformsNeedUpdate,this}toJSON(a){let b=super.toJSON(a);for(let c in b.glslVersion=this.glslVersion,b.uniforms={},this.uniforms){let d=this.uniforms[c].value;d&&d.isTexture?b.uniforms[c]={type:"t",value:d.toJSON(a).uuid}:d&&d.isColor?b.uniforms[c]={type:"c",value:d.getHex()}:d&&d.isVector2?b.uniforms[c]={type:"v2",value:d.toArray()}:d&&d.isVector3?b.uniforms[c]={type:"v3",value:d.toArray()}:d&&d.isVector4?b.uniforms[c]={type:"v4",value:d.toArray()}:d&&d.isMatrix3?b.uniforms[c]={type:"m3",value:d.toArray()}:d&&d.isMatrix4?b.uniforms[c]={type:"m4",value:d.toArray()}:b.uniforms[c]={value:d}}Object.keys(this.defines).length>0&&(b.defines=this.defines),b.vertexShader=this.vertexShader,b.fragmentShader=this.fragmentShader,b.lights=this.lights,b.clipping=this.clipping;let c={};for(let a in this.extensions)!0===this.extensions[a]&&(c[a]=!0);return Object.keys(c).length>0&&(b.extensions=c),b}}class fu extends ft{constructor(a){super(a),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class fv extends cj{constructor(a){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new bg(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new aj(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aT,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.defines={STANDARD:""},this.color.copy(a.color),this.roughness=a.roughness,this.metalness=a.metalness,this.map=a.map,this.lightMap=a.lightMap,this.lightMapIntensity=a.lightMapIntensity,this.aoMap=a.aoMap,this.aoMapIntensity=a.aoMapIntensity,this.emissive.copy(a.emissive),this.emissiveMap=a.emissiveMap,this.emissiveIntensity=a.emissiveIntensity,this.bumpMap=a.bumpMap,this.bumpScale=a.bumpScale,this.normalMap=a.normalMap,this.normalMapType=a.normalMapType,this.normalScale.copy(a.normalScale),this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.roughnessMap=a.roughnessMap,this.metalnessMap=a.metalnessMap,this.alphaMap=a.alphaMap,this.envMap=a.envMap,this.envMapRotation.copy(a.envMapRotation),this.envMapIntensity=a.envMapIntensity,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.wireframeLinecap=a.wireframeLinecap,this.wireframeLinejoin=a.wireframeLinejoin,this.flatShading=a.flatShading,this.fog=a.fog,this}}class fw extends fv{constructor(a){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new aj(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ad(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(a){this.ior=(1+.4*a)/(1-.4*a)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new bg(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new bg(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new bg(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(a)}get anisotropy(){return this._anisotropy}set anisotropy(a){this._anisotropy>0!=a>0&&this.version++,this._anisotropy=a}get clearcoat(){return this._clearcoat}set clearcoat(a){this._clearcoat>0!=a>0&&this.version++,this._clearcoat=a}get iridescence(){return this._iridescence}set iridescence(a){this._iridescence>0!=a>0&&this.version++,this._iridescence=a}get dispersion(){return this._dispersion}set dispersion(a){this._dispersion>0!=a>0&&this.version++,this._dispersion=a}get sheen(){return this._sheen}set sheen(a){this._sheen>0!=a>0&&this.version++,this._sheen=a}get transmission(){return this._transmission}set transmission(a){this._transmission>0!=a>0&&this.version++,this._transmission=a}copy(a){return super.copy(a),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=a.anisotropy,this.anisotropyRotation=a.anisotropyRotation,this.anisotropyMap=a.anisotropyMap,this.clearcoat=a.clearcoat,this.clearcoatMap=a.clearcoatMap,this.clearcoatRoughness=a.clearcoatRoughness,this.clearcoatRoughnessMap=a.clearcoatRoughnessMap,this.clearcoatNormalMap=a.clearcoatNormalMap,this.clearcoatNormalScale.copy(a.clearcoatNormalScale),this.dispersion=a.dispersion,this.ior=a.ior,this.iridescence=a.iridescence,this.iridescenceMap=a.iridescenceMap,this.iridescenceIOR=a.iridescenceIOR,this.iridescenceThicknessRange=[...a.iridescenceThicknessRange],this.iridescenceThicknessMap=a.iridescenceThicknessMap,this.sheen=a.sheen,this.sheenColor.copy(a.sheenColor),this.sheenColorMap=a.sheenColorMap,this.sheenRoughness=a.sheenRoughness,this.sheenRoughnessMap=a.sheenRoughnessMap,this.transmission=a.transmission,this.transmissionMap=a.transmissionMap,this.thickness=a.thickness,this.thicknessMap=a.thicknessMap,this.attenuationDistance=a.attenuationDistance,this.attenuationColor.copy(a.attenuationColor),this.specularIntensity=a.specularIntensity,this.specularIntensityMap=a.specularIntensityMap,this.specularColor.copy(a.specularColor),this.specularColorMap=a.specularColorMap,this}}class fx extends cj{constructor(a){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new bg(0xffffff),this.specular=new bg(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new aj(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aT,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.specular.copy(a.specular),this.shininess=a.shininess,this.map=a.map,this.lightMap=a.lightMap,this.lightMapIntensity=a.lightMapIntensity,this.aoMap=a.aoMap,this.aoMapIntensity=a.aoMapIntensity,this.emissive.copy(a.emissive),this.emissiveMap=a.emissiveMap,this.emissiveIntensity=a.emissiveIntensity,this.bumpMap=a.bumpMap,this.bumpScale=a.bumpScale,this.normalMap=a.normalMap,this.normalMapType=a.normalMapType,this.normalScale.copy(a.normalScale),this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.specularMap=a.specularMap,this.alphaMap=a.alphaMap,this.envMap=a.envMap,this.envMapRotation.copy(a.envMapRotation),this.combine=a.combine,this.reflectivity=a.reflectivity,this.envMapIntensity=a.envMapIntensity,this.refractionRatio=a.refractionRatio,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.wireframeLinecap=a.wireframeLinecap,this.wireframeLinejoin=a.wireframeLinejoin,this.flatShading=a.flatShading,this.fog=a.fog,this}}class fy extends cj{constructor(a){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new bg(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new aj(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.map=a.map,this.gradientMap=a.gradientMap,this.lightMap=a.lightMap,this.lightMapIntensity=a.lightMapIntensity,this.aoMap=a.aoMap,this.aoMapIntensity=a.aoMapIntensity,this.emissive.copy(a.emissive),this.emissiveMap=a.emissiveMap,this.emissiveIntensity=a.emissiveIntensity,this.bumpMap=a.bumpMap,this.bumpScale=a.bumpScale,this.normalMap=a.normalMap,this.normalMapType=a.normalMapType,this.normalScale.copy(a.normalScale),this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.alphaMap=a.alphaMap,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.wireframeLinecap=a.wireframeLinecap,this.wireframeLinejoin=a.wireframeLinejoin,this.fog=a.fog,this}}class fz extends cj{constructor(a){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new aj(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(a)}copy(a){return super.copy(a),this.bumpMap=a.bumpMap,this.bumpScale=a.bumpScale,this.normalMap=a.normalMap,this.normalMapType=a.normalMapType,this.normalScale.copy(a.normalScale),this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.flatShading=a.flatShading,this}}class fA extends cj{constructor(a){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new bg(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new aj(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aT,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.color.copy(a.color),this.map=a.map,this.lightMap=a.lightMap,this.lightMapIntensity=a.lightMapIntensity,this.aoMap=a.aoMap,this.aoMapIntensity=a.aoMapIntensity,this.emissive.copy(a.emissive),this.emissiveMap=a.emissiveMap,this.emissiveIntensity=a.emissiveIntensity,this.bumpMap=a.bumpMap,this.bumpScale=a.bumpScale,this.normalMap=a.normalMap,this.normalMapType=a.normalMapType,this.normalScale.copy(a.normalScale),this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.specularMap=a.specularMap,this.alphaMap=a.alphaMap,this.envMap=a.envMap,this.envMapRotation.copy(a.envMapRotation),this.combine=a.combine,this.reflectivity=a.reflectivity,this.envMapIntensity=a.envMapIntensity,this.refractionRatio=a.refractionRatio,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.wireframeLinecap=a.wireframeLinecap,this.wireframeLinejoin=a.wireframeLinejoin,this.flatShading=a.flatShading,this.fog=a.fog,this}}class fB extends cj{constructor(a){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(a)}copy(a){return super.copy(a),this.depthPacking=a.depthPacking,this.map=a.map,this.alphaMap=a.alphaMap,this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this}}class fC extends cj{constructor(a){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(a)}copy(a){return super.copy(a),this.map=a.map,this.alphaMap=a.alphaMap,this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this}}class fD extends cj{constructor(a){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new bg(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new aj(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(a)}copy(a){return super.copy(a),this.defines={MATCAP:""},this.color.copy(a.color),this.matcap=a.matcap,this.map=a.map,this.bumpMap=a.bumpMap,this.bumpScale=a.bumpScale,this.normalMap=a.normalMap,this.normalMapType=a.normalMapType,this.normalScale.copy(a.normalScale),this.displacementMap=a.displacementMap,this.displacementScale=a.displacementScale,this.displacementBias=a.displacementBias,this.alphaMap=a.alphaMap,this.wireframe=a.wireframe,this.wireframeLinewidth=a.wireframeLinewidth,this.flatShading=a.flatShading,this.fog=a.fog,this}}class fE extends dN{constructor(a){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(a)}copy(a){return super.copy(a),this.scale=a.scale,this.dashSize=a.dashSize,this.gapSize=a.gapSize,this}}function fF(a,b){return a&&a.constructor!==b?"number"==typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a):a}function fG(a){let b=a.length,c=Array(b);for(let a=0;a!==b;++a)c[a]=a;return c.sort(function(b,c){return a[b]-a[c]}),c}function fH(a,b,c){let d=a.length,e=new a.constructor(d);for(let f=0,g=0;g!==d;++f){let d=c[f]*b;for(let c=0;c!==b;++c)e[g++]=a[d+c]}return e}function fI(a,b,c,d){let e=1,f=a[0];for(;void 0!==f&&void 0===f[d];)f=a[e++];if(void 0===f)return;let g=f[d];if(void 0!==g)if(Array.isArray(g))do void 0!==(g=f[d])&&(b.push(f.time),c.push(...g)),f=a[e++];while(void 0!==f)else if(void 0!==g.toArray)do void 0!==(g=f[d])&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)else do void 0!==(g=f[d])&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}class fJ{static convertArray(a,b){return fF(a,b)}static isTypedArray(a){return L(a)}static getKeyframeOrder(a){return fG(a)}static sortedArray(a,b,c){return fH(a,b,c)}static flattenJSON(a,b,c,d){fI(a,b,c,d)}static subclip(a,b,c,d,e=30){return function(a,b,c,d,e=30){let f=a.clone();f.name=b;let g=[];for(let a=0;a<f.tracks.length;++a){let b=f.tracks[a],h=b.getValueSize(),i=[],j=[];for(let a=0;a<b.times.length;++a){let f=b.times[a]*e;if(!(f<c)&&!(f>=d)){i.push(b.times[a]);for(let c=0;c<h;++c)j.push(b.values[a*h+c])}}0!==i.length&&(b.times=fF(i,b.times.constructor),b.values=fF(j,b.values.constructor),g.push(b))}f.tracks=g;let h=1/0;for(let a=0;a<f.tracks.length;++a)h>f.tracks[a].times[0]&&(h=f.tracks[a].times[0]);for(let a=0;a<f.tracks.length;++a)f.tracks[a].shift(-1*h);return f.resetDuration(),f}(a,b,c,d,e)}static makeClipAdditive(a,b=0,c=a,d=30){return function(a,b=0,c=a,d=30){d<=0&&(d=30);let e=c.tracks.length,f=b/d;for(let b=0;b<e;++b){let d,e=c.tracks[b],g=e.ValueTypeName;if("bool"===g||"string"===g)continue;let h=a.tracks.find(function(a){return a.name===e.name&&a.ValueTypeName===g});if(void 0===h)continue;let i=0,j=e.getValueSize();e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(i=j/3);let k=0,l=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(k=l/3);let m=e.times.length-1;if(f<=e.times[0]){let a=i,b=j-i;d=e.values.slice(a,b)}else if(f>=e.times[m]){let a=m*j+i,b=a+j-i;d=e.values.slice(a,b)}else{let a=e.createInterpolant(),b=i,c=j-i;a.evaluate(f),d=a.resultBuffer.slice(b,c)}"quaternion"===g&&new ak().fromArray(d).normalize().conjugate().toArray(d);let n=h.times.length;for(let a=0;a<n;++a){let b=a*l+k;if("quaternion"===g)ak.multiplyQuaternionsFlat(h.values,b,d,0,h.values,b);else{let a=l-2*k;for(let c=0;c<a;++c)h.values[b+c]-=d[c]}}}return a.blendMode=2501,a}(a,b,c,d)}}class fK{constructor(a,b,c,d){this.parameterPositions=a,this._cachedIndex=0,this.resultBuffer=void 0!==d?d:new b.constructor(c),this.sampleValues=b,this.valueSize=c,this.settings=null,this.DefaultSettings_={}}evaluate(a){let b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];c:{d:{let f;e:{f:if(!(a<d)){for(let f=c+2;;){if(void 0===d){if(a<e)break f;return c=b.length,this._cachedIndex=c,this.copySampleValue_(c-1)}if(c===f)break;if(e=d,a<(d=b[++c]))break d}f=b.length;break e}if(!(a>=e)){let g=b[1];a<g&&(c=2,e=g);for(let f=c-2;;){if(void 0===e)return this._cachedIndex=0,this.copySampleValue_(0);if(c===f)break;if(d=e,a>=(e=b[--c-1]))break d}f=c,c=0;break e}break c}for(;c<f;){let d=c+f>>>1;a<b[d]?f=d:c=d+1}if(d=b[c],void 0===(e=b[c-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===d)return c=b.length,this._cachedIndex=c,this.copySampleValue_(c-1)}this._cachedIndex=c,this.intervalChanged_(c,e,d)}return this.interpolate_(c,e,a,d)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(a){let b=this.resultBuffer,c=this.sampleValues,d=this.valueSize,e=a*d;for(let a=0;a!==d;++a)b[a]=c[e+a];return b}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class fL extends fK{constructor(a,b,c,d){super(a,b,c,d),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(a,b,c){let d=this.parameterPositions,e=a-2,f=a+1,g=d[e],h=d[f];if(void 0===g)switch(this.getSettings_().endingStart){case 2401:e=a,g=2*b-c;break;case 2402:e=d.length-2,g=b+d[e]-d[e+1];break;default:e=a,g=c}if(void 0===h)switch(this.getSettings_().endingEnd){case 2401:f=a,h=2*c-b;break;case 2402:f=1,h=c+d[1]-d[0];break;default:f=a-1,h=b}let i=(c-b)*.5,j=this.valueSize;this._weightPrev=i/(b-g),this._weightNext=i/(h-c),this._offsetPrev=e*j,this._offsetNext=f*j}interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=a*g,i=h-g,j=this._offsetPrev,k=this._offsetNext,l=this._weightPrev,m=this._weightNext,n=(c-b)/(d-b),o=n*n,p=o*n,q=-l*p+2*l*o-l*n,r=(1+l)*p+(-1.5-2*l)*o+(-.5+l)*n+1,s=(-1-m)*p+(1.5+m)*o+.5*n,t=m*p-m*o;for(let a=0;a!==g;++a)e[a]=q*f[j+a]+r*f[i+a]+s*f[h+a]+t*f[k+a];return e}}class fM extends fK{constructor(a,b,c,d){super(a,b,c,d)}interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=a*g,i=h-g,j=(c-b)/(d-b),k=1-j;for(let a=0;a!==g;++a)e[a]=f[i+a]*k+f[h+a]*j;return e}}class fN extends fK{constructor(a,b,c,d){super(a,b,c,d)}interpolate_(a){return this.copySampleValue_(a-1)}}class fO extends fK{interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=a*g,i=h-g,j=this.settings||this.DefaultSettings_,k=j.inTangents,l=j.outTangents;if(!k||!l){let a=(c-b)/(d-b),j=1-a;for(let b=0;b!==g;++b)e[b]=f[i+b]*j+f[h+b]*a;return e}let m=2*g,n=a-1;for(let j=0;j!==g;++j){let g,o,p,q,r,s=f[i+j],t=f[h+j],u=n*m+2*j,v=l[u],w=l[u+1],x=a*m+2*j,y=k[x],z=k[x+1],A=(c-b)/(d-b);for(let a=0;a<8;a++){o=(g=A*A)*A;let a=(r=(q=(p=1-A)*p)*p)*b+3*q*A*v+3*p*g*y+o*d-c;if(1e-10>Math.abs(a))break;let e=3*q*(v-b)+6*p*A*(y-v)+3*g*(d-y);if(1e-10>Math.abs(e))break;A-=a/e,A=Math.max(0,Math.min(1,A))}e[j]=r*s+3*q*A*w+3*p*g*z+o*t}return e}}class fP{constructor(a,b,c,d){if(void 0===a)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===b||0===b.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+a);this.name=a,this.times=fF(b,this.TimeBufferType),this.values=fF(c,this.ValueBufferType),this.setInterpolation(d||this.DefaultInterpolation)}static toJSON(a){let b,c=a.constructor;if(c.toJSON!==this.toJSON)b=c.toJSON(a);else{b={name:a.name,times:fF(a.times,Array),values:fF(a.values,Array)};let c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}return b.type=a.ValueTypeName,b}InterpolantFactoryMethodDiscrete(a){return new fN(this.times,this.values,this.getValueSize(),a)}InterpolantFactoryMethodLinear(a){return new fM(this.times,this.values,this.getValueSize(),a)}InterpolantFactoryMethodSmooth(a){return new fL(this.times,this.values,this.getValueSize(),a)}InterpolantFactoryMethodBezier(a){let b=new fO(this.times,this.values,this.getValueSize(),a);return this.settings&&(b.settings=this.settings),b}setInterpolation(a){let b;switch(a){case 2300:b=this.InterpolantFactoryMethodDiscrete;break;case 2301:b=this.InterpolantFactoryMethodLinear;break;case 2302:b=this.InterpolantFactoryMethodSmooth;break;case 2303:b=this.InterpolantFactoryMethodBezier}if(void 0===b){let b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(b);return U("KeyframeTrack:",b),this}return this.createInterpolant=b,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(a){if(0!==a){let b=this.times;for(let c=0,d=b.length;c!==d;++c)b[c]+=a}return this}scale(a){if(1!==a){let b=this.times;for(let c=0,d=b.length;c!==d;++c)b[c]*=a}return this}trim(a,b){let c=this.times,d=c.length,e=0,f=d-1;for(;e!==d&&c[e]<a;)++e;for(;-1!==f&&c[f]>b;)--f;if(++f,0!==e||f!==d){e>=f&&(e=(f=Math.max(f,1))-1);let a=this.getValueSize();this.times=c.slice(e,f),this.values=this.values.slice(e*a,f*a)}return this}validate(){let a=!0,b=this.getValueSize();b-Math.floor(b)!=0&&(V("KeyframeTrack: Invalid value size in track.",this),a=!1);let c=this.times,d=this.values,e=c.length;0===e&&(V("KeyframeTrack: Track is empty.",this),a=!1);let f=null;for(let b=0;b!==e;b++){let d=c[b];if("number"==typeof d&&isNaN(d)){V("KeyframeTrack: Time is not a valid number.",this,b,d),a=!1;break}if(null!==f&&f>d){V("KeyframeTrack: Out of order keys.",this,b,d,f),a=!1;break}f=d}if(void 0!==d&&L(d))for(let b=0,c=d.length;b!==c;++b){let c=d[b];if(isNaN(c)){V("KeyframeTrack: Value is not a valid number.",this,b,c),a=!1;break}}return a}optimize(){let a=this.times.slice(),b=this.values.slice(),c=this.getValueSize(),d=2302===this.getInterpolation(),e=a.length-1,f=1;for(let g=1;g<e;++g){let e=!1,h=a[g];if(h!==a[g+1]&&(1!==g||h!==a[0]))if(d)e=!0;else{let a=g*c,d=a-c,f=a+c;for(let g=0;g!==c;++g){let c=b[a+g];if(c!==b[d+g]||c!==b[f+g]){e=!0;break}}}if(e){if(g!==f){a[f]=a[g];let d=g*c,e=f*c;for(let a=0;a!==c;++a)b[e+a]=b[d+a]}++f}}if(e>0){a[f]=a[e];for(let a=e*c,d=f*c,g=0;g!==c;++g)b[d+g]=b[a+g];++f}return f!==a.length?(this.times=a.slice(0,f),this.values=b.slice(0,f*c)):(this.times=a,this.values=b),this}clone(){let a=this.times.slice(),b=this.values.slice(),c=new this.constructor(this.name,a,b);return c.createInterpolant=this.createInterpolant,c}}fP.prototype.ValueTypeName="",fP.prototype.TimeBufferType=Float32Array,fP.prototype.ValueBufferType=Float32Array,fP.prototype.DefaultInterpolation=2301;class fQ extends fP{constructor(a,b,c){super(a,b,c)}}fQ.prototype.ValueTypeName="bool",fQ.prototype.ValueBufferType=Array,fQ.prototype.DefaultInterpolation=2300,fQ.prototype.InterpolantFactoryMethodLinear=void 0,fQ.prototype.InterpolantFactoryMethodSmooth=void 0;class fR extends fP{constructor(a,b,c,d){super(a,b,c,d)}}fR.prototype.ValueTypeName="color";class fS extends fP{constructor(a,b,c,d){super(a,b,c,d)}}fS.prototype.ValueTypeName="number";class fT extends fK{constructor(a,b,c,d){super(a,b,c,d)}interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=(c-b)/(d-b),i=a*g;for(let a=i+g;i!==a;i+=4)ak.slerpFlat(e,0,f,i-g,f,i,h);return e}}class fU extends fP{constructor(a,b,c,d){super(a,b,c,d)}InterpolantFactoryMethodLinear(a){return new fT(this.times,this.values,this.getValueSize(),a)}}fU.prototype.ValueTypeName="quaternion",fU.prototype.InterpolantFactoryMethodSmooth=void 0;class fV extends fP{constructor(a,b,c){super(a,b,c)}}fV.prototype.ValueTypeName="string",fV.prototype.ValueBufferType=Array,fV.prototype.DefaultInterpolation=2300,fV.prototype.InterpolantFactoryMethodLinear=void 0,fV.prototype.InterpolantFactoryMethodSmooth=void 0;class fW extends fP{constructor(a,b,c,d){super(a,b,c,d)}}fW.prototype.ValueTypeName="vector";class fX{constructor(a="",b=-1,c=[],d=2500){this.name=a,this.tracks=c,this.duration=b,this.blendMode=d,this.uuid=ac(),this.userData={},this.duration<0&&this.resetDuration()}static parse(a){let b=[],c=a.tracks,d=1/(a.fps||1);for(let a=0,e=c.length;a!==e;++a)b.push((function(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let b=function(a){switch(a.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return fS;case"vector":case"vector2":case"vector3":case"vector4":return fW;case"color":return fR;case"quaternion":return fU;case"bool":case"boolean":return fQ;case"string":return fV}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a)}(a.type);if(void 0===a.times){let b=[],c=[];fI(a.keys,b,c,"value"),a.times=b,a.values=c}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)})(c[a]).scale(d));let e=new this(a.name,a.duration,b,a.blendMode);return e.uuid=a.uuid,e.userData=JSON.parse(a.userData||"{}"),e}static toJSON(a){let b=[],c=a.tracks,d={name:a.name,duration:a.duration,tracks:b,uuid:a.uuid,blendMode:a.blendMode,userData:JSON.stringify(a.userData)};for(let a=0,d=c.length;a!==d;++a)b.push(fP.toJSON(c[a]));return d}static CreateFromMorphTargetSequence(a,b,c,d){let e=b.length,f=[];for(let a=0;a<e;a++){let g=[],h=[];g.push((a+e-1)%e,a,(a+1)%e),h.push(0,1,0);let i=fG(g);g=fH(g,1,i),h=fH(h,1,i),d||0!==g[0]||(g.push(e),h.push(h[0])),f.push(new fS(".morphTargetInfluences["+b[a].name+"]",g,h).scale(1/c))}return new this(a,-1,f)}static findByName(a,b){let c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(let a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null}static CreateClipsFromMorphTargetSequences(a,b,c){let d={},e=/^([\w-]*?)([\d]+)$/;for(let b=0,c=a.length;b<c;b++){let c=a[b],f=c.name.match(e);if(f&&f.length>1){let a=f[1],b=d[a];b||(d[a]=b=[]),b.push(c)}}let f=[];for(let a in d)f.push(this.CreateFromMorphTargetSequence(a,d[a],b,c));return f}static parseAnimation(a,b){if(U("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!a)return V("AnimationClip: No animation in JSONLoader data."),null;let c=function(a,b,c,d,e){if(0!==c.length){let f=[],g=[];fI(c,f,g,d),0!==f.length&&e.push(new a(b,f,g))}},d=[],e=a.name||"default",f=a.fps||30,g=a.blendMode,h=a.length||-1,i=a.hierarchy||[];for(let a=0;a<i.length;a++){let e=i[a].keys;if(e&&0!==e.length)if(e[0].morphTargets){let a,b={};for(a=0;a<e.length;a++)if(e[a].morphTargets)for(let c=0;c<e[a].morphTargets.length;c++)b[e[a].morphTargets[c]]=-1;for(let c in b){let b=[],f=[];for(let d=0;d!==e[a].morphTargets.length;++d){let d=e[a];b.push(d.time),f.push(+(d.morphTarget===c))}d.push(new fS(".morphTargetInfluence["+c+"]",b,f))}h=b.length*f}else{let f=".bones["+b[a].name+"]";c(fW,f+".position",e,"pos",d),c(fU,f+".quaternion",e,"rot",d),c(fW,f+".scale",e,"scl",d)}}return 0===d.length?null:new this(e,h,d,g)}resetDuration(){let a=this.tracks,b=0;for(let c=0,d=a.length;c!==d;++c){let a=this.tracks[c];b=Math.max(b,a.times[a.times.length-1])}return this.duration=b,this}trim(){for(let a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this}validate(){let a=!0;for(let b=0;b<this.tracks.length;b++)a=a&&this.tracks[b].validate();return a}optimize(){for(let a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this}clone(){let a=[];for(let b=0;b<this.tracks.length;b++)a.push(this.tracks[b].clone());let b=new this.constructor(this.name,this.duration,a,this.blendMode);return b.userData=JSON.parse(JSON.stringify(this.userData)),b}toJSON(){return this.constructor.toJSON(this)}}let fY={enabled:!1,files:{},add:function(a,b){!1===this.enabled||fZ(a)||(this.files[a]=b)},get:function(a){if(!1!==this.enabled&&!fZ(a))return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};function fZ(a){try{let b=a.slice(a.indexOf(":")+1),c=new URL(b);return"blob:"===c.protocol}catch(a){return!1}}class f${constructor(a,b,c){let d;const e=this;let f=!1,g=0,h=0;const i=[];this.onStart=void 0,this.onLoad=a,this.onProgress=b,this.onError=c,this._abortController=null,this.itemStart=function(a){h++,!1===f&&void 0!==e.onStart&&e.onStart(a,g,h),f=!0},this.itemEnd=function(a){g++,void 0!==e.onProgress&&e.onProgress(a,g,h),g===h&&(f=!1,void 0!==e.onLoad&&e.onLoad())},this.itemError=function(a){void 0!==e.onError&&e.onError(a)},this.resolveURL=function(a){return d?d(a):a},this.setURLModifier=function(a){return d=a,this},this.addHandler=function(a,b){return i.push(a,b),this},this.removeHandler=function(a){let b=i.indexOf(a);return -1!==b&&i.splice(b,2),this},this.getHandler=function(a){for(let b=0,c=i.length;b<c;b+=2){let c=i[b],d=i[b+1];if(c.global&&(c.lastIndex=0),c.test(a))return d}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}let f_=new f$;class f0{constructor(a){this.manager=void 0!==a?a:f_,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(a,b){let c=this;return new Promise(function(d,e){c.load(a,d,b,e)})}parse(){}setCrossOrigin(a){return this.crossOrigin=a,this}setWithCredentials(a){return this.withCredentials=a,this}setPath(a){return this.path=a,this}setResourcePath(a){return this.resourcePath=a,this}setRequestHeader(a){return this.requestHeader=a,this}abort(){return this}}f0.DEFAULT_MATERIAL_NAME="__DEFAULT";let f1={};class f2 extends Error{constructor(a,b){super(a),this.response=b}}class f3 extends f0{constructor(a){super(a),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(a,b,c,d){void 0===a&&(a=""),void 0!==this.path&&(a=this.path+a),a=this.manager.resolveURL(a);let e=fY.get(`file:${a}`);if(void 0!==e)return this.manager.itemStart(a),setTimeout(()=>{b&&b(e),this.manager.itemEnd(a)},0),e;if(void 0!==f1[a])return void f1[a].push({onLoad:b,onProgress:c,onError:d});f1[a]=[],f1[a].push({onLoad:b,onProgress:c,onError:d});let f=new Request(a,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),g=this.mimeType,h=this.responseType;fetch(f).then(b=>{if(200===b.status||0===b.status){if(0===b.status&&U("FileLoader: HTTP Status 0 received."),"u"<typeof ReadableStream||void 0===b.body||void 0===b.body.getReader)return b;let c=f1[a],d=b.body.getReader(),e=b.headers.get("X-File-Size")||b.headers.get("Content-Length"),f=e?parseInt(e):0,g=0!==f,h=0;return new Response(new ReadableStream({start(a){!function b(){d.read().then(({done:d,value:e})=>{if(d)a.close();else{let d=new ProgressEvent("progress",{lengthComputable:g,loaded:h+=e.byteLength,total:f});for(let a=0,b=c.length;a<b;a++){let b=c[a];b.onProgress&&b.onProgress(d)}a.enqueue(e),b()}},b=>{a.error(b)})}()}}))}throw new f2(`fetch for "${b.url}" responded with ${b.status}: ${b.statusText}`,b)}).then(a=>{switch(h){case"arraybuffer":return a.arrayBuffer();case"blob":return a.blob();case"document":return a.text().then(a=>new DOMParser().parseFromString(a,g));case"json":return a.json();default:if(""===g)return a.text();{let b=/charset="?([^;"\s]*)"?/i.exec(g),c=new TextDecoder(b&&b[1]?b[1].toLowerCase():void 0);return a.arrayBuffer().then(a=>c.decode(a))}}}).then(b=>{fY.add(`file:${a}`,b);let c=f1[a];delete f1[a];for(let a=0,d=c.length;a<d;a++){let d=c[a];d.onLoad&&d.onLoad(b)}}).catch(b=>{let c=f1[a];if(void 0===c)throw this.manager.itemError(a),b;delete f1[a];for(let a=0,d=c.length;a<d;a++){let d=c[a];d.onError&&d.onError(b)}this.manager.itemError(a)}).finally(()=>{this.manager.itemEnd(a)}),this.manager.itemStart(a)}setResponseType(a){return this.responseType=a,this}setMimeType(a){return this.mimeType=a,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class f4 extends f0{constructor(a){super(a)}load(a,b,c,d){let e=this,f=new f3(this.manager);f.setPath(this.path),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(a,function(c){try{b(e.parse(JSON.parse(c)))}catch(b){d?d(b):V(b),e.manager.itemError(a)}},c,d)}parse(a){let b=[];for(let c=0;c<a.length;c++){let d=fX.parse(a[c]);b.push(d)}return b}}class f5 extends f0{constructor(a){super(a)}load(a,b,c,d){let e=this,f=[],g=new d9,h=new f3(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(e.withCredentials);let i=0;if(Array.isArray(a))for(let j=0,k=a.length;j<k;++j)!function(j){h.load(a[j],function(a){let c=e.parse(a,!0);f[j]={width:c.width,height:c.height,format:c.format,mipmaps:c.mipmaps},6===(i+=1)&&(1===c.mipmapCount&&(g.minFilter=1006),g.image=f,g.format=c.format,g.needsUpdate=!0,b&&b(g))},c,d)}(j);else h.load(a,function(a){let c=e.parse(a,!0);if(c.isCubemap){let a=c.mipmaps.length/c.mipmapCount;for(let b=0;b<a;b++){f[b]={mipmaps:[]};for(let a=0;a<c.mipmapCount;a++)f[b].mipmaps.push(c.mipmaps[b*c.mipmapCount+a]),f[b].format=c.format,f[b].width=c.width,f[b].height=c.height}g.image=f}else g.image.width=c.width,g.image.height=c.height,g.mipmaps=c.mipmaps;1===c.mipmapCount&&(g.minFilter=1006),g.format=c.format,g.needsUpdate=!0,b&&b(g)},c,d);return g}}let f6=new WeakMap;class f7 extends f0{constructor(a){super(a)}load(a,b,c,d){void 0!==this.path&&(a=this.path+a),a=this.manager.resolveURL(a);let e=this,f=fY.get(`image:${a}`);if(void 0!==f){if(!0===f.complete)e.manager.itemStart(a),setTimeout(function(){b&&b(f),e.manager.itemEnd(a)},0);else{let a=f6.get(f);void 0===a&&(a=[],f6.set(f,a)),a.push({onLoad:b,onError:d})}return f}let g=M("img");function h(){j(),b&&b(this);let c=f6.get(this)||[];for(let a=0;a<c.length;a++){let b=c[a];b.onLoad&&b.onLoad(this)}f6.delete(this),e.manager.itemEnd(a)}function i(b){j(),d&&d(b),fY.remove(`image:${a}`);let c=f6.get(this)||[];for(let a=0;a<c.length;a++){let d=c[a];d.onError&&d.onError(b)}f6.delete(this),e.manager.itemError(a),e.manager.itemEnd(a)}function j(){g.removeEventListener("load",h,!1),g.removeEventListener("error",i,!1)}return g.addEventListener("load",h,!1),g.addEventListener("error",i,!1),"data:"!==a.slice(0,5)&&void 0!==this.crossOrigin&&(g.crossOrigin=this.crossOrigin),fY.add(`image:${a}`,g),e.manager.itemStart(a),g.src=a,g}}class f8 extends f0{constructor(a){super(a)}load(a,b,c,d){let e=new ec;e.colorSpace=A;let f=new f7(this.manager);f.setCrossOrigin(this.crossOrigin),f.setPath(this.path);let g=0;for(let c=0;c<a.length;++c)!function(c){f.load(a[c],function(a){e.images[c]=a,6==++g&&(e.needsUpdate=!0,b&&b(e))},void 0,d)}(c);return e}}class f9 extends f0{constructor(a){super(a)}load(a,b,c,d){let e=this,f=new c7,g=new f3(this.manager);return g.setResponseType("arraybuffer"),g.setRequestHeader(this.requestHeader),g.setPath(this.path),g.setWithCredentials(e.withCredentials),g.load(a,function(a){let c;try{c=e.parse(a)}catch(a){if(void 0===d)return void a(a);d(a)}void 0!==c.image?f.image=c.image:void 0!==c.data&&(f.image.width=c.width,f.image.height=c.height,f.image.data=c.data),f.wrapS=void 0!==c.wrapS?c.wrapS:1001,f.wrapT=void 0!==c.wrapT?c.wrapT:1001,f.magFilter=void 0!==c.magFilter?c.magFilter:1006,f.minFilter=void 0!==c.minFilter?c.minFilter:1006,f.anisotropy=void 0!==c.anisotropy?c.anisotropy:1,void 0!==c.colorSpace&&(f.colorSpace=c.colorSpace),void 0!==c.flipY&&(f.flipY=c.flipY),void 0!==c.format&&(f.format=c.format),void 0!==c.type&&(f.type=c.type),void 0!==c.mipmaps&&(f.mipmaps=c.mipmaps,f.minFilter=1008),1===c.mipmapCount&&(f.minFilter=1006),void 0!==c.generateMipmaps&&(f.generateMipmaps=c.generateMipmaps),f.needsUpdate=!0,b&&b(f,c)},c,d),f}}class ga extends f0{constructor(a){super(a)}load(a,b,c,d){let e=new aB,f=new f7(this.manager);return f.setCrossOrigin(this.crossOrigin),f.setPath(this.path),f.load(a,function(a){e.image=a,e.needsUpdate=!0,void 0!==b&&b(e)},c,d),e}}class gb extends a8{constructor(a,b=1){super(),this.isLight=!0,this.type="Light",this.color=new bg(a),this.intensity=b}dispose(){this.dispatchEvent({type:"dispose"})}copy(a,b){return super.copy(a,b),this.color.copy(a.color),this.intensity=a.intensity,this}toJSON(a){let b=super.toJSON(a);return b.object.color=this.color.getHex(),b.object.intensity=this.intensity,b}}class gc extends gb{constructor(a,b,c){super(a,c),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(a8.DEFAULT_UP),this.updateMatrix(),this.groundColor=new bg(b)}copy(a,b){return super.copy(a,b),this.groundColor.copy(a.groundColor),this}toJSON(a){let b=super.toJSON(a);return b.object.groundColor=this.groundColor.getHex(),b}}let gd=new aJ,ge=new al,gf=new al;class gg{constructor(a){this.camera=a,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new aj(512,512),this.mapType=1009,this.map=null,this.mapPass=null,this.matrix=new aJ,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ds,this._frameExtents=new aj(1,1),this._viewportCount=1,this._viewports=[new aC(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(a){let b=this.camera,c=this.matrix;ge.setFromMatrixPosition(a.matrixWorld),b.position.copy(ge),gf.setFromMatrixPosition(a.target.matrixWorld),b.lookAt(gf),b.updateMatrixWorld(),gd.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gd,b.coordinateSystem,b.reversedDepth),2001===b.coordinateSystem||b.reversedDepth?c.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):c.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),c.multiply(gd)}getViewport(a){return this._viewports[a]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(a){return this.camera=a.camera.clone(),this.intensity=a.intensity,this.bias=a.bias,this.radius=a.radius,this.autoUpdate=a.autoUpdate,this.needsUpdate=a.needsUpdate,this.normalBias=a.normalBias,this.blurSamples=a.blurSamples,this.mapSize.copy(a.mapSize),this.biasNode=a.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let a={};return 1!==this.intensity&&(a.intensity=this.intensity),0!==this.bias&&(a.bias=this.bias),0!==this.normalBias&&(a.normalBias=this.normalBias),1!==this.radius&&(a.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(a.mapSize=this.mapSize.toArray()),a.camera=this.camera.toJSON(!1).object,delete a.camera.matrix,a}}let gh=new al,gi=new ak,gj=new al;class gk extends a8{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new aJ,this.projectionMatrix=new aJ,this.projectionMatrixInverse=new aJ,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(a,b){return super.copy(a,b),this.matrixWorldInverse.copy(a.matrixWorldInverse),this.projectionMatrix.copy(a.projectionMatrix),this.projectionMatrixInverse.copy(a.projectionMatrixInverse),this.coordinateSystem=a.coordinateSystem,this}getWorldDirection(a){return super.getWorldDirection(a).negate()}updateMatrixWorld(a){super.updateMatrixWorld(a),this.matrixWorld.decompose(gh,gi,gj),1===gj.x&&1===gj.y&&1===gj.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(gh,gi,gj.set(1,1,1)).invert()}updateWorldMatrix(a,b){super.updateWorldMatrix(a,b),this.matrixWorld.decompose(gh,gi,gj),1===gj.x&&1===gj.y&&1===gj.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(gh,gi,gj.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}let gl=new al,gm=new aj,gn=new aj;class go extends gk{constructor(a=50,b=1,c=.1,d=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=a,this.zoom=1,this.near=c,this.far=d,this.focus=10,this.aspect=b,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(a,b){return super.copy(a,b),this.fov=a.fov,this.zoom=a.zoom,this.near=a.near,this.far=a.far,this.focus=a.focus,this.aspect=a.aspect,this.view=null===a.view?null:Object.assign({},a.view),this.filmGauge=a.filmGauge,this.filmOffset=a.filmOffset,this}setFocalLength(a){let b=.5*this.getFilmHeight()/a;this.fov=2*ab*Math.atan(b),this.updateProjectionMatrix()}getFocalLength(){let a=Math.tan(.5*aa*this.fov);return .5*this.getFilmHeight()/a}getEffectiveFOV(){return 2*ab*Math.atan(Math.tan(.5*aa*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(a,b,c){gl.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),b.set(gl.x,gl.y).multiplyScalar(-a/gl.z),gl.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),c.set(gl.x,gl.y).multiplyScalar(-a/gl.z)}getViewSize(a,b){return this.getViewBounds(a,gm,gn),b.subVectors(gn,gm)}setViewOffset(a,b,c,d,e,f){this.aspect=a/b,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=a,this.view.fullHeight=b,this.view.offsetX=c,this.view.offsetY=d,this.view.width=e,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let a=this.near,b=a*Math.tan(.5*aa*this.fov)/this.zoom,c=2*b,d=this.aspect*c,e=-.5*d,f=this.view;if(null!==this.view&&this.view.enabled){let a=f.fullWidth,g=f.fullHeight;e+=f.offsetX*d/a,b-=f.offsetY*c/g,d*=f.width/a,c*=f.height/g}let g=this.filmOffset;0!==g&&(e+=a*g/this.getFilmWidth()),this.projectionMatrix.makePerspective(e,e+d,b,b-c,a,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(a){let b=super.toJSON(a);return b.object.fov=this.fov,b.object.zoom=this.zoom,b.object.near=this.near,b.object.far=this.far,b.object.focus=this.focus,b.object.aspect=this.aspect,null!==this.view&&(b.object.view=Object.assign({},this.view)),b.object.filmGauge=this.filmGauge,b.object.filmOffset=this.filmOffset,b}}class gp extends gg{constructor(){super(new go(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(a){let b=this.camera,c=2*ab*a.angle*this.focus,d=this.mapSize.width/this.mapSize.height*this.aspect,e=a.distance||b.far;(c!==b.fov||d!==b.aspect||e!==b.far)&&(b.fov=c,b.aspect=d,b.far=e,b.updateProjectionMatrix()),super.updateMatrices(a)}copy(a){return super.copy(a),this.focus=a.focus,this}}class gq extends gb{constructor(a,b,c=0,d=Math.PI/3,e=0,f=2){super(a,b),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(a8.DEFAULT_UP),this.updateMatrix(),this.target=new a8,this.distance=c,this.angle=d,this.penumbra=e,this.decay=f,this.map=null,this.shadow=new gp}get power(){return this.intensity*Math.PI}set power(a){this.intensity=a/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(a,b){return super.copy(a,b),this.distance=a.distance,this.angle=a.angle,this.penumbra=a.penumbra,this.decay=a.decay,this.target=a.target.clone(),this.map=a.map,this.shadow=a.shadow.clone(),this}toJSON(a){let b=super.toJSON(a);return b.object.distance=this.distance,b.object.angle=this.angle,b.object.decay=this.decay,b.object.penumbra=this.penumbra,b.object.target=this.target.uuid,this.map&&this.map.isTexture&&(b.object.map=this.map.toJSON(a).uuid),b.object.shadow=this.shadow.toJSON(),b}}class gr extends gg{constructor(){super(new go(90,1,.5,500)),this.isPointLightShadow=!0}}class gs extends gb{constructor(a,b,c=0,d=2){super(a,b),this.isPointLight=!0,this.type="PointLight",this.distance=c,this.decay=d,this.shadow=new gr}get power(){return 4*this.intensity*Math.PI}set power(a){this.intensity=a/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(a,b){return super.copy(a,b),this.distance=a.distance,this.decay=a.decay,this.shadow=a.shadow.clone(),this}toJSON(a){let b=super.toJSON(a);return b.object.distance=this.distance,b.object.decay=this.decay,b.object.shadow=this.shadow.toJSON(),b}}class gt extends gk{constructor(a=-1,b=1,c=1,d=-1,e=.1,f=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=a,this.right=b,this.top=c,this.bottom=d,this.near=e,this.far=f,this.updateProjectionMatrix()}copy(a,b){return super.copy(a,b),this.left=a.left,this.right=a.right,this.top=a.top,this.bottom=a.bottom,this.near=a.near,this.far=a.far,this.zoom=a.zoom,this.view=null===a.view?null:Object.assign({},a.view),this}setViewOffset(a,b,c,d,e,f){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=a,this.view.fullHeight=b,this.view.offsetX=c,this.view.offsetY=d,this.view.width=e,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2,e=c-a,f=c+a,g=d+b,h=d-b;if(null!==this.view&&this.view.enabled){let a=(this.right-this.left)/this.view.fullWidth/this.zoom,b=(this.top-this.bottom)/this.view.fullHeight/this.zoom;e+=a*this.view.offsetX,f=e+a*this.view.width,g-=b*this.view.offsetY,h=g-b*this.view.height}this.projectionMatrix.makeOrthographic(e,f,g,h,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(a){let b=super.toJSON(a);return b.object.zoom=this.zoom,b.object.left=this.left,b.object.right=this.right,b.object.top=this.top,b.object.bottom=this.bottom,b.object.near=this.near,b.object.far=this.far,null!==this.view&&(b.object.view=Object.assign({},this.view)),b}}class gu extends gg{constructor(){super(new gt(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class gv extends gb{constructor(a,b){super(a,b),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(a8.DEFAULT_UP),this.updateMatrix(),this.target=new a8,this.shadow=new gu}dispose(){super.dispose(),this.shadow.dispose()}copy(a){return super.copy(a),this.target=a.target.clone(),this.shadow=a.shadow.clone(),this}toJSON(a){let b=super.toJSON(a);return b.object.shadow=this.shadow.toJSON(),b.object.target=this.target.uuid,b}}class gw extends gb{constructor(a,b){super(a,b),this.isAmbientLight=!0,this.type="AmbientLight"}}class gx extends gb{constructor(a,b,c=10,d=10){super(a,b),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=c,this.height=d}get power(){return this.intensity*this.width*this.height*Math.PI}set power(a){this.intensity=a/(this.width*this.height*Math.PI)}copy(a){return super.copy(a),this.width=a.width,this.height=a.height,this}toJSON(a){let b=super.toJSON(a);return b.object.width=this.width,b.object.height=this.height,b}}class gy{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let a=0;a<9;a++)this.coefficients.push(new al)}set(a){for(let b=0;b<9;b++)this.coefficients[b].copy(a[b]);return this}zero(){for(let a=0;a<9;a++)this.coefficients[a].set(0,0,0);return this}getAt(a,b){let c=a.x,d=a.y,e=a.z,f=this.coefficients;return b.copy(f[0]).multiplyScalar(.282095),b.addScaledVector(f[1],.488603*d),b.addScaledVector(f[2],.488603*e),b.addScaledVector(f[3],.488603*c),b.addScaledVector(f[4],c*d*1.092548),b.addScaledVector(f[5],d*e*1.092548),b.addScaledVector(f[6],.315392*(3*e*e-1)),b.addScaledVector(f[7],c*e*1.092548),b.addScaledVector(f[8],.546274*(c*c-d*d)),b}getIrradianceAt(a,b){let c=a.x,d=a.y,e=a.z,f=this.coefficients;return b.copy(f[0]).multiplyScalar(.886227),b.addScaledVector(f[1],1.023328*d),b.addScaledVector(f[2],1.023328*e),b.addScaledVector(f[3],1.023328*c),b.addScaledVector(f[4],.858086*c*d),b.addScaledVector(f[5],.858086*d*e),b.addScaledVector(f[6],.743125*e*e-.247708),b.addScaledVector(f[7],.858086*c*e),b.addScaledVector(f[8],.429043*(c*c-d*d)),b}add(a){for(let b=0;b<9;b++)this.coefficients[b].add(a.coefficients[b]);return this}addScaledSH(a,b){for(let c=0;c<9;c++)this.coefficients[c].addScaledVector(a.coefficients[c],b);return this}scale(a){for(let b=0;b<9;b++)this.coefficients[b].multiplyScalar(a);return this}lerp(a,b){for(let c=0;c<9;c++)this.coefficients[c].lerp(a.coefficients[c],b);return this}equals(a){for(let b=0;b<9;b++)if(!this.coefficients[b].equals(a.coefficients[b]))return!1;return!0}copy(a){return this.set(a.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(a,b=0){let c=this.coefficients;for(let d=0;d<9;d++)c[d].fromArray(a,b+3*d);return this}toArray(a=[],b=0){let c=this.coefficients;for(let d=0;d<9;d++)c[d].toArray(a,b+3*d);return a}static getBasisAt(a,b){let c=a.x,d=a.y,e=a.z;b[0]=.282095,b[1]=.488603*d,b[2]=.488603*e,b[3]=.488603*c,b[4]=1.092548*c*d,b[5]=1.092548*d*e,b[6]=.315392*(3*e*e-1),b[7]=1.092548*c*e,b[8]=.546274*(c*c-d*d)}}class gz extends gb{constructor(a=new gy,b=1){super(void 0,b),this.isLightProbe=!0,this.sh=a}copy(a){return super.copy(a),this.sh.copy(a.sh),this}toJSON(a){let b=super.toJSON(a);return b.object.sh=this.sh.toArray(),b}}class gA extends f0{constructor(a){super(a),this.textures={}}load(a,b,c,d){let e=this,f=new f3(e.manager);f.setPath(e.path),f.setRequestHeader(e.requestHeader),f.setWithCredentials(e.withCredentials),f.load(a,function(c){try{b(e.parse(JSON.parse(c)))}catch(b){d?d(b):V(b),e.manager.itemError(a)}},c,d)}parse(a){let b=this.textures;function c(a){return void 0===b[a]&&U("MaterialLoader: Undefined texture",a),b[a]}let d=this.createMaterialFromType(a.type);if(void 0!==a.uuid&&(d.uuid=a.uuid),void 0!==a.name&&(d.name=a.name),void 0!==a.color&&void 0!==d.color&&d.color.setHex(a.color),void 0!==a.roughness&&(d.roughness=a.roughness),void 0!==a.metalness&&(d.metalness=a.metalness),void 0!==a.sheen&&(d.sheen=a.sheen),void 0!==a.sheenColor&&(d.sheenColor=new bg().setHex(a.sheenColor)),void 0!==a.sheenRoughness&&(d.sheenRoughness=a.sheenRoughness),void 0!==a.emissive&&void 0!==d.emissive&&d.emissive.setHex(a.emissive),void 0!==a.specular&&void 0!==d.specular&&d.specular.setHex(a.specular),void 0!==a.specularIntensity&&(d.specularIntensity=a.specularIntensity),void 0!==a.specularColor&&void 0!==d.specularColor&&d.specularColor.setHex(a.specularColor),void 0!==a.shininess&&(d.shininess=a.shininess),void 0!==a.clearcoat&&(d.clearcoat=a.clearcoat),void 0!==a.clearcoatRoughness&&(d.clearcoatRoughness=a.clearcoatRoughness),void 0!==a.dispersion&&(d.dispersion=a.dispersion),void 0!==a.iridescence&&(d.iridescence=a.iridescence),void 0!==a.iridescenceIOR&&(d.iridescenceIOR=a.iridescenceIOR),void 0!==a.iridescenceThicknessRange&&(d.iridescenceThicknessRange=a.iridescenceThicknessRange),void 0!==a.transmission&&(d.transmission=a.transmission),void 0!==a.thickness&&(d.thickness=a.thickness),void 0!==a.attenuationDistance&&(d.attenuationDistance=a.attenuationDistance),void 0!==a.attenuationColor&&void 0!==d.attenuationColor&&d.attenuationColor.setHex(a.attenuationColor),void 0!==a.anisotropy&&(d.anisotropy=a.anisotropy),void 0!==a.anisotropyRotation&&(d.anisotropyRotation=a.anisotropyRotation),void 0!==a.fog&&(d.fog=a.fog),void 0!==a.flatShading&&(d.flatShading=a.flatShading),void 0!==a.blending&&(d.blending=a.blending),void 0!==a.combine&&(d.combine=a.combine),void 0!==a.side&&(d.side=a.side),void 0!==a.shadowSide&&(d.shadowSide=a.shadowSide),void 0!==a.opacity&&(d.opacity=a.opacity),void 0!==a.transparent&&(d.transparent=a.transparent),void 0!==a.alphaTest&&(d.alphaTest=a.alphaTest),void 0!==a.alphaHash&&(d.alphaHash=a.alphaHash),void 0!==a.depthFunc&&(d.depthFunc=a.depthFunc),void 0!==a.depthTest&&(d.depthTest=a.depthTest),void 0!==a.depthWrite&&(d.depthWrite=a.depthWrite),void 0!==a.colorWrite&&(d.colorWrite=a.colorWrite),void 0!==a.blendSrc&&(d.blendSrc=a.blendSrc),void 0!==a.blendDst&&(d.blendDst=a.blendDst),void 0!==a.blendEquation&&(d.blendEquation=a.blendEquation),void 0!==a.blendSrcAlpha&&(d.blendSrcAlpha=a.blendSrcAlpha),void 0!==a.blendDstAlpha&&(d.blendDstAlpha=a.blendDstAlpha),void 0!==a.blendEquationAlpha&&(d.blendEquationAlpha=a.blendEquationAlpha),void 0!==a.blendColor&&void 0!==d.blendColor&&d.blendColor.setHex(a.blendColor),void 0!==a.blendAlpha&&(d.blendAlpha=a.blendAlpha),void 0!==a.stencilWriteMask&&(d.stencilWriteMask=a.stencilWriteMask),void 0!==a.stencilFunc&&(d.stencilFunc=a.stencilFunc),void 0!==a.stencilRef&&(d.stencilRef=a.stencilRef),void 0!==a.stencilFuncMask&&(d.stencilFuncMask=a.stencilFuncMask),void 0!==a.stencilFail&&(d.stencilFail=a.stencilFail),void 0!==a.stencilZFail&&(d.stencilZFail=a.stencilZFail),void 0!==a.stencilZPass&&(d.stencilZPass=a.stencilZPass),void 0!==a.stencilWrite&&(d.stencilWrite=a.stencilWrite),void 0!==a.wireframe&&(d.wireframe=a.wireframe),void 0!==a.wireframeLinewidth&&(d.wireframeLinewidth=a.wireframeLinewidth),void 0!==a.wireframeLinecap&&(d.wireframeLinecap=a.wireframeLinecap),void 0!==a.wireframeLinejoin&&(d.wireframeLinejoin=a.wireframeLinejoin),void 0!==a.rotation&&(d.rotation=a.rotation),void 0!==a.linewidth&&(d.linewidth=a.linewidth),void 0!==a.dashSize&&(d.dashSize=a.dashSize),void 0!==a.gapSize&&(d.gapSize=a.gapSize),void 0!==a.scale&&(d.scale=a.scale),void 0!==a.polygonOffset&&(d.polygonOffset=a.polygonOffset),void 0!==a.polygonOffsetFactor&&(d.polygonOffsetFactor=a.polygonOffsetFactor),void 0!==a.polygonOffsetUnits&&(d.polygonOffsetUnits=a.polygonOffsetUnits),void 0!==a.dithering&&(d.dithering=a.dithering),void 0!==a.alphaToCoverage&&(d.alphaToCoverage=a.alphaToCoverage),void 0!==a.premultipliedAlpha&&(d.premultipliedAlpha=a.premultipliedAlpha),void 0!==a.forceSinglePass&&(d.forceSinglePass=a.forceSinglePass),void 0!==a.allowOverride&&(d.allowOverride=a.allowOverride),void 0!==a.visible&&(d.visible=a.visible),void 0!==a.toneMapped&&(d.toneMapped=a.toneMapped),void 0!==a.userData&&(d.userData=a.userData),void 0!==a.vertexColors&&("number"==typeof a.vertexColors?d.vertexColors=a.vertexColors>0:d.vertexColors=a.vertexColors),void 0!==a.uniforms)for(let b in a.uniforms){let e=a.uniforms[b];switch(d.uniforms[b]={},e.type){case"t":d.uniforms[b].value=c(e.value);break;case"c":d.uniforms[b].value=new bg().setHex(e.value);break;case"v2":d.uniforms[b].value=new aj().fromArray(e.value);break;case"v3":d.uniforms[b].value=new al().fromArray(e.value);break;case"v4":d.uniforms[b].value=new aC().fromArray(e.value);break;case"m3":d.uniforms[b].value=new ao().fromArray(e.value);break;case"m4":d.uniforms[b].value=new aJ().fromArray(e.value);break;default:d.uniforms[b].value=e.value}}if(void 0!==a.defines&&(d.defines=a.defines),void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader),void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader),void 0!==a.glslVersion&&(d.glslVersion=a.glslVersion),void 0!==a.extensions)for(let b in a.extensions)d.extensions[b]=a.extensions[b];if(void 0!==a.lights&&(d.lights=a.lights),void 0!==a.clipping&&(d.clipping=a.clipping),void 0!==a.size&&(d.size=a.size),void 0!==a.sizeAttenuation&&(d.sizeAttenuation=a.sizeAttenuation),void 0!==a.map&&(d.map=c(a.map)),void 0!==a.matcap&&(d.matcap=c(a.matcap)),void 0!==a.alphaMap&&(d.alphaMap=c(a.alphaMap)),void 0!==a.bumpMap&&(d.bumpMap=c(a.bumpMap)),void 0!==a.bumpScale&&(d.bumpScale=a.bumpScale),void 0!==a.normalMap&&(d.normalMap=c(a.normalMap)),void 0!==a.normalMapType&&(d.normalMapType=a.normalMapType),void 0!==a.normalScale){let b=a.normalScale;!1===Array.isArray(b)&&(b=[b,b]),d.normalScale=new aj().fromArray(b)}return void 0!==a.displacementMap&&(d.displacementMap=c(a.displacementMap)),void 0!==a.displacementScale&&(d.displacementScale=a.displacementScale),void 0!==a.displacementBias&&(d.displacementBias=a.displacementBias),void 0!==a.roughnessMap&&(d.roughnessMap=c(a.roughnessMap)),void 0!==a.metalnessMap&&(d.metalnessMap=c(a.metalnessMap)),void 0!==a.emissiveMap&&(d.emissiveMap=c(a.emissiveMap)),void 0!==a.emissiveIntensity&&(d.emissiveIntensity=a.emissiveIntensity),void 0!==a.specularMap&&(d.specularMap=c(a.specularMap)),void 0!==a.specularIntensityMap&&(d.specularIntensityMap=c(a.specularIntensityMap)),void 0!==a.specularColorMap&&(d.specularColorMap=c(a.specularColorMap)),void 0!==a.envMap&&(d.envMap=c(a.envMap)),void 0!==a.envMapRotation&&d.envMapRotation.fromArray(a.envMapRotation),void 0!==a.envMapIntensity&&(d.envMapIntensity=a.envMapIntensity),void 0!==a.reflectivity&&(d.reflectivity=a.reflectivity),void 0!==a.refractionRatio&&(d.refractionRatio=a.refractionRatio),void 0!==a.lightMap&&(d.lightMap=c(a.lightMap)),void 0!==a.lightMapIntensity&&(d.lightMapIntensity=a.lightMapIntensity),void 0!==a.aoMap&&(d.aoMap=c(a.aoMap)),void 0!==a.aoMapIntensity&&(d.aoMapIntensity=a.aoMapIntensity),void 0!==a.gradientMap&&(d.gradientMap=c(a.gradientMap)),void 0!==a.clearcoatMap&&(d.clearcoatMap=c(a.clearcoatMap)),void 0!==a.clearcoatRoughnessMap&&(d.clearcoatRoughnessMap=c(a.clearcoatRoughnessMap)),void 0!==a.clearcoatNormalMap&&(d.clearcoatNormalMap=c(a.clearcoatNormalMap)),void 0!==a.clearcoatNormalScale&&(d.clearcoatNormalScale=new aj().fromArray(a.clearcoatNormalScale)),void 0!==a.iridescenceMap&&(d.iridescenceMap=c(a.iridescenceMap)),void 0!==a.iridescenceThicknessMap&&(d.iridescenceThicknessMap=c(a.iridescenceThicknessMap)),void 0!==a.transmissionMap&&(d.transmissionMap=c(a.transmissionMap)),void 0!==a.thicknessMap&&(d.thicknessMap=c(a.thicknessMap)),void 0!==a.anisotropyMap&&(d.anisotropyMap=c(a.anisotropyMap)),void 0!==a.sheenColorMap&&(d.sheenColorMap=c(a.sheenColorMap)),void 0!==a.sheenRoughnessMap&&(d.sheenRoughnessMap=c(a.sheenRoughnessMap)),d}setTextures(a){return this.textures=a,this}createMaterialFromType(a){return gA.createMaterialFromType(a)}static createMaterialFromType(a){return new({ShadowMaterial:fo,SpriteMaterial:ck,RawShaderMaterial:fu,ShaderMaterial:ft,PointsMaterial:d_,MeshPhysicalMaterial:fw,MeshStandardMaterial:fv,MeshPhongMaterial:fx,MeshToonMaterial:fy,MeshNormalMaterial:fz,MeshLambertMaterial:fA,MeshDepthMaterial:fB,MeshDistanceMaterial:fC,MeshBasicMaterial:cK,MeshMatcapMaterial:fD,LineDashedMaterial:fE,LineBasicMaterial:dN,Material:cj})[a]}}class gB{static extractUrlBase(a){let b=a.lastIndexOf("/");return -1===b?"./":a.slice(0,b+1)}static resolveURL(a,b){return"string"!=typeof a||""===a?"":(/^https?:\/\//i.test(b)&&/^\//.test(a)&&(b=b.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(a)||/^data:.*,.*$/i.test(a)||/^blob:.*$/i.test(a))?a:b+a}}class gC extends ce{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(a){return super.copy(a),this.instanceCount=a.instanceCount,this}toJSON(){let a=super.toJSON();return a.instanceCount=this.instanceCount,a.isInstancedBufferGeometry=!0,a}}class gD extends f0{constructor(a){super(a)}load(a,b,c,d){let e=this,f=new f3(e.manager);f.setPath(e.path),f.setRequestHeader(e.requestHeader),f.setWithCredentials(e.withCredentials),f.load(a,function(c){try{b(e.parse(JSON.parse(c)))}catch(b){d?d(b):V(b),e.manager.itemError(a)}},c,d)}parse(a){let b={},c={};function d(a,d){if(void 0!==b[d])return b[d];let e=a.interleavedBuffers[d],f=function(a,b){if(void 0!==c[b])return c[b];let d=new Uint32Array(a.arrayBuffers[b]).buffer;return c[b]=d,d}(a,e.buffer),g=new cf(K(e.type,f),e.stride);return g.uuid=e.uuid,b[d]=g,g}let e=a.isInstancedBufferGeometry?new gC:new ce,f=a.data.index;if(void 0!==f){let a=K(f.type,f.array);e.setIndex(new bV(a,1))}let g=a.data.attributes;for(let b in g){let c,f=g[b];if(f.isInterleavedBufferAttribute)c=new ch(d(a.data,f.data),f.itemSize,f.offset,f.normalized);else{let a=K(f.type,f.array);c=new(f.isInstancedBufferAttribute?db:bV)(a,f.itemSize,f.normalized)}void 0!==f.name&&(c.name=f.name),void 0!==f.usage&&c.setUsage(f.usage),e.setAttribute(b,c)}let h=a.data.morphAttributes;if(h)for(let b in h){let c=h[b],f=[];for(let b=0,e=c.length;b<e;b++){let e,g=c[b];e=g.isInterleavedBufferAttribute?new ch(d(a.data,g.data),g.itemSize,g.offset,g.normalized):new bV(K(g.type,g.array),g.itemSize,g.normalized),void 0!==g.name&&(e.name=g.name),f.push(e)}e.morphAttributes[b]=f}a.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);let i=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==i)for(let a=0,b=i.length;a!==b;++a){let b=i[a];e.addGroup(b.start,b.count,b.materialIndex)}let j=a.data.boundingSphere;return void 0!==j&&(e.boundingSphere=new b6().fromJSON(j)),a.name&&(e.name=a.name),a.userData&&(e.userData=a.userData),e}}class gE extends f0{constructor(a){super(a)}load(a,b,c,d){let e=this,f=""===this.path?gB.extractUrlBase(a):this.path;this.resourcePath=this.resourcePath||f;let g=new f3(this.manager);g.setPath(this.path),g.setRequestHeader(this.requestHeader),g.setWithCredentials(this.withCredentials),g.load(a,function(c){let f=null;try{f=JSON.parse(c)}catch(b){void 0!==d&&d(b),b("ObjectLoader: Can't parse "+a+".",b.message);return}let g=f.metadata;if(void 0===g||void 0===g.type||"geometry"===g.type.toLowerCase()){void 0!==d&&d(Error("THREE.ObjectLoader: Can't load "+a)),V("ObjectLoader: Can't load "+a);return}e.parse(f,b)},c,d)}async loadAsync(a,b){let c,d=""===this.path?gB.extractUrlBase(a):this.path;this.resourcePath=this.resourcePath||d;let e=new f3(this.manager);e.setPath(this.path),e.setRequestHeader(this.requestHeader),e.setWithCredentials(this.withCredentials);let f=await e.loadAsync(a,b);try{c=JSON.parse(f)}catch(b){throw Error("ObjectLoader: Can't parse "+a+". "+b.message)}let g=c.metadata;if(void 0===g||void 0===g.type||"geometry"===g.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+a);return await this.parseAsync(c)}parse(a,b){let c=this.parseAnimations(a.animations),d=this.parseShapes(a.shapes),e=this.parseGeometries(a.geometries,d),f=this.parseImages(a.images,function(){void 0!==b&&b(i)}),g=this.parseTextures(a.textures,f),h=this.parseMaterials(a.materials,g),i=this.parseObject(a.object,e,h,g,c),j=this.parseSkeletons(a.skeletons,i);if(this.bindSkeletons(i,j),this.bindLightTargets(i),void 0!==b){let a=!1;for(let b in f)if(f[b].data instanceof HTMLImageElement){a=!0;break}!1===a&&b(i)}return i}async parseAsync(a){let b=this.parseAnimations(a.animations),c=this.parseShapes(a.shapes),d=this.parseGeometries(a.geometries,c),e=await this.parseImagesAsync(a.images),f=this.parseTextures(a.textures,e),g=this.parseMaterials(a.materials,f),h=this.parseObject(a.object,d,g,f,b),i=this.parseSkeletons(a.skeletons,h);return this.bindSkeletons(h,i),this.bindLightTargets(h),h}parseShapes(a){let b={};if(void 0!==a)for(let c=0,d=a.length;c<d;c++){let d=new eP().fromJSON(a[c]);b[d.uuid]=d}return b}parseSkeletons(a,b){let c={},d={};if(b.traverse(function(a){a.isBone&&(d[a.uuid]=a)}),void 0!==a)for(let b=0,e=a.length;b<e;b++){let e=new da().fromJSON(a[b],d);c[e.uuid]=e}return c}parseGeometries(a,b){let c={};if(void 0!==a){let d=new gD;for(let e=0,f=a.length;e<f;e++){let f,g=a[e];switch(g.type){case"BufferGeometry":case"InstancedBufferGeometry":f=d.parse(g);break;default:g.type in fn?f=fn[g.type].fromJSON(g,b):U(`ObjectLoader: Unsupported geometry type "${g.type}"`)}f.uuid=g.uuid,void 0!==g.name&&(f.name=g.name),void 0!==g.userData&&(f.userData=g.userData),c[g.uuid]=f}}return c}parseMaterials(a,b){let c={},d={};if(void 0!==a){let e=new gA;e.setTextures(b);for(let b=0,f=a.length;b<f;b++){let f=a[b];void 0===c[f.uuid]&&(c[f.uuid]=e.parse(f)),d[f.uuid]=c[f.uuid]}}return d}parseAnimations(a){let b={};if(void 0!==a)for(let c=0;c<a.length;c++){let d=a[c],e=fX.parse(d);b[e.uuid]=e}return b}parseImages(a,b){let c,d=this,e={};function f(a){if("string"==typeof a){var b;return b=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:d.resourcePath+a,d.manager.itemStart(b),c.load(b,function(){d.manager.itemEnd(b)},void 0,function(){d.manager.itemError(b),d.manager.itemEnd(b)})}return a.data?{data:K(a.type,a.data),width:a.width,height:a.height}:null}if(void 0!==a&&a.length>0){(c=new f7(new f$(b))).setCrossOrigin(this.crossOrigin);for(let b=0,c=a.length;b<c;b++){let c=a[b],d=c.url;if(Array.isArray(d)){let a=[];for(let b=0,c=d.length;b<c;b++){let c=f(d[b]);null!==c&&(c instanceof HTMLImageElement?a.push(c):a.push(new c7(c.data,c.width,c.height)))}e[c.uuid]=new ax(a)}else{let a=f(c.url);e[c.uuid]=new ax(a)}}}return e}async parseImagesAsync(a){let b,c=this,d={};async function e(a){if("string"==typeof a){let d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:c.resourcePath+a;return await b.loadAsync(d)}return a.data?{data:K(a.type,a.data),width:a.width,height:a.height}:null}if(void 0!==a&&a.length>0){(b=new f7(this.manager)).setCrossOrigin(this.crossOrigin);for(let b=0,c=a.length;b<c;b++){let c=a[b],f=c.url;if(Array.isArray(f)){let a=[];for(let b=0,c=f.length;b<c;b++){let c=f[b],d=await e(c);null!==d&&(d instanceof HTMLImageElement?a.push(d):a.push(new c7(d.data,d.width,d.height)))}d[c.uuid]=new ax(a)}else{let a=await e(c.url);d[c.uuid]=new ax(a)}}}return d}parseTextures(a,b){function c(a,b){return"number"==typeof a?a:(U("ObjectLoader.parseTexture: Constant should be in numeric form.",a),b[a])}let d={};if(void 0!==a)for(let e=0,f=a.length;e<f;e++){let f,g=a[e];void 0===g.image&&U('ObjectLoader: No "image" specified for',g.uuid),void 0===b[g.image]&&U("ObjectLoader: Undefined image",g.image);let h=b[g.image],i=h.data;Array.isArray(i)?(f=new ec,6===i.length&&(f.needsUpdate=!0)):(f=i&&i.data?new c7:new aB,i&&(f.needsUpdate=!0)),f.source=h,f.uuid=g.uuid,void 0!==g.name&&(f.name=g.name),void 0!==g.mapping&&(f.mapping=c(g.mapping,gF)),void 0!==g.channel&&(f.channel=g.channel),void 0!==g.offset&&f.offset.fromArray(g.offset),void 0!==g.repeat&&f.repeat.fromArray(g.repeat),void 0!==g.center&&f.center.fromArray(g.center),void 0!==g.rotation&&(f.rotation=g.rotation),void 0!==g.wrap&&(f.wrapS=c(g.wrap[0],gG),f.wrapT=c(g.wrap[1],gG)),void 0!==g.format&&(f.format=g.format),void 0!==g.internalFormat&&(f.internalFormat=g.internalFormat),void 0!==g.type&&(f.type=g.type),void 0!==g.colorSpace&&(f.colorSpace=g.colorSpace),void 0!==g.minFilter&&(f.minFilter=c(g.minFilter,gH)),void 0!==g.magFilter&&(f.magFilter=c(g.magFilter,gH)),void 0!==g.anisotropy&&(f.anisotropy=g.anisotropy),void 0!==g.flipY&&(f.flipY=g.flipY),void 0!==g.generateMipmaps&&(f.generateMipmaps=g.generateMipmaps),void 0!==g.premultiplyAlpha&&(f.premultiplyAlpha=g.premultiplyAlpha),void 0!==g.unpackAlignment&&(f.unpackAlignment=g.unpackAlignment),void 0!==g.compareFunction&&(f.compareFunction=g.compareFunction),void 0!==g.userData&&(f.userData=g.userData),d[g.uuid]=f}return d}parseObject(a,b,c,d,e){let f,g,h;function i(a){return void 0===b[a]&&U("ObjectLoader: Undefined geometry",a),b[a]}function j(a){if(void 0!==a){if(Array.isArray(a)){let b=[];for(let d=0,e=a.length;d<e;d++){let e=a[d];void 0===c[e]&&U("ObjectLoader: Undefined material",e),b.push(c[e])}return b}return void 0===c[a]&&U("ObjectLoader: Undefined material",a),c[a]}}function k(a){return void 0===d[a]&&U("ObjectLoader: Undefined texture",a),d[a]}switch(a.type){case"Scene":f=new bk,void 0!==a.background&&(Number.isInteger(a.background)?f.background=new bg(a.background):f.background=k(a.background)),void 0!==a.environment&&(f.environment=k(a.environment)),void 0!==a.fog&&("Fog"===a.fog.type?f.fog=new bj(a.fog.color,a.fog.near,a.fog.far):"FogExp2"===a.fog.type&&(f.fog=new bi(a.fog.color,a.fog.density)),""!==a.fog.name&&(f.fog.name=a.fog.name)),void 0!==a.backgroundBlurriness&&(f.backgroundBlurriness=a.backgroundBlurriness),void 0!==a.backgroundIntensity&&(f.backgroundIntensity=a.backgroundIntensity),void 0!==a.backgroundRotation&&f.backgroundRotation.fromArray(a.backgroundRotation),void 0!==a.environmentIntensity&&(f.environmentIntensity=a.environmentIntensity),void 0!==a.environmentRotation&&f.environmentRotation.fromArray(a.environmentRotation);break;case"PerspectiveCamera":f=new go(a.fov,a.aspect,a.near,a.far),void 0!==a.focus&&(f.focus=a.focus),void 0!==a.zoom&&(f.zoom=a.zoom),void 0!==a.filmGauge&&(f.filmGauge=a.filmGauge),void 0!==a.filmOffset&&(f.filmOffset=a.filmOffset),void 0!==a.view&&(f.view=Object.assign({},a.view));break;case"OrthographicCamera":f=new gt(a.left,a.right,a.top,a.bottom,a.near,a.far),void 0!==a.zoom&&(f.zoom=a.zoom),void 0!==a.view&&(f.view=Object.assign({},a.view));break;case"AmbientLight":f=new gw(a.color,a.intensity);break;case"DirectionalLight":(f=new gv(a.color,a.intensity)).target=a.target||"";break;case"PointLight":f=new gs(a.color,a.intensity,a.distance,a.decay);break;case"RectAreaLight":f=new gx(a.color,a.intensity,a.width,a.height);break;case"SpotLight":(f=new gq(a.color,a.intensity,a.distance,a.angle,a.penumbra,a.decay)).target=a.target||"";break;case"HemisphereLight":f=new gc(a.color,a.groundColor,a.intensity);break;case"LightProbe":f=new gz(new gy().fromArray(a.sh),a.intensity);break;case"SkinnedMesh":f=new c5(g=i(a.geometry),h=j(a.material)),void 0!==a.bindMode&&(f.bindMode=a.bindMode),void 0!==a.bindMatrix&&f.bindMatrix.fromArray(a.bindMatrix),void 0!==a.skeleton&&(f.skeleton=a.skeleton);break;case"Mesh":f=new cW(g=i(a.geometry),h=j(a.material));break;case"InstancedMesh":g=i(a.geometry),h=j(a.material);let l=a.count,m=a.instanceMatrix,n=a.instanceColor;(f=new dj(g,h,l)).instanceMatrix=new db(new Float32Array(m.array),16),void 0!==n&&(f.instanceColor=new db(new Float32Array(n.array),n.itemSize));break;case"BatchedMesh":g=i(a.geometry),h=j(a.material),(f=new dM(a.maxInstanceCount,a.maxVertexCount,a.maxIndexCount,h)).geometry=g,f.perObjectFrustumCulled=a.perObjectFrustumCulled,f.sortObjects=a.sortObjects,f._drawRanges=a.drawRanges,f._reservedRanges=a.reservedRanges,f._geometryInfo=a.geometryInfo.map(a=>{let b=null,c=null;return void 0!==a.boundingBox&&(b=new bz().fromJSON(a.boundingBox)),void 0!==a.boundingSphere&&(c=new b6().fromJSON(a.boundingSphere)),{...a,boundingBox:b,boundingSphere:c}}),f._instanceInfo=a.instanceInfo,f._availableInstanceIds=a._availableInstanceIds,f._availableGeometryIds=a._availableGeometryIds,f._nextIndexStart=a.nextIndexStart,f._nextVertexStart=a.nextVertexStart,f._geometryCount=a.geometryCount,f._maxInstanceCount=a.maxInstanceCount,f._maxVertexCount=a.maxVertexCount,f._maxIndexCount=a.maxIndexCount,f._geometryInitialized=a.geometryInitialized,f._matricesTexture=k(a.matricesTexture.uuid),f._indirectTexture=k(a.indirectTexture.uuid),void 0!==a.colorsTexture&&(f._colorsTexture=k(a.colorsTexture.uuid)),void 0!==a.boundingSphere&&(f.boundingSphere=new b6().fromJSON(a.boundingSphere)),void 0!==a.boundingBox&&(f.boundingBox=new bz().fromJSON(a.boundingBox));break;case"LOD":f=new cB;break;case"Line":f=new dV(i(a.geometry),j(a.material));break;case"LineLoop":f=new d$(i(a.geometry),j(a.material));break;case"LineSegments":f=new dZ(i(a.geometry),j(a.material));break;case"PointCloud":case"Points":f=new d4(i(a.geometry),j(a.material));break;case"Sprite":f=new cx(j(a.material));break;case"Group":f=new a9;break;case"Bone":f=new c6;break;default:f=new a8}if(f.uuid=a.uuid,void 0!==a.name&&(f.name=a.name),void 0!==a.matrix?(f.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(f.matrixAutoUpdate=a.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(void 0!==a.position&&f.position.fromArray(a.position),void 0!==a.rotation&&f.rotation.fromArray(a.rotation),void 0!==a.quaternion&&f.quaternion.fromArray(a.quaternion),void 0!==a.scale&&f.scale.fromArray(a.scale)),void 0!==a.up&&f.up.fromArray(a.up),void 0!==a.pivot&&(f.pivot=new al().fromArray(a.pivot)),void 0!==a.morphTargetDictionary&&(f.morphTargetDictionary=Object.assign({},a.morphTargetDictionary)),void 0!==a.morphTargetInfluences&&(f.morphTargetInfluences=a.morphTargetInfluences.slice()),void 0!==a.castShadow&&(f.castShadow=a.castShadow),void 0!==a.receiveShadow&&(f.receiveShadow=a.receiveShadow),a.shadow&&(void 0!==a.shadow.intensity&&(f.shadow.intensity=a.shadow.intensity),void 0!==a.shadow.bias&&(f.shadow.bias=a.shadow.bias),void 0!==a.shadow.normalBias&&(f.shadow.normalBias=a.shadow.normalBias),void 0!==a.shadow.radius&&(f.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&f.shadow.mapSize.fromArray(a.shadow.mapSize),void 0!==a.shadow.camera&&(f.shadow.camera=this.parseObject(a.shadow.camera))),void 0!==a.visible&&(f.visible=a.visible),void 0!==a.frustumCulled&&(f.frustumCulled=a.frustumCulled),void 0!==a.renderOrder&&(f.renderOrder=a.renderOrder),void 0!==a.static&&(f.static=a.static),void 0!==a.userData&&(f.userData=a.userData),void 0!==a.layers&&(f.layers.mask=a.layers),void 0!==a.children){let g=a.children;for(let a=0;a<g.length;a++)f.add(this.parseObject(g[a],b,c,d,e))}if(void 0!==a.animations){let b=a.animations;for(let a=0;a<b.length;a++){let c=b[a];f.animations.push(e[c])}}if("LOD"===a.type){void 0!==a.autoUpdate&&(f.autoUpdate=a.autoUpdate);let b=a.levels;for(let a=0;a<b.length;a++){let c=b[a],d=f.getObjectByProperty("uuid",c.object);void 0!==d&&f.addLevel(d,c.distance,c.hysteresis)}}return f}bindSkeletons(a,b){0!==Object.keys(b).length&&a.traverse(function(a){if(!0===a.isSkinnedMesh&&void 0!==a.skeleton){let c=b[a.skeleton];void 0===c?U("ObjectLoader: No skeleton found with UUID:",a.skeleton):a.bind(c,a.bindMatrix)}})}bindLightTargets(a){a.traverse(function(b){if(b.isDirectionalLight||b.isSpotLight){let c=b.target,d=a.getObjectByProperty("uuid",c);void 0!==d?b.target=d:b.target=new a8}})}}let gF={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},gG={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},gH={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008},gI=new WeakMap;class gJ extends f0{constructor(a){super(a),this.isImageBitmapLoader=!0,"u"<typeof createImageBitmap&&U("ImageBitmapLoader: createImageBitmap() not supported."),"u"<typeof fetch&&U("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(a){return this.options=a,this}load(a,b,c,d){void 0===a&&(a=""),void 0!==this.path&&(a=this.path+a),a=this.manager.resolveURL(a);let e=this,f=fY.get(`image-bitmap:${a}`);if(void 0!==f)return(e.manager.itemStart(a),f.then)?void f.then(c=>{if(!0!==gI.has(f))return b&&b(c),e.manager.itemEnd(a),c;d&&d(gI.get(f)),e.manager.itemError(a),e.manager.itemEnd(a)}):(setTimeout(function(){b&&b(f),e.manager.itemEnd(a)},0),f);let g={};g.credentials="anonymous"===this.crossOrigin?"same-origin":"include",g.headers=this.requestHeader,g.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let h=fetch(a,g).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,Object.assign(e.options,{colorSpaceConversion:"none"}))}).then(function(c){return fY.add(`image-bitmap:${a}`,c),b&&b(c),e.manager.itemEnd(a),c}).catch(function(b){d&&d(b),gI.set(h,b),fY.remove(`image-bitmap:${a}`),e.manager.itemError(a),e.manager.itemEnd(a)});fY.add(`image-bitmap:${a}`,h),e.manager.itemStart(a)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class gK{static getContext(){return void 0===d&&(d=new(window.AudioContext||window.webkitAudioContext)),d}static setContext(a){d=a}}class gL extends f0{constructor(a){super(a)}load(a,b,c,d){let e=this,f=new f3(this.manager);function g(b){d?d(b):V(b),e.manager.itemError(a)}f.setResponseType("arraybuffer"),f.setPath(this.path),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(a,function(a){try{let c=a.slice(0);gK.getContext().decodeAudioData(c,function(a){b(a)}).catch(g)}catch(a){g(a)}},c,d)}}let gM=new aJ,gN=new aJ,gO=new aJ;class gP{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new go,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new go,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(a){let b=this._cache;if(b.focus!==a.focus||b.fov!==a.fov||b.aspect!==a.aspect*this.aspect||b.near!==a.near||b.far!==a.far||b.zoom!==a.zoom||b.eyeSep!==this.eyeSep){let c,d;b.focus=a.focus,b.fov=a.fov,b.aspect=a.aspect*this.aspect,b.near=a.near,b.far=a.far,b.zoom=a.zoom,b.eyeSep=this.eyeSep,gO.copy(a.projectionMatrix);let e=b.eyeSep/2,f=e*b.near/b.focus,g=b.near*Math.tan(aa*b.fov*.5)/b.zoom;gN.elements[12]=-e,gM.elements[12]=e,c=-g*b.aspect+f,d=g*b.aspect+f,gO.elements[0]=2*b.near/(d-c),gO.elements[8]=(d+c)/(d-c),this.cameraL.projectionMatrix.copy(gO),c=-g*b.aspect-f,d=g*b.aspect-f,gO.elements[0]=2*b.near/(d-c),gO.elements[8]=(d+c)/(d-c),this.cameraR.projectionMatrix.copy(gO)}this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(gN),this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(gM)}}class gQ extends a8{constructor(a,b,c){super(),this.type="CubeCamera",this.renderTarget=c,this.coordinateSystem=null,this.activeMipmapLevel=0;const d=new go(-90,1,a,b);d.layers=this.layers,this.add(d);const e=new go(-90,1,a,b);e.layers=this.layers,this.add(e);const f=new go(-90,1,a,b);f.layers=this.layers,this.add(f);const g=new go(-90,1,a,b);g.layers=this.layers,this.add(g);const h=new go(-90,1,a,b);h.layers=this.layers,this.add(h);const i=new go(-90,1,a,b);i.layers=this.layers,this.add(i)}updateCoordinateSystem(){let a=this.coordinateSystem,b=this.children.concat(),[c,d,e,f,g,h]=b;for(let a of b)this.remove(a);if(2e3===a)c.up.set(0,1,0),c.lookAt(1,0,0),d.up.set(0,1,0),d.lookAt(-1,0,0),e.up.set(0,0,-1),e.lookAt(0,1,0),f.up.set(0,0,1),f.lookAt(0,-1,0),g.up.set(0,1,0),g.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else if(2001===a)c.up.set(0,-1,0),c.lookAt(-1,0,0),d.up.set(0,-1,0),d.lookAt(1,0,0),e.up.set(0,0,1),e.lookAt(0,1,0),f.up.set(0,0,-1),f.lookAt(0,-1,0),g.up.set(0,-1,0),g.lookAt(0,0,1),h.up.set(0,-1,0),h.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+a);for(let a of b)this.add(a),a.updateMatrixWorld()}update(a,b){null===this.parent&&this.updateMatrixWorld();let{renderTarget:c,activeMipmapLevel:d}=this;this.coordinateSystem!==a.coordinateSystem&&(this.coordinateSystem=a.coordinateSystem,this.updateCoordinateSystem());let[e,f,g,h,i,j]=this.children,k=a.getRenderTarget(),l=a.getActiveCubeFace(),m=a.getActiveMipmapLevel(),n=a.xr.enabled;a.xr.enabled=!1;let o=c.texture.generateMipmaps;c.texture.generateMipmaps=!1;let p=!1;p=!0===a.isWebGLRenderer?a.state.buffers.depth.getReversed():a.reversedDepthBuffer,a.setRenderTarget(c,0,d),p&&!1===a.autoClear&&a.clearDepth(),a.render(b,e),a.setRenderTarget(c,1,d),p&&!1===a.autoClear&&a.clearDepth(),a.render(b,f),a.setRenderTarget(c,2,d),p&&!1===a.autoClear&&a.clearDepth(),a.render(b,g),a.setRenderTarget(c,3,d),p&&!1===a.autoClear&&a.clearDepth(),a.render(b,h),a.setRenderTarget(c,4,d),p&&!1===a.autoClear&&a.clearDepth(),a.render(b,i),c.texture.generateMipmaps=o,a.setRenderTarget(c,5,d),p&&!1===a.autoClear&&a.clearDepth(),a.render(b,j),a.setRenderTarget(k,l,m),a.xr.enabled=n,c.texture.needsPMREMUpdate=!0}}class gR extends go{constructor(a=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=a}}class gS{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(a){this._document=a,void 0!==a.hidden&&(this._pageVisibilityHandler=gT.bind(this),a.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(a){return this._timescale=a,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(a){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==a?a:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function gT(){!1===this._document.hidden&&this.reset()}let gU=new al,gV=new ak,gW=new al,gX=new al,gY=new al;class gZ extends a8{constructor(){super(),this.type="AudioListener",this.context=gK.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new gS}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(a){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=a,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(a){return this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01),this}updateMatrixWorld(a){super.updateMatrixWorld(a),this._timer.update();let b=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(gU,gV,gW),gX.set(0,0,-1).applyQuaternion(gV),gY.set(0,1,0).applyQuaternion(gV),b.positionX){let a=this.context.currentTime+this.timeDelta;b.positionX.linearRampToValueAtTime(gU.x,a),b.positionY.linearRampToValueAtTime(gU.y,a),b.positionZ.linearRampToValueAtTime(gU.z,a),b.forwardX.linearRampToValueAtTime(gX.x,a),b.forwardY.linearRampToValueAtTime(gX.y,a),b.forwardZ.linearRampToValueAtTime(gX.z,a),b.upX.linearRampToValueAtTime(gY.x,a),b.upY.linearRampToValueAtTime(gY.y,a),b.upZ.linearRampToValueAtTime(gY.z,a)}else b.setPosition(gU.x,gU.y,gU.z),b.setOrientation(gX.x,gX.y,gX.z,gY.x,gY.y,gY.z)}}class g$ extends a8{constructor(a){super(),this.type="Audio",this.listener=a,this.context=a.context,this.gain=this.context.createGain(),this.gain.connect(a.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(a){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=a,this.connect(),this}setMediaElementSource(a){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(a),this.connect(),this}setMediaStreamSource(a){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(a),this.connect(),this}setBuffer(a){return this.buffer=a,this.sourceType="buffer",this.autoplay&&this.play(),this}play(a=0){if(!0===this.isPlaying)return void U("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void U("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+a;let b=this.context.createBufferSource();return b.buffer=this.buffer,b.loop=this.loop,b.loopStart=this.loopStart,b.loopEnd=this.loopEnd,b.onended=this.onEnded.bind(this),b.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=b,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void U("Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)}stop(a=0){return!1===this.hasPlaybackControl?void U("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+a),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let a=1,b=this.filters.length;a<b;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let a=1,b=this.filters.length;a<b;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(a){return a||(a=[]),!0===this._connected?(this.disconnect(),this.filters=a.slice(),this.connect()):this.filters=a.slice(),this}setDetune(a){return this.detune=a,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(a){return this.setFilters(a?[a]:[])}setPlaybackRate(a){return!1===this.hasPlaybackControl?void U("Audio: this Audio has no playback control."):(this.playbackRate=a,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return!1===this.hasPlaybackControl?(U("Audio: this Audio has no playback control."),!1):this.loop}setLoop(a){return!1===this.hasPlaybackControl?void U("Audio: this Audio has no playback control."):(this.loop=a,!0===this.isPlaying&&(this.source.loop=this.loop),this)}setLoopStart(a){return this.loopStart=a,this}setLoopEnd(a){return this.loopEnd=a,this}getVolume(){return this.gain.gain.value}setVolume(a){return this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01),this}copy(a,b){return(super.copy(a,b),"buffer"!==a.sourceType)?U("Audio: Audio source type cannot be copied."):(this.autoplay=a.autoplay,this.buffer=a.buffer,this.detune=a.detune,this.loop=a.loop,this.loopStart=a.loopStart,this.loopEnd=a.loopEnd,this.offset=a.offset,this.duration=a.duration,this.playbackRate=a.playbackRate,this.hasPlaybackControl=a.hasPlaybackControl,this.sourceType=a.sourceType,this.filters=a.filters.slice()),this}clone(a){return new this.constructor(this.listener).copy(this,a)}}let g_=new al,g0=new ak,g1=new al,g2=new al;class g3 extends g${constructor(a){super(a),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(a){return this.panner.refDistance=a,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(a){return this.panner.rolloffFactor=a,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(a){return this.panner.distanceModel=a,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(a){return this.panner.maxDistance=a,this}setDirectionalCone(a,b,c){return this.panner.coneInnerAngle=a,this.panner.coneOuterAngle=b,this.panner.coneOuterGain=c,this}updateMatrixWorld(a){if(super.updateMatrixWorld(a),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(g_,g0,g1),g2.set(0,0,1).applyQuaternion(g0);let b=this.panner;if(b.positionX){let a=this.context.currentTime+this.listener.timeDelta;b.positionX.linearRampToValueAtTime(g_.x,a),b.positionY.linearRampToValueAtTime(g_.y,a),b.positionZ.linearRampToValueAtTime(g_.z,a),b.orientationX.linearRampToValueAtTime(g2.x,a),b.orientationY.linearRampToValueAtTime(g2.y,a),b.orientationZ.linearRampToValueAtTime(g2.z,a)}else b.setPosition(g_.x,g_.y,g_.z),b.setOrientation(g2.x,g2.y,g2.z)}}class g4{constructor(a,b=2048){this.analyser=a.context.createAnalyser(),this.analyser.fftSize=b,this.data=new Uint8Array(this.analyser.frequencyBinCount),a.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let a=0,b=this.getFrequencyData();for(let c=0;c<b.length;c++)a+=b[c];return a/b.length}}class g5{constructor(a,b,c){let d,e,f;switch(this.binding=a,this.valueSize=c,b){case"quaternion":d=this._slerp,e=this._slerpAdditive,f=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*c),this._workIndex=5;break;case"string":case"bool":d=this._select,e=this._select,f=this._setAdditiveIdentityOther,this.buffer=Array(5*c);break;default:d=this._lerp,e=this._lerpAdditive,f=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*c)}this._mixBufferRegion=d,this._mixBufferRegionAdditive=e,this._setIdentity=f,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(a,b){let c=this.buffer,d=this.valueSize,e=a*d+d,f=this.cumulativeWeight;if(0===f){for(let a=0;a!==d;++a)c[e+a]=c[a];f=b}else{f+=b;let a=b/f;this._mixBufferRegion(c,e,0,a,d)}this.cumulativeWeight=f}accumulateAdditive(a){let b=this.buffer,c=this.valueSize,d=c*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(b,d,0,a,c),this.cumulativeWeightAdditive+=a}apply(a){let b=this.valueSize,c=this.buffer,d=a*b+b,e=this.cumulativeWeight,f=this.cumulativeWeightAdditive,g=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,e<1){let a=b*this._origIndex;this._mixBufferRegion(c,d,a,1-e,b)}f>0&&this._mixBufferRegionAdditive(c,d,this._addIndex*b,1,b);for(let a=b,e=b+b;a!==e;++a)if(c[a]!==c[a+b]){g.setValue(c,d);break}}saveOriginalState(){let a=this.binding,b=this.buffer,c=this.valueSize,d=c*this._origIndex;a.getValue(b,d);for(let a=c;a!==d;++a)b[a]=b[d+a%c];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let a=3*this.valueSize;this.binding.setValue(this.buffer,a)}_setAdditiveIdentityNumeric(){let a=this._addIndex*this.valueSize,b=a+this.valueSize;for(let c=a;c<b;c++)this.buffer[c]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let a=this._origIndex*this.valueSize,b=this._addIndex*this.valueSize;for(let c=0;c<this.valueSize;c++)this.buffer[b+c]=this.buffer[a+c]}_select(a,b,c,d,e){if(d>=.5)for(let d=0;d!==e;++d)a[b+d]=a[c+d]}_slerp(a,b,c,d){ak.slerpFlat(a,b,a,b,a,c,d)}_slerpAdditive(a,b,c,d,e){let f=this._workIndex*e;ak.multiplyQuaternionsFlat(a,f,a,b,a,c),ak.slerpFlat(a,b,a,b,a,f,d)}_lerp(a,b,c,d,e){let f=1-d;for(let g=0;g!==e;++g){let e=b+g;a[e]=a[e]*f+a[c+g]*d}}_lerpAdditive(a,b,c,d,e){for(let f=0;f!==e;++f){let e=b+f;a[e]=a[e]+a[c+f]*d}}}let g6="\\[\\]\\.:\\/",g7=RegExp("["+g6+"]","g"),g8="[^"+g6+"]",g9="[^"+g6.replace("\\.","")+"]",ha=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",g8)+/(WCOD+)?/.source.replace("WCOD",g9)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",g8)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",g8)+"$"),hb=["material","materials","bones","map"];class hc{constructor(a,b,c){this.path=b,this.parsedPath=c||hc.parseTrackName(b),this.node=hc.findNode(a,this.parsedPath.nodeName),this.rootNode=a,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(a,b,c){return a&&a.isAnimationObjectGroup?new hc.Composite(a,b,c):new hc(a,b,c)}static sanitizeNodeName(a){return a.replace(/\s/g,"_").replace(g7,"")}static parseTrackName(a){let b=ha.exec(a);if(null===b)throw Error("PropertyBinding: Cannot parse trackName: "+a);let c={nodeName:b[2],objectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]},d=c.nodeName&&c.nodeName.lastIndexOf(".");if(void 0!==d&&-1!==d){let a=c.nodeName.substring(d+1);-1!==hb.indexOf(a)&&(c.nodeName=c.nodeName.substring(0,d),c.objectName=a)}if(null===c.propertyName||0===c.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+a);return c}static findNode(a,b){if(void 0===b||""===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){let c=a.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){let c=function(a){for(let d=0;d<a.length;d++){let e=a[d];if(e.name===b||e.uuid===b)return e;let f=c(e.children);if(f)return f}return null},d=c(a.children);if(d)return d}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(a,b){a[b]=this.targetObject[this.propertyName]}_getValue_array(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)a[b++]=c[d]}_getValue_arrayElement(a,b){a[b]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(a,b){this.resolvedProperty.toArray(a,b)}_setValue_direct(a,b){this.targetObject[this.propertyName]=a[b]}_setValue_direct_setNeedsUpdate(a,b){this.targetObject[this.propertyName]=a[b],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(a,b){this.targetObject[this.propertyName]=a[b],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)c[d]=a[b++]}_setValue_array_setNeedsUpdate(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(a,b){this.resolvedProperty[this.propertyIndex]=a[b]}_setValue_arrayElement_setNeedsUpdate(a,b){this.resolvedProperty[this.propertyIndex]=a[b],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(a,b){this.resolvedProperty[this.propertyIndex]=a[b],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(a,b){this.resolvedProperty.fromArray(a,b)}_setValue_fromArray_setNeedsUpdate(a,b){this.resolvedProperty.fromArray(a,b),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(a,b){this.resolvedProperty.fromArray(a,b),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(a,b){this.bind(),this.getValue(a,b)}_setValue_unbound(a,b){this.bind(),this.setValue(a,b)}bind(){let a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;if(a||(a=hc.findNode(this.rootNode,b.nodeName),this.node=a),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!a)return void U("PropertyBinding: No target node found for track: "+this.path+".");if(c){let d=b.objectIndex;switch(c){case"materials":if(!a.material)return void V("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!a.material.materials)return void V("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);a=a.material.materials;break;case"bones":if(!a.skeleton)return void V("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);a=a.skeleton.bones;for(let b=0;b<a.length;b++)if(a[b].name===d){d=b;break}break;case"map":if("map"in a){a=a.map;break}if(!a.material)return void V("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!a.material.map)return void V("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);a=a.material.map;break;default:if(void 0===a[c])return void V("PropertyBinding: Can not bind to objectName of node undefined.",this);a=a[c]}if(void 0!==d){if(void 0===a[d])return void V("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,a);a=a[d]}}let f=a[d];if(void 0===f)return void V("PropertyBinding: Trying to update property for track: "+b.nodeName+"."+d+" but it wasn't found.",a);let g=this.Versioning.None;this.targetObject=a,!0===a.isMaterial?g=this.Versioning.NeedsUpdate:!0===a.isObject3D&&(g=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(void 0!==e){if("morphTargetInfluences"===d){if(!a.geometry)return void V("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!a.geometry.morphAttributes)return void V("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==a.morphTargetDictionary[e]&&(e=a.morphTargetDictionary[e])}h=this.BindingType.ArrayElement,this.resolvedProperty=f,this.propertyIndex=e}else void 0!==f.fromArray&&void 0!==f.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=f):Array.isArray(f)?(h=this.BindingType.EntireArray,this.resolvedProperty=f):this.propertyName=d;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][g]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}hc.Composite=class{constructor(a,b,c){const d=c||hc.parseTrackName(b);this._targetGroup=a,this._bindings=a.subscribe_(b,d)}getValue(a,b){this.bind();let c=this._targetGroup.nCachedObjects_,d=this._bindings[c];void 0!==d&&d.getValue(a,b)}setValue(a,b){let c=this._bindings;for(let d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)}bind(){let a=this._bindings;for(let b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()}unbind(){let a=this._bindings;for(let b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}},hc.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},hc.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},hc.prototype.GetterByBindingType=[hc.prototype._getValue_direct,hc.prototype._getValue_array,hc.prototype._getValue_arrayElement,hc.prototype._getValue_toArray],hc.prototype.SetterByBindingTypeAndVersioning=[[hc.prototype._setValue_direct,hc.prototype._setValue_direct_setNeedsUpdate,hc.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[hc.prototype._setValue_array,hc.prototype._setValue_array_setNeedsUpdate,hc.prototype._setValue_array_setMatrixWorldNeedsUpdate],[hc.prototype._setValue_arrayElement,hc.prototype._setValue_arrayElement_setNeedsUpdate,hc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[hc.prototype._setValue_fromArray,hc.prototype._setValue_fromArray_setNeedsUpdate,hc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class hd{constructor(){this.isAnimationObjectGroup=!0,this.uuid=ac(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const a={};this._indicesByUUID=a;for(let b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const b=this;this.stats={objects:{get total(){return b._objects.length},get inUse(){return this.total-b.nCachedObjects_}},get bindingsPerObject(){return b._bindings.length}}}add(){let a=this._objects,b=this._indicesByUUID,c=this._paths,d=this._parsedPaths,e=this._bindings,f=e.length,g,h=a.length,i=this.nCachedObjects_;for(let j=0,k=arguments.length;j!==k;++j){let k=arguments[j],l=k.uuid,m=b[l];if(void 0===m){m=h++,b[l]=m,a.push(k);for(let a=0;a!==f;++a)e[a].push(new hc(k,c[a],d[a]))}else if(m<i){g=a[m];let h=--i,j=a[h];b[j.uuid]=m,a[m]=j,b[l]=h,a[h]=k;for(let a=0;a!==f;++a){let b=e[a],f=b[h],g=b[m];b[m]=f,void 0===g&&(g=new hc(k,c[a],d[a])),b[h]=g}}else a[m]!==g&&V("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=i}remove(){let a=this._objects,b=this._indicesByUUID,c=this._bindings,d=c.length,e=this.nCachedObjects_;for(let f=0,g=arguments.length;f!==g;++f){let g=arguments[f],h=g.uuid,i=b[h];if(void 0!==i&&i>=e){let f=e++,j=a[f];b[j.uuid]=i,a[i]=j,b[h]=f,a[f]=g;for(let a=0;a!==d;++a){let b=c[a],d=b[f],e=b[i];b[i]=d,b[f]=e}}}this.nCachedObjects_=e}uncache(){let a=this._objects,b=this._indicesByUUID,c=this._bindings,d=c.length,e=this.nCachedObjects_,f=a.length;for(let g=0,h=arguments.length;g!==h;++g){let h=arguments[g],i=h.uuid,j=b[i];if(void 0!==j)if(delete b[i],j<e){let g=--e,h=a[g],i=--f,k=a[i];b[h.uuid]=j,a[j]=h,b[k.uuid]=g,a[g]=k,a.pop();for(let a=0;a!==d;++a){let b=c[a],d=b[g],e=b[i];b[j]=d,b[g]=e,b.pop()}}else{let e=--f,g=a[e];e>0&&(b[g.uuid]=j),a[j]=g,a.pop();for(let a=0;a!==d;++a){let b=c[a];b[j]=b[e],b.pop()}}}this.nCachedObjects_=e}subscribe_(a,b){let c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];let f=this._paths,g=this._parsedPaths,h=this._objects,i=h.length,j=this.nCachedObjects_,k=Array(i);d=e.length,c[a]=d,f.push(a),g.push(b),e.push(k);for(let c=j,d=h.length;c!==d;++c){let d=h[c];k[c]=new hc(d,a,b)}return k}unsubscribe_(a){let b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){let d=this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c,f[c]=h,f.pop(),e[c]=e[g],e.pop(),d[c]=d[g],d.pop()}}}class he{constructor(a,b,c=null,d=b.blendMode){this._mixer=a,this._clip=b,this._localRoot=c,this.blendMode=d;const e=b.tracks,f=e.length,g=Array(f),h={endingStart:2400,endingEnd:2400};for(let a=0;a!==f;++a){const b=e[a].createInterpolant(null);g[a]=b,b.settings=h}this._interpolantSettings=h,this._interpolants=g,this._propertyBindings=Array(f),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(a){return this._startTime=a,this}setLoop(a,b){return this.loop=a,this.repetitions=b,this}setEffectiveWeight(a){return this.weight=a,this._effectiveWeight=this.enabled?a:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(a){return this._scheduleFading(a,0,1)}fadeOut(a){return this._scheduleFading(a,1,0)}crossFadeFrom(a,b,c=!1){if(a.fadeOut(b),this.fadeIn(b),!0===c){let c=this._clip.duration,d=a._clip.duration;a.warp(1,d/c,b),this.warp(c/d,1,b)}return this}crossFadeTo(a,b,c=!1){return a.crossFadeFrom(this,b,c)}stopFading(){let a=this._weightInterpolant;return null!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a)),this}setEffectiveTimeScale(a){return this.timeScale=a,this._effectiveTimeScale=this.paused?0:a,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(a){return this.timeScale=this._clip.duration/a,this.stopWarping()}syncWith(a){return this.time=a.time,this.timeScale=a.timeScale,this.stopWarping()}halt(a){return this.warp(this._effectiveTimeScale,0,a)}warp(a,b,c){let d=this._mixer,e=d.time,f=this.timeScale,g=this._timeScaleInterpolant;null===g&&(g=d._lendControlInterpolant(),this._timeScaleInterpolant=g);let h=g.parameterPositions,i=g.sampleValues;return h[0]=e,h[1]=e+c,i[0]=a/f,i[1]=b/f,this}stopWarping(){let a=this._timeScaleInterpolant;return null!==a&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(a)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(a,b,c,d){if(!this.enabled)return void this._updateWeight(a);let e=this._startTime;if(null!==e){let d=(a-e)*c;d<0||0===c?b=0:(this._startTime=null,b=c*d)}b*=this._updateTimeScale(a);let f=this._updateTime(b),g=this._updateWeight(a);if(g>0){let a=this._interpolants,b=this._propertyBindings;if(2501===this.blendMode)for(let c=0,d=a.length;c!==d;++c)a[c].evaluate(f),b[c].accumulateAdditive(g);else for(let c=0,e=a.length;c!==e;++c)a[c].evaluate(f),b[c].accumulate(d,g)}}_updateWeight(a){let b=0;if(this.enabled){b=this.weight;let c=this._weightInterpolant;if(null!==c){let d=c.evaluate(a)[0];b*=d,a>c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b,b}_updateTimeScale(a){let b=0;if(!this.paused){b=this.timeScale;let c=this._timeScaleInterpolant;null!==c&&(b*=c.evaluate(a)[0],a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b))}return this._effectiveTimeScale=b,b}_updateTime(a){let b=this._clip.duration,c=this.loop,d=this.time+a,e=this._loopCount,f=2202===c;if(0===a)return -1===e?d:f&&(1&e)==1?b-d:d;if(2200===c){-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1));g:{if(d>=b)d=b;else if(d<0)d=0;else{this.time=d;break g}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=d,this._mixer.dispatchEvent({type:"finished",action:this,direction:a<0?-1:1})}}else{if(-1===e&&(a>=0?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f)),d>=b||d<0){let c=Math.floor(d/b);d-=b*c,e+=Math.abs(c);let g=this.repetitions-e;if(g<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,d=a>0?b:0,this.time=d,this._mixer.dispatchEvent({type:"finished",action:this,direction:a>0?1:-1});else{if(1===g){let b=a<0;this._setEndings(b,!b,f)}else this._setEndings(!1,!1,f);this._loopCount=e,this.time=d,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:c})}}else this.time=d;if(f&&(1&e)==1)return b-d}return d}_setEndings(a,b,c){let d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(a?d.endingStart=this.zeroSlopeAtStart?2401:2400:d.endingStart=2402,b?d.endingEnd=this.zeroSlopeAtEnd?2401:2400:d.endingEnd=2402)}_scheduleFading(a,b,c){let d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(f=d._lendControlInterpolant(),this._weightInterpolant=f);let g=f.parameterPositions,h=f.sampleValues;return g[0]=e,h[0]=b,g[1]=e+a,h[1]=c,this}}let hf=new Float32Array(1);class hg extends Z{constructor(a){super(),this._root=a,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(a,b){let c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings,g=a._interpolants,h=c.uuid,i=this._bindingsByRootAndName,j=i[h];void 0===j&&(j={},i[h]=j);for(let a=0;a!==e;++a){let e=d[a],i=e.name,k=j[i];if(void 0!==k)++k.referenceCount,f[a]=k;else{if(void 0!==(k=f[a])){null===k._cacheIndex&&(++k.referenceCount,this._addInactiveBinding(k,h,i));continue}let d=b&&b._propertyBindings[a].binding.parsedPath;k=new g5(hc.create(c,i,d),e.ValueTypeName,e.getValueSize()),++k.referenceCount,this._addInactiveBinding(k,h,i),f[a]=k}g[a].resultBuffer=k.buffer}}_activateAction(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){let b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]),this._addInactiveAction(a,c,b)}let b=a._propertyBindings;for(let a=0,c=b.length;a!==c;++a){let c=b[a];0==c.useCount++&&(this._lendBinding(c),c.saveOriginalState())}this._lendAction(a)}}_deactivateAction(a){if(this._isActiveAction(a)){let b=a._propertyBindings;for(let a=0,c=b.length;a!==c;++a){let c=b[a];0==--c.useCount&&(c.restoreOriginalState(),this._takeBackBinding(c))}this._takeBackAction(a)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}}_isActiveAction(a){let b=a._cacheIndex;return null!==b&&b<this._nActiveActions}_addInactiveAction(a,b,c){let d=this._actions,e=this._actionsByClip,f=e[b];if(void 0===f)f={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=f;else{let b=f.knownActions;a._byClipCacheIndex=b.length,b.push(a)}a._cacheIndex=d.length,d.push(a),f.actionByRoot[c]=a}_removeInactiveAction(a){let b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d,b[d]=c,b.pop(),a._cacheIndex=null;let e=a._clip.uuid,f=this._actionsByClip,g=f[e],h=g.knownActions,i=h[h.length-1],j=a._byClipCacheIndex;i._byClipCacheIndex=j,h[j]=i,h.pop(),a._byClipCacheIndex=null;let k=g.actionByRoot,l=(a._localRoot||this._root).uuid;delete k[l],0===h.length&&delete f[e],this._removeInactiveBindingsForAction(a)}_removeInactiveBindingsForAction(a){let b=a._propertyBindings;for(let a=0,c=b.length;a!==c;++a){let c=b[a];0==--c.referenceCount&&this._removeInactiveBinding(c)}}_lendAction(a){let b=this._actions,c=a._cacheIndex,d=this._nActiveActions++,e=b[d];a._cacheIndex=d,b[d]=a,e._cacheIndex=c,b[c]=e}_takeBackAction(a){let b=this._actions,c=a._cacheIndex,d=--this._nActiveActions,e=b[d];a._cacheIndex=d,b[d]=a,e._cacheIndex=c,b[c]=e}_addInactiveBinding(a,b,c){let d=this._bindingsByRootAndName,e=this._bindings,f=d[b];void 0===f&&(f={},d[b]=f),f[c]=a,a._cacheIndex=e.length,e.push(a)}_removeInactiveBinding(a){let b=this._bindings,c=a.binding,d=c.rootNode.uuid,e=c.path,f=this._bindingsByRootAndName,g=f[d],h=b[b.length-1],i=a._cacheIndex;h._cacheIndex=i,b[i]=h,b.pop(),delete g[e],0===Object.keys(g).length&&delete f[d]}_lendBinding(a){let b=this._bindings,c=a._cacheIndex,d=this._nActiveBindings++,e=b[d];a._cacheIndex=d,b[d]=a,e._cacheIndex=c,b[c]=e}_takeBackBinding(a){let b=this._bindings,c=a._cacheIndex,d=--this._nActiveBindings,e=b[d];a._cacheIndex=d,b[d]=a,e._cacheIndex=c,b[c]=e}_lendControlInterpolant(){let a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];return void 0===c&&((c=new fM(new Float32Array(2),new Float32Array(2),1,hf)).__cacheIndex=b,a[b]=c),c}_takeBackControlInterpolant(a){let b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,e=b[d];a.__cacheIndex=d,b[d]=a,e.__cacheIndex=c,b[c]=e}clipAction(a,b,c){let d=b||this._root,e=d.uuid,f="string"==typeof a?fX.findByName(d,a):a,g=null!==f?f.uuid:a,h=this._actionsByClip[g],i=null;if(void 0===c&&(c=null!==f?f.blendMode:2500),void 0!==h){let a=h.actionByRoot[e];if(void 0!==a&&a.blendMode===c)return a;i=h.knownActions[0],null===f&&(f=i._clip)}if(null===f)return null;let j=new he(this,f,b,c);return this._bindAction(j,i),this._addInactiveAction(j,g,e),j}existingAction(a,b){let c=b||this._root,d=c.uuid,e="string"==typeof a?fX.findByName(c,a):a,f=e?e.uuid:a,g=this._actionsByClip[f];return void 0!==g&&g.actionByRoot[d]||null}stopAllAction(){let a=this._actions,b=this._nActiveActions;for(let c=b-1;c>=0;--c)a[c].stop();return this}update(a){a*=this.timeScale;let b=this._actions,c=this._nActiveActions,d=this.time+=a,e=Math.sign(a),f=this._accuIndex^=1;for(let g=0;g!==c;++g)b[g]._update(d,a,e,f);let g=this._bindings,h=this._nActiveBindings;for(let a=0;a!==h;++a)g[a].apply(f);return this}setTime(a){this.time=0;for(let a=0;a<this._actions.length;a++)this._actions[a].time=0;return this.update(a)}getRoot(){return this._root}uncacheClip(a){let b=this._actions,c=a.uuid,d=this._actionsByClip,e=d[c];if(void 0!==e){let a=e.knownActions;for(let c=0,d=a.length;c!==d;++c){let d=a[c];this._deactivateAction(d);let e=d._cacheIndex,f=b[b.length-1];d._cacheIndex=null,d._byClipCacheIndex=null,f._cacheIndex=e,b[e]=f,b.pop(),this._removeInactiveBindingsForAction(d)}delete d[c]}}uncacheRoot(a){let b=a.uuid,c=this._actionsByClip;for(let a in c){let d=c[a].actionByRoot[b];void 0!==d&&(this._deactivateAction(d),this._removeInactiveAction(d))}let d=this._bindingsByRootAndName[b];if(void 0!==d)for(let a in d){let b=d[a];b.restoreOriginalState(),this._removeInactiveBinding(b)}}uncacheAction(a,b){let c=this.existingAction(a,b);null!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}}class hh extends aD{constructor(a=1,b=1,c=1,d={}){super(a,b,d),this.isRenderTarget3D=!0,this.depth=c,this.texture=new aH(null,a,b,c),this._setTextureOptions(d),this.texture.isRenderTargetTexture=!0}}class hi{constructor(a){this.value=a}clone(){return new hi(void 0===this.value.clone?this.value:this.value.clone())}}let hj=0;class hk extends Z{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:hj++}),this.name="",this.usage=35044,this.uniforms=[]}add(a){return this.uniforms.push(a),this}remove(a){let b=this.uniforms.indexOf(a);return -1!==b&&this.uniforms.splice(b,1),this}setName(a){return this.name=a,this}setUsage(a){return this.usage=a,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(a){this.name=a.name,this.usage=a.usage;let b=a.uniforms;this.uniforms.length=0;for(let a=0,c=b.length;a<c;a++){let c=Array.isArray(b[a])?b[a]:[b[a]];for(let a=0;a<c.length;a++)this.uniforms.push(c[a].clone())}return this}clone(){return new this.constructor().copy(this)}}class hl extends cf{constructor(a,b,c=1){super(a,b),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=c}copy(a){return super.copy(a),this.meshPerAttribute=a.meshPerAttribute,this}clone(a){let b=super.clone(a);return b.meshPerAttribute=this.meshPerAttribute,b}toJSON(a){let b=super.toJSON(a);return b.isInstancedInterleavedBuffer=!0,b.meshPerAttribute=this.meshPerAttribute,b}}class hm{constructor(a,b,c,d,e,f=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=a,this.type=b,this.itemSize=c,this.elementSize=d,this.count=e,this.normalized=f,this.version=0}set needsUpdate(a){!0===a&&this.version++}setBuffer(a){return this.buffer=a,this}setType(a,b){return this.type=a,this.elementSize=b,this}setItemSize(a){return this.itemSize=a,this}setCount(a){return this.count=a,this}}let hn=new aJ;class ho{constructor(a,b,c=0,d=1/0){this.ray=new cJ(a,b),this.near=c,this.far=d,this.camera=null,this.layers=new aU,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(a,b){this.ray.set(a,b)}setFromCamera(a,b){b.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(b.matrixWorld),this.ray.direction.set(a.x,a.y,.5).unproject(b).sub(this.ray.origin).normalize(),this.camera=b):b.isOrthographicCamera?(this.ray.origin.set(a.x,a.y,(b.near+b.far)/(b.near-b.far)).unproject(b),this.ray.direction.set(0,0,-1).transformDirection(b.matrixWorld),this.camera=b):V("Raycaster: Unsupported camera type: "+b.type)}setFromXRController(a){return hn.identity().extractRotation(a.matrixWorld),this.ray.origin.setFromMatrixPosition(a.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(hn),this}intersectObject(a,b=!0,c=[]){return hq(a,this,c,b),c.sort(hp),c}intersectObjects(a,b=!0,c=[]){for(let d=0,e=a.length;d<e;d++)hq(a[d],this,c,b);return c.sort(hp),c}}function hp(a,b){return a.distance-b.distance}function hq(a,b,c,d){let e=!0;if(a.layers.test(b.layers)&&!1===a.raycast(b,c)&&(e=!1),!0===e&&!0===d){let d=a.children;for(let a=0,e=d.length;a<e;a++)hq(d[a],b,c,!0)}}class hr{constructor(a=!0){this.autoStart=a,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,U("THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let b=performance.now();a=(b-this.oldTime)/1e3,this.oldTime=b,this.elapsedTime+=a}return a}}class hs{constructor(a=1,b=0,c=0){this.radius=a,this.phi=b,this.theta=c}set(a,b,c){return this.radius=a,this.phi=b,this.theta=c,this}copy(a){return this.radius=a.radius,this.phi=a.phi,this.theta=a.theta,this}makeSafe(){return this.phi=ad(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(a){return this.setFromCartesianCoords(a.x,a.y,a.z)}setFromCartesianCoords(a,b,c){return this.radius=Math.sqrt(a*a+b*b+c*c),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(a,c),this.phi=Math.acos(ad(b/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class ht{constructor(a=1,b=0,c=0){this.radius=a,this.theta=b,this.y=c}set(a,b,c){return this.radius=a,this.theta=b,this.y=c,this}copy(a){return this.radius=a.radius,this.theta=a.theta,this.y=a.y,this}setFromVector3(a){return this.setFromCartesianCoords(a.x,a.y,a.z)}setFromCartesianCoords(a,b,c){return this.radius=Math.sqrt(a*a+c*c),this.theta=Math.atan2(a,c),this.y=b,this}clone(){return new this.constructor().copy(this)}}class hu{constructor(a,b,c,d){hu.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==a&&this.set(a,b,c,d)}identity(){return this.set(1,0,0,1),this}fromArray(a,b=0){for(let c=0;c<4;c++)this.elements[c]=a[c+b];return this}set(a,b,c,d){let e=this.elements;return e[0]=a,e[2]=b,e[1]=c,e[3]=d,this}}let hv=new aj;class hw{constructor(a=new aj(Infinity,Infinity),b=new aj(-1/0,-1/0)){this.isBox2=!0,this.min=a,this.max=b}set(a,b){return this.min.copy(a),this.max.copy(b),this}setFromPoints(a){this.makeEmpty();for(let b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this}setFromCenterAndSize(a,b){let c=hv.copy(b).multiplyScalar(.5);return this.min.copy(a).sub(c),this.max.copy(a).add(c),this}clone(){return new this.constructor().copy(this)}copy(a){return this.min.copy(a.min),this.max.copy(a.max),this}makeEmpty(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(a){return this.isEmpty()?a.set(0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(a){return this.isEmpty()?a.set(0,0):a.subVectors(this.max,this.min)}expandByPoint(a){return this.min.min(a),this.max.max(a),this}expandByVector(a){return this.min.sub(a),this.max.add(a),this}expandByScalar(a){return this.min.addScalar(-a),this.max.addScalar(a),this}containsPoint(a){return a.x>=this.min.x&&a.x<=this.max.x&&a.y>=this.min.y&&a.y<=this.max.y}containsBox(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y}getParameter(a,b){return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(a){return a.max.x>=this.min.x&&a.min.x<=this.max.x&&a.max.y>=this.min.y&&a.min.y<=this.max.y}clampPoint(a,b){return b.copy(a).clamp(this.min,this.max)}distanceToPoint(a){return this.clampPoint(a,hv).distanceTo(a)}intersect(a){return this.min.max(a.min),this.max.min(a.max),this.isEmpty()&&this.makeEmpty(),this}union(a){return this.min.min(a.min),this.max.max(a.max),this}translate(a){return this.min.add(a),this.max.add(a),this}equals(a){return a.min.equals(this.min)&&a.max.equals(this.max)}}let hx=new al,hy=new al,hz=new al,hA=new al,hB=new al,hC=new al,hD=new al;class hE{constructor(a=new al,b=new al){this.start=a,this.end=b}set(a,b){return this.start.copy(a),this.end.copy(b),this}copy(a){return this.start.copy(a.start),this.end.copy(a.end),this}getCenter(a){return a.addVectors(this.start,this.end).multiplyScalar(.5)}delta(a){return a.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(a,b){return this.delta(b).multiplyScalar(a).add(this.start)}closestPointToPointParameter(a,b){hx.subVectors(a,this.start),hy.subVectors(this.end,this.start);let c=hy.dot(hy),d=hy.dot(hx)/c;return b&&(d=ad(d,0,1)),d}closestPointToPoint(a,b,c){let d=this.closestPointToPointParameter(a,b);return this.delta(c).multiplyScalar(d).add(this.start)}distanceSqToLine3(a,b=hC,c=hD){let d,e,f=1e-8*1e-8,g=this.start,h=a.start,i=this.end,j=a.end;hz.subVectors(i,g),hA.subVectors(j,h),hB.subVectors(g,h);let k=hz.dot(hz),l=hA.dot(hA),m=hA.dot(hB);if(k<=f&&l<=f)return b.copy(g),c.copy(h),b.sub(c),b.dot(b);if(k<=f)d=0,e=ad(e=m/l,0,1);else{let a=hz.dot(hB);if(l<=f)e=0,d=ad(-a/k,0,1);else{let b=hz.dot(hA),c=k*l-b*b;d=0!==c?ad((b*m-a*l)/c,0,1):0,(e=(b*d+m)/l)<0?(e=0,d=ad(-a/k,0,1)):e>1&&(e=1,d=ad((b-a)/k,0,1))}}return b.copy(g).addScaledVector(hz,d),c.copy(h).addScaledVector(hA,e),b.distanceToSquared(c)}applyMatrix4(a){return this.start.applyMatrix4(a),this.end.applyMatrix4(a),this}equals(a){return a.start.equals(this.start)&&a.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}let hF=new al;class hG extends a8{constructor(a,b){super(),this.light=a,this.matrixAutoUpdate=!1,this.color=b,this.type="SpotLightHelper";const c=new ce,d=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,b=1;a<32;a++,b++){const c=a/32*Math.PI*2,e=b/32*Math.PI*2;d.push(Math.cos(c),Math.sin(c),1,Math.cos(e),Math.sin(e),1)}c.setAttribute("position",new b2(d,3));const e=new dN({fog:!1,toneMapped:!1});this.cone=new dZ(c,e),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let a=this.light.distance?this.light.distance:1e3,b=a*Math.tan(this.light.angle);this.cone.scale.set(b,b,a),hF.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(hF),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}let hH=new al,hI=new aJ,hJ=new aJ;class hK extends dZ{constructor(a){const b=function a(b){let c=[];!0===b.isBone&&c.push(b);for(let d=0;d<b.children.length;d++)c.push(...a(b.children[d]));return c}(a),c=new ce,d=[],e=[];for(let a=0;a<b.length;a++){const c=b[a];c.parent&&c.parent.isBone&&(d.push(0,0,0),d.push(0,0,0),e.push(0,0,0),e.push(0,0,0))}c.setAttribute("position",new b2(d,3)),c.setAttribute("color",new b2(e,3)),super(c,new dN({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=a,this.bones=b,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1;const f=new bg(255),g=new bg(65280);this.setColors(f,g)}updateMatrixWorld(a){let b=this.bones,c=this.geometry,d=c.getAttribute("position");hJ.copy(this.root.matrixWorld).invert();for(let a=0,c=0;a<b.length;a++){let e=b[a];e.parent&&e.parent.isBone&&(hI.multiplyMatrices(hJ,e.matrixWorld),hH.setFromMatrixPosition(hI),d.setXYZ(c,hH.x,hH.y,hH.z),hI.multiplyMatrices(hJ,e.parent.matrixWorld),hH.setFromMatrixPosition(hI),d.setXYZ(c+1,hH.x,hH.y,hH.z),c+=2)}c.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(a)}setColors(a,b){let c=this.geometry.getAttribute("color");for(let d=0;d<c.count;d+=2)c.setXYZ(d,a.r,a.g,a.b),c.setXYZ(d+1,b.r,b.g,b.b);return c.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class hL extends cW{constructor(a,b,c){super(new fg(b,4,2),new cK({wireframe:!0,fog:!1,toneMapped:!1})),this.light=a,this.color=c,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}let hM=new al,hN=new bg,hO=new bg;class hP extends a8{constructor(a,b,c){super(),this.light=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.color=c,this.type="HemisphereLightHelper";const d=new fc(b);d.rotateY(.5*Math.PI),this.material=new cK({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const e=new Float32Array(3*d.getAttribute("position").count);d.setAttribute("color",new bV(e,3)),this.add(new cW(d,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let a=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let b=a.geometry.getAttribute("color");hN.copy(this.light.color),hO.copy(this.light.groundColor);for(let a=0,c=b.count;a<c;a++){let d=a<c/2?hN:hO;b.setXYZ(a,d.r,d.g,d.b)}b.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),a.lookAt(hM.setFromMatrixPosition(this.light.matrixWorld).negate())}}class hQ extends dZ{constructor(a=10,b=10,c=4473924,d=8947848){c=new bg(c),d=new bg(d);const e=b/2,f=a/b,g=a/2,h=[],i=[];for(let a=0,j=0,k=-g;a<=b;a++,k+=f){h.push(-g,0,k,g,0,k),h.push(k,0,-g,k,0,g);const b=a===e?c:d;b.toArray(i,j),j+=3,b.toArray(i,j),j+=3,b.toArray(i,j),j+=3,b.toArray(i,j),j+=3}const j=new ce;j.setAttribute("position",new b2(h,3)),j.setAttribute("color",new b2(i,3)),super(j,new dN({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class hR extends dZ{constructor(a=10,b=16,c=8,d=64,e=4473924,f=8947848){e=new bg(e),f=new bg(f);const g=[],h=[];if(b>1)for(let c=0;c<b;c++){const d=c/b*(2*Math.PI),i=Math.sin(d)*a,j=Math.cos(d)*a;g.push(0,0,0),g.push(i,0,j);const k=1&c?e:f;h.push(k.r,k.g,k.b),h.push(k.r,k.g,k.b)}for(let b=0;b<c;b++){const i=1&b?e:f,j=a-a/c*b;for(let a=0;a<d;a++){let b=a/d*(2*Math.PI),c=Math.sin(b)*j,e=Math.cos(b)*j;g.push(c,0,e),h.push(i.r,i.g,i.b),c=Math.sin(b=(a+1)/d*(2*Math.PI))*j,e=Math.cos(b)*j,g.push(c,0,e),h.push(i.r,i.g,i.b)}}const i=new ce;i.setAttribute("position",new b2(g,3)),i.setAttribute("color",new b2(h,3)),super(i,new dN({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}let hS=new al,hT=new al,hU=new al;class hV extends a8{constructor(a,b,c){super(),this.light=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.color=c,this.type="DirectionalLightHelper",void 0===b&&(b=1);let d=new ce;d.setAttribute("position",new b2([-b,b,0,b,b,0,b,-b,0,-b,-b,0,-b,b,0],3));const e=new dN({fog:!1,toneMapped:!1});this.lightPlane=new dV(d,e),this.add(this.lightPlane),(d=new ce).setAttribute("position",new b2([0,0,0,0,0,1],3)),this.targetLine=new dV(d,e),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),hS.setFromMatrixPosition(this.light.matrixWorld),hT.setFromMatrixPosition(this.light.target.matrixWorld),hU.subVectors(hT,hS),this.lightPlane.lookAt(hT),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(hT),this.targetLine.scale.z=hU.length()}}let hW=new al,hX=new gk;class hY extends dZ{constructor(a){const b=new ce,c=new dN({color:0xffffff,vertexColors:!0,toneMapped:!1}),d=[],e=[],f={};function g(a,b){h(a),h(b)}function h(a){d.push(0,0,0),e.push(0,0,0),void 0===f[a]&&(f[a]=[]),f[a].push(d.length/3-1)}g("n1","n2"),g("n2","n4"),g("n4","n3"),g("n3","n1"),g("f1","f2"),g("f2","f4"),g("f4","f3"),g("f3","f1"),g("n1","f1"),g("n2","f2"),g("n3","f3"),g("n4","f4"),g("p","n1"),g("p","n2"),g("p","n3"),g("p","n4"),g("u1","u2"),g("u2","u3"),g("u3","u1"),g("c","t"),g("p","c"),g("cn1","cn2"),g("cn3","cn4"),g("cf1","cf2"),g("cf3","cf4"),b.setAttribute("position",new b2(d,3)),b.setAttribute("color",new b2(e,3)),super(b,c),this.type="CameraHelper",this.camera=a,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=f,this.update();const i=new bg(0xffaa00),j=new bg(0xff0000),k=new bg(43775),l=new bg(0xffffff),m=new bg(3355443);this.setColors(i,j,k,l,m)}setColors(a,b,c,d,e){let f=this.geometry.getAttribute("color");return f.setXYZ(0,a.r,a.g,a.b),f.setXYZ(1,a.r,a.g,a.b),f.setXYZ(2,a.r,a.g,a.b),f.setXYZ(3,a.r,a.g,a.b),f.setXYZ(4,a.r,a.g,a.b),f.setXYZ(5,a.r,a.g,a.b),f.setXYZ(6,a.r,a.g,a.b),f.setXYZ(7,a.r,a.g,a.b),f.setXYZ(8,a.r,a.g,a.b),f.setXYZ(9,a.r,a.g,a.b),f.setXYZ(10,a.r,a.g,a.b),f.setXYZ(11,a.r,a.g,a.b),f.setXYZ(12,a.r,a.g,a.b),f.setXYZ(13,a.r,a.g,a.b),f.setXYZ(14,a.r,a.g,a.b),f.setXYZ(15,a.r,a.g,a.b),f.setXYZ(16,a.r,a.g,a.b),f.setXYZ(17,a.r,a.g,a.b),f.setXYZ(18,a.r,a.g,a.b),f.setXYZ(19,a.r,a.g,a.b),f.setXYZ(20,a.r,a.g,a.b),f.setXYZ(21,a.r,a.g,a.b),f.setXYZ(22,a.r,a.g,a.b),f.setXYZ(23,a.r,a.g,a.b),f.setXYZ(24,b.r,b.g,b.b),f.setXYZ(25,b.r,b.g,b.b),f.setXYZ(26,b.r,b.g,b.b),f.setXYZ(27,b.r,b.g,b.b),f.setXYZ(28,b.r,b.g,b.b),f.setXYZ(29,b.r,b.g,b.b),f.setXYZ(30,b.r,b.g,b.b),f.setXYZ(31,b.r,b.g,b.b),f.setXYZ(32,c.r,c.g,c.b),f.setXYZ(33,c.r,c.g,c.b),f.setXYZ(34,c.r,c.g,c.b),f.setXYZ(35,c.r,c.g,c.b),f.setXYZ(36,c.r,c.g,c.b),f.setXYZ(37,c.r,c.g,c.b),f.setXYZ(38,d.r,d.g,d.b),f.setXYZ(39,d.r,d.g,d.b),f.setXYZ(40,e.r,e.g,e.b),f.setXYZ(41,e.r,e.g,e.b),f.setXYZ(42,e.r,e.g,e.b),f.setXYZ(43,e.r,e.g,e.b),f.setXYZ(44,e.r,e.g,e.b),f.setXYZ(45,e.r,e.g,e.b),f.setXYZ(46,e.r,e.g,e.b),f.setXYZ(47,e.r,e.g,e.b),f.setXYZ(48,e.r,e.g,e.b),f.setXYZ(49,e.r,e.g,e.b),f.needsUpdate=!0,this}update(){let a,b,c=this.geometry,d=this.pointMap;if(hX.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)a=1,b=0;else if(2e3===this.camera.coordinateSystem)a=-1,b=1;else if(2001===this.camera.coordinateSystem)a=0,b=1;else throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);hZ("c",d,c,hX,0,0,a),hZ("t",d,c,hX,0,0,b),hZ("n1",d,c,hX,-1,-1,a),hZ("n2",d,c,hX,1,-1,a),hZ("n3",d,c,hX,-1,1,a),hZ("n4",d,c,hX,1,1,a),hZ("f1",d,c,hX,-1,-1,b),hZ("f2",d,c,hX,1,-1,b),hZ("f3",d,c,hX,-1,1,b),hZ("f4",d,c,hX,1,1,b),hZ("u1",d,c,hX,.7,1.1,a),hZ("u2",d,c,hX,-.7,1.1,a),hZ("u3",d,c,hX,0,2,a),hZ("cf1",d,c,hX,-1,0,b),hZ("cf2",d,c,hX,1,0,b),hZ("cf3",d,c,hX,0,-1,b),hZ("cf4",d,c,hX,0,1,b),hZ("cn1",d,c,hX,-1,0,a),hZ("cn2",d,c,hX,1,0,a),hZ("cn3",d,c,hX,0,-1,a),hZ("cn4",d,c,hX,0,1,a),c.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function hZ(a,b,c,d,e,f,g){hW.set(e,f,g).unproject(d);let h=b[a];if(void 0!==h){let a=c.getAttribute("position");for(let b=0,c=h.length;b<c;b++)a.setXYZ(h[b],hW.x,hW.y,hW.z)}}let h$=new bz;class h_ extends dZ{constructor(a,b=0xffff00){const c=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),d=new Float32Array(24),e=new ce;e.setIndex(new bV(c,1)),e.setAttribute("position",new bV(d,3)),super(e,new dN({color:b,toneMapped:!1})),this.object=a,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(void 0!==this.object&&h$.setFromObject(this.object),h$.isEmpty())return;let a=h$.min,b=h$.max,c=this.geometry.attributes.position,d=c.array;d[0]=b.x,d[1]=b.y,d[2]=b.z,d[3]=a.x,d[4]=b.y,d[5]=b.z,d[6]=a.x,d[7]=a.y,d[8]=b.z,d[9]=b.x,d[10]=a.y,d[11]=b.z,d[12]=b.x,d[13]=b.y,d[14]=a.z,d[15]=a.x,d[16]=b.y,d[17]=a.z,d[18]=a.x,d[19]=a.y,d[20]=a.z,d[21]=b.x,d[22]=a.y,d[23]=a.z,c.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(a){return this.object=a,this.update(),this}copy(a,b){return super.copy(a,b),this.object=a.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class h0 extends dZ{constructor(a,b=0xffff00){const c=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),d=new ce;d.setIndex(new bV(c,1)),d.setAttribute("position",new b2([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(d,new dN({color:b,toneMapped:!1})),this.box=a,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(a){let b=this.box;b.isEmpty()||(b.getCenter(this.position),b.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(a))}dispose(){this.geometry.dispose(),this.material.dispose()}}class h1 extends dV{constructor(a,b=1,c=0xffff00){const d=new ce;d.setAttribute("position",new b2([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),d.computeBoundingSphere(),super(d,new dN({color:c,toneMapped:!1})),this.type="PlaneHelper",this.plane=a,this.size=b;const e=new ce;e.setAttribute("position",new b2([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),e.computeBoundingSphere(),this.add(new cW(e,new cK({color:c,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(a){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(a)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}let h2=new al;class h3 extends a8{constructor(a=new al(0,0,1),b=new al(0,0,0),c=1,d=0xffff00,g=.2*c,h=.2*g){super(),this.type="ArrowHelper",void 0===e&&((e=new ce).setAttribute("position",new b2([0,0,0,0,1,0],3)),(f=new el(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(b),this.line=new dV(e,new dN({color:d,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new cW(f,new cK({color:d,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(a),this.setLength(c,g,h)}setDirection(a){if(a.y>.99999)this.quaternion.set(0,0,0,1);else if(a.y<-.99999)this.quaternion.set(1,0,0,0);else{h2.set(a.z,0,-a.x).normalize();let b=Math.acos(a.y);this.quaternion.setFromAxisAngle(h2,b)}}setLength(a,b=.2*a,c=.2*b){this.line.scale.set(1,Math.max(1e-4,a-b),1),this.line.updateMatrix(),this.cone.scale.set(c,b,c),this.cone.position.y=a,this.cone.updateMatrix()}setColor(a){this.line.material.color.set(a),this.cone.material.color.set(a)}copy(a){return super.copy(a,!1),this.line.copy(a.line),this.cone.copy(a.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class h4 extends dZ{constructor(a=1){const b=new ce;b.setAttribute("position",new b2([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a],3)),b.setAttribute("color",new b2([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(b,new dN({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(a,b,c){let d=new bg,e=this.geometry.attributes.color.array;return d.set(a),d.toArray(e,0),d.toArray(e,3),d.set(b),d.toArray(e,6),d.toArray(e,9),d.set(c),d.toArray(e,12),d.toArray(e,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class h5{constructor(){this.type="ShapePath",this.color=new bg,this.subPaths=[],this.currentPath=null}moveTo(a,b){return this.currentPath=new eO,this.subPaths.push(this.currentPath),this.currentPath.moveTo(a,b),this}lineTo(a,b){return this.currentPath.lineTo(a,b),this}quadraticCurveTo(a,b,c,d){return this.currentPath.quadraticCurveTo(a,b,c,d),this}bezierCurveTo(a,b,c,d,e,f){return this.currentPath.bezierCurveTo(a,b,c,d,e,f),this}splineThru(a){return this.currentPath.splineThru(a),this}toShapes(a){let b,c,d,e,f,g=e5.isClockWise,h=this.subPaths;if(0===h.length)return[];let i=[];if(1===h.length)return c=h[0],(d=new eP).curves=c.curves,i.push(d),i;let j=!g(h[0].getPoints());j=a?!j:j;let k=[],l=[],m=[],n=0;l[0]=void 0,m[n]=[];for(let d=0,f=h.length;d<f;d++)b=g(e=(c=h[d]).getPoints()),(b=a?!b:b)?(!j&&l[n]&&n++,l[n]={s:new eP,p:e},l[n].s.curves=c.curves,j&&n++,m[n]=[]):m[n].push({h:c,p:e[0]});if(!l[0])return function(a){let b=[];for(let c=0,d=a.length;c<d;c++){let d=a[c],e=new eP;e.curves=d.curves,b.push(e)}return b}(h);if(l.length>1){let a=!1,b=0;for(let a=0,b=l.length;a<b;a++)k[a]=[];for(let c=0,d=l.length;c<d;c++){let d=m[c];for(let e=0;e<d.length;e++){let f=d[e],g=!0;for(let d=0;d<l.length;d++)(function(a,b){let c=b.length,d=!1;for(let e=c-1,f=0;f<c;e=f++){let c=b[e],g=b[f],h=g.x-c.x,i=g.y-c.y;if(Math.abs(i)>Number.EPSILON){if(i<0&&(c=b[f],h=-h,g=b[e],i=-i),a.y<c.y||a.y>g.y)continue;if(a.y===c.y){if(a.x===c.x)return!0}else{let b=i*(a.x-c.x)-h*(a.y-c.y);if(0===b)return!0;if(b<0)continue;d=!d}}else{if(a.y!==c.y)continue;if(g.x<=a.x&&a.x<=c.x||c.x<=a.x&&a.x<=g.x)return!0}}return d})(f.p,l[d].p)&&(c!==d&&b++,g?(g=!1,k[d].push(f)):a=!0);g&&k[c].push(f)}}b>0&&!1===a&&(m=k)}for(let a=0,b=l.length;a<b;a++){d=l[a].s,i.push(d),f=m[a];for(let a=0,b=f.length;a<b;a++)d.holes.push(f[a].h)}return i}}class h6 extends Z{constructor(a,b=null){super(),this.object=a,this.domElement=b,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(a){void 0===a?U("Controls: connect() now requires an element."):(null!==this.domElement&&this.disconnect(),this.domElement=a)}disconnect(){}dispose(){}update(){}}function h7(a,b,c,d){let e=function(a){switch(a){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${a}.`)}(d);switch(c){case 1021:return a*b;case 1028:case 1029:return a*b/e.components*e.byteLength;case 1030:case 1031:return a*b*2/e.components*e.byteLength;case 1022:return a*b*3/e.components*e.byteLength;case 1023:case 1033:return a*b*4/e.components*e.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((a+3)/4)*Math.floor((b+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((a+3)/4)*Math.floor((b+3)/4)*16;case 35841:case 35843:return Math.max(a,16)*Math.max(b,8)/4;case 35840:case 35842:return Math.max(a,8)*Math.max(b,8)/2;case 37809:return Math.floor((a+4)/5)*Math.floor((b+3)/4)*16;case 37810:return Math.floor((a+4)/5)*Math.floor((b+4)/5)*16;case 37811:return Math.floor((a+5)/6)*Math.floor((b+4)/5)*16;case 37812:return Math.floor((a+5)/6)*Math.floor((b+5)/6)*16;case 37813:return Math.floor((a+7)/8)*Math.floor((b+4)/5)*16;case 37814:return Math.floor((a+7)/8)*Math.floor((b+5)/6)*16;case 37815:return Math.floor((a+7)/8)*Math.floor((b+7)/8)*16;case 37816:return Math.floor((a+9)/10)*Math.floor((b+4)/5)*16;case 37817:return Math.floor((a+9)/10)*Math.floor((b+5)/6)*16;case 37818:return Math.floor((a+9)/10)*Math.floor((b+7)/8)*16;case 37819:return Math.floor((a+9)/10)*Math.floor((b+9)/10)*16;case 37820:return Math.floor((a+11)/12)*Math.floor((b+9)/10)*16;case 37821:return Math.floor((a+11)/12)*Math.floor((b+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(a/4)*Math.ceil(b/4)*16;case 36283:case 36284:return Math.ceil(a/4)*Math.ceil(b/4)*8}throw Error(`Unable to determine texture byte length for ${c} format.`)}class h8{static contain(a,b){let c;return(c=a.image&&a.image.width?a.image.width/a.image.height:1)>b?(a.repeat.x=1,a.repeat.y=c/b,a.offset.x=0,a.offset.y=(1-a.repeat.y)/2):(a.repeat.x=b/c,a.repeat.y=1,a.offset.x=(1-a.repeat.x)/2,a.offset.y=0),a}static cover(a,b){let c;return(c=a.image&&a.image.width?a.image.width/a.image.height:1)>b?(a.repeat.x=b/c,a.repeat.y=1,a.offset.x=(1-a.repeat.x)/2,a.offset.y=0):(a.repeat.x=1,a.repeat.y=c/b,a.offset.x=0,a.offset.y=(1-a.repeat.y)/2),a}static fill(a){return a.repeat.x=1,a.repeat.y=1,a.offset.x=0,a.offset.y=0,a}static getByteLength(a,b,c,d){return h7(a,b,c,d)}}function h9(){let a=null,b=!1,c=null,d=null;function e(b,f){c(b,f),d=a.requestAnimationFrame(e)}return{start:function(){!0===b||null!==c&&(d=a.requestAnimationFrame(e),b=!0)},stop:function(){a.cancelAnimationFrame(d),b=!1},setAnimationLoop:function(a){c=a},setContext:function(b){a=b}}}function ia(a){let b=new WeakMap;return{get:function(a){return a.isInterleavedBufferAttribute&&(a=a.data),b.get(a)},remove:function(c){c.isInterleavedBufferAttribute&&(c=c.data);let d=b.get(c);d&&(a.deleteBuffer(d.buffer),b.delete(c))},update:function(c,d){if(c.isInterleavedBufferAttribute&&(c=c.data),c.isGLBufferAttribute){let a=b.get(c);(!a||a.version<c.version)&&b.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}let e=b.get(c);if(void 0===e)b.set(c,function(b,c){let d,e=b.array,f=b.usage,g=e.byteLength,h=a.createBuffer();if(a.bindBuffer(c,h),a.bufferData(c,e,f),b.onUploadCallback(),e instanceof Float32Array)d=a.FLOAT;else if("u">typeof Float16Array&&e instanceof Float16Array)d=a.HALF_FLOAT;else if(e instanceof Uint16Array)d=b.isFloat16BufferAttribute?a.HALF_FLOAT:a.UNSIGNED_SHORT;else if(e instanceof Int16Array)d=a.SHORT;else if(e instanceof Uint32Array)d=a.UNSIGNED_INT;else if(e instanceof Int32Array)d=a.INT;else if(e instanceof Int8Array)d=a.BYTE;else if(e instanceof Uint8Array)d=a.UNSIGNED_BYTE;else if(e instanceof Uint8ClampedArray)d=a.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+e);return{buffer:h,type:d,bytesPerElement:e.BYTES_PER_ELEMENT,version:b.version,size:g}}(c,d));else if(e.version<c.version){if(e.size!==c.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(b,c,d){let e=c.array,f=c.updateRanges;if(a.bindBuffer(d,b),0===f.length)a.bufferSubData(d,0,e);else{f.sort((a,b)=>a.start-b.start);let b=0;for(let a=1;a<f.length;a++){let c=f[b],d=f[a];d.start<=c.start+c.count+1?c.count=Math.max(c.count,d.start+d.count-c.start):f[++b]=d}f.length=b+1;for(let b=0,c=f.length;b<c;b++){let c=f[b];a.bufferSubData(d,c.start*e.BYTES_PER_ELEMENT,e,c.start,c.count)}c.clearUpdateRanges()}c.onUploadCallback()}(e.buffer,c,d),e.version=c.version}}}}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"183"}})),a.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveAnimationBlendMode",()=>2501,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"AlwaysStencilFunc",()=>519,"AmbientLight",()=>gw,"AnimationAction",()=>he,"AnimationClip",()=>fX,"AnimationLoader",()=>f4,"AnimationMixer",()=>hg,"AnimationObjectGroup",()=>hd,"AnimationUtils",()=>fJ,"ArcCurve",()=>ev,"ArrayCamera",()=>gR,"ArrowHelper",()=>h3,"AttachedBindMode",()=>y,"Audio",()=>g$,"AudioAnalyser",()=>g4,"AudioContext",()=>gK,"AudioListener",()=>gZ,"AudioLoader",()=>gL,"AxesHelper",()=>h4,"BackSide",()=>1,"BasicDepthPacking",()=>3200,"BasicShadowMap",()=>0,"BatchedMesh",()=>dM,"BezierInterpolant",()=>fO,"Bone",()=>c6,"BooleanKeyframeTrack",()=>fQ,"Box2",()=>hw,"Box3",()=>bz,"Box3Helper",()=>h0,"BoxGeometry",()=>eh,"BoxHelper",()=>h_,"BufferAttribute",()=>bV,"BufferGeometry",()=>ce,"BufferGeometryLoader",()=>gD,"ByteType",()=>1010,"Cache",()=>fY,"Camera",()=>gk,"CameraHelper",()=>hY,"CanvasTexture",()=>ed,"CapsuleGeometry",()=>ei,"CatmullRomCurve3",()=>eB,"CineonToneMapping",()=>3,"CircleGeometry",()=>ej,"ClampToEdgeWrapping",()=>1001,"Clock",()=>hr,"Color",()=>bg,"ColorKeyframeTrack",()=>fR,"ColorManagement",()=>as,"Compatibility",()=>I,"CompressedArrayTexture",()=>ea,"CompressedCubeTexture",()=>eb,"CompressedTexture",()=>d9,"CompressedTextureLoader",()=>f5,"ConeGeometry",()=>el,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"Controls",()=>h6,"CubeCamera",()=>gQ,"CubeDepthTexture",()=>ef,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>ec,"CubeTextureLoader",()=>f8,"CubeUVReflectionMapping",()=>306,"CubicBezierCurve",()=>eF,"CubicBezierCurve3",()=>eG,"CubicInterpolant",()=>fL,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceFrontBack",()=>3,"CullFaceNone",()=>0,"Curve",()=>et,"CurvePath",()=>eN,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"CylinderGeometry",()=>ek,"Cylindrical",()=>ht,"Data3DTexture",()=>aH,"DataArrayTexture",()=>aF,"DataTexture",()=>c7,"DataTextureLoader",()=>f9,"DataUtils",()=>bR,"DecrementStencilOp",()=>7683,"DecrementWrapStencilOp",()=>34056,"DefaultLoadingManager",()=>f_,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>ee,"DetachedBindMode",()=>z,"DirectionalLight",()=>gv,"DirectionalLightHelper",()=>hV,"DiscreteInterpolant",()=>fN,"DodecahedronGeometry",()=>en,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"DynamicCopyUsage",()=>35050,"DynamicDrawUsage",()=>35048,"DynamicReadUsage",()=>35049,"EdgesGeometry",()=>es,"EllipseCurve",()=>eu,"EqualCompare",()=>514,"EqualDepth",()=>4,"EqualStencilFunc",()=>514,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>aT,"EventDispatcher",()=>Z,"ExternalTexture",()=>eg,"ExtrudeGeometry",()=>e8,"FileLoader",()=>f3,"Float16BufferAttribute",()=>b1,"Float32BufferAttribute",()=>b2,"FloatType",()=>1015,"Fog",()=>bj,"FogExp2",()=>bi,"FramebufferTexture",()=>d8,"FrontSide",()=>0,"Frustum",()=>ds,"FrustumArray",()=>dv,"GLBufferAttribute",()=>hm,"GLSL1",()=>"100","GLSL3",()=>E,"GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"GreaterEqualStencilFunc",()=>518,"GreaterStencilFunc",()=>516,"GridHelper",()=>hQ,"Group",()=>a9,"HalfFloatType",()=>1016,"HemisphereLight",()=>gc,"HemisphereLightHelper",()=>hP,"IcosahedronGeometry",()=>fa,"ImageBitmapLoader",()=>gJ,"ImageLoader",()=>f7,"ImageUtils",()=>av,"IncrementStencilOp",()=>7682,"IncrementWrapStencilOp",()=>34055,"InstancedBufferAttribute",()=>db,"InstancedBufferGeometry",()=>gC,"InstancedInterleavedBuffer",()=>hl,"InstancedMesh",()=>dj,"Int16BufferAttribute",()=>bZ,"Int32BufferAttribute",()=>b_,"Int8BufferAttribute",()=>bW,"IntType",()=>1013,"InterleavedBuffer",()=>cf,"InterleavedBufferAttribute",()=>ch,"Interpolant",()=>fK,"InterpolateBezier",()=>2303,"InterpolateDiscrete",()=>2300,"InterpolateLinear",()=>2301,"InterpolateSmooth",()=>2302,"InterpolationSamplingMode",()=>H,"InterpolationSamplingType",()=>G,"InvertStencilOp",()=>5386,"KeepStencilOp",()=>7680,"KeyframeTrack",()=>fP,"LOD",()=>cB,"LatheGeometry",()=>fb,"Layers",()=>aU,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LessEqualStencilFunc",()=>515,"LessStencilFunc",()=>513,"Light",()=>gb,"LightProbe",()=>gz,"Line",()=>dV,"Line3",()=>hE,"LineBasicMaterial",()=>dN,"LineCurve",()=>eH,"LineCurve3",()=>eI,"LineDashedMaterial",()=>fE,"LineLoop",()=>d$,"LineSegments",()=>dZ,"LinearFilter",()=>1006,"LinearInterpolant",()=>fM,"LinearMipMapLinearFilter",()=>1008,"LinearMipMapNearestFilter",()=>1007,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>B,"LinearToneMapping",()=>1,"LinearTransfer",()=>C,"Loader",()=>f0,"LoaderUtils",()=>gB,"LoadingManager",()=>f$,"LoopOnce",()=>2200,"LoopPingPong",()=>2202,"LoopRepeat",()=>2201,"MOUSE",()=>w,"Material",()=>cj,"MaterialBlending",()=>6,"MaterialLoader",()=>gA,"MathUtils",()=>ai,"Matrix2",()=>hu,"Matrix3",()=>ao,"Matrix4",()=>aJ,"MaxEquation",()=>104,"Mesh",()=>cW,"MeshBasicMaterial",()=>cK,"MeshDepthMaterial",()=>fB,"MeshDistanceMaterial",()=>fC,"MeshLambertMaterial",()=>fA,"MeshMatcapMaterial",()=>fD,"MeshNormalMaterial",()=>fz,"MeshPhongMaterial",()=>fx,"MeshPhysicalMaterial",()=>fw,"MeshStandardMaterial",()=>fv,"MeshToonMaterial",()=>fy,"MinEquation",()=>103,"MirroredRepeatWrapping",()=>1002,"MixOperation",()=>1,"MultiplyBlending",()=>4,"MultiplyOperation",()=>0,"NearestFilter",()=>1003,"NearestMipMapLinearFilter",()=>1005,"NearestMipMapNearestFilter",()=>1004,"NearestMipmapLinearFilter",()=>1005,"NearestMipmapNearestFilter",()=>1004,"NeutralToneMapping",()=>7,"NeverCompare",()=>512,"NeverDepth",()=>0,"NeverStencilFunc",()=>512,"NoBlending",()=>0,"NoColorSpace",()=>"","NoNormalPacking",()=>"","NoToneMapping",()=>0,"NormalAnimationBlendMode",()=>2500,"NormalBlending",()=>1,"NormalGAPacking",()=>"ga","NormalRGPacking",()=>"rg","NotEqualCompare",()=>517,"NotEqualDepth",()=>7,"NotEqualStencilFunc",()=>517,"NumberKeyframeTrack",()=>fS,"Object3D",()=>a8,"ObjectLoader",()=>gE,"ObjectSpaceNormalMap",()=>1,"OctahedronGeometry",()=>fc,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>gt,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"Path",()=>eO,"PerspectiveCamera",()=>go,"Plane",()=>dn,"PlaneGeometry",()=>fd,"PlaneHelper",()=>h1,"PointLight",()=>gs,"PointLightHelper",()=>hL,"Points",()=>d4,"PointsMaterial",()=>d_,"PolarGridHelper",()=>hR,"PolyhedronGeometry",()=>em,"PositionalAudio",()=>g3,"PropertyBinding",()=>hc,"PropertyMixer",()=>g5,"QuadraticBezierCurve",()=>eJ,"QuadraticBezierCurve3",()=>eK,"Quaternion",()=>ak,"QuaternionKeyframeTrack",()=>fU,"QuaternionLinearInterpolant",()=>fT,"R11_EAC_Format",()=>37488,"RAD2DEG",()=>ab,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"183","RG11_EAC_Format",()=>37490,"RGBADepthPacking",()=>3201,"RGBAFormat",()=>1023,"RGBAIntegerFormat",()=>1033,"RGBA_ASTC_10x10_Format",()=>37819,"RGBA_ASTC_10x5_Format",()=>37816,"RGBA_ASTC_10x6_Format",()=>37817,"RGBA_ASTC_10x8_Format",()=>37818,"RGBA_ASTC_12x10_Format",()=>37820,"RGBA_ASTC_12x12_Format",()=>37821,"RGBA_ASTC_4x4_Format",()=>37808,"RGBA_ASTC_5x4_Format",()=>37809,"RGBA_ASTC_5x5_Format",()=>37810,"RGBA_ASTC_6x5_Format",()=>37811,"RGBA_ASTC_6x6_Format",()=>37812,"RGBA_ASTC_8x5_Format",()=>37813,"RGBA_ASTC_8x6_Format",()=>37814,"RGBA_ASTC_8x8_Format",()=>37815,"RGBA_BPTC_Format",()=>36492,"RGBA_ETC2_EAC_Format",()=>37496,"RGBA_PVRTC_2BPPV1_Format",()=>35843,"RGBA_PVRTC_4BPPV1_Format",()=>35842,"RGBA_S3TC_DXT1_Format",()=>33777,"RGBA_S3TC_DXT3_Format",()=>33778,"RGBA_S3TC_DXT5_Format",()=>33779,"RGBDepthPacking",()=>3202,"RGBFormat",()=>1022,"RGBIntegerFormat",()=>1032,"RGB_BPTC_SIGNED_Format",()=>36494,"RGB_BPTC_UNSIGNED_Format",()=>36495,"RGB_ETC1_Format",()=>36196,"RGB_ETC2_Format",()=>37492,"RGB_PVRTC_2BPPV1_Format",()=>35841,"RGB_PVRTC_4BPPV1_Format",()=>35840,"RGB_S3TC_DXT1_Format",()=>33776,"RGDepthPacking",()=>3203,"RGFormat",()=>1030,"RGIntegerFormat",()=>1031,"RawShaderMaterial",()=>fu,"Ray",()=>cJ,"Raycaster",()=>ho,"RectAreaLight",()=>gx,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RenderTarget",()=>aD,"RenderTarget3D",()=>hh,"RepeatWrapping",()=>1e3,"ReplaceStencilOp",()=>7681,"ReverseSubtractEquation",()=>102,"ReversedDepthFuncs",()=>Y,"RingGeometry",()=>fe,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>36286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>A,"SRGBTransfer",()=>D,"Scene",()=>bk,"ShaderMaterial",()=>ft,"ShadowMaterial",()=>fo,"Shape",()=>eP,"ShapeGeometry",()=>ff,"ShapePath",()=>h5,"ShapeUtils",()=>e5,"ShortType",()=>1011,"Skeleton",()=>da,"SkeletonHelper",()=>hK,"SkinnedMesh",()=>c5,"Source",()=>ax,"Sphere",()=>b6,"SphereGeometry",()=>fg,"Spherical",()=>hs,"SphericalHarmonics3",()=>gy,"SplineCurve",()=>eL,"SpotLight",()=>gq,"SpotLightHelper",()=>hG,"Sprite",()=>cx,"SpriteMaterial",()=>ck,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"StaticCopyUsage",()=>35046,"StaticDrawUsage",()=>35044,"StaticReadUsage",()=>35045,"StereoCamera",()=>gP,"StreamCopyUsage",()=>35042,"StreamDrawUsage",()=>35040,"StreamReadUsage",()=>35041,"StringKeyframeTrack",()=>fV,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TOUCH",()=>x,"TangentSpaceNormalMap",()=>0,"TetrahedronGeometry",()=>fh,"Texture",()=>aB,"TextureLoader",()=>ga,"TextureUtils",()=>h8,"Timer",()=>gS,"TimestampQuery",()=>F,"TorusGeometry",()=>fi,"TorusKnotGeometry",()=>fj,"Triangle",()=>by,"TriangleFanDrawMode",()=>2,"TriangleStripDrawMode",()=>1,"TrianglesDrawMode",()=>0,"TubeGeometry",()=>fk,"UVMapping",()=>300,"Uint16BufferAttribute",()=>b$,"Uint32BufferAttribute",()=>b0,"Uint8BufferAttribute",()=>bX,"Uint8ClampedBufferAttribute",()=>bY,"Uniform",()=>hi,"UniformsGroup",()=>hk,"UniformsUtils",()=>fs,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>aj,"Vector3",()=>al,"Vector4",()=>aC,"VectorKeyframeTrack",()=>fW,"VideoFrameTexture",()=>d7,"VideoTexture",()=>d6,"WebGL3DRenderTarget",()=>aI,"WebGLArrayRenderTarget",()=>aG,"WebGLCoordinateSystem",()=>2e3,"WebGLRenderTarget",()=>aE,"WebGPUCoordinateSystem",()=>2001,"WebXRController",()=>bb,"WireframeGeometry",()=>fl,"WrapAroundEnding",()=>2402,"ZeroCurvatureEnding",()=>2400,"ZeroFactor",()=>200,"ZeroSlopeEnding",()=>2401,"ZeroStencilOp",()=>0,"cloneUniforms",()=>fp,"createCanvasElement",()=>N,"createElementNS",()=>M,"error",()=>V,"getByteLength",()=>h7,"getConsoleFunction",()=>R,"getUnlitUniformColorSpace",()=>fr,"log",()=>S,"mergeUniforms",()=>fq,"probeAsync",()=>X,"setConsoleFunction",()=>Q,"warn",()=>U,"warnOnce",()=>W],35258);let ib={alphahash_fragment:"#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec4 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );\n }\n#endif",batching_vertex:"#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec4 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec4( 1.0 );\n#endif\n#ifdef USE_COLOR_ALPHA\n vColor *= color;\n#elif defined( USE_COLOR )\n vColor.rgb *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.rgb *= instanceColor.rgb;\n#endif\n#ifdef USE_BATCHING_COLOR\n vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = metalnessFactor;\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = vec3( 0.04 );\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n vec3 diffuseContribution;\n vec3 specularColor;\n vec3 specularColorBlended;\n float roughness;\n float metalness;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n vec3 iridescenceFresnelDielectric;\n vec3 iridescenceFresnelMetallic;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return v;\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColorBlended;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float rInv = 1.0 / ( roughness + 0.1 );\n float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n float DG = exp( a * dotNV + b );\n return saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n float Ess_V = dfgV.x + dfgV.y;\n float Ess_L = dfgL.x + dfgL.y;\n float Ems_V = 1.0 - Ess_V;\n float Ems_L = 1.0 - Ess_L;\n vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n float compensationFactor = Ems_V * Ems_L;\n vec3 multiScatter = Fms * compensationFactor;\n return singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n #ifdef USE_CLEARCOAT\n vec3 Ncc = geometryClearcoatNormal;\n vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\n vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\n vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\n mat3 mInvClearcoat = mat3(\n vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\n vec3( 0, 1, 0 ),\n vec3( t1Clearcoat.z, 0, t1Clearcoat.w )\n );\n vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\n clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\n #endif\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n \n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n irradiance *= sheenEnergyComp;\n \n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n diffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectDiffuse += diffuse;\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n #endif\n vec3 singleScatteringDielectric = vec3( 0.0 );\n vec3 multiScatteringDielectric = vec3( 0.0 );\n vec3 singleScatteringMetallic = vec3( 0.0 );\n vec3 multiScatteringMetallic = vec3( 0.0 );\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #endif\n vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n vec3 indirectSpecular = radiance * singleScattering;\n indirectSpecular += multiScattering * cosineWeightedIrradiance;\n vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n indirectSpecular *= sheenEnergyComp;\n indirectDiffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectSpecular += indirectSpecular;\n reflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\n #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n #if defined( LAMBERT ) || defined( PHONG )\n irradiance += iblIrradiance;\n #endif\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n #ifdef USE_REVERSED_DEPTH_BUFFER\n \n return depth * ( far - near ) - far;\n #else\n return depth * ( near - far ) - near;\n #endif\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n \n #ifdef USE_REVERSED_DEPTH_BUFFER\n return ( near * far ) / ( ( near - far ) * depth - near );\n #else\n return ( near * far ) / ( ( far - near ) * depth - far );\n #endif\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #else\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #else\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #elif defined( SHADOWMAP_TYPE_BASIC )\n uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float interleavedGradientNoise( vec2 position ) {\n return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n }\n vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n const float goldenAngle = 2.399963229728653;\n float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n float theta = float( sampleIndex ) * goldenAngle + phi;\n return vec2( cos( theta ), sin( theta ) ) * r;\n }\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float radius = shadowRadius * texelSize.x;\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n shadow = (\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_VSM )\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadowCoord.z -= shadowBias;\n #else\n shadowCoord.z += shadowBias;\n #endif\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n float mean = distribution.x;\n float variance = distribution.y * distribution.y;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( mean, shadowCoord.z );\n #else\n float hard_shadow = step( shadowCoord.z, mean );\n #endif\n \n if ( hard_shadow == 1.0 ) {\n shadow = 1.0;\n } else {\n variance = max( variance, 0.0000001 );\n float d = shadowCoord.z - mean;\n float p_max = variance / ( variance + d * d );\n p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n shadow = max( hard_shadow, p_max );\n }\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #else\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadowCoord.z -= shadowBias;\n #else\n shadowCoord.z += shadowBias;\n #endif\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n float depth = texture2D( shadowMap, shadowCoord.xy ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, shadowCoord.z );\n #else\n shadow = step( shadowCoord.z, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp -= shadowBias;\n #else\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n #endif\n float texelSize = shadowRadius / shadowMapSize.x;\n vec3 absDir = abs( bd3D );\n vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n tangent = normalize( cross( bd3D, tangent ) );\n vec3 bitangent = cross( bd3D, tangent );\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n vec2 sample0 = vogelDiskSample( 0, 5, phi );\n vec2 sample1 = vogelDiskSample( 1, 5, phi );\n vec2 sample2 = vogelDiskSample( 2, 5, phi );\n vec2 sample3 = vogelDiskSample( 3, 5, phi );\n vec2 sample4 = vogelDiskSample( 4, 5, phi );\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_BASIC )\n float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n depth = 1.0 - depth;\n #endif\n shadow = step( dp, depth );\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #endif\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distance_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n \n outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\n \n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}"},ic={common:{diffuse:{value:new bg(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new ao},alphaMap:{value:null},alphaMapTransform:{value:new ao},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ao}},envmap:{envMap:{value:null},envMapRotation:{value:new ao},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ao}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ao}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ao},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ao},normalScale:{value:new aj(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ao},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ao}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ao}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ao}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new bg(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new bg(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ao},alphaTest:{value:0},uvTransform:{value:new ao}},sprite:{diffuse:{value:new bg(0xffffff)},opacity:{value:1},center:{value:new aj(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ao},alphaMap:{value:null},alphaMapTransform:{value:new ao},alphaTest:{value:0}}},id={basic:{uniforms:fq([ic.common,ic.specularmap,ic.envmap,ic.aomap,ic.lightmap,ic.fog]),vertexShader:ib.meshbasic_vert,fragmentShader:ib.meshbasic_frag},lambert:{uniforms:fq([ic.common,ic.specularmap,ic.envmap,ic.aomap,ic.lightmap,ic.emissivemap,ic.bumpmap,ic.normalmap,ic.displacementmap,ic.fog,ic.lights,{emissive:{value:new bg(0)},envMapIntensity:{value:1}}]),vertexShader:ib.meshlambert_vert,fragmentShader:ib.meshlambert_frag},phong:{uniforms:fq([ic.common,ic.specularmap,ic.envmap,ic.aomap,ic.lightmap,ic.emissivemap,ic.bumpmap,ic.normalmap,ic.displacementmap,ic.fog,ic.lights,{emissive:{value:new bg(0)},specular:{value:new bg(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:ib.meshphong_vert,fragmentShader:ib.meshphong_frag},standard:{uniforms:fq([ic.common,ic.envmap,ic.aomap,ic.lightmap,ic.emissivemap,ic.bumpmap,ic.normalmap,ic.displacementmap,ic.roughnessmap,ic.metalnessmap,ic.fog,ic.lights,{emissive:{value:new bg(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ib.meshphysical_vert,fragmentShader:ib.meshphysical_frag},toon:{uniforms:fq([ic.common,ic.aomap,ic.lightmap,ic.emissivemap,ic.bumpmap,ic.normalmap,ic.displacementmap,ic.gradientmap,ic.fog,ic.lights,{emissive:{value:new bg(0)}}]),vertexShader:ib.meshtoon_vert,fragmentShader:ib.meshtoon_frag},matcap:{uniforms:fq([ic.common,ic.bumpmap,ic.normalmap,ic.displacementmap,ic.fog,{matcap:{value:null}}]),vertexShader:ib.meshmatcap_vert,fragmentShader:ib.meshmatcap_frag},points:{uniforms:fq([ic.points,ic.fog]),vertexShader:ib.points_vert,fragmentShader:ib.points_frag},dashed:{uniforms:fq([ic.common,ic.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ib.linedashed_vert,fragmentShader:ib.linedashed_frag},depth:{uniforms:fq([ic.common,ic.displacementmap]),vertexShader:ib.depth_vert,fragmentShader:ib.depth_frag},normal:{uniforms:fq([ic.common,ic.bumpmap,ic.normalmap,ic.displacementmap,{opacity:{value:1}}]),vertexShader:ib.meshnormal_vert,fragmentShader:ib.meshnormal_frag},sprite:{uniforms:fq([ic.sprite,ic.fog]),vertexShader:ib.sprite_vert,fragmentShader:ib.sprite_frag},background:{uniforms:{uvTransform:{value:new ao},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ib.background_vert,fragmentShader:ib.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ao}},vertexShader:ib.backgroundCube_vert,fragmentShader:ib.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ib.cube_vert,fragmentShader:ib.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ib.equirect_vert,fragmentShader:ib.equirect_frag},distance:{uniforms:fq([ic.common,ic.displacementmap,{referencePosition:{value:new al},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ib.distance_vert,fragmentShader:ib.distance_frag},shadow:{uniforms:fq([ic.lights,ic.fog,{color:{value:new bg(0)},opacity:{value:1}}]),vertexShader:ib.shadow_vert,fragmentShader:ib.shadow_frag}};id.physical={uniforms:fq([id.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ao},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ao},clearcoatNormalScale:{value:new aj(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ao},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ao},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ao},sheen:{value:0},sheenColor:{value:new bg(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ao},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ao},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ao},transmissionSamplerSize:{value:new aj},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ao},attenuationDistance:{value:0},attenuationColor:{value:new bg(0)},specularColor:{value:new bg(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ao},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ao},anisotropyVector:{value:new aj},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ao}}]),vertexShader:ib.meshphysical_vert,fragmentShader:ib.meshphysical_frag};let ie={r:0,b:0,g:0},ig=new aT,ih=new aJ;function ii(a,b,c,d,e,f){let g,h,i=new bg(0),j=+(!0!==e),k=null,l=0,m=null;function n(a){let c=!0===a.isScene?a.background:null;if(c&&c.isTexture){let d=a.backgroundBlurriness>0;c=b.get(c,d)}return c}function o(b,d){b.getRGB(ie,fr(a)),c.buffers.color.setClear(ie.r,ie.g,ie.b,d,f)}return{getClearColor:function(){return i},setClearColor:function(a,b=1){i.set(a),o(i,j=b)},getClearAlpha:function(){return j},setClearAlpha:function(a){o(i,j=a)},render:function(b){let d=!1,e=n(b);null===e?o(i,j):e&&e.isColor&&(o(e,1),d=!0);let g=a.xr.getEnvironmentBlendMode();"additive"===g?c.buffers.color.setClear(0,0,0,1,f):"alpha-blend"===g&&c.buffers.color.setClear(0,0,0,0,f),(a.autoClear||d)&&(c.buffers.depth.setTest(!0),c.buffers.depth.setMask(!0),c.buffers.color.setMask(!0),a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil))},addToRenderList:function(b,c){let e=n(c);e&&(e.isCubeTexture||306===e.mapping)?(void 0===h&&((h=new cW(new eh(1,1,1),new ft({name:"BackgroundCubeMaterial",uniforms:fp(id.backgroundCube.uniforms),vertexShader:id.backgroundCube.vertexShader,fragmentShader:id.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),d.update(h)),ig.copy(c.backgroundRotation),ig.x*=-1,ig.y*=-1,ig.z*=-1,e.isCubeTexture&&!1===e.isRenderTargetTexture&&(ig.y*=-1,ig.z*=-1),h.material.uniforms.envMap.value=e,h.material.uniforms.flipEnvMap.value=e.isCubeTexture&&!1===e.isRenderTargetTexture?-1:1,h.material.uniforms.backgroundBlurriness.value=c.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=c.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(ih.makeRotationFromEuler(ig)),h.material.toneMapped=as.getTransfer(e.colorSpace)!==D,(k!==e||l!==e.version||m!==a.toneMapping)&&(h.material.needsUpdate=!0,k=e,l=e.version,m=a.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):e&&e.isTexture&&(void 0===g&&((g=new cW(new fd(2,2),new ft({name:"BackgroundMaterial",uniforms:fp(id.background.uniforms),vertexShader:id.background.vertexShader,fragmentShader:id.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(g.material,"map",{get:function(){return this.uniforms.t2D.value}}),d.update(g)),g.material.uniforms.t2D.value=e,g.material.uniforms.backgroundIntensity.value=c.backgroundIntensity,g.material.toneMapped=as.getTransfer(e.colorSpace)!==D,!0===e.matrixAutoUpdate&&e.updateMatrix(),g.material.uniforms.uvTransform.value.copy(e.matrix),(k!==e||l!==e.version||m!==a.toneMapping)&&(g.material.needsUpdate=!0,k=e,l=e.version,m=a.toneMapping),g.layers.enableAll(),b.unshift(g,g.geometry,g.material,0,0,null))},dispose:function(){void 0!==h&&(h.geometry.dispose(),h.material.dispose(),h=void 0),void 0!==g&&(g.geometry.dispose(),g.material.dispose(),g=void 0)}}}function ij(a,b){let c=a.getParameter(a.MAX_VERTEX_ATTRIBS),d={},e=j(null),f=e,g=!1;function h(b){return a.bindVertexArray(b)}function i(b){return a.deleteVertexArray(b)}function j(a){let b=[],d=[],e=[];for(let a=0;a<c;a++)b[a]=0,d[a]=0,e[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:b,enabledAttributes:d,attributeDivisors:e,object:a,attributes:{},index:null}}function k(){let a=f.newAttributes;for(let b=0,c=a.length;b<c;b++)a[b]=0}function l(a){m(a,0)}function m(b,c){let d=f.newAttributes,e=f.enabledAttributes,g=f.attributeDivisors;d[b]=1,0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1),g[b]!==c&&(a.vertexAttribDivisor(b,c),g[b]=c)}function n(){let b=f.newAttributes,c=f.enabledAttributes;for(let d=0,e=c.length;d<e;d++)c[d]!==b[d]&&(a.disableVertexAttribArray(d),c[d]=0)}function o(b,c,d,e,f,g,h){!0===h?a.vertexAttribIPointer(b,c,d,f,g):a.vertexAttribPointer(b,c,d,e,f,g)}function p(){q(),g=!0,f!==e&&h((f=e).object)}function q(){e.geometry=null,e.program=null,e.wireframe=!1}return{setup:function(c,e,i,p,q){var r,s,t;let u,v,w,x,y,z,A=!1,B=(r=c,s=p,t=i,u=!0===e.wireframe,void 0===(v=d[s.id])&&(v={},d[s.id]=v),void 0===(x=v[w=!0===r.isInstancedMesh?r.id:0])&&(x={},v[w]=x),void 0===(y=x[t.id])&&(y={},x[t.id]=y),void 0===(z=y[u])&&(z=j(a.createVertexArray()),y[u]=z),z);f!==B&&h((f=B).object),(A=function(a,b,c,d){let e=f.attributes,g=b.attributes,h=0,i=c.getAttributes();for(let b in i)if(i[b].location>=0){let c=e[b],d=g[b];if(void 0===d&&("instanceMatrix"===b&&a.instanceMatrix&&(d=a.instanceMatrix),"instanceColor"===b&&a.instanceColor&&(d=a.instanceColor)),void 0===c||c.attribute!==d||d&&c.data!==d.data)return!0;h++}return f.attributesNum!==h||f.index!==d}(c,p,i,q))&&function(a,b,c,d){let e={},g=b.attributes,h=0,i=c.getAttributes();for(let b in i)if(i[b].location>=0){let c=g[b];void 0===c&&("instanceMatrix"===b&&a.instanceMatrix&&(c=a.instanceMatrix),"instanceColor"===b&&a.instanceColor&&(c=a.instanceColor));let d={};d.attribute=c,c&&c.data&&(d.data=c.data),e[b]=d,h++}f.attributes=e,f.attributesNum=h,f.index=d}(c,p,i,q),null!==q&&b.update(q,a.ELEMENT_ARRAY_BUFFER),(A||g)&&(g=!1,function(c,d,e,f){k();let g=f.attributes,h=e.getAttributes(),i=d.defaultAttributeValues;for(let d in h){let e=h[d];if(e.location>=0){let h=g[d];if(void 0===h&&("instanceMatrix"===d&&c.instanceMatrix&&(h=c.instanceMatrix),"instanceColor"===d&&c.instanceColor&&(h=c.instanceColor)),void 0!==h){let d=h.normalized,g=h.itemSize,i=b.get(h);if(void 0===i)continue;let j=i.buffer,k=i.type,n=i.bytesPerElement,p=k===a.INT||k===a.UNSIGNED_INT||1013===h.gpuType;if(h.isInterleavedBufferAttribute){let b=h.data,i=b.stride,q=h.offset;if(b.isInstancedInterleavedBuffer){for(let a=0;a<e.locationSize;a++)m(e.location+a,b.meshPerAttribute);!0!==c.isInstancedMesh&&void 0===f._maxInstanceCount&&(f._maxInstanceCount=b.meshPerAttribute*b.count)}else for(let a=0;a<e.locationSize;a++)l(e.location+a);a.bindBuffer(a.ARRAY_BUFFER,j);for(let a=0;a<e.locationSize;a++)o(e.location+a,g/e.locationSize,k,d,i*n,(q+g/e.locationSize*a)*n,p)}else{if(h.isInstancedBufferAttribute){for(let a=0;a<e.locationSize;a++)m(e.location+a,h.meshPerAttribute);!0!==c.isInstancedMesh&&void 0===f._maxInstanceCount&&(f._maxInstanceCount=h.meshPerAttribute*h.count)}else for(let a=0;a<e.locationSize;a++)l(e.location+a);a.bindBuffer(a.ARRAY_BUFFER,j);for(let a=0;a<e.locationSize;a++)o(e.location+a,g/e.locationSize,k,d,g*n,g/e.locationSize*a*n,p)}}else if(void 0!==i){let b=i[d];if(void 0!==b)switch(b.length){case 2:a.vertexAttrib2fv(e.location,b);break;case 3:a.vertexAttrib3fv(e.location,b);break;case 4:a.vertexAttrib4fv(e.location,b);break;default:a.vertexAttrib1fv(e.location,b)}}}}n()}(c,e,i,p),null!==q&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.get(q).buffer))},reset:p,resetDefaultState:q,dispose:function(){for(let a in p(),d){let b=d[a];for(let a in b){let c=b[a];for(let a in c){let b=c[a];for(let a in b)i(b[a].object),delete b[a];delete c[a]}}delete d[a]}},releaseStatesOfGeometry:function(a){if(void 0===d[a.id])return;let b=d[a.id];for(let a in b){let c=b[a];for(let a in c){let b=c[a];for(let a in b)i(b[a].object),delete b[a];delete c[a]}}delete d[a.id]},releaseStatesOfObject:function(a){for(let b in d){let c=d[b],e=!0===a.isInstancedMesh?a.id:0,f=c[e];if(void 0!==f){for(let a in f){let b=f[a];for(let a in b)i(b[a].object),delete b[a];delete f[a]}delete c[e],0===Object.keys(c).length&&delete d[b]}}},releaseStatesOfProgram:function(a){for(let b in d){let c=d[b];for(let b in c){let d=c[b];if(void 0===d[a.id])continue;let e=d[a.id];for(let a in e)i(e[a].object),delete e[a];delete d[a.id]}}},initAttributes:k,enableAttribute:l,disableUnusedAttributes:n}}function ik(a,b,c){let d;function e(b,e,f){0!==f&&(a.drawArraysInstanced(d,b,e,f),c.update(e,d,f))}this.setMode=function(a){d=a},this.render=function(b,e){a.drawArrays(d,b,e),c.update(e,d,1)},this.renderInstances=e,this.renderMultiDraw=function(a,e,f){if(0===f)return;b.get("WEBGL_multi_draw").multiDrawArraysWEBGL(d,a,0,e,0,f);let g=0;for(let a=0;a<f;a++)g+=e[a];c.update(g,d,1)},this.renderMultiDrawInstances=function(a,f,g,h){if(0===g)return;let i=b.get("WEBGL_multi_draw");if(null===i)for(let b=0;b<a.length;b++)e(a[b],f[b],h[b]);else{i.multiDrawArraysInstancedWEBGL(d,a,0,f,0,h,0,g);let b=0;for(let a=0;a<g;a++)b+=f[a]*h[a];c.update(b,d,1)}}}function il(a,b,c,d){let e;function f(b){if("highp"===b){if(a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision>0)return"highp";b="mediump"}return"mediump"===b&&a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let g=void 0!==c.precision?c.precision:"highp",h=f(g);return h!==g&&(U("WebGLRenderer:",g,"not supported, using",h,"instead."),g=h),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==e)return e;if(!0===b.has("EXT_texture_filter_anisotropic")){let c=b.get("EXT_texture_filter_anisotropic");e=a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else e=0;return e},getMaxPrecision:f,textureFormatReadable:function(b){return 1023===b||d.convert(b)===a.getParameter(a.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(c){let e=1016===c&&(b.has("EXT_color_buffer_half_float")||b.has("EXT_color_buffer_float"));return 1009===c||d.convert(c)===a.getParameter(a.IMPLEMENTATION_COLOR_READ_TYPE)||1015===c||!!e},precision:g,logarithmicDepthBuffer:!0===c.logarithmicDepthBuffer,reversedDepthBuffer:!0===c.reversedDepthBuffer&&b.has("EXT_clip_control"),maxTextures:a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:a.getParameter(a.MAX_TEXTURE_SIZE),maxCubemapSize:a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:a.getParameter(a.MAX_VERTEX_ATTRIBS),maxVertexUniforms:a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:a.getParameter(a.MAX_VARYING_VECTORS),maxFragmentUniforms:a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:a.getParameter(a.MAX_SAMPLES),samples:a.getParameter(a.SAMPLES)}}function im(a){let b=this,c=null,d=0,e=!1,f=!1,g=new dn,h=new ao,i={value:null,needsUpdate:!1};function j(a,c,d,e){let f=null!==a?a.length:0,j=null;if(0!==f){if(j=i.value,!0!==e||null===j){let b=d+4*f,e=c.matrixWorldInverse;h.getNormalMatrix(e),(null===j||j.length<b)&&(j=new Float32Array(b));for(let b=0,c=d;b!==f;++b,c+=4)g.copy(a[b]).applyMatrix4(e,h),g.normal.toArray(j,c),j[c+3]=g.constant}i.value=j,i.needsUpdate=!0}return b.numPlanes=f,b.numIntersection=0,j}this.uniform=i,this.numPlanes=0,this.numIntersection=0,this.init=function(a,b){let c=0!==a.length||b||0!==d||e;return e=b,d=a.length,c},this.beginShadows=function(){f=!0,j(null)},this.endShadows=function(){f=!1},this.setGlobalState=function(a,b){c=j(a,b,0)},this.setState=function(g,h,k){let l=g.clippingPlanes,m=g.clipIntersection,n=g.clipShadows,o=a.get(g);if(e&&null!==l&&0!==l.length&&(!f||n)){let a=f?0:d,b=4*a,e=o.clippingState||null;i.value=e,e=j(l,h,b,k);for(let a=0;a!==b;++a)e[a]=c[a];o.clippingState=e,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=a}else f?j(null):(i.value!==c&&(i.value=c,i.needsUpdate=d>0),b.numPlanes=d,b.numIntersection=0)}}let io=[.125,.215,.35,.446,.526,.582],ip=new gt,iq=new bg,ir=null,is=0,it=0,iu=!1,iv=new al;class iw{constructor(a){this._renderer=a,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(a,b=0,c=.1,d=100,e={}){let{size:f=256,position:g=iv}=e;ir=this._renderer.getRenderTarget(),is=this._renderer.getActiveCubeFace(),it=this._renderer.getActiveMipmapLevel(),iu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(f);let h=this._allocateTargets();return h.depthBuffer=!0,this._sceneToCubeUV(a,c,d,h,g),b>0&&this._blur(h,0,0,b),this._applyPMREM(h),this._cleanup(h),h}fromEquirectangular(a,b=null){return this._fromTexture(a,b)}fromCubemap(a,b=null){return this._fromTexture(a,b)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=iA(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=iz(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(a){this._lodMax=Math.floor(Math.log2(a)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._ggxMaterial&&this._ggxMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let a=0;a<this._lodMeshes.length;a++)this._lodMeshes[a].geometry.dispose()}_cleanup(a){this._renderer.setRenderTarget(ir,is,it),this._renderer.xr.enabled=iu,a.scissorTest=!1,iy(a,0,0,a.width,a.height)}_fromTexture(a,b){301===a.mapping||302===a.mapping?this._setSize(0===a.image.length?16:a.image[0].width||a.image[0].image.width):this._setSize(a.image.width/4),ir=this._renderer.getRenderTarget(),is=this._renderer.getActiveCubeFace(),it=this._renderer.getActiveMipmapLevel(),iu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let c=b||this._allocateTargets();return this._textureToCubeUV(a,c),this._applyPMREM(c),this._cleanup(c),c}_allocateTargets(){let a=3*Math.max(this._cubeSize,112),b=4*this._cubeSize,c={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:B,depthBuffer:!1},d=ix(a,b,c);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==a||this._pingPongRenderTarget.height!==b){var e,f;null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ix(a,b,c);let{_lodMax:d}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=function(a){let b=[],c=[],d=[],e=a,f=a-4+1+io.length;for(let g=0;g<f;g++){let f=Math.pow(2,e);b.push(f);let h=1/f;g>a-4?h=io[g-a+4-1]:0===g&&(h=0),c.push(h);let i=1/(f-2),j=-i,k=1+i,l=[j,j,k,j,k,k,j,j,k,k,j,k],m=new Float32Array(108),n=new Float32Array(72),o=new Float32Array(36);for(let a=0;a<6;a++){let b=a%3*2/3-1,c=a>2?0:-1,d=[b,c,0,b+2/3,c,0,b+2/3,c+1,0,b,c,0,b+2/3,c+1,0,b,c+1,0];m.set(d,18*a),n.set(l,12*a);let e=[a,a,a,a,a,a];o.set(e,6*a)}let p=new ce;p.setAttribute("position",new bV(m,3)),p.setAttribute("uv",new bV(n,2)),p.setAttribute("faceIndex",new bV(o,1)),d.push(new cW(p,null)),e>4&&e--}return{lodMeshes:d,sizeLods:b,sigmas:c}}(d)),this._blurMaterial=(e=d,new ft({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/a,CUBEUV_TEXEL_HEIGHT:1/b,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new al(0,1,0)}},vertexShader:iB(),fragmentShader:`
|
|
2
|
+
|
|
3
|
+
precision mediump float;
|
|
4
|
+
precision mediump int;
|
|
5
|
+
|
|
6
|
+
varying vec3 vOutputDirection;
|
|
7
|
+
|
|
8
|
+
uniform sampler2D envMap;
|
|
9
|
+
uniform int samples;
|
|
10
|
+
uniform float weights[ n ];
|
|
11
|
+
uniform bool latitudinal;
|
|
12
|
+
uniform float dTheta;
|
|
13
|
+
uniform float mipInt;
|
|
14
|
+
uniform vec3 poleAxis;
|
|
15
|
+
|
|
16
|
+
#define ENVMAP_TYPE_CUBE_UV
|
|
17
|
+
#include <cube_uv_reflection_fragment>
|
|
18
|
+
|
|
19
|
+
vec3 getSample( float theta, vec3 axis ) {
|
|
20
|
+
|
|
21
|
+
float cosTheta = cos( theta );
|
|
22
|
+
// Rodrigues' axis-angle rotation
|
|
23
|
+
vec3 sampleDirection = vOutputDirection * cosTheta
|
|
24
|
+
+ cross( axis, vOutputDirection ) * sin( theta )
|
|
25
|
+
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
|
|
26
|
+
|
|
27
|
+
return bilinearCubeUV( envMap, sampleDirection, mipInt );
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void main() {
|
|
32
|
+
|
|
33
|
+
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
|
|
34
|
+
|
|
35
|
+
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
|
|
36
|
+
|
|
37
|
+
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
axis = normalize( axis );
|
|
42
|
+
|
|
43
|
+
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
44
|
+
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
|
|
45
|
+
|
|
46
|
+
for ( int i = 1; i < n; i++ ) {
|
|
47
|
+
|
|
48
|
+
if ( i >= samples ) {
|
|
49
|
+
|
|
50
|
+
break;
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
float theta = dTheta * float( i );
|
|
55
|
+
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
|
|
56
|
+
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
`,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(f=d,new ft({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/a,CUBEUV_TEXEL_HEIGHT:1/b,CUBEUV_MAX_MIP:`${f}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:iB(),fragmentShader:`
|
|
62
|
+
|
|
63
|
+
precision highp float;
|
|
64
|
+
precision highp int;
|
|
65
|
+
|
|
66
|
+
varying vec3 vOutputDirection;
|
|
67
|
+
|
|
68
|
+
uniform sampler2D envMap;
|
|
69
|
+
uniform float roughness;
|
|
70
|
+
uniform float mipInt;
|
|
71
|
+
|
|
72
|
+
#define ENVMAP_TYPE_CUBE_UV
|
|
73
|
+
#include <cube_uv_reflection_fragment>
|
|
74
|
+
|
|
75
|
+
#define PI 3.14159265359
|
|
76
|
+
|
|
77
|
+
// Van der Corput radical inverse
|
|
78
|
+
float radicalInverse_VdC(uint bits) {
|
|
79
|
+
bits = (bits << 16u) | (bits >> 16u);
|
|
80
|
+
bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
|
|
81
|
+
bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
|
|
82
|
+
bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
|
|
83
|
+
bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
|
|
84
|
+
return float(bits) * 2.3283064365386963e-10; // / 0x100000000
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Hammersley sequence
|
|
88
|
+
vec2 hammersley(uint i, uint N) {
|
|
89
|
+
return vec2(float(i) / float(N), radicalInverse_VdC(i));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// GGX VNDF importance sampling (Eric Heitz 2018)
|
|
93
|
+
// "Sampling the GGX Distribution of Visible Normals"
|
|
94
|
+
// https://jcgt.org/published/0007/04/01/
|
|
95
|
+
vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
|
|
96
|
+
float alpha = roughness * roughness;
|
|
97
|
+
|
|
98
|
+
// Section 4.1: Orthonormal basis
|
|
99
|
+
vec3 T1 = vec3(1.0, 0.0, 0.0);
|
|
100
|
+
vec3 T2 = cross(V, T1);
|
|
101
|
+
|
|
102
|
+
// Section 4.2: Parameterization of projected area
|
|
103
|
+
float r = sqrt(Xi.x);
|
|
104
|
+
float phi = 2.0 * PI * Xi.y;
|
|
105
|
+
float t1 = r * cos(phi);
|
|
106
|
+
float t2 = r * sin(phi);
|
|
107
|
+
float s = 0.5 * (1.0 + V.z);
|
|
108
|
+
t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
|
|
109
|
+
|
|
110
|
+
// Section 4.3: Reprojection onto hemisphere
|
|
111
|
+
vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
|
|
112
|
+
|
|
113
|
+
// Section 3.4: Transform back to ellipsoid configuration
|
|
114
|
+
return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
void main() {
|
|
118
|
+
vec3 N = normalize(vOutputDirection);
|
|
119
|
+
vec3 V = N; // Assume view direction equals normal for pre-filtering
|
|
120
|
+
|
|
121
|
+
vec3 prefilteredColor = vec3(0.0);
|
|
122
|
+
float totalWeight = 0.0;
|
|
123
|
+
|
|
124
|
+
// For very low roughness, just sample the environment directly
|
|
125
|
+
if (roughness < 0.001) {
|
|
126
|
+
gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Tangent space basis for VNDF sampling
|
|
131
|
+
vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
132
|
+
vec3 tangent = normalize(cross(up, N));
|
|
133
|
+
vec3 bitangent = cross(N, tangent);
|
|
134
|
+
|
|
135
|
+
for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
|
|
136
|
+
vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
|
|
137
|
+
|
|
138
|
+
// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
|
|
139
|
+
vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
|
|
140
|
+
|
|
141
|
+
// Transform H back to world space
|
|
142
|
+
vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
|
|
143
|
+
vec3 L = normalize(2.0 * dot(V, H) * H - V);
|
|
144
|
+
|
|
145
|
+
float NdotL = max(dot(N, L), 0.0);
|
|
146
|
+
|
|
147
|
+
if(NdotL > 0.0) {
|
|
148
|
+
// Sample environment at fixed mip level
|
|
149
|
+
// VNDF importance sampling handles the distribution filtering
|
|
150
|
+
vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
|
|
151
|
+
|
|
152
|
+
// Weight by NdotL for the split-sum approximation
|
|
153
|
+
// VNDF PDF naturally accounts for the visible microfacet distribution
|
|
154
|
+
prefilteredColor += sampleColor * NdotL;
|
|
155
|
+
totalWeight += NdotL;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (totalWeight > 0.0) {
|
|
160
|
+
prefilteredColor = prefilteredColor / totalWeight;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
gl_FragColor = vec4(prefilteredColor, 1.0);
|
|
164
|
+
}
|
|
165
|
+
`,blending:0,depthTest:!1,depthWrite:!1}))}return d}_compileMaterial(a){let b=new cW(new ce,a);this._renderer.compile(b,ip)}_sceneToCubeUV(a,b,c,d,e){let f=new go(90,1,b,c),g=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],i=this._renderer,j=i.autoClear,k=i.toneMapping;i.getClearColor(iq),i.toneMapping=0,i.autoClear=!1,i.state.buffers.depth.getReversed()&&(i.setRenderTarget(d),i.clearDepth(),i.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new cW(new eh,new cK({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1})));let l=this._backgroundBox,m=l.material,n=!1,o=a.background;o?o.isColor&&(m.color.copy(o),a.background=null,n=!0):(m.color.copy(iq),n=!0);for(let b=0;b<6;b++){let c=b%3;0===c?(f.up.set(0,g[b],0),f.position.set(e.x,e.y,e.z),f.lookAt(e.x+h[b],e.y,e.z)):1===c?(f.up.set(0,0,g[b]),f.position.set(e.x,e.y,e.z),f.lookAt(e.x,e.y+h[b],e.z)):(f.up.set(0,g[b],0),f.position.set(e.x,e.y,e.z),f.lookAt(e.x,e.y,e.z+h[b]));let j=this._cubeSize;iy(d,c*j,b>2?j:0,j,j),i.setRenderTarget(d),n&&i.render(l,f),i.render(a,f)}i.toneMapping=k,i.autoClear=j,a.background=o}_textureToCubeUV(a,b){let c=this._renderer,d=301===a.mapping||302===a.mapping;d?(null===this._cubemapMaterial&&(this._cubemapMaterial=iA()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===a.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=iz());let e=d?this._cubemapMaterial:this._equirectMaterial,f=this._lodMeshes[0];f.material=e,e.uniforms.envMap.value=a;let g=this._cubeSize;iy(b,0,0,3*g,2*g),c.setRenderTarget(b),c.render(f,ip)}_applyPMREM(a){let b=this._renderer,c=b.autoClear;b.autoClear=!1;let d=this._lodMeshes.length;for(let b=1;b<d;b++)this._applyGGXFilter(a,b-1,b);b.autoClear=c}_applyGGXFilter(a,b,c){let d=this._renderer,e=this._pingPongRenderTarget,f=this._ggxMaterial,g=this._lodMeshes[c];g.material=f;let h=f.uniforms,i=c/(this._lodMeshes.length-1),j=b/(this._lodMeshes.length-1),k=Math.sqrt(i*i-j*j),{_lodMax:l}=this,m=this._sizeLods[c],n=3*m*(c>l-4?c-l+4:0),o=4*(this._cubeSize-m);h.envMap.value=a.texture,h.roughness.value=k*(0+1.25*i),h.mipInt.value=l-b,iy(e,n,o,3*m,2*m),d.setRenderTarget(e),d.render(g,ip),h.envMap.value=e.texture,h.roughness.value=0,h.mipInt.value=l-c,iy(a,n,o,3*m,2*m),d.setRenderTarget(a),d.render(g,ip)}_blur(a,b,c,d,e){let f=this._pingPongRenderTarget;this._halfBlur(a,f,b,c,d,"latitudinal",e),this._halfBlur(f,a,c,c,d,"longitudinal",e)}_halfBlur(a,b,c,d,e,f,g){let h=this._renderer,i=this._blurMaterial;"latitudinal"!==f&&"longitudinal"!==f&&V("blur direction must be either latitudinal or longitudinal!");let j=this._lodMeshes[d];j.material=i;let k=i.uniforms,l=this._sizeLods[c]-1,m=isFinite(e)?Math.PI/(2*l):2*Math.PI/39,n=e/m,o=isFinite(e)?1+Math.floor(3*n):20;o>20&&U(`sigmaRadians, ${e}, is too large and will clip, as it requested ${o} samples when the maximum is set to 20`);let p=[],q=0;for(let a=0;a<20;++a){let b=a/n,c=Math.exp(-b*b/2);p.push(c),0===a?q+=c:a<o&&(q+=2*c)}for(let a=0;a<p.length;a++)p[a]=p[a]/q;k.envMap.value=a.texture,k.samples.value=o,k.weights.value=p,k.latitudinal.value="latitudinal"===f,g&&(k.poleAxis.value=g);let{_lodMax:r}=this;k.dTheta.value=m,k.mipInt.value=r-c;let s=this._sizeLods[d],t=4*(this._cubeSize-s);iy(b,3*s*(d>r-4?d-r+4:0),t,3*s,2*s),h.setRenderTarget(b),h.render(j,ip)}}function ix(a,b,c){let d=new aE(a,b,c);return d.texture.mapping=306,d.texture.name="PMREM.cubeUv",d.scissorTest=!0,d}function iy(a,b,c,d,e){a.viewport.set(b,c,d,e),a.scissor.set(b,c,d,e)}function iz(){return new ft({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:iB(),fragmentShader:`
|
|
166
|
+
|
|
167
|
+
precision mediump float;
|
|
168
|
+
precision mediump int;
|
|
169
|
+
|
|
170
|
+
varying vec3 vOutputDirection;
|
|
171
|
+
|
|
172
|
+
uniform sampler2D envMap;
|
|
173
|
+
|
|
174
|
+
#include <common>
|
|
175
|
+
|
|
176
|
+
void main() {
|
|
177
|
+
|
|
178
|
+
vec3 outputDirection = normalize( vOutputDirection );
|
|
179
|
+
vec2 uv = equirectUv( outputDirection );
|
|
180
|
+
|
|
181
|
+
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
|
182
|
+
|
|
183
|
+
}
|
|
184
|
+
`,blending:0,depthTest:!1,depthWrite:!1})}function iA(){return new ft({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:iB(),fragmentShader:`
|
|
185
|
+
|
|
186
|
+
precision mediump float;
|
|
187
|
+
precision mediump int;
|
|
188
|
+
|
|
189
|
+
uniform float flipEnvMap;
|
|
190
|
+
|
|
191
|
+
varying vec3 vOutputDirection;
|
|
192
|
+
|
|
193
|
+
uniform samplerCube envMap;
|
|
194
|
+
|
|
195
|
+
void main() {
|
|
196
|
+
|
|
197
|
+
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
|
198
|
+
|
|
199
|
+
}
|
|
200
|
+
`,blending:0,depthTest:!1,depthWrite:!1})}function iB(){return`
|
|
201
|
+
|
|
202
|
+
precision mediump float;
|
|
203
|
+
precision mediump int;
|
|
204
|
+
|
|
205
|
+
attribute float faceIndex;
|
|
206
|
+
|
|
207
|
+
varying vec3 vOutputDirection;
|
|
208
|
+
|
|
209
|
+
// RH coordinate system; PMREM face-indexing convention
|
|
210
|
+
vec3 getDirection( vec2 uv, float face ) {
|
|
211
|
+
|
|
212
|
+
uv = 2.0 * uv - 1.0;
|
|
213
|
+
|
|
214
|
+
vec3 direction = vec3( uv, 1.0 );
|
|
215
|
+
|
|
216
|
+
if ( face == 0.0 ) {
|
|
217
|
+
|
|
218
|
+
direction = direction.zyx; // ( 1, v, u ) pos x
|
|
219
|
+
|
|
220
|
+
} else if ( face == 1.0 ) {
|
|
221
|
+
|
|
222
|
+
direction = direction.xzy;
|
|
223
|
+
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
|
224
|
+
|
|
225
|
+
} else if ( face == 2.0 ) {
|
|
226
|
+
|
|
227
|
+
direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
|
228
|
+
|
|
229
|
+
} else if ( face == 3.0 ) {
|
|
230
|
+
|
|
231
|
+
direction = direction.zyx;
|
|
232
|
+
direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
|
233
|
+
|
|
234
|
+
} else if ( face == 4.0 ) {
|
|
235
|
+
|
|
236
|
+
direction = direction.xzy;
|
|
237
|
+
direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
|
238
|
+
|
|
239
|
+
} else if ( face == 5.0 ) {
|
|
240
|
+
|
|
241
|
+
direction.z *= -1.0; // ( u, v, -1 ) neg z
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return direction;
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
void main() {
|
|
250
|
+
|
|
251
|
+
vOutputDirection = getDirection( uv, faceIndex );
|
|
252
|
+
gl_Position = vec4( position, 1.0 );
|
|
253
|
+
|
|
254
|
+
}
|
|
255
|
+
`}class iC extends aE{constructor(a=1,b={}){super(a,a,b),this.isWebGLCubeRenderTarget=!0;const c={width:a,height:a,depth:1};this.texture=new ec([c,c,c,c,c,c]),this._setTextureOptions(b),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(a,b){this.texture.type=b.type,this.texture.colorSpace=b.colorSpace,this.texture.generateMipmaps=b.generateMipmaps,this.texture.minFilter=b.minFilter,this.texture.magFilter=b.magFilter;let c={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
256
|
+
|
|
257
|
+
varying vec3 vWorldDirection;
|
|
258
|
+
|
|
259
|
+
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
260
|
+
|
|
261
|
+
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
262
|
+
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
void main() {
|
|
266
|
+
|
|
267
|
+
vWorldDirection = transformDirection( position, modelMatrix );
|
|
268
|
+
|
|
269
|
+
#include <begin_vertex>
|
|
270
|
+
#include <project_vertex>
|
|
271
|
+
|
|
272
|
+
}
|
|
273
|
+
`,fragmentShader:`
|
|
274
|
+
|
|
275
|
+
uniform sampler2D tEquirect;
|
|
276
|
+
|
|
277
|
+
varying vec3 vWorldDirection;
|
|
278
|
+
|
|
279
|
+
#include <common>
|
|
280
|
+
|
|
281
|
+
void main() {
|
|
282
|
+
|
|
283
|
+
vec3 direction = normalize( vWorldDirection );
|
|
284
|
+
|
|
285
|
+
vec2 sampleUV = equirectUv( direction );
|
|
286
|
+
|
|
287
|
+
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
288
|
+
|
|
289
|
+
}
|
|
290
|
+
`},d=new eh(5,5,5),e=new ft({name:"CubemapFromEquirect",uniforms:fp(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,side:1,blending:0});e.uniforms.tEquirect.value=b;let f=new cW(d,e),g=b.minFilter;return 1008===b.minFilter&&(b.minFilter=1006),new gQ(1,10,this).update(a,f),b.minFilter=g,f.geometry.dispose(),f.material.dispose(),this}clear(a,b=!0,c=!0,d=!0){let e=a.getRenderTarget();for(let e=0;e<6;e++)a.setRenderTarget(this,e),a.clear(b,c,d);a.setRenderTarget(e)}}function iD(a){let b=new WeakMap,c=new WeakMap,d=null;function e(a,b){return 303===b?a.mapping=301:304===b&&(a.mapping=302),a}function f(a){let c=a.target;c.removeEventListener("dispose",f);let d=b.get(c);void 0!==d&&(b.delete(c),d.dispose())}function g(a){let b=a.target;b.removeEventListener("dispose",g);let d=c.get(b);void 0!==d&&(c.delete(b),d.dispose())}return{get:function(h,i=!1){return null==h?null:i?function(b){if(b&&b.isTexture){let e=b.mapping,f=303===e||304===e,h=301===e||302===e;if(f||h){let e=c.get(b),i=void 0!==e?e.texture.pmremVersion:0;if(b.isRenderTargetTexture&&b.pmremVersion!==i)return null===d&&(d=new iw(a)),(e=f?d.fromEquirectangular(b,e):d.fromCubemap(b,e)).texture.pmremVersion=b.pmremVersion,c.set(b,e),e.texture;{if(void 0!==e)return e.texture;let i=b.image;return f&&i&&i.height>0||h&&i&&function(a){let b=0;for(let c=0;c<6;c++)void 0!==a[c]&&b++;return 6===b}(i)?(null===d&&(d=new iw(a)),(e=f?d.fromEquirectangular(b):d.fromCubemap(b)).texture.pmremVersion=b.pmremVersion,c.set(b,e),b.addEventListener("dispose",g),e.texture):null}}}return b}(h):function(c){if(c&&c.isTexture){let d=c.mapping;if(303===d||304===d)if(b.has(c))return e(b.get(c).texture,c.mapping);else{let d=c.image;if(!d||!(d.height>0))return null;{let g=new iC(d.height);return g.fromEquirectangularTexture(a,c),b.set(c,g),c.addEventListener("dispose",f),e(g.texture,c.mapping)}}}return c}(h)},dispose:function(){b=new WeakMap,c=new WeakMap,null!==d&&(d.dispose(),d=null)}}}function iE(a){let b={};function c(c){if(void 0!==b[c])return b[c];let d=a.getExtension(c);return b[c]=d,d}return{has:function(a){return null!==c(a)},init:function(){c("EXT_color_buffer_float"),c("WEBGL_clip_cull_distance"),c("OES_texture_float_linear"),c("EXT_color_buffer_half_float"),c("WEBGL_multisampled_render_to_texture"),c("WEBGL_render_shared_exponent")},get:function(a){let b=c(a);return null===b&&W("WebGLRenderer: "+a+" extension not supported."),b}}}function iF(a,b,c,d){let e={},f=new WeakMap;function g(a){let h=a.target;for(let a in null!==h.index&&b.remove(h.index),h.attributes)b.remove(h.attributes[a]);h.removeEventListener("dispose",g),delete e[h.id];let i=f.get(h);i&&(b.remove(i),f.delete(h)),d.releaseStatesOfGeometry(h),!0===h.isInstancedBufferGeometry&&delete h._maxInstanceCount,c.memory.geometries--}function h(a){let c=[],d=a.index,e=a.attributes.position,g=0;if(void 0===e)return;if(null!==d){let a=d.array;g=d.version;for(let b=0,d=a.length;b<d;b+=3){let d=a[b+0],e=a[b+1],f=a[b+2];c.push(d,e,e,f,f,d)}}else{let a=e.array;g=e.version;for(let b=0,d=a.length/3-1;b<d;b+=3){let a=b+0,d=b+1,e=b+2;c.push(a,d,d,e,e,a)}}let h=new(e.count>=65535?b0:b$)(c,1);h.version=g;let i=f.get(a);i&&b.remove(i),f.set(a,h)}return{get:function(a,b){return!0===e[b.id]||(b.addEventListener("dispose",g),e[b.id]=!0,c.memory.geometries++),b},update:function(c){let d=c.attributes;for(let c in d)b.update(d[c],a.ARRAY_BUFFER)},getWireframeAttribute:function(a){let b=f.get(a);if(b){let c=a.index;null!==c&&b.version<c.version&&h(a)}else h(a);return f.get(a)}}}function iG(a,b,c){let d,e,f;function g(b,g,h){0!==h&&(a.drawElementsInstanced(d,g,e,b*f,h),c.update(g,d,h))}this.setMode=function(a){d=a},this.setIndex=function(a){e=a.type,f=a.bytesPerElement},this.render=function(b,g){a.drawElements(d,g,e,b*f),c.update(g,d,1)},this.renderInstances=g,this.renderMultiDraw=function(a,f,g){if(0===g)return;b.get("WEBGL_multi_draw").multiDrawElementsWEBGL(d,f,0,e,a,0,g);let h=0;for(let a=0;a<g;a++)h+=f[a];c.update(h,d,1)},this.renderMultiDrawInstances=function(a,h,i,j){if(0===i)return;let k=b.get("WEBGL_multi_draw");if(null===k)for(let b=0;b<a.length;b++)g(a[b]/f,h[b],j[b]);else{k.multiDrawElementsInstancedWEBGL(d,h,0,e,a,0,j,0,i);let b=0;for(let a=0;a<i;a++)b+=h[a]*j[a];c.update(b,d,1)}}}function iH(a){let b={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.calls=0,b.triangles=0,b.points=0,b.lines=0},update:function(c,d,e){switch(b.calls++,d){case a.TRIANGLES:b.triangles+=c/3*e;break;case a.LINES:b.lines+=c/2*e;break;case a.LINE_STRIP:b.lines+=e*(c-1);break;case a.LINE_LOOP:b.lines+=e*c;break;case a.POINTS:b.points+=e*c;break;default:V("WebGLInfo: Unknown draw mode:",d)}}}}function iI(a,b,c){let d=new WeakMap,e=new aC;return{update:function(f,g,h){let i=f.morphTargetInfluences,j=g.morphAttributes.position||g.morphAttributes.normal||g.morphAttributes.color,k=void 0!==j?j.length:0,l=d.get(g);if(void 0===l||l.count!==k){void 0!==l&&l.texture.dispose();let a=void 0!==g.morphAttributes.position,c=void 0!==g.morphAttributes.normal,f=void 0!==g.morphAttributes.color,h=g.morphAttributes.position||[],i=g.morphAttributes.normal||[],j=g.morphAttributes.color||[],m=0;!0===a&&(m=1),!0===c&&(m=2),!0===f&&(m=3);let n=g.attributes.position.count*m,o=1;n>b.maxTextureSize&&(o=Math.ceil(n/b.maxTextureSize),n=b.maxTextureSize);let p=new Float32Array(n*o*4*k),q=new aF(p,n,o,k);q.type=1015,q.needsUpdate=!0;let r=4*m;for(let b=0;b<k;b++){let d=h[b],g=i[b],k=j[b],l=n*o*4*b;for(let b=0;b<d.count;b++){let h=b*r;!0===a&&(e.fromBufferAttribute(d,b),p[l+h+0]=e.x,p[l+h+1]=e.y,p[l+h+2]=e.z,p[l+h+3]=0),!0===c&&(e.fromBufferAttribute(g,b),p[l+h+4]=e.x,p[l+h+5]=e.y,p[l+h+6]=e.z,p[l+h+7]=0),!0===f&&(e.fromBufferAttribute(k,b),p[l+h+8]=e.x,p[l+h+9]=e.y,p[l+h+10]=e.z,p[l+h+11]=4===k.itemSize?e.w:1)}}l={count:k,texture:q,size:new aj(n,o)},d.set(g,l),g.addEventListener("dispose",function a(){q.dispose(),d.delete(g),g.removeEventListener("dispose",a)})}if(!0===f.isInstancedMesh&&null!==f.morphTexture)h.getUniforms().setValue(a,"morphTexture",f.morphTexture,c);else{let b=0;for(let a=0;a<i.length;a++)b+=i[a];let c=g.morphTargetsRelative?1:1-b;h.getUniforms().setValue(a,"morphTargetBaseInfluence",c),h.getUniforms().setValue(a,"morphTargetInfluences",i)}h.getUniforms().setValue(a,"morphTargetsTexture",l.texture,c),h.getUniforms().setValue(a,"morphTargetsTextureSize",l.size)}}}function iJ(a,b,c,d,e){let f=new WeakMap;function g(a){let b=a.target;b.removeEventListener("dispose",g),d.releaseStatesOfObject(b),c.remove(b.instanceMatrix),null!==b.instanceColor&&c.remove(b.instanceColor)}return{update:function(d){let h=e.render.frame,i=d.geometry,j=b.get(d,i);if(f.get(j)!==h&&(b.update(j),f.set(j,h)),d.isInstancedMesh&&(!1===d.hasEventListener("dispose",g)&&d.addEventListener("dispose",g),f.get(d)!==h&&(c.update(d.instanceMatrix,a.ARRAY_BUFFER),null!==d.instanceColor&&c.update(d.instanceColor,a.ARRAY_BUFFER),f.set(d,h))),d.isSkinnedMesh){let a=d.skeleton;f.get(a)!==h&&(a.update(),f.set(a,h))}return j},dispose:function(){f=new WeakMap}}}let iK={1:"LINEAR_TONE_MAPPING",2:"REINHARD_TONE_MAPPING",3:"CINEON_TONE_MAPPING",4:"ACES_FILMIC_TONE_MAPPING",6:"AGX_TONE_MAPPING",7:"NEUTRAL_TONE_MAPPING",5:"CUSTOM_TONE_MAPPING"};function iL(a,b,c,d,e){let f,g=new aE(b,c,{type:a,depthBuffer:d,stencilBuffer:e}),h=new aE(b,c,{type:1016,depthBuffer:!1,stencilBuffer:!1}),i=new ce;i.setAttribute("position",new b2([-1,3,0,-1,-1,0,3,-1,0],3)),i.setAttribute("uv",new b2([0,2,0,0,2,0],2));let j=new fu({uniforms:{tDiffuse:{value:null}},vertexShader:`
|
|
291
|
+
precision highp float;
|
|
292
|
+
|
|
293
|
+
uniform mat4 modelViewMatrix;
|
|
294
|
+
uniform mat4 projectionMatrix;
|
|
295
|
+
|
|
296
|
+
attribute vec3 position;
|
|
297
|
+
attribute vec2 uv;
|
|
298
|
+
|
|
299
|
+
varying vec2 vUv;
|
|
300
|
+
|
|
301
|
+
void main() {
|
|
302
|
+
vUv = uv;
|
|
303
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
304
|
+
}`,fragmentShader:`
|
|
305
|
+
precision highp float;
|
|
306
|
+
|
|
307
|
+
uniform sampler2D tDiffuse;
|
|
308
|
+
|
|
309
|
+
varying vec2 vUv;
|
|
310
|
+
|
|
311
|
+
#include <tonemapping_pars_fragment>
|
|
312
|
+
#include <colorspace_pars_fragment>
|
|
313
|
+
|
|
314
|
+
void main() {
|
|
315
|
+
gl_FragColor = texture2D( tDiffuse, vUv );
|
|
316
|
+
|
|
317
|
+
#ifdef LINEAR_TONE_MAPPING
|
|
318
|
+
gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
|
|
319
|
+
#elif defined( REINHARD_TONE_MAPPING )
|
|
320
|
+
gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
|
|
321
|
+
#elif defined( CINEON_TONE_MAPPING )
|
|
322
|
+
gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
|
|
323
|
+
#elif defined( ACES_FILMIC_TONE_MAPPING )
|
|
324
|
+
gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
|
|
325
|
+
#elif defined( AGX_TONE_MAPPING )
|
|
326
|
+
gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
|
|
327
|
+
#elif defined( NEUTRAL_TONE_MAPPING )
|
|
328
|
+
gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
|
|
329
|
+
#elif defined( CUSTOM_TONE_MAPPING )
|
|
330
|
+
gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
|
|
331
|
+
#endif
|
|
332
|
+
|
|
333
|
+
#ifdef SRGB_TRANSFER
|
|
334
|
+
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
|
335
|
+
#endif
|
|
336
|
+
}`,depthTest:!1,depthWrite:!1}),k=new cW(i,j),l=new gt(-1,1,1,-1,0,1),m=null,n=null,o=!1,p=null,q=[],r=!1;this.setSize=function(a,b){g.setSize(a,b),h.setSize(a,b);for(let c=0;c<q.length;c++){let d=q[c];d.setSize&&d.setSize(a,b)}},this.setEffects=function(a){r=(q=a).length>0&&!0===q[0].isRenderPass;let b=g.width,c=g.height;for(let a=0;a<q.length;a++){let d=q[a];d.setSize&&d.setSize(b,c)}},this.begin=function(a,b){if(o||0===a.toneMapping&&0===q.length)return!1;if(p=b,null!==b){let a=b.width,c=b.height;(g.width!==a||g.height!==c)&&this.setSize(a,c)}return!1===r&&a.setRenderTarget(g),f=a.toneMapping,a.toneMapping=0,!0},this.hasRenderPass=function(){return r},this.end=function(a,b){a.toneMapping=f,o=!0;let c=g,d=h;for(let e=0;e<q.length;e++){let f=q[e];if(!1!==f.enabled&&(f.render(a,d,c,b),!1!==f.needsSwap)){let a=c;c=d,d=a}}if(m!==a.outputColorSpace||n!==a.toneMapping){m=a.outputColorSpace,n=a.toneMapping,j.defines={},as.getTransfer(m)===D&&(j.defines.SRGB_TRANSFER="");let b=iK[n];b&&(j.defines[b]=""),j.needsUpdate=!0}j.uniforms.tDiffuse.value=c.texture,a.setRenderTarget(p),a.render(k,l),p=null,o=!1},this.isCompositing=function(){return o},this.dispose=function(){g.dispose(),h.dispose(),i.dispose(),j.dispose()}}let iM=new aB,iN=new ee(1,1),iO=new aF,iP=new aH,iQ=new ec,iR=[],iS=[],iT=new Float32Array(16),iU=new Float32Array(9),iV=new Float32Array(4);function iW(a,b,c){let d=a[0];if(d<=0||d>0)return a;let e=b*c,f=iR[e];if(void 0===f&&(f=new Float32Array(e),iR[e]=f),0!==b){d.toArray(f,0);for(let d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e)}return f}function iX(a,b){if(a.length!==b.length)return!1;for(let c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function iY(a,b){for(let c=0,d=b.length;c<d;c++)a[c]=b[c]}function iZ(a,b){let c=iS[b];void 0===c&&(c=new Int32Array(b),iS[b]=c);for(let d=0;d!==b;++d)c[d]=a.allocateTextureUnit();return c}function i$(a,b){let c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function i_(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y)&&(a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y);else{if(iX(c,b))return;a.uniform2fv(this.addr,b),iY(c,b)}}function i0(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)&&(a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z);else if(void 0!==b.r)(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)&&(a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b);else{if(iX(c,b))return;a.uniform3fv(this.addr,b),iY(c,b)}}function i1(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)&&(a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w);else{if(iX(c,b))return;a.uniform4fv(this.addr,b),iY(c,b)}}function i2(a,b){let c=this.cache,d=b.elements;if(void 0===d){if(iX(c,b))return;a.uniformMatrix2fv(this.addr,!1,b),iY(c,b)}else{if(iX(c,d))return;iV.set(d),a.uniformMatrix2fv(this.addr,!1,iV),iY(c,d)}}function i3(a,b){let c=this.cache,d=b.elements;if(void 0===d){if(iX(c,b))return;a.uniformMatrix3fv(this.addr,!1,b),iY(c,b)}else{if(iX(c,d))return;iU.set(d),a.uniformMatrix3fv(this.addr,!1,iU),iY(c,d)}}function i4(a,b){let c=this.cache,d=b.elements;if(void 0===d){if(iX(c,b))return;a.uniformMatrix4fv(this.addr,!1,b),iY(c,b)}else{if(iX(c,d))return;iT.set(d),a.uniformMatrix4fv(this.addr,!1,iT),iY(c,d)}}function i5(a,b){let c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function i6(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y)&&(a.uniform2i(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y);else{if(iX(c,b))return;a.uniform2iv(this.addr,b),iY(c,b)}}function i7(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)&&(a.uniform3i(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z);else{if(iX(c,b))return;a.uniform3iv(this.addr,b),iY(c,b)}}function i8(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)&&(a.uniform4i(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w);else{if(iX(c,b))return;a.uniform4iv(this.addr,b),iY(c,b)}}function i9(a,b){let c=this.cache;c[0]!==b&&(a.uniform1ui(this.addr,b),c[0]=b)}function ja(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y)&&(a.uniform2ui(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y);else{if(iX(c,b))return;a.uniform2uiv(this.addr,b),iY(c,b)}}function jb(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)&&(a.uniform3ui(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z);else{if(iX(c,b))return;a.uniform3uiv(this.addr,b),iY(c,b)}}function jc(a,b){let c=this.cache;if(void 0!==b.x)(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)&&(a.uniform4ui(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w);else{if(iX(c,b))return;a.uniform4uiv(this.addr,b),iY(c,b)}}function jd(a,b,c){let d,e=this.cache,f=c.allocateTextureUnit();e[0]!==f&&(a.uniform1i(this.addr,f),e[0]=f),this.type===a.SAMPLER_2D_SHADOW?(iN.compareFunction=c.isReversedDepthBuffer()?518:515,d=iN):d=iM,c.setTexture2D(b||d,f)}function je(a,b,c){let d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e),c.setTexture3D(b||iP,e)}function jf(a,b,c){let d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e),c.setTextureCube(b||iQ,e)}function jg(a,b,c){let d=this.cache,e=c.allocateTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e),c.setTexture2DArray(b||iO,e)}function jh(a,b){a.uniform1fv(this.addr,b)}function ji(a,b){let c=iW(b,this.size,2);a.uniform2fv(this.addr,c)}function jj(a,b){let c=iW(b,this.size,3);a.uniform3fv(this.addr,c)}function jk(a,b){let c=iW(b,this.size,4);a.uniform4fv(this.addr,c)}function jl(a,b){let c=iW(b,this.size,4);a.uniformMatrix2fv(this.addr,!1,c)}function jm(a,b){let c=iW(b,this.size,9);a.uniformMatrix3fv(this.addr,!1,c)}function jn(a,b){let c=iW(b,this.size,16);a.uniformMatrix4fv(this.addr,!1,c)}function jo(a,b){a.uniform1iv(this.addr,b)}function jp(a,b){a.uniform2iv(this.addr,b)}function jq(a,b){a.uniform3iv(this.addr,b)}function jr(a,b){a.uniform4iv(this.addr,b)}function js(a,b){a.uniform1uiv(this.addr,b)}function jt(a,b){a.uniform2uiv(this.addr,b)}function ju(a,b){a.uniform3uiv(this.addr,b)}function jv(a,b){a.uniform4uiv(this.addr,b)}function jw(a,b,c){let d,e=this.cache,f=b.length,g=iZ(c,f);iX(e,g)||(a.uniform1iv(this.addr,g),iY(e,g)),d=this.type===a.SAMPLER_2D_SHADOW?iN:iM;for(let a=0;a!==f;++a)c.setTexture2D(b[a]||d,g[a])}function jx(a,b,c){let d=this.cache,e=b.length,f=iZ(c,e);iX(d,f)||(a.uniform1iv(this.addr,f),iY(d,f));for(let a=0;a!==e;++a)c.setTexture3D(b[a]||iP,f[a])}function jy(a,b,c){let d=this.cache,e=b.length,f=iZ(c,e);iX(d,f)||(a.uniform1iv(this.addr,f),iY(d,f));for(let a=0;a!==e;++a)c.setTextureCube(b[a]||iQ,f[a])}function jz(a,b,c){let d=this.cache,e=b.length,f=iZ(c,e);iX(d,f)||(a.uniform1iv(this.addr,f),iY(d,f));for(let a=0;a!==e;++a)c.setTexture2DArray(b[a]||iO,f[a])}class jA{constructor(a,b,c){this.id=a,this.addr=c,this.cache=[],this.type=b.type,this.setValue=function(a){switch(a){case 5126:return i$;case 35664:return i_;case 35665:return i0;case 35666:return i1;case 35674:return i2;case 35675:return i3;case 35676:return i4;case 5124:case 35670:return i5;case 35667:case 35671:return i6;case 35668:case 35672:return i7;case 35669:case 35673:return i8;case 5125:return i9;case 36294:return ja;case 36295:return jb;case 36296:return jc;case 35678:case 36198:case 36298:case 36306:case 35682:return jd;case 35679:case 36299:case 36307:return je;case 35680:case 36300:case 36308:case 36293:return jf;case 36289:case 36303:case 36311:case 36292:return jg}}(b.type)}}class jB{constructor(a,b,c){this.id=a,this.addr=c,this.cache=[],this.type=b.type,this.size=b.size,this.setValue=function(a){switch(a){case 5126:return jh;case 35664:return ji;case 35665:return jj;case 35666:return jk;case 35674:return jl;case 35675:return jm;case 35676:return jn;case 5124:case 35670:return jo;case 35667:case 35671:return jp;case 35668:case 35672:return jq;case 35669:case 35673:return jr;case 5125:return js;case 36294:return jt;case 36295:return ju;case 36296:return jv;case 35678:case 36198:case 36298:case 36306:case 35682:return jw;case 35679:case 36299:case 36307:return jx;case 35680:case 36300:case 36308:case 36293:return jy;case 36289:case 36303:case 36311:case 36292:return jz}}(b.type)}}class jC{constructor(a){this.id=a,this.seq=[],this.map={}}setValue(a,b,c){let d=this.seq;for(let e=0,f=d.length;e!==f;++e){let f=d[e];f.setValue(a,b[f.id],c)}}}let jD=/(\w+)(\])?(\[|\.)?/g;function jE(a,b){a.seq.push(b),a.map[b.id]=b}class jF{constructor(a,b){this.seq=[],this.map={};const c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS);for(let d=0;d<c;++d){const c=a.getActiveUniform(b,d),e=a.getUniformLocation(b,c.name);!function(a,b,c){let d=a.name,e=d.length;for(jD.lastIndex=0;;){let f=jD.exec(d),g=jD.lastIndex,h=f[1],i="]"===f[2],j=f[3];if(i&&(h|=0),void 0===j||"["===j&&g+2===e){jE(c,void 0===j?new jA(h,a,b):new jB(h,a,b));break}{let a=c.map[h];void 0===a&&jE(c,a=new jC(h)),c=a}}}(c,e,this)}const d=[],e=[];for(const b of this.seq)b.type===a.SAMPLER_2D_SHADOW||b.type===a.SAMPLER_CUBE_SHADOW||b.type===a.SAMPLER_2D_ARRAY_SHADOW?d.push(b):e.push(b);d.length>0&&(this.seq=d.concat(e))}setValue(a,b,c,d){let e=this.map[b];void 0!==e&&e.setValue(a,c,d)}setOptional(a,b,c){let d=b[c];void 0!==d&&this.setValue(a,c,d)}static upload(a,b,c,d){for(let e=0,f=b.length;e!==f;++e){let f=b[e],g=c[f.id];!1!==g.needsUpdate&&f.setValue(a,g.value,d)}}static seqWithValue(a,b){let c=[];for(let d=0,e=a.length;d!==e;++d){let e=a[d];e.id in b&&c.push(e)}return c}}function jG(a,b,c){let d=a.createShader(b);return a.shaderSource(d,c),a.compileShader(d),d}let jH=0,jI=new ao;function jJ(a,b,c){let d=a.getShaderParameter(b,a.COMPILE_STATUS),e=(a.getShaderInfoLog(b)||"").trim();if(d&&""===e)return"";let f=/ERROR: 0:(\d+)/.exec(e);if(!f)return e;{let d=parseInt(f[1]);return c.toUpperCase()+"\n\n"+e+"\n\n"+function(a,b){let c=a.split("\n"),d=[],e=Math.max(b-6,0),f=Math.min(b+6,c.length);for(let a=e;a<f;a++){let e=a+1;d.push(`${e===b?">":" "} ${e}: ${c[a]}`)}return d.join("\n")}(a.getShaderSource(b),d)}}let jK={1:"Linear",2:"Reinhard",3:"Cineon",4:"ACESFilmic",6:"AgX",7:"Neutral",5:"Custom"},jL=new al;function jM(a){return""!==a}function jN(a,b){let c=b.numSpotLightShadows+b.numSpotLightMaps-b.numSpotLightShadowsWithMaps;return a.replace(/NUM_DIR_LIGHTS/g,b.numDirLights).replace(/NUM_SPOT_LIGHTS/g,b.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,b.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,c).replace(/NUM_RECT_AREA_LIGHTS/g,b.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,b.numPointLights).replace(/NUM_HEMI_LIGHTS/g,b.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,b.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,b.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,b.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,b.numPointLightShadows)}function jO(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,b.numClippingPlanes-b.numClipIntersection)}let jP=/^[ \t]*#include +<([\w\d./]+)>/gm;function jQ(a){return a.replace(jP,jS)}let jR=new Map;function jS(a,b){let c=ib[b];if(void 0===c){let a=jR.get(b);if(void 0!==a)c=ib[a],U('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',b,a);else throw Error("Can not resolve #include <"+b+">")}return jQ(c)}let jT=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function jU(a){return a.replace(jT,jV)}function jV(a,b,c,d){let e="";for(let a=parseInt(b);a<parseInt(c);a++)e+=d.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return e}function jW(a){let b=`precision ${a.precision} float;
|
|
337
|
+
precision ${a.precision} int;
|
|
338
|
+
precision ${a.precision} sampler2D;
|
|
339
|
+
precision ${a.precision} samplerCube;
|
|
340
|
+
precision ${a.precision} sampler3D;
|
|
341
|
+
precision ${a.precision} sampler2DArray;
|
|
342
|
+
precision ${a.precision} sampler2DShadow;
|
|
343
|
+
precision ${a.precision} samplerCubeShadow;
|
|
344
|
+
precision ${a.precision} sampler2DArrayShadow;
|
|
345
|
+
precision ${a.precision} isampler2D;
|
|
346
|
+
precision ${a.precision} isampler3D;
|
|
347
|
+
precision ${a.precision} isamplerCube;
|
|
348
|
+
precision ${a.precision} isampler2DArray;
|
|
349
|
+
precision ${a.precision} usampler2D;
|
|
350
|
+
precision ${a.precision} usampler3D;
|
|
351
|
+
precision ${a.precision} usamplerCube;
|
|
352
|
+
precision ${a.precision} usampler2DArray;
|
|
353
|
+
`;return"highp"===a.precision?b+="\n#define HIGH_PRECISION":"mediump"===a.precision?b+="\n#define MEDIUM_PRECISION":"lowp"===a.precision&&(b+="\n#define LOW_PRECISION"),b}let jX={1:"SHADOWMAP_TYPE_PCF",3:"SHADOWMAP_TYPE_VSM"},jY={301:"ENVMAP_TYPE_CUBE",302:"ENVMAP_TYPE_CUBE",306:"ENVMAP_TYPE_CUBE_UV"},jZ={302:"ENVMAP_MODE_REFRACTION"},j$={0:"ENVMAP_BLENDING_MULTIPLY",1:"ENVMAP_BLENDING_MIX",2:"ENVMAP_BLENDING_ADD"};function j_(a,b,c,d){var e,f;let g,h,i,j,k=a.getContext(),l=c.defines,m=c.vertexShader,n=c.fragmentShader,o=jX[c.shadowMapType]||"SHADOWMAP_TYPE_BASIC",p=!1===c.envMap?"ENVMAP_TYPE_CUBE":jY[c.envMapMode]||"ENVMAP_TYPE_CUBE",q=!1===c.envMap?"ENVMAP_MODE_REFLECTION":jZ[c.envMapMode]||"ENVMAP_MODE_REFLECTION",r=!1===c.envMap?"ENVMAP_BLENDING_NONE":j$[c.combine]||"ENVMAP_BLENDING_NONE",s=function(a){let b=a.envMapCubeUVHeight;if(null===b)return null;let c=Math.log2(b)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,c),112)),texelHeight:1/b,maxMip:c}}(c),t=[c.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",c.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(jM).join("\n"),u=function(a){let b=[];for(let c in a){let d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}(l),v=k.createProgram(),w=c.glslVersion?"#version "+c.glslVersion+"\n":"";if(c.isRawShaderMaterial)(g=["#define SHADER_TYPE "+c.shaderType,"#define SHADER_NAME "+c.shaderName,u].filter(jM).join("\n")).length>0&&(g+="\n"),(h=["#define SHADER_TYPE "+c.shaderType,"#define SHADER_NAME "+c.shaderName,u].filter(jM).join("\n")).length>0&&(h+="\n");else{let a,b,d,i,j;g=[jW(c),"#define SHADER_TYPE "+c.shaderType,"#define SHADER_NAME "+c.shaderName,u,c.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",c.batching?"#define USE_BATCHING":"",c.batchingColor?"#define USE_BATCHING_COLOR":"",c.instancing?"#define USE_INSTANCING":"",c.instancingColor?"#define USE_INSTANCING_COLOR":"",c.instancingMorph?"#define USE_INSTANCING_MORPH":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+q:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",c.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",c.displacementMap?"#define USE_DISPLACEMENTMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.anisotropy?"#define USE_ANISOTROPY":"",c.anisotropyMap?"#define USE_ANISOTROPYMAP":"",c.clearcoatMap?"#define USE_CLEARCOATMAP":"",c.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",c.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",c.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.alphaHash?"#define USE_ALPHAHASH":"",c.transmission?"#define USE_TRANSMISSION":"",c.transmissionMap?"#define USE_TRANSMISSIONMAP":"",c.thicknessMap?"#define USE_THICKNESSMAP":"",c.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",c.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",c.mapUv?"#define MAP_UV "+c.mapUv:"",c.alphaMapUv?"#define ALPHAMAP_UV "+c.alphaMapUv:"",c.lightMapUv?"#define LIGHTMAP_UV "+c.lightMapUv:"",c.aoMapUv?"#define AOMAP_UV "+c.aoMapUv:"",c.emissiveMapUv?"#define EMISSIVEMAP_UV "+c.emissiveMapUv:"",c.bumpMapUv?"#define BUMPMAP_UV "+c.bumpMapUv:"",c.normalMapUv?"#define NORMALMAP_UV "+c.normalMapUv:"",c.displacementMapUv?"#define DISPLACEMENTMAP_UV "+c.displacementMapUv:"",c.metalnessMapUv?"#define METALNESSMAP_UV "+c.metalnessMapUv:"",c.roughnessMapUv?"#define ROUGHNESSMAP_UV "+c.roughnessMapUv:"",c.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+c.anisotropyMapUv:"",c.clearcoatMapUv?"#define CLEARCOATMAP_UV "+c.clearcoatMapUv:"",c.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+c.clearcoatNormalMapUv:"",c.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+c.clearcoatRoughnessMapUv:"",c.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+c.iridescenceMapUv:"",c.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+c.iridescenceThicknessMapUv:"",c.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+c.sheenColorMapUv:"",c.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+c.sheenRoughnessMapUv:"",c.specularMapUv?"#define SPECULARMAP_UV "+c.specularMapUv:"",c.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+c.specularColorMapUv:"",c.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+c.specularIntensityMapUv:"",c.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+c.transmissionMapUv:"",c.thicknessMapUv?"#define THICKNESSMAP_UV "+c.thicknessMapUv:"",c.vertexTangents&&!1===c.flatShading?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexAlphas?"#define USE_COLOR_ALPHA":"",c.vertexUv1s?"#define USE_UV1":"",c.vertexUv2s?"#define USE_UV2":"",c.vertexUv3s?"#define USE_UV3":"",c.pointsUvs?"#define USE_POINTS_UV":"",c.flatShading?"#define FLAT_SHADED":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals&&!1===c.flatShading?"#define USE_MORPHNORMALS":"",c.morphColors?"#define USE_MORPHCOLORS":"",c.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+c.morphTextureStride:"",c.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+c.morphTargetsCount:"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+o:"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"",c.numLightProbes>0?"#define USE_LIGHT_PROBES":"",c.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",c.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(jM).join("\n"),h=[jW(c),"#define SHADER_TYPE "+c.shaderType,"#define SHADER_NAME "+c.shaderName,u,c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",c.map?"#define USE_MAP":"",c.matcap?"#define USE_MATCAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+p:"",c.envMap?"#define "+q:"",c.envMap?"#define "+r:"",s?"#define CUBEUV_TEXEL_WIDTH "+s.texelWidth:"",s?"#define CUBEUV_TEXEL_HEIGHT "+s.texelHeight:"",s?"#define CUBEUV_MAX_MIP "+s.maxMip+".0":"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",c.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.anisotropy?"#define USE_ANISOTROPY":"",c.anisotropyMap?"#define USE_ANISOTROPYMAP":"",c.clearcoat?"#define USE_CLEARCOAT":"",c.clearcoatMap?"#define USE_CLEARCOATMAP":"",c.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.dispersion?"#define USE_DISPERSION":"",c.iridescence?"#define USE_IRIDESCENCE":"",c.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",c.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",c.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.alphaTest?"#define USE_ALPHATEST":"",c.alphaHash?"#define USE_ALPHAHASH":"",c.sheen?"#define USE_SHEEN":"",c.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",c.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",c.transmission?"#define USE_TRANSMISSION":"",c.transmissionMap?"#define USE_TRANSMISSIONMAP":"",c.thicknessMap?"#define USE_THICKNESSMAP":"",c.vertexTangents&&!1===c.flatShading?"#define USE_TANGENT":"",c.vertexColors||c.instancingColor?"#define USE_COLOR":"",c.vertexAlphas||c.batchingColor?"#define USE_COLOR_ALPHA":"",c.vertexUv1s?"#define USE_UV1":"",c.vertexUv2s?"#define USE_UV2":"",c.vertexUv3s?"#define USE_UV3":"",c.pointsUvs?"#define USE_POINTS_UV":"",c.gradientMap?"#define USE_GRADIENTMAP":"",c.flatShading?"#define FLAT_SHADED":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+o:"",c.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",c.numLightProbes>0?"#define USE_LIGHT_PROBES":"",c.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",c.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",c.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",c.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==c.toneMapping?"#define TONE_MAPPING":"",0!==c.toneMapping?ib.tonemapping_pars_fragment:"",0!==c.toneMapping?(e="toneMapping",void 0===(a=jK[f=c.toneMapping])?(U("WebGLProgram: Unsupported toneMapping:",f),"vec3 "+e+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+e+"( vec3 color ) { return "+a+"ToneMapping( color ); }"):"",c.dithering?"#define DITHERING":"",c.opaque?"#define OPAQUE":"",ib.colorspace_pars_fragment,(b=function(a){as._getMatrix(jI,as.workingColorSpace,a);let b=`mat3( ${jI.elements.map(a=>a.toFixed(4))} )`;switch(as.getTransfer(a)){case C:return[b,"LinearTransferOETF"];case D:return[b,"sRGBTransferOETF"];default:return U("WebGLProgram: Unsupported color space: ",a),[b,"LinearTransferOETF"]}}(c.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) {
|
|
354
|
+
return ${b[1]}( vec4( value.rgb * ${b[0]}, value.a ) );
|
|
355
|
+
}`),(as.getLuminanceCoefficients(jL),d=jL.x.toFixed(4),i=jL.y.toFixed(4),j=jL.z.toFixed(4),`float luminance( const in vec3 rgb ) {
|
|
356
|
+
const vec3 weights = vec3( ${d}, ${i}, ${j} );
|
|
357
|
+
return dot( weights, rgb );
|
|
358
|
+
}`),c.useDepthPacking?"#define DEPTH_PACKING "+c.depthPacking:"","\n"].filter(jM).join("\n")}m=jO(m=jN(m=jQ(m),c),c),n=jO(n=jN(n=jQ(n),c),c),m=jU(m),n=jU(n),!0!==c.isRawShaderMaterial&&(w="#version 300 es\n",g=[t,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+g,h=["#define varying in",c.glslVersion===E?"":"layout(location = 0) out highp vec4 pc_fragColor;",c.glslVersion===E?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+h);let x=w+g+m,y=w+h+n,z=jG(k,k.VERTEX_SHADER,x),A=jG(k,k.FRAGMENT_SHADER,y);function B(b){if(a.debug.checkShaderErrors){let c=k.getProgramInfoLog(v)||"",d=k.getShaderInfoLog(z)||"",e=k.getShaderInfoLog(A)||"",f=c.trim(),i=d.trim(),j=e.trim(),l=!0,m=!0;if(!1===k.getProgramParameter(v,k.LINK_STATUS))if(l=!1,"function"==typeof a.debug.onShaderError)a.debug.onShaderError(k,v,z,A);else{let a=jJ(k,z,"vertex"),c=jJ(k,A,"fragment");V("THREE.WebGLProgram: Shader Error "+k.getError()+" - VALIDATE_STATUS "+k.getProgramParameter(v,k.VALIDATE_STATUS)+"\n\nMaterial Name: "+b.name+"\nMaterial Type: "+b.type+"\n\nProgram Info Log: "+f+"\n"+a+"\n"+c)}else""!==f?U("WebGLProgram: Program Info Log:",f):(""===i||""===j)&&(m=!1);m&&(b.diagnostics={runnable:l,programLog:f,vertexShader:{log:i,prefix:g},fragmentShader:{log:j,prefix:h}})}k.deleteShader(z),k.deleteShader(A),i=new jF(k,v),j=function(a,b){let c={},d=a.getProgramParameter(b,a.ACTIVE_ATTRIBUTES);for(let e=0;e<d;e++){let d=a.getActiveAttrib(b,e),f=d.name,g=1;d.type===a.FLOAT_MAT2&&(g=2),d.type===a.FLOAT_MAT3&&(g=3),d.type===a.FLOAT_MAT4&&(g=4),c[f]={type:d.type,location:a.getAttribLocation(b,f),locationSize:g}}return c}(k,v)}k.attachShader(v,z),k.attachShader(v,A),void 0!==c.index0AttributeName?k.bindAttribLocation(v,0,c.index0AttributeName):!0===c.morphTargets&&k.bindAttribLocation(v,0,"position"),k.linkProgram(v),this.getUniforms=function(){return void 0===i&&B(this),i},this.getAttributes=function(){return void 0===j&&B(this),j};let F=!1===c.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===F&&(F=k.getProgramParameter(v,37297)),F},this.destroy=function(){d.releaseStatesOfProgram(this),k.deleteProgram(v),this.program=void 0},this.type=c.shaderType,this.name=c.shaderName,this.id=jH++,this.cacheKey=b,this.usedTimes=1,this.program=v,this.vertexShader=z,this.fragmentShader=A,this}let j0=0;class j1{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(a){let b=a.vertexShader,c=a.fragmentShader,d=this._getShaderStage(b),e=this._getShaderStage(c),f=this._getShaderCacheForMaterial(a);return!1===f.has(d)&&(f.add(d),d.usedTimes++),!1===f.has(e)&&(f.add(e),e.usedTimes++),this}remove(a){for(let b of this.materialCache.get(a))b.usedTimes--,0===b.usedTimes&&this.shaderCache.delete(b.code);return this.materialCache.delete(a),this}getVertexShaderID(a){return this._getShaderStage(a.vertexShader).id}getFragmentShaderID(a){return this._getShaderStage(a.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(a){let b=this.materialCache,c=b.get(a);return void 0===c&&(c=new Set,b.set(a,c)),c}_getShaderStage(a){let b=this.shaderCache,c=b.get(a);return void 0===c&&(c=new j2(a),b.set(a,c)),c}}class j2{constructor(a){this.id=j0++,this.code=a,this.usedTimes=0}}function j3(a,b,c,d,e,f){let g=new aU,h=new j1,i=new Set,j=[],k=new Map,l=d.logarithmicDepthBuffer,m=d.precision,n={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function o(a){return(i.add(a),0===a)?"uv":`uv${a}`}return{getParameters:function(e,g,j,k,p){let q,r,s,t,u=k.fog,v=p.geometry,w=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?k.environment:null,x=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap,y=b.get(e.envMap||w,x),z=y&&306===y.mapping?y.image.height:null,A=n[e.type];null!==e.precision&&(m=d.getMaxPrecision(e.precision))!==e.precision&&U("WebGLProgram.getParameters:",e.precision,"not supported, using",m,"instead.");let C=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,E=void 0!==C?C.length:0,F=0;if(void 0!==v.morphAttributes.position&&(F=1),void 0!==v.morphAttributes.normal&&(F=2),void 0!==v.morphAttributes.color&&(F=3),A){let a=id[A];q=a.vertexShader,r=a.fragmentShader}else q=e.vertexShader,r=e.fragmentShader,h.update(e),s=h.getVertexShaderID(e),t=h.getFragmentShaderID(e);let G=a.getRenderTarget(),H=a.state.buffers.depth.getReversed(),I=!0===p.isInstancedMesh,J=!0===p.isBatchedMesh,K=!!e.map,L=!!e.matcap,M=!!y,N=!!e.aoMap,O=!!e.lightMap,P=!!e.bumpMap,Q=!!e.normalMap,R=!!e.displacementMap,S=!!e.emissiveMap,T=!!e.metalnessMap,V=!!e.roughnessMap,W=e.anisotropy>0,X=e.clearcoat>0,Y=e.dispersion>0,Z=e.iridescence>0,$=e.sheen>0,_=e.transmission>0,aa=W&&!!e.anisotropyMap,ab=X&&!!e.clearcoatMap,ac=X&&!!e.clearcoatNormalMap,ad=X&&!!e.clearcoatRoughnessMap,ae=Z&&!!e.iridescenceMap,af=Z&&!!e.iridescenceThicknessMap,ag=$&&!!e.sheenColorMap,ah=$&&!!e.sheenRoughnessMap,ai=!!e.specularMap,aj=!!e.specularColorMap,ak=!!e.specularIntensityMap,al=_&&!!e.transmissionMap,am=_&&!!e.thicknessMap,an=!!e.gradientMap,ao=!!e.alphaMap,ap=e.alphaTest>0,aq=!!e.alphaHash,ar=!!e.extensions,at=0;e.toneMapped&&(null===G||!0===G.isXRRenderTarget)&&(at=a.toneMapping);let au={shaderID:A,shaderType:e.type,shaderName:e.name,vertexShader:q,fragmentShader:r,defines:e.defines,customVertexShaderID:s,customFragmentShaderID:t,isRawShaderMaterial:!0===e.isRawShaderMaterial,glslVersion:e.glslVersion,precision:m,batching:J,batchingColor:J&&null!==p._colorsTexture,instancing:I,instancingColor:I&&null!==p.instanceColor,instancingMorph:I&&null!==p.morphTexture,outputColorSpace:null===G?a.outputColorSpace:!0===G.isXRRenderTarget?G.texture.colorSpace:B,alphaToCoverage:!!e.alphaToCoverage,map:K,matcap:L,envMap:M,envMapMode:M&&y.mapping,envMapCubeUVHeight:z,aoMap:N,lightMap:O,bumpMap:P,normalMap:Q,displacementMap:R,emissiveMap:S,normalMapObjectSpace:Q&&1===e.normalMapType,normalMapTangentSpace:Q&&0===e.normalMapType,metalnessMap:T,roughnessMap:V,anisotropy:W,anisotropyMap:aa,clearcoat:X,clearcoatMap:ab,clearcoatNormalMap:ac,clearcoatRoughnessMap:ad,dispersion:Y,iridescence:Z,iridescenceMap:ae,iridescenceThicknessMap:af,sheen:$,sheenColorMap:ag,sheenRoughnessMap:ah,specularMap:ai,specularColorMap:aj,specularIntensityMap:ak,transmission:_,transmissionMap:al,thicknessMap:am,gradientMap:an,opaque:!1===e.transparent&&1===e.blending&&!1===e.alphaToCoverage,alphaMap:ao,alphaTest:ap,alphaHash:aq,combine:e.combine,mapUv:K&&o(e.map.channel),aoMapUv:N&&o(e.aoMap.channel),lightMapUv:O&&o(e.lightMap.channel),bumpMapUv:P&&o(e.bumpMap.channel),normalMapUv:Q&&o(e.normalMap.channel),displacementMapUv:R&&o(e.displacementMap.channel),emissiveMapUv:S&&o(e.emissiveMap.channel),metalnessMapUv:T&&o(e.metalnessMap.channel),roughnessMapUv:V&&o(e.roughnessMap.channel),anisotropyMapUv:aa&&o(e.anisotropyMap.channel),clearcoatMapUv:ab&&o(e.clearcoatMap.channel),clearcoatNormalMapUv:ac&&o(e.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ad&&o(e.clearcoatRoughnessMap.channel),iridescenceMapUv:ae&&o(e.iridescenceMap.channel),iridescenceThicknessMapUv:af&&o(e.iridescenceThicknessMap.channel),sheenColorMapUv:ag&&o(e.sheenColorMap.channel),sheenRoughnessMapUv:ah&&o(e.sheenRoughnessMap.channel),specularMapUv:ai&&o(e.specularMap.channel),specularColorMapUv:aj&&o(e.specularColorMap.channel),specularIntensityMapUv:ak&&o(e.specularIntensityMap.channel),transmissionMapUv:al&&o(e.transmissionMap.channel),thicknessMapUv:am&&o(e.thicknessMap.channel),alphaMapUv:ao&&o(e.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(Q||W),vertexColors:e.vertexColors,vertexAlphas:!0===e.vertexColors&&!!v.attributes.color&&4===v.attributes.color.itemSize,pointsUvs:!0===p.isPoints&&!!v.attributes.uv&&(K||ao),fog:!!u,useFog:!0===e.fog,fogExp2:!!u&&u.isFogExp2,flatShading:!1===e.wireframe&&(!0===e.flatShading||void 0===v.attributes.normal&&!1===Q&&(e.isMeshLambertMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isMeshPhysicalMaterial)),sizeAttenuation:!0===e.sizeAttenuation,logarithmicDepthBuffer:l,reversedDepthBuffer:H,skinning:!0===p.isSkinnedMesh,morphTargets:void 0!==v.morphAttributes.position,morphNormals:void 0!==v.morphAttributes.normal,morphColors:void 0!==v.morphAttributes.color,morphTargetsCount:E,morphTextureStride:F,numDirLights:g.directional.length,numPointLights:g.point.length,numSpotLights:g.spot.length,numSpotLightMaps:g.spotLightMap.length,numRectAreaLights:g.rectArea.length,numHemiLights:g.hemi.length,numDirLightShadows:g.directionalShadowMap.length,numPointLightShadows:g.pointShadowMap.length,numSpotLightShadows:g.spotShadowMap.length,numSpotLightShadowsWithMaps:g.numSpotLightShadowsWithMaps,numLightProbes:g.numLightProbes,numClippingPlanes:f.numPlanes,numClipIntersection:f.numIntersection,dithering:e.dithering,shadowMapEnabled:a.shadowMap.enabled&&j.length>0,shadowMapType:a.shadowMap.type,toneMapping:at,decodeVideoTexture:K&&!0===e.map.isVideoTexture&&as.getTransfer(e.map.colorSpace)===D,decodeVideoTextureEmissive:S&&!0===e.emissiveMap.isVideoTexture&&as.getTransfer(e.emissiveMap.colorSpace)===D,premultipliedAlpha:e.premultipliedAlpha,doubleSided:2===e.side,flipSided:1===e.side,useDepthPacking:e.depthPacking>=0,depthPacking:e.depthPacking||0,index0AttributeName:e.index0AttributeName,extensionClipCullDistance:ar&&!0===e.extensions.clipCullDistance&&c.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ar&&!0===e.extensions.multiDraw||J)&&c.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:c.has("KHR_parallel_shader_compile"),customProgramCacheKey:e.customProgramCacheKey()};return au.vertexUv1s=i.has(1),au.vertexUv2s=i.has(2),au.vertexUv3s=i.has(3),i.clear(),au},getProgramCacheKey:function(b){var c,d,e,f;let h=[];if(b.shaderID?h.push(b.shaderID):(h.push(b.customVertexShaderID),h.push(b.customFragmentShaderID)),void 0!==b.defines)for(let a in b.defines)h.push(a),h.push(b.defines[a]);return!1===b.isRawShaderMaterial&&(c=h,d=b,c.push(d.precision),c.push(d.outputColorSpace),c.push(d.envMapMode),c.push(d.envMapCubeUVHeight),c.push(d.mapUv),c.push(d.alphaMapUv),c.push(d.lightMapUv),c.push(d.aoMapUv),c.push(d.bumpMapUv),c.push(d.normalMapUv),c.push(d.displacementMapUv),c.push(d.emissiveMapUv),c.push(d.metalnessMapUv),c.push(d.roughnessMapUv),c.push(d.anisotropyMapUv),c.push(d.clearcoatMapUv),c.push(d.clearcoatNormalMapUv),c.push(d.clearcoatRoughnessMapUv),c.push(d.iridescenceMapUv),c.push(d.iridescenceThicknessMapUv),c.push(d.sheenColorMapUv),c.push(d.sheenRoughnessMapUv),c.push(d.specularMapUv),c.push(d.specularColorMapUv),c.push(d.specularIntensityMapUv),c.push(d.transmissionMapUv),c.push(d.thicknessMapUv),c.push(d.combine),c.push(d.fogExp2),c.push(d.sizeAttenuation),c.push(d.morphTargetsCount),c.push(d.morphAttributeCount),c.push(d.numDirLights),c.push(d.numPointLights),c.push(d.numSpotLights),c.push(d.numSpotLightMaps),c.push(d.numHemiLights),c.push(d.numRectAreaLights),c.push(d.numDirLightShadows),c.push(d.numPointLightShadows),c.push(d.numSpotLightShadows),c.push(d.numSpotLightShadowsWithMaps),c.push(d.numLightProbes),c.push(d.shadowMapType),c.push(d.toneMapping),c.push(d.numClippingPlanes),c.push(d.numClipIntersection),c.push(d.depthPacking),e=h,f=b,g.disableAll(),f.instancing&&g.enable(0),f.instancingColor&&g.enable(1),f.instancingMorph&&g.enable(2),f.matcap&&g.enable(3),f.envMap&&g.enable(4),f.normalMapObjectSpace&&g.enable(5),f.normalMapTangentSpace&&g.enable(6),f.clearcoat&&g.enable(7),f.iridescence&&g.enable(8),f.alphaTest&&g.enable(9),f.vertexColors&&g.enable(10),f.vertexAlphas&&g.enable(11),f.vertexUv1s&&g.enable(12),f.vertexUv2s&&g.enable(13),f.vertexUv3s&&g.enable(14),f.vertexTangents&&g.enable(15),f.anisotropy&&g.enable(16),f.alphaHash&&g.enable(17),f.batching&&g.enable(18),f.dispersion&&g.enable(19),f.batchingColor&&g.enable(20),f.gradientMap&&g.enable(21),e.push(g.mask),g.disableAll(),f.fog&&g.enable(0),f.useFog&&g.enable(1),f.flatShading&&g.enable(2),f.logarithmicDepthBuffer&&g.enable(3),f.reversedDepthBuffer&&g.enable(4),f.skinning&&g.enable(5),f.morphTargets&&g.enable(6),f.morphNormals&&g.enable(7),f.morphColors&&g.enable(8),f.premultipliedAlpha&&g.enable(9),f.shadowMapEnabled&&g.enable(10),f.doubleSided&&g.enable(11),f.flipSided&&g.enable(12),f.useDepthPacking&&g.enable(13),f.dithering&&g.enable(14),f.transmission&&g.enable(15),f.sheen&&g.enable(16),f.opaque&&g.enable(17),f.pointsUvs&&g.enable(18),f.decodeVideoTexture&&g.enable(19),f.decodeVideoTextureEmissive&&g.enable(20),f.alphaToCoverage&&g.enable(21),e.push(g.mask),h.push(a.outputColorSpace)),h.push(b.customProgramCacheKey),h.join()},getUniforms:function(a){let b,c=n[a.type];if(c){let a=id[c];b=fs.clone(a.uniforms)}else b=a.uniforms;return b},acquireProgram:function(b,c){let d=k.get(c);return void 0!==d?++d.usedTimes:(d=new j_(a,c,b,e),j.push(d),k.set(c,d)),d},releaseProgram:function(a){if(0==--a.usedTimes){let b=j.indexOf(a);j[b]=j[j.length-1],j.pop(),k.delete(a.cacheKey),a.destroy()}},releaseShaderCache:function(a){h.remove(a)},programs:j,dispose:function(){h.dispose()}}}function j4(){let a=new WeakMap;return{has:function(b){return a.has(b)},get:function(b){let c=a.get(b);return void 0===c&&(c={},a.set(b,c)),c},remove:function(b){a.delete(b)},update:function(b,c,d){a.get(b)[c]=d},dispose:function(){a=new WeakMap}}}function j5(a,b){if(a.groupOrder!==b.groupOrder)return a.groupOrder-b.groupOrder;if(a.renderOrder!==b.renderOrder)return a.renderOrder-b.renderOrder;if(a.material.id!==b.material.id)return a.material.id-b.material.id;if(a.materialVariant!==b.materialVariant)return a.materialVariant-b.materialVariant;if(a.z!==b.z)return a.z-b.z;else return a.id-b.id}function j6(a,b){return a.groupOrder!==b.groupOrder?a.groupOrder-b.groupOrder:a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function j7(){let a=[],b=0,c=[],d=[],e=[];function f(a){let b=0;return a.isInstancedMesh&&(b+=2),a.isSkinnedMesh&&(b+=1),b}function g(c,d,e,g,h,i){let j=a[b];return void 0===j?(j={id:c.id,object:c,geometry:d,material:e,materialVariant:f(c),groupOrder:g,renderOrder:c.renderOrder,z:h,group:i},a[b]=j):(j.id=c.id,j.object=c,j.geometry=d,j.material=e,j.materialVariant=f(c),j.groupOrder=g,j.renderOrder=c.renderOrder,j.z=h,j.group=i),b++,j}return{opaque:c,transmissive:d,transparent:e,init:function(){b=0,c.length=0,d.length=0,e.length=0},push:function(a,b,f,h,i,j){let k=g(a,b,f,h,i,j);f.transmission>0?d.push(k):!0===f.transparent?e.push(k):c.push(k)},unshift:function(a,b,f,h,i,j){let k=g(a,b,f,h,i,j);f.transmission>0?d.unshift(k):!0===f.transparent?e.unshift(k):c.unshift(k)},finish:function(){for(let c=b,d=a.length;c<d;c++){let b=a[c];if(null===b.id)break;b.id=null,b.object=null,b.geometry=null,b.material=null,b.group=null}},sort:function(a,b){c.length>1&&c.sort(a||j5),d.length>1&&d.sort(b||j6),e.length>1&&e.sort(b||j6)}}}function j8(){let a=new WeakMap;return{get:function(b,c){let d,e=a.get(b);return void 0===e?(d=new j7,a.set(b,[d])):c>=e.length?(d=new j7,e.push(d)):d=e[c],d},dispose:function(){a=new WeakMap}}}function j9(){let a={};return{get:function(b){let c;if(void 0!==a[b.id])return a[b.id];switch(b.type){case"DirectionalLight":c={direction:new al,color:new bg};break;case"SpotLight":c={position:new al,direction:new al,color:new bg,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":c={position:new al,color:new bg,distance:0,decay:0};break;case"HemisphereLight":c={direction:new al,skyColor:new bg,groundColor:new bg};break;case"RectAreaLight":c={color:new bg,position:new al,halfWidth:new al,halfHeight:new al}}return a[b.id]=c,c}}}let ka=0;function kb(a,b){return 2*!!b.castShadow-2*!!a.castShadow+ +!!b.map-!!a.map}function kc(a){let b,c=new j9,d=(b={},{get:function(a){let c;if(void 0!==b[a.id])return b[a.id];switch(a.type){case"DirectionalLight":case"SpotLight":c={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new aj};break;case"PointLight":c={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new aj,shadowCameraNear:1,shadowCameraFar:1e3}}return b[a.id]=c,c}}),e={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let a=0;a<9;a++)e.probe.push(new al);let f=new al,g=new aJ,h=new aJ;return{setup:function(b){let f=0,g=0,h=0;for(let a=0;a<9;a++)e.probe[a].set(0,0,0);let i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;b.sort(kb);for(let a=0,t=b.length;a<t;a++){let t=b[a],u=t.color,v=t.intensity,w=t.distance,x=null;if(t.shadow&&t.shadow.map&&(x=1030===t.shadow.map.texture.format?t.shadow.map.texture:t.shadow.map.depthTexture||t.shadow.map.texture),t.isAmbientLight)f+=u.r*v,g+=u.g*v,h+=u.b*v;else if(t.isLightProbe){for(let a=0;a<9;a++)e.probe[a].addScaledVector(t.sh.coefficients[a],v);s++}else if(t.isDirectionalLight){let a=c.get(t);if(a.color.copy(t.color).multiplyScalar(t.intensity),t.castShadow){let a=t.shadow,b=d.get(t);b.shadowIntensity=a.intensity,b.shadowBias=a.bias,b.shadowNormalBias=a.normalBias,b.shadowRadius=a.radius,b.shadowMapSize=a.mapSize,e.directionalShadow[i]=b,e.directionalShadowMap[i]=x,e.directionalShadowMatrix[i]=t.shadow.matrix,n++}e.directional[i]=a,i++}else if(t.isSpotLight){let a=c.get(t);a.position.setFromMatrixPosition(t.matrixWorld),a.color.copy(u).multiplyScalar(v),a.distance=w,a.coneCos=Math.cos(t.angle),a.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),a.decay=t.decay,e.spot[k]=a;let b=t.shadow;if(t.map&&(e.spotLightMap[q]=t.map,q++,b.updateMatrices(t),t.castShadow&&r++),e.spotLightMatrix[k]=b.matrix,t.castShadow){let a=d.get(t);a.shadowIntensity=b.intensity,a.shadowBias=b.bias,a.shadowNormalBias=b.normalBias,a.shadowRadius=b.radius,a.shadowMapSize=b.mapSize,e.spotShadow[k]=a,e.spotShadowMap[k]=x,p++}k++}else if(t.isRectAreaLight){let a=c.get(t);a.color.copy(u).multiplyScalar(v),a.halfWidth.set(.5*t.width,0,0),a.halfHeight.set(0,.5*t.height,0),e.rectArea[l]=a,l++}else if(t.isPointLight){let a=c.get(t);if(a.color.copy(t.color).multiplyScalar(t.intensity),a.distance=t.distance,a.decay=t.decay,t.castShadow){let a=t.shadow,b=d.get(t);b.shadowIntensity=a.intensity,b.shadowBias=a.bias,b.shadowNormalBias=a.normalBias,b.shadowRadius=a.radius,b.shadowMapSize=a.mapSize,b.shadowCameraNear=a.camera.near,b.shadowCameraFar=a.camera.far,e.pointShadow[j]=b,e.pointShadowMap[j]=x,e.pointShadowMatrix[j]=t.shadow.matrix,o++}e.point[j]=a,j++}else if(t.isHemisphereLight){let a=c.get(t);a.skyColor.copy(t.color).multiplyScalar(v),a.groundColor.copy(t.groundColor).multiplyScalar(v),e.hemi[m]=a,m++}}l>0&&(!0===a.has("OES_texture_float_linear")?(e.rectAreaLTC1=ic.LTC_FLOAT_1,e.rectAreaLTC2=ic.LTC_FLOAT_2):(e.rectAreaLTC1=ic.LTC_HALF_1,e.rectAreaLTC2=ic.LTC_HALF_2)),e.ambient[0]=f,e.ambient[1]=g,e.ambient[2]=h;let t=e.hash;(t.directionalLength!==i||t.pointLength!==j||t.spotLength!==k||t.rectAreaLength!==l||t.hemiLength!==m||t.numDirectionalShadows!==n||t.numPointShadows!==o||t.numSpotShadows!==p||t.numSpotMaps!==q||t.numLightProbes!==s)&&(e.directional.length=i,e.spot.length=k,e.rectArea.length=l,e.point.length=j,e.hemi.length=m,e.directionalShadow.length=n,e.directionalShadowMap.length=n,e.pointShadow.length=o,e.pointShadowMap.length=o,e.spotShadow.length=p,e.spotShadowMap.length=p,e.directionalShadowMatrix.length=n,e.pointShadowMatrix.length=o,e.spotLightMatrix.length=p+q-r,e.spotLightMap.length=q,e.numSpotLightShadowsWithMaps=r,e.numLightProbes=s,t.directionalLength=i,t.pointLength=j,t.spotLength=k,t.rectAreaLength=l,t.hemiLength=m,t.numDirectionalShadows=n,t.numPointShadows=o,t.numSpotShadows=p,t.numSpotMaps=q,t.numLightProbes=s,e.version=ka++)},setupView:function(a,b){let c=0,d=0,i=0,j=0,k=0,l=b.matrixWorldInverse;for(let b=0,m=a.length;b<m;b++){let m=a[b];if(m.isDirectionalLight){let a=e.directional[c];a.direction.setFromMatrixPosition(m.matrixWorld),f.setFromMatrixPosition(m.target.matrixWorld),a.direction.sub(f),a.direction.transformDirection(l),c++}else if(m.isSpotLight){let a=e.spot[i];a.position.setFromMatrixPosition(m.matrixWorld),a.position.applyMatrix4(l),a.direction.setFromMatrixPosition(m.matrixWorld),f.setFromMatrixPosition(m.target.matrixWorld),a.direction.sub(f),a.direction.transformDirection(l),i++}else if(m.isRectAreaLight){let a=e.rectArea[j];a.position.setFromMatrixPosition(m.matrixWorld),a.position.applyMatrix4(l),h.identity(),g.copy(m.matrixWorld),g.premultiply(l),h.extractRotation(g),a.halfWidth.set(.5*m.width,0,0),a.halfHeight.set(0,.5*m.height,0),a.halfWidth.applyMatrix4(h),a.halfHeight.applyMatrix4(h),j++}else if(m.isPointLight){let a=e.point[d];a.position.setFromMatrixPosition(m.matrixWorld),a.position.applyMatrix4(l),d++}else if(m.isHemisphereLight){let a=e.hemi[k];a.direction.setFromMatrixPosition(m.matrixWorld),a.direction.transformDirection(l),k++}}},state:e}}function kd(a){let b=new kc(a),c=[],d=[],e={lightsArray:c,shadowsArray:d,camera:null,lights:b,transmissionRenderTarget:{}};return{init:function(a){e.camera=a,c.length=0,d.length=0},state:e,setupLights:function(){b.setup(c)},setupLightsView:function(a){b.setupView(c,a)},pushLight:function(a){c.push(a)},pushShadow:function(a){d.push(a)}}}function ke(a){let b=new WeakMap;return{get:function(c,d=0){let e,f=b.get(c);return void 0===f?(e=new kd(a),b.set(c,[e])):d>=f.length?(e=new kd(a),f.push(e)):e=f[d],e},dispose:function(){b=new WeakMap}}}let kf=[new al(1,0,0),new al(-1,0,0),new al(0,1,0),new al(0,-1,0),new al(0,0,1),new al(0,0,-1)],kg=[new al(0,-1,0),new al(0,-1,0),new al(0,0,1),new al(0,0,-1),new al(0,-1,0),new al(0,-1,0)],kh=new aJ,ki=new al,kj=new al;function kk(a,b,c){let d=new ds,e=new aj,f=new aj,g=new aC,h=new fB,i=new fC,j={},k=c.maxTextureSize,l={0:1,1:0,2:2},m=new ft({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new aj},radius:{value:4}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}"}),n=m.clone();n.defines.HORIZONTAL_PASS=1;let o=new ce;o.setAttribute("position",new bV(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new cW(o,m),q=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let r=this.type;function s(b,c,d,e){let f=null,g=!0===d.isPointLight?b.customDistanceMaterial:b.customDepthMaterial;if(void 0!==g)f=g;else if(f=!0===d.isPointLight?i:h,a.localClippingEnabled&&!0===c.clipShadows&&Array.isArray(c.clippingPlanes)&&0!==c.clippingPlanes.length||c.displacementMap&&0!==c.displacementScale||c.alphaMap&&c.alphaTest>0||c.map&&c.alphaTest>0||!0===c.alphaToCoverage){let a=f.uuid,b=c.uuid,d=j[a];void 0===d&&(d={},j[a]=d);let e=d[b];void 0===e&&(e=f.clone(),d[b]=e,c.addEventListener("dispose",t)),f=e}return f.visible=c.visible,f.wireframe=c.wireframe,3===e?f.side=null!==c.shadowSide?c.shadowSide:c.side:f.side=null!==c.shadowSide?c.shadowSide:l[c.side],f.alphaMap=c.alphaMap,f.alphaTest=!0===c.alphaToCoverage?.5:c.alphaTest,f.map=c.map,f.clipShadows=c.clipShadows,f.clippingPlanes=c.clippingPlanes,f.clipIntersection=c.clipIntersection,f.displacementMap=c.displacementMap,f.displacementScale=c.displacementScale,f.displacementBias=c.displacementBias,f.wireframeLinewidth=c.wireframeLinewidth,f.linewidth=c.linewidth,!0===d.isPointLight&&!0===f.isMeshDistanceMaterial&&(a.properties.get(f).light=d),f}function t(a){for(let b in a.target.removeEventListener("dispose",t),j){let c=j[b],d=a.target.uuid;d in c&&(c[d].dispose(),delete c[d])}}this.render=function(c,h,i){if(!1===q.enabled||!1===q.autoUpdate&&!1===q.needsUpdate||0===c.length)return;2===this.type&&(U("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=1);let j=a.getRenderTarget(),l=a.getActiveCubeFace(),o=a.getActiveMipmapLevel(),t=a.state;t.setBlending(0),!0===t.buffers.depth.getReversed()?t.buffers.color.setClear(0,0,0,0):t.buffers.color.setClear(1,1,1,1),t.buffers.depth.setTest(!0),t.setScissorTest(!1);let u=r!==this.type;u&&h.traverse(function(a){a.material&&(Array.isArray(a.material)?a.material.forEach(a=>a.needsUpdate=!0):a.material.needsUpdate=!0)});for(let j=0,l=c.length;j<l;j++){let l=c[j],o=l.shadow;if(void 0===o){U("WebGLShadowMap:",l,"has no shadow.");continue}if(!1===o.autoUpdate&&!1===o.needsUpdate)continue;e.copy(o.mapSize);let q=o.getFrameExtents();e.multiply(q),f.copy(o.mapSize),(e.x>k||e.y>k)&&(e.x>k&&(f.x=Math.floor(k/q.x),e.x=f.x*q.x,o.mapSize.x=f.x),e.y>k&&(f.y=Math.floor(k/q.y),e.y=f.y*q.y,o.mapSize.y=f.y));let r=a.state.buffers.depth.getReversed();if(o.camera._reversedDepth=r,null===o.map||!0===u){if(null!==o.map&&(null!==o.map.depthTexture&&(o.map.depthTexture.dispose(),o.map.depthTexture=null),o.map.dispose()),3===this.type){if(l.isPointLight){U("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}o.map=new aE(e.x,e.y,{format:1030,type:1016,minFilter:1006,magFilter:1006,generateMipmaps:!1}),o.map.texture.name=l.name+".shadowMap",o.map.depthTexture=new ee(e.x,e.y,1015),o.map.depthTexture.name=l.name+".shadowMapDepth",o.map.depthTexture.format=1026,o.map.depthTexture.compareFunction=null,o.map.depthTexture.minFilter=1003,o.map.depthTexture.magFilter=1003}else l.isPointLight?(o.map=new iC(e.x),o.map.depthTexture=new ef(e.x,1014)):(o.map=new aE(e.x,e.y),o.map.depthTexture=new ee(e.x,e.y,1014)),o.map.depthTexture.name=l.name+".shadowMap",o.map.depthTexture.format=1026,1===this.type?(o.map.depthTexture.compareFunction=r?518:515,o.map.depthTexture.minFilter=1006,o.map.depthTexture.magFilter=1006):(o.map.depthTexture.compareFunction=null,o.map.depthTexture.minFilter=1003,o.map.depthTexture.magFilter=1003);o.camera.updateProjectionMatrix()}let v=o.map.isWebGLCubeRenderTarget?6:1;for(let c=0;c<v;c++){if(o.map.isWebGLCubeRenderTarget)a.setRenderTarget(o.map,c),a.clear();else{0===c&&(a.setRenderTarget(o.map),a.clear());let b=o.getViewport(c);g.set(f.x*b.x,f.y*b.y,f.x*b.z,f.y*b.w),t.viewport(g)}if(l.isPointLight){let a=o.camera,b=o.matrix,d=l.distance||a.far;d!==a.far&&(a.far=d,a.updateProjectionMatrix()),ki.setFromMatrixPosition(l.matrixWorld),a.position.copy(ki),kj.copy(a.position),kj.add(kf[c]),a.up.copy(kg[c]),a.lookAt(kj),a.updateMatrixWorld(),b.makeTranslation(-ki.x,-ki.y,-ki.z),kh.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),o._frustum.setFromProjectionMatrix(kh,a.coordinateSystem,a.reversedDepth)}else o.updateMatrices(l);d=o.getFrustum(),function c(e,f,g,h,i){if(!1===e.visible)return;if(e.layers.test(f.layers)&&(e.isMesh||e.isLine||e.isPoints)&&(e.castShadow||e.receiveShadow&&3===i)&&(!e.frustumCulled||d.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(g.matrixWorldInverse,e.matrixWorld);let c=b.update(e),d=e.material;if(Array.isArray(d)){let b=c.groups;for(let j=0,k=b.length;j<k;j++){let k=b[j],l=d[k.materialIndex];if(l&&l.visible){let b=s(e,l,h,i);e.onBeforeShadow(a,e,f,g,c,b,k),a.renderBufferDirect(g,null,c,b,e,k),e.onAfterShadow(a,e,f,g,c,b,k)}}}else if(d.visible){let b=s(e,d,h,i);e.onBeforeShadow(a,e,f,g,c,b,null),a.renderBufferDirect(g,null,c,b,e,null),e.onAfterShadow(a,e,f,g,c,b,null)}}let j=e.children;for(let a=0,b=j.length;a<b;a++)c(j[a],f,g,h,i)}(h,i,o.camera,l,this.type)}!0!==o.isPointLightShadow&&3===this.type&&function(c,d){let f=b.update(p);m.defines.VSM_SAMPLES!==c.blurSamples&&(m.defines.VSM_SAMPLES=c.blurSamples,n.defines.VSM_SAMPLES=c.blurSamples,m.needsUpdate=!0,n.needsUpdate=!0),null===c.mapPass&&(c.mapPass=new aE(e.x,e.y,{format:1030,type:1016})),m.uniforms.shadow_pass.value=c.map.depthTexture,m.uniforms.resolution.value=c.mapSize,m.uniforms.radius.value=c.radius,a.setRenderTarget(c.mapPass),a.clear(),a.renderBufferDirect(d,null,f,m,p,null),n.uniforms.shadow_pass.value=c.mapPass.texture,n.uniforms.resolution.value=c.mapSize,n.uniforms.radius.value=c.radius,a.setRenderTarget(c.map),a.clear(),a.renderBufferDirect(d,null,f,n,p,null)}(o,i),o.needsUpdate=!1}r=this.type,q.needsUpdate=!1,a.setRenderTarget(j,l,o)}}function kl(a,b){let c=new function(){let b=!1,c=new aC,d=null,e=new aC(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,d,f,g,h){!0===h&&(b*=g,d*=g,f*=g),c.set(b,d,f,g),!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1,d=null,e.set(-1,0,0,0)}}},d=new function(){let c=!1,d=!1,e=null,f=null,g=null;return{setReversed:function(a){if(d!==a){let c=b.get("EXT_clip_control");a?c.clipControlEXT(c.LOWER_LEFT_EXT,c.ZERO_TO_ONE_EXT):c.clipControlEXT(c.LOWER_LEFT_EXT,c.NEGATIVE_ONE_TO_ONE_EXT),d=a;let e=g;g=null,this.setClear(e)}},getReversed:function(){return d},setTest:function(b){b?N(a.DEPTH_TEST):O(a.DEPTH_TEST)},setMask:function(b){e===b||c||(a.depthMask(b),e=b)},setFunc:function(b){if(d&&(b=Y[b]),f!==b){switch(b){case 0:a.depthFunc(a.NEVER);break;case 1:a.depthFunc(a.ALWAYS);break;case 2:a.depthFunc(a.LESS);break;case 3:default:a.depthFunc(a.LEQUAL);break;case 4:a.depthFunc(a.EQUAL);break;case 5:a.depthFunc(a.GEQUAL);break;case 6:a.depthFunc(a.GREATER);break;case 7:a.depthFunc(a.NOTEQUAL)}f=b}},setLocked:function(a){c=a},setClear:function(b){g!==b&&(g=b,d&&(b=1-b),a.clearDepth(b))},reset:function(){c=!1,e=null,f=null,g=null,d=!1}}},e=new function(){let b=!1,c=null,d=null,e=null,f=null,g=null,h=null,i=null,j=null;return{setTest:function(c){b||(c?N(a.STENCIL_TEST):O(a.STENCIL_TEST))},setMask:function(d){c===d||b||(a.stencilMask(d),c=d)},setFunc:function(b,c,g){(d!==b||e!==c||f!==g)&&(a.stencilFunc(b,c,g),d=b,e=c,f=g)},setOp:function(b,c,d){(g!==b||h!==c||i!==d)&&(a.stencilOp(b,c,d),g=b,h=c,i=d)},setLocked:function(a){b=a},setClear:function(b){j!==b&&(a.clearStencil(b),j=b)},reset:function(){b=!1,c=null,d=null,e=null,f=null,g=null,h=null,i=null,j=null}}},f=new WeakMap,g=new WeakMap,h={},i={},j=new WeakMap,k=[],l=null,m=!1,n=null,o=null,p=null,q=null,r=null,s=null,t=null,u=new bg(0,0,0),v=0,w=!1,x=null,y=null,z=null,A=null,B=null,C=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS),D=!1,E=a.getParameter(a.VERSION);-1!==E.indexOf("WebGL")?D=parseFloat(/^WebGL (\d)/.exec(E)[1])>=1:-1!==E.indexOf("OpenGL ES")&&(D=parseFloat(/^OpenGL ES (\d)/.exec(E)[1])>=2);let F=null,G={},H=a.getParameter(a.SCISSOR_BOX),I=a.getParameter(a.VIEWPORT),J=new aC().fromArray(H),K=new aC().fromArray(I);function L(b,c,d,e){let f=new Uint8Array(4),g=a.createTexture();a.bindTexture(b,g),a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(let g=0;g<d;g++)b===a.TEXTURE_3D||b===a.TEXTURE_2D_ARRAY?a.texImage3D(c,0,a.RGBA,1,1,e,0,a.RGBA,a.UNSIGNED_BYTE,f):a.texImage2D(c+g,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,f);return g}let M={};function N(b){!0!==h[b]&&(a.enable(b),h[b]=!0)}function O(b){!1!==h[b]&&(a.disable(b),h[b]=!1)}M[a.TEXTURE_2D]=L(a.TEXTURE_2D,a.TEXTURE_2D,1),M[a.TEXTURE_CUBE_MAP]=L(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6),M[a.TEXTURE_2D_ARRAY]=L(a.TEXTURE_2D_ARRAY,a.TEXTURE_2D_ARRAY,1,1),M[a.TEXTURE_3D]=L(a.TEXTURE_3D,a.TEXTURE_3D,1,1),c.setClear(0,0,0,1),d.setClear(1),e.setClear(0),N(a.DEPTH_TEST),d.setFunc(3),S(!1),T(1),N(a.CULL_FACE),R(0);let P={100:a.FUNC_ADD,101:a.FUNC_SUBTRACT,102:a.FUNC_REVERSE_SUBTRACT};P[103]=a.MIN,P[104]=a.MAX;let Q={200:a.ZERO,201:a.ONE,202:a.SRC_COLOR,204:a.SRC_ALPHA,210:a.SRC_ALPHA_SATURATE,208:a.DST_COLOR,206:a.DST_ALPHA,203:a.ONE_MINUS_SRC_COLOR,205:a.ONE_MINUS_SRC_ALPHA,209:a.ONE_MINUS_DST_COLOR,207:a.ONE_MINUS_DST_ALPHA,211:a.CONSTANT_COLOR,212:a.ONE_MINUS_CONSTANT_COLOR,213:a.CONSTANT_ALPHA,214:a.ONE_MINUS_CONSTANT_ALPHA};function R(b,c,d,e,f,g,h,i,j,k){if(0===b){!0===m&&(O(a.BLEND),m=!1);return}if(!1===m&&(N(a.BLEND),m=!0),5!==b){if(b!==n||k!==w){if((100!==o||100!==r)&&(a.blendEquation(a.FUNC_ADD),o=100,r=100),k)switch(b){case 1:a.blendFuncSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA);break;case 2:a.blendFunc(a.ONE,a.ONE);break;case 3:a.blendFuncSeparate(a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ZERO,a.ONE);break;case 4:a.blendFuncSeparate(a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA,a.ZERO,a.ONE);break;default:V("WebGLState: Invalid blending: ",b)}else switch(b){case 1:a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA);break;case 2:a.blendFuncSeparate(a.SRC_ALPHA,a.ONE,a.ONE,a.ONE);break;case 3:V("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case 4:V("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:V("WebGLState: Invalid blending: ",b)}p=null,q=null,s=null,t=null,u.set(0,0,0),v=0,n=b,w=k}return}f=f||c,g=g||d,h=h||e,(c!==o||f!==r)&&(a.blendEquationSeparate(P[c],P[f]),o=c,r=f),(d!==p||e!==q||g!==s||h!==t)&&(a.blendFuncSeparate(Q[d],Q[e],Q[g],Q[h]),p=d,q=e,s=g,t=h),(!1===i.equals(u)||j!==v)&&(a.blendColor(i.r,i.g,i.b,j),u.copy(i),v=j),n=b,w=!1}function S(b){x!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),x=b)}function T(b){0!==b?(N(a.CULL_FACE),b!==y&&(1===b?a.cullFace(a.BACK):2===b?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):O(a.CULL_FACE),y=b}function U(b,c,e){b?(N(a.POLYGON_OFFSET_FILL),(A!==c||B!==e)&&(A=c,B=e,d.getReversed()&&(c=-c),a.polygonOffset(c,e))):O(a.POLYGON_OFFSET_FILL)}return{buffers:{color:c,depth:d,stencil:e},enable:N,disable:O,bindFramebuffer:function(b,c){return i[b]!==c&&(a.bindFramebuffer(b,c),i[b]=c,b===a.DRAW_FRAMEBUFFER&&(i[a.FRAMEBUFFER]=c),b===a.FRAMEBUFFER&&(i[a.DRAW_FRAMEBUFFER]=c),!0)},drawBuffers:function(b,c){let d=k,e=!1;if(b){void 0===(d=j.get(c))&&(d=[],j.set(c,d));let f=b.textures;if(d.length!==f.length||d[0]!==a.COLOR_ATTACHMENT0){for(let b=0,c=f.length;b<c;b++)d[b]=a.COLOR_ATTACHMENT0+b;d.length=f.length,e=!0}}else d[0]!==a.BACK&&(d[0]=a.BACK,e=!0);e&&a.drawBuffers(d)},useProgram:function(b){return l!==b&&(a.useProgram(b),l=b,!0)},setBlending:R,setMaterial:function(b,f){2===b.side?O(a.CULL_FACE):N(a.CULL_FACE);let g=1===b.side;f&&(g=!g),S(g),1===b.blending&&!1===b.transparent?R(0):R(b.blending,b.blendEquation,b.blendSrc,b.blendDst,b.blendEquationAlpha,b.blendSrcAlpha,b.blendDstAlpha,b.blendColor,b.blendAlpha,b.premultipliedAlpha),d.setFunc(b.depthFunc),d.setTest(b.depthTest),d.setMask(b.depthWrite),c.setMask(b.colorWrite);let h=b.stencilWrite;e.setTest(h),h&&(e.setMask(b.stencilWriteMask),e.setFunc(b.stencilFunc,b.stencilRef,b.stencilFuncMask),e.setOp(b.stencilFail,b.stencilZFail,b.stencilZPass)),U(b.polygonOffset,b.polygonOffsetFactor,b.polygonOffsetUnits),!0===b.alphaToCoverage?N(a.SAMPLE_ALPHA_TO_COVERAGE):O(a.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:S,setCullFace:T,setLineWidth:function(b){b!==z&&(D&&a.lineWidth(b),z=b)},setPolygonOffset:U,setScissorTest:function(b){b?N(a.SCISSOR_TEST):O(a.SCISSOR_TEST)},activeTexture:function(b){void 0===b&&(b=a.TEXTURE0+C-1),F!==b&&(a.activeTexture(b),F=b)},bindTexture:function(b,c,d){void 0===d&&(d=null===F?a.TEXTURE0+C-1:F);let e=G[d];void 0===e&&(e={type:void 0,texture:void 0},G[d]=e),(e.type!==b||e.texture!==c)&&(F!==d&&(a.activeTexture(d),F=d),a.bindTexture(b,c||M[b]),e.type=b,e.texture=c)},unbindTexture:function(){let b=G[F];void 0!==b&&void 0!==b.type&&(a.bindTexture(b.type,null),b.type=void 0,b.texture=void 0)},compressedTexImage2D:function(){try{a.compressedTexImage2D(...arguments)}catch(a){V("WebGLState:",a)}},compressedTexImage3D:function(){try{a.compressedTexImage3D(...arguments)}catch(a){V("WebGLState:",a)}},texImage2D:function(){try{a.texImage2D(...arguments)}catch(a){V("WebGLState:",a)}},texImage3D:function(){try{a.texImage3D(...arguments)}catch(a){V("WebGLState:",a)}},updateUBOMapping:function(b,c){let d=g.get(c);void 0===d&&(d=new WeakMap,g.set(c,d));let e=d.get(b);void 0===e&&(e=a.getUniformBlockIndex(c,b.name),d.set(b,e))},uniformBlockBinding:function(b,c){let d=g.get(c).get(b);f.get(c)!==d&&(a.uniformBlockBinding(c,d,b.__bindingPointIndex),f.set(c,d))},texStorage2D:function(){try{a.texStorage2D(...arguments)}catch(a){V("WebGLState:",a)}},texStorage3D:function(){try{a.texStorage3D(...arguments)}catch(a){V("WebGLState:",a)}},texSubImage2D:function(){try{a.texSubImage2D(...arguments)}catch(a){V("WebGLState:",a)}},texSubImage3D:function(){try{a.texSubImage3D(...arguments)}catch(a){V("WebGLState:",a)}},compressedTexSubImage2D:function(){try{a.compressedTexSubImage2D(...arguments)}catch(a){V("WebGLState:",a)}},compressedTexSubImage3D:function(){try{a.compressedTexSubImage3D(...arguments)}catch(a){V("WebGLState:",a)}},scissor:function(b){!1===J.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),J.copy(b))},viewport:function(b){!1===K.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),K.copy(b))},reset:function(){a.disable(a.BLEND),a.disable(a.CULL_FACE),a.disable(a.DEPTH_TEST),a.disable(a.POLYGON_OFFSET_FILL),a.disable(a.SCISSOR_TEST),a.disable(a.STENCIL_TEST),a.disable(a.SAMPLE_ALPHA_TO_COVERAGE),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ONE,a.ZERO),a.blendFuncSeparate(a.ONE,a.ZERO,a.ONE,a.ZERO),a.blendColor(0,0,0,0),a.colorMask(!0,!0,!0,!0),a.clearColor(0,0,0,0),a.depthMask(!0),a.depthFunc(a.LESS),d.setReversed(!1),a.clearDepth(1),a.stencilMask(0xffffffff),a.stencilFunc(a.ALWAYS,0,0xffffffff),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),a.clearStencil(0),a.cullFace(a.BACK),a.frontFace(a.CCW),a.polygonOffset(0,0),a.activeTexture(a.TEXTURE0),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,null),a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.useProgram(null),a.lineWidth(1),a.scissor(0,0,a.canvas.width,a.canvas.height),a.viewport(0,0,a.canvas.width,a.canvas.height),h={},F=null,G={},i={},j=new WeakMap,k=[],l=null,m=!1,n=null,o=null,p=null,q=null,r=null,s=null,t=null,u=new bg(0,0,0),v=0,w=!1,x=null,y=null,z=null,A=null,B=null,J.set(0,0,a.canvas.width,a.canvas.height),K.set(0,0,a.canvas.width,a.canvas.height),c.reset(),d.reset(),e.reset()}}}function km(a,b,c,d,e,f,g){let h,i=b.has("WEBGL_multisampled_render_to_texture")?b.get("WEBGL_multisampled_render_to_texture"):null,j="u">typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),k=new aj,l=new WeakMap,m=new WeakMap,n=!1;try{n="u">typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(a){}function o(a,b){return n?new OffscreenCanvas(a,b):M("canvas")}function p(a,b,c){let d=1,e=W(a);if((e.width>c||e.height>c)&&(d=c/Math.max(e.width,e.height)),d<1)if("u">typeof HTMLImageElement&&a instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&a instanceof ImageBitmap||"u">typeof VideoFrame&&a instanceof VideoFrame){let c=Math.floor(d*e.width),f=Math.floor(d*e.height);void 0===h&&(h=o(c,f));let g=b?o(c,f):h;return g.width=c,g.height=f,g.getContext("2d").drawImage(a,0,0,c,f),U("WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+c+"x"+f+")."),g}else"data"in a&&U("WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+").");return a}function q(a){return a.generateMipmaps}function r(b){a.generateMipmap(b)}function s(c,d,e,f,g=!1){if(null!==c){if(void 0!==a[c])return a[c];U("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+c+"'")}let h=d;if(d===a.RED&&(e===a.FLOAT&&(h=a.R32F),e===a.HALF_FLOAT&&(h=a.R16F),e===a.UNSIGNED_BYTE&&(h=a.R8)),d===a.RED_INTEGER&&(e===a.UNSIGNED_BYTE&&(h=a.R8UI),e===a.UNSIGNED_SHORT&&(h=a.R16UI),e===a.UNSIGNED_INT&&(h=a.R32UI),e===a.BYTE&&(h=a.R8I),e===a.SHORT&&(h=a.R16I),e===a.INT&&(h=a.R32I)),d===a.RG&&(e===a.FLOAT&&(h=a.RG32F),e===a.HALF_FLOAT&&(h=a.RG16F),e===a.UNSIGNED_BYTE&&(h=a.RG8)),d===a.RG_INTEGER&&(e===a.UNSIGNED_BYTE&&(h=a.RG8UI),e===a.UNSIGNED_SHORT&&(h=a.RG16UI),e===a.UNSIGNED_INT&&(h=a.RG32UI),e===a.BYTE&&(h=a.RG8I),e===a.SHORT&&(h=a.RG16I),e===a.INT&&(h=a.RG32I)),d===a.RGB_INTEGER&&(e===a.UNSIGNED_BYTE&&(h=a.RGB8UI),e===a.UNSIGNED_SHORT&&(h=a.RGB16UI),e===a.UNSIGNED_INT&&(h=a.RGB32UI),e===a.BYTE&&(h=a.RGB8I),e===a.SHORT&&(h=a.RGB16I),e===a.INT&&(h=a.RGB32I)),d===a.RGBA_INTEGER&&(e===a.UNSIGNED_BYTE&&(h=a.RGBA8UI),e===a.UNSIGNED_SHORT&&(h=a.RGBA16UI),e===a.UNSIGNED_INT&&(h=a.RGBA32UI),e===a.BYTE&&(h=a.RGBA8I),e===a.SHORT&&(h=a.RGBA16I),e===a.INT&&(h=a.RGBA32I)),d===a.RGB&&(e===a.UNSIGNED_INT_5_9_9_9_REV&&(h=a.RGB9_E5),e===a.UNSIGNED_INT_10F_11F_11F_REV&&(h=a.R11F_G11F_B10F)),d===a.RGBA){let b=g?C:as.getTransfer(f);e===a.FLOAT&&(h=a.RGBA32F),e===a.HALF_FLOAT&&(h=a.RGBA16F),e===a.UNSIGNED_BYTE&&(h=b===D?a.SRGB8_ALPHA8:a.RGBA8),e===a.UNSIGNED_SHORT_4_4_4_4&&(h=a.RGBA4),e===a.UNSIGNED_SHORT_5_5_5_1&&(h=a.RGB5_A1)}return(h===a.R16F||h===a.R32F||h===a.RG16F||h===a.RG32F||h===a.RGBA16F||h===a.RGBA32F)&&b.get("EXT_color_buffer_float"),h}function t(b,c){let d;return b?null===c||1014===c||1020===c?d=a.DEPTH24_STENCIL8:1015===c?d=a.DEPTH32F_STENCIL8:1012===c&&(d=a.DEPTH24_STENCIL8,U("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===c||1014===c||1020===c?d=a.DEPTH_COMPONENT24:1015===c?d=a.DEPTH_COMPONENT32F:1012===c&&(d=a.DEPTH_COMPONENT16),d}function u(a,b){return!0===q(a)||a.isFramebufferTexture&&1003!==a.minFilter&&1006!==a.minFilter?Math.log2(Math.max(b.width,b.height))+1:void 0!==a.mipmaps&&a.mipmaps.length>0?a.mipmaps.length:a.isCompressedTexture&&Array.isArray(a.image)?b.mipmaps.length:1}function v(a){let b=a.target;b.removeEventListener("dispose",v),function(a){let b=d.get(a);if(void 0===b.__webglInit)return;let c=a.source,e=m.get(c);if(e){let d=e[b.__cacheKey];d.usedTimes--,0===d.usedTimes&&x(a),0===Object.keys(e).length&&m.delete(c)}d.remove(a)}(b),b.isVideoTexture&&l.delete(b)}function w(b){let c=b.target;c.removeEventListener("dispose",w),function(b){let c=d.get(b);if(b.depthTexture&&(b.depthTexture.dispose(),d.remove(b.depthTexture)),b.isWebGLCubeRenderTarget)for(let b=0;b<6;b++){if(Array.isArray(c.__webglFramebuffer[b]))for(let d=0;d<c.__webglFramebuffer[b].length;d++)a.deleteFramebuffer(c.__webglFramebuffer[b][d]);else a.deleteFramebuffer(c.__webglFramebuffer[b]);c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[b])}else{if(Array.isArray(c.__webglFramebuffer))for(let b=0;b<c.__webglFramebuffer.length;b++)a.deleteFramebuffer(c.__webglFramebuffer[b]);else a.deleteFramebuffer(c.__webglFramebuffer);if(c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer),c.__webglMultisampledFramebuffer&&a.deleteFramebuffer(c.__webglMultisampledFramebuffer),c.__webglColorRenderbuffer)for(let b=0;b<c.__webglColorRenderbuffer.length;b++)c.__webglColorRenderbuffer[b]&&a.deleteRenderbuffer(c.__webglColorRenderbuffer[b]);c.__webglDepthRenderbuffer&&a.deleteRenderbuffer(c.__webglDepthRenderbuffer)}let e=b.textures;for(let b=0,c=e.length;b<c;b++){let c=d.get(e[b]);c.__webglTexture&&(a.deleteTexture(c.__webglTexture),g.memory.textures--),d.remove(e[b])}d.remove(b)}(c)}function x(b){let c=d.get(b);a.deleteTexture(c.__webglTexture);let e=b.source,f=m.get(e);delete f[c.__cacheKey],g.memory.textures--}let y=0;function z(b,e){var f;let h,i=d.get(b);if(b.isVideoTexture&&(f=b,h=g.render.frame,l.get(f)!==h&&(l.set(f,h),f.update())),!1===b.isRenderTargetTexture&&!0!==b.isExternalTexture&&b.version>0&&i.__version!==b.version){let a=b.image;if(null===a)U("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==a.complete)return void J(i,b,e);U("WebGLRenderer: Texture marked for update but image is incomplete")}}else b.isExternalTexture&&(i.__webglTexture=b.sourceTexture?b.sourceTexture:null);c.bindTexture(a.TEXTURE_2D,i.__webglTexture,a.TEXTURE0+e)}let A={1e3:a.REPEAT,1001:a.CLAMP_TO_EDGE,1002:a.MIRRORED_REPEAT},E={1003:a.NEAREST,1004:a.NEAREST_MIPMAP_NEAREST,1005:a.NEAREST_MIPMAP_LINEAR,1006:a.LINEAR,1007:a.LINEAR_MIPMAP_NEAREST,1008:a.LINEAR_MIPMAP_LINEAR},F={512:a.NEVER,519:a.ALWAYS,513:a.LESS,515:a.LEQUAL,514:a.EQUAL,518:a.GEQUAL,516:a.GREATER,517:a.NOTEQUAL};function G(c,f){if((1015===f.type&&!1===b.has("OES_texture_float_linear")&&(1006===f.magFilter||1007===f.magFilter||1005===f.magFilter||1008===f.magFilter||1006===f.minFilter||1007===f.minFilter||1005===f.minFilter||1008===f.minFilter)&&U("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),a.texParameteri(c,a.TEXTURE_WRAP_S,A[f.wrapS]),a.texParameteri(c,a.TEXTURE_WRAP_T,A[f.wrapT]),(c===a.TEXTURE_3D||c===a.TEXTURE_2D_ARRAY)&&a.texParameteri(c,a.TEXTURE_WRAP_R,A[f.wrapR]),a.texParameteri(c,a.TEXTURE_MAG_FILTER,E[f.magFilter]),a.texParameteri(c,a.TEXTURE_MIN_FILTER,E[f.minFilter]),f.compareFunction&&(a.texParameteri(c,a.TEXTURE_COMPARE_MODE,a.COMPARE_REF_TO_TEXTURE),a.texParameteri(c,a.TEXTURE_COMPARE_FUNC,F[f.compareFunction])),!0===b.has("EXT_texture_filter_anisotropic"))&&1003!==f.magFilter&&(1005===f.minFilter||1008===f.minFilter)&&(1015!==f.type||!1!==b.has("OES_texture_float_linear"))&&(f.anisotropy>1||d.get(f).__currentAnisotropy)){let g=b.get("EXT_texture_filter_anisotropic");a.texParameterf(c,g.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(f.anisotropy,e.getMaxAnisotropy())),d.get(f).__currentAnisotropy=f.anisotropy}}function H(b,c){let d,e=!1;void 0===b.__webglInit&&(b.__webglInit=!0,c.addEventListener("dispose",v));let f=c.source,h=m.get(f);void 0===h&&(h={},m.set(f,h));let i=((d=[]).push(c.wrapS),d.push(c.wrapT),d.push(c.wrapR||0),d.push(c.magFilter),d.push(c.minFilter),d.push(c.anisotropy),d.push(c.internalFormat),d.push(c.format),d.push(c.type),d.push(c.generateMipmaps),d.push(c.premultiplyAlpha),d.push(c.flipY),d.push(c.unpackAlignment),d.push(c.colorSpace),d.join());if(i!==b.__cacheKey){void 0===h[i]&&(h[i]={texture:a.createTexture(),usedTimes:0},g.memory.textures++,e=!0),h[i].usedTimes++;let d=h[b.__cacheKey];void 0!==d&&(h[b.__cacheKey].usedTimes--,0===d.usedTimes&&x(c)),b.__cacheKey=i,b.__webglTexture=h[i].texture}return e}function I(a,b,c){return Math.floor(Math.floor(a/c)/b)}function J(b,g,h){let i=a.TEXTURE_2D;(g.isDataArrayTexture||g.isCompressedArrayTexture)&&(i=a.TEXTURE_2D_ARRAY),g.isData3DTexture&&(i=a.TEXTURE_3D);let j=H(b,g),k=g.source;c.bindTexture(i,b.__webglTexture,a.TEXTURE0+h);let l=d.get(k);if(k.version!==l.__version||!0===j){let b;c.activeTexture(a.TEXTURE0+h);let d=as.getPrimaries(as.workingColorSpace),m=""===g.colorSpace?null:as.getPrimaries(g.colorSpace),n=""===g.colorSpace||d===m?a.NONE:a.BROWSER_DEFAULT_WEBGL;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,g.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,g.unpackAlignment),a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,n);let o=p(g.image,!1,e.maxTextureSize);o=T(g,o);let v=f.convert(g.format,g.colorSpace),w=f.convert(g.type),x=s(g.internalFormat,v,w,g.colorSpace,g.isVideoTexture);G(i,g);let y=g.mipmaps,z=!0!==g.isVideoTexture,A=void 0===l.__version||!0===j,B=k.dataReady,C=u(g,o);if(g.isDepthTexture)x=t(1027===g.format,g.type),A&&(z?c.texStorage2D(a.TEXTURE_2D,1,x,o.width,o.height):c.texImage2D(a.TEXTURE_2D,0,x,o.width,o.height,0,v,w,null));else if(g.isDataTexture)if(y.length>0){z&&A&&c.texStorage2D(a.TEXTURE_2D,C,x,y[0].width,y[0].height);for(let d=0,e=y.length;d<e;d++)b=y[d],z?B&&c.texSubImage2D(a.TEXTURE_2D,d,0,0,b.width,b.height,v,w,b.data):c.texImage2D(a.TEXTURE_2D,d,x,b.width,b.height,0,v,w,b.data);g.generateMipmaps=!1}else z?(A&&c.texStorage2D(a.TEXTURE_2D,C,x,o.width,o.height),B&&function(b,d,e,f){let g=b.updateRanges;if(0===g.length)c.texSubImage2D(a.TEXTURE_2D,0,0,0,d.width,d.height,e,f,d.data);else{g.sort((a,b)=>a.start-b.start);let h=0;for(let a=1;a<g.length;a++){let b=g[h],c=g[a],e=b.start+b.count,f=I(c.start,d.width,4),i=I(b.start,d.width,4);c.start<=e+1&&f===i&&I(c.start+c.count-1,d.width,4)===f?b.count=Math.max(b.count,c.start+c.count-b.start):g[++h]=c}g.length=h+1;let i=a.getParameter(a.UNPACK_ROW_LENGTH),j=a.getParameter(a.UNPACK_SKIP_PIXELS),k=a.getParameter(a.UNPACK_SKIP_ROWS);a.pixelStorei(a.UNPACK_ROW_LENGTH,d.width);for(let b=0,h=g.length;b<h;b++){let h=g[b],i=Math.floor(h.start/4),j=Math.ceil(h.count/4),k=i%d.width,l=Math.floor(i/d.width);a.pixelStorei(a.UNPACK_SKIP_PIXELS,k),a.pixelStorei(a.UNPACK_SKIP_ROWS,l),c.texSubImage2D(a.TEXTURE_2D,0,k,l,j,1,e,f,d.data)}b.clearUpdateRanges(),a.pixelStorei(a.UNPACK_ROW_LENGTH,i),a.pixelStorei(a.UNPACK_SKIP_PIXELS,j),a.pixelStorei(a.UNPACK_SKIP_ROWS,k)}}(g,o,v,w)):c.texImage2D(a.TEXTURE_2D,0,x,o.width,o.height,0,v,w,o.data);else if(g.isCompressedTexture)if(g.isCompressedArrayTexture){z&&A&&c.texStorage3D(a.TEXTURE_2D_ARRAY,C,x,y[0].width,y[0].height,o.depth);for(let d=0,e=y.length;d<e;d++)if(b=y[d],1023!==g.format)if(null!==v)if(z){if(B)if(g.layerUpdates.size>0){let e=h7(b.width,b.height,g.format,g.type);for(let f of g.layerUpdates){let g=b.data.subarray(f*e/b.data.BYTES_PER_ELEMENT,(f+1)*e/b.data.BYTES_PER_ELEMENT);c.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,d,0,0,f,b.width,b.height,1,v,g)}g.clearLayerUpdates()}else c.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,d,0,0,0,b.width,b.height,o.depth,v,b.data)}else c.compressedTexImage3D(a.TEXTURE_2D_ARRAY,d,x,b.width,b.height,o.depth,0,b.data,0,0);else U("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else z?B&&c.texSubImage3D(a.TEXTURE_2D_ARRAY,d,0,0,0,b.width,b.height,o.depth,v,w,b.data):c.texImage3D(a.TEXTURE_2D_ARRAY,d,x,b.width,b.height,o.depth,0,v,w,b.data)}else{z&&A&&c.texStorage2D(a.TEXTURE_2D,C,x,y[0].width,y[0].height);for(let d=0,e=y.length;d<e;d++)b=y[d],1023!==g.format?null!==v?z?B&&c.compressedTexSubImage2D(a.TEXTURE_2D,d,0,0,b.width,b.height,v,b.data):c.compressedTexImage2D(a.TEXTURE_2D,d,x,b.width,b.height,0,b.data):U("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):z?B&&c.texSubImage2D(a.TEXTURE_2D,d,0,0,b.width,b.height,v,w,b.data):c.texImage2D(a.TEXTURE_2D,d,x,b.width,b.height,0,v,w,b.data)}else if(g.isDataArrayTexture)if(z){if(A&&c.texStorage3D(a.TEXTURE_2D_ARRAY,C,x,o.width,o.height,o.depth),B)if(g.layerUpdates.size>0){let b=h7(o.width,o.height,g.format,g.type);for(let d of g.layerUpdates){let e=o.data.subarray(d*b/o.data.BYTES_PER_ELEMENT,(d+1)*b/o.data.BYTES_PER_ELEMENT);c.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,d,o.width,o.height,1,v,w,e)}g.clearLayerUpdates()}else c.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,0,o.width,o.height,o.depth,v,w,o.data)}else c.texImage3D(a.TEXTURE_2D_ARRAY,0,x,o.width,o.height,o.depth,0,v,w,o.data);else if(g.isData3DTexture)z?(A&&c.texStorage3D(a.TEXTURE_3D,C,x,o.width,o.height,o.depth),B&&c.texSubImage3D(a.TEXTURE_3D,0,0,0,0,o.width,o.height,o.depth,v,w,o.data)):c.texImage3D(a.TEXTURE_3D,0,x,o.width,o.height,o.depth,0,v,w,o.data);else if(g.isFramebufferTexture){if(A)if(z)c.texStorage2D(a.TEXTURE_2D,C,x,o.width,o.height);else{let b=o.width,d=o.height;for(let e=0;e<C;e++)c.texImage2D(a.TEXTURE_2D,e,x,b,d,0,v,w,null),b>>=1,d>>=1}}else if(y.length>0){if(z&&A){let b=W(y[0]);c.texStorage2D(a.TEXTURE_2D,C,x,b.width,b.height)}for(let d=0,e=y.length;d<e;d++)b=y[d],z?B&&c.texSubImage2D(a.TEXTURE_2D,d,0,0,v,w,b):c.texImage2D(a.TEXTURE_2D,d,x,v,w,b);g.generateMipmaps=!1}else if(z){if(A){let b=W(o);c.texStorage2D(a.TEXTURE_2D,C,x,b.width,b.height)}B&&c.texSubImage2D(a.TEXTURE_2D,0,0,0,v,w,o)}else c.texImage2D(a.TEXTURE_2D,0,x,v,w,o);q(g)&&r(i),l.__version=k.version,g.onUpdate&&g.onUpdate(g)}b.__version=g.version}function K(b,e,g,h,j,k){let l=f.convert(g.format,g.colorSpace),m=f.convert(g.type),n=s(g.internalFormat,l,m,g.colorSpace),o=d.get(e),p=d.get(g);if(p.__renderTarget=e,!o.__hasExternalTextures){let b=Math.max(1,e.width>>k),d=Math.max(1,e.height>>k);j===a.TEXTURE_3D||j===a.TEXTURE_2D_ARRAY?c.texImage3D(j,k,n,b,d,e.depth,0,l,m,null):c.texImage2D(j,k,n,b,d,0,l,m,null)}c.bindFramebuffer(a.FRAMEBUFFER,b),S(e)?i.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,h,j,p.__webglTexture,0,R(e)):(j===a.TEXTURE_2D||j>=a.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&a.framebufferTexture2D(a.FRAMEBUFFER,h,j,p.__webglTexture,k),c.bindFramebuffer(a.FRAMEBUFFER,null)}function L(b,c,d){if(a.bindRenderbuffer(a.RENDERBUFFER,b),c.depthBuffer){let e=c.depthTexture,f=e&&e.isDepthTexture?e.type:null,g=t(c.stencilBuffer,f),h=c.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;S(c)?i.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,R(c),g,c.width,c.height):d?a.renderbufferStorageMultisample(a.RENDERBUFFER,R(c),g,c.width,c.height):a.renderbufferStorage(a.RENDERBUFFER,g,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,h,a.RENDERBUFFER,b)}else{let b=c.textures;for(let e=0;e<b.length;e++){let g=b[e],h=f.convert(g.format,g.colorSpace),j=f.convert(g.type),k=s(g.internalFormat,h,j,g.colorSpace);S(c)?i.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,R(c),k,c.width,c.height):d?a.renderbufferStorageMultisample(a.RENDERBUFFER,R(c),k,c.width,c.height):a.renderbufferStorage(a.RENDERBUFFER,k,c.width,c.height)}}a.bindRenderbuffer(a.RENDERBUFFER,null)}function N(b,e,g){let h=!0===e.isWebGLCubeRenderTarget;if(c.bindFramebuffer(a.FRAMEBUFFER,b),!(e.depthTexture&&e.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let j=d.get(e.depthTexture);if(j.__renderTarget=e,j.__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),h){if(void 0===j.__webglInit&&(j.__webglInit=!0,e.depthTexture.addEventListener("dispose",v)),void 0===j.__webglTexture){let b;j.__webglTexture=a.createTexture(),c.bindTexture(a.TEXTURE_CUBE_MAP,j.__webglTexture),G(a.TEXTURE_CUBE_MAP,e.depthTexture);let d=f.convert(e.depthTexture.format),g=f.convert(e.depthTexture.type);1026===e.depthTexture.format?b=a.DEPTH_COMPONENT24:1027===e.depthTexture.format&&(b=a.DEPTH24_STENCIL8);for(let c=0;c<6;c++)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,b,e.width,e.height,0,d,g,null)}}else z(e.depthTexture,0);let k=j.__webglTexture,l=R(e),m=h?a.TEXTURE_CUBE_MAP_POSITIVE_X+g:a.TEXTURE_2D,n=1027===e.depthTexture.format?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;if(1026===e.depthTexture.format)S(e)?i.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,n,m,k,0,l):a.framebufferTexture2D(a.FRAMEBUFFER,n,m,k,0);else if(1027===e.depthTexture.format)S(e)?i.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,n,m,k,0,l):a.framebufferTexture2D(a.FRAMEBUFFER,n,m,k,0);else throw Error("Unknown depthTexture format")}function O(b){let e=d.get(b),f=!0===b.isWebGLCubeRenderTarget;if(e.__boundDepthTexture!==b.depthTexture){let a=b.depthTexture;if(e.__depthDisposeCallback&&e.__depthDisposeCallback(),a){let b=()=>{delete e.__boundDepthTexture,delete e.__depthDisposeCallback,a.removeEventListener("dispose",b)};a.addEventListener("dispose",b),e.__depthDisposeCallback=b}e.__boundDepthTexture=a}if(b.depthTexture&&!e.__autoAllocateDepthBuffer)if(f)for(let a=0;a<6;a++)N(e.__webglFramebuffer[a],b,a);else{let a=b.texture.mipmaps;a&&a.length>0?N(e.__webglFramebuffer[0],b,0):N(e.__webglFramebuffer,b,0)}else if(f){e.__webglDepthbuffer=[];for(let d=0;d<6;d++)if(c.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[d]),void 0===e.__webglDepthbuffer[d])e.__webglDepthbuffer[d]=a.createRenderbuffer(),L(e.__webglDepthbuffer[d],b,!1);else{let c=b.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,f=e.__webglDepthbuffer[d];a.bindRenderbuffer(a.RENDERBUFFER,f),a.framebufferRenderbuffer(a.FRAMEBUFFER,c,a.RENDERBUFFER,f)}}else{let d=b.texture.mipmaps;if(d&&d.length>0?c.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[0]):c.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),void 0===e.__webglDepthbuffer)e.__webglDepthbuffer=a.createRenderbuffer(),L(e.__webglDepthbuffer,b,!1);else{let c=b.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,d=e.__webglDepthbuffer;a.bindRenderbuffer(a.RENDERBUFFER,d),a.framebufferRenderbuffer(a.FRAMEBUFFER,c,a.RENDERBUFFER,d)}}c.bindFramebuffer(a.FRAMEBUFFER,null)}let P=[],Q=[];function R(a){return Math.min(e.maxSamples,a.samples)}function S(a){let c=d.get(a);return a.samples>0&&!0===b.has("WEBGL_multisampled_render_to_texture")&&!1!==c.__useRenderToTexture}function T(a,b){let c=a.colorSpace,d=a.format,e=a.type;return!0===a.isCompressedTexture||!0===a.isVideoTexture||c!==B&&""!==c&&(as.getTransfer(c)===D?(1023!==d||1009!==e)&&U("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):V("WebGLTextures: Unsupported texture color space:",c)),b}function W(a){return"u">typeof HTMLImageElement&&a instanceof HTMLImageElement?(k.width=a.naturalWidth||a.width,k.height=a.naturalHeight||a.height):"u">typeof VideoFrame&&a instanceof VideoFrame?(k.width=a.displayWidth,k.height=a.displayHeight):(k.width=a.width,k.height=a.height),k}this.allocateTextureUnit=function(){let a=y;return a>=e.maxTextures&&U("WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+e.maxTextures),y+=1,a},this.resetTextureUnits=function(){y=0},this.setTexture2D=z,this.setTexture2DArray=function(b,e){let f=d.get(b);!1===b.isRenderTargetTexture&&b.version>0&&f.__version!==b.version?J(f,b,e):(b.isExternalTexture&&(f.__webglTexture=b.sourceTexture?b.sourceTexture:null),c.bindTexture(a.TEXTURE_2D_ARRAY,f.__webglTexture,a.TEXTURE0+e))},this.setTexture3D=function(b,e){let f=d.get(b);!1===b.isRenderTargetTexture&&b.version>0&&f.__version!==b.version?J(f,b,e):c.bindTexture(a.TEXTURE_3D,f.__webglTexture,a.TEXTURE0+e)},this.setTextureCube=function(b,g){let h=d.get(b);!0!==b.isCubeDepthTexture&&b.version>0&&h.__version!==b.version?function(b,g,h){if(6!==g.image.length)return;let i=H(b,g),j=g.source;c.bindTexture(a.TEXTURE_CUBE_MAP,b.__webglTexture,a.TEXTURE0+h);let k=d.get(j);if(j.version!==k.__version||!0===i){let b;c.activeTexture(a.TEXTURE0+h);let d=as.getPrimaries(as.workingColorSpace),l=""===g.colorSpace?null:as.getPrimaries(g.colorSpace),m=""===g.colorSpace||d===l?a.NONE:a.BROWSER_DEFAULT_WEBGL;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,g.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,g.unpackAlignment),a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,m);let n=g.isCompressedTexture||g.image[0].isCompressedTexture,o=g.image[0]&&g.image[0].isDataTexture,t=[];for(let a=0;a<6;a++)n||o?t[a]=o?g.image[a].image:g.image[a]:t[a]=p(g.image[a],!0,e.maxCubemapSize),t[a]=T(g,t[a]);let v=t[0],w=f.convert(g.format,g.colorSpace),x=f.convert(g.type),y=s(g.internalFormat,w,x,g.colorSpace),z=!0!==g.isVideoTexture,A=void 0===k.__version||!0===i,B=j.dataReady,C=u(g,v);if(G(a.TEXTURE_CUBE_MAP,g),n){z&&A&&c.texStorage2D(a.TEXTURE_CUBE_MAP,C,y,v.width,v.height);for(let d=0;d<6;d++){b=t[d].mipmaps;for(let e=0;e<b.length;e++){let f=b[e];1023!==g.format?null!==w?z?B&&c.compressedTexSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e,0,0,f.width,f.height,w,f.data):c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e,y,f.width,f.height,0,f.data):U("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):z?B&&c.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e,0,0,f.width,f.height,w,x,f.data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e,y,f.width,f.height,0,w,x,f.data)}}}else{if(b=g.mipmaps,z&&A){b.length>0&&C++;let d=W(t[0]);c.texStorage2D(a.TEXTURE_CUBE_MAP,C,y,d.width,d.height)}for(let d=0;d<6;d++)if(o){z?B&&c.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,0,0,t[d].width,t[d].height,w,x,t[d].data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,y,t[d].width,t[d].height,0,w,x,t[d].data);for(let e=0;e<b.length;e++){let f=b[e].image[d].image;z?B&&c.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e+1,0,0,f.width,f.height,w,x,f.data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e+1,y,f.width,f.height,0,w,x,f.data)}}else{z?B&&c.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,0,0,w,x,t[d]):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,y,w,x,t[d]);for(let e=0;e<b.length;e++){let f=b[e];z?B&&c.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e+1,0,0,w,x,f.image[d]):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+d,e+1,y,w,x,f.image[d])}}}q(g)&&r(a.TEXTURE_CUBE_MAP),k.__version=j.version,g.onUpdate&&g.onUpdate(g)}b.__version=g.version}(h,b,g):c.bindTexture(a.TEXTURE_CUBE_MAP,h.__webglTexture,a.TEXTURE0+g)},this.rebindTextures=function(b,c,e){let f=d.get(b);void 0!==c&&K(f.__webglFramebuffer,b,b.texture,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,0),void 0!==e&&O(b)},this.setupRenderTarget=function(b){let e=b.texture,h=d.get(b),i=d.get(e);b.addEventListener("dispose",w);let j=b.textures,k=!0===b.isWebGLCubeRenderTarget,l=j.length>1;if(!l&&(void 0===i.__webglTexture&&(i.__webglTexture=a.createTexture()),i.__version=e.version,g.memory.textures++),k){h.__webglFramebuffer=[];for(let b=0;b<6;b++)if(e.mipmaps&&e.mipmaps.length>0){h.__webglFramebuffer[b]=[];for(let c=0;c<e.mipmaps.length;c++)h.__webglFramebuffer[b][c]=a.createFramebuffer()}else h.__webglFramebuffer[b]=a.createFramebuffer()}else{if(e.mipmaps&&e.mipmaps.length>0){h.__webglFramebuffer=[];for(let b=0;b<e.mipmaps.length;b++)h.__webglFramebuffer[b]=a.createFramebuffer()}else h.__webglFramebuffer=a.createFramebuffer();if(l)for(let b=0,c=j.length;b<c;b++){let c=d.get(j[b]);void 0===c.__webglTexture&&(c.__webglTexture=a.createTexture(),g.memory.textures++)}if(b.samples>0&&!1===S(b)){h.__webglMultisampledFramebuffer=a.createFramebuffer(),h.__webglColorRenderbuffer=[],c.bindFramebuffer(a.FRAMEBUFFER,h.__webglMultisampledFramebuffer);for(let c=0;c<j.length;c++){let d=j[c];h.__webglColorRenderbuffer[c]=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,h.__webglColorRenderbuffer[c]);let e=f.convert(d.format,d.colorSpace),g=f.convert(d.type),i=s(d.internalFormat,e,g,d.colorSpace,!0===b.isXRRenderTarget),k=R(b);a.renderbufferStorageMultisample(a.RENDERBUFFER,k,i,b.width,b.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+c,a.RENDERBUFFER,h.__webglColorRenderbuffer[c])}a.bindRenderbuffer(a.RENDERBUFFER,null),b.depthBuffer&&(h.__webglDepthRenderbuffer=a.createRenderbuffer(),L(h.__webglDepthRenderbuffer,b,!0)),c.bindFramebuffer(a.FRAMEBUFFER,null)}}if(k){c.bindTexture(a.TEXTURE_CUBE_MAP,i.__webglTexture),G(a.TEXTURE_CUBE_MAP,e);for(let c=0;c<6;c++)if(e.mipmaps&&e.mipmaps.length>0)for(let d=0;d<e.mipmaps.length;d++)K(h.__webglFramebuffer[c][d],b,e,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+c,d);else K(h.__webglFramebuffer[c],b,e,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+c,0);q(e)&&r(a.TEXTURE_CUBE_MAP),c.unbindTexture()}else if(l){for(let e=0,f=j.length;e<f;e++){let f=j[e],g=d.get(f),i=a.TEXTURE_2D;(b.isWebGL3DRenderTarget||b.isWebGLArrayRenderTarget)&&(i=b.isWebGL3DRenderTarget?a.TEXTURE_3D:a.TEXTURE_2D_ARRAY),c.bindTexture(i,g.__webglTexture),G(i,f),K(h.__webglFramebuffer,b,f,a.COLOR_ATTACHMENT0+e,i,0),q(f)&&r(i)}c.unbindTexture()}else{let d=a.TEXTURE_2D;if((b.isWebGL3DRenderTarget||b.isWebGLArrayRenderTarget)&&(d=b.isWebGL3DRenderTarget?a.TEXTURE_3D:a.TEXTURE_2D_ARRAY),c.bindTexture(d,i.__webglTexture),G(d,e),e.mipmaps&&e.mipmaps.length>0)for(let c=0;c<e.mipmaps.length;c++)K(h.__webglFramebuffer[c],b,e,a.COLOR_ATTACHMENT0,d,c);else K(h.__webglFramebuffer,b,e,a.COLOR_ATTACHMENT0,d,0);q(e)&&r(d),c.unbindTexture()}b.depthBuffer&&O(b)},this.updateRenderTargetMipmap=function(b){let e=b.textures;for(let f=0,g=e.length;f<g;f++){let g=e[f];if(q(g)){let e=b.isWebGLCubeRenderTarget?a.TEXTURE_CUBE_MAP:b.isWebGL3DRenderTarget?a.TEXTURE_3D:b.isWebGLArrayRenderTarget||b.isCompressedArrayTexture?a.TEXTURE_2D_ARRAY:a.TEXTURE_2D,f=d.get(g).__webglTexture;c.bindTexture(e,f),r(e),c.unbindTexture()}}},this.updateMultisampleRenderTarget=function(b){if(b.samples>0){if(!1===S(b)){let e=b.textures,f=b.width,g=b.height,h=a.COLOR_BUFFER_BIT,i=b.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,k=d.get(b),l=e.length>1;if(l)for(let b=0;b<e.length;b++)c.bindFramebuffer(a.FRAMEBUFFER,k.__webglMultisampledFramebuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+b,a.RENDERBUFFER,null),c.bindFramebuffer(a.FRAMEBUFFER,k.__webglFramebuffer),a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0+b,a.TEXTURE_2D,null,0);c.bindFramebuffer(a.READ_FRAMEBUFFER,k.__webglMultisampledFramebuffer);let m=b.texture.mipmaps;m&&m.length>0?c.bindFramebuffer(a.DRAW_FRAMEBUFFER,k.__webglFramebuffer[0]):c.bindFramebuffer(a.DRAW_FRAMEBUFFER,k.__webglFramebuffer);for(let c=0;c<e.length;c++){if(b.resolveDepthBuffer&&(b.depthBuffer&&(h|=a.DEPTH_BUFFER_BIT),b.stencilBuffer&&b.resolveStencilBuffer&&(h|=a.STENCIL_BUFFER_BIT)),l){a.framebufferRenderbuffer(a.READ_FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,k.__webglColorRenderbuffer[c]);let b=d.get(e[c]).__webglTexture;a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,b,0)}a.blitFramebuffer(0,0,f,g,0,0,f,g,h,a.NEAREST),!0===j&&(P.length=0,Q.length=0,P.push(a.COLOR_ATTACHMENT0+c),b.depthBuffer&&!1===b.resolveDepthBuffer&&(P.push(i),Q.push(i),a.invalidateFramebuffer(a.DRAW_FRAMEBUFFER,Q)),a.invalidateFramebuffer(a.READ_FRAMEBUFFER,P))}if(c.bindFramebuffer(a.READ_FRAMEBUFFER,null),c.bindFramebuffer(a.DRAW_FRAMEBUFFER,null),l)for(let b=0;b<e.length;b++){c.bindFramebuffer(a.FRAMEBUFFER,k.__webglMultisampledFramebuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+b,a.RENDERBUFFER,k.__webglColorRenderbuffer[b]);let f=d.get(e[b]).__webglTexture;c.bindFramebuffer(a.FRAMEBUFFER,k.__webglFramebuffer),a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0+b,a.TEXTURE_2D,f,0)}c.bindFramebuffer(a.DRAW_FRAMEBUFFER,k.__webglMultisampledFramebuffer)}else if(b.depthBuffer&&!1===b.resolveDepthBuffer&&j){let c=b.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;a.invalidateFramebuffer(a.DRAW_FRAMEBUFFER,[c])}}},this.setupDepthRenderbuffer=O,this.setupFrameBufferTexture=K,this.useMultisampledRTT=S,this.isReversedDepthBuffer=function(){return c.buffers.depth.getReversed()}}function kn(a,b){return{convert:function(c,d=""){let e,f=as.getTransfer(d);if(1009===c)return a.UNSIGNED_BYTE;if(1017===c)return a.UNSIGNED_SHORT_4_4_4_4;if(1018===c)return a.UNSIGNED_SHORT_5_5_5_1;if(35902===c)return a.UNSIGNED_INT_5_9_9_9_REV;if(35899===c)return a.UNSIGNED_INT_10F_11F_11F_REV;if(1010===c)return a.BYTE;if(1011===c)return a.SHORT;if(1012===c)return a.UNSIGNED_SHORT;if(1013===c)return a.INT;if(1014===c)return a.UNSIGNED_INT;if(1015===c)return a.FLOAT;if(1016===c)return a.HALF_FLOAT;if(1021===c)return a.ALPHA;if(1022===c)return a.RGB;if(1023===c)return a.RGBA;if(1026===c)return a.DEPTH_COMPONENT;if(1027===c)return a.DEPTH_STENCIL;if(1028===c)return a.RED;if(1029===c)return a.RED_INTEGER;if(1030===c)return a.RG;if(1031===c)return a.RG_INTEGER;if(1033===c)return a.RGBA_INTEGER;if(33776===c||33777===c||33778===c||33779===c)if(f===D){if(null===(e=b.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(33776===c)return e.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===c)return e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===c)return e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===c)return e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(e=b.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===c)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===c)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===c)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===c)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===c||35841===c||35842===c||35843===c){if(null===(e=b.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===c)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===c)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===c)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===c)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===c||37492===c||37496===c||37488===c||37489===c||37490===c||37491===c){if(null===(e=b.get("WEBGL_compressed_texture_etc")))return null;if(36196===c||37492===c)return f===D?e.COMPRESSED_SRGB8_ETC2:e.COMPRESSED_RGB8_ETC2;if(37496===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e.COMPRESSED_RGBA8_ETC2_EAC;if(37488===c)return e.COMPRESSED_R11_EAC;if(37489===c)return e.COMPRESSED_SIGNED_R11_EAC;if(37490===c)return e.COMPRESSED_RG11_EAC;if(37491===c)return e.COMPRESSED_SIGNED_RG11_EAC}if(37808===c||37809===c||37810===c||37811===c||37812===c||37813===c||37814===c||37815===c||37816===c||37817===c||37818===c||37819===c||37820===c||37821===c){if(null===(e=b.get("WEBGL_compressed_texture_astc")))return null;if(37808===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:e.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:e.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:e.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:e.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:e.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:e.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:e.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:e.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:e.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:e.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:e.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:e.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:e.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===c)return f===D?e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:e.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===c||36494===c||36495===c){if(null===(e=b.get("EXT_texture_compression_bptc")))return null;if(36492===c)return f===D?e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:e.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===c)return e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===c)return e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===c||36284===c||36285===c||36286===c){if(null===(e=b.get("EXT_texture_compression_rgtc")))return null;if(36283===c)return e.COMPRESSED_RED_RGTC1_EXT;if(36284===c)return e.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===c)return e.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===c)return e.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return 1020===c?a.UNSIGNED_INT_24_8:void 0!==a[c]?a[c]:null}}}let ko=`
|
|
359
|
+
void main() {
|
|
360
|
+
|
|
361
|
+
gl_Position = vec4( position, 1.0 );
|
|
362
|
+
|
|
363
|
+
}`,kp=`
|
|
364
|
+
uniform sampler2DArray depthColor;
|
|
365
|
+
uniform float depthWidth;
|
|
366
|
+
uniform float depthHeight;
|
|
367
|
+
|
|
368
|
+
void main() {
|
|
369
|
+
|
|
370
|
+
vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
|
|
371
|
+
|
|
372
|
+
if ( coord.x >= 1.0 ) {
|
|
373
|
+
|
|
374
|
+
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
|
|
375
|
+
|
|
376
|
+
} else {
|
|
377
|
+
|
|
378
|
+
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
|
|
379
|
+
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
}`;class kq{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(a,b){if(null===this.texture){let c=new eg(a.texture);(a.depthNear!==b.depthNear||a.depthFar!==b.depthFar)&&(this.depthNear=a.depthNear,this.depthFar=a.depthFar),this.texture=c}}getMesh(a){if(null!==this.texture&&null===this.mesh){let b=a.cameras[0].viewport,c=new ft({vertexShader:ko,fragmentShader:kp,uniforms:{depthColor:{value:this.texture},depthWidth:{value:b.z},depthHeight:{value:b.w}}});this.mesh=new cW(new fd(20,20),c)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class kr extends Z{constructor(a,b){super();const c=this;let d=null,e=1,f=null,g="local-floor",h=1,i=null,j=null,k=null,l=null,m=null,n=null;const o="u">typeof XRWebGLBinding,p=new kq,q={},r=b.getContextAttributes();let s=null,t=null;const u=[],v=[],w=new aj;let x=null;const y=new go;y.viewport=new aC;const z=new go;z.viewport=new aC;const A=[y,z],B=new gR;let C=null,D=null;function E(a){let b=v.indexOf(a.inputSource);if(-1===b)return;let c=u[b];void 0!==c&&(c.update(a.inputSource,a.frame,i||f),c.dispatchEvent({type:a.type,data:a.inputSource}))}function F(){d.removeEventListener("select",E),d.removeEventListener("selectstart",E),d.removeEventListener("selectend",E),d.removeEventListener("squeeze",E),d.removeEventListener("squeezestart",E),d.removeEventListener("squeezeend",E),d.removeEventListener("end",F),d.removeEventListener("inputsourceschange",G);for(let a=0;a<u.length;a++){let b=v[a];null!==b&&(v[a]=null,u[a].disconnect(b))}for(let a in C=null,D=null,p.reset(),q)delete q[a];a.setRenderTarget(s),m=null,l=null,k=null,d=null,t=null,L.stop(),c.isPresenting=!1,a.setPixelRatio(x),a.setSize(w.width,w.height,!1),c.dispatchEvent({type:"sessionend"})}function G(a){for(let b=0;b<a.removed.length;b++){let c=a.removed[b],d=v.indexOf(c);d>=0&&(v[d]=null,u[d].disconnect(c))}for(let b=0;b<a.added.length;b++){let c=a.added[b],d=v.indexOf(c);if(-1===d){for(let a=0;a<u.length;a++)if(a>=v.length){v.push(c),d=a;break}else if(null===v[a]){v[a]=c,d=a;break}if(-1===d)break}let e=u[d];e&&e.connect(c)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(a){let b=u[a];return void 0===b&&(b=new bb,u[a]=b),b.getTargetRaySpace()},this.getControllerGrip=function(a){let b=u[a];return void 0===b&&(b=new bb,u[a]=b),b.getGripSpace()},this.getHand=function(a){let b=u[a];return void 0===b&&(b=new bb,u[a]=b),b.getHandSpace()},this.setFramebufferScaleFactor=function(a){e=a,!0===c.isPresenting&&U("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(a){g=a,!0===c.isPresenting&&U("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return i||f},this.setReferenceSpace=function(a){i=a},this.getBaseLayer=function(){return null!==l?l:m},this.getBinding=function(){return null===k&&o&&(k=new XRWebGLBinding(d,b)),k},this.getFrame=function(){return n},this.getSession=function(){return d},this.setSession=async function(j){if(null!==(d=j)){if(s=a.getRenderTarget(),d.addEventListener("select",E),d.addEventListener("selectstart",E),d.addEventListener("selectend",E),d.addEventListener("squeeze",E),d.addEventListener("squeezestart",E),d.addEventListener("squeezeend",E),d.addEventListener("end",F),d.addEventListener("inputsourceschange",G),!0!==r.xrCompatible&&await b.makeXRCompatible(),x=a.getPixelRatio(),a.getSize(w),o&&"createProjectionLayer"in XRWebGLBinding.prototype){let c=null,f=null,g=null;r.depth&&(g=r.stencil?b.DEPTH24_STENCIL8:b.DEPTH_COMPONENT24,c=r.stencil?1027:1026,f=r.stencil?1020:1014);let h={colorFormat:b.RGBA8,depthFormat:g,scaleFactor:e};l=(k=this.getBinding()).createProjectionLayer(h),d.updateRenderState({layers:[l]}),a.setPixelRatio(1),a.setSize(l.textureWidth,l.textureHeight,!1),t=new aE(l.textureWidth,l.textureHeight,{format:1023,type:1009,depthTexture:new ee(l.textureWidth,l.textureHeight,f,void 0,void 0,void 0,void 0,void 0,void 0,c),stencilBuffer:r.stencil,colorSpace:a.outputColorSpace,samples:4*!!r.antialias,resolveDepthBuffer:!1===l.ignoreDepthValues,resolveStencilBuffer:!1===l.ignoreDepthValues})}else{let c={antialias:r.antialias,alpha:!0,depth:r.depth,stencil:r.stencil,framebufferScaleFactor:e};m=new XRWebGLLayer(d,b,c),d.updateRenderState({baseLayer:m}),a.setPixelRatio(1),a.setSize(m.framebufferWidth,m.framebufferHeight,!1),t=new aE(m.framebufferWidth,m.framebufferHeight,{format:1023,type:1009,colorSpace:a.outputColorSpace,stencilBuffer:r.stencil,resolveDepthBuffer:!1===m.ignoreDepthValues,resolveStencilBuffer:!1===m.ignoreDepthValues})}t.isXRRenderTarget=!0,this.setFoveation(h),i=null,f=await d.requestReferenceSpace(g),L.setContext(d),L.start(),c.isPresenting=!0,c.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==d)return d.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const H=new al,I=new al;function J(a,b){null===b?a.matrixWorld.copy(a.matrix):a.matrixWorld.multiplyMatrices(b.matrixWorld,a.matrix),a.matrixWorldInverse.copy(a.matrixWorld).invert()}this.updateCamera=function(a){var b,c,e;if(null===d)return;let f=a.near,g=a.far;null!==p.texture&&(p.depthNear>0&&(f=p.depthNear),p.depthFar>0&&(g=p.depthFar)),B.near=z.near=y.near=f,B.far=z.far=y.far=g,(C!==B.near||D!==B.far)&&(d.updateRenderState({depthNear:B.near,depthFar:B.far}),C=B.near,D=B.far),B.layers.mask=6|a.layers.mask,y.layers.mask=-5&B.layers.mask,z.layers.mask=-3&B.layers.mask;let h=a.parent,i=B.cameras;J(B,h);for(let a=0;a<i.length;a++)J(i[a],h);2===i.length?function(a,b,c){H.setFromMatrixPosition(b.matrixWorld),I.setFromMatrixPosition(c.matrixWorld);let d=H.distanceTo(I),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements,g=e[14]/(e[10]-1),h=e[14]/(e[10]+1),i=(e[9]+1)/e[5],j=(e[9]-1)/e[5],k=(e[8]-1)/e[0],l=(f[8]+1)/f[0],m=d/(-k+l),n=-(m*k);if(b.matrixWorld.decompose(a.position,a.quaternion,a.scale),a.translateX(n),a.translateZ(m),a.matrixWorld.compose(a.position,a.quaternion,a.scale),a.matrixWorldInverse.copy(a.matrixWorld).invert(),-1===e[10])a.projectionMatrix.copy(b.projectionMatrix),a.projectionMatrixInverse.copy(b.projectionMatrixInverse);else{let b=g+m,c=h+m;a.projectionMatrix.makePerspective(g*k-n,g*l+(d-n),i*h/c*b,j*h/c*b,b,c),a.projectionMatrixInverse.copy(a.projectionMatrix).invert()}}(B,y,z):B.projectionMatrix.copy(y.projectionMatrix),b=a,c=B,null===(e=h)?b.matrix.copy(c.matrixWorld):(b.matrix.copy(e.matrixWorld),b.matrix.invert(),b.matrix.multiply(c.matrixWorld)),b.matrix.decompose(b.position,b.quaternion,b.scale),b.updateMatrixWorld(!0),b.projectionMatrix.copy(c.projectionMatrix),b.projectionMatrixInverse.copy(c.projectionMatrixInverse),b.isPerspectiveCamera&&(b.fov=2*ab*Math.atan(1/b.projectionMatrix.elements[5]),b.zoom=1)},this.getCamera=function(){return B},this.getFoveation=function(){if(null!==l||null!==m)return h},this.setFoveation=function(a){h=a,null!==l&&(l.fixedFoveation=a),null!==m&&void 0!==m.fixedFoveation&&(m.fixedFoveation=a)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(B)},this.getCameraTexture=function(a){return q[a]};let K=null;const L=new h9;L.setAnimationLoop(function(b,e){if(j=e.getViewerPose(i||f),n=e,null!==j){let b=j.views;null!==m&&(a.setRenderTargetFramebuffer(t,m.framebuffer),a.setRenderTarget(t));let e=!1;b.length!==B.cameras.length&&(B.cameras.length=0,e=!0);for(let c=0;c<b.length;c++){let d=b[c],f=null;if(null!==m)f=m.getViewport(d);else{let b=k.getViewSubImage(l,d);f=b.viewport,0===c&&(a.setRenderTargetTextures(t,b.colorTexture,b.depthStencilTexture),a.setRenderTarget(t))}let g=A[c];void 0===g&&((g=new go).layers.enable(c),g.viewport=new aC,A[c]=g),g.matrix.fromArray(d.transform.matrix),g.matrix.decompose(g.position,g.quaternion,g.scale),g.projectionMatrix.fromArray(d.projectionMatrix),g.projectionMatrixInverse.copy(g.projectionMatrix).invert(),g.viewport.set(f.x,f.y,f.width,f.height),0===c&&(B.matrix.copy(g.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),!0===e&&B.cameras.push(g)}let f=d.enabledFeatures;if(f&&f.includes("depth-sensing")&&"gpu-optimized"==d.depthUsage&&o){let a=(k=c.getBinding()).getDepthInformation(b[0]);a&&a.isValid&&a.texture&&p.init(a,d.renderState)}if(f&&f.includes("camera-access")&&o){a.state.unbindTexture(),k=c.getBinding();for(let a=0;a<b.length;a++){let c=b[a].camera;if(c){let a=q[c];a||(a=new eg,q[c]=a);let b=k.getCameraImage(c);a.sourceTexture=b}}}}for(let a=0;a<u.length;a++){let b=v[a],c=u[a];null!==b&&void 0!==c&&c.update(b,e,i||f)}K&&K(b,e),e.detectedPlanes&&c.dispatchEvent({type:"planesdetected",data:e}),n=null}),this.setAnimationLoop=function(a){K=a},this.dispose=function(){}}}let ks=new aT,kt=new aJ;function ku(a,b){function c(a,b){!0===a.matrixAutoUpdate&&a.updateMatrix(),b.value.copy(a.matrix)}function d(a,d){a.opacity.value=d.opacity,d.color&&a.diffuse.value.copy(d.color),d.emissive&&a.emissive.value.copy(d.emissive).multiplyScalar(d.emissiveIntensity),d.map&&(a.map.value=d.map,c(d.map,a.mapTransform)),d.alphaMap&&(a.alphaMap.value=d.alphaMap,c(d.alphaMap,a.alphaMapTransform)),d.bumpMap&&(a.bumpMap.value=d.bumpMap,c(d.bumpMap,a.bumpMapTransform),a.bumpScale.value=d.bumpScale,1===d.side&&(a.bumpScale.value*=-1)),d.normalMap&&(a.normalMap.value=d.normalMap,c(d.normalMap,a.normalMapTransform),a.normalScale.value.copy(d.normalScale),1===d.side&&a.normalScale.value.negate()),d.displacementMap&&(a.displacementMap.value=d.displacementMap,c(d.displacementMap,a.displacementMapTransform),a.displacementScale.value=d.displacementScale,a.displacementBias.value=d.displacementBias),d.emissiveMap&&(a.emissiveMap.value=d.emissiveMap,c(d.emissiveMap,a.emissiveMapTransform)),d.specularMap&&(a.specularMap.value=d.specularMap,c(d.specularMap,a.specularMapTransform)),d.alphaTest>0&&(a.alphaTest.value=d.alphaTest);let e=b.get(d),f=e.envMap,g=e.envMapRotation;f&&(a.envMap.value=f,ks.copy(g),ks.x*=-1,ks.y*=-1,ks.z*=-1,f.isCubeTexture&&!1===f.isRenderTargetTexture&&(ks.y*=-1,ks.z*=-1),a.envMapRotation.value.setFromMatrix4(kt.makeRotationFromEuler(ks)),a.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,a.reflectivity.value=d.reflectivity,a.ior.value=d.ior,a.refractionRatio.value=d.refractionRatio),d.lightMap&&(a.lightMap.value=d.lightMap,a.lightMapIntensity.value=d.lightMapIntensity,c(d.lightMap,a.lightMapTransform)),d.aoMap&&(a.aoMap.value=d.aoMap,a.aoMapIntensity.value=d.aoMapIntensity,c(d.aoMap,a.aoMapTransform))}return{refreshFogUniforms:function(b,c){c.color.getRGB(b.fogColor.value,fr(a)),c.isFog?(b.fogNear.value=c.near,b.fogFar.value=c.far):c.isFogExp2&&(b.fogDensity.value=c.density)},refreshMaterialUniforms:function(a,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E;let F;e.isMeshBasicMaterial?d(a,e):e.isMeshLambertMaterial?(d(a,e),e.envMap&&(a.envMapIntensity.value=e.envMapIntensity)):e.isMeshToonMaterial?(d(a,e),i=a,(j=e).gradientMap&&(i.gradientMap.value=j.gradientMap)):e.isMeshPhongMaterial?(d(a,e),k=a,l=e,k.specular.value.copy(l.specular),k.shininess.value=Math.max(l.shininess,1e-4),e.envMap&&(a.envMapIntensity.value=e.envMapIntensity)):e.isMeshStandardMaterial?(d(a,e),m=a,n=e,m.metalness.value=n.metalness,n.metalnessMap&&(m.metalnessMap.value=n.metalnessMap,c(n.metalnessMap,m.metalnessMapTransform)),m.roughness.value=n.roughness,n.roughnessMap&&(m.roughnessMap.value=n.roughnessMap,c(n.roughnessMap,m.roughnessMapTransform)),n.envMap&&(m.envMapIntensity.value=n.envMapIntensity),e.isMeshPhysicalMaterial&&(o=a,p=e,q=h,o.ior.value=p.ior,p.sheen>0&&(o.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),o.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(o.sheenColorMap.value=p.sheenColorMap,c(p.sheenColorMap,o.sheenColorMapTransform)),p.sheenRoughnessMap&&(o.sheenRoughnessMap.value=p.sheenRoughnessMap,c(p.sheenRoughnessMap,o.sheenRoughnessMapTransform))),p.clearcoat>0&&(o.clearcoat.value=p.clearcoat,o.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(o.clearcoatMap.value=p.clearcoatMap,c(p.clearcoatMap,o.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(o.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,c(p.clearcoatRoughnessMap,o.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(o.clearcoatNormalMap.value=p.clearcoatNormalMap,c(p.clearcoatNormalMap,o.clearcoatNormalMapTransform),o.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),1===p.side&&o.clearcoatNormalScale.value.negate())),p.dispersion>0&&(o.dispersion.value=p.dispersion),p.iridescence>0&&(o.iridescence.value=p.iridescence,o.iridescenceIOR.value=p.iridescenceIOR,o.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],o.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(o.iridescenceMap.value=p.iridescenceMap,c(p.iridescenceMap,o.iridescenceMapTransform)),p.iridescenceThicknessMap&&(o.iridescenceThicknessMap.value=p.iridescenceThicknessMap,c(p.iridescenceThicknessMap,o.iridescenceThicknessMapTransform))),p.transmission>0&&(o.transmission.value=p.transmission,o.transmissionSamplerMap.value=q.texture,o.transmissionSamplerSize.value.set(q.width,q.height),p.transmissionMap&&(o.transmissionMap.value=p.transmissionMap,c(p.transmissionMap,o.transmissionMapTransform)),o.thickness.value=p.thickness,p.thicknessMap&&(o.thicknessMap.value=p.thicknessMap,c(p.thicknessMap,o.thicknessMapTransform)),o.attenuationDistance.value=p.attenuationDistance,o.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(o.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(o.anisotropyMap.value=p.anisotropyMap,c(p.anisotropyMap,o.anisotropyMapTransform))),o.specularIntensity.value=p.specularIntensity,o.specularColor.value.copy(p.specularColor),p.specularColorMap&&(o.specularColorMap.value=p.specularColorMap,c(p.specularColorMap,o.specularColorMapTransform)),p.specularIntensityMap&&(o.specularIntensityMap.value=p.specularIntensityMap,c(p.specularIntensityMap,o.specularIntensityMapTransform)))):e.isMeshMatcapMaterial?(d(a,e),r=a,(s=e).matcap&&(r.matcap.value=s.matcap)):e.isMeshDepthMaterial?d(a,e):e.isMeshDistanceMaterial?(d(a,e),t=a,u=e,F=b.get(u).light,t.referencePosition.value.setFromMatrixPosition(F.matrixWorld),t.nearDistance.value=F.shadow.camera.near,t.farDistance.value=F.shadow.camera.far):e.isMeshNormalMaterial?d(a,e):e.isLineBasicMaterial?(v=a,w=e,v.diffuse.value.copy(w.color),v.opacity.value=w.opacity,w.map&&(v.map.value=w.map,c(w.map,v.mapTransform)),e.isLineDashedMaterial&&(x=a,y=e,x.dashSize.value=y.dashSize,x.totalSize.value=y.dashSize+y.gapSize,x.scale.value=y.scale)):e.isPointsMaterial?(z=a,A=e,B=f,C=g,z.diffuse.value.copy(A.color),z.opacity.value=A.opacity,z.size.value=A.size*B,z.scale.value=.5*C,A.map&&(z.map.value=A.map,c(A.map,z.uvTransform)),A.alphaMap&&(z.alphaMap.value=A.alphaMap,c(A.alphaMap,z.alphaMapTransform)),A.alphaTest>0&&(z.alphaTest.value=A.alphaTest)):e.isSpriteMaterial?(D=a,E=e,D.diffuse.value.copy(E.color),D.opacity.value=E.opacity,D.rotation.value=E.rotation,E.map&&(D.map.value=E.map,c(E.map,D.mapTransform)),E.alphaMap&&(D.alphaMap.value=E.alphaMap,c(E.alphaMap,D.alphaMapTransform)),E.alphaTest>0&&(D.alphaTest.value=E.alphaTest)):e.isShadowMaterial?(a.color.value.copy(e.color),a.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}}}function kv(a,b,c,d){let e={},f={},g=[],h=a.getParameter(a.MAX_UNIFORM_BUFFER_BINDINGS);function i(a){let b={boundary:0,storage:0};return"number"==typeof a||"boolean"==typeof a?(b.boundary=4,b.storage=4):a.isVector2?(b.boundary=8,b.storage=8):a.isVector3||a.isColor?(b.boundary=16,b.storage=12):a.isVector4?(b.boundary=16,b.storage=16):a.isMatrix3?(b.boundary=48,b.storage=48):a.isMatrix4?(b.boundary=64,b.storage=64):a.isTexture?U("WebGLRenderer: Texture samplers can not be part of an uniforms group."):U("WebGLRenderer: Unsupported uniform value type.",a),b}function j(b){let c=b.target;c.removeEventListener("dispose",j);let d=g.indexOf(c.__bindingPointIndex);g.splice(d,1),a.deleteBuffer(e[c.id]),delete e[c.id],delete f[c.id]}return{bind:function(a,b){let c=b.program;d.uniformBlockBinding(a,c)},update:function(c,k){var l;let m,n,o,p,q=e[c.id];void 0===q&&(function(a){let b=a.uniforms,c=0;for(let a=0,d=b.length;a<d;a++){let d=Array.isArray(b[a])?b[a]:[b[a]];for(let a=0,b=d.length;a<b;a++){let b=d[a],e=Array.isArray(b.value)?b.value:[b.value];for(let a=0,d=e.length;a<d;a++){let d=i(e[a]),f=c%16,g=f%d.boundary,h=f+g;c+=g,0!==h&&16-h<d.storage&&(c+=16-h),b.__data=new Float32Array(d.storage/Float32Array.BYTES_PER_ELEMENT),b.__offset=c,c+=d.storage}}}let d=c%16;d>0&&(c+=16-d),a.__size=c,a.__cache={}}(c),(l=c).__bindingPointIndex=m=function(){for(let a=0;a<h;a++)if(-1===g.indexOf(a))return g.push(a),a;return V("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}(),n=a.createBuffer(),o=l.__size,p=l.usage,a.bindBuffer(a.UNIFORM_BUFFER,n),a.bufferData(a.UNIFORM_BUFFER,o,p),a.bindBuffer(a.UNIFORM_BUFFER,null),a.bindBufferBase(a.UNIFORM_BUFFER,m,n),q=n,e[c.id]=q,c.addEventListener("dispose",j));let r=k.program;d.updateUBOMapping(c,r);let s=b.render.frame;f[c.id]!==s&&(function(b){let c=e[b.id],d=b.uniforms,f=b.__cache;a.bindBuffer(a.UNIFORM_BUFFER,c);for(let b=0,c=d.length;b<c;b++){let c=Array.isArray(d[b])?d[b]:[d[b]];for(let d=0,e=c.length;d<e;d++){let e=c[d];if(!0===function(a,b,c,d){let e=a.value,f=b+"_"+c;if(void 0===d[f])return"number"==typeof e||"boolean"==typeof e?d[f]=e:d[f]=e.clone(),!0;{let a=d[f];if("number"==typeof e||"boolean"==typeof e){if(a!==e)return d[f]=e,!0}else if(!1===a.equals(e))return a.copy(e),!0}return!1}(e,b,d,f)){let b=e.__offset,c=Array.isArray(e.value)?e.value:[e.value],d=0;for(let f=0;f<c.length;f++){let g=c[f],h=i(g);"number"==typeof g||"boolean"==typeof g?(e.__data[0]=g,a.bufferSubData(a.UNIFORM_BUFFER,b+d,e.__data)):g.isMatrix3?(e.__data[0]=g.elements[0],e.__data[1]=g.elements[1],e.__data[2]=g.elements[2],e.__data[3]=0,e.__data[4]=g.elements[3],e.__data[5]=g.elements[4],e.__data[6]=g.elements[5],e.__data[7]=0,e.__data[8]=g.elements[6],e.__data[9]=g.elements[7],e.__data[10]=g.elements[8],e.__data[11]=0):(g.toArray(e.__data,d),d+=h.storage/Float32Array.BYTES_PER_ELEMENT)}a.bufferSubData(a.UNIFORM_BUFFER,b,e.__data)}}}a.bindBuffer(a.UNIFORM_BUFFER,null)}(c),f[c.id]=s)},dispose:function(){for(let b in e)a.deleteBuffer(e[b]);g=[],e={},f={}}}}let kw=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),kx=null;class ky{constructor(a={}){let b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;const{canvas:z=N(),context:C=null,depth:D=!0,stencil:E=!1,alpha:F=!1,antialias:G=!1,premultipliedAlpha:H=!0,preserveDrawingBuffer:I=!1,powerPreference:J="default",failIfMajorPerformanceCaveat:K=!1,reversedDepthBuffer:L=!1,outputBufferType:M=1009}=a;if(this.isWebGLRenderer=!0,null!==C){if("u">typeof WebGLRenderingContext&&C instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=C.getContextAttributes().alpha}else b=F;const O=new Set([1033,1031,1029]),P=new Set([1009,1014,1012,1020,1017,1018]),Q=new Uint32Array(4),R=new Int32Array(4);let T=null,Y=null;const Z=[],$=[];let _=null;this.domElement=z,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const aa=this;let ab=!1;this._outputColorSpace=A;let ac=0,ad=0,ae=null,af=-1,ag=null;const ah=new aC,ai=new aC;let aj=null;const ak=new bg(0);let am=0,an=z.width,ao=z.height,ap=1,aq=null,ar=null;const at=new aC(0,0,an,ao),au=new aC(0,0,an,ao);let av=!1;const aw=new ds;let ax=!1,ay=!1;const az=new aJ,aA=new al,aB=new aC,aD={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let aF=!1;function aG(){return null===ae?ap:1}let aH=C;function aI(a,b){return z.getContext(a,b)}try{if("setAttribute"in z&&z.setAttribute("data-engine","three.js r183"),z.addEventListener("webglcontextlost",aM,!1),z.addEventListener("webglcontextrestored",aN,!1),z.addEventListener("webglcontextcreationerror",aO,!1),null===aH){const a="webgl2";if(aH=aI(a,{alpha:!0,depth:D,stencil:E,antialias:G,premultipliedAlpha:H,preserveDrawingBuffer:I,powerPreference:J,failIfMajorPerformanceCaveat:K}),null===aH)if(aI(a))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(a){throw V("WebGLRenderer: "+a.message),a}function aK(){(c=new iE(aH)).init(),w=new kn(aH,c),d=new il(aH,c,a,w),e=new kl(aH,c),d.reversedDepthBuffer&&L&&e.buffers.depth.setReversed(!0),f=new iH(aH),g=new j4,h=new km(aH,c,e,g,d,w,f),i=new iD(aa),j=new ia(aH),x=new ij(aH,j),k=new iF(aH,j,f,x),l=new iJ(aH,k,j,x,f),t=new iI(aH,d,h),q=new im(g),m=new j3(aa,i,c,d,x,q),n=new ku(aa,g),o=new j8,p=new ke(c),s=new ii(aa,i,e,l,b,H),r=new kk(aa,l,d),y=new kv(aH,f,d,e),u=new ik(aH,c,f),v=new iG(aH,c,f),f.programs=m.programs,aa.capabilities=d,aa.extensions=c,aa.properties=g,aa.renderLists=o,aa.shadowMap=r,aa.state=e,aa.info=f}aK(),1009!==M&&(_=new iL(M,z.width,z.height,D,E));const aL=new kr(aa,aH);function aM(a){a.preventDefault(),S("WebGLRenderer: Context Lost."),ab=!0}function aN(){S("WebGLRenderer: Context Restored."),ab=!1;let a=f.autoReset,b=r.enabled,c=r.autoUpdate,d=r.needsUpdate,e=r.type;aK(),f.autoReset=a,r.enabled=b,r.autoUpdate=c,r.needsUpdate=d,r.type=e}function aO(a){V("WebGLRenderer: A WebGL context could not be created. Reason: ",a.statusMessage)}function aP(a){var b,c;let d,e=a.target;e.removeEventListener("dispose",aP),c=b=e,void 0!==(d=g.get(c).programs)&&(d.forEach(function(a){m.releaseProgram(a)}),c.isShaderMaterial&&m.releaseShaderCache(c)),g.remove(b)}function aQ(a,b,c){!0===a.transparent&&2===a.side&&!1===a.forceSinglePass?(a.side=1,a.needsUpdate=!0,a$(a,b,c),a.side=0,a.needsUpdate=!0,a$(a,b,c),a.side=2):a$(a,b,c)}this.xr=aL,this.getContext=function(){return aH},this.getContextAttributes=function(){return aH.getContextAttributes()},this.forceContextLoss=function(){let a=c.get("WEBGL_lose_context");a&&a.loseContext()},this.forceContextRestore=function(){let a=c.get("WEBGL_lose_context");a&&a.restoreContext()},this.getPixelRatio=function(){return ap},this.setPixelRatio=function(a){void 0!==a&&(ap=a,this.setSize(an,ao,!1))},this.getSize=function(a){return a.set(an,ao)},this.setSize=function(a,b,c=!0){aL.isPresenting?U("WebGLRenderer: Can't change size while VR device is presenting."):(an=a,ao=b,z.width=Math.floor(a*ap),z.height=Math.floor(b*ap),!0===c&&(z.style.width=a+"px",z.style.height=b+"px"),null!==_&&_.setSize(z.width,z.height),this.setViewport(0,0,a,b))},this.getDrawingBufferSize=function(a){return a.set(an*ap,ao*ap).floor()},this.setDrawingBufferSize=function(a,b,c){an=a,ao=b,ap=c,z.width=Math.floor(a*c),z.height=Math.floor(b*c),this.setViewport(0,0,a,b)},this.setEffects=function(a){if(1009===M)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(a){for(let b=0;b<a.length;b++)if(!0===a[b].isOutputPass){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}_.setEffects(a||[])},this.getCurrentViewport=function(a){return a.copy(ah)},this.getViewport=function(a){return a.copy(at)},this.setViewport=function(a,b,c,d){a.isVector4?at.set(a.x,a.y,a.z,a.w):at.set(a,b,c,d),e.viewport(ah.copy(at).multiplyScalar(ap).round())},this.getScissor=function(a){return a.copy(au)},this.setScissor=function(a,b,c,d){a.isVector4?au.set(a.x,a.y,a.z,a.w):au.set(a,b,c,d),e.scissor(ai.copy(au).multiplyScalar(ap).round())},this.getScissorTest=function(){return av},this.setScissorTest=function(a){e.setScissorTest(av=a)},this.setOpaqueSort=function(a){aq=a},this.setTransparentSort=function(a){ar=a},this.getClearColor=function(a){return a.copy(s.getClearColor())},this.setClearColor=function(){s.setClearColor(...arguments)},this.getClearAlpha=function(){return s.getClearAlpha()},this.setClearAlpha=function(){s.setClearAlpha(...arguments)},this.clear=function(a=!0,b=!0,c=!0){let d=0;if(a){let a=!1;if(null!==ae){let b=ae.texture.format;a=O.has(b)}if(a){let a=ae.texture.type,b=P.has(a),c=s.getClearColor(),d=s.getClearAlpha(),e=c.r,f=c.g,g=c.b;b?(Q[0]=e,Q[1]=f,Q[2]=g,Q[3]=d,aH.clearBufferuiv(aH.COLOR,0,Q)):(R[0]=e,R[1]=f,R[2]=g,R[3]=d,aH.clearBufferiv(aH.COLOR,0,R))}else d|=aH.COLOR_BUFFER_BIT}b&&(d|=aH.DEPTH_BUFFER_BIT),c&&(d|=aH.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),0!==d&&aH.clear(d)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){z.removeEventListener("webglcontextlost",aM,!1),z.removeEventListener("webglcontextrestored",aN,!1),z.removeEventListener("webglcontextcreationerror",aO,!1),s.dispose(),o.dispose(),p.dispose(),g.dispose(),i.dispose(),l.dispose(),x.dispose(),y.dispose(),m.dispose(),aL.dispose(),aL.removeEventListener("sessionstart",aS),aL.removeEventListener("sessionend",aT),aU.stop()},this.renderBufferDirect=function(a,b,f,l,m,o){let p;null===b&&(b=aD);let r=m.isMesh&&0>m.matrixWorld.determinant(),s=function(a,b,c,f,j){var k,l;!0!==b.isScene&&(b=aD),h.resetTextureUnits();let m=b.fog,o=f.isMeshStandardMaterial||f.isMeshLambertMaterial||f.isMeshPhongMaterial?b.environment:null,p=null===ae?aa.outputColorSpace:!0===ae.isXRRenderTarget?ae.texture.colorSpace:B,r=f.isMeshStandardMaterial||f.isMeshLambertMaterial&&!f.envMap||f.isMeshPhongMaterial&&!f.envMap,s=i.get(f.envMap||o,r),u=!0===f.vertexColors&&!!c.attributes.color&&4===c.attributes.color.itemSize,v=!!c.attributes.tangent&&(!!f.normalMap||f.anisotropy>0),w=!!c.morphAttributes.position,x=!!c.morphAttributes.normal,z=!!c.morphAttributes.color,A=0;f.toneMapped&&(null===ae||!0===ae.isXRRenderTarget)&&(A=aa.toneMapping);let C=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,D=void 0!==C?C.length:0,E=g.get(f),F=Y.state.lights;if(!0===ax&&(!0===ay||a!==ag)){let b=a===ag&&f.id===af;q.setState(f,a,b)}let G=!1;f.version===E.__version?E.needsLights&&E.lightsStateVersion!==F.state.version||E.outputColorSpace!==p||j.isBatchedMesh&&!1===E.batching?G=!0:j.isBatchedMesh||!0!==E.batching?j.isBatchedMesh&&!0===E.batchingColor&&null===j.colorTexture||j.isBatchedMesh&&!1===E.batchingColor&&null!==j.colorTexture||j.isInstancedMesh&&!1===E.instancing?G=!0:j.isInstancedMesh||!0!==E.instancing?j.isSkinnedMesh&&!1===E.skinning?G=!0:j.isSkinnedMesh||!0!==E.skinning?j.isInstancedMesh&&!0===E.instancingColor&&null===j.instanceColor||j.isInstancedMesh&&!1===E.instancingColor&&null!==j.instanceColor||j.isInstancedMesh&&!0===E.instancingMorph&&null===j.morphTexture||j.isInstancedMesh&&!1===E.instancingMorph&&null!==j.morphTexture||E.envMap!==s||!0===f.fog&&E.fog!==m||void 0!==E.numClippingPlanes&&(E.numClippingPlanes!==q.numPlanes||E.numIntersection!==q.numIntersection)||E.vertexAlphas!==u||E.vertexTangents!==v||E.morphTargets!==w||E.morphNormals!==x||E.morphColors!==z||E.toneMapping!==A?G=!0:E.morphTargetsCount!==D&&(G=!0):G=!0:G=!0:G=!0:(G=!0,E.__version=f.version);let H=E.currentProgram;!0===G&&(H=a$(f,b,j));let I=!1,J=!1,K=!1,L=H.getUniforms(),M=E.uniforms;if(e.useProgram(H.program)&&(I=!0,J=!0,K=!0),f.id!==af&&(af=f.id,J=!0),I||ag!==a){e.buffers.depth.getReversed()&&!0!==a.reversedDepth&&(a._reversedDepth=!0,a.updateProjectionMatrix()),L.setValue(aH,"projectionMatrix",a.projectionMatrix),L.setValue(aH,"viewMatrix",a.matrixWorldInverse);let b=L.map.cameraPosition;void 0!==b&&b.setValue(aH,aA.setFromMatrixPosition(a.matrixWorld)),d.logarithmicDepthBuffer&&L.setValue(aH,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2)),(f.isMeshPhongMaterial||f.isMeshToonMaterial||f.isMeshLambertMaterial||f.isMeshBasicMaterial||f.isMeshStandardMaterial||f.isShaderMaterial)&&L.setValue(aH,"isOrthographic",!0===a.isOrthographicCamera),ag!==a&&(ag=a,J=!0,K=!0)}if(E.needsLights&&(F.state.directionalShadowMap.length>0&&L.setValue(aH,"directionalShadowMap",F.state.directionalShadowMap,h),F.state.spotShadowMap.length>0&&L.setValue(aH,"spotShadowMap",F.state.spotShadowMap,h),F.state.pointShadowMap.length>0&&L.setValue(aH,"pointShadowMap",F.state.pointShadowMap,h)),j.isSkinnedMesh){L.setOptional(aH,j,"bindMatrix"),L.setOptional(aH,j,"bindMatrixInverse");let a=j.skeleton;a&&(null===a.boneTexture&&a.computeBoneTexture(),L.setValue(aH,"boneTexture",a.boneTexture,h))}j.isBatchedMesh&&(L.setOptional(aH,j,"batchingTexture"),L.setValue(aH,"batchingTexture",j._matricesTexture,h),L.setOptional(aH,j,"batchingIdTexture"),L.setValue(aH,"batchingIdTexture",j._indirectTexture,h),L.setOptional(aH,j,"batchingColorTexture"),null!==j._colorsTexture&&L.setValue(aH,"batchingColorTexture",j._colorsTexture,h));let N=c.morphAttributes;if((void 0!==N.position||void 0!==N.normal||void 0!==N.color)&&t.update(j,c,H),(J||E.receiveShadow!==j.receiveShadow)&&(E.receiveShadow=j.receiveShadow,L.setValue(aH,"receiveShadow",j.receiveShadow)),(f.isMeshStandardMaterial||f.isMeshLambertMaterial||f.isMeshPhongMaterial)&&null===f.envMap&&null!==b.environment&&(M.envMapIntensity.value=b.environmentIntensity),void 0!==M.dfgLUT&&(M.dfgLUT.value=(null===kx&&((kx=new c7(kw,16,16,1030,1016)).name="DFG_LUT",kx.minFilter=1006,kx.magFilter=1006,kx.wrapS=1001,kx.wrapT=1001,kx.generateMipmaps=!1,kx.needsUpdate=!0),kx)),J&&(L.setValue(aH,"toneMappingExposure",aa.toneMappingExposure),E.needsLights&&(k=M,l=K,k.ambientLightColor.needsUpdate=l,k.lightProbe.needsUpdate=l,k.directionalLights.needsUpdate=l,k.directionalLightShadows.needsUpdate=l,k.pointLights.needsUpdate=l,k.pointLightShadows.needsUpdate=l,k.spotLights.needsUpdate=l,k.spotLightShadows.needsUpdate=l,k.rectAreaLights.needsUpdate=l,k.hemisphereLights.needsUpdate=l),m&&!0===f.fog&&n.refreshFogUniforms(M,m),n.refreshMaterialUniforms(M,f,ap,ao,Y.state.transmissionRenderTarget[a.id]),jF.upload(aH,a_(E),M,h)),f.isShaderMaterial&&!0===f.uniformsNeedUpdate&&(jF.upload(aH,a_(E),M,h),f.uniformsNeedUpdate=!1),f.isSpriteMaterial&&L.setValue(aH,"center",j.center),L.setValue(aH,"modelViewMatrix",j.modelViewMatrix),L.setValue(aH,"normalMatrix",j.normalMatrix),L.setValue(aH,"modelMatrix",j.matrixWorld),f.isShaderMaterial||f.isRawShaderMaterial){let a=f.uniformsGroups;for(let b=0,c=a.length;b<c;b++){let c=a[b];y.update(c,H),y.bind(c,H)}}return H}(a,b,f,l,m);e.setMaterial(l,r);let w=f.index,z=1;if(!0===l.wireframe){if(void 0===(w=k.getWireframeAttribute(f)))return;z=2}let A=f.drawRange,C=f.attributes.position,D=A.start*z,E=(A.start+A.count)*z;null!==o&&(D=Math.max(D,o.start*z),E=Math.min(E,(o.start+o.count)*z)),null!==w?(D=Math.max(D,0),E=Math.min(E,w.count)):null!=C&&(D=Math.max(D,0),E=Math.min(E,C.count));let F=E-D;if(F<0||F===1/0)return;x.setup(m,l,s,f,w);let G=u;if(null!==w&&(p=j.get(w),(G=v).setIndex(p)),m.isMesh)!0===l.wireframe?(e.setLineWidth(l.wireframeLinewidth*aG()),G.setMode(aH.LINES)):G.setMode(aH.TRIANGLES);else if(m.isLine){let a=l.linewidth;void 0===a&&(a=1),e.setLineWidth(a*aG()),m.isLineSegments?G.setMode(aH.LINES):m.isLineLoop?G.setMode(aH.LINE_LOOP):G.setMode(aH.LINE_STRIP)}else m.isPoints?G.setMode(aH.POINTS):m.isSprite&&G.setMode(aH.TRIANGLES);if(m.isBatchedMesh)if(null!==m._multiDrawInstances)W("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),G.renderMultiDrawInstances(m._multiDrawStarts,m._multiDrawCounts,m._multiDrawCount,m._multiDrawInstances);else if(c.get("WEBGL_multi_draw"))G.renderMultiDraw(m._multiDrawStarts,m._multiDrawCounts,m._multiDrawCount);else{let a=m._multiDrawStarts,b=m._multiDrawCounts,c=m._multiDrawCount,d=w?j.get(w).bytesPerElement:1,e=g.get(l).currentProgram.getUniforms();for(let f=0;f<c;f++)e.setValue(aH,"_gl_DrawID",f),G.render(a[f]/d,b[f])}else if(m.isInstancedMesh)G.renderInstances(D,F,m.count);else if(f.isInstancedBufferGeometry){let a=void 0!==f._maxInstanceCount?f._maxInstanceCount:1/0,b=Math.min(f.instanceCount,a);G.renderInstances(D,F,b)}else G.render(D,F)},this.compile=function(a,b,c=null){null===c&&(c=a),(Y=p.get(c)).init(b),$.push(Y),c.traverseVisible(function(a){a.isLight&&a.layers.test(b.layers)&&(Y.pushLight(a),a.castShadow&&Y.pushShadow(a))}),a!==c&&a.traverseVisible(function(a){a.isLight&&a.layers.test(b.layers)&&(Y.pushLight(a),a.castShadow&&Y.pushShadow(a))}),Y.setupLights();let d=new Set;return a.traverse(function(a){if(!(a.isMesh||a.isPoints||a.isLine||a.isSprite))return;let b=a.material;if(b)if(Array.isArray(b))for(let e=0;e<b.length;e++){let f=b[e];aQ(f,c,a),d.add(f)}else aQ(b,c,a),d.add(b)}),Y=$.pop(),d},this.compileAsync=function(a,b,d=null){let e=this.compile(a,b,d);return new Promise(b=>{function d(){(e.forEach(function(a){g.get(a).currentProgram.isReady()&&e.delete(a)}),0===e.size)?b(a):setTimeout(d,10)}null!==c.get("KHR_parallel_shader_compile")?d():setTimeout(d,10)})};let aR=null;function aS(){aU.stop()}function aT(){aU.start()}const aU=new h9;function aV(a,b,c,d){if(!1===a.visible)return;if(a.layers.test(b.layers)){if(a.isGroup)c=a.renderOrder;else if(a.isLOD)!0===a.autoUpdate&&a.update(b);else if(a.isLight)Y.pushLight(a),a.castShadow&&Y.pushShadow(a);else if(a.isSprite){if(!a.frustumCulled||aw.intersectsSprite(a)){d&&aB.setFromMatrixPosition(a.matrixWorld).applyMatrix4(az);let b=l.update(a),e=a.material;e.visible&&T.push(a,b,e,c,aB.z,null)}}else if((a.isMesh||a.isLine||a.isPoints)&&(!a.frustumCulled||aw.intersectsObject(a))){let b=l.update(a),e=a.material;if(d&&(void 0!==a.boundingSphere?(null===a.boundingSphere&&a.computeBoundingSphere(),aB.copy(a.boundingSphere.center)):(null===b.boundingSphere&&b.computeBoundingSphere(),aB.copy(b.boundingSphere.center)),aB.applyMatrix4(a.matrixWorld).applyMatrix4(az)),Array.isArray(e)){let d=b.groups;for(let f=0,g=d.length;f<g;f++){let g=d[f],h=e[g.materialIndex];h&&h.visible&&T.push(a,b,h,c,aB.z,g)}}else e.visible&&T.push(a,b,e,c,aB.z,null)}}let e=a.children;for(let a=0,f=e.length;a<f;a++)aV(e[a],b,c,d)}function aW(a,b,c,d){let{opaque:f,transmissive:g,transparent:h}=a;Y.setupLightsView(c),!0===ax&&q.setGlobalState(aa.clippingPlanes,c),d&&e.viewport(ah.copy(d)),f.length>0&&aY(f,b,c),g.length>0&&aY(g,b,c),h.length>0&&aY(h,b,c),e.buffers.depth.setTest(!0),e.buffers.depth.setMask(!0),e.buffers.color.setMask(!0),e.setPolygonOffset(!1)}function aX(a,b,e,f){if(null!==(!0===e.isScene?e.overrideMaterial:null))return;if(void 0===Y.state.transmissionRenderTarget[f.id]){let a=c.has("EXT_color_buffer_half_float")||c.has("EXT_color_buffer_float");Y.state.transmissionRenderTarget[f.id]=new aE(1,1,{generateMipmaps:!0,type:a?1016:1009,minFilter:1008,samples:d.samples,stencilBuffer:E,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:as.workingColorSpace})}let g=Y.state.transmissionRenderTarget[f.id],i=f.viewport||ah;g.setSize(i.z*aa.transmissionResolutionScale,i.w*aa.transmissionResolutionScale);let j=aa.getRenderTarget(),k=aa.getActiveCubeFace(),l=aa.getActiveMipmapLevel();aa.setRenderTarget(g),aa.getClearColor(ak),(am=aa.getClearAlpha())<1&&aa.setClearColor(0xffffff,.5),aa.clear(),aF&&s.render(e);let m=aa.toneMapping;aa.toneMapping=0;let n=f.viewport;if(void 0!==f.viewport&&(f.viewport=void 0),Y.setupLightsView(f),!0===ax&&q.setGlobalState(aa.clippingPlanes,f),aY(a,e,f),h.updateMultisampleRenderTarget(g),h.updateRenderTargetMipmap(g),!1===c.has("WEBGL_multisampled_render_to_texture")){let a=!1;for(let c=0,d=b.length;c<d;c++){let{object:d,geometry:g,material:h,group:i}=b[c];if(2===h.side&&d.layers.test(f.layers)){let b=h.side;h.side=1,h.needsUpdate=!0,aZ(d,e,f,g,h,i),h.side=b,h.needsUpdate=!0,a=!0}}!0===a&&(h.updateMultisampleRenderTarget(g),h.updateRenderTargetMipmap(g))}aa.setRenderTarget(j,k,l),aa.setClearColor(ak,am),void 0!==n&&(f.viewport=n),aa.toneMapping=m}function aY(a,b,c){let d=!0===b.isScene?b.overrideMaterial:null;for(let e=0,f=a.length;e<f;e++){let f=a[e],{object:g,geometry:h,group:i}=f,j=f.material;!0===j.allowOverride&&null!==d&&(j=d),g.layers.test(c.layers)&&aZ(g,b,c,h,j,i)}}function aZ(a,b,c,d,e,f){a.onBeforeRender(aa,b,c,d,e,f),a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld),a.normalMatrix.getNormalMatrix(a.modelViewMatrix),e.onBeforeRender(aa,b,c,d,a,f),!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,aa.renderBufferDirect(c,b,d,e,a,f),e.side=0,e.needsUpdate=!0,aa.renderBufferDirect(c,b,d,e,a,f),e.side=2):aa.renderBufferDirect(c,b,d,e,a,f),a.onAfterRender(aa,b,c,d,e,f)}function a$(a,b,c){var d;!0!==b.isScene&&(b=aD);let e=g.get(a),f=Y.state.lights,h=Y.state.shadowsArray,j=f.state.version,k=m.getParameters(a,f.state,h,b,c),l=m.getProgramCacheKey(k),n=e.programs;e.environment=a.isMeshStandardMaterial||a.isMeshLambertMaterial||a.isMeshPhongMaterial?b.environment:null,e.fog=b.fog;let o=a.isMeshStandardMaterial||a.isMeshLambertMaterial&&!a.envMap||a.isMeshPhongMaterial&&!a.envMap;e.envMap=i.get(a.envMap||e.environment,o),e.envMapRotation=null!==e.environment&&null===a.envMap?b.environmentRotation:a.envMapRotation,void 0===n&&(a.addEventListener("dispose",aP),e.programs=n=new Map);let p=n.get(l);if(void 0!==p){if(e.currentProgram===p&&e.lightsStateVersion===j)return a0(a,k),p}else k.uniforms=m.getUniforms(a),a.onBeforeCompile(k,aa),p=m.acquireProgram(k,l),n.set(l,p),e.uniforms=k.uniforms;let r=e.uniforms;return(a.isShaderMaterial||a.isRawShaderMaterial)&&!0!==a.clipping||(r.clippingPlanes=q.uniform),a0(a,k),e.needsLights=(d=a).isMeshLambertMaterial||d.isMeshToonMaterial||d.isMeshPhongMaterial||d.isMeshStandardMaterial||d.isShadowMaterial||d.isShaderMaterial&&!0===d.lights,e.lightsStateVersion=j,e.needsLights&&(r.ambientLightColor.value=f.state.ambient,r.lightProbe.value=f.state.probe,r.directionalLights.value=f.state.directional,r.directionalLightShadows.value=f.state.directionalShadow,r.spotLights.value=f.state.spot,r.spotLightShadows.value=f.state.spotShadow,r.rectAreaLights.value=f.state.rectArea,r.ltc_1.value=f.state.rectAreaLTC1,r.ltc_2.value=f.state.rectAreaLTC2,r.pointLights.value=f.state.point,r.pointLightShadows.value=f.state.pointShadow,r.hemisphereLights.value=f.state.hemi,r.directionalShadowMatrix.value=f.state.directionalShadowMatrix,r.spotLightMatrix.value=f.state.spotLightMatrix,r.spotLightMap.value=f.state.spotLightMap,r.pointShadowMatrix.value=f.state.pointShadowMatrix),e.currentProgram=p,e.uniformsList=null,p}function a_(a){if(null===a.uniformsList){let b=a.currentProgram.getUniforms();a.uniformsList=jF.seqWithValue(b.seq,a.uniforms)}return a.uniformsList}function a0(a,b){let c=g.get(a);c.outputColorSpace=b.outputColorSpace,c.batching=b.batching,c.batchingColor=b.batchingColor,c.instancing=b.instancing,c.instancingColor=b.instancingColor,c.instancingMorph=b.instancingMorph,c.skinning=b.skinning,c.morphTargets=b.morphTargets,c.morphNormals=b.morphNormals,c.morphColors=b.morphColors,c.morphTargetsCount=b.morphTargetsCount,c.numClippingPlanes=b.numClippingPlanes,c.numIntersection=b.numClipIntersection,c.vertexAlphas=b.vertexAlphas,c.vertexTangents=b.vertexTangents,c.toneMapping=b.toneMapping}aU.setAnimationLoop(function(a){aR&&aR(a)}),"u">typeof self&&aU.setContext(self),this.setAnimationLoop=function(a){aR=a,aL.setAnimationLoop(a),null===a?aU.stop():aU.start()},aL.addEventListener("sessionstart",aS),aL.addEventListener("sessionend",aT),this.render=function(a,b){if(void 0!==b&&!0!==b.isCamera)return void V("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===ab)return;let c=!0===aL.enabled&&!0===aL.isPresenting,d=null!==_&&(null===ae||c)&&_.begin(aa,ae);if(!0===a.matrixWorldAutoUpdate&&a.updateMatrixWorld(),null===b.parent&&!0===b.matrixWorldAutoUpdate&&b.updateMatrixWorld(),!0===aL.enabled&&!0===aL.isPresenting&&(null===_||!1===_.isCompositing())&&(!0===aL.cameraAutoUpdate&&aL.updateCamera(b),b=aL.getCamera()),!0===a.isScene&&a.onBeforeRender(aa,a,b,ae),(Y=p.get(a,$.length)).init(b),$.push(Y),az.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),aw.setFromProjectionMatrix(az,2e3,b.reversedDepth),ay=this.localClippingEnabled,ax=q.init(this.clippingPlanes,ay),(T=o.get(a,Z.length)).init(),Z.push(T),!0===aL.enabled&&!0===aL.isPresenting){let a=aa.xr.getDepthSensingMesh();null!==a&&aV(a,b,-1/0,aa.sortObjects)}aV(a,b,0,aa.sortObjects),T.finish(),!0===aa.sortObjects&&T.sort(aq,ar),(aF=!1===aL.enabled||!1===aL.isPresenting||!1===aL.hasDepthSensing())&&s.addToRenderList(T,a),this.info.render.frame++,!0===ax&&q.beginShadows();let e=Y.state.shadowsArray;if(r.render(e,a,b),!0===ax&&q.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(d&&_.hasRenderPass())){let c=T.opaque,d=T.transmissive;if(Y.setupLights(),b.isArrayCamera){let e=b.cameras;if(d.length>0)for(let b=0,f=e.length;b<f;b++)aX(c,d,a,e[b]);aF&&s.render(a);for(let b=0,c=e.length;b<c;b++){let c=e[b];aW(T,a,c,c.viewport)}}else d.length>0&&aX(c,d,a,b),aF&&s.render(a),aW(T,a,b)}null!==ae&&0===ad&&(h.updateMultisampleRenderTarget(ae),h.updateRenderTargetMipmap(ae)),d&&_.end(aa),!0===a.isScene&&a.onAfterRender(aa,a,b),x.resetDefaultState(),af=-1,ag=null,$.pop(),$.length>0?(Y=$[$.length-1],!0===ax&&q.setGlobalState(aa.clippingPlanes,Y.state.camera)):Y=null,Z.pop(),T=Z.length>0?Z[Z.length-1]:null},this.getActiveCubeFace=function(){return ac},this.getActiveMipmapLevel=function(){return ad},this.getRenderTarget=function(){return ae},this.setRenderTargetTextures=function(a,b,c){let d=g.get(a);d.__autoAllocateDepthBuffer=!1===a.resolveDepthBuffer,!1===d.__autoAllocateDepthBuffer&&(d.__useRenderToTexture=!1),g.get(a.texture).__webglTexture=b,g.get(a.depthTexture).__webglTexture=d.__autoAllocateDepthBuffer?void 0:c,d.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(a,b){let c=g.get(a);c.__webglFramebuffer=b,c.__useDefaultFramebuffer=void 0===b};const a1=aH.createFramebuffer();this.setRenderTarget=function(a,b=0,c=0){ae=a,ac=b,ad=c;let d=null,f=!1,i=!1;if(a){let j=g.get(a);if(void 0!==j.__useDefaultFramebuffer){e.bindFramebuffer(aH.FRAMEBUFFER,j.__webglFramebuffer),ah.copy(a.viewport),ai.copy(a.scissor),aj=a.scissorTest,e.viewport(ah),e.scissor(ai),e.setScissorTest(aj),af=-1;return}if(void 0===j.__webglFramebuffer)h.setupRenderTarget(a);else if(j.__hasExternalTextures)h.rebindTextures(a,g.get(a.texture).__webglTexture,g.get(a.depthTexture).__webglTexture);else if(a.depthBuffer){let b=a.depthTexture;if(j.__boundDepthTexture!==b){if(null!==b&&g.has(b)&&(a.width!==b.image.width||a.height!==b.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");h.setupDepthRenderbuffer(a)}}let k=a.texture;(k.isData3DTexture||k.isDataArrayTexture||k.isCompressedArrayTexture)&&(i=!0);let l=g.get(a).__webglFramebuffer;a.isWebGLCubeRenderTarget?(d=Array.isArray(l[b])?l[b][c]:l[b],f=!0):d=a.samples>0&&!1===h.useMultisampledRTT(a)?g.get(a).__webglMultisampledFramebuffer:Array.isArray(l)?l[c]:l,ah.copy(a.viewport),ai.copy(a.scissor),aj=a.scissorTest}else ah.copy(at).multiplyScalar(ap).floor(),ai.copy(au).multiplyScalar(ap).floor(),aj=av;if(0!==c&&(d=a1),e.bindFramebuffer(aH.FRAMEBUFFER,d)&&e.drawBuffers(a,d),e.viewport(ah),e.scissor(ai),e.setScissorTest(aj),f){let d=g.get(a.texture);aH.framebufferTexture2D(aH.FRAMEBUFFER,aH.COLOR_ATTACHMENT0,aH.TEXTURE_CUBE_MAP_POSITIVE_X+b,d.__webglTexture,c)}else if(i)for(let d=0;d<a.textures.length;d++){let e=g.get(a.textures[d]);aH.framebufferTextureLayer(aH.FRAMEBUFFER,aH.COLOR_ATTACHMENT0+d,e.__webglTexture,c,b)}else if(null!==a&&0!==c){let b=g.get(a.texture);aH.framebufferTexture2D(aH.FRAMEBUFFER,aH.COLOR_ATTACHMENT0,aH.TEXTURE_2D,b.__webglTexture,c)}af=-1},this.readRenderTargetPixels=function(a,b,c,f,h,i,j,k=0){if(!(a&&a.isWebGLRenderTarget))return void V("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=g.get(a).__webglFramebuffer;if(a.isWebGLCubeRenderTarget&&void 0!==j&&(l=l[j]),l){e.bindFramebuffer(aH.FRAMEBUFFER,l);try{let e=a.textures[k],g=e.format,j=e.type;if(a.textures.length>1&&aH.readBuffer(aH.COLOR_ATTACHMENT0+k),!d.textureFormatReadable(g))return void V("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!d.textureTypeReadable(j))return void V("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");b>=0&&b<=a.width-f&&c>=0&&c<=a.height-h&&aH.readPixels(b,c,f,h,w.convert(g),w.convert(j),i)}finally{let a=null!==ae?g.get(ae).__webglFramebuffer:null;e.bindFramebuffer(aH.FRAMEBUFFER,a)}}},this.readRenderTargetPixelsAsync=async function(a,b,c,f,h,i,j,k=0){if(!(a&&a.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=g.get(a).__webglFramebuffer;if(a.isWebGLCubeRenderTarget&&void 0!==j&&(l=l[j]),l)if(b>=0&&b<=a.width-f&&c>=0&&c<=a.height-h){e.bindFramebuffer(aH.FRAMEBUFFER,l);let j=a.textures[k],m=j.format,n=j.type;if(a.textures.length>1&&aH.readBuffer(aH.COLOR_ATTACHMENT0+k),!d.textureFormatReadable(m))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!d.textureTypeReadable(n))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let o=aH.createBuffer();aH.bindBuffer(aH.PIXEL_PACK_BUFFER,o),aH.bufferData(aH.PIXEL_PACK_BUFFER,i.byteLength,aH.STREAM_READ),aH.readPixels(b,c,f,h,w.convert(m),w.convert(n),0);let p=null!==ae?g.get(ae).__webglFramebuffer:null;e.bindFramebuffer(aH.FRAMEBUFFER,p);let q=aH.fenceSync(aH.SYNC_GPU_COMMANDS_COMPLETE,0);return aH.flush(),await X(aH,q,4),aH.bindBuffer(aH.PIXEL_PACK_BUFFER,o),aH.getBufferSubData(aH.PIXEL_PACK_BUFFER,0,i),aH.deleteBuffer(o),aH.deleteSync(q),i}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(a,b=null,c=0){let d=Math.pow(2,-c),f=Math.floor(a.image.width*d),g=Math.floor(a.image.height*d),i=null!==b?b.x:0,j=null!==b?b.y:0;h.setTexture2D(a,0),aH.copyTexSubImage2D(aH.TEXTURE_2D,c,0,0,i,j,f,g),e.unbindTexture()};const a2=aH.createFramebuffer(),a3=aH.createFramebuffer();this.copyTextureToTexture=function(a,b,c=null,d=null,f=0,i=0){let j,k,l,m,n,o,p,q,r,s,t=a.isCompressedTexture?a.mipmaps[i]:a.image;if(null!==c)j=c.max.x-c.min.x,k=c.max.y-c.min.y,l=c.isBox3?c.max.z-c.min.z:1,m=c.min.x,n=c.min.y,o=c.isBox3?c.min.z:0;else{let b=Math.pow(2,-f);j=Math.floor(t.width*b),k=Math.floor(t.height*b),l=a.isDataArrayTexture?t.depth:a.isData3DTexture?Math.floor(t.depth*b):1,m=0,n=0,o=0}null!==d?(p=d.x,q=d.y,r=d.z):(p=0,q=0,r=0);let u=w.convert(b.format),v=w.convert(b.type);b.isData3DTexture?(h.setTexture3D(b,0),s=aH.TEXTURE_3D):b.isDataArrayTexture||b.isCompressedArrayTexture?(h.setTexture2DArray(b,0),s=aH.TEXTURE_2D_ARRAY):(h.setTexture2D(b,0),s=aH.TEXTURE_2D),aH.pixelStorei(aH.UNPACK_FLIP_Y_WEBGL,b.flipY),aH.pixelStorei(aH.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),aH.pixelStorei(aH.UNPACK_ALIGNMENT,b.unpackAlignment);let x=aH.getParameter(aH.UNPACK_ROW_LENGTH),y=aH.getParameter(aH.UNPACK_IMAGE_HEIGHT),z=aH.getParameter(aH.UNPACK_SKIP_PIXELS),A=aH.getParameter(aH.UNPACK_SKIP_ROWS),B=aH.getParameter(aH.UNPACK_SKIP_IMAGES);aH.pixelStorei(aH.UNPACK_ROW_LENGTH,t.width),aH.pixelStorei(aH.UNPACK_IMAGE_HEIGHT,t.height),aH.pixelStorei(aH.UNPACK_SKIP_PIXELS,m),aH.pixelStorei(aH.UNPACK_SKIP_ROWS,n),aH.pixelStorei(aH.UNPACK_SKIP_IMAGES,o);let C=a.isDataArrayTexture||a.isData3DTexture,D=b.isDataArrayTexture||b.isData3DTexture;if(a.isDepthTexture){let c=g.get(a),d=g.get(b),h=g.get(c.__renderTarget),s=g.get(d.__renderTarget);e.bindFramebuffer(aH.READ_FRAMEBUFFER,h.__webglFramebuffer),e.bindFramebuffer(aH.DRAW_FRAMEBUFFER,s.__webglFramebuffer);for(let c=0;c<l;c++)C&&(aH.framebufferTextureLayer(aH.READ_FRAMEBUFFER,aH.COLOR_ATTACHMENT0,g.get(a).__webglTexture,f,o+c),aH.framebufferTextureLayer(aH.DRAW_FRAMEBUFFER,aH.COLOR_ATTACHMENT0,g.get(b).__webglTexture,i,r+c)),aH.blitFramebuffer(m,n,j,k,p,q,j,k,aH.DEPTH_BUFFER_BIT,aH.NEAREST);e.bindFramebuffer(aH.READ_FRAMEBUFFER,null),e.bindFramebuffer(aH.DRAW_FRAMEBUFFER,null)}else if(0!==f||a.isRenderTargetTexture||g.has(a)){let c=g.get(a),d=g.get(b);e.bindFramebuffer(aH.READ_FRAMEBUFFER,a2),e.bindFramebuffer(aH.DRAW_FRAMEBUFFER,a3);for(let a=0;a<l;a++)C?aH.framebufferTextureLayer(aH.READ_FRAMEBUFFER,aH.COLOR_ATTACHMENT0,c.__webglTexture,f,o+a):aH.framebufferTexture2D(aH.READ_FRAMEBUFFER,aH.COLOR_ATTACHMENT0,aH.TEXTURE_2D,c.__webglTexture,f),D?aH.framebufferTextureLayer(aH.DRAW_FRAMEBUFFER,aH.COLOR_ATTACHMENT0,d.__webglTexture,i,r+a):aH.framebufferTexture2D(aH.DRAW_FRAMEBUFFER,aH.COLOR_ATTACHMENT0,aH.TEXTURE_2D,d.__webglTexture,i),0!==f?aH.blitFramebuffer(m,n,j,k,p,q,j,k,aH.COLOR_BUFFER_BIT,aH.NEAREST):D?aH.copyTexSubImage3D(s,i,p,q,r+a,m,n,j,k):aH.copyTexSubImage2D(s,i,p,q,m,n,j,k);e.bindFramebuffer(aH.READ_FRAMEBUFFER,null),e.bindFramebuffer(aH.DRAW_FRAMEBUFFER,null)}else D?a.isDataTexture||a.isData3DTexture?aH.texSubImage3D(s,i,p,q,r,j,k,l,u,v,t.data):b.isCompressedArrayTexture?aH.compressedTexSubImage3D(s,i,p,q,r,j,k,l,u,t.data):aH.texSubImage3D(s,i,p,q,r,j,k,l,u,v,t):a.isDataTexture?aH.texSubImage2D(aH.TEXTURE_2D,i,p,q,j,k,u,v,t.data):a.isCompressedTexture?aH.compressedTexSubImage2D(aH.TEXTURE_2D,i,p,q,t.width,t.height,u,t.data):aH.texSubImage2D(aH.TEXTURE_2D,i,p,q,j,k,u,v,t);aH.pixelStorei(aH.UNPACK_ROW_LENGTH,x),aH.pixelStorei(aH.UNPACK_IMAGE_HEIGHT,y),aH.pixelStorei(aH.UNPACK_SKIP_PIXELS,z),aH.pixelStorei(aH.UNPACK_SKIP_ROWS,A),aH.pixelStorei(aH.UNPACK_SKIP_IMAGES,B),0===i&&b.generateMipmaps&&aH.generateMipmap(s),e.unbindTexture()},this.initRenderTarget=function(a){void 0===g.get(a).__webglFramebuffer&&h.setupRenderTarget(a)},this.initTexture=function(a){a.isCubeTexture?h.setTextureCube(a,0):a.isData3DTexture?h.setTexture3D(a,0):a.isDataArrayTexture||a.isCompressedArrayTexture?h.setTexture2DArray(a,0):h.setTexture2D(a,0),e.unbindTexture()},this.resetState=function(){ac=0,ad=0,ae=null,e.reset(),x.reset()},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(a){this._outputColorSpace=a;let b=this.getContext();b.drawingBufferColorSpace=as._getDrawingBufferColorSpace(a),b.unpackColorSpace=as._getUnpackColorSpace()}}a.s(["PMREMGenerator",()=>iw,"ShaderChunk",()=>ib,"ShaderLib",()=>id,"UniformsLib",()=>ic,"WebGLCubeRenderTarget",()=>iC,"WebGLRenderer",()=>ky,"WebGLUtils",()=>kn],66110);var kz=a.i(64442);let kA=a=>{let b,c=new Set,d=(a,d)=>{let e="function"==typeof a?a(b):a;if(!Object.is(e,b)){let a=b;b=(null!=d?d:"object"!=typeof e||null===e)?e:Object.assign({},b,e),c.forEach(c=>c(b,a))}},e=()=>b,f={setState:d,getState:e,getInitialState:()=>g,subscribe:a=>(c.add(a),()=>c.delete(a))},g=b=a(d,e,f);return f},{useSyncExternalStoreWithSelector:kB}=kz.default,kC=(a,b)=>{let c=a?kA(a):kA,d=(a,d=b)=>(function(a,b=a=>a,c){let d=kB(a.subscribe,a.getState,a.getInitialState,b,c);return v.default.useDebugValue(d),d})(c,a,d);return Object.assign(d,c),d},kD=(a,b)=>a?kC(a,b):kC,kE=[];function kF(a,b,c=(a,b)=>a===b){if(a===b)return!0;if(!a||!b)return!1;let d=a.length;if(b.length!==d)return!1;for(let e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0}function kG(a,b=null,c=!1,d={}){for(let e of(null===b&&(b=[a]),kE))if(kF(b,e.keys,e.equal)){if(c)return;if(Object.prototype.hasOwnProperty.call(e,"error"))throw e.error;if(Object.prototype.hasOwnProperty.call(e,"response"))return d.lifespan&&d.lifespan>0&&(e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(e.remove,d.lifespan)),e.response;if(!c)throw e.promise}let e={keys:b,equal:d.equal,remove:()=>{let a=kE.indexOf(e);-1!==a&&kE.splice(a,1)},promise:("object"==typeof a&&"function"==typeof a.then?a:a(...b)).then(a=>{e.response=a,d.lifespan&&d.lifespan>0&&(e.timeout=setTimeout(e.remove,d.lifespan))}).catch(a=>e.error=a)};if(kE.push(e),!c)throw e.promise}var kH=a.i(90693),kI=a.i(87924),kJ=v;function kK(a,b,c){if(!a)return;if(!0===c(a))return a;let d=b?a.return:a.child;for(;d;){let a=kK(d,b,c);if(a)return a;d=b?null:d.sibling}}function kL(a){try{return Object.defineProperties(a,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(b){return a}}kJ.useEffect;let kM=kL(kJ.createContext(null));class kN extends kJ.Component{render(){return kJ.createElement(kM.Provider,{value:this._reactInternals},this.props.children)}}function kO(){let a=kJ.useContext(kM);if(null===a)throw Error("its-fine: useFiber must be called within a <FiberProvider />!");let b=kJ.useId();return kJ.useMemo(()=>{for(let c of[a,null==a?void 0:a.alternate]){if(!c)continue;let a=kK(c,!1,a=>{let c=a.memoizedState;for(;c;){if(c.memoizedState===b)return!0;c=c.next}});if(a)return a}},[a,b])}let kP=Symbol.for("react.context"),kQ=a=>null!==a&&"object"==typeof a&&"$$typeof"in a&&a.$$typeof===kP;function kR(a){let b=a.root;for(;b.getState().previousRoot;)b=b.getState().previousRoot;return b}v.act;let kS=a=>a&&a.hasOwnProperty("current"),kT=a=>null!=a&&("string"==typeof a||"number"==typeof a||a.isColor),kU=v.useEffect;function kV(a){let b=v.useRef(a);return kU(()=>void(b.current=a),[a]),b}function kW(){let a,b=kO(),c=(a=function(){let a=kO(),[b]=kJ.useState(()=>new Map);b.clear();let c=a;for(;c;){let a=c.type;kQ(a)&&a!==kM&&!b.has(a)&&b.set(a,kJ.use(kL(a))),c=c.return}return b}(),kJ.useMemo(()=>Array.from(a.keys()).reduce((b,c)=>d=>kJ.createElement(b,null,kJ.createElement(c.Provider,{...d,value:a.get(c)})),a=>kJ.createElement(kN,{...a})),[a]));return v.useMemo(()=>({children:a})=>{let d=kK(b,!0,a=>a.type===v.StrictMode)?v.StrictMode:v.Fragment;return(0,kI.jsx)(d,{children:(0,kI.jsx)(c,{children:a})})},[b,c])}function kX({set:a}){return kU(()=>(a(new Promise(()=>null)),()=>a(!1)),[a]),null}let kY=((p=class extends v.Component{constructor(...a){super(...a),this.state={error:!1}}componentDidCatch(a){this.props.set(a)}render(){return this.state.error?null:this.props.children}}).getDerivedStateFromError=()=>({error:!0}),p);function kZ(a){return Array.isArray(a)?Math.min(Math.max(a[0],1),a[1]):a}function k$(a){var b;return null==(b=a.__r3f)?void 0:b.root.getState()}let k_={obj:a=>a===Object(a)&&!k_.arr(a)&&"function"!=typeof a,fun:a=>"function"==typeof a,str:a=>"string"==typeof a,num:a=>"number"==typeof a,boo:a=>"boolean"==typeof a,und:a=>void 0===a,nul:a=>null===a,arr:a=>Array.isArray(a),equ(a,b,{arrays:c="shallow",objects:d="reference",strict:e=!0}={}){let f;if(typeof a!=typeof b||!!a!=!!b)return!1;if(k_.str(a)||k_.num(a)||k_.boo(a))return a===b;let g=k_.obj(a);if(g&&"reference"===d)return a===b;let h=k_.arr(a);if(h&&"reference"===c)return a===b;if((h||g)&&a===b)return!0;for(f in a)if(!(f in b))return!1;if(g&&"shallow"===c&&"shallow"===d){for(f in e?b:a)if(!k_.equ(a[f],b[f],{strict:e,objects:"reference"}))return!1}else for(f in e?b:a)if(a[f]!==b[f])return!1;if(k_.und(f)){if(h&&0===a.length&&0===b.length||g&&0===Object.keys(a).length&&0===Object.keys(b).length)return!0;if(a!==b)return!1}return!0}},k0=["children","key","ref"];function k1(a,b,c,d){let e=null==a?void 0:a.__r3f;return!e&&(e={root:b,type:c,parent:null,children:[],props:function(a){let b={};for(let c in a)k0.includes(c)||(b[c]=a[c]);return b}(d),object:a,eventCount:0,handlers:{},isHidden:!1},a&&(a.__r3f=e)),e}function k2(a,b){if(!b.includes("-")||b in a)return{root:a,key:b,target:a[b]};let c=a,d=b.split("-");for(let e of d){if("object"!=typeof c||null===c){if(void 0!==c)return{root:c,key:d.slice(d.indexOf(e)).join("-"),target:void 0};return{root:a,key:b,target:void 0}}b=e,a=c,c=c[b]}return{root:a,key:b,target:c}}let k3=/-\d+$/;function k4(a,b){if(k_.str(b.props.attach)){if(k3.test(b.props.attach)){let c=b.props.attach.replace(k3,""),{root:d,key:e}=k2(a.object,c);Array.isArray(d[e])||(d[e]=[])}let{root:c,key:d}=k2(a.object,b.props.attach);b.previousAttach=c[d],c[d]=b.object}else k_.fun(b.props.attach)&&(b.previousAttach=b.props.attach(a.object,b.object))}function k5(a,b){if(k_.str(b.props.attach)){let{root:c,key:d}=k2(a.object,b.props.attach),e=b.previousAttach;void 0===e?delete c[d]:c[d]=e}else null==b.previousAttach||b.previousAttach(a.object,b.object);delete b.previousAttach}let k6=[...k0,"args","dispose","attach","object","onUpdate","dispose"],k7=new Map,k8=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],k9=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function la(a,b){var c,d;let e=a.__r3f,f=e&&kR(e).getState(),g=null==e?void 0:e.eventCount;for(let c in b){let g=b[c];if(k6.includes(c))continue;if(e&&k9.test(c)){"function"==typeof g?e.handlers[c]=g:delete e.handlers[c],e.eventCount=Object.keys(e.handlers).length;continue}if(void 0===g)continue;let{root:h,key:i,target:j}=k2(a,c);if(void 0===j&&("object"!=typeof h||null===h))throw Error(`R3F: Cannot set "${c}". Ensure it is an object before setting "${i}".`);j instanceof aU&&g instanceof aU?j.mask=g.mask:j instanceof bg&&kT(g)?j.set(g):null!==j&&"object"==typeof j&&"function"==typeof j.set&&"function"==typeof j.copy&&null!=g&&g.constructor&&j.constructor===g.constructor?j.copy(g):null!==j&&"object"==typeof j&&"function"==typeof j.set&&Array.isArray(g)?"function"==typeof j.fromArray?j.fromArray(g):j.set(...g):null!==j&&"object"==typeof j&&"function"==typeof j.set&&"number"==typeof g?"function"==typeof j.setScalar?j.setScalar(g):j.set(g):(h[i]=g,f&&!f.linear&&k8.includes(i)&&null!=(d=h[i])&&d.isTexture&&1023===h[i].format&&1009===h[i].type&&(h[i].colorSpace=A))}if(null!=e&&e.parent&&null!=f&&f.internal&&null!=(c=e.object)&&c.isObject3D&&g!==e.eventCount){let a=e.object,b=f.internal.interaction.indexOf(a);b>-1&&f.internal.interaction.splice(b,1),e.eventCount&&null!==a.raycast&&f.internal.interaction.push(a)}return e&&void 0===e.props.attach&&(e.object.isBufferGeometry?e.props.attach="geometry":e.object.isMaterial&&(e.props.attach="material")),e&&lb(e),a}function lb(a){var b;if(!a.parent)return;null==a.props.onUpdate||a.props.onUpdate(a.object);let c=null==(b=a.root)||null==b.getState?void 0:b.getState();c&&0===c.internal.frames&&c.invalidate()}function lc(a,b){!a.manual&&(a&&a.isOrthographicCamera?(a.left=-(b.width/2),a.right=b.width/2,a.top=b.height/2,a.bottom=-(b.height/2)):a.aspect=b.width/b.height,a.updateProjectionMatrix())}let ld=a=>null==a?void 0:a.isObject3D;function le(a){return(a.eventObject||a.object).uuid+"/"+a.index+a.instanceId}function lf(a,b,c,d){let e=c.get(b);e&&(c.delete(b),0===c.size&&(a.delete(d),e.target.releasePointerCapture(d)))}let lg=a=>!!(null!=a&&a.render),lh=v.createContext(null);function li(){let a=v.useContext(lh);if(!a)throw Error("R3F: Hooks can only be used within the Canvas component!");return a}function lj(a=a=>a,b){return li()(a,b)}function lk(a,b=0){let c=li(),d=c.getState().internal.subscribe,e=kV(a);return kU(()=>d(e,b,c),[b,d,c]),null}let ll=new WeakMap;function lm(a,b){return function(c,...d){var e;let f;return"function"==typeof c&&(null==c||null==(e=c.prototype)?void 0:e.constructor)===c?(f=ll.get(c))||(f=new c,ll.set(c,f)):f=c,a&&a(f),Promise.all(d.map(a=>new Promise((c,d)=>f.load(a,a=>{var b;let d;ld(null==a?void 0:a.scene)&&Object.assign(a,(b=a.scene,d={nodes:{},materials:{},meshes:{}},b&&b.traverse(a=>{a.name&&(d.nodes[a.name]=a),a.material&&!d.materials[a.material.name]&&(d.materials[a.material.name]=a.material),a.isMesh&&!d.meshes[a.name]&&(d.meshes[a.name]=a)}),d)),c(a)},b,b=>d(Error(`Could not load ${a}: ${null==b?void 0:b.message}`))))))}}function ln(a,b,c,d){let e=Array.isArray(b)?b:[b],f=kG(lm(c,d),[a,...e],!1,{equal:k_.equ});return Array.isArray(b)?f:f[0]}ln.preload=function(a,b,c){let d,e=Array.isArray(b)?b:[b];kG(lm(c),[a,...e],!0,d)},ln.clear=function(a,b){var c=[a,...Array.isArray(b)?b:[b]];if(void 0===c||0===c.length)kE.splice(0,kE.length);else{let a=kE.find(a=>kF(c,a.keys,a.equal));a&&a.remove()}};var lo={exports:{}},lp={exports:{}};lp.exports;let lq=(u||(u=1,t||(t=1,lp.exports=function(a){function b(a,b,c,d){return new dW(a,b,c,d)}function c(){}function d(a){var b="https://react.dev/errors/"+a;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do(4098&(b=a).flags)!=0&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function f(a){if(e(a)!==a)throw Error(d(188))}function g(a){var b=a.alternate;if(!b){if(null===(b=e(a)))throw Error(d(188));return b!==a?null:a}for(var c=a,g=b;;){var h=c.return;if(null===h)break;var i=h.alternate;if(null===i){if(null!==(g=h.return)){c=g;continue}break}if(h.child===i.child){for(i=h.child;i;){if(i===c)return f(h),a;if(i===g)return f(h),b;i=i.sibling}throw Error(d(188))}if(c.return!==g.return)c=h,g=i;else{for(var j=!1,k=h.child;k;){if(k===c){j=!0,c=h,g=i;break}if(k===g){j=!0,g=h,c=i;break}k=k.sibling}if(!j){for(k=i.child;k;){if(k===c){j=!0,c=i,g=h;break}if(k===g){j=!0,g=i,c=h;break}k=k.sibling}if(!j)throw Error(d(189))}}if(c.alternate!==g)throw Error(d(190))}if(3!==c.tag)throw Error(d(188));return c.stateNode.current===c?a:b}function h(a){return null===a||"object"!=typeof a?null:"function"==typeof(a=es&&a[es]||a["@@iterator"])?a:null}function i(a){if(null==a)return null;if("function"==typeof a)return a.$$typeof===et?null:a.displayName||a.name||null;if("string"==typeof a)return a;switch(a){case eg:return"Fragment";case ei:return"Profiler";case eh:return"StrictMode";case em:return"Suspense";case en:return"SuspenseList";case eq:return"Activity"}if("object"==typeof a)switch(a.$$typeof){case ef:return"Portal";case ek:return a.displayName||"Context";case ej:return(a._context.displayName||"Context")+".Consumer";case el:var b=a.render;return(a=a.displayName)||(a=""!==(a=b.displayName||b.name||"")?"ForwardRef("+a+")":"ForwardRef"),a;case eo:return null!==(b=a.displayName||null)?b:i(a.type)||"Memo";case ep:b=a._payload,a=a._init;try{return i(a(b))}catch{}}return null}function j(a){return{current:a}}function k(a){0>gw||(a.current=gv[gw],gv[gw]=null,gw--)}function l(a,b){gv[++gw]=a.current,a.current=b}function m(a){var b=42&a;if(0!==b)return b;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&a;case 262144:case 524288:case 1048576:case 2097152:return 3932160&a;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&a;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return a}}function n(a,b,c){var d=a.pendingLanes;if(0===d)return 0;var e=0,f=a.suspendedLanes,g=a.pingedLanes;a=a.warmLanes;var h=0x7ffffff&d;return 0!==h?0!=(d=h&~f)?e=m(d):0!=(g&=h)?e=m(g):c||0!=(c=h&~a)&&(e=m(c)):0!=(h=d&~f)?e=m(h):0!==g?e=m(g):c||0!=(c=d&~a)&&(e=m(c)),0===e?0:0!==b&&b!==e&&(b&f)==0&&((f=e&-e)>=(c=b&-b)||32===f&&(4194048&c)!=0)?b:e}function o(a,b){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&b)==0}function p(){var a=gD;return(0x3c00000&(gD<<=1))==0&&(gD=4194304),a}function q(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}function r(a,b){a.pendingLanes|=b,0x10000000!==b&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function s(a,b,c){a.pendingLanes|=b,a.suspendedLanes&=~b;var d=31-gy(b);a.entangledLanes|=b,a.entanglements[d]=0x40000000|a.entanglements[d]|261930&c}function t(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-gy(c),e=1<<d;e&b|a[d]&b&&(a[d]|=b),c&=~e}}function u(a,b){var c=b&-b;return((c=(42&c)!=0?1:w(c))&(a.suspendedLanes|b))!=0?0:c}function w(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 0x1000000:case 0x2000000:a=128;break;case 0x10000000:a=0x8000000;break;default:a=0}return a}function x(a){return 2<(a&=-a)?8<a?(0x7ffffff&a)!=0?32:0x10000000:8:2}function y(a){if("function"==typeof gN&&gO(a),gQ&&"function"==typeof gQ.setStrictMode)try{gQ.setStrictMode(gP,a)}catch{}}function z(a){if(void 0===f7)try{throw Error()}catch(a){var b=a.stack.trim().match(/\n( *(at )?)/);f7=b&&b[1]||"",f8=-1<a.stack.indexOf(`
|
|
383
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
384
|
+
`+f7+a+f8}function A(a,b){if(!a||gU)return"";gU=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(b){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(c,[])}catch(a){var d=a}Reflect.construct(a,[],c)}else{try{c.call()}catch(a){d=a}a.call(c.prototype)}}else{try{throw Error()}catch(a){d=a}(c=a())&&"function"==typeof c.catch&&c.catch(function(){})}}catch(a){if(a&&d&&"string"==typeof a.stack)return[a.stack,d.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var e=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");e&&e.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=d.DetermineComponentFrameRoot(),g=f[0],h=f[1];if(g&&h){var i=g.split(`
|
|
385
|
+
`),j=h.split(`
|
|
386
|
+
`);for(e=d=0;d<i.length&&!i[d].includes("DetermineComponentFrameRoot");)d++;for(;e<j.length&&!j[e].includes("DetermineComponentFrameRoot");)e++;if(d===i.length||e===j.length)for(d=i.length-1,e=j.length-1;1<=d&&0<=e&&i[d]!==j[e];)e--;for(;1<=d&&0<=e;d--,e--)if(i[d]!==j[e]){if(1!==d||1!==e)do if(d--,e--,0>e||i[d]!==j[e]){var k=`
|
|
387
|
+
`+i[d].replace(" at new "," at ");return a.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",a.displayName)),k}while(1<=d&&0<=e)break}}}finally{gU=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?z(c):""}function B(a){try{var b="",c=null;do b+=function(a,b){switch(a.tag){case 26:case 27:case 5:return z(a.type);case 16:return z("Lazy");case 13:return a.child!==b&&null!==b?z("Suspense Fallback"):z("Suspense");case 19:return z("SuspenseList");case 0:case 15:return A(a.type,!1);case 11:return A(a.type.render,!1);case 1:return A(a.type,!0);case 31:return z("Activity");default:return""}}(a,c),c=a,a=a.return;while(a)return b}catch(a){return`
|
|
388
|
+
Error generating stack: `+a.message+`
|
|
389
|
+
`+a.stack}}function C(a,b){if("object"==typeof a&&null!==a){var c=gV.get(a);return void 0!==c?c:(b={value:a,source:b,stack:B(b)},gV.set(a,b),b)}return{value:a,source:b,stack:B(b)}}function D(a,b){gW[gX++]=gZ,gW[gX++]=gY,gY=a,gZ=b}function E(a,b,c){g$[g_++]=g1,g$[g_++]=g2,g$[g_++]=g0,g0=a;var d=g1;a=g2;var e=32-gy(d)-1;d&=~(1<<e),c+=1;var f=32-gy(b)+e;if(30<f){var g=e-e%5;f=(d&(1<<g)-1).toString(32),d>>=g,e-=g,g1=1<<32-gy(b)+e|c<<e|d,g2=f+a}else g1=1<<f|c<<e|d,g2=a}function F(a){null!==a.return&&(D(a,1),E(a,1,0))}function G(a){for(;a===gY;)gY=gW[--gX],gW[gX]=null,gZ=gW[--gX],gW[gX]=null;for(;a===g0;)g0=g$[--g_],g$[g_]=null,g2=g$[--g_],g$[g_]=null,g1=g$[--g_],g$[g_]=null}function H(a,b){g$[g_++]=g1,g$[g_++]=g2,g$[g_++]=g0,g1=b.id,g2=b.overflow,g0=a}function I(a,b){l(g5,b),l(g4,a),l(g3,null),a=eA(b),k(g3),l(g3,a)}function J(){k(g3),k(g4),k(g5)}function K(a){null!==a.memoizedState&&l(g6,a);var b=g3.current,c=eB(b,a.type);b!==c&&(l(g4,a),l(g3,c))}function L(a){g4.current===a&&(k(g3),k(g4)),g6.current===a&&(k(g6),eM?e3._currentValue=e2:e3._currentValue2=e2)}function M(a){var b=Error(d(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML",""));throw S(C(b,a)),hc}function N(a,b){if(!eP)throw Error(d(175));fS(a.stateNode,a.type,a.memoizedProps,b,a)||M(a,!0)}function O(a){for(g7=a.return;g7;)switch(g7.tag){case 5:case 31:case 13:hb=!1;return;case 27:case 3:hb=!0;return;default:g7=g7.return}}function P(a){if(!eP||a!==g7)return!1;if(!g9)return O(a),g9=!0,!1;var b=a.tag;if(gp?3!==b&&27!==b&&(5!==b||f6(a.type)&&!eH(a.type,a.memoizedProps))&&g8&&M(a):3!==b&&(5!==b||f6(a.type)&&!eH(a.type,a.memoizedProps))&&g8&&M(a),O(a),13===b){if(!eP)throw Error(d(316));if(!(a=null!==(a=a.memoizedState)?a.dehydrated:null))throw Error(d(317));g8=fX(a)}else if(31===b){if(!(a=null!==(a=a.memoizedState)?a.dehydrated:null))throw Error(d(317));g8=fW(a)}else g8=gp&&27===b?fI(a.type,g8):g7?fH(a.stateNode):null;return!0}function Q(){eP&&(g8=g7=null,g9=!1)}function R(){var a=ha;return null!==a&&(null===iG?iG=a:iG.push.apply(iG,a),ha=null),a}function S(a){null===ha?ha=[a]:ha.push(a)}function T(a,b,c){eM?(l(hd,b._currentValue),b._currentValue=c):(l(hd,b._currentValue2),b._currentValue2=c)}function U(a){var b=hd.current;eM?a._currentValue=b:a._currentValue2=b,k(hd)}function V(a,b,c){for(;null!==a;){var d=a.alternate;if((a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b),a===c)break;a=a.return}}function W(a,b,c,e){var f=a.child;for(null!==f&&(f.return=a);null!==f;){var g=f.dependencies;if(null!==g){var h=f.child;g=g.firstContext;h:for(;null!==g;){var i=g;g=f;for(var j=0;j<b.length;j++)if(i.context===b[j]){g.lanes|=c,null!==(i=g.alternate)&&(i.lanes|=c),V(g.return,c,a),e||(h=null);break h}g=i.next}}else if(18===f.tag){if(null===(h=f.return))throw Error(d(341));h.lanes|=c,null!==(g=h.alternate)&&(g.lanes|=c),V(h,c,a),h=null}else h=f.child;if(null!==h)h.return=f;else for(h=f;null!==h;){if(h===a){h=null;break}if(null!==(f=h.sibling)){f.return=h.return,h=f;break}h=h.return}f=h}}function X(a,b,c,e){a=null;for(var f=b,g=!1;null!==f;){if(!g){if((524288&f.flags)!=0)g=!0;else if((262144&f.flags)!=0)break}if(10===f.tag){var h=f.alternate;if(null===h)throw Error(d(387));if(null!==(h=h.memoizedProps)){var i=f.type;gR(f.pendingProps.value,h.value)||(null!==a?a.push(i):a=[i])}}else if(f===g6.current){if(null===(h=f.alternate))throw Error(d(387));h.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(null!==a?a.push(e3):a=[e3])}f=f.return}null!==a&&W(b,a,c,e),b.flags|=262144}function Y(a){for(a=a.firstContext;null!==a;){var b=a.context;if(!gR(eM?b._currentValue:b._currentValue2,a.memoizedValue))return!0;a=a.next}return!1}function Z(a){he=a,hf=null,null!==(a=a.dependencies)&&(a.firstContext=null)}function $(a){return aa(he,a)}function _(a,b){return null===he&&Z(a),aa(a,b)}function aa(a,b){var c=eM?b._currentValue:b._currentValue2;if(b={context:b,memoizedValue:c,next:null},null===hf){if(null===a)throw Error(d(308));hf=b,a.dependencies={lanes:0,firstContext:b},a.flags|=524288}else hf=hf.next=b;return c}function ab(){return{controller:new hg,data:new Map,refCount:0}}function ac(a){a.refCount--,0===a.refCount&&hh(hi,function(){a.controller.abort()})}function ad(){}function ae(a){a!==hl&&null===a.next&&(null===hl?hk=hl=a:hl=hl.next=a),hn=!0,hm||(hm=!0,e5?e6(function(){(6&ip)!=0?gE(gJ,ag):ah()}):gE(gJ,ag))}function af(a,b){if(!ho&&hn){ho=!0;do for(var c=!1,d=hk;null!==d;){if(!b)if(0!==a){var e=d.pendingLanes;if(0===e)var f=0;else{var g=d.suspendedLanes,h=d.pingedLanes;f=0xc000095&(f=(1<<31-gy(42|a)+1)-1&(e&~(g&~h)))?0xc000095&f|1:f?2|f:0}0!==f&&(c=!0,ak(d,f))}else f=is,(3&(f=n(d,d===iq?f:0,null!==d.cancelPendingCommit||d.timeoutHandle!==eL)))==0||o(d,f)||(c=!0,ak(d,f));d=d.next}while(c)ho=!1}}function ag(){ah()}function ah(){hn=hm=!1;var a=0;0!==hp&&eV()&&(a=hp);for(var b=gI(),c=null,d=hk;null!==d;){var e=d.next,f=ai(d,b);0===f?(d.next=null,null===c?hk=e:c.next=e,null===e&&(hl=c)):(c=d,(0!==a||(3&f)!=0)&&(hn=!0)),d=e}0!==iN&&5!==iN||af(a,!1),0!==hp&&(hp=0)}function ai(a,b){for(var c=a.suspendedLanes,d=a.pingedLanes,e=a.expirationTimes,f=-0x3c00001&a.pendingLanes;0<f;){var g=31-gy(f),h=1<<g,i=e[g];-1===i?((h&c)==0||(h&d)!=0)&&(e[g]=function(a,b){switch(a){case 1:case 2:case 4:case 8:case 64:return b+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b+5e3;default:return -1}}(h,b)):i<=b&&(a.expiredLanes|=h),f&=~h}if(b=iq,c=is,c=n(a,a===b?c:0,null!==a.cancelPendingCommit||a.timeoutHandle!==eL),d=a.callbackNode,0===c||a===b&&(2===it||9===it)||null!==a.cancelPendingCommit)return null!==d&&null!==d&&gF(d),a.callbackNode=null,a.callbackPriority=0;if((3&c)==0||o(a,c)){if((b=c&-c)===a.callbackPriority)return b;switch(null!==d&&gF(d),x(c)){case 2:case 8:c=gK;break;case 32:default:c=gL;break;case 0x10000000:c=gM}return c=gE(c,d=aj.bind(null,a)),a.callbackPriority=b,a.callbackNode=c,b}return null!==d&&null!==d&&gF(d),a.callbackPriority=2,a.callbackNode=null,2}function aj(a,b){if(0!==iN&&5!==iN)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(dN()&&a.callbackNode!==c)return null;var d=is;return 0===(d=n(a,a===iq?d:0,null!==a.cancelPendingCommit||a.timeoutHandle!==eL))?null:(dr(a,d,b),ai(a,gI()),null!=a.callbackNode&&a.callbackNode===c?aj.bind(null,a):null)}function ak(a,b){if(dN())return null;dr(a,b,!0)}function al(){if(0===hp){var a=hs;0===a&&(a=gB,(261888&(gB<<=1))==0&&(gB=256)),hp=a}return hp}function am(){if(0==--hr&&null!==hq){null!==ht&&(ht.status="fulfilled");var a=hq;hq=null,hs=0,ht=null;for(var b=0;b<a.length;b++)(0,a[b])()}}function an(){var a=hv.current;return null!==a?a:iq.pooledCache}function ao(a,b){null===b?l(hv,hv.current):l(hv,b.pool)}function ap(){var a=an();return null===a?null:{parent:eM?hj._currentValue:hj._currentValue2,pool:a}}function aq(a,b){if(gR(a,b))return!0;if("object"!=typeof a||null===a||"object"!=typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var e=c[d];if(!gT.call(b,e)||!gR(a[e],b[e]))return!1}return!0}function ar(a){return"fulfilled"===(a=a.status)||"rejected"===a}function as(a,b,c){switch(void 0===(c=a[c])?a.push(b):c!==b&&(b.then(ad,ad),b=c),b.status){case"fulfilled":return b.value;case"rejected":throw av(a=b.reason),a;default:if("string"==typeof b.status)b.then(ad,ad);else{if(null!==(a=iq)&&100<a.shellSuspendCounter)throw Error(d(482));(a=b).status="pending",a.then(function(a){if("pending"===b.status){var c=b;c.status="fulfilled",c.value=a}},function(a){if("pending"===b.status){var c=b;c.status="rejected",c.reason=a}})}switch(b.status){case"fulfilled":return b.value;case"rejected":throw av(a=b.reason),a}throw hA=b,hw}}function at(a){try{return(0,a._init)(a._payload)}catch(a){throw null!==a&&"object"==typeof a&&"function"==typeof a.then?(hA=a,hw):a}}function au(){if(null===hA)throw Error(d(459));var a=hA;return hA=null,a}function av(a){if(a===hw||a===hy)throw Error(d(483))}function aw(a){var b=hC;return hC+=1,null===hB&&(hB=[]),as(hB,a,b)}function ax(a,b){a.ref=void 0!==(b=b.props.ref)?b:null}function ay(a,b){throw b.$$typeof===ed?Error(d(525)):Error(d(31,"[object Object]"===(a=Object.prototype.toString.call(b))?"object with keys {"+Object.keys(b).join(", ")+"}":a))}function az(a){function c(b,c){if(a){var d=b.deletions;null===d?(b.deletions=[c],b.flags|=16):d.push(c)}}function e(b,d){if(!a)return null;for(;null!==d;)c(b,d),d=d.sibling;return null}function f(a){for(var b=new Map;null!==a;)null!==a.key?b.set(a.key,a):b.set(a.index,a),a=a.sibling;return b}function g(a,b){return(a=dY(a,b)).index=0,a.sibling=null,a}function i(b,c,d){return b.index=d,a?null!==(d=b.alternate)?(d=d.index)<c?(b.flags|=0x4000002,c):d:(b.flags|=0x4000002,c):(b.flags|=1048576,c)}function j(b){return a&&null===b.alternate&&(b.flags|=0x4000002),b}function k(a,b,c,d){return null===b||6!==b.tag?(b=d0(c,a.mode,d)).return=a:(b=g(b,c)).return=a,b}function l(a,b,c,d){var e=c.type;return e===eg?n(a,b,c.props.children,d,c.key):(null!==b&&(b.elementType===e||"object"==typeof e&&null!==e&&e.$$typeof===ep&&at(e)===b.type)?ax(b=g(b,c.props),c):ax(b=d$(c.type,c.key,c.props,null,a.mode,d),c),b.return=a,b)}function m(a,b,c,d){return null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation?(b=d2(c,a.mode,d)).return=a:(b=g(b,c.children||[])).return=a,b}function n(a,b,c,d,e){return null===b||7!==b.tag?(b=d_(c,a.mode,d,e)).return=a:(b=g(b,c)).return=a,b}function o(a,b,c){if("string"==typeof b&&""!==b||"number"==typeof b||"bigint"==typeof b)return(b=d0(""+b,a.mode,c)).return=a,b;if("object"==typeof b&&null!==b){switch(b.$$typeof){case ee:return ax(c=d$(b.type,b.key,b.props,null,a.mode,c),b),c.return=a,c;case ef:return(b=d2(b,a.mode,c)).return=a,b;case ep:return o(a,b=at(b),c)}if(eu(b)||h(b))return(b=d_(b,a.mode,c,null)).return=a,b;if("function"==typeof b.then)return o(a,aw(b),c);if(b.$$typeof===ek)return o(a,_(a,b),c);ay(a,b)}return null}function p(a,b,c,d){var e=null!==b?b.key:null;if("string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c)return null!==e?null:k(a,b,""+c,d);if("object"==typeof c&&null!==c){switch(c.$$typeof){case ee:return c.key===e?l(a,b,c,d):null;case ef:return c.key===e?m(a,b,c,d):null;case ep:return p(a,b,c=at(c),d)}if(eu(c)||h(c))return null!==e?null:n(a,b,c,d,null);if("function"==typeof c.then)return p(a,b,aw(c),d);if(c.$$typeof===ek)return p(a,b,_(a,c),d);ay(a,c)}return null}function q(a,b,c,d,e){if("string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d)return k(b,a=a.get(c)||null,""+d,e);if("object"==typeof d&&null!==d){switch(d.$$typeof){case ee:return l(b,a=a.get(null===d.key?c:d.key)||null,d,e);case ef:return m(b,a=a.get(null===d.key?c:d.key)||null,d,e);case ep:return q(a,b,c,d=at(d),e)}if(eu(d)||h(d))return n(b,a=a.get(c)||null,d,e,null);if("function"==typeof d.then)return q(a,b,c,aw(d),e);if(d.$$typeof===ek)return q(a,b,c,_(b,d),e);ay(b,d)}return null}return function(k,l,m,n){try{hC=0;var r=function b(k,l,m,n){if("object"==typeof m&&null!==m&&m.type===eg&&null===m.key&&(m=m.props.children),"object"==typeof m&&null!==m){switch(m.$$typeof){case ee:h:{for(var r=m.key;null!==l;){if(l.key===r){if((r=m.type)===eg){if(7===l.tag){e(k,l.sibling),(n=g(l,m.props.children)).return=k,k=n;break h}}else if(l.elementType===r||"object"==typeof r&&null!==r&&r.$$typeof===ep&&at(r)===l.type){e(k,l.sibling),ax(n=g(l,m.props),m),n.return=k,k=n;break h}e(k,l);break}c(k,l),l=l.sibling}m.type===eg?(n=d_(m.props.children,k.mode,n,m.key)).return=k:(ax(n=d$(m.type,m.key,m.props,null,k.mode,n),m),n.return=k),k=n}return j(k);case ef:h:{for(r=m.key;null!==l;){if(l.key===r)if(4===l.tag&&l.stateNode.containerInfo===m.containerInfo&&l.stateNode.implementation===m.implementation){e(k,l.sibling),(n=g(l,m.children||[])).return=k,k=n;break h}else{e(k,l);break}c(k,l),l=l.sibling}(n=d2(m,k.mode,n)).return=k,k=n}return j(k);case ep:return b(k,l,m=at(m),n)}if(eu(m))return function(b,d,g,h){for(var j=null,k=null,l=d,m=d=0,n=null;null!==l&&m<g.length;m++){l.index>m?(n=l,l=null):n=l.sibling;var r=p(b,l,g[m],h);if(null===r){null===l&&(l=n);break}a&&l&&null===r.alternate&&c(b,l),d=i(r,d,m),null===k?j=r:k.sibling=r,k=r,l=n}if(m===g.length)return e(b,l),g9&&D(b,m),j;if(null===l){for(;m<g.length;m++)null!==(l=o(b,g[m],h))&&(d=i(l,d,m),null===k?j=l:k.sibling=l,k=l);return g9&&D(b,m),j}for(l=f(l);m<g.length;m++)null!==(n=q(l,b,m,g[m],h))&&(a&&null!==n.alternate&&l.delete(null===n.key?m:n.key),d=i(n,d,m),null===k?j=n:k.sibling=n,k=n);return a&&l.forEach(function(a){return c(b,a)}),g9&&D(b,m),j}(k,l,m,n);if(h(m)){if("function"!=typeof(r=h(m)))throw Error(d(150));return function(b,g,h,j){if(null==h)throw Error(d(151));for(var k=null,l=null,m=g,n=g=0,r=null,s=h.next();null!==m&&!s.done;n++,s=h.next()){m.index>n?(r=m,m=null):r=m.sibling;var t=p(b,m,s.value,j);if(null===t){null===m&&(m=r);break}a&&m&&null===t.alternate&&c(b,m),g=i(t,g,n),null===l?k=t:l.sibling=t,l=t,m=r}if(s.done)return e(b,m),g9&&D(b,n),k;if(null===m){for(;!s.done;n++,s=h.next())null!==(s=o(b,s.value,j))&&(g=i(s,g,n),null===l?k=s:l.sibling=s,l=s);return g9&&D(b,n),k}for(m=f(m);!s.done;n++,s=h.next())null!==(s=q(m,b,n,s.value,j))&&(a&&null!==s.alternate&&m.delete(null===s.key?n:s.key),g=i(s,g,n),null===l?k=s:l.sibling=s,l=s);return a&&m.forEach(function(a){return c(b,a)}),g9&&D(b,n),k}(k,l,m=r.call(m),n)}if("function"==typeof m.then)return b(k,l,aw(m),n);if(m.$$typeof===ek)return b(k,l,_(k,m),n);ay(k,m)}return"string"==typeof m&&""!==m||"number"==typeof m||"bigint"==typeof m?(m=""+m,null!==l&&6===l.tag?(e(k,l.sibling),(n=g(l,m)).return=k):(e(k,l),(n=d0(m,k.mode,n)).return=k),j(k=n)):e(k,l)}(k,l,m,n);return hB=null,r}catch(a){if(a===hw||a===hy)throw a;var s=b(29,a,null,k.mode);return s.lanes=n,s.return=k,s}finally{}}}function aA(){for(var a=hG,b=hH=hG=0;b<a;){var c=hF[b];hF[b++]=null;var d=hF[b];hF[b++]=null;var e=hF[b];hF[b++]=null;var f=hF[b];if(hF[b++]=null,null!==d&&null!==e){var g=d.pending;null===g?e.next=e:(e.next=g.next,g.next=e),d.pending=e}0!==f&&aE(c,e,f)}}function aB(a,b,c,d){hF[hG++]=a,hF[hG++]=b,hF[hG++]=c,hF[hG++]=d,hH|=d,a.lanes|=d,null!==(a=a.alternate)&&(a.lanes|=d)}function aC(a,b,c,d){return aB(a,b,c,d),aF(a)}function aD(a,b){return aB(a,null,null,b),aF(a)}function aE(a,b,c){a.lanes|=c;var d=a.alternate;null!==d&&(d.lanes|=c);for(var e=!1,f=a.return;null!==f;)f.childLanes|=c,null!==(d=f.alternate)&&(d.childLanes|=c),22===f.tag&&(null===(a=f.stateNode)||1&a._visibility||(e=!0)),a=f,f=f.return;return 3===a.tag?(f=a.stateNode,e&&null!==b&&(e=31-gy(c),null===(d=(a=f.hiddenUpdates)[e])?a[e]=[b]:d.push(b),b.lane=0x20000000|c),f):null}function aF(a){if(50<iU)throw iU=0,iV=null,Error(d(185));for(var b=a.return;null!==b;)b=(a=b).return;return 3===a.tag?a.stateNode:null}function aG(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function aH(a,b){a=a.updateQueue,b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function aI(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function aJ(a,b,c){var d=a.updateQueue;if(null===d)return null;if(d=d.shared,(2&ip)!=0){var e=d.pending;return null===e?b.next=b:(b.next=e.next,e.next=b),d.pending=b,b=aF(a),aE(a,null,c),b}return aB(a,d,b,c),aF(a)}function aK(a,b,c){if(null!==(b=b.updateQueue)&&(b=b.shared,(4194048&c)!=0)){var d=b.lanes;d&=a.pendingLanes,c|=d,b.lanes=c,t(a,c)}}function aL(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&c===(d=d.updateQueue)){var e=null,f=null;if(null!==(c=c.firstBaseUpdate)){do{var g={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};null===f?e=f=g:f=f.next=g,c=c.next}while(null!==c)null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,callbacks:d.callbacks},a.updateQueue=c;return}null===(a=c.lastBaseUpdate)?c.firstBaseUpdate=b:a.next=b,c.lastBaseUpdate=b}function aM(){if(hJ){var a=ht;if(null!==a)throw a}}function aN(a,b,c,d){hJ=!1;var e=a.updateQueue;hI=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var i=h,j=i.next;i.next=null,null===g?f=j:g.next=j,g=i;var k=a.alternate;null!==k&&(h=(k=k.updateQueue).lastBaseUpdate)!==g&&(null===h?k.firstBaseUpdate=j:h.next=j,k.lastBaseUpdate=i)}if(null!==f){var l=e.baseState;for(g=0,k=j=i=null,h=f;;){var m=-0x20000001&h.lane,n=m!==h.lane;if(n?(is&m)===m:(d&m)===m){0!==m&&m===hs&&(hJ=!0),null!==k&&(k=k.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});h:{var o=a,p=h;switch(m=b,p.tag){case 1:if("function"==typeof(o=p.payload)){l=o.call(c,l,m);break h}l=o;break h;case 3:o.flags=-65537&o.flags|128;case 0:if(null==(m="function"==typeof(o=p.payload)?o.call(c,l,m):o))break h;l=ec({},l,m);break h;case 2:hI=!0}}null!==(m=h.callback)&&(a.flags|=64,n&&(a.flags|=8192),null===(n=e.callbacks)?e.callbacks=[m]:n.push(m))}else n={lane:m,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===k?(j=k=n,i=l):k=k.next=n,g|=m;if(null===(h=h.next)){if(null===(h=e.shared.pending))break;h=(n=h).next,n.next=null,e.lastBaseUpdate=n,e.shared.pending=null}}null===k&&(i=l),e.baseState=i,e.firstBaseUpdate=j,e.lastBaseUpdate=k,null===f&&(e.shared.lanes=0),iA|=g,a.lanes=g,a.memoizedState=l}}function aO(a,b){if("function"!=typeof a)throw Error(d(191,a));a.call(b)}function aP(a,b){var c=a.callbacks;if(null!==c)for(a.callbacks=null,a=0;a<c.length;a++)aO(c[a],b)}function aQ(a,b){l(hL,a=iy),l(hK,b),iy=a|b.baseLanes}function aR(){l(hL,iy),l(hK,hK.current)}function aS(){iy=hL.current,k(hK),k(hL)}function aT(a){var b=a.alternate;l(hO,1&hO.current),l(hM,a),null===hN&&(null===b||null!==hK.current||null!==b.memoizedState)&&(hN=a)}function aU(a){l(hO,hO.current),l(hM,a),null===hN&&(hN=a)}function aV(a){22===a.tag?(l(hO,hO.current),l(hM,a),null===hN&&(hN=a)):aW()}function aW(){l(hO,hO.current),l(hM,hM.current)}function aX(a){k(hM),hN===a&&(hN=null),k(hO)}function aY(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(null===(c=c.dehydrated)||fB(c)||fC(c)))return b}else if(19===b.tag&&("forwards"===b.memoizedProps.revealOrder||"backwards"===b.memoizedProps.revealOrder||"unstable_legacy-backwards"===b.memoizedProps.revealOrder||"together"===b.memoizedProps.revealOrder)){if((128&b.flags)!=0)return b}else if(null!==b.child){b.child.return=b,b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return,b=b.sibling}return null}function aZ(){throw Error(d(321))}function a$(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!gR(a[c],b[c]))return!1;return!0}function a_(a,b,c,d,e,f){return hP=f,hQ=b,b.memoizedState=null,b.updateQueue=null,b.lanes=0,ev.H=null===a||null===a.memoizedState?h_:h0,hV=!1,f=c(d,e),hV=!1,hU&&(f=a1(b,c,d,e)),a0(a),f}function a0(a){ev.H=h$;var b=null!==hR&&null!==hR.next;if(hP=0,hS=hR=hQ=null,hT=!1,hX=0,hY=null,b)throw Error(d(300));null===a||h4||null!==(a=a.dependencies)&&Y(a)&&(h4=!0)}function a1(a,b,c,e){hQ=a;var f=0;do{if(hU&&(hY=null),hX=0,hU=!1,25<=f)throw Error(d(301));if(f+=1,hS=hR=null,null!=a.updateQueue){var g=a.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,null!=g.memoCache&&(g.memoCache.index=0)}ev.H=h1,g=b(c,e)}while(hU)return g}function a2(){var a=ev.H,b=a.useState()[0];return b="function"==typeof b.then?a9(b):b,a=a.useState()[0],(null!==hR?hR.memoizedState:null)!==a&&(hQ.flags|=1024),b}function a3(){var a=0!==hW;return hW=0,a}function a4(a,b,c){b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~c}function a5(a){if(hT){for(a=a.memoizedState;null!==a;){var b=a.queue;null!==b&&(b.pending=null),a=a.next}hT=!1}hP=0,hS=hR=hQ=null,hU=!1,hX=hW=0,hY=null}function a6(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===hS?hQ.memoizedState=hS=a:hS=hS.next=a,hS}function a7(){if(null===hR){var a=hQ.alternate;a=null!==a?a.memoizedState:null}else a=hR.next;var b=null===hS?hQ.memoizedState:hS.next;if(null!==b)hS=b,hR=a;else{if(null===a)throw null===hQ.alternate?Error(d(467)):Error(d(310));a={memoizedState:(hR=a).memoizedState,baseState:hR.baseState,baseQueue:hR.baseQueue,queue:hR.queue,next:null},null===hS?hQ.memoizedState=hS=a:hS=hS.next=a}return hS}function a8(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function a9(a){var b=hX;return hX+=1,null===hY&&(hY=[]),a=as(hY,a,b),b=hQ,(null===hS?b.memoizedState:hS.next)===null&&(ev.H=null===(b=b.alternate)||null===b.memoizedState?h_:h0),a}function ba(a){if(null!==a&&"object"==typeof a){if("function"==typeof a.then)return a9(a);if(a.$$typeof===ek)return $(a)}throw Error(d(438,String(a)))}function bb(a){var b=null,c=hQ.updateQueue;if(null!==c&&(b=c.memoCache),null==b){var d=hQ.alternate;null!==d&&null!==(d=d.updateQueue)&&null!=(d=d.memoCache)&&(b={data:d.data.map(function(a){return a.slice()}),index:0})}if(null==b&&(b={data:[],index:0}),null===c&&(c=a8(),hQ.updateQueue=c),c.memoCache=b,void 0===(c=b.data[b.index]))for(c=b.data[b.index]=Array(a),d=0;d<a;d++)c[d]=er;return b.index++,c}function bc(a,b){return"function"==typeof b?b(a):b}function bd(a){return be(a7(),hR,a)}function be(a,b,c){var e=a.queue;if(null===e)throw Error(d(311));e.lastRenderedReducer=c;var f=a.baseQueue,g=e.pending;if(null!==g){if(null!==f){var h=f.next;f.next=g.next,g.next=h}b.baseQueue=f=g,e.pending=null}if(g=a.baseState,null===f)a.memoizedState=g;else{b=f.next;var i=h=null,j=null,k=b,l=!1;do{var m=-0x20000001&k.lane;if(m!==k.lane?(is&m)===m:(hP&m)===m){var n=k.revertLane;if(0===n)null!==j&&(j=j.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),m===hs&&(l=!0);else if((hP&n)===n){k=k.next,n===hs&&(l=!0);continue}else m={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},null===j?(i=j=m,h=g):j=j.next=m,hQ.lanes|=n,iA|=n;m=k.action,hV&&c(g,m),g=k.hasEagerState?k.eagerState:c(g,m)}else n={lane:m,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},null===j?(i=j=n,h=g):j=j.next=n,hQ.lanes|=m,iA|=m;k=k.next}while(null!==k&&k!==b)if(null===j?h=g:j.next=i,!gR(g,a.memoizedState)&&(h4=!0,l&&null!==(c=ht)))throw c;a.memoizedState=g,a.baseState=h,a.baseQueue=j,e.lastRenderedState=g}return null===f&&(e.lanes=0),[a.memoizedState,e.dispatch]}function bf(a){var b=a7(),c=b.queue;if(null===c)throw Error(d(311));c.lastRenderedReducer=a;var e=c.dispatch,f=c.pending,g=b.memoizedState;if(null!==f){c.pending=null;var h=f=f.next;do g=a(g,h.action),h=h.next;while(h!==f)gR(g,b.memoizedState)||(h4=!0),b.memoizedState=g,null===b.baseQueue&&(b.baseState=g),c.lastRenderedState=g}return[g,e]}function bg(a,b,c){var e=hQ,f=a7(),g=g9;if(g){if(void 0===c)throw Error(d(407));c=c()}else c=b();var h=!gR((hR||f).memoizedState,c);if(h&&(f.memoizedState=c,h4=!0),f=f.queue,bF(bj.bind(null,e,f,a),[a]),f.getSnapshot!==b||h||null!==hS&&1&hS.memoizedState.tag){if(e.flags|=2048,bA(9,{destroy:void 0},bi.bind(null,e,f,c,b),null),null===iq)throw Error(d(349));g||(127&hP)!=0||bh(e,b,c)}return c}function bh(a,b,c){a.flags|=16384,a={getSnapshot:b,value:c},null===(b=hQ.updateQueue)?(b=a8(),hQ.updateQueue=b,b.stores=[a]):null===(c=b.stores)?b.stores=[a]:c.push(a)}function bi(a,b,c,d){b.value=c,b.getSnapshot=d,bk(b)&&bl(a)}function bj(a,b,c){return c(function(){bk(b)&&bl(a)})}function bk(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!gR(a,c)}catch{return!0}}function bl(a){var b=aD(a,2);null!==b&&dq(b,a,2)}function bm(a){var b=a6();if("function"==typeof a){var c=a;if(a=c(),hV){y(!0);try{c()}finally{y(!1)}}}return b.memoizedState=b.baseState=a,b.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bc,lastRenderedState:a},b}function bn(a,b,c,d){return a.baseState=c,be(a,hR,"function"==typeof d?d:bc)}function bo(a,b,c,e,f){if(b$(a))throw Error(d(485));if(null!==(a=b.action)){var g={payload:f,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){g.listeners.push(a)}};null!==ev.T?c(!0):g.isTransition=!1,e(g),null===(c=b.pending)?(g.next=b.pending=g,bp(b,g)):(g.next=c.next,b.pending=c.next=g)}}function bp(a,b){var c=b.action,d=b.payload,e=a.state;if(b.isTransition){var f=ev.T,g={};ev.T=g;try{var h=c(e,d),i=ev.S;null!==i&&i(g,h),bq(a,b,h)}catch(c){bs(a,b,c)}finally{null!==f&&null!==g.types&&(f.types=g.types),ev.T=f}}else try{f=c(e,d),bq(a,b,f)}catch(c){bs(a,b,c)}}function bq(a,b,c){null!==c&&"object"==typeof c&&"function"==typeof c.then?c.then(function(c){br(a,b,c)},function(c){return bs(a,b,c)}):br(a,b,c)}function br(a,b,c){b.status="fulfilled",b.value=c,bt(b),a.state=c,null!==(b=a.pending)&&((c=b.next)===b?a.pending=null:(c=c.next,b.next=c,bp(a,c)))}function bs(a,b,c){var d=a.pending;if(a.pending=null,null!==d){d=d.next;do b.status="rejected",b.reason=c,bt(b),b=b.next;while(b!==d)}a.action=null}function bt(a){a=a.listeners;for(var b=0;b<a.length;b++)(0,a[b])()}function bu(a,b){return b}function bv(a,b){if(g9){var c=iq.formState;if(null!==c){h:{var d=hQ;if(g9){if(g8){var e=fF(g8,hb);if(e){g8=fH(e),d=fG(e);break h}}M(d)}d=!1}d&&(b=c[0])}}(c=a6()).memoizedState=c.baseState=b,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bu,lastRenderedState:b},c.queue=d,c=bX.bind(null,hQ,d),d.dispatch=c,d=bm(!1);var f=bZ.bind(null,hQ,!1,d.queue);return d=a6(),e={state:b,dispatch:null,action:a,pending:null},d.queue=e,c=bo.bind(null,hQ,e,f,c),e.dispatch=c,d.memoizedState=a,[b,c,!1]}function bw(a){return bx(a7(),hR,a)}function bx(a,b,c){if(b=be(a,b,bu)[0],a=bd(bc)[0],"object"==typeof b&&null!==b&&"function"==typeof b.then)try{var d=a9(b)}catch(a){throw a===hw?hy:a}else d=b;var e=(b=a7()).queue,f=e.dispatch;return c!==b.memoizedState&&(hQ.flags|=2048,bA(9,{destroy:void 0},by.bind(null,e,c),null)),[d,f,a]}function by(a,b){a.action=b}function bz(a){var b=a7(),c=hR;if(null!==c)return bx(b,c,a);a7(),b=b.memoizedState;var d=(c=a7()).queue.dispatch;return c.memoizedState=a,[b,d,!1]}function bA(a,b,c,d){return a={tag:a,create:c,deps:d,inst:b,next:null},null===(b=hQ.updateQueue)&&(b=a8(),hQ.updateQueue=b),null===(c=b.lastEffect)?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a),a}function bB(){return a7().memoizedState}function bC(a,b,c,d){var e=a6();hQ.flags|=a,e.memoizedState=bA(1|b,{destroy:void 0},c,void 0===d?null:d)}function bD(a,b,c,d){var e=a7();d=void 0===d?null:d;var f=e.memoizedState.inst;null!==hR&&null!==d&&a$(d,hR.memoizedState.deps)?e.memoizedState=bA(b,f,c,d):(hQ.flags|=a,e.memoizedState=bA(1|b,f,c,d))}function bE(a,b){bC(8390656,8,a,b)}function bF(a,b){bD(2048,8,a,b)}function bG(a){var b=a7().memoizedState;return function(a){hQ.flags|=4;var b=hQ.updateQueue;if(null===b)b=a8(),hQ.updateQueue=b,b.events=[a];else{var c=b.events;null===c?b.events=[a]:c.push(a)}}({ref:b,nextImpl:a}),function(){if((2&ip)!=0)throw Error(d(440));return b.impl.apply(void 0,arguments)}}function bH(a,b){return bD(4,2,a,b)}function bI(a,b){return bD(4,4,a,b)}function bJ(a,b){if("function"==typeof b){var c=b(a=a());return function(){"function"==typeof c?c():b(null)}}if(null!=b)return b.current=a=a(),function(){b.current=null}}function bK(a,b,c){c=null!=c?c.concat([a]):null,bD(4,4,bJ.bind(null,b,a),c)}function bL(){}function bM(a,b){var c=a7();b=void 0===b?null:b;var d=c.memoizedState;return null!==b&&a$(b,d[1])?d[0]:(c.memoizedState=[a,b],a)}function bN(a,b){var c=a7();b=void 0===b?null:b;var d=c.memoizedState;if(null!==b&&a$(b,d[1]))return d[0];if(d=a(),hV){y(!0);try{a()}finally{y(!1)}}return c.memoizedState=[d,b],d}function bO(a,b,c){return void 0===c||(0x40000000&hP)!=0&&(261930&is)==0?a.memoizedState=b:(a.memoizedState=c,a=dp(),hQ.lanes|=a,iA|=a,c)}function bP(a,b,c,d){return gR(c,b)?c:null!==hK.current?(gR(a=bO(a,c,d),b)||(h4=!0),a):(42&hP)==0||(0x40000000&hP)!=0&&(261930&is)==0?(h4=!0,a.memoizedState=c):(a=dp(),hQ.lanes|=a,iA|=a,b)}function bQ(a,b,c,d,e){var f=eT();eS(0!==f&&8>f?f:8);var g=ev.T,h={};ev.T=h,bZ(a,!1,b,c);try{var i=e(),j=ev.S;if(null!==j&&j(h,i),null!==i&&"object"==typeof i&&"function"==typeof i.then){var k,l,m=(k=[],l={status:"pending",value:null,reason:null,then:function(a){k.push(a)}},i.then(function(){l.status="fulfilled",l.value=d;for(var a=0;a<k.length;a++)(0,k[a])(d)},function(a){for(l.status="rejected",l.reason=a,a=0;a<k.length;a++)(0,k[a])(void 0)}),l);bY(a,b,m,dn(a))}else bY(a,b,d,dn(a))}catch(c){bY(a,b,{then:function(){},status:"rejected",reason:c},dn())}finally{eS(f),null!==g&&null!==h.types&&(g.types=h.types),ev.T=g}}function bR(a){var b=a.memoizedState;if(null!==b)return b;var c={};return(b={memoizedState:e2,baseState:e2,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bc,lastRenderedState:e2},next:null}).next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bc,lastRenderedState:c},next:null},a.memoizedState=b,null!==(a=a.alternate)&&(a.memoizedState=b),b}function bS(){return $(e3)}function bT(){return a7().memoizedState}function bU(){return a7().memoizedState}function bV(a){for(var b=a.return;null!==b;){switch(b.tag){case 24:case 3:var c=dn(),d=aJ(b,a=aI(c),c);null!==d&&(dq(d,b,c),aK(d,b,c)),b={cache:ab()},a.payload=b;return}b=b.return}}function bW(a,b,c){var d=dn();c={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},b$(a)?b_(b,c):null!==(c=aC(a,b,c,d))&&(dq(c,a,d),b0(c,b,d))}function bX(a,b,c){bY(a,b,c,dn())}function bY(a,b,c,d){var e={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(b$(a))b_(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&null!==(f=b.lastRenderedReducer))try{var g=b.lastRenderedState,h=f(g,c);if(e.hasEagerState=!0,e.eagerState=h,gR(h,g))return aB(a,b,e,0),null===iq&&aA(),!1}catch{}finally{}if(null!==(c=aC(a,b,e,d)))return dq(c,a,d),b0(c,b,d),!0}return!1}function bZ(a,b,c,e){if(e={lane:2,revertLane:al(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},b$(a)){if(b)throw Error(d(479))}else null!==(b=aC(a,c,e,2))&&dq(b,a,2)}function b$(a){var b=a.alternate;return a===hQ||null!==b&&b===hQ}function b_(a,b){hU=hT=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b),a.pending=b}function b0(a,b,c){if((4194048&c)!=0){var d=b.lanes;d&=a.pendingLanes,b.lanes=c|=d,t(a,c)}}function b1(a,b,c,d){c=null==(c=c(d,b=a.memoizedState))?b:ec({},b,c),a.memoizedState=c,0===a.lanes&&(a.updateQueue.baseState=c)}function b2(a,b,c,d,e,f,g){return"function"==typeof(a=a.stateNode).shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):!b.prototype||!b.prototype.isPureReactComponent||!aq(c,d)||!aq(e,f)}function b3(a,b,c,d){a=b.state,"function"==typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d),"function"==typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d),b.state!==a&&h2.enqueueReplaceState(b,b.state,null)}function b4(a,b){var c=b;if("ref"in b)for(var d in c={},b)"ref"!==d&&(c[d]=b[d]);if(a=a.defaultProps)for(var e in c===b&&(c=ec({},c)),a)void 0===c[e]&&(c[e]=a[e]);return c}function b5(a,b){try{(0,a.onUncaughtError)(b.value,{componentStack:b.stack})}catch(a){setTimeout(function(){throw a})}}function b6(a,b,c){try{(0,a.onCaughtError)(c.value,{componentStack:c.stack,errorBoundary:1===b.tag?b.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function b7(a,b,c){return(c=aI(c)).tag=3,c.payload={element:null},c.callback=function(){b5(a,b)},c}function b8(a){return(a=aI(a)).tag=3,a}function b9(a,b,c,d){var e=c.type.getDerivedStateFromError;if("function"==typeof e){var f=d.value;a.payload=function(){return e(f)},a.callback=function(){b6(b,c,d)}}var g=c.stateNode;null!==g&&"function"==typeof g.componentDidCatch&&(a.callback=function(){b6(b,c,d),"function"!=typeof e&&(null===iM?iM=new Set([this]):iM.add(this));var a=d.stack;this.componentDidCatch(d.value,{componentStack:null!==a?a:""})})}function ca(a,b,c,d){b.child=null===a?hE(b,null,c,d):hD(b,a.child,c,d)}function cb(a,b,c,d,e){c=c.render;var f=b.ref;if("ref"in d){var g={};for(var h in d)"ref"!==h&&(g[h]=d[h])}else g=d;return Z(b),d=a_(a,b,c,g,f,e),h=a3(),null===a||h4?(g9&&h&&F(b),b.flags|=1,ca(a,b,d,e),b.child):(a4(a,b,e),cx(a,b,e))}function cc(a,b,c,d,e){if(null===a){var f=c.type;return"function"!=typeof f||dX(f)||void 0!==f.defaultProps||null!==c.compare?((a=d$(c.type,null,d,b,b.mode,e)).ref=b.ref,a.return=b,b.child=a):(b.tag=15,b.type=f,cd(a,b,f,d,e))}if(f=a.child,!cy(a,e)){var g=f.memoizedProps;if((c=null!==(c=c.compare)?c:aq)(g,d)&&a.ref===b.ref)return cx(a,b,e)}return b.flags|=1,(a=dY(f,d)).ref=b.ref,a.return=b,b.child=a}function cd(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(aq(f,d)&&a.ref===b.ref)if(h4=!1,b.pendingProps=d=f,!cy(a,e))return b.lanes=a.lanes,cx(a,b,e);else(131072&a.flags)!=0&&(h4=!0)}return ck(a,b,c,d,e)}function ce(a,b,c,d){var e=d.children,f=null!==a?a.memoizedState:null;if(null===a&&null===b.stateNode&&(b.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===d.mode){if((128&b.flags)!=0){if(f=null!==f?f.baseLanes|c:c,null!==a){for(d=b.child=a.child,e=0;null!==d;)e=e|d.lanes|d.childLanes,d=d.sibling;d=e&~f}else d=0,b.child=null;return cg(a,b,f,c,d)}if((0x20000000&c)==0)return d=b.lanes=0x20000000,cg(a,b,null!==f?f.baseLanes|c:c,c,d);b.memoizedState={baseLanes:0,cachePool:null},null!==a&&ao(b,null!==f?f.cachePool:null),null!==f?aQ(b,f):aR(),aV(b)}else null!==f?(ao(b,f.cachePool),aQ(b,f),aW(),b.memoizedState=null):(null!==a&&ao(b,null),aR(),aW());return ca(a,b,e,c),b.child}function cf(a,b){return null!==a&&22===a.tag||null!==b.stateNode||(b.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.sibling}function cg(a,b,c,d,e){var f=an();return b.memoizedState={baseLanes:c,cachePool:f=null===f?null:{parent:eM?hj._currentValue:hj._currentValue2,pool:f}},null!==a&&ao(b,null),aR(),aV(b),null!==a&&X(a,b,d,!0),b.childLanes=e,null}function ch(a,b){return(b=cs({mode:b.mode,children:b.children},a.mode)).ref=a.ref,a.child=b,b.return=a,b}function ci(a,b,c){return hD(b,a.child,null,c),a=ch(b,b.pendingProps),a.flags|=2,aX(b),b.memoizedState=null,a}function cj(a,b){var c=b.ref;if(null===c)null!==a&&null!==a.ref&&(b.flags|=4194816);else{if("function"!=typeof c&&"object"!=typeof c)throw Error(d(284));(null===a||a.ref!==c)&&(b.flags|=4194816)}}function ck(a,b,c,d,e){return Z(b),c=a_(a,b,c,d,void 0,e),d=a3(),null===a||h4?(g9&&d&&F(b),b.flags|=1,ca(a,b,c,e),b.child):(a4(a,b,e),cx(a,b,e))}function cl(a,b,c,d,e,f){return Z(b),b.updateQueue=null,c=a1(b,d,c,e),a0(a),d=a3(),null===a||h4?(g9&&d&&F(b),b.flags|=1,ca(a,b,c,f),b.child):(a4(a,b,f),cx(a,b,f))}function cm(a,b,c,d,e){if(Z(b),null===b.stateNode){var f=gx,g=c.contextType;"object"==typeof g&&null!==g&&(f=$(g)),b.memoizedState=null!==(f=new c(d,f)).state&&void 0!==f.state?f.state:null,f.updater=h2,b.stateNode=f,f._reactInternals=b,(f=b.stateNode).props=d,f.state=b.memoizedState,f.refs={},aG(b),g=c.contextType,f.context="object"==typeof g&&null!==g?$(g):gx,f.state=b.memoizedState,"function"==typeof(g=c.getDerivedStateFromProps)&&(b1(b,c,g,d),f.state=b.memoizedState),"function"==typeof c.getDerivedStateFromProps||"function"==typeof f.getSnapshotBeforeUpdate||"function"!=typeof f.UNSAFE_componentWillMount&&"function"!=typeof f.componentWillMount||(g=f.state,"function"==typeof f.componentWillMount&&f.componentWillMount(),"function"==typeof f.UNSAFE_componentWillMount&&f.UNSAFE_componentWillMount(),g!==f.state&&h2.enqueueReplaceState(f,f.state,null),aN(b,d,f,e),aM(),f.state=b.memoizedState),"function"==typeof f.componentDidMount&&(b.flags|=4194308),d=!0}else if(null===a){f=b.stateNode;var h=b.memoizedProps,i=b4(c,h);f.props=i;var j=f.context,k=c.contextType;g=gx,"object"==typeof k&&null!==k&&(g=$(k));var l=c.getDerivedStateFromProps;k="function"==typeof l||"function"==typeof f.getSnapshotBeforeUpdate,h=b.pendingProps!==h,k||"function"!=typeof f.UNSAFE_componentWillReceiveProps&&"function"!=typeof f.componentWillReceiveProps||(h||j!==g)&&b3(b,f,d,g),hI=!1;var m=b.memoizedState;f.state=m,aN(b,d,f,e),aM(),j=b.memoizedState,h||m!==j||hI?("function"==typeof l&&(b1(b,c,l,d),j=b.memoizedState),(i=hI||b2(b,c,i,d,m,j,g))?(k||"function"!=typeof f.UNSAFE_componentWillMount&&"function"!=typeof f.componentWillMount||("function"==typeof f.componentWillMount&&f.componentWillMount(),"function"==typeof f.UNSAFE_componentWillMount&&f.UNSAFE_componentWillMount()),"function"==typeof f.componentDidMount&&(b.flags|=4194308)):("function"==typeof f.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=j),f.props=d,f.state=j,f.context=g,d=i):("function"==typeof f.componentDidMount&&(b.flags|=4194308),d=!1)}else{f=b.stateNode,aH(a,b),k=b4(c,g=b.memoizedProps),f.props=k,l=b.pendingProps,m=f.context,j=c.contextType,i=gx,"object"==typeof j&&null!==j&&(i=$(j)),(j="function"==typeof(h=c.getDerivedStateFromProps)||"function"==typeof f.getSnapshotBeforeUpdate)||"function"!=typeof f.UNSAFE_componentWillReceiveProps&&"function"!=typeof f.componentWillReceiveProps||(g!==l||m!==i)&&b3(b,f,d,i),hI=!1,m=b.memoizedState,f.state=m,aN(b,d,f,e),aM();var n=b.memoizedState;g!==l||m!==n||hI||null!==a&&null!==a.dependencies&&Y(a.dependencies)?("function"==typeof h&&(b1(b,c,h,d),n=b.memoizedState),(k=hI||b2(b,c,k,d,m,n,i)||null!==a&&null!==a.dependencies&&Y(a.dependencies))?(j||"function"!=typeof f.UNSAFE_componentWillUpdate&&"function"!=typeof f.componentWillUpdate||("function"==typeof f.componentWillUpdate&&f.componentWillUpdate(d,n,i),"function"==typeof f.UNSAFE_componentWillUpdate&&f.UNSAFE_componentWillUpdate(d,n,i)),"function"==typeof f.componentDidUpdate&&(b.flags|=4),"function"==typeof f.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!=typeof f.componentDidUpdate||g===a.memoizedProps&&m===a.memoizedState||(b.flags|=4),"function"!=typeof f.getSnapshotBeforeUpdate||g===a.memoizedProps&&m===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=n),f.props=d,f.state=n,f.context=i,d=k):("function"!=typeof f.componentDidUpdate||g===a.memoizedProps&&m===a.memoizedState||(b.flags|=4),"function"!=typeof f.getSnapshotBeforeUpdate||g===a.memoizedProps&&m===a.memoizedState||(b.flags|=1024),d=!1)}return f=d,cj(a,b),d=(128&b.flags)!=0,f||d?(f=b.stateNode,c=d&&"function"!=typeof c.getDerivedStateFromError?null:f.render(),b.flags|=1,null!==a&&d?(b.child=hD(b,a.child,null,e),b.child=hD(b,null,c,e)):ca(a,b,c,e),b.memoizedState=f.state,a=b.child):a=cx(a,b,e),a}function cn(a,b,c,d){return Q(),b.flags|=256,ca(a,b,c,d),b.child}function co(a){return{baseLanes:a,cachePool:ap()}}function cp(a,b,c){return a=null!==a?a.childLanes&~c:0,b&&(a|=iD),a}function cq(a,b,c){var e,f=b.pendingProps,g=!1,h=(128&b.flags)!=0;if((e=h)||(e=(null===a||null!==a.memoizedState)&&(2&hO.current)!=0),e&&(g=!0,b.flags&=-129),e=(32&b.flags)!=0,b.flags&=-33,null===a){if(g9){if(g?aT(b):aW(),(a=g8)?null!==(a=fR(a,hb))&&(b.memoizedState={dehydrated:a,treeContext:null!==g0?{id:g1,overflow:g2}:null,retryLane:0x20000000,hydrationErrors:null},(c=d1(a)).return=b,b.child=c,g7=b,g8=null):a=null,null===a)throw M(b);return fC(a)?b.lanes=32:b.lanes=0x20000000,null}var i=f.children;return f=f.fallback,g?(aW(),i=cs({mode:"hidden",children:i},g=b.mode),f=d_(f,g,c,null),i.return=b,f.return=b,i.sibling=f,b.child=i,(f=b.child).memoizedState=co(c),f.childLanes=cp(a,e,c),b.memoizedState=h5,cf(null,f)):(aT(b),cr(b,i))}var j=a.memoizedState;if(null!==j&&null!==(i=j.dehydrated)){if(h)256&b.flags?(aT(b),b.flags&=-257,b=ct(a,b,c)):null!==b.memoizedState?(aW(),b.child=a.child,b.flags|=128,b=null):(aW(),i=f.fallback,g=b.mode,f=cs({mode:"visible",children:f.children},g),i=d_(i,g,c,null),i.flags|=2,f.return=b,i.return=b,f.sibling=i,b.child=f,hD(b,a.child,null,c),(f=b.child).memoizedState=co(c),f.childLanes=cp(a,e,c),b.memoizedState=h5,b=cf(null,f));else if(aT(b),fC(i))e=fD(i).digest,(f=Error(d(419))).stack="",f.digest=e,S({value:f,source:null,stack:null}),b=ct(a,b,c);else if(h4||X(a,b,c,!1),e=(c&a.childLanes)!=0,h4||e){if(null!==(e=iq)&&0!==(f=u(e,c))&&f!==j.retryLane)throw j.retryLane=f,aD(a,f),dq(e,a,f),h3;fB(i)||dB(),b=ct(a,b,c)}else fB(i)?(b.flags|=192,b.child=a.child,b=null):(a=j.treeContext,eP&&(g8=fM(i),g7=b,g9=!0,ha=null,hb=!1,null!==a&&H(b,a)),b=cr(b,f.children),b.flags|=4096);return b}return g?(aW(),i=f.fallback,g=b.mode,h=(j=a.child).sibling,(f=dY(j,{mode:"hidden",children:f.children})).subtreeFlags=0x3e00000&j.subtreeFlags,null!==h?i=dY(h,i):(i=d_(i,g,c,null),i.flags|=2),i.return=b,f.return=b,f.sibling=i,b.child=f,cf(null,f),f=b.child,null===(i=a.child.memoizedState)?i=co(c):(null!==(g=i.cachePool)?(j=eM?hj._currentValue:hj._currentValue2,g=g.parent!==j?{parent:j,pool:j}:g):g=ap(),i={baseLanes:i.baseLanes|c,cachePool:g}),f.memoizedState=i,f.childLanes=cp(a,e,c),b.memoizedState=h5,cf(a.child,f)):(aT(b),a=(c=a.child).sibling,(c=dY(c,{mode:"visible",children:f.children})).return=b,c.sibling=null,null!==a&&(null===(e=b.deletions)?(b.deletions=[a],b.flags|=16):e.push(a)),b.child=c,b.memoizedState=null,c)}function cr(a,b){return(b=cs({mode:"visible",children:b},a.mode)).return=a,a.child=b}function cs(a,c){return(a=b(22,a,null,c)).lanes=0,a}function ct(a,b,c){return hD(b,a.child,null,c),a=cr(b,b.pendingProps.children),a.flags|=2,b.memoizedState=null,a}function cu(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b),V(a.return,b,c)}function cv(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e,treeForkCount:f}:(g.isBackwards=b,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=c,g.tailMode=e,g.treeForkCount=f)}function cw(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;d=d.children;var g=hO.current,h=(2&g)!=0;if(h?(g=1&g|2,b.flags|=128):g&=1,l(hO,g),ca(a,b,d,c),d=g9?gZ:0,!h&&null!==a&&(128&a.flags)!=0)h:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&cu(a,c,b);else if(19===a.tag)cu(a,c,b);else if(null!==a.child){a.child.return=a,a=a.child;continue}if(a===b)break;for(;null===a.sibling;){if(null===a.return||a.return===b)break h;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(e){case"forwards":for(c=b.child,e=null;null!==c;)null!==(a=c.alternate)&&null===aY(a)&&(e=c),c=c.sibling;null===(c=e)?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null),cv(b,!1,e,c,f,d);break;case"backwards":case"unstable_legacy-backwards":for(c=null,e=b.child,b.child=null;null!==e;){if(null!==(a=e.alternate)&&null===aY(a)){b.child=e;break}a=e.sibling,e.sibling=c,c=e,e=a}cv(b,!0,c,null,f,d);break;case"together":cv(b,!1,null,null,void 0,d);break;default:b.memoizedState=null}return b.child}function cx(a,b,c){if(null!==a&&(b.dependencies=a.dependencies),iA|=b.lanes,(c&b.childLanes)==0){if(null===a)return null;else if(X(a,b,c,!1),(c&b.childLanes)==0)return null}if(null!==a&&b.child!==a.child)throw Error(d(153));if(null!==b.child){for(c=dY(a=b.child,a.pendingProps),b.child=c,c.return=b;null!==a.sibling;)a=a.sibling,(c=c.sibling=dY(a,a.pendingProps)).return=b;c.sibling=null}return b.child}function cy(a,b){return(a.lanes&b)!=0||!!(null!==(a=a.dependencies)&&Y(a))}function cz(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps)h4=!0;else{if(!cy(a,c)&&(128&b.flags)==0)return h4=!1,function(a,b,c){switch(b.tag){case 3:I(b,b.stateNode.containerInfo),T(b,hj,a.memoizedState.cache),Q();break;case 27:case 5:K(b);break;case 4:I(b,b.stateNode.containerInfo);break;case 10:T(b,b.type,b.memoizedProps.value);break;case 31:if(null!==b.memoizedState)return b.flags|=128,aU(b),null;break;case 13:var d=b.memoizedState;if(null!==d)return null!==d.dehydrated?(aT(b),b.flags|=128,null):(c&b.child.childLanes)!=0?cq(a,b,c):(aT(b),null!==(a=cx(a,b,c))?a.sibling:null);aT(b);break;case 19:var e=(128&a.flags)!=0;if((d=(c&b.childLanes)!=0)||(X(a,b,c,!1),d=(c&b.childLanes)!=0),e){if(d)return cw(a,b,c);b.flags|=128}if(null!==(e=b.memoizedState)&&(e.rendering=null,e.tail=null,e.lastEffect=null),l(hO,hO.current),d)break;return null;case 22:return b.lanes=0,ce(a,b,c,b.pendingProps);case 24:T(b,hj,a.memoizedState.cache)}return cx(a,b,c)}(a,b,c);h4=(131072&a.flags)!=0}else h4=!1,g9&&(1048576&b.flags)!=0&&E(b,gZ,b.index);switch(b.lanes=0,b.tag){case 16:h:{var e=b.pendingProps;if(a=at(b.elementType),b.type=a,"function"==typeof a)dX(a)?(e=b4(a,e),b.tag=1,b=cm(null,b,a,e,c)):(b.tag=0,b=ck(null,b,a,e,c));else{if(null!=a){var f=a.$$typeof;if(f===el){b.tag=11,b=cb(null,b,a,e,c);break h}if(f===eo){b.tag=14,b=cc(null,b,a,e,c);break h}}throw Error(d(306,b=i(a)||a,""))}}return b;case 0:return ck(a,b,b.type,b.pendingProps,c);case 1:return f=b4(e=b.type,b.pendingProps),cm(a,b,e,f,c);case 3:h:{if(I(b,b.stateNode.containerInfo),null===a)throw Error(d(387));var g=b.pendingProps;e=(f=b.memoizedState).element,aH(a,b),aN(b,g,null,c);var h=b.memoizedState;if(T(b,hj,g=h.cache),g!==f.cache&&W(b,[hj],c,!0),aM(),g=h.element,eP&&f.isDehydrated)if(f={element:g,isDehydrated:!1,cache:h.cache},b.updateQueue.baseState=f,b.memoizedState=f,256&b.flags){b=cn(a,b,g,c);break h}else if(g!==e){S(e=C(Error(d(424)),b)),b=cn(a,b,g,c);break h}else for(eP&&(g8=fK(b.stateNode.containerInfo),g7=b,g9=!0,ha=null,hb=!0),c=hE(b,null,g,c),b.child=c;c;)c.flags=-3&c.flags|4096,c=c.sibling;else{if(Q(),g===e){b=cx(a,b,c);break h}ca(a,b,g,c)}b=b.child}return b;case 26:if(gb)return cj(a,b),null===a?(c=ge(b.type,null,b.pendingProps,null))?b.memoizedState=c:g9||(b.stateNode=gk(b.type,b.pendingProps,g5.current,b)):b.memoizedState=ge(b.type,a.memoizedProps,b.pendingProps,a.memoizedState),null;case 27:if(gp)return K(b),null===a&&gp&&g9&&(e=b.stateNode=gq(b.type,b.pendingProps,g5.current,g3.current,!1),g7=b,hb=!0,g8=fN(b.type,e,g8)),ca(a,b,b.pendingProps.children,c),cj(a,b),null===a&&(b.flags|=4194304),b.child;case 5:return null===a&&g9&&(f9(b.type,b.pendingProps,g3.current),(f=e=g8)&&(null!==(e=fO(e,b.type,b.pendingProps,hb))?(b.stateNode=e,g7=b,g8=fJ(e),hb=!1,f=!0):f=!1),f||M(b)),K(b),f=b.type,g=b.pendingProps,h=null!==a?a.memoizedProps:null,e=g.children,eH(f,g)?e=null:null!==h&&eH(f,h)&&(b.flags|=32),null!==b.memoizedState&&(f=a_(a,b,a2,null,null,c),eM?e3._currentValue=f:e3._currentValue2=f),cj(a,b),ca(a,b,e,c),b.child;case 6:return null===a&&g9&&(ga(b.pendingProps,g3.current),(a=c=g8)&&(null!==(c=fP(c,b.pendingProps,hb))?(b.stateNode=c,g7=b,g8=null,a=!0):a=!1),a||M(b)),null;case 13:return cq(a,b,c);case 4:return I(b,b.stateNode.containerInfo),e=b.pendingProps,null===a?b.child=hD(b,null,e,c):ca(a,b,e,c),b.child;case 11:return cb(a,b,b.type,b.pendingProps,c);case 7:return ca(a,b,b.pendingProps,c),b.child;case 8:case 12:return ca(a,b,b.pendingProps.children,c),b.child;case 10:return e=b.pendingProps,T(b,b.type,e.value),ca(a,b,e.children,c),b.child;case 9:return f=b.type._context,e=b.pendingProps.children,Z(b),e=e(f=$(f)),b.flags|=1,ca(a,b,e,c),b.child;case 14:return cc(a,b,b.type,b.pendingProps,c);case 15:return cd(a,b,b.type,b.pendingProps,c);case 19:return cw(a,b,c);case 31:var j=a,k=b,m=c,n=k.pendingProps,o=(128&k.flags)!=0;if(k.flags&=-129,null===j){if(g9){if("hidden"===n.mode)return j=ch(k,n),k.lanes=0x20000000,cf(null,j);if(aU(k),(j=g8)?null!==(j=fQ(j,hb))&&(k.memoizedState={dehydrated:j,treeContext:null!==g0?{id:g1,overflow:g2}:null,retryLane:0x20000000,hydrationErrors:null},(m=d1(j)).return=k,k.child=m,g7=k,g8=null):j=null,null===j)throw M(k);return k.lanes=0x20000000,null}return ch(k,n)}var p=j.memoizedState;if(null!==p){var q=p.dehydrated;if(aU(k),o)if(256&k.flags)k.flags&=-257,k=ci(j,k,m);else if(null!==k.memoizedState)k.child=j.child,k.flags|=128,k=null;else throw Error(d(558));else if(h4||X(j,k,m,!1),o=(m&j.childLanes)!=0,h4||o){if(null!==(n=iq)&&0!==(q=u(n,m))&&q!==p.retryLane)throw p.retryLane=q,aD(j,q),dq(n,j,q),h3;dB(),k=ci(j,k,m)}else j=p.treeContext,eP&&(g8=fL(q),g7=k,g9=!0,ha=null,hb=!1,null!==j&&H(k,j)),k=ch(k,n),k.flags|=4096;return k}return(j=dY(j.child,{mode:n.mode,children:n.children})).ref=k.ref,k.child=j,j.return=k,j;case 22:return ce(a,b,c,b.pendingProps);case 24:return Z(b),e=$(hj),null===a?(null===(f=an())&&(f=iq,g=ab(),f.pooledCache=g,g.refCount++,null!==g&&(f.pooledCacheLanes|=c),f=g),b.memoizedState={parent:e,cache:f},aG(b),T(b,hj,f)):((a.lanes&c)!=0&&(aH(a,b),aN(b,null,null,c),aM()),f=a.memoizedState,g=b.memoizedState,f.parent!==e?(f={parent:e,cache:e},b.memoizedState=f,0===b.lanes&&(b.memoizedState=b.updateQueue.baseState=f),T(b,hj,e)):(T(b,hj,e=g.cache),e!==f.cache&&W(b,[hj],c,!0))),ca(a,b,b.pendingProps.children,c),b.child;case 29:throw b.pendingProps}throw Error(d(156,b.tag))}function cA(a){a.flags|=4}function cB(a){eO&&(a.flags|=8)}function cC(a,b){if(null!==a&&a.child===b.child)return!1;if((16&b.flags)!=0)return!0;for(a=b.child;null!==a;){if((8218&a.flags)!=0||(8218&a.subtreeFlags)!=0)return!0;a=a.sibling}return!1}function cD(a,b,c,d){if(eN)for(c=b.child;null!==c;){if(5===c.tag||6===c.tag)eF(a,c.stateNode);else if(!(4===c.tag||gp&&27===c.tag)&&null!==c.child){c.child.return=c,c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return,c=c.sibling}else if(eO)for(var e=b.child;null!==e;){if(5===e.tag){var f=e.stateNode;c&&d&&(f=fz(f,e.type,e.memoizedProps)),eF(a,f)}else if(6===e.tag)f=e.stateNode,c&&d&&(f=fA(f,e.memoizedProps)),eF(a,f);else if(4!==e.tag){if(22===e.tag&&null!==e.memoizedState)null!==(f=e.child)&&(f.return=e),cD(a,e,!0,!0);else if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===b)break;for(;null===e.sibling;){if(null===e.return||e.return===b)return;e=e.return}e.sibling.return=e.return,e=e.sibling}}function cE(a,b){if(eO&&cC(a,b)){var c=(a=b.stateNode).containerInfo,d=fv();(function a(b,c,d,e){var f=!1;if(eO)for(var g=c.child;null!==g;){if(5===g.tag){var h=g.stateNode;d&&e&&(h=fz(h,g.type,g.memoizedProps)),fw(b,h)}else if(6===g.tag)h=g.stateNode,d&&e&&(h=fA(h,g.memoizedProps)),fw(b,h);else if(4!==g.tag){if(22===g.tag&&null!==g.memoizedState)null!==(f=g.child)&&(f.return=g),a(b,g,!0,!0),f=!0;else if(null!==g.child){g.child.return=g,g=g.child;continue}}if(g===c)break;for(;null===g.sibling;){if(null===g.return||g.return===c)return f;g=g.return}g.sibling.return=g.return,g=g.sibling}return f})(d,b,!1,!1),a.pendingChildren=d,cA(b),fx(c,d)}}function cF(a,b,c,d){if(eN)a.memoizedProps!==d&&cA(b);else if(eO){var e=a.stateNode,f=a.memoizedProps;if((a=cC(a,b))||f!==d){var g=g3.current;(f=fu(e,c,f,d,!a,null))===e?b.stateNode=e:(cB(b),eG(f,c,d,g)&&cA(b),b.stateNode=f,a&&cD(f,b,!1,!1))}else b.stateNode=e}}function cG(a,b,c,d,e){if((32&a.mode)!=0&&(null===c?eX(b,d):eY(b,c,d))){if(a.flags|=0x1000000,(0x13ffff40&e)===e||eZ(b,d))if(e$(a.stateNode,b,d))a.flags|=8192;else if(dy())a.flags|=8192;else throw hA=hz,hx}else a.flags&=-0x1000001}function cH(a,b){if(gm(b)){if(a.flags|=0x1000000,!gn(b))if(dy())a.flags|=8192;else throw hA=hz,hx}else a.flags&=-0x1000001}function cI(a,b){null!==b&&(a.flags|=4),16384&a.flags&&(b=22!==a.tag?p():0x20000000,a.lanes|=b,iE|=b)}function cJ(a,b){if(!g9)switch(a.tailMode){case"hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function cK(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=0x3e00000&e.subtreeFlags,d|=0x3e00000&e.flags,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;return a.subtreeFlags|=d,a.childLanes=c,b}function cL(a,b){switch(G(b),b.tag){case 3:U(hj),J();break;case 26:case 27:case 5:L(b);break;case 4:J();break;case 31:null!==b.memoizedState&&aX(b);break;case 13:aX(b);break;case 19:k(hO);break;case 10:U(b.type);break;case 22:case 23:aX(b),aS(),null!==a&&k(hv);break;case 24:U(hj)}}function cM(a,b){try{var c=b.updateQueue,d=null!==c?c.lastEffect:null;if(null!==d){var e=d.next;c=e;do{if((c.tag&a)===a){d=void 0;var f=c.create;c.inst.destroy=d=f()}c=c.next}while(c!==e)}}catch(a){dQ(b,b.return,a)}}function cN(a,b,c){try{var d=b.updateQueue,e=null!==d?d.lastEffect:null;if(null!==e){var f=e.next;d=f;do{if((d.tag&a)===a){var g=d.inst,h=g.destroy;if(void 0!==h){g.destroy=void 0,e=b;try{h()}catch(a){dQ(e,c,a)}}}d=d.next}while(d!==f)}}catch(a){dQ(b,b.return,a)}}function cO(a){var b=a.updateQueue;if(null!==b){var c=a.stateNode;try{aP(b,c)}catch(b){dQ(a,a.return,b)}}}function cP(a,b,c){c.props=b4(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(c){dQ(a,b,c)}}function cQ(a,b){try{var c=a.ref;if(null!==c){switch(a.tag){case 26:case 27:case 5:var d=ez(a.stateNode);break;default:d=a.stateNode}"function"==typeof c?a.refCleanup=c(d):c.current=d}}catch(c){dQ(a,b,c)}}function cR(a,b){var c=a.ref,d=a.refCleanup;if(null!==c)if("function"==typeof d)try{d()}catch(c){dQ(a,b,c)}finally{a.refCleanup=null,null!=(a=a.alternate)&&(a.refCleanup=null)}else if("function"==typeof c)try{c(null)}catch(c){dQ(a,b,c)}else c.current=null}function cS(a){var b=a.type,c=a.memoizedProps,d=a.stateNode;try{fi(d,b,c,a)}catch(b){dQ(a,a.return,b)}}function cT(a,b,c){try{fj(a.stateNode,a.type,c,b,a)}catch(b){dQ(a,a.return,b)}}function cU(a){return 5===a.tag||3===a.tag||!!gb&&26===a.tag||!!gp&&27===a.tag&&gu(a.type)||4===a.tag}function cV(a){h:for(;;){for(;null===a.sibling;){if(null===a.return||cU(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(gp&&27===a.tag&&gu(a.type)||2&a.flags||null===a.child||4===a.tag)continue h;a.child.return=a,a=a.child}if(!(2&a.flags))return a.stateNode}}function cW(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?fk(c,a,b):ff(c,a);else if(4!==d&&(gp&&27===d&&gu(a.type)&&(c=a.stateNode),null!==(a=a.child)))for(cW(a,b,c),a=a.sibling;null!==a;)cW(a,b,c),a=a.sibling}function cX(a,b,c){a=a.containerInfo;try{fy(a,c)}catch(a){dQ(b,b.return,a)}}function cY(a){var b=a.stateNode,c=a.memoizedProps;try{gr(a.type,c,b,a)}catch(b){dQ(a,a.return,b)}}function cZ(a,b,c){var d=c.flags;switch(c.tag){case 0:case 11:case 15:c6(a,c),4&d&&cM(5,c);break;case 1:if(c6(a,c),4&d)if(a=c.stateNode,null===b)try{a.componentDidMount()}catch(a){dQ(c,c.return,a)}else{var e=b4(c.type,b.memoizedProps);b=b.memoizedState;try{a.componentDidUpdate(e,b,a.__reactInternalSnapshotBeforeUpdate)}catch(a){dQ(c,c.return,a)}}64&d&&cO(c),512&d&&cQ(c,c.return);break;case 3:if(c6(a,c),64&d&&null!==(d=c.updateQueue)){if(a=null,null!==c.child)switch(c.child.tag){case 27:case 5:a=ez(c.child.stateNode);break;case 1:a=c.child.stateNode}try{aP(d,a)}catch(a){dQ(c,c.return,a)}}break;case 27:gp&&null===b&&4&d&&cY(c);case 26:case 5:if(c6(a,c),null===b){if(4&d)cS(c);else if(64&d){a=c.type,b=c.memoizedProps,e=c.stateNode;try{fY(e,a,b,c)}catch(a){dQ(c,c.return,a)}}}512&d&&cQ(c,c.return);break;case 12:default:c6(a,c);break;case 31:c6(a,c),4&d&&c0(a,c);break;case 13:c6(a,c),4&d&&c1(a,c),64&d&&null!==(d=c.memoizedState)&&null!==(d=d.dehydrated)&&fE(d,c=dU.bind(null,c));break;case 22:if(!(d=null!==c.memoizedState||h6)){b=null!==b&&null!==b.memoizedState||h7,e=h6;var f=h7;h6=d,(h7=b)&&!f?function a(b,c,d){for(d=d&&(8772&c.subtreeFlags)!=0,c=c.child;null!==c;){var e=c.alternate,f=b,g=c,h=g.flags;switch(g.tag){case 0:case 11:case 15:a(f,g,d),cM(4,g);break;case 1:if(a(f,g,d),"function"==typeof(f=(e=g).stateNode).componentDidMount)try{f.componentDidMount()}catch(a){dQ(e,e.return,a)}if(null!==(f=(e=g).updateQueue)){var i=e.stateNode;try{var j=f.shared.hiddenCallbacks;if(null!==j)for(f.shared.hiddenCallbacks=null,f=0;f<j.length;f++)aO(j[f],i)}catch(a){dQ(e,e.return,a)}}d&&64&h&&cO(g),cQ(g,g.return);break;case 27:gp&&cY(g);case 26:case 5:a(f,g,d),d&&null===e&&4&h&&cS(g),cQ(g,g.return);break;case 12:default:a(f,g,d);break;case 31:a(f,g,d),d&&4&h&&c0(f,g);break;case 13:a(f,g,d),d&&4&h&&c1(f,g);break;case 22:null===g.memoizedState&&a(f,g,d),cQ(g,g.return);case 30:}c=c.sibling}}(a,c,(8772&c.subtreeFlags)!=0):c6(a,c),h6=e,h7=f}case 30:}}function c$(a,b,c){for(c=c.child;null!==c;)c_(a,b,c),c=c.sibling}function c_(a,b,c){if(gQ&&"function"==typeof gQ.onCommitFiberUnmount)try{gQ.onCommitFiberUnmount(gP,c)}catch{}switch(c.tag){case 26:if(gb){h7||cR(c,b),c$(a,b,c),c.memoizedState?gg(c.memoizedState):c.stateNode&&gj(c.stateNode);break}case 27:if(gp){h7||cR(c,b);var d=ib,e=ic;gu(c.type)&&(ib=c.stateNode,ic=!1),c$(a,b,c),gs(c.stateNode),ib=d,ic=e;break}case 5:h7||cR(c,b);case 6:if(eN){if(d=ib,e=ic,ib=null,c$(a,b,c),ib=d,ic=e,null!==ib)if(ic)try{fn(ib,c.stateNode)}catch(a){dQ(c,b,a)}else try{fm(ib,c.stateNode)}catch(a){dQ(c,b,a)}}else c$(a,b,c);break;case 18:eN&&null!==ib&&(ic?f3(ib,c.stateNode):f2(ib,c.stateNode));break;case 4:eN?(d=ib,e=ic,ib=c.stateNode.containerInfo,ic=!0,c$(a,b,c),ib=d,ic=e):(eO&&cX(c.stateNode,c,fv()),c$(a,b,c));break;case 0:case 11:case 14:case 15:cN(2,c,b),h7||cN(4,c,b),c$(a,b,c);break;case 1:h7||(cR(c,b),"function"==typeof(d=c.stateNode).componentWillUnmount&&cP(c,b,d)),c$(a,b,c);break;case 21:default:c$(a,b,c);break;case 22:h7=(d=h7)||null!==c.memoizedState,c$(a,b,c),h7=d}}function c0(a,b){if(eP&&null===b.memoizedState&&null!==(a=b.alternate)&&null!==(a=a.memoizedState)){a=a.dehydrated;try{f$(a)}catch(a){dQ(b,b.return,a)}}}function c1(a,b){if(eP&&null===b.memoizedState&&null!==(a=b.alternate)&&null!==(a=a.memoizedState)&&null!==(a=a.dehydrated))try{f_(a)}catch(a){dQ(b,b.return,a)}}function c2(a,b){var c=function(a){switch(a.tag){case 31:case 13:case 19:var b=a.stateNode;return null===b&&(b=a.stateNode=new h9),b;case 22:return null===(b=(a=a.stateNode)._retryCache)&&(b=a._retryCache=new h9),b;default:throw Error(d(435,a.tag))}}(a);b.forEach(function(b){if(!c.has(b)){c.add(b);var d=dV.bind(null,a,b);b.then(d,d)}})}function c3(a,b){var c=b.deletions;if(null!==c)for(var e=0;e<c.length;e++){var f=c[e],g=a,h=b;if(eN){var i=h;h:for(;null!==i;){switch(i.tag){case 27:if(gp){if(gu(i.type)){ib=i.stateNode,ic=!1;break h}break}case 5:ib=i.stateNode,ic=!1;break h;case 3:case 4:ib=i.stateNode.containerInfo,ic=!0;break h}i=i.return}if(null===ib)throw Error(d(160));c_(g,h,f),ib=null,ic=!1}else c_(g,h,f);null!==(g=f.alternate)&&(g.return=null),f.return=null}if(13886&b.subtreeFlags)for(b=b.child;null!==b;)c4(b,a),b=b.sibling}function c4(a,b){var c=a.alternate,e=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:c3(b,a),c5(a),4&e&&(cN(3,a,a.return),cM(3,a),cN(5,a,a.return));break;case 1:c3(b,a),c5(a),512&e&&(h7||null===c||cR(c,c.return)),64&e&&h6&&null!==(a=a.updateQueue)&&null!==(e=a.callbacks)&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=null===c?e:c.concat(e));break;case 26:if(gb){var f=id;if(c3(b,a),c5(a),512&e&&(h7||null===c||cR(c,c.return)),4&e){e=null!==c?c.memoizedState:null;var g=a.memoizedState;null===c?null===g?null===a.stateNode?a.stateNode=gh(f,a.type,a.memoizedProps,a):gi(f,a.type,a.stateNode):a.stateNode=gf(f,g,a.memoizedProps):e!==g?(null===e?null!==c.stateNode&&gj(c.stateNode):gg(e),null===g?gi(f,a.type,a.stateNode):gf(f,g,a.memoizedProps)):null===g&&null!==a.stateNode&&cT(a,a.memoizedProps,c.memoizedProps)}break}case 27:if(gp){c3(b,a),c5(a),512&e&&(h7||null===c||cR(c,c.return)),null!==c&&4&e&&cT(a,a.memoizedProps,c.memoizedProps);break}case 5:if(c3(b,a),c5(a),512&e&&(h7||null===c||cR(c,c.return)),eN){if(32&a.flags){f=a.stateNode;try{fo(f)}catch(b){dQ(a,a.return,b)}}4&e&&null!=a.stateNode&&(f=a.memoizedProps,cT(a,f,null!==c?c.memoizedProps:f)),1024&e&&(h8=!0)}else eO&&null!==a.alternate&&(a.alternate.stateNode=a.stateNode);break;case 6:if(c3(b,a),c5(a),4&e&&eN){if(null===a.stateNode)throw Error(d(162));e=a.memoizedProps,c=null!==c?c.memoizedProps:e,f=a.stateNode;try{fh(f,c,e)}catch(b){dQ(a,a.return,b)}}break;case 3:if(gb?(gl(),f=id,id=gd(b.containerInfo),c3(b,a),id=f):c3(b,a),c5(a),4&e){if(eN&&eP&&null!==c&&c.memoizedState.isDehydrated)try{fZ(b.containerInfo)}catch(b){dQ(a,a.return,b)}if(eO){e=b.containerInfo,c=b.pendingChildren;try{fy(e,c)}catch(b){dQ(a,a.return,b)}}}h8&&(h8=!1,function a(b){if(1024&b.subtreeFlags)for(b=b.child;null!==b;){var c=b;a(c),5===c.tag&&1024&c.flags&&e4(c.stateNode),b=b.sibling}}(a));break;case 4:gb?(c=id,id=gd(a.stateNode.containerInfo),c3(b,a),c5(a),id=c):(c3(b,a),c5(a)),4&e&&eO&&cX(a.stateNode,a,a.stateNode.pendingChildren);break;case 12:default:c3(b,a),c5(a);break;case 31:case 19:c3(b,a),c5(a),4&e&&null!==(e=a.updateQueue)&&(a.updateQueue=null,c2(a,e));break;case 13:c3(b,a),c5(a),8192&a.child.flags&&null!==a.memoizedState!=(null!==c&&null!==c.memoizedState)&&(iI=gI()),4&e&&null!==(e=a.updateQueue)&&(a.updateQueue=null,c2(a,e));break;case 22:f=null!==a.memoizedState;var h=null!==c&&null!==c.memoizedState,i=h6,j=h7;if(h6=i||f,h7=j||h,c3(b,a),h7=j,h6=i,c5(a),8192&e&&((b=a.stateNode)._visibility=f?-2&b._visibility:1|b._visibility,f&&(null===c||h||h6||h7||function a(b){for(b=b.child;null!==b;){var c=b;switch(c.tag){case 0:case 11:case 14:case 15:cN(4,c,c.return),a(c);break;case 1:cR(c,c.return);var d=c.stateNode;"function"==typeof d.componentWillUnmount&&cP(c,c.return,d),a(c);break;case 27:gp&&gs(c.stateNode);case 26:case 5:cR(c,c.return),a(c);break;case 22:null===c.memoizedState&&a(c);break;default:a(c)}b=b.sibling}}(a)),eN)){h:if(c=null,eN)for(b=a;;){if(5===b.tag||gb&&26===b.tag){if(null===c){h=c=b;try{g=h.stateNode,f?fp(g):fr(h.stateNode,h.memoizedProps)}catch(a){dQ(h,h.return,a)}}}else if(6===b.tag){if(null===c){h=b;try{var k=h.stateNode;f?fq(k):fs(k,h.memoizedProps)}catch(a){dQ(h,h.return,a)}}}else if(18===b.tag){if(null===c){h=b;try{var l=h.stateNode;f?f4(l):f5(h.stateNode)}catch(a){dQ(h,h.return,a)}}}else if((22!==b.tag&&23!==b.tag||null===b.memoizedState||b===a)&&null!==b.child){b.child.return=b,b=b.child;continue}if(b===a)break h;for(;null===b.sibling;){if(null===b.return||b.return===a)break h;c===b&&(c=null),b=b.return}c===b&&(c=null),b.sibling.return=b.return,b=b.sibling}}4&e&&null!==(e=a.updateQueue)&&null!==(c=e.retryQueue)&&(e.retryQueue=null,c2(a,c));case 30:case 21:}}function c5(a){var b=a.flags;if(2&b){try{for(var c,e=a.return;null!==e;){if(cU(e)){c=e;break}e=e.return}if(eN){if(null==c)throw Error(d(160));switch(c.tag){case 27:if(gp){var f=c.stateNode,g=cV(a);cW(a,g,f);break}case 5:var h=c.stateNode;32&c.flags&&(fo(h),c.flags&=-33);var i=cV(a);cW(a,i,h);break;case 3:case 4:var j=c.stateNode.containerInfo,k=cV(a);!function a(b,c,d){var e=b.tag;if(5===e||6===e)b=b.stateNode,c?fl(d,b,c):fg(d,b);else if(4!==e&&(gp&&27===e&&gu(b.type)&&(d=b.stateNode,c=null),null!==(b=b.child)))for(a(b,c,d),b=b.sibling;null!==b;)a(b,c,d),b=b.sibling}(a,k,j);break;default:throw Error(d(161))}}}catch(b){dQ(a,a.return,b)}a.flags&=-3}4096&b&&(a.flags&=-4097)}function c6(a,b){if(8772&b.subtreeFlags)for(b=b.child;null!==b;)cZ(a,b.alternate,b),b=b.sibling}function c7(a,b){var c=null;null!==a&&null!==a.memoizedState&&null!==a.memoizedState.cachePool&&(c=a.memoizedState.cachePool.pool),a=null,null!==b.memoizedState&&null!==b.memoizedState.cachePool&&(a=b.memoizedState.cachePool.pool),a!==c&&(null!=a&&a.refCount++,null!=c&&ac(c))}function c8(a,b){a=null,null!==b.alternate&&(a=b.alternate.memoizedState.cache),(b=b.memoizedState.cache)!==a&&(b.refCount++,null!=a&&ac(a))}function c9(a,b,c,d){if(10256&b.subtreeFlags)for(b=b.child;null!==b;)da(a,b,c,d),b=b.sibling}function da(a,b,c,d){var e=b.flags;switch(b.tag){case 0:case 11:case 15:c9(a,b,c,d),2048&e&&cM(9,b);break;case 1:case 31:case 13:default:c9(a,b,c,d);break;case 3:c9(a,b,c,d),2048&e&&(a=null,null!==b.alternate&&(a=b.alternate.memoizedState.cache),(b=b.memoizedState.cache)!==a&&(b.refCount++,null!=a&&ac(a)));break;case 12:if(2048&e){c9(a,b,c,d),a=b.stateNode;try{var f=b.memoizedProps,g=f.id,h=f.onPostCommit;"function"==typeof h&&h(g,null===b.alternate?"mount":"update",a.passiveEffectDuration,-0)}catch(a){dQ(b,b.return,a)}}else c9(a,b,c,d);break;case 23:break;case 22:f=b.stateNode,g=b.alternate,null!==b.memoizedState?2&f._visibility?c9(a,b,c,d):db(a,b):2&f._visibility?c9(a,b,c,d):(f._visibility|=2,function a(b,c,d,e,f){for(f=f&&(10256&c.subtreeFlags)!=0,c=c.child;null!==c;){var g=c,h=g.flags;switch(g.tag){case 0:case 11:case 15:a(b,g,d,e,f),cM(8,g);break;case 23:break;case 22:var i=g.stateNode;null!==g.memoizedState?2&i._visibility?a(b,g,d,e,f):db(b,g):(i._visibility|=2,a(b,g,d,e,f)),f&&2048&h&&c7(g.alternate,g);break;case 24:a(b,g,d,e,f),f&&2048&h&&c8(g.alternate,g);break;default:a(b,g,d,e,f)}c=c.sibling}}(a,b,c,d,(10256&b.subtreeFlags)!=0)),2048&e&&c7(g,b);break;case 24:c9(a,b,c,d),2048&e&&c8(b.alternate,b)}}function db(a,b){if(10256&b.subtreeFlags)for(b=b.child;null!==b;){var c=b,d=c.flags;switch(c.tag){case 22:db(a,c),2048&d&&c7(c.alternate,c);break;case 24:db(a,c),2048&d&&c8(c.alternate,c);break;default:db(a,c)}b=b.sibling}}function dc(a,b,c){if(a.subtreeFlags&ie)for(a=a.child;null!==a;)dd(a,b,c),a=a.sibling}function dd(a,b,c){switch(a.tag){case 26:if(dc(a,b,c),a.flags&ie)if(null!==a.memoizedState)go(c,id,a.memoizedState,a.memoizedProps);else{var d=a.stateNode,e=a.type;a=a.memoizedProps,((0x13ffff40&b)===b||eZ(e,a))&&e0(c,d,e,a)}break;case 5:dc(a,b,c),a.flags&ie&&(d=a.stateNode,e=a.type,a=a.memoizedProps,((0x13ffff40&b)===b||eZ(e,a))&&e0(c,d,e,a));break;case 3:case 4:gb?(d=id,id=gd(a.stateNode.containerInfo),dc(a,b,c),id=d):dc(a,b,c);break;case 22:null===a.memoizedState&&(null!==(d=a.alternate)&&null!==d.memoizedState?(d=ie,ie=0x1000000,dc(a,b,c),ie=d):dc(a,b,c));break;default:dc(a,b,c)}}function de(a){var b=a.alternate;if(null!==b&&null!==(a=b.child)){b.child=null;do b=a.sibling,a.sibling=null,a=b;while(null!==a)}}function df(a){var b=a.deletions;if((16&a.flags)!=0){if(null!==b)for(var c=0;c<b.length;c++){var d=b[c];ia=d,dh(d,a)}de(a)}if(10256&a.subtreeFlags)for(a=a.child;null!==a;)dg(a),a=a.sibling}function dg(a){switch(a.tag){case 0:case 11:case 15:df(a),2048&a.flags&&cN(9,a,a.return);break;case 3:case 12:default:df(a);break;case 22:var b=a.stateNode;null!==a.memoizedState&&2&b._visibility&&(null===a.return||13!==a.return.tag)?(b._visibility&=-3,function a(b){var c=b.deletions;if((16&b.flags)!=0){if(null!==c)for(var d=0;d<c.length;d++){var e=c[d];ia=e,dh(e,b)}de(b)}for(b=b.child;null!==b;){switch((c=b).tag){case 0:case 11:case 15:cN(8,c,c.return),a(c);break;case 22:2&(d=c.stateNode)._visibility&&(d._visibility&=-3,a(c));break;default:a(c)}b=b.sibling}}(a)):df(a)}}function dh(a,b){for(;null!==ia;){var c=ia;switch(c.tag){case 0:case 11:case 15:cN(8,c,b);break;case 23:case 22:if(null!==c.memoizedState&&null!==c.memoizedState.cachePool){var d=c.memoizedState.cachePool.pool;null!=d&&d.refCount++}break;case 24:ac(c.memoizedState.cache)}if(null!==(d=c.child))d.return=c,ia=d;else for(c=a;null!==ia;){var e=(d=ia).sibling,f=d.return;if(function a(b){var c=b.alternate;null!==c&&(b.alternate=null,a(c)),b.child=null,b.deletions=null,b.sibling=null,5===b.tag&&null!==(c=b.stateNode)&&eW(c),b.stateNode=null,b.return=null,b.dependencies=null,b.memoizedProps=null,b.memoizedState=null,b.pendingProps=null,b.stateNode=null,b.updateQueue=null}(d),d===c){ia=null;break}if(null!==e){e.return=f,ia=e;break}ia=f}}}function di(a){var b=eQ(a);if(null!=b){if("string"!=typeof b.memoizedProps["data-testname"])throw Error(d(364));return b}if(null===(a=e8(a)))throw Error(d(362));return a.stateNode.current}function dj(a,b){var c=a.tag;switch(b.$$typeof){case ih:if(a.type===b.value)return!0;break;case ii:h:{for(b=b.value,a=[a,0],c=0;c<a.length;){var e=a[c++],f=e.tag,g=a[c++],h=b[g];if(5!==f&&26!==f&&27!==f||!fb(e)){for(;null!=h&&dj(e,h);)h=b[++g];if(g===b.length){b=!0;break h}for(e=e.child;null!==e;)a.push(e,g),e=e.sibling}}b=!1}return b;case ij:if((5===c||26===c||27===c)&&fc(a.stateNode,b.value))return!0;break;case il:if((5===c||6===c||26===c||27===c)&&null!==(a=fa(a))&&0<=a.indexOf(b.value))return!0;break;case ik:if((5===c||26===c||27===c)&&"string"==typeof(a=a.memoizedProps["data-testname"])&&a.toLowerCase()===b.value.toLowerCase())return!0;break;default:throw Error(d(365))}return!1}function dk(a){switch(a.$$typeof){case ih:return"<"+(i(a.value)||"Unknown")+">";case ii:return":has("+(dk(a)||"")+")";case ij:return'[role="'+a.value+'"]';case il:return'"'+a.value+'"';case ik:return'[data-testname="'+a.value+'"]';default:throw Error(d(365))}}function dl(a,b){var c=[];a=[a,0];for(var d=0;d<a.length;){var e=a[d++],f=e.tag,g=a[d++],h=b[g];if(5!==f&&26!==f&&27!==f||!fb(e)){for(;null!=h&&dj(e,h);)h=b[++g];if(g===b.length)c.push(e);else for(e=e.child;null!==e;)a.push(e,g),e=e.sibling}}return c}function dm(a,b){if(!e7)throw Error(d(363));a=dl(a=di(a),b),b=[],a=Array.from(a);for(var c=0;c<a.length;){var e=a[c++],f=e.tag;if(5===f||26===f||27===f)fb(e)||b.push(e.stateNode);else for(e=e.child;null!==e;)a.push(e),e=e.sibling}return b}function dn(){return(2&ip)!=0&&0!==is?is&-is:null!==ev.T?al():eU()}function dp(){if(0===iD)if((0x20000000&is)==0||g9){var a=gC;(3932160&(gC<<=1))==0&&(gC=262144),iD=a}else iD=0x20000000;return null!==(a=hM.current)&&(a.flags|=32),iD}function dq(a,b,c){(a===iq&&(2===it||9===it)||null!==a.cancelPendingCommit)&&(dw(a,0),dt(a,is,iD,!1)),r(a,c),((2&ip)==0||a!==iq)&&(a===iq&&((2&ip)==0&&(iB|=c),4===iz&&dt(a,is,iD,!1)),ae(a))}function dr(a,b,c){if((6&ip)!=0)throw Error(d(327));for(var e=!c&&(127&b)==0&&(b&a.expiredLanes)==0||o(a,b),f=e?function(a,b){var c=ip;ip|=2;var e=dz(),f=dA();iq!==a||is!==b?(iL=null,iK=gI()+500,dw(a,b)):iw=o(a,b);h:for(;;)try{if(0!==it&&null!==ir){b=ir;var g=iu;i:switch(it){case 1:it=0,iu=null,dF(a,b,g,1);break;case 2:case 9:if(ar(g)){it=0,iu=null,dE(b);break}b=function(){2!==it&&9!==it||iq!==a||(it=7),ae(a)},g.then(b,b);break h;case 3:it=7;break h;case 4:it=5;break h;case 7:ar(g)?(it=0,iu=null,dE(b)):(it=0,iu=null,dF(a,b,g,7));break;case 5:var h=null;switch(ir.tag){case 26:h=ir.memoizedState;case 5:case 27:var i=ir,j=i.type,k=i.pendingProps;if(h?gn(h):e$(i.stateNode,j,k)){it=0,iu=null;var l=i.sibling;if(null!==l)ir=l;else{var m=i.return;null!==m?(ir=m,dG(m)):ir=null}break i}}it=0,iu=null,dF(a,b,g,5);break;case 6:it=0,iu=null,dF(a,b,g,6);break;case 8:dv(),iz=6;break h;default:throw Error(d(462))}}for(;null!==ir&&!gG();)dD(ir);break}catch(b){dx(a,b)}return hf=he=null,ev.H=e,ev.A=f,ip=c,null!==ir?0:(iq=null,is=0,aA(),iz)}(a,b):dC(a,b,!0),g=e;;){if(0===f)iw&&!e&&dt(a,b,0,!1);else{if(c=a.current.alternate,g&&!function(a){for(var b=a;;){var c=b.tag;if((0===c||11===c||15===c)&&16384&b.flags&&null!==(c=b.updateQueue)&&null!==(c=c.stores))for(var d=0;d<c.length;d++){var e=c[d],f=e.getSnapshot;e=e.value;try{if(!gR(f(),e))return!1}catch{return!1}}if(c=b.child,16384&b.subtreeFlags&&null!==c)c.return=b,b=c;else{if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return!0;b=b.return}b.sibling.return=b.return,b=b.sibling}}return!0}(c)){f=dC(a,b,!1),g=!1;continue}if(2===f){if(g=b,a.errorRecoveryDisabledLanes&g)var h=0;else h=0!=(h=-0x20000001&a.pendingLanes)?h:0x20000000&h?0x20000000:0;if(0!==h){b=h;h:{f=iF;var i=eP&&a.current.memoizedState.isDehydrated;if(i&&(dw(a,h).flags|=256),2!==(h=dC(a,h,!1))){if(ix&&!i){a.errorRecoveryDisabledLanes|=g,iB|=g,f=4;break h}g=iG,iG=f,null!==g&&(null===iG?iG=g:iG.push.apply(iG,g))}f=h}if(g=!1,2!==f)continue}}if(1===f){dw(a,0),dt(a,b,0,!0);break}h:{switch(e=a,g=f){case 0:case 1:throw Error(d(345));case 4:if((4194048&b)!==b)break;case 6:dt(e,b,iD,!iv);break h;case 2:iG=null;break;case 3:case 5:break;default:throw Error(d(329))}if((0x3c00000&b)===b&&10<(f=iI+300-gI())){if(dt(e,b,iD,!iv),0!==n(e,0,!0))break h;iQ=b,e.timeoutHandle=eJ(ds.bind(null,e,c,iG,iL,iH,b,iD,iB,iE,iv,g,"Throttled",-0,0),f);break h}ds(e,c,iG,iL,iH,b,iD,iB,iE,iv,g,null,-0,0)}}break}ae(a)}function ds(a,b,c,d,e,f,g,h,i,j,k,l,m,n){if(a.timeoutHandle=eL,8192&(l=b.subtreeFlags)||(0x1002000&l)==0x1002000){dd(b,f,l=e_());var o=(0x3c00000&f)===f?iI-gI():(4194048&f)===f?iJ-gI():0;if(null!==(o=e1(l,o))){iQ=f,a.cancelPendingCommit=o(dI.bind(null,a,b,f,c,d,e,g,h,i,k,l,null,m,n)),dt(a,f,g,!j);return}}dI(a,b,f,c,d,e,g,h,i)}function dt(a,b,c,d){b&=~iC,b&=~iB,a.suspendedLanes|=b,a.pingedLanes&=~b,d&&(a.warmLanes|=b),d=a.expirationTimes;for(var e=b;0<e;){var f=31-gy(e),g=1<<f;d[f]=-1,e&=~g}0!==c&&s(a,c,b)}function du(){return(6&ip)!=0||(af(0,!1),!1)}function dv(){if(null!==ir){if(0===it)var a=ir.return;else a=ir,hf=he=null,a5(a),hB=null,hC=0,a=ir;for(;null!==a;)cL(a.alternate,a),a=a.return;ir=null}}function dw(a,b){var c=a.timeoutHandle;c!==eL&&(a.timeoutHandle=eL,eK(c)),null!==(c=a.cancelPendingCommit)&&(a.cancelPendingCommit=null,c()),iQ=0,dv(),iq=a,ir=c=dY(a.current,null),is=b,it=0,iu=null,iv=!1,iw=o(a,b),ix=!1,iE=iD=iC=iB=iA=iz=0,iG=iF=null,iH=!1,(8&b)!=0&&(b|=32&b);var d=a.entangledLanes;if(0!==d)for(a=a.entanglements,d&=b;0<d;){var e=31-gy(d),f=1<<e;b|=a[e],d&=~f}return iy=b,aA(),c}function dx(a,b){hQ=null,ev.H=h$,b===hw||b===hy?(b=au(),it=3):b===hx?(b=au(),it=4):it=b===h3?8:null!==b&&"object"==typeof b&&"function"==typeof b.then?6:1,iu=b,null===ir&&(iz=1,b5(a,C(b,a.current)))}function dy(){var a=hM.current;return null===a||((4194048&is)===is?null===hN:((0x3c00000&is)===is||(0x20000000&is)!=0)&&a===hN)}function dz(){var a=ev.H;return ev.H=h$,null===a?h$:a}function dA(){var a=ev.A;return ev.A=ig,a}function dB(){iz=4,iv||(4194048&is)!==is&&null!==hM.current||(iw=!0),(0x7ffffff&iA)==0&&(0x7ffffff&iB)==0||null===iq||dt(iq,is,iD,!1)}function dC(a,b,c){var d=ip;ip|=2;var e=dz(),f=dA();(iq!==a||is!==b)&&(iL=null,dw(a,b)),b=!1;var g=iz;h:for(;;)try{if(0!==it&&null!==ir){var h=ir,i=iu;switch(it){case 8:dv(),g=6;break h;case 3:case 2:case 9:case 6:null===hM.current&&(b=!0);var j=it;if(it=0,iu=null,dF(a,h,i,j),c&&iw){g=0;break h}break;default:j=it,it=0,iu=null,dF(a,h,i,j)}}(function(){for(;null!==ir;)dD(ir)})(),g=iz;break}catch(b){dx(a,b)}return b&&a.shellSuspendCounter++,hf=he=null,ip=d,ev.H=e,ev.A=f,null===ir&&(iq=null,is=0,aA()),g}function dD(a){var b=cz(a.alternate,a,iy);a.memoizedProps=a.pendingProps,null===b?dG(a):ir=b}function dE(a){var b=a,c=b.alternate;switch(b.tag){case 15:case 0:b=cl(c,b,b.pendingProps,b.type,void 0,is);break;case 11:b=cl(c,b,b.pendingProps,b.type.render,b.ref,is);break;case 5:a5(b);default:cL(c,b),b=cz(c,b=ir=dZ(b,iy),iy)}a.memoizedProps=a.pendingProps,null===b?dG(a):ir=b}function dF(a,b,c,e){hf=he=null,a5(b),hB=null,hC=0;var f=b.return;try{if(function(a,b,c,e,f){if(c.flags|=32768,null!==e&&"object"==typeof e&&"function"==typeof e.then){if(null!==(b=c.alternate)&&X(b,c,f,!0),null!==(c=hM.current)){switch(c.tag){case 31:case 13:return null===hN?dB():null===c.alternate&&0===iz&&(iz=3),c.flags&=-257,c.flags|=65536,c.lanes=f,e===hz?c.flags|=16384:(null===(b=c.updateQueue)?c.updateQueue=new Set([e]):b.add(e),dR(a,e,f)),!1;case 22:return c.flags|=65536,e===hz?c.flags|=16384:(null===(b=c.updateQueue)?(b={transitions:null,markerInstances:null,retryQueue:new Set([e])},c.updateQueue=b):null===(c=b.retryQueue)?b.retryQueue=new Set([e]):c.add(e),dR(a,e,f)),!1}throw Error(d(435,c.tag))}return dR(a,e,f),dB(),!1}if(g9)return null!==(b=hM.current)?((65536&b.flags)==0&&(b.flags|=256),b.flags|=65536,b.lanes=f,e!==hc&&S(C(a=Error(d(422),{cause:e}),c))):(e!==hc&&S(C(b=Error(d(423),{cause:e}),c)),a=a.current.alternate,a.flags|=65536,f&=-f,a.lanes|=f,e=C(e,c),f=b7(a.stateNode,e,f),aL(a,f),4!==iz&&(iz=2)),!1;var g=Error(d(520),{cause:e});if(g=C(g,c),null===iF?iF=[g]:iF.push(g),4!==iz&&(iz=2),null===b)return!0;e=C(e,c),c=b;do{switch(c.tag){case 3:return c.flags|=65536,a=f&-f,c.lanes|=a,a=b7(c.stateNode,e,a),aL(c,a),!1;case 1:if(b=c.type,g=c.stateNode,(128&c.flags)==0&&("function"==typeof b.getDerivedStateFromError||null!==g&&"function"==typeof g.componentDidCatch&&(null===iM||!iM.has(g))))return c.flags|=65536,f&=-f,c.lanes|=f,b9(f=b8(f),a,c,e),aL(c,f),!1}c=c.return}while(null!==c)return!1}(a,f,b,c,is)){iz=1,b5(a,C(c,a.current)),ir=null;return}}catch(b){if(null!==f)throw ir=f,b;iz=1,b5(a,C(c,a.current)),ir=null;return}32768&b.flags?(g9||1===e?a=!0:iw||(0x20000000&is)!=0?a=!1:(iv=a=!0,(2===e||9===e||3===e||6===e)&&null!==(e=hM.current)&&13===e.tag&&(e.flags|=16384)),dH(b,a)):dG(b)}function dG(a){var b=a;do{if((32768&b.flags)!=0)return void dH(b,iv);a=b.return;var c=function(a,b,c){var e=b.pendingProps;switch(G(b),b.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return cK(b),null;case 3:return c=b.stateNode,e=null,null!==a&&(e=a.memoizedState.cache),b.memoizedState.cache!==e&&(b.flags|=2048),U(hj),J(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(null===a||null===a.child)&&(P(b)?cA(b):null===a||a.memoizedState.isDehydrated&&(256&b.flags)==0||(b.flags|=1024,R())),cE(a,b),cK(b),null;case 26:if(gb){var f=b.type,g=b.memoizedState;return null===a?(cA(b),null!==g?(cK(b),cH(b,g)):(cK(b),cG(b,f,null,e,c))):g?g!==a.memoizedState?(cA(b),cK(b),cH(b,g)):(cK(b),b.flags&=-0x1000001):(g=a.memoizedProps,eN?g!==e&&cA(b):cF(a,b,f,e),cK(b),cG(b,f,g,e,c)),null}case 27:if(gp){if(L(b),c=g5.current,f=b.type,null!==a&&null!=b.stateNode)eN?a.memoizedProps!==e&&cA(b):cF(a,b,f,e);else{if(!e){if(null===b.stateNode)throw Error(d(166));return cK(b),null}a=g3.current,P(b)?N(b,a):(b.stateNode=a=gq(f,e,c,a,!0),cA(b))}return cK(b),null}case 5:if(L(b),f=b.type,null!==a&&null!=b.stateNode)cF(a,b,f,e);else{if(!e){if(null===b.stateNode)throw Error(d(166));return cK(b),null}if(g=g3.current,P(b))N(b,g),f0(b.stateNode,f,e,g)&&(b.flags|=64);else{var h=eE(f,e,g5.current,g,b);cB(b),cD(h,b,!1,!1),b.stateNode=h,eG(h,f,e,g)&&cA(b)}}return cK(b),cG(b,b.type,null===a?null:a.memoizedProps,b.pendingProps,c),null;case 6:if(a&&null!=b.stateNode)c=a.memoizedProps,eN?c!==e&&cA(b):eO&&(c!==e?(a=g5.current,c=g3.current,cB(b),b.stateNode=eI(e,a,c,b)):b.stateNode=a.stateNode);else{if("string"!=typeof e&&null===b.stateNode)throw Error(d(166));if(a=g5.current,c=g3.current,P(b)){if(!eP)throw Error(d(176));if(a=b.stateNode,c=b.memoizedProps,e=null,null!==(f=g7))switch(f.tag){case 27:case 5:e=f.memoizedProps}fT(a,c,b,e)||M(b,!0)}else cB(b),b.stateNode=eI(e,a,c,b)}return cK(b),null;case 31:if(c=b.memoizedState,null===a||null!==a.memoizedState){if(e=P(b),null!==c){if(null===a){if(!e)throw Error(d(318));if(!eP)throw Error(d(556));if(!(a=null!==(a=b.memoizedState)?a.dehydrated:null))throw Error(d(557));fU(a,b)}else Q(),(128&b.flags)==0&&(b.memoizedState=null),b.flags|=4;cK(b),a=!1}else c=R(),null!==a&&null!==a.memoizedState&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return 256&b.flags?(aX(b),b):(aX(b),null);if((128&b.flags)!=0)throw Error(d(558))}return cK(b),null;case 13:if(e=b.memoizedState,null===a||null!==a.memoizedState&&null!==a.memoizedState.dehydrated){if(f=P(b),null!==e&&null!==e.dehydrated){if(null===a){if(!f)throw Error(d(318));if(!eP)throw Error(d(344));if(!(f=null!==(f=b.memoizedState)?f.dehydrated:null))throw Error(d(317));fV(f,b)}else Q(),(128&b.flags)==0&&(b.memoizedState=null),b.flags|=4;cK(b),f=!1}else f=R(),null!==a&&null!==a.memoizedState&&(a.memoizedState.hydrationErrors=f),f=!0;if(!f)return 256&b.flags?(aX(b),b):(aX(b),null)}return aX(b),(128&b.flags)!=0?(b.lanes=c,b):(c=null!==e,a=null!==a&&null!==a.memoizedState,c&&(e=b.child,f=null,null!==e.alternate&&null!==e.alternate.memoizedState&&null!==e.alternate.memoizedState.cachePool&&(f=e.alternate.memoizedState.cachePool.pool),g=null,null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(g=e.memoizedState.cachePool.pool),g!==f&&(e.flags|=2048)),c!==a&&c&&(b.child.flags|=8192),cI(b,b.updateQueue),cK(b),null);case 4:return J(),cE(a,b),null===a&&eR(b.stateNode.containerInfo),cK(b),null;case 10:return U(b.type),cK(b),null;case 19:if(k(hO),null===(e=b.memoizedState))return cK(b),null;if(f=(128&b.flags)!=0,null===(g=e.rendering))if(f)cJ(e,!1);else{if(0!==iz||null!==a&&(128&a.flags)!=0)for(a=b.child;null!==a;){if(null!==(g=aY(a))){for(b.flags|=128,cJ(e,!1),b.updateQueue=a=g.updateQueue,cI(b,a),b.subtreeFlags=0,a=c,c=b.child;null!==c;)dZ(c,a),c=c.sibling;return l(hO,1&hO.current|2),g9&&D(b,e.treeForkCount),b.child}a=a.sibling}null!==e.tail&&gI()>iK&&(b.flags|=128,f=!0,cJ(e,!1),b.lanes=4194304)}else{if(!f)if(null!==(a=aY(g))){if(b.flags|=128,f=!0,b.updateQueue=a=a.updateQueue,cI(b,a),cJ(e,!0),null===e.tail&&"hidden"===e.tailMode&&!g.alternate&&!g9)return cK(b),null}else 2*gI()-e.renderingStartTime>iK&&0x20000000!==c&&(b.flags|=128,f=!0,cJ(e,!1),b.lanes=4194304);e.isBackwards?(g.sibling=b.child,b.child=g):(null!==(a=e.last)?a.sibling=g:b.child=g,e.last=g)}return null!==e.tail?(a=e.tail,e.rendering=a,e.tail=a.sibling,e.renderingStartTime=gI(),a.sibling=null,c=hO.current,l(hO,f?1&c|2:1&c),g9&&D(b,e.treeForkCount),a):(cK(b),null);case 22:case 23:return aX(b),aS(),e=null!==b.memoizedState,null!==a?null!==a.memoizedState!==e&&(b.flags|=8192):e&&(b.flags|=8192),e?(0x20000000&c)!=0&&(128&b.flags)==0&&(cK(b),6&b.subtreeFlags&&(b.flags|=8192)):cK(b),null!==(c=b.updateQueue)&&cI(b,c.retryQueue),c=null,null!==a&&null!==a.memoizedState&&null!==a.memoizedState.cachePool&&(c=a.memoizedState.cachePool.pool),e=null,null!==b.memoizedState&&null!==b.memoizedState.cachePool&&(e=b.memoizedState.cachePool.pool),e!==c&&(b.flags|=2048),null!==a&&k(hv),null;case 24:return c=null,null!==a&&(c=a.memoizedState.cache),b.memoizedState.cache!==c&&(b.flags|=2048),U(hj),cK(b),null;case 25:case 30:return null}throw Error(d(156,b.tag))}(b.alternate,b,iy);if(null!==c){ir=c;return}if(null!==(b=b.sibling)){ir=b;return}ir=b=a}while(null!==b)0===iz&&(iz=5)}function dH(a,b){do{var c=function(a,b){switch(G(b),b.tag){case 1:return 65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 3:return U(hj),J(),(65536&(a=b.flags))!=0&&(128&a)==0?(b.flags=-65537&a|128,b):null;case 26:case 27:case 5:return L(b),null;case 31:if(null!==b.memoizedState){if(aX(b),null===b.alternate)throw Error(d(340));Q()}return 65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 13:if(aX(b),null!==(a=b.memoizedState)&&null!==a.dehydrated){if(null===b.alternate)throw Error(d(340));Q()}return 65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 19:return k(hO),null;case 4:return J(),null;case 10:return U(b.type),null;case 22:case 23:return aX(b),aS(),null!==a&&k(hv),65536&(a=b.flags)?(b.flags=-65537&a|128,b):null;case 24:return U(hj),null;default:return null}}(a.alternate,a);if(null!==c){c.flags&=32767,ir=c;return}if(null!==(c=a.return)&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!b&&null!==(a=a.sibling)){ir=a;return}ir=a=c}while(null!==a)iz=6,ir=null}function dI(a,b,c,e,f,g,h,i,j){a.cancelPendingCommit=null;do dN();while(0!==iN)if((6&ip)!=0)throw Error(d(327));if(null!==b){if(b===a.current)throw Error(d(177));if(function(a,b,c,d,e,f){var g=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var h=a.entanglements,i=a.expirationTimes,j=a.hiddenUpdates;for(c=g&~c;0<c;){var k=31-gy(c),l=1<<k;h[k]=0,i[k]=-1;var m=j[k];if(null!==m)for(j[k]=null,k=0;k<m.length;k++){var n=m[k];null!==n&&(n.lane&=-0x20000001)}c&=~l}0!==d&&s(a,d,0),0!==f&&0===e&&0!==a.tag&&(a.suspendedLanes|=f&~(g&~b))}(a,c,g=b.lanes|b.childLanes|hH,h,i,j),a===iq&&(ir=iq=null,is=0),iP=b,iO=a,iQ=c,iR=g,iS=f,iT=e,(10256&b.subtreeFlags)!=0||(10256&b.flags)!=0?(a.callbackNode=null,a.callbackPriority=0,gE(gL,function(){return dO(),null})):(a.callbackNode=null,a.callbackPriority=0),e=(13878&b.flags)!=0,(13878&b.subtreeFlags)!=0||e){e=ev.T,ev.T=null,f=eT(),eS(2),h=ip,ip|=4;try{!function(a,b){for(eC(a.containerInfo),ia=b;null!==ia;)if(b=(a=ia).child,(1028&a.subtreeFlags)!=0&&null!==b)b.return=a,ia=b;else for(;null!==ia;){var c=(a=ia).alternate;switch(b=a.flags,a.tag){case 0:if((4&b)!=0&&null!==(b=null!==(b=a.updateQueue)?b.events:null))for(var e=0;e<b.length;e++){var f=b[e];f.ref.impl=f.nextImpl}break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if((1024&b)!=0&&null!==c){b=void 0,e=a,f=c.memoizedProps,c=c.memoizedState;var g=e.stateNode;try{var h=b4(e.type,f);b=g.getSnapshotBeforeUpdate(h,c),g.__reactInternalSnapshotBeforeUpdate=b}catch(a){dQ(e,e.return,a)}}break;case 3:(1024&b)!=0&&eN&&ft(a.stateNode.containerInfo);break;default:if((1024&b)!=0)throw Error(d(163))}if(null!==(b=a.sibling)){b.return=a.return,ia=b;break}ia=a.return}}(a,b,c)}finally{ip=h,eS(f),ev.T=e}}iN=1,dJ(),dK(),dL()}}function dJ(){if(1===iN){iN=0;var a=iO,b=iP,c=(13878&b.flags)!=0;if((13878&b.subtreeFlags)!=0||c){c=ev.T,ev.T=null;var d=eT();eS(2);var e=ip;ip|=4;try{c4(b,a),eD(a.containerInfo)}finally{ip=e,eS(d),ev.T=c}}a.current=b,iN=2}}function dK(){if(2===iN){iN=0;var a=iO,b=iP,c=(8772&b.flags)!=0;if((8772&b.subtreeFlags)!=0||c){c=ev.T,ev.T=null;var d=eT();eS(2);var e=ip;ip|=4;try{cZ(a,b.alternate,b)}finally{ip=e,eS(d),ev.T=c}}iN=3}}function dL(){if(4===iN||3===iN){iN=0,gH();var a=iO,b=iP,c=iQ,d=iT;(10256&b.subtreeFlags)!=0||(10256&b.flags)!=0?iN=5:(iN=0,iP=iO=null,dM(a,a.pendingLanes));var e=a.pendingLanes;if(0===e&&(iM=null),x(c),b=b.stateNode,gQ&&"function"==typeof gQ.onCommitFiberRoot)try{gQ.onCommitFiberRoot(gP,b,void 0,(128&b.current.flags)==128)}catch{}if(null!==d){b=ev.T,e=eT(),eS(2),ev.T=null;try{for(var f=a.onRecoverableError,g=0;g<d.length;g++){var h=d[g];f(h.value,{componentStack:h.stack})}}finally{ev.T=b,eS(e)}}(3&iQ)!=0&&dN(),ae(a),e=a.pendingLanes,(261930&c)!=0&&(42&e)!=0?a===iV?iU++:(iU=0,iV=a):iU=0,eP&&f1(),af(0,!1)}}function dM(a,b){0==(a.pooledCacheLanes&=b)&&null!=(b=a.pooledCache)&&(a.pooledCache=null,ac(b))}function dN(){return dJ(),dK(),dL(),dO()}function dO(){if(5!==iN)return!1;var a=iO,b=iR;iR=0;var c=x(iQ),e=32>c?32:c;c=ev.T;var f=eT();try{eS(e),ev.T=null,e=iS,iS=null;var g=iO,h=iQ;if(iN=0,iP=iO=null,iQ=0,(6&ip)!=0)throw Error(d(331));var i=ip;if(ip|=4,dg(g.current),da(g,g.current,h,e),ip=i,af(0,!1),gQ&&"function"==typeof gQ.onPostCommitFiberRoot)try{gQ.onPostCommitFiberRoot(gP,g)}catch{}return!0}finally{eS(f),ev.T=c,dM(a,b)}}function dP(a,b,c){b=C(c,b),b=b7(a.stateNode,b,2),null!==(a=aJ(a,b,2))&&(r(a,2),ae(a))}function dQ(a,b,c){if(3===a.tag)dP(a,a,c);else for(;null!==b;){if(3===b.tag){dP(b,a,c);break}if(1===b.tag){var d=b.stateNode;if("function"==typeof b.type.getDerivedStateFromError||"function"==typeof d.componentDidCatch&&(null===iM||!iM.has(d))){a=C(c,a),null!==(d=aJ(b,c=b8(2),2))&&(b9(c,d,b,a),r(d,2),ae(d));break}}b=b.return}}function dR(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new io;var e=new Set;d.set(b,e)}else void 0===(e=d.get(b))&&(e=new Set,d.set(b,e));e.has(c)||(ix=!0,e.add(c),a=dS.bind(null,a,b,c),b.then(a,a))}function dS(a,b,c){var d=a.pingCache;null!==d&&d.delete(b),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,iq===a&&(is&c)===c&&(4===iz||3===iz&&(0x3c00000&is)===is&&300>gI()-iI?(2&ip)==0&&dw(a,0):iC|=c,iE===is&&(iE=0)),ae(a)}function dT(a,b){0===b&&(b=p()),null!==(a=aD(a,b))&&(r(a,b),ae(a))}function dU(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane),dT(a,c)}function dV(a,b){var c=0;switch(a.tag){case 31:case 13:var e=a.stateNode,f=a.memoizedState;null!==f&&(c=f.retryLane);break;case 19:e=a.stateNode;break;case 22:e=a.stateNode._retryCache;break;default:throw Error(d(314))}null!==e&&e.delete(b),dT(a,c)}function dW(a,b,c,d){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=b,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dX(a){return!(!(a=a.prototype)||!a.isReactComponent)}function dY(a,c){var d=a.alternate;return null===d?((d=b(a.tag,c,a.key,a.mode)).elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=c,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=0x3e00000&a.flags,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,c=a.dependencies,d.dependencies=null===c?null:{lanes:c.lanes,firstContext:c.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function dZ(a,b){a.flags&=0x3e00002;var c=a.alternate;return null===c?(a.childLanes=0,a.lanes=b,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,a.dependencies=null===(b=c.dependencies)?null:{lanes:b.lanes,firstContext:b.firstContext}),a}function d$(a,c,e,f,g,h){var i=0;if(f=a,"function"==typeof a)dX(a)&&(i=1);else if("string"==typeof a)i=gb&&gp?gc(a,e,g3.current)?26:gt(a)?27:5:gb?gc(a,e,g3.current)?26:5:gp&>(a)?27:5;else h:switch(a){case eq:return(a=b(31,e,c,g)).elementType=eq,a.lanes=h,a;case eg:return d_(e.children,g,h,c);case eh:i=8,g|=24;break;case ei:return(a=b(12,e,c,2|g)).elementType=ei,a.lanes=h,a;case em:return(a=b(13,e,c,g)).elementType=em,a.lanes=h,a;case en:return(a=b(19,e,c,g)).elementType=en,a.lanes=h,a;default:if("object"==typeof a&&null!==a)switch(a.$$typeof){case ek:i=10;break h;case ej:i=9;break h;case el:i=11;break h;case eo:i=14;break h;case ep:i=16,f=null;break h}i=29,e=Error(d(130,null===a?"null":typeof a,"")),f=null}return(c=b(i,e,c,g)).elementType=a,c.type=f,c.lanes=h,c}function d_(a,c,d,e){return(a=b(7,a,e,c)).lanes=d,a}function d0(a,c,d){return(a=b(6,a,null,c)).lanes=d,a}function d1(a){var c=b(18,null,null,0);return c.stateNode=a,c}function d2(a,c,d){return(c=b(4,null!==a.children?a.children:[],a.key,c)).lanes=d,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function d3(a,b,c,d,e,f,g,h,i){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=eL,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=q(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=q(0),this.hiddenUpdates=q(null),this.identifierPrefix=d,this.onUncaughtError=e,this.onCaughtError=f,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=i,this.incompleteTransitions=new Map}function d4(a,c,d,e,f,g,h,i,j,k,l,m){return a=new d3(a,c,d,h,j,k,l,m,i),c=1,!0===g&&(c|=24),g=b(3,null,null,c),a.current=g,g.stateNode=a,c=ab(),c.refCount++,a.pooledCache=c,c.refCount++,g.memoizedState={element:e,isDehydrated:d,cache:c},aG(g),a}function d5(a){var b=a._reactInternals;if(void 0===b)throw"function"==typeof a.render?Error(d(188)):Error(d(268,a=Object.keys(a).join(",")));return null===(a=null!==(a=g(b))?function a(b){var c=b.tag;if(5===c||26===c||27===c||6===c)return b;for(b=b.child;null!==b;){if(null!==(c=a(b)))return c;b=b.sibling}return null}(a):null)?null:ez(a.stateNode)}function d6(a,b,c,d,e,f){e=gx,null===d.context?d.context=e:d.pendingContext=e,(d=aI(b)).payload={element:c},null!==(f=void 0===f?null:f)&&(d.callback=f),null!==(c=aJ(a,d,b))&&(dq(c,a,b),aK(c,a,b))}function d7(a,b){if(null!==(a=a.memoizedState)&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b}}function d8(a,b){d7(a,b),(a=a.alternate)&&d7(a,b)}var d9={},ea=v.default,eb=kH.default,ec=Object.assign,ed=Symbol.for("react.element"),ee=Symbol.for("react.transitional.element"),ef=Symbol.for("react.portal"),eg=Symbol.for("react.fragment"),eh=Symbol.for("react.strict_mode"),ei=Symbol.for("react.profiler"),ej=Symbol.for("react.consumer"),ek=Symbol.for("react.context"),el=Symbol.for("react.forward_ref"),em=Symbol.for("react.suspense"),en=Symbol.for("react.suspense_list"),eo=Symbol.for("react.memo"),ep=Symbol.for("react.lazy"),eq=Symbol.for("react.activity"),er=Symbol.for("react.memo_cache_sentinel"),es=Symbol.iterator,et=Symbol.for("react.client.reference"),eu=Array.isArray,ev=ea.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ew=a.rendererVersion,ex=a.rendererPackageName,ey=a.extraDevToolsConfig,ez=a.getPublicInstance,eA=a.getRootHostContext,eB=a.getChildHostContext,eC=a.prepareForCommit,eD=a.resetAfterCommit,eE=a.createInstance;a.cloneMutableInstance;var eF=a.appendInitialChild,eG=a.finalizeInitialChildren,eH=a.shouldSetTextContent,eI=a.createTextInstance;a.cloneMutableTextInstance;var eJ=a.scheduleTimeout,eK=a.cancelTimeout,eL=a.noTimeout,eM=a.isPrimaryRenderer;a.warnsIfNotActing;var eN=a.supportsMutation,eO=a.supportsPersistence,eP=a.supportsHydration,eQ=a.getInstanceFromNode;a.beforeActiveInstanceBlur;var eR=a.preparePortalMount;a.prepareScopeUpdate,a.getInstanceFromScope;var eS=a.setCurrentUpdatePriority,eT=a.getCurrentUpdatePriority,eU=a.resolveUpdatePriority;a.trackSchedulerEvent,a.resolveEventType,a.resolveEventTimeStamp;var eV=a.shouldAttemptEagerTransition,eW=a.detachDeletedInstance;a.requestPostPaintCallback;var eX=a.maySuspendCommit,eY=a.maySuspendCommitOnUpdate,eZ=a.maySuspendCommitInSyncRender,e$=a.preloadInstance,e_=a.startSuspendingCommit,e0=a.suspendInstance;a.suspendOnActiveViewTransition;var e1=a.waitForCommitToBeReady;a.getSuspendedCommitReason;var e2=a.NotPendingTransition,e3=a.HostTransitionContext,e4=a.resetFormInstance;a.bindToConsole;var e5=a.supportsMicrotasks,e6=a.scheduleMicrotask,e7=a.supportsTestSelectors,e8=a.findFiberRoot,e9=a.getBoundingRect,fa=a.getTextContent,fb=a.isHiddenSubtree,fc=a.matchAccessibilityRole,fd=a.setFocusIfFocusable,fe=a.setupIntersectionObserver,ff=a.appendChild,fg=a.appendChildToContainer,fh=a.commitTextUpdate,fi=a.commitMount,fj=a.commitUpdate,fk=a.insertBefore,fl=a.insertInContainerBefore,fm=a.removeChild,fn=a.removeChildFromContainer,fo=a.resetTextContent,fp=a.hideInstance,fq=a.hideTextInstance,fr=a.unhideInstance,fs=a.unhideTextInstance;a.cancelViewTransitionName,a.cancelRootViewTransitionName,a.restoreRootViewTransitionName,a.cloneRootViewTransitionContainer,a.removeRootViewTransitionClone,a.measureClonedInstance,a.hasInstanceChanged,a.hasInstanceAffectedParent,a.startViewTransition,a.startGestureTransition,a.stopViewTransition,a.getCurrentGestureOffset,a.createViewTransitionInstance;var ft=a.clearContainer;a.createFragmentInstance,a.updateFragmentInstanceFiber,a.commitNewChildToFragmentInstance,a.deleteChildFromFragmentInstance;var fu=a.cloneInstance,fv=a.createContainerChildSet,fw=a.appendChildToContainerChildSet,fx=a.finalizeContainerChildren,fy=a.replaceContainerChildren,fz=a.cloneHiddenInstance,fA=a.cloneHiddenTextInstance,fB=a.isSuspenseInstancePending,fC=a.isSuspenseInstanceFallback,fD=a.getSuspenseInstanceFallbackErrorDetails,fE=a.registerSuspenseInstanceRetry,fF=a.canHydrateFormStateMarker,fG=a.isFormStateMarkerMatching,fH=a.getNextHydratableSibling,fI=a.getNextHydratableSiblingAfterSingleton,fJ=a.getFirstHydratableChild,fK=a.getFirstHydratableChildWithinContainer,fL=a.getFirstHydratableChildWithinActivityInstance,fM=a.getFirstHydratableChildWithinSuspenseInstance,fN=a.getFirstHydratableChildWithinSingleton,fO=a.canHydrateInstance,fP=a.canHydrateTextInstance,fQ=a.canHydrateActivityInstance,fR=a.canHydrateSuspenseInstance,fS=a.hydrateInstance,fT=a.hydrateTextInstance,fU=a.hydrateActivityInstance,fV=a.hydrateSuspenseInstance,fW=a.getNextHydratableInstanceAfterActivityInstance,fX=a.getNextHydratableInstanceAfterSuspenseInstance,fY=a.commitHydratedInstance,fZ=a.commitHydratedContainer,f$=a.commitHydratedActivityInstance,f_=a.commitHydratedSuspenseInstance,f0=a.finalizeHydratedChildren,f1=a.flushHydrationEvents;a.clearActivityBoundary;var f2=a.clearSuspenseBoundary;a.clearActivityBoundaryFromContainer;var f3=a.clearSuspenseBoundaryFromContainer,f4=a.hideDehydratedBoundary,f5=a.unhideDehydratedBoundary,f6=a.shouldDeleteUnhydratedTailInstances;a.diffHydratedPropsForDevWarnings,a.diffHydratedTextForDevWarnings,a.describeHydratableInstanceForDevWarnings;var f7,f8,f9=a.validateHydratableInstance,ga=a.validateHydratableTextInstance,gb=a.supportsResources,gc=a.isHostHoistableType,gd=a.getHoistableRoot,ge=a.getResource,gf=a.acquireResource,gg=a.releaseResource,gh=a.hydrateHoistable,gi=a.mountHoistable,gj=a.unmountHoistable,gk=a.createHoistableInstance,gl=a.prepareToCommitHoistables,gm=a.mayResourceSuspendCommit,gn=a.preloadResource,go=a.suspendResource,gp=a.supportsSingletons,gq=a.resolveSingletonInstance,gr=a.acquireSingletonInstance,gs=a.releaseSingletonInstance,gt=a.isHostSingletonType,gu=a.isSingletonScope,gv=[],gw=-1,gx={},gy=Math.clz32?Math.clz32:function(a){return 0==(a>>>=0)?32:31-(gz(a)/gA|0)|0},gz=Math.log,gA=Math.LN2,gB=256,gC=262144,gD=4194304,gE=eb.unstable_scheduleCallback,gF=eb.unstable_cancelCallback,gG=eb.unstable_shouldYield,gH=eb.unstable_requestPaint,gI=eb.unstable_now,gJ=eb.unstable_ImmediatePriority,gK=eb.unstable_UserBlockingPriority,gL=eb.unstable_NormalPriority,gM=eb.unstable_IdlePriority,gN=eb.log,gO=eb.unstable_setDisableYieldValue,gP=null,gQ=null,gR="function"==typeof Object.is?Object.is:function(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},gS="function"==typeof reportError?reportError:function(a){"object"==typeof process&&"function"==typeof process.emit?process.emit("uncaughtException",a):console.error(a)},gT=Object.prototype.hasOwnProperty,gU=!1,gV=new WeakMap,gW=[],gX=0,gY=null,gZ=0,g$=[],g_=0,g0=null,g1=1,g2="",g3=j(null),g4=j(null),g5=j(null),g6=j(null),g7=null,g8=null,g9=!1,ha=null,hb=!1,hc=Error(d(519)),hd=j(null),he=null,hf=null,hg="u">typeof AbortController?AbortController:function(){var a=[],b=this.signal={aborted:!1,addEventListener:function(b,c){a.push(c)}};this.abort=function(){b.aborted=!0,a.forEach(function(a){return a()})}},hh=eb.unstable_scheduleCallback,hi=eb.unstable_NormalPriority,hj={$$typeof:ek,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},hk=null,hl=null,hm=!1,hn=!1,ho=!1,hp=0,hq=null,hr=0,hs=0,ht=null,hu=ev.S;ev.S=function(a,b){iJ=gI(),"object"==typeof b&&null!==b&&"function"==typeof b.then&&function(a,b){if(null===hq){var c=hq=[];hr=0,hs=al(),ht={status:"pending",value:void 0,then:function(a){c.push(a)}}}hr++,b.then(am,am)}(0,b),null!==hu&&hu(a,b)};var hv=j(null),hw=Error(d(460)),hx=Error(d(474)),hy=Error(d(542)),hz={then:function(){}},hA=null,hB=null,hC=0,hD=az(!0),hE=az(!1),hF=[],hG=0,hH=0,hI=!1,hJ=!1,hK=j(null),hL=j(0),hM=j(null),hN=null,hO=j(0),hP=0,hQ=null,hR=null,hS=null,hT=!1,hU=!1,hV=!1,hW=0,hX=0,hY=null,hZ=0,h$={readContext:$,use:ba,useCallback:aZ,useContext:aZ,useEffect:aZ,useImperativeHandle:aZ,useLayoutEffect:aZ,useInsertionEffect:aZ,useMemo:aZ,useReducer:aZ,useRef:aZ,useState:aZ,useDebugValue:aZ,useDeferredValue:aZ,useTransition:aZ,useSyncExternalStore:aZ,useId:aZ,useHostTransitionStatus:aZ,useFormState:aZ,useActionState:aZ,useOptimistic:aZ,useMemoCache:aZ,useCacheRefresh:aZ};h$.useEffectEvent=aZ;var h_={readContext:$,use:ba,useCallback:function(a,b){return a6().memoizedState=[a,void 0===b?null:b],a},useContext:$,useEffect:bE,useImperativeHandle:function(a,b,c){c=null!=c?c.concat([a]):null,bC(4194308,4,bJ.bind(null,b,a),c)},useLayoutEffect:function(a,b){return bC(4194308,4,a,b)},useInsertionEffect:function(a,b){bC(4,2,a,b)},useMemo:function(a,b){var c=a6();b=void 0===b?null:b;var d=a();return c.memoizedState=[d,b],d},useReducer:function(a,b,c){var d=a6();if(void 0!==c)var e=c(b);else e=b;return d.memoizedState=d.baseState=e,d.queue=a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:e},a=a.dispatch=bW.bind(null,hQ,a),[d.memoizedState,a]},useRef:function(a){return a6().memoizedState={current:a}},useState:function(a){var b=(a=bm(a)).queue,c=bX.bind(null,hQ,b);return b.dispatch=c,[a.memoizedState,c]},useDebugValue:bL,useDeferredValue:function(a,b){return bO(a6(),a,b)},useTransition:function(){var a=bm(!1);return a=bQ.bind(null,hQ,a.queue,!0,!1),a6().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,b,c){var e=hQ,f=a6();if(g9){if(void 0===c)throw Error(d(407));c=c()}else{if(c=b(),null===iq)throw Error(d(349));(127&is)!=0||bh(e,b,c)}f.memoizedState=c;var g={value:c,getSnapshot:b};return f.queue=g,bE(bj.bind(null,e,g,a),[a]),e.flags|=2048,bA(9,{destroy:void 0},bi.bind(null,e,g,c,b),null),c},useId:function(){var a=a6(),b=iq.identifierPrefix;if(g9){var c=g2,d=g1;b="_"+b+"R_"+(c=(d&~(1<<32-gy(d)-1)).toString(32)+c),0<(c=hW++)&&(b+="H"+c.toString(32)),b+="_"}else b="_"+b+"r_"+(c=hZ++).toString(32)+"_";return a.memoizedState=b},useHostTransitionStatus:bS,useFormState:bv,useActionState:bv,useOptimistic:function(a){var b=a6();b.memoizedState=b.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return b.queue=c,b=bZ.bind(null,hQ,!0,c),c.dispatch=b,[a,b]},useMemoCache:bb,useCacheRefresh:function(){return a6().memoizedState=bV.bind(null,hQ)},useEffectEvent:function(a){var b=a6(),c={impl:a};return b.memoizedState=c,function(){if((2&ip)!=0)throw Error(d(440));return c.impl.apply(void 0,arguments)}}},h0={readContext:$,use:ba,useCallback:bM,useContext:$,useEffect:bF,useImperativeHandle:bK,useInsertionEffect:bH,useLayoutEffect:bI,useMemo:bN,useReducer:bd,useRef:bB,useState:function(){return bd(bc)},useDebugValue:bL,useDeferredValue:function(a,b){return bP(a7(),hR.memoizedState,a,b)},useTransition:function(){var a=bd(bc)[0],b=a7().memoizedState;return["boolean"==typeof a?a:a9(a),b]},useSyncExternalStore:bg,useId:bT,useHostTransitionStatus:bS,useFormState:bw,useActionState:bw,useOptimistic:function(a,b){return bn(a7(),hR,a,b)},useMemoCache:bb,useCacheRefresh:bU};h0.useEffectEvent=bG;var h1={readContext:$,use:ba,useCallback:bM,useContext:$,useEffect:bF,useImperativeHandle:bK,useInsertionEffect:bH,useLayoutEffect:bI,useMemo:bN,useReducer:bf,useRef:bB,useState:function(){return bf(bc)},useDebugValue:bL,useDeferredValue:function(a,b){var c=a7();return null===hR?bO(c,a,b):bP(c,hR.memoizedState,a,b)},useTransition:function(){var a=bf(bc)[0],b=a7().memoizedState;return["boolean"==typeof a?a:a9(a),b]},useSyncExternalStore:bg,useId:bT,useHostTransitionStatus:bS,useFormState:bz,useActionState:bz,useOptimistic:function(a,b){var c=a7();return null!==hR?bn(c,hR,a,b):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:bb,useCacheRefresh:bU};h1.useEffectEvent=bG;var h2={enqueueSetState:function(a,b,c){a=a._reactInternals;var d=dn(),e=aI(d);e.payload=b,null!=c&&(e.callback=c),null!==(b=aJ(a,e,d))&&(dq(b,a,d),aK(b,a,d))},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=dn(),e=aI(d);e.tag=1,e.payload=b,null!=c&&(e.callback=c),null!==(b=aJ(a,e,d))&&(dq(b,a,d),aK(b,a,d))},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=dn(),d=aI(c);d.tag=2,null!=b&&(d.callback=b),null!==(b=aJ(a,d,c))&&(dq(b,a,c),aK(b,a,c))}},h3=Error(d(461)),h4=!1,h5={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},h6=!1,h7=!1,h8=!1,h9="function"==typeof WeakSet?WeakSet:Set,ia=null,ib=null,ic=!1,id=null,ie=8192,ig={getCacheForType:function(a){var b=$(hj),c=b.data.get(a);return void 0===c&&(c=a(),b.data.set(a,c)),c},cacheSignal:function(){return $(hj).controller.signal}},ih=0,ii=1,ij=2,ik=3,il=4;if("function"==typeof Symbol&&Symbol.for){var im=Symbol.for;ih=im("selector.component"),ii=im("selector.has_pseudo_class"),ij=im("selector.role"),ik=im("selector.test_id"),il=im("selector.text")}var io="function"==typeof WeakMap?WeakMap:Map,ip=0,iq=null,ir=null,is=0,it=0,iu=null,iv=!1,iw=!1,ix=!1,iy=0,iz=0,iA=0,iB=0,iC=0,iD=0,iE=0,iF=null,iG=null,iH=!1,iI=0,iJ=0,iK=1/0,iL=null,iM=null,iN=0,iO=null,iP=null,iQ=0,iR=0,iS=null,iT=null,iU=0,iV=null;return d9.attemptContinuousHydration=function(a){if(13===a.tag||31===a.tag){var b=aD(a,0x4000000);null!==b&&dq(b,a,0x4000000),d8(a,0x4000000)}},d9.attemptHydrationAtCurrentPriority=function(a){if(13===a.tag||31===a.tag){var b=dn(),c=aD(a,b=w(b));null!==c&&dq(c,a,b),d8(a,b)}},d9.attemptSynchronousHydration=function(a){switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var b=m(a.pendingLanes);if(0!==b){for(a.pendingLanes|=2,a.entangledLanes|=2;b;){var c=1<<31-gy(b);a.entanglements[1]|=c,b&=~c}ae(a),(6&ip)==0&&(iK=gI()+500,af(0,!1))}}break;case 31:case 13:null!==(b=aD(a,2))&&dq(b,a,2),du(),d8(a,2)}},d9.batchedUpdates=function(a,b){return a(b)},d9.createComponentSelector=function(a){return{$$typeof:ih,value:a}},d9.createContainer=function(a,b,c,d,e,f,g,h,i,j){return d4(a,b,!1,null,c,d,f,null,g,h,i,j)},d9.createHasPseudoClassSelector=function(a){return{$$typeof:ii,value:a}},d9.createHydrationContainer=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o;return(a=d4(c,d,!0,a,e,f,h,n,i,j,k,l)).context=gx,c=a.current,(e=aI(d=w(d=dn()))).callback=null!=(o=b)?o:null,aJ(c,e,d),b=d,a.current.lanes=b,r(a,b),ae(a),a},d9.createPortal=function(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:ef,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}},d9.createRoleSelector=function(a){return{$$typeof:ij,value:a}},d9.createTestNameSelector=function(a){return{$$typeof:ik,value:a}},d9.createTextSelector=function(a){return{$$typeof:il,value:a}},d9.defaultOnCaughtError=function(a){console.error(a)},d9.defaultOnRecoverableError=function(a){gS(a)},d9.defaultOnUncaughtError=function(a){gS(a)},d9.deferredUpdates=function(a){var b=ev.T,c=eT();try{return eS(32),ev.T=null,a()}finally{eS(c),ev.T=b}},d9.discreteUpdates=function(a,b,c,d,e){var f=ev.T,g=eT();try{return eS(2),ev.T=null,a(b,c,d,e)}finally{eS(g),ev.T=f,0===ip&&(iK=gI()+500)}},d9.findAllNodes=dm,d9.findBoundingRects=function(a,b){if(!e7)throw Error(d(363));b=dm(a,b),a=[];for(var c=0;c<b.length;c++)a.push(e9(b[c]));for(b=a.length-1;0<b;b--){c=a[b];for(var e=c.x,f=e+c.width,g=c.y,h=g+c.height,i=b-1;0<=i;i--)if(b!==i){var j=a[i],k=j.x,l=k+j.width,m=j.y,n=m+j.height;if(e>=k&&g>=m&&f<=l&&h<=n){a.splice(b,1);break}if(e!==k||c.width!==j.width||n<g||m>h){if(!(g!==m||c.height!==j.height||l<e||k>f)){k>e&&(j.width+=k-e,j.x=e),l<f&&(j.width=f-k),a.splice(b,1);break}}else{m>g&&(j.height+=m-g,j.y=g),n<h&&(j.height=h-m),a.splice(b,1);break}}}return a},d9.findHostInstance=d5,d9.findHostInstanceWithNoPortals=function(a){return null===(a=null!==(a=g(a))?function a(b){var c=b.tag;if(5===c||26===c||27===c||6===c)return b;for(b=b.child;null!==b;){if(4!==b.tag&&null!==(c=a(b)))return c;b=b.sibling}return null}(a):null)?null:ez(a.stateNode)},d9.findHostInstanceWithWarning=function(a){return d5(a)},d9.flushPassiveEffects=dN,d9.flushSyncFromReconciler=function(a){var b=ip;ip|=1;var c=ev.T,d=eT();try{if(eS(2),ev.T=null,a)return a()}finally{eS(d),ev.T=c,(6&(ip=b))==0&&af(0,!1)}},d9.flushSyncWork=du,d9.focusWithin=function(a,b){if(!e7)throw Error(d(363));for(b=Array.from(b=dl(a=di(a),b)),a=0;a<b.length;){var c=b[a++],e=c.tag;if(!fb(c)){if((5===e||26===e||27===e)&&fd(c.stateNode))return!0;for(c=c.child;null!==c;)b.push(c),c=c.sibling}}return!1},d9.getFindAllNodesFailureDescription=function(a,b){if(!e7)throw Error(d(363));var c=0,e=[];a=[di(a),0];for(var f=0;f<a.length;){var g=a[f++],h=g.tag,i=a[f++],j=b[i];if((5!==h&&26!==h&&27!==h||!fb(g))&&(dj(g,j)&&(e.push(dk(j)),++i>c&&(c=i)),i<b.length))for(g=g.child;null!==g;)a.push(g,i),g=g.sibling}if(c<b.length){for(a=[];c<b.length;c++)a.push(dk(b[c]));return`findAllNodes was able to match part of the selector:
|
|
390
|
+
`+e.join(" > ")+`
|
|
391
|
+
|
|
392
|
+
No matching component was found for:
|
|
393
|
+
`+a.join(" > ")}return null},d9.getPublicRootInstance=function(a){if(!(a=a.current).child)return null;switch(a.child.tag){case 27:case 5:return ez(a.child.stateNode);default:return a.child.stateNode}},d9.injectIntoDevTools=function(){var a={bundleType:0,version:ew,rendererPackageName:ex,currentDispatcherRef:ev,reconcilerVersion:"19.2.0"};if(null!==ey&&(a.rendererConfig=ey),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")a=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)a=!0;else{try{gP=b.inject(a),gQ=b}catch{}a=!!b.checkDCE}}return a},d9.isAlreadyRendering=function(){return(6&ip)!=0},d9.observeVisibleRects=function(a,b,c,e){if(!e7)throw Error(d(363));var f=fe(a=dm(a,b),c,e).disconnect;return{disconnect:function(){f()}}},d9.shouldError=function(){return null},d9.shouldSuspend=function(){return!1},d9.startHostTransition=function(a,b,e,f){if(5!==a.tag)throw Error(d(476));var g=bR(a).queue;bQ(a,g,b,e2,null===e?c:function(){var b=bR(a);return null===b.next&&(b=a.alternate.memoizedState),bY(a,b.next.queue,{},dn()),e(f)})},d9.updateContainer=function(a,b,c,d){var e=b.current,f=dn();return d6(e,f,a,b,c,d),f},d9.updateContainerSync=function(a,b,c,d){return d6(b.current,2,a,b,c,d),2},d9},lp.exports.default=lp.exports,Object.defineProperty(lp.exports,"__esModule",{value:!0})),lo.exports=lp.exports),(r=lo.exports)&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default"))?r.default:r,lr={},ls=/^three(?=[A-Z])/,lt=a=>`${a[0].toUpperCase()}${a.slice(1)}`,lu=0;function lv(a){if("function"==typeof a){let b=`${lu++}`;return lr[b]=a,b}Object.assign(lr,a)}function lw(a,b){let c=lt(a),d=lr[c];if("primitive"!==a&&!d)throw Error(`R3F: ${c} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if("primitive"===a&&!b.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==b.args&&!Array.isArray(b.args))throw Error("R3F: The args prop must be an array!")}function lx(a){if(a.isHidden){var b;a.props.attach&&null!=(b=a.parent)&&b.object?k4(a.parent,a):ld(a.object)&&!1!==a.props.visible&&(a.object.visible=!0),a.isHidden=!1,lb(a)}}function ly(a,b,c){let d=b.root.getState();if(a.parent||a.object===d.scene){if(!b.object){var e,f;let a=lr[lt(b.type)];b.object=null!=(e=b.props.object)?e:new a(...null!=(f=b.props.args)?f:[]),b.object.__r3f=b}if(la(b.object,b.props),b.props.attach)k4(a,b);else if(ld(b.object)&&ld(a.object)){let d=a.object.children.indexOf(null==c?void 0:c.object);if(c&&-1!==d){let c=a.object.children.indexOf(b.object);-1!==c?(a.object.children.splice(c,1),a.object.children.splice(c<d?d-1:d,0,b.object)):(b.object.parent=a.object,a.object.children.splice(d,0,b.object),b.object.dispatchEvent({type:"added"}),a.object.dispatchEvent({type:"childadded",child:b.object}))}else a.object.add(b.object)}for(let a of b.children)ly(b,a);lb(b)}}function lz(a,b){b&&(b.parent=a,a.children.push(b),ly(a,b))}function lA(a,b,c){if(!b||!c)return;b.parent=a;let d=a.children.indexOf(c);-1!==d?a.children.splice(d,0,b):a.children.push(b),ly(a,b,c)}function lB(a){if("function"==typeof a.dispose){let b=()=>{try{a.dispose()}catch{}};"u">typeof IS_REACT_ACT_ENVIRONMENT?b():(0,kH.unstable_scheduleCallback)(kH.unstable_IdlePriority,b)}}function lC(a,b,c){if(!b)return;b.parent=null;let d=a.children.indexOf(b);-1!==d&&a.children.splice(d,1),b.props.attach?k5(a,b):ld(b.object)&&ld(a.object)&&(a.object.remove(b.object),function(a,b){let{internal:c}=a.getState();c.interaction=c.interaction.filter(a=>a!==b),c.initialHits=c.initialHits.filter(a=>a!==b),c.hovered.forEach((a,d)=>{(a.eventObject===b||a.object===b)&&c.hovered.delete(d)}),c.capturedMap.forEach((a,d)=>{lf(c.capturedMap,b,a,d)})}(kR(b),b.object));let e=null!==b.props.dispose&&!1!==c;for(let a=b.children.length-1;a>=0;a--){let c=b.children[a];lC(b,c,e)}b.children.length=0,delete b.object.__r3f,e&&"primitive"!==b.type&&"Scene"!==b.object.type&&lB(b.object),void 0===c&&lb(b)}let lD=[],lE=()=>{},lF={},lG=0,lH=(s={isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(a,b,c){var d;return lw(a=lt(a)in lr?a:a.replace(ls,""),b),"primitive"===a&&null!=(d=b.object)&&d.__r3f&&delete b.object.__r3f,k1(b.object,c,a,b)},removeChild:lC,appendChild:lz,appendInitialChild:lz,insertBefore:lA,appendChildToContainer(a,b){let c=a.getState().scene.__r3f;b&&c&&lz(c,b)},removeChildFromContainer(a,b){let c=a.getState().scene.__r3f;b&&c&&lC(c,b)},insertInContainerBefore(a,b,c){let d=a.getState().scene.__r3f;b&&c&&d&&lA(d,b,c)},getRootHostContext:()=>lF,getChildHostContext:()=>lF,commitUpdate(a,b,c,d,e){var f,g,h;lw(b,d);let i=!1;if("primitive"===a.type&&c.object!==d.object||(null==(f=d.args)?void 0:f.length)!==(null==(g=c.args)?void 0:g.length)?i=!0:null!=(h=d.args)&&h.some((a,b)=>{var d;return a!==(null==(d=c.args)?void 0:d[b])})&&(i=!0),i)lD.push([a,{...d},e]);else{let b=function(a,b){let c={};for(let d in b)if(!k6.includes(d)&&!k_.equ(b[d],a.props[d]))for(let a in c[d]=b[d],b)a.startsWith(`${d}-`)&&(c[a]=b[a]);for(let d in a.props){if(k6.includes(d)||b.hasOwnProperty(d))continue;let{root:e,key:f}=k2(a.object,d);if(e.constructor&&0===e.constructor.length){let a=function(a){let b=k7.get(a.constructor);try{b||(b=new a.constructor,k7.set(a.constructor,b))}catch(a){}return b}(e);k_.und(a)||(c[f]=a[f])}else c[f]=0}return c}(a,d);Object.keys(b).length&&(Object.assign(a.props,b),la(a.object,b))}(null===e.sibling||(4&e.flags)==0)&&function(){for(let[a]of lD){let b=a.parent;if(b)for(let c of(a.props.attach?k5(b,a):ld(a.object)&&ld(b.object)&&b.object.remove(a.object),a.children))c.props.attach?k5(a,c):ld(c.object)&&ld(a.object)&&a.object.remove(c.object);a.isHidden&&lx(a),a.object.__r3f&&delete a.object.__r3f,"primitive"!==a.type&&lB(a.object)}for(let[d,e,f]of lD){d.props=e;let g=d.parent;if(g){let e=lr[lt(d.type)];d.object=null!=(a=d.props.object)?a:new e(...null!=(b=d.props.args)?b:[]),d.object.__r3f=d;var a,b,c=d.object;for(let a of[f,f.alternate])if(null!==a)if("function"==typeof a.ref){null==a.refCleanup||a.refCleanup();let b=a.ref(c);"function"==typeof b&&(a.refCleanup=b)}else a.ref&&(a.ref.current=c);for(let a of(la(d.object,d.props),d.props.attach?k4(g,d):ld(d.object)&&ld(g.object)&&g.object.add(d.object),d.children))a.props.attach?k4(d,a):ld(a.object)&&ld(d.object)&&d.object.add(a.object);lb(d)}}lD.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:a=>null==a?void 0:a.object,prepareForCommit:()=>null,preparePortalMount:a=>k1(a.getState().scene,a,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(a){if(!a.isHidden){var b;a.props.attach&&null!=(b=a.parent)&&b.object?k5(a.parent,a):ld(a.object)&&(a.object.visible=!1),a.isHidden=!0,lb(a)}},unhideInstance:lx,createTextInstance:lE,hideTextInstance:lE,unhideTextInstance:lE,scheduleTimeout:"function"==typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"==typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:v.createContext(null),setCurrentUpdatePriority(a){lG=a},getCurrentUpdatePriority:()=>lG,resolveUpdatePriority:()=>0!==lG?lG:32,resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:"9.5.0",applyViewTransitionName(a,b,c){},restoreViewTransitionName(a,b){},cancelViewTransitionName(a,b,c){},cancelRootViewTransitionName(a){},restoreRootViewTransitionName(a){},InstanceMeasurement:null,measureInstance:a=>null,wasInstanceInViewport:a=>!0,hasInstanceChanged:(a,b)=>!1,hasInstanceAffectedParent:(a,b)=>!1,suspendOnActiveViewTransition(a,b){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(a){},createViewTransitionInstance:a=>null,getCurrentGestureOffset(a){throw Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance:(a,b)=>a,cloneMutableTextInstance:a=>a,cloneRootViewTransitionContainer(a){throw Error("Not implemented.")},removeRootViewTransitionClone(a,b){throw Error("Not implemented.")},createFragmentInstance:a=>null,updateFragmentInstanceFiber(a,b){},commitNewChildToFragmentInstance(a,b){},deleteChildFromFragmentInstance(a,b){},measureClonedInstance:a=>null,maySuspendCommitOnUpdate:(a,b,c)=>!1,maySuspendCommitInSyncRender:(a,b)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(a,b)=>null},(q=lq(s)).injectIntoDevTools(),q),lI=new Map,lJ={objects:"shallow",strict:!1};function lK(a){var b,c;let d,e,f,g,h,i,j,k=lI.get(a),l=null==k?void 0:k.fiber,m=null==k?void 0:k.store;k&&console.warn("R3F.createRoot should only be called once!");let n="function"==typeof reportError?reportError:console.error,o=m||(b=lY,c=lZ,h=(g=(f=kD((a,d)=>{let e,f=new al,g=new al,h=new al;function i(a=d().camera,b=g,c=d().size){let{width:e,height:j,top:k,left:l}=c,m=e/j;b.isVector3?h.copy(b):h.set(...b);let n=a.getWorldPosition(f).distanceTo(h);if(a&&a.isOrthographicCamera)return{width:e/a.zoom,height:j/a.zoom,top:k,left:l,factor:1,distance:n,aspect:m};{let b=2*Math.tan(a.fov*Math.PI/180/2)*n,c=e/j*b;return{width:c,height:b,top:k,left:l,factor:e/c,distance:n,aspect:m}}}let j=b=>a(a=>({performance:{...a.performance,current:b}})),k=new aj;return{set:a,get:d,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(a=1)=>b(d(),a),advance:(a,b)=>c(a,b,d()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new hr,pointer:k,mouse:k,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let a=d();e&&clearTimeout(e),a.performance.current!==a.performance.min&&j(a.performance.min),e=setTimeout(()=>j(d().performance.max),a.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:i},setEvents:b=>a(a=>({...a,events:{...a.events,...b}})),setSize:(b,c,e=0,f=0)=>{let h=d().camera,j={width:b,height:c,top:e,left:f};a(a=>({size:j,viewport:{...a.viewport,...i(h,g,j)}}))},setDpr:b=>a(a=>{let c=kZ(b);return{viewport:{...a.viewport,dpr:c,initialDpr:a.viewport.initialDpr||c}}}),setFrameloop:(b="always")=>{let c=d().clock;c.stop(),c.elapsedTime=0,"never"!==b&&(c.start(),c.elapsedTime=0),a(()=>({frameloop:b}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:v.createRef(),active:!1,frames:0,priority:0,subscribe:(a,b,c)=>{let e=d().internal;return e.priority=e.priority+ +(b>0),e.subscribers.push({ref:a,priority:b,store:c}),e.subscribers=e.subscribers.sort((a,b)=>a.priority-b.priority),()=>{let c=d().internal;null!=c&&c.subscribers&&(c.priority=c.priority-(b>0),c.subscribers=c.subscribers.filter(b=>b.ref!==a))}}}}})).getState()).size,i=g.viewport.dpr,j=g.camera,f.subscribe(()=>{let{camera:a,size:b,viewport:c,gl:d,set:e}=f.getState();if(b.width!==h.width||b.height!==h.height||c.dpr!==i){h=b,i=c.dpr,lc(a,b),c.dpr>0&&d.setPixelRatio(c.dpr);let e="u">typeof HTMLCanvasElement&&d.domElement instanceof HTMLCanvasElement;d.setSize(b.width,b.height,e)}a!==j&&(j=a,e(b=>({viewport:{...b.viewport,...b.viewport.getCurrentViewport(a)}})))}),f.subscribe(a=>b(a)),f),p=l||lH.createContainer(o,1,null,!1,null,"",n,n,n,null);k||lI.set(a,{fiber:p,store:o});let q=!1,r=null;return{async configure(b={}){var c,f;let g;r=new Promise(a=>g=a);let{gl:h,size:i,scene:j,events:k,onCreated:l,shadows:m=!1,linear:n=!1,flat:p=!1,legacy:s=!1,orthographic:t=!1,frameloop:u="always",dpr:v=[1,2],performance:w,raycaster:x,camera:y,onPointerMissed:z}=b,C=o.getState(),D=C.gl;if(!C.gl){let b={canvas:a,powerPreference:"high-performance",antialias:!0,alpha:!0},c="function"==typeof h?await h(b):h;D=lg(c)?c:new ky({...b,...h}),C.set({gl:D})}let E=C.raycaster;E||C.set({raycaster:E=new ho});let{params:F,...G}=x||{};if(k_.equ(G,E,lJ)||la(E,{...G}),k_.equ(F,E.params,lJ)||la(E,{params:{...E.params,...F}}),!C.camera||C.camera===e&&!k_.equ(e,y,lJ)){e=y;let a=null==y?void 0:y.isCamera,b=a?y:t?new gt(0,0,0,0,.1,1e3):new go(75,0,.1,1e3);!a&&(b.position.z=5,y&&(la(b,y),!b.manual&&("aspect"in y||"left"in y||"right"in y||"bottom"in y||"top"in y)&&(b.manual=!0,b.updateProjectionMatrix())),C.camera||null!=y&&y.rotation||b.lookAt(0,0,0)),C.set({camera:b}),E.camera=b}if(!C.scene){let a;null!=j&&j.isScene?k1(a=j,o,"",{}):(k1(a=new bk,o,"",{}),j&&la(a,j)),C.set({scene:a})}k&&!C.events.handlers&&C.set({events:k(o)});let H=function(a,b){if(!b&&"u">typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement&&a.parentElement){let{width:b,height:c,top:d,left:e}=a.parentElement.getBoundingClientRect();return{width:b,height:c,top:d,left:e}}return!b&&"u">typeof OffscreenCanvas&&a instanceof OffscreenCanvas?{width:a.width,height:a.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...b}}(a,i);if(k_.equ(H,C.size,lJ)||C.setSize(H.width,H.height,H.top,H.left),v&&C.viewport.dpr!==kZ(v)&&C.setDpr(v),C.frameloop!==u&&C.setFrameloop(u),C.onPointerMissed||C.set({onPointerMissed:z}),w&&!k_.equ(w,C.performance,lJ)&&C.set(a=>({performance:{...a.performance,...w}})),!C.xr){let a=(a,b)=>{let c=o.getState();"never"!==c.frameloop&&lZ(a,!0,c,b)},b=()=>{let b=o.getState();b.gl.xr.enabled=b.gl.xr.isPresenting,b.gl.xr.setAnimationLoop(b.gl.xr.isPresenting?a:null),b.gl.xr.isPresenting||lY(b)},d={connect(){let a=o.getState().gl;a.xr.addEventListener("sessionstart",b),a.xr.addEventListener("sessionend",b)},disconnect(){let a=o.getState().gl;a.xr.removeEventListener("sessionstart",b),a.xr.removeEventListener("sessionend",b)}};"function"==typeof(null==(c=D.xr)?void 0:c.addEventListener)&&d.connect(),C.set({xr:d})}if(D.shadowMap){let a=D.shadowMap.enabled,b=D.shadowMap.type;D.shadowMap.enabled=!!m,k_.boo(m)?D.shadowMap.type=2:k_.str(m)?D.shadowMap.type=null!=(f=({basic:0,percentage:1,soft:2,variance:3})[m])?f:2:k_.obj(m)&&Object.assign(D.shadowMap,m),(a!==D.shadowMap.enabled||b!==D.shadowMap.type)&&(D.shadowMap.needsUpdate=!0)}return as.enabled=!s,q||(D.outputColorSpace=n?B:A,D.toneMapping=4*!p),C.legacy!==s&&C.set(()=>({legacy:s})),C.linear!==n&&C.set(()=>({linear:n})),C.flat!==p&&C.set(()=>({flat:p})),!h||k_.fun(h)||lg(h)||k_.equ(h,D,lJ)||la(D,h),d=l,q=!0,g(),this},render(b){return q||r||this.configure(),r.then(()=>{lH.updateContainer((0,kI.jsx)(lL,{store:o,children:b,onCreated:d,rootElement:a}),p,null,()=>void 0)}),o},unmount(){lM(a)}}}function lL({store:a,children:b,onCreated:c,rootElement:d}){return kU(()=>{let b=a.getState();b.set(a=>({internal:{...a.internal,active:!0}})),c&&c(b),a.getState().events.connected||null==b.events.connect||b.events.connect(d)},[]),(0,kI.jsx)(lh.Provider,{value:a,children:b})}function lM(a,b){let c=lI.get(a),d=null==c?void 0:c.fiber;if(d){let e=null==c?void 0:c.store.getState();e&&(e.internal.active=!1),lH.updateContainer(null,d,null,()=>{e&&setTimeout(()=>{try{null==e.events.disconnect||e.events.disconnect(),null==(c=e.gl)||null==(d=c.renderLists)||null==d.dispose||d.dispose(),null==(f=e.gl)||null==f.forceContextLoss||f.forceContextLoss(),null!=(g=e.gl)&&g.xr&&e.xr.disconnect();var c,d,f,g,h=e.scene;for(let a in"Scene"!==h.type&&(null==h.dispose||h.dispose()),h){let b=h[a];(null==b?void 0:b.type)!=="Scene"&&(null==b||null==b.dispose||b.dispose())}lI.delete(a),b&&b(a)}catch(a){}},500)})}}function lN(a,b,c){return(0,kI.jsx)(lO,{children:a,container:b,state:c})}function lO({state:a={},children:b,container:c}){let{events:d,size:e,...f}=a,g=li(),[h]=v.useState(()=>new ho),[i]=v.useState(()=>new aj),j=kV((a,b)=>{let f;if(b.camera&&e){let c=b.camera;f=a.viewport.getCurrentViewport(c,new al,e),c!==a.camera&&lc(c,e)}return{...a,...b,scene:c,raycaster:h,pointer:i,mouse:i,previousRoot:g,events:{...a.events,...b.events,...d},size:{...a.size,...e},viewport:{...a.viewport,...f},setEvents:a=>b.set(b=>({...b,events:{...b.events,...a}}))}}),k=v.useMemo(()=>{let a=kD((a,b)=>({...f,set:a,get:b})),b=b=>a.setState(a=>j.current(b,a));return b(g.getState()),g.subscribe(b),a},[g,c]);return(0,kI.jsx)(kI.Fragment,{children:lH.createPortal((0,kI.jsx)(lh.Provider,{value:k,children:b}),k,null)})}let lP=new Set,lQ=new Set,lR=new Set;function lS(a,b){if(a.size)for(let{callback:c}of a.values())c(b)}function lT(a,b){switch(a){case"before":return lS(lP,b);case"after":return lS(lQ,b);case"tail":return lS(lR,b)}}function lU(a,b,c){let d=b.clock.getDelta();"never"===b.frameloop&&"number"==typeof a&&(d=a-b.clock.elapsedTime,b.clock.oldTime=b.clock.elapsedTime,b.clock.elapsedTime=a),g=b.internal.subscribers;for(let a=0;a<g.length;a++)(h=g[a]).ref.current(h.store.getState(),d,c);return!b.internal.priority&&b.gl.render&&b.gl.render(b.scene,b.camera),b.internal.frames=Math.max(0,b.internal.frames-1),"always"===b.frameloop?1:b.internal.frames}let lV=!1,lW=!1;function lX(a){for(let c of(j=requestAnimationFrame(lX),lV=!0,i=0,lT("before",a),lW=!0,lI.values())){var b;(k=c.store.getState()).internal.active&&("always"===k.frameloop||k.internal.frames>0)&&!(null!=(b=k.gl.xr)&&b.isPresenting)&&(i+=lU(a,k))}if(lW=!1,lT("after",a),0===i)return lT("tail",a),lV=!1,cancelAnimationFrame(j)}function lY(a,b=1){var c;if(!a)return lI.forEach(a=>lY(a.store.getState(),b));(null==(c=a.gl.xr)||!c.isPresenting)&&a.internal.active&&"never"!==a.frameloop&&(b>1?a.internal.frames=Math.min(60,a.internal.frames+b):lW?a.internal.frames=2:a.internal.frames=1,lV||(lV=!0,requestAnimationFrame(lX)))}function lZ(a,b=!0,c,d){if(b&&lT("before",a),c)lU(a,c,d);else for(let b of lI.values())lU(a,b.store.getState());b&&lT("after",a)}let l$={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function l_(a){let{handlePointer:b}=function(a){function b(a){return a.filter(a=>["Move","Over","Enter","Out","Leave"].some(b=>{var c;return null==(c=a.__r3f)?void 0:c.handlers["onPointer"+b]}))}function c(b){let{internal:c}=a.getState();for(let a of c.hovered.values())if(!b.length||!b.find(b=>b.object===a.object&&b.index===a.index&&b.instanceId===a.instanceId)){let d=a.eventObject.__r3f;if(c.hovered.delete(le(a)),null!=d&&d.eventCount){let c=d.handlers,e={...a,intersections:b};null==c.onPointerOut||c.onPointerOut(e),null==c.onPointerLeave||c.onPointerLeave(e)}}}function d(a,b){for(let c=0;c<b.length;c++){let d=b[c].__r3f;null==d||null==d.handlers.onPointerMissed||d.handlers.onPointerMissed(a)}}return{handlePointer:function(e){switch(e){case"onPointerLeave":case"onPointerCancel":return()=>c([]);case"onLostPointerCapture":return b=>{let{internal:d}=a.getState();"pointerId"in b&&d.capturedMap.has(b.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(b.pointerId)&&(d.capturedMap.delete(b.pointerId),c([]))})}}return function(f){let{onPointerMissed:g,internal:h}=a.getState();h.lastEvent.current=f;let i="onPointerMove"===e,j="onClick"===e||"onContextMenu"===e||"onDoubleClick"===e,k=function(b,c){let d=a.getState(),e=new Set,f=[],g=c?c(d.internal.interaction):d.internal.interaction;for(let a=0;a<g.length;a++){let b=k$(g[a]);b&&(b.raycaster.camera=void 0)}d.previousRoot||null==d.events.compute||d.events.compute(b,d);let h=g.flatMap(function(a){let c=k$(a);if(!c||!c.events.enabled||null===c.raycaster.camera)return[];if(void 0===c.raycaster.camera){var d;null==c.events.compute||c.events.compute(b,c,null==(d=c.previousRoot)?void 0:d.getState()),void 0===c.raycaster.camera&&(c.raycaster.camera=null)}return c.raycaster.camera?c.raycaster.intersectObject(a,!0):[]}).sort((a,b)=>{let c=k$(a.object),d=k$(b.object);return c&&d&&d.events.priority-c.events.priority||a.distance-b.distance}).filter(a=>{let b=le(a);return!e.has(b)&&(e.add(b),!0)});for(let a of(d.events.filter&&(h=d.events.filter(h,d)),h)){let b=a.object;for(;b;){var i;null!=(i=b.__r3f)&&i.eventCount&&f.push({...a,eventObject:b}),b=b.parent}}if("pointerId"in b&&d.internal.capturedMap.has(b.pointerId))for(let a of d.internal.capturedMap.get(b.pointerId).values())e.has(le(a.intersection))||f.push(a.intersection);return f}(f,i?b:void 0),l=j?function(b){let{internal:c}=a.getState(),d=b.offsetX-c.initialClick[0],e=b.offsetY-c.initialClick[1];return Math.round(Math.sqrt(d*d+e*e))}(f):0;"onPointerDown"===e&&(h.initialClick=[f.offsetX,f.offsetY],h.initialHits=k.map(a=>a.eventObject)),j&&!k.length&&l<=2&&(d(f,h.interaction),g&&g(f)),i&&c(k),!function(a,b,d,e){if(a.length){let f={stopped:!1};for(let g of a){let h=k$(g.object);if(h||g.object.traverseAncestors(a=>{let b=k$(a);if(b)return h=b,!1}),h){let{raycaster:i,pointer:j,camera:k,internal:l}=h,m=new al(j.x,j.y,0).unproject(k),n=a=>{var b,c;return null!=(b=null==(c=l.capturedMap.get(a))?void 0:c.has(g.eventObject))&&b},o=a=>{let c={intersection:g,target:b.target};l.capturedMap.has(a)?l.capturedMap.get(a).set(g.eventObject,c):l.capturedMap.set(a,new Map([[g.eventObject,c]])),b.target.setPointerCapture(a)},p=a=>{let b=l.capturedMap.get(a);b&&lf(l.capturedMap,g.eventObject,b,a)},q={};for(let a in b){let c=b[a];"function"!=typeof c&&(q[a]=c)}let r={...g,...q,pointer:j,intersections:a,stopped:f.stopped,delta:d,unprojectedPoint:m,ray:i.ray,camera:k,stopPropagation(){let d="pointerId"in b&&l.capturedMap.get(b.pointerId);(!d||d.has(g.eventObject))&&(r.stopped=f.stopped=!0,l.hovered.size&&Array.from(l.hovered.values()).find(a=>a.eventObject===g.eventObject)&&c([...a.slice(0,a.indexOf(g)),g]))},target:{hasPointerCapture:n,setPointerCapture:o,releasePointerCapture:p},currentTarget:{hasPointerCapture:n,setPointerCapture:o,releasePointerCapture:p},nativeEvent:b};if(e(r),!0===f.stopped)break}}}}(k,f,l,function(a){let b=a.eventObject,c=b.__r3f;if(!(null!=c&&c.eventCount))return;let g=c.handlers;if(i){if(g.onPointerOver||g.onPointerEnter||g.onPointerOut||g.onPointerLeave){let b=le(a),c=h.hovered.get(b);c?c.stopped&&a.stopPropagation():(h.hovered.set(b,a),null==g.onPointerOver||g.onPointerOver(a),null==g.onPointerEnter||g.onPointerEnter(a))}null==g.onPointerMove||g.onPointerMove(a)}else{let c=g[e];c?(!j||h.initialHits.includes(b))&&(d(f,h.interaction.filter(a=>!h.initialHits.includes(a))),c(a)):j&&h.initialHits.includes(b)&&d(f,h.interaction.filter(a=>!h.initialHits.includes(a)))}})}}}}(a);return{priority:1,enabled:!0,compute(a,b,c){b.pointer.set(a.offsetX/b.size.width*2-1,-(2*(a.offsetY/b.size.height))+1),b.raycaster.setFromCamera(b.pointer,b.camera)},connected:void 0,handlers:Object.keys(l$).reduce((a,c)=>({...a,[c]:b(c)}),{}),update:()=>{var b;let{events:c,internal:d}=a.getState();null!=(b=d.lastEvent)&&b.current&&c.handlers&&c.handlers.onPointerMove(d.lastEvent.current)},connect:b=>{let{set:c,events:d}=a.getState();if(null==d.disconnect||d.disconnect(),c(a=>({events:{...a.events,connected:b}})),d.handlers)for(let a in d.handlers){let c=d.handlers[a],[e,f]=l$[a];b.addEventListener(e,c,{passive:f})}},disconnect:()=>{let{set:b,events:c}=a.getState();if(c.connected){if(c.handlers)for(let a in c.handlers){let b=c.handlers[a],[d]=l$[a];c.connected.removeEventListener(d,b)}b(a=>({events:{...a.events,connected:void 0}}))}}}}a.s(["B",()=>kX,"C",()=>lj,"D",()=>lk,"E",()=>kY,"G",()=>ln,"a",()=>kV,"b",()=>kU,"c",()=>lK,"d",()=>lM,"e",()=>lv,"f",()=>l_,"i",()=>kS,"o",()=>lN,"s",()=>la,"u",()=>kW],48604),a.i(66110),a.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveAnimationBlendMode",()=>2501,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"AlwaysStencilFunc",()=>519,"AmbientLight",()=>gw,"AnimationAction",()=>he,"AnimationClip",()=>fX,"AnimationLoader",()=>f4,"AnimationMixer",()=>hg,"AnimationObjectGroup",()=>hd,"AnimationUtils",()=>fJ,"ArcCurve",()=>ev,"ArrayCamera",()=>gR,"ArrowHelper",()=>h3,"AttachedBindMode",()=>y,"Audio",()=>g$,"AudioAnalyser",()=>g4,"AudioContext",()=>gK,"AudioListener",()=>gZ,"AudioLoader",()=>gL,"AxesHelper",()=>h4,"BackSide",()=>1,"BasicDepthPacking",()=>3200,"BasicShadowMap",()=>0,"BatchedMesh",()=>dM,"BezierInterpolant",()=>fO,"Bone",()=>c6,"BooleanKeyframeTrack",()=>fQ,"Box2",()=>hw,"Box3",()=>bz,"Box3Helper",()=>h0,"BoxGeometry",()=>eh,"BoxHelper",()=>h_,"BufferAttribute",()=>bV,"BufferGeometry",()=>ce,"BufferGeometryLoader",()=>gD,"ByteType",()=>1010,"Cache",()=>fY,"Camera",()=>gk,"CameraHelper",()=>hY,"CanvasTexture",()=>ed,"CapsuleGeometry",()=>ei,"CatmullRomCurve3",()=>eB,"CineonToneMapping",()=>3,"CircleGeometry",()=>ej,"ClampToEdgeWrapping",()=>1001,"Clock",()=>hr,"Color",()=>bg,"ColorKeyframeTrack",()=>fR,"ColorManagement",()=>as,"Compatibility",()=>I,"CompressedArrayTexture",()=>ea,"CompressedCubeTexture",()=>eb,"CompressedTexture",()=>d9,"CompressedTextureLoader",()=>f5,"ConeGeometry",()=>el,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"Controls",()=>h6,"CubeCamera",()=>gQ,"CubeDepthTexture",()=>ef,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>ec,"CubeTextureLoader",()=>f8,"CubeUVReflectionMapping",()=>306,"CubicBezierCurve",()=>eF,"CubicBezierCurve3",()=>eG,"CubicInterpolant",()=>fL,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceFrontBack",()=>3,"CullFaceNone",()=>0,"Curve",()=>et,"CurvePath",()=>eN,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"CylinderGeometry",()=>ek,"Cylindrical",()=>ht,"Data3DTexture",()=>aH,"DataArrayTexture",()=>aF,"DataTexture",()=>c7,"DataTextureLoader",()=>f9,"DataUtils",()=>bR,"DecrementStencilOp",()=>7683,"DecrementWrapStencilOp",()=>34056,"DefaultLoadingManager",()=>f_,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>ee,"DetachedBindMode",()=>z,"DirectionalLight",()=>gv,"DirectionalLightHelper",()=>hV,"DiscreteInterpolant",()=>fN,"DodecahedronGeometry",()=>en,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"DynamicCopyUsage",()=>35050,"DynamicDrawUsage",()=>35048,"DynamicReadUsage",()=>35049,"EdgesGeometry",()=>es,"EllipseCurve",()=>eu,"EqualCompare",()=>514,"EqualDepth",()=>4,"EqualStencilFunc",()=>514,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>aT,"EventDispatcher",()=>Z,"ExternalTexture",()=>eg,"ExtrudeGeometry",()=>e8,"FileLoader",()=>f3,"Float16BufferAttribute",()=>b1,"Float32BufferAttribute",()=>b2,"FloatType",()=>1015,"Fog",()=>bj,"FogExp2",()=>bi,"FramebufferTexture",()=>d8,"FrontSide",()=>0,"Frustum",()=>ds,"FrustumArray",()=>dv,"GLBufferAttribute",()=>hm,"GLSL1",()=>"100","GLSL3",()=>E,"GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"GreaterEqualStencilFunc",()=>518,"GreaterStencilFunc",()=>516,"GridHelper",()=>hQ,"Group",()=>a9,"HalfFloatType",()=>1016,"HemisphereLight",()=>gc,"HemisphereLightHelper",()=>hP,"IcosahedronGeometry",()=>fa,"ImageBitmapLoader",()=>gJ,"ImageLoader",()=>f7,"ImageUtils",()=>av,"IncrementStencilOp",()=>7682,"IncrementWrapStencilOp",()=>34055,"InstancedBufferAttribute",()=>db,"InstancedBufferGeometry",()=>gC,"InstancedInterleavedBuffer",()=>hl,"InstancedMesh",()=>dj,"Int16BufferAttribute",()=>bZ,"Int32BufferAttribute",()=>b_,"Int8BufferAttribute",()=>bW,"IntType",()=>1013,"InterleavedBuffer",()=>cf,"InterleavedBufferAttribute",()=>ch,"Interpolant",()=>fK,"InterpolateBezier",()=>2303,"InterpolateDiscrete",()=>2300,"InterpolateLinear",()=>2301,"InterpolateSmooth",()=>2302,"InterpolationSamplingMode",()=>H,"InterpolationSamplingType",()=>G,"InvertStencilOp",()=>5386,"KeepStencilOp",()=>7680,"KeyframeTrack",()=>fP,"LOD",()=>cB,"LatheGeometry",()=>fb,"Layers",()=>aU,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LessEqualStencilFunc",()=>515,"LessStencilFunc",()=>513,"Light",()=>gb,"LightProbe",()=>gz,"Line",()=>dV,"Line3",()=>hE,"LineBasicMaterial",()=>dN,"LineCurve",()=>eH,"LineCurve3",()=>eI,"LineDashedMaterial",()=>fE,"LineLoop",()=>d$,"LineSegments",()=>dZ,"LinearFilter",()=>1006,"LinearInterpolant",()=>fM,"LinearMipMapLinearFilter",()=>1008,"LinearMipMapNearestFilter",()=>1007,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>B,"LinearToneMapping",()=>1,"LinearTransfer",()=>C,"Loader",()=>f0,"LoaderUtils",()=>gB,"LoadingManager",()=>f$,"LoopOnce",()=>2200,"LoopPingPong",()=>2202,"LoopRepeat",()=>2201,"MOUSE",()=>w,"Material",()=>cj,"MaterialBlending",()=>6,"MaterialLoader",()=>gA,"MathUtils",()=>ai,"Matrix2",()=>hu,"Matrix3",()=>ao,"Matrix4",()=>aJ,"MaxEquation",()=>104,"Mesh",()=>cW,"MeshBasicMaterial",()=>cK,"MeshDepthMaterial",()=>fB,"MeshDistanceMaterial",()=>fC,"MeshLambertMaterial",()=>fA,"MeshMatcapMaterial",()=>fD,"MeshNormalMaterial",()=>fz,"MeshPhongMaterial",()=>fx,"MeshPhysicalMaterial",()=>fw,"MeshStandardMaterial",()=>fv,"MeshToonMaterial",()=>fy,"MinEquation",()=>103,"MirroredRepeatWrapping",()=>1002,"MixOperation",()=>1,"MultiplyBlending",()=>4,"MultiplyOperation",()=>0,"NearestFilter",()=>1003,"NearestMipMapLinearFilter",()=>1005,"NearestMipMapNearestFilter",()=>1004,"NearestMipmapLinearFilter",()=>1005,"NearestMipmapNearestFilter",()=>1004,"NeutralToneMapping",()=>7,"NeverCompare",()=>512,"NeverDepth",()=>0,"NeverStencilFunc",()=>512,"NoBlending",()=>0,"NoColorSpace",()=>"","NoNormalPacking",()=>"","NoToneMapping",()=>0,"NormalAnimationBlendMode",()=>2500,"NormalBlending",()=>1,"NormalGAPacking",()=>"ga","NormalRGPacking",()=>"rg","NotEqualCompare",()=>517,"NotEqualDepth",()=>7,"NotEqualStencilFunc",()=>517,"NumberKeyframeTrack",()=>fS,"Object3D",()=>a8,"ObjectLoader",()=>gE,"ObjectSpaceNormalMap",()=>1,"OctahedronGeometry",()=>fc,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>gt,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"PMREMGenerator",()=>iw,"Path",()=>eO,"PerspectiveCamera",()=>go,"Plane",()=>dn,"PlaneGeometry",()=>fd,"PlaneHelper",()=>h1,"PointLight",()=>gs,"PointLightHelper",()=>hL,"Points",()=>d4,"PointsMaterial",()=>d_,"PolarGridHelper",()=>hR,"PolyhedronGeometry",()=>em,"PositionalAudio",()=>g3,"PropertyBinding",()=>hc,"PropertyMixer",()=>g5,"QuadraticBezierCurve",()=>eJ,"QuadraticBezierCurve3",()=>eK,"Quaternion",()=>ak,"QuaternionKeyframeTrack",()=>fU,"QuaternionLinearInterpolant",()=>fT,"R11_EAC_Format",()=>37488,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"183","RG11_EAC_Format",()=>37490,"RGBADepthPacking",()=>3201,"RGBAFormat",()=>1023,"RGBAIntegerFormat",()=>1033,"RGBA_ASTC_10x10_Format",()=>37819,"RGBA_ASTC_10x5_Format",()=>37816,"RGBA_ASTC_10x6_Format",()=>37817,"RGBA_ASTC_10x8_Format",()=>37818,"RGBA_ASTC_12x10_Format",()=>37820,"RGBA_ASTC_12x12_Format",()=>37821,"RGBA_ASTC_4x4_Format",()=>37808,"RGBA_ASTC_5x4_Format",()=>37809,"RGBA_ASTC_5x5_Format",()=>37810,"RGBA_ASTC_6x5_Format",()=>37811,"RGBA_ASTC_6x6_Format",()=>37812,"RGBA_ASTC_8x5_Format",()=>37813,"RGBA_ASTC_8x6_Format",()=>37814,"RGBA_ASTC_8x8_Format",()=>37815,"RGBA_BPTC_Format",()=>36492,"RGBA_ETC2_EAC_Format",()=>37496,"RGBA_PVRTC_2BPPV1_Format",()=>35843,"RGBA_PVRTC_4BPPV1_Format",()=>35842,"RGBA_S3TC_DXT1_Format",()=>33777,"RGBA_S3TC_DXT3_Format",()=>33778,"RGBA_S3TC_DXT5_Format",()=>33779,"RGBDepthPacking",()=>3202,"RGBFormat",()=>1022,"RGBIntegerFormat",()=>1032,"RGB_BPTC_SIGNED_Format",()=>36494,"RGB_BPTC_UNSIGNED_Format",()=>36495,"RGB_ETC1_Format",()=>36196,"RGB_ETC2_Format",()=>37492,"RGB_PVRTC_2BPPV1_Format",()=>35841,"RGB_PVRTC_4BPPV1_Format",()=>35840,"RGB_S3TC_DXT1_Format",()=>33776,"RGDepthPacking",()=>3203,"RGFormat",()=>1030,"RGIntegerFormat",()=>1031,"RawShaderMaterial",()=>fu,"Ray",()=>cJ,"Raycaster",()=>ho,"RectAreaLight",()=>gx,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RenderTarget",()=>aD,"RenderTarget3D",()=>hh,"RepeatWrapping",()=>1e3,"ReplaceStencilOp",()=>7681,"ReverseSubtractEquation",()=>102,"RingGeometry",()=>fe,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>36286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>A,"SRGBTransfer",()=>D,"Scene",()=>bk,"ShaderChunk",()=>ib,"ShaderLib",()=>id,"ShaderMaterial",()=>ft,"ShadowMaterial",()=>fo,"Shape",()=>eP,"ShapeGeometry",()=>ff,"ShapePath",()=>h5,"ShapeUtils",()=>e5,"ShortType",()=>1011,"Skeleton",()=>da,"SkeletonHelper",()=>hK,"SkinnedMesh",()=>c5,"Source",()=>ax,"Sphere",()=>b6,"SphereGeometry",()=>fg,"Spherical",()=>hs,"SphericalHarmonics3",()=>gy,"SplineCurve",()=>eL,"SpotLight",()=>gq,"SpotLightHelper",()=>hG,"Sprite",()=>cx,"SpriteMaterial",()=>ck,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"StaticCopyUsage",()=>35046,"StaticDrawUsage",()=>35044,"StaticReadUsage",()=>35045,"StereoCamera",()=>gP,"StreamCopyUsage",()=>35042,"StreamDrawUsage",()=>35040,"StreamReadUsage",()=>35041,"StringKeyframeTrack",()=>fV,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TOUCH",()=>x,"TangentSpaceNormalMap",()=>0,"TetrahedronGeometry",()=>fh,"Texture",()=>aB,"TextureLoader",()=>ga,"TextureUtils",()=>h8,"Timer",()=>gS,"TimestampQuery",()=>F,"TorusGeometry",()=>fi,"TorusKnotGeometry",()=>fj,"Triangle",()=>by,"TriangleFanDrawMode",()=>2,"TriangleStripDrawMode",()=>1,"TrianglesDrawMode",()=>0,"TubeGeometry",()=>fk,"UVMapping",()=>300,"Uint16BufferAttribute",()=>b$,"Uint32BufferAttribute",()=>b0,"Uint8BufferAttribute",()=>bX,"Uint8ClampedBufferAttribute",()=>bY,"Uniform",()=>hi,"UniformsGroup",()=>hk,"UniformsLib",()=>ic,"UniformsUtils",()=>fs,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>aj,"Vector3",()=>al,"Vector4",()=>aC,"VectorKeyframeTrack",()=>fW,"VideoFrameTexture",()=>d7,"VideoTexture",()=>d6,"WebGL3DRenderTarget",()=>aI,"WebGLArrayRenderTarget",()=>aG,"WebGLCoordinateSystem",()=>2e3,"WebGLCubeRenderTarget",()=>iC,"WebGLRenderTarget",()=>aE,"WebGLRenderer",()=>ky,"WebGLUtils",()=>kn,"WebGPUCoordinateSystem",()=>2001,"WebXRController",()=>bb,"WireframeGeometry",()=>fl,"WrapAroundEnding",()=>2402,"ZeroCurvatureEnding",()=>2400,"ZeroFactor",()=>200,"ZeroSlopeEnding",()=>2401,"ZeroStencilOp",()=>0,"createCanvasElement",()=>N,"error",()=>V,"getConsoleFunction",()=>R,"log",()=>S,"setConsoleFunction",()=>Q,"warn",()=>U,"warnOnce",()=>W],98167);var l0=a.i(98167);function l1(a,b){let c;return(...d)=>{window.clearTimeout(c),c=window.setTimeout(()=>a(...d),b)}}let l2=["x","y","top","bottom","left","right","width","height"];function l3({ref:a,children:b,fallback:c,resize:d,style:e,gl:f,events:g=l_,eventSource:h,eventPrefix:i,shadows:j,linear:k,flat:l,legacy:m,orthographic:n,frameloop:o,dpr:p,performance:q,raycaster:r,camera:s,scene:t,onPointerMissed:u,onCreated:w,...x}){v.useMemo(()=>lv(l0),[]);let y=kW(),[z,A]=function({debounce:a,scroll:b,polyfill:c,offsetSize:d}={debounce:0,scroll:!1,offsetSize:!1}){var e,f,g;let h=c||class{};if(!h)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[i,j]=(0,v.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),k=(0,v.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:i,orientationHandler:null}),l=a?"number"==typeof a?a:a.scroll:null,m=a?"number"==typeof a?a:a.resize:null,n=(0,v.useRef)(!1);(0,v.useEffect)(()=>(n.current=!0,()=>void(n.current=!1)));let[o,p,q]=(0,v.useMemo)(()=>{let a=()=>{let a,b;if(!k.current.element)return;let{left:c,top:e,width:f,height:g,bottom:h,right:i,x:l,y:m}=k.current.element.getBoundingClientRect(),o={left:c,top:e,width:f,height:g,bottom:h,right:i,x:l,y:m};k.current.element instanceof HTMLElement&&d&&(o.height=k.current.element.offsetHeight,o.width=k.current.element.offsetWidth),Object.freeze(o),n.current&&(a=k.current.lastBounds,b=o,!l2.every(c=>a[c]===b[c]))&&j(k.current.lastBounds=o)};return[a,m?l1(a,m):a,l?l1(a,l):a]},[j,d,l,m]);function r(){k.current.scrollContainers&&(k.current.scrollContainers.forEach(a=>a.removeEventListener("scroll",q,!0)),k.current.scrollContainers=null),k.current.resizeObserver&&(k.current.resizeObserver.disconnect(),k.current.resizeObserver=null),k.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",k.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",k.current.orientationHandler))}function s(){k.current.element&&(k.current.resizeObserver=new h(q),k.current.resizeObserver.observe(k.current.element),b&&k.current.scrollContainers&&k.current.scrollContainers.forEach(a=>a.addEventListener("scroll",q,{capture:!0,passive:!0})),k.current.orientationHandler=()=>{q()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",k.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",k.current.orientationHandler))}return e=q,f=!!b,(0,v.useEffect)(()=>{if(f)return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)},[e,f]),g=p,(0,v.useEffect)(()=>(window.addEventListener("resize",g),()=>void window.removeEventListener("resize",g)),[g]),(0,v.useEffect)(()=>{r(),s()},[b,q,p]),(0,v.useEffect)(()=>r,[]),[a=>{a&&a!==k.current.element&&(r(),k.current.element=a,k.current.scrollContainers=function a(b){let c=[];if(!b||b===document.body)return c;let{overflow:d,overflowX:e,overflowY:f}=window.getComputedStyle(b);return[d,e,f].some(a=>"auto"===a||"scroll"===a)&&c.push(b),[...c,...a(b.parentElement)]}(a),s())},i,o]}({scroll:!0,debounce:{scroll:50,resize:0},...d}),B=v.useRef(null),C=v.useRef(null);v.useImperativeHandle(a,()=>B.current);let D=kV(u),[E,F]=v.useState(!1),[G,H]=v.useState(!1);if(E)throw E;if(G)throw G;let I=v.useRef(null);kU(()=>{let a=B.current;A.width>0&&A.height>0&&a&&(I.current||(I.current=lK(a)),async function(){await I.current.configure({gl:f,scene:t,events:g,shadows:j,linear:k,flat:l,legacy:m,orthographic:n,frameloop:o,dpr:p,performance:q,raycaster:r,camera:s,size:A,onPointerMissed:(...a)=>null==D.current?void 0:D.current(...a),onCreated:a=>{null==a.events.connect||a.events.connect(h?kS(h)?h.current:h:C.current),i&&a.setEvents({compute:(a,b)=>{let c=a[i+"X"],d=a[i+"Y"];b.pointer.set(c/b.size.width*2-1,-(2*(d/b.size.height))+1),b.raycaster.setFromCamera(b.pointer,b.camera)}}),null==w||w(a)}}),I.current.render((0,kI.jsx)(y,{children:(0,kI.jsx)(kY,{set:H,children:(0,kI.jsx)(v.Suspense,{fallback:(0,kI.jsx)(kX,{set:F}),children:null!=b?b:null})})}))}())}),v.useEffect(()=>{let a=B.current;if(a)return()=>lM(a)},[]);let J=h?"none":"auto";return(0,kI.jsx)("div",{ref:C,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:J,...e},...x,children:(0,kI.jsx)("div",{ref:z,style:{width:"100%",height:"100%"},children:(0,kI.jsx)("canvas",{ref:B,style:{display:"block"},children:c})})})}function l4(a){return(0,kI.jsx)(kN,{children:(0,kI.jsx)(l3,{...a})})}a.s(["Canvas",()=>l4],10129)},12303,a=>{"use strict";var b=a.i(48604);a.s(["useFrame",()=>b.D])},52253,a=>{"use strict";var b=a.i(48604);a.s(["useThree",()=>b.C])},39705,a=>{"use strict";function b(){return(b=Object.assign.bind()).apply(null,arguments)}a.s(["default",()=>b])},73974,a=>{"use strict";var b=a.i(39705),c=a.i(52253),d=a.i(12303),e=a.i(72131),f=a.i(35258),g=Object.defineProperty;class h{constructor(){((a,b,c)=>{let d;return(d="symbol"!=typeof b?b+"":b)in a?g(a,d,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[d]=c})(this,"_listeners")}addEventListener(a,b){void 0===this._listeners&&(this._listeners={});let c=this._listeners;void 0===c[a]&&(c[a]=[]),-1===c[a].indexOf(b)&&c[a].push(b)}hasEventListener(a,b){if(void 0===this._listeners)return!1;let c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)}removeEventListener(a,b){if(void 0===this._listeners)return;let c=this._listeners[a];if(void 0!==c){let a=c.indexOf(b);-1!==a&&c.splice(a,1)}}dispatchEvent(a){if(void 0===this._listeners)return;let b=this._listeners[a.type];if(void 0!==b){a.target=this;let c=b.slice(0);for(let b=0,d=c.length;b<d;b++)c[b].call(this,a);a.target=null}}}var i=Object.defineProperty,j=(a,b,c)=>{let d;return(d="symbol"!=typeof b?b+"":b)in a?i(a,d,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[d]=c,c};let k=new f.Ray,l=new f.Plane,m=Math.cos(Math.PI/180*70),n=(a,b)=>(a%b+b)%b;class o extends h{constructor(a,b){super(),j(this,"object"),j(this,"domElement"),j(this,"enabled",!0),j(this,"target",new f.Vector3),j(this,"minDistance",0),j(this,"maxDistance",1/0),j(this,"minZoom",0),j(this,"maxZoom",1/0),j(this,"minPolarAngle",0),j(this,"maxPolarAngle",Math.PI),j(this,"minAzimuthAngle",-1/0),j(this,"maxAzimuthAngle",1/0),j(this,"enableDamping",!1),j(this,"dampingFactor",.05),j(this,"enableZoom",!0),j(this,"zoomSpeed",1),j(this,"enableRotate",!0),j(this,"rotateSpeed",1),j(this,"enablePan",!0),j(this,"panSpeed",1),j(this,"screenSpacePanning",!0),j(this,"keyPanSpeed",7),j(this,"zoomToCursor",!1),j(this,"autoRotate",!1),j(this,"autoRotateSpeed",2),j(this,"reverseOrbit",!1),j(this,"reverseHorizontalOrbit",!1),j(this,"reverseVerticalOrbit",!1),j(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),j(this,"mouseButtons",{LEFT:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN}),j(this,"touches",{ONE:f.TOUCH.ROTATE,TWO:f.TOUCH.DOLLY_PAN}),j(this,"target0"),j(this,"position0"),j(this,"zoom0"),j(this,"_domElementKeyEvents",null),j(this,"getPolarAngle"),j(this,"getAzimuthalAngle"),j(this,"setPolarAngle"),j(this,"setAzimuthalAngle"),j(this,"getDistance"),j(this,"getZoomScale"),j(this,"listenToKeyEvents"),j(this,"stopListenToKeyEvents"),j(this,"saveState"),j(this,"reset"),j(this,"update"),j(this,"connect"),j(this,"dispose"),j(this,"dollyIn"),j(this,"dollyOut"),j(this,"getScale"),j(this,"setScale"),this.object=a,this.domElement=b,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>p.phi,this.getAzimuthalAngle=()=>p.theta,this.setPolarAngle=a=>{let b=n(a,2*Math.PI),d=p.phi;d<0&&(d+=2*Math.PI),b<0&&(b+=2*Math.PI);let e=Math.abs(b-d);2*Math.PI-e<e&&(b<d?b+=2*Math.PI:d+=2*Math.PI),q.phi=b-d,c.update()},this.setAzimuthalAngle=a=>{let b=n(a,2*Math.PI),d=p.theta;d<0&&(d+=2*Math.PI),b<0&&(b+=2*Math.PI);let e=Math.abs(b-d);2*Math.PI-e<e&&(b<d?b+=2*Math.PI:d+=2*Math.PI),q.theta=b-d,c.update()},this.getDistance=()=>c.object.position.distanceTo(c.target),this.listenToKeyEvents=a=>{a.addEventListener("keydown",aa),this._domElementKeyEvents=a},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",aa),this._domElementKeyEvents=null},this.saveState=()=>{c.target0.copy(c.target),c.position0.copy(c.object.position),c.zoom0=c.object.zoom},this.reset=()=>{c.target.copy(c.target0),c.object.position.copy(c.position0),c.object.zoom=c.zoom0,c.object.updateProjectionMatrix(),c.dispatchEvent(d),c.update(),i=h.NONE},this.update=(()=>{let b=new f.Vector3,e=new f.Vector3(0,1,0),g=new f.Quaternion().setFromUnitVectors(a.up,e),j=g.clone().invert(),n=new f.Vector3,t=new f.Quaternion,u=2*Math.PI;return function(){let v=c.object.position;g.setFromUnitVectors(a.up,e),j.copy(g).invert(),b.copy(v).sub(c.target),b.applyQuaternion(g),p.setFromVector3(b),c.autoRotate&&i===h.NONE&&I(2*Math.PI/60/60*c.autoRotateSpeed),c.enableDamping?(p.theta+=q.theta*c.dampingFactor,p.phi+=q.phi*c.dampingFactor):(p.theta+=q.theta,p.phi+=q.phi);let w=c.minAzimuthAngle,x=c.maxAzimuthAngle;isFinite(w)&&isFinite(x)&&(w<-Math.PI?w+=u:w>Math.PI&&(w-=u),x<-Math.PI?x+=u:x>Math.PI&&(x-=u),w<=x?p.theta=Math.max(w,Math.min(x,p.theta)):p.theta=p.theta>(w+x)/2?Math.max(w,p.theta):Math.min(x,p.theta)),p.phi=Math.max(c.minPolarAngle,Math.min(c.maxPolarAngle,p.phi)),p.makeSafe(),!0===c.enableDamping?c.target.addScaledVector(s,c.dampingFactor):c.target.add(s),c.zoomToCursor&&E||c.object.isOrthographicCamera?p.radius=P(p.radius):p.radius=P(p.radius*r),b.setFromSpherical(p),b.applyQuaternion(j),v.copy(c.target).add(b),c.object.matrixAutoUpdate||c.object.updateMatrix(),c.object.lookAt(c.target),!0===c.enableDamping?(q.theta*=1-c.dampingFactor,q.phi*=1-c.dampingFactor,s.multiplyScalar(1-c.dampingFactor)):(q.set(0,0,0),s.set(0,0,0));let y=!1;if(c.zoomToCursor&&E){let d=null;if(c.object instanceof f.PerspectiveCamera&&c.object.isPerspectiveCamera){let a=b.length();d=P(a*r);let e=a-d;c.object.position.addScaledVector(C,e),c.object.updateMatrixWorld()}else if(c.object.isOrthographicCamera){let a=new f.Vector3(D.x,D.y,0);a.unproject(c.object),c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom/r)),c.object.updateProjectionMatrix(),y=!0;let e=new f.Vector3(D.x,D.y,0);e.unproject(c.object),c.object.position.sub(e).add(a),c.object.updateMatrixWorld(),d=b.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),c.zoomToCursor=!1;null!==d&&(c.screenSpacePanning?c.target.set(0,0,-1).transformDirection(c.object.matrix).multiplyScalar(d).add(c.object.position):(k.origin.copy(c.object.position),k.direction.set(0,0,-1).transformDirection(c.object.matrix),Math.abs(c.object.up.dot(k.direction))<m?a.lookAt(c.target):(l.setFromNormalAndCoplanarPoint(c.object.up,c.target),k.intersectPlane(l,c.target))))}else c.object instanceof f.OrthographicCamera&&c.object.isOrthographicCamera&&(y=1!==r)&&(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom/r)),c.object.updateProjectionMatrix());return r=1,E=!1,!!(y||n.distanceToSquared(c.object.position)>o||8*(1-t.dot(c.object.quaternion))>o)&&(c.dispatchEvent(d),n.copy(c.object.position),t.copy(c.object.quaternion),y=!1,!0)}})(),this.connect=a=>{c.domElement=a,c.domElement.style.touchAction="none",c.domElement.addEventListener("contextmenu",ab),c.domElement.addEventListener("pointerdown",Y),c.domElement.addEventListener("pointercancel",$),c.domElement.addEventListener("wheel",_)},this.dispose=()=>{var a,b,d,e,f,g;c.domElement&&(c.domElement.style.touchAction="auto"),null==(a=c.domElement)||a.removeEventListener("contextmenu",ab),null==(b=c.domElement)||b.removeEventListener("pointerdown",Y),null==(d=c.domElement)||d.removeEventListener("pointercancel",$),null==(e=c.domElement)||e.removeEventListener("wheel",_),null==(f=c.domElement)||f.ownerDocument.removeEventListener("pointermove",Z),null==(g=c.domElement)||g.ownerDocument.removeEventListener("pointerup",$),null!==c._domElementKeyEvents&&c._domElementKeyEvents.removeEventListener("keydown",aa)};const c=this,d={type:"change"},e={type:"start"},g={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=h.NONE;const o=1e-6,p=new f.Spherical,q=new f.Spherical;let r=1;const s=new f.Vector3,t=new f.Vector2,u=new f.Vector2,v=new f.Vector2,w=new f.Vector2,x=new f.Vector2,y=new f.Vector2,z=new f.Vector2,A=new f.Vector2,B=new f.Vector2,C=new f.Vector3,D=new f.Vector2;let E=!1;const F=[],G={};function H(){return Math.pow(.95,c.zoomSpeed)}function I(a){c.reverseOrbit||c.reverseHorizontalOrbit?q.theta+=a:q.theta-=a}function J(a){c.reverseOrbit||c.reverseVerticalOrbit?q.phi+=a:q.phi-=a}const K=(()=>{let a=new f.Vector3;return function(b,c){a.setFromMatrixColumn(c,0),a.multiplyScalar(-b),s.add(a)}})(),L=(()=>{let a=new f.Vector3;return function(b,d){!0===c.screenSpacePanning?a.setFromMatrixColumn(d,1):(a.setFromMatrixColumn(d,0),a.crossVectors(c.object.up,a)),a.multiplyScalar(b),s.add(a)}})(),M=(()=>{let a=new f.Vector3;return function(b,d){let e=c.domElement;if(e&&c.object instanceof f.PerspectiveCamera&&c.object.isPerspectiveCamera){let f=c.object.position;a.copy(f).sub(c.target);let g=a.length();K(2*b*(g*=Math.tan(c.object.fov/2*Math.PI/180))/e.clientHeight,c.object.matrix),L(2*d*g/e.clientHeight,c.object.matrix)}else e&&c.object instanceof f.OrthographicCamera&&c.object.isOrthographicCamera?(K(b*(c.object.right-c.object.left)/c.object.zoom/e.clientWidth,c.object.matrix),L(d*(c.object.top-c.object.bottom)/c.object.zoom/e.clientHeight,c.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),c.enablePan=!1)}})();function N(a){c.object instanceof f.PerspectiveCamera&&c.object.isPerspectiveCamera||c.object instanceof f.OrthographicCamera&&c.object.isOrthographicCamera?r=a:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function O(a){if(!c.zoomToCursor||!c.domElement)return;E=!0;let b=c.domElement.getBoundingClientRect(),d=a.clientX-b.left,e=a.clientY-b.top,f=b.width,g=b.height;D.x=d/f*2-1,D.y=-(e/g*2)+1,C.set(D.x,D.y,1).unproject(c.object).sub(c.object.position).normalize()}function P(a){return Math.max(c.minDistance,Math.min(c.maxDistance,a))}function Q(a){t.set(a.clientX,a.clientY)}function R(a){w.set(a.clientX,a.clientY)}function S(){if(1==F.length)t.set(F[0].pageX,F[0].pageY);else{let a=.5*(F[0].pageX+F[1].pageX),b=.5*(F[0].pageY+F[1].pageY);t.set(a,b)}}function T(){if(1==F.length)w.set(F[0].pageX,F[0].pageY);else{let a=.5*(F[0].pageX+F[1].pageX),b=.5*(F[0].pageY+F[1].pageY);w.set(a,b)}}function U(){let a=F[0].pageX-F[1].pageX,b=F[0].pageY-F[1].pageY,c=Math.sqrt(a*a+b*b);z.set(0,c)}function V(a){if(1==F.length)u.set(a.pageX,a.pageY);else{let b=ad(a),c=.5*(a.pageX+b.x),d=.5*(a.pageY+b.y);u.set(c,d)}v.subVectors(u,t).multiplyScalar(c.rotateSpeed);let b=c.domElement;b&&(I(2*Math.PI*v.x/b.clientHeight),J(2*Math.PI*v.y/b.clientHeight)),t.copy(u)}function W(a){if(1==F.length)x.set(a.pageX,a.pageY);else{let b=ad(a),c=.5*(a.pageX+b.x),d=.5*(a.pageY+b.y);x.set(c,d)}y.subVectors(x,w).multiplyScalar(c.panSpeed),M(y.x,y.y),w.copy(x)}function X(a){var b;let d=ad(a),e=a.pageX-d.x,f=a.pageY-d.y,g=Math.sqrt(e*e+f*f);A.set(0,g),B.set(0,Math.pow(A.y/z.y,c.zoomSpeed)),b=B.y,N(r/b),z.copy(A)}function Y(a){var b,d,g;!1!==c.enabled&&(0===F.length&&(null==(b=c.domElement)||b.ownerDocument.addEventListener("pointermove",Z),null==(d=c.domElement)||d.ownerDocument.addEventListener("pointerup",$)),g=a,F.push(g),"touch"===a.pointerType?function(a){switch(ac(a),F.length){case 1:switch(c.touches.ONE){case f.TOUCH.ROTATE:if(!1===c.enableRotate)return;S(),i=h.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(!1===c.enablePan)return;T(),i=h.TOUCH_PAN;break;default:i=h.NONE}break;case 2:switch(c.touches.TWO){case f.TOUCH.DOLLY_PAN:if(!1===c.enableZoom&&!1===c.enablePan)return;c.enableZoom&&U(),c.enablePan&&T(),i=h.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(!1===c.enableZoom&&!1===c.enableRotate)return;c.enableZoom&&U(),c.enableRotate&&S(),i=h.TOUCH_DOLLY_ROTATE;break;default:i=h.NONE}break;default:i=h.NONE}i!==h.NONE&&c.dispatchEvent(e)}(a):function(a){let b;switch(a.button){case 0:b=c.mouseButtons.LEFT;break;case 1:b=c.mouseButtons.MIDDLE;break;case 2:b=c.mouseButtons.RIGHT;break;default:b=-1}switch(b){case f.MOUSE.DOLLY:if(!1===c.enableZoom)return;O(a),z.set(a.clientX,a.clientY),i=h.DOLLY;break;case f.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(!1===c.enablePan)return;R(a),i=h.PAN}else{if(!1===c.enableRotate)return;Q(a),i=h.ROTATE}break;case f.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(!1===c.enableRotate)return;Q(a),i=h.ROTATE}else{if(!1===c.enablePan)return;R(a),i=h.PAN}break;default:i=h.NONE}i!==h.NONE&&c.dispatchEvent(e)}(a))}function Z(a){!1!==c.enabled&&("touch"===a.pointerType?function(a){switch(ac(a),i){case h.TOUCH_ROTATE:if(!1===c.enableRotate)return;V(a),c.update();break;case h.TOUCH_PAN:if(!1===c.enablePan)return;W(a),c.update();break;case h.TOUCH_DOLLY_PAN:if(!1===c.enableZoom&&!1===c.enablePan)return;c.enableZoom&&X(a),c.enablePan&&W(a),c.update();break;case h.TOUCH_DOLLY_ROTATE:if(!1===c.enableZoom&&!1===c.enableRotate)return;c.enableZoom&&X(a),c.enableRotate&&V(a),c.update();break;default:i=h.NONE}}(a):function(a){if(!1!==c.enabled)switch(i){case h.ROTATE:let b;if(!1===c.enableRotate)return;u.set(a.clientX,a.clientY),v.subVectors(u,t).multiplyScalar(c.rotateSpeed),(b=c.domElement)&&(I(2*Math.PI*v.x/b.clientHeight),J(2*Math.PI*v.y/b.clientHeight)),t.copy(u),c.update();break;case h.DOLLY:var d,e;if(!1===c.enableZoom)return;(A.set(a.clientX,a.clientY),B.subVectors(A,z),B.y>0)?(d=H(),N(r/d)):B.y<0&&(e=H(),N(r*e)),z.copy(A),c.update();break;case h.PAN:if(!1===c.enablePan)return;x.set(a.clientX,a.clientY),y.subVectors(x,w).multiplyScalar(c.panSpeed),M(y.x,y.y),w.copy(x),c.update()}}(a))}function $(a){var b,d,e;(function(a){delete G[a.pointerId];for(let b=0;b<F.length;b++)if(F[b].pointerId==a.pointerId)return void F.splice(b,1)})(a),0===F.length&&(null==(b=c.domElement)||b.releasePointerCapture(a.pointerId),null==(d=c.domElement)||d.ownerDocument.removeEventListener("pointermove",Z),null==(e=c.domElement)||e.ownerDocument.removeEventListener("pointerup",$)),c.dispatchEvent(g),i=h.NONE}function _(a){if(!1!==c.enabled&&!1!==c.enableZoom&&(i===h.NONE||i===h.ROTATE)){var b,d;a.preventDefault(),c.dispatchEvent(e),(O(a),a.deltaY<0)?(b=H(),N(r*b)):a.deltaY>0&&(d=H(),N(r/d)),c.update(),c.dispatchEvent(g)}}function aa(a){if(!1!==c.enabled&&!1!==c.enablePan){let b=!1;switch(a.code){case c.keys.UP:M(0,c.keyPanSpeed),b=!0;break;case c.keys.BOTTOM:M(0,-c.keyPanSpeed),b=!0;break;case c.keys.LEFT:M(c.keyPanSpeed,0),b=!0;break;case c.keys.RIGHT:M(-c.keyPanSpeed,0),b=!0}b&&(a.preventDefault(),c.update())}}function ab(a){!1!==c.enabled&&a.preventDefault()}function ac(a){let b=G[a.pointerId];void 0===b&&(b=new f.Vector2,G[a.pointerId]=b),b.set(a.pageX,a.pageY)}function ad(a){return G[(a.pointerId===F[0].pointerId?F[1]:F[0]).pointerId]}this.dollyIn=(a=H())=>{N(r*a),c.update()},this.dollyOut=(a=H())=>{N(r/a),c.update()},this.getScale=()=>r,this.setScale=a=>{N(a),c.update()},this.getZoomScale=()=>H(),void 0!==b&&this.connect(b),this.update()}}let p=e.forwardRef(({makeDefault:a,camera:f,regress:g,domElement:h,enableDamping:i=!0,keyEvents:j=!1,onChange:k,onStart:l,onEnd:m,...n},p)=>{let q=(0,c.useThree)(a=>a.invalidate),r=(0,c.useThree)(a=>a.camera),s=(0,c.useThree)(a=>a.gl),t=(0,c.useThree)(a=>a.events),u=(0,c.useThree)(a=>a.setEvents),v=(0,c.useThree)(a=>a.set),w=(0,c.useThree)(a=>a.get),x=(0,c.useThree)(a=>a.performance),y=f||r,z=h||t.connected||s.domElement,A=e.useMemo(()=>new o(y),[y]);return(0,d.useFrame)(()=>{A.enabled&&A.update()},-1),e.useEffect(()=>(j&&A.connect(!0===j?z:j),A.connect(z),()=>void A.dispose()),[j,z,g,A,q]),e.useEffect(()=>{let a=a=>{q(),g&&x.regress(),k&&k(a)},b=a=>{l&&l(a)},c=a=>{m&&m(a)};return A.addEventListener("change",a),A.addEventListener("start",b),A.addEventListener("end",c),()=>{A.removeEventListener("start",b),A.removeEventListener("end",c),A.removeEventListener("change",a)}},[k,l,m,A,q,u]),e.useEffect(()=>{if(a){let a=w().controls;return v({controls:A}),()=>v({controls:a})}},[a,A]),e.createElement("primitive",(0,b.default)({ref:p,object:A,enableDamping:i},n))});a.s(["OrbitControls",()=>p],73974)},60554,a=>{"use strict";let b=parseInt(a.i(35258).REVISION.replace(/\D+/g,""));a.s(["version",()=>b])}];
|
|
394
|
+
|
|
395
|
+
//# sourceMappingURL=node_modules_04a97984._.js.map
|