From fecf646d9087c47e444601b8149cd22106009428 Mon Sep 17 00:00:00 2001 From: Brian Beck Date: Thu, 12 Mar 2026 16:34:43 -0700 Subject: [PATCH] rebuild --- docs/404.html | 2 +- docs/404/index.html | 2 +- docs/__next.__PAGE__.txt | 7 +- docs/__next._full.txt | 9 +- docs/__next._head.txt | 2 +- docs/__next._index.txt | 4 +- docs/__next._tree.txt | 7 +- docs/_next/static/chunks/005e475439c5cb3e.js | 1 + docs/_next/static/chunks/037fbc56cebf7caa.js | 1 - docs/_next/static/chunks/0e2ec5f4026ef564.js | 1 + docs/_next/static/chunks/14c6376ae0b23060.js | 38 -- docs/_next/static/chunks/164bc8495505bc95.js | 174 ------ docs/_next/static/chunks/1a6c33d7ed444b1d.js | 1 + docs/_next/static/chunks/1cf57947857f8eec.js | 1 + docs/_next/static/chunks/1db3a9d62713e989.css | 1 + docs/_next/static/chunks/21659079be7af0ab.js | 17 + docs/_next/static/chunks/22c22371d5c1dcba.js | 1 + docs/_next/static/chunks/273b16b21a9dcb92.js | 1 + docs/_next/static/chunks/28c98fb093e4695f.css | 2 + docs/_next/static/chunks/2afaf0aea010c2be.js | 1 + docs/_next/static/chunks/2c772d15a5a10e4d.js | 75 +++ docs/_next/static/chunks/2edeeda5ca6dc680.js | 1 - docs/_next/static/chunks/302e494fb721f5e6.js | 1 + docs/_next/static/chunks/341165a5ae0d70ac.js | 1 + docs/_next/static/chunks/3770acf7d1a6ba0a.js | 1 + docs/_next/static/chunks/39402d7e86cbc15f.js | 1 + ...a2c6dc513278881.js => 3b423df62fc674df.js} | 2 +- docs/_next/static/chunks/3f45dfa93dd54d72.js | 1 + docs/_next/static/chunks/3fc0c5e684385765.js | 89 --- docs/_next/static/chunks/450cc5a89761fca0.js | 1 + docs/_next/static/chunks/463a5d636c02e0db.js | 1 - docs/_next/static/chunks/4c292ca57f1d49be.js | 1 + docs/_next/static/chunks/4fb9edf01fb5e4f5.js | 1 + docs/_next/static/chunks/534ef931e88eb989.js | 1 - docs/_next/static/chunks/543f866d9a9c134b.css | 1 + docs/_next/static/chunks/576b06837c0cb7a0.js | 17 - docs/_next/static/chunks/5b60a5e8e48bc409.js | 397 ------------- docs/_next/static/chunks/5be53d01eebba2c6.js | 1 + docs/_next/static/chunks/66f953934e42712b.css | 1 + docs/_next/static/chunks/687860f86433eb04.js | 1 - docs/_next/static/chunks/68bae3cf9f451a9b.js | 1 + docs/_next/static/chunks/6c0bdfaab43cc40b.js | 1 + docs/_next/static/chunks/6f1c1038c8b3b80c.js | 75 --- docs/_next/static/chunks/718b5c36c0eed37e.js | 1 - docs/_next/static/chunks/727710e55f003daf.js | 36 ++ docs/_next/static/chunks/744d1b0edcf40c69.js | 521 ++++++++++++++++++ docs/_next/static/chunks/818dce712bc45cb4.js | 174 ------ docs/_next/static/chunks/82a44da545bac352.js | 397 ------------- docs/_next/static/chunks/88a5cf0ea7f16af4.js | 1 - ...00acbf8afd8b4b6.js => 9236f2f78e6373a1.js} | 2 +- docs/_next/static/chunks/92a585fca24d52ed.css | 14 + docs/_next/static/chunks/9542fc38c512bd1a.css | 5 - docs/_next/static/chunks/96ae05ebba99dcff.js | 1 + docs/_next/static/chunks/97346c3751717c47.js | 1 + docs/_next/static/chunks/994d42eb1af43673.js | 211 +++++++ docs/_next/static/chunks/99bc9f3ae93187f1.css | 1 - docs/_next/static/chunks/9a99559140e82f06.js | 362 ++++++++++++ docs/_next/static/chunks/9ffe862a9787606f.css | 1 + docs/_next/static/chunks/a05c1cf573184d15.css | 4 + docs/_next/static/chunks/a2e31798d9bc121e.css | 13 - docs/_next/static/chunks/ac206141b5c1882c.js | 1 - docs/_next/static/chunks/acace6aadc879a08.js | 1 + ...0039d1c837dab.css => ad52ebedad251428.css} | 2 +- docs/_next/static/chunks/aed6ada67562a5fc.js | 1 - ...eaea0ae086bad69.js => af18e4f3fa33de6b.js} | 2 +- docs/_next/static/chunks/b89dc6fc9051e9fe.js | 1 + docs/_next/static/chunks/bc2b324cb2101ffe.js | 89 +++ docs/_next/static/chunks/c293826b70147a61.js | 521 ------------------ docs/_next/static/chunks/ca289845e0f08110.js | 1 - docs/_next/static/chunks/d16b6f1b4eacbf2b.js | 1 - docs/_next/static/chunks/e16c267496b8de91.js | 1 - docs/_next/static/chunks/e1a8caa90a5343cf.js | 17 - docs/_next/static/chunks/e27b13e203064a85.js | 1 + docs/_next/static/chunks/e4a5074909f0df67.js | 1 - docs/_next/static/chunks/e5617268e3c7a140.js | 1 - ...96073b9f885dcbc.js => ebf99400aa3d97c0.js} | 2 +- docs/_next/static/chunks/fcfc8a45de71c4a4.js | 1 + .../_buildManifest.js | 0 .../_clientMiddlewareManifest.json | 0 .../_ssgManifest.js | 0 docs/_not-found/__next._full.txt | 4 +- docs/_not-found/__next._head.txt | 2 +- docs/_not-found/__next._index.txt | 4 +- .../_not-found/__next._not-found.__PAGE__.txt | 2 +- docs/_not-found/__next._not-found.txt | 2 +- docs/_not-found/__next._tree.txt | 4 +- docs/_not-found/index.html | 2 +- docs/_not-found/index.txt | 4 +- docs/index.html | 2 +- docs/index.txt | 9 +- docs/shapes/__next._full.txt | 8 +- docs/shapes/__next._head.txt | 2 +- docs/shapes/__next._index.txt | 4 +- docs/shapes/__next._tree.txt | 6 +- docs/shapes/__next.shapes.__PAGE__.txt | 6 +- docs/shapes/__next.shapes.txt | 2 +- docs/shapes/index.html | 2 +- docs/shapes/index.txt | 8 +- next-env.d.ts | 2 +- src/components/EntityRenderer.tsx | 15 +- src/components/InteriorInstance.tsx | 4 +- src/components/JoinServerButton.tsx | 8 +- src/components/PlayerModel.tsx | 6 +- src/components/SettingsProvider.tsx | 1 - src/components/ShapeModel.tsx | 12 +- src/components/WaterBlock.tsx | 1 - 106 files changed, 1438 insertions(+), 2018 deletions(-) create mode 100644 docs/_next/static/chunks/005e475439c5cb3e.js delete mode 100644 docs/_next/static/chunks/037fbc56cebf7caa.js create mode 100644 docs/_next/static/chunks/0e2ec5f4026ef564.js delete mode 100644 docs/_next/static/chunks/14c6376ae0b23060.js delete mode 100644 docs/_next/static/chunks/164bc8495505bc95.js create mode 100644 docs/_next/static/chunks/1a6c33d7ed444b1d.js create mode 100644 docs/_next/static/chunks/1cf57947857f8eec.js create mode 100644 docs/_next/static/chunks/1db3a9d62713e989.css create mode 100644 docs/_next/static/chunks/21659079be7af0ab.js create mode 100644 docs/_next/static/chunks/22c22371d5c1dcba.js create mode 100644 docs/_next/static/chunks/273b16b21a9dcb92.js create mode 100644 docs/_next/static/chunks/28c98fb093e4695f.css create mode 100644 docs/_next/static/chunks/2afaf0aea010c2be.js create mode 100644 docs/_next/static/chunks/2c772d15a5a10e4d.js delete mode 100644 docs/_next/static/chunks/2edeeda5ca6dc680.js create mode 100644 docs/_next/static/chunks/302e494fb721f5e6.js create mode 100644 docs/_next/static/chunks/341165a5ae0d70ac.js create mode 100644 docs/_next/static/chunks/3770acf7d1a6ba0a.js create mode 100644 docs/_next/static/chunks/39402d7e86cbc15f.js rename docs/_next/static/chunks/{1a2c6dc513278881.js => 3b423df62fc674df.js} (92%) create mode 100644 docs/_next/static/chunks/3f45dfa93dd54d72.js delete mode 100644 docs/_next/static/chunks/3fc0c5e684385765.js create mode 100644 docs/_next/static/chunks/450cc5a89761fca0.js delete mode 100644 docs/_next/static/chunks/463a5d636c02e0db.js create mode 100644 docs/_next/static/chunks/4c292ca57f1d49be.js create mode 100644 docs/_next/static/chunks/4fb9edf01fb5e4f5.js delete mode 100644 docs/_next/static/chunks/534ef931e88eb989.js create mode 100644 docs/_next/static/chunks/543f866d9a9c134b.css delete mode 100644 docs/_next/static/chunks/576b06837c0cb7a0.js delete mode 100644 docs/_next/static/chunks/5b60a5e8e48bc409.js create mode 100644 docs/_next/static/chunks/5be53d01eebba2c6.js create mode 100644 docs/_next/static/chunks/66f953934e42712b.css delete mode 100644 docs/_next/static/chunks/687860f86433eb04.js create mode 100644 docs/_next/static/chunks/68bae3cf9f451a9b.js create mode 100644 docs/_next/static/chunks/6c0bdfaab43cc40b.js delete mode 100644 docs/_next/static/chunks/6f1c1038c8b3b80c.js delete mode 100644 docs/_next/static/chunks/718b5c36c0eed37e.js create mode 100644 docs/_next/static/chunks/727710e55f003daf.js create mode 100644 docs/_next/static/chunks/744d1b0edcf40c69.js delete mode 100644 docs/_next/static/chunks/818dce712bc45cb4.js delete mode 100644 docs/_next/static/chunks/82a44da545bac352.js delete mode 100644 docs/_next/static/chunks/88a5cf0ea7f16af4.js rename docs/_next/static/chunks/{b00acbf8afd8b4b6.js => 9236f2f78e6373a1.js} (75%) create mode 100644 docs/_next/static/chunks/92a585fca24d52ed.css delete mode 100644 docs/_next/static/chunks/9542fc38c512bd1a.css create mode 100644 docs/_next/static/chunks/96ae05ebba99dcff.js create mode 100644 docs/_next/static/chunks/97346c3751717c47.js create mode 100644 docs/_next/static/chunks/994d42eb1af43673.js delete mode 100644 docs/_next/static/chunks/99bc9f3ae93187f1.css create mode 100644 docs/_next/static/chunks/9a99559140e82f06.js create mode 100644 docs/_next/static/chunks/9ffe862a9787606f.css create mode 100644 docs/_next/static/chunks/a05c1cf573184d15.css delete mode 100644 docs/_next/static/chunks/a2e31798d9bc121e.css delete mode 100644 docs/_next/static/chunks/ac206141b5c1882c.js create mode 100644 docs/_next/static/chunks/acace6aadc879a08.js rename docs/_next/static/chunks/{e620039d1c837dab.css => ad52ebedad251428.css} (71%) delete mode 100644 docs/_next/static/chunks/aed6ada67562a5fc.js rename docs/_next/static/chunks/{9eaea0ae086bad69.js => af18e4f3fa33de6b.js} (57%) create mode 100644 docs/_next/static/chunks/b89dc6fc9051e9fe.js create mode 100644 docs/_next/static/chunks/bc2b324cb2101ffe.js delete mode 100644 docs/_next/static/chunks/c293826b70147a61.js delete mode 100644 docs/_next/static/chunks/ca289845e0f08110.js delete mode 100644 docs/_next/static/chunks/d16b6f1b4eacbf2b.js delete mode 100644 docs/_next/static/chunks/e16c267496b8de91.js delete mode 100644 docs/_next/static/chunks/e1a8caa90a5343cf.js create mode 100644 docs/_next/static/chunks/e27b13e203064a85.js delete mode 100644 docs/_next/static/chunks/e4a5074909f0df67.js delete mode 100644 docs/_next/static/chunks/e5617268e3c7a140.js rename docs/_next/static/chunks/{796073b9f885dcbc.js => ebf99400aa3d97c0.js} (55%) create mode 100644 docs/_next/static/chunks/fcfc8a45de71c4a4.js rename docs/_next/static/{MrEXjMpW9X_XkpwJ2-Z7S => n8myNCT_KvBz4YicTIvRW}/_buildManifest.js (100%) rename docs/_next/static/{MrEXjMpW9X_XkpwJ2-Z7S => n8myNCT_KvBz4YicTIvRW}/_clientMiddlewareManifest.json (100%) rename docs/_next/static/{MrEXjMpW9X_XkpwJ2-Z7S => n8myNCT_KvBz4YicTIvRW}/_ssgManifest.js (100%) diff --git a/docs/404.html b/docs/404.html index be6e873b..2b94f253 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index be6e873b..2b94f253 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/__next.__PAGE__.txt b/docs/__next.__PAGE__.txt index 104b2414..e9981183 100644 --- a/docs/__next.__PAGE__.txt +++ b/docs/__next.__PAGE__.txt @@ -1,11 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -3:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/ac206141b5c1882c.js","/t2-mapper/_next/static/chunks/164bc8495505bc95.js","/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/c293826b70147a61.js","/t2-mapper/_next/static/chunks/576b06837c0cb7a0.js","/t2-mapper/_next/static/chunks/534ef931e88eb989.js","/t2-mapper/_next/static/chunks/5b60a5e8e48bc409.js","/t2-mapper/_next/static/chunks/9eaea0ae086bad69.js","/t2-mapper/_next/static/chunks/037fbc56cebf7caa.js","/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","/t2-mapper/_next/static/chunks/e4a5074909f0df67.js"],"default"] +3:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/5be53d01eebba2c6.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/2afaf0aea010c2be.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/1a6c33d7ed444b1d.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/744d1b0edcf40c69.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 7:"$Sreact.suspense" -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -:HL["/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ac206141b5c1882c.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/164bc8495505bc95.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/c293826b70147a61.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/576b06837c0cb7a0.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/534ef931e88eb989.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/5b60a5e8e48bc409.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9eaea0ae086bad69.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/037fbc56cebf7caa.js","async":true}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","async":true}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/e4a5074909f0df67.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/5be53d01eebba2c6.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/2afaf0aea010c2be.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/1a6c33d7ed444b1d.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/744d1b0edcf40c69.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/docs/__next._full.txt b/docs/__next._full.txt index 4761c8c1..88f109fa 100644 --- a/docs/__next._full.txt +++ b/docs/__next._full.txt @@ -3,16 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/ac206141b5c1882c.js","/t2-mapper/_next/static/chunks/164bc8495505bc95.js","/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/c293826b70147a61.js","/t2-mapper/_next/static/chunks/576b06837c0cb7a0.js","/t2-mapper/_next/static/chunks/534ef931e88eb989.js","/t2-mapper/_next/static/chunks/5b60a5e8e48bc409.js","/t2-mapper/_next/static/chunks/9eaea0ae086bad69.js","/t2-mapper/_next/static/chunks/037fbc56cebf7caa.js","/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","/t2-mapper/_next/static/chunks/e4a5074909f0df67.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/5be53d01eebba2c6.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/2afaf0aea010c2be.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/1a6c33d7ed444b1d.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/744d1b0edcf40c69.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -:HL["/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","style"] -0:{"P":null,"b":"MrEXjMpW9X_XkpwJ2-Z7S","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ac206141b5c1882c.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/164bc8495505bc95.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/c293826b70147a61.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/576b06837c0cb7a0.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/534ef931e88eb989.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/5b60a5e8e48bc409.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9eaea0ae086bad69.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/037fbc56cebf7caa.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/e4a5074909f0df67.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"P":null,"b":"n8myNCT_KvBz4YicTIvRW","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/5be53d01eebba2c6.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/2afaf0aea010c2be.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/1a6c33d7ed444b1d.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/744d1b0edcf40c69.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/__next._head.txt b/docs/__next._head.txt index 653a1b4e..5ebe2af2 100644 --- a/docs/__next._head.txt +++ b/docs/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/__next._index.txt b/docs/__next._index.txt index 58c2cae6..7b7002dc 100644 --- a/docs/__next._index.txt +++ b/docs/__next._index.txt @@ -2,5 +2,5 @@ 2:I[12985,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js"],"NuqsAdapter"] 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/__next._tree.txt b/docs/__next._tree.txt index a98feb93..b4cdbca7 100644 --- a/docs/__next._tree.txt +++ b/docs/__next._tree.txt @@ -1,4 +1,3 @@ -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -:HL["/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_next/static/chunks/005e475439c5cb3e.js b/docs/_next/static/chunks/005e475439c5cb3e.js new file mode 100644 index 00000000..5f6c4f0b --- /dev/null +++ b/docs/_next/static/chunks/005e475439c5cb3e.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81405,(e,t,l)=>{var n;e.e,(n=function(){function e(e){return a.appendChild(e.dom),e}function t(e){for(var t=0;tr+1e3&&(c.update(1e3*o/(e-r),100),r=e,o=0,m)){var t=performance.memory;m.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:a,setMode:t}}).Panel=function(e,t,l){var n=1/0,a=0,i=Math.round,r=i(window.devicePixelRatio||1),o=80*r,c=48*r,s=3*r,m=2*r,f=3*r,d=15*r,u=74*r,h=30*r,p=document.createElement("canvas");p.width=o,p.height=c,p.style.cssText="width:80px;height:48px";var x=p.getContext("2d");return x.font="bold "+9*r+"px Helvetica,Arial,sans-serif",x.textBaseline="top",x.fillStyle=l,x.fillRect(0,0,o,c),x.fillStyle=t,x.fillText(e,s,m),x.fillRect(f,d,u,h),x.fillStyle=l,x.globalAlpha=.9,x.fillRect(f,d,u,h),{dom:p,update:function(c,b){n=Math.min(n,c),a=Math.max(a,c),x.fillStyle=l,x.globalAlpha=1,x.fillRect(0,0,o,d),x.fillStyle=t,x.fillText(i(c)+" "+e+" ("+i(n)+"-"+i(a)+")",s,m),x.drawImage(p,f+r,d,u-r,h,f,d,u-r,h),x.fillRect(f+u-r,d,r,h),x.fillStyle=l,x.globalAlpha=.9,x.fillRect(f+u-r,d,r,i((1-c/b)*h))}}},t.exports=n},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),l=e.i(932),n=e.i(71645),a=e.i(40859),a=a,i=a,r=e.i(81405);function o(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function c({showPanel:e=0,className:t,parent:l}){let c=function(e,t=[],l){let[a,i]=n.useState();return n.useLayoutEffect(()=>{let t=e();return i(t),o(void 0,t),()=>o(void 0,null)},t),a}(()=>new r.default,[]);return n.useEffect(()=>{if(c){let n=l&&l.current||document.body;c.showPanel(e),null==n||n.appendChild(c.dom);let r=(null!=t?t:"").split(" ").filter(e=>e);r.length&&c.dom.classList.add(...r);let o=(0,a.j)(()=>c.begin()),s=(0,i.k)(()=>c.end());return()=>{r.length&&c.dom.classList.remove(...r),null==n||n.removeChild(c.dom),o(),s()}}},[l,c,t,e]),null}var s=e.i(60099),m=e.i(55141);function f(){let e,a,i,r,o,f,d,u,h,p,x=(0,l.c)(10),b=(0,n.useRef)(null);return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=b.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},x[0]=e):e=x[0],(0,n.useEffect)(e),x[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(c,{className:m.default.StatsPanel}),x[1]=a):a=x[1],x[2]===Symbol.for("react.memo_cache_sentinel")?(i=[70],x[2]=i):i=x[2],x[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("axesHelper",{ref:b,args:i,renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),x[3]=r):r=x[3],x[4]===Symbol.for("react.memo_cache_sentinel")?(o=[80,0,0],x[4]=o):o=x[4],x[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(s.Html,{position:o,center:!0,children:(0,t.jsx)("span",{className:m.default.AxisLabel,"data-axis":"y",children:"Y"})}),x[5]=f):f=x[5],x[6]===Symbol.for("react.memo_cache_sentinel")?(d=[0,80,0],x[6]=d):d=x[6],x[7]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(s.Html,{position:d,center:!0,children:(0,t.jsx)("span",{className:m.default.AxisLabel,"data-axis":"z",children:"Z"})}),x[7]=u):u=x[7],x[8]===Symbol.for("react.memo_cache_sentinel")?(h=[0,0,80],x[8]=h):h=x[8],x[9]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsxs)(t.Fragment,{children:[a,r,f,u,(0,t.jsx)(s.Html,{position:h,center:!0,children:(0,t.jsx)("span",{className:m.default.AxisLabel,"data-axis":"x",children:"X"})})]}),x[9]=p):p=x[9],p}e.s(["DebugElements",()=>f],86855)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/037fbc56cebf7caa.js b/docs/_next/static/chunks/037fbc56cebf7caa.js deleted file mode 100644 index 1e79aaf9..00000000 --- a/docs/_next/static/chunks/037fbc56cebf7caa.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},32424,7368,e=>{"use strict";var t=e.i(12979);function r(){return async e=>{let r;try{r=(0,t.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let t=await fetch(r);if(!t.ok)return console.error(`Script fetch failed: ${e} (${t.status})`),null;return await t.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}}}e.s(["createScriptLoader",()=>r],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function E(e){return e}function A(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eE(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eA(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eA(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eE);return(t&&eE(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,E=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),A=i.onFocusCapture,w=W(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:E,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();A(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,E=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:E,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e5=(0,R.createContext)(void 0),e4=ec([e1,ev],[e2,eg]),e8=e4.useContext,e6=e4.useScopedContext,e9=e4.useProviderContext,e7=e4.ContextProvider,te=e4.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return A(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,E=e9();A(e=e||E,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();A(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=E,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tE=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tE(e))});var{useSyncExternalStore:tA}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=E){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tA(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tA(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&at||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":E||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tE(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();A(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),E=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e5)])?d:"option",children:t,...s,onClick:E,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();A(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;A(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e5.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t5(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t4(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t5(e,t,t=>{t4(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:E,unstable_treeSnapshotKey:A,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t5(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,A]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t5(q,t,n=>{t4(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,A]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eE]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eE,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rE(e){return e.split("-")[1]}function rA(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rA(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rE(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r5(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r5(){return!("u"rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();A(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),E=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return A(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:A=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!A?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==E;!C&&I&&O.push(...(f=rE(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===E,R),f&&(d=d.map(e=>e+"-"+f),A&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rE(l),r=rw(t=rA(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rA(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rA(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rA(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,E=rm(f[v?"top":"left"],x),A=rm(f[v?"bottom":"right"],x),w=C-h[m]-A,_=C/2-h[m]/2+(y/2-b/2),T=rh(E,rm(_,w)),M=!u.arrow&&null!=rE(i)&&_!==T&&o.reference[m]/2-(_{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rE(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,E=S,A=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(A=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(E=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?A=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):E=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:A,availableHeight:E});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,E,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(E.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,E,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,E,S,C,E,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==E?void 0:E.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,E,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();A(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nE=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nE],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nA=ec([ev],[eg]),nw=nA.useContext;nA.useScopedContext,nA.useProviderContext,nA.ContextProvider,nA.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),E=y&&c&&(m?"horizontal"!==c:"vertical"!==c),A=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(E&&!A?v:nM(v,g.rowId),l,A),l);return null==e?void 0:e.id}if(E){let e=nT(A?C:S,l);return A?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&A?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return A(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",E="[object WeakMap]",A="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[A]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[E]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eE.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eE.prototype.delete=function(e){return eP(this,e).delete(e)},eE.prototype.get=function(e){return eP(this,e).get(e)},eE.prototype.has=function(e){return eP(this,e).has(e)},eE.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eA.prototype.add=eA.prototype.push=function(e){return this.__data__.set(e,l),this},eA.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eE(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eA:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},81405,(e,t,r)=>{var n;e.e,(n=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;ta+1e3&&(u.update(1e3*l/(e-a),100),a=e,l=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){o=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,r){var n=1/0,i=0,o=Math.round,a=o(window.devicePixelRatio||1),l=80*a,u=48*a,s=3*a,c=2*a,f=3*a,d=15*a,p=74*a,m=30*a,h=document.createElement("canvas");h.width=l,h.height=u,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*a+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=r,v.fillRect(0,0,l,u),v.fillStyle=t,v.fillText(e,s,c),v.fillRect(f,d,p,m),v.fillStyle=r,v.globalAlpha=.9,v.fillRect(f,d,p,m),{dom:h,update:function(u,g){n=Math.min(n,u),i=Math.max(i,u),v.fillStyle=r,v.globalAlpha=1,v.fillRect(0,0,l,d),v.fillStyle=t,v.fillText(o(u)+" "+e+" ("+o(n)+"-"+o(i)+")",s,c),v.drawImage(h,f+a,d,p-a,m,f,d,p-a,m),v.fillRect(f+p-a,d,a,m),v.fillStyle=r,v.globalAlpha=.9,v.fillRect(f+p-a,d,a,o((1-u/g)*m))}}},t.exports=n},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),r=e.i(932),n=e.i(71645),i=e.i(40859),i=i,o=i,a=e.i(81405);function l(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function u({showPanel:e=0,className:t,parent:r}){let u=function(e,t=[],r){let[i,o]=n.useState();return n.useLayoutEffect(()=>{let t=e();return o(t),l(void 0,t),()=>l(void 0,null)},t),i}(()=>new a.default,[]);return n.useEffect(()=>{if(u){let n=r&&r.current||document.body;u.showPanel(e),null==n||n.appendChild(u.dom);let a=(null!=t?t:"").split(" ").filter(e=>e);a.length&&u.dom.classList.add(...a);let l=(0,i.j)(()=>u.begin()),s=(0,o.k)(()=>u.end());return()=>{a.length&&u.dom.classList.remove(...a),null==n||n.removeChild(u.dom),l(),s()}}},[r,u,t,e]),null}var s=e.i(60099),c=e.i(79123),f=e.i(55141);function d(){let e,i,o=(0,r.c)(3),{debugMode:a}=(0,c.useDebug)(),l=(0,n.useRef)(null);return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=l.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},o[0]=e):e=o[0],(0,n.useEffect)(e),o[1]!==a?(i=a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{className:f.default.StatsPanel}),(0,t.jsx)("axesHelper",{ref:l,args:[70],renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,t.jsx)(s.Html,{position:[80,0,0],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"y",children:"Y"})}),(0,t.jsx)(s.Html,{position:[0,80,0],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"z",children:"Z"})}),(0,t.jsx)(s.Html,{position:[0,0,80],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"x",children:"X"})})]}):null,o[1]=a,o[2]=i):i=o[2],i}e.s(["DebugElements",()=>d],86855)},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),E=x.searchParams,A=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,E??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,E),Object.keys(A.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,E,_,A.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:E,queuedQueries:_,queryRef:A.current,stateRef:R.current}),R.current=t,M(t)),A.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?E?.getAll(r):E?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,E,_,A.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:E,queuedQueries:_,queryRef:A.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${E?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},A.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,E=!1,A=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);bt(e),E?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/0e2ec5f4026ef564.js b/docs/_next/static/chunks/0e2ec5f4026ef564.js new file mode 100644 index 00000000..45dc1ba6 --- /dev/null +++ b/docs/_next/static/chunks/0e2ec5f4026ef564.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(25645),c=e.i(12979),a=e.i(51434),s=e.i(79123),l=e.i(89887),f=e.i(58647);let d=(0,u.createLogger)("AudioEmitter"),p=new Map,m=new Map;function h(e,t=1){m.set(e,t)}function y(e){m.delete(e)}let g=0;function D(){return g}function R(){for(let[e]of(g++,m)){try{e.stop()}catch{}try{e.disconnect()}catch{}}m.clear()}function v(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,c=u?.is3D??!0,a=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function M(e,t,r,n,o){let u;try{u=(0,c.audioToUrl)(e.filename)}catch{return}let a=f.engineStore.getState().playback.rate,s=g;T(u,r,r=>{if(s===g)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(a),n&&u.position.copy(n),o.add(u),m.set(u,1),u.play(),u.source.onended=()=>{m.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),m.set(n,1),n.play(),n.source.onended=()=>{m.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function T(e,t,r){p.has(e)?r(p.get(e)):t.load(e,t=>{p.set(e,t),r(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}f.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of m)try{t.setPlaybackRate(r*e)}catch{}});let b=(0,r.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,p=e.audioMinDistance??1,m=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,D=e.audioIsLooping??!0,[R,v,M]=e.position??[0,0,0],b=(0,n.useThree)(e=>e.scene),x=(0,n.useThree)(e=>e.camera),{audioLoader:A,audioListener:S}=(0,a.useAudio)(),{audioEnabled:w}=(0,s.useSettings)(),P=(0,r.useRef)(null),k=(0,r.useRef)(null),B=(0,r.useRef)(null),L=(0,r.useRef)(!1),V=(0,r.useRef)(!1),j=(0,r.useRef)(new i.Vector3(R,v,M)),E=(0,r.useRef)(0),F=()=>{null!=k.current&&(clearTimeout(k.current),k.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)};(0,r.useEffect)(()=>{let e;if(A&&S){if(E.current++,g){let t=new i.PositionalAudio(S);t.position.copy(j.current),t.setDistanceModel("inverse"),t.setRefDistance(p),t.setMaxDistance(m),t.setRolloffFactor(1),t.setVolume(d),e=t,b.add(e)}else(e=new i.Audio(S)).setVolume(d);return P.current=e,()=>{F();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&b.remove(e),P.current=null,L.current=!1,V.current=!1}}},[A,S,g,p,m,d,b]);let C=(e,t)=>{if(D)if(h>0||y>0){let r=Math.max(0,h),n=Math.max(r,y),o=r===n?r:Math.random()*(n-r)+r;e.loop=!1;let i=()=>{t===E.current&&(!1===e.isPlaying?k.current=setTimeout(()=>{if(t===E.current)try{e.play(),C(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},G=e=>{if(!A)return;let t=E.current;if(L.current)try{e.isPlaying||(e.play(),C(e,t))}catch{}else{let r;try{r=(0,c.audioToUrl)(f)}catch{return}T(r,A,r=>{if(t===E.current&&!e.buffer){e.setBuffer(r),L.current=!0;try{e.play(),C(e,t)}catch{}}})}};return(0,r.useEffect)(()=>{let e=P.current;e&&!g&&w&&f&&G(e)},[w,g,f,A,S]),(0,o.useFrame)(()=>{let e=P.current;if(!e||!g||!w||!f)return;let t=x.position.distanceTo(j.current),r=V.current,n=t<=m;if(n&&!r)V.current=!0,G(e);else if(!n&&r){V.current=!1,F();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=P.current;if(e&&!w){F();try{e.stop()}catch{}V.current=!1}},[w]),u?(0,t.jsxs)("mesh",{position:j.current,children:[(0,t.jsx)("sphereGeometry",{args:[p,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(l.FloatingLabel,{color:"#00ff00",position:[0,p+1,0],children:f})]}):null});e.s(["AudioEmitter",0,b,"audioBufferCache",0,p,"getCachedAudioBuffer",()=>T,"getSoundGeneration",()=>D,"playOneShotSound",()=>M,"resolveAudioProfile",()=>v,"stopAllTrackedSounds",()=>R,"trackSound",()=>h,"untrackSound",()=>y])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/14c6376ae0b23060.js b/docs/_next/static/chunks/14c6376ae0b23060.js deleted file mode 100644 index 0dd685eb..00000000 --- a/docs/_next/static/chunks/14c6376ae0b23060.js +++ /dev/null @@ -1,38 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,60099,e=>{"use strict";let t,n;var r=e.i(43476),i=e.i(932),s=e.i(71645),a=e.i(90072),o=e.i(71753),l=e.i(31067),c=e.i(88014),u=e.i(15080);let d=new a.Vector3,m=new a.Vector3,f=new a.Vector3,p=new a.Vector2;function y(e,t,n){let r=d.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,s=n.height/2;return[r.x*i+i,-(r.y*s)+s]}let h=e=>1e-10>Math.abs(e)?0:e;function v(e,t,n=""){let r="matrix3d(";for(let n=0;16!==n;n++)r+=h(t[n]*e.elements[n])+(15!==n?",":")");return n+r}let b=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>v(e,t)),g=(n=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>v(e,n(t),"translate(-50%,-50%)")),E=s.forwardRef(({children:e,eps:t=.001,style:n,className:r,prepend:i,center:v,fullscreen:E,portal:S,distanceFactor:x,sprite:M=!1,transform:w=!1,occlude:k,onOcclude:j,castShadow:P,receiveShadow:W,material:_,geometry:I,zIndexRange:R=[0x1000037,0],calculatePosition:T=y,as:N="div",wrapperClass:B,pointerEvents:A="auto",...V},F)=>{let{gl:C,camera:O,scene:$,size:z,raycaster:L,events:D,viewport:q}=(0,u.useThree)(),[H]=s.useState(()=>document.createElement(N)),U=s.useRef(null),G=s.useRef(null),K=s.useRef(0),Y=s.useRef([0,0]),Z=s.useRef(null),J=s.useRef(null),Q=(null==S?void 0:S.current)||D.connected||C.domElement.parentNode,X=s.useRef(null),ee=s.useRef(!1),et=s.useMemo(()=>{var e;return k&&"blending"!==k||Array.isArray(k)&&k.length&&(e=k[0])&&"object"==typeof e&&"current"in e},[k]);s.useLayoutEffect(()=>{let e=C.domElement;k&&"blending"===k?(e.style.zIndex=`${Math.floor(R[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[k]),s.useLayoutEffect(()=>{if(G.current){let e=U.current=c.createRoot(H);if($.updateMatrixWorld(),w)H.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=T(G.current,O,z);H.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Q&&(i?Q.prepend(H):Q.appendChild(H)),()=>{Q&&Q.removeChild(H),e.unmount()}}},[Q,w]),s.useLayoutEffect(()=>{B&&(H.className=B)},[B]);let en=s.useMemo(()=>w?{position:"absolute",top:0,left:0,width:z.width,height:z.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:v?"translate3d(-50%,-50%,0)":"none",...E&&{top:-z.height/2,left:-z.width/2,width:z.width,height:z.height},...n},[n,v,E,z,w]),er=s.useMemo(()=>({position:"absolute",pointerEvents:A}),[A]);s.useLayoutEffect(()=>{var t,i;ee.current=!1,w?null==(t=U.current)||t.render(s.createElement("div",{ref:Z,style:en},s.createElement("div",{ref:J,style:er},s.createElement("div",{ref:F,className:r,style:n,children:e})))):null==(i=U.current)||i.render(s.createElement("div",{ref:F,style:en,className:r,children:e}))});let ei=s.useRef(!0);(0,o.useFrame)(e=>{if(G.current){O.updateMatrixWorld(),G.current.updateWorldMatrix(!0,!1);let e=w?Y.current:T(G.current,O,z);if(w||Math.abs(K.current-O.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var n;let t,r,i,s,o=(n=G.current,t=d.setFromMatrixPosition(n.matrixWorld),r=m.setFromMatrixPosition(O.matrixWorld),i=t.sub(r),s=O.getWorldDirection(f),i.angleTo(s)>Math.PI/2),l=!1;et&&(Array.isArray(k)?l=k.map(e=>e.current):"blending"!==k&&(l=[$]));let c=ei.current;l?ei.current=function(e,t,n,r){let i=d.setFromMatrixPosition(e.matrixWorld),s=i.clone();s.project(t),p.set(s.x,s.y),n.setFromCamera(p,t);let a=n.intersectObjects(r,!0);if(a.length){let e=a[0].distance;return i.distanceTo(n.ray.origin)({vertexShader:w?void 0:` - /* - This shader is from the THREE's SpriteMaterial. - We need to turn the backing plane into a Sprite - (make it always face the camera) if "transfrom" - is false. - */ - #include - - void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - // This is somewhat arbitrary, but it seems to work well - // Need to figure out how to derive this dynamically if it even matters - float size = 0.03; - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; - } - `,fragmentShader:` - void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - } - `}),[w]);return s.createElement("group",(0,l.default)({},V,{ref:G}),k&&!et&&s.createElement("mesh",{castShadow:P,receiveShadow:W,ref:X},I||s.createElement("planeGeometry",null),_||s.createElement("shaderMaterial",{side:a.DoubleSide,vertexShader:es.vertexShader,fragmentShader:es.fragmentShader})))});e.s(["Html",()=>E],60099);var S=e.i(67191);let x=[0,0,0],M=new a.Vector3,w=(0,s.memo)(function(e){let t,n,a,l=(0,i.c)(11),{children:c,color:u,position:d,opacity:m}=e,f=void 0===u?"white":u,p=void 0===d?x:d,y=void 0===m?"fadeWithDistance":m,h="fadeWithDistance"===y,v=(0,s.useRef)(null),[b,g]=(0,s.useState)(0!==y),w=(0,s.useRef)(null);return l[0]!==h||l[1]!==b||l[2]!==y?(t=e=>{var t,n,r;let i,{camera:s}=e,a=v.current;if(!a)return;a.getWorldPosition(M);let o=(t=M.x,n=M.y,r=M.z,-((t-(i=s.matrixWorld.elements)[12])*i[8])+-((n-i[13])*i[9])+-((r-i[14])*i[10])<0);if(h){let e=o?1/0:s.position.distanceTo(M),t=e<200;if(b!==t&&g(t),w.current&&t){let t=Math.max(0,Math.min(1,1-e/200));w.current.style.opacity=t.toString()}}else{let e=!o&&0!==y;b!==e&&g(e),w.current&&(w.current.style.opacity=y.toString())}},l[0]=h,l[1]=b,l[2]=y,l[3]=t):t=l[3],(0,o.useFrame)(t),l[4]!==c||l[5]!==f||l[6]!==b||l[7]!==p?(n=b?(0,r.jsx)(E,{position:p,center:!0,children:(0,r.jsx)("div",{ref:w,className:S.default.Label,style:{color:f},children:c})}):null,l[4]=c,l[5]=f,l[6]=b,l[7]=p,l[8]=n):n=l[8],l[9]!==n?(a=(0,r.jsx)("group",{ref:v,children:n}),l[9]=n,l[10]=a):a=l[10],a});e.s(["FloatingLabel",0,w],89887)},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},79474,(e,t,n)=>{"use strict";var r=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;n.c=function(e){return r.H.useMemoCache(e)}},932,(e,t,n)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,n)=>{"use strict";var r=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,a=r.useEffect,o=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var u="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,n)=>{"use strict";var r=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useSyncExternalStore,o=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=o(null);if(null===d.current){var m={hasValue:!1,value:null};d.current=m}else m=d.current;var f=a(e,(d=c(function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==i&&m.hasValue){var t=m.value;if(i(t,e))return o=t}return o=e}if(t=o,s(a,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(a=e,t):(a=e,o=n)}var a,o,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,i]))[0],d[1]);return l(function(){m.hasValue=!0,m.value=f},[f]),u(f),f}},30224,(e,t,n)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),n=e.i(30224);let r=e=>{let t,n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(r,i,s);return s},i=e=>e?r(e):r;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=n.default,a=e=>e;function o(e,n=a,r){let i=s(e.subscribe,e.getState,e.getInitialState,n,r);return t.default.useDebugValue(i),i}let l=(e,t)=>{let n=i(e),r=(e,r=t)=>o(n,e,r);return Object.assign(r,n),r},c=(e,t)=>e?l(e,t):l;e.s(["createWithEqualityFn",()=>c,"useStoreWithEqualityFn",()=>o],66748)},58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let n=e=>(t,n,r)=>{let i=r.subscribe;return r.subscribe=(e,t,n)=>{let s=e;if(t){let i=(null==n?void 0:n.equalityFn)||Object.is,a=e(r.getState());s=n=>{let r=e(n);if(!i(a,r)){let e=a;t(a=r,e)}},(null==n?void 0:n.fireImmediately)&&t(a,a)}return i(s)},e(t,n,r)};e.s(["subscribeWithSelector",()=>n],79473);var r=e.i(66748);function i(e){let t=new Map;for(let n of e.state.datablocks.values()){if("tsshapeconstructor"!==n._class)continue;let e=n.baseshape;if("string"!=typeof e)continue;let r=e.toLowerCase(),i=r.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=n[`sequence${e}`];if("string"!=typeof t)continue;let r=t.indexOf(" ");if(-1===r)continue;let a=t.slice(0,r).toLowerCase(),o=t.slice(r+1).trim().toLowerCase();if(!o||!a.startsWith(i)||!a.endsWith(".dsq"))continue;let l=a.slice(i.length,-4);l&&s.set(o,l)}s.size>0&&t.set(r,s)}return t}function s(e,t,n){let r=new Map;for(let n of e){let e=t.clipAction(n);r.set(n.name.toLowerCase(),e)}if(n)for(let[e,t]of n){let n=r.get(t);n&&!r.has(e)&&r.set(e,n)}return r}function a(e){return e.toLowerCase()}function o(e){let t=a(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let l={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},c=(0,t.createStore)()(n(e=>({...l,setRuntime(t){let n=function(e){let t={},n={},r={},i={};for(let n of e.state.objectsById.values())t[n._id]=0,n._name&&(r[a(n._name)]=n._id,n._isDatablock&&(i[a(n._name)]=n._id));for(let t of e.state.globals.keys())n[o(t)]=0;return{objectVersionById:t,globalVersionByName:n,objectIdsByName:r,datablockIdsByName:i}}(t),r=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:r,objectVersionById:n.objectVersionById,globalVersionByName:n.globalVersionByName,objectIdsByName:n.objectIdsByName,datablockIdsByName:n.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,n){0!==t.length&&e(e=>{let r={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},l={...e.runtime.datablockIdsByName},c=e=>{null!=e&&(r[e]=(r[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(c(e.objectId),t._name){let n=a(t._name);s[n]=e.objectId,t._isDatablock&&(l[n]=e.objectId)}c(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete r[e.objectId],t?._name){let e=a(t._name);delete s[e],t._isDatablock&&delete l[e]}c(t?._parent?._id);continue}if("field.changed"===e.type){c(e.objectId);continue}if("global.changed"===e.type){let t=o(e.name);i[t]=(i[t]??0)+1;continue}}let u=n?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:r,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:l,lastRuntimeTick:u}}})},setRecording(t){let n=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:"stopped",timeMs:0,rate:1,durationMs:n,streamSnapshot:null}}))},setPlaybackTime(t){e(e=>{var n,r,i;let s=(n=t,r=0,i=e.playback.durationMs,n<0?0:n>i?i:n);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var n,r,i;let s=Number.isFinite(t)?(r=.01,i=16,(n=t)<.01?.01:n>16?16:n):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),u=0;function d(){return u}function m(e,t){u+=e*t*1e3}function f(){return c}function p(e,t){return(0,r.useStoreWithEqualityFn)(c,e,t)}c.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(u=0)}),e.s(["advanceEffectClock",()=>m,"effectNow",()=>d,"engineStore",0,c,"useEngineSelector",()=>p,"useEngineStoreApi",()=>f],58647)},13876,77964,92224,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.i(58647),e.s(["isSceneEntity",()=>t],77964),e.i(932);var n=e.i(8155),r=e.i(66748);let i=(0,n.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,version:0,setEntity(t){e(e=>{let n=new Map(e.missionEntities);return n.set(t.id,t),{missionEntities:n,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let n=new Map(e.missionEntities);return n.delete(t),{missionEntities:n,version:e.version+1}})},setEntities(t){e(e=>{let n=new Map(e.missionEntities);for(let e of t)n.set(e.id,e);return{missionEntities:n,version:e.version+1}})},setAllEntities(t){e(()=>{let e=new Map;for(let n of t)e.set(n.id,n);return{missionEntities:e}})},clearEntities(){e(e=>0===e.missionEntities.size?e:{missionEntities:new Map,version:e.version+1})},beginStreaming(){e(e=>e.isStreaming?e:{isStreaming:!0,streamEntities:new Map,version:e.version+1})},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let n=new Map(e.streamEntities);return n.set(t.id,t),{streamEntities:n,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let n=new Map(e.streamEntities);return n.delete(t),{streamEntities:n,version:e.version+1}})},setStreamEntities(t){e(e=>{let n=new Map(e.streamEntities);for(let e of t)n.set(e.id,e);return{streamEntities:n,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let n=e.streamEntities,r=new Map;for(let e of t)r.set(e.id,e);return r.size===n.size&&[...r.keys()].every(e=>n.has(e))?e:{streamEntities:r,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function s(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,n=[];for(let e of t.values())"None"!==e.renderType&&n.push(e);return n}function a(e,t){if(e.length!==t.length)return!1;for(let n=0;no,"useSceneSky",()=>u,"useSceneSun",()=>d],92224),e.s([],13876)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/164bc8495505bc95.js b/docs/_next/static/chunks/164bc8495505bc95.js deleted file mode 100644 index fa59aa5f..00000000 --- a/docs/_next/static/chunks/164bc8495505bc95.js +++ /dev/null @@ -1,174 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},19273,80166,e=>{"use strict";e.i(47167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>i,"timeoutManager",()=>r],80166);var s="u"=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:i,fetchStatus:s,predicate:n,queryKey:a,stale:o}=e;if(a){if(i){if(t.queryHash!==d(a,t.options))return!1}else if(!v(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!n||!!n(t))}function f(e,t){let{exact:r,status:i,predicate:s,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(n))return!1}else if(!v(t.options.mutationKey,n))return!1}return(!i||t.state.status===i)&&(!s||!!s(t))}function d(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function v(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>v(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function T(e){return new Promise(t=>{r.setTimeout(t,e)})}function O(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let s=y(t)&&y(r);if(!s&&!(b(t)&&b(r)))return r;let n=(s?t:Object.keys(t)).length,a=s?r:Object.keys(r),o=a.length,u=s?Array(o):{},l=0;for(let c=0;cr?i.slice(1):i}function R(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var E=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==E?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function w(e,t){return"function"==typeof e?e(...t):!!e}function D(e,t,r){let i,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}e.s(["addConsumeAwareSignal",()=>D,"addToEnd",()=>F,"addToStart",()=>R,"ensureQueryFn",()=>C,"functionalUpdate",()=>a,"hashKey",()=>p,"hashQueryKeyByOptions",()=>d,"isServer",()=>s,"isValidTimeout",()=>o,"matchMutation",()=>f,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>v,"replaceData",()=>O,"resolveEnabled",()=>c,"resolveStaleTime",()=>l,"shallowEqualObjects",()=>g,"shouldThrowError",()=>w,"skipToken",()=>E,"sleep",()=>T,"timeUntilStale",()=>u],19273)},75555,e=>{"use strict";var t=e.i(15823),r=e.i(19273),i=new class extends t.Subscribable{#r;#i;#s;constructor(){super(),this.#s=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>i])},40143,e=>{"use strict";let t,r,i,s,n,a;var o=e.i(80166).systemSetTimeoutZero,u=(t=[],r=0,i=e=>{e()},s=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{i(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>u])},86491,14448,93803,36553,88587,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),i=e.i(75555),s=e.i(15823),n=new class extends s.Subscribable{#n=!0;#i;#s;constructor(){super(),this.#s=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function a(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function o(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||n.isOnline()}e.s(["onlineManager",()=>n],14448),e.s(["pendingThenable",()=>a],93803);var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,s=!1,c=0,h=a(),f=()=>i.focusManager.isFocused()&&("always"===e.networkMode||n.isOnline())&&e.canRun(),d=()=>u(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},v=e=>{"pending"===h.status&&(r?.(),h.reject(e))},m=()=>new Promise(t=>{r=e=>{("pending"!==h.status||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),g=()=>{let r;if("pending"!==h.status)return;let i=0===c?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(p).catch(r=>{if("pending"!==h.status)return;let i=e.retry??3*!t.isServer,n=e.retryDelay??o,a="function"==typeof n?n(c,r):n,u=!0===i||"number"==typeof i&&cf()?void 0:m()).then(()=>{s?v(r):g()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new l(t);v(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:d,start:()=>(d()?g():m().then(g),h)}}e.s(["CancelledError",()=>l,"canFetch",()=>u,"createRetryer",()=>c],36553);var h=e.i(80166),f=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>f],88587);var d=class extends f{#o;#u;#l;#c;#h;#f;#d;constructor(e){super(),this.#d=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#l=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=m(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=m(this.options);void 0!==e.data&&(this.setState(v(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#d?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,r){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,s.signal)})},a=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),s=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#d=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},o=(n(i={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),i);this.options.behavior?.onFetch(o,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#p({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof l&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof l){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#l.config.onError?.(e,this),this.#l.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...v(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function v(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function m(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>d,"fetchState",()=>p],86491)},69230,e=>{"use strict";var t=e.i(75555),r=e.i(40143),i=e.i(86491),s=e.i(15823),n=e.i(93803),a=e.i(19273),o=e.i(80166),u=class extends s.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#v=null,this.#m=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#y=void 0;#b=void 0;#S;#T;#m;#v;#O;#F;#R;#E;#C;#w;#D=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),l(this.#g,this.options)?this.#I():this.updateResult(),this.#U())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#P(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,a.resolveEnabled)(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#M(),this.#g.setOptions(this.options),t._defaulted&&!(0,a.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let i=this.hasListeners();i&&h(this.#g,r,this.options,t)&&this.#I(),this.updateResult(),i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||(0,a.resolveStaleTime)(this.options.staleTime,this.#g)!==(0,a.resolveStaleTime)(t.staleTime,this.#g))&&this.#_();let s=this.#Q();i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||s!==this.#w)&&this.#k(s)}getOptimisticResult(e){var t,r;let i=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(i,e);return t=this,r=s,(0,a.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=s,this.#T=this.options,this.#S=this.#g.state),s}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#m.status||this.#m.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#D.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#I({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#I(e){this.#M();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(a.noop)),t}#_(){this.#x();let e=(0,a.resolveStaleTime)(this.options.staleTime,this.#g);if(a.isServer||this.#b.isStale||!(0,a.isValidTimeout)(e))return;let t=(0,a.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#E=o.timeoutManager.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#k(e){this.#P(),this.#w=e,!a.isServer&&!1!==(0,a.resolveEnabled)(this.options.enabled,this.#g)&&(0,a.isValidTimeout)(this.#w)&&0!==this.#w&&(this.#C=o.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||t.focusManager.isFocused())&&this.#I()},this.#w))}#U(){this.#_(),this.#k(this.#Q())}#x(){this.#E&&(o.timeoutManager.clearTimeout(this.#E),this.#E=void 0)}#P(){this.#C&&(o.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let r,s=this.#g,o=this.options,u=this.#b,c=this.#S,d=this.#T,p=e!==s?e.state:this.#y,{state:v}=e,m={...v},g=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&l(e,t),a=r&&h(e,s,t,o);(n||a)&&(m={...m,...(0,i.fetchState)(v.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=m;r=m.data;let T=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===S){let e;u?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=u.data,T=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#R?.state.data,this.#R):t.placeholderData,void 0!==e&&(S="success",r=(0,a.replaceData)(u?.data,e,t),g=!0)}if(t.select&&void 0!==r&&!T)if(u&&r===c?.data&&t.select===this.#O)r=this.#F;else try{this.#O=t.select,r=t.select(r),r=(0,a.replaceData)(u?.data,r,t),this.#F=r,this.#v=null}catch(e){this.#v=e}this.#v&&(y=this.#v,r=this.#F,b=Date.now(),S="error");let O="fetching"===m.fetchStatus,F="pending"===S,R="error"===S,E=F&&O,C=void 0!==r,w={status:S,fetchStatus:m.fetchStatus,isPending:F,isSuccess:"success"===S,isError:R,isInitialLoading:E,isLoading:E,data:r,dataUpdatedAt:m.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>p.dataUpdateCount||m.errorUpdateCount>p.errorUpdateCount,isFetching:O,isRefetching:O&&!F,isLoadingError:R&&!C,isPaused:"paused"===m.fetchStatus,isPlaceholderData:g,isRefetchError:R&&C,isStale:f(e,t),refetch:this.refetch,promise:this.#m,isEnabled:!1!==(0,a.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,r="error"===w.status&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{i(this.#m=w.promise=(0,n.pendingThenable)())},o=this.#m;switch(o.status){case"pending":e.queryHash===s.queryHash&&i(o);break;case"fulfilled":(r||w.data!==o.value)&&a();break;case"rejected":r&&w.error===o.reason||a()}}return w}updateResult(){let e=this.#b,t=this.createResult(this.#g,this.options);if(this.#S=this.#g.state,this.#T=this.options,void 0!==this.#S.data&&(this.#R=this.#g),(0,a.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#D.size)return!0;let i=new Set(r??this.#D);return this.options.throwOnError&&i.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&i.has(t))};this.#L({listeners:r()})}#M(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#U()}#L(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function l(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,a.resolveEnabled)(t.enabled,e)&&"static"!==(0,a.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&f(e,t)}return!1}function h(e,t,r,i){return(e!==t||!1===(0,a.resolveEnabled)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&f(e,r)}function f(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",()=>u])},12598,e=>{"use strict";var t=e.i(71645),r=e.i(43476),i=t.createContext(void 0),s=e=>{let r=t.useContext(i);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},n=({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(i.Provider,{value:e,children:s}));e.s(["QueryClientProvider",()=>n,"useQueryClient",()=>s])},69637,54440,e=>{"use strict";let t;e.i(47167);var r=e.i(71645),i=e.i(19273),s=e.i(40143),n=e.i(12598);e.i(43476);var a=r.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),o=r.createContext(!1);o.Provider;var u=(e,t)=>void 0===t.state.data,l=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},c=(e,t)=>e.isLoading&&e.isFetching&&!t,h=(e,t)=>e?.suspense&&t.isPending,f=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function d(e,t,u){let d,p=r.useContext(o),v=r.useContext(a),m=(0,n.useQueryClient)(u),g=m.defaultQueryOptions(e);m.getDefaultOptions().queries?._experimental_beforeQuery?.(g);let y=m.getQueryCache().get(g.queryHash);g._optimisticResults=p?"isRestoring":"optimistic",l(g),d=y?.state.error&&"function"==typeof g.throwOnError?(0,i.shouldThrowError)(g.throwOnError,[y.state.error,y]):g.throwOnError,(g.suspense||g.experimental_prefetchInRender||d)&&!v.isReset()&&(g.retryOnMount=!1),r.useEffect(()=>{v.clearReset()},[v]);let b=!m.getQueryCache().get(g.queryHash),[S]=r.useState(()=>new t(m,g)),T=S.getOptimisticResult(g),O=!p&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{let t=O?S.subscribe(s.notifyManager.batchCalls(e)):i.noop;return S.updateResult(),t},[S,O]),()=>S.getCurrentResult(),()=>S.getCurrentResult()),r.useEffect(()=>{S.setOptions(g)},[g,S]),h(g,T))throw f(g,S,v);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||(0,i.shouldThrowError)(r,[e.error,s])))({result:T,errorResetBoundary:v,throwOnError:g.throwOnError,query:y,suspense:g.suspense}))throw T.error;if(m.getDefaultOptions().queries?._experimental_afterQuery?.(g,T),g.experimental_prefetchInRender&&!i.isServer&&c(T,p)){let e=b?f(g,S,v):y?.promise;e?.catch(i.noop).finally(()=>{S.updateResult()})}return g.notifyOnChangeProps?T:S.trackResult(T)}e.s(["defaultThrowOnError",()=>u,"ensureSuspenseTimers",()=>l,"fetchOptimistic",()=>f,"shouldSuspend",()=>h,"willFetch",()=>c],54440),e.s(["useBaseQuery",()=>d],69637)},51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(71753);let s=(0,r.createContext)(null);function n({children:e}){let n=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,i.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,n.current)for(let e of n.current)e(o.current)});let u=(0,r.useCallback)(e=>(n.current??=new Set,n.current.add(e),()=>{n.current.delete(e)}),[]),l=(0,r.useCallback)(()=>o.current,[]),c=(0,r.useMemo)(()=>({subscribe:u,getTick:l}),[u,l]);return(0,t.jsx)(s.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(s);if(!t)throw Error("useTick must be used within a TickProvider");let i=(0,r.useRef)(e);i.current=e,(0,r.useEffect)(()=>t.subscribe(e=>i.current(e)),[t])}e.s(["TICK_RATE",0,32,"TickProvider",()=>n,"useTick",()=>a])},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),u=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(u)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(u)?e=u:u instanceof r.Texture?e=[u]:n(u)&&(e=Object.values(u)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,u]),(0,t.useMemo)(()=>{if(!n(e))return u;{let t={},r=0;for(let i in e)t[i]=u[r++];return t}},[e,u])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=16,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a])},47021,e=>{"use strict";var t=e.i(8560);let r=` -#ifdef USE_FOG - // Check fog enabled uniform - allows toggling without shader recompilation - #ifdef USE_VOLUMETRIC_FOG - if (!fogEnabled) { - // Skip all fog calculations when disabled - } else { - #endif - - float dist = vFogDepth; - - // Discard fragments at or beyond visible distance - matches Torque's behavior - // where objects beyond visibleDistance are not rendered at all. - // This prevents fully-fogged geometry from showing as silhouettes against - // the sky's fog-to-sky gradient. - if (dist >= fogFar) { - discard; - } - - // Step 1: Calculate distance-based haze (quadratic falloff) - // Since we discard at fogFar, haze never reaches 1.0 here - float haze = 0.0; - if (dist > fogNear) { - float fogScale = 1.0 / (fogFar - fogNear); - float distFactor = (dist - fogNear) * fogScale - 1.0; - haze = 1.0 - distFactor * distFactor; - } - - // Step 2: Calculate fog volume contributions - // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) - // All fog uses the global fogColor - see Tribes2_Fog_System.md for details - float volumeFog = 0.0; - - #ifdef USE_VOLUMETRIC_FOG - { - #ifdef USE_FOG_WORLD_POSITION - float fragmentHeight = vFogWorldPosition.y; - #else - float fragmentHeight = cameraHeight; - #endif - - float deltaY = fragmentHeight - cameraHeight; - float absDeltaY = abs(deltaY); - - // Determine if we're going up (positive) or down (negative) - if (absDeltaY > 0.01) { - // Non-horizontal ray: ray-march through fog volumes - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - // Skip inactive volumes (visibleDistance = 0) - if (volVisDist <= 0.0) continue; - - // Calculate fog factor for this volume - // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage - // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) - // Since we don't have quality settings, we use visFactor = 1.0 - float factor = (1.0 / volVisDist) * volPct; - - // Find ray intersection with this volume's height range - float rayMinY = min(cameraHeight, fragmentHeight); - float rayMaxY = max(cameraHeight, fragmentHeight); - - // Check if ray intersects volume height range - if (rayMinY < volMaxH && rayMaxY > volMinH) { - float intersectMin = max(rayMinY, volMinH); - float intersectMax = min(rayMaxY, volMaxH); - float intersectHeight = intersectMax - intersectMin; - - // Calculate distance traveled through this volume using similar triangles: - // subDist / dist = intersectHeight / absDeltaY - float subDist = dist * (intersectHeight / absDeltaY); - - // Accumulate fog: fog += subDist * factor - volumeFog += subDist * factor; - } - } - } else { - // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // If camera is inside this volume, apply fog for full distance - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float factor = (1.0 / volVisDist) * volPct; - volumeFog += dist * factor; - } - } - } - } - #endif - - // Step 3: Combine haze and volume fog - // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct - // This gives fog volumes priority over haze - float volPct = min(volumeFog, 1.0); - float hazePct = haze; - if (volPct + hazePct > 1.0) { - hazePct = 1.0 - volPct; - } - float fogFactor = hazePct + volPct; - - // Apply fog using global fogColor (per-volume colors not used in Tribes 2) - gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); - - #ifdef USE_VOLUMETRIC_FOG - } // end fogEnabled check - #endif -#endif -`;function i(){t.ShaderChunk.fog_pars_fragment=` -#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif - - // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) - // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats - #ifdef USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - #endif - - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_fragment=r,t.ShaderChunk.fog_pars_vertex=` -#ifdef USE_FOG - varying float vFogDepth; - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_vertex=` -#ifdef USE_FOG - // Use Euclidean distance from camera, not view-space z-depth - // This ensures fog doesn't change when rotating the camera - vFogDepth = length(mvPosition.xyz); - #ifdef USE_FOG_WORLD_POSITION - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; - #endif -#endif -`}function s(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_FOG_WORLD_POSITION - #define USE_VOLUMETRIC_FOG - varying vec3 vFogWorldPosition; -#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - uniform bool fogEnabled; - #define USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1a6c33d7ed444b1d.js b/docs/_next/static/chunks/1a6c33d7ed444b1d.js new file mode 100644 index 00000000..b4c41526 --- /dev/null +++ b/docs/_next/static/chunks/1a6c33d7ed444b1d.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76775,(e,t,a)=>{function r(e,t,a,r){return Math.round(e/a)+" "+r+(t>=1.5*a?"s":"")}t.exports=function(e,t){t=t||{};var a,i,n,o,s=typeof e;if("string"===s&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var c=parseFloat(d[1]);switch((d[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===s&&isFinite(e)){return t.long?(i=Math.abs(a=e))>=864e5?r(a,i,864e5,"day"):i>=36e5?r(a,i,36e5,"hour"):i>=6e4?r(a,i,6e4,"minute"):i>=1e3?r(a,i,1e3,"second"):a+" ms":(o=Math.abs(n=e))>=864e5?Math.round(n/864e5)+"d":o>=36e5?Math.round(n/36e5)+"h":o>=6e4?Math.round(n/6e4)+"m":o>=1e3?Math.round(n/1e3)+"s":n+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},7003,(e,t,a)=>{t.exports=function(t){function a(e){let t,i,n,o=null;function s(...e){if(!s.enabled)return;let r=Number(new Date);s.diff=r-(t||r),s.prev=t,s.curr=r,t=r,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,r)=>{if("%%"===t)return"%";i++;let n=a.formatters[r];if("function"==typeof n){let a=e[i];t=n.call(s,a),e.splice(i,1),i--}return t}),a.formatArgs.call(s,e),(s.log||a.log).apply(s,e)}return s.namespace=e,s.useColors=a.useColors(),s.color=a.selectColor(e),s.extend=r,s.destroy=a.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==a.namespaces&&(i=a.namespaces,n=a.enabled(e)),n),set:e=>{o=e}}),"function"==typeof a.init&&a.init(s),s}function r(e,t){let r=a(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function i(e,t){let a=0,r=0,i=-1,n=0;for(;a"-"+e)].join(",");return a.enable(""),e},a.enable=function(e){for(let t of(a.save(e),a.namespaces=e,a.names=[],a.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===t[0]?a.skips.push(t.slice(1)):a.names.push(t)},a.enabled=function(e){for(let t of a.skips)if(i(e,t))return!1;for(let t of a.names)if(i(e,t))return!0;return!1},a.humanize=e.r(76775),a.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(e=>{a[e]=t[e]}),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let t=0;for(let a=0;a{let r;var i=e.i(47167);a.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let a="color: "+this.color;e.splice(1,0,a,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),e.splice(i,0,a)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")||a.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==i.default&&"env"in i.default&&(e=i.default.env.DEBUG),e},a.useColors=function(){let e;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},a.storage=function(){try{return localStorage}catch(e){}}(),r=!1,a.destroy=()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.log=console.debug||console.log||(()=>{}),t.exports=e.r(7003)(a);let{formatters:n}=t.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},50593,17711,58281,45853,25311,89119,10244,e=>{"use strict";var t={},a=function(e,a,r,i,n){var o=new Worker(t[a]||(t[a]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var t=e.data,a=t.$e$;if(a){var r=Error(a[0]);r.code=a[1],r.stack=a[2],n(r,null)}else n(null,t)},o.postMessage(r,i),o},r=Uint8Array,i=Uint16Array,n=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(e,t){for(var a=new i(31),r=0;r<31;++r)a[r]=t+=1<>1|(21845&F)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,m[F]=((65280&v)>>8|(255&v)<<8)>>1}for(var y=function(e,t,a){for(var r,n=e.length,o=0,s=new i(t);o>d]=c}else for(o=0,r=new i(n);o>15-e[o]);return r},S=new r(288),F=0;F<144;++F)S[F]=8;for(var F=144;F<256;++F)S[F]=9;for(var F=256;F<280;++F)S[F]=7;for(var F=280;F<288;++F)S[F]=8;for(var k=new r(32),F=0;F<32;++F)k[F]=5;var b=y(S,9,0),I=y(S,9,1),x=y(k,5,0),P=y(k,5,1),D=function(e){for(var t=e[0],a=1;at&&(t=e[a]);return t},C=function(e,t,a){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&a},w=function(e,t){var a=t/8|0;return(e[a]|e[a+1]<<8|e[a+2]<<16)>>(7&t)},E=function(e){return(e+7)/8|0},B=function(e,t,a){return(null==t||t<0)&&(t=0),(null==a||a>e.length)&&(a=e.length),new r(e.subarray(t,a))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],T=function(e,t,a){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,T),!a)throw r;return r},N=function(e,t,a,i){var n=e.length,d=i?i.length:0;if(!n||t.f&&!t.l)return a||new r(0);var c=!a,u=c||2!=t.i,g=t.i;c&&(a=new r(3*n));var f=function(e){var t=a.length;if(e>t){var i=new r(Math.max(2*t,e));i.set(a),a=i}},m=t.f||0,F=t.p||0,v=t.b||0,S=t.l,k=t.d,b=t.m,x=t.n,M=8*n;do{if(!S){m=C(e,F,1);var N=C(e,F+1,3);if(F+=3,N)if(1==N)S=I,k=P,b=9,x=5;else if(2==N){var G=C(e,F,31)+257,R=C(e,F+10,15)+4,U=G+C(e,F+5,31)+1;F+=14;for(var j=new r(U),A=new r(19),V=0;V>4;if(_<16)j[V++]=_;else{var H=0,W=0;for(16==_?(W=3+C(e,F,3),F+=2,H=j[V-1]):17==_?(W=3+C(e,F,7),F+=3):18==_&&(W=11+C(e,F,127),F+=7);W--;)j[V++]=H}}var $=j.subarray(0,G),Z=j.subarray(G);b=D($),x=D(Z),S=y($,b,1),k=y(Z,x,1)}else T(1);else{var _=E(F)+4,X=e[_-4]|e[_-3]<<8,J=_+X;if(J>n){g&&T(0);break}u&&f(v+X),a.set(e.subarray(_,J),v),t.b=v+=X,t.p=F=8*J,t.f=m;continue}if(F>M){g&&T(0);break}}u&&f(v+131072);for(var Y=(1<>4;if((F+=15&H)>M){g&&T(0);break}if(H||T(2),ee<256)a[v++]=ee;else if(256==ee){K=F,S=null;break}else{var et=ee-254;if(ee>264){var V=ee-257,ea=o[V];et=C(e,F,(1<>4;er||T(3),F+=15&er;var Z=p[ei];if(ei>3){var ea=s[ei];Z+=w(e,F)&(1<M){g&&T(0);break}u&&f(v+131072);var en=v+et;if(v>8},R=function(e,t,a){a<<=7&t;var r=t/8|0;e[r]|=a,e[r+1]|=a>>8,e[r+2]|=a>>16},U=function(e,t){for(var a=[],n=0;np&&(p=s[n].s);var f=new i(p+1),m=j(a[u-1],f,0);if(m>t){var n=0,F=0,v=m-t,y=1<t)F+=y-(1<>=v;F>0;){var k=s[n].s;f[k]=0&&F;--n){var b=s[n].s;f[b]==t&&(--f[b],++F)}m=t}return{t:new r(f),l:m}},j=function(e,t,a){return -1==e.s?Math.max(j(e.l,t,a+1),j(e.r,t,a+1)):t[e.s]=a},A=function(e){for(var t=e.length;t&&!e[--t];);for(var a=new i(++t),r=0,n=e[0],o=1,s=function(e){a[r++]=e},l=1;l<=t;++l)if(e[l]==n&&l!=t)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=e[l]}return{c:a.subarray(0,r),n:t}},V=function(e,t){for(var a=0,r=0;r>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var n=0;n4&&!H[l[$-1]];--$);var Z=g+5<<3,X=V(n,S)+V(d,k)+c,J=V(n,P)+V(d,w)+c+14+3*$+V(L,H)+2*L[16]+3*L[17]+7*L[18];if(u>=0&&Z<=X&&Z<=J)return O(t,p,e.subarray(u,u+g));if(G(t,p,1+(J15&&(G(t,p,ee[q]>>5&127),p+=ee[q]>>12)}}else f=b,m=S,F=x,v=k;for(var q=0;q255){var et=ea>>18&31;R(t,p,f[et+257]),p+=m[et+257],et>7&&(G(t,p,ea>>23&31),p+=o[et]);var er=31&ea;R(t,p,F[er]),p+=v[er],er>3&&(R(t,p,ea>>5&8191),p+=s[er])}else R(t,p,f[ea]),p+=m[ea]}return R(t,p,f[256]),p+m[256]},L=new n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q=new r(0),_=function(e,t,a,l,d,c){var h=c.z||e.length,g=new r(l+h+5*(1+Math.ceil(h/7e3))+d),p=g.subarray(l,g.length-d),m=c.l,F=7&(c.r||0);if(t){F&&(p[0]=c.r>>3);for(var v=L[t-1],y=v>>13,S=8191&v,k=(1<7e3||R>24576)&&(_>423||!m)){F=z(e,p,0,C,w,M,N,R,j,G-j,F),R=T=N=0,j=G;for(var H=0;H<286;++H)w[H]=0;for(var H=0;H<30;++H)M[H]=0}var W=2,$=0,Z=S,X=V-q&32767;if(_>2&&A==D(G-X))for(var J=Math.min(y,_)-1,Y=Math.min(32767,G),Q=Math.min(258,_);X<=Y&&--Z&&V!=q;){if(e[G+W]==e[G+W-X]){for(var K=0;KW){if(W=K,$=X,K>J)break;for(var ee=Math.min(X,K-2),et=0,H=0;Het&&(et=ei,q=ea)}}}q=b[V=q],X+=V-q&32767}if($){C[R++]=0x10000000|u[W]<<18|f[$];var en=31&u[W],eo=31&f[$];N+=o[en]+s[eo],++w[257+en],++M[eo],U=G+W,++T}else C[R++]=e[G],++w[e[G]]}}for(G=Math.max(G,U);G=h&&(p[F/8|0]=m,es=h),F=O(p,F+1,e.subarray(G,es))}c.i=h}return B(g,0,l+E(F)+d)},H=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var a=t,r=9;--r;)a=(1&a&&-0x12477ce0)^a>>>1;e[t]=a}return e}(),W=function(){var e=-1;return{p:function(t){for(var a=e,r=0;r>>8;e=a},d:function(){return~e}}},$=function(){var e=1,t=0;return{p:function(a){for(var r=e,i=t,n=0|a.length,o=0;o!=n;){for(var s=Math.min(o+2655,n);o>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(255&e)<<24|(65280&e)<<8|(255&t)<<8|t>>8}}},Z=function(e,t,a,i,n){if(!n&&(n={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new r(o.length+e.length);s.set(o),s.set(e,o.length),e=s,n.w=o.length}return _(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,a,i,n)},X=function(e,t){var a={};for(var r in e)a[r]=e[r];for(var r in t)a[r]=t[r];return a},J=function(e,t,a){for(var r=e(),i=e.toString(),n=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},eh=function(e,t){return ec(e,t)+0x100000000*ec(e,t+4)},eu=function(e,t,a){for(;a;++t)e[t]=a,a>>>=8},eg=function(e,t){var a=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&eu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),a){e[3]=8;for(var r=0;r<=a.length;++r)e[r+10]=a.charCodeAt(r)}},ep=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&T(6,"invalid gzip data");var t=e[3],a=10;4&t&&(a+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[a++]);return a+(2&t)},ef=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},em=function(e){return 10+(e.filename?e.filename.length+1:0)},eF=function(e,t){var a=t.level;if(e[0]=120,e[1]=(0==a?0:a<6?1:9==a?3:2)<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var r=$();r.p(t.dictionary),eu(e,2,r.d())}},ev=function(e,t){return((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&T(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&T(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function ey(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var eS=function(){function e(e,t){if("function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var a=this.o.dictionary.subarray(-32768);this.b.set(a,32768-a.length),this.s.i=32768-a.length}}return e.prototype.p=function(e,t){this.ondata(Z(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,t){this.ondata||T(5),this.s.l&&T(4);var a=e.length+this.s.z;if(a>this.b.length){if(a>2*this.b.length-32768){var i=new r(-32768&a);i.set(this.b.subarray(0,this.s.z)),this.b=i}var n=this.b.length-this.s.z;this.b.set(e.subarray(0,n),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(n),32768),this.s.z=e.length-n+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&t,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||T(5),this.s.l&&T(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),ek=function(e,t){el([et,function(){return[es,eS]}],this,ey.call(this,e,t),function(e){onmessage=es(new eS(e.data))},6,1)};function eb(e,t){return Z(e,t||{},0,0)}var eI=function(){function e(e,t){"function"==typeof e&&(t=e,e={}),this.ondata=t;var a=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:a?a.length:0},this.o=new r(32768),this.p=new r(0),a&&this.o.set(a)}return e.prototype.e=function(e){if(this.ondata||T(5),this.d&&T(4),this.p.length){if(e.length){var t=new r(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,a=N(this.p,this.s,this.o);this.ondata(B(a,t,this.s.b),this.d),this.o=B(a,this.s.b-32768),this.s.b=this.o.length,this.p=B(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ex=function(e,t){el([ee,function(){return[es,eI]}],this,ey.call(this,e,t),function(e){onmessage=es(new eI(e.data))},7,0)};function eP(e,t){return N(e,{i:2},t&&t.out,t&&t.dictionary)}(function(){function e(e,t){this.c=W(),this.l=0,this.v=1,eS.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,eS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var a=Z(e,this.o,this.v&&em(this.o),t&&8,this.s);this.v&&(eg(a,this.o),this.v=0),t&&(eu(a,a.length-8,this.c.d()),eu(a,a.length-4,this.l)),this.ondata(a,t)},e.prototype.flush=function(){eS.prototype.flush.call(this)}})();var eD=function(){function e(e,t){this.v=1,this.r=0,eI.call(this,e,t)}return e.prototype.push=function(e,t){if(eI.prototype.e.call(this,e),this.r+=e.length,this.v){var a=this.p.subarray(this.v-1),i=a.length>3?ep(a):4;if(i>a.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-a.length);this.p=a.subarray(i),this.v=0}eI.prototype.c.call(this,t),!this.s.f||this.s.l||t||(this.v=E(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),t))},e}(),eC=function(e,t){var a=this;el([ee,ea,function(){return[es,eI,eD]}],this,ey.call(this,e,t),function(e){var t=new eD(e.data);t.onmember=function(e){return postMessage(e)},onmessage=es(t)},9,0,function(e){return a.onmember&&a.onmember(e)})},ew=(function(){function e(e,t){this.c=$(),this.v=1,eS.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),eS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var a=Z(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(eF(a,this.o),this.v=0),t&&eu(a,a.length-4,this.c.d()),this.ondata(a,t)},e.prototype.flush=function(){eS.prototype.flush.call(this)}}(),function(){function e(e,t){eI.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(eI.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(ev(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&T(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),eI.prototype.c.call(this,t)},e}()),eE=function(e,t){el([ee,er,function(){return[es,eI,ew]}],this,ey.call(this,e,t),function(e){onmessage=es(new ew(e.data))},11,0)},eB=function(){function e(e,t){this.o=ey.call(this,e,t)||{},this.G=eD,this.I=eI,this.Z=ew}return e.prototype.i=function(){var e=this;this.s.ondata=function(t,a){e.ondata(t,a)}},e.prototype.push=function(e,t){if(this.ondata||T(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var a=new r(this.p.length+e.length);a.set(this.p),a.set(e,this.p.length)}else this.p=e;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,t),this.p=null)}},e}();function eM(e,t){eB.call(this,e,t),this.queuedSize=0,this.G=eC,this.I=ex,this.Z=eE}eM.prototype.i=function(){var e=this;this.s.ondata=function(t,a,r){e.ondata(t,a,r)},this.s.ondrain=function(t){e.queuedSize-=t,e.ondrain&&e.ondrain(t)}},eM.prototype.push=function(e,t){this.queuedSize+=e.length,eB.prototype.push.call(this,e,t)};var eT="u">typeof TextEncoder&&new TextEncoder,eN="u">typeof TextDecoder&&new TextDecoder,eG=0;try{eN.decode(q,{stream:!0}),eG=1}catch(e){}var eR=function(e){for(var t="",a=0;;){var r=e[a++],i=(r>127)+(r>223)+(r>239);if(a+i>e.length)return{s:t,r:B(e,a-1)};i?3==i?t+=String.fromCharCode(55296|(r=((15&r)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++])-65536)>>10,56320|1023&r):1&i?t+=String.fromCharCode((31&r)<<6|63&e[a++]):t+=String.fromCharCode((15&r)<<12|(63&e[a++])<<6|63&e[a++]):t+=String.fromCharCode(r)}};function eU(e,t){if(t){for(var a=new r(e.length),i=0;i>1)),s=0,l=function(e){o[s++]=e},i=0;io.length){var d=new r(s+8+(n-i<<1));d.set(o),o=d}var c=e.charCodeAt(i);c<128||t?l(c):(c<2048?l(192|c>>6):(c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++i))>>18),l(128|c>>12&63)):l(224|c>>12),l(128|c>>6&63)),l(128|63&c))}return B(o,0,s)}(function(e){this.ondata=e,eG?this.t=new TextDecoder:this.p=q}).prototype.push=function(e,t){if(this.ondata||T(5),t=!!t,this.t){this.ondata(this.t.decode(e,{stream:!0}),t),t&&(this.t.decode().length&&T(8),this.t=null);return}this.p||T(4);var a=new r(this.p.length+e.length);a.set(this.p),a.set(e,this.p.length);var i=eR(a),n=i.s,o=i.r;t?(o.length&&T(8),this.p=null):this.p=o,this.ondata(n,t)},(function(e){this.ondata=e}).prototype.push=function(e,t){this.ondata||T(5),this.d&&T(4),this.ondata(eU(e),this.d=t||!1)};var ej=function(e){return 1==e?3:e<6?2:+(9==e)},eA=function(e,t){for(;1!=ed(e,t);t+=4+ed(e,t+2));return[eh(e,t+12),eh(e,t+4),eh(e,t+20)]},eV=function(e){var t=0;if(e)for(var a in e){var r=e[a].length;r>65535&&T(9),t+=r+4}return t},eO=function(e,t,a,r,i,n,o,s){var l=r.length,d=a.extra,c=s&&s.length,h=eV(d);eu(e,t,null!=o?0x2014b50:0x4034b50),t+=4,null!=o&&(e[t++]=20,e[t++]=a.os),e[t]=20,t+=2,e[t++]=a.flag<<1|(n<0&&8),e[t++]=i&&8,e[t++]=255&a.compression,e[t++]=a.compression>>8;var u=new Date(null==a.mtime?Date.now():a.mtime),g=u.getFullYear()-1980;if((g<0||g>119)&&T(10),eu(e,t,g<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>1),t+=4,-1!=n&&(eu(e,t,a.crc),eu(e,t+4,n<0?-n-2:n),eu(e,t+8,a.size)),eu(e,t+12,l),eu(e,t+14,h),t+=16,null!=o&&(eu(e,t,c),eu(e,t+6,a.attrs),eu(e,t+10,o),t+=14),e.set(r,t),t+=l,h)for(var p in d){var f=d[p],m=f.length;eu(e,t,+p),eu(e,t+2,m),e.set(f,t+4),t+=4+m}return c&&(e.set(s,t),t+=c),t},ez=function(e,t,a,r,i){eu(e,t,0x6054b50),eu(e,t+8,a),eu(e,t+10,a),eu(e,t+12,r),eu(e,t+16,i)},eL=function(){function e(e){this.filename=e,this.c=W(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||T(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();function eq(e,t){var a=this;t||(t={}),eL.call(this,e),this.d=new eS(t,function(e,t){a.ondata(null,e,t)}),this.compression=8,this.flag=ej(t.level)}function e_(e,t){var a=this;t||(t={}),eL.call(this,e),this.d=new ek(t,function(e,t,r){a.ondata(e,t,r)}),this.compression=8,this.flag=ej(t.level),this.terminate=this.d.terminate}function eH(e){this.ondata=e,this.u=[],this.d=1}eq.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},eq.prototype.push=function(e,t){eL.prototype.push.call(this,e,t)},e_.prototype.process=function(e,t){this.d.push(e,t)},e_.prototype.push=function(e,t){eL.prototype.push.call(this,e,t)},eH.prototype.add=function(e){var t=this;if(this.ondata||T(5),2&this.d)this.ondata(T(4+(1&this.d)*8,0,1),null,!1);else{var a=eU(e.filename),i=a.length,n=e.comment,o=n&&eU(n),s=i!=e.filename.length||o&&n.length!=o.length,l=i+eV(e.extra)+30;i>65535&&this.ondata(T(11,0,1),null,!1);var d=new r(l);eO(d,0,e,a,s,-1);var c=[d],h=function(){for(var e=0,a=c;e0){var i=Math.min(this.c,e.length),n=e.subarray(0,i);if(this.c-=i,this.d?this.d.push(n,!this.c):this.k[0].push(n),(e=e.subarray(i)).length)return this.push(e,t)}else{var o=0,s=0,l=void 0,d=void 0;this.p.length?e.length?((d=new r(this.p.length+e.length)).set(this.p),d.set(e,this.p.length)):d=this.p:d=e;for(var c=d.length,h=this.c,u=h&&this.d,g=this;ss+30+n+u){var p,f,m=[];g.k.unshift(m),o=2;var F=ec(d,s+18),v=ec(d,s+22),y=function(e,t){if(t){for(var a="",r=0;r=0&&(S.size=F,S.originalSize=v),g.onfile(S)}return"break"}if(h){if(0x8074b50==e)return l=s+=12+(-2==h&&8),o=3,g.c=0,"break";else if(0x2014b50==e)return l=s-=4,o=3,g.c=0,"break"}}();++s);if(this.p=q,h<0){var p=o?d.subarray(0,l-12-(-2==h&&8)-(0x8074b50==ec(d,l-16)&&4)):d.subarray(0,s);u?u.push(p,!!o):this.k[+(2==o)].push(p)}if(2&o)return this.push(d.subarray(s),t);this.p=d.subarray(s)}t&&(this.c&&T(13),this.p=null)},eX.prototype.register=function(e){this.o[e.compression]=e},"function"==typeof queueMicrotask&&queueMicrotask;var eJ=e.i(48450);let eY=[0,0,0,0,0,0,0,0,0,329,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2809,68,0,27,0,58,3,62,4,7,0,0,15,65,554,3,394,404,189,117,30,51,27,15,34,32,80,1,142,3,142,39,0,144,125,44,122,275,70,135,61,127,8,12,113,246,122,36,185,1,149,309,335,12,11,14,54,151,0,0,2,0,0,211,0,2090,344,736,993,2872,701,605,646,1552,328,305,1240,735,1533,1713,562,3,1775,1149,1469,979,407,553,59,279,31,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function eQ(e){return e.node?e.node.pop:e.leaf.pop}let eK=new class{nodes=[];leaves=[];tablesBuilt=!1;buildTables(){if(this.tablesBuilt)return;this.tablesBuilt=!0,this.leaves=[];for(let t=0;t<256;t++){var e;this.leaves.push({pop:eY[t]+ +((e=t)>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)+1,symbol:t,numBits:0,code:0})}this.nodes=[{pop:0,index0:0,index1:0}];let t=256,a=[];for(let e=0;e<256;e++)a.push({node:null,leaf:this.leaves[e]});for(;1!==t;){let e=0xfffffffe,r=0xffffffff,i=-1,n=-1;for(let o=0;on?i:n;a[s]={node:o,leaf:null},l!==t-1&&(a[l]=a[t-1]),t--}this.nodes[0]=a[0].node,this.generateCodes(0,0,0)}determineIndex(e){return null!==e.leaf?-(this.leaves.indexOf(e.leaf)+1):this.nodes.indexOf(e.node)}generateCodes(e,t,a){if(t<0){let r=this.leaves[-(t+1)];r.code=e,r.numBits=a}else{let r=this.nodes[t];this.generateCodes(e,r.index0,a+1),this.generateCodes(e|1<=0)t=e.readFlag()?this.nodes[t].index1:this.nodes[t].index0;else{a.push(this.leaves[-(t+1)].symbol);break}}return String.fromCharCode(...a)}{let t=e.readInt(8);return String.fromCharCode(...e.readBytes(t))}}};class e0{data;bitNum;maxReadBitNum;error;stringBuffer=null;constructor(e,t=0){this.data=e,this.bitNum=t,this.maxReadBitNum=e.length<<3,this.error=!1}getCurPos(){return this.bitNum}setCurPos(e){this.bitNum=e}getBytePosition(){return this.bitNum+7>>3}isError(){return this.error}isFull(){return this.bitNum>this.maxReadBitNum}getRemainingBits(){return this.maxReadBitNum-this.bitNum}getMaxPos(){return this.maxReadBitNum}readFlag(){if(this.bitNum>=this.maxReadBitNum)return this.error=!0,!1;let e=1<<(7&this.bitNum),t=(this.data[this.bitNum>>3]&e)!=0;return this.bitNum++,t}readInt(e){if(0===e)return 0;if(this.bitNum+e>this.maxReadBitNum)return this.error=!0,0;let t=this.bitNum>>3,a=7&this.bitNum;if(this.bitNum+=e,e+a<=32){let r=0,i=e+a+7>>3;for(let e=0;e>>=a,32===e)?r>>>0:r&(1<>3;for(let e=0;e>>0:r&(1<>3,a=new Uint8Array(t),r=this.bitNum>>3,i=7&this.bitNum,n=8-i;if(0===i)a.set(this.data.subarray(r,r+t));else{let e=this.data[r];for(let o=0;o>i|t<this.maxReadBitNum)return this.error=!0,0;let e=this.bitNum>>3,t=7&this.bitNum,a=e0.f32U8;if(0===t)a[0]=this.data[e],a[1]=this.data[e+1],a[2]=this.data[e+2],a[3]=this.data[e+3];else{let r=8-t;for(let i=0;i<4;i++){let n=this.data[e+i],o=e+i+1>t|o<>>0)}getCompressionPoint(){return this.compressionPoint}getDataBlockDataMap(){return this.dataBlockDataMap}getConnectionContext(){let e=this.dataBlockDataMap;return{compressionPoint:this.compressionPoint,ghostTracker:this.ghostTracker,getDataBlockParser:e=>this.registry.getDataBlockParser(e),getDataBlockData:e?t=>e.get(t):void 0,getGhostParser:e=>this.registry.getGhostParser(e)}}_setNextRecvEventSeq(e){this.nextRecvEventSeq=e>>>0}setConnectionProtocolState(e){for(this.lastSeqRecvdAtSend=e.lastSeqRecvdAtSend.slice(0,32);this.lastSeqRecvdAtSend.length<32;)this.lastSeqRecvdAtSend.push(0);this.lastSeqRecvd=e.lastSeqRecvd>>>0,this.highestAckedSeq=e.highestAckedSeq>>>0,this.lastSendSeq=e.lastSendSeq>>>0,this.recvAckMask=e.ackMask>>>0,this.connectSequence=e.connectSequence>>>0,this.lastRecvAckAck=e.lastRecvAckAck>>>0,this._connectionEstablished=e.connectionEstablished}onSendPacketTrigger(){this.lastSendSeq=this.lastSendSeq+1>>>0,this.lastSeqRecvdAtSend[31&this.lastSendSeq]=this.lastSeqRecvd>>>0}applyProtocolHeader(e){if(e.connectSeqBit!==(1&this.connectSequence)||e.ackByteCount>4||e.packetType>2)return{accepted:!1,dispatchData:!1};let t=(e.seqNumber|0xfffffe00&this.lastSeqRecvd)>>>0;if(t>>0),this.lastSeqRecvd+31>>0;if(a>>0),this.lastSendSeq>>0,0===e.packetType&&(this.recvAckMask=(1|this.recvAckMask)>>>0);for(let t=this.highestAckedSeq+1;t<=a;t++)(e.ackMask&1<<(a-t&31))!=0&&(this.lastRecvAckAck=this.lastSeqRecvdAtSend[31&t]>>>0);t-this.lastRecvAckAck>32&&(this.lastRecvAckAck=t-32),this.highestAckedSeq=a;let i=this.lastSeqRecvd!==t&&0===e.packetType;return this.lastSeqRecvd=t,{accepted:!0,dispatchData:i}}parsePacket(e){let t=new e0(e),a=this.readDnetHeader(t),r=this.applyProtocolHeader(a);if(this.packetsParsed++,!r.accepted)return this.protocolRejected++,{dnetHeader:a,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};if(!r.dispatchData)return this.protocolNoDispatch++,{dnetHeader:a,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};let i=this.readRateInfo(t);t.setStringBuffer(!0);let n=this.readGameState(t),o=void 0===n.controlObjectDataStart||void 0!==n.controlObjectData,s=o?this.readEvents(t):[],l=s[s.length-1],d=!l||l.dataBitsEnd!==l.dataBitsStart,c=o&&d?t.getCurPos():void 0,h=o&&d?this.readGhosts(t,a.seqNumber):[];return t.setStringBuffer(!1),{dnetHeader:a,rateInfo:i,gameState:n,events:s,ghosts:h,ghostSectionStart:c}}readDnetHeader(e){let t=e.readFlag(),a=e.readInt(1),r=e.readInt(9),i=e.readInt(9),n=e.readInt(2),o=e.readInt(3),s=o>0?e.readInt(8*o):0;return{gameFlag:t,connectSeqBit:a,seqNumber:r,highestAck:i,packetType:n,ackByteCount:o,ackMask:s}}readRateInfo(e){let t={};return e.readFlag()&&(t.updateDelay=e.readInt(10),t.packetSize=e.readInt(10)),e.readFlag()&&(t.maxUpdateDelay=e.readInt(10),t.maxPacketSize=e.readInt(10)),t}readGameState(e){let t,a,r,i,n,o,s,l,d,c,h,u,g,p,f,m=e.readInt(32);e.readFlag()&&(e.readFlag()&&(t=e.readFloat(7)),e.readFlag()&&(a=1.5*e.readFloat(7))),e.readFlag()&&(r=e.readFlag(),i=e.readFlag()),e.readFlag()&&((n=e.readFlag())&&(o={x:e.readF32(),y:e.readF32(),z:e.readF32()}),1===(s=e.readRangedU32(0,2))?e.readFlag()&&(l=e.readRangedU32(0,1023)):2===s&&(d={x:e.readF32(),y:e.readF32(),z:e.readF32()}));let F=e.readFlag(),v=e.readFlag();if(e.readFlag())if(e.readFlag()){let f=e.readInt(10);c=f,h=e.getCurPos();let y=e.savePos(),S=this.ghostTracker.getGhost(f),k=S?this.registry.getGhostParser(S.classId):void 0,b=this.controlParserByGhostIndex.get(f),I=this.registry.getGhostParser(25),x=this.registry.getGhostParser(4),P=[],D=new Set,C=e=>{!e?.readPacketData||D.has(e.name)||(D.add(e.name),P.push(e))};C(k),C(b),C(I),C(x);let w=!1;for(let t of P){e.restorePos(y);try{let a=this.getConnectionContext(),r=t.readPacketData(e,a);if(e.getCurPos()-h<=0||e.isError())continue;g=r,u=e.getCurPos(),this.controlParserByGhostIndex.set(f,t),a.compressionPoint!==this.compressionPoint&&(this.compressionPoint=a.compressionPoint,p=this.compressionPoint),this.controlObjectParsed++,w=!0;break}catch{}}if(!w)return e.restorePos(y),u=h,this.controlObjectFailed++,{lastMoveAck:m,damageFlash:t,whiteOut:a,selfLocked:r,selfHomed:i,seekerTracking:n,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:d,pinged:F,jammed:v,controlObjectGhostIndex:c,controlObjectDataStart:h,controlObjectDataEnd:u,controlObjectData:g,targetVisibility:[]}}else p={x:e.readF32(),y:e.readF32(),z:e.readF32()},this.compressionPoint=p;let y=[];for(;e.readFlag();)y.push({index:e.readInt(4),mask:e.readInt(32)});return e.readFlag()&&(f=e.readInt(8)),{lastMoveAck:m,damageFlash:t,whiteOut:a,selfLocked:r,selfHomed:i,seekerTracking:n,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:d,pinged:F,jammed:v,controlObjectGhostIndex:c,controlObjectDataStart:h,controlObjectDataEnd:u,controlObjectData:g,compressionPoint:p,targetVisibility:y.length>0?y:void 0,cameraFov:f}}readEvents(e){let t=[],a=!0,r=-2;for(;;){let i,n,o,s=e.readFlag();if(a&&!s){if(a=!1,!e.readFlag()){this.dispatchGuaranteedEvents(t);break}}else if(a||s){if(!s)break}else{this.dispatchGuaranteedEvents(t);break}!a&&(r=i=e.readFlag()?r+1&127:e.readInt(7),(n=i|0xffffff80&this.nextRecvEventSeq)0&&this.pendingGuaranteedEvents[0].absoluteSequenceNumber===this.nextRecvEventSeq;){let t=this.pendingGuaranteedEvents.shift();if(!t)break;this.nextRecvEventSeq=this.nextRecvEventSeq+1>>>0,e.push(t.event),t.event.parsedData&&this.applyEventSideEffects(t.event.parsedData)}}applyEventSideEffects(e){let t=e.type;if("GhostingMessageEvent"===t){let t=e.message;"number"==typeof t&&2===t&&this.ghostTracker.clear();return}if("GhostAlwaysObjectEvent"===t){let t=e.ghostIndex,a=e.classId;if("number"==typeof t&&"number"==typeof a){let e=this.registry.getGhostParser(a);this.ghostTracker.createGhost(t,a,e?.name??`unknown_${a}`)}}"SimDataBlockEvent"===t&&this.dataBlockDataMap&&e.dataBlockData&&"number"==typeof e.objectId&&this.dataBlockDataMap.set(e.objectId,e.dataBlockData)}readGhosts(e,t){let a=[];if(!e.readFlag())return a;let r=e.readInt(3)+3;for(;e.readFlag();){let i;if(e.isError())break;let n=e.readInt(r);if(e.isError())break;if(e.readFlag()){this.ghostTracker.deleteGhost(n),this.ghostDeletes++,a.push({index:n,type:"delete",updateBitsStart:e.getCurPos(),updateBitsEnd:e.getCurPos()});continue}let o=!this.ghostTracker.hasGhost(n);i=o?e.readInt(7)+0:this.ghostTracker.getGhost(n)?.classId;let s=e.getCurPos(),l=void 0!==i?this.registry.getGhostParser(i):void 0;if(o&&!l){this.ghostsTrackerDiverged++,e5("DIVERGED pkt=%d seq=%d idx=%d classId=%d bit=%d/%d trackerSize=%d (server sent UPDATE for ghost not in our tracker; 7-bit classId is actually update data)",this.packetsParsed,t,n,i,s,e.getMaxPos(),this.ghostTracker.size()),a.push({index:n,type:"create",classId:i,updateBitsStart:s,updateBitsEnd:s});break}let d=!1;if(l)try{let t=this.getConnectionContext();t.currentGhostIndex=n;let r=l.unpackUpdate(e,o,t),c=e.getCurPos();o&&void 0!==i?(this.ghostTracker.createGhost(n,i,l.name),this.ghostCreatesParsed++):this.ghostUpdatesParsed++,a.push({index:n,type:o?"create":"update",classId:i,updateBitsStart:s,updateBitsEnd:c,parsedData:r}),d=!0}catch(c){this.ghostsFailed++;let r=o?"create":"update",d=c instanceof Error?c.message:String(c);e5("FAIL pkt=%d seq=%d #%d idx=%d op=%s classId=%d parser=%s bit=%d/%d trackerSize=%d err=%s",this.packetsParsed,t,a.length,n,r,i,l.name,s,e.getMaxPos(),this.ghostTracker.size(),d)}if(!d){e5("STOP pkt=%d seq=%d idx=%d op=%s classId=%d parser=%s bit=%d/%d",this.packetsParsed,t,n,o?"create":"update",i,l?.name??"NONE",s,e.getMaxPos()),a.push({index:n,type:o?"create":"update",classId:i,updateBitsStart:s,updateBitsEnd:s});break}}return a}emptyGameState(){return{lastMoveAck:0,pinged:!1,jammed:!1}}}class e6{eventParsers=new Map;ghostParsers=new Map;dataBlockParsers=new Map;eventCatalog=new Map;ghostCatalog=new Map;dataBlockCatalog=new Map;catalogEvent(e){this.eventCatalog.set(e.name,e)}catalogGhost(e){this.ghostCatalog.set(e.name,e)}catalogDataBlock(e){this.dataBlockCatalog.set(e.name,e)}bindDeterministicDataBlocks(e,t){let a=0,r=[];for(let i=0;i0&&(r.sounds=t)}if(e.readFlag()){let t=[];for(let a=0;a<4;a++)e.readFlag()&&t.push({index:a,sequence:e.readInt(5),state:e.readInt(2),forward:e.readFlag(),atEnd:e.readFlag()});t.length>0&&(r.threads=t)}let i=!1;if(e.readFlag()){let a=[];for(let r=0;r<8;r++)if(e.readFlag()){let n={index:r};e.readFlag()?n.dataBlockId=e9(e):n.dataBlockId=0,e.readFlag()&&(e.readFlag()?n.skinTagIndex=e.readInt(10):n.skinName=e.readString(),i=!0),n.triggerDown=e.readFlag(),n.loaded=e.readFlag(),n.ammo=e.readFlag(),n.wet=e.readFlag(),n.target=e.readFlag(),n.fireCount=e.readInt(3),t&&(n.imageExtraFlag=e.readFlag()),a.push(n)}a.length>0&&(r.images=a)}if(e.readFlag()){if(e.readFlag()){r.stateAEnabled=e.readFlag(),r.stateB=e.readFlag();let t=e.readFlag();r.hasInvulnerability=t,t?(r.invulnerabilityVisual=e.readFlag(),r.invulnerabilityTicks=e.readU32()):r.binaryCloak=e.readFlag()}if(e.readFlag())if(e.readFlag()){let t=e.readFlag();r.stateBMode=t,t?r.energyPackOn=!0:r.energyPackOn=!1}else r.shieldNormal=e.readNormalVector(8),r.energyPercent=e.readFloat(5);e.readFlag()&&(r.stateValue1=e.readU32(),r.stateValue2=e.readU32())}return i&&(r.imageSkinDirty=!0),e.readFlag()&&(e.readFlag()?(r.mountObject=e.readInt(10),r.mountNode=e.readInt(5)):r.mountObject=-1),r}function ta(e,t,a){let r=tt(e,t,a);if(e.readFlag()&&(r.impactSound=e.readInt(3)),e.readFlag()&&(r.action=e.readInt(8),r.actionHoldAtEnd=e.readFlag(),r.actionAtEnd=e.readFlag(),r.actionFirstPerson=e.readFlag(),!r.actionAtEnd&&e.readFlag()&&(r.actionAnimPos=e.readSignedFloat(6))),e.readFlag()&&(r.armAction=e.readInt(8)),e.readFlag())return r;if(e.readFlag()){if(r.actionState=e.readInt(3),e.readFlag()&&(r.recoverTicks=e.readInt(7)),r.moveFlag0=e.readFlag(),r.moveFlag1=e.readFlag(),r.position=e.readCompressedPoint(a.compressionPoint),e.readFlag()){let t=e.readInt(13)/32,a=e.readNormalVector(10);r.velocity={x:a.x*t,y:a.y*t,z:a.z*t}}else r.velocity={x:0,y:0,z:0};r.headX=e.readSignedFloat(6),r.headZ=e.readSignedFloat(6),r.rotationZ=2*e.readFloat(7)*Math.PI,r.move=e7(e),r.allowWarp=e.readFlag()}return r.energy=e.readFloat(5),r}function tr(e,t){let a={};if(a.energyLevel=e.readF32(),a.rechargeRate=e.readF32(),a.actionState=e.readInt(3),e.readFlag()&&(a.recoverTicks=e.readInt(7)),e.readFlag()&&(a.jumpDelay=e.readInt(7)),e.readFlag()){let r={x:e.readF32(),y:e.readF32(),z:e.readF32()};a.position=r,t.compressionPoint=r,a.velocity={x:e.readF32(),y:e.readF32(),z:e.readF32()},a.jumpSurfaceLastContact=e.readInt(4)}if(a.headX=e.readF32(),a.headZ=e.readF32(),a.rotationZ=e.readF32(),e.readFlag()){let r=e.readInt(10);a.controlObjectGhost=r;let i=t.ghostTracker.getGhost(r),n=i?t.getGhostParser?.(i.classId):void 0;if(n?.readPacketData){let i=t.currentGhostIndex;t.currentGhostIndex=r,a.controlObjectData=n.readPacketData(e,t),t.currentGhostIndex=i}}return a.disableMove=e.readFlag(),a.pilot=e.readFlag(),a}function ti(e,t,a){let r=tt(e,t,a);return(r.jetting=e.readFlag(),e.readFlag())?r._controlledEarlyReturn=!0:(r.steeringYaw=e.readFloat(9),r.steeringPitch=e.readFloat(9),r.move=e7(e),r.frozen=e.readFlag(),e.readFlag()&&(r.position=e.readCompressedPoint(a.compressionPoint),r.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},r.linMomentum=e.readPoint3F(),r.angMomentum=e.readPoint3F()),e.readFlag()&&(r.energy=e.readFloat(8))),r}function tn(e,t){let a={};a.energyLevel=e.readF32(),a.rechargeRate=e.readF32(),a.steering={x:e.readF32(),y:e.readF32()};let r={x:e.readF32(),y:e.readF32(),z:e.readF32()};return a.linPosition=r,a.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},a.linMomentum=e.readPoint3F(),a.angMomentum=e.readPoint3F(),a.disableMove=e.readFlag(),a.frozen=e.readFlag(),t.compressionPoint=r,a}function to(e,t){let a=tn(e,t);a.braking=e.readFlag();let r=4,i=t.currentGhostIndex;if(void 0!==i){let e=tZ.get(i);void 0!==e&&(r=e)}let n=[];for(let t=0;t64)throw Error(`Invalid Sky fogVolumeCount: ${t}`);r.fogVolumeCount=t,r.useSkyTextures=e.readBool(),r.renderBottomTexture=e.readBool(),r.skySolidColor={r:e.readF32(),g:e.readF32(),b:e.readF32()},r.windEffectPrecipitation=e.readBool();let a=[];for(let r=0;r3)throw Error(`Invalid precipitation colorCount: ${t}`);let a=[];for(let r=0;rMath.floor(e.getRemainingBits()/96))throw Error(`Invalid physicalZone point count: ${t}`);let a=[];for(let r=0;rMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone plane count: ${i}`);let n=[];for(let t=0;tMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone edge count: ${o}`);let s=[];for(let t=0;t0&&(a.audioData=e.readBitsBuffer(8*r)),a}function ad(e,t){return{type:"GhostingMessageEvent",sequence:e.readU32(),message:e.readInt(3),ghostCount:e.readInt(11)}}function ac(e,t){let a={type:"GhostAlwaysObjectEvent"};a.ghostIndex=e.readInt(10);let r=e.readFlag();if(a._hasObjectData=r,r){let r=e.readInt(7);a.classId=r;let i=t.getGhostParser?.(r);if(!i)throw Error(`No ghost parser for GhostAlwaysObjectEvent classId=${r}`);a.objectData=i.unpackUpdate(e,!0,t)}return a}function ah(e,t){let a={type:"PathManagerEvent"};if(e.readFlag()){a.messageType="NewPaths";let t=e.readU32(),r=[];for(let a=0;a0&&(t.hudImages=a),t}function aw(e){let t={};e.readFlag()&&(t.crc=e.readU32()),t.shapeName=e.readString(),t.mountPoint=e.readU32(),e.readFlag()||(t.offset=e.readAffineTransform()),t.firstPerson=e.readFlag(),t.mass=e.readF32(),t.usesEnergy=e.readFlag(),t.minEnergy=e.readF32(),t.hasFlash=e.readFlag(),t.projectile=ab(e),t.muzzleFlash=ab(e),t.isSeeker=e.readFlag(),t.isSeeker&&(t.seekerRadius=e.readF32(),t.maxSeekAngle=e.readF32(),t.seekerLockTime=e.readF32(),t.seekerFreeTime=e.readF32(),t.isTargetLockRequired=e.readFlag(),t.maxLockRange=e.readF32()),t.cloakable=e.readFlag(),t.lightType=e.readRangedU32(0,3),0!==t.lightType&&(t.lightRadius=e.readF32(),t.lightTime=e.readS32(),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)}),t.shellExitDir={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.shellExitVariance=e.readF32(),t.shellVelocity=e.readF32(),t.casing=ab(e),t.accuFire=e.readFlag();let a=[];for(let t=0;t<31;t++){if(!e.readFlag())continue;let t={};t.name=e.readString(),t.transitionOnAmmo=e.readInt(5),t.transitionOnNoAmmo=e.readInt(5),t.transitionOnTarget=e.readInt(5),t.transitionOnNoTarget=e.readInt(5),t.transitionOnWet=e.readInt(5),t.transitionOnNotWet=e.readInt(5),t.transitionOnTriggerUp=e.readInt(5),t.transitionOnTriggerDown=e.readInt(5),t.transitionOnTimeout=e.readInt(5),t.transitionGeneric0In=e.readInt(5),t.transitionGeneric0Out=e.readInt(5),e.readFlag()&&(t.timeoutValue=e.readF32()),t.waitForTimeout=e.readFlag(),t.fire=e.readFlag(),t.ejectShell=e.readFlag(),t.scaleAnimation=e.readFlag(),t.direction=e.readFlag(),t.reload=e.readFlag(),e.readFlag()&&(t.energyDrain=e.readF32()),t.loaded=e.readInt(3),t.spin=e.readInt(3),t.recoil=e.readInt(3),e.readFlag()&&(t.sequence=e.readSignedInt(16)),e.readFlag()&&(t.sequenceVis=e.readSignedInt(16)),t.flashSequence=e.readFlag(),t.ignoreLoadedForReady=e.readFlag(),t.emitter=ab(e),null!==t.emitter&&(t.emitterTime=e.readF32(),t.emitterNode=e.readS32()),t.sound=ab(e),a.push(t)}return t.states=a,t}function aE(e){let t=aC(e);t.renderFirstPerson=e.readFlag(),t.minLookAngle=e.readF32(),t.maxLookAngle=e.readF32(),t.maxFreelookAngle=e.readF32(),t.maxTimeScale=e.readF32(),t.maxStepHeight=e.readF32(),t.runForce=e.readF32(),t.runEnergyDrain=e.readF32(),t.minRunEnergy=e.readF32(),t.maxForwardSpeed=e.readF32(),t.maxBackwardSpeed=e.readF32(),t.maxSideSpeed=e.readF32(),t.maxUnderwaterForwardSpeed=e.readF32(),t.maxUnderwaterBackwardSpeed=e.readF32(),t.maxUnderwaterSideSpeedRef=ab(e),e.readFlag()&&(t.runSurfaceAngleRef=e.readInt(11)),t.runSurfaceAngle=e.readF32(),t.recoverDelay=e.readF32(),t.recoverRunForceScale=e.readF32(),t.jumpForce=e.readF32(),t.jumpEnergyDrain=e.readF32(),t.minJumpEnergy=e.readF32(),t.minJumpSpeed=e.readF32(),t.maxJumpSpeed=e.readF32(),t.jumpSurfaceAngle=e.readF32(),t.minJetEnergy=e.readF32(),t.splashVelocity=e.readF32(),t.splashAngle=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.bubbleEmitTime=e.readF32(),t.medSplashSoundVel=e.readF32(),t.hardSplashSoundVel=e.readF32(),t.exitSplashSoundVel=e.readF32(),t.jumpDelay=e.readInt(7),t.horizMaxSpeed=e.readF32(),t.horizResistSpeed=e.readF32(),t.horizResistFactor=e.readF32(),t.upMaxSpeed=e.readF32(),t.upResistSpeed=e.readF32(),t.upResistFactor=e.readF32(),t.jetEnergyDrain=e.readF32(),t.canJet=e.readF32(),t.maxJetHorizontalPercentage=e.readF32(),t.maxJetForwardSpeed=e.readF32(),t.jetForce=e.readF32(),t.minJetSpeed=e.readF32(),t.maxDamage=e.readF32(),t.minImpactDamageSpeed=e.readF32(),t.impactDamageScale=e.readF32(),t.footSplashHeight=e.readF32();let a=[];for(let t=0;t<32;t++)e.readFlag()?a.push(e.readInt(11)):a.push(null);t.sounds=a,t.boxSize={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.footPuffEmitter=ab(e),t.footPuffNumParts=e.readF32(),t.footPuffRadius=e.readF32(),t.decalData=ab(e),t.decalOffset=e.readF32(),t.dustEmitter=ab(e),t.splash=ab(e);let r=[];for(let t=0;t<3;t++)r.push(ab(e));return t.splashEmitters=r,t.groundImpactMinSpeed=e.readF32(),t.groundImpactShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeDuration=e.readF32(),t.groundImpactShakeFalloff=e.readF32(),t.boundingRadius=e.readF32(),t.moveBubbleSize=e.readF32(),t}function aB(e){let t=aC(e);t.bodyRestitution=e.readF32(),t.bodyFriction=e.readF32();let a=[];for(let t=0;t<2;t++)a.push(ab(e));t.impactSounds=a,t.minImpactSpeed=e.readF32(),t.softImpactSpeed=e.readF32(),t.hardImpactSpeed=e.readF32(),t.minRollSpeed=e.readF32(),t.maxSteeringAngle=e.readF32(),t.maxDrag=e.readF32(),t.minDrag=e.readF32(),t.cameraOffset=e.readF32(),t.cameraLag=e.readF32(),t.jetForce=e.readF32(),t.jetEnergyDrain=e.readF32(),t.minJetEnergy=e.readF32(),t.integration=e.readF32(),t.collisionTol=e.readF32(),t.massCenter=e.readF32(),t.exitSplashSoundVelocity=e.readF32(),t.softSplashSoundVelocity=e.readF32(),t.mediumSplashSoundVelocity=e.readF32(),t.hardSplashSoundVelocity=e.readF32();let r=[];for(let t=0;t<5;t++)r.push(ab(e));t.waterSounds=r,t.dustEmitter=ab(e);let i=[];for(let t=0;t<3;t++)i.push(ab(e));t.damageEmitters=i;let n=[];for(let t=0;t<2;t++)n.push(ab(e));return t.splashEmitters=n,t.damageEmitterOffset0={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageEmitterOffset1={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageLevelTolerance0=e.readF32(),t.damageLevelTolerance1=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.collDamageThresholdVel=e.readF32(),t.collDamageMultiplier=e.readF32(),t}function aM(e){let t=aB(e);t.jetActivateSound=ab(e),t.jetDeactivateSound=ab(e);let a=[];for(let t=0;t<4;t++)a.push(ab(e));return t.jetEmitters=a,t.maneuveringForce=e.readF32(),t.horizontalSurfaceForce=e.readF32(),t.verticalSurfaceForce=e.readF32(),t.autoInputDamping=e.readF32(),t.steeringForce=e.readF32(),t.steeringRollForce=e.readF32(),t.rollForce=e.readF32(),t.autoAngularForce=e.readF32(),t.rotationalDrag=e.readF32(),t.maxAutoSpeed=e.readF32(),t.autoLinearForce=e.readF32(),t.hoverHeight=e.readF32(),t.createHoverHeight=e.readF32(),t.minTrailSpeed=e.readF32(),t.vertThrustMultiple=e.readF32(),t.maxForwardSpeed=e.readF32(),t}function aT(e){let t=aB(e);t.dragForce=e.readF32(),t.mainThrustForce=e.readF32(),t.reverseThrustForce=e.readF32(),t.strafeThrustForce=e.readF32(),t.turboFactor=e.readF32(),t.stabLenMin=e.readF32(),t.stabLenMax=e.readF32(),t.stabSpringConstant=e.readF32(),t.stabDampingConstant=e.readF32(),t.gyroDrag=e.readF32(),t.normalForce=e.readF32(),t.restorativeForce=e.readF32(),t.steeringForce=e.readF32(),t.rollForce=e.readF32(),t.pitchForce=e.readF32(),t.floatingThrustFactor=e.readF32(),t.brakingForce=e.readF32(),t.dustTrailOffset={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.dustTrailFreqMod=e.readF32(),t.triggerTrailHeight=e.readF32(),t.floatSound=ab(e),t.thrustSound=ab(e),t.turboSound=ab(e);let a=[];for(let t=0;t<3;t++)a.push(ab(e));return t.jetEmitters=a,t.dustTrailEmitter=ab(e),t.mainThrustEmitterFactor=e.readF32(),t.strafeThrustEmitterFactor=e.readF32(),t.reverseThrustEmitterFactor=e.readF32(),t}function aN(e){let t=aB(e);return t.tireRadius=e.readF32(),t.tireStaticFriction=e.readF32(),t.tireKineticFriction=e.readF32(),t.tireRestitution=e.readF32(),t.tireLateralForce=e.readF32(),t.tireLateralDamping=e.readF32(),t.tireLateralRelaxation=e.readF32(),t.tireLongitudinalForce=e.readF32(),t.tireLongitudinalDamping=e.readF32(),t.tireEmitter=ab(e),t.jetSound=ab(e),t.engineSound=ab(e),t.squealSound=ab(e),t.wadeSound=ab(e),t.spring=e.readF32(),t.springDamping=e.readF32(),t.springLength=e.readF32(),t.brakeTorque=e.readF32(),t.engineTorque=e.readF32(),t.engineBrake=e.readF32(),t.maxWheelSpeed=e.readF32(),t.steeringAngle=e.readF32(),t.steeringReturn=e.readF32(),t.steeringDamping=e.readF32(),t.powerSteeringFactor=e.readF32(),t}function aG(e){let t=aC(e);return t.noIndividualDamage=e.readFlag(),t.dynamicTypeField=e.readS32(),t}function aR(e){let t=aG(e);return t.thetaMin=e.readF32(),t.thetaMax=e.readF32(),t.thetaNull=e.readF32(),t.neverUpdateControl=e.readFlag(),t.primaryAxis=e.readRangedU32(0,3),t.maxCapacitorEnergy=e.readF32(),t.capacitorRechargeRate=e.readF32(),t}function aU(e){let t=aw(e);return t.activationMS=e.readInt(8),t.deactivateDelayMS=e.readInt(8),t.degPerSecTheta=e.readRangedU32(0,1080),t.degPerSecPhi=e.readRangedU32(0,1080),t.dontFireInsideDamageRadius=e.readFlag(),t.damageRadius=e.readF32(),t.useCapacitor=e.readFlag(),t}function aj(e){let t=aC(e);return t.friction=e.readFloat(10),t.elasticity=e.readFloat(10),t.sticky=e.readFlag(),e.readFlag()&&(t.gravityMod=e.readFloat(10)),e.readFlag()&&(t.maxVelocity=e.readF32()),e.readFlag()&&(t.lightType=e.readInt(2),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)},t.lightTime=e.readS32(),t.lightRadius=e.readF32(),t.lightOnlyStatic=e.readFlag()),t}function aA(e){let t={};t.projectileShapeName=e.readString(),t.faceViewerLinkTime=e.readS32(),t.lifetime=e.readS32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.scale={x:e.readF32(),y:e.readF32(),z:e.readF32()}),t.baseEmitter=ab(e),t.delayEmitter=ab(e),t.bubbleEmitter=ab(e),t.explosion=ab(e),t.underwaterExplosion=ab(e),t.splash=ab(e),t.sound=ab(e),t.wetFireSound=ab(e),t.fireSound=ab(e);let a=[];for(let t=0;t<6;t++)a.push(ab(e));return t.decals=a,e.readFlag()&&(t.lightRadius=e.readFloat(8),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),e.readFlag()&&(t.underwaterLightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),t.explodeOnWaterImpact=aP(e),t.depthTolerance=e.readF32(),t}function aV(e){let t=aA(e);return t.dryVelocity=e.readF32(),t.wetVelocity=e.readF32(),t.fizzleTime=e.readU32(),t.fizzleType=e.readU32(),t.hardRetarget=e.readFlag(),t.inheritedVelocityScale=e.readRangedU32(0,90),t.lifetimeMS=e.readRangedU32(0,90),t.collideWithOwnerTimeMS=e.readU32(),t.proximityRadius=e.readU32(),t.tracerProjectile=e.readFlag(),t}function aO(e){let t=aA(e);return t.armingDelayMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.grenadeElasticity=e.readF32(),t.grenadeFriction=e.readF32(),t.drag=e.readF32(),t.density=e.readF32(),t.gravityMod=e.readF32(),t.lifetimeMS=e.readS32(),t}function az(e){let t=aA(e);return t.lifetimeMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.turningSpeed=e.readF32(),t.proximityRadius=e.readF32(),t.terrainAvoidanceSpeed=e.readF32(),t.terrainScanAhead=e.readF32(),t.terrainHeightFail=e.readF32(),t.terrainAvoidanceRadius=e.readF32(),t.flareDistance=e.readF32(),t.flareAngle=e.readF32(),t.useFlechette=aP(e),t.maxVelocity=e.readF32(),t.acceleration=e.readF32(),t.flechetteDelayMs=e.readS32(),t.exhaustTimeMs=e.readS32(),t.exhaustNodeName=e.readString(),t.casingShapeName=e.readString(),t.casingDebris=ab(e),t.puffEmitter=ab(e),t.exhaustEmitter=ab(e),t}function aL(e){let t=aA(e);t.maxRifleRange=e.readF32(),t.rifleHeadMultiplier=e.readF32(),t.beamColor=ax(e),t.fadeTime=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32(),t.lightColor=ax(e),t.lightRadius=e.readF32();let a=[];for(let t=0;t<12;t++)a.push(e.readString());return t.textures=a,t}function aq(e){let t=aA(e);t.zapDuration=e.readF32(),t.boltLength=e.readF32(),t.numParts=e.readF32(),t.lightningFreq=e.readF32(),t.lightningDensity=e.readF32(),t.lightningAmp=e.readF32(),t.lightningWidth=e.readF32(),t.shockwave=ab(e);let a=[],r=[],i=[],n=[];for(let t=0;t<2;t++)a.push(e.readF32()),r.push(e.readF32()),i.push(e.readF32()),n.push(e.readF32());t.startWidth=a,t.endWidth=r,t.boltSpeed=i,t.texWrap=n;let o=[];for(let t=0;t<4;t++)o.push(e.readString());return t.textures=o,t.emitter=ab(e),t}function a_(e){let t=aA(e);return t.beamRange=e.readF32(),t.beamDrainRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t.flareTexture=e.readString(),t.hitEmitter=ab(e),t}function aH(e){let t=aA(e);return t.beamRange=e.readF32(),t.beamRepairRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t}function aW(e){let t=aA(e);t.maxRifleRange=e.readF32(),t.beamColor=ax(e),t.startBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32();let a=[];for(let t=0;t<4;t++)a.push(e.readString());return t.textures=a,t}function a$(e){let t=aV(e);return t.tracerLength=e.readF32(),t.tracerAlpha=e.readF32(),t.tracerMinPixels=e.readF32(),t.crossViewFraction=aP(e),t.tracerColor=ax(e),t.tracerWidth=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=aP(e),t.textureName0=e.readString(),t.textureName1=e.readString(),t}function aZ(e){let t=aO(e);return t.energyDrainPerSecond=e.readF32(),t.energyMinDrain=e.readF32(),t.beamWidth=e.readF32(),t.beamRange=e.readF32(),t.numSegments=e.readF32(),t.texRepeat=e.readF32(),t.beamFlareAngle=e.readF32(),t.beamTexture=e.readString(),t.flareTexture=e.readString(),t}function aX(e){let t=aV(e);return t.numFlares=e.readF32(),t.flareColor=ax(e),t.flareTexture=e.readString(),t.smokeTexture=e.readString(),t.size=e.readF32(),t.flareModTexture=e.readF32(),t.smokeSize=e.readF32(),t}function aJ(e){let t=aO(e);return t.smokeDist=e.readF32(),t.noSmoke=e.readF32(),t.boomTime=e.readF32(),t.casingDist=e.readF32(),t.smokeCushion=e.readF32(),t.noSmokeCounter=e.readF32(),t.smokeTexture=e.readString(),t.bombTexture=e.readString(),t}function aY(e){let t=aO(e);return t.size=e.readF32(),t.useLensFlare=aP(e),t.flareTexture=e.readString(),t.lensFlareTexture=e.readString(),t}function aQ(e){let t={};t.dtsFileName=e.readString(),t.soundProfile=ab(e),t.particleEmitter=ab(e),t.particleDensity=e.readInt(14),t.particleRadius=e.readF32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.explosionScale={x:e.readInt(16),y:e.readInt(16),z:e.readInt(16)}),t.playSpeed=e.readInt(14),t.debrisThetaMin=e.readRangedU32(0,180),t.debrisThetaMax=e.readRangedU32(0,180),t.debrisPhiMin=e.readRangedU32(0,360),t.debrisPhiMax=e.readRangedU32(0,360),t.debrisMinVelocity=e.readRangedU32(0,1e3),t.debrisMaxVelocity=e.readRangedU32(0,1e3),t.debrisNum=e.readInt(14),t.debrisVariance=e.readRangedU32(0,1e4),t.delayMS=e.readInt(16),t.delayVariance=e.readInt(16),t.lifetimeMS=e.readInt(16),t.lifetimeVariance=e.readInt(16),t.offset=e.readF32(),t.shakeCamera=e.readFlag(),t.hasLight=e.readFlag(),t.camShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeDuration=e.readF32(),t.camShakeRadius=e.readF32(),t.camShakeFalloff=e.readF32(),t.shockwave=ab(e),t.debris=ab(e);let a=[];for(let t=0;t<4;t++)a.push(ab(e));t.emitters=a;let r=[];for(let t=0;t<5;t++)r.push(ab(e));t.subExplosions=r;let i=e.readRangedU32(0,4),n=[];for(let t=0;t0&&ry("DataBlock binding: %d/%d bound, missing parsers: %s",t,e3.length,a.join(", "));const{bound:r,missing:i}=this.registry.bindDeterministicGhosts(e2,0);i.length>0&&ry("Ghost binding: %d/%d bound, missing parsers: %s",r,e2.length,i.join(", "));const{bound:n,missing:o}=this.registry.bindDeterministicEvents(e1,255);o.length>0&&ry("Event binding: %d/%d bound, missing parsers: %s",n,e1.length,o.join(", ")),this.packetParser=new e8(this.registry,this.ghostTracker)}getRegistry(){return this.registry}getGhostTracker(){return this.ghostTracker}getPacketParser(){return this.packetParser}get loaded(){return this._loaded}get header(){if(!this._loaded)throw Error("must call load() first");return this._header}get initialBlock(){if(!this._loaded)throw Error("must call load() first");return this._initialBlock}get blockCount(){if(!this._loaded)throw Error("must call load() first");if(void 0===this._blockCount){let e=this._decompressedData,t=this._decompressedView,a=0,r=0;for(;r+2<=e.length;){let i=4095&t.getUint16(r,!0);if((r+=2+i)>e.length)break;a++}this._blockCount=a}return this._blockCount}get blockCursor(){if(!this._loaded)throw Error("must call load() first");return this._blockCursor}async load(){if(this._loaded)return{header:this._header,initialBlock:this._initialBlock};let e=this.readHeader();ry('header: "%s" version=0x%s length=%dms (%smin) initialBlockSize=%d',e.identString,e.protocolVersion.toString(16),e.demoLengthMs,(e.demoLengthMs/1e3/60).toFixed(1),e.initialBlockSize);let t=this.buffer.subarray(this.offset,this.offset+e.initialBlockSize),a=this.readInitialBlock(t);this.offset+=e.initialBlockSize;let r=this.buffer.subarray(this.offset);ry("compressed block stream: %d bytes",r.length);let i=await new Promise((e,t)=>{var a,i;a=(a,r)=>{a?t(a):e(r)},i||(i=a,a={}),"function"!=typeof i&&T(7),eo(r,a,[ee],function(e){return ei(eP(e.data[0],en(e.data[1])))},1,i)});return ry("decompressed block stream: %d bytes",i.length),this._decompressedData=i,this._decompressedView=new DataView(i.buffer,i.byteOffset,i.byteLength),this.setupPacketParser(a),this._header=e,this._initialBlock=a,this._blockStreamOffset=0,this._blockCursor=0,this._loaded=!0,{header:e,initialBlock:a}}nextBlock(){if(!this._loaded)throw Error("must call load() first");let e=this._decompressedData,t=this._decompressedView,a=this._blockStreamOffset;if(a+2>e.length)return;let r=t.getUint16(a,!0),i=r>>12,n=4095&r;if(a+2+n>e.length)return void rk("block %d: size %d would exceed decompressed data (offset=%d remaining=%d), stopping",this._blockCursor,n,a+2,e.length-a-2);let o=e.subarray(a+2,a+2+n);this._blockStreamOffset=a+2+n;let s={index:this._blockCursor,type:i,size:n,data:o};if(this._blockCursor++,0===i)try{s.parsed=this.packetParser.parsePacket(o)}catch{}else if(1===i)this.packetParser.onSendPacketTrigger();else if(2===i&&64===n)try{s.parsed=this.readRawMove(o)}catch{}else if(3===i&&8===n)try{s.parsed=this.readInfoBlock(o)}catch{}return s}reset(){if(!this._loaded)throw Error("must call load() first");this._blockStreamOffset=0,this._blockCursor=0,this._blockCount=void 0,this.setupPacketParser(this._initialBlock)}processBlocks(e){if(!this._loaded)throw Error("must call load() first");let t=0;for(let a=0;a=128&&t<128+e3.length?e3[t-128]:`unknown(${t})`;throw Error(`No parser for DataBlock classId ${t} (${e}) at bit ${n}`)}}ry("all %d/%d DataBlocks parsed (%d payloads), bit position after DataBlocks: %d",l,n,s.size,r.getCurPos());let d=0!==r.readU8(),c=[];for(let e=0;e<6;e++)c.push(r.readU32());let h=[];for(let e=0;e<16;e++)h.push(r.readU32());let u=r.readU32(),g=[];for(let e=0;e>3<<3),this.readSimpleTargetManager(r),this.readSimpleTargetManager(r),rS('after sequential tail bit=%d mission="%s" CRC=0x%s',r.getCurPos(),B,M.toString(16))}catch(e){a=e instanceof Error?e.message:String(e)}finally{this.ghostTracker=x}let T=b-r.getCurPos(),N=B.length>0?B.split("").filter(e=>{let t=e.charCodeAt(0);return t>=32&&t<=126}).length/B.length:1,G=B.length>0&&N>=.8&&void 0===a;return ry('initial block: events=%d ghosts=%d ghostingSeq=%d controlObj=%d mission="%s" CRC=0x%s valid=%s%s',P.length,w.length,C,E,B,M.toString(16),G,a?` error=${a}`:""),{taggedStrings:i,dataBlockHeaders:o,dataBlockCount:l,dataBlocks:s,firstPerson:d,connectionFields:c,stateArray:h,scoreEntries:g,demoValues:p,sensorGroupColors:f,targetEntries:m,connectionState:F,roundTripTime:v,packetLoss:y,pathManager:S,notifyCount:k,nextRecvEventSeq:D,ghostingSequence:C,initialGhosts:w,initialEvents:P,controlObjectGhostIndex:E,controlObjectData:t,missionName:B,missionCRC:M,phase2TrailingBits:T,phase2Valid:G,phase2Error:a}}readScoreEntry(e){let t=e.readFlag()?e.readInt(16):0,a=e.readFlag()?e.readInt(16):0,r=e.readFlag()?e.readInt(16):0,i=e.readInt(6),n=e.readInt(6),o=e.readInt(6),s=e.readFlag(),l=[];for(let t=0;t<6;t++)l.push(e.readFlag());return{clientId:t,teamId:a,score:r,field0:i,field1:n,field2:o,isBot:s,triggerFlags:l}}readDemoValues(e){let t=[];for(;e.readFlag();)t.push(e.readString());return t}readComplexTargetManager(e){e.readU8(),e.readU8(),e.readU8(),e.readU8();let t=[];for(let a=0;a<32;a++)for(let r=0;r<32;r++)e.readFlag()&&t.push({group:a,targetGroup:r,r:e.readU8(),g:e.readU8(),b:e.readU8(),a:e.readU8()});let a=[];for(let t=0;t<512;t++){if(!e.readFlag())continue;let r={targetId:t,sensorGroup:0,targetData:0,damageLevel:0};e.readFlag()&&(r.sensorData=e.readU32()),e.readFlag()&&(r.voiceMapData=e.readU32()),e.readFlag()&&(r.name=e.readString()),e.readFlag()&&(r.skin=e.readString()),e.readFlag()&&(r.skinPref=e.readString()),e.readFlag()&&(r.voice=e.readString()),e.readFlag()&&(r.typeDescription=e.readString()),r.sensorGroup=e.readInt(5),r.targetData=e.readInt(9),t>=32&&e.readFlag()&&(r.dataBlockRef=e.readInt(11)),r.damageLevel=e.readFloat(7),a.push(r)}return{sensorGroupColors:t,targets:a}}readPathManager(e){let t=[],a=e.readU32();for(let r=0;rthis.registry.getDataBlockParser(e)};t=n.unpack(e,a)}catch{a.push({classId:r,guaranteed:!0,dataBitsStart:i,dataBitsEnd:i});break}else{a.push({classId:r,guaranteed:!0,dataBitsStart:i,dataBitsEnd:i});break}a.push({classId:r,guaranteed:!0,dataBitsStart:i,dataBitsEnd:e.getCurPos(),parsedData:t}),rS(" event classId=%d bits=%d",r,e.getCurPos()-i)}return{nextRecvEventSeq:t,events:a}}readGhostStartBlock(e,t){let a=e.readU32(),r=[];rS("ghost block: seq=%d bit=%d",a,e.getCurPos());let i=this.registry.getGhostCatalog(),n=8*e.getBuffer().length,o=new Map;for(let[e,a]of t)o.set(e,a.data);for(;e.readFlag()&&!e.isError();){let a=e.readInt(10),s=e.readInt(7)+0,l=e.getCurPos(),d=[],c=new Set,{entry:h}=this.identifyGhostViaDataBlock(e,t,i),u=this.registry.getGhostParser(s);u&&(d.push({entry:u,method:"registry"}),c.add(u)),h&&!c.has(h)&&(d.push({entry:h,method:"datablock"}),c.add(h));let g={getDataBlockData:e=>o.get(e),getDataBlockParser:e=>this.registry.getDataBlockParser(e)},p=!1;for(let{entry:t,method:i}of d){let o="registry"===i,d=this.tryGhostParser(e,t,l,n,!1,g,o);if(!1!==d){this.ghostTracker.createGhost(a,s,t.name),rS(" ghost idx=%d classId=%d parser=%s bits=%d via=%s",a,s,t.name,e.getCurPos()-l,i),r.push({index:a,type:"create",classId:s,updateBitsStart:l,updateBitsEnd:e.getCurPos(),parsedData:d}),p=!0;break}}if(!p){rS(" ghost idx=%d classId=%d NO PARSER (stopping at bit=%d, remaining=%d)",a,s,l,n-l);break}}return rS("ghost loop ended at bit=%d remaining=%d count=%d",e.getCurPos(),n-e.getCurPos(),r.length),{ghostingSequence:a,ghosts:r}}tryGhostParser(e,t,a,r,i=!1,n,o=!1){let s=e.savePos();i||rS(" try %s: startBit=%d",t.name,a);try{let l=t.unpackUpdate(e,!0,{compressionPoint:{x:0,y:0,z:0},ghostTracker:this.ghostTracker,...n}),d=e.getCurPos()-a,c=r-e.getCurPos();if(e.isError()||!o&&d<3)return i||rS(" reject %s: bits=%d isError=%s",t.name,d,e.isError()),e.restorePos(s),!1;if(c>1e3){let a=e.getCurPos(),r=e.readFlag();if(e.setCurPos(a),!r)return i||rS(" reject %s: bits=%d misaligned (remaining=%d)",t.name,d,c),e.restorePos(s),!1}return l??{}}catch(a){return i||rS(" reject %s: error at bit=%d: %s",t.name,e.getCurPos(),a instanceof Error?a.message:String(a)),e.restorePos(s),!1}}identifyGhostViaDataBlock(e,t,a){let r;if(!t)return{entry:void 0,dbFlag:!1};let i=e.savePos(),n=!1;try{if(n=e.readFlag()){let i=e.readInt(11),n=t.get(i);if(n){let e=n.className.replace(/Data$/,"");(r=a.get(e))||rS(" identifyGhostViaDataBlock: dbId=%d className=%s ghostName=%s (no ghost parser)",i,n.className,e)}else rS(" identifyGhostViaDataBlock: dbId=%d (no DataBlock found)",i)}else rS(" identifyGhostViaDataBlock: DataBlock flag=0")}catch{}return e.restorePos(i),{entry:r,dbFlag:n}}readRawMove(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getInt32(0,!0),r=t.getInt32(4,!0),i=t.getInt32(8,!0),n=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getFloat32(24,!0),d=t.getFloat32(28,!0),c=t.getFloat32(32,!0),h=t.getFloat32(36,!0),u=t.getFloat32(40,!0),g=t.getFloat32(44,!0),p=t.getUint32(48,!0),f=t.getUint32(52,!0),m=0!==e[56],F=[];for(let t=0;t<6;t++)F.push(0!==e[57+t]);return{px:a,py:r,pz:i,pyaw:n,ppitch:o,proll:s,x:l,y:d,z:c,yaw:h,pitch:u,roll:g,id:p,sendCount:f,freeLook:m,trigger:F}}readInfoBlock(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{value1:t.getUint32(0,!0),value2:t.getFloat32(4,!0)}}}function rI(){let e=new e6,t=new e4;ak(e),t3(e),rv(e),e.bindDeterministicDataBlocks(e3,128),e.bindDeterministicGhosts(e2,0),e.bindDeterministicEvents(e1,255);let a=new e8(e,t,{dataBlockDataMap:new Map});return{registry:e,ghostTracker:t,packetParser:a}}e.s(["DemoParser",()=>rb],58281),e.s(["createLiveParser",()=>rI],45853),e.s([],50593);var rx=e.i(90072);let rP=new Set(["FlyingVehicle","HoverVehicle","WheeledVehicle"]),rD=new Set(["BombProjectile","EnergyProjectile","FlareProjectile","GrenadeProjectile","LinearFlareProjectile","LinearProjectile","Projectile","SeekerProjectile","TracerProjectile"]),rC=new Set(["LinearProjectile","TracerProjectile","LinearFlareProjectile","Projectile"]),rw=new Set(["GrenadeProjectile","EnergyProjectile","FlareProjectile","BombProjectile"]),rE=new Set(["SeekerProjectile"]),rB=new Set(["StaticShape","ScopeAlwaysShape","Turret","BeaconObject","ForceFieldBare"]);function rM(e){return"Player"===e?"Player":rP.has(e)?"Vehicle":"Item"===e?"Item":rD.has(e)?"Projectile":rB.has(e)?"Deployable":"Ghost"}function rT(e,t){return`${e}_${t}`}let rN=Object.freeze({r:0,g:255,b:0}),rG=Object.freeze({r:255,g:0,b:0});e.s(["IFF_GREEN",0,rN,"IFF_RED",0,rG,"TICK_DURATION_MS",0,32,"ballisticProjectileClassNames",0,rw,"linearProjectileClassNames",0,rC,"projectileClassNames",0,rD,"seekerProjectileClassNames",0,rE,"toEntityId",()=>rT,"toEntityType",()=>rM],25311);let rR=new rx.Matrix4,rU=new rx.Quaternion;function rj(e,t,a){return ea?a:e}let rA=.494*Math.PI;function rV(e,t){let a=Math.sin(t),r=Math.cos(t),i=Math.sin(e),n=Math.cos(e);return rR.set(-i,n*a,-n*r,0,0,r,a,0,n,i*a,-i*r,0,0,0,0,1),rU.setFromRotationMatrix(rR),[rU.x,rU.y,rU.z,rU.w]}function rO(e){let t=-e/2;return[0,Math.sin(t),0,Math.cos(t)]}function rz(e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(e.z)||!Number.isFinite(e.w))return null;let t=-e.y,a=-e.z,r=-e.x,i=e.w,n=t*t+a*a+r*r+i*i;if(n<=1e-12)return null;let o=1/Math.sqrt(n);return[t*o,a*o,r*o,i*o]}function rL(e){return Math.atan2(2*(e.w*e.z+e.x*e.y),e.w*e.w+e.x*e.x-e.y*e.y-e.z*e.z)}function rq(e){return Math.asin(Math.max(-1,Math.min(1,2*(e.w*e.x-e.y*e.z))))}function r_(e){return null!=e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function rH(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z}function rW(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z&&"number"==typeof e.w}function r$(e,t){let a;if(t)return"string"==typeof(a=rD.has(e)||e.endsWith("ProjectileData")?t.projectileShapeName:"DebrisData"===e?t.shapeFileName:t.shapeName)&&a.length>0?a:void 0}function rZ(e,t){if(e)for(let a of t){let t=e[a];if("number"==typeof t&&Number.isFinite(t))return t}}function rX(e,t){if(e)for(let a of t){let t=e[a];if("string"==typeof t&&t.length>0)return t}}function rJ(e,t){if(!t)return;let a=rX(t,["tracerTex0","textureName0","texture0"])??"";if(!("TracerProjectile"===e||a.length>0&&null!=rZ(t,["tracerLength"]))||!a)return;let r=rX(t,["tracerTex1","textureName1","texture1"]),i=rZ(t,["tracerLength"])??10,n=rZ(t,["tracerWidth"]),o=rZ(t,["tracerAlpha"]),s=null!=n&&(null!=rZ(t,["crossViewAng"])||n<=.7)?n:o??n??.5,l=rZ(t,["crossViewAng","crossViewFraction"])??("number"==typeof t.tracerWidth&&t.tracerWidth>.7?t.tracerWidth:.98);return{kind:"tracer",texture:a,crossTexture:r,tracerLength:i,tracerWidth:s,crossViewAng:l,crossSize:rZ(t,["crossSize","muzzleVelocity"])??.45,renderCross:function(e,t){if(e)for(let a of t){let t=e[a];if("boolean"==typeof t)return t}}(t,["renderCross","proximityRadius"])??!0}}function rY(e,t){if(t){if("LinearFlareProjectile"===e){let e=rX(t,["smokeTexture","flareTexture"]);if(!e)return;let a=t.flareColor,r=rZ(t,["size"])??.5;return{kind:"sprite",texture:e,color:a?{r:a.r,g:a.g,b:a.b}:{r:1,g:1,b:1},size:r}}if("FlareProjectile"===e){let e=rX(t,["flareTexture"]);if(!e)return;return{kind:"sprite",texture:e,color:{r:1,g:.9,b:.5},size:rZ(t,["size"])??4}}}}function rQ(e){let t=e.states;if(Array.isArray(t)&&0!==t.length)return t.map(e=>{let t=e=>null==e?-1:e-1;return{name:e.name??"",transitionOnNotLoaded:t(e.transitionOnAmmo),transitionOnLoaded:t(e.transitionOnNoAmmo),transitionOnNoAmmo:t(e.transitionOnTarget),transitionOnAmmo:t(e.transitionOnNoTarget),transitionOnNoTarget:t(e.transitionOnWet),transitionOnTarget:t(e.transitionOnNotWet),transitionOnNotWet:t(e.transitionOnTriggerUp),transitionOnWet:t(e.transitionOnTriggerDown),transitionOnTriggerUp:t(e.transitionOnTimeout),transitionOnTriggerDown:t(e.transitionGeneric0In),transitionOnTimeout:t(e.transitionGeneric0Out),timeoutValue:e.timeoutValue,waitForTimeout:e.waitForTimeout??!1,fire:e.fire??!1,sequence:e.sequence,spin:e.spin??0,direction:e.direction??!0,scaleAnimation:e.scaleAnimation??!1,loaded:e.loaded??0,soundDataBlockId:e.sound??-1}})}function rK(e){let t="";for(let a=0;a=32&&(t+=e[a]);return t}let r0={2:0,3:1,4:2,5:3,6:4,7:5,8:6,11:7,12:8,14:9};function r3(e){for(let t=0;t=32)break}}function r2(e){let t=[],a=0,r="",i=!1;for(let n=0;n=32&&(r+=e[n]);continue}let s=r0[o];void 0!==s?(r&&(t.push({text:r,colorCode:a}),r=""),a=s):15===o?(r&&(t.push({text:r,colorCode:a}),r=""),a=0):o>=32&&(r+=e[n])}return r&&t.push({text:r,colorCode:a}),t}function r1(e){let t=e.indexOf("~w");return -1===t?{text:e,wavPath:null}:{text:e.substring(0,t),wavPath:e.substring(t+2)}}function r5(e){return e?"number"==typeof e.cameraMode?"camera":"number"==typeof e.rotationZ?"player":null:null}let r8=new Map([["gui/hud_new_packammo",0],["gui/hud_new_packcloak",1],["gui/hud_new_packenergy",2],["gui/hud_new_packrepair",3],["gui/hud_new_packsatchel",4],["gui/hud_new_packshield",5],["gui/hud_new_packinventory",6],["gui/hud_new_packmotionsens",7],["gui/hud_new_packradar",8],["gui/hud_new_packturretout",9],["gui/hud_new_packturretin",10],["gui/hud_new_packsensjam",11],["gui/hud_new_packturret",12],["gui/hud_satchel_unarmed",18]]);function r6(e){let t=e.toLowerCase();for(let[e,a]of r8)if(e===t)return a;return -1}e.s(["CameraMode_OrbitObject",0,3,"MAX_PITCH",0,rA,"backpackBitmapToIndex",()=>r6,"clamp",()=>rj,"detectColorCode",()=>r3,"detectControlObjectType",()=>r5,"extractWavTag",()=>r1,"getNumberField",()=>rZ,"isQuatLike",()=>rW,"isValidPosition",()=>r_,"isVec3Like",()=>rH,"parseColorSegments",()=>r2,"parseWeaponImageStates",()=>rQ,"playerYawToQuaternion",()=>rO,"resolveShapeName",()=>r$,"resolveSpriteVisual",()=>rY,"resolveTracerVisual",()=>rJ,"stripTaggedStringMarkup",()=>rK,"torqueQuatHeading",()=>rL,"torqueQuatPitch",()=>rq,"torqueQuatToThreeJS",()=>rz,"yawPitchToQuaternion",()=>rV],89119),e.i(70847);var r4=e.i(47566);let r7=(0,e.i(25645).createLogger)("StreamEngine");class r9{registry;ghostTracker;entities=new Map;entityIdByGhostIndex=new Map;tickCount=0;camera=null;chatMessages=[];chatMessageIdCounter=0;_chatGen=0;_chatSnapshotGen=-1;_chatSnapshot=[];audioEvents=[];netStrings=new Map;targetNames=new Map;targetTeams=new Map;targetRenderFlags=new Map;pendingNameTags=new Map;sensorGroupColors=new Map;playerSensorGroup=0;lastStatus={health:1,energy:1};latestControl={ghostIndex:-1};controlPlayerGhostId;lastControlType="camera";isPiloting=!1;lastPilotGhostIndex;lastVehicleHeading=0;lastVehiclePitch=0;lastVehicleOrbitDir;lastVehicleVelocity;lastVehiclePosTime=0;lastVehiclePos;firstPerson=!0;lastCameraMode;lastOrbitGhostIndex;lastOrbitDistance;latestFov=90;weaponsHud={slots:new Map,activeIndex:-1};backpackHud={packIndex:-1,active:!1,text:""};inventoryHud={slots:new Map,activeSlot:-1};teamScores=[];playerRoster=new Map;missionDisplayName=null;missionTypeDisplayName=null;gameClassName=null;serverDisplayName=null;connectedPlayerName=null;onMissionInfoChange;nextExplosionId=0;resolveGhostClassName(e,t){if("number"==typeof t){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let a=this.entityIdByGhostIndex.get(e);if(a){let e=this.entities.get(a);if(e?.className)return e.className}let r=this.ghostTracker.getGhost(e);if(r?.className)return r.className}resolveEntityIdForGhostIndex(e){let t=this.entityIdByGhostIndex.get(e);if(t)return t;let a=this.ghostTracker.getGhost(e);if(a)return rT(a.className,e)}resetSharedState(){this.entities.clear(),this.entityIdByGhostIndex.clear(),this.tickCount=0,this.camera=null,this.chatMessages=[],this.chatMessageIdCounter=0,this._chatGen=0,this._chatSnapshotGen=-1,this._chatSnapshot=[],this.audioEvents=[],this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.targetRenderFlags.clear(),this.sensorGroupColors.clear(),this.playerSensorGroup=0,this.lastStatus={health:1,energy:1},this.latestControl={ghostIndex:-1},this.controlPlayerGhostId=void 0,this.lastControlType="camera",this.isPiloting=!1,this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0,this.firstPerson=!0,this.lastCameraMode=void 0,this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0,this.latestFov=90,this.weaponsHud={slots:new Map,activeIndex:-1},this.backpackHud={packIndex:-1,active:!1,text:""},this.inventoryHud={slots:new Map,activeSlot:-1},this.teamScores=[],this.playerRoster.clear(),this.nextExplosionId=0,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.connectedPlayerName=null}resolveNetString(e){if(e.length>=2&&1===e.charCodeAt(0)){let t=parseInt(e.slice(1),10);if(Number.isFinite(t))return this.netStrings.get(t)??e}return e}formatRemoteArgs(e,t){let a=this.resolveNetString(e);for(let e=0;e0&&(this.playerSensorGroup=t.sensorGroup)}if(t){let e=r5(t);if(e&&(this.lastControlType=e),"player"===this.lastControlType)this.isPiloting=!!(t.pilot||null!=t.controlObjectGhost),this.isPiloting&&"number"==typeof t.controlObjectGhost?this.lastPilotGhostIndex=t.controlObjectGhost:this.isPiloting||(this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0);else if(this.isPiloting=!1,"number"==typeof t.cameraMode)if(this.lastCameraMode=t.cameraMode,3===t.cameraMode){"number"==typeof t.orbitObjectGhostIndex&&(this.lastOrbitGhostIndex=t.orbitObjectGhostIndex);let e=t.minOrbitDist,a=t.maxOrbitDist,r=t.curOrbitDist;"number"==typeof e&&"number"==typeof a&&Number.isFinite(e)&&Number.isFinite(a)?this.lastOrbitDistance=Math.max(0,a-e):"number"==typeof r&&Number.isFinite(r)&&(this.lastOrbitDistance=Math.max(0,r))}else this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0}void 0!==e.cameraFov&&(this.latestFov=e.cameraFov)}processEvent(e,t){let a=e.parsedData;if(!a)return;let r=a.type;if("GhostAlwaysObjectEvent"===r){let e=a.ghostIndex,t=a.classId,r=a.objectData,i=a._hasObjectData,n="number"==typeof t?this.registry.getGhostParser(t)?.name??`classId=${t}`:"?";r7.debug("GhostAlwaysObjectEvent: ghost=%d class=%s hasData=%s %s",e,n,i,r?`keys=[${Object.keys(r).join(",")}]`:"(no data)"),null!=e&&null!=t&&this.processGhostUpdate({index:e,type:"create",classId:t,parsedData:r});return}if("NetStringEvent"===r||"NetStringEvent"===t){let e=a.id,t=a.value;if(null!=e&&"string"==typeof t){this.netStrings.set(e,t);let a=this.pendingNameTags.get(e);if(null!=a){this.pendingNameTags.delete(e);let r=rK(t);for(let e of(this.targetNames.set(a,r),this.entities.values()))e.targetId===a&&(e.playerName=r)}}return}if("TargetInfoEvent"===r||"TargetInfoEvent"===t){let e=a.targetId,t=a.nameTag;if(null!=e&&null!=t){let a=this.netStrings.get(t);a?this.targetNames.set(e,rK(a)):this.pendingNameTags.set(t,e)}let r=a.sensorGroup;null!=e&&null!=r&&this.targetTeams.set(e,r);let i=a.renderFlags;if(null!=e&&null!=i&&this.targetRenderFlags.set(e,i),null!=e){let t=this.targetNames.get(e),a=this.targetTeams.get(e),r=this.targetRenderFlags.get(e);for(let i of this.entities.values())i.targetId===e&&(t&&(i.playerName=t),null!=a&&(i.sensorGroup=a),null!=r&&(i.targetRenderFlags=r))}return}if("SetSensorGroupEvent"===r||"SetSensorGroupEvent"===t){let e=a.sensorGroup;null!=e&&(this.playerSensorGroup=e);return}if("SensorGroupColorEvent"===r||"SensorGroupColorEvent"===t){let e=a.sensorGroup,t=a.colors;if(t){let a=this.sensorGroupColors.get(e);for(let r of(a||(a=new Map,this.sensorGroupColors.set(e,a)),t))r.default?a.delete(r.index):a.set(r.index,{r:r.r??0,g:r.g??0,b:r.b??0})}return}if("RemoteCommandEvent"===r||"RemoteCommandEvent"===t){let e=this.resolveNetString(a.funcName),t=a.args,r=this.getTimeSec();if("ChatMessage"===e&&t.length>=4){let e=r3(this.resolveNetString(t[3])),a=t[4]?rK(this.resolveNetString(t[4])):"",i=this.formatRemoteArgs(t[3],t.slice(4));if(i){let n,o,s=i.indexOf(": "),{text:l,wavPath:d}=r1(s>=0?i.slice(s+2):i);if(d){let e=this.resolveNetString(t[1]);n=e?`voice/${e}/${d}.wav`:d;let a=this.resolveNetString(t[2]);if(a){let e=parseFloat(a);Number.isFinite(e)&&(o=Math.max(.5,Math.min(2,e)))}}let c=e??0;this.pushChatMessage({timeSec:r,sender:a,text:l,kind:"chat",colorCode:c,segments:[{text:a?`${a}: ${l}`:l,colorCode:c}],soundPath:n,soundPitch:o})}}else if("CannedChatMessage"===e&&t.length>=6){let e=r3(this.resolveNetString(t[1])),a=rK(this.resolveNetString(t[2])),i=rK(this.resolveNetString(t[4])),n=this.formatRemoteArgs(t[1],t.slice(2));if(n){let o,s,{wavPath:l}=r1(n),d=r1(rK(this.resolveNetString(t[3]))).text;if(l){let e=this.resolveNetString(t[5]);if(o=e?`voice/${e}/${l}.wav`:l,t[6]){let e=parseFloat(this.resolveNetString(t[6]));Number.isFinite(e)&&(s=Math.max(.5,Math.min(2,e)))}}let c=e??0,h=[];i&&h.push({text:`[${i}] `,colorCode:0}),h.push({text:a?`${a}: ${d}`:d,colorCode:c}),this.pushChatMessage({timeSec:r,sender:a,text:d,kind:"chat",colorCode:c,segments:h,soundPath:o,soundPitch:s})}}else if("ServerMessage"===e&&t.length>=2){this.handleServerMessage(t);let e=r3(this.resolveNetString(t[1])),a=this.formatRemoteArgs(t[1],t.slice(2));if(a){let{text:t,wavPath:i}=r1(a),n=e??0;this.pushChatMessage({timeSec:r,sender:"",text:t,kind:"server",colorCode:n,segments:[{text:t,colorCode:n}],soundPath:i??void 0})}}else this.handleHudRemoteCommand(e,t);return}if("Sim3DAudioEvent"===r||"Sim2DAudioEvent"===r||"Sim3DAudioEvent"===t||"Sim2DAudioEvent"===t){let e=a.profileId;if("number"==typeof e){let i=this.getTimeSec(),n="Sim3DAudioEvent"===r||"Sim3DAudioEvent"===t?a.position:void 0;this.audioEvents.push({profileId:e,position:n,timeSec:i}),this.audioEvents.length>100&&this.audioEvents.splice(0,this.audioEvents.length-100)}}}processGhostUpdate(e){let t,a=e.index,r=this.entityIdByGhostIndex.get(a);if(r){let t=this.entities.get(r);t&&"Projectile"===t.type&&!t.hasExploded&&null!=t.explosionDataBlockId&&t.position&&("delete"===e.type||"create"===e.type)&&this.spawnExplosion(t,[...t.position])}if("delete"===e.type){r&&(this.removeSoundSlotEntities(r),this.entities.delete(r),this.entityIdByGhostIndex.delete(a));return}let i=this.resolveGhostClassName(a,e.classId);if(!i){if("create"===e.type)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${a})`);return}let n=rT(i,a);r&&r!==n&&(this.removeSoundSlotEntities(r),this.entities.delete(r));let o=this.entities.get(n);if(o&&"create"===e.type?(this.removeSoundSlotEntities(n),o.spawnTick=this.tickCount,this.resetEntity(o),t=o):o?t=o:(t={id:n,ghostIndex:a,className:i,spawnTick:this.tickCount,type:rM(i),rotation:[0,0,0,1]},this.entities.set(n,t)),t.ghostIndex=a,t.className=i,t.type=rM(i),this.entityIdByGhostIndex.set(a,n),this.applyGhostData(t,e.parsedData),"create"===e.type&&e.parsedData){let r=(0,r4.ghostToSceneObject)(i,a,e.parsedData);r&&(t.sceneData=r)}}resetEntity(e){e.rotation=[0,0,0,1],e.hasExploded=void 0,e.explosionShape=void 0,e.explosionLifetimeTicks=void 0,e.faceViewer=void 0,e.simulatedVelocity=void 0,e.projectilePhysics=void 0,e.gravityMod=void 0,e.direction=void 0,e.velocity=void 0,e.position=void 0,e.dataBlock=void 0,e.dataBlockId=void 0,e.shapeHint=void 0,e.visual=void 0,e.targetId=void 0,e.targetRenderFlags=void 0,e.carryingFlag=void 0,e.sensorGroup=void 0,e.playerName=void 0,e.weaponShape=void 0,e.packShape=void 0,e.falling=void 0,e.jetting=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0,e.weaponImageStatesDbId=void 0,e.itemPhysics=void 0,e.threads=void 0,e.headPitch=void 0,e.headYaw=void 0,e.health=void 0,e.energy=void 0,e.maxEnergy=void 0,e.damageState=void 0,e.actionAnim=void 0,e.actionAtEnd=void 0,e.explosionDataBlockId=void 0,e.maintainEmitterId=void 0}applyGhostData(e,t){if(!t)return;let a=t.dataBlockId;if(null!=a){e.dataBlockId=a;let t=this.getDataBlockData(a),r=r$(e.className,t);if(e.visual=rJ(e.className,t)??rY(e.className,t),"string"==typeof r&&(e.shapeHint=r,e.dataBlock=r),"Player"===e.type&&"number"==typeof t?.maxEnergy&&(e.maxEnergy=t.maxEnergy),"Projectile"===e.type&&(rC.has(e.className)?e.projectilePhysics="linear":rw.has(e.className)?(e.projectilePhysics="ballistic",e.gravityMod=rZ(t,["gravityMod"])??1):rE.has(e.className)&&(e.projectilePhysics="seeker")),"Projectile"===e.type&&null==e.explosionDataBlockId){let t=this.resolveExplosionInfo(a);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks,e.explosionDataBlockId=t.explosionDataBlockId)}if("Projectile"===e.type&&null==e.maintainEmitterId){let a=t?.baseEmitter;"number"==typeof a&&a>0&&(e.maintainEmitterId=a)}}if("Player"===e.type){let a=t.images;if(Array.isArray(a)&&a.length>0){let t=a.find(e=>0===e.index);if(t?.dataBlockId&&t.dataBlockId>0){let a=this.getDataBlockData(t.dataBlockId),r=r$("ShapeBaseImageData",a);if(r){let t=a?.mountPoint;(null==t||t<=0)&&!/pack_/i.test(r)&&(e.weaponShape=r)}let i=e.weaponImageState;e.weaponImageState={dataBlockId:t.dataBlockId,triggerDown:t.triggerDown??i?.triggerDown??!1,ammo:t.ammo??i?.ammo??!0,loaded:t.loaded??i?.loaded??!0,target:t.target??i?.target??!1,wet:t.wet??i?.wet??!1,fireCount:t.fireCount??i?.fireCount??0},a&&e.weaponImageStatesDbId!==t.dataBlockId&&(e.weaponImageStates=rQ(a),e.weaponImageStatesDbId=t.dataBlockId)}else t&&!t.dataBlockId&&(e.weaponShape=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0);let r=a.find(e=>2===e.index);if(r?.dataBlockId&&r.dataBlockId>0){let t=r$("ShapeBaseImageData",this.getDataBlockData(r.dataBlockId));t&&(e.packShape=t)}else r&&!r.dataBlockId&&(e.packShape=void 0);let i=a.find(e=>3===e.index);if(i?.dataBlockId&&i.dataBlockId>0){e.carryingFlag=!0;let t=r$("ShapeBaseImageData",this.getDataBlockData(i.dataBlockId));if(t&&(e.flagShape=t),null!=e.targetId&&e.targetId>=0){let t=this.targetRenderFlags.get(e.targetId)??0,a=2|t;a!==t&&(this.targetRenderFlags.set(e.targetId,a),e.targetRenderFlags=a)}}else if(i&&!i.dataBlockId&&(e.carryingFlag=!1,e.flagShape=void 0,null!=e.targetId&&e.targetId>=0)){let t=this.targetRenderFlags.get(e.targetId)??0,a=-3&t;a!==t&&(this.targetRenderFlags.set(e.targetId,a),e.targetRenderFlags=a)}}}let r=r_(t.position)?t.position:r_(t.initialPosition)?t.initialPosition:r_(t.explodePosition)?t.explodePosition:r_(t.endPoint)?t.endPoint:r_(t.transform?.position)?t.transform.position:void 0;r&&(e.position=[r.x,r.y,r.z],this.updateSoundSlotPositions(e));let i=rH(t.direction)?t.direction:void 0;if(i&&(e.direction=[i.x,i.y,i.z]),"Player"===e.type&&"number"==typeof t.rotationZ&&(e.rotation=rO(t.rotationZ)),"Player"===e.type&&("number"==typeof t.headX&&(e.headPitch=t.headX),"number"==typeof t.headZ&&(e.headYaw=t.headZ)),rW(t.angPosition)){let a=rz(t.angPosition);a&&(e.rotation=a)}else if(rW(t.transform?.rotation)){let a=rz(t.transform.rotation);a&&(e.rotation=a)}else if("Item"===e.type&&"number"==typeof t.rotation?.angle){let a=t.rotation;e.rotation=rO((a.zSign??1)*a.angle)}else if("Projectile"===e.type){let a=t.velocity??t.direction??(r_(t.initialPosition)&&r_(t.endPos)?{x:t.endPos.x-t.initialPosition.x,y:t.endPos.y-t.initialPosition.y,z:t.endPos.z-t.initialPosition.z}:void 0);rH(a)&&(0!==a.x||0!==a.y)&&(e.rotation=rO(Math.atan2(a.x,a.y)))}if(rH(t.velocity)&&(e.velocity=[t.velocity.x,t.velocity.y,t.velocity.z],e.direction||(e.direction=[t.velocity.x,t.velocity.y,t.velocity.z])),"boolean"==typeof t.moveFlag0&&(e.falling=t.moveFlag0),"boolean"==typeof t.moveFlag1&&(e.jetting=t.moveFlag1),"Item"===e.type){let a=t.atRest;!1===a&&rH(t.velocity)?e.itemPhysics={velocity:[t.velocity.x,t.velocity.y,t.velocity.z],atRest:!1}:!0===a&&(e.itemPhysics=void 0)}if(e.projectilePhysics){if("linear"===e.projectilePhysics){let a=rZ(null!=e.dataBlockId?this.getDataBlockData(e.dataBlockId):void 0,["dryVelocity","muzzleVelocity","bulletVelocity"])??80,r=e.direction??[0,1,0],i=r[0]*a,n=r[1]*a,o=r[2]*a,s=t.excessVel,l=t.excessDir;"number"==typeof s&&s>0&&rH(l)&&(i+=l.x*s,n+=l.y*s,o+=l.z*s),e.simulatedVelocity=[i,n,o]}else rH(t.velocity)&&(e.simulatedVelocity=[t.velocity.x,t.velocity.y,t.velocity.z]);let a=t.currTick;if("number"==typeof a&&a>0&&e.simulatedVelocity&&e.position){let t=.032*a,r=e.simulatedVelocity;if(e.position[0]+=r[0]*t,e.position[1]+=r[1]*t,e.position[2]+=r[2]*t,"ballistic"===e.projectilePhysics){let a=-9.81*(e.gravityMod??1);e.position[2]+=.5*a*t*t,r[2]+=a*t}}}let n=r_(t.explodePosition)?t.explodePosition:r_(t.explodePoint)?t.explodePoint:void 0;if("Projectile"===e.type&&!e.hasExploded&&n&&null!=e.explosionDataBlockId&&this.spawnExplosion(e,[n.x,n.y,n.z]),"number"==typeof t.damageLevel&&(e.health=rj(1-t.damageLevel,0,1)),"number"==typeof t.damageState&&(e.damageState=t.damageState),"number"==typeof t.action&&(e.actionAnim=t.action,e.actionAtEnd=!!t.actionAtEnd),Array.isArray(t.threads)){let a=t.threads;if(e.threads){let t=[...e.threads];for(let e of a){let a=t.findIndex(t=>t.index===e.index);a>=0?t[a]=e:t.push(e)}e.threads=t}else e.threads=a}if("number"==typeof t.energy&&(e.energy=rj(t.energy,0,1)),"number"==typeof t.targetId){e.targetId=t.targetId;let a=this.targetNames.get(t.targetId);a&&(e.playerName=a);let r=this.targetTeams.get(t.targetId);null!=r&&(e.sensorGroup=r,e.ghostIndex===this.latestControl.ghostIndex&&"player"===this.lastControlType&&(this.playerSensorGroup=r));let i=this.targetRenderFlags.get(t.targetId);null!=i&&(e.targetRenderFlags=i)}let o=t.sounds;Array.isArray(o)&&this.syncSoundSlotEntities(e,o),"WayPoint"===e.className&&"string"==typeof t.name&&(e.label=t.name),"AudioEmitter"===e.className&&("string"==typeof t.filename&&(e.audioFileName=t.filename),"number"==typeof t.volume&&(e.audioVolume=t.volume),"boolean"==typeof t.is3D&&(e.audioIs3D=t.is3D),"boolean"==typeof t.isLooping&&(e.audioIsLooping=t.isLooping),"number"==typeof t.minDistance&&(e.audioMinDistance=t.minDistance),"number"==typeof t.maxDistance&&(e.audioMaxDistance=t.maxDistance),"number"==typeof t.minLoopGap&&(e.audioMinLoopGap=t.minLoopGap),"number"==typeof t.maxLoopGap&&(e.audioMaxLoopGap=t.maxLoopGap))}syncSoundSlotEntities(e,t){for(let a of t){let t=`${e.id}:sound:${a.index}`;if(a.playing&&"number"==typeof a.profileId){let r=this.getDataBlockData(a.profileId),i=r?.filename;if(!i)continue;let n=i.endsWith(".wav")?i:`${i}.wav`,o=r.description,s=null!=o?this.getDataBlockData(o):void 0,l=this.entities.get(t);l?l.position=e.position:this.entities.set(t,{id:t,ghostIndex:e.ghostIndex,className:"AudioEmitter",type:"AudioEmitter",spawnTick:this.tickCount,position:e.position,rotation:[0,0,0,1],audioFileName:n,audioVolume:s?.volume??1,audioIs3D:s?.is3D??!0,audioIsLooping:s?.isLooping??!1,audioMinDistance:s?.referenceDistance??20,audioMaxDistance:s?.maxDistance??100,audioMinLoopGap:s?.minLoopGap??0,audioMaxLoopGap:s?.maxLoopGap??0})}else this.entities.delete(t)}}updateSoundSlotPositions(e){for(let t=0;t<4;t++){let a=this.entities.get(`${e.id}:sound:${t}`);a&&(a.position=e.position)}}removeSoundSlotEntities(e){for(let t=0;t<4;t++)this.entities.delete(`${e}:sound:${t}`)}resolveExplosionInfo(e){let t=this.getDataBlockData(e);if(!t)return;let a=t.explosion;if(null==a)return;let r=this.getDataBlockData(a);if(!r)return;let i=r.dtsFileName||void 0,n=r.lifetimeMS??31;return{shape:i,faceViewer:!1!==r.faceViewer&&0!==r.faceViewer,lifetimeTicks:n,explosionDataBlockId:a}}spawnExplosion(e,t){e.hasExploded=!0;let a=e.explosionLifetimeTicks??31,r=`fx_${this.nextExplosionId++}`,i={id:r,ghostIndex:-1,className:"Explosion",spawnTick:this.tickCount,type:"Explosion",dataBlock:e.explosionShape,explosionDataBlockId:e.explosionDataBlockId,position:t,rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==e.faceViewer,expiryTick:this.tickCount+a};if(this.entities.set(r,i),null!=e.explosionDataBlockId){let a=this.getDataBlockData(e.explosionDataBlockId),r=a?.subExplosions;if(Array.isArray(r))for(let e of r){if(null==e)continue;let a=this.getDataBlockData(e);if(!a)continue;let r=a.dtsFileName||void 0;if(!r)continue;let i=a.lifetimeMS??31,n=a.offset??0,o=Math.random()*Math.PI*2,s=[t[0]+Math.cos(o)*n,t[1]+Math.sin(o)*n,t[2]],l=`fx_${this.nextExplosionId++}`,d={id:l,ghostIndex:-1,className:"Explosion",spawnTick:this.tickCount,type:"Explosion",dataBlock:r,explosionDataBlockId:e,position:s,rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==a.faceViewer&&0!==a.faceViewer,expiryTick:this.tickCount+i};this.entities.set(l,d)}}e.position=void 0,e.simulatedVelocity=void 0}advanceProjectiles(){for(let e of this.entities.values()){if(!e.simulatedVelocity||!e.position)continue;let t=e.simulatedVelocity,a=e.position;"ballistic"===e.projectilePhysics&&(t[2]+=-9.81*(e.gravityMod??1)*.032),a[0]+=.032*t[0],a[1]+=.032*t[1],a[2]+=.032*t[2],(0!==t[0]||0!==t[1])&&(e.rotation=rO(Math.atan2(t[0],t[1])))}}advanceItems(){for(let e of this.entities.values()){let t=e.itemPhysics;if(!t||t.atRest||!e.position)continue;let a=t.velocity,r=e.position;r[0]+=.032*a[0],r[1]+=.032*a[1],r[2]+=.032*a[2]}}removeExpiredExplosions(){for(let[e,t]of this.entities)t.isExplosion&&null!=t.expiryTick&&this.tickCount>=t.expiryTick&&this.entities.delete(e)}updateCameraAndHud(){let e=this.latestControl,t=this.getTimeSec(),a=e.data,r=this.lastControlType;if(this.removeExpiredExplosions(),e.position){let{yaw:i,pitch:n}=this.getCameraYawPitch(a);if(this.isPiloting){if(a){let e=a.controlObjectData,t=e?.angPosition;if(t&&"number"==typeof t.w){this.lastVehicleHeading=rL(t),this.lastVehiclePitch=rq(t);let e=rz(t);if(e){let[t,a,r,i]=e;this.lastVehicleOrbitDir=[-(1-2*(a*a+r*r)),-(2*(t*a+r*i)),-(2*(t*r-a*i))]}}}i=this.lastVehicleHeading,n=this.lastVehiclePitch}if(this.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:rV(i,rj(n,-rA,rA)),fov:this.latestFov,mode:"observer",yaw:i,pitch:n},"camera"===r)if(("number"==typeof a?.cameraMode?a.cameraMode:this.lastCameraMode)===3){this.camera.mode="third-person","number"==typeof this.lastOrbitDistance&&(this.camera.orbitDistance=this.lastOrbitDistance);let e="number"==typeof a?.orbitObjectGhostIndex?a.orbitObjectGhostIndex:this.lastOrbitGhostIndex;"number"==typeof e&&e>=0&&(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.camera.mode="observer";else e.ghostIndex>=0&&(this.controlPlayerGhostId=this.resolveEntityIdForGhostIndex(e.ghostIndex)),this.firstPerson?this.camera.mode="first-person":(this.camera.mode="third-person",this.isPiloting&&null!=this.lastPilotGhostIndex?(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),this.camera.orbitDistance=15,this.lastVehicleOrbitDir&&(this.camera.orbitDirection=this.lastVehicleOrbitDir)):(this.camera.orbitTargetId=this.controlPlayerGhostId,this.camera.orbitDistance=3)),this.controlPlayerGhostId&&(this.camera.controlEntityId=this.controlPlayerGhostId);if("player"===r&&e.position){if(this.isPiloting&&null!=this.lastPilotGhostIndex){let r=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),i=r?this.entities.get(r):void 0;if(i){let r=a?.controlObjectData;if(r){i.position=[e.position.x,e.position.y,e.position.z],this.lastVehiclePos=i.position.slice(),this.lastVehiclePosTime=t;let a=r.linMomentum;if(a&&r_(a)){let e=i.dataBlockId,t=null!=e?this.getDataBlockData(e):void 0,r=t?.mass??200,n=r>0?1/r:.005;this.lastVehicleVelocity=[a.x*n,a.y*n,a.z*n],i.velocity=this.lastVehicleVelocity}let n=r.angPosition;if(n&&"number"==typeof n.w){let e=rz(n);e&&(i.rotation=e)}}else if(this.lastVehiclePos&&this.lastVehicleVelocity&&this.lastVehiclePosTime>0){let e=t-this.lastVehiclePosTime;if(e>0&&e<1){let[t,a,r]=this.lastVehicleVelocity;i.position=[this.lastVehiclePos[0]+t*e,this.lastVehiclePos[1]+a*e,this.lastVehiclePos[2]+r*e]}}}}else if(this.controlPlayerGhostId){let t=this.entities.get(this.controlPlayerGhostId);if(t){t.position=[e.position.x,e.position.y,e.position.z],t.rotation=rO(i),t.headPitch=this.getControlPlayerHeadPitch(n);let r=a?.velocity;rH(r)&&(t.velocity=[r.x,r.y,r.z],t.falling=r.z<-10)}}}}else this.camera&&(this.camera={...this.camera,time:t,fov:this.latestFov});let i={health:1,energy:1};if(this.camera?.mode==="first-person"){let e=this.controlPlayerGhostId,t=e?this.entities.get(e):void 0;i.health=t?.health??1;let r=a?.energyLevel;if("number"==typeof r){let e=t?.maxEnergy??60;e>0&&(i.energy=rj(r/e,0,1))}else i.energy=t?.energy??1}else if(this.camera?.mode==="third-person"&&this.camera.orbitTargetId){let e=this.entities.get(this.camera.orbitTargetId);i.health=e?.health??1,i.energy=e?.energy??1}this.lastStatus=i}getControlPlayerHeadPitch(e){return rj(e/rA,-1,1)}getAbsoluteRotation(e){return e?"number"==typeof e.rotationZ&&"number"==typeof e.headX?{yaw:e.rotationZ,pitch:e.headX}:"number"==typeof e.rotZ&&"number"==typeof e.rotX?{yaw:e.rotZ,pitch:e.rotX}:null:null}resolveIffColor(e){if(0===this.playerSensorGroup)return;let t=this.sensorGroupColors.get(this.playerSensorGroup);if(t){let a=t.get(e);if(a)return a}return e===this.playerSensorGroup?rN:0!==e?rG:void 0}pushChatMessage(e){this.chatMessages.push({...e,id:++this.chatMessageIdCounter}),this.chatMessages.length>200&&this.chatMessages.splice(0,this.chatMessages.length-200),this._chatGen++}handleServerMessage(e){if(e.length<2)return;let t=this.resolveNetString(e[0]);if("MsgTeamScoreIs"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(a)){let e=this.teamScores.find(e=>e.teamId===t);e&&(e.score=a,this.onTeamScoresChanged())}}else if("MsgCTFAddTeam"===t&&e.length>=6){let t=parseInt(this.resolveNetString(e[2]),10),a=rK(this.resolveNetString(e[3])),r=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)){let e=t+1,i=this.teamScores.find(t=>t.teamId===e);i?(i.name=a,i.score=isNaN(r)?i.score:r):this.teamScores.push({teamId:e,name:a,score:isNaN(r)?0:r,playerCount:0}),this.onTeamScoresChanged()}}else if("MsgClientJoin"===t&&e.length>=4){let t=rK(this.resolveNetString(e[2])).trim(),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(a)){let e=this.playerRoster.get(a);this.playerRoster.set(a,{name:t,teamId:e?.teamId??0}),this.onRosterChanged()}!this.connectedPlayerName&&t&&(this.connectedPlayerName=t,this.onMissionInfoChange?.())}else if("MsgClientDrop"===t&&e.length>=3){let t=parseInt(this.resolveNetString(e[2]),10);isNaN(t)||(this.playerRoster.delete(t),this.onRosterChanged())}else if("MsgClientJoinTeam"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(a)){let e=this.playerRoster.get(t);e?e.teamId=a:this.playerRoster.set(t,{name:"",teamId:a}),this.onRosterChanged()}}else if("MsgMissionDropInfo"===t&&e.length>=5){let t=rK(this.resolveNetString(e[2])),a=rK(this.resolveNetString(e[3])),r=rK(this.resolveNetString(e[4]));r7.info("mission drop info: mission=%s gameType=%s server=%s",t,a,r),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=a||this.missionTypeDisplayName,this.serverDisplayName=r||this.serverDisplayName,this.onMissionInfoChange?.()}else if("MsgLoadInfo"===t&&e.length>=5){let t=rK(this.resolveNetString(e[3])),a=rK(this.resolveNetString(e[4]));r7.info("load info: mission=%s gameType=%s",t,a),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=a||this.missionTypeDisplayName,this.onMissionInfoChange?.()}else if("MsgClientReady"===t&&e.length>=3){let t=this.resolveNetString(e[2]);r7.info("client ready: gameClass=%s",t),this.gameClassName=t||this.gameClassName,this.onMissionInfoChange?.()}}onTeamScoresChanged(){}onRosterChanged(){}handleHudRemoteCommand(e,t){if("setWeaponsHudItem"===e&&t.length>=3){let e=parseInt(t[0],10),a=parseInt(t[1],10),r="1"===t[2]||"true"===t[2];isNaN(e)||(r?this.weaponsHud.slots.set(e,isNaN(a)?-1:a):this.weaponsHud.slots.delete(e),this.onWeaponsHudChanged())}else if("setWeaponsHudAmmo"===e&&t.length>=2){let e=parseInt(t[0],10),a=parseInt(t[1],10);isNaN(e)||(this.weaponsHud.slots.set(e,isNaN(a)?-1:a),this.onWeaponsHudChanged())}else if("setWeaponsHudActive"===e&&t.length>=1){let e=parseInt(t[0],10);this.weaponsHud.activeIndex=isNaN(e)?-1:e,isNaN(e)||!(e>=0)||this.weaponsHud.slots.has(e)||this.weaponsHud.slots.set(e,-1),this.onWeaponsHudChanged()}else if("setWeaponsHudClearAll"===e)this.weaponsHud.slots.clear(),this.weaponsHud.activeIndex=-1,this.onWeaponsHudChanged();else if("setBackpackHudItem"===e&&t.length>=2){let e=parseInt(t[0],10);"1"!==t[1]&&"true"!==t[1]||isNaN(e)?this.backpackHud.packIndex=-1:this.backpackHud.packIndex=e,this.backpackHud.active=!1,this.backpackHud.text=""}else if("setSatchelArmed"===e)this.backpackHud.active=!0;else if("setCloakIconOn"===e||"setRepairPackIconOn"===e||"setShieldIconOn"===e||"setSenJamIconOn"===e)this.backpackHud.active=!0;else if("setCloakIconOff"===e||"setRepairPackIconOff"===e||"setShieldIconOff"===e||"setSenJamIconOff"===e)this.backpackHud.active=!1;else if("updatePackText"===e&&t.length>=1)this.backpackHud.text=t[0]??"";else if("setInventoryHudItem"===e&&t.length>=3){let e=parseInt(t[0],10),a=parseInt(t[1],10),r="1"===t[2]||"true"===t[2];isNaN(e)||(r&&!isNaN(a)?this.inventoryHud.slots.set(e,a):this.inventoryHud.slots.delete(e),this.onInventoryHudChanged())}else if("setInventoryHudAmount"===e&&t.length>=2){let e=parseInt(t[0],10),a=parseInt(t[1],10);isNaN(e)||isNaN(a)||(this.inventoryHud.slots.set(e,a),this.onInventoryHudChanged())}else"setInventoryHudClearAll"===e&&(this.inventoryHud.slots.clear(),this.inventoryHud.activeSlot=-1,this.onInventoryHudChanged())}onWeaponsHudChanged(){}onInventoryHudChanged(){}buildEntityList(e){let t=[];for(let a of this.entities.values()){if(e&&!e(a))continue;let r=null!=a.targetId&&a.targetId>=0?this.targetRenderFlags.get(a.targetId)??a.targetRenderFlags:a.targetRenderFlags;"Player"!==a.type||a.carryingFlag||(r=null!=r?-3&r:r),t.push({id:a.id,type:a.type,visual:a.visual,direction:a.direction,ghostIndex:a.ghostIndex,className:a.className,dataBlockId:a.dataBlockId,shapeHint:a.shapeHint,dataBlock:a.dataBlock,weaponShape:a.weaponShape,packShape:a.packShape,flagShape:a.flagShape,falling:a.falling,jetting:a.jetting,playerName:a.playerName,targetRenderFlags:r,iffColor:("Player"===a.type||((r??0)&2)!=0)&&null!=a.sensorGroup?this.resolveIffColor(a.sensorGroup):void 0,position:a.position&&(a.simulatedVelocity||a.itemPhysics&&!a.itemPhysics.atRest)?[...a.position]:a.position,rotation:a.rotation,velocity:a.velocity,health:a.health,energy:a.energy,actionAnim:a.actionAnim,actionAtEnd:a.actionAtEnd,damageState:a.damageState,faceViewer:a.faceViewer,threads:a.threads,explosionDataBlockId:a.explosionDataBlockId,maintainEmitterId:a.maintainEmitterId,weaponImageState:a.weaponImageState,weaponImageStates:a.weaponImageStates,headPitch:a.headPitch,headYaw:a.headYaw,label:a.label,audioFileName:a.audioFileName,audioVolume:a.audioVolume,audioIs3D:a.audioIs3D,audioIsLooping:a.audioIsLooping,audioMinDistance:a.audioMinDistance,audioMaxDistance:a.audioMaxDistance,audioMinLoopGap:a.audioMinLoopGap,audioMaxLoopGap:a.audioMaxLoopGap,sceneData:a.sceneData})}return t}buildHudState(){let e={slots:Array.from(this.weaponsHud.slots.entries()).map(([e,t])=>({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},t={slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},a=this.backpackHud.packIndex>=0?{...this.backpackHud}:null,r=this.teamScores.map(e=>({...e})),i=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&i.set(e,(i.get(e)??0)+1);for(let e of r)e.playerCount=i.get(e.teamId)??0;return{weaponsHud:e,inventoryHud:t,backpackHud:a,teamScores:r}}buildTimeFilteredEvents(e){return this._chatSnapshotGen!==this._chatGen&&(this._chatSnapshot=this.chatMessages.slice(),this._chatSnapshotGen=this._chatGen),{chatMessages:this._chatSnapshot,audioEvents:this.audioEvents.filter(t=>t.timeSec>e-.5&&t.timeSec<=e)}}}e.s(["StreamEngine",()=>r9],10244)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1cf57947857f8eec.js b/docs/_next/static/chunks/1cf57947857f8eec.js new file mode 100644 index 00000000..6bf75da4 --- /dev/null +++ b/docs/_next/static/chunks/1cf57947857f8eec.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60505,e=>{"use strict";var t=e.i(932),r=e.i(71645),n=e.i(71753),c=e.i(15080),i=e.i(90072),o=e.i(12631),a=e.i(25645),u=e.i(98755),l=e.i(58647),m=e.i(93784),s=e.i(205),d=e.i(79123),v=e.i(51475),p=e.i(89119);let y=(0,a.createLogger)("LiveObserver"),f=1/v.TICK_RATE,g=new i.Vector3,E=new i.Vector3;function h(){let e,i,a,h,M,P,L,_,O,R,I,A,C,k,K=(0,t.c)(27),N=(0,u.useLiveSelector)(T),z=(0,u.useLiveSelector)(b),X=(0,u.useLiveSelector)(w),Y=(0,l.useEngineStoreApi)(),{speedMultiplier:D}=(0,d.useControls)(),x=(0,r.useRef)(null),H=(0,c.useThree)(S),[,U]=(0,o.useKeyboardControls)(),V=(0,r.useRef)(0),W=(0,r.useRef)(0);K[0]===Symbol.for("react.memo_cache_sentinel")?(e={yaw:0,pitch:0,prevYaw:0,prevPitch:0,initialized:!1,lastSyncedCamera:null},K[0]=e):e=K[0];let q=(0,r.useRef)(e),B=(0,r.useRef)(0);return K[1]!==N||K[2]!==z||K[3]!==Y?(i=()=>{if(N&&("connected"===z||"authenticating"===z)){if(x.current===N)return;y.info("wiring adapter to engine store");let e=u.liveConnectionStore.getState(),t={source:"live",duration:1/0,missionName:e.mapName??null,gameType:null,serverDisplayName:e.serverName??null,recorderName:e.warriorName??null,recordingDate:null,streamingPlayback:N};Y.getState().setRecording(t),Y.getState().setPlaybackStatus("playing"),x.current=N,q.current.initialized=!1,q.current.lastSyncedCamera=null}else if(!N&&x.current){let e=Y.getState().playback.recording;e?.source==="live"&&Y.getState().setRecording(null),x.current=null,q.current.initialized=!1}},a=[N,z,Y],K[1]=N,K[2]=z,K[3]=Y,K[4]=i,K[5]=a):(i=K[4],a=K[5]),(0,r.useEffect)(i,a),K[6]!==H.domElement?(h=()=>{let e=!1,t=t=>{document.pointerLockElement?(V.current=V.current+.002*t.movementX,W.current=W.current+.002*t.movementY):e&&(V.current=V.current+t.movementX*s.MOUSE_SENSITIVITY,W.current=W.current+t.movementY*s.MOUSE_SENSITIVITY)},r=t=>{document.pointerLockElement||t.target!==H.domElement||(e=!0)},n=()=>{e=!1};return document.addEventListener("mousemove",t),document.addEventListener("mousedown",r),document.addEventListener("mouseup",n),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mousedown",r),document.removeEventListener("mouseup",n)}},M=[H.domElement],K[6]=H.domElement,K[7]=h,K[8]=M):(h=K[7],M=K[8]),(0,r.useEffect)(h,M),K[9]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{let e=e=>{document.pointerLockElement&&x.current&&"follow"===x.current.observerMode&&(e.stopImmediatePropagation(),x.current.cycleObserveNext())};return document.addEventListener("click",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0})}},K[9]=P):P=K[9],K[10]!==H.domElement?(L=[H.domElement],K[10]=H.domElement,K[11]=L):L=K[11],(0,r.useEffect)(P,L),K[12]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{let e=e=>{if("KeyO"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||x.current&&(x.current.toggleObserverMode(),y.info("observer mode: %s",x.current.observerMode))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},O=[],K[12]=_,K[13]=O):(_=K[12],O=K[13]),(0,r.useEffect)(_,O),K[14]!==z||K[15]!==U?(R=(e,t)=>{if(!x.current||"connected"!==z)return;let{lookUp:r,lookDown:n,lookLeft:c,lookRight:i}=U();i&&(V.current=V.current+s.ARROW_LOOK_SPEED*t),c&&(V.current=V.current-s.ARROW_LOOK_SPEED*t),n&&(W.current=W.current+s.ARROW_LOOK_SPEED*t),r&&(W.current=W.current-s.ARROW_LOOK_SPEED*t)},K[14]=z,K[15]=U,K[16]=R):R=K[16],(0,n.useFrame)(R),K[17]!==z||K[18]!==U||K[19]!==X||K[20]!==D?(I=()=>{if(!x.current||"connected"!==z)return;let{forward:e,backward:t,left:r,right:n,up:c,down:i}=U(),o=0,a=0,u=0;e&&(a=1),t&&(a-=1),r&&(o=-1),n&&(o+=1),c&&(u=1),i&&(u-=1);let l=V.current,m=W.current;V.current=0,W.current=0;let s=q.current;s.prevYaw=s.yaw,s.prevPitch=s.pitch,s.yaw=s.yaw+l,s.pitch=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,s.pitch+m)),B.current=0;let d=Math.min(1,D);X({x:o*d,y:a*d,z:u*d,yaw:l,pitch:m,roll:0,trigger:[!1,!0,!1,!1,!1,!1],freeLook:!1})},K[17]=z,K[18]=U,K[19]=X,K[20]=D,K[21]=I):I=K[21],(0,v.useTick)(I),K[22]!==z?(A=(e,t)=>{if(!x.current||"connected"!==z)return;let r=q.current,n=x.current.getSnapshot(),c=n?.camera;if(c&&c!==r.lastSyncedCamera&&"number"==typeof c.yaw&&"number"==typeof c.pitch){let e=V.current,t=W.current;r.prevYaw=r.initialized?r.yaw:c.yaw,r.prevPitch=r.initialized?r.pitch:c.pitch,r.yaw=c.yaw+e,r.pitch=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,c.pitch+t)),r.lastSyncedCamera=c,r.initialized=!0}if(!r.initialized)return;B.current=B.current+t;let i=Math.min(1,B.current/f),o=r.prevYaw+(r.yaw-r.prevYaw)*i+V.current,a=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,r.prevPitch+(r.pitch-r.prevPitch)*i+W.current)),[u,l,s,d]=(0,p.yawPitchToQuaternion)(o,a);if(c?.mode==="third-person"&&c.orbitTargetId){let t=m.streamPlaybackStore.getState().root,r=t?.children.find(e=>e.name===c.orbitTargetId);if(r){E.copy(r.position);let t=m.streamPlaybackStore.getState().entities.get(c.orbitTargetId);t?.renderType==="Player"&&(E.y=E.y+1);let n=Math.sin(a),i=Math.cos(a),u=Math.sin(o),l=Math.cos(o);if(g.set(-l*i,-n,u*i),g.lengthSq()>1e-8){g.normalize();let t=Math.max(.1,c.orbitDistance??4);e.camera.position.copy(E).addScaledVector(g,t),e.camera.lookAt(E)}}}else e.camera.quaternion.set(u,l,s,d)},K[22]=z,K[23]=A):A=K[23],(0,n.useFrame)(A),K[24]!==Y?(C=()=>()=>{if(x.current){let e=Y.getState().playback.recording;e?.source==="live"&&Y.getState().setRecording(null),x.current=null}},k=[Y],K[24]=Y,K[25]=C,K[26]=k):(C=K[25],k=K[26]),(0,r.useEffect)(C,k),null}function S(e){return e.gl}function w(e){return e.sendMove}function b(e){return e.gameStatus}function T(e){return e.adapter}e.s(["LiveObserver",()=>h])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1db3a9d62713e989.css b/docs/_next/static/chunks/1db3a9d62713e989.css new file mode 100644 index 00000000..a82116fb --- /dev/null +++ b/docs/_next/static/chunks/1db3a9d62713e989.css @@ -0,0 +1 @@ +.DemoPlaybackControls-module__A_AHSq__Root{z-index:2;align-items:center;gap:10px;padding:8px 12px;font-size:13px;display:flex}.DemoPlaybackControls-module__A_AHSq__PlayPause{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;font-size:14px;display:flex}@media (hover:hover){.DemoPlaybackControls-module__A_AHSq__PlayPause:hover{background:#0062b3cc}}.DemoPlaybackControls-module__A_AHSq__Time{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}.DemoPlaybackControls-module__A_AHSq__Seek[type=range]{flex:1 1 0;min-width:0;max-width:none}.DemoPlaybackControls-module__A_AHSq__Speed{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:2px 4px;font-size:12px} diff --git a/docs/_next/static/chunks/21659079be7af0ab.js b/docs/_next/static/chunks/21659079be7af0ab.js new file mode 100644 index 00000000..e691e539 --- /dev/null +++ b/docs/_next/static/chunks/21659079be7af0ab.js @@ -0,0 +1,17 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92552,(e,t,r)=>{"use strict";let n,s;function i(e,t){return t.reduce((e,[t,r])=>({type:"BinaryExpression",operator:t,left:e,right:r}),e)}function o(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class a extends SyntaxError{constructor(e,t,r,n){super(e),this.expected=t,this.found=r,this.location=n,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null,n=e.find(e=>e.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));let s=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,o=this.location.source+":"+i.line+":"+i.column;if(r){let e=this.location.end,n="".padEnd(i.line.toString().length," "),a=r[s.line-1],l=(s.line===e.line?e.column:a.length+1)-s.column||1;t+="\n --> "+o+"\n"+n+" |\n"+i.line+" | "+a+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}let n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(e){return n?e.replace(n,e=>"\\u{"+r(e)+"}"):e}function i(e){return s(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function o(e){return s(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}let a={literal:e=>'"'+i(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r]/,k=/^[+\-]/,R=/^[%*\/]/,N=/^[!\-~]/,L=/^[a-zA-Z_]/,O=/^[a-zA-Z0-9_]/,I=/^[ \t]/,j=/^[^"\\\n\r]/,M=/^[^'\\\n\r]/,B=/^[0-9a-fA-F]/,T=/^[0-9]/,P=/^[xX]/,H=/^[^\n\r]/,D=/^[\n\r]/,F=/^[ \t\n\r]/,G=tE(";",!1),q=tE("package",!1),J=tE("{",!1),U=tE("}",!1),W=tE("function",!1),K=tE("(",!1),z=tE(")",!1),Z=tE("::",!1),V=tE(",",!1),Q=tE("datablock",!1),X=tE(":",!1),Y=tE("new",!1),ee=tE("[",!1),et=tE("]",!1),er=tE("=",!1),en=tE(".",!1),es=tE("if",!1),ei=tE("else",!1),eo=tE("for",!1),ea=tE("while",!1),el=tE("do",!1),eu=tE("switch$",!1),ec=tE("switch",!1),ep=tE("case",!1),ef=tE("default",!1),eh=tE("or",!1),ed=tE("return",!1),em=tE("break",!1),eg=tE("continue",!1),eb=tE("+=",!1),ey=tE("-=",!1),e$=tE("*=",!1),eA=tE("/=",!1),ex=tE("%=",!1),eC=tE("<<=",!1),eS=tE(">>=",!1),ev=tE("&=",!1),ew=tE("|=",!1),eE=tE("^=",!1),e_=tE("?",!1),ek=tE("||",!1),eR=tE("&&",!1),eN=tE("|",!1),eL=tE("^",!1),eO=tE("&",!1),eI=tE("==",!1),ej=tE("!=",!1),eM=tE("<=",!1),eB=tE(">=",!1),eT=t_(["<",">"],!1,!1,!1),eP=tE("$=",!1),eH=tE("!$=",!1),eD=tE("@",!1),eF=tE("NL",!1),eG=tE("TAB",!1),eq=tE("SPC",!1),eJ=tE("<<",!1),eU=tE(">>",!1),eW=t_(["+","-"],!1,!1,!1),eK=t_(["%","*","/"],!1,!1,!1),ez=t_(["!","-","~"],!1,!1,!1),eZ=tE("++",!1),eV=tE("--",!1),eQ=tE("*",!1),eX=tE("%",!1),eY=t_([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=t_([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tE("$",!1),e2=tE("parent",!1),e4=t_([" "," "],!1,!1,!1),e3=tE('"',!1),e9=tE("'",!1),e5=tE("\\",!1),e6=t_(['"',"\\","\n","\r"],!0,!1,!1),e8=t_(["'","\\","\n","\r"],!0,!1,!1),e7=tE("n",!1),te=tE("r",!1),tt=tE("t",!1),tr=tE("x",!1),tn=t_([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ts=tE("cr",!1),ti=tE("cp",!1),to=tE("co",!1),ta=tE("c",!1),tl=t_([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tE("0",!1),tp=t_(["x","X"],!1,!1,!1),tf=tE("-",!1),th=tE("true",!1),td=tE("false",!1),tm=tE("//",!1),tg=t_(["\n","\r"],!0,!1,!1),tb=t_(["\n","\r"],!1,!1,!1),ty=tE("/*",!1),t$=tE("*/",!1),tA=t_([" "," ","\n","\r"],!1,!1,!1),tx=0|t.peg$currPos,tC=[{line:1,column:1}],tS=tx,tv=t.peg$maxFailExpected||[],tw=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');p=c[t.startRule]}function tE(e,t){return{type:"literal",text:e,ignoreCase:t}}function t_(e,t,r,n){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:n}}function tk(t){let r,n=tC[t];if(n)return n;if(t>=tC.length)r=tC.length-1;else for(r=t;!tC[--r];);for(n={line:(n=tC[r]).line,column:n.column};rtS&&(tS=tx,tv=[]),tv.push(e))}function tL(){let e,t,r;for(rp(),e=[],t=tx,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tx=t,t=l);t!==l;)e.push(t),t=tx,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tx=t,t=l);return{type:"Program",body:e.map(([e])=>e).filter(Boolean),execScriptPaths:Array.from(n),hasDynamicExec:s}}function tO(){let t,r,n,s,i,o,a,u,c,p,d,$,A,v,w,E,_;return(t=function(){let t,r,n,s,i,o,a,u;if(t=tx,e.substr(tx,7)===f?(r=f,tx+=7):(r=l,0===tw&&tN(q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),123===e.charCodeAt(tx)?(s="{",tx++):(s=l,0===tw&&tN(J)),s!==l){for(rp(),i=[],o=tx,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tx=o,o=l);o!==l;)i.push(o),o=tx,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tx=o,o=l);(125===e.charCodeAt(tx)?(o="}",tx++):(o=l,0===tw&&tN(U)),o!==l)?(a=ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),t={type:"PackageDeclaration",name:n,body:i.map(([e])=>e).filter(Boolean)}):(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tx,e.substr(tx,8)===h?(r=h,tx+=8):(r=l,0===tw&&tN(W)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s;if(t=tx,(r=rn())!==l)if("::"===e.substr(tx,2)?(n="::",tx+=2):(n=l,0===tw&&tN(Z)),n!==l)if((s=rn())!==l)t={type:"MethodName",namespace:r,method:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=rn()),t}())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=function(){let t,r,n,s,i,o,a,u;if(t=tx,(r=rn())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tx=t,t=l;return t}())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l)if(ru(),(a=tF())!==l)t={type:"FunctionDeclaration",name:n,params:i||[],body:a};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&((n=tx,(s=tI())!==l)?(ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i===l&&(i=null),ru(),n=s):(tx=n,n=l),(t=n)===l&&((o=tx,(a=tj())!==l)?(ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),ru(),o=a):(tx=o,o=l),(t=o)===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tx,"if"===e.substr(tx,2)?(r="if",tx+=2):(r=l,0===tw&&tN(es)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),(o=tO())!==l){var h;a=tx,u=ru(),e.substr(tx,4)===m?(c=m,tx+=4):(c=l,0===tw&&tN(ei)),c!==l?(p=ru(),(f=tO())!==l?a=u=[u,c,p,f]:(tx=a,a=l)):(tx=a,a=l),a===l&&(a=null),t={type:"IfStatement",test:s,consequent:o,alternate:(h=a)?h[3]:null}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tx,"for"===e.substr(tx,3)?(r="for",tx+=3):(r=l,0===tw&&tN(eo)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())===l&&(s=null),ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i!==l)if(ru(),(o=tG())===l&&(o=null),ru(),59===e.charCodeAt(tx)?(a=";",tx++):(a=l,0===tw&&tN(G)),a!==l)if(ru(),(u=tG())===l&&(u=null),ru(),41===e.charCodeAt(tx)?(c=")",tx++):(c=l,0===tw&&tN(z)),c!==l)if(ru(),(p=tO())!==l){var f,h;f=s,h=o,t={type:"ForStatement",init:f,test:h,update:u,body:p}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u;if(t=tx,"do"===e.substr(tx,2)?(r="do",tx+=2):(r=l,0===tw&&tN(el)),r!==l)if(ru(),(n=tO())!==l)if(ru(),e.substr(tx,5)===g?(s=g,tx+=5):(s=l,0===tw&&tN(ea)),s!==l)if(ru(),40===e.charCodeAt(tx)?(i="(",tx++):(i=l,0===tw&&tN(K)),i!==l)if(ru(),(o=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(a=")",tx++):(a=l,0===tw&&tN(z)),a!==l)ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),t={type:"DoWhileStatement",test:o,body:n};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o;if(t=tx,e.substr(tx,5)===g?(r=g,tx+=5):(r=l,0===tw&&tN(ea)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),(o=tO())!==l)t={type:"WhileStatement",test:s,body:o};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tx,e.substr(tx,7)===b?(r=b,tx+=7):(r=l,0===tw&&tN(eu)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),123===e.charCodeAt(tx)?(o="{",tx++):(o=l,0===tw&&tN(J)),o!==l){for(rp(),a=[],u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);u!==l;)a.push(u),u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);(125===e.charCodeAt(tx)?(u="}",tx++):(u=l,0===tw&&tN(U)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;if(t===l)if(t=tx,e.substr(tx,6)===y?(r=y,tx+=6):(r=l,0===tw&&tN(ec)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),123===e.charCodeAt(tx)?(o="{",tx++):(o=l,0===tw&&tN(J)),o!==l){for(rp(),a=[],u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);u!==l;)a.push(u),u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);(125===e.charCodeAt(tx)?(u="}",tx++):(u=l,0===tw&&tN(U)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i;if(t=tx,e.substr(tx,6)===x?(r=x,tx+=6):(r=l,0===tw&&tN(ed)),r!==l)if(n=tx,(s=rc())!==l&&(i=tG())!==l?n=s=[s,i]:(tx=n,n=l),n===l&&(n=null),s=ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i!==l){var o;t={type:"ReturnStatement",value:(o=n)?o[1]:null}}else tx=t,t=l;else tx=t,t=l;return t}())===l&&(c=tx,e.substr(tx,5)===C?(p=C,tx+=5):(p=l,0===tw&&tN(em)),p!==l?(ru(),59===e.charCodeAt(tx)?(d=";",tx++):(d=l,0===tw&&tN(G)),d!==l?c={type:"BreakStatement"}:(tx=c,c=l)):(tx=c,c=l),(t=c)===l&&($=tx,e.substr(tx,8)===S?(A=S,tx+=8):(A=l,0===tw&&tN(eg)),A!==l?(ru(),59===e.charCodeAt(tx)?(v=";",tx++):(v=l,0===tw&&tN(G)),v!==l?$={type:"ContinueStatement"}:(tx=$,$=l)):(tx=$,$=l),(t=$)===l&&((w=tx,(E=tG())!==l&&(ru(),59===e.charCodeAt(tx)?(_=";",tx++):(_=l,0===tw&&tN(G)),_!==l))?w={type:"ExpressionStatement",expression:E}:(tx=w,w=l),(t=w)===l&&(t=tF())===l&&(t=rl())===l)))))&&(t=tx,ru(),59===e.charCodeAt(tx)?(r=";",tx++):(r=l,0===tw&&tN(G)),r!==l?(ru(),t=null):(tx=t,t=l)),t}function tI(){let t,r,n,s,i,o,a,u,c,p,f,h,m,g;if(t=tx,e.substr(tx,9)===d?(r=d,tx+=9):(r=l,0===tw&&tN(Q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=tB())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l){var b,y,$;if(ru(),a=tx,58===e.charCodeAt(tx)?(u=":",tx++):(u=l,0===tw&&tN(X)),u!==l?(c=ru(),(p=rn())!==l?a=u=[u,c,p]:(tx=a,a=l)):(tx=a,a=l),a===l&&(a=null),u=ru(),c=tx,123===e.charCodeAt(tx)?(p="{",tx++):(p=l,0===tw&&tN(J)),p!==l){for(f=ru(),h=[],m=tM();m!==l;)h.push(m),m=tM();m=ru(),125===e.charCodeAt(tx)?(g="}",tx++):(g=l,0===tw&&tN(U)),g!==l?c=p=[p,f,h,m,g,ru()]:(tx=c,c=l)}else tx=c,c=l;c===l&&(c=null),b=i,y=a,$=c,t={type:"DatablockDeclaration",className:n,instanceName:b,parent:y?y[2]:null,body:$?$[2].filter(Boolean):[]}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}function tj(){let t,r,n,s,i,o,a,u,c,p,f,h;if(t=tx,"new"===e.substr(tx,3)?(r="new",tx+=3):(r=l,0===tw&&tN(Y)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u,c,p;if((t=tx,40===e.charCodeAt(tx)?(r="(",tx++):(r=l,0===tw&&tN(K)),r!==l&&(n=ru(),(s=tG())!==l&&(i=ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l)))?t=s:(tx=t,t=l),t===l)if(t=tx,(r=rn())!==l){var f;for(n=[],s=tx,i=ru(),91===e.charCodeAt(tx)?(o="[",tx++):(o=l,0===tw&&tN(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tx)?(p="]",tx++):(p=l,0===tw&&tN(et)),p!==l?s=i=[i,o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),91===e.charCodeAt(tx)?(o="[",tx++):(o=l,0===tw&&tN(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tx)?(p="]",tx++):(p=l,0===tw&&tN(et)),p!==l?s=i=[i,o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);f=r,t=n.reduce((e,[,,,t])=>({type:"IndexExpression",object:e,index:t}),f)}else tx=t,t=l;return t}())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=tB())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l){var d;if(ru(),a=tx,123===e.charCodeAt(tx)?(u="{",tx++):(u=l,0===tw&&tN(J)),u!==l){for(c=ru(),p=[],f=tM();f!==l;)p.push(f),f=tM();f=ru(),125===e.charCodeAt(tx)?(h="}",tx++):(h=l,0===tw&&tN(U)),h!==l?a=u=[u,c,p,f,h,ru()]:(tx=a,a=l)}else tx=a,a=l;a===l&&(a=null),t={type:"ObjectDeclaration",className:n,instanceName:i,body:(d=a)?d[2].filter(Boolean):[]}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}function tM(){let t,r,n;return(t=tx,(r=tj())!==l)?(ru(),59===e.charCodeAt(tx)?(n=";",tx++):(n=l,0===tw&&tN(G)),n===l&&(n=null),ru(),t=r):(tx=t,t=l),t===l&&((t=tx,(r=tI())!==l)?(ru(),59===e.charCodeAt(tx)?(n=";",tx++):(n=l,0===tw&&tN(G)),n===l&&(n=null),ru(),t=r):(tx=t,t=l),t===l&&(t=function(){let t,r,n,s,i;if(t=tx,ru(),(r=tT())!==l)if(ru(),61===e.charCodeAt(tx)?(n="=",tx++):(n=l,0===tw&&tN(er)),n!==l)if(ru(),(s=tG())!==l)ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i===l&&(i=null),ru(),t={type:"Assignment",target:r,value:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=rl())===l&&(t=function(){let t,r;if(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r!==l)for(;r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));else t=l;return t!==l&&(t=null),t}())),t}function tB(){let e;return(e=tY())===l&&(e=rn())===l&&(e=ra()),e}function tT(){let e,t,r,n;if(e=tx,(t=t8())!==l){for(r=[],n=tP();n!==l;)r.push(n),n=tP();e=r.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tx=e,e=l;return e}function tP(){let t,r,n,s;return(t=tx,46===e.charCodeAt(tx)?(r=".",tx++):(r=l,0===tw&&tN(en)),r!==l&&(ru(),(n=rn())!==l))?t={type:"property",value:n}:(tx=t,t=l),t===l&&((t=tx,91===e.charCodeAt(tx)?(r="[",tx++):(r=l,0===tw&&tN(ee)),r!==l&&(ru(),(n=tH())!==l&&(ru(),93===e.charCodeAt(tx)?(s="]",tx++):(s=l,0===tw&&tN(et)),s!==l)))?t={type:"index",value:n}:(tx=t,t=l)),t}function tH(){let t,r,n,s,i,o,a,u;if(t=tx,(r=tG())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tx=t,t=l;return t}function tD(){let t,r,n,s,i,o,a,u,c;if(t=tx,e.substr(tx,4)===$?(r=$,tx+=4):(r=l,0===tw&&tN(ep)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u;if(t=tx,(r=t3())!==l){for(n=[],s=tx,i=ru(),"or"===e.substr(tx,2)?(o="or",tx+=2):(o=l,0===tw&&tN(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),"or"===e.substr(tx,2)?(o="or",tx+=2):(o=l,0===tw&&tN(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tx=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tx=t,t=l;return t}())!==l)if(ru(),58===e.charCodeAt(tx)?(s=":",tx++):(s=l,0===tw&&tN(X)),s!==l){for(i=rp(),o=[],a=tx,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tx=a,a=l);a!==l;)o.push(a),a=tx,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tx=a,a=l);t={type:"SwitchCase",test:n,consequent:o.map(([e])=>e).filter(Boolean)}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;if(t===l)if(t=tx,e.substr(tx,7)===A?(r=A,tx+=7):(r=l,0===tw&&tN(ef)),r!==l)if(ru(),58===e.charCodeAt(tx)?(n=":",tx++):(n=l,0===tw&&tN(X)),n!==l){for(rp(),s=[],i=tx,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tx=i,i=l);i!==l;)s.push(i),i=tx,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tx=i,i=l);t={type:"SwitchCase",test:null,consequent:s.map(([e])=>e).filter(Boolean)}}else tx=t,t=l;else tx=t,t=l;return t}function tF(){let t,r,n,s,i,o;if(t=tx,123===e.charCodeAt(tx)?(r="{",tx++):(r=l,0===tw&&tN(J)),r!==l){for(rp(),n=[],s=tx,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tx=s,s=l);s!==l;)n.push(s),s=tx,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tx=s,s=l);(125===e.charCodeAt(tx)?(s="}",tx++):(s=l,0===tw&&tN(U)),s!==l)?t={type:"BlockStatement",body:n.map(([e])=>e).filter(Boolean)}:(tx=t,t=l)}else tx=t,t=l;return t}function tG(){let t,r,n,s;if(t=tx,(r=tT())!==l)if(ru(),(n=tq())!==l)if(ru(),(s=tG())!==l)t={type:"AssignmentExpression",operator:n,target:r,value:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=function(){let t,r,n,s,i,o;if(t=tx,(r=tJ())!==l)if(ru(),63===e.charCodeAt(tx)?(n="?",tx++):(n=l,0===tw&&tN(e_)),n!==l)if(ru(),(s=tG())!==l)if(ru(),58===e.charCodeAt(tx)?(i=":",tx++):(i=l,0===tw&&tN(X)),i!==l)if(ru(),(o=tG())!==l)t={type:"ConditionalExpression",test:r,consequent:s,alternate:o};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=tJ()),t}()),t}function tq(){let t;return 61===e.charCodeAt(tx)?(t="=",tx++):(t=l,0===tw&&tN(er)),t===l&&("+="===e.substr(tx,2)?(t="+=",tx+=2):(t=l,0===tw&&tN(eb)),t===l&&("-="===e.substr(tx,2)?(t="-=",tx+=2):(t=l,0===tw&&tN(ey)),t===l&&("*="===e.substr(tx,2)?(t="*=",tx+=2):(t=l,0===tw&&tN(e$)),t===l&&("/="===e.substr(tx,2)?(t="/=",tx+=2):(t=l,0===tw&&tN(eA)),t===l&&("%="===e.substr(tx,2)?(t="%=",tx+=2):(t=l,0===tw&&tN(ex)),t===l&&("<<="===e.substr(tx,3)?(t="<<=",tx+=3):(t=l,0===tw&&tN(eC)),t===l&&(">>="===e.substr(tx,3)?(t=">>=",tx+=3):(t=l,0===tw&&tN(eS)),t===l&&("&="===e.substr(tx,2)?(t="&=",tx+=2):(t=l,0===tw&&tN(ev)),t===l&&("|="===e.substr(tx,2)?(t="|=",tx+=2):(t=l,0===tw&&tN(ew)),t===l&&("^="===e.substr(tx,2)?(t="^=",tx+=2):(t=l,0===tw&&tN(eE)))))))))))),t}function tJ(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tU())!==l){for(n=[],s=tx,o=ru(),"||"===e.substr(tx,2)?(a="||",tx+=2):(a=l,0===tw&&tN(ek)),a!==l?(u=ru(),(c=tU())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),"||"===e.substr(tx,2)?(a="||",tx+=2):(a=l,0===tw&&tN(ek)),a!==l?(u=ru(),(c=tU())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tU(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tW())!==l){for(n=[],s=tx,o=ru(),"&&"===e.substr(tx,2)?(a="&&",tx+=2):(a=l,0===tw&&tN(eR)),a!==l?(u=ru(),(c=tW())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),"&&"===e.substr(tx,2)?(a="&&",tx+=2):(a=l,0===tw&&tN(eR)),a!==l?(u=ru(),(c=tW())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tW(){let t,r,n,s,o,a,u,c,p;if(t=tx,(r=tK())!==l){for(n=[],s=tx,o=ru(),124===e.charCodeAt(tx)?(a="|",tx++):(a=l,0===tw&&tN(eN)),a!==l?(u=tx,tw++,124===e.charCodeAt(tx)?(c="|",tx++):(c=l,0===tw&&tN(eN)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tK())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),124===e.charCodeAt(tx)?(a="|",tx++):(a=l,0===tw&&tN(eN)),a!==l?(u=tx,tw++,124===e.charCodeAt(tx)?(c="|",tx++):(c=l,0===tw&&tN(eN)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tK())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tx=t,t=l;return t}function tK(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tz())!==l){for(n=[],s=tx,o=ru(),94===e.charCodeAt(tx)?(a="^",tx++):(a=l,0===tw&&tN(eL)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),94===e.charCodeAt(tx)?(a="^",tx++):(a=l,0===tw&&tN(eL)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tz(){let t,r,n,s,o,a,u,c,p;if(t=tx,(r=tZ())!==l){for(n=[],s=tx,o=ru(),38===e.charCodeAt(tx)?(a="&",tx++):(a=l,0===tw&&tN(eO)),a!==l?(u=tx,tw++,38===e.charCodeAt(tx)?(c="&",tx++):(c=l,0===tw&&tN(eO)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tZ())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),38===e.charCodeAt(tx)?(a="&",tx++):(a=l,0===tw&&tN(eO)),a!==l?(u=tx,tw++,38===e.charCodeAt(tx)?(c="&",tx++):(c=l,0===tw&&tN(eO)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tZ())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tx=t,t=l;return t}function tZ(){let e,t,r,n,s,o,a,u;if(e=tx,(t=tQ())!==l){for(r=[],n=tx,s=ru(),(o=tV())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=tV())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function tV(){let t;return"=="===e.substr(tx,2)?(t="==",tx+=2):(t=l,0===tw&&tN(eI)),t===l&&("!="===e.substr(tx,2)?(t="!=",tx+=2):(t=l,0===tw&&tN(ej))),t}function tQ(){let e,t,r,n,s,o,a,u;if(e=tx,(t=tY())!==l){for(r=[],n=tx,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function tX(){let t;return"<="===e.substr(tx,2)?(t="<=",tx+=2):(t=l,0===tw&&tN(eM)),t===l&&(">="===e.substr(tx,2)?(t=">=",tx+=2):(t=l,0===tw&&tN(eB)),t===l&&(t=e.charAt(tx),_.test(t)?tx++:(t=l,0===tw&&tN(eT)))),t}function tY(){let e,t,r,n,s,o,a,u;if(e=tx,(t=t2())!==l){for(r=[],n=tx,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function t0(){let e,t,r,n;if(e=tx,(t=tT())!==l)if(ru(),(r=tq())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tx=e,e=l;else tx=e,e=l;else tx=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tx,2)?(t="$=",tx+=2):(t=l,0===tw&&tN(eP)),t===l&&("!$="===e.substr(tx,3)?(t="!$=",tx+=3):(t=l,0===tw&&tN(eH)),t===l&&(64===e.charCodeAt(tx)?(t="@",tx++):(t=l,0===tw&&tN(eD)),t===l&&("NL"===e.substr(tx,2)?(t="NL",tx+=2):(t=l,0===tw&&tN(eF)),t===l&&("TAB"===e.substr(tx,3)?(t="TAB",tx+=3):(t=l,0===tw&&tN(eG)),t===l&&("SPC"===e.substr(tx,3)?(t="SPC",tx+=3):(t=l,0===tw&&tN(eq))))))),t}function t2(){let e,t,r,n,s,o,a,u;if(e=tx,(t=t3())!==l){for(r=[],n=tx,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function t4(){let t;return"<<"===e.substr(tx,2)?(t="<<",tx+=2):(t=l,0===tw&&tN(eJ)),t===l&&(">>"===e.substr(tx,2)?(t=">>",tx+=2):(t=l,0===tw&&tN(eU))),t}function t3(){let t,r,n,s,o,a,u,c;if(t=tx,(r=t9())!==l){for(n=[],s=tx,o=ru(),a=e.charAt(tx),k.test(a)?tx++:(a=l,0===tw&&tN(eW)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),a=e.charAt(tx),k.test(a)?tx++:(a=l,0===tw&&tN(eW)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function t9(){let t,r,n,s,o,a,u,c;if(t=tx,(r=t5())!==l){for(n=[],s=tx,o=ru(),a=e.charAt(tx),R.test(a)?tx++:(a=l,0===tw&&tN(eK)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),a=e.charAt(tx),R.test(a)?tx++:(a=l,0===tw&&tN(eK)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function t5(){let t,r,n;return(t=tx,r=e.charAt(tx),N.test(r)?tx++:(r=l,0===tw&&tN(ez)),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tx=t,t=l),t===l&&((t=tx,"++"===e.substr(tx,2)?(r="++",tx+=2):(r=l,0===tw&&tN(eZ)),r===l&&("--"===e.substr(tx,2)?(r="--",tx+=2):(r=l,0===tw&&tN(eV))),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tx=t,t=l),t===l&&((t=tx,42===e.charCodeAt(tx)?(r="*",tx++):(r=l,0===tw&&tN(eQ)),r!==l&&(ru(),(n=t6())!==l))?t={type:"TagDereferenceExpression",argument:n}:(tx=t,t=l),t===l&&(t=function(){let t,r,n;if(t=tx,(r=t8())!==l)if(ru(),"++"===e.substr(tx,2)?(n="++",tx+=2):(n=l,0===tw&&tN(eZ)),n===l&&("--"===e.substr(tx,2)?(n="--",tx+=2):(n=l,0===tw&&tN(eV))),n!==l)t={type:"PostfixExpression",operator:n,argument:r};else tx=t,t=l;else tx=t,t=l;return t===l&&(t=t8()),t}()))),t}function t6(){let e,t,r,n;if(e=tx,(t=tT())!==l)if(ru(),(r=tq())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tx=e,e=l;else tx=e,e=l;else tx=e,e=l;return e===l&&(e=t5()),e}function t8(){let t,r,i,o,a,u,c,p,f,h;if(t=tx,(r=function(){let t,r,n,s,i,o,a,u,c,p,f,h,d,m,g,b;if(t=tx,(a=tj())===l&&(a=tI())===l&&(a=function(){let t,r,n,s;if(t=tx,34===e.charCodeAt(tx)?(r='"',tx++):(r=l,0===tw&&tN(e3)),r!==l){for(n=[],s=rs();s!==l;)n.push(s),s=rs();(34===e.charCodeAt(tx)?(s='"',tx++):(s=l,0===tw&&tN(e3)),s!==l)?t={type:"StringLiteral",value:n.join("")}:(tx=t,t=l)}else tx=t,t=l;if(t===l)if(t=tx,39===e.charCodeAt(tx)?(r="'",tx++):(r=l,0===tw&&tN(e9)),r!==l){for(n=[],s=ri();s!==l;)n.push(s),s=ri();(39===e.charCodeAt(tx)?(s="'",tx++):(s=l,0===tw&&tN(e9)),s!==l)?t={type:"StringLiteral",value:n.join(""),tagged:!0}:(tx=t,t=l)}else tx=t,t=l;return t}())===l&&(a=ra())===l&&((u=tx,e.substr(tx,4)===w?(c=w,tx+=4):(c=l,0===tw&&tN(th)),c===l&&(e.substr(tx,5)===E?(c=E,tx+=5):(c=l,0===tw&&tN(td))),c!==l&&(p=tx,tw++,f=rh(),tw--,f===l?p=void 0:(tx=p,p=l),p!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tx=u,u=l),(a=u)===l&&((h=re())===l&&(h=rt())===l&&(h=rr()),(a=h)===l))&&((d=tx,40===e.charCodeAt(tx)?(m="(",tx++):(m=l,0===tw&&tN(K)),m!==l&&(ru(),(g=tG())!==l&&(ru(),41===e.charCodeAt(tx)?(b=")",tx++):(b=l,0===tw&&tN(z)),b!==l)))?d=g:(tx=d,d=l),a=d),(r=a)!==l){for(n=[],s=tx,i=ru(),(o=tP())!==l?s=i=[i,o]:(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),(o=tP())!==l?s=i=[i,o]:(tx=s,s=l);t=n.reduce((e,[,t])=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},r)}else tx=t,t=l;return t}())!==l){for(i=[],o=tx,a=ru(),40===e.charCodeAt(tx)?(u="(",tx++):(u=l,0===tw&&tN(K)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tx)?(h=")",tx++):(h=l,0===tw&&tN(z)),h!==l?o=a=[a,u,c,p,f,h]:(tx=o,o=l)):(tx=o,o=l),o===l&&(o=tx,a=ru(),(u=tP())!==l?o=a=[a,u]:(tx=o,o=l));o!==l;)i.push(o),o=tx,a=ru(),40===e.charCodeAt(tx)?(u="(",tx++):(u=l,0===tw&&tN(K)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tx)?(h=")",tx++):(h=l,0===tw&&tN(z)),h!==l?o=a=[a,u,c,p,f,h]:(tx=o,o=l)):(tx=o,o=l),o===l&&(o=tx,a=ru(),(u=tP())!==l?o=a=[a,u]:(tx=o,o=l));t=i.reduce((e,t)=>{if("("===t[1]){var r;let[,,,i]=t;return r=i||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(r.length>0&&"StringLiteral"===r[0].type?n.add(r[0].value):s=!0),{type:"CallExpression",callee:e,arguments:r}}let i=t[1];return"property"===i.type?{type:"MemberExpression",object:e,property:i.value}:{type:"IndexExpression",object:e,index:i.value}},r)}else tx=t,t=l;return t}function t7(){let t,r,n,s,i,o,a,u;if(t=tx,(r=tG())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tx=t,t=l;return t}function re(){let t,r,n,s,i,o,a;if(t=tx,37===e.charCodeAt(tx)?(r="%",tx++):(r=l,0===tw&&tN(eX)),r!==l){if(n=tx,s=tx,i=e.charAt(tx),L.test(i)?tx++:(i=l,0===tw&&tN(eY)),i!==l){for(o=[],a=e.charAt(tx),O.test(a)?tx++:(a=l,0===tw&&tN(e0));a!==l;)o.push(a),a=e.charAt(tx),O.test(a)?tx++:(a=l,0===tw&&tN(e0));s=i=[i,o]}else tx=s,s=l;(n=s!==l?e.substring(n,tx):s)!==l?t={type:"Variable",scope:"local",name:n}:(tx=t,t=l)}else tx=t,t=l;return t}function rt(){let t,r,n,s,i,o,a,u,c,p,f,h,d;if(t=tx,36===e.charCodeAt(tx)?(r="$",tx++):(r=l,0===tw&&tN(e1)),r!==l){if(n=tx,s=tx,"::"===e.substr(tx,2)?(i="::",tx+=2):(i=l,0===tw&&tN(Z)),i===l&&(i=null),o=e.charAt(tx),L.test(o)?tx++:(o=l,0===tw&&tN(eY)),o!==l){for(a=[],u=e.charAt(tx),O.test(u)?tx++:(u=l,0===tw&&tN(e0));u!==l;)a.push(u),u=e.charAt(tx),O.test(u)?tx++:(u=l,0===tw&&tN(e0));if(u=[],c=tx,"::"===e.substr(tx,2)?(p="::",tx+=2):(p=l,0===tw&&tN(Z)),p!==l)if(f=e.charAt(tx),L.test(f)?tx++:(f=l,0===tw&&tN(eY)),f!==l){for(h=[],d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));d!==l;)h.push(d),d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));c=p=[p,f,h]}else tx=c,c=l;else tx=c,c=l;for(;c!==l;)if(u.push(c),c=tx,"::"===e.substr(tx,2)?(p="::",tx+=2):(p=l,0===tw&&tN(Z)),p!==l)if(f=e.charAt(tx),L.test(f)?tx++:(f=l,0===tw&&tN(eY)),f!==l){for(h=[],d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));d!==l;)h.push(d),d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));c=p=[p,f,h]}else tx=c,c=l;else tx=c,c=l;s=i=[i,o,a,u]}else tx=s,s=l;(n=s!==l?e.substring(n,tx):s)!==l?t={type:"Variable",scope:"global",name:n}:(tx=t,t=l)}else tx=t,t=l;return t}function rr(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tx,r=tx,n=tx,e.substr(tx,6)===v?(s=v,tx+=6):(s=l,0===tw&&tN(e2)),s!==l){for(i=[],o=e.charAt(tx),I.test(o)?tx++:(o=l,0===tw&&tN(e4));o!==l;)i.push(o),o=e.charAt(tx),I.test(o)?tx++:(o=l,0===tw&&tN(e4));if("::"===e.substr(tx,2)?(o="::",tx+=2):(o=l,0===tw&&tN(Z)),o!==l){for(a=[],u=e.charAt(tx),I.test(u)?tx++:(u=l,0===tw&&tN(e4));u!==l;)a.push(u),u=e.charAt(tx),I.test(u)?tx++:(u=l,0===tw&&tN(e4));if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));n=s=[s,i,o,a,u,c]}else tx=n,n=l}else tx=n,n=l}else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r.replace(/\s+/g,"")}),(t=r)===l){if(t=tx,r=tx,n=tx,e.substr(tx,6)===v?(s=v,tx+=6):(s=l,0===tw&&tN(e2)),s!==l){if(i=[],o=tx,"::"===e.substr(tx,2)?(a="::",tx+=2):(a=l,0===tw&&tN(Z)),a!==l)if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));o=a=[a,u,c]}else tx=o,o=l;else tx=o,o=l;if(o!==l)for(;o!==l;)if(i.push(o),o=tx,"::"===e.substr(tx,2)?(a="::",tx+=2):(a=l,0===tw&&tN(Z)),a!==l)if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));o=a=[a,u,c]}else tx=o,o=l;else tx=o,o=l;else i=l;i!==l?n=s=[s,i]:(tx=n,n=l)}else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r}),(t=r)===l){if(t=tx,r=tx,n=tx,s=e.charAt(tx),L.test(s)?tx++:(s=l,0===tw&&tN(eY)),s!==l){for(i=[],o=e.charAt(tx),O.test(o)?tx++:(o=l,0===tw&&tN(e0));o!==l;)i.push(o),o=e.charAt(tx),O.test(o)?tx++:(o=l,0===tw&&tN(e0));if(o=[],a=tx,"::"===e.substr(tx,2)?(u="::",tx+=2):(u=l,0===tw&&tN(Z)),u!==l)if(c=e.charAt(tx),L.test(c)?tx++:(c=l,0===tw&&tN(eY)),c!==l){for(p=[],f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));f!==l;)p.push(f),f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));a=u=[u,c,p]}else tx=a,a=l;else tx=a,a=l;for(;a!==l;)if(o.push(a),a=tx,"::"===e.substr(tx,2)?(u="::",tx+=2):(u=l,0===tw&&tN(Z)),u!==l)if(c=e.charAt(tx),L.test(c)?tx++:(c=l,0===tw&&tN(eY)),c!==l){for(p=[],f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));f!==l;)p.push(f),f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));a=u=[u,c,p]}else tx=a,a=l;else tx=a,a=l;n=s=[s,i,o]}else tx=n,n=l;(r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r}),t=r}}return t}function rn(){let e;return(e=re())===l&&(e=rt())===l&&(e=rr()),e}function rs(){let t,r,n;return(t=tx,92===e.charCodeAt(tx)?(r="\\",tx++):(r=l,0===tw&&tN(e5)),r!==l&&(n=ro())!==l)?t=n:(tx=t,t=l),t===l&&(t=e.charAt(tx),j.test(t)?tx++:(t=l,0===tw&&tN(e6))),t}function ri(){let t,r,n;return(t=tx,92===e.charCodeAt(tx)?(r="\\",tx++):(r=l,0===tw&&tN(e5)),r!==l&&(n=ro())!==l)?t=n:(tx=t,t=l),t===l&&(t=e.charAt(tx),M.test(t)?tx++:(t=l,0===tw&&tN(e8))),t}function ro(){let t,r,n,s,i,o;return t=tx,110===e.charCodeAt(tx)?(r="n",tx++):(r=l,0===tw&&tN(e7)),r!==l&&(r="\n"),(t=r)===l&&(t=tx,114===e.charCodeAt(tx)?(r="r",tx++):(r=l,0===tw&&tN(te)),r!==l&&(r="\r"),(t=r)===l)&&(t=tx,116===e.charCodeAt(tx)?(r="t",tx++):(r=l,0===tw&&tN(tt)),r!==l&&(r=" "),(t=r)===l)&&((t=tx,120===e.charCodeAt(tx)?(r="x",tx++):(r=l,0===tw&&tN(tr)),r!==l&&(n=tx,s=tx,i=e.charAt(tx),B.test(i)?tx++:(i=l,0===tw&&tN(tn)),i!==l?(o=e.charAt(tx),B.test(o)?tx++:(o=l,0===tw&&tN(tn)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l),(n=s!==l?e.substring(n,tx):s)!==l))?t=String.fromCharCode(parseInt(n,16)):(tx=t,t=l),t===l&&(t=tx,"cr"===e.substr(tx,2)?(r="cr",tx+=2):(r=l,0===tw&&tN(ts)),r!==l&&(r="\x0f"),(t=r)===l&&(t=tx,"cp"===e.substr(tx,2)?(r="cp",tx+=2):(r=l,0===tw&&tN(ti)),r!==l&&(r="\x10"),(t=r)===l))&&(t=tx,"co"===e.substr(tx,2)?(r="co",tx+=2):(r=l,0===tw&&tN(to)),r!==l&&(r="\x11"),(t=r)===l)&&((t=tx,99===e.charCodeAt(tx)?(r="c",tx++):(r=l,0===tw&&tN(ta)),r!==l&&(n=e.charAt(tx),T.test(n)?tx++:(n=l,0===tw&&tN(tl)),n!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(n,10)]):(tx=t,t=l),t===l&&(t=tx,e.length>tx?(r=e.charAt(tx),tx++):(r=l,0===tw&&tN(tu)),t=r))),t}function ra(){let t,r,n,s,i,o,a,u,c;if(t=tx,r=tx,n=tx,48===e.charCodeAt(tx)?(s="0",tx++):(s=l,0===tw&&tN(tc)),s!==l)if(i=e.charAt(tx),P.test(i)?tx++:(i=l,0===tw&&tN(tp)),i!==l){if(o=[],a=e.charAt(tx),B.test(a)?tx++:(a=l,0===tw&&tN(tn)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tx),B.test(a)?tx++:(a=l,0===tw&&tN(tn));else o=l;o!==l?n=s=[s,i,o]:(tx=n,n=l)}else tx=n,n=l;else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(n=tx,tw++,s=rh(),tw--,s===l?n=void 0:(tx=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseInt(r,16)}:(tx=t,t=l),t===l){if(t=tx,r=tx,n=tx,45===e.charCodeAt(tx)?(s="-",tx++):(s=l,0===tw&&tN(tf)),s===l&&(s=null),i=[],o=e.charAt(tx),T.test(o)?tx++:(o=l,0===tw&&tN(tl)),o!==l)for(;o!==l;)i.push(o),o=e.charAt(tx),T.test(o)?tx++:(o=l,0===tw&&tN(tl));else i=l;if(i!==l){if(o=tx,46===e.charCodeAt(tx)?(a=".",tx++):(a=l,0===tw&&tN(en)),a!==l){if(u=[],c=e.charAt(tx),T.test(c)?tx++:(c=l,0===tw&&tN(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tx),T.test(c)?tx++:(c=l,0===tw&&tN(tl));else u=l;u!==l?o=a=[a,u]:(tx=o,o=l)}else tx=o,o=l;o===l&&(o=null),n=s=[s,i,o]}else tx=n,n=l;if(n===l)if(n=tx,45===e.charCodeAt(tx)?(s="-",tx++):(s=l,0===tw&&tN(tf)),s===l&&(s=null),46===e.charCodeAt(tx)?(i=".",tx++):(i=l,0===tw&&tN(en)),i!==l){if(o=[],a=e.charAt(tx),T.test(a)?tx++:(a=l,0===tw&&tN(tl)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tx),T.test(a)?tx++:(a=l,0===tw&&tN(tl));else o=l;o!==l?n=s=[s,i,o]:(tx=n,n=l)}else tx=n,n=l;(r=n!==l?e.substring(r,tx):n)!==l&&(n=tx,tw++,s=rh(),tw--,s===l?n=void 0:(tx=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseFloat(r)}:(tx=t,t=l)}return t}function rl(){let t;return(t=function(){let t,r,n,s,i;if(t=tx,"//"===e.substr(tx,2)?(r="//",tx+=2):(r=l,0===tw&&tN(tm)),r!==l){for(n=tx,s=[],i=e.charAt(tx),H.test(i)?tx++:(i=l,0===tw&&tN(tg));i!==l;)s.push(i),i=e.charAt(tx),H.test(i)?tx++:(i=l,0===tw&&tN(tg));n=e.substring(n,tx),s=e.charAt(tx),D.test(s)?tx++:(s=l,0===tw&&tN(tb)),s===l&&(s=null),t={type:"Comment",value:n}}else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tx,"/*"===e.substr(tx,2)?(r="/*",tx+=2):(r=l,0===tw&&tN(ty)),r!==l){for(n=tx,s=[],i=tx,o=tx,tw++,"*/"===e.substr(tx,2)?(a="*/",tx+=2):(a=l,0===tw&&tN(t$)),tw--,a===l?o=void 0:(tx=o,o=l),o!==l?(e.length>tx?(a=e.charAt(tx),tx++):(a=l,0===tw&&tN(tu)),a!==l?i=o=[o,a]:(tx=i,i=l)):(tx=i,i=l);i!==l;)s.push(i),i=tx,o=tx,tw++,"*/"===e.substr(tx,2)?(a="*/",tx+=2):(a=l,0===tw&&tN(t$)),tw--,a===l?o=void 0:(tx=o,o=l),o!==l?(e.length>tx?(a=e.charAt(tx),tx++):(a=l,0===tw&&tN(tu)),a!==l?i=o=[o,a]:(tx=i,i=l)):(tx=i,i=l);(n=e.substring(n,tx),"*/"===e.substr(tx,2)?(s="*/",tx+=2):(s=l,0===tw&&tN(t$)),s!==l)?t={type:"Comment",value:n}:(tx=t,t=l)}else tx=t,t=l;return t}()),t}function ru(){let t,r;for(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r===l&&(r=rf());r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r===l&&(r=rf());return t}function rc(){let t,r,n,s;if(t=tx,r=[],n=e.charAt(tx),F.test(n)?tx++:(n=l,0===tw&&tN(tA)),n!==l)for(;n!==l;)r.push(n),n=e.charAt(tx),F.test(n)?tx++:(n=l,0===tw&&tN(tA));else r=l;if(r!==l){for(n=[],s=e.charAt(tx),F.test(s)?tx++:(s=l,0===tw&&tN(tA)),s===l&&(s=rf());s!==l;)n.push(s),s=e.charAt(tx),F.test(s)?tx++:(s=l,0===tw&&tN(tA)),s===l&&(s=rf());t=r=[r,n]}else tx=t,t=l;return t}function rp(){let t,r;for(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));return t}function rf(){let t,r,n,s,i,o;if(t=tx,"//"===e.substr(tx,2)?(r="//",tx+=2):(r=l,0===tw&&tN(tm)),r!==l){for(n=[],s=e.charAt(tx),H.test(s)?tx++:(s=l,0===tw&&tN(tg));s!==l;)n.push(s),s=e.charAt(tx),H.test(s)?tx++:(s=l,0===tw&&tN(tg));s=e.charAt(tx),D.test(s)?tx++:(s=l,0===tw&&tN(tb)),s===l&&(s=null),t=r=[r,n,s]}else tx=t,t=l;if(t===l)if(t=tx,"/*"===e.substr(tx,2)?(r="/*",tx+=2):(r=l,0===tw&&tN(ty)),r!==l){for(n=[],s=tx,i=tx,tw++,"*/"===e.substr(tx,2)?(o="*/",tx+=2):(o=l,0===tw&&tN(t$)),tw--,o===l?i=void 0:(tx=i,i=l),i!==l?(e.length>tx?(o=e.charAt(tx),tx++):(o=l,0===tw&&tN(tu)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=tx,tw++,"*/"===e.substr(tx,2)?(o="*/",tx+=2):(o=l,0===tw&&tN(t$)),tw--,o===l?i=void 0:(tx=i,i=l),i!==l?(e.length>tx?(o=e.charAt(tx),tx++):(o=l,0===tw&&tN(tu)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l);"*/"===e.substr(tx,2)?(s="*/",tx+=2):(s=l,0===tw&&tN(t$)),s!==l?t=r=[r,n,s]:(tx=t,t=l)}else tx=t,t=l;return t}function rh(){let t;return t=e.charAt(tx),O.test(t)?tx++:(t=l,0===tw&&tN(e0)),t}n=new Set,s=!1;let rd=(r=p())!==l&&tx===e.length;function rm(){var t,n,s;throw r!==l&&tx{"use strict";let n="[^\\\\/]",s="[^/]",i="(?:\\/|$)",o="(?:^|\\/)",a=`\\.{1,2}${i}`,l=`(?!${o}${a})`,u=`(?!\\.{0,1}${i})`,c=`(?!${a})`,p=`${s}*?`,f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:"(?!\\.)",NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:o,SEP:"/"},h={...f,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:f}},19241,(e,t,r)=>{"use strict";var n=e.i(47167);let{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=e.r(53487);r.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r.hasRegexChars=e=>o.test(e),r.isRegexChar=e=>1===e.length&&r.hasRegexChars(e),r.escapeRegex=e=>e.replace(a,"\\$1"),r.toPosixSlashes=e=>e.replace(s,"/"),r.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==n.default&&!!n.default.platform&&"win32"===n.default.platform},r.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),r.escapeLast=(e,t,n)=>{let s=e.lastIndexOf(t,n);return -1===s?e:"\\"===e[s-1]?r.escapeLast(e,t,s-1):`${e.slice(0,s)}\\${e.slice(s)}`},r.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},r.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},r.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return""===n?r[r.length-2]:n}},26094,(e,t,r)=>{"use strict";let n=e.r(19241),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:y}=e.r(53487),$=e=>e===c||e===o,A=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let r,x,C=t||{},S=e.length-1,v=!0===C.parts||!0===C.scanToEnd,w=[],E=[],_=[],k=e,R=-1,N=0,L=0,O=!1,I=!1,j=!1,M=!1,B=!1,T=!1,P=!1,H=!1,D=!1,F=!1,G=0,q={value:"",depth:0,isGlob:!1},J=()=>R>=S,U=()=>k.charCodeAt(R+1),W=()=>(r=x,k.charCodeAt(++R));for(;R0&&(z=k.slice(0,N),k=k.slice(N),L-=N),K&&!0===j&&L>0?(K=k.slice(0,L),Z=k.slice(L)):!0===j?(K="",Z=k):K=k,K&&""!==K&&"/"!==K&&K!==k&&$(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),!0===C.unescape&&(Z&&(Z=n.removeBackslashes(Z)),K&&!0===P&&(K=n.removeBackslashes(K)));let V={prefix:z,input:e,start:N,base:K,glob:Z,isBrace:O,isBracket:I,isGlob:j,isExtglob:M,isGlobstar:B,negated:H,negatedExtglob:D};if(!0===C.tokens&&(V.maxDepth=0,$(x)||E.push(q),V.tokens=E),!0===C.parts||!0===C.tokens){let t;for(let r=0;r{"use strict";let n=e.r(53487),s=e.r(19241),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>s.escapeRegex(e)).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,f=(e,t)=>{let r;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let h={...t},d="number"==typeof h.maxLength?Math.min(i,h.maxLength):i,m=e.length;if(m>d)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${d}`);let g={type:"bos",value:"",output:h.prepend||""},b=[g],y=h.capture?"":"?:",$=n.globChars(h.windows),A=n.extglobChars($),{DOT_LITERAL:x,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:w,NO_DOT:E,NO_DOT_SLASH:_,NO_DOTS_SLASH:k,QMARK:R,QMARK_NO_DOT:N,STAR:L,START_ANCHOR:O}=$,I=e=>`(${y}(?:(?!${O}${e.dot?w:x}).)*?)`,j=h.dot?"":E,M=h.dot?R:N,B=!0===h.bash?I(h):L;h.capture&&(B=`(${B})`),"boolean"==typeof h.noext&&(h.noextglob=h.noext);let T={input:e,index:-1,start:0,dot:!0===h.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};m=(e=s.removePrefix(e,T)).length;let P=[],H=[],D=[],F=g,G=()=>T.index===m-1,q=T.peek=(t=1)=>e[T.index+t],J=T.advance=()=>e[++T.index]||"",U=()=>e.slice(T.index+1),W=(e="",t=0)=>{T.consumed+=e,T.index+=t},K=e=>{T.output+=null!=e.output?e.output:e.value,W(e.value)},z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)J(),T.start++,e++;return e%2!=0&&(T.negated=!0,T.start++,!0)},Z=e=>{T[e]++,D.push(e)},V=e=>{T[e]--,D.pop()},Q=e=>{if("globstar"===F.type){let t=T.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||P.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(T.output=T.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=B,T.output+=F.output)}if(P.length&&"paren"!==e.type&&(P[P.length-1].inner+=e.value),(e.value||e.output)&&K(e),F&&"text"===F.type&&"text"===e.type){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,b.push(e),F=e},X=(e,t)=>{let r={...A[t],conditions:1,inner:""};r.prev=F,r.parens=T.parens,r.output=T.output;let n=(h.capture?"(":"")+r.open;Z("parens"),Q({type:e,value:t,output:T.output?"":v}),Q({type:"paren",extglob:!0,value:J(),output:n}),P.push(r)},Y=e=>{let n,s=e.close+(h.capture?")":"");if("negate"===e.type){let r=B;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=I(h)),(r!==B||G()||/^\)+$/.test(U()))&&(s=e.close=`)$))${r}`),e.inner.includes("*")&&(n=U())&&/^\.[^\\/.]+$/.test(n)){let i=f(n,{...t,fastpaths:!1}).output;s=e.close=`)${i})${r})`}"bos"===e.prev.type&&(T.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:r,output:s}),V("parens")};if(!1!==h.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,n=e.replace(l,(e,t,n,s,i,o)=>"\\"===s?(r=!0,e):"?"===s?t?t+s+(i?R.repeat(i.length):""):0===o?M+(i?R.repeat(i.length):""):R.repeat(n.length):"."===s?x.repeat(n.length):"*"===s?t?t+s+(i?B:""):B:t?e:`\\${e}`);return(!0===r&&(n=!0===h.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===e&&!0===h.contains)?T.output=e:T.output=s.wrapOutput(n,T,t),T}for(;!G();){if("\0"===(r=J()))continue;if("\\"===r){let e=q();if("/"===e&&!0!==h.bash||"."===e||";"===e)continue;if(!e){Q({type:"text",value:r+="\\"});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,T.index+=n,n%2!=0&&(r+="\\")),!0===h.unescape?r=J():r+=J(),0===T.brackets){Q({type:"text",value:r});continue}}if(T.brackets>0&&("]"!==r||"["===F.value||"[^"===F.value)){if(!1!==h.posix&&":"===r){let e=F.value.slice(1);if(e.includes("[")&&(F.posix=!0,e.includes(":"))){let e=F.value.lastIndexOf("["),t=F.value.slice(0,e),r=o[F.value.slice(e+2)];if(r){F.value=t+r,T.backtrack=!0,J(),g.output||1!==b.indexOf(F)||(g.output=v);continue}}}("["===r&&":"!==q()||"-"===r&&"]"===q())&&(r=`\\${r}`),"]"===r&&("["===F.value||"[^"===F.value)&&(r=`\\${r}`),!0===h.posix&&"!"===r&&"["===F.value&&(r="^"),F.value+=r,K({value:r});continue}if(1===T.quotes&&'"'!==r){r=s.escapeRegex(r),F.value+=r,K({value:r});continue}if('"'===r){T.quotes=+(1!==T.quotes),!0===h.keepQuotes&&Q({type:"text",value:r});continue}if("("===r){Z("parens"),Q({type:"paren",value:r});continue}if(")"===r){if(0===T.parens&&!0===h.strictBrackets)throw SyntaxError(p("opening","("));let e=P[P.length-1];if(e&&T.parens===e.parens+1){Y(P.pop());continue}Q({type:"paren",value:r,output:T.parens?")":"\\)"}),V("parens");continue}if("["===r){if(!0!==h.nobracket&&U().includes("]"))Z("brackets");else{if(!0!==h.nobracket&&!0===h.strictBrackets)throw SyntaxError(p("closing","]"));r=`\\${r}`}Q({type:"bracket",value:r});continue}if("]"===r){if(!0===h.nobracket||F&&"bracket"===F.type&&1===F.value.length){Q({type:"text",value:r,output:`\\${r}`});continue}if(0===T.brackets){if(!0===h.strictBrackets)throw SyntaxError(p("opening","["));Q({type:"text",value:r,output:`\\${r}`});continue}V("brackets");let e=F.value.slice(1);if(!0===F.posix||"^"!==e[0]||e.includes("/")||(r=`/${r}`),F.value+=r,K({value:r}),!1===h.literalBrackets||s.hasRegexChars(e))continue;let t=s.escapeRegex(F.value);if(T.output=T.output.slice(0,-F.value.length),!0===h.literalBrackets){T.output+=t,F.value=t;continue}F.value=`(${y}${t}|${F.value})`,T.output+=F.value;continue}if("{"===r&&!0!==h.nobrace){Z("braces");let e={type:"brace",value:r,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};H.push(e),Q(e);continue}if("}"===r){let e=H[H.length-1];if(!0===h.nobrace||!e){Q({type:"text",value:r,output:r});continue}let t=")";if(!0===e.dots){let e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=c(r,h),T.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=T.output.slice(0,e.outputIndex),s=T.tokens.slice(e.tokensIndex);for(let i of(e.value=e.output="\\{",r=t="\\}",T.output=n,s))T.output+=i.output||i.value}Q({type:"brace",value:r,output:t}),V("braces"),H.pop();continue}if("|"===r){P.length>0&&P[P.length-1].conditions++,Q({type:"text",value:r});continue}if(","===r){let e=r,t=H[H.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:r,output:e});continue}if("/"===r){if("dot"===F.type&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",b.pop(),F=g;continue}Q({type:"slash",value:r,output:S});continue}if("."===r){if(T.braces>0&&"dot"===F.type){"."===F.value&&(F.output=x);let e=H[H.length-1];F.type="dots",F.output+=r,F.value+=r,e.dots=!0;continue}if(T.braces+T.parens===0&&"bos"!==F.type&&"slash"!==F.type){Q({type:"text",value:r,output:x});continue}Q({type:"dot",value:r,output:x});continue}if("?"===r){if(!(F&&"("===F.value)&&!0!==h.noextglob&&"("===q()&&"?"!==q(2)){X("qmark",r);continue}if(F&&"paren"===F.type){let e=q(),t=r;("("!==F.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(U()))||(t=`\\${r}`),Q({type:"text",value:r,output:t});continue}if(!0!==h.dot&&("slash"===F.type||"bos"===F.type)){Q({type:"qmark",value:r,output:N});continue}Q({type:"qmark",value:r,output:R});continue}if("!"===r){if(!0!==h.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){X("negate",r);continue}if(!0!==h.nonegate&&0===T.index){z();continue}}if("+"===r){if(!0!==h.noextglob&&"("===q()&&"?"!==q(2)){X("plus",r);continue}if(F&&"("===F.value||!1===h.regex){Q({type:"plus",value:r,output:C});continue}if(F&&("bracket"===F.type||"paren"===F.type||"brace"===F.type)||T.parens>0){Q({type:"plus",value:r});continue}Q({type:"plus",value:C});continue}if("@"===r){if(!0!==h.noextglob&&"("===q()&&"?"!==q(2)){Q({type:"at",extglob:!0,value:r,output:""});continue}Q({type:"text",value:r});continue}if("*"!==r){("$"===r||"^"===r)&&(r=`\\${r}`);let e=a.exec(U());e&&(r+=e[0],T.index+=e[0].length),Q({type:"text",value:r});continue}if(F&&("globstar"===F.type||!0===F.star)){F.type="star",F.star=!0,F.value+=r,F.output=B,T.backtrack=!0,T.globstar=!0,W(r);continue}let t=U();if(!0!==h.noextglob&&/^\([^?]/.test(t)){X("star",r);continue}if("star"===F.type){if(!0===h.noglobstar){W(r);continue}let n=F.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,o=s&&("star"===s.type||"globstar"===s.type);if(!0===h.bash&&(!i||t[0]&&"/"!==t[0])){Q({type:"star",value:r,output:""});continue}let a=T.braces>0&&("comma"===n.type||"brace"===n.type),l=P.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!l){Q({type:"star",value:r,output:""});continue}for(;"/**"===t.slice(0,3);){let r=e[T.index+4];if(r&&"/"!==r)break;t=t.slice(3),W("/**",3)}if("bos"===n.type&&G()){F.type="globstar",F.value+=r,F.output=I(h),T.output=F.output,T.globstar=!0,W(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&G()){T.output=T.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=I(h)+(h.strictSlashes?")":"|$)"),F.value+=r,T.globstar=!0,T.output+=n.output+F.output,W(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";T.output=T.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=`${I(h)}${S}|${S}${e})`,F.value+=r,T.output+=n.output+F.output,T.globstar=!0,W(r+J()),Q({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){F.type="globstar",F.value+=r,F.output=`(?:^|${S}|${I(h)}${S})`,T.output=F.output,T.globstar=!0,W(r+J()),Q({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-F.output.length),F.type="globstar",F.output=I(h),F.value+=r,T.output+=F.output,T.globstar=!0,W(r);continue}let n={type:"star",value:r,output:B};if(!0===h.bash){n.output=".*?",("bos"===F.type||"slash"===F.type)&&(n.output=j+n.output),Q(n);continue}if(F&&("bracket"===F.type||"paren"===F.type)&&!0===h.regex){n.output=r,Q(n);continue}(T.index===T.start||"slash"===F.type||"dot"===F.type)&&("dot"===F.type?(T.output+=_,F.output+=_):!0===h.dot?(T.output+=k,F.output+=k):(T.output+=j,F.output+=j),"*"!==q()&&(T.output+=v,F.output+=v)),Q(n)}for(;T.brackets>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","]"));T.output=s.escapeLast(T.output,"["),V("brackets")}for(;T.parens>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing",")"));T.output=s.escapeLast(T.output,"("),V("parens")}for(;T.braces>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","}"));T.output=s.escapeLast(T.output,"{"),V("braces")}if(!0!==h.strictSlashes&&("star"===F.type||"bracket"===F.type)&&Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===T.backtrack)for(let e of(T.output="",T.tokens))T.output+=null!=e.output?e.output:e.value,e.suffix&&(T.output+=e.suffix);return T};f.fastpaths=(e,t)=>{let r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:b}=n.globChars(r.windows),y=r.dot?d:h,$=r.dot?m:h,A=r.capture?"":"?:",x=!0===r.bash?".*?":g;r.capture&&(x=`(${x})`);let C=e=>!0===e.noglobstar?x:`(${A}(?:(?!${b}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case"*":return`${y}${p}${x}`;case".*":return`${l}${p}${x}`;case"*.*":return`${y}${x}${l}${p}${x}`;case"*/*":return`${y}${x}${c}${p}${$}${x}`;case"**":return y+C(r);case"**/*":return`(?:${y}${C(r)}${c})?${$}${p}${x}`;case"**/*.*":return`(?:${y}${C(r)}${c})?${$}${x}${l}${p}${x}`;case"**/.*":return`(?:${y}${C(r)}${c})?${l}${p}${x}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let r=S(t[1]);if(!r)return;return r+l+t[2]}}},v=S(s.removePrefix(e,{negated:!1,prefix:""}));return v&&!0!==r.strictSlashes&&(v+=`${c}?`),v},t.exports=f},53174,(e,t,r)=>{"use strict";let n=e.r(26094),s=e.r(17932),i=e.r(19241),o=e.r(53487),a=(e,t,r=!1)=>{if(Array.isArray(e)){let n=e.map(e=>a(e,t,r));return e=>{for(let t of n){let r=t(e);if(r)return r}return!1}}let n=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,o=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),l=o.state;delete o.state;let u=()=>!1;if(s.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=a(s.ignore,e,r)}let c=(r,n=!1)=>{let{isMatch:c,match:p,output:f}=a.test(r,o,t,{glob:e,posix:i}),h={glob:e,state:l,regex:o,posix:i,input:r,output:f,match:p,isMatch:c};return("function"==typeof s.onResult&&s.onResult(h),!1===c)?(h.isMatch=!1,!!n&&h):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!n&&h):("function"==typeof s.onMatch&&s.onMatch(h),!n||h)};return r&&(c.state=l),c};a.test=(e,t,r,{glob:n,posix:s}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let o=r||{},l=o.format||(s?i.toPosixSlashes:null),u=e===n,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===n),(!1===u||!0===o.capture)&&(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,s):t.exec(c)),{isMatch:!!u,match:u,output:c}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):s(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;let s=t||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===n&&(u.state=e),u},a.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),a.compileRe(i,t,r,n)},a.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,t.exports=a},54970,(e,t,r)=>{"use strict";let n=e.r(53174),s=e.r(19241);function i(e,t,r=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:s.isWindows()}),n(e,t,r)}Object.assign(i,n),t.exports=i},62395,33870,38433,86608,e=>{"use strict";e.s(["parse",()=>B,"runServer",()=>H],86608);var t=e.i(92552);function r(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let n={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class s{indent;runtime;functions;globals;locals;indentLevel=0;currentClass=null;currentFunction=null;constructor(e={}){this.indent=e.indent??" ",this.runtime=e.runtime??"$",this.functions=e.functions??"$f",this.globals=e.globals??"$g",this.locals=e.locals??"$l"}getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),r="global"===e.scope?this.globals:this.locals;return{getter:`${r}.get(${t})`,setter:e=>`${r}.set(${t}, ${e})`,postIncHelper:`${r}.postInc(${t})`,postDecHelper:`${r}.postDec(${t})`}}if("MemberExpression"===e.type){let t=this.expression(e.object),r="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:`${this.runtime}.prop(${t}, ${r})`,setter:e=>`${this.runtime}.setProp(${t}, ${r}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${t}, ${r})`,postDecHelper:`${this.runtime}.propPostDec(${t}, ${r})`}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals,s=t.join(", ");return{getter:`${n}.get(${r}, ${s})`,setter:e=>`${n}.set(${r}, ${s}, ${e})`,postIncHelper:`${n}.postInc(${r}, ${s})`,postDecHelper:`${n}.postDec(${r}, ${s})`}}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return{getter:`${this.runtime}.prop(${n}, ${i})`,setter:e=>`${this.runtime}.setProp(${n}, ${i}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${n}, ${i})`,postDecHelper:`${this.runtime}.propPostDec(${n}, ${i})`}}let r=this.expression(e.object),n=1===t.length?t[0]:`${this.runtime}.key(${t.join(", ")})`;return{getter:`${this.runtime}.getIndex(${r}, ${n})`,setter:e=>`${this.runtime}.setIndex(${r}, ${n}, ${e})`,postIncHelper:`${this.runtime}.indexPostInc(${r}, ${n})`,postDecHelper:`${this.runtime}.indexPostDec(${r}, ${n})`}}return null}generate(e){let t=[];for(let r of e.body){let e=this.statement(r);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line(`${this.expression(e.expression)};`);case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line(`${this.objectDeclaration(e)};`);case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error(`Unknown statement type: ${e.type}`)}}functionDeclaration(e){let t=r(e.name.name);if(t){let r=t.namespace,n=t.method;this.currentClass=r.toLowerCase(),this.currentFunction=n.toLowerCase();let s=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,`${this.line(`${this.runtime}.registerMethod(${JSON.stringify(r)}, ${JSON.stringify(n)}, function() {`)} +${s} +${this.line("});")}`}{let t=e.name.name;this.currentFunction=t.toLowerCase();let r=this.functionBody(e.body,e.params);return this.currentFunction=null,`${this.line(`${this.runtime}.registerFunction(${JSON.stringify(t)}, function() {`)} +${r} +${this.line("});")}`}}functionBody(e,t){this.indentLevel++;let r=[];r.push(this.line(`const ${this.locals} = ${this.runtime}.locals();`));for(let e=0;ethis.statement(e)).join("\n\n");return this.indentLevel--,`${this.line(`${this.runtime}.package(${t}, function() {`)} +${r} +${this.line("});")}`}datablockDeclaration(e){let t=JSON.stringify(e.className.name),r=e.instanceName?JSON.stringify(e.instanceName.name):"null",n=e.parent?JSON.stringify(e.parent.name):"null",s=this.objectBody(e.body);return this.line(`${this.runtime}.datablock(${t}, ${r}, ${n}, ${s});`)}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),r=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),n=[],s=[];for(let t of e.body)"Assignment"===t.type?n.push(t):s.push(t);let i=this.objectBody(n);if(s.length>0){let e=s.map(e=>this.objectDeclaration(e)).join(",\n");return`${this.runtime}.create(${t}, ${r}, ${i}, [ +${e} +])`}return`${this.runtime}.create(${t}, ${r}, ${i})`}objectBody(e){if(0===e.length)return"{}";let t=[];for(let r of e)if("Assignment"===r.type){let e=this.expression(r.value);if("Identifier"===r.target.type){let n=r.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?t.push(`${n}: ${e}`):t.push(`[${JSON.stringify(n)}]: ${e}`)}else if("IndexExpression"===r.target.type){let n=this.objectPropertyKey(r.target);t.push(`[${n}]: ${e}`)}else{let n=this.expression(r.target);t.push(`[${n}]: ${e}`)}}if(t.length<=1)return`{ ${t.join(", ")} }`;let r=this.indent.repeat(this.indentLevel+1),n=this.indent.repeat(this.indentLevel);return`{ +${r}${t.join(",\n"+r)} +${n}}`}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),r=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return`${this.runtime}.key(${t}, ${r})`}ifStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let n=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line(`if (${t}) ${r} else ${n}`)}else{let n=this.statementAsBlock(e.alternate);return this.line(`if (${t}) ${r} else ${n}`)}return this.line(`if (${t}) ${r}`)}forStatement(e){let t=e.init?this.expression(e.init):"",r=e.test?this.expression(e.test):"",n=e.update?this.expression(e.update):"",s=this.statementAsBlock(e.body);return this.line(`for (${t}; ${r}; ${n}) ${s}`)}whileStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.body);return this.line(`while (${t}) ${r}`)}doWhileStatement(e){let t=this.statementAsBlock(e.body),r=this.expression(e.test);return this.line(`do ${t} while (${r});`)}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let r=[];for(let t of e.cases)r.push(this.switchCase(t));return this.indentLevel--,`${this.line(`switch (${t}) {`)} +${r.join("\n")} +${this.line("}")}`}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let r of e.test)t.push(this.line(`case ${this.expression(r)}:`));else t.push(this.line(`case ${this.expression(e.test)}:`));for(let r of(this.indentLevel++,e.consequent))t.push(this.statement(r));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),r=[];for(let t of e.cases)if(null===t.test)r.push(`default: () => { ${this.blockContent(t.consequent)} }`);else if(Array.isArray(t.test))for(let e of t.test)r.push(`${this.expression(e)}: () => { ${this.blockContent(t.consequent)} }`);else r.push(`${this.expression(t.test)}: () => { ${this.blockContent(t.consequent)} }`);return this.line(`${this.runtime}.switchStr(${t}, { ${r.join(", ")} });`)}returnStatement(e){return e.value?this.line(`return ${this.expression(e.value)};`):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,`{ +${t} +${this.line("}")}`}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,`{ +${t} +${this.line("}")}`}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return`(${this.expression(e.test)} ? ${this.expression(e.consequent)} : ${this.expression(e.alternate)})`;case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return`${this.runtime}.deref(${this.expression(e.argument)})`;case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return`${this.runtime}.datablock(${JSON.stringify(e.className.name)}, ${e.instanceName?JSON.stringify(e.instanceName.name):"null"}, ${e.parent?JSON.stringify(e.parent.name):"null"}, ${this.objectBody(e.body)})`;default:throw Error(`Unknown expression type: ${e.type}`)}}identifier(e){let t=r(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?`${this.runtime}.nsRef(${JSON.stringify(t.namespace)}, ${JSON.stringify(t.method)})`:JSON.stringify(e.name)}variable(e){return"global"===e.scope?`${this.globals}.get(${JSON.stringify(e.name)})`:`${this.locals}.get(${JSON.stringify(e.name)})`}binaryExpression(e){let t=this.expression(e.left),r=this.expression(e.right),s=e.operator,i=this.concatExpression(t,s,r);if(i)return i;if("$="===s)return`${this.runtime}.streq(${t}, ${r})`;if("!$="===s)return`!${this.runtime}.streq(${t}, ${r})`;if("&&"===s||"||"===s)return`(${t} ${s} ${r})`;let o=n[s];return o?`${o}(${t}, ${r})`:`(${t} ${s} ${r})`}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?1:-1;return t.setter(`${this.runtime}.add(${t.getter}, ${r})`)}}let t=this.expression(e.argument);return"~"===e.operator?`${this.runtime}.bitnot(${t})`:"-"===e.operator?`${this.runtime}.neg(${t})`:`${e.operator}${t}`}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?t.postIncHelper:t.postDecHelper;if(r)return r}return`${this.expression(e.argument)}${e.operator}`}assignmentExpression(e){let t=this.expression(e.value),r=e.operator,n=this.getAccessInfo(e.target);if(!n)throw Error(`Unhandled assignment target type: ${e.target.type}`);if("="===r)return n.setter(t);{let e=r.slice(0,-1),s=this.compoundAssignmentValue(n.getter,e,t);return n.setter(s)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let n=e.callee.name,s=r(n);if(s&&"parent"===s.namespace.toLowerCase())if(this.currentClass)return`${this.runtime}.parent(${JSON.stringify(this.currentClass)}, ${JSON.stringify(s.method)}, arguments[0]${t?", "+t:""})`;else if(this.currentFunction)return`${this.runtime}.parentFunc(${JSON.stringify(this.currentFunction)}${t?", "+t:""})`;else throw Error("Parent:: call outside of function context");return s?`${this.runtime}.nsCall(${JSON.stringify(s.namespace)}, ${JSON.stringify(s.method)}${t?", "+t:""})`:`${this.functions}.call(${JSON.stringify(n)}${t?", "+t:""})`}if("MemberExpression"===e.callee.type){let r=this.expression(e.callee.object),n="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return`${this.runtime}.call(${r}, ${n}${t?", "+t:""})`}let n=this.expression(e.callee);return`${n}(${t})`}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?`${this.runtime}.prop(${t}, ${this.expression(e.property)})`:`${this.runtime}.prop(${t}, ${JSON.stringify(e.property.name)})`}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals;return`${n}.get(${r}, ${t.join(", ")})`}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return`${this.runtime}.prop(${n}, ${i})`}let r=this.expression(e.object);return 1===t.length?`${this.runtime}.getIndex(${r}, ${t[0]})`:`${this.runtime}.getIndex(${r}, ${this.runtime}.key(${t.join(", ")}))`}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,r){switch(t){case"@":return`${this.runtime}.concat(${e}, ${r})`;case"SPC":return`${this.runtime}.concat(${e}, " ", ${r})`;case"TAB":return`${this.runtime}.concat(${e}, "\\t", ${r})`;case"NL":return`${this.runtime}.concat(${e}, "\\n", ${r})`;default:return null}}compoundAssignmentValue(e,t,r){let s=this.concatExpression(e,t,r);if(s)return s;let i=n[t];return i?`${i}(${e}, ${r})`:`(${e} ${t} ${r})`}}e.s(["createRuntime",()=>I,"createScriptCache",()=>R],33870);var i=e.i(54970),o=e.i(25645);class a{map=new Map;keyLookup=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let r=e.toLowerCase(),n=this.keyLookup.get(r);return void 0!==n?this.map.set(n,t):(this.keyLookup.set(r,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),r=this.keyLookup.get(t);return void 0!==r&&(this.keyLookup.delete(t),this.map.delete(r))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,r]of this.map)e(r,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}}class l{set=new Set;constructor(e){if(e)for(const t of e)this.add(t)}get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}}function u(e){return e.replace(/\\/g,"/").toLowerCase()}function c(e){return String(e??"")}function p(e){return Number(e)||0}function f(e){let t=c(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function h(e,t,r){let n=0;for(;t+n0;){if(n>=e.length)return"";let s=h(e,n,r);if(n+s>=e.length)return"";n+=s+1,t--}let s=h(e,n,r);return 0===s?"":e.substring(n,n+s)}function m(e,t,r,n){let s=0,i=t;for(;i>0;){if(s>=e.length)return"";let t=h(e,s,n);if(s+t>=e.length)return"";s+=t+1,i--}let o=s,a=r-t+1;for(;a>0;){let t=h(e,s,n);if((s+=t)>=e.length)break;s++,a--}let l=s;return l>o&&n.includes(e[l-1])&&l--,e.substring(o,l)}function g(e,t){if(""===e)return 0;let r=0;for(let n=0;nt&&o>=e.length)break}return i.join(s)}function y(e,t,r,n){let s=[],i=0,o=0;for(;it().$f.call(c(e),...r),eval(e){throw Error("eval() not implemented: requires runtime parsing and execution")},collapseescape:e=>c(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>c(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,r){console.warn(`export(${e}): not implemented`)},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>c(e).length,strchr(e,t){let r=c(e),n=c(t)[0]??"",s=r.indexOf(n);return s>=0?r.substring(s):""},strpos:(e,t,r)=>c(e).indexOf(c(t),p(r)),strcmp(e,t){let r=c(e),n=c(t);return rn)},stricmp(e,t){let r=c(e).toLowerCase(),n=c(t).toLowerCase();return rn)},strstr:(e,t)=>c(e).indexOf(c(t)),getsubstr(e,t,r){let n=c(e),s=p(t);return void 0===r?n.substring(s):n.substring(s,s+p(r))},getword:(e,t)=>d(c(e),p(t)," \n"),getwordcount:e=>g(c(e)," \n"),getfield:(e,t)=>d(c(e),p(t)," \n"),getfieldcount:e=>g(c(e)," \n"),setword:(e,t,r)=>b(c(e),p(t),c(r)," \n"," "),setfield:(e,t,r)=>b(c(e),p(t),c(r)," \n"," "),firstword:e=>d(c(e),0," \n"),restwords:e=>m(c(e),1,1e6," \n"),trim:e=>c(e).trim(),ltrim:e=>c(e).replace(/^\s+/,""),rtrim:e=>c(e).replace(/\s+$/,""),strupr:e=>c(e).toUpperCase(),strlwr:e=>c(e).toLowerCase(),strreplace:(e,t,r)=>c(e).split(c(t)).join(c(r)),filterstring:(e,t)=>c(e),stripchars(e,t){let r=c(e),n=new Set(c(t).split(""));return r.split("").filter(e=>!n.has(e)).join("")},getfields(e,t,r){let n=void 0!==r?Number(r):1e6;return m(c(e),p(t),n," \n")},getwords(e,t,r){let n=void 0!==r?Number(r):1e6;return m(c(e),p(t),n," \n")},removeword:(e,t)=>y(c(e),p(t)," \n"," "),removefield:(e,t)=>y(c(e),p(t)," \n"," "),getrecord:(e,t)=>d(c(e),p(t),"\n"),getrecordcount:e=>g(c(e),"\n"),setrecord:(e,t,r)=>b(c(e),p(t),c(r),"\n","\n"),removerecord:(e,t)=>y(c(e),p(t),"\n","\n"),nexttoken(e,t,r){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>c(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(p(e)),mfloor:e=>Math.floor(p(e)),mceil:e=>Math.ceil(p(e)),msqrt:e=>Math.sqrt(p(e)),mpow:(e,t)=>Math.pow(p(e),p(t)),msin:e=>Math.sin(p(e)),mcos:e=>Math.cos(p(e)),mtan:e=>Math.tan(p(e)),masin:e=>Math.asin(p(e)),macos:e=>Math.acos(p(e)),matan:(e,t)=>Math.atan2(p(e),p(t)),mlog:e=>Math.log(p(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(p(e)+1));let r=p(e);return Math.floor(Math.random()*(p(t)-r+1))+r},mdegtorad:e=>p(e)*(Math.PI/180),mradtodeg:e=>p(e)*(180/Math.PI),mfloatlength:(e,t)=>p(e).toFixed(p(t)),getboxcenter(e){let t=c(e).split(" ").map(Number),r=t[0]||0,n=t[1]||0,s=t[2]||0,i=t[3]||0,o=t[4]||0,a=t[5]||0;return`${(r+i)/2} ${(n+o)/2} ${(s+a)/2}`},vectoradd(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${r+i} ${n+o} ${s+a}`},vectorsub(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${r-i} ${n-o} ${s-a}`},vectorscale(e,t){let[r,n,s]=f(e),i=p(t);return`${r*i} ${n*i} ${s*i}`},vectordot(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return r*i+n*o+s*a},vectorcross(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${n*a-s*o} ${s*i-r*a} ${r*o-n*i}`},vectorlen(e){let[t,r,n]=f(e);return Math.sqrt(t*t+r*r+n*n)},vectornormalize(e){let[t,r,n]=f(e),s=Math.sqrt(t*t+r*r+n*n);return 0===s?"0 0 0":`${t/s} ${r/s} ${n/s}`},vectordist(e,t){let[r,n,s]=f(e),[i,o,a]=f(t),l=r-i,u=n-o,c=s-a;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,r,n,...s){let i=Number(e)||0,o=t(),a=setTimeout(()=>{o.state.pendingTimeouts.delete(a);try{o.$f.call(String(n),...s)}catch(e){throw console.error(`schedule: error calling ${n}:`,e),e}},i);return o.state.pendingTimeouts.add(a),a},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let r=String(e??"");if(console.debug(`exec(${JSON.stringify(r)}): preparing to execute…`),!r.includes("."))return console.error(`exec: invalid script file name ${JSON.stringify(r)}.`),!1;let n=u(r),s=t(),{executedScripts:i,scripts:o}=s.state;if(i.has(n))return console.debug(`exec(${JSON.stringify(r)}): skipping (already executed)`),!0;let a=o.get(n);return null==a?(console.warn(`exec(${JSON.stringify(r)}): script not found`),!1):(i.add(n),console.debug(`exec(${JSON.stringify(r)}): executing!`),s.executeAST(a),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>r?r.isFile(c(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=c(e),r=t.lastIndexOf(".");return r>=0?t.substring(r):""},filebase(e){let t=c(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),n=t.lastIndexOf("."),s=r>=0?r+1:0,i=n>s?n:t.length;return t.substring(s,i)},filepath(e){let t=c(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.substring(0,r):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile:e=>r?(i=c(e),n=r.findFiles(i),s=0,n[s++]??""):(console.warn("findFirstFile(): no fileSystem handler configured"),""),findnextfile(e){let t=c(e);if(t!==i){if(!r)return"";i=t,n=r.findFiles(t)}return n[s++]??""},getfilecrc:e=>c(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(c(e))},deactivatepackage(e){t().$.deactivatePackage(c(e))},ispackage:e=>t().$.isPackage(c(e)),isactivepackage:e=>t().$.isActivePackage(c(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource:(...e)=>0,alxgetwavelen:e=>0,alxlistenerf(e,t){},alxplay:(...e)=>0,alxsetchannelvolume(e,t){},alxsourcef(e,t,r){},alxstop(e){},alxstopall(){},activatedirectinput(){},activatekeyboard(){},deactivatedirectinput(){},deactivatekeyboard(){},disablejoystick(){},enablejoystick(){},enablewinconsole(e){},isjoystickdetected:()=>!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,r,n){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring:(e,...t)=>"",detag:e=>c(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){},commandtoserver(e){},cancelserverquery(){},querymasterserver(){},querysingleserver(){},setnetport:e=>!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty:(...e)=>!0,containerraycast:(...e)=>"",containersearchcurrdist:()=>0,containersearchnext:()=>0,initcontainerradiussearch(){},calcexplosioncoverage:(...e)=>1,getcontrolobjectaltitude:()=>0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){},pathonmissionloaddone(){}}}function A(e){return e.toLowerCase()}function x(e){let t=e.trim();return A(t.startsWith("$")?t.slice(1):t)}function C(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function S(e,t){for(let r of t)e.add(A(r))}function v(e,t,r){if(e.anyClassValues.has("*")||e.anyClassValues.has(r))return!0;for(let n of t){let t=e.valuesByClass.get(A(n));if(t&&(t.has("*")||t.has(r)))return!0}return!1}let w=[{classNames:["SceneObject","GameBase","ShapeBase","Item","Player"],fields:["position","rotation","scale","transform","hidden","renderingdistance","datablock","shapename","shapefile","initialbarrel","skin","team","health","energy","energylevel","damagelevel","damageflash","damagepercent","damagestate","mountobject","mountedimage","targetposition","targetrotation","targetscale","missiontypeslist","renderenabled","vis","velocity","name"]},{classNames:["*"],fields:["position","rotation","scale","hidden","shapefile","datablock"]}],E=[{classNames:["SceneObject","GameBase","ShapeBase","SimObject"],methods:["settransform","setposition","setrotation","setscale","sethidden","setdatablock","setshapename","mountimage","unmountimage","mountobject","unmountobject","setdamagelevel","setenergylevel","schedule","delete","deleteallobjects","add","remove","playthread","stopthread","setthreaddir","pausethread"]},{classNames:["*"],methods:["settransform","setscale","delete","add","remove"]}],_=["missionrunning","loadingmission"],k=(0,o.createLogger)("runtime");function R(){return{scripts:new Map,generatedCode:new WeakMap}}function N(e){return e.toLowerCase()}function L(e){return Number(e)>>>0}function O(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error(`Invalid instance name type: ${typeof e}`)}function I(e={}){let t,r,n,o=e.reactiveFieldRules??w,c=e.reactiveMethodRules??E,p=e.reactiveGlobalNames??_,f=(t=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=A(e);if("*"===s){S(t,n.fields);continue}S(C(r,s),n.fields)}return{anyClassValues:t,valuesByClass:r}}(o),(e,r)=>v(t,e,A(r))),h=(r=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=A(e);if("*"===s){S(t,n.methods);continue}S(C(r,s),n.methods)}return{anyClassValues:t,valuesByClass:r}}(c),(e,t)=>v(r,e,A(t))),d=(n=function(e){let t=new Set;for(let r of e)t.add(x(r));return t}(p),e=>{let t=x(e);return n.has("*")||n.has(t)}),m=new a,g=new a,b=new a,y=[],j=new l,M=3,T=1027,P=new Map,H=new a,D=new a,F=new a,G=new a,q=new a,J=new Set,U=[],W=!1,K=0;if(e.globals)for(let[t,r]of Object.entries(e.globals)){if(!t.startsWith("$"))throw Error(`Global variable "${t}" must start with $, e.g. "$${t}"`);F.set(t.slice(1),r)}let z=new Set,Z=new Set,V=e.ignoreScripts&&e.ignoreScripts.length>0?(0,i.default)(e.ignoreScripts,{nocase:!0}):null,Q=e.cache??R(),X=Q.scripts,Y=Q.generatedCode,ee=new Map;function et(e){let t=ee.get(e);return t&&t.length>0?t[t.length-1]:void 0}function er(e,t,r){let n;(n=ee.get(e))||(n=[],ee.set(e,n)),n.push(t);try{return r()}finally{let t;(t=ee.get(e))&&t.pop()}}function en(e,t){return`${e.toLowerCase()}::${t.toLowerCase()}`}function es(e,t){return m.get(e)?.get(t)??null}function ei(e){if(!e)return[];let t=[],r=new Set,n=e.class||e._className||e._class,s=n?N(String(n)):"";for(;s&&!r.has(s);)t.push(s),r.add(s),s=q.get(s)??"";return e._superClass&&!r.has(e._superClass)&&t.push(e._superClass),t}function eo(){if(W=!1,0===U.length)return;let e=U.splice(0,U.length);for(let t of(K+=1,J))t({type:"batch.flushed",tick:K,events:e})}function ea(e){for(let t of(U.push(e),J))t(e);W||(W=!0,queueMicrotask(eo))}function el(e){ea({type:"object.created",objectId:e._id,object:e})}function eu(e,t,r,n){let s=N(t);Object.is(r,n)||f(ei(e),s)&&ea({type:"field.changed",objectId:e._id,field:s,value:r,previousValue:n,object:e})}let ec=new Set,ep=null,ef=null,eh=(e.builtins??$)({runtime:()=>ef,fileSystem:e.fileSystem??null});function ed(e){let t=b.get(e);if(!t)return void j.add(e);if(!t.active){for(let[e,r]of(t.active=!0,y.push(t.name),t.methods)){m.has(e)||m.set(e,new a);let t=m.get(e);for(let[e,n]of r)t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[e,r]of t.functions)g.has(e)||g.set(e,[]),g.get(e).push(r)}}function em(e){return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?H.get(e)??null:"number"==typeof e?P.get(e)??null:null}function eg(e,t,r){let n=em(e);if(null==n)return 0;let s=eA(n[t]);return n[t]=s+r,eu(n,t,n[t],s),s}function eb(e,t){let r=es(e,t);return r&&r.length>0?r[r.length-1]:null}function ey(e,t,r,n){let s=es(e,t);return s&&0!==s.length?{found:!0,result:er(en(e,t),s.length-1,()=>s[s.length-1](r,...n))}:{found:!1}}function e$(e,t,r,n){let s;h((s=ei(r)).length?s:[e],t)&&ea({type:"method.called",className:N(e),methodName:N(t),objectId:r._id,args:[...n]});let i=G.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(r,...n)}}function eA(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function ex(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),r=null;for(let e=0;et._name?.toLowerCase()===e)??null}if(!r)return null}}return r}function eC(e){return null==e||""===e?null:ex(String(e))}function eS(e,t){function r(e,t){return e+t.join("_")}return{get:(t,...n)=>e.get(r(t,n))??"",set(n,...s){if(0===s.length)throw Error("set() requires at least a value argument");if(1===s.length){let r=e.get(n);return e.set(n,s[0]),t?.onSet?.(n,s[0],r),s[0]}let i=s[s.length-1],o=r(n,s.slice(0,-1)),a=e.get(o);return e.set(o,i),t?.onSet?.(o,i,a),i},postInc(n,...s){let i=r(n,s),o=eA(e.get(i)),a=o+1;return e.set(i,a),t?.onSet?.(i,a,o),o},postDec(n,...s){let i=r(n,s),o=eA(e.get(i)),a=o-1;return e.set(i,a),t?.onSet?.(i,a,o),o}}}function ev(){return eS(new a)}let ew={registerMethod:function(e,t,r){if(ep)ep.methods.has(e)||ep.methods.set(e,new a),ep.methods.get(e).set(t,r);else{m.has(e)||m.set(e,new a);let n=m.get(e);n.has(t)||n.set(t,[]),n.get(t).push(r)}},registerFunction:function(e,t){ep?ep.functions.set(e,t):(g.has(e)||g.set(e,[]),g.get(e).push(t))},package:function(e,t){let r=b.get(e);r||(r={name:e,active:!1,methods:new a,functions:new a},b.set(e,r));let n=ep;ep=r,t(),ep=n,j.has(e)&&(j.delete(e),ed(e))},activatePackage:ed,deactivatePackage:function(e){let t=b.get(e);if(!t||!t.active)return;t.active=!1;let r=y.findIndex(t=>t.toLowerCase()===e.toLowerCase());for(let[e,n]of(-1!==r&&y.splice(r,1),t.methods)){let t=m.get(e);if(t)for(let[e,r]of n){let n=t.get(e);if(n){let e=n.indexOf(r);-1!==e&&n.splice(e,1)}}}for(let[e,r]of t.functions){let t=g.get(e);if(t){let e=t.indexOf(r);-1!==e&&t.splice(e,1)}}},create:function(e,t,r,n){let s=N(e),i=function(){for(;P.has(T);)T+=1;let e=T;return T+=1,e}(),o={_class:s,_className:e,_id:i};for(let[e,t]of Object.entries(r))o[N(e)]=t;o.superclass&&(o._superClass=N(String(o.superclass)),o.class&&q.set(N(String(o.class)),o._superClass)),P.set(i,o);let a=O(t);if(a&&(o._name=a,H.set(a,o)),n){for(let e of n)e._parent=o;o._children=n}let l=eb(e,"onAdd");return l&&l(o),el(o),o},datablock:function(e,t,r,n){let s=N(e),i=function(){for(;P.has(M);)M+=1;let e=M;return M+=1,e}(),o={_class:s,_className:e,_id:i,_isDatablock:!0},a=O(r);if(a){let e=D.get(a);if(e){for(let[t,r]of Object.entries(e))t.startsWith("_")||(o[t]=r);o._parent=e}}for(let[e,t]of Object.entries(n))o[N(e)]=t;P.set(i,o);let l=O(t);return l&&(o._name=l,H.set(l,o),D.set(l,o)),el(o),o},deleteObject:function e(t){var r;let n;if(null==t||("number"==typeof t?n=P.get(t):"string"==typeof t?n=H.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let s=eb(n._className,"onRemove");if(s&&s(n),P.delete(n._id),n._name&&H.delete(n._name),n._isDatablock&&n._name&&D.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return ea({type:"object.deleted",objectId:(r=n)._id,object:r}),!0},prop:function(e,t){let r=em(e);return null==r?"":r[N(t)]??""},setProp:function(e,t,r){let n=em(e);if(null==n)return r;let s=N(t),i=n[s];return n[s]=r,eu(n,s,r,i),r},getIndex:function(e,t){let r=em(e);return null==r?"":r[String(t)]??""},setIndex:function(e,t,r){let n=em(e);if(null==n)return r;let s=String(t),i=n[s];return n[s]=r,eu(n,s,r,i),r},propPostInc:function(e,t){return eg(e,N(t),1)},propPostDec:function(e,t){return eg(e,N(t),-1)},indexPostInc:function(e,t){return eg(e,String(t),1)},indexPostDec:function(e,t){return eg(e,String(t),-1)},key:function(e,...t){return e+t.join("_")},call:function(e,t,...r){if(null==e||("string"==typeof e||"number"==typeof e)&&null==(e=eC(e)))return"";let n=e.class||e._className||e._class;if(n){let s=ey(n,t,e,r);if(s.found)return e$(n,t,e,r),s.result}let s=e._superClass||q.get(n);for(;s;){let n=ey(s,t,e,r);if(n.found)return e$(s,t,e,r),n.result;s=q.get(s)}return""},nsCall:function(e,t,...r){let n=es(e,t);if(!n||0===n.length)return"";let s=en(e,t),i=n[n.length-1],o=er(s,n.length-1,()=>i(...r)),a=r[0];return a&&"object"==typeof a&&e$(e,t,a,r.slice(1)),o},nsRef:function(e,t){let r=es(e,t);if(!r||0===r.length)return null;let n=en(e,t),s=r[r.length-1];return(...e)=>er(n,r.length-1,()=>s(...e))},parent:function(e,t,r,...n){let s=es(e,t),i=en(e,t),o=et(i);if(s&&void 0!==o&&o>=1){let a=o-1,l=er(i,a,()=>s[a](r,...n));return r&&"object"==typeof r&&e$(e,t,r,n),l}let a=q.get(e);for(;a;){let e=es(a,t);if(e&&e.length>0){let s=er(en(a,t),e.length-1,()=>e[e.length-1](r,...n));return r&&"object"==typeof r&&e$(a,t,r,n),s}a=q.get(a)}return""},parentFunc:function(e,...t){let r=g.get(e);if(!r)return"";let n=e.toLowerCase(),s=et(n);if(void 0===s||s<1)return"";let i=s-1;return er(n,i,()=>r[i](...t))},add:function(e,t){return eA(e)+eA(t)},sub:function(e,t){return eA(e)-eA(t)},mul:function(e,t){return eA(e)*eA(t)},div:function(e,t){return eA(e)/eA(t)},neg:function(e){return-eA(e)},lt:function(e,t){return eA(e)eA(t)},ge:function(e,t){return eA(e)>=eA(t)},eq:function(e,t){return eA(e)===eA(t)},ne:function(e,t){return eA(e)!==eA(t)},mod:function(e,t){let r=0|Number(t);return 0===r?0:(0|Number(e))%r},bitand:function(e,t){return L(e)&L(t)},bitor:function(e,t){return L(e)|L(t)},bitxor:function(e,t){return L(e)^L(t)},shl:function(e,t){return L(L(e)<<(31&L(t)))},shr:function(e,t){return L(e)>>>(31&L(t))},bitnot:function(e){return~L(e)>>>0},concat:function(...e){return e.map(e=>String(e??"")).join("")},streq:function(e,t){return String(e??"").toLowerCase()===String(t??"").toLowerCase()},switchStr:function(e,t){let r=String(e??"").toLowerCase();for(let[e,n]of Object.entries(t))if("default"!==e&&N(e)===r)return void n();t.default&&t.default()},deref:eC,nameToId:function(e){let t=ex(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?P.has(e):"string"==typeof e&&H.has(e)))},isFunction:function(e){return g.has(e)||e.toLowerCase()in eh},isPackage:function(e){return b.has(e)},isActivePackage:function(e){let t=b.get(e);return t?.active??!1},getPackageList:function(){return y.join(" ")},locals:ev,onMethodCalled(e,t,r){let n=G.get(e);n||(n=new a,G.set(e,n));let s=n.get(t);return s||(s=[],n.set(t,s)),s.push(r),()=>{let e=s.indexOf(r);-1!==e&&s.splice(e,1)}}},eE={call(e,...t){let r=g.get(e);if(r&&r.length>0)return er(e.toLowerCase(),r.length-1,()=>r[r.length-1](...t));let n=eh[e.toLowerCase()];return n?n(...t):(k.warn(`Unknown function: ${e}(${t.map(e=>JSON.stringify(e)).join(", ")})`),"")}},e_=eS(F,{onSet:function(e,t,r){let n=N(e.startsWith("$")?e.slice(1):e);Object.is(t,r)||d(n)&&ea({type:"global.changed",name:n,value:t,previousValue:r})}}),ek={methods:m,functions:g,packages:b,activePackages:y,objectsById:P,objectsByName:H,datablocks:D,globals:F,executedScripts:z,failedScripts:Z,scripts:X,generatedCode:Y,pendingTimeouts:ec,startTime:Date.now()};function eR(e){let t=function(e){let t=Y.get(e);null==t&&(t=new s(void 0).generate(e),Y.set(e,t));return t}(e),r=ev();Function("$","$f","$g","$l",t)(ew,eE,e_,r)}function eN(e,t){return{execute(){if(t){let e=u(t);ek.executedScripts.add(e)}eR(e)}}}async function eL(t,r,n){let s=e.loadScript;if(!s){t.length>0&&k.warn("Script has exec() calls but no loadScript provided: %o",t);return}async function i(t){e.signal?.throwIfAborted();let i=u(t);if(ek.scripts.has(i)||ek.failedScripts.has(i))return;if(V&&V(i)){k.warn("Ignoring script: %s",t),ek.failedScripts.add(i);return}if(n.has(i))return;let o=r.get(i);if(o)return void await o;e.progress?.addItem(t);let a=(async()=>{let o,a=await s(t);if(null==a){k.warn("Script not found: %s",t),ek.failedScripts.add(i),e.progress?.completeItem();return}try{o=B(a,{filename:t})}catch(r){k.warn("Failed to parse script: %s %o",t,r),ek.failedScripts.add(i),e.progress?.completeItem();return}let l=new Set(n);l.add(i),await eL(o.execScriptPaths,r,l),ek.scripts.set(i,o),e.progress?.completeItem()})();r.set(i,a),await a}await Promise.all(t.map(i))}async function eO(t){let r=e.loadScript;if(!r)throw Error("loadFromPath requires loadScript option to be set");let n=u(t);if(ek.scripts.has(n))return eN(ek.scripts.get(n),t);e.progress?.addItem(t);let s=await r(t);if(null==s)throw e.progress?.completeItem(),Error(`Script not found: ${t}`);let i=await eI(s,{path:t});return e.progress?.completeItem(),i}async function eI(e,t){if(t?.path){let e=u(t.path);if(ek.scripts.has(e))return eN(ek.scripts.get(e),t.path)}return ej(B(e,{filename:t?.path}),t)}async function ej(t,r){let n=new Map,s=new Set;if(r?.path){let e=u(r.path);ek.scripts.set(e,t),s.add(e)}let i=[...t.execScriptPaths,...e.preloadScripts??[]];return await eL(i,n,s),eN(t,r?.path)}return ef={$:ew,$f:eE,$g:e_,state:ek,destroy:function(){for(let e of(U.length>0&&eo(),ek.pendingTimeouts))clearTimeout(e);ek.pendingTimeouts.clear(),J.clear()},executeAST:eR,loadFromPath:eO,loadFromSource:eI,loadFromAST:ej,call:(e,...t)=>eE.call(e,...t),getObjectByName:e=>H.get(e),subscribeRuntimeEvents:e=>(J.add(e),()=>{J.delete(e)})}}let j=(0,o.createLogger)("engineMethods");function M(){let e=new Set,t=0,r=0,n=null;function s(){for(let t of e)t()}return{get total(){return t},get loaded(){return r},get current(){return n},get progress(){return 0===t?0:r/t},on(t,r){e.add(r)},off(t,r){e.delete(r)},addItem(e){t++,n=e,s()},completeItem(){r++,n=null,s()},setCurrent(e){n=e,s()}}}function B(e,r){try{return t.default.parse(e)}catch(e){if(r?.filename&&e.location)throw Error(`${r.filename}:${e.location.start.line}:${e.location.start.column}: ${e.message}`,{cause:e});throw e}}function T(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();return""!==t&&"0"!==t&&"false"!==t}return!!e}function P(){let e=Error("Operation aborted");return e.name="AbortError",e}function H(e){let t,{missionName:r,missionType:n,runtimeOptions:s,onMissionLoadDone:i}=e,{signal:o,fileSystem:a,globals:l={},preloadScripts:u=[],reactiveGlobalNames:c}=s??{},p=a?.findFiles("scripts/*Game.cs")??[],f=c?Array.from(new Set([...c,"missionRunning"])):void 0,h=I({...s,reactiveGlobalNames:f,globals:{...l,"$Host::Map":r,"$Host::MissionType":n},preloadScripts:[...u,...p]});(t=h.$.registerMethod.bind(h.$))("ShapeBase","playThread",(e,t,r)=>{e._threads||(e._threads={}),e._threads[Number(t)]={sequence:String(r),playing:!0,direction:!0}}),t("ShapeBase","stopThread",(e,t)=>{e._threads&&delete e._threads[Number(t)]}),t("ShapeBase","setThreadDir",(e,t,r)=>{e._threads||(e._threads={});let n=Number(t);e._threads[n]?e._threads[n].direction=!!Number(r):e._threads[n]={sequence:"",playing:!1,direction:!!Number(r)}}),t("ShapeBase","pauseThread",(e,t)=>{e._threads?.[Number(t)]&&(e._threads[Number(t)].playing=!1)}),t("ShapeBase","playAudio",()=>{}),t("ShapeBase","stopAudio",()=>{}),t("SimObject","getDatablock",e=>{let t=e.datablock;return t?h.getObjectByName(String(t))??"":""}),t("SimObject","getGroup",e=>e._parent??""),t("SimObject","getName",e=>e._name??""),t("SimObject","getType",()=>16384),t("SimGroup","getCount",e=>e._children?e._children.length:0),t("SimGroup","getObject",(e,t)=>{let r=e._children;return r?r[Number(t)]??"":""}),t("GameBase","isEnabled",()=>!0),t("GameBase","isDisabled",()=>!1),t("GameBase","setPoweredState",()=>{}),t("GameBase","setRechargeRate",()=>{}),t("GameBase","getRechargeRate",()=>0),t("GameBase","setEnergyLevel",()=>{}),t("GameBase","getEnergyLevel",()=>0),t("ShapeBase","getDamageLevel",()=>0),t("ShapeBase","setDamageLevel",()=>{}),t("ShapeBase","getRepairRate",()=>0),t("ShapeBase","setRepairRate",()=>{}),t("ShapeBase","getDamagePercent",()=>0),t("GameBase","getControllingClient",()=>0),t("SimObject","schedule",(e,t,r,...n)=>{let s=setTimeout(()=>{h.state.pendingTimeouts.delete(s);try{h.$.call(e,String(r),...n)}catch(t){j.error("schedule: error calling %s on %s: %o",r,e._id,t)}},Number(t)||0);return h.state.pendingTimeouts.add(s),s});let d=async function(){try{let e=await h.loadFromPath("scripts/server.cs");o?.throwIfAborted(),await h.loadFromPath(`missions/${r}.mis`),o?.throwIfAborted(),e.execute();let t=function(e,t){let{signal:r,onMissionLoadDone:n}=t;return new Promise((t,s)=>{let i=!1,o=!1,a=()=>T(e.$g.get("missionRunning")),l=()=>{i||(i=!0,h(),t())},u=e=>{i||(i=!0,h(),s(e))},c=t=>{if(!n||o)return;let r=t??e.getObjectByName("Game");r&&(o=!0,n(r))},p=()=>u(P()),f=e.subscribeRuntimeEvents(e=>{if("global.changed"===e.type&&"missionrunning"===e.name){T(e.value)&&(c(),l());return}"batch.flushed"===e.type&&a()&&(c(),l())});function h(){f(),r?.removeEventListener("abort",p)}if(r){if(r.aborted)return void u(P());r.addEventListener("abort",p,{once:!0})}a()&&(c(),l())})}(h,{signal:o,onMissionLoadDone:i}),n=await h.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");o?.throwIfAborted(),n.execute(),await t}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:h,ready:d}}e.s(["createProgressTracker",()=>M],38433);let D=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,F=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,G=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i,q={arena:"Arena",bounty:"Bounty",cnh:"CnH",ctf:"CTF",dm:"DM",dnd:"DnD",hunters:"Hunters",lakrabbit:"LakRabbit",lakzm:"LakZM",lctf:"LCTF",none:"None",rabbit:"Rabbit",sctf:"SCtF",siege:"Siege",singleplayer:"SinglePlayer",tdm:"TDM",teamhunters:"TeamHunters",teamlak:"TeamLak",tr2:"TR2"};function J(e){let t=B(e),{pragma:r,sections:n}=function(e){let t={},r=[],n={name:null,comments:[]};for(let s of e.body)if("Comment"===s.type){let e=function(e){let t;return(t=e.match(F))?{type:"sectionBegin",name:t[1]}:(t=e.match(G))?{type:"sectionEnd",name:t[1]}:(t=e.match(D))?{type:"definition",identifier:t[1],value:t[2]}:null}(s.value);if(e)switch(e.type){case"definition":null===n.name?t[e.identifier.toLowerCase()]=e.value:n.comments.push(s.value);break;case"sectionBegin":(null!==n.name||n.comments.length>0)&&r.push(n),n={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==n.name&&r.push(n),n={name:null,comments:[]}}else n.comments.push(s.value)}return(null!==n.name||n.comments.length>0)&&r.push(n),{pragma:t,sections:r}}(t);function s(e){return n.find(t=>t.name===e)?.comments.map(e=>e.trimStart()).join("\n")??null}return{displayName:r.displayname??null,missionTypes:r.missiontypes?.split(/\s+/).filter(Boolean).map(e=>q[e.toLowerCase()]??e)??[],missionBriefing:s("MISSION BRIEFING"),briefingWav:r.briefingwav??null,bitmap:r.bitmap??null,planetName:r.planetname??null,missionBlurb:s("MISSION BLURB"),missionQuote:s("MISSION QUOTE"),missionString:s("MISSION STRING"),execScriptPaths:t.execScriptPaths,hasDynamicExec:t.hasDynamicExec,ast:t}}function U(e,t){if(e)return e[t.toLowerCase()]}function W(e){let[t,r,n]=(e.position??"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}function K(e){let[t,r,n]=(e.scale??"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}e.s(["getPosition",()=>W,"getProperty",()=>U,"getScale",()=>K,"normalizedMissionTypes",0,q,"parseMissionScript",()=>J],62395)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/22c22371d5c1dcba.js b/docs/_next/static/chunks/22c22371d5c1dcba.js new file mode 100644 index 00000000..bb629ada --- /dev/null +++ b/docs/_next/static/chunks/22c22371d5c1dcba.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75840,e=>{e.v({BarFillEnergy:"PlayerHUD-module__-E1Scq__BarFillEnergy",BarFillHealth:"PlayerHUD-module__-E1Scq__BarFillHealth",BarTrack:"PlayerHUD-module__-E1Scq__BarTrack",Bars:"PlayerHUD-module__-E1Scq__Bars",Compass:"PlayerHUD-module__-E1Scq__Compass",CompassNSEW:"PlayerHUD-module__-E1Scq__CompassNSEW",CompassRing:"PlayerHUD-module__-E1Scq__CompassRing",PackInvCount:"PlayerHUD-module__-E1Scq__PackInvCount",PackInvIcon:"PlayerHUD-module__-E1Scq__PackInvIcon",PackInvInfinity:"PlayerHUD-module__-E1Scq__PackInvInfinity",PackInvItem:"PlayerHUD-module__-E1Scq__PackInvItem",PackInvItemActive:"PlayerHUD-module__-E1Scq__PackInvItemActive",PackInvItemDim:"PlayerHUD-module__-E1Scq__PackInvItemDim",PackInventoryHUD:"PlayerHUD-module__-E1Scq__PackInventoryHUD",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD",Reticle:"PlayerHUD-module__-E1Scq__Reticle",ReticleDot:"PlayerHUD-module__-E1Scq__ReticleDot",ReticleImage:"PlayerHUD-module__-E1Scq__ReticleImage",TeamCount:"PlayerHUD-module__-E1Scq__TeamCount",TeamNameEnemy:"PlayerHUD-module__-E1Scq__TeamNameEnemy",TeamNameFriendly:"PlayerHUD-module__-E1Scq__TeamNameFriendly",TeamRow:"PlayerHUD-module__-E1Scq__TeamRow",TeamScore:"PlayerHUD-module__-E1Scq__TeamScore",TeamScores:"PlayerHUD-module__-E1Scq__TeamScores",TopRight:"PlayerHUD-module__-E1Scq__TopRight",WeaponHUD:"PlayerHUD-module__-E1Scq__WeaponHUD",WeaponSeparator:"PlayerHUD-module__-E1Scq__WeaponSeparator"})},75782,e=>{e.v({ChatColor0:"ChatWindow-module__mz35vq__ChatColor0",ChatColor1:"ChatWindow-module__mz35vq__ChatColor1",ChatColor2:"ChatWindow-module__mz35vq__ChatColor2",ChatColor3:"ChatWindow-module__mz35vq__ChatColor3",ChatColor4:"ChatWindow-module__mz35vq__ChatColor4",ChatColor5:"ChatWindow-module__mz35vq__ChatColor5",ChatColor6:"ChatWindow-module__mz35vq__ChatColor6",ChatColor7:"ChatWindow-module__mz35vq__ChatColor7",ChatColor8:"ChatWindow-module__mz35vq__ChatColor8",ChatColor9:"ChatWindow-module__mz35vq__ChatColor9",ChatContainer:"ChatWindow-module__mz35vq__ChatContainer",ChatMessage:"ChatWindow-module__mz35vq__ChatMessage",ChatWindow:"ChatWindow-module__mz35vq__ChatWindow"})},49776,e=>{"use strict";var a=e.i(43476),l=e.i(932),t=e.i(58647),n=e.i(12979),r=e.i(75840),o=e.i(71645),c=e.i(75782);let u=(0,o.lazy)(()=>e.A(60458).then(e=>({default:e.ChatInput}))),i=[],s={0:c.default.ChatColor0,1:c.default.ChatColor1,2:c.default.ChatColor2,3:c.default.ChatColor3,4:c.default.ChatColor4,5:c.default.ChatColor5,6:c.default.ChatColor6,7:c.default.ChatColor7,8:c.default.ChatColor8,9:c.default.ChatColor9},d=(0,o.memo)(function(){let e,n,r,i,s,d,h=(0,l.c)(12),p=(0,t.useEngineSelector)(_),f=(0,t.useEngineSelector)(m),C=(0,o.useRef)(null),k=f[f.length-1]?.id;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},h[0]=e):e=h[0],h[1]!==k?(n=[k],h[1]=k,h[2]=n):n=h[2],(0,o.useEffect)(e,n),h[3]!==f?(r=f.map(g),h[3]=f,h[4]=r):r=h[4],h[5]!==r?(i=(0,a.jsx)("div",{ref:C,className:c.default.ChatWindow,children:r}),h[5]=r,h[6]=i):i=h[6],h[7]!==p?(s=p&&(0,a.jsx)(o.Suspense,{children:(0,a.jsx)(u,{})}),h[7]=p,h[8]=s):s=h[8],h[9]!==i||h[10]!==s?(d=(0,a.jsxs)("div",{className:c.default.ChatContainer,children:[i,s]}),h[9]=i,h[10]=s,h[11]=d):d=h[11],d});function _(e){return e.playback.recording?.source==="live"}function m(e){return e.playback.streamSnapshot?.chatMessages??i}function h(e,l){return(0,a.jsx)("span",{className:s[e.colorCode]??s[0],children:e.text},l)}function g(e){return(0,a.jsx)("div",{className:c.default.ChatMessage,hidden:!e.text,children:e.segments?e.segments.map(h):(0,a.jsxs)("span",{className:null!=e.colorCode&&s[e.colorCode]?s[e.colorCode]:s[0],children:[e.sender?`${e.sender}: `:"",e.text]})},e.id)}let p=(0,n.textureToUrl)("gui/hud_new_compass"),f=(0,n.textureToUrl)("gui/hud_new_NSEW");function C(){let e,n,o=(0,l.c)(3),c=(0,t.useEngineSelector)(k);if(null==c)return null;let u=180*c/Math.PI;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("img",{src:p,alt:"",className:r.default.CompassRing}),o[0]=e):e=o[0];let i=`rotate(${-u}deg)`;return o[1]!==i?(n=(0,a.jsxs)("div",{className:r.default.Compass,children:[e,(0,a.jsx)("img",{src:f,alt:"",className:r.default.CompassNSEW,style:{transform:i}})]}),o[1]=i,o[2]=n):n=o[2],n}function k(e){return e.playback.streamSnapshot?.camera?.yaw}function S(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(y);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillHealth,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function y(e){return e.playback.streamSnapshot?.status?.health}function v(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(x);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillEnergy,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function x(e){return e.playback.streamSnapshot?.status?.energy}let I={weapon_sniper:"gui/hud_ret_sniper",weapon_shocklance:"gui/hud_ret_shocklance",weapon_targeting:"gui/hud_ret_targlaser"};function P(){let e,o=(0,l.c)(5),c=(0,t.useEngineSelector)(b);if(void 0===c)return null;let u=I[!c?"":c.replace(/\.dts$/i,"").toLowerCase()];if(u){let e,l;return o[0]!==u?(e=(0,n.textureToUrl)(u),o[0]=u,o[1]=e):e=o[1],o[2]!==e?(l=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("img",{src:e,alt:"",className:r.default.ReticleImage})}),o[2]=e,o[3]=l):l=o[3],l}return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("div",{className:r.default.ReticleDot})}),o[4]=e):e=o[4],e}function b(e){let a=e.playback.streamSnapshot;if(!a||a.camera?.mode!=="first-person")return;let l=a.controlPlayerGhostId;if(l)return a.entities.find(e=>e.id===l)?.weaponShape}let w={0:{icon:"gui/hud_blaster",label:"Blaster"},1:{icon:"gui/hud_plasma",label:"Plasma"},2:{icon:"gui/hud_chaingun",label:"Chaingun"},3:{icon:"gui/hud_disc",label:"Spinfusor"},4:{icon:"gui/hud_grenlaunch",label:"GL"},5:{icon:"gui/hud_sniper",label:"Laser Rifle"},6:{icon:"gui/hud_elfgun",label:"ELF Gun"},7:{icon:"gui/hud_new_mortar",label:"Mortar"},8:{icon:"gui/hud_missiles",label:"Missile"},9:{icon:"gui/hud_targetlaser",label:"Targeting"},10:{icon:"gui/hud_shocklance",label:"Shocklance"},11:{icon:"gui/hud_disc",label:"Spinfusor"},12:{icon:"gui/hud_grenlaunch",label:"GL"},13:{icon:"gui/hud_chaingun",label:"Chaingun"},14:{icon:"gui/hud_targetlaser",label:"Targeting"},15:{icon:"gui/hud_targetlaser",label:"Targeting"},16:{icon:"gui/hud_shocklance",label:"Shocklance"},17:{icon:"gui/hud_new_mortar",label:"Mortar"}},j=new Map(Object.entries(w).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)])),E=new Set([9,14,15]),N=(0,n.textureToUrl)("gui/hud_infinity");function U(e){let t,n,o,c,u=(0,l.c)(12),{slot:i,isSelected:s}=e,d=w[i.index];if(!d)return null;let _=i.ammo<0,m=`${r.default.PackInvItem} ${s?r.default.PackInvItemActive:r.default.PackInvItemDim}`;return u[0]!==i.index?(t=j.get(i.index),u[0]=i.index,u[1]=t):t=u[1],u[2]!==d.label||u[3]!==t?(n=(0,a.jsx)("img",{src:t,alt:d.label,className:r.default.PackInvIcon}),u[2]=d.label,u[3]=t,u[4]=n):n=u[4],u[5]!==_||u[6]!==i.ammo?(o=_?(0,a.jsx)("img",{src:N,alt:"\\u221E",className:r.default.PackInvInfinity}):(0,a.jsx)("span",{className:r.default.PackInvCount,children:i.ammo}),u[5]=_,u[6]=i.ammo,u[7]=o):o=u[7],u[8]!==m||u[9]!==n||u[10]!==o?(c=(0,a.jsxs)("div",{className:m,children:[n,o]}),u[8]=m,u[9]=n,u[10]=o,u[11]=c):c=u[11],c}function D(){let e,n,o,c,u,i,s=(0,l.c)(15),d=(0,t.useEngineSelector)(H);if(!d||!d.slots.length)return null;if(s[0]!==d.slots){for(let a of(n=[],e=[],d.slots))E.has(a.index)?e.push(a):n.push(a);s[0]=d.slots,s[1]=e,s[2]=n}else e=s[1],n=s[2];return s[3]!==n||s[4]!==d?(o=n.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[3]=n,s[4]=d,s[5]=o):o=s[5],s[6]!==e.length?(c=e.length>0&&(0,a.jsx)("div",{className:r.default.WeaponSeparator}),s[6]=e.length,s[7]=c):c=s[7],s[8]!==e||s[9]!==d?(u=e.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[8]=e,s[9]=d,s[10]=u):u=s[10],s[11]!==o||s[12]!==c||s[13]!==u?(i=(0,a.jsxs)("div",{className:r.default.WeaponHUD,children:[o,c,u]}),s[11]=o,s[12]=c,s[13]=u,s[14]=i):i=s[14],i}function H(e){return e.playback.streamSnapshot?.weaponsHud}let T={1:"Storm",2:"Inferno",3:"Starwolf",4:"Diamond Sword",5:"Blood Eagle",6:"Phoenix"};function q(){let e,n,o,c=(0,l.c)(11),u=(0,t.useEngineSelector)(R),i=(0,t.useEngineSelector)(W);if(!u?.length)return null;if(c[0]!==i||c[1]!==u){let l,t;c[4]!==i?(l=(e,a)=>{if(i){if(e.teamId===i)return -1;if(a.teamId===i)return 1}return e.teamId-a.teamId},c[4]=i,c[5]=l):l=c[5];let o=[...u].sort(l);e=r.default.TeamScores,c[6]!==i?(t=e=>{let l=i>0&&e.teamId===i,t=e.name||(T[e.teamId]??`Team ${e.teamId}`);return(0,a.jsxs)("div",{className:r.default.TeamRow,children:[(0,a.jsx)("span",{className:l?r.default.TeamNameFriendly:r.default.TeamNameEnemy,children:t}),(0,a.jsx)("span",{className:r.default.TeamScore,children:e.score}),(0,a.jsxs)("span",{className:r.default.TeamCount,children:["(",e.playerCount,")"]})]},e.teamId)},c[6]=i,c[7]=t):t=c[7],n=o.map(t),c[0]=i,c[1]=u,c[2]=e,c[3]=n}else e=c[2],n=c[3];return c[8]!==e||c[9]!==n?(o=(0,a.jsx)("div",{className:e,children:n}),c[8]=e,c[9]=n,c[10]=o):o=c[10],o}function W(e){return e.playback.streamSnapshot?.playerSensorGroup}function R(e){return e.playback.streamSnapshot?.teamScores}let B=new Map(Object.entries({0:"gui/hud_new_packammo",1:"gui/hud_new_packcloak",2:"gui/hud_new_packenergy",3:"gui/hud_new_packrepair",4:"gui/hud_new_packsatchel",5:"gui/hud_new_packshield",6:"gui/hud_new_packinventory",7:"gui/hud_new_packmotionsens",8:"gui/hud_new_packradar",9:"gui/hud_new_packturretout",10:"gui/hud_new_packturretin",11:"gui/hud_new_packsensjam",12:"gui/hud_new_packturret",13:"gui/hud_new_packturret",14:"gui/hud_new_packturret",15:"gui/hud_new_packturret",16:"gui/hud_new_packturret",17:"gui/hud_new_packturret",18:"gui/hud_satchel_unarmed",19:"gui/hud_new_packenergy"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),M=new Map(Object.entries({1:"gui/hud_new_packcloak_armed",3:"gui/hud_new_packrepair_armed",4:"gui/hud_satchel_armed",5:"gui/hud_new_packshield_armed",11:"gui/hud_new_packsensjam_armed"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),z={0:{icon:"gui/hud_handgren",label:"Grenade"},1:{icon:"gui/hud_mine",label:"Mine"},2:{icon:"gui/hud_beacon",label:"Beacon"},3:{icon:"gui/hud_medpack",label:"Repair Kit"}},F=new Map(Object.entries(z).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)]));function $(){let e,n,o,c,u,i,s,d=(0,l.c)(25),_=(0,t.useEngineSelector)(O),m=(0,t.useEngineSelector)(G),h=_&&_.packIndex>=0;if(h){let a,l;d[0]!==_.active||d[1]!==_.packIndex?(a=_.active?M.get(_.packIndex):void 0,d[0]=_.active,d[1]=_.packIndex,d[2]=a):a=d[2];let t=a;d[3]!==t||d[4]!==_.packIndex?(l=t??B.get(_.packIndex),d[3]=t,d[4]=_.packIndex,d[5]=l):l=d[5],e=l}if(d[6]!==m){if(n=new Map,m)for(let e of m.slots)n.set(e.slot,e.count);d[6]=m,d[7]=n}else n=d[7];if(d[8]!==_||d[9]!==n||d[10]!==h||d[11]!==e){i=Symbol.for("react.early_return_sentinel");e:{let l,t=Object.keys(z).map(Number).sort(A);if(!h&&!n.size){i=null;break e}o=r.default.PackInventoryHUD,d[16]!==_||d[17]!==e?(c=e&&(0,a.jsxs)("div",{className:`${r.default.PackInvItem} ${_.active?r.default.PackInvItemActive:""}`,children:[(0,a.jsx)("img",{src:e,alt:"",className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:_.text||" "})]}),d[16]=_,d[17]=e,d[18]=c):c=d[18],d[19]!==n?(l=e=>{let l=z[e],t=F.get(e);return l&&t?(0,a.jsxs)("div",{className:r.default.PackInvItem,children:[(0,a.jsx)("img",{src:t,alt:l.label,className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:n.get(e)??0})]},e):null},d[19]=n,d[20]=l):l=d[20],u=t.map(l)}d[8]=_,d[9]=n,d[10]=h,d[11]=e,d[12]=o,d[13]=c,d[14]=u,d[15]=i}else o=d[12],c=d[13],u=d[14],i=d[15];return i!==Symbol.for("react.early_return_sentinel")?i:(d[21]!==o||d[22]!==c||d[23]!==u?(s=(0,a.jsxs)("div",{className:o,children:[c,u]}),d[21]=o,d[22]=c,d[23]=u,d[24]=s):s=d[24],s)}function A(e,a){return e-a}function G(e){return e.playback.streamSnapshot?.inventoryHud}function O(e){return e.playback.streamSnapshot?.backpackHud}function L(){let e,n,o,c,u,i,s,_=(0,l.c)(12),m=(0,t.useEngineSelector)(K);return _[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d,{}),_[0]=e):e=_[0],_[1]!==m?(n=m&&(0,a.jsxs)("div",{className:r.default.Bars,children:[(0,a.jsx)(S,{}),(0,a.jsx)(v,{})]}),_[1]=m,_[2]=n):n=_[2],_[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(C,{}),_[3]=o):o=_[3],_[4]!==n?(c=(0,a.jsxs)("div",{className:r.default.TopRight,children:[n,o]}),_[4]=n,_[5]=c):c=_[5],_[6]!==m?(u=m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(D,{}),(0,a.jsx)($,{}),(0,a.jsx)(P,{})]}),_[6]=m,_[7]=u):u=_[7],_[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(q,{}),_[8]=i):i=_[8],_[9]!==c||_[10]!==u?(s=(0,a.jsxs)("div",{className:r.default.PlayerHUD,children:[e,c,u,i]}),_[9]=c,_[10]=u,_[11]=s):s=_[11],s}function K(e){return!!e.playback.streamSnapshot?.controlPlayerGhostId}e.s(["PlayerHUD",()=>L],49776)},60458,e=>{e.v(a=>Promise.all(["static/chunks/543f866d9a9c134b.css","static/chunks/450cc5a89761fca0.js"].map(a=>e.l(a))).then(()=>a(52728)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/273b16b21a9dcb92.js b/docs/_next/static/chunks/273b16b21a9dcb92.js new file mode 100644 index 00000000..1d55c706 --- /dev/null +++ b/docs/_next/static/chunks/273b16b21a9dcb92.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(81847).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog "+e.i(81847).Dialog,Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay "+e.i(81847).Overlay,PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),o=e.i(11152),i=e.i(66027),n=e.i(12979),r=e.i(91996),s=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,o=(0,a.c)(5),{name:i}=e;o[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,n.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),o[0]=i,o[1]=l):l=o[1];let u=l;if(u){let e;return o[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:s.default.Bitmap}),o[2]=u,o[3]=e):e=o[3],e}if(/bullet/i.test(i)){let e;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:s.default.Bullet,children:"•"}),o[4]=e):e=o[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let o,i,n=(0,a.c)(4),{markup:r}=e;n[0]!==r?(o=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),o={type:"span",source:"root",style:{},children:[]},i=o,n=[i],r=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||r(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,n.push(i);break}case"spop":if("root"!==i.source){let e=n.pop();for(;"spush"!==e.source;)e=n.pop();i=n[n.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(r(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,n.push(i)}else i.style.fontSize=t;break}case"color":if(r(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,n.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,n.push(i);break}case"/a":{let e=n.pop();for(;"a"!==e.source;)e=n.pop();i=n[n.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(o)}(r),n[0]=r,n[1]=o):o=n[1];let c=o;return n[2]!==c?(i=(0,t.jsx)("div",{className:s.default.GuiMarkup,children:c}),n[2]=c,n[3]=i):i=n[3],i}var f=e.i(41973);function _(e){let o,i,n,r=(0,a.c)(7),{src:s,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(r[0]!==s?(o=()=>{let e,t=!1;return fetch(s).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(h),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[s],r[0]=s,r[1]=o,r[2]=i):(o=r[1],i=r[2]),(0,l.useEffect)(o,i),p)?(r[3]!==u||r[4]!==m||r[5]!==p?(n=(0,t.jsx)("img",{src:p,alt:u,className:m}),r[3]=u,r[4]=m,r[5]=p,r[6]=n):n=r[6],n):null}function h(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,r,s,u,c,m,p,d,_,h,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let D=`${n.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{k.current?.pause()},s=[],y[2]=r,y[3]=s):(r=y[2],s=y[3]),(0,l.useEffect)(r,s),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==D?(d=(0,t.jsx)("audio",{ref:k,src:D,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=D,y[10]=d):d=y[10],y[11]!==M?(_=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=_):_=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(h=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(o.FaVolumeUp,{}):(0,t.jsx)(o.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=h):h=y[16],y[17]!==v||y[18]!==h||y[19]!==d||y[20]!==_?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,_,h]}),y[17]=v,y[18]=h,y[19]=d,y[20]=_,y[21]=g):g=y[21],g}function x(e){var o,s,u;let c,m,h,g,y,M,x,D,w,I,N,B,S,C,P,L,T,X,E,O,R,U,F,$,G,K,Q,q,W,Z,z,A,H,V,J,Y,ee,et=(0,a.c)(100),{onClose:ea,missionName:el,missionType:eo}=e,{data:ei}=((ee=(0,a.c)(2))[0]!==el?(Y={queryKey:["parsedMission",el],queryFn:()=>(0,n.loadMission)(el)},ee[0]=el,ee[1]=Y):Y=ee[1],(0,i.useQuery)(Y)),en=(0,l.useRef)(null);et[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},m=[],et[0]=c,et[1]=m):(c=et[0],m=et[1]),(0,l.useEffect)(c,m),et[2]!==ea?(h=()=>{let e=e=>{if("Escape"===e.key)ea();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void ea();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea],et[2]=ea,et[3]=h,et[4]=g):(h=et[3],g=et[4]),(0,l.useEffect)(h,g),et[5]!==ei?(y=ei?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(ei.ast):{},et[5]=ei,et[6]=y):y=et[6];let er=y;et[7]!==el||et[8]!==ei?(M=ei?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,n.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,n.getUrlForPath)(e)}catch{}return null}(ei.bitmap,el):null,et[7]=el,et[8]=ei,et[9]=M):M=et[9];let es=M,eu=ei?.displayName??el;et[10]!==eo?(x=eo.toLowerCase(),et[10]=eo,et[11]=x):x=et[11];let ec="singleplayer"===x,em=er.musictrack;if(et[12]!==es||et[13]!==eu||et[14]!==ec||et[15]!==eo||et[16]!==ea||et[17]!==ei){let e,a,l,i,n,r,c=ei?.missionString?(o=ei.missionString,r=eo.toUpperCase(),o.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(r)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[36]!==ei?.missionQuote){if(s=i=ei?.missionQuote?.trim()??"",l="",e="",!(a=p.test(s)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[36]=ei?.missionQuote,et[37]=e,et[38]=a,et[39]=l,et[40]=i}else e=et[37],a=et[38],l=et[39],i=et[40];(U=f.default.Overlay,F=ea,C=en,P=f.default.Dialog,L=j,T=b,X="dialog",E="true",O="Map Information",R=-1,S=f.default.Body,$=f.default.Left,et[41]!==es||et[42]!==eu||et[43]!==ec?(G=es&&ec&&(0,t.jsx)(_,{className:f.default.PreviewImageFloating,src:es,alt:`${eu} preview`},es),et[41]=es,et[42]=eu,et[43]=ec,et[44]=G):G=et[44],et[45]!==eu?(D=(0,t.jsx)("h1",{className:f.default.Title,children:eu}),et[45]=eu,et[46]=D):D=et[46],et[47]!==ei?(n=ei?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:ei.planetName}),et[47]=ei,et[48]=n):n=et[48],et[49]!==n?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:n}),et[49]=n,et[50]=w):w=et[50],et[51]!==e||et[52]!==a||et[53]!==l||et[54]!==i?(I=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[51]=e,et[52]=a,et[53]=l,et[54]=i,et[55]=I):I=et[55],et[56]!==ei)?(N=ei?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=ei.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:ei.missionBlurb.trim()}):ei.missionBlurb.trim()}),et[56]=ei,et[57]=N):N=et[57],B=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[12]=es,et[13]=eu,et[14]=ec,et[15]=eo,et[16]=ea,et[17]=ei,et[18]=D,et[19]=w,et[20]=I,et[21]=N,et[22]=B,et[23]=S,et[24]=C,et[25]=P,et[26]=L,et[27]=T,et[28]=X,et[29]=E,et[30]=O,et[31]=R,et[32]=U,et[33]=F,et[34]=$,et[35]=G}else D=et[18],w=et[19],I=et[20],N=et[21],B=et[22],S=et[23],C=et[24],P=et[25],L=et[26],T=et[27],X=et[28],E=et[29],O=et[30],R=et[31],U=et[32],F=et[33],$=et[34],G=et[35];return et[58]!==ei?(K=ei?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:ei.missionBriefing})]}),et[58]=ei,et[59]=K):K=et[59],et[60]!==em?(Q=em&&(0,t.jsx)(v,{track:em}),et[60]=em,et[61]=Q):Q=et[61],et[62]!==D||et[63]!==w||et[64]!==I||et[65]!==N||et[66]!==B||et[67]!==K||et[68]!==Q||et[69]!==$||et[70]!==G?(q=(0,t.jsxs)("div",{className:$,children:[G,D,w,I,N,B,K,Q]}),et[62]=D,et[63]=w,et[64]=I,et[65]=N,et[66]=B,et[67]=K,et[68]=Q,et[69]=$,et[70]=G,et[71]=q):q=et[71],et[72]!==es||et[73]!==eu||et[74]!==ec?(W=es&&!ec&&(0,t.jsx)(_,{src:es,alt:`${eu} preview`},es),et[72]=es,et[73]=eu,et[74]=ec,et[75]=W):W=et[75],et[76]!==S||et[77]!==q||et[78]!==W?(Z=(0,t.jsxs)("div",{className:S,children:[q,W]}),et[76]=S,et[77]=q,et[78]=W,et[79]=Z):Z=et[79],et[80]!==ea?(z=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:ea,children:"Close"}),et[80]=ea,et[81]=z):z=et[81],et[82]===Symbol.for("react.memo_cache_sentinel")?(A=(0,t.jsx)("span",{className:f.default.Hint,children:"Esc to close"}),et[82]=A):A=et[82],et[83]!==z?(H=(0,t.jsxs)("div",{className:f.default.Footer,children:[z,A]}),et[83]=z,et[84]=H):H=et[84],et[85]!==C||et[86]!==P||et[87]!==L||et[88]!==T||et[89]!==X||et[90]!==E||et[91]!==O||et[92]!==R||et[93]!==Z||et[94]!==H?(V=(0,t.jsxs)("div",{ref:C,className:P,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":O,tabIndex:R,children:[Z,H]}),et[85]=C,et[86]=P,et[87]=L,et[88]=T,et[89]=X,et[90]=E,et[91]=O,et[92]=R,et[93]=Z,et[94]=H,et[95]=V):V=et[95],et[96]!==U||et[97]!==F||et[98]!==V?(J=(0,t.jsx)("div",{className:U,onClick:F,children:V}),et[96]=U,et[97]=F,et[98]=V,et[99]=J):J=et[99],J}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/28c98fb093e4695f.css b/docs/_next/static/chunks/28c98fb093e4695f.css new file mode 100644 index 00000000..696d899c --- /dev/null +++ b/docs/_next/static/chunks/28c98fb093e4695f.css @@ -0,0 +1,2 @@ +.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__TopRight{align-items:flex-start;gap:6px;display:flex;position:absolute;top:10px;right:10px}.PlayerHUD-module__-E1Scq__Compass{flex-shrink:0;width:64px;height:64px;position:relative}.PlayerHUD-module__-E1Scq__CompassRing{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__CompassNSEW{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__Bars{flex-direction:column;gap:3px;padding-top:10px;display:flex}.PlayerHUD-module__-E1Scq__BarTrack{background:#00000080;border:1px solid #ffffff26;width:120px;height:10px;overflow:hidden}.PlayerHUD-module__-E1Scq__BarFillHealth{background:#2ecc40;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__BarFillEnergy{background:#0af;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__WeaponHUD{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:8px;transform:translateY(-50%)}.PlayerHUD-module__-E1Scq__WeaponSeparator{height:6px}.PlayerHUD-module__-E1Scq__TeamScores{font-family:monospace;font-size:12px;position:absolute;bottom:8px;left:8px}.PlayerHUD-module__-E1Scq__TeamRow{background:#00323ca6;gap:6px;padding:2px 8px;display:flex}.PlayerHUD-module__-E1Scq__TeamRow+.PlayerHUD-module__-E1Scq__TeamRow{border-top:1px solid #80ffc826}.PlayerHUD-module__-E1Scq__TeamNameFriendly{color:#2ecc40;min-width:60px}.PlayerHUD-module__-E1Scq__TeamNameEnemy{color:#e44;min-width:60px}.PlayerHUD-module__-E1Scq__TeamScore{color:#fff;text-align:right;min-width:24px;font-weight:700}.PlayerHUD-module__-E1Scq__TeamCount{color:#9ba;text-align:right;min-width:24px}.PlayerHUD-module__-E1Scq__PackInventoryHUD{align-items:center;gap:4px;display:flex;position:absolute;bottom:8px;right:8px}.PlayerHUD-module__-E1Scq__PackInvItem{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}.PlayerHUD-module__-E1Scq__PackInvItemActive{border-color:#80ffc880;box-shadow:0 0 6px #80ffc84d}.PlayerHUD-module__-E1Scq__PackInvItemDim{opacity:.5}.PlayerHUD-module__-E1Scq__PackInvIcon{image-rendering:pixelated;display:block}.PlayerHUD-module__-E1Scq__PackInvCount{color:#bfe;text-align:center;min-width:12px;font-family:monospace;font-size:11px}.PlayerHUD-module__-E1Scq__PackInvInfinity{image-rendering:pixelated;opacity:.8;display:block}.PlayerHUD-module__-E1Scq__Reticle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.PlayerHUD-module__-E1Scq__ReticleImage{opacity:.85;width:64px;height:64px;image-rendering:pixelated}.PlayerHUD-module__-E1Scq__ReticleDot{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080} +.ChatWindow-module__mz35vq__ChatContainer{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;width:400px;max-width:50%;display:flex;position:absolute;top:8px;left:8px}.ChatWindow-module__mz35vq__ChatWindow{-webkit-user-select:text;user-select:text;scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;min-height:4em;max-height:12.5em;padding:6px;font-size:12px;line-height:1.25;overflow-y:auto}.ChatWindow-module__mz35vq__ChatMessage{color:#2cacb5;padding:2px 0}.ChatWindow-module__mz35vq__ChatColor0{color:#2cacb5}.ChatWindow-module__mz35vq__ChatColor1{color:#04eb69}.ChatWindow-module__mz35vq__ChatColor2{color:#dbc880}.ChatWindow-module__mz35vq__ChatColor3{color:#4dfd5f}.ChatWindow-module__mz35vq__ChatColor4{color:#28e7f0}.ChatWindow-module__mz35vq__ChatColor5{color:#c8c832}.ChatWindow-module__mz35vq__ChatColor6{color:#c8c8c8}.ChatWindow-module__mz35vq__ChatColor7{color:#dcdc14}.ChatWindow-module__mz35vq__ChatColor8{color:#9696fa}.ChatWindow-module__mz35vq__ChatColor9{color:#3cdc96} diff --git a/docs/_next/static/chunks/2afaf0aea010c2be.js b/docs/_next/static/chunks/2afaf0aea010c2be.js new file mode 100644 index 00000000..6a5ffb7a --- /dev/null +++ b/docs/_next/static/chunks/2afaf0aea010c2be.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function s(e,s){let n=t(e,s);if(null==n)return;let i=parseFloat(n);return Number.isFinite(i)?i:void 0}function n(e,s){let n=t(e,s);if(null==n)return;let i=parseInt(n,10);return Number.isFinite(i)?i:void 0}function i(e,t={x:0,y:0,z:0}){if(!e)return t;let s=e.split(" ").map(Number);return{x:s[0]??t.x,y:s[1]??t.y,z:s[2]??t.z}}function r(e,t={r:0,g:0,b:0}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b,a:s[3]??t.a}}function o(e,t){let s=i(e),n=(t??"1 0 0 0").split(" ").map(Number),r=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),c=Math.sqrt(r*r+a*a+o*o),u=0,m=0,d=1;c>1e-8&&(u=r/c,m=a/c,d=o/c);let h=Math.cos(l),p=Math.sin(l),g=1-h,f=Array(16).fill(0);return f[0]=g*u*u+h,f[1]=g*u*m+p*d,f[2]=g*u*d-p*m,f[4]=g*u*m-p*d,f[5]=g*m*m+h,f[6]=g*m*d+p*u,f[8]=g*u*d+p*m,f[9]=g*m*d-p*u,f[10]=g*d*d+h,f[12]=s.x,f[13]=s.y,f[14]=s.z,f[15]=1,{elements:f,position:s}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function c(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function u(e){let a=[];for(let s=1;s<=3;s++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),s=t[0]??0,n=t[1]??0,i=t[2]??0;return 0===s&&0===n&&0===i?null:{visibleDistance:s,minHeight:n,maxHeight:i,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${s}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let i=t(e,`cloudText${n+1}`)??"",r=s(e,`cloudHeightPer[${n}]`)??s(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=s(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:i,heightPercent:r,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:r(t(e,"fogColor")),visibleDistance:s(e,"visibleDistance")??1e3,fogDistance:s(e,"fogDistance")??0,skySolidColor:r(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:i(t(e,"windVelocity"))}}function m(e){return{className:"Sun",ghostIndex:e._id,direction:i(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function d(e){let n=t(e,"area"),i={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);i={x:e[0]??i.x,y:e[1]??i.y,w:e[2]??i.w,h:e[3]??i.h}}return{className:"MissionArea",ghostIndex:e._id,area:i,flightCeiling:s(e,"flightCeiling")??2e3,flightCeilingRange:s(e,"flightCeilingRange")??50}}function h(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:s(e,"surfaceOpacity")??.75,waveMagnitude:s(e,"waveMagnitude")??1,envMapIntensity:s(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>c,"missionAreaFromMis",()=>d,"skyFromMis",()=>u,"sunFromMis",()=>m,"terrainFromMis",()=>l,"waterBlockFromMis",()=>h])},70847,47566,63318,e=>{"use strict";let t=(0,e.i(25645).createLogger)("ghostToScene");function s(e,t={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:t}function n(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function i(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:s}=e,n=s.x*s.x,i=s.y*s.y,r=s.z*s.z,a=s.x*s.y,o=s.x*s.z,l=s.y*s.z,c=s.w*s.x,u=s.w*s.y,m=s.w*s.z;return{elements:[1-2*(i+r),2*(a+m),2*(o-u),0,2*(a-m),1-2*(n+r),2*(l+c),0,2*(o+u),2*(l-c),1-2*(n+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function a(e,a,o){let l;switch(e){case"TerrainBlock":return l={className:"TerrainBlock",ghostIndex:a,terrFileName:o.terrFileName??"",detailTextureName:o.detailTextureName??"",squareSize:o.squareSize??8,emptySquareRuns:o.emptySquareRuns},t.debug("TerrainBlock #%d: terrFileName=%s",a,l.terrFileName),l;case"InteriorInstance":return l={className:"InteriorInstance",ghostIndex:a,interiorFile:o.interiorFile??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),showTerrainInside:o.showTerrainInside??!1,skinBase:o.skinBase??"",alarmState:o.alarmState??!1},t.debug("InteriorInstance #%d: interiorFile=%s",a,l.interiorFile),l;case"TSStatic":return{className:"TSStatic",ghostIndex:a,shapeName:o.shapeName??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1})};case"Sky":{let e,i;e=Array.isArray(o.fogVolumes)?o.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:n(e.color)})):[],i=Array.isArray(o.cloudLayers)?o.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[];let r=l={className:"Sky",ghostIndex:a,materialList:o.materialList??"",fogColor:n(o.fogColor),visibleDistance:o.visibleDistance??1e3,fogDistance:o.fogDistance??0,skySolidColor:n(o.skySolidColor),useSkyTextures:o.useSkyTextures??!0,fogVolumes:e,cloudLayers:i,windVelocity:s(o.windVelocity)};return t.debug("Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s",a,r.materialList,r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,r.useSkyTextures),l}case"Sun":{let e=l={className:"Sun",ghostIndex:a,direction:s(o.direction,{x:.57735,y:.57735,z:-.57735}),color:i(o.color,{r:.7,g:.7,b:.7,a:1}),ambient:i(o.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(o.textures)?o.textures:void 0};return t.debug("Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",a,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),l}case"MissionArea":return{className:"MissionArea",ghostIndex:a,area:o.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:o.flightCeiling??2e3,flightCeilingRange:o.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:a,transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),surfaceName:o.surfaceName??"",envMapName:o.envMapName??"",surfaceOpacity:o.surfaceOpacity??.75,waveMagnitude:o.waveMagnitude??1,envMapIntensity:o.envMapIntensity??1};default:return null}}e.s(["ghostToSceneObject",()=>a],47566),e.i(9672);var o=e.i(90072);function l(e){return[e.y,e.z,e.x]}function c(e){return[e.y,e.z,e.x]}function u(e){let t=e.elements,s=new o.Matrix4,n=s.elements;n[0]=t[5],n[1]=t[6],n[2]=t[4],n[3]=0,n[4]=t[9],n[5]=t[10],n[6]=t[8],n[7]=0,n[8]=t[1],n[9]=t[2],n[10]=t[0],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1;let i=new o.Quaternion;return i.setFromRotationMatrix(s),i.conjugate(),i}e.s(["matrixFToQuaternion",()=>u,"torqueScaleToThree",()=>c,"torqueToThree",()=>l],63318),e.s([],70847)},92224,e=>{"use strict";e.i(932);var t=e.i(8155),s=e.i(66748),n=e.i(62395);let i=(0,t.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let s=new Map(e.missionEntities);return s.set(t.id,t),{missionEntities:s,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let s=new Map(e.missionEntities);return s.delete(t),{missionEntities:s,version:e.version+1}})},setEntities(t){e(e=>{let s=new Map(e.missionEntities);for(let e of t)s.set(e.id,e);return{missionEntities:s,version:e.version+1}})},setAllEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);return{missionEntities:s,dataSource:e.isStreaming?e.dataSource:"map"}})},clearEntities(){e(e=>0===e.missionEntities.size?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let s={};if(void 0!==t.missionName&&(s.missionName=t.missionName),void 0!==t.missionType&&(s.missionType=t.missionType),void 0!==t.missionTypeDisplayName&&(s.missionTypeDisplayName=t.missionTypeDisplayName),void 0!==t.missionDisplayName&&(s.missionDisplayName=t.missionDisplayName),void 0!==t.gameClassName&&(s.gameClassName=t.gameClassName,void 0===t.missionType))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,"");s.missionType=n.normalizedMissionTypes[e.toLowerCase()]??e}else s.missionType=null;void 0!==t.serverDisplayName&&(s.serverDisplayName=t.serverDisplayName),void 0!==t.recorderName&&(s.recorderName=t.recorderName),void 0!==t.recordingDate&&(s.recordingDate=t.recordingDate),e(e=>({...s,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?"map":null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let s=new Map(e.streamEntities);return s.set(t.id,t),{streamEntities:s,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let s=new Map(e.streamEntities);return s.delete(t),{streamEntities:s,version:e.version+1}})},setStreamEntities(t){e(e=>{let s=new Map(e.streamEntities);for(let e of t)s.set(e.id,e);return{streamEntities:s,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);let n=e.streamEntities;return s.size===n.size&&[...s.keys()].every(e=>n.has(e))?e:{streamEntities:s,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function r(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,s=[];for(let e of t.values())"None"!==e.renderType&&s.push(e);return s}function a(e,t){if(e.length!==t.length)return!1;for(let s=0;so,"useDataSource",()=>d,"useMissionDisplayName",()=>k,"useMissionName",()=>p,"useMissionType",()=>f,"useMissionTypeDisplayName",()=>v,"useRecorderName",()=>N,"useRecordingDate",()=>x,"useSceneSky",()=>u,"useSceneSun",()=>m,"useServerDisplayName",()=>E])},98755,e=>{"use strict";var t=e.i(47167),s=e.i(8155),n=e.i(66748),i=e.i(25645);let r=(0,i.createLogger)("relayClient");class a{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{r.info("WebSocket connected to %s",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){r.error("Failed to parse relay message: %o",e)}},this.ws.onclose=()=>{r.info("WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{r.error("WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){r.info("Joining server: %s",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,s){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:s})}sendCRCCompute(e,t,s,n){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:n,datablocks:s})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMove(e){this.send({type:"sendMove",move:e})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):r.warn("send dropped (ws not open): %s",e.type)}}e.i(50593);var o=e.i(45853),l=e.i(89119),c=e.i(10244);let u=(0,i.createLogger)("liveStreaming");class m extends c.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:s,packetParser:n}=(0,o.createLiveParser)();this.packetParser=n,this.ghostTracker=s,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,s=e.sequences;t&&s&&this._shapeConstructorCache.set(t.toLowerCase(),s)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,s]of t){let n=s.explosion;if(null==n)continue;let i=t.get(n);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly",this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let s=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(s)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);u.info("auth event: %s %o",s,t),this.relay.sendAuthEvent(s,t);return}let n=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===s){let e=n[0]??"",t=n[1]??null;u.info("mission phase 1, seq=%s mission=%s resolvedArgs=%o",e,t,n),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===s){let e=n[0]??"";u.info("mission phase 2 (datablocks), seq=%s",e),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===s){let e=n[0]??"",t=n[1]??null;u.info("mission phase 3 (ghosting), seq=%s mission=%s",e,t),t&&(this.missionName=t),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,s=e.field1,n=e.field2,i=(1&s)!=0;u.info("CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s",(t>>>0).toString(16),(s>>>0).toString(16),(n>>>0).toString(16),i);let r=this.packetParser.getDataBlockDataMap(),a=[];if(r)for(let[e,t]of r){let s=this.dataBlockClassNames.get(e);if(!s)continue;let n=(0,l.resolveShapeName)(s,t);a.push({objectId:e,className:s,shapeName:n??""})}u.info("CRC: sending %d datablocks for computation",a.length),this.relay.sendCRCCompute(t,n,a,i)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,s=e.sequence,n=e.ghostCount;u.info("GhostingMessageEvent: message=%d sequence=%d ghostCount=%d",t,s,n),0===t&&(u.info("Sending ghost ack (type 1) for sequence %d",s),this.relay.sendGhostAck(s,n))}observerMode="fly";cycleObserveNext(){"fly"===this.observerMode?(u.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(u.info("observer: cycle next (fire trigger)"),this.sendTrigger(0))}toggleObserverMode(){"fly"===this.observerMode?(u.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(u.info("observer: follow → fly (jump trigger)"),this.sendTrigger(2),this.observerMode="fly")}sendTrigger(e){let t=[!1,!1,!1,!1,!1,!1];t[e]=!0,this.relay.sendMove({x:0,y:0,z:0,yaw:0,pitch:0,roll:0,trigger:t,freeLook:!1})}getPlayerList(){let e=[];for(let[t,s]of this.targetNames){let n=this.targetTeams.get(t)??0;e.push({targetId:t,name:s,sensorGroup:n})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,s=this.packetParser.protocolNoDispatch,n=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,r=this.packetParser.protocolNoDispatch>s;(i||r)&&u.warn("packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)",this.tickCount,i?"REJECTED":"no-dispatch",e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let a=this.tickCount<20,o=this.tickCount%100==0,c=a||o;for(let t of(c&&u.debug("packet #%d: %d events, %d ghosts, %d bytes%s%s",this.tickCount,n.events.length,n.ghosts.length,e.length,void 0!==n.gameState.controlObjectGhostIndex?`, control=${n.gameState.controlObjectGhostIndex}`:"",void 0!==n.gameState.cameraFov?`, fov=${n.gameState.cameraFov}`:""),this.processControlObject(n.gameState),n.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");u.debug("remote: %s",e)}if(a&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&u.debug("event: %s%s",e,"SimDataBlockEvent"===e?` id=${t.parsedData.objectId} class=${t.parsedData.dataBlockClassName}`:""),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,s=t.parsedData.dataBlockClassName;if(null!=e&&s&&this.dataBlockClassNames.set(e,s),c){let n=t.parsedData.dataBlockData,i=(0,l.resolveShapeName)(s??"",n);u.debug("datablock: id=%d class=%s%s",e,s??"?",i?` shape=${i}`:"")}}let s=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,s),a&&"NetStringEvent"===e){let e=t.parsedData.id,s=t.parsedData.value;null!=e&&"string"==typeof s&&u.trace('netString #%d = "%s"',e,s.length>60?s.slice(0,60)+"…":s)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,s=t.parsedData.nameTag;if(null!=e&&null!=s){let n=this.netStrings.get(s);if(n){let s=(0,l.stripTaggedStringMarkup)(n);u.info('target #%d: "%s" team=%s',e,s,t.parsedData.sensorGroup??"?")}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&u.info("sensor group changed: → %d",e)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,s=t.parsedData.colors;s&&u.debug("sensor group colors: group=%d, %d entries",e,s.length)}}for(let e of n.ghosts){if("create"===e.type){let t=e.parsedData?.position,s=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,n=this.resolveGhostClassName(e.index,e.classId);u.debug("ghost create: #%d %s%s (%d entities total)",e.index,n??"?",s?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"",this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),s=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&u.debug("ghost delete: #%d %s (%d entities remaining)",e.index,s?.className??"?",this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),o&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();u.info("status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d",this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let m=this.entities.size;if(1===this.tickCount||m>0&&m%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");u.info("entity count: %d (%s)",m,t)}let d=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==d&&u.info("camera mode: %s → %s%s",d??"none",this.camera.mode,"third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:""),this.tickCount<=5&&this.camera){let[e,t,s]=this.camera.position;u.debug("camera: mode=%s pos=(%s, %s, %s) fov=%s",this.camera.mode,e.toFixed(1),t.toFixed(1),s.toFixed(1),this.camera.fov)}}catch(s){let t={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};u.error("Failed to process live packet: %o %o",s,t)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:s,audioEvents:n}=this.buildTimeFilteredEvents(t),{weaponsHud:i,inventoryHud:r,backpackHud:a,teamScores:o}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:s,audioEvents:n,weaponsHud:i,backpackHud:a,inventoryHud:r,teamScores:o};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}var d=e.i(92224);let h=(0,i.createLogger)("liveConnectionStore"),p=t.default.env.NEXT_PUBLIC_RELAY_URL||"ws://localhost:8765",g=(0,s.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(s=p){let n=t();n._relay&&n._relay.close();let i=new a(s,{onOpen(){e({relayConnected:!0});let s=t();for(let e of s._pending)e();s._pending=[]},onStatus(t,s,n,i){h.info("game status: %s%s%s",t,s?` — ${s}`:"",i?` map=${i}`:""),e({gameStatus:t,gameStatusMessage:s,...i?{mapName:i}:{}})},onServerList(s){t()._listInFlight=!1,e({servers:s,serversLoading:!1})},onGamePacket(e){let s=t()._adapter;s||h.warn("received game packet but no adapter is active"),s?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(s){h.error("error: %s",s),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let s=t();s._relay===i&&(s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let s=t();s._relay?.close(),s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let s=t();if(s._listInFlight)return;s._listInFlight=!0;let n=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),s._relay?.connected?n():(s._pending.push(n),s._relay||t().connectRelay())},joinServer(s,n){let i=t();if(!i._relay)return;let r=i.servers.find(e=>e.address===s),a=new m(i._relay);a.onReady=()=>e({liveReady:!0}),a.onMissionChange=t=>{h.info("mission changed: %s",t),e({mapName:t,liveReady:!1}),d.gameEntityStore.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},a.onMissionInfoChange=()=>{d.gameEntityStore.getState().setMissionInfo({missionDisplayName:a.missionDisplayName??void 0,missionTypeDisplayName:a.missionTypeDisplayName??void 0,gameClassName:a.gameClassName??void 0,serverDisplayName:a.serverDisplayName??void 0,recorderName:a.connectedPlayerName??void 0})},i._adapter=a,e({mapName:r?.mapName??i.mapName,serverName:r?.name,warriorName:n,liveReady:!1,gameStatus:null,adapter:a}),d.gameEntityStore.getState().setMissionInfo({missionName:r?.mapName??void 0,missionTypeDisplayName:r?.gameType??void 0,serverDisplayName:r?.name??void 0,recorderName:n??void 0}),i._relay.joinServer(s,n)},disconnectServer(){let s=t();s._relay?.disconnectServer(),s._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMove(e){t()._relay?.sendMove(e)},sendCommand(e,...s){t()._relay?.sendCommand(e,s)}}));function f(e,t){return(0,n.useStoreWithEqualityFn)(g,e,t)}function y(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}e.s(["liveConnectionStore",0,g,"selectPing",()=>y,"useLiveSelector",()=>f],98755)},66027,e=>{"use strict";var t=e.i(69230),s=e.i(69637);function n(e,n){return(0,s.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},66093,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,n.createContext)(null);function r(){let e=(0,n.useContext)(i);if(!e)throw Error("No JoystickContext found. Did you forget to add a ?");return e}function a(e){let r,a,o,l,c,u,m=(0,s.c)(7),{children:d}=e;m[0]===Symbol.for("react.memo_cache_sentinel")?(r={angle:0,force:0},m[0]=r):r=m[0];let h=(0,n.useRef)(r);m[1]===Symbol.for("react.memo_cache_sentinel")?(a={angle:0,force:0},m[1]=a):a=m[1];let p=(0,n.useRef)(a);m[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{angle:t,force:s}=e;null!=t&&(h.current.angle=t),null!=s&&(h.current.force=s)},m[2]=o):o=m[2];let g=o;m[3]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let{angle:t,force:s}=e;null!=t&&(p.current.angle=t),null!=s&&(p.current.force=s)},m[3]=l):l=m[3];let f=l;m[4]===Symbol.for("react.memo_cache_sentinel")?(c={moveState:h,lookState:p,setMoveState:g,setLookState:f},m[4]=c):c=m[4];let y=c;return m[5]!==d?(u=(0,t.jsx)(i,{value:y,children:d}),m[5]=d,m[6]=u):u=m[6],u}e.s(["JoystickProvider",()=>a,"useJoystick",()=>r])},32865,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(58647);function i(e){let n,i=(0,s.c)(2),{children:r}=e;return i[0]!==r?(n=(0,t.jsx)(t.Fragment,{children:r}),i[0]=r,i[1]=n):n=i[1],n}function r(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function c(){return(0,n.useEngineSelector)(u)}function u(e){return e.playback.timeMs/1e3}function m(){return(0,n.useEngineSelector)(d)}function d(e){return e.playback.durationMs/1e3}function h(){return(0,n.useEngineSelector)(p)}function p(e){return e.playback.rate}function g(){let e,t,i,a,o,l,c=(0,s.c)(17),u=r(),m=(0,n.useEngineSelector)(S),d=(0,n.useEngineSelector)(v),h=(0,n.useEngineSelector)(y),p=(0,n.useEngineSelector)(f);c[0]!==m?(e=e=>{m(e)},c[0]=m,c[1]=e):e=c[1];let g=e;c[2]!==u||c[3]!==d?(t=()=>{u&&d("playing")},c[2]=u,c[3]=d,c[4]=t):t=c[4];let k=t;c[5]!==d?(i=()=>{d("paused")},c[5]=d,c[6]=i):i=c[6];let b=i;c[7]!==h?(a=e=>{h(1e3*e)},c[7]=h,c[8]=a):a=c[8];let E=a;c[9]!==p?(o=e=>{p(e)},c[9]=p,c[10]=o):o=c[10];let C=o;return c[11]!==b||c[12]!==k||c[13]!==E||c[14]!==g||c[15]!==C?(l={setRecording:g,play:k,pause:b,seek:E,setSpeed:C},c[11]=b,c[12]=k,c[13]=E,c[14]=g,c[15]=C,c[16]=l):l=c[16],l}function f(e){return e.setPlaybackRate}function y(e){return e.setPlaybackTime}function v(e){return e.setPlaybackStatus}function S(e){return e.setRecording}e.s(["RecordingProvider",()=>i,"useCurrentTime",()=>c,"useDuration",()=>m,"useIsPlaying",()=>o,"usePlaybackActions",()=>g,"useRecording",()=>r,"useSpeed",()=>h])},51434,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645),i=e.i(15080),r=e.i(90072),a=e.i(58647),o=e.i(79123);let l=(0,n.createContext)(void 0);function c(e){let c,h,p,g,f,y,v=(0,s.c)(11),{children:S}=e,k=(0,i.useThree)(d),{audioVolume:b}=(0,o.useSettings)();v[0]===Symbol.for("react.memo_cache_sentinel")?(c={audioLoader:null,audioListener:null},v[0]=c):c=v[0];let[E,C]=(0,n.useState)(c);return v[1]!==k?(h=()=>{let e=new r.AudioLoader,t=k.children.find(m);t||(t=new r.AudioListener,k.add(t)),C({audioLoader:e,audioListener:t});let s=()=>{let e=t.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s)})};document.addEventListener("click",s),document.addEventListener("keydown",s);let n=a.engineStore.subscribe(u,e=>{let s=t.context;s&&("paused"===e?s.suspend():"suspended"===s.state&&s.resume())});return()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),n(),t&&k.remove(t)}},p=[k],v[1]=k,v[2]=h,v[3]=p):(h=v[2],p=v[3]),(0,n.useEffect)(h,p),v[4]!==E.audioListener||v[5]!==b?(g=()=>{E.audioListener?.setMasterVolume(b)},f=[b,E.audioListener],v[4]=E.audioListener,v[5]=b,v[6]=g,v[7]=f):(g=v[6],f=v[7]),(0,n.useEffect)(g,f),v[8]!==E||v[9]!==S?(y=(0,t.jsx)(l.Provider,{value:E,children:S}),v[8]=E,v[9]=S,v[10]=y):y=v[10],y}function u(e){return e.playback.status}function m(e){return e instanceof r.AudioListener}function d(e){return e.camera}function h(){let e=(0,n.useContext)(l);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>c,"useAudio",()=>h])},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function s(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>s,"streamPlaybackStore",0,t])},46325,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,e.i(25645).createLogger)("DebugSuspense");function r(e){let i,r,l,c=(0,s.c)(10),{name:u,fallback:m,children:d}=e,h=void 0===m?null:m;return c[0]!==h||c[1]!==u?(i=(0,t.jsx)(a,{name:u,children:h}),c[0]=h,c[1]=u,c[2]=i):i=c[2],c[3]!==u?(r=(0,t.jsx)(o,{name:u}),c[3]=u,c[4]=r):r=c[4],c[5]!==d||c[6]!==u||c[7]!==i||c[8]!==r?(l=(0,t.jsxs)(n.Suspense,{name:u,fallback:i,children:[r,d]}),c[5]=d,c[6]=u,c[7]=i,c[8]=r,c[9]=l):l=c[9],l}function a(e){let t,r,a=(0,s.c)(3),{name:o,children:l}=e;return a[0]!==o?(t=()=>{i.debug("🛑 SUSPENDED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),l}function o(e){let t,r,a=(0,s.c)(3),{name:o}=e;return a[0]!==o?(t=()=>{i.debug("✅ RESOLVED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),null}e.s(["DebugSuspense",()=>r])},31999,e=>{"use strict";var t=e.i(71645);let s=(0,e.i(25645).createLogger)("ShapeErrorBoundary");class n extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){s.error("Shape load failed: %s %s",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["ShapeErrorBoundary",()=>n])},77964,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.s(["isSceneEntity",()=>t])},12631,e=>{"use strict";var t=e.i(71645),s=e.i(8155);let n=e=>{let n=(0,s.createStore)(e),i=e=>(function(e,s=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};var i=e.i(79473);let r=t.createContext(null);function a({map:e,children:s,onChange:a,domElement:o}){let l=e.map(e=>e.name+e.keys).join("-"),c=t.useMemo(()=>{let t;return(t=(0,i.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?n(t):n},[l]),u=t.useMemo(()=>[c.subscribe,c.getState,c],[l]),m=c.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:s})=>({keys:t,up:s,fn:t=>{m({[e]:t}),a&&a(e,t,u[1]())}})).reduce((e,{keys:t,fn:s,up:n=!0})=>(t.forEach(t=>e[t]={fn:s,pressed:!1,up:n}),e),{}),s=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,pressed:r,up:a}=n;n.pressed=!0,(a||!r)&&i(!0)},n=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,up:r}=n;n.pressed=!1,r&&i(!1)},i=o||window;return i.addEventListener("keydown",s,{passive:!0}),i.addEventListener("keyup",n,{passive:!0}),()=>{i.removeEventListener("keydown",s),i.removeEventListener("keyup",n)}},[o,l]),t.createElement(r.Provider,{value:u,children:s})}function o(e){let[s,n,i]=t.useContext(r);return e?i(e):[s,n]}e.s(["KeyboardControls",()=>a,"useKeyboardControls",()=>o],12631)},85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,n)=>{let i,r;r=void 0,(i="symbol"!=typeof s?s+"":s)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let s=t.slice(0);for(let t=0,n=s.length;ts])},68294,e=>{"use strict";var t=e.i(43476),s=e.i(90072),n=e.i(15080),i=e.i(71645);let r=(0,i.createContext)(null);function a(){let e=(0,i.useContext)(r);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function o({children:e}){let a=(0,n.useThree)(e=>e.camera),[o,l]=(0,i.useState)(-1),[c,u]=(0,i.useState)({}),[m,d]=(0,i.useState)(()=>({initialized:!1,position:null,quarternion:null})),h=(0,i.useCallback)(e=>{u(t=>({...t,[e.id]:e}))},[]),p=(0,i.useCallback)(e=>{u(t=>{let{[e.id]:s,...n}=t;return n})},[]),g=Object.keys(c).length,f=(0,i.useCallback)(e=>{if(e>=0&&e{f(g?(o+1)%g:-1)},[g,o,f]);(0,i.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,n]=e.slice(2).split("~"),i=t.split(",").map(e=>parseFloat(e)),r=n.split(",").map(e=>parseFloat(e));d({initialized:!0,position:new s.Vector3(...i),quarternion:new s.Quaternion(...r)})}else d({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,i.useEffect)(()=>{m.initialized&&m.position&&(a.position.copy(m.position),m.quarternion&&a.quaternion.copy(m.quarternion))},[a,m]),(0,i.useEffect)(()=>{m.initialized&&!m.position&&g>0&&-1===o&&f(0)},[g,f,o,m]);let v=(0,i.useMemo)(()=>({registerCamera:h,unregisterCamera:p,nextCamera:y,setCameraIndex:f,cameraCount:g}),[h,p,y,f,g]);return 0===g&&-1!==o&&l(-1),(0,t.jsx)(r.Provider,{value:v,children:e})}e.s(["CamerasProvider",()=>o,"useCameras",()=>a])},26747,e=>{"use strict";var t=e.i(90072),s=e.i(85413),n=Object.defineProperty,i=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?n(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,s};let r=new t.Euler(0,0,0,"YXZ"),a=new t.Vector3,o={type:"change"},l={type:"lock"},c={type:"unlock"},u=Math.PI/2;class m extends s.EventDispatcher{constructor(e,s){super(),i(this,"camera"),i(this,"domElement"),i(this,"isLocked"),i(this,"minPolarAngle"),i(this,"maxPolarAngle"),i(this,"pointerSpeed"),i(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(r.setFromQuaternion(this.camera.quaternion),r.y-=.002*e.movementX*this.pointerSpeed,r.x-=.002*e.movementY*this.pointerSpeed,r.x=Math.max(u-this.maxPolarAngle,Math.min(u-this.minPolarAngle,r.x)),this.camera.quaternion.setFromEuler(r),this.dispatchEvent(o))}),i(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(l),this.isLocked=!0):(this.dispatchEvent(c),this.isLocked=!1))}),i(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),i(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),i(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),i(this,"dispose",()=>{this.disconnect()}),i(this,"getObject",()=>this.camera),i(this,"direction",new t.Vector3(0,0,-1)),i(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),i(this,"moveForward",e=>{a.setFromMatrixColumn(this.camera.matrix,0),a.crossVectors(this.camera.up,a),this.camera.position.addScaledVector(a,e)}),i(this,"moveRight",e=>{a.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(a,e)}),i(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),i(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=s,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,s&&this.connect(s)}}e.s(["PointerLockControls",()=>m])},205,e=>{"use strict";var t=e.i(932),s=e.i(71645),n=e.i(90072),i=e.i(71753),r=e.i(15080),a=e.i(12631),o=e.i(26747),l=e.i(79123),c=e.i(68294),u=e.i(93784);let m=Math.PI/2-.01;function d(){let e,d,f,y,v,S,k,b,E,C,N,w,x,D,P,M,T=(0,t.c)(38);T[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],T[0]=e):e=T[0],(0,s.useEffect)(g,e);let{speedMultiplier:_,setSpeedMultiplier:L,invertScroll:F,invertDrag:I}=(0,l.useControls)(),[R,j]=(0,a.useKeyboardControls)(),A=(0,r.useThree)(p),q=(0,r.useThree)(h),{nextCamera:z,setCameraIndex:W,cameraCount:B}=(0,c.useCameras)(),G=(0,s.useRef)(null);T[1]!==F?(d=()=>F,T[1]=F,T[2]=d):d=T[2];let O=(0,s.useEffectEvent)(d);T[3]!==I?(f=()=>I,T[3]=I,T[4]=f):f=T[4];let V=(0,s.useEffectEvent)(f);T[5]===Symbol.for("react.memo_cache_sentinel")?(y=new n.Vector3,T[5]=y):y=T[5];let $=(0,s.useRef)(y);T[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,T[6]=v):v=T[6];let K=(0,s.useRef)(v);T[7]===Symbol.for("react.memo_cache_sentinel")?(S=new n.Vector3,T[7]=S):S=T[7];let Y=(0,s.useRef)(S);T[8]===Symbol.for("react.memo_cache_sentinel")?(k=new n.Euler(0,0,0,"YXZ"),T[8]=k):k=T[8];let H=(0,s.useRef)(k);return T[9]!==A||T[10]!==q.domElement?(b=()=>{let e=new o.PointerLockControls(A,q.domElement);return G.current=e,()=>{e.dispose()}},E=[A,q.domElement],T[9]=A,T[10]=q.domElement,T[11]=b,T[12]=E):(b=T[11],E=T[12]),(0,s.useEffect)(b,E),T[13]!==A||T[14]!==V||T[15]!==q.domElement||T[16]!==z?(C=()=>{let e=q.domElement,t=new n.Euler(0,0,0,"YXZ"),s=!1,i=!1,r=0,a=0,o=t=>{G.current?.isLocked||t.target===e&&(s=!0,i=!1,r=t.clientX,a=t.clientY)},l=e=>{if(!s||!i&&3>Math.abs(e.clientX-r)&&3>Math.abs(e.clientY-a))return;i=!0;let n=V()?-1:1;t.setFromQuaternion(A.quaternion,"YXZ"),t.y=t.y+n*e.movementX*.003,t.x=t.x+n*e.movementY*.003,t.x=Math.max(-m,Math.min(m,t.x)),A.quaternion.setFromEuler(t)},c=()=>{s=!1},u=t=>{let s=G.current;!s||s.isLocked?z():t.target!==e||i||s.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("click",u),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("click",u)}},T[13]=A,T[14]=V,T[15]=q.domElement,T[16]=z,T[17]=C):C=T[17],T[18]!==A||T[19]!==q.domElement||T[20]!==z?(N=[A,q.domElement,z],T[18]=A,T[19]=q.domElement,T[20]=z,T[21]=N):N=T[21],(0,s.useEffect)(C,N),T[22]!==B||T[23]!==W||T[24]!==R?(w=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return R(t=>{for(let s=0;s{let e=e=>{e.preventDefault();let t=O()?-1:1,s=(e.deltaY>0?-1:1)*t,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*s;L(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},t=q.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},T[27]=O,T[28]=q.domElement,T[29]=L,T[30]=D):D=T[30],T[31]!==q.domElement||T[32]!==L?(P=[q.domElement,L],T[31]=q.domElement,T[32]=L,T[33]=P):P=T[33],(0,s.useEffect)(D,P),T[34]!==A||T[35]!==j||T[36]!==_?(M=(e,t)=>{let s=u.streamPlaybackStore.getState();if(s.playback&&!s.freeFlyCamera)return;let{forward:n,backward:i,left:r,right:a,up:o,down:l,lookUp:c,lookDown:d,lookLeft:h,lookRight:p}=j();if((c||d||h||p)&&(H.current.setFromQuaternion(A.quaternion,"YXZ"),h&&(H.current.y=H.current.y+ +t),p&&(H.current.y=H.current.y-t),c&&(H.current.x=H.current.x+ +t),d&&(H.current.x=H.current.x-t),H.current.x=Math.max(-m,Math.min(m,H.current.x)),A.quaternion.setFromEuler(H.current)),!n&&!i&&!r&&!a&&!o&&!l)return;let g=80*_;A.getWorldDirection($.current),$.current.normalize(),K.current.crossVectors(A.up,$.current).normalize(),Y.current.set(0,0,0),n&&Y.current.add($.current),i&&Y.current.sub($.current),r&&Y.current.add(K.current),a&&Y.current.sub(K.current),o&&(Y.current.y=Y.current.y+1),l&&(Y.current.y=Y.current.y-1),Y.current.lengthSq()>0&&(Y.current.normalize().multiplyScalar(g*t),A.position.add(Y.current))},T[34]=A,T[35]=j,T[36]=_,T[37]=M):M=T[37],(0,i.useFrame)(M),null}function h(e){return e.gl}function p(e){return e.camera}function g(){return window.addEventListener("keydown",f,{capture:!0}),window.addEventListener("keyup",f,{capture:!0}),()=>{window.removeEventListener("keydown",f,{capture:!0}),window.removeEventListener("keyup",f,{capture:!0})}}function f(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}e.s(["ARROW_LOOK_SPEED",0,1,"KEYBOARD_CONTROLS",0,[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}],"KeyboardAndMouseHandler",()=>d,"MOUSE_SENSITIVITY",0,.003])},60946,e=>{e.v(t=>Promise.all(["static/chunks/4fb9edf01fb5e4f5.js"].map(t=>e.l(t))).then(()=>t(0)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/b89dc6fc9051e9fe.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/96ae05ebba99dcff.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/6c0bdfaab43cc40b.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/2c772d15a5a10e4d.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/0e2ec5f4026ef564.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/ebf99400aa3d97c0.js"].map(t=>e.l(t))).then(()=>t(42585)))},34019,e=>{e.v(t=>Promise.all(["static/chunks/341165a5ae0d70ac.js"].map(t=>e.l(t))).then(()=>t(66069)))},553,e=>{e.v(t=>Promise.all(["static/chunks/66f953934e42712b.css","static/chunks/e27b13e203064a85.js"].map(t=>e.l(t))).then(()=>t(18339)))},33487,e=>{e.v(t=>Promise.all(["static/chunks/9ffe862a9787606f.css","static/chunks/302e494fb721f5e6.js"].map(t=>e.l(t))).then(()=>t(40378)))},25483,e=>{e.v(t=>Promise.all(["static/chunks/b89dc6fc9051e9fe.js","static/chunks/bc2b324cb2101ffe.js"].map(t=>e.l(t))).then(()=>t(51295)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/1db3a9d62713e989.css","static/chunks/3770acf7d1a6ba0a.js"].map(t=>e.l(t))).then(()=>t(94737)))},88487,e=>{e.v(t=>Promise.all(["static/chunks/005e475439c5cb3e.js","static/chunks/92a585fca24d52ed.css"].map(t=>e.l(t))).then(()=>t(86855)))},21683,e=>{e.v(t=>Promise.all(["static/chunks/4c292ca57f1d49be.js"].map(t=>e.l(t))).then(()=>t(91285)))},96145,e=>{e.v(t=>Promise.all(["static/chunks/1cf57947857f8eec.js"].map(t=>e.l(t))).then(()=>t(60505)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/97346c3751717c47.js"].map(t=>e.l(t))).then(()=>t(9962)))},57567,e=>{e.v(t=>Promise.all(["static/chunks/28c98fb093e4695f.css","static/chunks/22c22371d5c1dcba.js"].map(t=>e.l(t))).then(()=>t(49776)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/a05c1cf573184d15.css","static/chunks/273b16b21a9dcb92.js"].map(t=>e.l(t))).then(()=>t(94247)))},70012,e=>{e.v(t=>Promise.all(["static/chunks/a05c1cf573184d15.css","static/chunks/68bae3cf9f451a9b.js"].map(t=>e.l(t))).then(()=>t(45554)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/2c772d15a5a10e4d.js b/docs/_next/static/chunks/2c772d15a5a10e4d.js new file mode 100644 index 00000000..abc71ceb --- /dev/null +++ b/docs/_next/static/chunks/2c772d15a5a10e4d.js @@ -0,0 +1,75 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63724,e=>{"use strict";var r=e.i(43476),o=e.i(932),a=e.i(71645),t=e.i(46325),l=e.i(47071),c=e.i(71753),n=e.i(90072),i=e.i(12979),u=e.i(79123);let s=` +#include + +varying vec2 vUv; + +void main() { + vUv = uv; + vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); + gl_Position = projectionMatrix * mvPosition; + #include +} +`,f=` +#include + +uniform sampler2D frame0; +uniform sampler2D frame1; +uniform sampler2D frame2; +uniform sampler2D frame3; +uniform sampler2D frame4; +uniform int currentFrame; +uniform float vScroll; +uniform vec2 uvScale; +uniform vec3 tintColor; +uniform float opacity; +uniform float opacityFactor; + +varying vec2 vUv; + +void main() { + // Scale and scroll UVs + vec2 scrolledUv = vec2(vUv.x * uvScale.x, vUv.y * uvScale.y + vScroll); + + // Sample the current frame + vec4 texColor; + if (currentFrame == 0) { + texColor = texture2D(frame0, scrolledUv); + } else if (currentFrame == 1) { + texColor = texture2D(frame1, scrolledUv); + } else if (currentFrame == 2) { + texColor = texture2D(frame2, scrolledUv); + } else if (currentFrame == 3) { + texColor = texture2D(frame3, scrolledUv); + } else { + texColor = texture2D(frame4, scrolledUv); + } + + // Tribes 2 GL_MODULATE: output = texture * vertexColor + // No gamma correction - textures use NoColorSpace and values pass through + // directly to display, matching how WaterBlock handles sRGB textures. + vec3 modulatedColor = texColor.rgb * tintColor; + + float adjustedOpacity = opacity * opacityFactor; + + gl_FragColor = vec4(modulatedColor, adjustedOpacity); + + // Custom fog for additive blending: fade out rather than blend to fog color. + // Standard fog (mix toward fogColor) doesn't work with additive blending + // because we'd still be adding fogColor to the framebuffer. + // Uses Torque's quadratic haze formula for consistency. + #ifdef USE_FOG + float dist = vFogDepth; + float fogFactor = 0.0; + if (dist > fogNear) { + if (dist >= fogFar) { + fogFactor = 1.0; + } else { + float fogScale = 1.0 / (fogFar - fogNear); + float distFactor = (dist - fogNear) * fogScale - 1.0; + fogFactor = 1.0 - distFactor * distFactor; + } + } + gl_FragColor.a *= 1.0 - fogFactor; + #endif +} +`;function d(e){let r,t,l,c=(0,o.c)(7),[i,u,s]=e;c[0]!==i||c[1]!==u||c[2]!==s?((r=new n.BoxGeometry(i,u,s)).translate(i/2,u/2,s/2),c[0]=i,c[1]=u,c[2]=s,c[3]=r):r=c[3];let f=r;return c[4]!==f?(t=()=>()=>f.dispose(),l=[f],c[4]=f,c[5]=t,c[6]=l):(t=c[5],l=c[6]),(0,a.useEffect)(t,l),f}function m(e){let a,t,l,c=(0,o.c)(10),{scale:i,color:u,baseTranslucency:s}=e,f=d(i);c[0]!==u[0]||c[1]!==u[1]||c[2]!==u[2]?(a=new n.Color(u[0],u[1],u[2]),c[0]=u[0],c[1]=u[1],c[2]=u[2],c[3]=a):a=c[3];let m=a,v=+s;return c[4]!==m||c[5]!==v?(t=(0,r.jsx)("meshBasicMaterial",{color:m,transparent:!0,opacity:v,blending:n.AdditiveBlending,side:n.DoubleSide,depthWrite:!1,fog:!1}),c[4]=m,c[5]=v,c[6]=t):t=c[6],c[7]!==f||c[8]!==t?(l=(0,r.jsx)("mesh",{geometry:f,renderOrder:1,children:t}),c[7]=f,c[8]=t,c[9]=l):l=c[9],l}function v({scale:e,data:o}){let{animationEnabled:t}=(0,u.useSettings)(),m=d(e),v=(0,a.useMemo)(()=>o.textures.map(e=>(0,i.textureToUrl)(e)),[o.textures]),g=(0,l.useTexture)(v,e=>{e.forEach(e=>{e.wrapS=e.wrapT=n.RepeatWrapping,e.colorSpace=n.NoColorSpace,e.flipY=!1,e.needsUpdate=!0})}),p=(0,a.useMemo)(()=>(function({textures:e,scale:r,umapping:o,vmapping:a,color:t,baseTranslucency:l}){let c=[...r].sort((e,r)=>r-e),i=new n.Vector2(c[0]*o,c[1]*a),u=e[0];return new n.ShaderMaterial({uniforms:{frame0:{value:u},frame1:{value:e[1]??u},frame2:{value:e[2]??u},frame3:{value:e[3]??u},frame4:{value:e[4]??u},currentFrame:{value:0},vScroll:{value:0},uvScale:{value:i},tintColor:{value:new n.Color(...t)},opacity:{value:l},opacityFactor:{value:1},fogColor:{value:new n.Color},fogNear:{value:1},fogFar:{value:2e3}},vertexShader:s,fragmentShader:f,transparent:!0,blending:n.AdditiveBlending,side:n.DoubleSide,depthWrite:!1,fog:!0})})({textures:g,scale:e,umapping:o.umapping,vmapping:o.vmapping,color:o.color,baseTranslucency:o.baseTranslucency}),[g,e,o]);(0,a.useEffect)(()=>()=>p.dispose(),[p]);let x=(0,a.useRef)(0);return(0,c.useFrame)((e,r)=>{if(!t){x.current=0,p.uniforms.currentFrame.value=0,p.uniforms.vScroll.value=0;return}x.current+=r,p.uniforms.currentFrame.value=Math.floor(x.current*o.framesPerSec)%o.numFrames,p.uniforms.vScroll.value=x.current*o.scrollSpeed}),(0,r.jsx)("mesh",{geometry:m,material:p,renderOrder:1})}function g(e){let a,l,c,n=(0,o.c)(14),{entity:i}=e,u=i.forceFieldData,s=u.dimensions;if(0===u.textures.map(p).length){let e;return n[0]!==u.baseTranslucency||n[1]!==u.color||n[2]!==s?(e=(0,r.jsx)(m,{scale:s,color:u.color,baseTranslucency:u.baseTranslucency}),n[0]=u.baseTranslucency,n[1]=u.color,n[2]=s,n[3]=e):e=n[3],e}return n[4]!==u.baseTranslucency||n[5]!==u.color||n[6]!==s?(a=(0,r.jsx)(m,{scale:s,color:u.color,baseTranslucency:u.baseTranslucency}),n[4]=u.baseTranslucency,n[5]=u.color,n[6]=s,n[7]=a):a=n[7],n[8]!==u||n[9]!==s?(l=(0,r.jsx)(v,{scale:s,data:u}),n[8]=u,n[9]=s,n[10]=l):l=n[10],n[11]!==a||n[12]!==l?(c=(0,r.jsx)(t.DebugSuspense,{name:"ForceField",fallback:a,children:l}),n[11]=a,n[12]=l,n[13]=c):c=n[13],c}function p(e){return(0,i.textureToUrl)(e)}e.s(["ForceFieldBare",()=>g],63724)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/2edeeda5ca6dc680.js b/docs/_next/static/chunks/2edeeda5ca6dc680.js deleted file mode 100644 index 37c36bfd..00000000 --- a/docs/_next/static/chunks/2edeeda5ca6dc680.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},81405,(e,t,r)=>{var n;e.e,(n=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;ta+1e3&&(u.update(1e3*l/(e-a),100),a=e,l=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){o=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,r){var n=1/0,i=0,o=Math.round,a=o(window.devicePixelRatio||1),l=80*a,u=48*a,s=3*a,c=2*a,f=3*a,d=15*a,p=74*a,m=30*a,h=document.createElement("canvas");h.width=l,h.height=u,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*a+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=r,v.fillRect(0,0,l,u),v.fillStyle=t,v.fillText(e,s,c),v.fillRect(f,d,p,m),v.fillStyle=r,v.globalAlpha=.9,v.fillRect(f,d,p,m),{dom:h,update:function(u,g){n=Math.min(n,u),i=Math.max(i,u),v.fillStyle=r,v.globalAlpha=1,v.fillRect(0,0,l,d),v.fillStyle=t,v.fillText(o(u)+" "+e+" ("+o(n)+"-"+o(i)+")",s,c),v.drawImage(h,f+a,d,p-a,m,f,d,p-a,m),v.fillRect(f+p-a,d,a,m),v.fillStyle=r,v.globalAlpha=.9,v.fillRect(f+p-a,d,a,o((1-u/g)*m))}}},t.exports=n},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),r=e.i(932),n=e.i(71645),i=e.i(40859),i=i,o=i,a=e.i(81405);function l(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function u({showPanel:e=0,className:t,parent:r}){let u=function(e,t=[],r){let[i,o]=n.useState();return n.useLayoutEffect(()=>{let t=e();return o(t),l(void 0,t),()=>l(void 0,null)},t),i}(()=>new a.default,[]);return n.useEffect(()=>{if(u){let n=r&&r.current||document.body;u.showPanel(e),null==n||n.appendChild(u.dom);let a=(null!=t?t:"").split(" ").filter(e=>e);a.length&&u.dom.classList.add(...a);let l=(0,i.j)(()=>u.begin()),s=(0,o.k)(()=>u.end());return()=>{a.length&&u.dom.classList.remove(...a),null==n||n.removeChild(u.dom),l(),s()}}},[r,u,t,e]),null}var s=e.i(60099),c=e.i(79123),f=e.i(55141);function d(){let e,i,o=(0,r.c)(3),{debugMode:a}=(0,c.useDebug)(),l=(0,n.useRef)(null);return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=l.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},o[0]=e):e=o[0],(0,n.useEffect)(e),o[1]!==a?(i=a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{className:f.default.StatsPanel}),(0,t.jsx)("axesHelper",{ref:l,args:[70],renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,t.jsx)(s.Html,{position:[80,0,0],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"y",children:"Y"})}),(0,t.jsx)(s.Html,{position:[0,80,0],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"z",children:"Z"})}),(0,t.jsx)(s.Html,{position:[0,0,80],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"x",children:"X"})})]}):null,o[1]=a,o[2]=i):i=o[2],i}e.s(["DebugElements",()=>d],86855)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function E(e){return e}function A(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eE(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eA(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eA(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eE);return(t&&eE(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,E=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),A=i.onFocusCapture,w=W(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:E,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();A(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,E=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:E,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e5=(0,R.createContext)(void 0),e4=ec([e1,ev],[e2,eg]),e8=e4.useContext,e6=e4.useScopedContext,e9=e4.useProviderContext,e7=e4.ContextProvider,te=e4.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return A(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,E=e9();A(e=e||E,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();A(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=E,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tE=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tE(e))});var{useSyncExternalStore:tA}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=E){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tA(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tA(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&at||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":E||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tE(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();A(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),E=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e5)])?d:"option",children:t,...s,onClick:E,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();A(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;A(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e5.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t5(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t4(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t5(e,t,t=>{t4(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:E,unstable_treeSnapshotKey:A,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t5(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,A]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t5(q,t,n=>{t4(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,A]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eE]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eE,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rE(e){return e.split("-")[1]}function rA(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rA(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rE(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r5(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r5(){return!("u"rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();A(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),E=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return A(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:A=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!A?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==E;!C&&I&&O.push(...(f=rE(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===E,R),f&&(d=d.map(e=>e+"-"+f),A&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rE(l),r=rw(t=rA(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rA(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rA(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rA(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,E=rm(f[v?"top":"left"],x),A=rm(f[v?"bottom":"right"],x),w=C-h[m]-A,_=C/2-h[m]/2+(y/2-b/2),T=rh(E,rm(_,w)),M=!u.arrow&&null!=rE(i)&&_!==T&&o.reference[m]/2-(_{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rE(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,E=S,A=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(A=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(E=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?A=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):E=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:A,availableHeight:E});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,E,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(E.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,E,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,E,S,C,E,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==E?void 0:E.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,E,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();A(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nE=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nE],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nA=ec([ev],[eg]),nw=nA.useContext;nA.useScopedContext,nA.useProviderContext,nA.ContextProvider,nA.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),E=y&&c&&(m?"horizontal"!==c:"vertical"!==c),A=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(E&&!A?v:nM(v,g.rowId),l,A),l);return null==e?void 0:e.id}if(E){let e=nT(A?C:S,l);return A?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&A?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return A(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",E="[object WeakMap]",A="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[A]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[E]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eE.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eE.prototype.delete=function(e){return eP(this,e).delete(e)},eE.prototype.get=function(e){return eP(this,e).get(e)},eE.prototype.has=function(e){return eP(this,e).has(e)},eE.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eA.prototype.add=eA.prototype.push=function(e){return this.__data__.set(e,l),this},eA.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eE(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eA:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),E=x.searchParams,A=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,E??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,E),Object.keys(A.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,E,_,A.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:E,queuedQueries:_,queryRef:A.current,stateRef:R.current}),R.current=t,M(t)),A.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?E?.getAll(r):E?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,E,_,A.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:E,queuedQueries:_,queryRef:A.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${E?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},A.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,E=!1,A=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);bt(e),E?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)},32424,7368,e=>{"use strict";var t=e.i(12979);function r(){return async e=>{let r;try{r=(0,t.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let t=await fetch(r);if(!t.ok)return console.error(`Script fetch failed: ${e} (${t.status})`),null;return await t.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}}}e.s(["createScriptLoader",()=>r],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/302e494fb721f5e6.js b/docs/_next/static/chunks/302e494fb721f5e6.js new file mode 100644 index 00000000..54a8f2ff --- /dev/null +++ b/docs/_next/static/chunks/302e494fb721f5e6.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13070,e=>{e.v({Arrow:"KeyboardOverlay-module__HsRBsa__Arrow",Column:"KeyboardOverlay-module__HsRBsa__Column",Key:"KeyboardOverlay-module__HsRBsa__Key",Root:"KeyboardOverlay-module__HsRBsa__Root",Row:"KeyboardOverlay-module__HsRBsa__Row",Spacer:"KeyboardOverlay-module__HsRBsa__Spacer"})},40378,e=>{"use strict";var s=e.i(43476),a=e.i(932),l=e.i(12631),r=e.i(32865),d=e.i(13070);function o(){let e,o,h,K,b,j,x,N,p,R,C,w,S,O,B,A,H,g,k,T,U,D,P,L,W=(0,a.c)(51),q=(0,r.useRecording)(),z=(0,l.useKeyboardControls)(v),E=(0,l.useKeyboardControls)(_),F=(0,l.useKeyboardControls)(y),G=(0,l.useKeyboardControls)(f),I=(0,l.useKeyboardControls)(m),J=(0,l.useKeyboardControls)(u),M=(0,l.useKeyboardControls)(i),Q=(0,l.useKeyboardControls)(n),V=(0,l.useKeyboardControls)(c),X=(0,l.useKeyboardControls)(t);return q&&"live"!==q.source?null:(W[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)("div",{className:d.default.Spacer}),W[0]=e):e=W[0],W[1]!==z?(o=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":z,children:"W"}),W[1]=z,W[2]=o):o=W[2],W[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsx)("div",{className:d.default.Spacer}),W[3]=h):h=W[3],W[4]!==o?(K=(0,s.jsxs)("div",{className:d.default.Row,children:[e,o,h]}),W[4]=o,W[5]=K):K=W[5],W[6]!==F?(b=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":F,children:"A"}),W[6]=F,W[7]=b):b=W[7],W[8]!==E?(j=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":E,children:"S"}),W[8]=E,W[9]=j):j=W[9],W[10]!==G?(x=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":G,children:"D"}),W[10]=G,W[11]=x):x=W[11],W[12]!==b||W[13]!==j||W[14]!==x?(N=(0,s.jsxs)("div",{className:d.default.Row,children:[b,j,x]}),W[12]=b,W[13]=j,W[14]=x,W[15]=N):N=W[15],W[16]!==K||W[17]!==N?(p=(0,s.jsxs)("div",{className:d.default.Column,children:[K,N]}),W[16]=K,W[17]=N,W[18]=p):p=W[18],W[19]===Symbol.for("react.memo_cache_sentinel")?(R=(0,s.jsx)("span",{className:d.default.Arrow,children:"↑"}),W[19]=R):R=W[19],W[20]!==I?(C=(0,s.jsx)("div",{className:d.default.Row,children:(0,s.jsxs)("div",{className:d.default.Key,"data-pressed":I,children:[R," Space"]})}),W[20]=I,W[21]=C):C=W[21],W[22]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)("span",{className:d.default.Arrow,children:"↓"}),W[22]=w):w=W[22],W[23]!==J?(S=(0,s.jsx)("div",{className:d.default.Row,children:(0,s.jsxs)("div",{className:d.default.Key,"data-pressed":J,children:[w," Shift"]})}),W[23]=J,W[24]=S):S=W[24],W[25]!==C||W[26]!==S?(O=(0,s.jsxs)("div",{className:d.default.Column,children:[C,S]}),W[25]=C,W[26]=S,W[27]=O):O=W[27],W[28]===Symbol.for("react.memo_cache_sentinel")?(B=(0,s.jsx)("div",{className:d.default.Spacer}),W[28]=B):B=W[28],W[29]!==M?(A=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":M,children:"↑"}),W[29]=M,W[30]=A):A=W[30],W[31]===Symbol.for("react.memo_cache_sentinel")?(H=(0,s.jsx)("div",{className:d.default.Spacer}),W[31]=H):H=W[31],W[32]!==A?(g=(0,s.jsxs)("div",{className:d.default.Row,children:[B,A,H]}),W[32]=A,W[33]=g):g=W[33],W[34]!==V?(k=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":V,children:"←"}),W[34]=V,W[35]=k):k=W[35],W[36]!==Q?(T=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":Q,children:"↓"}),W[36]=Q,W[37]=T):T=W[37],W[38]!==X?(U=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":X,children:"→"}),W[38]=X,W[39]=U):U=W[39],W[40]!==k||W[41]!==T||W[42]!==U?(D=(0,s.jsxs)("div",{className:d.default.Row,children:[k,T,U]}),W[40]=k,W[41]=T,W[42]=U,W[43]=D):D=W[43],W[44]!==g||W[45]!==D?(P=(0,s.jsxs)("div",{className:d.default.Column,children:[g,D]}),W[44]=g,W[45]=D,W[46]=P):P=W[46],W[47]!==O||W[48]!==P||W[49]!==p?(L=(0,s.jsxs)("div",{className:d.default.Root,children:[p,O,P]}),W[47]=O,W[48]=P,W[49]=p,W[50]=L):L=W[50],L)}function t(e){return e.lookRight}function c(e){return e.lookLeft}function n(e){return e.lookDown}function i(e){return e.lookUp}function u(e){return e.down}function m(e){return e.up}function f(e){return e.right}function y(e){return e.left}function _(e){return e.backward}function v(e){return e.forward}e.s(["KeyboardOverlay",()=>o])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/341165a5ae0d70ac.js b/docs/_next/static/chunks/341165a5ae0d70ac.js new file mode 100644 index 00000000..2dda5457 --- /dev/null +++ b/docs/_next/static/chunks/341165a5ae0d70ac.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66069,e=>{"use strict";var r=e.i(932),t=e.i(71645),n=e.i(90072),c=e.i(71753),u=e.i(15080),o=e.i(79123),i=e.i(66093);let l=Math.PI/2-.01;function a(){let e,a,h,d,f,v,E,y,x,g,S,p=(0,r.c)(27),{speedMultiplier:M,touchMode:T,invertDrag:q,invertJoystick:b}=(0,o.useControls)(),L=(0,u.useThree)(m),_=(0,u.useThree)(s),{moveState:k,lookState:F}=(0,i.useJoystick)();p[0]===Symbol.for("react.memo_cache_sentinel")?(e=new n.Euler(0,0,0,"YXZ"),p[0]=e):e=p[0];let R=(0,t.useRef)(e),X=(0,t.useRef)(null);p[1]===Symbol.for("react.memo_cache_sentinel")?(a={x:0,y:0},p[1]=a):a=p[1];let Y=(0,t.useRef)(a);p[2]!==q?(h=()=>q,p[2]=q,p[3]=h):h=p[3];let V=(0,t.useEffectEvent)(h);p[4]===Symbol.for("react.memo_cache_sentinel")?(d=new n.Vector3,p[4]=d):d=p[4];let Z=(0,t.useRef)(d);p[5]===Symbol.for("react.memo_cache_sentinel")?(f=new n.Vector3,p[5]=f):f=p[5];let w=(0,t.useRef)(f);p[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,p[6]=v):v=p[6];let z=(0,t.useRef)(v);return p[7]!==L.quaternion?(E=()=>{R.current.setFromQuaternion(L.quaternion,"YXZ")},p[7]=L.quaternion,p[8]=E):E=p[8],p[9]!==L?(y=[L],p[9]=L,p[10]=y):y=p[10],(0,t.useEffect)(E,y),p[11]!==L.quaternion||p[12]!==V||p[13]!==_.domElement||p[14]!==T?(x=()=>{if("moveLookStick"!==T)return;let e=_.domElement,r=e=>{if(null===X.current)for(;0{if(null!==X.current)for(let r=0;r{for(let r=0;r{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",t),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),X.current=null}},p[11]=L.quaternion,p[12]=V,p[13]=_.domElement,p[14]=T,p[15]=x):x=p[15],p[16]!==L||p[17]!==_.domElement||p[18]!==T?(g=[L,_.domElement,T],p[16]=L,p[17]=_.domElement,p[18]=T,p[19]=g):g=p[19],(0,t.useEffect)(x,g),p[20]!==L||p[21]!==b||p[22]!==F.current||p[23]!==k.current||p[24]!==M||p[25]!==T?(S=(e,r)=>{let{force:t,angle:n}=k.current,{force:c,angle:u}=F.current;if("dualStick"===T){if(c>.15){let e=(c-.15)/.85,t=Math.cos(u),n=Math.sin(u),o=b?-1:1;R.current.setFromQuaternion(L.quaternion,"YXZ"),R.current.y=R.current.y-o*t*e*2.5*r,R.current.x=R.current.x+o*n*e*2.5*r,R.current.x=Math.max(-l,Math.min(l,R.current.x)),L.quaternion.setFromEuler(R.current)}if(t>.08){let e=80*M*((t-.08)/.92),c=Math.cos(n),u=Math.sin(n);L.getWorldDirection(Z.current),Z.current.normalize(),w.current.crossVectors(L.up,Z.current).normalize(),z.current.set(0,0,0).addScaledVector(Z.current,u).addScaledVector(w.current,-c),z.current.lengthSq()>0&&(z.current.normalize().multiplyScalar(e*r),L.position.add(z.current))}}else if("moveLookStick"===T&&t>0){let e=80*M*.5;if(L.getWorldDirection(Z.current),Z.current.normalize(),z.current.copy(Z.current).multiplyScalar(e*r),L.position.add(z.current),t>=.15){let e=Math.cos(n),c=Math.sin(n),u=(t-.15)/.85,o=b?-1:1;R.current.setFromQuaternion(L.quaternion,"YXZ"),R.current.y=R.current.y-o*e*u*1.25*r,R.current.x=R.current.x+o*c*u*1.25*r,R.current.x=Math.max(-l,Math.min(l,R.current.x)),L.quaternion.setFromEuler(R.current)}}},p[20]=L,p[21]=b,p[22]=F.current,p[23]=k.current,p[24]=M,p[25]=T,p[26]=S):S=p[26],(0,c.useFrame)(S),null}function s(e){return e.gl}function m(e){return e.camera}e.s(["TouchHandler",()=>a])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3770acf7d1a6ba0a.js b/docs/_next/static/chunks/3770acf7d1a6ba0a.js new file mode 100644 index 00000000..de444557 --- /dev/null +++ b/docs/_next/static/chunks/3770acf7d1a6ba0a.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78462,e=>{e.v({PlayPause:"DemoPlaybackControls-module__A_AHSq__PlayPause",Root:"DemoPlaybackControls-module__A_AHSq__Root",Seek:"DemoPlaybackControls-module__A_AHSq__Seek",Speed:"DemoPlaybackControls-module__A_AHSq__Speed",Time:"DemoPlaybackControls-module__A_AHSq__Time"})},94737,e=>{"use strict";var t=e.i(43476),a=e.i(932),o=e.i(71645),n=e.i(32865),l=e.i(78462);let r=[.25,.5,1,2,4];function s(e){let t=Math.floor(e/60),a=Math.floor(e%60);return`${t}:${a.toString().padStart(2,"0")}`}function u(){let e,u,_,p,P,f,g,y,S,b,A,C,k=(0,a.c)(33),T=(0,n.useRecording)(),h=(0,n.useIsPlaying)(),v=(0,n.useCurrentTime)(),N=(0,n.useDuration)(),D=(0,n.useSpeed)(),{play:w,pause:x,seek:E,setSpeed:j}=(0,n.usePlaybackActions)();k[0]!==h||k[1]!==x||k[2]!==w||k[3]!==T?(e=()=>{if(!T)return;let e=e=>{if("Space"!==e.code)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||"BUTTON"===t.tagName||t.isContentEditable||(e.preventDefault(),h?x():w())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},u=[T,h,w,x],k[0]=h,k[1]=x,k[2]=w,k[3]=T,k[4]=e,k[5]=u):(e=k[4],u=k[5]),(0,o.useEffect)(e,u),k[6]!==E?(_=e=>{E(parseFloat(e.target.value))},k[6]=E,k[7]=_):_=k[7];let R=_;k[8]!==j?(p=e=>{j(parseFloat(e.target.value))},k[8]=j,k[9]=p):p=k[9];let q=p;if(!T||!Number.isFinite(T.duration))return null;let H=h?x:w,F=h?"Pause":"Play",U=h?"❚❚":"▶";k[10]!==H||k[11]!==F||k[12]!==U?(P=(0,t.jsx)("button",{className:l.default.PlayPause,onClick:H,"aria-label":F,autoFocus:!0,children:U}),k[10]=H,k[11]=F,k[12]=U,k[13]=P):P=k[13],k[14]!==v?(f=s(v),k[14]=v,k[15]=f):f=k[15],k[16]!==N?(g=s(N),k[16]=N,k[17]=g):g=k[17];let $=`${f} / ${g}`;return k[18]!==$?(y=(0,t.jsx)("span",{className:l.default.Time,children:$}),k[18]=$,k[19]=y):y=k[19],k[20]!==v||k[21]!==N||k[22]!==R?(S=(0,t.jsx)("input",{className:l.default.Seek,type:"range",min:0,max:N,step:.01,value:v,onChange:R}),k[20]=v,k[21]=N,k[22]=R,k[23]=S):S=k[23],k[24]===Symbol.for("react.memo_cache_sentinel")?(b=r.map(i),k[24]=b):b=k[24],k[25]!==q||k[26]!==D?(A=(0,t.jsx)("select",{className:l.default.Speed,value:D,onChange:q,children:b}),k[25]=q,k[26]=D,k[27]=A):A=k[27],k[28]!==y||k[29]!==S||k[30]!==A||k[31]!==P?(C=(0,t.jsxs)("div",{className:l.default.Root,onKeyDown:m,onPointerDown:d,onClick:c,children:[P,y,S,A]}),k[28]=y,k[29]=S,k[30]=A,k[31]=P,k[32]=C):C=k[32],C}function i(e){return(0,t.jsxs)("option",{value:e,children:[e,"x"]},e)}function c(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}function m(e){return e.stopPropagation()}e.s(["DemoPlaybackControls",()=>u])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/39402d7e86cbc15f.js b/docs/_next/static/chunks/39402d7e86cbc15f.js new file mode 100644 index 00000000..067a95f4 --- /dev/null +++ b/docs/_next/static/chunks/39402d7e86cbc15f.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,i)=>{let r,l;l=void 0,(r="symbol"!=typeof s?s+"":s)in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let s=t.slice(0);for(let t=0,i=s.length;ts])},32424,7368,e=>{"use strict";var t=e.i(25645),s=e.i(12979);let i=(0,t.createLogger)("scriptLoader");function r(){return async e=>{let t;try{t=(0,s.getUrlForPath)(e)}catch(t){return i.warn("Script not in manifest: %s (%s)",e,t),null}try{let s=await fetch(t);if(!s.ok)return i.error("Script fetch failed: %s (%d)",e,s.status),null;return await s.text()}catch(t){return i.error("Script fetch error: %s %o",e,t),null}}}e.s(["createScriptLoader",()=>r],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},81405,(e,t,s)=>{var i;e.e,(i=function(){function e(e){return r.appendChild(e.dom),e}function t(e){for(var t=0;tn+1e3&&(c.update(1e3*a/(e-n),100),n=e,a=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){l=this.end()},domElement:r,setMode:t}}).Panel=function(e,t,s){var i=1/0,r=0,l=Math.round,n=l(window.devicePixelRatio||1),a=80*n,c=48*n,o=3*n,d=2*n,f=3*n,u=15*n,p=74*n,m=30*n,h=document.createElement("canvas");h.width=a,h.height=c,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*n+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=s,v.fillRect(0,0,a,c),v.fillStyle=t,v.fillText(e,o,d),v.fillRect(f,u,p,m),v.fillStyle=s,v.globalAlpha=.9,v.fillRect(f,u,p,m),{dom:h,update:function(c,b){i=Math.min(i,c),r=Math.max(r,c),v.fillStyle=s,v.globalAlpha=1,v.fillRect(0,0,a,u),v.fillStyle=t,v.fillText(l(c)+" "+e+" ("+l(i)+"-"+l(r)+")",o,d),v.drawImage(h,f+n,u,p-n,m,f,u,p-n,m),v.fillRect(f+p-n,u,n,m),v.fillStyle=s,v.globalAlpha=.9,v.fillRect(f+p-n,u,n,l((1-c/b)*m))}}},t.exports=i},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),s=e.i(932),i=e.i(71645),r=e.i(40859),r=r,l=r,n=e.i(81405);function a(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function c({showPanel:e=0,className:t,parent:s}){let c=function(e,t=[],s){let[r,l]=i.useState();return i.useLayoutEffect(()=>{let t=e();return l(t),a(void 0,t),()=>a(void 0,null)},t),r}(()=>new n.default,[]);return i.useEffect(()=>{if(c){let i=s&&s.current||document.body;c.showPanel(e),null==i||i.appendChild(c.dom);let n=(null!=t?t:"").split(" ").filter(e=>e);n.length&&c.dom.classList.add(...n);let a=(0,r.j)(()=>c.begin()),o=(0,l.k)(()=>c.end());return()=>{n.length&&c.dom.classList.remove(...n),null==i||i.removeChild(c.dom),a(),o()}}},[s,c,t,e]),null}var o=e.i(60099),d=e.i(55141);function f(){let e,r,l,n,a,f,u,p,m,h,v=(0,s.c)(10),b=(0,i.useRef)(null);return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=b.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},v[0]=e):e=v[0],(0,i.useEffect)(e),v[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(c,{className:d.default.StatsPanel}),v[1]=r):r=v[1],v[2]===Symbol.for("react.memo_cache_sentinel")?(l=[70],v[2]=l):l=v[2],v[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("axesHelper",{ref:b,args:l,renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),v[3]=n):n=v[3],v[4]===Symbol.for("react.memo_cache_sentinel")?(a=[80,0,0],v[4]=a):a=v[4],v[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(o.Html,{position:a,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"y",children:"Y"})}),v[5]=f):f=v[5],v[6]===Symbol.for("react.memo_cache_sentinel")?(u=[0,80,0],v[6]=u):u=v[6],v[7]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(o.Html,{position:u,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"z",children:"Z"})}),v[7]=p):p=v[7],v[8]===Symbol.for("react.memo_cache_sentinel")?(m=[0,0,80],v[8]=m):m=v[8],v[9]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsxs)(t.Fragment,{children:[r,n,f,p,(0,t.jsx)(o.Html,{position:m,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"x",children:"X"})})]}),v[9]=h):h=v[9],h}e.s(["DebugElements",()=>f],86855)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1a2c6dc513278881.js b/docs/_next/static/chunks/3b423df62fc674df.js similarity index 92% rename from docs/_next/static/chunks/1a2c6dc513278881.js rename to docs/_next/static/chunks/3b423df62fc674df.js index 8f44e0c5..a7d8caf6 100644 --- a/docs/_next/static/chunks/1a2c6dc513278881.js +++ b/docs/_next/static/chunks/3b423df62fc674df.js @@ -5,4 +5,4 @@ uniform float shapeAmbientFactor; // Apply shape-specific lighting multipliers reflectedLight.directDiffuse *= shapeDirectionalFactor; reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1){let o=e.userData?.resource_path,A=new Set(e.userData?.flag_names??[]);if(!o){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(A.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,A,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,o,t,r)}}return{material:t,initialize:(e,r)=>I(t,o,e,r)}}let l=(0,a.textureToUrl)(o),B=(0,i.loadTexture)(l),c=A.has("Translucent");n||c?(0,i.setupTexture)(B,{disableMipmaps:!0}):(0,i.setupTexture)(B);let u=(0,r.createMaterialFromFlags)(e,B,A,n,s);return Array.isArray(u)?{material:u[1],backMaterial:u[0]}:{material:u}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t){var r;let n,i=[],a=!!t&&(0,s.isOrganicShape)(t),o=null;e.traverse(e=>{!o&&e.skeleton&&(o=e.skeleton)});let A=o?(r=o,n=new Set,r.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&n.add(t)}),n):new Set,l=[];for(let{parent:t,mesh:r}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;if((e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry){let t=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let r=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let s=G(t,r,a);if(s.initialize&&i.push({mesh:e,initialize:s.initialize}),s.backMaterial&&e.parent){let t=e.clone();t.material=s.backMaterial,l.push({parent:e.parent,mesh:t})}return s.material});else if(e.material){let t=G(e.material,r,a);if(t.initialize&&i.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,l.push({parent:e.parent,mesh:r})}}}),l))t.add(r);return i}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapeRenderer",()=>T,"applyShapeShaderModifications",()=>F,"createMaterialFromFlags",()=>E,"useStaticShape",()=>G]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(12979),A=e.i(90072),l=e.i(82816),B=(e.i(75567),e.i(79123)),c=e.i(25947);e.i(13876);var u=e.i(58647),C=e.i(89887),h=e.i(71505),d=e.i(47021),f=e.i(48066),m=e.i(6655),p=e.i(85557);function M(){let{recording:e}=u.engineStore.getState().playback;return null!=e?(0,u.effectNow)()/1e3:performance.now()/1e3}function F(e){e.onBeforeCompile=t=>{(0,d.injectCustomFog)(t,f.globalFogUniforms),e instanceof A.MeshLambertMaterial&&(0,m.injectShapeLighting)(t)}}function E(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),l=r.has("SelfIlluminating"),B=n<1||i;if(l||o){let e=o||a||B,r=new A.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:A.AdditiveBlending}});return F(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new A.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new A.MeshLambertMaterial({...e,side:0});return F(r),F(s),[r,s]}let c=new A.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return F(c),c}function G(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,o.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function I(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(C.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function g(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,B.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(I,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let D=new Set(["octahedron.dts"]);function R(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,B.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(C.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let T=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:u,streamEntity:C,children:h}=e,d=void 0===u?"yellow":u,{object:f,shapeName:m}=(0,c.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(g,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(D.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(R,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(g,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(I,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==C?(o=(0,t.jsx)(J,{streamEntity:C}),B[8]=C,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),H=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,c.useShapeInfo)(),{debugMode:o}=(0,B.useDebug)(),{animationEnabled:d}=(0,B.useSettings)(),f=(0,u.useEngineSelector)(e=>e.runtime.runtime),{clonedScene:m,mixer:F,clipsByName:E,visNodesBySequence:G,iflMeshes:I}=(0,s.useMemo)(()=>{let t=l.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,p.processShapeScene)(t,i??void 0),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new A.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e]),g=(0,s.useRef)(new Map),D=(0,s.useRef)(new Map),R=(0,s.useRef)([]),T=(0,s.useRef)(0);(0,s.useRef)(d).current=d;let H=(0,s.useRef)(r);H.current=r;let J=(0,s.useRef)(null),b=(0,s.useRef)(null),y=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(R.current=[],D.current.clear(),I))(0,h.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};R.current.push(s),D.current.set(e.mesh,t)}).catch(t=>{console.warn(`[ShapeModel] Failed to load IFL atlas for ${e.iflPath}:`,t)})},[I]);let L=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=g.current,t=null==H.current;function r(t,r){let n=r.toLowerCase();s(t);let i=E.get(n),a=G.get(n),o={sequence:n,startTime:M()};if(i&&F){let e=F.clipAction(i);L.get(n)??!0?e.setLoop(A.LoopRepeat,1/0):(e.setLoop(A.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,p.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=D.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(J.current=r,b.current=s,!t)return()=>{for(let t of(J.current=null,b.current=null,y.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(f&&(i.push(f.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(f.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(f.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(E.has(a)||G.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),J.current=null,b.current=null,y.current=void 0,[...e.keys()]))s(t)}},[F,E,G,L,n,f]);let x=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=g.current,s=null!=H.current,n=u.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=H.current?.threads,o=y.current;if(a!==o){let e=J.current,t=b.current;if(e&&t){y.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(T.current+=i,l)){if(!d){(0,h.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=M()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,h.updateAtlasFrame)(e.atlas,(0,h.getFrameIndexForTime)(e.atlas,t))}else(0,h.updateAtlasFrame)(e.atlas,(0,h.getFrameIndexForTime)(e.atlas,T.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:m}),o?(0,t.jsxs)(C.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function J(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,c.useShapeInfo)(),o=G(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(H,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file +`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1){let o=e.userData?.resource_path,A=new Set(e.userData?.flag_names??[]);if(!o){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(A.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,A,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,o,t,r)}}return{material:t,initialize:(e,r)=>I(t,o,e,r)}}let l=(0,a.textureToUrl)(o),B=(0,i.loadTexture)(l),c=A.has("Translucent");n||c?(0,i.setupTexture)(B,{disableMipmaps:!0}):(0,i.setupTexture)(B);let u=(0,r.createMaterialFromFlags)(e,B,A,n,s);return Array.isArray(u)?{material:u[1],backMaterial:u[0]}:{material:u}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t){var r;let n,i=[],a=!!t&&(0,s.isOrganicShape)(t),o=null;e.traverse(e=>{!o&&e.skeleton&&(o=e.skeleton)});let A=o?(r=o,n=new Set,r.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&n.add(t)}),n):new Set,l=[];for(let{parent:t,mesh:r}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;if((e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry){let t=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let r=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let s=G(t,r,a);if(s.initialize&&i.push({mesh:e,initialize:s.initialize}),s.backMaterial&&e.parent){let t=e.clone();t.material=s.backMaterial,l.push({parent:e.parent,mesh:t})}return s.material});else if(e.material){let t=G(e.material,r,a);if(t.initialize&&i.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,l.push({parent:e.parent,mesh:r})}}}),l))t.add(r);return i}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>D,"ShapeRenderer",()=>J,"applyShapeShaderModifications",()=>G,"createMaterialFromFlags",()=>I,"useStaticShape",()=>g]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(79123)),u=e.i(25947),C=e.i(58647),h=e.i(89887),d=e.i(71505),f=e.i(47021),m=e.i(48066),p=e.i(6655),M=e.i(85557);let F=(0,o.createLogger)("GenericShape");function E(){let{recording:e}=C.engineStore.getState().playback;return null!=e?(0,C.effectNow)()/1e3:performance.now()/1e3}function G(e){e.onBeforeCompile=t=>{(0,f.injectCustomFog)(t,m.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,p.injectShapeLighting)(t)}}function I(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return G(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return G(r),G(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return G(c),c}function g(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function D(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(h.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function R(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,c.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(D,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let T=new Set(["octahedron.dts"]);function H(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,c.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(h.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let J=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:C,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,u.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(R,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(T.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(H,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(R,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(D,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==C?(o=(0,t.jsx)(y,{streamEntity:C}),B[8]=C,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),b=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,u.useShapeInfo)(),{debugMode:o}=(0,c.useDebug)(),{animationEnabled:A}=(0,c.useSettings)(),f=(0,C.useEngineSelector)(e=>e.runtime.runtime),{clonedScene:m,mixer:p,clipsByName:G,visNodesBySequence:I,iflMeshes:g}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,M.processShapeScene)(t,i??void 0),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e]),D=(0,s.useRef)(new Map),R=(0,s.useRef)(new Map),T=(0,s.useRef)([]),H=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let J=(0,s.useRef)(r);J.current=r;let b=(0,s.useRef)(null),y=(0,s.useRef)(null),L=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(T.current=[],R.current.clear(),g))(0,d.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};T.current.push(s),R.current.set(e.mesh,t)}).catch(t=>{F.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[g]);let x=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=D.current,t=null==J.current;function r(t,r){let n=r.toLowerCase();s(t);let i=G.get(n),a=I.get(n),o={sequence:n,startTime:E()};if(i&&p){let e=p.clipAction(i);x.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,M.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=R.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(b.current=r,y.current=s,!t)return()=>{for(let t of(b.current=null,y.current=null,L.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(f&&(i.push(f.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(f.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(f.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(G.has(a)||I.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),b.current=null,y.current=null,L.current=void 0,[...e.keys()]))s(t)}},[p,G,I,x,n,f]);let S=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=D.current,s=null!=J.current,n=C.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=J.current?.threads,o=L.current;if(a!==o){let e=b.current,t=y.current;if(e&&t){L.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(H.current+=i,B)){if(!A){(0,d.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=E()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,d.updateAtlasFrame)(e.atlas,(0,d.getFrameIndexForTime)(e.atlas,t))}else(0,d.updateAtlasFrame)(e.atlas,(0,d.getFrameIndexForTime)(e.atlas,H.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:m}),o?(0,t.jsxs)(h.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function y(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,u.useShapeInfo)(),o=g(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(b,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3f45dfa93dd54d72.js b/docs/_next/static/chunks/3f45dfa93dd54d72.js new file mode 100644 index 00000000..d1c637e0 --- /dev/null +++ b/docs/_next/static/chunks/3f45dfa93dd54d72.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(2232);let r=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:n,modules:i}=function(){let e="info".trim();if(!e)return{globalLevel:"info",modules:new Map};let t=null,n=new Map;for(let i of e.split(",")){let e=i.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&n.set(t,r)}else r.has(e)&&(t=e)}return{globalLevel:t??=n.size>0?"silent":"info",modules:n}}(),s={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},l=(0,t.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=s[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function a(e){let t=i.get(e)??n;return l.child({module:e},{level:t})}e.s(["createLogger",()=>a])},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".ogg")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3fc0c5e684385765.js b/docs/_next/static/chunks/3fc0c5e684385765.js deleted file mode 100644 index 538faae9..00000000 --- a/docs/_next/static/chunks/3fc0c5e684385765.js +++ /dev/null @@ -1,89 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53272,e=>{"use strict";var t=e.i(43476),i=e.i(932),r=e.i(32865),a=e.i(71645),n=e.i(71753),o=e.i(78140),l=e.i(90072),s=e.i(85557),c=e.i(12979),u=e.i(15080),d=e.i(75567);let m=Math.PI/180,p=Math.PI/18e4;function f(e,t,i){let r=e[t];return"number"==typeof r&&Number.isFinite(r)?r:i}function h(e,t,i){let r=e[t];return"boolean"==typeof r?r:"number"==typeof r?0!==r:i}function g(e,t){let i,r=e.particles;if(Array.isArray(r)){for(let e of r)if("number"==typeof e&&(i=t(e)))break}return i?{ejectionPeriodMS:f(e,"ejectionPeriodMS",100),periodVarianceMS:f(e,"periodVarianceMS",0),ejectionVelocity:.01*f(e,"ejectionVelocity",200),velocityVariance:.01*f(e,"velocityVariance",100),ejectionOffset:.01*f(e,"ejectionOffset",0),thetaMin:f(e,"thetaMin",0),thetaMax:f(e,"thetaMax",90),phiReferenceVel:f(e,"phiReferenceVel",0),phiVariance:f(e,"phiVariance",360),overrideAdvances:h(e,"overrideAdvances",!1),orientParticles:h(e,"orientParticles",!1),orientOnVelocity:h(e,"orientOnVelocity",!0),lifetimeMS:f(e,"lifetimeMS",0)<<5,lifetimeVarianceMS:f(e,"lifetimeVarianceMS",0)<<5,particles:function(e){let t=e.keys,i=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e0&&t[0]&&(r=t[0])}return{dragCoefficient:5*f(e,"dragCoefficient",0),windCoefficient:f(e,"windCoefficient",1),gravityCoefficient:10*f(e,"gravityCoefficient",0),inheritedVelFactor:f(e,"inheritedVelFactor",0),constantAcceleration:f(e,"constantAcceleration",0),lifetimeMS:f(e,"lifetimeMS",31)<<5,lifetimeVarianceMS:f(e,"lifetimeVarianceMS",0)<<5,spinSpeed:f(e,"spinSpeed",0),spinRandomMin:f(e,"spinRandomMin",1e3)+-1e3,spinRandomMax:f(e,"spinRandomMax",1e3)+-1e3,useInvAlpha:h(e,"useInvAlpha",!1),keys:i,textureName:r}}(i)}:null}function y(e,t){return e+(2*Math.random()-1)*t}function S(e,t,i,r,a,n,o){let l=Math.cos(o),s=Math.sin(o),c=e*r+t*a+i*n;return[e*l+(a*i-n*t)*s+r*c*(1-l),t*l+(n*e-r*i)*s+a*c*(1-l),i*l+(r*t-a*e)*s+n*c*(1-l)]}class b{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,i){this.data=e,this.maxParticles=t;let r=i??e.lifetimeMS;!i&&e.lifetimeVarianceMS>0&&(r+=Math.round(y(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,i=[0,0,1]){for(let r=0;r0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(y(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,i=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let a=this.particles[r];if(a.currentAge+=e,a.currentAge>=a.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let n=i.dragCoefficient,o=i.gravityCoefficient,l=a.acc[0]-a.vel[0]*n,s=a.acc[1]-a.vel[1]*n,c=a.acc[2]-a.vel[2]*n+-9.81*o;a.vel[0]+=l*t,a.vel[1]+=s*t,a.vel[2]+=c*t,a.pos[0]+=a.vel[0]*t,a.pos[1]+=a.vel[1]*t,a.pos[2]+=a.vel[2]*t;let u=a.currentAge/a.totalLifetime,d=function(e,t){for(let i=1;i=t){let r=e[i-1],a=e[i],n=a.time-r.time,o=n>0?(t-r.time)/n:0;return{r:r.r+(a.r-r.r)*o,g:r.g+(a.g-r.g)*o,b:r.b+(a.b-r.b)*o,a:r.a+(a.a-r.a)*o,size:r.size+(a.size-r.size)*o}}let i=e[e.length-1];return{r:i.r,g:i.g,b:i.b,a:i.a,size:i.size}}(i.keys,u);a.r=d.r,a.g=d.g,a.b=d.b,a.a=d.a,a.size=d.size,a.currentSpin=a.spinSpeed*a.currentAge*p}}isDead(){return this.emitterDead&&0===this.particles.length}kill(){this.emitterDead=!0}addParticle(e,t){var i,r,a,n;let o,l,s,c,u=this.data,d=u.particles,p=t[0],f=t[1],h=t[2],g=(i=p,r=f,.9>Math.abs(a=h)?(o=r,l=-i,s=0):(o=-a,l=0,s=i),(c=Math.sqrt(o*o+l*l+s*s))<1e-8?[1,0,0]:[o/c,l/c,s/c]),b=(u.thetaMin+Math.random()*(u.thetaMax-u.thetaMin))*m,v=(this.internalClock/1e3*u.phiReferenceVel+Math.random()*u.phiVariance)*m;[p,f,h]=S(p,f,h,g[0],g[1],g[2],b),[p,f,h]=S(p,f,h,t[0],t[1],t[2],v);let M=Math.sqrt(p*p+f*f+h*h);M>1e-8&&(p/=M,f/=M,h/=M);let x=y(u.ejectionVelocity,u.velocityVariance),w=[e[0]+p*u.ejectionOffset,e[1]+f*u.ejectionOffset,e[2]+h*u.ejectionOffset],A=[p*x,f*x,h*x],T=d.constantAcceleration,P=[A[0]*T,A[1]*T,A[2]*T],k=d.lifetimeMS;d.lifetimeVarianceMS>0&&(k+=Math.round(y(0,d.lifetimeVarianceMS))),k=Math.max(1,k);let C=d.spinSpeed+((n=d.spinRandomMin)+Math.random()*(d.spinRandomMax-n)),I=d.keys[0];this.particles.push({pos:w,vel:A,acc:P,orientDir:[p,f,h],currentAge:0,totalLifetime:k,dataIndex:0,spinSpeed:C,currentSpin:0,r:I.r,g:I.g,b:I.b,a:I.a,size:I.size})}}let v=` -// 'position' is auto-declared by Three.js for ShaderMaterial. -attribute vec4 particleColor; -attribute float particleSize; -attribute float particleSpin; -attribute vec2 quadCorner; // (-0.5,-0.5) to (0.5,0.5) -attribute vec3 orientDir; - -uniform bool uOrientParticles; -// cameraPosition is a built-in Three.js uniform. - -varying vec2 vUv; -varying vec4 vColor; - -void main() { - vUv = quadCorner + 0.5; // [0,1] range - vColor = particleColor; - - if (uOrientParticles) { - if (length(orientDir) < 0.0001) { - // V12: don't render oriented particles with zero velocity. - gl_Position = vec4(0.0, 0.0, 0.0, 0.0); - return; - } - // V12 oriented particle: quad aligned along direction, facing camera. - vec3 worldPos = (modelMatrix * vec4(position, 1.0)).xyz; - vec3 dir = normalize(orientDir); - vec3 dirFromCam = worldPos - cameraPosition; - vec3 crossDir = normalize(cross(dirFromCam, dir)); - - // V12 maps U along dir (velocity) — match by using quadCorner.x for dir. - vec3 offset = dir * quadCorner.x + crossDir * quadCorner.y; - worldPos += offset * particleSize; - - gl_Position = projectionMatrix * viewMatrix * vec4(worldPos, 1.0); - } else { - // Standard camera-facing billboard. - vec3 viewPos = (modelViewMatrix * vec4(position, 1.0)).xyz; - - // Apply spin rotation to quad corner. - float c = cos(particleSpin); - float s = sin(particleSpin); - vec2 rotated = vec2( - c * quadCorner.x - s * quadCorner.y, - s * quadCorner.x + c * quadCorner.y - ); - - // Offset in view space (camera-facing billboard). - viewPos.xy += rotated * particleSize; - - gl_Position = projectionMatrix * vec4(viewPos, 1.0); - } -} -`,M=` -uniform sampler2D particleTexture; -uniform bool hasTexture; -uniform float debugOpacity; - -varying vec2 vUv; -varying vec4 vColor; - -void main() { - if (hasTexture) { - vec4 texColor = texture2D(particleTexture, vUv); - gl_FragColor = texColor * vColor; - } else { - gl_FragColor = vColor; - } - gl_FragColor.a *= debugOpacity; -} -`;var x=e.i(79123),w=e.i(51434),A=e.i(29055);e.i(13876);var T=e.i(58647);let P=new Float32Array([-.5,-.5,.5,-.5,.5,.5,-.5,.5]),k=new Map,C=new Set,I=new l.DataTexture(new Uint8Array([255,255,255,255]),1,1,l.RGBAFormat,l.UnsignedByteType);function B(e){if(!e)return I;let t=k.get(e);if(t)return t;try{let t=(0,c.textureToUrl)(e),i=(0,d.loadTexture)(t,e=>{(0,s.setupEffectTexture)(e),C.add(e)});return(0,s.setupEffectTexture)(i),k.set(e,i),i}catch{return I}}I.needsUpdate=!0;let D=new l.SphereGeometry(1,6,6),E=new l.MeshBasicMaterial({color:0xff0000,wireframe:!0}),R=new l.BoxGeometry(.3,.3,.3),V=new l.MeshBasicMaterial({color:65280,wireframe:!0}),F=new l.SphereGeometry(1,12,8),N=` - attribute vec4 vertexColor; - attribute vec2 texCoord; - varying vec4 vColor; - varying vec2 vUV; - void main() { - vColor = vertexColor; - vUV = texCoord; - gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - } -`,_=` - uniform sampler2D uTexture; - varying vec4 vColor; - varying vec2 vUV; - void main() { - vec4 tex = texture2D(uTexture, vUV); - gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); - } -`;function O(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),n=new Uint16Array(6*e);for(let t=0;t{let i=Y.current,r=k.current;if(!i||!r)return;let a=T.engineStore.getState().playback,n="playing"===a.status,o=n?t*a.rate:0,s=1e3*o,u=P.getDataBlockData.bind(P);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],n=i.particleEmitter;if("number"==typeof n){let e=t(n);if(e){let a=g(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let o=i.emitters;if(Array.isArray(o))for(let e of o){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=g(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new b(e.data,256);t.emitBurst(r,e.density);let a=B(e.data.particles.textureName),n=U(256),o=j(a,e.data.particles.useInvAlpha,e.data.orientParticles),s=new l.Mesh(n,o);s.frustumCulled=!1,i.add(s),Q.current.push({emitter:t,mesh:s,geometry:n,material:o,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new b(e,256,t.lifetimeMS),n=B(e.particles.textureName),o=U(256),s=j(n,e.particles.useInvAlpha,e.orientParticles),c=new l.Mesh(o,s);c.frustumCulled=!1,i.add(c),Q.current.push({emitter:a,mesh:c,geometry:o,material:s,targetTexture:n,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(I){let n=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,o=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),s=new l.MeshBasicMaterial({color:o,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new l.Mesh(F,s);c.frustumCulled=!1,c.scale.setScalar(n),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new l.CanvasTexture(i),n=new l.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),o=new l.Sprite(n),s=i.width/i.height;return o.scale.set(2*s,2,1),{sprite:o,material:n}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,o);u.position.set(r[1],r[2]+n+2,r[0]),u.frustumCulled=!1,i.add(u),et.current.push({entityId:e.id,mesh:c,material:s,label:u,labelMaterial:d,creationTime:(0,T.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:n})}let n=a?.shockwave;if("number"==typeof n){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(n,u);if(t){let a=B(t.textureName),n=O(t.numSegments),o=new l.ShaderMaterial({vertexShader:N,fragmentShader:_,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:l.AdditiveBlending,side:l.DoubleSide}),s=new l.Mesh(n,o);s.frustumCulled=!1,s.position.set(r[1],r[2],r[0]),i.add(s);let c=null,u=null;t.renderBottom&&(u=O(t.numSegments),(c=new l.Mesh(u,o)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;ei.current.push({entityId:e.id,mesh:s,bottomMesh:c,geometry:n,bottomGeometry:u,material:o,creationTime:(0,T.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||J.current.has(e.id))continue;J.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=g(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],n=new b(r,256),o=B(r.particles.textureName),s=U(256),c=j(o,r.particles.useInvAlpha,r.orientParticles),m=new l.Mesh(s,c);m.frustumCulled=!1,i.add(m),Q.current.push({emitter:n,mesh:m,geometry:s,material:c,targetTexture:o,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of Q.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of J.current)d.has(e)||J.current.delete(e);let m=Q.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,n=e.getContext();n.getProgramParameter(a,n.LINK_STATUS)||console.error(`[ParticleFX] Shader LINK ERROR (${i}):`,n.getProgramInfoLog(a))}(K,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,s,t.emitAxis),t.emitter.update(s),C.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=I?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),n=i.getAttribute("particleSize"),o=i.getAttribute("particleSpin"),l=i.getAttribute("orientDir"),s=r.array,c=a.array,u=n.array,d=o.array,m=l.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e=0;e--){let t=p[e],r=Math.min((f-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let h=ei.current;for(let t=h.length-1;t>=0;t--){let r=h[t],a=Math.min((f-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*o,r.radius=r.radius+r.velocity*o;let n=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e=r[e]&&(a=e);let n=Math.min(a+1,i.length-1),o=r[a]??0,l=(r[n]??1)-o,s=l>0?Math.min((t-o)/l,1):0,c=i[a]??i[0],u=i[n]??i[0];return[c.r+(u.r-c.r)*s,c.g+(u.g-c.g)*s,c.b+(u.b-c.b)*s,c.a+(u.a-c.a)*s]}(r.data,a);z(r.geometry,r.data,r.radius,n,r.data.is2D),r.bottomGeometry&&z(r.bottomGeometry,r.data,r.radius,n,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),h.splice(t,1))}if(n&&q&&H&&$&&Y.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(ee.current.has(t))continue;ee.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,A.resolveAudioProfile)(r,u);if(!a)continue;let n=new l.Vector3(e.position[1],e.position[2],e.position[0]);(0,A.playOneShotSound)(a,$,H,n,Y.current)}let e=Z.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let n=(0,A.resolveAudioProfile)(r,u);if(n&&n.isLooping&&n.is3D)try{let i=(0,c.audioToUrl)(n.filename),r=(0,A.getSoundGeneration)();(0,A.getCachedAudioBuffer)(i,H,i=>{if(r!==(0,A.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let o=Y.current;if(!o)return;let s=new l.PositionalAudio($);s.setBuffer(i),s.setDistanceModel("inverse"),s.setRefDistance(n.refDist),s.setMaxDistance(n.maxDist),s.setRolloffFactor(1),s.setVolume(n.volume),s.setPlaybackRate(a.rate),s.setLoop(!0),s.position.set(t.position[1],t.position[2],t.position[0]),o.add(s),(0,A.trackSound)(s),s.play(),e.set(t.id,s)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,A.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Y.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(ee.current.has(t))continue;ee.current.add(t);let i=(0,A.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new l.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,A.playOneShotSound)(i,$,H,r,Y.current)}}if(X.current.size>500){let e=new Set(r.entities.map(G));for(let t of X.current)e.has(t)||X.current.delete(t)}if(ee.current.size>500){let e=new Set(r.entities.map(L));for(let t of ee.current)t.startsWith("snd:")&&e.has(t.slice(4))||ee.current.delete(t)}},M[7]=q,M[8]=$,M[9]=H,M[10]=I,M[11]=K,M[12]=P,M[13]=k,M[14]=h):h=M[14],(0,n.useFrame)(h),M[15]===Symbol.for("react.memo_cache_sentinel")?(S=()=>()=>{let e=Y.current;for(let t of Q.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(Q.current=[],et.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(et.current=[],ei.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(ei.current=[],X.current.clear(),J.current.clear(),Z.current)){(0,A.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}Z.current.clear(),ee.current.clear()},y=[],M[15]=y,M[16]=S):(y=M[15],S=M[16]),(0,a.useEffect)(S,y),M[17]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("group",{ref:Y}),M[17]=v):v=M[17],v}function L(e){return e.id}function G(e){return e.id}function W(e){return e.gl}var H=e.i(9721),$=e.i(92224),K=e.i(93784);function Y(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var Q=e.i(77964);let X=new WeakMap;function J(e){let t=X.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),X.set(e,t)),t}let Z=new l.Vector3,ee=new l.Quaternion,et=new l.Quaternion,ei=new l.Quaternion(0,1,0,0),er=new l.Vector3,ea=new l.Vector3,en=new l.Vector3;function eo(e){let r,u,d,m,p,f,h,g,y,S=(0,i.c)(20),{recording:b}=e,v=(0,T.useEngineStoreApi)(),M=(0,a.useRef)(0),x=(0,a.useRef)(null),w=(0,a.useRef)(null);S[0]===Symbol.for("react.memo_cache_sentinel")?(r=new l.Vector3(0,s.DEFAULT_EYE_HEIGHT,0),S[0]=r):r=S[0];let P=(0,a.useRef)(r),k=(0,a.useRef)(b.streamingPlayback??null),C=(0,a.useRef)(null);S[1]===Symbol.for("react.memo_cache_sentinel")?(u=new Map,S[1]=u):u=S[1];let I=(0,a.useRef)(u),B=(0,a.useRef)(null),[D,E]=(0,a.useState)(null);S[2]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{if(e===B.current)return;B.current=e;let t=I.current,i=new Map,r=!1;for(let n of e.entities){let o=t.get(n.id);if(o&&o.className===(n.className??n.type)&&o.ghostIndex===n.ghostIndex&&o.dataBlockId===n.dataBlockId&&o.shapeHint===n.shapeHint&&o.shapeName===n.dataBlock&&("Player"===o.renderType||o.weaponShape===n.weaponShape)){var a=o;switch(a.renderType){case"Player":a.threads=n.threads,a.weaponShape=n.weaponShape,a.packShape=n.packShape,a.falling=n.falling,a.jetting=n.jetting,a.weaponImageState=n.weaponImageState,a.weaponImageStates=n.weaponImageStates,a.playerName=n.playerName,a.iffColor=n.iffColor,a.headPitch=n.headPitch,a.headYaw=n.headYaw,a.targetRenderFlags=n.targetRenderFlags;break;case"Shape":a.threads=n.threads,a.targetRenderFlags=n.targetRenderFlags,a.iffColor=n.iffColor}}else o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Y(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Y(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Y(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Y(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Y(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Y(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Y(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Y(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Y(e,t),renderType:"Camera"}:{...Y(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(n,e.timeSec),r=!0;if(i.set(n.id,o),(0,Q.isSceneEntity)(o)||"None"===o.renderType)continue;let l=o.keyframes;0===l.length&&l.push({time:e.timeSec,position:n.position??[0,0,0],rotation:n.rotation??[0,0,0,1]});let s=l[0];s.time=e.timeSec,n.position&&(s.position=n.position),n.rotation&&(s.rotation=n.rotation),s.velocity=n.velocity,s.health=n.health,s.energy=n.energy,s.actionAnim=n.actionAnim,s.actionAtEnd=n.actionAtEnd,s.damageState=n.damageState}for(let[a,n]of t)if(!i.has(a)){if("Explosion"===n.renderType&&n.shapeName&&null!=n.spawnTime&&e.timeSec-n.spawnTime<5){i.set(a,n);continue}r=!0}i.size!==t.size&&(r=!0),I.current=i,r&&$.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let n=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(n=r)}E(e=>e===n?e:n)},S[2]=d):d=S[2];let R=d;return S[3]!==v||S[4]!==b.source||S[5]!==b.streamingPlayback?(m=()=>{(0,A.stopAllTrackedSounds)(),k.current=b.streamingPlayback??null,I.current=new Map,B.current=null,C.current=null,(0,K.resetStreamPlayback)(),M.current=0,x.current=null,w.current=null;let e=k.current;if(K.streamPlaybackStore.setState({playback:e}),$.gameEntityStore.getState().beginStreaming(),!e)return void v.getState().setPlaybackStreamSnapshot(null);for(let t of("live"!==b.source&&e.reset(),e.getEffectShapes()))o.useGLTF.preload((0,c.shapeToUrl)(t));let t=e.getSnapshot();return K.streamPlaybackStore.setState({time:t.timeSec}),M.current=t.timeSec,x.current=t,w.current=t,R(t),v.getState().setPlaybackStreamSnapshot(t),C.current=t,()=>{(0,A.stopAllTrackedSounds)(),$.gameEntityStore.getState().endStreaming(),(0,K.resetStreamPlayback)(),v.getState().setPlaybackStreamSnapshot(null)}},S[3]=v,S[4]=b.source,S[5]=b.streamingPlayback,S[6]=m):m=S[6],S[7]!==v||S[8]!==b?(p=[b,v,R],S[7]=v,S[8]=b,S[9]=p):p=S[9],(0,a.useEffect)(m,p),S[10]!==v||S[11]!==b.source?(f=(e,t)=>{let i=k.current;if(!i)return;let r=v.getState(),a=r.playback,n="playing"===a.status,o=a.timeMs/1e3,l=!n&&Math.abs(o-M.current)>5e-4,c=n&&Math.abs(o-K.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(M.current=o),n&&((0,T.advanceEffectClock)(t,a.rate),M.current=M.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=M.current+s.STREAM_TICK_SEC,p=i.stepToTime(m,n&&!u?d:1/0),f=w.current;!f||p.timeSec1.5*s.STREAM_TICK_SEC?(x.current=p,w.current=p):p.timeSec!==f.timeSec&&(x.current=f,w.current=p);let h=w.current??p,g=x.current??h,y=h.timeSec-s.STREAM_TICK_SEC,S=Math.max(0,Math.min(1,(M.current-y)/s.STREAM_TICK_SEC));K.streamPlaybackStore.setState({time:M.current}),p.exhausted&&n&&(M.current=Math.min(M.current,p.timeSec)),R(h),K.streamPlaybackStore.getState().entities=I.current,h!==C.current&&(C.current=h,r.setPlaybackStreamSnapshot(h));let A=h.camera,B=A&&g.camera&&g.camera.mode===A.mode&&g.camera.controlEntityId===A.controlEntityId&&g.camera.orbitTargetId===A.orbitTargetId?g.camera:null,D=K.streamPlaybackStore.getState().freeFlyCamera,E="live"===b.source;if(A&&!D){if(B){let t=B.position[0],i=B.position[1],r=B.position[2],a=A.position[0],n=A.position[1],o=A.position[2];e.camera.position.set(i+(n-i)*S,r+(o-r)*S,t+(a-t)*S),E||(ee.set(...B.rotation),et.set(...A.rotation),ee.slerp(et,S),e.camera.quaternion.copy(ee))}else e.camera.position.set(A.position[1],A.position[2],A.position[0]),E||e.camera.quaternion.set(...A.rotation);if(Number.isFinite(A.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=B&&Number.isFinite(B.fov)?B.fov+(A.fov-B.fov)*S:A.fov,r=(0,s.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let V=J(h),F=J(g),N=I.current,_=K.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=N.get(t.name);if(i&&(0,Q.isSceneEntity)(i))continue;let r=V.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=F.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],n=a.position[2],o=r.position[0],l=r.position[1],s=r.position[2],c=e+(o-e)*S,u=i+(l-i)*S,d=n+(s-n)*S;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(ei):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(ee.set(...a.rotation),et.set(...r.rotation),ee.slerp(et,S),t.quaternion.copy(ee)):t.quaternion.set(...r.rotation))}let O=A?.mode;if(!D&&!E&&"third-person"===O&&_&&A?.orbitTargetId){let t=_.children.find(e=>e.name===A.orbitTargetId);if(t){let i=V.get(A.orbitTargetId);ea.copy(t.position),i?.type==="Player"&&(ea.y=ea.y+1);let r=!1;if(A.orbitDirection)er.set(A.orbitDirection[0],A.orbitDirection[1],A.orbitDirection[2]),r=er.lengthSq()>1e-8;else if("number"==typeof A.yaw&&"number"==typeof A.pitch){let e=Math.sin(A.pitch),t=Math.cos(A.pitch),i=Math.sin(A.yaw),a=Math.cos(A.yaw);er.set(-a*t,-e,-i*t),r=er.lengthSq()>1e-8}if(r||(er.copy(e.camera.position).sub(ea),r=er.lengthSq()>1e-8),r){er.normalize();let t=Math.max(.1,A.orbitDistance??4);en.copy(ea).addScaledVector(er,t),e.camera.position.copy(en),e.camera.lookAt(ea)}}}if(!D&&"first-person"===O&&_&&A?.controlEntityId){let t=_.children.find(e=>e.name===A.controlEntityId);t?(Z.copy(P.current).applyQuaternion(t.quaternion),e.camera.position.add(Z)):e.camera.position.y=e.camera.position.y+P.current.y}n&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*M.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},S[10]=v,S[11]=b.source,S[12]=f):f=S[12],(0,n.useFrame)(f),S[13]!==b.streamingPlayback?(h=(0,t.jsx)(q,{playback:b.streamingPlayback,snapshotRef:w}),S[13]=b.streamingPlayback,S[14]=h):h=S[14],S[15]!==D?(g=D&&(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(H.PlayerEyeOffset,{shapeName:D,eyeOffsetRef:P})}),S[15]=D,S[16]=g):g=S[16],S[17]!==h||S[18]!==g?(y=(0,t.jsxs)(t.Fragment,{children:[h,g]}),S[17]=h,S[18]=g,S[19]=y):y=S[19],y}function el(){let e,a=(0,i.c)(2),n=(0,r.useRecording)();return n?(a[0]!==n?(e=(0,t.jsx)(eo,{recording:n}),a[0]=n,a[1]=e):e=a[1],e):null}e.s(["StreamPlayback",()=>el],53272)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/450cc5a89761fca0.js b/docs/_next/static/chunks/450cc5a89761fca0.js new file mode 100644 index 00000000..47e5d0a9 --- /dev/null +++ b/docs/_next/static/chunks/450cc5a89761fca0.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90963,t=>{t.v({Input:"ChatInput-module__mZgxEG__Input",InputForm:"ChatInput-module__mZgxEG__InputForm"})},52728,t=>{"use strict";var e=t.i(43476),n=t.i(932),o=t.i(71645),a=t.i(98755),u=t.i(90963);function r(){let t,r,m,p,s=(0,n.c)(8),[c,g]=(0,o.useState)("");s[0]!==c?(t=t=>{t.preventDefault();let e=c.trim();e&&(a.liveConnectionStore.getState().sendCommand("messageSent",e),g(""))},s[0]=c,s[1]=t):t=s[1];let h=t;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t=>g(t.target.value),s[2]=r):r=s[2],s[3]!==c?(m=(0,e.jsx)("input",{className:u.default.Input,type:"text",placeholder:"Say something…",value:c,onChange:r,onKeyDown:l,onKeyUp:i,maxLength:255}),s[3]=c,s[4]=m):m=s[4],s[5]!==h||s[6]!==m?(p=(0,e.jsx)("form",{className:u.default.InputForm,onSubmit:h,children:m}),s[5]=h,s[6]=m,s[7]=p):p=s[7],p}function i(t){return t.stopPropagation()}function l(t){return t.stopPropagation()}t.s(["ChatInput",()=>r])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/463a5d636c02e0db.js b/docs/_next/static/chunks/463a5d636c02e0db.js deleted file mode 100644 index a3a74480..00000000 --- a/docs/_next/static/chunks/463a5d636c02e0db.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(15080),i=e.i(71753),r=e.i(90072),o=e.i(12979),l=e.i(51434),s=e.i(79123),c=e.i(89887);e.i(13876);var u=e.i(58647);let m=new Map,f=new Map;function d(e,t=1){f.set(e,t)}function p(e){f.delete(e)}let h=0;function S(){return h}function g(){for(let[e]of(h++,f)){try{e.stop()}catch{}try{e.disconnect()}catch{}}f.clear()}function y(e,t){let n=t(e),a=n?.filename;if(!a)return null;let i=a.endsWith(".wav")?a:`${a}.wav`,r=n.description,o=null!=r?t(r):void 0,l=o?.is3D??!0,s=o?.isLooping??!1,c=o?.referenceDistance??20;return{filename:i,is3D:l,isLooping:s,refDist:c,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function T(e,t,n,a,i){let l;try{l=(0,o.audioToUrl)(e.filename)}catch{return}let s=u.engineStore.getState().playback.rate,c=h;I(l,n,n=>{if(c===h)try{if(e.is3D&&i){let o=new r.PositionalAudio(t);o.setBuffer(n),o.setDistanceModel("inverse"),o.setRefDistance(e.refDist),o.setMaxDistance(e.maxDist),o.setRolloffFactor(1),o.setVolume(e.volume),o.setPlaybackRate(s),a&&o.position.copy(a),i.add(o),f.set(o,1),o.play(),o.source.onended=()=>{f.delete(o);try{o.disconnect()}catch{}i.remove(o)}}else{let a=new r.Audio(t);a.setBuffer(n),a.setVolume(e.volume),a.setPlaybackRate(s),f.set(a,1),a.play(),a.source.onended=()=>{f.delete(a);try{a.disconnect()}catch{}}}}catch{}})}function I(e,t,n){m.has(e)?n(m.get(e)):t.load(e,t=>{m.set(e,t),n(t)},void 0,t=>{console.error("Audio load error",e,t)})}u.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of f)try{t.setPlaybackRate(n*e)}catch{}});let w=(0,n.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),m=e.audioFileName??"",f=e.audioVolume??1,d=e.audioMinDistance??1,p=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,S=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,y=e.audioIsLooping??!0,[T,w,k]=e.position??[0,0,0],{scene:A,camera:M}=(0,a.useThree)(),{audioLoader:N,audioListener:v}=(0,l.useAudio)(),{audioEnabled:b}=(0,s.useSettings)(),x=(0,n.useRef)(null),R=(0,n.useRef)(null),_=(0,n.useRef)(null),L=(0,n.useRef)(!1),C=(0,n.useRef)(!1),E=(0,n.useRef)(new r.Vector3(T,w,k)),O=(0,n.useRef)(0),D=()=>{null!=R.current&&(clearTimeout(R.current),R.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)};(0,n.useEffect)(()=>{let e;if(N&&v){if(O.current++,g){let t=new r.PositionalAudio(v);t.position.copy(E.current),t.setDistanceModel("inverse"),t.setRefDistance(d),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(f),e=t,A.add(e)}else(e=new r.Audio(v)).setVolume(f);return x.current=e,()=>{D();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&A.remove(e),x.current=null,L.current=!1,C.current=!1}}},[N,v,g,d,p,f,A]);let P=(e,t)=>{if(y)if(h>0||S>0){let n=Math.max(0,h),a=Math.max(n,S),i=n===a?n:Math.random()*(a-n)+n;e.loop=!1;let r=()=>{t===O.current&&(!1===e.isPlaying?R.current=setTimeout(()=>{if(t===O.current)try{e.play(),P(e,t)}catch{}},i):_.current=setTimeout(r,100))};_.current=setTimeout(r,100)}else e.setLoop(!0)},F=e=>{if(!N)return;let t=O.current;if(L.current)try{e.isPlaying||(e.play(),P(e,t))}catch{}else{let n;try{n=(0,o.audioToUrl)(m)}catch{return}I(n,N,n=>{if(t===O.current&&!e.buffer){e.setBuffer(n),L.current=!0;try{e.play(),P(e,t)}catch{}}})}};return(0,n.useEffect)(()=>{let e=x.current;e&&!g&&b&&m&&F(e)},[b,g,m,N,v]),(0,i.useFrame)(()=>{let e=x.current;if(!e||!g||!b||!m)return;let t=M.position.distanceTo(E.current),n=C.current,a=t<=p;if(a&&!n)C.current=!0,F(e);else if(!a&&n){C.current=!1,D();try{e.stop()}catch{}}}),(0,n.useEffect)(()=>{let e=x.current;if(e&&!b){D();try{e.stop()}catch{}C.current=!1}},[b]),u?(0,t.jsxs)("mesh",{position:E.current,children:[(0,t.jsx)("sphereGeometry",{args:[d,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(c.FloatingLabel,{color:"#00ff00",position:[0,d+1,0],children:m})]}):null});e.s(["AudioEmitter",0,w,"audioBufferCache",0,m,"getCachedAudioBuffer",()=>I,"getSoundGeneration",()=>S,"playOneShotSound",()=>T,"resolveAudioProfile",()=>y,"stopAllTrackedSounds",()=>g,"trackSound",()=>d,"untrackSound",()=>p])},9721,e=>{"use strict";var t=e.i(43476),n=e.i(932),a=e.i(71645),i=e.i(71753),r=e.i(90072),o=e.i(82816),l=e.i(85557);class s{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(0===this.states.length)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let a=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&a.push(t)}}this.delayTime-=e;let i=n,r=this.evaluateTickTransitions(t),o=0;for(;r>=0&&o<32;){if(o++,i=!0,r===this.currentStateIndex){this.delayTime=this.states[r].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=r;let l=this.states[r].timeoutValue??0;this.delayTime=l;let s=this.states[r].soundDataBlockId;switch(s>=0&&a.push(s),this.states[r].spin){case 1:this.spinTimeScale=0;break;case 4:this.spinTimeScale=1;break;case 2:3===e&&l>0&&(this.delayTime*=1-n/l);break;case 3:2===e&&l>0&&(this.delayTime*=1-n/l)}r=this.evaluateEntryTransitions(t)}let l=this.states[this.currentStateIndex],s=l.timeoutValue??0;switch(l.spin){case 1:this.spinTimeScale=0;break;case 2:this.spinTimeScale=s>0?Math.max(0,1-this.delayTime/s):1;break;case 4:this.spinTimeScale=1;break;case 3:this.spinTimeScale=s>0?Math.max(0,this.delayTime/s):0}return{sequenceName:this.resolveSequenceName(l),isFiring:l.fire,spinTimeScale:this.spinTimeScale,reverse:!l.direction,scaleAnimation:l.scaleAnimation,timeoutValue:l.timeoutValue??0,transitioned:i,soundDataBlockIds:a,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return -1;let a=this.evaluateConditions(t,e);if(-1!==a)return a;if(n){let e=t.transitionOnTimeout;if(-1!==e)return e}return -1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(-1!==n)return n;let a=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(-1!==a)return a;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(-1!==i)return i;let r=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(-1!==r)return r;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return -1!==o?o:-1}resolveSequenceName(e){return null==e.sequence||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}}var c=e.i(43595),u=e.i(91907),m=e.i(87297),f=e.i(51434),d=e.i(29055),p=e.i(12979),h=e.i(79123);e.i(13876);var S=e.i(58647),g=e.i(93784);let y=["root","run","back","side","fall","jet","jump","land"];function T(e,t,n){let a=e.current;if(a){(0,d.untrackSound)(a);try{a.stop()}catch{}try{a.disconnect()}catch{}n?.remove(a),e.current=null,t.current=-1}}function I(e){let s,f,d,p,h,T,I,b,x,R,L,C,E,O,D,P,F,B,j,q,V,W,U=(0,n.c)(56),{entity:G}=e,z=(0,S.useEngineStoreApi)(),Y=G.shapeName??G.dataBlock,K=(0,u.useStaticShape)(Y);U[0]!==Y?(s=e=>{let t=Y?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0},U[0]=Y,U[1]=s):s=U[1];let H=(0,S.useEngineSelector)(s);U[2]!==K.scene?(T=o.clone(K.scene),f=(0,l.processShapeScene)(T),T.traverse(N),h=new r.AnimationMixer(T),d=null,p=null,T.traverse(e=>{d||"Mount0"!==e.name||(d=e),p||"Mount1"!==e.name||(p=e)}),U[2]=K.scene,U[3]=f,U[4]=d,U[5]=p,U[6]=h,U[7]=T):(f=U[3],d=U[4],p=U[5],h=U[6],T=U[7]),U[8]!==f||U[9]!==d||U[10]!==p||U[11]!==h||U[12]!==T?(I={clonedScene:T,mixer:h,mount0:d,mount1:p,iflInitializers:f},U[8]=f,U[9]=d,U[10]=p,U[11]=h,U[12]=T,U[13]=I):I=U[13];let{clonedScene:Q,mixer:$,mount0:J,mount1:X,iflInitializers:Z}=I;U[14]===Symbol.for("react.memo_cache_sentinel")?(b=new Map,U[14]=b):b=U[14];let ee=(0,a.useRef)(b);U[15]===Symbol.for("react.memo_cache_sentinel")?(x={head:null,headside:null},U[15]=x):x=U[15];let et=(0,a.useRef)(x);U[16]===Symbol.for("react.memo_cache_sentinel")?(R=new Map,U[16]=R):R=U[16];let en=(0,a.useRef)(R),ea=(0,a.useRef)(null);U[17]===Symbol.for("react.memo_cache_sentinel")?(L={name:"root",timeScale:1},U[17]=L):L=U[17];let ei=(0,a.useRef)(L),er=(0,a.useRef)(!1),eo=(0,a.useRef)(void 0);if(U[18]!==z||U[19]!==Y){e:{let e=z.getState().playback,t=e.recording?.streamingPlayback,n=Y?.toLowerCase();if(!t||!n){let e;U[21]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,U[21]=e):e=U[21],C=e;break e}let a=t.getShapeConstructorSequences(n);if(!a){let e;U[22]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,U[22]=e):e=U[22],C=e;break e}C=function(e,t){let n=new Map,a=[];for(let n of e){let e=n.indexOf(" ");if(-1===e)continue;let i=n.slice(0,e).toLowerCase(),r=n.slice(e+1).trim().toLowerCase();if(!r||!i.startsWith(t)||!i.endsWith(".dsq"))continue;let o=i.slice(t.length,-4);o&&a.push({clipName:o,alias:r})}let i=new Set;for(let e=0;e{let e=(0,c.getAliasedActions)(K.animations,$,H);ee.current=e;let t=e.get("root");t&&t.play(),ei.current={name:"root",timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:"head",names:["head"]},{key:"headside",names:["headside"]}]){let a=K.animations.find(e=>t.includes(e.name.toLowerCase()));if(!a)continue;let i=a.clone(),o=Math.round(30*a.duration/2);r.AnimationUtils.makeClipAdditive(i,o,a,30);let l=$.clipAction(i);l.blendMode=r.AdditiveAnimationBlendMode,l.timeScale=0,l.weight=1,l.play(),n[e]=l}et.current=n;let a=new Map,i=K.animations.find(M),o=i?Math.round(30*i.duration/2):0;for(let e of["lookde","lookms","looksn"]){let t=K.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),l=i??t;r.AnimationUtils.makeClipAdditive(n,o,l,30);let s=$.clipAction(n);s.blendMode=r.AdditiveAnimationBlendMode,s.timeScale=0,s.weight=0,s.play(),a.set(e,s)}en.current=a;let l=a.get("lookde");return l&&(l.weight=1,ea.current="lookde"),$.update(0),()=>{$.stopAllAction(),ee.current=new Map,et.current={head:null,headside:null},en.current=new Map,ea.current=null}},O=[$,K.animations,H],U[23]=K.animations,U[24]=$,U[25]=H,U[26]=E,U[27]=O):(E=U[26],O=U[27]),(0,a.useEffect)(E,O),U[28]!==Z?(D=()=>{let e=[];for(let{mesh:t,initialize:n}of Z)n(t,A).then(t=>e.push(t)).catch(k);return()=>e.forEach(w)},P=[Z],U[28]=Z,U[29]=D,U[30]=P):(D=U[29],P=U[30]),(0,a.useEffect)(D,P);let es=(0,a.useRef)(G.weaponShape),[ec,eu]=(0,a.useState)(G.weaponShape),em=(0,a.useRef)(G.packShape),[ef,ed]=(0,a.useState)(G.packShape);return U[31]!==el||U[32]!==z||U[33]!==G.falling||U[34]!==G.headPitch||U[35]!==G.headYaw||U[36]!==G.jetting||U[37]!==G.keyframes||U[38]!==G.packShape||U[39]!==G.weaponShape||U[40]!==$?(F=(e,t)=>{G.weaponShape!==es.current&&(es.current=G.weaponShape,eu(G.weaponShape)),G.packShape!==em.current&&(em.current=G.packShape,ed(G.packShape));let n=z.getState().playback,a="playing"===n.status,i=g.streamPlaybackStore.getState().time,o=(0,l.getKeyframeAtTime)(G.keyframes??[],i),s=o?.damageState!=null&&o.damageState>=1,c=ee.current;if(s&&!er.current){er.current=!0;let e=null!=o.actionAnim?el.get(o.actionAnim):void 0;if(e){let t=c.get(e.clipName);if(t){let n=c.get(ei.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),ei.current={name:e.clipName,timeScale:1},eo.current=o.actionAnim}}}if(!s&&er.current){er.current=!1,eo.current=void 0;let e=c.get(ei.current.name.toLowerCase());e&&(e.stop(),e.setLoop(r.LoopRepeat,1/0),e.clampWhenFinished=!1),ei.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().play()}let u=o?.actionAnim,m=eo.current;if(!er.current&&u!==m){eo.current=u;let e=null!=m&&m>=8;if(null!=u&&u>=8){let e=el.get(u);if(e){let t=c.get(e.clipName);if(t){let n=c.get(ei.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),ei.current={name:e.clipName,timeScale:1}}}}else if(e){let e=el.get(m);if(e){let t=c.get(e.clipName);t&&(t.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopRepeat,1/0),t.clampWhenFinished=!1)}ei.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()}}if(null!=u&&u>=8&&o?.actionAtEnd){let e=el.get(u);if(e){let t=c.get(e.clipName);t&&(t.paused=!0)}}let f=null!=eo.current&&eo.current>=8;if(!er.current&&!f){let e=function(e,t,n,a){if(n)return{animation:"fall",timeScale:1};if(!e)return a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1};let[i,r,o]=e,l=-2*Math.atan2(t[1],t[3]),s=Math.cos(l),c=Math.sin(l),u=i*s+r*c,m=-i*c+r*s,f=-m,d=-u,p=Math.max(m,f,d,u);return p<.1?a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1}:p===m?{animation:"run",timeScale:1}:p===f?{animation:"back",timeScale:1}:p===d?{animation:"side",timeScale:1}:{animation:"side",timeScale:-1}}(o?.velocity,o?.rotation??[0,0,0,1],G.falling,G.jetting),t=ei.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let n=c.get(t.name.toLowerCase()),i=c.get(e.animation.toLowerCase());i&&(a&&n&&n!==i?(n.fadeOut(l.ANIM_TRANSITION_TIME),i.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):(n&&n!==i&&n.stop(),i.reset().play()),i.timeScale=e.timeScale,ei.current={name:e.animation,timeScale:e.timeScale})}}let d=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(G.weaponShape);if(d!==ea.current){let e=en.current,t=ea.current?e.get(ea.current):null,n=e.get(d);n&&(t&&(t.weight=0),n.weight=+!s,ea.current=d)}let{head:p,headside:h}=et.current,S=ea.current?en.current.get(ea.current):null,y=+!s,T=G.headPitch??0,I=G.headYaw??0,w=(T+1)/2;S&&(S.time=w*S.getClip().duration,S.weight=y),p&&(p.time=w*p.getClip().duration,p.weight=y),h&&(h.time=(I+1)/2*h.getClip().duration,h.weight=y),a?$.update(t*n.rate):$.update(0)},U[31]=el,U[32]=z,U[33]=G.falling,U[34]=G.headPitch,U[35]=G.headYaw,U[36]=G.jetting,U[37]=G.keyframes,U[38]=G.packShape,U[39]=G.weaponShape,U[40]=$,U[41]=F):F=U[41],(0,i.useFrame)(F),U[42]===Symbol.for("react.memo_cache_sentinel")?(B=[0,Math.PI/2,0],U[42]=B):B=U[42],U[43]!==Q?(j=(0,t.jsx)("group",{rotation:B,children:(0,t.jsx)("primitive",{object:Q})}),U[43]=Q,U[44]=j):j=U[44],U[45]!==ec||U[46]!==G||U[47]!==J?(q=ec&&J&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:null,children:(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(v,{entity:G,weaponShape:ec,mount0:J})})},ec),U[45]=ec,U[46]=G,U[47]=J,U[48]=q):q=U[48],U[49]!==ef||U[50]!==X?(V=ef&&X&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:null,children:(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(_,{packShape:ef,mountBone:X})})},ef),U[49]=ef,U[50]=X,U[51]=V):V=U[51],U[52]!==j||U[53]!==q||U[54]!==V?(W=(0,t.jsxs)(t.Fragment,{children:[j,q,V]}),U[52]=j,U[53]=q,U[54]=V,U[55]=W):W=U[55],W}function w(e){return e()}function k(){}function A(){return g.streamPlaybackStore.getState().time}function M(e){return"lookde"===e.name.toLowerCase()}function N(e){if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.side=r.FrontSide}function v(e){let t,c,m,g,y,I,w,k,A,M,N,v,_,L,C=(0,n.c)(38),{entity:E,weaponShape:O,mount0:D}=e,P=(0,S.useEngineStoreApi)(),F=(0,u.useStaticShape)(O);if(C[0]!==F.animations||C[1]!==F.scene){t=o.clone(F.scene),c=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(F.scene,F.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}g=new Map,t.traverse(e=>{if(!e.isMesh)return;let t=e.userData,n=(t?.vis_sequence??"").toLowerCase();if(!n)return;let a=g.get(n);a||(a=[],g.set(n,a)),a.push(e)}),m=new r.AnimationMixer(t),C[0]=F.animations,C[1]=F.scene,C[2]=t,C[3]=c,C[4]=m,C[5]=g}else t=C[2],c=C[3],m=C[4],g=C[5];let B=m,j=F.scene;C[6]!==j||C[7]!==F.animations?(y=function(e,t){let n=e.userData?.dts_sequence_names;if("string"==typeof n)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}(j,F.animations),C[6]=j,C[7]=F.animations,C[8]=y):y=C[8];let q=y;C[9]!==t||C[10]!==c||C[11]!==B||C[12]!==q||C[13]!==g?(I={weaponClone:t,weaponMixer:B,seqIndexToName:q,visNodesBySequence:g,weaponIflInitializers:c},C[9]=t,C[10]=c,C[11]=B,C[12]=q,C[13]=g,C[14]=I):I=C[14];let{weaponClone:V,weaponMixer:W,seqIndexToName:U,visNodesBySequence:G,weaponIflInitializers:z}=I;C[15]===Symbol.for("react.memo_cache_sentinel")?(w=new Map,C[15]=w):w=C[15];let Y=(0,a.useRef)(w),K=(0,a.useRef)(null);C[16]!==F.animations||C[17]!==W?(k=()=>{let e=new Map;for(let t of F.animations)e.set(t.name.toLowerCase(),W.clipAction(t));Y.current=e;let t=e.get("spin");return t&&(t.setLoop(r.LoopRepeat,1/0),t.timeScale=0,t.play()),K.current=t??null,W.update(0),()=>{W.stopAllAction(),Y.current=new Map,K.current=null,T(et,en)}},A=[W,F.animations],C[16]=F.animations,C[17]=W,C[18]=k,C[19]=A):(k=C[18],A=C[19]),(0,a.useEffect)(k,A),C[20]!==z?(M=()=>{let e=[];for(let{mesh:t,initialize:n}of z)n(t,R).then(t=>e.push(t)).catch(x);return()=>e.forEach(b)},N=[z],C[20]=z,C[21]=M,C[22]=N):(M=C[21],N=C[22]),(0,a.useEffect)(M,N);let{audioLoader:H,audioListener:Q}=(0,f.useAudio)(),$=(0,h.useSettings)(),J=$?.audioEnabled??!1,X=(0,a.useRef)(null),Z=(0,a.useRef)(null),ee=(0,a.useRef)(E.weaponImageStates),et=(0,a.useRef)(null),en=(0,a.useRef)(-1);return C[23]!==D||C[24]!==V?(v=()=>(D.add(V),()=>{D.remove(V)}),_=[V,D],C[23]=D,C[24]=V,C[25]=v,C[26]=_):(v=C[25],_=C[26]),(0,a.useEffect)(v,_),C[27]!==J||C[28]!==Q||C[29]!==H||C[30]!==P||C[31]!==E.weaponImageState||C[32]!==E.weaponImageStates||C[33]!==U||C[34]!==G||C[35]!==V||C[36]!==W?(L=(e,t)=>{let n=P.getState().playback,a="playing"===n.status,i=Y.current,o=E.weaponImageState,c=E.weaponImageStates;c!==ee.current&&(ee.current=c,c&&c.length>0?X.current=new s(c,U):X.current=null,Z.current=null,T(et,en,V)),!X.current&&c&&c.length>0&&(X.current=new s(c,U));let u=X.current;if(u&&o&&a){let e=t*n.rate,a=u.tick(e,o);if(function(e,t,n,a){let i=e.sequenceName,o=n.current;if(i===o&&!e.transitioned)return;if(i!==o){if(o){let e=a.get(o);if(e)for(let t of e)t.visible=!1}if(i){let e=a.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(o){let e=t.get(o);e&&e.fadeOut(l.ANIM_TRANSITION_TIME),n.current=null}return}let s=t.get(i);if(s&&(e.transitioned||i!==o)){let a=o?t.get(o):null;if(e.isFiring||e.timeoutValue>0?(s.setLoop(r.LoopOnce,1),s.clampWhenFinished=!0):(s.setLoop(r.LoopRepeat,1/0),s.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=s.getClip().duration;s.timeScale=t>0?t/e.timeoutValue:1}else s.timeScale=e.reverse?-1:1;a&&a!==s?(a.fadeOut(l.ANIM_TRANSITION_TIME),s.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):s.reset().play(),n.current=i}}(a,i,Z,G),et.current&&a.stateIndex!==en.current&&T(et,en,V),J&&H&&Q&&a.soundDataBlockIds.length>0){let e=n.recording?.streamingPlayback.getDataBlockData.bind(n.recording.streamingPlayback);if(e)for(let t of a.soundDataBlockIds){let a=(0,d.resolveAudioProfile)(t,e);if(a)if(a.isLooping){if(!et.current)try{let e=(0,p.audioToUrl)(a.filename),t=(0,d.getSoundGeneration)();(0,d.getCachedAudioBuffer)(e,H,e=>{if(t!==(0,d.getSoundGeneration)()||et.current)return;let i=u.stateIndex,o=new r.PositionalAudio(Q);o.setBuffer(e),o.setDistanceModel("inverse"),o.setRefDistance(a.refDist),o.setMaxDistance(a.maxDist),o.setRolloffFactor(1),o.setVolume(a.volume),o.setPlaybackRate(n.rate),o.setLoop(!0),V.add(o),(0,d.trackSound)(o),o.play(),et.current=o,en.current=i})}catch{}}else(0,d.playOneShotSound)(a,Q,H,void 0,V)}}K.current&&(K.current.timeScale=a.spinTimeScale)}a?W.update(t*n.rate):W.update(0)},C[27]=J,C[28]=Q,C[29]=H,C[30]=P,C[31]=E.weaponImageState,C[32]=E.weaponImageStates,C[33]=U,C[34]=G,C[35]=V,C[36]=W,C[37]=L):L=C[37],(0,i.useFrame)(L),null}function b(e){return e()}function x(){}function R(){return g.streamPlaybackStore.getState().time}function _(e){let t,i,r,s,c,m,f,d=(0,n.c)(14),{packShape:p,mountBone:h}=e,S=(0,u.useStaticShape)(p);if(d[0]!==S.animations||d[1]!==S.scene){t=o.clone(S.scene),i=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(S.scene,S.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}d[0]=S.animations,d[1]=S.scene,d[2]=t,d[3]=i}else t=d[2],i=d[3];d[4]!==t||d[5]!==i?(r={packClone:t,packIflInitializers:i},d[4]=t,d[5]=i,d[6]=r):r=d[6];let{packClone:g,packIflInitializers:y}=r;return d[7]!==h||d[8]!==g?(s=()=>(h.add(g),()=>{h.remove(g)}),c=[g,h],d[7]=h,d[8]=g,d[9]=s,d[10]=c):(s=d[9],c=d[10]),(0,a.useEffect)(s,c),d[11]!==y?(m=()=>{let e=[];for(let{mesh:t,initialize:n}of y)n(t,E).then(t=>e.push(t)).catch(C);return()=>e.forEach(L)},f=[y],d[11]=y,d[12]=m,d[13]=f):(m=d[12],f=d[13]),(0,a.useEffect)(m,f),null}function L(e){return e()}function C(){}function E(){return g.streamPlaybackStore.getState().time}function O(e){let t,i,r=(0,n.c)(7),{shapeName:o,eyeOffsetRef:s}=e,c=(0,u.useStaticShape)(o);return r[0]!==s||r[1]!==c.animations||r[2]!==c.scene?(t=()=>{let e=(0,l.getPosedNodeTransform)(c.scene,c.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,l.DEFAULT_EYE_HEIGHT,0)},r[0]=s,r[1]=c.animations,r[2]=c.scene,r[3]=t):t=r[3],r[4]!==s||r[5]!==c?(i=[c,s],r[4]=s,r[5]=c,r[6]=i):i=r[6],(0,a.useEffect)(t,i),null}e.s(["PlayerEyeOffset",()=>O,"PlayerModel",()=>I],9721)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/4c292ca57f1d49be.js b/docs/_next/static/chunks/4c292ca57f1d49be.js new file mode 100644 index 00000000..82858470 --- /dev/null +++ b/docs/_next/static/chunks/4c292ca57f1d49be.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32424,7368,e=>{"use strict";var t=e.i(25645),r=e.i(12979);let a=(0,t.createLogger)("scriptLoader");function i(){return async e=>{let t;try{t=(0,r.getUrlForPath)(e)}catch(t){return a.warn("Script not in manifest: %s (%s)",e,t),null}try{let r=await fetch(t);if(!r.ok)return a.error("Script fetch failed: %s (%d)",e,r.status),null;return await r.text()}catch(t){return a.error("Script fetch error: %s %o",e,t),null}}}e.s(["createScriptLoader",()=>i],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},91285,e=>{"use strict";var t=e.i(43476),r=e.i(932),a=e.i(66027),i=e.i(54970),s=e.i(12979),o=e.i(32424),n=e.i(71645);let c=(0,n.createContext)(null);function p(e){let a,i=(0,r.c)(3),{runtime:s,children:o}=e;return i[0]!==o||i[1]!==s?(a=(0,t.jsx)(c.Provider,{value:s,children:o}),i[0]=o,i[1]=s,i[2]=a):a=i[2],a}var l=e.i(86608),u=e.i(38433),m=e.i(33870),d=e.i(91996);let g=(0,n.createContext)(null).Provider;var y=e.i(58647),f=e.i(92224),S=e.i(7368),h=e.i(62395),P=e.i(9672);function T(e,t){if(t)return e.state.datablocks.get(t)}let F=(0,e.i(25645).createLogger)("Mission"),v=(0,o.createScriptLoader)(),M=(0,m.createScriptCache)(),b={findFiles:e=>{let t=(0,i.default)(e,{nocase:!0});return(0,d.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,d.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,d.getResourceMap)()[(0,d.getResourceKey)(e)]};function k(e){"batch.flushed"===e.type&&y.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function B(e){e instanceof Error&&"AbortError"===e.name||F.error("Mission runtime failed to become ready: %o",e)}let D=(0,n.memo)(function(e){let i,o,c,m,d,F,D,L=(0,r.c)(13),{name:C,missionType:I,onLoadingChange:A}=e,{data:E}=((D=(0,r.c)(2))[0]!==C?(F={queryKey:["parsedMission",C],queryFn:()=>(0,s.loadMission)(C)},D[0]=C,D[1]=F):F=D[1],(0,a.useQuery)(F)),{ready:w,runtime:x,progress:R}=function(e,t,a){let i,s,o,c=(0,r.c)(6);c[0]===Symbol.for("react.memo_cache_sentinel")?(i={ready:!1,runtime:void 0,progress:0},c[0]=i):i=c[0];let[p,m]=(0,n.useState)(i);return c[1]!==e||c[2]!==t||c[3]!==a?(s=()=>{if(!a)return;let r=new AbortController,i=!1,s=null,o=(0,u.createProgressTracker)(),n=()=>{m(e=>({...e,progress:o.progress}))};o.on("update",n);let{runtime:c,ready:p}=(0,l.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:v,fileSystem:b,cache:M,signal:r.signal,progress:o,ignoreScripts:S.ignoreScripts}});return p.then(()=>{if(i||r.signal.aborted)return;y.engineStore.getState().setRuntime(c);let a=c.getObjectByName("MissionGroup");if(a){let r=function e(t,r,a,i){let s=[],o=i;if("SimGroup"===t._className){if(t._name?.toLowerCase()==="teams")o=void 0;else if(void 0===o&&t._name){let e=t._name.match(/^team(\d+)$/i);e&&(o=parseInt(e[1],10))}}let n=function(e,t,r){let a=e._className,i=`mission_${e._id}`,s=(0,h.getPosition)(e),o=(0,h.getScale)(e),n=function(e){let[t,r,a,i]=e.split(" ").map(parseFloat),s=-(i||0)*Math.PI/360,o=Math.sin(s),n=Math.cos(s),c=Math.sqrt((r||0)*(r||0)+(a||0)*(a||0)+(t||0)*(t||0));return c<1e-8?[0,0,0,1]:[(r||0)/c*o,(a||0)/c*o,(t||0)/c*o,n]}(e.rotation??"1 0 0 0"),c=(0,h.getProperty)(e,"dataBlock")??"",p=T(t,c),l=(0,h.getProperty)(e,"missionTypesList"),u={id:i,className:a,runtimeObject:e,missionTypesList:l},m={...u,position:s,rotation:n,scale:o};switch(a){case"TerrainBlock":return{...u,renderType:"TerrainBlock",terrainData:(0,P.terrainFromMis)(e)};case"InteriorInstance":return{...u,renderType:"InteriorInstance",interiorData:(0,P.interiorFromMis)(e)};case"Sky":return{...u,renderType:"Sky",skyData:(0,P.skyFromMis)(e)};case"Sun":return{...u,renderType:"Sun",sunData:(0,P.sunFromMis)(e)};case"WaterBlock":return{...u,renderType:"WaterBlock",waterData:(0,P.waterBlockFromMis)(e)};case"MissionArea":return{...u,renderType:"MissionArea",missionAreaData:(0,P.missionAreaFromMis)(e)};case"StaticShape":case"Item":case"Turret":case"TSStatic":var d=m,g=e,y=p,f=t,S=a,F=r,v=c;let M="TSStatic"===S?(0,h.getProperty)(g,"shapeName"):(0,h.getProperty)(y,"shapeFile"),b={...d,renderType:"Shape",shapeName:M,shapeType:"Turret"===S?"Turret":"Item"===S?"Item":"TSStatic"===S?"TSStatic":"StaticShape",dataBlock:v||void 0,teamId:F};if("Item"===S&&(b.rotate=function(e){if("string"==typeof e){let t=e.toLowerCase();return"0"!==t&&"false"!==t&&""!==t}return!!e}((0,h.getProperty)(g,"rotate")??(0,h.getProperty)(y,"rotate"))),"Turret"===S){let e=(0,h.getProperty)(g,"initialBarrel");if(e){let t=T(f,e);b.barrelShapeName=(0,h.getProperty)(t,"shapeFile")}}return b;case"ForceFieldBare":return function(e,t,r,a){let i,s=(0,h.getProperty)(r,"color"),o=s?[(i=s.split(" ").map(e=>parseFloat(e)))[0]??0,i[1]??0,i[2]??0]:[1,1,1],n=parseFloat((0,h.getProperty)(r,"baseTranslucency"))||1,c=parseInt((0,h.getProperty)(r,"numFrames"),10)||1,p=parseFloat((0,h.getProperty)(r,"framesPerSec"))||1,l=parseFloat((0,h.getProperty)(r,"scrollSpeed"))||0,u=parseFloat((0,h.getProperty)(r,"umapping"))||1,m=parseFloat((0,h.getProperty)(r,"vmapping"))||1,d=[];for(let e=0;e{i=!0,o.off("update",n),r.abort(),s?.(),y.engineStore.getState().clearRuntime(),f.gameEntityStore.getState().clearEntities(),c.destroy()}},o=[e,t,a],c[1]=e,c[2]=t,c[3]=a,c[4]=s,c[5]=o):(s=c[4],o=c[5]),(0,n.useEffect)(s,o),p}(C,I,E),_=!E||!w||!x;L[0]!==I||L[1]!==E?(i={metadata:E,missionType:I},L[0]=I,L[1]=E,L[2]=i):i=L[2];let j=i;return(L[3]!==_||L[4]!==A||L[5]!==R?(o=()=>{A?.(_,R)},c=[_,R,A],L[3]=_,L[4]=A,L[5]=R,L[6]=o,L[7]=c):(o=L[6],c=L[7]),(0,n.useEffect)(o,c),_)?null:(L[8]!==x?(m=(0,t.jsx)(p,{runtime:x}),L[8]=x,L[9]=m):m=L[9],L[10]!==j||L[11]!==m?(d=(0,t.jsx)(g,{value:j,children:m}),L[10]=j,L[11]=m,L[12]=d):d=L[12],d)});e.s(["Mission",0,D],91285)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/4fb9edf01fb5e4f5.js b/docs/_next/static/chunks/4fb9edf01fb5e4f5.js new file mode 100644 index 00000000..ba9ebe95 --- /dev/null +++ b/docs/_next/static/chunks/4fb9edf01fb5e4f5.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,0,t=>{"use strict";t.i(50593);var e=t.i(17711),s=t.i(58281);t.i(70847);var a=t.i(47566),i=t.i(25311),o=t.i(89119),r=t.i(10244);class n extends r.StreamEngine{parser;initialBlock;moveTicks=0;absoluteYaw=0;absolutePitch=0;lastAbsYaw=0;lastAbsPitch=0;exhausted=!1;_teamScoresGen=0;_rosterGen=0;_weaponsHudGen=0;_inventoryHudGen=0;_cachedSnapshot=null;_cachedSnapshotTick=-1;_snap=null;constructor(t){super(),this.parser=t,this.registry=t.getRegistry(),this.ghostTracker=t.getGhostTracker();const e=t.initialBlock;this.initialBlock={dataBlocks:e.dataBlocks,initialGhosts:e.initialGhosts,controlObjectGhostIndex:e.controlObjectGhostIndex,controlObjectData:e.controlObjectData,targetEntries:e.targetEntries,sensorGroupColors:e.sensorGroupColors,taggedStrings:e.taggedStrings,initialEvents:e.initialEvents,demoValues:e.demoValues,firstPerson:e.firstPerson},this.reset()}getDataBlockData(t){let e=this.initialBlock.dataBlocks.get(t);if(e?.data)return e.data;let s=this.parser.getPacketParser();return s.dataBlockDataMap?.get(t)}_shapeConstructorCache=null;getShapeConstructorSequences(t){if(!this._shapeConstructorCache)for(let[,t]of(this._shapeConstructorCache=new Map,this.initialBlock.dataBlocks)){if("TSShapeConstructor"!==t.className||!t.data)continue;let e=t.data.shape,s=t.data.sequences;e&&s&&this._shapeConstructorCache.set(e.toLowerCase(),s)}return this._shapeConstructorCache.get(t.toLowerCase())}getTimeSec(){return this.moveTicks*(i.TICK_DURATION_MS/1e3)}getCameraYawPitch(t){let e="player"===this.lastControlType,s=e?this.absoluteYaw:this.lastAbsYaw,a=e?this.absolutePitch:this.lastAbsPitch;return e&&(this.lastAbsYaw=s,this.lastAbsPitch=a),{yaw:s,pitch:a}}getControlPlayerHeadPitch(t){return(0,o.clamp)(this.absolutePitch/o.MAX_PITCH,-1,1)}onTeamScoresChanged(){this._teamScoresGen++}onRosterChanged(){this._rosterGen++}onWeaponsHudChanged(){this._weaponsHudGen++}onInventoryHudChanged(){this._inventoryHudGen++}reset(){for(let[t,e]of(this.parser.reset(),this.ghostTracker=this.parser.getGhostTracker(),this._cachedSnapshot=null,this._cachedSnapshotTick=-1,this._snap=null,this.resetSharedState(),this.initialBlock.taggedStrings))this.netStrings.set(t,e);for(let t of this.initialBlock.targetEntries)t.name&&this.targetNames.set(t.targetId,(0,o.stripTaggedStringMarkup)(t.name)),this.targetTeams.set(t.targetId,t.sensorGroup),this.targetRenderFlags.set(t.targetId,t.targetData);for(let t of this.initialBlock.sensorGroupColors){let e=this.sensorGroupColors.get(t.group);e||(e=new Map,this.sensorGroupColors.set(t.group,e)),e.set(t.targetGroup,{r:t.r,g:t.g,b:t.b})}if(this.moveTicks=0,this.absoluteYaw=0,this.absolutePitch=0,this.lastAbsYaw=0,this.lastAbsPitch=0,this.firstPerson=this.initialBlock.firstPerson,this.lastControlType=(0,o.detectControlObjectType)(this.initialBlock.controlObjectData)??"player",this.isPiloting="player"===this.lastControlType&&!!(this.initialBlock.controlObjectData?.pilot||this.initialBlock.controlObjectData?.controlObjectGhost!=null),this.lastPilotGhostIndex=this.isPiloting&&"number"==typeof this.initialBlock.controlObjectData?.controlObjectGhost?this.initialBlock.controlObjectData.controlObjectGhost:void 0,this.isPiloting){let t=this.initialBlock.controlObjectData?.controlObjectData,e=t?.angPosition;if(e&&"number"==typeof e.w){this.lastVehicleHeading=(0,o.torqueQuatHeading)(e),this.lastVehiclePitch=(0,o.torqueQuatPitch)(e);let t=(0,o.torqueQuatToThreeJS)(e);if(t){let[e,s,a,i]=t;this.lastVehicleOrbitDir=[-(1-2*(s*s+a*a)),-(2*(e*s+a*i)),-(2*(e*a-s*i))]}}}if(this.lastCameraMode="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.cameraMode?this.initialBlock.controlObjectData.cameraMode:void 0,this.lastOrbitGhostIndex="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.orbitObjectGhostIndex?this.initialBlock.controlObjectData.orbitObjectGhostIndex:void 0,"camera"===this.lastControlType){let t=this.initialBlock.controlObjectData?.minOrbitDist,e=this.initialBlock.controlObjectData?.maxOrbitDist,s=this.initialBlock.controlObjectData?.curOrbitDist;"number"==typeof t&&"number"==typeof e&&Number.isFinite(t)&&Number.isFinite(e)?this.lastOrbitDistance=Math.max(0,e-t):"number"==typeof s&&Number.isFinite(s)?this.lastOrbitDistance=Math.max(0,s):this.lastOrbitDistance=void 0}else this.lastOrbitDistance=void 0;let t=this.getAbsoluteRotation(this.initialBlock.controlObjectData);for(let e of(t&&(this.absoluteYaw=t.yaw,this.absolutePitch=t.pitch,this.lastAbsYaw=t.yaw,this.lastAbsPitch=t.pitch),this.exhausted=!1,this.latestFov=100,this.latestControl={ghostIndex:this.initialBlock.controlObjectGhostIndex,data:this.initialBlock.controlObjectData,position:(0,o.isValidPosition)(this.initialBlock.controlObjectData?.position)?this.initialBlock.controlObjectData?.position:void 0},this.controlPlayerGhostId="player"===this.lastControlType&&this.initialBlock.controlObjectGhostIndex>=0?(0,i.toEntityId)("Player",this.initialBlock.controlObjectGhostIndex):void 0,this.initialBlock.initialGhosts)){if("create"!==e.type||null==e.classId)continue;let t=this.registry.getGhostParser(e.classId)?.name;if(!t)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${e.index})`);let s=(0,i.toEntityId)(t,e.index),o={id:s,ghostIndex:e.index,className:t,spawnTick:0,type:(0,i.toEntityType)(t),rotation:[0,0,0,1]};if(this.applyGhostData(o,e.parsedData),e.parsedData){let s=(0,a.ghostToSceneObject)(t,e.index,e.parsedData);s&&(o.sceneData=s)}this.entities.set(s,o),this.entityIdByGhostIndex.set(e.index,s)}if(0===this.playerSensorGroup&&"player"===this.lastControlType&&this.latestControl.ghostIndex>=0){let t=this.entityIdByGhostIndex.get(this.latestControl.ghostIndex),e=t?this.entities.get(t):void 0;e?.sensorGroup!=null&&e.sensorGroup>0&&(this.playerSensorGroup=e.sensorGroup)}for(let t of this.initialBlock.initialEvents){let e=this.registry.getEventParser(t.classId)?.name;if("SetSensorGroupEvent"===e&&t.parsedData){let e=t.parsedData.sensorGroup;null!=e&&(this.playerSensorGroup=e)}else if("RemoteCommandEvent"===e&&t.parsedData){let e=this.resolveNetString(t.parsedData.funcName),s=t.parsedData.args;"ServerMessage"===e&&this.handleServerMessage(s),this.handleHudRemoteCommand(e,s)}}let e=function(t){let e={weaponsHud:null,backpackHud:null,inventoryHud:null,teamScores:[],playerRoster:new Map,chatMessages:[],gravity:-20};if(!t.length)return e;let s=0,a=()=>{let e=t[s++];return""===e?"":e??""};if(a(),s>=t.length)return e;let i=parseInt(a(),10)||0,r=new Map;for(let t=0;t0&&r.set(o,(r.get(o)??0)+1)}if(s>=t.length||(a(),s>=t.length))return e;{let t=a().split(" "),s=t[0]??"",i="1"===t[1]||"true"===t[1],r=t[2]??"",n="1"===t[4]||"true"===t[4];i&&s&&(e.backpackHud={packIndex:(0,o.backpackBitmapToIndex)(s),active:n,text:r})}if(s>=t.length)return e;let n=a().split(" "),l=parseInt(n[4],10)||0,c=parseInt(n[5],10)||0,h=parseInt(n[6],10);for(let t=0;t=t.length)return e;let d=a().split(" "),u=parseInt(d[4],10)||0,m=parseInt(d[5],10)||0,k=parseInt(d[6],10);for(let t=0;t0)||t.set(s,i)}t.size>0&&(e.inventoryHud={slots:t,activeSlot:isNaN(k)?-1:k})}if(s>=t.length)return e;let b=a().split(" "),g=b[1]??"",y=parseInt(b[2],10)||0,f=[];for(let t=0;t=8)for(let t=0;t<2;t++){let s=4*t,a=t+1;e.teamScores.push({teamId:a,name:f[s]??"",score:parseInt(f[s+1],10)||0,playerCount:r.get(a)??0})}else if("TR2Game"===g&&y>=4)for(let t=0;t<2;t++){let s=2*t,a=t+1;e.teamScores.push({teamId:a,name:f[s+1]??"",score:parseInt(f[s],10)||0,playerCount:r.get(a)??0})}if(s>=t.length)return e;a();for(let i=0;i<10&&!(s>=t.length);i++){let t=a();t&&e.chatMessages.push(t)}if(st.text).join("");if(!s.trim())continue;let a=e[0].colorCode;if(e.some(t=>3===t.colorCode||4===t.colorCode)&&s.includes(": ")){let t=s.indexOf(": ");this.pushChatMessage({timeSec:0,sender:s.slice(0,t),text:s.slice(t+2),kind:"chat",colorCode:a,segments:e})}else this.pushChatMessage({timeSec:0,sender:"",text:s,kind:"server",colorCode:a,segments:e})}this.updateCameraAndHud()}getSnapshot(){if(this._cachedSnapshot&&this._cachedSnapshotTick===this.moveTicks)return this._cachedSnapshot;let t=this.buildSnapshot();return this._cachedSnapshot=t,this._cachedSnapshotTick=this.moveTicks,t}getEffectShapes(){let t=new Set,e=e=>{let s=e.dtsFileName;s&&t.add(s);let a=e.subExplosions;if(Array.isArray(a))for(let e of a){if(null==e)continue;let s=this.getDataBlockData(e);s?.dtsFileName&&t.add(s.dtsFileName)}};for(let[,t]of this.initialBlock.dataBlocks){let s=t.data?.explosion;if(null==s)continue;let a=this.getDataBlockData(s);a&&e(a)}return[...t]}stepToTime(t,e=1/0){let s=Math.floor(1e3*(Number.isFinite(t)?Math.max(0,t):0)/i.TICK_DURATION_MS),a=!1;s({index:t,ammo:e})),activeIndex:this.weaponsHud.activeIndex},n=a&&a.inventoryHudGen===this._inventoryHudGen?a.inventoryHud:{slots:Array.from(this.inventoryHud.slots.entries()).map(([t,e])=>({slot:t,count:e})),activeSlot:this.inventoryHud.activeSlot},l=a&&a.backpackPackIndex===this.backpackHud.packIndex&&a.backpackActive===this.backpackHud.active&&a.backpackText===this.backpackHud.text?a.backpackHud:this.backpackHud.packIndex>=0?{...this.backpackHud}:null;if(a&&a.teamScoresGen===this._teamScoresGen&&a.rosterGen===this._rosterGen)t=a.teamScores;else{t=this.teamScores.map(t=>({...t}));let e=new Map;for(let{teamId:t}of this.playerRoster.values())t>0&&e.set(t,(e.get(t)??0)+1);for(let s of t)s.playerCount=e.get(s.teamId)??0}return this._snap={teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,teamScores:t,weaponsHudGen:this._weaponsHudGen,weaponsHud:r,inventoryHudGen:this._inventoryHudGen,inventoryHud:n,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,backpackText:this.backpackHud.text,backpackHud:l},{timeSec:s,exhausted:this.exhausted,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:i,audioEvents:o,weaponsHud:r,backpackHud:l,inventoryHud:n,teamScores:t}}isPacketData(t){return!!t&&"object"==typeof t&&"gameState"in t&&"events"in t&&"ghosts"in t}isMoveData(t){return!!t&&"object"==typeof t&&"yaw"in t}isInfoData(t){return!!t&&"object"==typeof t&&"value1"in t&&"number"==typeof t.value1&&"value2"in t&&"number"==typeof t.value2}}async function l(t){let e=new s.DemoParser(new Uint8Array(t)),{header:a,initialBlock:i}=await e.load(),r=function(t){let e=null,s=null,a=null,i=null,r=null,n=null,l=null;for(let c=0;c=3&&h[1]?.endsWith("Game")&&(a=h[1]),"readplayerinfo"!==t[c])continue;let p=t[c+1];if(p){if(p.startsWith("1 ")){let t=p.split(" ");t[2]&&(n=(0,o.stripTaggedStringMarkup)(t[2]).trim());continue}if(p.startsWith("2 ")){let t=p.split(" ");t[1]&&(i=t[1]),t[3]&&(l=t[3]),t[4]&&(e=t[4]);continue}if(p.startsWith("3 ")){let t=p.split(" ");t[1]&&(r=t[1]),t[2]&&(s=t[2])}}}return{missionDisplayName:e,missionType:s,gameClassName:a,serverDisplayName:i,mod:r,recorderName:n,recordingDate:l}}(i.demoValues),l=new n(e);return l.missionDisplayName=r.missionDisplayName,l.missionTypeDisplayName=r.missionType,l.gameClassName=r.gameClassName,l.serverDisplayName=r.serverDisplayName,l.connectedPlayerName=r.recorderName,{source:"demo",duration:a.demoLengthMs/1e3,missionName:i.missionName??null,gameType:r.missionType,serverDisplayName:r.serverDisplayName,recorderName:r.recorderName,recordingDate:r.recordingDate,streamingPlayback:l}}t.s(["createDemoStreamingRecording",()=>l])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/534ef931e88eb989.js b/docs/_next/static/chunks/534ef931e88eb989.js deleted file mode 100644 index 8297a3c6..00000000 --- a/docs/_next/static/chunks/534ef931e88eb989.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13070,e=>{e.v({Arrow:"KeyboardOverlay-module__HsRBsa__Arrow",Column:"KeyboardOverlay-module__HsRBsa__Column",Key:"KeyboardOverlay-module__HsRBsa__Key",Root:"KeyboardOverlay-module__HsRBsa__Root",Row:"KeyboardOverlay-module__HsRBsa__Row",Spacer:"KeyboardOverlay-module__HsRBsa__Spacer"})},78295,e=>{e.v({Joystick:"TouchControls-module__AkxfgW__Joystick",Left:"TouchControls-module__AkxfgW__Left TouchControls-module__AkxfgW__Joystick",Right:"TouchControls-module__AkxfgW__Right TouchControls-module__AkxfgW__Joystick"})},65883,e=>{e.v({ButtonLabel:"InspectorControls-module__gNRB6W__ButtonLabel",CheckboxField:"InspectorControls-module__gNRB6W__CheckboxField",Controls:"InspectorControls-module__gNRB6W__Controls",Dropdown:"InspectorControls-module__gNRB6W__Dropdown",Field:"InspectorControls-module__gNRB6W__Field",Group:"InspectorControls-module__gNRB6W__Group",IconButton:"InspectorControls-module__gNRB6W__IconButton",LabelledButton:"InspectorControls-module__gNRB6W__LabelledButton",MapInfoButton:"InspectorControls-module__gNRB6W__MapInfoButton InspectorControls-module__gNRB6W__IconButton InspectorControls-module__gNRB6W__LabelledButton",MissionSelectWrapper:"InspectorControls-module__gNRB6W__MissionSelectWrapper",Toggle:"InspectorControls-module__gNRB6W__Toggle InspectorControls-module__gNRB6W__IconButton"})},36679,e=>{e.v({ButtonLabel:"CopyCoordinatesButton-module__BxovtG__ButtonLabel "+e.i(65883).ButtonLabel,ClipboardCheck:"CopyCoordinatesButton-module__BxovtG__ClipboardCheck",MapPin:"CopyCoordinatesButton-module__BxovtG__MapPin",Root:"CopyCoordinatesButton-module__BxovtG__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,showClipboardCheck:"CopyCoordinatesButton-module__BxovtG__showClipboardCheck"})},28903,e=>{e.v({ButtonLabel:"LoadDemoButton-module__kGZaoW__ButtonLabel "+e.i(65883).ButtonLabel,DemoIcon:"LoadDemoButton-module__kGZaoW__DemoIcon",Root:"LoadDemoButton-module__kGZaoW__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton})},9607,e=>{e.v({LiveIcon:"JoinServerButton-module__DIR70a__LiveIcon",PingLabel:"JoinServerButton-module__DIR70a__PingLabel "+e.i(65883).ButtonLabel,Pulsing:"JoinServerButton-module__DIR70a__Pulsing",Root:"JoinServerButton-module__DIR70a__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,TextLabel:"JoinServerButton-module__DIR70a__TextLabel "+e.i(65883).ButtonLabel,blink:"JoinServerButton-module__DIR70a__blink"})},75840,e=>{e.v({BarFillEnergy:"PlayerHUD-module__-E1Scq__BarFillEnergy",BarFillHealth:"PlayerHUD-module__-E1Scq__BarFillHealth",BarTrack:"PlayerHUD-module__-E1Scq__BarTrack",Bars:"PlayerHUD-module__-E1Scq__Bars",ChatColor0:"PlayerHUD-module__-E1Scq__ChatColor0",ChatColor1:"PlayerHUD-module__-E1Scq__ChatColor1",ChatColor2:"PlayerHUD-module__-E1Scq__ChatColor2",ChatColor3:"PlayerHUD-module__-E1Scq__ChatColor3",ChatColor4:"PlayerHUD-module__-E1Scq__ChatColor4",ChatColor5:"PlayerHUD-module__-E1Scq__ChatColor5",ChatColor6:"PlayerHUD-module__-E1Scq__ChatColor6",ChatColor7:"PlayerHUD-module__-E1Scq__ChatColor7",ChatColor8:"PlayerHUD-module__-E1Scq__ChatColor8",ChatColor9:"PlayerHUD-module__-E1Scq__ChatColor9",ChatContainer:"PlayerHUD-module__-E1Scq__ChatContainer",ChatInput:"PlayerHUD-module__-E1Scq__ChatInput",ChatInputForm:"PlayerHUD-module__-E1Scq__ChatInputForm",ChatMessage:"PlayerHUD-module__-E1Scq__ChatMessage",ChatWindow:"PlayerHUD-module__-E1Scq__ChatWindow",Compass:"PlayerHUD-module__-E1Scq__Compass",CompassNSEW:"PlayerHUD-module__-E1Scq__CompassNSEW",CompassRing:"PlayerHUD-module__-E1Scq__CompassRing",PackInvCount:"PlayerHUD-module__-E1Scq__PackInvCount",PackInvIcon:"PlayerHUD-module__-E1Scq__PackInvIcon",PackInvInfinity:"PlayerHUD-module__-E1Scq__PackInvInfinity",PackInvItem:"PlayerHUD-module__-E1Scq__PackInvItem",PackInvItemActive:"PlayerHUD-module__-E1Scq__PackInvItemActive",PackInvItemDim:"PlayerHUD-module__-E1Scq__PackInvItemDim",PackInventoryHUD:"PlayerHUD-module__-E1Scq__PackInventoryHUD",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD",Reticle:"PlayerHUD-module__-E1Scq__Reticle",ReticleDot:"PlayerHUD-module__-E1Scq__ReticleDot",ReticleImage:"PlayerHUD-module__-E1Scq__ReticleImage",TeamCount:"PlayerHUD-module__-E1Scq__TeamCount",TeamNameEnemy:"PlayerHUD-module__-E1Scq__TeamNameEnemy",TeamNameFriendly:"PlayerHUD-module__-E1Scq__TeamNameFriendly",TeamRow:"PlayerHUD-module__-E1Scq__TeamRow",TeamScore:"PlayerHUD-module__-E1Scq__TeamScore",TeamScores:"PlayerHUD-module__-E1Scq__TeamScores",TopRight:"PlayerHUD-module__-E1Scq__TopRight",WeaponHUD:"PlayerHUD-module__-E1Scq__WeaponHUD",WeaponSeparator:"PlayerHUD-module__-E1Scq__WeaponSeparator"})},56614,e=>{e.v({CloseButton:"ServerBrowser-module__kqm3eq__CloseButton "+e.i(6090).Secondary,Dialog:"ServerBrowser-module__kqm3eq__Dialog",Empty:"ServerBrowser-module__kqm3eq__Empty",Footer:"ServerBrowser-module__kqm3eq__Footer",Header:"ServerBrowser-module__kqm3eq__Header",Hint:"ServerBrowser-module__kqm3eq__Hint",JoinButton:"ServerBrowser-module__kqm3eq__JoinButton "+e.i(6090).DialogButton,Overlay:"ServerBrowser-module__kqm3eq__Overlay",PasswordIcon:"ServerBrowser-module__kqm3eq__PasswordIcon",RefreshButton:"ServerBrowser-module__kqm3eq__RefreshButton "+e.i(6090).DialogButton,Selected:"ServerBrowser-module__kqm3eq__Selected",ServerCount:"ServerBrowser-module__kqm3eq__ServerCount",Table:"ServerBrowser-module__kqm3eq__Table",TableWrapper:"ServerBrowser-module__kqm3eq__TableWrapper",Title:"ServerBrowser-module__kqm3eq__Title",WarriorField:"ServerBrowser-module__kqm3eq__WarriorField",WarriorInput:"ServerBrowser-module__kqm3eq__WarriorInput",WarriorLabel:"ServerBrowser-module__kqm3eq__WarriorLabel"})},3011,e=>{e.v({CanvasContainer:"page-module__E0kJGG__CanvasContainer",LoadingIndicator:"page-module__E0kJGG__LoadingIndicator",Progress:"page-module__E0kJGG__Progress",ProgressBar:"page-module__E0kJGG__ProgressBar",ProgressText:"page-module__E0kJGG__ProgressText",Spinner:"page-module__E0kJGG__Spinner",loadingComplete:"page-module__E0kJGG__loadingComplete",spin:"page-module__E0kJGG__spin"})},31713,e=>{"use strict";var t=e.i(43476),a=e.i(932),r=e.i(71645),n=e.i(75056),o=e.i(90072),s=e.i(66027),l=e.i(54970),i=e.i(12979),c=e.i(32424);let u=(0,r.createContext)(null);function d(e){let r,n=(0,a.c)(3),{runtime:o,children:s}=e;return n[0]!==s||n[1]!==o?(r=(0,t.jsx)(u.Provider,{value:o,children:s}),n[0]=s,n[1]=o,n[2]=r):r=n[2],r}var m=e.i(86608),h=e.i(38433),p=e.i(33870),f=e.i(91996);let _=(0,r.createContext)(null).Provider;e.i(13876);var g=e.i(58647),y=e.i(92224),v=e.i(7368),x=e.i(62395),b=e.i(9672);function k(e,t){if(t)return e.state.datablocks.get(t)}let S=(0,c.createScriptLoader)(),C=(0,p.createScriptCache)(),j={findFiles:e=>{let t=(0,l.default)(e,{nocase:!0});return(0,f.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,f.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,f.getResourceMap)()[(0,f.getResourceKey)(e)]};function w(e){"batch.flushed"===e.type&&g.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function N(e){e instanceof Error&&"AbortError"===e.name||console.error("Mission runtime failed to become ready:",e)}let I=(0,r.memo)(function(e){let n,o,l,c,u,p,f,I=(0,a.c)(13),{name:T,missionType:P,onLoadingChange:B}=e,{data:D}=((f=(0,a.c)(2))[0]!==T?(p={queryKey:["parsedMission",T],queryFn:()=>(0,i.loadMission)(T)},f[0]=T,f[1]=p):p=f[1],(0,s.useQuery)(p)),{ready:E,runtime:L,progress:R}=function(e,t,n){let o,s,l,i=(0,a.c)(6);i[0]===Symbol.for("react.memo_cache_sentinel")?(o={ready:!1,runtime:void 0,progress:0},i[0]=o):o=i[0];let[c,u]=(0,r.useState)(o);return i[1]!==e||i[2]!==t||i[3]!==n?(s=()=>{if(!n)return;let a=new AbortController,r=!1,o=null,s=(0,h.createProgressTracker)(),l=()=>{u(e=>({...e,progress:s.progress}))};s.on("update",l);let{runtime:i,ready:c}=(0,m.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:S,fileSystem:j,cache:C,signal:a.signal,progress:s,ignoreScripts:v.ignoreScripts}});return c.then(()=>{if(r||a.signal.aborted)return;g.engineStore.getState().setRuntime(i);let e=i.getObjectByName("MissionGroup");if(e){let t=function e(t,a,r){let n=[],o=r;if("SimGroup"===t._className){if(t._name?.toLowerCase()==="teams")o=void 0;else if(void 0===o&&t._name){let e=t._name.match(/^team(\d+)$/i);e&&(o=parseInt(e[1],10))}}let s=function(e,t,a){let r=e._className,n=`mission_${e._id}`,o=(0,x.getPosition)(e),s=(0,x.getScale)(e),l=function(e){let[t,a,r,n]=e.split(" ").map(parseFloat),o=-(n||0)*Math.PI/360,s=Math.sin(o),l=Math.cos(o),i=Math.sqrt((a||0)*(a||0)+(r||0)*(r||0)+(t||0)*(t||0));return i<1e-8?[0,0,0,1]:[(a||0)/i*s,(r||0)/i*s,(t||0)/i*s,l]}(e.rotation??"1 0 0 0"),i=(0,x.getProperty)(e,"dataBlock")??"",c=k(t,i),u=(0,x.getProperty)(e,"missionTypesList"),d={id:n,className:r,runtimeObject:e,missionTypesList:u},m={...d,position:o,rotation:l,scale:s};switch(r){case"TerrainBlock":return{...d,renderType:"TerrainBlock",terrainData:(0,b.terrainFromMis)(e)};case"InteriorInstance":return{...d,renderType:"InteriorInstance",interiorData:(0,b.interiorFromMis)(e)};case"Sky":return{...d,renderType:"Sky",skyData:(0,b.skyFromMis)(e)};case"Sun":return{...d,renderType:"Sun",sunData:(0,b.sunFromMis)(e)};case"WaterBlock":return{...d,renderType:"WaterBlock",waterData:(0,b.waterBlockFromMis)(e)};case"MissionArea":return{...d,renderType:"MissionArea",missionAreaData:(0,b.missionAreaFromMis)(e)};case"StaticShape":case"Item":case"Turret":case"TSStatic":var h=m,p=e,f=c,_=t,g=r,y=a,v=i;let S="TSStatic"===g?(0,x.getProperty)(p,"shapeName"):(0,x.getProperty)(f,"shapeFile"),C={...h,renderType:"Shape",shapeName:S,shapeType:"Turret"===g?"Turret":"Item"===g?"Item":"TSStatic"===g?"TSStatic":"StaticShape",dataBlock:v||void 0,teamId:y};if("Item"===g&&(C.rotate=function(e){if("string"==typeof e){let t=e.toLowerCase();return"0"!==t&&"false"!==t&&""!==t}return!!e}((0,x.getProperty)(p,"rotate")??(0,x.getProperty)(f,"rotate"))),"Turret"===g){let e=(0,x.getProperty)(p,"initialBarrel");if(e){let t=k(_,e);C.barrelShapeName=(0,x.getProperty)(t,"shapeFile")}}return C;case"ForceFieldBare":return function(e,t,a,r){let n,o=(0,x.getProperty)(a,"color"),s=o?[(n=o.split(" ").map(e=>parseFloat(e)))[0]??0,n[1]??0,n[2]??0]:[1,1,1],l=parseFloat((0,x.getProperty)(a,"baseTranslucency"))||1,i=parseInt((0,x.getProperty)(a,"numFrames"),10)||1,c=parseFloat((0,x.getProperty)(a,"framesPerSec"))||1,u=parseFloat((0,x.getProperty)(a,"scrollSpeed"))||0,d=parseFloat((0,x.getProperty)(a,"umapping"))||1,m=parseFloat((0,x.getProperty)(a,"vmapping"))||1,h=[];for(let e=0;e{r=!0,s.off("update",l),a.abort(),o?.(),g.engineStore.getState().clearRuntime(),y.gameEntityStore.getState().clearEntities(),i.destroy()}},l=[e,t,n],i[1]=e,i[2]=t,i[3]=n,i[4]=s,i[5]=l):(s=i[4],l=i[5]),(0,r.useEffect)(s,l),c}(T,P,D),M=!D||!E||!L;I[0]!==P||I[1]!==D?(n={metadata:D,missionType:P},I[0]=P,I[1]=D,I[2]=n):n=I[2];let H=n;return(I[3]!==M||I[4]!==B||I[5]!==R?(o=()=>{B?.(M,R)},l=[M,R,B],I[3]=M,I[4]=B,I[5]=R,I[6]=o,I[7]=l):(o=I[6],l=I[7]),(0,r.useEffect)(o,l),M)?null:(I[8]!==L?(c=(0,t.jsx)(d,{runtime:L}),I[8]=L,I[9]=c):c=I[9],I[10]!==H||I[11]!==c?(u=(0,t.jsx)(_,{value:H,children:c}),I[10]=H,I[11]=c,I[12]=u):u=I[12],u)});var T=e.i(17751),P=e.i(12598),B=e.i(5729),D=e.i(12631),E=e.i(32865),L=e.i(13070);function R(){let e,r,n,o,s,l,i,c,u,d,m,h,p,f,_,g,y,v,x,b,k,S,C,j,w=(0,a.c)(51),N=(0,E.useRecording)(),I=(0,D.useKeyboardControls)(K),T=(0,D.useKeyboardControls)(W),P=(0,D.useKeyboardControls)(U),B=(0,D.useKeyboardControls)(A),R=(0,D.useKeyboardControls)(O),z=(0,D.useKeyboardControls)(q),$=(0,D.useKeyboardControls)(G),J=(0,D.useKeyboardControls)(F),V=(0,D.useKeyboardControls)(H),Y=(0,D.useKeyboardControls)(M);return N&&"live"!==N.source?null:(w[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:L.default.Spacer}),w[0]=e):e=w[0],w[1]!==I?(r=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":I,children:"W"}),w[1]=I,w[2]=r):r=w[2],w[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("div",{className:L.default.Spacer}),w[3]=n):n=w[3],w[4]!==r?(o=(0,t.jsxs)("div",{className:L.default.Row,children:[e,r,n]}),w[4]=r,w[5]=o):o=w[5],w[6]!==P?(s=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":P,children:"A"}),w[6]=P,w[7]=s):s=w[7],w[8]!==T?(l=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":T,children:"S"}),w[8]=T,w[9]=l):l=w[9],w[10]!==B?(i=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":B,children:"D"}),w[10]=B,w[11]=i):i=w[11],w[12]!==s||w[13]!==l||w[14]!==i?(c=(0,t.jsxs)("div",{className:L.default.Row,children:[s,l,i]}),w[12]=s,w[13]=l,w[14]=i,w[15]=c):c=w[15],w[16]!==o||w[17]!==c?(u=(0,t.jsxs)("div",{className:L.default.Column,children:[o,c]}),w[16]=o,w[17]=c,w[18]=u):u=w[18],w[19]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)("span",{className:L.default.Arrow,children:"↑"}),w[19]=d):d=w[19],w[20]!==R?(m=(0,t.jsx)("div",{className:L.default.Row,children:(0,t.jsxs)("div",{className:L.default.Key,"data-pressed":R,children:[d," Space"]})}),w[20]=R,w[21]=m):m=w[21],w[22]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)("span",{className:L.default.Arrow,children:"↓"}),w[22]=h):h=w[22],w[23]!==z?(p=(0,t.jsx)("div",{className:L.default.Row,children:(0,t.jsxs)("div",{className:L.default.Key,"data-pressed":z,children:[h," Shift"]})}),w[23]=z,w[24]=p):p=w[24],w[25]!==m||w[26]!==p?(f=(0,t.jsxs)("div",{className:L.default.Column,children:[m,p]}),w[25]=m,w[26]=p,w[27]=f):f=w[27],w[28]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)("div",{className:L.default.Spacer}),w[28]=_):_=w[28],w[29]!==$?(g=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":$,children:"↑"}),w[29]=$,w[30]=g):g=w[30],w[31]===Symbol.for("react.memo_cache_sentinel")?(y=(0,t.jsx)("div",{className:L.default.Spacer}),w[31]=y):y=w[31],w[32]!==g?(v=(0,t.jsxs)("div",{className:L.default.Row,children:[_,g,y]}),w[32]=g,w[33]=v):v=w[33],w[34]!==V?(x=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":V,children:"←"}),w[34]=V,w[35]=x):x=w[35],w[36]!==J?(b=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":J,children:"↓"}),w[36]=J,w[37]=b):b=w[37],w[38]!==Y?(k=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":Y,children:"→"}),w[38]=Y,w[39]=k):k=w[39],w[40]!==x||w[41]!==b||w[42]!==k?(S=(0,t.jsxs)("div",{className:L.default.Row,children:[x,b,k]}),w[40]=x,w[41]=b,w[42]=k,w[43]=S):S=w[43],w[44]!==v||w[45]!==S?(C=(0,t.jsxs)("div",{className:L.default.Column,children:[v,S]}),w[44]=v,w[45]=S,w[46]=C):C=w[46],w[47]!==f||w[48]!==C||w[49]!==u?(j=(0,t.jsxs)("div",{className:L.default.Root,children:[u,f,C]}),w[47]=f,w[48]=C,w[49]=u,w[50]=j):j=w[50],j)}function M(e){return e.lookRight}function H(e){return e.lookLeft}function F(e){return e.lookDown}function G(e){return e.lookUp}function q(e){return e.down}function O(e){return e.up}function A(e){return e.right}function U(e){return e.left}function W(e){return e.backward}function K(e){return e.forward}var z=e.i(71753),$=e.i(15080),J=e.i(79123),V=e.i(78295);function Y(e){let t=e.querySelector(".back");t&&(t.style.background="rgba(3, 79, 76, 0.6)",t.style.border="1px solid rgba(0, 219, 223, 0.5)",t.style.boxShadow="inset 0 0 10px rgba(0, 0, 0, 0.7)");let a=e.querySelector(".front");a&&(a.style.background="radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)",a.style.border="2px solid rgba(255, 255, 255, 0.4)",a.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)")}let X=Math.PI/2-.01;function Q({joystickState:a,joystickZone:n,lookJoystickState:o,lookJoystickZone:s}){let{touchMode:l}=(0,J.useControls)();(0,r.useEffect)(()=>{let t=n.current;if(!t)return;let r=null,o=!1;return e.A(84968).then(e=>{o||(r=e.default.create({zone:t,mode:"static",position:{left:"70px",bottom:"70px"},size:120,restOpacity:.9}),Y(t),r.on("move",(e,t)=>{a.current.angle=t.angle.radian,a.current.force=Math.min(1,t.force)}),r.on("end",()=>{a.current.force=0}))}),()=>{o=!0,r?.destroy()}},[a,n,l]),(0,r.useEffect)(()=>{if("dualStick"!==l)return;let t=s.current;if(!t)return;let a=null,r=!1;return e.A(84968).then(e=>{r||(a=e.default.create({zone:t,mode:"static",position:{right:"70px",bottom:"70px"},size:120,restOpacity:.9}),Y(t),a.on("move",(e,t)=>{o.current.angle=t.angle.radian,o.current.force=Math.min(1,t.force)}),a.on("end",()=>{o.current.force=0}))}),()=>{r=!0,a?.destroy()}},[l,o,s]);let i=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return"dualStick"===l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:n,className:V.default.Left,onContextMenu:e=>e.preventDefault(),onTouchStart:i}),(0,t.jsx)("div",{ref:s,className:V.default.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:i})]}):(0,t.jsx)("div",{ref:n,className:V.default.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:i})}function Z(e){let t,n,s,l,i,c,u,d,m,h,p=(0,a.c)(25),{joystickState:f,joystickZone:_,lookJoystickState:g}=e,{speedMultiplier:y,touchMode:v}=(0,J.useControls)(),{camera:x,gl:b}=(0,$.useThree)();p[0]===Symbol.for("react.memo_cache_sentinel")?(t=new o.Euler(0,0,0,"YXZ"),p[0]=t):t=p[0];let k=(0,r.useRef)(t),S=(0,r.useRef)(null);p[1]===Symbol.for("react.memo_cache_sentinel")?(n={x:0,y:0},p[1]=n):n=p[1];let C=(0,r.useRef)(n);p[2]===Symbol.for("react.memo_cache_sentinel")?(s=new o.Vector3,p[2]=s):s=p[2];let j=(0,r.useRef)(s);p[3]===Symbol.for("react.memo_cache_sentinel")?(l=new o.Vector3,p[3]=l):l=p[3];let w=(0,r.useRef)(l);p[4]===Symbol.for("react.memo_cache_sentinel")?(i=new o.Vector3,p[4]=i):i=p[4];let N=(0,r.useRef)(i);return p[5]!==x.quaternion?(c=()=>{k.current.setFromQuaternion(x.quaternion,"YXZ")},p[5]=x.quaternion,p[6]=c):c=p[6],p[7]!==x?(u=[x],p[7]=x,p[8]=u):u=p[8],(0,r.useEffect)(c,u),p[9]!==x.quaternion||p[10]!==b.domElement||p[11]!==_||p[12]!==v?(d=()=>{if("moveLookStick"!==v)return;let e=b.domElement,t=e=>{let t=_.current;if(!t)return!1;let a=t.getBoundingClientRect();return e.clientX>=a.left&&e.clientX<=a.right&&e.clientY>=a.top&&e.clientY<=a.bottom},a=e=>{if(null===S.current)for(let a=0;a{if(null!==S.current)for(let t=0;t{for(let t=0;t{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),S.current=null}},p[9]=x.quaternion,p[10]=b.domElement,p[11]=_,p[12]=v,p[13]=d):d=p[13],p[14]!==x||p[15]!==b.domElement||p[16]!==_||p[17]!==v?(m=[x,b.domElement,_,v],p[14]=x,p[15]=b.domElement,p[16]=_,p[17]=v,p[18]=m):m=p[18],(0,r.useEffect)(d,m),p[19]!==x||p[20]!==f.current||p[21]!==g||p[22]!==y||p[23]!==v?(h=(e,t)=>{let{force:a,angle:r}=f.current;if("dualStick"===v){let e=g.current;if(e.force>.15){let a=(e.force-.15)/.85,r=Math.cos(e.angle),n=Math.sin(e.angle);k.current.setFromQuaternion(x.quaternion,"YXZ"),k.current.y=k.current.y-r*a*2.5*t,k.current.x=k.current.x+n*a*2.5*t,k.current.x=Math.max(-X,Math.min(X,k.current.x)),x.quaternion.setFromEuler(k.current)}if(a>.08){let e=80*y*((a-.08)/.92),n=Math.cos(r),o=Math.sin(r);x.getWorldDirection(j.current),j.current.normalize(),w.current.crossVectors(x.up,j.current).normalize(),N.current.set(0,0,0).addScaledVector(j.current,o).addScaledVector(w.current,-n),N.current.lengthSq()>0&&(N.current.normalize().multiplyScalar(e*t),x.position.add(N.current))}}else if("moveLookStick"===v&&a>0){let e=80*y*.5;if(x.getWorldDirection(j.current),j.current.normalize(),N.current.copy(j.current).multiplyScalar(e*t),x.position.add(N.current),a>=.15){let e=Math.cos(r),n=Math.sin(r),o=(a-.15)/.85;k.current.setFromQuaternion(x.quaternion,"YXZ"),k.current.y=k.current.y-e*o*1.25*t,k.current.x=k.current.x+n*o*1.25*t,k.current.x=Math.max(-X,Math.min(X,k.current.x)),x.quaternion.setFromEuler(k.current)}}},p[19]=x,p[20]=f.current,p[21]=g,p[22]=y,p[23]=v,p[24]=h):h=p[24],(0,z.useFrame)(h),null}var ee=e.i(11889),et=e.i(56373),ea=e.i(86447),er=e.i(1559),en=e.i(78440),eo=e.i(59129),es=e.i(25998),el=e.i(18364),ei=e.i(70238),ec=e.i(29402),eu=e.i(97442);let ed=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),em={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},eh={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},ep=(0,f.getMissionList)().filter(e=>!ed.has(e)).map(e=>{let t,a=(0,f.getMissionInfo)(e),[r]=(0,f.getSourceAndPath)(a.resourcePath),n=(t=r.match(/^(.*)(\/[^/]+)$/))?t[1]:"",o=em[r]??eh[n]??null;return{resourcePath:a.resourcePath,missionName:e,displayName:a.displayName,sourcePath:r,groupName:o,missionTypes:a.missionTypes}}),ef=new Map(ep.map(e=>[e.missionName,e])),e_=function(e){let t=new Map;for(let a of e){let e=t.get(a.groupName)??[];e.push(a),t.set(a.groupName,e)}return t.forEach((e,a)=>{t.set(a,(0,ec.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,ec.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(ep),eg="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function ey(e){let r,n,o,s,l,i=(0,a.c)(12),{mission:c}=e,u=c.displayName||c.missionName;return i[0]!==u?(r=(0,t.jsx)("span",{className:eu.default.ItemName,children:u}),i[0]=u,i[1]=r):r=i[1],i[2]!==c.missionTypes?(n=c.missionTypes.length>0&&(0,t.jsx)("span",{className:eu.default.ItemTypes,children:c.missionTypes.map(ev)}),i[2]=c.missionTypes,i[3]=n):n=i[3],i[4]!==r||i[5]!==n?(o=(0,t.jsxs)("span",{className:eu.default.ItemHeader,children:[r,n]}),i[4]=r,i[5]=n,i[6]=o):o=i[6],i[7]!==c.missionName?(s=(0,t.jsx)("span",{className:eu.default.ItemMissionName,children:c.missionName}),i[7]=c.missionName,i[8]=s):s=i[8],i[9]!==o||i[10]!==s?(l=(0,t.jsxs)(t.Fragment,{children:[o,s]}),i[9]=o,i[10]=s,i[11]=l):l=i[11],l}function ev(e){return(0,t.jsx)("span",{className:eu.default.ItemType,"data-mission-type":e,children:e},e)}function ex(e){let n,o,s,l,i,c,u,d,m,h,p,_,g,y,v,x,b,k=(0,a.c)(46),{value:S,missionType:C,onChange:j,disabled:w}=e,[N,I]=(0,r.useState)(""),T=(0,r.useRef)(null),P=(0,r.useRef)(C);k[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{(0,r.startTransition)(()=>I(e))},k[0]=n):n=k[0];let B=(0,el.useComboboxStore)({resetValueOnHide:!0,selectedValue:S,setSelectedValue:e=>{if(e){let t=P.current,a=(0,f.getMissionInfo)(e).missionTypes;t&&a.includes(t)||(t=a[0]),j({missionName:e,missionType:t}),T.current?.blur()}},setValue:n});k[1]!==B?(o=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),B.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},s=[B],k[1]=B,k[2]=o,k[3]=s):(o=k[2],s=k[3]),(0,r.useEffect)(o,s),k[4]!==S?(l=ef.get(S),k[4]=S,k[5]=l):l=k[5];let D=l;e:{let e,t;if(!N){let e;k[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:e_},k[6]=e):e=k[6],i=e;break e}k[7]!==N?(e=(0,ei.matchSorter)(ep,N,{keys:["displayName","missionName","missionTypes","groupName"]}),k[7]=N,k[8]=e):e=k[8];let a=e;k[9]!==a?(t={type:"flat",missions:a},k[9]=a,k[10]=t):t=k[10],i=t}let E=i,L=D?D.displayName||D.missionName:S,R="flat"===E.type?0===E.missions.length:0===E.groups.length,M=e=>(0,t.jsx)(et.ComboboxItem,{value:e.missionName,className:eu.default.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let a=t.target.dataset.missionType;a?(P.current=a,e.missionName===S&&j({missionName:e.missionName,missionType:a})):P.current=null}else P.current=null},children:(0,t.jsx)(ey,{mission:e})},e.missionName),H=en.ComboboxProvider;k[11]!==B?(c=()=>{try{document.exitPointerLock()}catch{}B.show()},u=e=>{"Escape"!==e.key||B.getState().open||T.current?.blur()},k[11]=B,k[12]=c,k[13]=u):(c=k[12],u=k[13]),k[14]!==w||k[15]!==L||k[16]!==c||k[17]!==u?(d=(0,t.jsx)(ee.Combobox,{ref:T,autoSelect:!0,disabled:w,placeholder:L,className:eu.default.Input,onFocus:c,onKeyDown:u}),k[14]=w,k[15]=L,k[16]=c,k[17]=u,k[18]=d):d=k[18],k[19]!==L?(m=(0,t.jsx)("span",{className:eu.default.SelectedName,children:L}),k[19]=L,k[20]=m):m=k[20],k[21]!==C?(h=C&&(0,t.jsx)("span",{className:eu.default.ItemType,"data-mission-type":C,children:C}),k[21]=C,k[22]=h):h=k[22],k[23]!==h||k[24]!==m?(p=(0,t.jsxs)("div",{className:eu.default.SelectedValue,children:[m,h]}),k[23]=h,k[24]=m,k[25]=p):p=k[25],k[26]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)("kbd",{className:eu.default.Shortcut,children:eg?"⌘K":"^K"}),k[26]=_):_=k[26],k[27]!==p||k[28]!==d?(g=(0,t.jsxs)("div",{className:eu.default.InputWrapper,children:[d,p,_]}),k[27]=p,k[28]=d,k[29]=g):g=k[29];let F=er.ComboboxPopover,G=eu.default,q=ea.ComboboxList,O=eu.default,A="flat"===E.type?E.missions.map(M):E.groups.map(e=>{let[a,n]=e;return a?(0,t.jsxs)(eo.ComboboxGroup,{className:eu.default.Group,children:[(0,t.jsx)(es.ComboboxGroupLabel,{className:eu.default.GroupLabel,children:a}),n.map(M)]},a):(0,t.jsx)(r.Fragment,{children:n.map(M)},"ungrouped")});return k[30]!==R?(y=R&&(0,t.jsx)("div",{className:eu.default.NoResults,children:"No missions found"}),k[30]=R,k[31]=y):y=k[31],k[32]!==q||k[33]!==O.List||k[34]!==A||k[35]!==y?(v=(0,t.jsxs)(q,{className:O.List,children:[A,y]}),k[32]=q,k[33]=O.List,k[34]=A,k[35]=y,k[36]=v):v=k[36],k[37]!==F||k[38]!==G.Popover||k[39]!==v?(x=(0,t.jsx)(F,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:G.Popover,children:v}),k[37]=F,k[38]=G.Popover,k[39]=v,k[40]=x):x=k[40],k[41]!==H||k[42]!==B||k[43]!==g||k[44]!==x?(b=(0,t.jsxs)(H,{store:B,children:[g,x]}),k[41]=H,k[42]=B,k[43]=g,k[44]=x,k[45]=b):b=k[45],b}var eb=e.i(11152),ek=e.i(40141);function eS(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(e)}var eC=e.i(36679);function ej(e){let n,o,s,l,i,c=(0,a.c)(11),{cameraRef:u,missionName:d,missionType:m}=e,{fogEnabled:h}=(0,J.useSettings)(),[p,f]=(0,r.useState)(!1),_=(0,r.useRef)(null);c[0]!==u||c[1]!==h||c[2]!==d||c[3]!==m?(n=async()=>{clearTimeout(_.current);let e=u.current;if(!e)return;let t=function({position:e,quaternion:t}){let a=e=>parseFloat(e.toFixed(3)),r=`${a(e.x)},${a(e.y)},${a(e.z)}`,n=`${a(t.x)},${a(t.y)},${a(t.z)},${a(t.w)}`;return`#c${r}~${n}`}(e),a=new URLSearchParams;a.set("mission",`${d}~${m}`),a.set("fog",h.toString());let r=`${window.location.pathname}?${a}${t}`,n=`${window.location.origin}${r}`;window.history.replaceState(null,"",r);try{await navigator.clipboard.writeText(n),f(!0),_.current=setTimeout(()=>{f(!1)},1100)}catch(e){console.error(e)}},c[0]=u,c[1]=h,c[2]=d,c[3]=m,c[4]=n):n=c[4];let g=n,y=p?"true":"false";return c[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(eb.FaMapPin,{className:eC.default.MapPin}),s=(0,t.jsx)(eS,{className:eC.default.ClipboardCheck}),l=(0,t.jsx)("span",{className:eC.default.ButtonLabel,children:" Copy coordinates URL"}),c[5]=o,c[6]=s,c[7]=l):(o=c[5],s=c[6],l=c[7]),c[8]!==g||c[9]!==y?(i=(0,t.jsxs)("button",{type:"button",className:eC.default.Root,"aria-label":"Copy coordinates URL",title:"Copy coordinates URL",onClick:g,"data-copied":y,id:"copyCoordinatesButton",children:[o,s,l]}),c[8]=g,c[9]=y,c[10]=i):i=c[10],i}function ew(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z"},child:[]}]})(e)}e.i(91891);var eN=e.i(11251),eI=e.i(88787);e.i(70847);var eT=e.i(47566),eP=e.i(25311),eB=e.i(89119),eD=e.i(10244);class eE extends eD.StreamEngine{parser;initialBlock;moveTicks=0;absoluteYaw=0;absolutePitch=0;lastAbsYaw=0;lastAbsPitch=0;exhausted=!1;_teamScoresGen=0;_rosterGen=0;_weaponsHudGen=0;_inventoryHudGen=0;_cachedSnapshot=null;_cachedSnapshotTick=-1;_snap=null;constructor(e){super(),this.parser=e,this.registry=e.getRegistry(),this.ghostTracker=e.getGhostTracker();const t=e.initialBlock;this.initialBlock={dataBlocks:t.dataBlocks,initialGhosts:t.initialGhosts,controlObjectGhostIndex:t.controlObjectGhostIndex,controlObjectData:t.controlObjectData,targetEntries:t.targetEntries,sensorGroupColors:t.sensorGroupColors,taggedStrings:t.taggedStrings,initialEvents:t.initialEvents,demoValues:t.demoValues,firstPerson:t.firstPerson},this.reset()}getDataBlockData(e){let t=this.initialBlock.dataBlocks.get(e);if(t?.data)return t.data;let a=this.parser.getPacketParser();return a.dataBlockDataMap?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){if(!this._shapeConstructorCache)for(let[,e]of(this._shapeConstructorCache=new Map,this.initialBlock.dataBlocks)){if("TSShapeConstructor"!==e.className||!e.data)continue;let t=e.data.shape,a=e.data.sequences;t&&a&&this._shapeConstructorCache.set(t.toLowerCase(),a)}return this._shapeConstructorCache.get(e.toLowerCase())}getTimeSec(){return this.moveTicks*(eP.TICK_DURATION_MS/1e3)}getCameraYawPitch(e){let t="player"===this.lastControlType,a=t?this.absoluteYaw:this.lastAbsYaw,r=t?this.absolutePitch:this.lastAbsPitch;return t&&(this.lastAbsYaw=a,this.lastAbsPitch=r),{yaw:a,pitch:r}}getControlPlayerHeadPitch(e){return(0,eB.clamp)(this.absolutePitch/eB.MAX_PITCH,-1,1)}onTeamScoresChanged(){this._teamScoresGen++}onRosterChanged(){this._rosterGen++}onWeaponsHudChanged(){this._weaponsHudGen++}onInventoryHudChanged(){this._inventoryHudGen++}reset(){for(let[e,t]of(this.parser.reset(),this.ghostTracker=this.parser.getGhostTracker(),this._cachedSnapshot=null,this._cachedSnapshotTick=-1,this._snap=null,this.resetSharedState(),this.initialBlock.taggedStrings))this.netStrings.set(e,t);for(let e of this.initialBlock.targetEntries)e.name&&this.targetNames.set(e.targetId,(0,eB.stripTaggedStringMarkup)(e.name)),this.targetTeams.set(e.targetId,e.sensorGroup),this.targetRenderFlags.set(e.targetId,e.targetData);for(let e of this.initialBlock.sensorGroupColors){let t=this.sensorGroupColors.get(e.group);t||(t=new Map,this.sensorGroupColors.set(e.group,t)),t.set(e.targetGroup,{r:e.r,g:e.g,b:e.b})}if(this.moveTicks=0,this.absoluteYaw=0,this.absolutePitch=0,this.lastAbsYaw=0,this.lastAbsPitch=0,this.firstPerson=this.initialBlock.firstPerson,this.lastControlType=(0,eB.detectControlObjectType)(this.initialBlock.controlObjectData)??"player",this.isPiloting="player"===this.lastControlType&&!!(this.initialBlock.controlObjectData?.pilot||this.initialBlock.controlObjectData?.controlObjectGhost!=null),this.lastPilotGhostIndex=this.isPiloting&&"number"==typeof this.initialBlock.controlObjectData?.controlObjectGhost?this.initialBlock.controlObjectData.controlObjectGhost:void 0,this.isPiloting){let e=this.initialBlock.controlObjectData?.controlObjectData,t=e?.angPosition;if(t&&"number"==typeof t.w){this.lastVehicleHeading=(0,eB.torqueQuatHeading)(t),this.lastVehiclePitch=(0,eB.torqueQuatPitch)(t);let e=(0,eB.torqueQuatToThreeJS)(t);if(e){let[t,a,r,n]=e;this.lastVehicleOrbitDir=[-(1-2*(a*a+r*r)),-(2*(t*a+r*n)),-(2*(t*r-a*n))]}}}if(this.lastCameraMode="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.cameraMode?this.initialBlock.controlObjectData.cameraMode:void 0,this.lastOrbitGhostIndex="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.orbitObjectGhostIndex?this.initialBlock.controlObjectData.orbitObjectGhostIndex:void 0,"camera"===this.lastControlType){let e=this.initialBlock.controlObjectData?.minOrbitDist,t=this.initialBlock.controlObjectData?.maxOrbitDist,a=this.initialBlock.controlObjectData?.curOrbitDist;"number"==typeof e&&"number"==typeof t&&Number.isFinite(e)&&Number.isFinite(t)?this.lastOrbitDistance=Math.max(0,t-e):"number"==typeof a&&Number.isFinite(a)?this.lastOrbitDistance=Math.max(0,a):this.lastOrbitDistance=void 0}else this.lastOrbitDistance=void 0;let e=this.getAbsoluteRotation(this.initialBlock.controlObjectData);for(let t of(e&&(this.absoluteYaw=e.yaw,this.absolutePitch=e.pitch,this.lastAbsYaw=e.yaw,this.lastAbsPitch=e.pitch),this.exhausted=!1,this.latestFov=100,this.latestControl={ghostIndex:this.initialBlock.controlObjectGhostIndex,data:this.initialBlock.controlObjectData,position:(0,eB.isValidPosition)(this.initialBlock.controlObjectData?.position)?this.initialBlock.controlObjectData?.position:void 0},this.controlPlayerGhostId="player"===this.lastControlType&&this.initialBlock.controlObjectGhostIndex>=0?(0,eP.toEntityId)("Player",this.initialBlock.controlObjectGhostIndex):void 0,this.initialBlock.initialGhosts)){if("create"!==t.type||null==t.classId)continue;let e=this.registry.getGhostParser(t.classId)?.name;if(!e)throw Error(`No ghost parser for classId ${t.classId} (ghost index ${t.index})`);let a=(0,eP.toEntityId)(e,t.index),r={id:a,ghostIndex:t.index,className:e,spawnTick:0,type:(0,eP.toEntityType)(e),rotation:[0,0,0,1]};if(this.applyGhostData(r,t.parsedData),t.parsedData){let a=(0,eT.ghostToSceneObject)(e,t.index,t.parsedData);a&&(r.sceneData=a)}this.entities.set(a,r),this.entityIdByGhostIndex.set(t.index,a)}if(0===this.playerSensorGroup&&"player"===this.lastControlType&&this.latestControl.ghostIndex>=0){let e=this.entityIdByGhostIndex.get(this.latestControl.ghostIndex),t=e?this.entities.get(e):void 0;t?.sensorGroup!=null&&t.sensorGroup>0&&(this.playerSensorGroup=t.sensorGroup)}for(let e of this.initialBlock.initialEvents){let t=this.registry.getEventParser(e.classId)?.name;if("SetSensorGroupEvent"===t&&e.parsedData){let t=e.parsedData.sensorGroup;null!=t&&(this.playerSensorGroup=t)}else if("RemoteCommandEvent"===t&&e.parsedData){let t=this.resolveNetString(e.parsedData.funcName),a=e.parsedData.args;"ServerMessage"===t&&this.handleServerMessage(a),this.handleHudRemoteCommand(t,a)}}let t=function(e){let t={weaponsHud:null,backpackHud:null,inventoryHud:null,teamScores:[],playerRoster:new Map,chatMessages:[],gravity:-20};if(!e.length)return t;let a=0,r=()=>{let t=e[a++];return""===t?"":t??""};if(r(),a>=e.length)return t;let n=parseInt(r(),10)||0,o=new Map;for(let e=0;e0&&o.set(s,(o.get(s)??0)+1)}if(a>=e.length||(r(),a>=e.length))return t;{let e=r().split(" "),a=e[0]??"",n="1"===e[1]||"true"===e[1],o=e[2]??"",s="1"===e[4]||"true"===e[4];n&&a&&(t.backpackHud={packIndex:(0,eB.backpackBitmapToIndex)(a),active:s,text:o})}if(a>=e.length)return t;let s=r().split(" "),l=parseInt(s[4],10)||0,i=parseInt(s[5],10)||0,c=parseInt(s[6],10);for(let e=0;e=e.length)return t;let d=r().split(" "),m=parseInt(d[4],10)||0,h=parseInt(d[5],10)||0,p=parseInt(d[6],10);for(let e=0;e0)||e.set(a,n)}e.size>0&&(t.inventoryHud={slots:e,activeSlot:isNaN(p)?-1:p})}if(a>=e.length)return t;let f=r().split(" "),_=f[1]??"",g=parseInt(f[2],10)||0,y=[];for(let e=0;e=8)for(let e=0;e<2;e++){let a=4*e,r=e+1;t.teamScores.push({teamId:r,name:y[a]??"",score:parseInt(y[a+1],10)||0,playerCount:o.get(r)??0})}else if("TR2Game"===_&&g>=4)for(let e=0;e<2;e++){let a=2*e,r=e+1;t.teamScores.push({teamId:r,name:y[a+1]??"",score:parseInt(y[a],10)||0,playerCount:o.get(r)??0})}if(a>=e.length)return t;r();for(let n=0;n<10&&!(a>=e.length);n++){let e=r();e&&t.chatMessages.push(e)}if(ae.text).join("");if(!a.trim())continue;let r=t[0].colorCode;if(t.some(e=>3===e.colorCode||4===e.colorCode)&&a.includes(": ")){let e=a.indexOf(": ");this.pushChatMessage({timeSec:0,sender:a.slice(0,e),text:a.slice(e+2),kind:"chat",colorCode:r,segments:t})}else this.pushChatMessage({timeSec:0,sender:"",text:a,kind:"server",colorCode:r,segments:t})}this.updateCameraAndHud()}getSnapshot(){if(this._cachedSnapshot&&this._cachedSnapshotTick===this.moveTicks)return this._cachedSnapshot;let e=this.buildSnapshot();return this._cachedSnapshot=e,this._cachedSnapshotTick=this.moveTicks,e}getEffectShapes(){let e=new Set,t=t=>{let a=t.dtsFileName;a&&e.add(a);let r=t.subExplosions;if(Array.isArray(r))for(let t of r){if(null==t)continue;let a=this.getDataBlockData(t);a?.dtsFileName&&e.add(a.dtsFileName)}};for(let[,e]of this.initialBlock.dataBlocks){let a=e.data?.explosion;if(null==a)continue;let r=this.getDataBlockData(a);r&&t(r)}return[...e]}stepToTime(e,t=1/0){let a=Math.floor(1e3*(Number.isFinite(e)?Math.max(0,e):0)/eP.TICK_DURATION_MS),r=!1;a({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},l=r&&r.inventoryHudGen===this._inventoryHudGen?r.inventoryHud:{slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},i=r&&r.backpackPackIndex===this.backpackHud.packIndex&&r.backpackActive===this.backpackHud.active&&r.backpackText===this.backpackHud.text?r.backpackHud:this.backpackHud.packIndex>=0?{...this.backpackHud}:null;if(r&&r.teamScoresGen===this._teamScoresGen&&r.rosterGen===this._rosterGen)e=r.teamScores;else{e=this.teamScores.map(e=>({...e}));let t=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&t.set(e,(t.get(e)??0)+1);for(let a of e)a.playerCount=t.get(a.teamId)??0}return this._snap={teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,teamScores:e,weaponsHudGen:this._weaponsHudGen,weaponsHud:s,inventoryHudGen:this._inventoryHudGen,inventoryHud:l,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,backpackText:this.backpackHud.text,backpackHud:i},{timeSec:a,exhausted:this.exhausted,camera:this.camera,entities:t,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:n,audioEvents:o,weaponsHud:s,backpackHud:i,inventoryHud:l,teamScores:e}}isPacketData(e){return!!e&&"object"==typeof e&&"gameState"in e&&"events"in e&&"ghosts"in e}isMoveData(e){return!!e&&"object"==typeof e&&"yaw"in e}isInfoData(e){return!!e&&"object"==typeof e&&"value1"in e&&"number"==typeof e.value1&&"value2"in e&&"number"==typeof e.value2}}async function eL(e){let t=new eI.DemoParser(new Uint8Array(e)),{header:a,initialBlock:r}=await t.load(),{missionName:n,gameType:o}=function(e){let t=null,a=null;for(let r=0;r{if(h){_.current=_.current+1,p(null);return}f.current?.click()},d[0]=h,d[1]=p,d[2]=e):e=d[2];let g=e;d[3]!==p?(n=async e=>{let t=e.target.files?.[0];if(t){e.target.value="";try{let e=await t.arrayBuffer(),a=_.current+1;_.current=a;let r=await eL(e);if(_.current!==a)return;p(r)}catch(e){console.error("Failed to load demo:",e)}}},d[3]=p,d[4]=n):n=d[4];let y=n;d[5]===Symbol.for("react.memo_cache_sentinel")?(o={display:"none"},d[5]=o):o=d[5],d[6]!==y?(s=(0,t.jsx)("input",{ref:f,type:"file",accept:".rec",style:o,onChange:y}),d[6]=y,d[7]=s):s=d[7];let v=h?"Unload demo":"Load demo (.rec)",x=h?"Unload demo":"Load demo (.rec)",b=h?"true":void 0,k=null!=m&&!h;d[8]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(ew,{className:eR.default.DemoIcon}),d[8]=l):l=d[8];let S=h?"Unload demo":"Demo";return d[9]!==S?(i=(0,t.jsx)("span",{className:eR.default.ButtonLabel,children:S}),d[9]=S,d[10]=i):i=d[10],d[11]!==g||d[12]!==i||d[13]!==v||d[14]!==x||d[15]!==b||d[16]!==k?(c=(0,t.jsxs)("button",{type:"button",className:eR.default.Root,"aria-label":v,title:x,onClick:g,"data-active":b,disabled:k,children:[l,i]}),d[11]=g,d[12]=i,d[13]=v,d[14]=x,d[15]=b,d[16]=k,d[17]=c):c=d[17],d[18]!==c||d[19]!==s?(u=(0,t.jsxs)(t.Fragment,{children:[s,c]}),d[18]=c,d[19]=s,d[20]=u):u=d[20],u}function eH(e){return(0,ek.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z"},child:[]}]})(e)}var eF=e.i(98755),eG=e.i(9607);function eq(e){let r,n,o,s,l,i=(0,a.c)(20),{onOpenServerBrowser:c}=e,u=(0,eF.useLiveSelector)(eU),d=(0,eF.useLiveSelector)(eA),m=(0,eF.useLiveSelector)(eF.selectPing),h=(0,eF.useLiveSelector)(eO),p="connected"===u,f="connecting"===u||"challenging"===u||"authenticating"===u,_=p?`Disconnect from ${d??"server"}`:"Join server",g=p?`Disconnect from ${d??"server"}`:"Join server";i[0]!==h||i[1]!==p||i[2]!==c?(r=()=>{p?h():c()},i[0]=h,i[1]=p,i[2]=c,i[3]=r):r=i[3];let y=p?"true":void 0,v=`${eG.default.LiveIcon} ${p?eG.default.Pulsing:""}`;if(i[4]!==v?(n=(0,t.jsx)(eH,{className:v}),i[4]=v,i[5]=n):n=i[5],i[6]!==f||i[7]!==p?(o=!p&&(0,t.jsx)("span",{className:eG.default.TextLabel,children:f?"Connecting...":"Connect"}),i[6]=f,i[7]=p,i[8]=o):o=i[8],i[9]!==p||i[10]!==m)s=p&&null!=m&&(0,t.jsx)("span",{className:eG.default.PingLabel,children:m>=1e3?m.toLocaleString()+"ms":m+"ms"}),i[9]=p,i[10]=m,i[11]=s;else s=i[11];return i[12]!==_||i[13]!==g||i[14]!==r||i[15]!==y||i[16]!==n||i[17]!==o||i[18]!==s?(l=(0,t.jsxs)("button",{type:"button",className:eG.default.Root,"aria-label":_,title:g,onClick:r,"data-active":y,children:[n,o,s]}),i[12]=_,i[13]=g,i[14]=r,i[15]=y,i[16]=n,i[17]=o,i[18]=s,i[19]=l):l=i[19],l}function eO(e){return e.disconnectServer}function eA(e){return e.serverName}function eU(e){return e.gameStatus}function eW(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"},child:[]}]})(e)}function eK(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}var ez=e.i(65883);function e$(e){let n,o,s,l,i,c,u,d,m,h,p,f,_,g,y,v,x,b,k,S,C,j,w,N,I,T,P,B,D,L,R,M,H,F,G,q,O,A,U,W,K=(0,a.c)(95),{missionName:z,missionType:$,onChangeMission:V,onOpenMapInfo:Y,onOpenServerBrowser:X,isTouch:Q,cameraRef:Z}=e,{fogEnabled:ee,setFogEnabled:et,fov:ea,setFov:er,audioEnabled:en,setAudioEnabled:eo,animationEnabled:es,setAnimationEnabled:el}=(0,J.useSettings)(),{speedMultiplier:ei,setSpeedMultiplier:ec,touchMode:eu,setTouchMode:ed}=(0,J.useControls)(),{debugMode:em,setDebugMode:eh}=(0,J.useDebug)(),ep=(0,E.useRecording)(),ef=(0,eF.useLiveSelector)(eQ),e_=null!=ep||ef,eg=e_&&!ef,[ey,ev]=(0,r.useState)(!1),eb=(0,r.useRef)(null),ek=(0,r.useRef)(null),eS=(0,r.useRef)(null);K[0]!==ey?(n=()=>{ey&&eb.current?.focus()},o=[ey],K[0]=ey,K[1]=n,K[2]=o):(n=K[1],o=K[2]),(0,r.useEffect)(n,o),K[3]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{let t=e.relatedTarget;t&&eS.current?.contains(t)||ev(!1)},K[3]=s):s=K[3];let eC=s;K[4]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{"Escape"===e.key&&(ev(!1),ek.current?.focus())},K[4]=l):l=K[4];let ew=l;return K[5]!==e_||K[6]!==z||K[7]!==$||K[8]!==V?(i=(0,t.jsx)("div",{className:ez.default.MissionSelectWrapper,children:(0,t.jsx)(ex,{value:z,missionType:$,onChange:V,disabled:e_})}),K[5]=e_,K[6]=z,K[7]=$,K[8]=V,K[9]=i):i=K[9],K[10]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{ev(eJ)},K[10]=c):c=K[10],K[11]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(eK,{}),K[11]=u):u=K[11],K[12]!==ey?(d=(0,t.jsx)("button",{ref:ek,className:ez.default.Toggle,onClick:c,"aria-expanded":ey,"aria-controls":"settingsPanel","aria-label":"Settings",children:u}),K[12]=ey,K[13]=d):d=K[13],K[14]!==Z||K[15]!==z||K[16]!==$?(m=(0,t.jsx)(ej,{missionName:z,missionType:$,cameraRef:Z}),K[14]=Z,K[15]=z,K[16]=$,K[17]=m):m=K[17],K[18]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)(eM,{}),K[18]=h):h=K[18],K[19]!==X?(p=X&&(0,t.jsx)(eq,{onOpenServerBrowser:X}),K[19]=X,K[20]=p):p=K[20],K[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(eW,{}),_=(0,t.jsx)("span",{className:ez.default.ButtonLabel,children:"Show map info"}),K[21]=f,K[22]=_):(f=K[21],_=K[22]),K[23]!==Y?(g=(0,t.jsxs)("button",{type:"button",className:ez.default.MapInfoButton,"aria-label":"Show map info",onClick:Y,children:[f,_]}),K[23]=Y,K[24]=g):g=K[24],K[25]!==p||K[26]!==g||K[27]!==m?(y=(0,t.jsxs)("div",{className:ez.default.Group,children:[m,h,p,g]}),K[25]=p,K[26]=g,K[27]=m,K[28]=y):y=K[28],K[29]!==et?(v=e=>{et(e.target.checked)},K[29]=et,K[30]=v):v=K[30],K[31]!==ee||K[32]!==v?(x=(0,t.jsx)("input",{id:"fogInput",type:"checkbox",checked:ee,onChange:v}),K[31]=ee,K[32]=v,K[33]=x):x=K[33],K[34]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("label",{htmlFor:"fogInput",children:"Fog?"}),K[34]=b):b=K[34],K[35]!==x?(k=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[x,b]}),K[35]=x,K[36]=k):k=K[36],K[37]!==eo?(S=e=>{eo(e.target.checked)},K[37]=eo,K[38]=S):S=K[38],K[39]!==en||K[40]!==S?(C=(0,t.jsx)("input",{id:"audioInput",type:"checkbox",checked:en,onChange:S}),K[39]=en,K[40]=S,K[41]=C):C=K[41],K[42]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)("label",{htmlFor:"audioInput",children:"Audio?"}),K[42]=j):j=K[42],K[43]!==C?(w=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[C,j]}),K[43]=C,K[44]=w):w=K[44],K[45]!==k||K[46]!==w?(N=(0,t.jsxs)("div",{className:ez.default.Group,children:[k,w]}),K[45]=k,K[46]=w,K[47]=N):N=K[47],K[48]!==el?(I=e=>{el(e.target.checked)},K[48]=el,K[49]=I):I=K[49],K[50]!==es||K[51]!==I?(T=(0,t.jsx)("input",{id:"animationInput",type:"checkbox",checked:es,onChange:I}),K[50]=es,K[51]=I,K[52]=T):T=K[52],K[53]===Symbol.for("react.memo_cache_sentinel")?(P=(0,t.jsx)("label",{htmlFor:"animationInput",children:"Animation?"}),K[53]=P):P=K[53],K[54]!==T?(B=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[T,P]}),K[54]=T,K[55]=B):B=K[55],K[56]!==eh?(D=e=>{eh(e.target.checked)},K[56]=eh,K[57]=D):D=K[57],K[58]!==em||K[59]!==D?(L=(0,t.jsx)("input",{id:"debugInput",type:"checkbox",checked:em,onChange:D}),K[58]=em,K[59]=D,K[60]=L):L=K[60],K[61]===Symbol.for("react.memo_cache_sentinel")?(R=(0,t.jsx)("label",{htmlFor:"debugInput",children:"Debug?"}),K[61]=R):R=K[61],K[62]!==L?(M=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[L,R]}),K[62]=L,K[63]=M):M=K[63],K[64]!==B||K[65]!==M?(H=(0,t.jsxs)("div",{className:ez.default.Group,children:[B,M]}),K[64]=B,K[65]=M,K[66]=H):H=K[66],K[67]!==ea||K[68]!==eg||K[69]!==er?(F=eg?null:(0,t.jsxs)("div",{className:ez.default.Field,children:[(0,t.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),(0,t.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:ea,onChange:e=>er(parseInt(e.target.value))}),(0,t.jsx)("output",{htmlFor:"fovInput",children:ea})]}),K[67]=ea,K[68]=eg,K[69]=er,K[70]=F):F=K[70],K[71]!==eg||K[72]!==ec||K[73]!==ei?(G=eg?null:(0,t.jsxs)("div",{className:ez.default.Field,children:[(0,t.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),(0,t.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:ei,onChange:e=>ec(parseFloat(e.target.value))})]}),K[71]=eg,K[72]=ec,K[73]=ei,K[74]=G):G=K[74],K[75]!==F||K[76]!==G?(q=(0,t.jsxs)("div",{className:ez.default.Group,children:[F,G]}),K[75]=F,K[76]=G,K[77]=q):q=K[77],K[78]!==Q||K[79]!==ed||K[80]!==eu?(O=Q&&(0,t.jsx)("div",{className:ez.default.Group,children:(0,t.jsxs)("div",{className:ez.default.Field,children:[(0,t.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick:"})," ",(0,t.jsxs)("select",{id:"touchModeInput",value:eu,onChange:e=>ed(e.target.value),children:[(0,t.jsx)("option",{value:"dualStick",children:"Dual Stick"}),(0,t.jsx)("option",{value:"moveLookStick",children:"Single Stick"})]})]})}),K[78]=Q,K[79]=ed,K[80]=eu,K[81]=O):O=K[81],K[82]!==ey||K[83]!==y||K[84]!==N||K[85]!==H||K[86]!==q||K[87]!==O?(A=(0,t.jsxs)("div",{className:ez.default.Dropdown,ref:eb,id:"settingsPanel",tabIndex:-1,onKeyDown:ew,onBlur:eC,"data-open":ey,children:[y,N,H,q,O]}),K[82]=ey,K[83]=y,K[84]=N,K[85]=H,K[86]=q,K[87]=O,K[88]=A):A=K[88],K[89]!==A||K[90]!==d?(U=(0,t.jsxs)("div",{ref:eS,children:[d,A]}),K[89]=A,K[90]=d,K[91]=U):U=K[91],K[92]!==U||K[93]!==i?(W=(0,t.jsxs)("div",{id:"controls",className:ez.default.Controls,onKeyDown:eX,onPointerDown:eY,onClick:eV,children:[i,U]}),K[92]=U,K[93]=i,K[94]=W):W=K[94],W}function eJ(e){return!e}function eV(e){return e.stopPropagation()}function eY(e){return e.stopPropagation()}function eX(e){return e.stopPropagation()}function eQ(e){return null!=e.adapter}let eZ=()=>null;var e0=e.i(31067);let e1=r.forwardRef(({envMap:e,resolution:t=256,frames:a=1/0,makeDefault:n,children:s,...l},i)=>{let c=(0,$.useThree)(({set:e})=>e),u=(0,$.useThree)(({camera:e})=>e),d=(0,$.useThree)(({size:e})=>e),m=r.useRef(null);r.useImperativeHandle(i,()=>m.current,[]);let h=r.useRef(null),p=function(e,t,a){let n=(0,$.useThree)(e=>e.size),s=(0,$.useThree)(e=>e.viewport),l="number"==typeof e?e:n.width*s.dpr,i=n.height*s.dpr,c=("number"==typeof e?void 0:e)||{},{samples:u=0,depth:d,...m}=c,h=null!=d?d:c.depthBuffer,p=r.useMemo(()=>{let e=new o.WebGLRenderTarget(l,i,{minFilter:o.LinearFilter,magFilter:o.LinearFilter,type:o.HalfFloatType,...m});return h&&(e.depthTexture=new o.DepthTexture(l,i,o.FloatType)),e.samples=u,e},[]);return r.useLayoutEffect(()=>{p.setSize(l,i),u&&(p.samples=u)},[u,p,l,i]),r.useEffect(()=>()=>p.dispose(),[]),p}(t);r.useLayoutEffect(()=>{l.manual||(m.current.aspect=d.width/d.height)},[d,l]),r.useLayoutEffect(()=>{m.current.updateProjectionMatrix()});let f=0,_=null,g="function"==typeof s;return(0,z.useFrame)(t=>{g&&(a===1/0||f{if(n)return c(()=>({camera:m.current})),()=>c(()=>({camera:u}))},[m,n,c]),r.createElement(r.Fragment,null,r.createElement("perspectiveCamera",(0,e0.default)({ref:m},l),!g&&s),r.createElement("group",{ref:h},g&&s(p.texture)))});function e2(){let e,r,n=(0,a.c)(3),{fov:o}=(0,J.useSettings)();return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],n[0]=e):e=n[0],n[1]!==o?(r=(0,t.jsx)(e1,{makeDefault:!0,position:e,fov:o}),n[1]=o,n[2]=r):r=n[2],r}var e3=e.i(51434),e4=e.i(86855),e5=e.i(68294),e6=e.i(87297),e8=e.i(51475),e7=e.i(63318),e9=e.i(38437);function te(){let e,r=(0,a.c)(3),n=(0,y.useSceneSun)();if(!n){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("ambientLight",{color:"#888888",intensity:1}),r[0]=e):e=r[0],e}return r[1]!==n?(e=(0,t.jsx)(tt,{sunData:n}),r[1]=n,r[2]=e):e=r[2],e}function tt(e){let n,s,l,i,c,u,d,m,h,p,f=(0,a.c)(29),{sunData:_}=e;f[0]!==_.direction?(n=(0,e7.torqueToThree)(_.direction),f[0]=_.direction,f[1]=n):n=f[1];let[g,y,v]=n,x=Math.sqrt(g*g+y*y+v*v),b=g/x,k=y/x,S=v/x;f[2]!==b||f[3]!==k||f[4]!==S?(s=new o.Vector3(b,k,S),f[2]=b,f[3]=k,f[4]=S,f[5]=s):s=f[5];let C=s,j=-(5e3*C.x),w=-(5e3*C.y),N=-(5e3*C.z);f[6]!==j||f[7]!==w||f[8]!==N?(l=new o.Vector3(j,w,N),f[6]=j,f[7]=w,f[8]=N,f[9]=l):l=f[9];let I=l;f[10]!==_.color.b||f[11]!==_.color.g||f[12]!==_.color.r?(i=new o.Color(_.color.r,_.color.g,_.color.b),f[10]=_.color.b,f[11]=_.color.g,f[12]=_.color.r,f[13]=i):i=f[13];let T=i;f[14]!==_.ambient.b||f[15]!==_.ambient.g||f[16]!==_.ambient.r?(c=new o.Color(_.ambient.r,_.ambient.g,_.ambient.b),f[14]=_.ambient.b,f[15]=_.ambient.g,f[16]=_.ambient.r,f[17]=c):c=f[17];let P=c,B=C.y<0;return f[18]!==B?(u=()=>{(0,e9.updateGlobalSunUniforms)(B)},d=[B],f[18]=B,f[19]=u,f[20]=d):(u=f[19],d=f[20]),(0,r.useEffect)(u,d),f[21]!==T||f[22]!==I?(m=(0,t.jsx)("directionalLight",{position:I,color:T,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),f[21]=T,f[22]=I,f[23]=m):m=f[23],f[24]!==P?(h=(0,t.jsx)("ambientLight",{color:P,intensity:1}),f[24]=P,f[25]=h):h=f[25],f[26]!==m||f[27]!==h?(p=(0,t.jsxs)(t.Fragment,{children:[m,h]}),f[26]=m,f[27]=h,f[28]=p):p=f[28],p}var ta=e.i(75840);let tr=(0,i.textureToUrl)("gui/hud_new_compass"),tn=(0,i.textureToUrl)("gui/hud_new_NSEW");function to(e){let r,n,o=(0,a.c)(3),{yaw:s}=e;if(null==s)return null;let l=180*s/Math.PI;o[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("img",{src:tr,alt:"",className:ta.default.CompassRing}),o[0]=r):r=o[0];let i=`rotate(${-l}deg)`;return o[1]!==i?(n=(0,t.jsxs)("div",{className:ta.default.Compass,children:[r,(0,t.jsx)("img",{src:tn,alt:"",className:ta.default.CompassNSEW,style:{transform:i}})]}),o[1]=i,o[2]=n):n=o[2],n}function ts(e){let r,n=(0,a.c)(2),{value:o}=e,s=Math.max(0,Math.min(100,100*o)),l=`${s}%`;return n[0]!==l?(r=(0,t.jsx)("div",{className:ta.default.BarTrack,children:(0,t.jsx)("div",{className:ta.default.BarFillHealth,style:{width:l}})}),n[0]=l,n[1]=r):r=n[1],r}function tl(e){let r,n=(0,a.c)(2),{value:o}=e,s=Math.max(0,Math.min(100,100*o)),l=`${s}%`;return n[0]!==l?(r=(0,t.jsx)("div",{className:ta.default.BarTrack,children:(0,t.jsx)("div",{className:ta.default.BarFillEnergy,style:{width:l}})}),n[0]=l,n[1]=r):r=n[1],r}let ti={weapon_sniper:"gui/hud_ret_sniper",weapon_shocklance:"gui/hud_ret_shocklance",weapon_targeting:"gui/hud_ret_targlaser"};function tc(){let e,r=(0,a.c)(5),n=(0,g.useEngineSelector)(tu);if(void 0===n)return null;let o=ti[!n?"":n.replace(/\.dts$/i,"").toLowerCase()];if(o){let e,a;return r[0]!==o?(e=(0,i.textureToUrl)(o),r[0]=o,r[1]=e):e=r[1],r[2]!==e?(a=(0,t.jsx)("div",{className:ta.default.Reticle,children:(0,t.jsx)("img",{src:e,alt:"",className:ta.default.ReticleImage})}),r[2]=e,r[3]=a):a=r[3],a}return r[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:ta.default.Reticle,children:(0,t.jsx)("div",{className:ta.default.ReticleDot})}),r[4]=e):e=r[4],e}function tu(e){let t=e.playback.streamSnapshot;if(!t||t.camera?.mode!=="first-person")return;let a=t.controlPlayerGhostId;if(a)return t.entities.find(e=>e.id===a)?.weaponShape}let td={0:{icon:"gui/hud_blaster",label:"Blaster"},1:{icon:"gui/hud_plasma",label:"Plasma"},2:{icon:"gui/hud_chaingun",label:"Chaingun"},3:{icon:"gui/hud_disc",label:"Spinfusor"},4:{icon:"gui/hud_grenlaunch",label:"GL"},5:{icon:"gui/hud_sniper",label:"Laser Rifle"},6:{icon:"gui/hud_elfgun",label:"ELF Gun"},7:{icon:"gui/hud_new_mortar",label:"Mortar"},8:{icon:"gui/hud_missiles",label:"Missile"},9:{icon:"gui/hud_targetlaser",label:"Targeting"},10:{icon:"gui/hud_shocklance",label:"Shocklance"},11:{icon:"gui/hud_disc",label:"Spinfusor"},12:{icon:"gui/hud_grenlaunch",label:"GL"},13:{icon:"gui/hud_chaingun",label:"Chaingun"},14:{icon:"gui/hud_targetlaser",label:"Targeting"},15:{icon:"gui/hud_targetlaser",label:"Targeting"},16:{icon:"gui/hud_shocklance",label:"Shocklance"},17:{icon:"gui/hud_new_mortar",label:"Mortar"}},tm=new Map(Object.entries(td).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t.icon)])),th=new Set([9,14,15]),tp=(0,i.textureToUrl)("gui/hud_infinity");function tf(e){let r,n,o,s,l=(0,a.c)(12),{slot:i,isSelected:c}=e,u=td[i.index];if(!u)return null;let d=i.ammo<0,m=`${ta.default.PackInvItem} ${c?ta.default.PackInvItemActive:ta.default.PackInvItemDim}`;return l[0]!==i.index?(r=tm.get(i.index),l[0]=i.index,l[1]=r):r=l[1],l[2]!==u.label||l[3]!==r?(n=(0,t.jsx)("img",{src:r,alt:u.label,className:ta.default.PackInvIcon}),l[2]=u.label,l[3]=r,l[4]=n):n=l[4],l[5]!==d||l[6]!==i.ammo?(o=d?(0,t.jsx)("img",{src:tp,alt:"\\u221E",className:ta.default.PackInvInfinity}):(0,t.jsx)("span",{className:ta.default.PackInvCount,children:i.ammo}),l[5]=d,l[6]=i.ammo,l[7]=o):o=l[7],l[8]!==m||l[9]!==n||l[10]!==o?(s=(0,t.jsxs)("div",{className:m,children:[n,o]}),l[8]=m,l[9]=n,l[10]=o,l[11]=s):s=l[11],s}function t_(){let e,r,n,o,s,l,i=(0,a.c)(15),c=(0,g.useEngineSelector)(tg);if(!c||!c.slots.length)return null;if(i[0]!==c.slots){for(let t of(r=[],e=[],c.slots))th.has(t.index)?e.push(t):r.push(t);i[0]=c.slots,i[1]=e,i[2]=r}else e=i[1],r=i[2];return i[3]!==r||i[4]!==c?(n=r.map(e=>(0,t.jsx)(tf,{slot:e,isSelected:e.index===c.activeIndex},e.index)),i[3]=r,i[4]=c,i[5]=n):n=i[5],i[6]!==e.length?(o=e.length>0&&(0,t.jsx)("div",{className:ta.default.WeaponSeparator}),i[6]=e.length,i[7]=o):o=i[7],i[8]!==e||i[9]!==c?(s=e.map(e=>(0,t.jsx)(tf,{slot:e,isSelected:e.index===c.activeIndex},e.index)),i[8]=e,i[9]=c,i[10]=s):s=i[10],i[11]!==n||i[12]!==o||i[13]!==s?(l=(0,t.jsxs)("div",{className:ta.default.WeaponHUD,children:[n,o,s]}),i[11]=n,i[12]=o,i[13]=s,i[14]=l):l=i[14],l}function tg(e){return e.playback.streamSnapshot?.weaponsHud}let ty={1:"Storm",2:"Inferno",3:"Starwolf",4:"Diamond Sword",5:"Blood Eagle",6:"Phoenix"};function tv(){let e,r,n,o=(0,a.c)(11),s=(0,g.useEngineSelector)(tb),l=(0,g.useEngineSelector)(tx);if(!s?.length)return null;if(o[0]!==l||o[1]!==s){let a,n;o[4]!==l?(a=(e,t)=>{if(l){if(e.teamId===l)return -1;if(t.teamId===l)return 1}return e.teamId-t.teamId},o[4]=l,o[5]=a):a=o[5];let i=[...s].sort(a);e=ta.default.TeamScores,o[6]!==l?(n=e=>{let a=l>0&&e.teamId===l,r=e.name||(ty[e.teamId]??`Team ${e.teamId}`);return(0,t.jsxs)("div",{className:ta.default.TeamRow,children:[(0,t.jsx)("span",{className:a?ta.default.TeamNameFriendly:ta.default.TeamNameEnemy,children:r}),(0,t.jsx)("span",{className:ta.default.TeamScore,children:e.score}),(0,t.jsxs)("span",{className:ta.default.TeamCount,children:["(",e.playerCount,")"]})]},e.teamId)},o[6]=l,o[7]=n):n=o[7],r=i.map(n),o[0]=l,o[1]=s,o[2]=e,o[3]=r}else e=o[2],r=o[3];return o[8]!==e||o[9]!==r?(n=(0,t.jsx)("div",{className:e,children:r}),o[8]=e,o[9]=r,o[10]=n):n=o[10],n}function tx(e){return e.playback.streamSnapshot?.playerSensorGroup}function tb(e){return e.playback.streamSnapshot?.teamScores}let tk={0:ta.default.ChatColor0,1:ta.default.ChatColor1,2:ta.default.ChatColor2,3:ta.default.ChatColor3,4:ta.default.ChatColor4,5:ta.default.ChatColor5,6:ta.default.ChatColor6,7:ta.default.ChatColor7,8:ta.default.ChatColor8,9:ta.default.ChatColor9};function tS(e){let n,o,s,l,i,c,u=(0,a.c)(15),{isLive:d}=e,m=(0,g.useEngineSelector)(tI),h=(0,r.useRef)(null),p=(0,r.useRef)(0),[f,_]=(0,r.useState)(""),y=m?.length??0;u[0]!==y?(n=()=>{y>p.current&&h.current&&(h.current.scrollTop=h.current.scrollHeight),p.current=y},o=[y],u[0]=y,u[1]=n,u[2]=o):(n=u[1],o=u[2]),(0,r.useEffect)(n,o),u[3]!==f?(s=e=>{e.preventDefault();let t=f.trim();t&&(eF.liveConnectionStore.getState().sendCommand("messageSent",t),_(""))},u[3]=f,u[4]=s):s=u[4];let v=s,x=!!m?.length;return u[5]!==x||u[6]!==m?(l=x&&(0,t.jsx)("div",{ref:h,className:ta.default.ChatWindow,children:m.map(tw)}),u[5]=x,u[6]=m,u[7]=l):l=u[7],u[8]!==f||u[9]!==v||u[10]!==d?(i=d&&(0,t.jsx)("form",{className:ta.default.ChatInputForm,onSubmit:v,children:(0,t.jsx)("input",{className:ta.default.ChatInput,type:"text",placeholder:"Say something…",value:f,onChange:e=>_(e.target.value),onKeyDown:tj,onKeyUp:tC,maxLength:255})}),u[8]=f,u[9]=v,u[10]=d,u[11]=i):i=u[11],u[12]!==l||u[13]!==i?(c=(0,t.jsxs)("div",{className:ta.default.ChatContainer,children:[l,i]}),u[12]=l,u[13]=i,u[14]=c):c=u[14],c}function tC(e){return e.stopPropagation()}function tj(e){return e.stopPropagation()}function tw(e,a){return(0,t.jsx)("div",{className:ta.default.ChatMessage,children:e.segments?e.segments.map(tN):(0,t.jsxs)("span",{className:null!=e.colorCode&&tk[e.colorCode]?tk[e.colorCode]:tk[0],children:[e.sender?`${e.sender}: `:"",e.text]})},e.id)}function tN(e,a){return(0,t.jsx)("span",{className:tk[e.colorCode]??tk[0],children:e.text},a)}function tI(e){return e.playback.streamSnapshot?.chatMessages}let tT=new Map(Object.entries({0:"gui/hud_new_packammo",1:"gui/hud_new_packcloak",2:"gui/hud_new_packenergy",3:"gui/hud_new_packrepair",4:"gui/hud_new_packsatchel",5:"gui/hud_new_packshield",6:"gui/hud_new_packinventory",7:"gui/hud_new_packmotionsens",8:"gui/hud_new_packradar",9:"gui/hud_new_packturretout",10:"gui/hud_new_packturretin",11:"gui/hud_new_packsensjam",12:"gui/hud_new_packturret",13:"gui/hud_new_packturret",14:"gui/hud_new_packturret",15:"gui/hud_new_packturret",16:"gui/hud_new_packturret",17:"gui/hud_new_packturret",18:"gui/hud_satchel_unarmed",19:"gui/hud_new_packenergy"}).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t)])),tP=new Map(Object.entries({1:"gui/hud_new_packcloak_armed",3:"gui/hud_new_packrepair_armed",4:"gui/hud_satchel_armed",5:"gui/hud_new_packshield_armed",11:"gui/hud_new_packsensjam_armed"}).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t)])),tB={0:{icon:"gui/hud_handgren",label:"Grenade"},1:{icon:"gui/hud_mine",label:"Mine"},2:{icon:"gui/hud_beacon",label:"Beacon"},3:{icon:"gui/hud_medpack",label:"Repair Kit"}},tD=new Map(Object.entries(tB).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t.icon)]));function tE(){let e,r,n,o,s,l,i,c=(0,a.c)(25),u=(0,g.useEngineSelector)(tM),d=(0,g.useEngineSelector)(tR),m=u&&u.packIndex>=0;if(m){let t,a;c[0]!==u.active||c[1]!==u.packIndex?(t=u.active?tP.get(u.packIndex):void 0,c[0]=u.active,c[1]=u.packIndex,c[2]=t):t=c[2];let r=t;c[3]!==r||c[4]!==u.packIndex?(a=r??tT.get(u.packIndex),c[3]=r,c[4]=u.packIndex,c[5]=a):a=c[5],e=a}if(c[6]!==d){if(r=new Map,d)for(let e of d.slots)r.set(e.slot,e.count);c[6]=d,c[7]=r}else r=c[7];if(c[8]!==u||c[9]!==r||c[10]!==m||c[11]!==e){l=Symbol.for("react.early_return_sentinel");e:{let a,i=Object.keys(tB).map(Number).sort(tL);if(!m&&!r.size){l=null;break e}n=ta.default.PackInventoryHUD,c[16]!==u||c[17]!==e?(o=e&&(0,t.jsxs)("div",{className:`${ta.default.PackInvItem} ${u.active?ta.default.PackInvItemActive:""}`,children:[(0,t.jsx)("img",{src:e,alt:"",className:ta.default.PackInvIcon}),(0,t.jsx)("span",{className:ta.default.PackInvCount,children:u.text||" "})]}),c[16]=u,c[17]=e,c[18]=o):o=c[18],c[19]!==r?(a=e=>{let a=tB[e],n=tD.get(e);return a&&n?(0,t.jsxs)("div",{className:ta.default.PackInvItem,children:[(0,t.jsx)("img",{src:n,alt:a.label,className:ta.default.PackInvIcon}),(0,t.jsx)("span",{className:ta.default.PackInvCount,children:r.get(e)??0})]},e):null},c[19]=r,c[20]=a):a=c[20],s=i.map(a)}c[8]=u,c[9]=r,c[10]=m,c[11]=e,c[12]=n,c[13]=o,c[14]=s,c[15]=l}else n=c[12],o=c[13],s=c[14],l=c[15];return l!==Symbol.for("react.early_return_sentinel")?l:(c[21]!==n||c[22]!==o||c[23]!==s?(i=(0,t.jsxs)("div",{className:n,children:[o,s]}),c[21]=n,c[22]=o,c[23]=s,c[24]=i):i=c[24],i)}function tL(e,t){return e-t}function tR(e){return e.playback.streamSnapshot?.inventoryHud}function tM(e){return e.playback.streamSnapshot?.backpackHud}function tH(e){let r,n,o,s,l=(0,a.c)(10);l[0]!==e?(r=void 0===e?{}:e,l[0]=e,l[1]=r):r=l[1];let{isLive:i}=r,c=void 0!==i&&i,u=(0,E.useRecording)(),d=(0,g.useEngineSelector)(tF);if(!u&&!c)return null;let m=d?.status;return l[2]!==c?(n=(0,t.jsx)(tS,{isLive:c}),l[2]=c,l[3]=n):n=l[3],l[4]!==m||l[5]!==d?.camera?.yaw?(o=m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:ta.default.TopRight,children:[(0,t.jsxs)("div",{className:ta.default.Bars,children:[(0,t.jsx)(ts,{value:m.health}),(0,t.jsx)(tl,{value:m.energy})]}),(0,t.jsx)(to,{yaw:d?.camera?.yaw})]}),(0,t.jsx)(t_,{}),(0,t.jsx)(tE,{}),(0,t.jsx)(tv,{}),(0,t.jsx)(tc,{})]}),l[4]=m,l[5]=d?.camera?.yaw,l[6]=o):o=l[6],l[7]!==n||l[8]!==o?(s=(0,t.jsxs)("div",{className:ta.default.PlayerHUD,children:[n,o]}),l[7]=n,l[8]=o,l[9]=s):s=l[9],s}function tF(e){return e.playback.streamSnapshot}function tG(e){let t,n=(0,a.c)(1),{children:o}=e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],n[0]=t):t=n[0],(0,r.useEffect)(tq,t),o}function tq(){return tO}function tO(){return(0,eF.disposeLiveConnection)()}var tA=e.i(56614);function tU({open:e,onClose:a,servers:n,loading:o,onRefresh:s,onJoin:l,wsPing:i,warriorName:c,onWarriorNameChange:u}){let[d,m]=(0,r.useState)(null),[h,p]=(0,r.useState)("ping"),[f,_]=(0,r.useState)("asc"),g=(0,r.useRef)(null),y=(0,r.useRef)(s);y.current=s;let v=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(e){g.current?.focus();try{document.exitPointerLock()}catch{}}else v.current=!1},[e]),(0,r.useEffect)(()=>{e&&0===n.length&&!v.current&&(v.current=!0,y.current())},[e]),(0,r.useEffect)(()=>{if(!e)return;let t=e=>{e.stopPropagation(),"Escape"===e.key&&a()};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,a]);let x=(0,r.useCallback)(e=>{h===e?_(e=>"asc"===e?"desc":"asc"):(p(e),_("desc"))},[h]),b=(0,r.useMemo)(()=>[...n].sort((e,t)=>{let a=e[h],r=t[h],n="number"==typeof a&&"number"==typeof r?a-r:String(a).localeCompare(String(r));return"asc"===f?n:-n}),[n,f,h]),k=(0,r.useCallback)(()=>{d&&(l(d),a())},[d,l,a]);return e?(0,t.jsx)("div",{className:tA.default.Overlay,onClick:a,children:(0,t.jsxs)("div",{className:tA.default.Dialog,ref:g,tabIndex:-1,onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:tA.default.Header,children:[(0,t.jsx)("h2",{className:tA.default.Title,children:"Server Browser"}),(0,t.jsxs)("span",{className:tA.default.ServerCount,children:[n.length," server",1!==n.length?"s":""]}),(0,t.jsx)("button",{className:tA.default.RefreshButton,onClick:s,disabled:o,children:o?"Refreshing...":"Refresh"})]}),(0,t.jsx)("div",{className:tA.default.TableWrapper,children:(0,t.jsxs)("table",{className:tA.default.Table,children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{onClick:()=>x("name"),children:"Server Name"}),(0,t.jsx)("th",{onClick:()=>x("playerCount"),children:"Players"}),(0,t.jsx)("th",{onClick:()=>x("ping"),children:"Ping"}),(0,t.jsx)("th",{onClick:()=>x("mapName"),children:"Map"}),(0,t.jsx)("th",{onClick:()=>x("gameType"),children:"Type"}),(0,t.jsx)("th",{onClick:()=>x("mod"),children:"Mod"})]})}),(0,t.jsxs)("tbody",{children:[b.map(e=>(0,t.jsxs)("tr",{className:d===e.address?tA.default.Selected:void 0,onClick:()=>m(e.address),onDoubleClick:()=>{m(e.address),l(e.address),a()},children:[(0,t.jsxs)("td",{children:[e.passwordRequired&&(0,t.jsx)("span",{className:tA.default.PasswordIcon,children:"🔒"}),e.name]}),(0,t.jsxs)("td",{children:[e.playerCount,"/",e.maxPlayers]}),(0,t.jsx)("td",{children:null!=i?(e.ping+i).toLocaleString():"—"}),(0,t.jsx)("td",{children:e.mapName}),(0,t.jsx)("td",{children:e.gameType}),(0,t.jsx)("td",{children:e.mod})]},e.address)),0===b.length&&!o&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:6,className:tA.default.Empty,children:"No servers found"})}),o&&0===b.length&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:6,className:tA.default.Empty,children:"Querying master server..."})})]})]})}),(0,t.jsxs)("div",{className:tA.default.Footer,children:[(0,t.jsxs)("div",{className:tA.default.WarriorField,children:[(0,t.jsx)("label",{className:tA.default.WarriorLabel,htmlFor:"warriorName",children:"Warrior"}),(0,t.jsx)("input",{id:"warriorName",className:tA.default.WarriorInput,type:"text",value:c,onChange:e=>u(e.target.value),placeholder:"Name thyself…",maxLength:24})]}),(0,t.jsx)("span",{className:tA.default.Hint,children:"Double-click a server to join"}),(0,t.jsx)("button",{onClick:a,className:tA.default.CloseButton,children:"Cancel"}),(0,t.jsx)("button",{onClick:k,disabled:!d,className:tA.default.JoinButton,children:"Join"})]})]})}):null}var tW=e.i(38847);let tK=(0,r.createContext)({live:!1});function tz(e){let n,o,s=(0,a.c)(5),{children:l}=e,[i]=(0,tW.useQueryState)("features",tW.parseAsString);s[0]!==i?(n=()=>({live:new Set((i??"").split(",").map(t$).filter(Boolean)).has("live")}),s[0]=i,s[1]=n):n=s[1];let[c]=(0,r.useState)(n);return s[2]!==l||s[3]!==c?(o=(0,t.jsx)(tK.Provider,{value:c,children:l}),s[2]=l,s[3]=c,s[4]=o):o=s[4],o}function t$(e){return e.trim().toLowerCase()}var tJ=e.i(3011);let tV=(0,r.lazy)(()=>e.A(67521).then(e=>({default:e.StreamPlayback}))),tY=(0,r.lazy)(()=>e.A(93884).then(e=>({default:e.DemoPlaybackControls}))),tX=(0,r.lazy)(()=>e.A(96145).then(e=>({default:e.LiveObserver}))),tQ=(0,r.lazy)(()=>e.A(38496).then(e=>({default:e.ChatSoundPlayer}))),tZ=(0,r.lazy)(()=>e.A(59197).then(e=>({default:e.MapInfoDialog}))),t0=new T.QueryClient,t1={toneMapping:o.NoToneMapping,outputColorSpace:o.SRGBColorSpace},t2=(0,tW.createParser)({parse(e){let[t,a]=e.split("~"),r=a,n=(0,f.getMissionInfo)(t).missionTypes;return a&&n.includes(a)||(r=n[0]),{missionName:t,missionType:r}},serialize:({missionName:e,missionType:t})=>1===(0,f.getMissionInfo)(e).missionTypes.length?e:`${e}~${t}`,eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});function t3(){let e,s,l,i,c,u,d,m,h,p,_,g,y,v,x,b,k,S,C,j,w,N,I,T,L,M,H,F,G,q,O,A,U,W,K,z,$,V,Y,X,Z,ee,et,ea=(0,a.c)(77),[er,en]=(0,tW.useQueryState)("mission",t2),[eo,es]=(0,tW.useQueryState)("fog",tW.parseAsBoolean);ea[0]!==es?(e=()=>{es(null)},ea[0]=es,ea[1]=e):e=ea[1];let el=e;ea[2]!==el||ea[3]!==en?(s=e=>{window.location.hash="",el(),en(e)},ea[2]=el,ea[3]=en,ea[4]=s):s=ea[4];let ei=s,ec=(X=(0,a.c)(2),Z=(0,r.useRef)(null),X[0]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{let t=window.matchMedia("(pointer: coarse)");return t.addEventListener("change",e),Z.current=t,()=>{t.removeEventListener("change",e)}},X[0]=V):V=X[0],ee=V,X[1]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>Z.current?.matches??null,X[1]=Y):Y=X[1],et=Y,(0,r.useSyncExternalStore)(ee,et,eZ)),eu=(0,r.useContext)(tK),ed=(0,eF.useLiveSelector)(t8),em=(0,eF.useLiveSelector)(t6),eh=(0,eF.useLiveSelector)(t5),{missionName:ep,missionType:ef}=er,[e_,eg]=(0,r.useState)(!1),[ey,ev]=(0,r.useState)(!1),[ex,eb]=(0,r.useState)(0),[ek,eS]=(0,r.useState)(!0),eC=ed?em?1:"connected"===eh?.8:"authenticating"===eh?.6:"challenging"===eh?.3:"connecting"===eh?.2:.1:null;ea[5]!==eC?(l=()=>{null!=eC&&eb(0)},ea[5]=eC,ea[6]=l):l=ea[6];let ej=null!=eC;ea[7]!==ej?(i=[ej],ea[7]=ej,ea[8]=i):i=ea[8],(0,r.useEffect)(l,i);let ew=eC??ex,eN=ew<1;ea[9]!==eN?(c=()=>{if(eN)eS(!0);else{let e=setTimeout(()=>eS(!1),500);return()=>clearTimeout(e)}},u=[eN],ea[9]=eN,ea[10]=c,ea[11]=u):(c=ea[10],u=ea[11]),(0,r.useEffect)(c,u),ea[12]!==ei?(d=()=>(window.setMissionName=e=>{let t=(0,f.getMissionInfo)(e).missionTypes;ei({missionName:e,missionType:t[0]})},window.getMissionList=f.getMissionList,window.getMissionInfo=f.getMissionInfo,t4),m=[ei],ea[12]=ei,ea[13]=d,ea[14]=m):(d=ea[13],m=ea[14]),(0,r.useEffect)(d,m),ea[15]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{let e=e=>{if("KeyI"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||eg(!0)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},h=[],ea[15]=h,ea[16]=p):(h=ea[15],p=ea[16]),(0,r.useEffect)(p,h),ea[17]===Symbol.for("react.memo_cache_sentinel")?(_=(e,t)=>{eb(void 0===t?0:t)},ea[17]=_):_=ea[17];let eI=_,eT=(0,r.useRef)(null);ea[18]===Symbol.for("react.memo_cache_sentinel")?(g={angle:0,force:0},ea[18]=g):g=ea[18];let eP=(0,r.useRef)(g),eB=(0,r.useRef)(null);ea[19]===Symbol.for("react.memo_cache_sentinel")?(y={angle:0,force:0},ea[19]=y):y=ea[19];let eD=(0,r.useRef)(y),eE=(0,r.useRef)(null);return ea[20]!==eN||ea[21]!==ew||ea[22]!==ek?(v=ek&&(0,t.jsxs)("div",{id:"loadingIndicator",className:tJ.default.LoadingIndicator,"data-complete":!eN,children:[(0,t.jsx)("div",{className:tJ.default.Spinner}),(0,t.jsx)("div",{className:tJ.default.Progress,children:(0,t.jsx)("div",{className:tJ.default.ProgressBar,style:{width:`${100*ew}%`}})}),(0,t.jsxs)("div",{className:tJ.default.ProgressText,children:[Math.round(100*ew),"%"]})]}),ea[20]=eN,ea[21]=ew,ea[22]=ek,ea[23]=v):v=ea[23],ea[24]===Symbol.for("react.memo_cache_sentinel")?(x={type:o.PCFShadowMap},b=e=>{eT.current=e.camera},ea[24]=x,ea[25]=b):(x=ea[24],b=ea[25]),ea[26]!==ep||ea[27]!==ef?(k=(0,t.jsx)(t7,{missionName:ep,missionType:ef,onLoadingChange:eI}),ea[26]=ep,ea[27]=ef,ea[28]=k):k=ea[28],ea[29]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(te,{}),ea[29]=S):S=ea[29],ea[30]!==ef?(C=(0,t.jsx)(e6.EntityScene,{missionType:ef}),ea[30]=ef,ea[31]=C):C=ea[31],ea[32]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)(e2,{}),w=(0,t.jsx)(e4.DebugElements,{}),ea[32]=j,ea[33]=w):(j=ea[32],w=ea[33]),ea[34]!==ec?(N=(0,t.jsx)(ae,{isTouch:ec,joystickStateRef:eP,joystickZoneRef:eB,lookJoystickStateRef:eD,lookJoystickZoneRef:eE}),ea[34]=ec,ea[35]=N):N=ea[35],ea[36]!==k||ea[37]!==C||ea[38]!==N?(I=(0,t.jsx)(n.Canvas,{frameloop:"always",gl:t1,shadows:x,onCreated:b,children:(0,t.jsx)(e8.TickProvider,{children:(0,t.jsx)(e5.CamerasProvider,{children:(0,t.jsxs)(e3.AudioProvider,{children:[k,S,C,j,w,N]})})})}),ea[36]=k,ea[37]=C,ea[38]=N,ea[39]=I):I=ea[39],ea[40]!==v||ea[41]!==I?(T=(0,t.jsxs)("div",{id:"canvasContainer",className:tJ.default.CanvasContainer,children:[v,I]}),ea[40]=v,ea[41]=I,ea[42]=T):T=ea[42],ea[43]===Symbol.for("react.memo_cache_sentinel")?(L=(0,t.jsx)(aa,{}),ea[43]=L):L=ea[43],ea[44]!==ec?(M=ec&&(0,t.jsx)(Q,{joystickState:eP,joystickZone:eB,lookJoystickState:eD,lookJoystickZone:eE}),ea[44]=ec,ea[45]=M):M=ea[45],ea[46]!==ec?(H=!1===ec&&(0,t.jsx)(R,{}),ea[46]=ec,ea[47]=H):H=ea[47],ea[48]===Symbol.for("react.memo_cache_sentinel")?(F=()=>eg(!0),ea[48]=F):F=ea[48],ea[49]!==eu.live?(G=eu.live?()=>ev(!0):void 0,ea[49]=eu.live,ea[50]=G):G=ea[50],ea[51]!==ei||ea[52]!==ec||ea[53]!==ep||ea[54]!==ef||ea[55]!==G?(q=(0,t.jsx)(e$,{missionName:ep,missionType:ef,onChangeMission:ei,onOpenMapInfo:F,onOpenServerBrowser:G,cameraRef:eT,isTouch:ec}),ea[51]=ei,ea[52]=ec,ea[53]=ep,ea[54]=ef,ea[55]=G,ea[56]=q):q=ea[56],ea[57]!==e_||ea[58]!==ep||ea[59]!==ef?(O=e_&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tZ,{open:e_,onClose:()=>eg(!1),missionName:ep,missionType:ef??""})}),ea[57]=e_,ea[58]=ep,ea[59]=ef,ea[60]=O):O=ea[60],ea[61]===Symbol.for("react.memo_cache_sentinel")?(A=()=>ev(!1),ea[61]=A):A=ea[61],ea[62]!==ey?(U=(0,t.jsx)(as,{open:ey,onClose:A}),ea[62]=ey,ea[63]=U):U=ea[63],ea[64]===Symbol.for("react.memo_cache_sentinel")?(W=(0,t.jsx)(an,{}),K=(0,t.jsx)(am,{}),ea[64]=W,ea[65]=K):(W=ea[64],K=ea[65]),ea[66]!==T||ea[67]!==M||ea[68]!==H||ea[69]!==q||ea[70]!==O||ea[71]!==U?(z=(0,t.jsxs)(D.KeyboardControls,{map:B.KEYBOARD_CONTROLS,children:[T,L,M,H,q,O,U,W,K]}),ea[66]=T,ea[67]=M,ea[68]=H,ea[69]=q,ea[70]=O,ea[71]=U,ea[72]=z):z=ea[72],ea[73]!==el||ea[74]!==eo||ea[75]!==z?($=(0,t.jsx)(P.QueryClientProvider,{client:t0,children:(0,t.jsx)("main",{children:(0,t.jsx)(E.RecordingProvider,{children:(0,t.jsx)(J.SettingsProvider,{fogEnabledOverride:eo,onClearFogEnabledOverride:el,children:z})})})}),ea[73]=el,ea[74]=eo,ea[75]=z,ea[76]=$):$=ea[76],$}function t4(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}function t5(e){return e.gameStatus}function t6(e){return e.liveReady}function t8(e){return null!=e.adapter}function t7(e){let r,n=(0,a.c)(5),{missionName:o,missionType:s,onLoadingChange:l}=e,i=(0,E.useRecording)(),c=(0,eF.useLiveSelector)(t9);if(null!=i||c)return null;let u=`${o}~${s}`;return n[0]!==o||n[1]!==s||n[2]!==l||n[3]!==u?(r=(0,t.jsx)(I,{name:o,missionType:s,onLoadingChange:l},u),n[0]=o,n[1]=s,n[2]=l,n[3]=u,n[4]=r):r=n[4],r}function t9(e){return null!=e.adapter}function ae(e){let n,o,s,l,i,c=(0,a.c)(18),{isTouch:u,joystickStateRef:d,joystickZoneRef:m,lookJoystickStateRef:h,lookJoystickZoneRef:p}=e,f=(0,E.useRecording)(),_=(0,eF.useLiveSelector)(at),g=null!=f||_,y=!g||_;return c[0]!==f?(n=f&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tV,{})}),c[0]=f,c[1]=n):n=c[1],c[2]!==_?(o=_&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tX,{})}),c[2]=_,c[3]=o):o=c[3],c[4]!==g?(s=g&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tQ,{})}),c[4]=g,c[5]=s):s=c[5],c[6]!==u||c[7]!==d||c[8]!==m||c[9]!==h||c[10]!==p||c[11]!==y?(l=y&&null!==u&&(u?(0,t.jsx)(Z,{joystickState:d,joystickZone:m,lookJoystickState:h,lookJoystickZone:p}):(0,t.jsx)(B.ObserverControls,{})),c[6]=u,c[7]=d,c[8]=m,c[9]=h,c[10]=p,c[11]=y,c[12]=l):l=c[12],c[13]!==n||c[14]!==o||c[15]!==s||c[16]!==l?(i=(0,t.jsxs)(t.Fragment,{children:[n,o,s,l]}),c[13]=n,c[14]=o,c[15]=s,c[16]=l,c[17]=i):i=c[17],i}function at(e){return null!=e.adapter}function aa(){let e,r=(0,a.c)(2),n=(0,E.useRecording)(),o=(0,eF.useLiveSelector)(ar);return n||o?(r[0]!==o?(e=(0,t.jsx)(tH,{isLive:o}),r[0]=o,r[1]=e):e=r[1],e):null}function ar(e){return null!=e.adapter}function an(){let e,n=(0,a.c)(1),o=(0,E.useRecording)(),s=(0,eF.useLiveSelector)(ao);return!o||s?null:(n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tY,{})}),n[0]=e):e=n[0],e)}function ao(e){return null!=e.adapter}function as(e){let r,n,o,s=(0,a.c)(15),{open:l,onClose:i}=e,c=(0,eF.useLiveSelector)(ad),u=(0,eF.useLiveSelector)(au),d=(0,eF.useLiveSelector)(ac),m=(0,eF.useLiveSelector)(ai),h=(0,eF.useLiveSelector)(al),p=(0,J.useSettings)();s[0]!==h||s[1]!==p?.warriorName?(r=e=>{h(e,p?.warriorName)},s[0]=h,s[1]=p?.warriorName,s[2]=r):r=s[2],p?.warriorName;let f=r,_=p?.warriorName??"";return s[3]!==p?(n=e=>p?.setWarriorName(e),s[3]=p,s[4]=n):n=s[4],s[5]!==d||s[6]!==f||s[7]!==m||s[8]!==i||s[9]!==l||s[10]!==c||s[11]!==u||s[12]!==_||s[13]!==n?(o=(0,t.jsx)(tU,{open:l,onClose:i,servers:c,loading:u,onRefresh:m,onJoin:f,wsPing:d,warriorName:_,onWarriorNameChange:n}),s[5]=d,s[6]=f,s[7]=m,s[8]=i,s[9]=l,s[10]=c,s[11]=u,s[12]=_,s[13]=n,s[14]=o):o=s[14],o}function al(e){return e.joinServer}function ai(e){return e.listServers}function ac(e){return e.browserToRelayPing}function au(e){return e.serversLoading}function ad(e){return e.servers}function am(){let e,t,n=(0,a.c)(3),{setRecording:o}=(0,E.usePlaybackActions)();return n[0]!==o?(e=()=>(window.loadDemoRecording=o,ah),t=[o],n[0]=o,n[1]=e,n[2]=t):(e=n[1],t=n[2]),(0,r.useEffect)(e,t),null}function ah(){delete window.loadDemoRecording}function ap(){let e,n=(0,a.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(tz,{children:(0,t.jsx)(tG,{children:(0,t.jsx)(t3,{})})})}),n[0]=e):e=n[0],e}e.s(["default",()=>ap],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/543f866d9a9c134b.css b/docs/_next/static/chunks/543f866d9a9c134b.css new file mode 100644 index 00000000..14199904 --- /dev/null +++ b/docs/_next/static/chunks/543f866d9a9c134b.css @@ -0,0 +1 @@ +.ChatInput-module__mZgxEG__InputForm{display:flex}.ChatInput-module__mZgxEG__Input{color:#28e7f0;background:#00323ccc;border:0;border-top:1px solid #4eb3a733;border-radius:0;outline:none;width:100%;margin:0;padding:6px;font-family:inherit;font-size:12px;line-height:1.25}.ChatInput-module__mZgxEG__Input::placeholder{color:#2cacb580}.ChatInput-module__mZgxEG__Input:focus{background:#00323ce6} diff --git a/docs/_next/static/chunks/576b06837c0cb7a0.js b/docs/_next/static/chunks/576b06837c0cb7a0.js deleted file mode 100644 index 45ff4eb4..00000000 --- a/docs/_next/static/chunks/576b06837c0cb7a0.js +++ /dev/null @@ -1,17 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53487,(e,t,r)=>{"use strict";let n="[^\\\\/]",s="[^/]",i="(?:\\/|$)",o="(?:^|\\/)",a=`\\.{1,2}${i}`,l=`(?!${o}${a})`,u=`(?!\\.{0,1}${i})`,c=`(?!${a})`,p=`${s}*?`,f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:"(?!\\.)",NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:o,SEP:"/"},h={...f,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:f}},19241,(e,t,r)=>{"use strict";var n=e.i(47167);let{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=e.r(53487);r.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r.hasRegexChars=e=>o.test(e),r.isRegexChar=e=>1===e.length&&r.hasRegexChars(e),r.escapeRegex=e=>e.replace(a,"\\$1"),r.toPosixSlashes=e=>e.replace(s,"/"),r.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==n.default&&!!n.default.platform&&"win32"===n.default.platform},r.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),r.escapeLast=(e,t,n)=>{let s=e.lastIndexOf(t,n);return -1===s?e:"\\"===e[s-1]?r.escapeLast(e,t,s-1):`${e.slice(0,s)}\\${e.slice(s)}`},r.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},r.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},r.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return""===n?r[r.length-2]:n}},26094,(e,t,r)=>{"use strict";let n=e.r(19241),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:$}=e.r(53487),y=e=>e===c||e===o,x=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let r,A,C=t||{},S=e.length-1,v=!0===C.parts||!0===C.scanToEnd,w=[],E=[],_=[],k=e,R=-1,L=0,N=0,O=!1,I=!1,j=!1,T=!1,M=!1,B=!1,P=!1,H=!1,D=!1,F=!1,G=0,U={value:"",depth:0,isGlob:!1},q=()=>R>=S,J=()=>k.charCodeAt(R+1),K=()=>(r=A,k.charCodeAt(++R));for(;R0&&(z=k.slice(0,L),k=k.slice(L),N-=L),W&&!0===j&&N>0?(W=k.slice(0,N),V=k.slice(N)):!0===j?(W="",V=k):W=k,W&&""!==W&&"/"!==W&&W!==k&&y(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===C.unescape&&(V&&(V=n.removeBackslashes(V)),W&&!0===P&&(W=n.removeBackslashes(W)));let Z={prefix:z,input:e,start:L,base:W,glob:V,isBrace:O,isBracket:I,isGlob:j,isExtglob:T,isGlobstar:M,negated:H,negatedExtglob:D};if(!0===C.tokens&&(Z.maxDepth=0,y(A)||E.push(U),Z.tokens=E),!0===C.parts||!0===C.tokens){let t;for(let r=0;r{"use strict";let n=e.r(53487),s=e.r(19241),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>s.escapeRegex(e)).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,f=(e,t)=>{let r;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let h={...t},d="number"==typeof h.maxLength?Math.min(i,h.maxLength):i,g=e.length;if(g>d)throw SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);let m={type:"bos",value:"",output:h.prepend||""},b=[m],$=h.capture?"":"?:",y=n.globChars(h.windows),x=n.extglobChars(y),{DOT_LITERAL:A,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:w,NO_DOT:E,NO_DOT_SLASH:_,NO_DOTS_SLASH:k,QMARK:R,QMARK_NO_DOT:L,STAR:N,START_ANCHOR:O}=y,I=e=>`(${$}(?:(?!${O}${e.dot?w:A}).)*?)`,j=h.dot?"":E,T=h.dot?R:L,M=!0===h.bash?I(h):N;h.capture&&(M=`(${M})`),"boolean"==typeof h.noext&&(h.noextglob=h.noext);let B={input:e,index:-1,start:0,dot:!0===h.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};g=(e=s.removePrefix(e,B)).length;let P=[],H=[],D=[],F=m,G=()=>B.index===g-1,U=B.peek=(t=1)=>e[B.index+t],q=B.advance=()=>e[++B.index]||"",J=()=>e.slice(B.index+1),K=(e="",t=0)=>{B.consumed+=e,B.index+=t},W=e=>{B.output+=null!=e.output?e.output:e.value,K(e.value)},z=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},V=e=>{B[e]++,D.push(e)},Z=e=>{B[e]--,D.pop()},Q=e=>{if("globstar"===F.type){let t=B.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||P.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(B.output=B.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=M,B.output+=F.output)}if(P.length&&"paren"!==e.type&&(P[P.length-1].inner+=e.value),(e.value||e.output)&&W(e),F&&"text"===F.type&&"text"===e.type){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,b.push(e),F=e},X=(e,t)=>{let r={...x[t],conditions:1,inner:""};r.prev=F,r.parens=B.parens,r.output=B.output;let n=(h.capture?"(":"")+r.open;V("parens"),Q({type:e,value:t,output:B.output?"":v}),Q({type:"paren",extglob:!0,value:q(),output:n}),P.push(r)},Y=e=>{let n,s=e.close+(h.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=I(h)),(r!==M||G()||/^\)+$/.test(J()))&&(s=e.close=`)$))${r}`),e.inner.includes("*")&&(n=J())&&/^\.[^\\/.]+$/.test(n)){let i=f(n,{...t,fastpaths:!1}).output;s=e.close=`)${i})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:r,output:s}),Z("parens")};if(!1!==h.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,n=e.replace(l,(e,t,n,s,i,o)=>"\\"===s?(r=!0,e):"?"===s?t?t+s+(i?R.repeat(i.length):""):0===o?T+(i?R.repeat(i.length):""):R.repeat(n.length):"."===s?A.repeat(n.length):"*"===s?t?t+s+(i?M:""):M:t?e:`\\${e}`);return(!0===r&&(n=!0===h.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===e&&!0===h.contains)?B.output=e:B.output=s.wrapOutput(n,B,t),B}for(;!G();){if("\0"===(r=q()))continue;if("\\"===r){let e=U();if("/"===e&&!0!==h.bash||"."===e||";"===e)continue;if(!e){Q({type:"text",value:r+="\\"});continue}let t=/^\\+/.exec(J()),n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(r+="\\")),!0===h.unescape?r=q():r+=q(),0===B.brackets){Q({type:"text",value:r});continue}}if(B.brackets>0&&("]"!==r||"["===F.value||"[^"===F.value)){if(!1!==h.posix&&":"===r){let e=F.value.slice(1);if(e.includes("[")&&(F.posix=!0,e.includes(":"))){let e=F.value.lastIndexOf("["),t=F.value.slice(0,e),r=o[F.value.slice(e+2)];if(r){F.value=t+r,B.backtrack=!0,q(),m.output||1!==b.indexOf(F)||(m.output=v);continue}}}("["===r&&":"!==U()||"-"===r&&"]"===U())&&(r=`\\${r}`),"]"===r&&("["===F.value||"[^"===F.value)&&(r=`\\${r}`),!0===h.posix&&"!"===r&&"["===F.value&&(r="^"),F.value+=r,W({value:r});continue}if(1===B.quotes&&'"'!==r){r=s.escapeRegex(r),F.value+=r,W({value:r});continue}if('"'===r){B.quotes=+(1!==B.quotes),!0===h.keepQuotes&&Q({type:"text",value:r});continue}if("("===r){V("parens"),Q({type:"paren",value:r});continue}if(")"===r){if(0===B.parens&&!0===h.strictBrackets)throw SyntaxError(p("opening","("));let e=P[P.length-1];if(e&&B.parens===e.parens+1){Y(P.pop());continue}Q({type:"paren",value:r,output:B.parens?")":"\\)"}),Z("parens");continue}if("["===r){if(!0!==h.nobracket&&J().includes("]"))V("brackets");else{if(!0!==h.nobracket&&!0===h.strictBrackets)throw SyntaxError(p("closing","]"));r=`\\${r}`}Q({type:"bracket",value:r});continue}if("]"===r){if(!0===h.nobracket||F&&"bracket"===F.type&&1===F.value.length){Q({type:"text",value:r,output:`\\${r}`});continue}if(0===B.brackets){if(!0===h.strictBrackets)throw SyntaxError(p("opening","["));Q({type:"text",value:r,output:`\\${r}`});continue}Z("brackets");let e=F.value.slice(1);if(!0===F.posix||"^"!==e[0]||e.includes("/")||(r=`/${r}`),F.value+=r,W({value:r}),!1===h.literalBrackets||s.hasRegexChars(e))continue;let t=s.escapeRegex(F.value);if(B.output=B.output.slice(0,-F.value.length),!0===h.literalBrackets){B.output+=t,F.value=t;continue}F.value=`(${$}${t}|${F.value})`,B.output+=F.value;continue}if("{"===r&&!0!==h.nobrace){V("braces");let e={type:"brace",value:r,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};H.push(e),Q(e);continue}if("}"===r){let e=H[H.length-1];if(!0===h.nobrace||!e){Q({type:"text",value:r,output:r});continue}let t=")";if(!0===e.dots){let e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=c(r,h),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=B.output.slice(0,e.outputIndex),s=B.tokens.slice(e.tokensIndex);for(let i of(e.value=e.output="\\{",r=t="\\}",B.output=n,s))B.output+=i.output||i.value}Q({type:"brace",value:r,output:t}),Z("braces"),H.pop();continue}if("|"===r){P.length>0&&P[P.length-1].conditions++,Q({type:"text",value:r});continue}if(","===r){let e=r,t=H[H.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:r,output:e});continue}if("/"===r){if("dot"===F.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",b.pop(),F=m;continue}Q({type:"slash",value:r,output:S});continue}if("."===r){if(B.braces>0&&"dot"===F.type){"."===F.value&&(F.output=A);let e=H[H.length-1];F.type="dots",F.output+=r,F.value+=r,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==F.type&&"slash"!==F.type){Q({type:"text",value:r,output:A});continue}Q({type:"dot",value:r,output:A});continue}if("?"===r){if(!(F&&"("===F.value)&&!0!==h.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",r);continue}if(F&&"paren"===F.type){let e=U(),t=r;("("!==F.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(J()))||(t=`\\${r}`),Q({type:"text",value:r,output:t});continue}if(!0!==h.dot&&("slash"===F.type||"bos"===F.type)){Q({type:"qmark",value:r,output:L});continue}Q({type:"qmark",value:r,output:R});continue}if("!"===r){if(!0!==h.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",r);continue}if(!0!==h.nonegate&&0===B.index){z();continue}}if("+"===r){if(!0!==h.noextglob&&"("===U()&&"?"!==U(2)){X("plus",r);continue}if(F&&"("===F.value||!1===h.regex){Q({type:"plus",value:r,output:C});continue}if(F&&("bracket"===F.type||"paren"===F.type||"brace"===F.type)||B.parens>0){Q({type:"plus",value:r});continue}Q({type:"plus",value:C});continue}if("@"===r){if(!0!==h.noextglob&&"("===U()&&"?"!==U(2)){Q({type:"at",extglob:!0,value:r,output:""});continue}Q({type:"text",value:r});continue}if("*"!==r){("$"===r||"^"===r)&&(r=`\\${r}`);let e=a.exec(J());e&&(r+=e[0],B.index+=e[0].length),Q({type:"text",value:r});continue}if(F&&("globstar"===F.type||!0===F.star)){F.type="star",F.star=!0,F.value+=r,F.output=M,B.backtrack=!0,B.globstar=!0,K(r);continue}let t=J();if(!0!==h.noextglob&&/^\([^?]/.test(t)){X("star",r);continue}if("star"===F.type){if(!0===h.noglobstar){K(r);continue}let n=F.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,o=s&&("star"===s.type||"globstar"===s.type);if(!0===h.bash&&(!i||t[0]&&"/"!==t[0])){Q({type:"star",value:r,output:""});continue}let a=B.braces>0&&("comma"===n.type||"brace"===n.type),l=P.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!l){Q({type:"star",value:r,output:""});continue}for(;"/**"===t.slice(0,3);){let r=e[B.index+4];if(r&&"/"!==r)break;t=t.slice(3),K("/**",3)}if("bos"===n.type&&G()){F.type="globstar",F.value+=r,F.output=I(h),B.output=F.output,B.globstar=!0,K(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&G()){B.output=B.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=I(h)+(h.strictSlashes?")":"|$)"),F.value+=r,B.globstar=!0,B.output+=n.output+F.output,K(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";B.output=B.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=`${I(h)}${S}|${S}${e})`,F.value+=r,B.output+=n.output+F.output,B.globstar=!0,K(r+q()),Q({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){F.type="globstar",F.value+=r,F.output=`(?:^|${S}|${I(h)}${S})`,B.output=F.output,B.globstar=!0,K(r+q()),Q({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-F.output.length),F.type="globstar",F.output=I(h),F.value+=r,B.output+=F.output,B.globstar=!0,K(r);continue}let n={type:"star",value:r,output:M};if(!0===h.bash){n.output=".*?",("bos"===F.type||"slash"===F.type)&&(n.output=j+n.output),Q(n);continue}if(F&&("bracket"===F.type||"paren"===F.type)&&!0===h.regex){n.output=r,Q(n);continue}(B.index===B.start||"slash"===F.type||"dot"===F.type)&&("dot"===F.type?(B.output+=_,F.output+=_):!0===h.dot?(B.output+=k,F.output+=k):(B.output+=j,F.output+=j),"*"!==U()&&(B.output+=v,F.output+=v)),Q(n)}for(;B.brackets>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","]"));B.output=s.escapeLast(B.output,"["),Z("brackets")}for(;B.parens>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing",")"));B.output=s.escapeLast(B.output,"("),Z("parens")}for(;B.braces>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","}"));B.output=s.escapeLast(B.output,"{"),Z("braces")}if(!0!==h.strictSlashes&&("star"===F.type||"bracket"===F.type)&&Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===B.backtrack)for(let e of(B.output="",B.tokens))B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix);return B};f.fastpaths=(e,t)=>{let r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:b}=n.globChars(r.windows),$=r.dot?d:h,y=r.dot?g:h,x=r.capture?"":"?:",A=!0===r.bash?".*?":m;r.capture&&(A=`(${A})`);let C=e=>!0===e.noglobstar?A:`(${x}(?:(?!${b}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case"*":return`${$}${p}${A}`;case".*":return`${l}${p}${A}`;case"*.*":return`${$}${A}${l}${p}${A}`;case"*/*":return`${$}${A}${c}${p}${y}${A}`;case"**":return $+C(r);case"**/*":return`(?:${$}${C(r)}${c})?${y}${p}${A}`;case"**/*.*":return`(?:${$}${C(r)}${c})?${y}${A}${l}${p}${A}`;case"**/.*":return`(?:${$}${C(r)}${c})?${l}${p}${A}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let r=S(t[1]);if(!r)return;return r+l+t[2]}}},v=S(s.removePrefix(e,{negated:!1,prefix:""}));return v&&!0!==r.strictSlashes&&(v+=`${c}?`),v},t.exports=f},53174,(e,t,r)=>{"use strict";let n=e.r(26094),s=e.r(17932),i=e.r(19241),o=e.r(53487),a=(e,t,r=!1)=>{if(Array.isArray(e)){let n=e.map(e=>a(e,t,r));return e=>{for(let t of n){let r=t(e);if(r)return r}return!1}}let n=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,o=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),l=o.state;delete o.state;let u=()=>!1;if(s.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=a(s.ignore,e,r)}let c=(r,n=!1)=>{let{isMatch:c,match:p,output:f}=a.test(r,o,t,{glob:e,posix:i}),h={glob:e,state:l,regex:o,posix:i,input:r,output:f,match:p,isMatch:c};return("function"==typeof s.onResult&&s.onResult(h),!1===c)?(h.isMatch=!1,!!n&&h):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!n&&h):("function"==typeof s.onMatch&&s.onMatch(h),!n||h)};return r&&(c.state=l),c};a.test=(e,t,r,{glob:n,posix:s}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let o=r||{},l=o.format||(s?i.toPosixSlashes:null),u=e===n,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===n),(!1===u||!0===o.capture)&&(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,s):t.exec(c)),{isMatch:!!u,match:u,output:c}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):s(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;let s=t||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===n&&(u.state=e),u},a.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),a.compileRe(i,t,r,n)},a.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,t.exports=a},54970,(e,t,r)=>{"use strict";let n=e.r(53174),s=e.r(19241);function i(e,t,r=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:s.isWindows()}),n(e,t,r)}Object.assign(i,n),t.exports=i},92552,(e,t,r)=>{"use strict";let n,s;function i(e,t){return t.reduce((e,[t,r])=>({type:"BinaryExpression",operator:t,left:e,right:r}),e)}function o(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class a extends SyntaxError{constructor(e,t,r,n){super(e),this.expected=t,this.found=r,this.location=n,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null,n=e.find(e=>e.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));let s=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,o=this.location.source+":"+i.line+":"+i.column;if(r){let e=this.location.end,n="".padEnd(i.line.toString().length," "),a=r[s.line-1],l=(s.line===e.line?e.column:a.length+1)-s.column||1;t+="\n --> "+o+"\n"+n+" |\n"+i.line+" | "+a+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}let n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(e){return n?e.replace(n,e=>"\\u{"+r(e)+"}"):e}function i(e){return s(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function o(e){return s(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}let a={literal:e=>'"'+i(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r]/,k=/^[+\-]/,R=/^[%*\/]/,L=/^[!\-~]/,N=/^[a-zA-Z_]/,O=/^[a-zA-Z0-9_]/,I=/^[ \t]/,j=/^[^"\\\n\r]/,T=/^[^'\\\n\r]/,M=/^[0-9a-fA-F]/,B=/^[0-9]/,P=/^[xX]/,H=/^[^\n\r]/,D=/^[\n\r]/,F=/^[ \t\n\r]/,G=tE(";",!1),U=tE("package",!1),q=tE("{",!1),J=tE("}",!1),K=tE("function",!1),W=tE("(",!1),z=tE(")",!1),V=tE("::",!1),Z=tE(",",!1),Q=tE("datablock",!1),X=tE(":",!1),Y=tE("new",!1),ee=tE("[",!1),et=tE("]",!1),er=tE("=",!1),en=tE(".",!1),es=tE("if",!1),ei=tE("else",!1),eo=tE("for",!1),ea=tE("while",!1),el=tE("do",!1),eu=tE("switch$",!1),ec=tE("switch",!1),ep=tE("case",!1),ef=tE("default",!1),eh=tE("or",!1),ed=tE("return",!1),eg=tE("break",!1),em=tE("continue",!1),eb=tE("+=",!1),e$=tE("-=",!1),ey=tE("*=",!1),ex=tE("/=",!1),eA=tE("%=",!1),eC=tE("<<=",!1),eS=tE(">>=",!1),ev=tE("&=",!1),ew=tE("|=",!1),eE=tE("^=",!1),e_=tE("?",!1),ek=tE("||",!1),eR=tE("&&",!1),eL=tE("|",!1),eN=tE("^",!1),eO=tE("&",!1),eI=tE("==",!1),ej=tE("!=",!1),eT=tE("<=",!1),eM=tE(">=",!1),eB=t_(["<",">"],!1,!1,!1),eP=tE("$=",!1),eH=tE("!$=",!1),eD=tE("@",!1),eF=tE("NL",!1),eG=tE("TAB",!1),eU=tE("SPC",!1),eq=tE("<<",!1),eJ=tE(">>",!1),eK=t_(["+","-"],!1,!1,!1),eW=t_(["%","*","/"],!1,!1,!1),ez=t_(["!","-","~"],!1,!1,!1),eV=tE("++",!1),eZ=tE("--",!1),eQ=tE("*",!1),eX=tE("%",!1),eY=t_([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=t_([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tE("$",!1),e2=tE("parent",!1),e4=t_([" "," "],!1,!1,!1),e3=tE('"',!1),e9=tE("'",!1),e5=tE("\\",!1),e6=t_(['"',"\\","\n","\r"],!0,!1,!1),e8=t_(["'","\\","\n","\r"],!0,!1,!1),e7=tE("n",!1),te=tE("r",!1),tt=tE("t",!1),tr=tE("x",!1),tn=t_([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ts=tE("cr",!1),ti=tE("cp",!1),to=tE("co",!1),ta=tE("c",!1),tl=t_([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tE("0",!1),tp=t_(["x","X"],!1,!1,!1),tf=tE("-",!1),th=tE("true",!1),td=tE("false",!1),tg=tE("//",!1),tm=t_(["\n","\r"],!0,!1,!1),tb=t_(["\n","\r"],!1,!1,!1),t$=tE("/*",!1),ty=tE("*/",!1),tx=t_([" "," ","\n","\r"],!1,!1,!1),tA=0|t.peg$currPos,tC=[{line:1,column:1}],tS=tA,tv=t.peg$maxFailExpected||[],tw=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');p=c[t.startRule]}function tE(e,t){return{type:"literal",text:e,ignoreCase:t}}function t_(e,t,r,n){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:n}}function tk(t){let r,n=tC[t];if(n)return n;if(t>=tC.length)r=tC.length-1;else for(r=t;!tC[--r];);for(n={line:(n=tC[r]).line,column:n.column};rtS&&(tS=tA,tv=[]),tv.push(e))}function tN(){let e,t,r;for(rp(),e=[],t=tA,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tA=t,t=l);t!==l;)e.push(t),t=tA,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tA=t,t=l);return{type:"Program",body:e.map(([e])=>e).filter(Boolean),execScriptPaths:Array.from(n),hasDynamicExec:s}}function tO(){let t,r,n,s,i,o,a,u,c,p,d,y,x,v,w,E,_;return(t=function(){let t,r,n,s,i,o,a,u;if(t=tA,e.substr(tA,7)===f?(r=f,tA+=7):(r=l,0===tw&&tL(U)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),123===e.charCodeAt(tA)?(s="{",tA++):(s=l,0===tw&&tL(q)),s!==l){for(rp(),i=[],o=tA,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tA=o,o=l);o!==l;)i.push(o),o=tA,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tA=o,o=l);(125===e.charCodeAt(tA)?(o="}",tA++):(o=l,0===tw&&tL(J)),o!==l)?(a=ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),t={type:"PackageDeclaration",name:n,body:i.map(([e])=>e).filter(Boolean)}):(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tA,e.substr(tA,8)===h?(r=h,tA+=8):(r=l,0===tw&&tL(K)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s;if(t=tA,(r=rn())!==l)if("::"===e.substr(tA,2)?(n="::",tA+=2):(n=l,0===tw&&tL(V)),n!==l)if((s=rn())!==l)t={type:"MethodName",namespace:r,method:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=rn()),t}())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=function(){let t,r,n,s,i,o,a,u;if(t=tA,(r=rn())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tA=t,t=l;return t}())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l)if(ru(),(a=tF())!==l)t={type:"FunctionDeclaration",name:n,params:i||[],body:a};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&((n=tA,(s=tI())!==l)?(ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i===l&&(i=null),ru(),n=s):(tA=n,n=l),(t=n)===l&&((o=tA,(a=tj())!==l)?(ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),ru(),o=a):(tA=o,o=l),(t=o)===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tA,"if"===e.substr(tA,2)?(r="if",tA+=2):(r=l,0===tw&&tL(es)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),(o=tO())!==l){var h;a=tA,u=ru(),e.substr(tA,4)===g?(c=g,tA+=4):(c=l,0===tw&&tL(ei)),c!==l?(p=ru(),(f=tO())!==l?a=u=[u,c,p,f]:(tA=a,a=l)):(tA=a,a=l),a===l&&(a=null),t={type:"IfStatement",test:s,consequent:o,alternate:(h=a)?h[3]:null}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tA,"for"===e.substr(tA,3)?(r="for",tA+=3):(r=l,0===tw&&tL(eo)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())===l&&(s=null),ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i!==l)if(ru(),(o=tG())===l&&(o=null),ru(),59===e.charCodeAt(tA)?(a=";",tA++):(a=l,0===tw&&tL(G)),a!==l)if(ru(),(u=tG())===l&&(u=null),ru(),41===e.charCodeAt(tA)?(c=")",tA++):(c=l,0===tw&&tL(z)),c!==l)if(ru(),(p=tO())!==l){var f,h;f=s,h=o,t={type:"ForStatement",init:f,test:h,update:u,body:p}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u;if(t=tA,"do"===e.substr(tA,2)?(r="do",tA+=2):(r=l,0===tw&&tL(el)),r!==l)if(ru(),(n=tO())!==l)if(ru(),e.substr(tA,5)===m?(s=m,tA+=5):(s=l,0===tw&&tL(ea)),s!==l)if(ru(),40===e.charCodeAt(tA)?(i="(",tA++):(i=l,0===tw&&tL(W)),i!==l)if(ru(),(o=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(a=")",tA++):(a=l,0===tw&&tL(z)),a!==l)ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),t={type:"DoWhileStatement",test:o,body:n};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o;if(t=tA,e.substr(tA,5)===m?(r=m,tA+=5):(r=l,0===tw&&tL(ea)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),(o=tO())!==l)t={type:"WhileStatement",test:s,body:o};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tA,e.substr(tA,7)===b?(r=b,tA+=7):(r=l,0===tw&&tL(eu)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),123===e.charCodeAt(tA)?(o="{",tA++):(o=l,0===tw&&tL(q)),o!==l){for(rp(),a=[],u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);u!==l;)a.push(u),u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);(125===e.charCodeAt(tA)?(u="}",tA++):(u=l,0===tw&&tL(J)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;if(t===l)if(t=tA,e.substr(tA,6)===$?(r=$,tA+=6):(r=l,0===tw&&tL(ec)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),123===e.charCodeAt(tA)?(o="{",tA++):(o=l,0===tw&&tL(q)),o!==l){for(rp(),a=[],u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);u!==l;)a.push(u),u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);(125===e.charCodeAt(tA)?(u="}",tA++):(u=l,0===tw&&tL(J)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i;if(t=tA,e.substr(tA,6)===A?(r=A,tA+=6):(r=l,0===tw&&tL(ed)),r!==l)if(n=tA,(s=rc())!==l&&(i=tG())!==l?n=s=[s,i]:(tA=n,n=l),n===l&&(n=null),s=ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i!==l){var o;t={type:"ReturnStatement",value:(o=n)?o[1]:null}}else tA=t,t=l;else tA=t,t=l;return t}())===l&&(c=tA,e.substr(tA,5)===C?(p=C,tA+=5):(p=l,0===tw&&tL(eg)),p!==l?(ru(),59===e.charCodeAt(tA)?(d=";",tA++):(d=l,0===tw&&tL(G)),d!==l?c={type:"BreakStatement"}:(tA=c,c=l)):(tA=c,c=l),(t=c)===l&&(y=tA,e.substr(tA,8)===S?(x=S,tA+=8):(x=l,0===tw&&tL(em)),x!==l?(ru(),59===e.charCodeAt(tA)?(v=";",tA++):(v=l,0===tw&&tL(G)),v!==l?y={type:"ContinueStatement"}:(tA=y,y=l)):(tA=y,y=l),(t=y)===l&&((w=tA,(E=tG())!==l&&(ru(),59===e.charCodeAt(tA)?(_=";",tA++):(_=l,0===tw&&tL(G)),_!==l))?w={type:"ExpressionStatement",expression:E}:(tA=w,w=l),(t=w)===l&&(t=tF())===l&&(t=rl())===l)))))&&(t=tA,ru(),59===e.charCodeAt(tA)?(r=";",tA++):(r=l,0===tw&&tL(G)),r!==l?(ru(),t=null):(tA=t,t=l)),t}function tI(){let t,r,n,s,i,o,a,u,c,p,f,h,g,m;if(t=tA,e.substr(tA,9)===d?(r=d,tA+=9):(r=l,0===tw&&tL(Q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=tM())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l){var b,$,y;if(ru(),a=tA,58===e.charCodeAt(tA)?(u=":",tA++):(u=l,0===tw&&tL(X)),u!==l?(c=ru(),(p=rn())!==l?a=u=[u,c,p]:(tA=a,a=l)):(tA=a,a=l),a===l&&(a=null),u=ru(),c=tA,123===e.charCodeAt(tA)?(p="{",tA++):(p=l,0===tw&&tL(q)),p!==l){for(f=ru(),h=[],g=tT();g!==l;)h.push(g),g=tT();g=ru(),125===e.charCodeAt(tA)?(m="}",tA++):(m=l,0===tw&&tL(J)),m!==l?c=p=[p,f,h,g,m,ru()]:(tA=c,c=l)}else tA=c,c=l;c===l&&(c=null),b=i,$=a,y=c,t={type:"DatablockDeclaration",className:n,instanceName:b,parent:$?$[2]:null,body:y?y[2].filter(Boolean):[]}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}function tj(){let t,r,n,s,i,o,a,u,c,p,f,h;if(t=tA,"new"===e.substr(tA,3)?(r="new",tA+=3):(r=l,0===tw&&tL(Y)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u,c,p;if((t=tA,40===e.charCodeAt(tA)?(r="(",tA++):(r=l,0===tw&&tL(W)),r!==l&&(n=ru(),(s=tG())!==l&&(i=ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l)))?t=s:(tA=t,t=l),t===l)if(t=tA,(r=rn())!==l){var f;for(n=[],s=tA,i=ru(),91===e.charCodeAt(tA)?(o="[",tA++):(o=l,0===tw&&tL(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tA)?(p="]",tA++):(p=l,0===tw&&tL(et)),p!==l?s=i=[i,o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),91===e.charCodeAt(tA)?(o="[",tA++):(o=l,0===tw&&tL(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tA)?(p="]",tA++):(p=l,0===tw&&tL(et)),p!==l?s=i=[i,o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);f=r,t=n.reduce((e,[,,,t])=>({type:"IndexExpression",object:e,index:t}),f)}else tA=t,t=l;return t}())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=tM())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l){var d;if(ru(),a=tA,123===e.charCodeAt(tA)?(u="{",tA++):(u=l,0===tw&&tL(q)),u!==l){for(c=ru(),p=[],f=tT();f!==l;)p.push(f),f=tT();f=ru(),125===e.charCodeAt(tA)?(h="}",tA++):(h=l,0===tw&&tL(J)),h!==l?a=u=[u,c,p,f,h,ru()]:(tA=a,a=l)}else tA=a,a=l;a===l&&(a=null),t={type:"ObjectDeclaration",className:n,instanceName:i,body:(d=a)?d[2].filter(Boolean):[]}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}function tT(){let t,r,n;return(t=tA,(r=tj())!==l)?(ru(),59===e.charCodeAt(tA)?(n=";",tA++):(n=l,0===tw&&tL(G)),n===l&&(n=null),ru(),t=r):(tA=t,t=l),t===l&&((t=tA,(r=tI())!==l)?(ru(),59===e.charCodeAt(tA)?(n=";",tA++):(n=l,0===tw&&tL(G)),n===l&&(n=null),ru(),t=r):(tA=t,t=l),t===l&&(t=function(){let t,r,n,s,i;if(t=tA,ru(),(r=tB())!==l)if(ru(),61===e.charCodeAt(tA)?(n="=",tA++):(n=l,0===tw&&tL(er)),n!==l)if(ru(),(s=tG())!==l)ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i===l&&(i=null),ru(),t={type:"Assignment",target:r,value:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=rl())===l&&(t=function(){let t,r;if(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r!==l)for(;r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));else t=l;return t!==l&&(t=null),t}())),t}function tM(){let e;return(e=tY())===l&&(e=rn())===l&&(e=ra()),e}function tB(){let e,t,r,n;if(e=tA,(t=t8())!==l){for(r=[],n=tP();n!==l;)r.push(n),n=tP();e=r.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tA=e,e=l;return e}function tP(){let t,r,n,s;return(t=tA,46===e.charCodeAt(tA)?(r=".",tA++):(r=l,0===tw&&tL(en)),r!==l&&(ru(),(n=rn())!==l))?t={type:"property",value:n}:(tA=t,t=l),t===l&&((t=tA,91===e.charCodeAt(tA)?(r="[",tA++):(r=l,0===tw&&tL(ee)),r!==l&&(ru(),(n=tH())!==l&&(ru(),93===e.charCodeAt(tA)?(s="]",tA++):(s=l,0===tw&&tL(et)),s!==l)))?t={type:"index",value:n}:(tA=t,t=l)),t}function tH(){let t,r,n,s,i,o,a,u;if(t=tA,(r=tG())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tA=t,t=l;return t}function tD(){let t,r,n,s,i,o,a,u,c;if(t=tA,e.substr(tA,4)===y?(r=y,tA+=4):(r=l,0===tw&&tL(ep)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u;if(t=tA,(r=t3())!==l){for(n=[],s=tA,i=ru(),"or"===e.substr(tA,2)?(o="or",tA+=2):(o=l,0===tw&&tL(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),"or"===e.substr(tA,2)?(o="or",tA+=2):(o=l,0===tw&&tL(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tA=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tA=t,t=l;return t}())!==l)if(ru(),58===e.charCodeAt(tA)?(s=":",tA++):(s=l,0===tw&&tL(X)),s!==l){for(i=rp(),o=[],a=tA,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tA=a,a=l);a!==l;)o.push(a),a=tA,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tA=a,a=l);t={type:"SwitchCase",test:n,consequent:o.map(([e])=>e).filter(Boolean)}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;if(t===l)if(t=tA,e.substr(tA,7)===x?(r=x,tA+=7):(r=l,0===tw&&tL(ef)),r!==l)if(ru(),58===e.charCodeAt(tA)?(n=":",tA++):(n=l,0===tw&&tL(X)),n!==l){for(rp(),s=[],i=tA,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tA=i,i=l);i!==l;)s.push(i),i=tA,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tA=i,i=l);t={type:"SwitchCase",test:null,consequent:s.map(([e])=>e).filter(Boolean)}}else tA=t,t=l;else tA=t,t=l;return t}function tF(){let t,r,n,s,i,o;if(t=tA,123===e.charCodeAt(tA)?(r="{",tA++):(r=l,0===tw&&tL(q)),r!==l){for(rp(),n=[],s=tA,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tA=s,s=l);s!==l;)n.push(s),s=tA,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tA=s,s=l);(125===e.charCodeAt(tA)?(s="}",tA++):(s=l,0===tw&&tL(J)),s!==l)?t={type:"BlockStatement",body:n.map(([e])=>e).filter(Boolean)}:(tA=t,t=l)}else tA=t,t=l;return t}function tG(){let t,r,n,s;if(t=tA,(r=tB())!==l)if(ru(),(n=tU())!==l)if(ru(),(s=tG())!==l)t={type:"AssignmentExpression",operator:n,target:r,value:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=function(){let t,r,n,s,i,o;if(t=tA,(r=tq())!==l)if(ru(),63===e.charCodeAt(tA)?(n="?",tA++):(n=l,0===tw&&tL(e_)),n!==l)if(ru(),(s=tG())!==l)if(ru(),58===e.charCodeAt(tA)?(i=":",tA++):(i=l,0===tw&&tL(X)),i!==l)if(ru(),(o=tG())!==l)t={type:"ConditionalExpression",test:r,consequent:s,alternate:o};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=tq()),t}()),t}function tU(){let t;return 61===e.charCodeAt(tA)?(t="=",tA++):(t=l,0===tw&&tL(er)),t===l&&("+="===e.substr(tA,2)?(t="+=",tA+=2):(t=l,0===tw&&tL(eb)),t===l&&("-="===e.substr(tA,2)?(t="-=",tA+=2):(t=l,0===tw&&tL(e$)),t===l&&("*="===e.substr(tA,2)?(t="*=",tA+=2):(t=l,0===tw&&tL(ey)),t===l&&("/="===e.substr(tA,2)?(t="/=",tA+=2):(t=l,0===tw&&tL(ex)),t===l&&("%="===e.substr(tA,2)?(t="%=",tA+=2):(t=l,0===tw&&tL(eA)),t===l&&("<<="===e.substr(tA,3)?(t="<<=",tA+=3):(t=l,0===tw&&tL(eC)),t===l&&(">>="===e.substr(tA,3)?(t=">>=",tA+=3):(t=l,0===tw&&tL(eS)),t===l&&("&="===e.substr(tA,2)?(t="&=",tA+=2):(t=l,0===tw&&tL(ev)),t===l&&("|="===e.substr(tA,2)?(t="|=",tA+=2):(t=l,0===tw&&tL(ew)),t===l&&("^="===e.substr(tA,2)?(t="^=",tA+=2):(t=l,0===tw&&tL(eE)))))))))))),t}function tq(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tJ())!==l){for(n=[],s=tA,o=ru(),"||"===e.substr(tA,2)?(a="||",tA+=2):(a=l,0===tw&&tL(ek)),a!==l?(u=ru(),(c=tJ())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),"||"===e.substr(tA,2)?(a="||",tA+=2):(a=l,0===tw&&tL(ek)),a!==l?(u=ru(),(c=tJ())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tJ(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tK())!==l){for(n=[],s=tA,o=ru(),"&&"===e.substr(tA,2)?(a="&&",tA+=2):(a=l,0===tw&&tL(eR)),a!==l?(u=ru(),(c=tK())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),"&&"===e.substr(tA,2)?(a="&&",tA+=2):(a=l,0===tw&&tL(eR)),a!==l?(u=ru(),(c=tK())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tK(){let t,r,n,s,o,a,u,c,p;if(t=tA,(r=tW())!==l){for(n=[],s=tA,o=ru(),124===e.charCodeAt(tA)?(a="|",tA++):(a=l,0===tw&&tL(eL)),a!==l?(u=tA,tw++,124===e.charCodeAt(tA)?(c="|",tA++):(c=l,0===tw&&tL(eL)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tW())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),124===e.charCodeAt(tA)?(a="|",tA++):(a=l,0===tw&&tL(eL)),a!==l?(u=tA,tw++,124===e.charCodeAt(tA)?(c="|",tA++):(c=l,0===tw&&tL(eL)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tW())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tA=t,t=l;return t}function tW(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tz())!==l){for(n=[],s=tA,o=ru(),94===e.charCodeAt(tA)?(a="^",tA++):(a=l,0===tw&&tL(eN)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),94===e.charCodeAt(tA)?(a="^",tA++):(a=l,0===tw&&tL(eN)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tz(){let t,r,n,s,o,a,u,c,p;if(t=tA,(r=tV())!==l){for(n=[],s=tA,o=ru(),38===e.charCodeAt(tA)?(a="&",tA++):(a=l,0===tw&&tL(eO)),a!==l?(u=tA,tw++,38===e.charCodeAt(tA)?(c="&",tA++):(c=l,0===tw&&tL(eO)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tV())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),38===e.charCodeAt(tA)?(a="&",tA++):(a=l,0===tw&&tL(eO)),a!==l?(u=tA,tw++,38===e.charCodeAt(tA)?(c="&",tA++):(c=l,0===tw&&tL(eO)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tV())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tA=t,t=l;return t}function tV(){let e,t,r,n,s,o,a,u;if(e=tA,(t=tQ())!==l){for(r=[],n=tA,s=ru(),(o=tZ())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=tZ())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function tZ(){let t;return"=="===e.substr(tA,2)?(t="==",tA+=2):(t=l,0===tw&&tL(eI)),t===l&&("!="===e.substr(tA,2)?(t="!=",tA+=2):(t=l,0===tw&&tL(ej))),t}function tQ(){let e,t,r,n,s,o,a,u;if(e=tA,(t=tY())!==l){for(r=[],n=tA,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function tX(){let t;return"<="===e.substr(tA,2)?(t="<=",tA+=2):(t=l,0===tw&&tL(eT)),t===l&&(">="===e.substr(tA,2)?(t=">=",tA+=2):(t=l,0===tw&&tL(eM)),t===l&&(t=e.charAt(tA),_.test(t)?tA++:(t=l,0===tw&&tL(eB)))),t}function tY(){let e,t,r,n,s,o,a,u;if(e=tA,(t=t2())!==l){for(r=[],n=tA,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function t0(){let e,t,r,n;if(e=tA,(t=tB())!==l)if(ru(),(r=tU())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tA=e,e=l;else tA=e,e=l;else tA=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tA,2)?(t="$=",tA+=2):(t=l,0===tw&&tL(eP)),t===l&&("!$="===e.substr(tA,3)?(t="!$=",tA+=3):(t=l,0===tw&&tL(eH)),t===l&&(64===e.charCodeAt(tA)?(t="@",tA++):(t=l,0===tw&&tL(eD)),t===l&&("NL"===e.substr(tA,2)?(t="NL",tA+=2):(t=l,0===tw&&tL(eF)),t===l&&("TAB"===e.substr(tA,3)?(t="TAB",tA+=3):(t=l,0===tw&&tL(eG)),t===l&&("SPC"===e.substr(tA,3)?(t="SPC",tA+=3):(t=l,0===tw&&tL(eU))))))),t}function t2(){let e,t,r,n,s,o,a,u;if(e=tA,(t=t3())!==l){for(r=[],n=tA,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function t4(){let t;return"<<"===e.substr(tA,2)?(t="<<",tA+=2):(t=l,0===tw&&tL(eq)),t===l&&(">>"===e.substr(tA,2)?(t=">>",tA+=2):(t=l,0===tw&&tL(eJ))),t}function t3(){let t,r,n,s,o,a,u,c;if(t=tA,(r=t9())!==l){for(n=[],s=tA,o=ru(),a=e.charAt(tA),k.test(a)?tA++:(a=l,0===tw&&tL(eK)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),a=e.charAt(tA),k.test(a)?tA++:(a=l,0===tw&&tL(eK)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function t9(){let t,r,n,s,o,a,u,c;if(t=tA,(r=t5())!==l){for(n=[],s=tA,o=ru(),a=e.charAt(tA),R.test(a)?tA++:(a=l,0===tw&&tL(eW)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),a=e.charAt(tA),R.test(a)?tA++:(a=l,0===tw&&tL(eW)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function t5(){let t,r,n;return(t=tA,r=e.charAt(tA),L.test(r)?tA++:(r=l,0===tw&&tL(ez)),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tA=t,t=l),t===l&&((t=tA,"++"===e.substr(tA,2)?(r="++",tA+=2):(r=l,0===tw&&tL(eV)),r===l&&("--"===e.substr(tA,2)?(r="--",tA+=2):(r=l,0===tw&&tL(eZ))),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tA=t,t=l),t===l&&((t=tA,42===e.charCodeAt(tA)?(r="*",tA++):(r=l,0===tw&&tL(eQ)),r!==l&&(ru(),(n=t6())!==l))?t={type:"TagDereferenceExpression",argument:n}:(tA=t,t=l),t===l&&(t=function(){let t,r,n;if(t=tA,(r=t8())!==l)if(ru(),"++"===e.substr(tA,2)?(n="++",tA+=2):(n=l,0===tw&&tL(eV)),n===l&&("--"===e.substr(tA,2)?(n="--",tA+=2):(n=l,0===tw&&tL(eZ))),n!==l)t={type:"PostfixExpression",operator:n,argument:r};else tA=t,t=l;else tA=t,t=l;return t===l&&(t=t8()),t}()))),t}function t6(){let e,t,r,n;if(e=tA,(t=tB())!==l)if(ru(),(r=tU())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tA=e,e=l;else tA=e,e=l;else tA=e,e=l;return e===l&&(e=t5()),e}function t8(){let t,r,i,o,a,u,c,p,f,h;if(t=tA,(r=function(){let t,r,n,s,i,o,a,u,c,p,f,h,d,g,m,b;if(t=tA,(a=tj())===l&&(a=tI())===l&&(a=function(){let t,r,n,s;if(t=tA,34===e.charCodeAt(tA)?(r='"',tA++):(r=l,0===tw&&tL(e3)),r!==l){for(n=[],s=rs();s!==l;)n.push(s),s=rs();(34===e.charCodeAt(tA)?(s='"',tA++):(s=l,0===tw&&tL(e3)),s!==l)?t={type:"StringLiteral",value:n.join("")}:(tA=t,t=l)}else tA=t,t=l;if(t===l)if(t=tA,39===e.charCodeAt(tA)?(r="'",tA++):(r=l,0===tw&&tL(e9)),r!==l){for(n=[],s=ri();s!==l;)n.push(s),s=ri();(39===e.charCodeAt(tA)?(s="'",tA++):(s=l,0===tw&&tL(e9)),s!==l)?t={type:"StringLiteral",value:n.join(""),tagged:!0}:(tA=t,t=l)}else tA=t,t=l;return t}())===l&&(a=ra())===l&&((u=tA,e.substr(tA,4)===w?(c=w,tA+=4):(c=l,0===tw&&tL(th)),c===l&&(e.substr(tA,5)===E?(c=E,tA+=5):(c=l,0===tw&&tL(td))),c!==l&&(p=tA,tw++,f=rh(),tw--,f===l?p=void 0:(tA=p,p=l),p!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tA=u,u=l),(a=u)===l&&((h=re())===l&&(h=rt())===l&&(h=rr()),(a=h)===l))&&((d=tA,40===e.charCodeAt(tA)?(g="(",tA++):(g=l,0===tw&&tL(W)),g!==l&&(ru(),(m=tG())!==l&&(ru(),41===e.charCodeAt(tA)?(b=")",tA++):(b=l,0===tw&&tL(z)),b!==l)))?d=m:(tA=d,d=l),a=d),(r=a)!==l){for(n=[],s=tA,i=ru(),(o=tP())!==l?s=i=[i,o]:(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),(o=tP())!==l?s=i=[i,o]:(tA=s,s=l);t=n.reduce((e,[,t])=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},r)}else tA=t,t=l;return t}())!==l){for(i=[],o=tA,a=ru(),40===e.charCodeAt(tA)?(u="(",tA++):(u=l,0===tw&&tL(W)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tA)?(h=")",tA++):(h=l,0===tw&&tL(z)),h!==l?o=a=[a,u,c,p,f,h]:(tA=o,o=l)):(tA=o,o=l),o===l&&(o=tA,a=ru(),(u=tP())!==l?o=a=[a,u]:(tA=o,o=l));o!==l;)i.push(o),o=tA,a=ru(),40===e.charCodeAt(tA)?(u="(",tA++):(u=l,0===tw&&tL(W)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tA)?(h=")",tA++):(h=l,0===tw&&tL(z)),h!==l?o=a=[a,u,c,p,f,h]:(tA=o,o=l)):(tA=o,o=l),o===l&&(o=tA,a=ru(),(u=tP())!==l?o=a=[a,u]:(tA=o,o=l));t=i.reduce((e,t)=>{if("("===t[1]){var r;let[,,,i]=t;return r=i||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(r.length>0&&"StringLiteral"===r[0].type?n.add(r[0].value):s=!0),{type:"CallExpression",callee:e,arguments:r}}let i=t[1];return"property"===i.type?{type:"MemberExpression",object:e,property:i.value}:{type:"IndexExpression",object:e,index:i.value}},r)}else tA=t,t=l;return t}function t7(){let t,r,n,s,i,o,a,u;if(t=tA,(r=tG())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tA=t,t=l;return t}function re(){let t,r,n,s,i,o,a;if(t=tA,37===e.charCodeAt(tA)?(r="%",tA++):(r=l,0===tw&&tL(eX)),r!==l){if(n=tA,s=tA,i=e.charAt(tA),N.test(i)?tA++:(i=l,0===tw&&tL(eY)),i!==l){for(o=[],a=e.charAt(tA),O.test(a)?tA++:(a=l,0===tw&&tL(e0));a!==l;)o.push(a),a=e.charAt(tA),O.test(a)?tA++:(a=l,0===tw&&tL(e0));s=i=[i,o]}else tA=s,s=l;(n=s!==l?e.substring(n,tA):s)!==l?t={type:"Variable",scope:"local",name:n}:(tA=t,t=l)}else tA=t,t=l;return t}function rt(){let t,r,n,s,i,o,a,u,c,p,f,h,d;if(t=tA,36===e.charCodeAt(tA)?(r="$",tA++):(r=l,0===tw&&tL(e1)),r!==l){if(n=tA,s=tA,"::"===e.substr(tA,2)?(i="::",tA+=2):(i=l,0===tw&&tL(V)),i===l&&(i=null),o=e.charAt(tA),N.test(o)?tA++:(o=l,0===tw&&tL(eY)),o!==l){for(a=[],u=e.charAt(tA),O.test(u)?tA++:(u=l,0===tw&&tL(e0));u!==l;)a.push(u),u=e.charAt(tA),O.test(u)?tA++:(u=l,0===tw&&tL(e0));if(u=[],c=tA,"::"===e.substr(tA,2)?(p="::",tA+=2):(p=l,0===tw&&tL(V)),p!==l)if(f=e.charAt(tA),N.test(f)?tA++:(f=l,0===tw&&tL(eY)),f!==l){for(h=[],d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));d!==l;)h.push(d),d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));c=p=[p,f,h]}else tA=c,c=l;else tA=c,c=l;for(;c!==l;)if(u.push(c),c=tA,"::"===e.substr(tA,2)?(p="::",tA+=2):(p=l,0===tw&&tL(V)),p!==l)if(f=e.charAt(tA),N.test(f)?tA++:(f=l,0===tw&&tL(eY)),f!==l){for(h=[],d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));d!==l;)h.push(d),d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));c=p=[p,f,h]}else tA=c,c=l;else tA=c,c=l;s=i=[i,o,a,u]}else tA=s,s=l;(n=s!==l?e.substring(n,tA):s)!==l?t={type:"Variable",scope:"global",name:n}:(tA=t,t=l)}else tA=t,t=l;return t}function rr(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tA,r=tA,n=tA,e.substr(tA,6)===v?(s=v,tA+=6):(s=l,0===tw&&tL(e2)),s!==l){for(i=[],o=e.charAt(tA),I.test(o)?tA++:(o=l,0===tw&&tL(e4));o!==l;)i.push(o),o=e.charAt(tA),I.test(o)?tA++:(o=l,0===tw&&tL(e4));if("::"===e.substr(tA,2)?(o="::",tA+=2):(o=l,0===tw&&tL(V)),o!==l){for(a=[],u=e.charAt(tA),I.test(u)?tA++:(u=l,0===tw&&tL(e4));u!==l;)a.push(u),u=e.charAt(tA),I.test(u)?tA++:(u=l,0===tw&&tL(e4));if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));n=s=[s,i,o,a,u,c]}else tA=n,n=l}else tA=n,n=l}else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r.replace(/\s+/g,"")}),(t=r)===l){if(t=tA,r=tA,n=tA,e.substr(tA,6)===v?(s=v,tA+=6):(s=l,0===tw&&tL(e2)),s!==l){if(i=[],o=tA,"::"===e.substr(tA,2)?(a="::",tA+=2):(a=l,0===tw&&tL(V)),a!==l)if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));o=a=[a,u,c]}else tA=o,o=l;else tA=o,o=l;if(o!==l)for(;o!==l;)if(i.push(o),o=tA,"::"===e.substr(tA,2)?(a="::",tA+=2):(a=l,0===tw&&tL(V)),a!==l)if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));o=a=[a,u,c]}else tA=o,o=l;else tA=o,o=l;else i=l;i!==l?n=s=[s,i]:(tA=n,n=l)}else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r}),(t=r)===l){if(t=tA,r=tA,n=tA,s=e.charAt(tA),N.test(s)?tA++:(s=l,0===tw&&tL(eY)),s!==l){for(i=[],o=e.charAt(tA),O.test(o)?tA++:(o=l,0===tw&&tL(e0));o!==l;)i.push(o),o=e.charAt(tA),O.test(o)?tA++:(o=l,0===tw&&tL(e0));if(o=[],a=tA,"::"===e.substr(tA,2)?(u="::",tA+=2):(u=l,0===tw&&tL(V)),u!==l)if(c=e.charAt(tA),N.test(c)?tA++:(c=l,0===tw&&tL(eY)),c!==l){for(p=[],f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));f!==l;)p.push(f),f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));a=u=[u,c,p]}else tA=a,a=l;else tA=a,a=l;for(;a!==l;)if(o.push(a),a=tA,"::"===e.substr(tA,2)?(u="::",tA+=2):(u=l,0===tw&&tL(V)),u!==l)if(c=e.charAt(tA),N.test(c)?tA++:(c=l,0===tw&&tL(eY)),c!==l){for(p=[],f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));f!==l;)p.push(f),f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));a=u=[u,c,p]}else tA=a,a=l;else tA=a,a=l;n=s=[s,i,o]}else tA=n,n=l;(r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r}),t=r}}return t}function rn(){let e;return(e=re())===l&&(e=rt())===l&&(e=rr()),e}function rs(){let t,r,n;return(t=tA,92===e.charCodeAt(tA)?(r="\\",tA++):(r=l,0===tw&&tL(e5)),r!==l&&(n=ro())!==l)?t=n:(tA=t,t=l),t===l&&(t=e.charAt(tA),j.test(t)?tA++:(t=l,0===tw&&tL(e6))),t}function ri(){let t,r,n;return(t=tA,92===e.charCodeAt(tA)?(r="\\",tA++):(r=l,0===tw&&tL(e5)),r!==l&&(n=ro())!==l)?t=n:(tA=t,t=l),t===l&&(t=e.charAt(tA),T.test(t)?tA++:(t=l,0===tw&&tL(e8))),t}function ro(){let t,r,n,s,i,o;return t=tA,110===e.charCodeAt(tA)?(r="n",tA++):(r=l,0===tw&&tL(e7)),r!==l&&(r="\n"),(t=r)===l&&(t=tA,114===e.charCodeAt(tA)?(r="r",tA++):(r=l,0===tw&&tL(te)),r!==l&&(r="\r"),(t=r)===l)&&(t=tA,116===e.charCodeAt(tA)?(r="t",tA++):(r=l,0===tw&&tL(tt)),r!==l&&(r=" "),(t=r)===l)&&((t=tA,120===e.charCodeAt(tA)?(r="x",tA++):(r=l,0===tw&&tL(tr)),r!==l&&(n=tA,s=tA,i=e.charAt(tA),M.test(i)?tA++:(i=l,0===tw&&tL(tn)),i!==l?(o=e.charAt(tA),M.test(o)?tA++:(o=l,0===tw&&tL(tn)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l),(n=s!==l?e.substring(n,tA):s)!==l))?t=String.fromCharCode(parseInt(n,16)):(tA=t,t=l),t===l&&(t=tA,"cr"===e.substr(tA,2)?(r="cr",tA+=2):(r=l,0===tw&&tL(ts)),r!==l&&(r="\x0f"),(t=r)===l&&(t=tA,"cp"===e.substr(tA,2)?(r="cp",tA+=2):(r=l,0===tw&&tL(ti)),r!==l&&(r="\x10"),(t=r)===l))&&(t=tA,"co"===e.substr(tA,2)?(r="co",tA+=2):(r=l,0===tw&&tL(to)),r!==l&&(r="\x11"),(t=r)===l)&&((t=tA,99===e.charCodeAt(tA)?(r="c",tA++):(r=l,0===tw&&tL(ta)),r!==l&&(n=e.charAt(tA),B.test(n)?tA++:(n=l,0===tw&&tL(tl)),n!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(n,10)]):(tA=t,t=l),t===l&&(t=tA,e.length>tA?(r=e.charAt(tA),tA++):(r=l,0===tw&&tL(tu)),t=r))),t}function ra(){let t,r,n,s,i,o,a,u,c;if(t=tA,r=tA,n=tA,48===e.charCodeAt(tA)?(s="0",tA++):(s=l,0===tw&&tL(tc)),s!==l)if(i=e.charAt(tA),P.test(i)?tA++:(i=l,0===tw&&tL(tp)),i!==l){if(o=[],a=e.charAt(tA),M.test(a)?tA++:(a=l,0===tw&&tL(tn)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tA),M.test(a)?tA++:(a=l,0===tw&&tL(tn));else o=l;o!==l?n=s=[s,i,o]:(tA=n,n=l)}else tA=n,n=l;else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(n=tA,tw++,s=rh(),tw--,s===l?n=void 0:(tA=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseInt(r,16)}:(tA=t,t=l),t===l){if(t=tA,r=tA,n=tA,45===e.charCodeAt(tA)?(s="-",tA++):(s=l,0===tw&&tL(tf)),s===l&&(s=null),i=[],o=e.charAt(tA),B.test(o)?tA++:(o=l,0===tw&&tL(tl)),o!==l)for(;o!==l;)i.push(o),o=e.charAt(tA),B.test(o)?tA++:(o=l,0===tw&&tL(tl));else i=l;if(i!==l){if(o=tA,46===e.charCodeAt(tA)?(a=".",tA++):(a=l,0===tw&&tL(en)),a!==l){if(u=[],c=e.charAt(tA),B.test(c)?tA++:(c=l,0===tw&&tL(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tA),B.test(c)?tA++:(c=l,0===tw&&tL(tl));else u=l;u!==l?o=a=[a,u]:(tA=o,o=l)}else tA=o,o=l;o===l&&(o=null),n=s=[s,i,o]}else tA=n,n=l;if(n===l)if(n=tA,45===e.charCodeAt(tA)?(s="-",tA++):(s=l,0===tw&&tL(tf)),s===l&&(s=null),46===e.charCodeAt(tA)?(i=".",tA++):(i=l,0===tw&&tL(en)),i!==l){if(o=[],a=e.charAt(tA),B.test(a)?tA++:(a=l,0===tw&&tL(tl)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tA),B.test(a)?tA++:(a=l,0===tw&&tL(tl));else o=l;o!==l?n=s=[s,i,o]:(tA=n,n=l)}else tA=n,n=l;(r=n!==l?e.substring(r,tA):n)!==l&&(n=tA,tw++,s=rh(),tw--,s===l?n=void 0:(tA=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseFloat(r)}:(tA=t,t=l)}return t}function rl(){let t;return(t=function(){let t,r,n,s,i;if(t=tA,"//"===e.substr(tA,2)?(r="//",tA+=2):(r=l,0===tw&&tL(tg)),r!==l){for(n=tA,s=[],i=e.charAt(tA),H.test(i)?tA++:(i=l,0===tw&&tL(tm));i!==l;)s.push(i),i=e.charAt(tA),H.test(i)?tA++:(i=l,0===tw&&tL(tm));n=e.substring(n,tA),s=e.charAt(tA),D.test(s)?tA++:(s=l,0===tw&&tL(tb)),s===l&&(s=null),t={type:"Comment",value:n}}else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tA,"/*"===e.substr(tA,2)?(r="/*",tA+=2):(r=l,0===tw&&tL(t$)),r!==l){for(n=tA,s=[],i=tA,o=tA,tw++,"*/"===e.substr(tA,2)?(a="*/",tA+=2):(a=l,0===tw&&tL(ty)),tw--,a===l?o=void 0:(tA=o,o=l),o!==l?(e.length>tA?(a=e.charAt(tA),tA++):(a=l,0===tw&&tL(tu)),a!==l?i=o=[o,a]:(tA=i,i=l)):(tA=i,i=l);i!==l;)s.push(i),i=tA,o=tA,tw++,"*/"===e.substr(tA,2)?(a="*/",tA+=2):(a=l,0===tw&&tL(ty)),tw--,a===l?o=void 0:(tA=o,o=l),o!==l?(e.length>tA?(a=e.charAt(tA),tA++):(a=l,0===tw&&tL(tu)),a!==l?i=o=[o,a]:(tA=i,i=l)):(tA=i,i=l);(n=e.substring(n,tA),"*/"===e.substr(tA,2)?(s="*/",tA+=2):(s=l,0===tw&&tL(ty)),s!==l)?t={type:"Comment",value:n}:(tA=t,t=l)}else tA=t,t=l;return t}()),t}function ru(){let t,r;for(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r===l&&(r=rf());r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r===l&&(r=rf());return t}function rc(){let t,r,n,s;if(t=tA,r=[],n=e.charAt(tA),F.test(n)?tA++:(n=l,0===tw&&tL(tx)),n!==l)for(;n!==l;)r.push(n),n=e.charAt(tA),F.test(n)?tA++:(n=l,0===tw&&tL(tx));else r=l;if(r!==l){for(n=[],s=e.charAt(tA),F.test(s)?tA++:(s=l,0===tw&&tL(tx)),s===l&&(s=rf());s!==l;)n.push(s),s=e.charAt(tA),F.test(s)?tA++:(s=l,0===tw&&tL(tx)),s===l&&(s=rf());t=r=[r,n]}else tA=t,t=l;return t}function rp(){let t,r;for(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));return t}function rf(){let t,r,n,s,i,o;if(t=tA,"//"===e.substr(tA,2)?(r="//",tA+=2):(r=l,0===tw&&tL(tg)),r!==l){for(n=[],s=e.charAt(tA),H.test(s)?tA++:(s=l,0===tw&&tL(tm));s!==l;)n.push(s),s=e.charAt(tA),H.test(s)?tA++:(s=l,0===tw&&tL(tm));s=e.charAt(tA),D.test(s)?tA++:(s=l,0===tw&&tL(tb)),s===l&&(s=null),t=r=[r,n,s]}else tA=t,t=l;if(t===l)if(t=tA,"/*"===e.substr(tA,2)?(r="/*",tA+=2):(r=l,0===tw&&tL(t$)),r!==l){for(n=[],s=tA,i=tA,tw++,"*/"===e.substr(tA,2)?(o="*/",tA+=2):(o=l,0===tw&&tL(ty)),tw--,o===l?i=void 0:(tA=i,i=l),i!==l?(e.length>tA?(o=e.charAt(tA),tA++):(o=l,0===tw&&tL(tu)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=tA,tw++,"*/"===e.substr(tA,2)?(o="*/",tA+=2):(o=l,0===tw&&tL(ty)),tw--,o===l?i=void 0:(tA=i,i=l),i!==l?(e.length>tA?(o=e.charAt(tA),tA++):(o=l,0===tw&&tL(tu)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l);"*/"===e.substr(tA,2)?(s="*/",tA+=2):(s=l,0===tw&&tL(ty)),s!==l?t=r=[r,n,s]:(tA=t,t=l)}else tA=t,t=l;return t}function rh(){let t;return t=e.charAt(tA),O.test(t)?tA++:(t=l,0===tw&&tL(e0)),t}n=new Set,s=!1;let rd=(r=p())!==l&&tA===e.length;function rg(){var t,n,s;throw r!==l&&tA{"use strict";function t(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}let r=e.i(87447).default;function n(e){return t(e).toLowerCase()}function s(){return r.resources}function i(e){let[t,...n]=r.resources[e],[s,i]=n[n.length-1];return[s,i??t]}function o(e){let t=n(e);if(r.resources[t])return t;let s=t.replace(/\d+(\.(png))$/i,"$1");if(r.resources[s])return s;throw Error(`Resource not found in manifest: ${e}`)}function a(){return Object.keys(r.resources)}let l=["",".jpg",".png",".gif",".bmp"];function u(e){let t=n(e);for(let e of l){let n=`${t}${e}`;if(r.resources[n])return n}return t}function c(e){let t=r.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function p(){return Object.keys(r.missions)}e.s(["getActualResourceKey",()=>o,"getMissionInfo",()=>c,"getMissionList",()=>p,"getResourceKey",()=>n,"getResourceList",()=>a,"getResourceMap",()=>s,"getSourceAndPath",()=>i,"getStandardTextureResourceKey",()=>u],91996),e.s(["parse",()=>q,"runServer",()=>W],86608);var f=e.i(92552);function h(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let d={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class g{indent;runtime;functions;globals;locals;indentLevel=0;currentClass=null;currentFunction=null;constructor(e={}){this.indent=e.indent??" ",this.runtime=e.runtime??"$",this.functions=e.functions??"$f",this.globals=e.globals??"$g",this.locals=e.locals??"$l"}getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),r="global"===e.scope?this.globals:this.locals;return{getter:`${r}.get(${t})`,setter:e=>`${r}.set(${t}, ${e})`,postIncHelper:`${r}.postInc(${t})`,postDecHelper:`${r}.postDec(${t})`}}if("MemberExpression"===e.type){let t=this.expression(e.object),r="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:`${this.runtime}.prop(${t}, ${r})`,setter:e=>`${this.runtime}.setProp(${t}, ${r}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${t}, ${r})`,postDecHelper:`${this.runtime}.propPostDec(${t}, ${r})`}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals,s=t.join(", ");return{getter:`${n}.get(${r}, ${s})`,setter:e=>`${n}.set(${r}, ${s}, ${e})`,postIncHelper:`${n}.postInc(${r}, ${s})`,postDecHelper:`${n}.postDec(${r}, ${s})`}}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return{getter:`${this.runtime}.prop(${n}, ${i})`,setter:e=>`${this.runtime}.setProp(${n}, ${i}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${n}, ${i})`,postDecHelper:`${this.runtime}.propPostDec(${n}, ${i})`}}let r=this.expression(e.object),n=1===t.length?t[0]:`${this.runtime}.key(${t.join(", ")})`;return{getter:`${this.runtime}.getIndex(${r}, ${n})`,setter:e=>`${this.runtime}.setIndex(${r}, ${n}, ${e})`,postIncHelper:`${this.runtime}.indexPostInc(${r}, ${n})`,postDecHelper:`${this.runtime}.indexPostDec(${r}, ${n})`}}return null}generate(e){let t=[];for(let r of e.body){let e=this.statement(r);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line(`${this.expression(e.expression)};`);case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line(`${this.objectDeclaration(e)};`);case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error(`Unknown statement type: ${e.type}`)}}functionDeclaration(e){let t=h(e.name.name);if(t){let r=t.namespace,n=t.method;this.currentClass=r.toLowerCase(),this.currentFunction=n.toLowerCase();let s=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,`${this.line(`${this.runtime}.registerMethod(${JSON.stringify(r)}, ${JSON.stringify(n)}, function() {`)} -${s} -${this.line("});")}`}{let t=e.name.name;this.currentFunction=t.toLowerCase();let r=this.functionBody(e.body,e.params);return this.currentFunction=null,`${this.line(`${this.runtime}.registerFunction(${JSON.stringify(t)}, function() {`)} -${r} -${this.line("});")}`}}functionBody(e,t){this.indentLevel++;let r=[];r.push(this.line(`const ${this.locals} = ${this.runtime}.locals();`));for(let e=0;ethis.statement(e)).join("\n\n");return this.indentLevel--,`${this.line(`${this.runtime}.package(${t}, function() {`)} -${r} -${this.line("});")}`}datablockDeclaration(e){let t=JSON.stringify(e.className.name),r=e.instanceName?JSON.stringify(e.instanceName.name):"null",n=e.parent?JSON.stringify(e.parent.name):"null",s=this.objectBody(e.body);return this.line(`${this.runtime}.datablock(${t}, ${r}, ${n}, ${s});`)}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),r=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),n=[],s=[];for(let t of e.body)"Assignment"===t.type?n.push(t):s.push(t);let i=this.objectBody(n);if(s.length>0){let e=s.map(e=>this.objectDeclaration(e)).join(",\n");return`${this.runtime}.create(${t}, ${r}, ${i}, [ -${e} -])`}return`${this.runtime}.create(${t}, ${r}, ${i})`}objectBody(e){if(0===e.length)return"{}";let t=[];for(let r of e)if("Assignment"===r.type){let e=this.expression(r.value);if("Identifier"===r.target.type){let n=r.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?t.push(`${n}: ${e}`):t.push(`[${JSON.stringify(n)}]: ${e}`)}else if("IndexExpression"===r.target.type){let n=this.objectPropertyKey(r.target);t.push(`[${n}]: ${e}`)}else{let n=this.expression(r.target);t.push(`[${n}]: ${e}`)}}if(t.length<=1)return`{ ${t.join(", ")} }`;let r=this.indent.repeat(this.indentLevel+1),n=this.indent.repeat(this.indentLevel);return`{ -${r}${t.join(",\n"+r)} -${n}}`}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),r=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return`${this.runtime}.key(${t}, ${r})`}ifStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let n=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line(`if (${t}) ${r} else ${n}`)}else{let n=this.statementAsBlock(e.alternate);return this.line(`if (${t}) ${r} else ${n}`)}return this.line(`if (${t}) ${r}`)}forStatement(e){let t=e.init?this.expression(e.init):"",r=e.test?this.expression(e.test):"",n=e.update?this.expression(e.update):"",s=this.statementAsBlock(e.body);return this.line(`for (${t}; ${r}; ${n}) ${s}`)}whileStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.body);return this.line(`while (${t}) ${r}`)}doWhileStatement(e){let t=this.statementAsBlock(e.body),r=this.expression(e.test);return this.line(`do ${t} while (${r});`)}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let r=[];for(let t of e.cases)r.push(this.switchCase(t));return this.indentLevel--,`${this.line(`switch (${t}) {`)} -${r.join("\n")} -${this.line("}")}`}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let r of e.test)t.push(this.line(`case ${this.expression(r)}:`));else t.push(this.line(`case ${this.expression(e.test)}:`));for(let r of(this.indentLevel++,e.consequent))t.push(this.statement(r));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),r=[];for(let t of e.cases)if(null===t.test)r.push(`default: () => { ${this.blockContent(t.consequent)} }`);else if(Array.isArray(t.test))for(let e of t.test)r.push(`${this.expression(e)}: () => { ${this.blockContent(t.consequent)} }`);else r.push(`${this.expression(t.test)}: () => { ${this.blockContent(t.consequent)} }`);return this.line(`${this.runtime}.switchStr(${t}, { ${r.join(", ")} });`)}returnStatement(e){return e.value?this.line(`return ${this.expression(e.value)};`):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,`{ -${t} -${this.line("}")}`}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,`{ -${t} -${this.line("}")}`}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return`(${this.expression(e.test)} ? ${this.expression(e.consequent)} : ${this.expression(e.alternate)})`;case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return`${this.runtime}.deref(${this.expression(e.argument)})`;case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return`${this.runtime}.datablock(${JSON.stringify(e.className.name)}, ${e.instanceName?JSON.stringify(e.instanceName.name):"null"}, ${e.parent?JSON.stringify(e.parent.name):"null"}, ${this.objectBody(e.body)})`;default:throw Error(`Unknown expression type: ${e.type}`)}}identifier(e){let t=h(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?`${this.runtime}.nsRef(${JSON.stringify(t.namespace)}, ${JSON.stringify(t.method)})`:JSON.stringify(e.name)}variable(e){return"global"===e.scope?`${this.globals}.get(${JSON.stringify(e.name)})`:`${this.locals}.get(${JSON.stringify(e.name)})`}binaryExpression(e){let t=this.expression(e.left),r=this.expression(e.right),n=e.operator,s=this.concatExpression(t,n,r);if(s)return s;if("$="===n)return`${this.runtime}.streq(${t}, ${r})`;if("!$="===n)return`!${this.runtime}.streq(${t}, ${r})`;if("&&"===n||"||"===n)return`(${t} ${n} ${r})`;let i=d[n];return i?`${i}(${t}, ${r})`:`(${t} ${n} ${r})`}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?1:-1;return t.setter(`${this.runtime}.add(${t.getter}, ${r})`)}}let t=this.expression(e.argument);return"~"===e.operator?`${this.runtime}.bitnot(${t})`:"-"===e.operator?`${this.runtime}.neg(${t})`:`${e.operator}${t}`}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?t.postIncHelper:t.postDecHelper;if(r)return r}return`${this.expression(e.argument)}${e.operator}`}assignmentExpression(e){let t=this.expression(e.value),r=e.operator,n=this.getAccessInfo(e.target);if(!n)throw Error(`Unhandled assignment target type: ${e.target.type}`);if("="===r)return n.setter(t);{let e=r.slice(0,-1),s=this.compoundAssignmentValue(n.getter,e,t);return n.setter(s)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let r=e.callee.name,n=h(r);if(n&&"parent"===n.namespace.toLowerCase())if(this.currentClass)return`${this.runtime}.parent(${JSON.stringify(this.currentClass)}, ${JSON.stringify(n.method)}, arguments[0]${t?", "+t:""})`;else if(this.currentFunction)return`${this.runtime}.parentFunc(${JSON.stringify(this.currentFunction)}${t?", "+t:""})`;else throw Error("Parent:: call outside of function context");return n?`${this.runtime}.nsCall(${JSON.stringify(n.namespace)}, ${JSON.stringify(n.method)}${t?", "+t:""})`:`${this.functions}.call(${JSON.stringify(r)}${t?", "+t:""})`}if("MemberExpression"===e.callee.type){let r=this.expression(e.callee.object),n="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return`${this.runtime}.call(${r}, ${n}${t?", "+t:""})`}let r=this.expression(e.callee);return`${r}(${t})`}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?`${this.runtime}.prop(${t}, ${this.expression(e.property)})`:`${this.runtime}.prop(${t}, ${JSON.stringify(e.property.name)})`}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals;return`${n}.get(${r}, ${t.join(", ")})`}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return`${this.runtime}.prop(${n}, ${i})`}let r=this.expression(e.object);return 1===t.length?`${this.runtime}.getIndex(${r}, ${t[0]})`:`${this.runtime}.getIndex(${r}, ${this.runtime}.key(${t.join(", ")}))`}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,r){switch(t){case"@":return`${this.runtime}.concat(${e}, ${r})`;case"SPC":return`${this.runtime}.concat(${e}, " ", ${r})`;case"TAB":return`${this.runtime}.concat(${e}, "\\t", ${r})`;case"NL":return`${this.runtime}.concat(${e}, "\\n", ${r})`;default:return null}}compoundAssignmentValue(e,t,r){let n=this.concatExpression(e,t,r);if(n)return n;let s=d[t];return s?`${s}(${e}, ${r})`:`(${e} ${t} ${r})`}}e.s(["createRuntime",()=>G,"createScriptCache",()=>P],33870);var m=e.i(54970);class b{map=new Map;keyLookup=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let r=e.toLowerCase(),n=this.keyLookup.get(r);return void 0!==n?this.map.set(n,t):(this.keyLookup.set(r,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),r=this.keyLookup.get(t);return void 0!==r&&(this.keyLookup.delete(t),this.map.delete(r))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,r]of this.map)e(r,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}}class ${set=new Set;constructor(e){if(e)for(const t of e)this.add(t)}get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}}function y(e){return e.replace(/\\/g,"/").toLowerCase()}function x(e){return String(e??"")}function A(e){return Number(e)||0}function C(e){let t=x(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function S(e,t,r){let n=0;for(;t+n0;){if(n>=e.length)return"";let s=S(e,n,r);if(n+s>=e.length)return"";n+=s+1,t--}let s=S(e,n,r);return 0===s?"":e.substring(n,n+s)}function w(e,t,r,n){let s=0,i=t;for(;i>0;){if(s>=e.length)return"";let t=S(e,s,n);if(s+t>=e.length)return"";s+=t+1,i--}let o=s,a=r-t+1;for(;a>0;){let t=S(e,s,n);if((s+=t)>=e.length)break;s++,a--}let l=s;return l>o&&n.includes(e[l-1])&&l--,e.substring(o,l)}function E(e,t){if(""===e)return 0;let r=0;for(let n=0;nt&&o>=e.length)break}return i.join(s)}function k(e,t,r,n){let s=[],i=0,o=0;for(;it().$f.call(x(e),...r),eval(e){throw Error("eval() not implemented: requires runtime parsing and execution")},collapseescape:e=>x(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>x(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,r){console.warn(`export(${e}): not implemented`)},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>x(e).length,strchr(e,t){let r=x(e),n=x(t)[0]??"",s=r.indexOf(n);return s>=0?r.substring(s):""},strpos:(e,t,r)=>x(e).indexOf(x(t),A(r)),strcmp(e,t){let r=x(e),n=x(t);return rn)},stricmp(e,t){let r=x(e).toLowerCase(),n=x(t).toLowerCase();return rn)},strstr:(e,t)=>x(e).indexOf(x(t)),getsubstr(e,t,r){let n=x(e),s=A(t);return void 0===r?n.substring(s):n.substring(s,s+A(r))},getword:(e,t)=>v(x(e),A(t)," \n"),getwordcount:e=>E(x(e)," \n"),getfield:(e,t)=>v(x(e),A(t)," \n"),getfieldcount:e=>E(x(e)," \n"),setword:(e,t,r)=>_(x(e),A(t),x(r)," \n"," "),setfield:(e,t,r)=>_(x(e),A(t),x(r)," \n"," "),firstword:e=>v(x(e),0," \n"),restwords:e=>w(x(e),1,1e6," \n"),trim:e=>x(e).trim(),ltrim:e=>x(e).replace(/^\s+/,""),rtrim:e=>x(e).replace(/\s+$/,""),strupr:e=>x(e).toUpperCase(),strlwr:e=>x(e).toLowerCase(),strreplace:(e,t,r)=>x(e).split(x(t)).join(x(r)),filterstring:(e,t)=>x(e),stripchars(e,t){let r=x(e),n=new Set(x(t).split(""));return r.split("").filter(e=>!n.has(e)).join("")},getfields(e,t,r){let n=void 0!==r?Number(r):1e6;return w(x(e),A(t),n," \n")},getwords(e,t,r){let n=void 0!==r?Number(r):1e6;return w(x(e),A(t),n," \n")},removeword:(e,t)=>k(x(e),A(t)," \n"," "),removefield:(e,t)=>k(x(e),A(t)," \n"," "),getrecord:(e,t)=>v(x(e),A(t),"\n"),getrecordcount:e=>E(x(e),"\n"),setrecord:(e,t,r)=>_(x(e),A(t),x(r),"\n","\n"),removerecord:(e,t)=>k(x(e),A(t),"\n","\n"),nexttoken(e,t,r){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>x(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(A(e)),mfloor:e=>Math.floor(A(e)),mceil:e=>Math.ceil(A(e)),msqrt:e=>Math.sqrt(A(e)),mpow:(e,t)=>Math.pow(A(e),A(t)),msin:e=>Math.sin(A(e)),mcos:e=>Math.cos(A(e)),mtan:e=>Math.tan(A(e)),masin:e=>Math.asin(A(e)),macos:e=>Math.acos(A(e)),matan:(e,t)=>Math.atan2(A(e),A(t)),mlog:e=>Math.log(A(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(A(e)+1));let r=A(e);return Math.floor(Math.random()*(A(t)-r+1))+r},mdegtorad:e=>A(e)*(Math.PI/180),mradtodeg:e=>A(e)*(180/Math.PI),mfloatlength:(e,t)=>A(e).toFixed(A(t)),getboxcenter(e){let t=x(e).split(" ").map(Number),r=t[0]||0,n=t[1]||0,s=t[2]||0,i=t[3]||0,o=t[4]||0,a=t[5]||0;return`${(r+i)/2} ${(n+o)/2} ${(s+a)/2}`},vectoradd(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${r+i} ${n+o} ${s+a}`},vectorsub(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${r-i} ${n-o} ${s-a}`},vectorscale(e,t){let[r,n,s]=C(e),i=A(t);return`${r*i} ${n*i} ${s*i}`},vectordot(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return r*i+n*o+s*a},vectorcross(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${n*a-s*o} ${s*i-r*a} ${r*o-n*i}`},vectorlen(e){let[t,r,n]=C(e);return Math.sqrt(t*t+r*r+n*n)},vectornormalize(e){let[t,r,n]=C(e),s=Math.sqrt(t*t+r*r+n*n);return 0===s?"0 0 0":`${t/s} ${r/s} ${n/s}`},vectordist(e,t){let[r,n,s]=C(e),[i,o,a]=C(t),l=r-i,u=n-o,c=s-a;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,r,n,...s){let i=Number(e)||0,o=t(),a=setTimeout(()=>{o.state.pendingTimeouts.delete(a);try{o.$f.call(String(n),...s)}catch(e){throw console.error(`schedule: error calling ${n}:`,e),e}},i);return o.state.pendingTimeouts.add(a),a},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let r=String(e??"");if(console.debug(`exec(${JSON.stringify(r)}): preparing to execute…`),!r.includes("."))return console.error(`exec: invalid script file name ${JSON.stringify(r)}.`),!1;let n=y(r),s=t(),{executedScripts:i,scripts:o}=s.state;if(i.has(n))return console.debug(`exec(${JSON.stringify(r)}): skipping (already executed)`),!0;let a=o.get(n);return null==a?(console.warn(`exec(${JSON.stringify(r)}): script not found`),!1):(i.add(n),console.debug(`exec(${JSON.stringify(r)}): executing!`),s.executeAST(a),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>r?r.isFile(x(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=x(e),r=t.lastIndexOf(".");return r>=0?t.substring(r):""},filebase(e){let t=x(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),n=t.lastIndexOf("."),s=r>=0?r+1:0,i=n>s?n:t.length;return t.substring(s,i)},filepath(e){let t=x(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.substring(0,r):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile:e=>r?(i=x(e),n=r.findFiles(i),s=0,n[s++]??""):(console.warn("findFirstFile(): no fileSystem handler configured"),""),findnextfile(e){let t=x(e);if(t!==i){if(!r)return"";i=t,n=r.findFiles(t)}return n[s++]??""},getfilecrc:e=>x(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(x(e))},deactivatepackage(e){t().$.deactivatePackage(x(e))},ispackage:e=>t().$.isPackage(x(e)),isactivepackage:e=>t().$.isActivePackage(x(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource:(...e)=>0,alxgetwavelen:e=>0,alxlistenerf(e,t){},alxplay:(...e)=>0,alxsetchannelvolume(e,t){},alxsourcef(e,t,r){},alxstop(e){},alxstopall(){},activatedirectinput(){},activatekeyboard(){},deactivatedirectinput(){},deactivatekeyboard(){},disablejoystick(){},enablejoystick(){},enablewinconsole(e){},isjoystickdetected:()=>!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,r,n){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring:(e,...t)=>"",detag:e=>x(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){},commandtoserver(e){},cancelserverquery(){},querymasterserver(){},querysingleserver(){},setnetport:e=>!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty:(...e)=>!0,containerraycast:(...e)=>"",containersearchcurrdist:()=>0,containersearchnext:()=>0,initcontainerradiussearch(){},calcexplosioncoverage:(...e)=>1,getcontrolobjectaltitude:()=>0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){},pathonmissionloaddone(){}}}function L(e){return e.toLowerCase()}function N(e){let t=e.trim();return L(t.startsWith("$")?t.slice(1):t)}function O(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function I(e,t){for(let r of t)e.add(L(r))}function j(e,t,r){if(e.anyClassValues.has("*")||e.anyClassValues.has(r))return!0;for(let n of t){let t=e.valuesByClass.get(L(n));if(t&&(t.has("*")||t.has(r)))return!0}return!1}let T=[{classNames:["SceneObject","GameBase","ShapeBase","Item","Player"],fields:["position","rotation","scale","transform","hidden","renderingdistance","datablock","shapename","shapefile","initialbarrel","skin","team","health","energy","energylevel","damagelevel","damageflash","damagepercent","damagestate","mountobject","mountedimage","targetposition","targetrotation","targetscale","missiontypeslist","renderenabled","vis","velocity","name"]},{classNames:["*"],fields:["position","rotation","scale","hidden","shapefile","datablock"]}],M=[{classNames:["SceneObject","GameBase","ShapeBase","SimObject"],methods:["settransform","setposition","setrotation","setscale","sethidden","setdatablock","setshapename","mountimage","unmountimage","mountobject","unmountobject","setdamagelevel","setenergylevel","schedule","delete","deleteallobjects","add","remove","playthread","stopthread","setthreaddir","pausethread"]},{classNames:["*"],methods:["settransform","setscale","delete","add","remove"]}],B=["missionrunning","loadingmission"];function P(){return{scripts:new Map,generatedCode:new WeakMap}}function H(e){return e.toLowerCase()}function D(e){return Number(e)>>>0}function F(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error(`Invalid instance name type: ${typeof e}`)}function G(e={}){let t,r,n,s=e.reactiveFieldRules??T,i=e.reactiveMethodRules??M,o=e.reactiveGlobalNames??B,a=(t=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=L(e);if("*"===s){I(t,n.fields);continue}I(O(r,s),n.fields)}return{anyClassValues:t,valuesByClass:r}}(s),(e,r)=>j(t,e,L(r))),l=(r=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=L(e);if("*"===s){I(t,n.methods);continue}I(O(r,s),n.methods)}return{anyClassValues:t,valuesByClass:r}}(i),(e,t)=>j(r,e,L(t))),u=(n=function(e){let t=new Set;for(let r of e)t.add(N(r));return t}(o),e=>{let t=N(e);return n.has("*")||n.has(t)}),c=new b,p=new b,f=new b,h=[],d=new $,x=3,A=1027,C=new Map,S=new b,v=new b,w=new b,E=new b,_=new b,k=new Set,U=[],J=!1,K=0;if(e.globals)for(let[t,r]of Object.entries(e.globals)){if(!t.startsWith("$"))throw Error(`Global variable "${t}" must start with $, e.g. "$${t}"`);w.set(t.slice(1),r)}let W=new Set,z=new Set,V=e.ignoreScripts&&e.ignoreScripts.length>0?(0,m.default)(e.ignoreScripts,{nocase:!0}):null,Z=e.cache??P(),Q=Z.scripts,X=Z.generatedCode,Y=new Map;function ee(e){let t=Y.get(e);return t&&t.length>0?t[t.length-1]:void 0}function et(e,t,r){let n;(n=Y.get(e))||(n=[],Y.set(e,n)),n.push(t);try{return r()}finally{let t;(t=Y.get(e))&&t.pop()}}function er(e,t){return`${e.toLowerCase()}::${t.toLowerCase()}`}function en(e,t){return c.get(e)?.get(t)??null}function es(e){if(!e)return[];let t=[],r=new Set,n=e.class||e._className||e._class,s=n?H(String(n)):"";for(;s&&!r.has(s);)t.push(s),r.add(s),s=_.get(s)??"";return e._superClass&&!r.has(e._superClass)&&t.push(e._superClass),t}function ei(){if(J=!1,0===U.length)return;let e=U.splice(0,U.length);for(let t of(K+=1,k))t({type:"batch.flushed",tick:K,events:e})}function eo(e){for(let t of(U.push(e),k))t(e);J||(J=!0,queueMicrotask(ei))}function ea(e){eo({type:"object.created",objectId:e._id,object:e})}function el(e,t,r,n){let s=H(t);Object.is(r,n)||a(es(e),s)&&eo({type:"field.changed",objectId:e._id,field:s,value:r,previousValue:n,object:e})}let eu=new Set,ec=null,ep=null,ef=(e.builtins??R)({runtime:()=>ep,fileSystem:e.fileSystem??null});function eh(e){let t=f.get(e);if(!t)return void d.add(e);if(!t.active){for(let[e,r]of(t.active=!0,h.push(t.name),t.methods)){c.has(e)||c.set(e,new b);let t=c.get(e);for(let[e,n]of r)t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[e,r]of t.functions)p.has(e)||p.set(e,[]),p.get(e).push(r)}}function ed(e){return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?S.get(e)??null:"number"==typeof e?C.get(e)??null:null}function eg(e,t,r){let n=ed(e);if(null==n)return 0;let s=ey(n[t]);return n[t]=s+r,el(n,t,n[t],s),s}function em(e,t){let r=en(e,t);return r&&r.length>0?r[r.length-1]:null}function eb(e,t,r,n){let s=en(e,t);return s&&0!==s.length?{found:!0,result:et(er(e,t),s.length-1,()=>s[s.length-1](r,...n))}:{found:!1}}function e$(e,t,r,n){let s;l((s=es(r)).length?s:[e],t)&&eo({type:"method.called",className:H(e),methodName:H(t),objectId:r._id,args:[...n]});let i=E.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(r,...n)}}function ey(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function ex(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),r=null;for(let e=0;et._name?.toLowerCase()===e)??null}if(!r)return null}}return r}function eA(e){return null==e||""===e?null:ex(String(e))}function eC(e,t){function r(e,t){return e+t.join("_")}return{get:(t,...n)=>e.get(r(t,n))??"",set(n,...s){if(0===s.length)throw Error("set() requires at least a value argument");if(1===s.length){let r=e.get(n);return e.set(n,s[0]),t?.onSet?.(n,s[0],r),s[0]}let i=s[s.length-1],o=r(n,s.slice(0,-1)),a=e.get(o);return e.set(o,i),t?.onSet?.(o,i,a),i},postInc(n,...s){let i=r(n,s),o=ey(e.get(i)),a=o+1;return e.set(i,a),t?.onSet?.(i,a,o),o},postDec(n,...s){let i=r(n,s),o=ey(e.get(i)),a=o-1;return e.set(i,a),t?.onSet?.(i,a,o),o}}}function eS(){return eC(new b)}let ev={registerMethod:function(e,t,r){if(ec)ec.methods.has(e)||ec.methods.set(e,new b),ec.methods.get(e).set(t,r);else{c.has(e)||c.set(e,new b);let n=c.get(e);n.has(t)||n.set(t,[]),n.get(t).push(r)}},registerFunction:function(e,t){ec?ec.functions.set(e,t):(p.has(e)||p.set(e,[]),p.get(e).push(t))},package:function(e,t){let r=f.get(e);r||(r={name:e,active:!1,methods:new b,functions:new b},f.set(e,r));let n=ec;ec=r,t(),ec=n,d.has(e)&&(d.delete(e),eh(e))},activatePackage:eh,deactivatePackage:function(e){let t=f.get(e);if(!t||!t.active)return;t.active=!1;let r=h.findIndex(t=>t.toLowerCase()===e.toLowerCase());for(let[e,n]of(-1!==r&&h.splice(r,1),t.methods)){let t=c.get(e);if(t)for(let[e,r]of n){let n=t.get(e);if(n){let e=n.indexOf(r);-1!==e&&n.splice(e,1)}}}for(let[e,r]of t.functions){let t=p.get(e);if(t){let e=t.indexOf(r);-1!==e&&t.splice(e,1)}}},create:function(e,t,r,n){let s=H(e),i=function(){for(;C.has(A);)A+=1;let e=A;return A+=1,e}(),o={_class:s,_className:e,_id:i};for(let[e,t]of Object.entries(r))o[H(e)]=t;o.superclass&&(o._superClass=H(String(o.superclass)),o.class&&_.set(H(String(o.class)),o._superClass)),C.set(i,o);let a=F(t);if(a&&(o._name=a,S.set(a,o)),n){for(let e of n)e._parent=o;o._children=n}let l=em(e,"onAdd");return l&&l(o),ea(o),o},datablock:function(e,t,r,n){let s=H(e),i=function(){for(;C.has(x);)x+=1;let e=x;return x+=1,e}(),o={_class:s,_className:e,_id:i,_isDatablock:!0},a=F(r);if(a){let e=v.get(a);if(e){for(let[t,r]of Object.entries(e))t.startsWith("_")||(o[t]=r);o._parent=e}}for(let[e,t]of Object.entries(n))o[H(e)]=t;C.set(i,o);let l=F(t);return l&&(o._name=l,S.set(l,o),v.set(l,o)),ea(o),o},deleteObject:function e(t){var r;let n;if(null==t||("number"==typeof t?n=C.get(t):"string"==typeof t?n=S.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let s=em(n._className,"onRemove");if(s&&s(n),C.delete(n._id),n._name&&S.delete(n._name),n._isDatablock&&n._name&&v.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return eo({type:"object.deleted",objectId:(r=n)._id,object:r}),!0},prop:function(e,t){let r=ed(e);return null==r?"":r[H(t)]??""},setProp:function(e,t,r){let n=ed(e);if(null==n)return r;let s=H(t),i=n[s];return n[s]=r,el(n,s,r,i),r},getIndex:function(e,t){let r=ed(e);return null==r?"":r[String(t)]??""},setIndex:function(e,t,r){let n=ed(e);if(null==n)return r;let s=String(t),i=n[s];return n[s]=r,el(n,s,r,i),r},propPostInc:function(e,t){return eg(e,H(t),1)},propPostDec:function(e,t){return eg(e,H(t),-1)},indexPostInc:function(e,t){return eg(e,String(t),1)},indexPostDec:function(e,t){return eg(e,String(t),-1)},key:function(e,...t){return e+t.join("_")},call:function(e,t,...r){if(null==e||("string"==typeof e||"number"==typeof e)&&null==(e=eA(e)))return"";let n=e.class||e._className||e._class;if(n){let s=eb(n,t,e,r);if(s.found)return e$(n,t,e,r),s.result}let s=e._superClass||_.get(n);for(;s;){let n=eb(s,t,e,r);if(n.found)return e$(s,t,e,r),n.result;s=_.get(s)}return""},nsCall:function(e,t,...r){let n=en(e,t);if(!n||0===n.length)return"";let s=er(e,t),i=n[n.length-1],o=et(s,n.length-1,()=>i(...r)),a=r[0];return a&&"object"==typeof a&&e$(e,t,a,r.slice(1)),o},nsRef:function(e,t){let r=en(e,t);if(!r||0===r.length)return null;let n=er(e,t),s=r[r.length-1];return(...e)=>et(n,r.length-1,()=>s(...e))},parent:function(e,t,r,...n){let s=en(e,t),i=er(e,t),o=ee(i);if(s&&void 0!==o&&o>=1){let a=o-1,l=et(i,a,()=>s[a](r,...n));return r&&"object"==typeof r&&e$(e,t,r,n),l}let a=_.get(e);for(;a;){let e=en(a,t);if(e&&e.length>0){let s=et(er(a,t),e.length-1,()=>e[e.length-1](r,...n));return r&&"object"==typeof r&&e$(a,t,r,n),s}a=_.get(a)}return""},parentFunc:function(e,...t){let r=p.get(e);if(!r)return"";let n=e.toLowerCase(),s=ee(n);if(void 0===s||s<1)return"";let i=s-1;return et(n,i,()=>r[i](...t))},add:function(e,t){return ey(e)+ey(t)},sub:function(e,t){return ey(e)-ey(t)},mul:function(e,t){return ey(e)*ey(t)},div:function(e,t){return ey(e)/ey(t)},neg:function(e){return-ey(e)},lt:function(e,t){return ey(e)ey(t)},ge:function(e,t){return ey(e)>=ey(t)},eq:function(e,t){return ey(e)===ey(t)},ne:function(e,t){return ey(e)!==ey(t)},mod:function(e,t){let r=0|Number(t);return 0===r?0:(0|Number(e))%r},bitand:function(e,t){return D(e)&D(t)},bitor:function(e,t){return D(e)|D(t)},bitxor:function(e,t){return D(e)^D(t)},shl:function(e,t){return D(D(e)<<(31&D(t)))},shr:function(e,t){return D(e)>>>(31&D(t))},bitnot:function(e){return~D(e)>>>0},concat:function(...e){return e.map(e=>String(e??"")).join("")},streq:function(e,t){return String(e??"").toLowerCase()===String(t??"").toLowerCase()},switchStr:function(e,t){let r=String(e??"").toLowerCase();for(let[e,n]of Object.entries(t))if("default"!==e&&H(e)===r)return void n();t.default&&t.default()},deref:eA,nameToId:function(e){let t=ex(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?C.has(e):"string"==typeof e&&S.has(e)))},isFunction:function(e){return p.has(e)||e.toLowerCase()in ef},isPackage:function(e){return f.has(e)},isActivePackage:function(e){let t=f.get(e);return t?.active??!1},getPackageList:function(){return h.join(" ")},locals:eS,onMethodCalled(e,t,r){let n=E.get(e);n||(n=new b,E.set(e,n));let s=n.get(t);return s||(s=[],n.set(t,s)),s.push(r),()=>{let e=s.indexOf(r);-1!==e&&s.splice(e,1)}}},ew={call(e,...t){let r=p.get(e);if(r&&r.length>0)return et(e.toLowerCase(),r.length-1,()=>r[r.length-1](...t));let n=ef[e.toLowerCase()];return n?n(...t):(console.warn(`Unknown function: ${e}(${t.map(e=>JSON.stringify(e)).join(", ")})`),"")}},eE=eC(w,{onSet:function(e,t,r){let n=H(e.startsWith("$")?e.slice(1):e);Object.is(t,r)||u(n)&&eo({type:"global.changed",name:n,value:t,previousValue:r})}}),e_={methods:c,functions:p,packages:f,activePackages:h,objectsById:C,objectsByName:S,datablocks:v,globals:w,executedScripts:W,failedScripts:z,scripts:Q,generatedCode:X,pendingTimeouts:eu,startTime:Date.now()};function ek(e){let t=function(e){let t=X.get(e);null==t&&(t=new g(void 0).generate(e),X.set(e,t));return t}(e),r=eS();Function("$","$f","$g","$l",t)(ev,ew,eE,r)}function eR(e,t){return{execute(){if(t){let e=y(t);e_.executedScripts.add(e)}ek(e)}}}async function eL(t,r,n){let s=e.loadScript;if(!s){t.length>0&&console.warn("Script has exec() calls but no loadScript provided:",t);return}async function i(t){e.signal?.throwIfAborted();let i=y(t);if(e_.scripts.has(i)||e_.failedScripts.has(i))return;if(V&&V(i)){console.warn(`Ignoring script: ${t}`),e_.failedScripts.add(i);return}if(n.has(i))return;let o=r.get(i);if(o)return void await o;e.progress?.addItem(t);let a=(async()=>{let o,a=await s(t);if(null==a){console.warn(`Script not found: ${t}`),e_.failedScripts.add(i),e.progress?.completeItem();return}try{o=q(a,{filename:t})}catch(r){console.warn(`Failed to parse script: ${t}`,r),e_.failedScripts.add(i),e.progress?.completeItem();return}let l=new Set(n);l.add(i),await eL(o.execScriptPaths,r,l),e_.scripts.set(i,o),e.progress?.completeItem()})();r.set(i,a),await a}await Promise.all(t.map(i))}async function eN(t){let r=e.loadScript;if(!r)throw Error("loadFromPath requires loadScript option to be set");let n=y(t);if(e_.scripts.has(n))return eR(e_.scripts.get(n),t);e.progress?.addItem(t);let s=await r(t);if(null==s)throw e.progress?.completeItem(),Error(`Script not found: ${t}`);let i=await eO(s,{path:t});return e.progress?.completeItem(),i}async function eO(e,t){if(t?.path){let e=y(t.path);if(e_.scripts.has(e))return eR(e_.scripts.get(e),t.path)}return eI(q(e,{filename:t?.path}),t)}async function eI(t,r){let n=new Map,s=new Set;if(r?.path){let e=y(r.path);e_.scripts.set(e,t),s.add(e)}let i=[...t.execScriptPaths,...e.preloadScripts??[]];return await eL(i,n,s),eR(t,r?.path)}return ep={$:ev,$f:ew,$g:eE,state:e_,destroy:function(){for(let e of(U.length>0&&ei(),e_.pendingTimeouts))clearTimeout(e);e_.pendingTimeouts.clear(),k.clear()},executeAST:ek,loadFromPath:eN,loadFromSource:eO,loadFromAST:eI,call:(e,...t)=>ew.call(e,...t),getObjectByName:e=>S.get(e),subscribeRuntimeEvents:e=>(k.add(e),()=>{k.delete(e)})}}function U(){let e=new Set,t=0,r=0,n=null;function s(){for(let t of e)t()}return{get total(){return t},get loaded(){return r},get current(){return n},get progress(){return 0===t?0:r/t},on(t,r){e.add(r)},off(t,r){e.delete(r)},addItem(e){t++,n=e,s()},completeItem(){r++,n=null,s()},setCurrent(e){n=e,s()}}}function q(e,t){try{return f.default.parse(e)}catch(e){if(t?.filename&&e.location)throw Error(`${t.filename}:${e.location.start.line}:${e.location.start.column}: ${e.message}`,{cause:e});throw e}}function J(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();return""!==t&&"0"!==t&&"false"!==t}return!!e}function K(){let e=Error("Operation aborted");return e.name="AbortError",e}function W(e){let t,{missionName:r,missionType:n,runtimeOptions:s,onMissionLoadDone:i}=e,{signal:o,fileSystem:a,globals:l={},preloadScripts:u=[],reactiveGlobalNames:c}=s??{},p=a?.findFiles("scripts/*Game.cs")??[],f=c?Array.from(new Set([...c,"missionRunning"])):void 0,h=G({...s,reactiveGlobalNames:f,globals:{...l,"$Host::Map":r,"$Host::MissionType":n},preloadScripts:[...u,...p]});(t=h.$.registerMethod.bind(h.$))("ShapeBase","playThread",(e,t,r)=>{e._threads||(e._threads={}),e._threads[Number(t)]={sequence:String(r),playing:!0,direction:!0}}),t("ShapeBase","stopThread",(e,t)=>{e._threads&&delete e._threads[Number(t)]}),t("ShapeBase","setThreadDir",(e,t,r)=>{e._threads||(e._threads={});let n=Number(t);e._threads[n]?e._threads[n].direction=!!Number(r):e._threads[n]={sequence:"",playing:!1,direction:!!Number(r)}}),t("ShapeBase","pauseThread",(e,t)=>{e._threads?.[Number(t)]&&(e._threads[Number(t)].playing=!1)}),t("ShapeBase","playAudio",()=>{}),t("ShapeBase","stopAudio",()=>{}),t("SimObject","getDatablock",e=>{let t=e.datablock;return t?h.getObjectByName(String(t))??"":""}),t("SimObject","getGroup",e=>e._parent??""),t("SimObject","getName",e=>e._name??""),t("SimObject","getType",()=>16384),t("SimGroup","getCount",e=>e._children?e._children.length:0),t("SimGroup","getObject",(e,t)=>{let r=e._children;return r?r[Number(t)]??"":""}),t("GameBase","isEnabled",()=>!0),t("GameBase","isDisabled",()=>!1),t("GameBase","setPoweredState",()=>{}),t("GameBase","setRechargeRate",()=>{}),t("GameBase","getRechargeRate",()=>0),t("GameBase","setEnergyLevel",()=>{}),t("GameBase","getEnergyLevel",()=>0),t("ShapeBase","getDamageLevel",()=>0),t("ShapeBase","setDamageLevel",()=>{}),t("ShapeBase","getRepairRate",()=>0),t("ShapeBase","setRepairRate",()=>{}),t("ShapeBase","getDamagePercent",()=>0),t("GameBase","getControllingClient",()=>0),t("SimObject","schedule",(e,t,r,...n)=>{let s=setTimeout(()=>{h.state.pendingTimeouts.delete(s);try{h.$.call(e,String(r),...n)}catch(t){console.error(`schedule: error calling ${r} on ${e._id}:`,t)}},Number(t)||0);return h.state.pendingTimeouts.add(s),s});let d=async function(){try{let e=await h.loadFromPath("scripts/server.cs");o?.throwIfAborted(),await h.loadFromPath(`missions/${r}.mis`),o?.throwIfAborted(),e.execute();let t=function(e,t){let{signal:r,onMissionLoadDone:n}=t;return new Promise((t,s)=>{let i=!1,o=!1,a=()=>J(e.$g.get("missionRunning")),l=()=>{i||(i=!0,h(),t())},u=e=>{i||(i=!0,h(),s(e))},c=t=>{if(!n||o)return;let r=t??e.getObjectByName("Game");r&&(o=!0,n(r))},p=()=>u(K()),f=e.subscribeRuntimeEvents(e=>{if("global.changed"===e.type&&"missionrunning"===e.name){J(e.value)&&(c(),l());return}"batch.flushed"===e.type&&a()&&(c(),l())});function h(){f(),r?.removeEventListener("abort",p)}if(r){if(r.aborted)return void u(K());r.addEventListener("abort",p,{once:!0})}a()&&(c(),l())})}(h,{signal:o,onMissionLoadDone:i}),n=await h.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");o?.throwIfAborted(),n.execute(),await t}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:h,ready:d}}e.s(["createProgressTracker",()=>U],38433);let z=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,V=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,Z=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i,Q={arena:"Arena",bounty:"Bounty",cnh:"CnH",ctf:"CTF",dm:"DM",dnd:"DnD",hunters:"Hunters",lakrabbit:"LakRabbit",lakzm:"LakZM",lctf:"LCTF",none:"None",rabbit:"Rabbit",sctf:"SCtF",siege:"Siege",singleplayer:"SinglePlayer",tdm:"TDM",teamhunters:"TeamHunters",teamlak:"TeamLak",tr2:"TR2"};function X(e){let t=q(e),{pragma:r,sections:n}=function(e){let t={},r=[],n={name:null,comments:[]};for(let s of e.body)if("Comment"===s.type){let e=function(e){let t;return(t=e.match(V))?{type:"sectionBegin",name:t[1]}:(t=e.match(Z))?{type:"sectionEnd",name:t[1]}:(t=e.match(z))?{type:"definition",identifier:t[1],value:t[2]}:null}(s.value);if(e)switch(e.type){case"definition":null===n.name?t[e.identifier.toLowerCase()]=e.value:n.comments.push(s.value);break;case"sectionBegin":(null!==n.name||n.comments.length>0)&&r.push(n),n={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==n.name&&r.push(n),n={name:null,comments:[]}}else n.comments.push(s.value)}return(null!==n.name||n.comments.length>0)&&r.push(n),{pragma:t,sections:r}}(t);function s(e){return n.find(t=>t.name===e)?.comments.map(e=>e.trimStart()).join("\n")??null}return{displayName:r.displayname??null,missionTypes:r.missiontypes?.split(/\s+/).filter(Boolean).map(e=>Q[e.toLowerCase()]??e)??[],missionBriefing:s("MISSION BRIEFING"),briefingWav:r.briefingwav??null,bitmap:r.bitmap??null,planetName:r.planetname??null,missionBlurb:s("MISSION BLURB"),missionQuote:s("MISSION QUOTE"),missionString:s("MISSION STRING"),execScriptPaths:t.execScriptPaths,hasDynamicExec:t.hasDynamicExec,ast:t}}function Y(e,t){if(e)return e[t.toLowerCase()]}function ee(e){let[t,r,n]=(e.position??"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}function et(e){let[t,r,n]=(e.scale??"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}e.s(["getPosition",()=>ee,"getProperty",()=>Y,"getScale",()=>et,"parseMissionScript",()=>X],62395);let er="/t2-mapper",en=`${er}/base/`,es=`${er}/magenta.png`;function ei(e,t){let r;try{r=o(e)}catch(r){if(t)return console.warn(`Resource "${e}" not found - rendering fallback.`),t;throw r}let[n,s]=i(r);return n?`${en}@vl2/${n}/${s}`:`${en}${s}`}function eo(e){return ei(`interiors/${e}`).replace(/\.dif$/i,".glb")}function ea(e){return ei(`shapes/${e}`).replace(/\.dts$/i,".glb")}function el(e){return e=e.replace(/^terrain\./,""),ei(u(`textures/terrain/${e}`),es)}function eu(e,r){let n=t(r).split("/"),s=n.length>1?n.slice(0,-1).join("/")+"/":"";return ei(u(`${s}${e}`),es)}function ec(e){return ei(u(`textures/${e}`),es)}function ep(e){return ei(`audio/${e}`).replace(/\.wav$/i,".ogg")}async function ef(e){let t=ei(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function eh(e){let t,r=c(e),n=await fetch(ei(r.resourcePath)),s=await n.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(s)}catch{t=new TextDecoder("windows-1252").decode(s)}return X(t=t.replaceAll("�","'"))}async function ed(e){let t=await fetch(ei(`terrains/${e}`));return function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),s=new Uint16Array(65536),i=[],o=e=>{let n="";for(let s=0;s0&&i.push(s)}let a=[];for(let e of i){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let s=t.getUint8(r++);e[n]=s}a.push(e)}return{version:n,textureNames:i,heightMap:s,alphaMaps:a}}(await t.arrayBuffer())}async function eg(e){let t=ei(e),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["FALLBACK_TEXTURE_URL",0,es,"RESOURCE_ROOT_URL",0,en,"audioToUrl",()=>ep,"getUrlForPath",()=>ei,"iflTextureToUrl",()=>eu,"interiorToUrl",()=>eo,"loadDetailMapList",()=>ef,"loadImageFrameList",()=>eg,"loadMission",()=>eh,"loadTerrain",()=>ed,"shapeToUrl",()=>ea,"terrainTextureToUrl",()=>el,"textureToUrl",()=>ec],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/5b60a5e8e48bc409.js b/docs/_next/static/chunks/5b60a5e8e48bc409.js deleted file mode 100644 index 36a0c378..00000000 --- a/docs/_next/static/chunks/5b60a5e8e48bc409.js +++ /dev/null @@ -1,397 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66936,(e,t,n)=>{"use strict";function i(e,t){var n=e.length;for(e.push(t);0>>1,r=e[i];if(0>>1;is(l,n))us(c,l)?(e[i]=c,e[u]=n,i=u):(e[i]=l,e[o]=n,i=o);else if(us(c,n))e[i]=c,e[u]=n,i=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,_=!1,y=!1,x="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,S="u">typeof setImmediate?setImmediate:null;function M(e){for(var t=r(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,i(h,t);else break;t=r(d)}}function T(e){if(_=!1,M(e),!v)if(null!==r(h))v=!0,w||(w=!0,o());else{var t=r(d);null!==t&&N(T,t.startTime-e)}}var w=!1,E=-1,A=5,C=-1;function R(){return!!y||!(n.unstable_now()-Ce&&R());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,M(e),t=!0;break t}f===r(h)&&a(h),M(e)}else a(h);f=r(h)}if(null!==f)t=!0;else{var u=r(d);null!==u&&N(T,u.startTime-e),t=!1}}break e}finally{f=null,m=i,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof S)o=function(){S(P)};else if("u">typeof MessageChannel){var I=new MessageChannel,L=I.port2;I.port1.onmessage=P,o=function(){L.postMessage(null)}}else o=function(){x(P,0)};function N(e,t){E=x(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_forceFrameRate=function(e){0>e||125s?(e.sortIndex=a,i(d,e),null===r(h)&&e===r(d)&&(_?(b(E),E=-1):_=!0,N(T,a-s))):(e.sortIndex=l,i(h,e),v||g||(v=!0,w||(w=!0,o()))),e},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},89499,(e,t,n)=>{"use strict";t.exports=e.r(66936)},40859,90072,8560,46791,e=>{"use strict";let t,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g,v,_;var y,x,b,S,M,T,w=e.i(47167),E=e.i(71645);let A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},C={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},R="attached",P="detached",I="srgb",L="srgb-linear",N="linear",U="srgb",D="300 es",O={COMPUTE:"compute",RENDER:"render"},F={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},z={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function B(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let k={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function V(e,t){return new k[e](t)}function H(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function G(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function W(){let e=G("canvas");return e.style.display="block",e}let j={},X=null;function q(e){X=e}function Y(){return X}function Z(...e){let t="THREE."+e.shift();X?X("log",t,...e):console.log(t,...e)}function J(...e){let t="THREE."+e.shift();X?X("warn",t,...e):console.warn(t,...e)}function K(...e){let t="THREE."+e.shift();X?X("error",t,...e):console.error(t,...e)}function $(...e){let t=e.join(" ");t in j||(j[t]=!0,J(...e))}function Q(e,t,n){return new Promise(function(i,r){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}},n)})}class ee{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let i=n[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,i=t.length;n>8&255]+et[e>>16&255]+et[e>>24&255]+"-"+et[255&t]+et[t>>8&255]+"-"+et[t>>16&15|64]+et[t>>24&255]+"-"+et[63&n|128]+et[n>>8&255]+"-"+et[n>>16&255]+et[n>>24&255]+et[255&i]+et[i>>8&255]+et[i>>16&255]+et[i>>24&255]).toLowerCase()}function es(e,t,n){return Math.max(t,Math.min(n,e))}function eo(e,t){return(e%t+t)%t}function el(e,t,n){return(1-n)*e+n*t}function eu(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function ec(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let eh={DEG2RAD:ei,RAD2DEG:er,generateUUID:ea,clamp:es,euclideanModulo:eo,mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:el,damp:function(e,t,n,i){return el(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(eo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(en=e);let t=en+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*ei},radToDeg:function(e){return e*er},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){let a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((t+i)/2),c=s((t+i)/2),h=a((t-i)/2),d=s((t-i)/2),p=a((i-t)/2),f=s((i-t)/2);switch(r){case"XYX":e.set(o*c,l*h,l*d,o*u);break;case"YZY":e.set(l*d,o*c,l*h,o*u);break;case"ZXZ":e.set(l*h,l*d,o*c,o*u);break;case"XZX":e.set(o*c,l*f,l*p,o*u);break;case"YXY":e.set(l*p,o*c,l*f,o*u);break;case"ZYZ":e.set(l*f,l*p,o*c,o*u);break;default:J("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:ec,denormalize:eu};class ed{constructor(e=0,t=0){ed.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(es(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ep{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],u=n[i+2],c=n[i+3],h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(s<=0){e[t+0]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c;return}if(s>=1){e[t+0]=h,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||o!==h||l!==d||u!==p){let e=o*h+l*d+u*p+c*f;e<0&&(h=-h,d=-d,p=-p,f=-f,e=-e);let t=1-s;if(e<.9995){let n=Math.acos(e),i=Math.sin(n);o=o*(t=Math.sin(t*n)/i)+h*(s=Math.sin(s*n)/i),l=l*t+d*s,u=u*t+p*s,c=c*t+f*s}else{let e=1/Math.sqrt((o=o*t+h*s)*o+(l=l*t+d*s)*l+(u=u*t+p*s)*u+(c=c*t+f*s)*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,i,r,a){let s=n[i],o=n[i+1],l=n[i+2],u=n[i+3],c=r[a],h=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+u*c+o*d-l*h,e[t+1]=o*p+u*h+l*c-s*d,e[t+2]=l*p+u*d+s*h-o*c,e[t+3]=u*p-s*c-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),u=s(i/2),c=s(r/2),h=o(n/2),d=o(i/2),p=o(r/2);switch(a){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:J("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],u=t[6],c=t[10],h=n+s+c;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>c){let e=2*Math.sqrt(1+n-s-c);this._w=(u-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>c){let e=2*Math.sqrt(1+s-n-c);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+u)/e}else{let e=2*Math.sqrt(1+c-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(es(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)return this;let i=Math.min(1,t/n);return this.slerp(e,i),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+a*s+i*l-r*o,this._y=i*u+a*o+r*s-n*l,this._z=r*u+a*l+n*o-i*s,this._w=a*u-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,i=e._y,r=e._z,a=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let o=1-t;if(s<.9995){let e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ef{constructor(e=0,t=0,n=0){ef.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(eg.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(eg.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),u=2*(s*t-r*i),c=2*(r*n-a*t);return this.x=t+o*l+a*c-s*u,this.y=n+o*u+s*l-r*c,this.z=i+o*c+r*u-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this.z=es(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this.z=es(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return em.copy(this).projectOnVector(e),this.sub(em)}reflect(e){return this.sub(em.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(es(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let em=new ef,eg=new ep;class ev{constructor(e,t,n,i,r,a,s,o,l){ev.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){let u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=t,u[4]=r,u[5]=o,u[6]=n,u[7]=a,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],b=i[5],S=i[8];return r[0]=a*f+s*v+o*x,r[3]=a*m+s*_+o*b,r[6]=a*g+s*y+o*S,r[1]=l*f+u*v+c*x,r[4]=l*m+u*_+c*b,r[7]=l*g+u*y+c*S,r[2]=h*f+d*v+p*x,r[5]=h*m+d*_+p*b,r[8]=h*g+d*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8];return t*a*u-t*s*l-n*r*u+n*s*o+i*r*l-i*a*o}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=u*a-s*l,h=s*o-u*r,d=l*r-a*o,p=t*c+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(i*l-u*n)*f,e[2]=(s*n-i*a)*f,e[3]=h*f,e[4]=(u*t-i*o)*f,e[5]=(i*r-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*r)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(e_.makeScale(e,t)),this}rotate(e){return this.premultiply(e_.makeRotation(-e)),this}translate(e,t){return this.premultiply(e_.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let e_=new ev,ey=new ev().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ex=new ev().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),eb=(d=[.64,.33,.3,.6,.15,.06],p=[.2126,.7152,.0722],f=[.3127,.329],(h={enabled:!0,workingColorSpace:L,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===U&&(e.r=eS(e.r),e.g=eS(e.g),e.b=eS(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===U&&(e.r=eM(e.r),e.g=eM(e.g),e.b=eM(e.b))),e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return""===e?N:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,t){return $("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),h.workingToColorSpace(e,t)},toWorkingColorSpace:function(e,t){return $("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),h.colorSpaceToWorking(e,t)}}).define({[L]:{primaries:d,whitePoint:f,transfer:N,toXYZ:ey,fromXYZ:ex,luminanceCoefficients:p,workingColorSpaceConfig:{unpackColorSpace:I},outputColorSpaceConfig:{drawingBufferColorSpace:I}},[I]:{primaries:d,whitePoint:f,transfer:U,toXYZ:ey,fromXYZ:ex,luminanceCoefficients:p,outputColorSpaceConfig:{drawingBufferColorSpace:I}}}),h);function eS(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function eM(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class eT{static getDataURL(e,n="image/png"){let i;if(/^data:/i.test(e.src)||"u"typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap){let t=G("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;etypeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"u">typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;ttypeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap?eT.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(J("Texture: Unable to serialize Texture."),{})}let eC=0,eR=new ef;class eP extends ee{constructor(e=eP.DEFAULT_IMAGE,t=eP.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=eP.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:eC++}),this.uuid=ea(),this.name="",this.source=new eE(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new ed(0,0),this.repeat=new ed(1,1),this.center=new ed(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ev,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(eR).x}get height(){return this.source.getSize(eR).y}get depth(){return this.source.getSize(eR).z}get image(){return this.source.data}set image(e=null){this.source.data=e}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(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(void 0===n){J(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){J(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}eP.DEFAULT_IMAGE=null,eP.DEFAULT_MAPPING=300,eP.DEFAULT_ANISOTROPY=1;class eI{constructor(e=0,t=0,n=0,i=1){eI.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r,a=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,_=(h+p)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=v/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=_/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=v/(r=Math.sqrt(m)),i=_/r),this.set(n,i,r,t),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this.z=es(this.z,e.z,t.z),this.w=es(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this.z=es(this.z,e,t),this.w=es(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 eL extends ee{constructor(e=1,t=1,n={}){super(),n=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},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new eI(0,0,e,t),this.scissorTest=!1,this.viewport=new eI(0,0,e,t);const i=new eP({width:e,height:t,depth:n.depth});this.textures=[];const r=n.count;for(let e=0;e1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ek),ek.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(eY),eZ.subVectors(this.max,eY),eH.subVectors(e.a,eY),eG.subVectors(e.b,eY),eW.subVectors(e.c,eY),ej.subVectors(eG,eH),eX.subVectors(eW,eG),eq.subVectors(eH,eW);let t=[0,-ej.z,ej.y,0,-eX.z,eX.y,0,-eq.z,eq.y,ej.z,0,-ej.x,eX.z,0,-eX.x,eq.z,0,-eq.x,-ej.y,ej.x,0,-eX.y,eX.x,0,-eq.y,eq.x,0];return!!e$(t,eH,eG,eW,eZ)&&!!e$(t=[1,0,0,0,1,0,0,0,1],eH,eG,eW,eZ)&&(eJ.crossVectors(ej,eX),e$(t=[eJ.x,eJ.y,eJ.z],eH,eG,eW,eZ))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ek).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ek).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(eB[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eB[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eB[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eB[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eB[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eB[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eB[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eB[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eB)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}let eB=[new ef,new ef,new ef,new ef,new ef,new ef,new ef,new ef],ek=new ef,eV=new ez,eH=new ef,eG=new ef,eW=new ef,ej=new ef,eX=new ef,eq=new ef,eY=new ef,eZ=new ef,eJ=new ef,eK=new ef;function e$(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){eK.fromArray(e,a);let s=r.x*Math.abs(eK.x)+r.y*Math.abs(eK.y)+r.z*Math.abs(eK.z),o=t.dot(eK),l=n.dot(eK),u=i.dot(eK);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>s)return!1}return!0}let eQ=new ez,e0=new ef,e1=new ef;class e2{constructor(e=new ef,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):eQ.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;e0.subVectors(e,this.center);let t=e0.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(e0,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(e1.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(e0.copy(e.center).add(e1)),this.expandByPoint(e0.copy(e.center).sub(e1)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let e3=new ef,e4=new ef,e5=new ef,e6=new ef,e8=new ef,e9=new ef,e7=new ef;class te{constructor(e=new ef,t=new ef(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,e3)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=e3.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(e3.copy(this.origin).addScaledVector(this.direction,t),e3.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){let r,a,s,o;e4.copy(e).add(t).multiplyScalar(.5),e5.copy(t).sub(e).normalize(),e6.copy(this.origin).sub(e4);let l=.5*e.distanceTo(t),u=-this.direction.dot(e5),c=e6.dot(this.direction),h=-e6.dot(e5),d=e6.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(r=u*h-c,a=u*c-h,o=l*p,r>=0)if(a>=-o)if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+u*a+2*c)+a*(u*r+a+2*h)+d}else s=-(r=Math.max(0,-(u*(a=l)+c)))*r+a*(a+2*h)+d;else s=-(r=Math.max(0,-(u*(a=-l)+c)))*r+a*(a+2*h)+d;else a<=-o?(a=(r=Math.max(0,-(-u*l+c)))>0?-l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(r=Math.max(0,-(u*l+c)))>0?l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d);else a=u>0?-l:l,s=-(r=Math.max(0,-(u*a+c)))*r+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,r),i&&i.copy(e4).addScaledVector(e5,a),s}intersectSphere(e,t){e3.subVectors(e.center,this.origin);let n=e3.dot(this.direction),i=e3.dot(e3)-n*n,r=e.radius*e.radius;if(i>r)return null;let a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,i,r,a,s,o,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),u>=0?(r=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a=0?(s=(e.min.z-h.z)*c,o=(e.max.z-h.z)*c):(s=(e.max.z-h.z)*c,o=(e.min.z-h.z)*c),n>o||s>i||((s>n||n!=n)&&(n=s),(o=0?n:i,t)}intersectsBox(e){return null!==this.intersectBox(e,e3)}intersectTriangle(e,t,n,i,r){let a;e8.subVectors(t,e),e9.subVectors(n,e),e7.crossVectors(e8,e9);let s=this.direction.dot(e7);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}e6.subVectors(this.origin,e);let o=a*this.direction.dot(e9.crossVectors(e6,e9));if(o<0)return null;let l=a*this.direction.dot(e8.cross(e6));if(l<0||o+l>s)return null;let u=-a*e6.dot(e7);return u<0?null:this.at(u/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tt{constructor(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m)}set(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 tt().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return 0===this.determinant()?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1)):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2)),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinant())return this.identity();let t=this.elements,n=e.elements,i=1/tn.setFromMatrixColumn(e,0).length(),r=1/tn.setFromMatrixColumn(e,1).length(),a=1/tn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){let e=a*u,n=a*c,i=s*u,r=s*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*u,n=o*c,i=l*u,r=l*c;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*u,n=o*c,i=l*u,r=l*c;t[0]=e-r*s,t[4]=-a*c,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*u,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*u,n=a*c,i=s*u,r=s*c;t[0]=o*u,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*c,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*u,t[4]=r-e*c,t[8]=i*c+n,t[1]=c,t[5]=a*u,t[9]=-s*u,t[2]=-l*u,t[6]=n*c+i,t[10]=e-r*c}else if("XZY"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+r,t[5]=a*u,t[9]=n*c-i,t[2]=i*c-n,t[6]=s*u,t[10]=r*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(tr,e,ta)}lookAt(e,t,n){let i=this.elements;return tl.subVectors(e,t),0===tl.lengthSq()&&(tl.z=1),tl.normalize(),ts.crossVectors(n,tl),0===ts.lengthSq()&&(1===Math.abs(n.z)?tl.x+=1e-4:tl.z+=1e-4,tl.normalize(),ts.crossVectors(n,tl)),ts.normalize(),to.crossVectors(tl,ts),i[0]=ts.x,i[4]=to.x,i[8]=tl.x,i[1]=ts.y,i[5]=to.y,i[9]=tl.y,i[2]=ts.z,i[6]=to.z,i[10]=tl.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],b=i[0],S=i[4],M=i[8],T=i[12],w=i[1],E=i[5],A=i[9],C=i[13],R=i[2],P=i[6],I=i[10],L=i[14],N=i[3],U=i[7],D=i[11],O=i[15];return r[0]=a*b+s*w+o*R+l*N,r[4]=a*S+s*E+o*P+l*U,r[8]=a*M+s*A+o*I+l*D,r[12]=a*T+s*C+o*L+l*O,r[1]=u*b+c*w+h*R+d*N,r[5]=u*S+c*E+h*P+d*U,r[9]=u*M+c*A+h*I+d*D,r[13]=u*T+c*C+h*L+d*O,r[2]=p*b+f*w+m*R+g*N,r[6]=p*S+f*E+m*P+g*U,r[10]=p*M+f*A+m*I+g*D,r[14]=p*T+f*C+m*L+g*O,r[3]=v*b+_*w+y*R+x*N,r[7]=v*S+_*E+y*P+x*U,r[11]=v*M+_*A+y*I+x*D,r[15]=v*T+_*C+y*L+x*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15],v=o*d-l*h,_=s*d-l*c,y=s*h-o*c,x=a*d-l*u,b=a*h-o*u,S=a*c-s*u;return t*(f*v-m*_+g*y)-n*(p*v-m*x+g*b)+i*(p*_-f*x+g*S)-r*(p*y-f*b+m*S)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*o*d-s*m*d-c*o*g+s*h*g,_=p*h*l-u*m*l-p*o*d+a*m*d+u*o*g-a*h*g,y=u*f*l-p*c*l+p*s*d-a*f*d-u*s*g+a*c*g,x=p*c*o-u*f*o-p*s*h+a*f*h+u*s*m-a*c*m,b=t*v+n*_+i*y+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/b;return e[0]=v*S,e[1]=(f*h*r-c*m*r-f*i*d+n*m*d+c*i*g-n*h*g)*S,e[2]=(s*m*r-f*o*r+f*i*l-n*m*l-s*i*g+n*o*g)*S,e[3]=(c*o*r-s*h*r-c*i*l+n*h*l+s*i*d-n*o*d)*S,e[4]=_*S,e[5]=(u*m*r-p*h*r+p*i*d-t*m*d-u*i*g+t*h*g)*S,e[6]=(p*o*r-a*m*r-p*i*l+t*m*l+a*i*g-t*o*g)*S,e[7]=(a*h*r-u*o*r+u*i*l-t*h*l-a*i*d+t*o*d)*S,e[8]=y*S,e[9]=(p*c*r-u*f*r-p*n*d+t*f*d+u*n*g-t*c*g)*S,e[10]=(a*f*r-p*s*r+p*n*l-t*f*l-a*n*g+t*s*g)*S,e[11]=(u*s*r-a*c*r-u*n*l+t*c*l+a*n*d-t*s*d)*S,e[12]=x*S,e[13]=(u*f*i-p*c*i+p*n*h-t*f*h-u*n*m+t*c*m)*S,e[14]=(p*s*i-a*f*i-p*n*o+t*f*o+a*n*m-t*s*m)*S,e[15]=(a*c*i-u*s*i+u*n*o-t*c*o-a*n*h+t*s*h)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,u=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,u*s+n,u*o-i*a,0,l*o-i*s,u*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,u=a+a,c=s+s,h=r*l,d=r*u,p=r*c,f=a*u,m=a*c,g=s*c,v=o*l,_=o*u,y=o*c,x=n.x,b=n.y,S=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+_)*S,i[9]=(m-v)*S,i[10]=(1-(h+f))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],0===this.determinant())return n.set(1,1,1),t.identity(),this;let r=tn.set(i[0],i[1],i[2]).length(),a=tn.set(i[4],i[5],i[6]).length(),s=tn.set(i[8],i[9],i[10]).length();0>this.determinant()&&(r=-r),ti.copy(this);let o=1/r,l=1/a,u=1/s;return ti.elements[0]*=o,ti.elements[1]*=o,ti.elements[2]*=o,ti.elements[4]*=l,ti.elements[5]*=l,ti.elements[6]*=l,ti.elements[8]*=u,ti.elements[9]*=u,ti.elements[10]*=u,t.setFromRotationMatrix(ti),n.x=r,n.y=a,n.z=s,this}makePerspective(e,t,n,i,r,a,s=2e3,o=!1){let l,u,c=this.elements;if(o)l=r/(a-r),u=a*r/(a-r);else if(2e3===s)l=-(a+r)/(a-r),u=-2*a*r/(a-r);else if(2001===s)l=-a/(a-r),u=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return c[0]=2*r/(t-e),c[4]=0,c[8]=(t+e)/(t-e),c[12]=0,c[1]=0,c[5]=2*r/(n-i),c[9]=(n+i)/(n-i),c[13]=0,c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,r,a,s=2e3,o=!1){let l,u,c=this.elements;if(o)l=1/(a-r),u=a/(a-r);else if(2e3===s)l=-2/(a-r),u=-(a+r)/(a-r);else if(2001===s)l=-1/(a-r),u=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return c[0]=2/(t-e),c[4]=0,c[8]=0,c[12]=-(t+e)/(t-e),c[1]=0,c[5]=2/(n-i),c[9]=0,c[13]=-(n+i)/(n-i),c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}let tn=new ef,ti=new tt,tr=new ef(0,0,0),ta=new ef(1,1,1),ts=new ef,to=new ef,tl=new ef,tu=new tt,tc=new ep;class th{constructor(e=0,t=0,n=0,i=th.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],u=i[9],c=i[2],h=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(es(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-es(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(es(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-es(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(es(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-es(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-u,d),this._y=0);break;default:J("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return tu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(tu,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return tc.setFromEuler(this),this.setFromQuaternion(tc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}th.DEFAULT_ORDER="XYZ";class td{constructor(){this.mask=1}set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>({...e})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t0){i.children=[];for(let t=0;t0){i.animations=[];for(let t=0;t0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=i,n;function a(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){tR.subVectors(i,t),tP.subVectors(n,t),tI.subVectors(e,t);let a=tR.dot(tR),s=tR.dot(tP),o=tR.dot(tI),l=tP.dot(tP),u=tP.dot(tI),c=a*l-s*s;if(0===c)return r.set(0,0,0),null;let h=1/c,d=(l*o-s*u)*h,p=(a*u-s*o)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,tL)&&tL.x>=0&&tL.y>=0&&tL.x+tL.y<=1}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,tL)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,tL.x),o.addScaledVector(a,tL.y),o.addScaledVector(s,tL.z),o)}static getInterpolatedAttribute(e,t,n,i,r,a){return tB.setScalar(0),tk.setScalar(0),tV.setScalar(0),tB.fromBufferAttribute(e,t),tk.fromBufferAttribute(e,n),tV.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(tB,r.x),a.addScaledVector(tk,r.y),a.addScaledVector(tV,r.z),a}static isFrontFacing(e,t,n,i){return tR.subVectors(n,t),tP.subVectors(e,t),0>tR.cross(tP).dot(i)}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tR.subVectors(this.c,this.b),tP.subVectors(this.a,this.b),.5*tR.cross(tP).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tH.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return tH.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return tH.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return tH.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tH.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,i,r=this.a,a=this.b,s=this.c;tN.subVectors(a,r),tU.subVectors(s,r),tO.subVectors(e,r);let o=tN.dot(tO),l=tU.dot(tO);if(o<=0&&l<=0)return t.copy(r);tF.subVectors(e,a);let u=tN.dot(tF),c=tU.dot(tF);if(u>=0&&c<=u)return t.copy(a);let h=o*c-u*l;if(h<=0&&o>=0&&u<=0)return n=o/(o-u),t.copy(r).addScaledVector(tN,n);tz.subVectors(e,s);let d=tN.dot(tz),p=tU.dot(tz);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return i=l/(l-p),t.copy(r).addScaledVector(tU,i);let m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return tD.subVectors(s,a),i=(c-u)/(c-u+(d-p)),t.copy(a).addScaledVector(tD,i);let g=1/(m+f+h);return n=f*g,i=h*g,t.copy(r).addScaledVector(tN,n).addScaledVector(tU,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let tG={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},tW={h:0,s:0,l:0},tj={h:0,s:0,l:0};function tX(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class tq{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=I){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,eb.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=eb.workingColorSpace){return this.r=e,this.g=t,this.b=n,eb.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=eb.workingColorSpace){if(e=eo(e,1),t=es(t,0,1),n=es(n,0,1),0===t)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=tX(r,i,e+1/3),this.g=tX(r,i,e),this.b=tX(r,i,e-1/3)}return eb.colorSpaceToWorking(this,i),this}setStyle(e,t=I){let n;function i(t){void 0!==t&&1>parseFloat(t)&&J("Color: Alpha component of "+e+" will be ignored.")}if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:J("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(i,16),t);J("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=I){let n=tG[e.toLowerCase()];return void 0!==n?this.setHex(n,t):J("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=eS(e.r),this.g=eS(e.g),this.b=eS(e.b),this}copyLinearToSRGB(e){return this.r=eM(e.r),this.g=eM(e.g),this.b=eM(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=I){return eb.workingToColorSpace(tY.copy(this),e),65536*Math.round(es(255*tY.r,0,255))+256*Math.round(es(255*tY.g,0,255))+Math.round(es(255*tY.b,0,255))}getHexString(e=I){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=eb.workingColorSpace){let n,i;eb.workingToColorSpace(tY.copy(this),t);let r=tY.r,a=tY.g,s=tY.b,o=Math.max(r,a,s),l=Math.min(r,a,s),u=(l+o)/2;if(l===o)n=0,i=0;else{let e=o-l;switch(i=u<=.5?e/(o+l):e/(2-o-l),o){case r:n=(a-s)/e+6*(a0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){J(`Material: parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){J(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(n.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(n.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(null!==t){let e=t.length;n=Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class tK extends tJ{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tq(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 th,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let t$=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),i=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(i[e]=0,i[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(i[e]=1024>>-t-14,i[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(i[e]=t+15<<10,i[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(i[e]=31744,i[256|e]=64512,r[e]=24,r[256|e]=24):(i[e]=31744,i[256|e]=64512,r[e]=13,r[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;(8388608&t)==0;)t<<=1,n-=8388608;t&=-8388609,n+=0x38800000,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=0x47800000,s[32]=0x80000000;for(let e=33;e<63;++e)s[e]=0x80000000+(e-32<<23);s[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}();function tQ(e){Math.abs(e)>65504&&J("DataUtils.toHalfFloat(): Value out of range."),e=es(e,-65504,65504),t$.floatView[0]=e;let t=t$.uint32View[0],n=t>>23&511;return t$.baseTable[n]+((8388607&t)>>t$.shiftTable[n])}function t0(e){let t=e>>10;return t$.uint32View[0]=t$.mantissaTable[t$.offsetTable[t]+(1023&e)]+t$.exponentTable[t],t$.floatView[0]}class t1{static toHalfFloat(e){return tQ(e)}static fromHalfFloat(e){return t0(e)}}let t2=new ef,t3=new ed,t4=0;class t5{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:t4++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;it.count&&J("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ez);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){K("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ef(-1/0,-1/0,-1/0),new ef(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let i=n[t];e.data.attributes[t]=i.toJSON(e.data)}let i={},r=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;null!==n&&this.setIndex(n.clone());let i=e.attributes;for(let e in i){let n=i[e];this.setAttribute(e,n.clone(t))}let r=e.morphAttributes;for(let e in r){let n=[],i=r[e];for(let e=0,r=i.length;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2)||(np.copy(r).invert(),nf.copy(e.ray).applyMatrix4(np),(null===n.boundingBox||!1!==nf.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,nf)))}_computeIntersections(e,t,n){let i,r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,c=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let r=0,o=h.length;rn.far?null:{distance:l,point:nM.clone(),object:e}}(e,t,n,i,nv,n_,ny,nS);if(c){let e=new ef;tH.getBarycoord(nS,nv,n_,ny,e),r&&(c.uv=tH.getInterpolatedAttribute(r,o,l,u,e,new ed)),a&&(c.uv1=tH.getInterpolatedAttribute(a,o,l,u,e,new ed)),s&&(c.normal=tH.getInterpolatedAttribute(s,o,l,u,e,new ef),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let t={a:o,b:l,c:u,normal:new ef,materialIndex:0};tH.getNormal(nv,n_,ny,t.normal),c.face=t,c.barycoord=e}return c}class nE extends nd{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[];let h=0,d=0;function p(e,t,n,i,r,a,p,f,m,g,v){let _=a/m,y=p/g,x=a/2,b=p/2,S=f/2,M=m+1,T=g+1,w=0,E=0,A=new ef;for(let a=0;a0?1:-1,u.push(A.x,A.y,A.z),c.push(o/m),c.push(1-a/g),w+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class nL extends tC{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tt,this.projectionMatrix=new tt,this.projectionMatrixInverse=new tt,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let nN=new ef,nU=new ed,nD=new ed;class nO extends nL{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*er*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*ei*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*er*Math.atan(Math.tan(.5*ei*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){nN.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(nN.x,nN.y).multiplyScalar(-e/nN.z),nN.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(nN.x,nN.y).multiplyScalar(-e/nN.z)}getViewSize(e,t){return this.getViewBounds(e,nU,nD),t.subVectors(nD,nU)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*ei*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class nF extends tC{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new nO(-90,1,e,t);i.layers=this.layers,this.add(i);const r=new nO(-90,1,e,t);r.layers=this.layers,this.add(r);const a=new nO(-90,1,e,t);a.layers=this.layers,this.add(a);const s=new nO(-90,1,e,t);s.layers=this.layers,this.add(s);const o=new nO(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new nO(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,s,o]=t;for(let e of t)this.remove(e);if(2e3===e)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===e)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,s),e.setRenderTarget(n,3,i),e.render(t,o),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,i),e.render(t,u),e.setRenderTarget(c,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class nz extends eP{constructor(e=[],t=301,n,i,r,a,s,o,l,u){super(e,t,n,i,r,a,s,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class nB extends eN{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1};this.texture=new nz([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new nE(5,5,5),r=new nI({name:"CubemapFromEquirect",uniforms:nA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let a=new nT(i,r),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new nF(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}class nk extends tC{constructor(){super(),this.isGroup=!0,this.type="Group"}}let nV={type:"move"};class nH{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new nk,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 nk,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ef,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ef),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new nk,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ef,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ef),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())){let e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}let i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(i=t.getPose(e.targetRaySpace,n))&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(nV)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new nk;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class nG{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new tq(e),this.density=t}clone(){return new nG(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class nW{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new tq(e),this.near=t,this.far=n}clone(){return new nW(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class nj extends tC{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 th,this.environmentIntensity=1,this.environmentRotation=new th,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class nX{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=ea()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;ie.far||t.push({distance:o,point:nJ.clone(),uv:tH.getInterpolation(nJ,n2,n3,n4,n5,n6,n8,new ed),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function n7(e,t,n,i,r,a){nQ.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(n0.x=a*nQ.x-r*nQ.y,n0.y=r*nQ.x+a*nQ.y):n0.copy(nQ),e.copy(t),e.x+=n0.x,e.y+=n0.y,e.applyMatrix4(n1)}let ie=new ef,it=new ef;class ii extends tC{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e0){let n,i;for(n=1,i=t.length;n0){ie.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(ie);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){let n,i;ie.setFromMatrixPosition(e.matrixWorld),it.setFromMatrixPosition(this.matrixWorld);let r=ie.distanceTo(it)/e.zoom;for(n=1,t[0].object.visible=!0,i=t.length;n=e)t[n-1].object.visible=!1,t[n].object.visible=!0;else break}for(this._currentLevel=n-1;n1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||iI.getNormalMatrix(e),i=this.coplanarPoint(iR).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let iN=new e2,iU=new ed(.5,.5),iD=new ef;class iO{constructor(e=new iL,t=new iL,n=new iL,i=new iL,r=new iL,a=new iL){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3,n=!1){let i=this.planes,r=e.elements,a=r[0],s=r[1],o=r[2],l=r[3],u=r[4],c=r[5],h=r[6],d=r[7],p=r[8],f=r[9],m=r[10],g=r[11],v=r[12],_=r[13],y=r[14],x=r[15];if(i[0].setComponents(l-a,d-u,g-p,x-v).normalize(),i[1].setComponents(l+a,d+u,g+p,x+v).normalize(),i[2].setComponents(l+s,d+c,g+f,x+_).normalize(),i[3].setComponents(l-s,d-c,g-f,x-_).normalize(),n)i[4].setComponents(o,h,m,y).normalize(),i[5].setComponents(l-o,d-h,g-m,x-y).normalize();else if(i[4].setComponents(l-o,d-h,g-m,x-y).normalize(),2e3===t)i[5].setComponents(l+o,d+h,g+m,x+y).normalize();else if(2001===t)i[5].setComponents(o,h,m,y).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),iN.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),iN.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(iN)}intersectsSprite(e){return iN.center.set(0,0,0),iN.radius=.7071067811865476+iU.distanceTo(e.center),iN.applyMatrix4(e.matrixWorld),this.intersectsSphere(iN)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,iD.y=i.normal.y>0?e.max.y:e.min.y,iD.z=i.normal.z>0?e.max.z:e.min.z,0>i.distanceToPoint(iD))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}let iF=new tt,iz=new iO;class iB{constructor(){this.coordinateSystem=2e3}intersectsObject(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(let n=0;n=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});let s=r[this.index];a.push(s),this.index++,s.start=e,s.count=t,s.z=n,s.index=i}reset(){this.list.length=0,this.index=0}},iQ=new nT,i0=[];function i1(e,t){if(e.constructor!==t.constructor){let n=Math.min(e.length,t.length);for(let i=0;i65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new t5(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let i=e.getAttribute(n),r=t.getAttribute(n);if(i.itemSize!==r.itemSize||i.normalized!==r.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ez);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(ik),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let i=this._matricesTexture;iG.identity().toArray(i.image.data,16*n),i.needsUpdate=!0;let r=this._colorsTexture;return r&&(iW.toArray(r.image.data,4*n),r.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,n=-1){let i;this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=-1===t?e.getAttribute("position").count:t;let s=e.getIndex();if(null!==s&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=-1===n?s.count:n),-1!==r.indexStart&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(ik),a[i=this._availableGeometryIds.shift()]=r):(i=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(i,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,i}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);let n=this.geometry,i=null!==n.getIndex(),r=n.getIndex(),a=t.getIndex(),s=this._geometryInfo[e];if(i&&a.count>s.reservedIndexCount||t.attributes.position.count>s.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=s.vertexStart,l=s.reservedVertexCount;for(let e in s.vertexCount=t.getAttribute("position").count,n.attributes){let i=t.getAttribute(e),r=n.getAttribute(e);!function(e,t,n=0){let i=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let r=e.count;for(let a=0;a=t.length||!1===t[e].active)return this;let n=this._instanceInfo;for(let t=0,i=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),r=this.geometry;for(let a=0,s=n.length;a=this._geometryCount)return null;let n=this.geometry,i=this._geometryInfo[e];if(null===i.boundingBox){let e=new ez,t=n.index,r=n.attributes.position;for(let n=i.start,a=i.start+i.count;n=this._geometryCount)return null;let n=this.geometry,i=this._geometryInfo[e];if(null===i.boundingSphere){let t=new e2;this.getBoundingBoxAt(e,iq),iq.getCenter(t.center);let r=n.index,a=n.attributes.position,s=0;for(let e=i.start,n=i.start+i.count;ee.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let i=this.geometry;i.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new nd,this._initializeGeometry(i));let r=this.geometry;for(let e in i.index&&i1(i.index.array,r.index.array),i.attributes)i1(i.attributes[e].array,r.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,i=this._geometryInfo,r=this.matrixWorld,a=this.geometry;iQ.material=this.material,iQ.geometry.index=a.index,iQ.geometry.attributes=a.attributes,null===iQ.geometry.boundingBox&&(iQ.geometry.boundingBox=new ez),null===iQ.geometry.boundingSphere&&(iQ.geometry.boundingSphere=new e2);for(let a=0,s=n.length;a({...e,boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._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(e,t,n,i,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=i.getIndex(),s=null===a?1:a.array.BYTES_PER_ELEMENT,o=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data,f=n.isArrayCamera?iX:ij;h&&!n.isArrayCamera&&(iG.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),ij.setFromProjectionMatrix(iG,n.coordinateSystem,n.reversedDepth));let m=0;if(this.sortObjects){iG.copy(this.matrixWorld).invert(),iZ.setFromMatrixPosition(n.matrixWorld).applyMatrix4(iG),iJ.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(iG);for(let e=0,t=o.length;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei)return;i7.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(i7);if(!(lt.far))return{distance:l,point:re.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}let ri=new ef,rr=new ef;class ra extends rt{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,n=[];for(let e=0,i=t.count;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class rf extends eP{constructor(e,t,n,i,r=1006,a=1006,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const u=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class rm extends rf{constructor(e,t,n,i,r,a,s,o){super({},e,t,n,i,r,a,s,o),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class rg extends eP{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}class rv extends eP{constructor(e,t,n,i,r,a,s,o,l,u,c,h){super(null,a,s,o,l,u,i,r,c,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class r_ extends rv{constructor(e,t,n,i,r,a){super(e,t,n,r,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=1001,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ry extends rv{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class rx extends eP{constructor(e,t,n,i,r,a,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class rb extends eP{constructor(e,t,n=1014,i,r,a,s=1003,o=1003,l,u=1026,c=1){if(1026!==u&&1027!==u)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:c},i,r,a,s,o,u,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new eE(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class rS extends rb{constructor(e,t=1014,n=301,i,r,a=1003,s=1003,o,l=1026){const u={width:e,height:e,depth:1};super(e,e,t,n,i,r,a,s,o,l),this.image=[u,u,u,u,u,u],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class rM extends eP{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class rT extends nd{constructor(e=1,t=1,n=4,i=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i,heightSegments:r},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),i=Math.max(3,Math.floor(i));const a=[],s=[],o=[],l=[],u=t/2,c=Math.PI/2*e,h=t,d=2*c+h,p=2*n+(r=Math.max(1,Math.floor(r))),f=i+1,m=new ef,g=new ef;for(let v=0;v<=p;v++){let _=0,y=0,x=0,b=0;if(v<=n){const t=v/n,i=t*Math.PI/2;y=-u-e*Math.cos(i),x=e*Math.sin(i),b=-e*Math.cos(i),_=t*c}else if(v<=n+r){const i=(v-n)/r;y=-u+i*t,x=e,b=0,_=c+i*h}else{const t=(v-n-r)/n,i=t*Math.PI/2;y=u+e*Math.sin(i),x=e*Math.cos(i),b=e*Math.sin(i),_=c+h+t*c}const S=Math.max(0,Math.min(1,_/d));let M=0;0===v?M=.5/i:v===p&&(M=-.5/i);for(let e=0;e<=i;e++){const t=e/i,n=t*Math.PI*2,r=Math.sin(n),a=Math.cos(n);g.x=-x*a,g.y=y,g.z=x*r,s.push(g.x,g.y,g.z),m.set(-x*a,b,x*r),m.normalize(),o.push(m.x,m.y,m.z),l.push(t+M,S)}if(v>0){const e=(v-1)*f;for(let t=0;t0||0!==i)&&(u.push(a,s,l),_+=3),(t>0||i!==r-1)&&(u.push(s,o,l),_+=3)}l.addGroup(g,_,0),g+=_})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new nr(c,3)),this.setAttribute("normal",new nr(h,3)),this.setAttribute("uv",new nr(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rE(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rA extends rE{constructor(e=1,t=1,n=32,i=1,r=!1,a=0,s=2*Math.PI){super(0,e,t,n,i,r,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:s}}static fromJSON(e){return new rA(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rC extends nd{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],a=[];function s(e){r.push(e.x,e.y,e.z)}function o(t,n){let i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function l(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}(function(e){let n=new ef,i=new ef,r=new ef;for(let a=0;a.9&&s<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new nr(r,3)),this.setAttribute("normal",new nr(r.slice(),3)),this.setAttribute("uv",new nr(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rC(e.vertices,e.indices,e.radius,e.detail)}}class rR extends rC{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n;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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[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],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new rR(e.radius,e.detail)}}let rP=new ef,rI=new ef,rL=new ef,rN=new tH;class rU extends nd{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=Math.cos(ei*t),i=e.getIndex(),r=e.getAttribute("position"),a=i?i.count:r.count,s=[0,0,0],o=["a","b","c"],l=[,,,],u={},c=[];for(let e=0;e0)o=r-1;else{o=r;break}if(i[r=o]===n)return r/(a-1);let u=i[r],c=i[r+1];return(r+(n-u)/(c-u))/(a-1)}getTangent(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);let r=this.getPoint(n),a=this.getPoint(i),s=t||(r.isVector2?new ed:new ef);return s.copy(a).sub(r).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new ef,i=[],r=[],a=[],s=new ef,o=new tt;for(let t=0;t<=e;t++){let n=t/e;i[t]=this.getTangentAt(n,new ef)}r[0]=new ef,a[0]=new ef;let l=Number.MAX_VALUE,u=Math.abs(i[0].x),c=Math.abs(i[0].y),h=Math.abs(i[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),a[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),a[t]=a[t-1].clone(),s.crossVectors(i[t-1],i[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(es(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(es(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],t*n)),a[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class rO extends rD{constructor(e=0,t=0,n=1,i=1,r=0,a=2*Math.PI,s=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t=new ed){let n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===l&&o===a-1&&(o=a-2,l=1),this.closed||o>0?n=r[(o-1)%a]:(rB.subVectors(r[0],r[1]).add(r[0]),n=rB);let u=r[o%a],c=r[(o+1)%a];if(this.closed||o+2n.length-2?n.length-1:r+1],u=n[r>n.length-3?n.length-1:r+2];return t.set(rW(a,s.x,o.x,l.x,u.x),rW(a,s.y,o.y,l.y,u.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=i[r]-n,a=this.curves[r],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,t)}r++}return null}getLength(){let e=this.getCurveLengths();return e[e.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 e=[],t=0;for(let n=0,i=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class r3 extends r2{constructor(e){super(e),this.uuid=ea(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0)for(let r=t;r=t;r-=i)a=ao(r/i|0,e[r],e[r+1],a);return a&&at(a,a.next)&&(al(a),a=a.next),a}function r5(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(at(n,n.next)||0===ae(n.prev,n,n.next))){if(al(n),(n=t=n.prev)===n.next)break;i=!0}else n=n.next;while(i||n!==t)return t}function r6(e,t){let n=e.x-t.x;return 0===n&&0==(n=e.y-t.y)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function r8(e,t,n,i,r){return(e=((e=((e=((e=((e=(e-n)*r|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-i)*r|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function r9(e,t,n,i,r,a,s,o){return(r-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(n-s)*(t-o)&&(n-s)*(a-o)>=(r-s)*(i-o)}function r7(e,t,n,i,r,a,s,o){return(e!==s||t!==o)&&r9(e,t,n,i,r,a,s,o)}function ae(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function at(e,t){return e.x===t.x&&e.y===t.y}function an(e,t,n,i){let r=ar(ae(e,t,n)),a=ar(ae(e,t,i)),s=ar(ae(n,i,e)),o=ar(ae(n,i,t));return!!(r!==a&&s!==o||0===r&&ai(e,n,t)||0===a&&ai(e,i,t)||0===s&&ai(n,e,i)||0===o&&ai(n,t,i))}function ai(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ar(e){return e>0?1:e<0?-1:0}function aa(e,t){return 0>ae(e.prev,e,e.next)?ae(e,t,e.next)>=0&&ae(e,e.prev,t)>=0:0>ae(e,t,e.prev)||0>ae(e,e.next,t)}function as(e,t){let n=au(e.i,e.x,e.y),i=au(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function ao(e,t,n,i){let r=au(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function al(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function au(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class ac{static triangulate(e,t,n=2){return function(e,t,n=2){let i,r,a,s=t&&t.length,o=s?t[0]*n:e.length,l=r4(e,0,o,n,!0),u=[];if(!l||l.next===l.prev)return u;if(s&&(l=function(e,t,n,i){let r=[];for(let n=0,a=t.length;n=i.next.y&&i.next.y!==i.y){let e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=r&&e>s&&(s=e,n=i.x=i.x&&i.x>=l&&r!==i.x&&r9(an.x||i.x===n.x&&(h=n,d=i,0>ae(h.prev,h,d.prev)&&0>ae(d.next,h,h.next))))&&(n=i,c=t)}i=i.next}while(i!==o)return n}(e,t);if(!n)return t;let i=as(n,e);return r5(i,i.next),r5(n,n.next)}(r[e],n);return n}(e,t,l,n)),e.length>80*n){i=e[0],r=e[1];let t=i,s=r;for(let a=n;at&&(t=n),o>s&&(s=o)}a=0!==(a=Math.max(t-i,s-r))?32767/a:0}return function e(t,n,i,r,a,s,o){if(!t)return;!o&&s&&function(e,t,n,i){let r=e;do 0===r.z&&(r.z=r8(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e)r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,n=1;do{let i,r=e;e=null;let a=null;for(t=0;r;){t++;let s=r,o=0;for(let e=0;e0||l>0&&s;)0!==o&&(0===l||!s||r.z<=s.z)?(i=r,r=r.nextZ,o--):(i=s,s=s.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=s}a.nextZ=null,n*=2}while(t>1)}(r)}(t,r,a,s);let l=t;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(s?function(e,t,n,i){let r=e.prev,a=e.next;if(ae(r,e,a)>=0)return!1;let s=r.x,o=e.x,l=a.x,u=r.y,c=e.y,h=a.y,d=Math.min(s,o,l),p=Math.min(u,c,h),f=Math.max(s,o,l),m=Math.max(u,c,h),g=r8(d,p,t,n,i),v=r8(f,m,t,n,i),_=e.prevZ,y=e.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&r7(s,u,o,c,l,h,_.x,_.y)&&ae(_.prev,_,_.next)>=0||(_=_.prevZ,y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==r&&y!==a&&r7(s,u,o,c,l,h,y.x,y.y)&&ae(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&r7(s,u,o,c,l,h,_.x,_.y)&&ae(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==r&&y!==a&&r7(s,u,o,c,l,h,y.x,y.y)&&ae(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}(t,r,a,s):function(e){let t=e.prev,n=e.next;if(ae(t,e,n)>=0)return!1;let i=t.x,r=e.x,a=n.x,s=t.y,o=e.y,l=n.y,u=Math.min(i,r,a),c=Math.min(s,o,l),h=Math.max(i,r,a),d=Math.max(s,o,l),p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=c&&p.y<=d&&r7(i,s,r,o,a,l,p.x,p.y)&&ae(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){n.push(u.i,t.i,c.i),al(t),t=c.next,l=c.next;continue}if((t=c)===l){o?1===o?e(t=function(e,t){let n=e;do{let i=n.prev,r=n.next.next;!at(i,r)&&an(i,n,n.next,r)&&aa(i,r)&&aa(r,i)&&(t.push(i.i,n.i,r.i),al(n),al(n.next),n=e=r),n=n.next}while(n!==e)return r5(n)}(r5(t),n),n,i,r,a,s,2):2===o&&function(t,n,i,r,a,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){var l,u;if(o.i!==t.i&&(l=o,u=t,l.next.i!==u.i&&l.prev.i!==u.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&an(n,n.next,e,t))return!0;n=n.next}while(n!==e)return!1}(l,u)&&(aa(l,u)&&aa(u,l)&&function(e,t){let n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e)return i}(l,u)&&(ae(l.prev,l,u.prev)||ae(l,u.prev,u))||at(l,u)&&ae(l.prev,l,l.next)>0&&ae(u.prev,u,u.next)>0))){let l=as(o,t);o=r5(o,o.next),l=r5(l,l.next),e(o,n,i,r,a,s,0),e(l,n,i,r,a,s,0);return}t=t.next}o=o.next}while(o!==t)}(t,n,i,r,a,s):e(r5(t),n,i,r,a,s,1);break}}}(l,u,n,i,r,a,0),u}(e,t,n)}}class ah{static area(e){let t=e.length,n=0;for(let i=t-1,r=0;rah.area(e)}static triangulateShape(e,t){let n=[],i=[],r=[];ad(e),ap(n,e);let a=e.length;t.forEach(ad);for(let e=0;e2&&e[t-1].equals(e[0])&&e.pop()}function ap(e,t){for(let n=0;nNumber.EPSILON){let h=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-o/h,f=t.y+s/h,m=((n.x-u/d-p)*u-(n.y+l/d-f)*l)/(s*u-o*l),g=(i=p+s*m-e.x)*i+(r=f+o*m-e.y)*r;if(g<=2)return new ed(i,r);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(u)&&(e=!0),e?(i=-o,r=s,a=Math.sqrt(c)):(i=s,r=o,a=Math.sqrt(c/2))}return new ed(i/a,r/a)}let L=[];for(let e=0,t=C.length,n=t-1,i=e+1;e=0;e--){let t=e/_,n=m*Math.cos(t*Math.PI/2),i=g*Math.sin(t*Math.PI/2)+v;for(let e=0,t=C.length;e=0;){let a=r,s=r-1;s<0&&(s=e.length-1);for(let e=0,r=d+2*_;e0)&&d.push(t,r,l),(e!==n-1||o0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class aU extends tJ{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tq(0xffffff),this.specular=new tq(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tq(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new th,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class aD extends tJ{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tq(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tq(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class aO extends tJ{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class aF extends tJ{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tq(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tq(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new th,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class az extends tJ{constructor(e){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(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class aB extends tJ{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class ak extends tJ{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tq(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(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(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class aV extends i3{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function aH(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function aG(e){let t=e.length,n=Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(t,n){return e[t]-e[n]}),n}function aW(e,t,n){let i=e.length,r=new e.constructor(i);for(let a=0,s=0;s!==i;++a){let i=n[a]*t;for(let n=0;n!==t;++n)r[s++]=e[i+n]}return r}function aj(e,t,n,i){let r=1,a=e[0];for(;void 0!==a&&void 0===a[i];)a=e[r++];if(void 0===a)return;let s=a[i];if(void 0!==s)if(Array.isArray(s))do void 0!==(s=a[i])&&(t.push(a.time),n.push(...s)),a=e[r++];while(void 0!==a)else if(void 0!==s.toArray)do void 0!==(s=a[i])&&(t.push(a.time),s.toArray(n,n.length)),a=e[r++];while(void 0!==a)else do void 0!==(s=a[i])&&(t.push(a.time),n.push(s)),a=e[r++];while(void 0!==a)}class aX{static convertArray(e,t){return aH(e,t)}static isTypedArray(e){return H(e)}static getKeyframeOrder(e){return aG(e)}static sortedArray(e,t,n){return aW(e,t,n)}static flattenJSON(e,t,n,i){aj(e,t,n,i)}static subclip(e,t,n,i,r=30){return function(e,t,n,i,r=30){let a=e.clone();a.name=t;let s=[];for(let e=0;e=i)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(o=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){let e=d*u+l,t=e+u-l;i=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=l,n=u-l;e.evaluate(a),i=e.resultBuffer.slice(t,n)}"quaternion"===s&&new ep().fromArray(i).normalize().conjugate().toArray(i);let p=o.times.length;for(let e=0;e=r)){let s=t[1];e=(r=t[--n-1]))break i}a=n,n=0;break r}break n}for(;n>>1;et;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(K("KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,r=n.length;0===r&&(K("KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==r;t++){let i=n[t];if("number"==typeof i&&isNaN(i)){K("KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==a&&a>i){K("KeyframeTrack: Out of order keys.",this,t,i,a),e=!1;break}a=i}if(void 0!==i&&H(i))for(let t=0,n=i.length;t!==n;++t){let n=i[t];if(isNaN(n)){K("KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1,a=1;for(let s=1;s0){e[a]=e[r];for(let e=r*n,i=a*n,s=0;s!==n;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}aK.prototype.ValueTypeName="",aK.prototype.TimeBufferType=Float32Array,aK.prototype.ValueBufferType=Float32Array,aK.prototype.DefaultInterpolation=2301;class a$ extends aK{constructor(e,t,n){super(e,t,n)}}a$.prototype.ValueTypeName="bool",a$.prototype.ValueBufferType=Array,a$.prototype.DefaultInterpolation=2300,a$.prototype.InterpolantFactoryMethodLinear=void 0,a$.prototype.InterpolantFactoryMethodSmooth=void 0;class aQ extends aK{constructor(e,t,n,i){super(e,t,n,i)}}aQ.prototype.ValueTypeName="color";class a0 extends aK{constructor(e,t,n,i){super(e,t,n,i)}}a0.prototype.ValueTypeName="number";class a1 extends aq{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(i-t),l=e*s;for(let e=l+s;l!==e;l+=4)ep.slerpFlat(r,0,a,l-s,a,l,o);return r}}class a2 extends aK{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new a1(this.times,this.values,this.getValueSize(),e)}}a2.prototype.ValueTypeName="quaternion",a2.prototype.InterpolantFactoryMethodSmooth=void 0;class a3 extends aK{constructor(e,t,n){super(e,t,n)}}a3.prototype.ValueTypeName="string",a3.prototype.ValueBufferType=Array,a3.prototype.DefaultInterpolation=2300,a3.prototype.InterpolantFactoryMethodLinear=void 0,a3.prototype.InterpolantFactoryMethodSmooth=void 0;class a4 extends aK{constructor(e,t,n,i){super(e,t,n,i)}}a4.prototype.ValueTypeName="vector";class a5{constructor(e="",t=-1,n=[],i=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=ea(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,r=n.length;e!==r;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return a0;case"vector":case"vector2":case"vector3":case"vector4":return a4;case"color":return aQ;case"quaternion":return a2;case"bool":case"boolean":return a$;case"string":return a3}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],n=[];aj(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(n[e]).scale(i));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,i=n.length;e!==i;++e)t.push(aK.toJSON(n[e]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let r=t.length,a=[];for(let e=0;e1){let e=a[1],t=i[e];t||(i[e]=t=[]),t.push(n)}}let a=[];for(let e in i)a.push(this.CreateFromMorphTargetSequence(e,i[e],t,n));return a}static parseAnimation(e,t){if(J("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return K("AnimationClip: No animation in JSONLoader data."),null;let n=function(e,t,n,i,r){if(0!==n.length){let a=[],s=[];aj(n,a,s,i),0!==a.length&&r.push(new e(t,a,s))}},i=[],r=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e{t&&t(r),this.manager.itemEnd(e)},0),r;if(void 0!==se[e])return void se[e].push({onLoad:t,onProgress:n,onError:i});se[e]=[],se[e].push({onLoad:t,onProgress:n,onError:i});let a=new Request(e,{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}),s=this.mimeType,o=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&J("FileLoader: HTTP Status 0 received."),"u"{if(i)e.close();else{let i=new ProgressEvent("progress",{lengthComputable:s,loaded:o+=r.byteLength,total:a});for(let e=0,t=n.length;e{e.error(t)})}()}}))}throw new st(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(s),n=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{a6.add(`file:${e}`,t);let n=se[e];delete se[e];for(let e=0,i=n.length;e{let n=se[e];if(void 0===n)throw this.manager.itemError(e),t;delete se[e];for(let e=0,i=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class si extends a7{constructor(e){super(e)}load(e,t,n,i){let r=this,a=new sn(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):K(t),r.manager.itemError(e)}},n,i)}parse(e){let t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let t in e.uniforms){let r=e.uniforms[t];switch(i.uniforms[t]={},r.type){case"t":i.uniforms[t].value=n(r.value);break;case"c":i.uniforms[t].value=new tq().setHex(r.value);break;case"v2":i.uniforms[t].value=new ed().fromArray(r.value);break;case"v3":i.uniforms[t].value=new ef().fromArray(r.value);break;case"v4":i.uniforms[t].value=new eI().fromArray(r.value);break;case"m3":i.uniforms[t].value=new ev().fromArray(r.value);break;case"m4":i.uniforms[t].value=new tt().fromArray(r.value);break;default:i.uniforms[t].value=r.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(i.glslVersion=e.glslVersion),void 0!==e.extensions)for(let t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(i.lights=e.lights),void 0!==e.clipping&&(i.clipping=e.clipping),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=new ed().fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(i.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(i.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapRotation&&i.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=new ed().fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(i.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(i.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(i.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(i.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(i.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return sA.createMaterialFromType(e)}static createMaterialFromType(e){return new({ShadowMaterial:aP,SpriteMaterial:nZ,RawShaderMaterial:aI,ShaderMaterial:nI,PointsMaterial:ro,MeshPhysicalMaterial:aN,MeshStandardMaterial:aL,MeshPhongMaterial:aU,MeshToonMaterial:aD,MeshNormalMaterial:aO,MeshLambertMaterial:aF,MeshDepthMaterial:az,MeshDistanceMaterial:aB,MeshBasicMaterial:tK,MeshMatcapMaterial:ak,LineDashedMaterial:aV,LineBasicMaterial:i3,Material:tJ})[e]}}class sC{static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}class sR extends nd{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class sP extends a7{constructor(e){super(e)}load(e,t,n,i){let r=this,a=new sn(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):K(t),r.manager.itemError(e)}},n,i)}parse(e){let t={},n={};function i(e,i){if(void 0!==t[i])return t[i];let r=e.interleavedBuffers[i],a=function(e,t){if(void 0!==n[t])return n[t];let i=new Uint32Array(e.arrayBuffers[t]).buffer;return n[t]=i,i}(e,r.buffer),s=new nX(V(r.type,a),r.stride);return s.uuid=r.uuid,t[i]=s,s}let r=e.isInstancedBufferGeometry?new sR:new nd,a=e.data.index;if(void 0!==a){let e=V(a.type,a.array);r.setIndex(new t5(e,1))}let s=e.data.attributes;for(let t in s){let n,a=s[t];if(a.isInterleavedBufferAttribute)n=new nY(i(e.data,a.data),a.itemSize,a.offset,a.normalized);else{let e=V(a.type,a.array);n=new(a.isInstancedBufferAttribute?ix:t5)(e,a.itemSize,a.normalized)}void 0!==a.name&&(n.name=a.name),void 0!==a.usage&&n.setUsage(a.usage),r.setAttribute(t,n)}let o=e.data.morphAttributes;if(o)for(let t in o){let n=o[t],a=[];for(let t=0,r=n.length;t0){(n=new ss(new a8(t))).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){(t=new ss(this.manager)).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t{let t=null,n=null;return void 0!==e.boundingBox&&(t=new ez().fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(n=new e2().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(a._colorsTexture=c(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(a.boundingSphere=new e2().fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(a.boundingBox=new ez().fromJSON(e.boundingBox));break;case"LOD":a=new ii;break;case"Line":a=new rt(l(e.geometry),u(e.material));break;case"LineLoop":a=new rs(l(e.geometry),u(e.material));break;case"LineSegments":a=new ra(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":a=new rd(l(e.geometry),u(e.material));break;case"Sprite":a=new n9(u(e.material));break;case"Group":a=new nk;break;case"Bone":a=new im;break;default:a=new tC}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(a.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){let s=e.children;for(let e=0;e{if(!0!==sD.has(a))return t&&t(n),r.manager.itemEnd(e),n;i&&i(sD.get(a)),r.manager.itemError(e),r.manager.itemEnd(e)}):(setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a);let s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,s.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(n){return a6.add(`image-bitmap:${e}`,n),t&&t(n),r.manager.itemEnd(e),n}).catch(function(t){i&&i(t),sD.set(o,t),a6.remove(`image-bitmap:${e}`),r.manager.itemError(e),r.manager.itemEnd(e)});a6.add(`image-bitmap:${e}`,o),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class sF{static getContext(){return void 0===i&&(i=new(window.AudioContext||window.webkitAudioContext)),i}static setContext(e){i=e}}class sz extends a7{constructor(e){super(e)}load(e,t,n,i){let r=this,a=new sn(this.manager);function s(t){i?i(t):K(t),r.manager.itemError(e)}a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){try{let n=e.slice(0);sF.getContext().decodeAudioData(n,function(e){t(e)}).catch(s)}catch(e){s(e)}},n,i)}}let sB=new tt,sk=new tt,sV=new tt;class sH{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nO,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nO,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(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){let n,i;t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,sV.copy(e.projectionMatrix);let r=t.eyeSep/2,a=r*t.near/t.focus,s=t.near*Math.tan(ei*t.fov*.5)/t.zoom;sk.elements[12]=-r,sB.elements[12]=r,n=-s*t.aspect+a,i=s*t.aspect+a,sV.elements[0]=2*t.near/(i-n),sV.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(sV),n=-s*t.aspect-a,i=s*t.aspect-a,sV.elements[0]=2*t.near/(i-n),sV.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(sV)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(sk),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(sB)}}class sG extends nO{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class sW{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}let sj=new ef,sX=new ep,sq=new ef,sY=new ef,sZ=new ef;class sJ extends tC{constructor(){super(),this.type="AudioListener",this.context=sF.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new sW}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(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(sj,sX,sq),sY.set(0,0,-1).applyQuaternion(sX),sZ.set(0,1,0).applyQuaternion(sX),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(sj.x,e),t.positionY.linearRampToValueAtTime(sj.y,e),t.positionZ.linearRampToValueAtTime(sj.z,e),t.forwardX.linearRampToValueAtTime(sY.x,e),t.forwardY.linearRampToValueAtTime(sY.y,e),t.forwardZ.linearRampToValueAtTime(sY.z,e),t.upX.linearRampToValueAtTime(sZ.x,e),t.upY.linearRampToValueAtTime(sZ.y,e),t.upZ.linearRampToValueAtTime(sZ.z,e)}else t.setPosition(sj.x,sj.y,sj.z),t.setOrientation(sY.x,sY.y,sY.z,sZ.x,sZ.y,sZ.z)}}class sK extends tC{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void J("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void J("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void J("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(e=0){return!1===this.hasPlaybackControl?void J("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(n[e]!==n[e+t]){s.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let e=n;e!==i;++e)t[e]=t[i+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let i=0;i!==r;++i)e[t+i]=e[n+i]}_slerp(e,t,n,i){ep.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,r){let a=this._workIndex*r;ep.multiplyQuaternionsFlat(e,a,e,t,e,n),ep.slerpFlat(e,t,e,t,e,a,i)}_lerp(e,t,n,i,r){let a=1-i;for(let s=0;s!==r;++s){let r=t+s;e[r]=e[r]*a+e[n+s]*i}}_lerpAdditive(e,t,n,i,r){for(let a=0;a!==r;++a){let r=t+a;e[r]=e[r]+e[n+a]*i}}}let s5="\\[\\]\\.:\\/",s6=RegExp("["+s5+"]","g"),s8="[^"+s5+"]",s9="[^"+s5.replace("\\.","")+"]",s7=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",s8)+/(WCOD+)?/.source.replace("WCOD",s9)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",s8)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",s8)+"$"),oe=["material","materials","bones","map"];class ot{constructor(e,t,n){this.path=t,this.parsedPath=n||ot.parseTrackName(t),this.node=ot.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new ot.Composite(e,t,n):new ot(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(s6,"")}static parseTrackName(e){let t=s7.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let e=n.nodeName.substring(i+1);-1!==oe.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let i=0;i=r){let a=r++,u=e[a];t[u.uuid]=l,e[l]=u,t[o]=a,e[a]=s;for(let e=0;e!==i;++e){let t=n[e],i=t[a],r=t[l];t[l]=i,t[a]=r}}}this.nCachedObjects_=r}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,r=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){let o=arguments[s],l=o.uuid,u=t[l];if(void 0!==u)if(delete t[l],u0&&(t[s.uuid]=u),e[u]=s,e.pop();for(let e=0;e!==i;++e){let t=n[e];t[u]=t[r],t.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];let a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,u=this.nCachedObjects_,c=Array(l);i=r.length,n[e]=i,a.push(e),s.push(t),r.push(c);for(let n=u,i=o.length;n!==i;++n){let i=o[n];c[n]=new ot(i,e,t)}return c}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){let i=this._paths,r=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=n,a[n]=o,a.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}}class oi{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const r=t.tracks,a=r.length,s=Array(a),o={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){const t=r[e].createInterpolant(null);s[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=Array(a),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(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),!0===n){let n=this._clip.duration,i=e._clip.duration;e.warp(1,i/n,t),this.warp(n/i,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,r=i.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=r,o[1]=r+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);let r=this._startTime;if(null!==r){let i=(e-r)*n;i<0||0===n?t=0:(this._startTime=null,t=n*i)}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulateAdditive(s);else for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulate(i,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(null!==n){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,r=this._loopCount,a=2202===n;if(0===e)return -1===r?i:a&&(1&r)==1?t-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break s}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i>=t||i<0){let n=Math.floor(i/t);i-=t*n,r+=Math.abs(n);let s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(a&&(1&r)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(e?i.endingStart=this.zeroSlopeAtStart?2401:2400:i.endingStart=2402,t?i.endingEnd=this.zeroSlopeAtEnd?2401:2400:i.endingEnd=2402)}_scheduleFading(e,t,n){let i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=r,o[0]=t,s[1]=r+e,o[1]=n,this}}let or=new Float32Array(1);class oa extends ee{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,s=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName,u=l[o];void 0===u&&(u={},l[o]=u);for(let e=0;e!==r;++e){let r=i[e],l=r.name,c=u[l];if(void 0!==c)++c.referenceCount,a[e]=c;else{if(void 0!==(c=a[e])){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,l));continue}let i=t&&t._propertyBindings[e].binding.parsedPath;c=new s4(ot.create(n,l,i),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,o,l),a[e]=c}s[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==n;++s)t[s]._update(i,e,r,a);let s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ob).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let oM=new ef,oT=new ef,ow=new ef,oE=new ef,oA=new ef,oC=new ef,oR=new ef;class oP{constructor(e=new ef,t=new ef){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){oM.subVectors(e,this.start),oT.subVectors(this.end,this.start);let n=oT.dot(oT),i=oT.dot(oM)/n;return t&&(i=es(i,0,1)),i}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}distanceSqToLine3(e,t=oC,n=oR){let i,r,a=1e-8*1e-8,s=this.start,o=e.start,l=this.end,u=e.end;ow.subVectors(l,s),oE.subVectors(u,o),oA.subVectors(s,o);let c=ow.dot(ow),h=oE.dot(oE),d=oE.dot(oA);if(c<=a&&h<=a)return t.copy(s),n.copy(o),t.sub(n),t.dot(t);if(c<=a)i=0,r=es(r=d/h,0,1);else{let e=ow.dot(oA);if(h<=a)r=0,i=es(-e/c,0,1);else{let t=ow.dot(oE),n=c*h-t*t;i=0!==n?es((t*d-e*h)/n,0,1):0,(r=(t*i+d)/h)<0?(r=0,i=es(-e/c,0,1)):r>1&&(r=1,i=es((t-e)/c,0,1))}}return t.copy(s).add(ow.multiplyScalar(i)),n.copy(o).add(oE.multiplyScalar(r)),t.sub(n),t.dot(t)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}let oI=new ef;class oL extends tC{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new nd,i=[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 e=0,t=1;e<32;e++,t++){const n=e/32*Math.PI*2,r=t/32*Math.PI*2;i.push(Math.cos(n),Math.sin(n),1,Math.cos(r),Math.sin(r),1)}n.setAttribute("position",new nr(i,3));const r=new i3({fog:!1,toneMapped:!1});this.cone=new ra(n,r),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 e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),oI.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(oI),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}let oN=new ef,oU=new tt,oD=new tt;class oO extends ra{constructor(e){const t=function e(t){let n=[];!0===t.isBone&&n.push(t);for(let i=0;i1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{o2.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(o2,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class o4 extends ra{constructor(e=1){const t=new nd;t.setAttribute("position",new nr([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),t.setAttribute("color",new nr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new i3({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){let i=new tq,r=this.geometry.attributes.color.array;return i.set(e),i.toArray(r,0),i.toArray(r,3),i.set(t),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class o5{constructor(){this.type="ShapePath",this.color=new tq,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new r2,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){let t,n,i,r,a,s=ah.isClockWise,o=this.subPaths;if(0===o.length)return[];let l=[];if(1===o.length)return n=o[0],(i=new r3).curves=n.curves,l.push(i),l;let u=!s(o[0].getPoints());u=e?!u:u;let c=[],h=[],d=[],p=0;h[0]=void 0,d[p]=[];for(let i=0,a=o.length;i1){let e=!1,t=0;for(let e=0,t=h.length;eNumber.EPSILON){if(l<0&&(n=t[a],o=-o,s=t[r],l=-l),e.ys.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==n.y)continue;if(s.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=s.x)return!0}}return i})(a.p,h[i].p)&&(n!==i&&t++,s?(s=!1,c[i].push(a)):e=!0);s&&c[n].push(a)}}t>0&&!1===e&&(d=c)}for(let e=0,t=h.length;et?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}static cover(e,t){let n;return(n=e.image&&e.image.width?e.image.width/e.image.height:1)>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}static fill(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}static getByteLength(e,t,n,i){return o8(e,t,n,i)}}function o7(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0===t||null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function le(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){let e=t.get(n);(!e||e.versiontypeof Float16Array&&r instanceof Float16Array)i=e.HALF_FLOAT;else if(r instanceof Uint16Array)i=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)i=e.SHORT;else if(r instanceof Uint32Array)i=e.UNSIGNED_INT;else if(r instanceof Int32Array)i=e.INT;else if(r instanceof Int8Array)i=e.BYTE;else if(r instanceof Uint8Array)i=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)i=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);return{buffer:o,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:s}}(n,i));else if(r.versione.start-t.start);let t=0;for(let e=1;etypeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"182"}})),"u">typeof window&&(window.__THREE__?J("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="182"),e.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveAnimationBlendMode",()=>2501,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"AlwaysStencilFunc",()=>519,"AmbientLight",()=>sM,"AnimationAction",()=>oi,"AnimationClip",()=>a5,"AnimationLoader",()=>si,"AnimationMixer",()=>oa,"AnimationObjectGroup",()=>on,"AnimationUtils",()=>aX,"ArcCurve",()=>rF,"ArrayCamera",()=>sG,"ArrowHelper",()=>o3,"AttachedBindMode",()=>R,"Audio",()=>sK,"AudioAnalyser",()=>s3,"AudioContext",()=>sF,"AudioListener",()=>sJ,"AudioLoader",()=>sz,"AxesHelper",()=>o4,"BackSide",()=>1,"BasicDepthPacking",()=>3200,"BasicShadowMap",()=>0,"BatchedMesh",()=>i2,"Bone",()=>im,"BooleanKeyframeTrack",()=>a$,"Box2",()=>oS,"Box3",()=>ez,"Box3Helper",()=>o0,"BoxGeometry",()=>nE,"BoxHelper",()=>oQ,"BufferAttribute",()=>t5,"BufferGeometry",()=>nd,"BufferGeometryLoader",()=>sP,"ByteType",()=>1010,"Cache",()=>a6,"Camera",()=>nL,"CameraHelper",()=>oJ,"CanvasTexture",()=>rx,"CapsuleGeometry",()=>rT,"CatmullRomCurve3",()=>rG,"CineonToneMapping",()=>3,"CircleGeometry",()=>rw,"ClampToEdgeWrapping",()=>1001,"Clock",()=>sW,"Color",()=>tq,"ColorKeyframeTrack",()=>aQ,"ColorManagement",()=>eb,"CompressedArrayTexture",()=>r_,"CompressedCubeTexture",()=>ry,"CompressedTexture",()=>rv,"CompressedTextureLoader",()=>sr,"ConeGeometry",()=>rA,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"Controls",()=>o6,"CubeCamera",()=>nF,"CubeDepthTexture",()=>rS,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>nz,"CubeTextureLoader",()=>so,"CubeUVReflectionMapping",()=>306,"CubicBezierCurve",()=>rq,"CubicBezierCurve3",()=>rY,"CubicInterpolant",()=>aY,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceFrontBack",()=>3,"CullFaceNone",()=>0,"Curve",()=>rD,"CurvePath",()=>r1,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"CylinderGeometry",()=>rE,"Cylindrical",()=>oy,"Data3DTexture",()=>eO,"DataArrayTexture",()=>eU,"DataTexture",()=>ig,"DataTextureLoader",()=>sl,"DataUtils",()=>t1,"DecrementStencilOp",()=>7683,"DecrementWrapStencilOp",()=>34056,"DefaultLoadingManager",()=>a9,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>rb,"DetachedBindMode",()=>P,"DirectionalLight",()=>sS,"DirectionalLightHelper",()=>oq,"DiscreteInterpolant",()=>aJ,"DodecahedronGeometry",()=>rR,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"DynamicCopyUsage",()=>35050,"DynamicDrawUsage",()=>35048,"DynamicReadUsage",()=>35049,"EdgesGeometry",()=>rU,"EllipseCurve",()=>rO,"EqualCompare",()=>514,"EqualDepth",()=>4,"EqualStencilFunc",()=>514,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>th,"EventDispatcher",()=>ee,"ExternalTexture",()=>rM,"ExtrudeGeometry",()=>af,"FileLoader",()=>sn,"Float16BufferAttribute",()=>ni,"Float32BufferAttribute",()=>nr,"FloatType",()=>1015,"Fog",()=>nW,"FogExp2",()=>nG,"FramebufferTexture",()=>rg,"FrontSide",()=>0,"Frustum",()=>iO,"FrustumArray",()=>iB,"GLBufferAttribute",()=>oh,"GLSL1",()=>"100","GLSL3",()=>D,"GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"GreaterEqualStencilFunc",()=>518,"GreaterStencilFunc",()=>516,"GridHelper",()=>oH,"Group",()=>nk,"HalfFloatType",()=>1016,"HemisphereLight",()=>sh,"HemisphereLightHelper",()=>oV,"IcosahedronGeometry",()=>ag,"ImageBitmapLoader",()=>sO,"ImageLoader",()=>ss,"ImageUtils",()=>eT,"IncrementStencilOp",()=>7682,"IncrementWrapStencilOp",()=>34055,"InstancedBufferAttribute",()=>ix,"InstancedBufferGeometry",()=>sR,"InstancedInterleavedBuffer",()=>oc,"InstancedMesh",()=>iC,"Int16BufferAttribute",()=>t7,"Int32BufferAttribute",()=>nt,"Int8BufferAttribute",()=>t6,"IntType",()=>1013,"InterleavedBuffer",()=>nX,"InterleavedBufferAttribute",()=>nY,"Interpolant",()=>aq,"InterpolateDiscrete",()=>2300,"InterpolateLinear",()=>2301,"InterpolateSmooth",()=>2302,"InterpolationSamplingMode",()=>z,"InterpolationSamplingType",()=>F,"InvertStencilOp",()=>5386,"KeepStencilOp",()=>7680,"KeyframeTrack",()=>aK,"LOD",()=>ii,"LatheGeometry",()=>av,"Layers",()=>td,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LessEqualStencilFunc",()=>515,"LessStencilFunc",()=>513,"Light",()=>sc,"LightProbe",()=>sE,"Line",()=>rt,"Line3",()=>oP,"LineBasicMaterial",()=>i3,"LineCurve",()=>rZ,"LineCurve3",()=>rJ,"LineDashedMaterial",()=>aV,"LineLoop",()=>rs,"LineSegments",()=>ra,"LinearFilter",()=>1006,"LinearInterpolant",()=>aZ,"LinearMipMapLinearFilter",()=>1008,"LinearMipMapNearestFilter",()=>1007,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>L,"LinearToneMapping",()=>1,"LinearTransfer",()=>N,"Loader",()=>a7,"LoaderUtils",()=>sC,"LoadingManager",()=>a8,"LoopOnce",()=>2200,"LoopPingPong",()=>2202,"LoopRepeat",()=>2201,"MOUSE",()=>A,"Material",()=>tJ,"MaterialLoader",()=>sA,"MathUtils",()=>eh,"Matrix2",()=>ox,"Matrix3",()=>ev,"Matrix4",()=>tt,"MaxEquation",()=>104,"Mesh",()=>nT,"MeshBasicMaterial",()=>tK,"MeshDepthMaterial",()=>az,"MeshDistanceMaterial",()=>aB,"MeshLambertMaterial",()=>aF,"MeshMatcapMaterial",()=>ak,"MeshNormalMaterial",()=>aO,"MeshPhongMaterial",()=>aU,"MeshPhysicalMaterial",()=>aN,"MeshStandardMaterial",()=>aL,"MeshToonMaterial",()=>aD,"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",()=>a0,"Object3D",()=>tC,"ObjectLoader",()=>sI,"ObjectSpaceNormalMap",()=>1,"OctahedronGeometry",()=>a_,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>sx,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"Path",()=>r2,"PerspectiveCamera",()=>nO,"Plane",()=>iL,"PlaneGeometry",()=>ay,"PlaneHelper",()=>o1,"PointLight",()=>sy,"PointLightHelper",()=>oF,"Points",()=>rd,"PointsMaterial",()=>ro,"PolarGridHelper",()=>oG,"PolyhedronGeometry",()=>rC,"PositionalAudio",()=>s2,"PropertyBinding",()=>ot,"PropertyMixer",()=>s4,"QuadraticBezierCurve",()=>rK,"QuadraticBezierCurve3",()=>r$,"Quaternion",()=>ep,"QuaternionKeyframeTrack",()=>a2,"QuaternionLinearInterpolant",()=>a1,"R11_EAC_Format",()=>37488,"RAD2DEG",()=>er,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"182","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",()=>aI,"Ray",()=>te,"Raycaster",()=>op,"RectAreaLight",()=>sT,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RenderTarget",()=>eL,"RenderTarget3D",()=>os,"RepeatWrapping",()=>1e3,"ReplaceStencilOp",()=>7681,"ReverseSubtractEquation",()=>102,"RingGeometry",()=>ax,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>36286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>I,"SRGBTransfer",()=>U,"Scene",()=>nj,"ShaderMaterial",()=>nI,"ShadowMaterial",()=>aP,"Shape",()=>r3,"ShapeGeometry",()=>ab,"ShapePath",()=>o5,"ShapeUtils",()=>ah,"ShortType",()=>1011,"Skeleton",()=>iy,"SkeletonHelper",()=>oO,"SkinnedMesh",()=>ip,"Source",()=>eE,"Sphere",()=>e2,"SphereGeometry",()=>aS,"Spherical",()=>o_,"SphericalHarmonics3",()=>sw,"SplineCurve",()=>rQ,"SpotLight",()=>sv,"SpotLightHelper",()=>oL,"Sprite",()=>n9,"SpriteMaterial",()=>nZ,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"StaticCopyUsage",()=>35046,"StaticDrawUsage",()=>35044,"StaticReadUsage",()=>35045,"StereoCamera",()=>sH,"StreamCopyUsage",()=>35042,"StreamDrawUsage",()=>35040,"StreamReadUsage",()=>35041,"StringKeyframeTrack",()=>a3,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TOUCH",()=>C,"TangentSpaceNormalMap",()=>0,"TetrahedronGeometry",()=>aM,"Texture",()=>eP,"TextureLoader",()=>su,"TextureUtils",()=>o9,"Timer",()=>og,"TimestampQuery",()=>O,"TorusGeometry",()=>aT,"TorusKnotGeometry",()=>aw,"Triangle",()=>tH,"TriangleFanDrawMode",()=>2,"TriangleStripDrawMode",()=>1,"TrianglesDrawMode",()=>0,"TubeGeometry",()=>aE,"UVMapping",()=>300,"Uint16BufferAttribute",()=>ne,"Uint32BufferAttribute",()=>nn,"Uint8BufferAttribute",()=>t8,"Uint8ClampedBufferAttribute",()=>t9,"Uniform",()=>oo,"UniformsGroup",()=>ou,"UniformsUtils",()=>nP,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>ed,"Vector3",()=>ef,"Vector4",()=>eI,"VectorKeyframeTrack",()=>a4,"VideoFrameTexture",()=>rm,"VideoTexture",()=>rf,"WebGL3DRenderTarget",()=>eF,"WebGLArrayRenderTarget",()=>eD,"WebGLCoordinateSystem",()=>2e3,"WebGLCubeRenderTarget",()=>nB,"WebGLRenderTarget",()=>eN,"WebGPUCoordinateSystem",()=>2001,"WebXRController",()=>nH,"WireframeGeometry",()=>aA,"WrapAroundEnding",()=>2402,"ZeroCurvatureEnding",()=>2400,"ZeroFactor",()=>200,"ZeroSlopeEnding",()=>2401,"ZeroStencilOp",()=>0,"arrayNeedsUint32",()=>B,"cloneUniforms",()=>nA,"createCanvasElement",()=>W,"createElementNS",()=>G,"error",()=>K,"getByteLength",()=>o8,"getConsoleFunction",()=>Y,"getUnlitUniformColorSpace",()=>nR,"log",()=>Z,"mergeUniforms",()=>nC,"probeAsync",()=>Q,"setConsoleFunction",()=>q,"warn",()=>J,"warnOnce",()=>$],90072);let lt={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 vec3 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 ).rgb;\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_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\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 #else\n vec4 envColor = vec4( 0.0 );\n #endif\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",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 + ( vec3( 1.0 ) - 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 }\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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\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 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 return depth * ( near - far ) - near;\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 return ( near * far ) / ( ( far - near ) * depth - far );\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 ) * 6.28318530718;\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 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 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 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 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 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 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\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 ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).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 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 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, dp );\n #else\n shadow = step( dp, depth );\n #endif\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 \n #include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \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 \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 \n #include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \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 \n #include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \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 \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \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 \n #include \n #include \n #include \n #include \n #include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \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 \n #include \n #include \n #include \n #include \n #include \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 \n #include \n #include \n #include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \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 \n #include \n #include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"},ln={common:{diffuse:{value:new tq(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new ev},alphaMap:{value:null},alphaMapTransform:{value:new ev},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ev}},envmap:{envMap:{value:null},envMapRotation:{value:new ev},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 ev}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ev}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ev},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ev},normalScale:{value:new ed(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ev},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ev}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ev}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ev}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tq(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},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 tq(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ev},alphaTest:{value:0},uvTransform:{value:new ev}},sprite:{diffuse:{value:new tq(0xffffff)},opacity:{value:1},center:{value:new ed(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ev},alphaMap:{value:null},alphaMapTransform:{value:new ev},alphaTest:{value:0}}},li={basic:{uniforms:nC([ln.common,ln.specularmap,ln.envmap,ln.aomap,ln.lightmap,ln.fog]),vertexShader:lt.meshbasic_vert,fragmentShader:lt.meshbasic_frag},lambert:{uniforms:nC([ln.common,ln.specularmap,ln.envmap,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.fog,ln.lights,{emissive:{value:new tq(0)}}]),vertexShader:lt.meshlambert_vert,fragmentShader:lt.meshlambert_frag},phong:{uniforms:nC([ln.common,ln.specularmap,ln.envmap,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.fog,ln.lights,{emissive:{value:new tq(0)},specular:{value:new tq(1118481)},shininess:{value:30}}]),vertexShader:lt.meshphong_vert,fragmentShader:lt.meshphong_frag},standard:{uniforms:nC([ln.common,ln.envmap,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.roughnessmap,ln.metalnessmap,ln.fog,ln.lights,{emissive:{value:new tq(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag},toon:{uniforms:nC([ln.common,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.gradientmap,ln.fog,ln.lights,{emissive:{value:new tq(0)}}]),vertexShader:lt.meshtoon_vert,fragmentShader:lt.meshtoon_frag},matcap:{uniforms:nC([ln.common,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.fog,{matcap:{value:null}}]),vertexShader:lt.meshmatcap_vert,fragmentShader:lt.meshmatcap_frag},points:{uniforms:nC([ln.points,ln.fog]),vertexShader:lt.points_vert,fragmentShader:lt.points_frag},dashed:{uniforms:nC([ln.common,ln.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:lt.linedashed_vert,fragmentShader:lt.linedashed_frag},depth:{uniforms:nC([ln.common,ln.displacementmap]),vertexShader:lt.depth_vert,fragmentShader:lt.depth_frag},normal:{uniforms:nC([ln.common,ln.bumpmap,ln.normalmap,ln.displacementmap,{opacity:{value:1}}]),vertexShader:lt.meshnormal_vert,fragmentShader:lt.meshnormal_frag},sprite:{uniforms:nC([ln.sprite,ln.fog]),vertexShader:lt.sprite_vert,fragmentShader:lt.sprite_frag},background:{uniforms:{uvTransform:{value:new ev},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:lt.background_vert,fragmentShader:lt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ev}},vertexShader:lt.backgroundCube_vert,fragmentShader:lt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:lt.cube_vert,fragmentShader:lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:lt.equirect_vert,fragmentShader:lt.equirect_frag},distance:{uniforms:nC([ln.common,ln.displacementmap,{referencePosition:{value:new ef},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:lt.distance_vert,fragmentShader:lt.distance_frag},shadow:{uniforms:nC([ln.lights,ln.fog,{color:{value:new tq(0)},opacity:{value:1}}]),vertexShader:lt.shadow_vert,fragmentShader:lt.shadow_frag}};li.physical={uniforms:nC([li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ev},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ev},clearcoatNormalScale:{value:new ed(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ev},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ev},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ev},sheen:{value:0},sheenColor:{value:new tq(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ev},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ev},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ev},transmissionSamplerSize:{value:new ed},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ev},attenuationDistance:{value:0},attenuationColor:{value:new tq(0)},specularColor:{value:new tq(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ev},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ev},anisotropyVector:{value:new ed},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ev}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag};let lr={r:0,b:0,g:0},la=new th,ls=new tt;function lo(e,t,n,i,r,a,s){let o,l,u=new tq(0),c=+(!0!==a),h=null,d=0,p=null;function f(e){let i=!0===e.isScene?e.background:null;return i&&i.isTexture&&(i=(e.backgroundBlurriness>0?n:t).get(i)),i}function m(t,n){t.getRGB(lr,nR(e)),i.buffers.color.setClear(lr.r,lr.g,lr.b,n,s)}return{getClearColor:function(){return u},setClearColor:function(e,t=1){u.set(e),m(u,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){m(u,c=e)},render:function(t){let n=!1,r=f(t);null===r?m(u,c):r&&r.isColor&&(m(r,1),n=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?i.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===a&&i.buffers.color.setClear(0,0,0,0,s),(e.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){let i=f(n);i&&(i.isCubeTexture||306===i.mapping)?(void 0===l&&((l=new nT(new nE(1,1,1),new nI({name:"BackgroundCubeMaterial",uniforms:nA(li.backgroundCube.uniforms),vertexShader:li.backgroundCube.vertexShader,fragmentShader:li.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),la.copy(n.backgroundRotation),la.x*=-1,la.y*=-1,la.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(la.y*=-1,la.z*=-1),l.material.uniforms.envMap.value=i,l.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(ls.makeRotationFromEuler(la)),l.material.toneMapped=eb.getTransfer(i.colorSpace)!==U,(h!==i||d!==i.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,h=i,d=i.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(void 0===o&&((o=new nT(new ay(2,2),new nI({name:"BackgroundMaterial",uniforms:nA(li.background.uniforms),vertexShader:li.background.vertexShader,fragmentShader:li.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=i,o.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,o.material.toneMapped=eb.getTransfer(i.colorSpace)!==U,!0===i.matrixAutoUpdate&&i.updateMatrix(),o.material.uniforms.uvTransform.value.copy(i.matrix),(h!==i||d!==i.version||p!==e.toneMapping)&&(o.material.needsUpdate=!0,h=i,d=i.version,p=e.toneMapping),o.layers.enableAll(),t.unshift(o,o.geometry,o.material,0,0,null))},dispose:function(){void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0),void 0!==o&&(o.geometry.dispose(),o.material.dispose(),o=void 0)}}}function ll(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=u(null),a=r,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){let t=[],i=[],r=[];for(let e=0;e=0){let n=r[t],i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n||n.attribute!==i||i&&n.data!==i.data)return!0;o++}return a.attributesNum!==o||a.index!==i}(n,m,l,g))&&function(e,t,n,i){let r={},s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,o++}a.attributes=r,a.attributesNum=o,a.index=i}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(M||s)&&(s=!1,function(n,i,r,a){c();let s=a.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(let i in o){let r=o[i];if(r.location>=0){let o=s[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){let i=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let u=l.buffer,c=l.type,p=l.bytesPerElement,m=c===e.INT||c===e.UNSIGNED_INT||1013===o.gpuType;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,g=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=void 0!==n.precision?n.precision:"highp",o=a(s);return o!==s&&(J("WebGLRenderer:",s,"not supported, using",o,"instead."),s=o),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:a,textureFormatReadable:function(t){return 1023===t||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let r=1016===n&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return 1009===n||i.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||1015===n||!!r},precision:s,logarithmicDepthBuffer:!0===n.logarithmicDepthBuffer,reversedDepthBuffer:!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function lh(e){let t=this,n=null,i=0,r=!1,a=!1,s=new iL,o=new ev,l={value:null,needsUpdate:!1};function u(e,n,i,r){let a=null!==e?e.length:0,u=null;if(0!==a){if(u=l.value,!0!==r||null===u){let t=i+4*a,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===u||u.length0),t.numPlanes=i,t.numIntersection=0)}}function ld(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping;if(303===a||304===a)if(t.has(r))return n(t.get(r).texture,r.mapping);else{let a=r.image;if(!a||!(a.height>0))return null;{let s=new nB(a.height);return s.fromEquirectangularTexture(e,r),t.set(r,s),r.addEventListener("dispose",i),n(s.texture,r.mapping)}}}return r},dispose:function(){t=new WeakMap}}}let lp=[.125,.215,.35,.446,.526,.582],lf=new sx,lm=new tq,lg=null,lv=0,l_=0,ly=!1,lx=new ef;class lb{constructor(e){this._renderer=e,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(e,t=0,n=.1,i=100,r={}){let{size:a=256,position:s=lx}=r;lg=this._renderer.getRenderTarget(),lv=this._renderer.getActiveCubeFace(),l_=this._renderer.getActiveMipmapLevel(),ly=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,i,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=lw(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=lT(),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(e){this._lodMax=Math.floor(Math.log2(e)),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 e=0;ee-4?o=lp[s-e+4-1]:0===s&&(o=0),n.push(o);let l=1/(a-2),u=-l,c=1+l,h=[u,u,c,u,c,c,u,u,c,c,u,c],d=new Float32Array(108),p=new Float32Array(72),f=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];d.set(i,18*e),p.set(h,12*e);let r=[e,e,e,e,e,e];f.set(r,6*e)}let m=new nd;m.setAttribute("position",new t5(d,3)),m.setAttribute("uv",new t5(p,2)),m.setAttribute("faceIndex",new t5(f,1)),i.push(new nT(m,null)),r>4&&r--}return{lodMeshes:i,sizeLods:t,sigmas:n}}(i)),this._blurMaterial=(r=i,new nI({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.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 ef(0,1,0)}},vertexShader:lE(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(a=i,new nI({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:lE(),fragmentShader:` - - precision highp float; - precision highp int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform float roughness; - uniform float mipInt; - - #define ENVMAP_TYPE_CUBE_UV - #include - - #define PI 3.14159265359 - - // Van der Corput radical inverse - float radicalInverse_VdC(uint bits) { - bits = (bits << 16u) | (bits >> 16u); - bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); - bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); - bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); - bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); - return float(bits) * 2.3283064365386963e-10; // / 0x100000000 - } - - // Hammersley sequence - vec2 hammersley(uint i, uint N) { - return vec2(float(i) / float(N), radicalInverse_VdC(i)); - } - - // GGX VNDF importance sampling (Eric Heitz 2018) - // "Sampling the GGX Distribution of Visible Normals" - // https://jcgt.org/published/0007/04/01/ - vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { - float alpha = roughness * roughness; - - // Section 3.2: Transform view direction to hemisphere configuration - vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); - - // Section 4.1: Orthonormal basis - float lensq = Vh.x * Vh.x + Vh.y * Vh.y; - vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); - vec3 T2 = cross(Vh, T1); - - // Section 4.2: Parameterization of projected area - float r = sqrt(Xi.x); - float phi = 2.0 * PI * Xi.y; - float t1 = r * cos(phi); - float t2 = r * sin(phi); - float s = 0.5 * (1.0 + Vh.z); - t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; - - // Section 4.3: Reprojection onto hemisphere - vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; - - // Section 3.4: Transform back to ellipsoid configuration - return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); - } - - void main() { - vec3 N = normalize(vOutputDirection); - vec3 V = N; // Assume view direction equals normal for pre-filtering - - vec3 prefilteredColor = vec3(0.0); - float totalWeight = 0.0; - - // For very low roughness, just sample the environment directly - if (roughness < 0.001) { - gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); - return; - } - - // Tangent space basis for VNDF sampling - vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - - for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { - vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); - - // For PMREM, V = N, so in tangent space V is always (0, 0, 1) - vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); - - // Transform H back to world space - vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); - vec3 L = normalize(2.0 * dot(V, H) * H - V); - - float NdotL = max(dot(N, L), 0.0); - - if(NdotL > 0.0) { - // Sample environment at fixed mip level - // VNDF importance sampling handles the distribution filtering - vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); - - // Weight by NdotL for the split-sum approximation - // VNDF PDF naturally accounts for the visible microfacet distribution - prefilteredColor += sampleColor * NdotL; - totalWeight += NdotL; - } - } - - if (totalWeight > 0.0) { - prefilteredColor = prefilteredColor / totalWeight; - } - - gl_FragColor = vec4(prefilteredColor, 1.0); - } - `,blending:0,depthTest:!1,depthWrite:!1}))}return i}_compileMaterial(e){let t=new nT(new nd,e);this._renderer.compile(t,lf)}_sceneToCubeUV(e,t,n,i,r){let a=new nO(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(lm),l.toneMapping=0,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(i),l.clearDepth(),l.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new nT(new nE,new tK({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1})));let h=this._backgroundBox,d=h.material,p=!1,f=e.background;f?f.isColor&&(d.color.copy(f),e.background=null,p=!0):(d.color.copy(lm),p=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x+o[t],r.y,r.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y+o[t],r.z)):(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y,r.z+o[t]));let u=this._cubeSize;lM(i,n*u,t>2?u:0,u,u),l.setRenderTarget(i),p&&l.render(h,a),l.render(e,a)}l.toneMapping=c,l.autoClear=u,e.background=f}_textureToCubeUV(e,t){let n=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=lw()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=lT());let r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r,r.uniforms.envMap.value=e;let s=this._cubeSize;lM(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,lf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let i=this._lodMeshes.length;for(let t=1;th-4?n-h+4:0),f=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=c*(0+1.25*l),o.mipInt.value=h-t,lM(r,p,f,3*d,2*d),i.setRenderTarget(r),i.render(s,lf),o.envMap.value=r.texture,o.roughness.value=0,o.mipInt.value=h-n,lM(e,p,f,3*d,2*d),i.setRenderTarget(e),i.render(s,lf)}_blur(e,t,n,i,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&K("blur direction must be either latitudinal or longitudinal!");let u=this._lodMeshes[i];u.material=l;let c=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&J(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);let m=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:ev-4?i-v+4:0),y,3*_,2*_),o.setRenderTarget(t),o.render(u,lf)}}function lS(e,t,n){let i=new eN(e,t,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function lM(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function lT(){return new nI({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:lE(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function lw(){return new nI({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lE(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function lE(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function lA(e){let t=new WeakMap,n=null;function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping,s=303===a||304===a,o=301===a||302===a;if(s||o){let a=t.get(r),l=void 0!==a?a.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new lb(e)),(a=s?n.fromEquirectangular(r,a):n.fromCubemap(r,a)).texture.pmremVersion=r.pmremVersion,t.set(r,a),a.texture;{if(void 0!==a)return a.texture;let l=r.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new lb(e)),(a=s?n.fromEquirectangular(r):n.fromCubemap(r)).texture.pmremVersion=r.pmremVersion,t.set(r,a),r.addEventListener("dispose",i),a.texture):null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function lC(e){let t={};function n(n){if(void 0!==t[n])return t[n];let i=e.getExtension(n);return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){let t=n(e);return null===t&&$("WebGLRenderer: "+e+" extension not supported."),t}}}function lR(e,t,n,i){let r={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],i=e.index,r=e.attributes.position,s=0;if(null!==i){let e=i.array;s=i.version;for(let t=0,i=e.length;tt.maxTextureSize&&(f=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let m=new Float32Array(p*f*4*c),g=new eU(m,p,f,c);g.type=1015,g.needsUpdate=!0;let v=4*d;for(let t=0;t - #include - - void main() { - gl_FragColor = texture2D( tDiffuse, vUv ); - - #ifdef LINEAR_TONE_MAPPING - gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); - #elif defined( REINHARD_TONE_MAPPING ) - gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); - #elif defined( CINEON_TONE_MAPPING ) - gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); - #elif defined( ACES_FILMIC_TONE_MAPPING ) - gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); - #elif defined( AGX_TONE_MAPPING ) - gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); - #elif defined( NEUTRAL_TONE_MAPPING ) - gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); - #elif defined( CUSTOM_TONE_MAPPING ) - gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); - #endif - - #ifdef SRGB_TRANSFER - gl_FragColor = sRGBTransferOETF( gl_FragColor ); - #endif - }`,depthTest:!1,depthWrite:!1}),c=new nT(l,u),h=new sx(-1,1,1,-1,0,1),d=null,p=null,f=!1,m=null,g=[],v=!1;this.setSize=function(e,t){s.setSize(e,t),o.setSize(e,t);for(let n=0;n0&&!0===g[0].isRenderPass;let t=s.width,n=s.height;for(let e=0;e0)return e;let r=t*n,a=lV[r];if(void 0===a&&(a=new Float32Array(r),lV[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function lq(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n0&&(this.seq=i.concat(r))}setValue(e,t,n,i){let r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){let i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){let a=t[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){let n=[];for(let i=0,r=e.length;i!==r;++i){let r=e[i];r.id in t&&n.push(r)}return n}}function uP(e,t,n){let i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}let uI=0,uL=new ev;function uN(e,t,n){let i=e.getShaderParameter(t,e.COMPILE_STATUS),r=(e.getShaderInfoLog(t)||"").trim();if(i&&""===r)return"";let a=/ERROR: 0:(\d+)/.exec(r);if(!a)return r;{let i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){let n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;e":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}}let uU={1:"Linear",2:"Reinhard",3:"Cineon",4:"ACESFilmic",6:"AgX",7:"Neutral",5:"Custom"},uD=new ef;function uO(e){return""!==e}function uF(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function uz(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let uB=/^[ \t]*#include +<([\w\d./]+)>/gm;function uk(e){return e.replace(uB,uH)}let uV=new Map;function uH(e,t){let n=lt[t];if(void 0===n){let e=uV.get(t);if(void 0!==e)n=lt[e],J('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return uk(n)}let uG=/#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 uW(e){return e.replace(uG,uj)}function uj(e,t,n,i){let r="";for(let e=parseInt(t);e0&&(s+="\n"),(o=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(uO).join("\n")).length>0&&(o+="\n");else{let e,t,i,l,u;s=[uX(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.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(uO).join("\n"),o=[uX(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+m:"",n.envMap?"#define "+g:"",n.envMap?"#define "+v:"",_?"#define CUBEUV_TEXEL_WIDTH "+_.texelWidth:"",_?"#define CUBEUV_TEXEL_HEIGHT "+_.texelHeight:"",_?"#define CUBEUV_MAX_MIP "+_.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?lt.tonemapping_pars_fragment:"",0!==n.toneMapping?(r="toneMapping",void 0===(e=uU[a=n.toneMapping])?(J("WebGLProgram: Unsupported toneMapping:",a),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",lt.colorspace_pars_fragment,(t=function(e){eb._getMatrix(uL,eb.workingColorSpace,e);let t=`mat3( ${uL.elements.map(e=>e.toFixed(4))} )`;switch(eb.getTransfer(e)){case N:return[t,"LinearTransferOETF"];case U:return[t,"sRGBTransferOETF"];default:return J("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(n.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) { - return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) ); -}`),(eb.getLuminanceCoefficients(uD),i=uD.x.toFixed(4),l=uD.y.toFixed(4),u=uD.z.toFixed(4),`float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( ${i}, ${l}, ${u} ); - return dot( weights, rgb ); -}`),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(uO).join("\n")}d=uz(d=uF(d=uk(d),n),n),p=uz(p=uF(p=uk(p),n),n),d=uW(d),p=uW(p),!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",s=[y,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+s,o=["#define varying in",n.glslVersion===D?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===D?"":"#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"+o);let M=S+s+d,T=S+o+p,w=uP(c,c.VERTEX_SHADER,M),E=uP(c,c.FRAGMENT_SHADER,T);function A(t){if(e.debug.checkShaderErrors){let n=c.getProgramInfoLog(b)||"",i=c.getShaderInfoLog(w)||"",r=c.getShaderInfoLog(E)||"",a=n.trim(),l=i.trim(),u=r.trim(),h=!0,d=!0;if(!1===c.getProgramParameter(b,c.LINK_STATUS))if(h=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,b,w,E);else{let e=uN(c,w,"vertex"),n=uN(c,E,"fragment");K("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(b,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+a+"\n"+e+"\n"+n)}else""!==a?J("WebGLProgram: Program Info Log:",a):(""===l||""===u)&&(d=!1);d&&(t.diagnostics={runnable:h,programLog:a,vertexShader:{log:l,prefix:s},fragmentShader:{log:u,prefix:o}})}c.deleteShader(w),c.deleteShader(E),l=new uR(c,b),u=function(e,t){let n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r0,Y=a.clearcoat>0,Z=a.dispersion>0,K=a.iridescence>0,$=a.sheen>0,Q=a.transmission>0,ee=q&&!!a.anisotropyMap,et=Y&&!!a.clearcoatMap,en=Y&&!!a.clearcoatNormalMap,ei=Y&&!!a.clearcoatRoughnessMap,er=K&&!!a.iridescenceMap,ea=K&&!!a.iridescenceThicknessMap,es=$&&!!a.sheenColorMap,eo=$&&!!a.sheenRoughnessMap,el=!!a.specularMap,eu=!!a.specularColorMap,ec=!!a.specularIntensityMap,eh=Q&&!!a.transmissionMap,ed=Q&&!!a.thicknessMap,ep=!!a.gradientMap,ef=!!a.alphaMap,em=a.alphaTest>0,eg=!!a.alphaHash,ev=!!a.extensions,e_=0;a.toneMapped&&(null===P||!0===P.isXRRenderTarget)&&(e_=e.toneMapping);let ey={shaderID:E,shaderType:a.type,shaderName:a.name,vertexShader:v,fragmentShader:_,defines:a.defines,customVertexShaderID:y,customFragmentShaderID:x,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:D,batchingColor:D&&null!==g._colorsTexture,instancing:N,instancingColor:N&&null!==g.instanceColor,instancingMorph:N&&null!==g.morphTexture,outputColorSpace:null===P?e.outputColorSpace:!0===P.isXRRenderTarget?P.texture.colorSpace:L,alphaToCoverage:!!a.alphaToCoverage,map:O,matcap:F,envMap:z,envMapMode:z&&T.mapping,envMapCubeUVHeight:w,aoMap:B,lightMap:k,bumpMap:V,normalMap:H,displacementMap:G,emissiveMap:W,normalMapObjectSpace:H&&1===a.normalMapType,normalMapTangentSpace:H&&0===a.normalMapType,metalnessMap:j,roughnessMap:X,anisotropy:q,anisotropyMap:ee,clearcoat:Y,clearcoatMap:et,clearcoatNormalMap:en,clearcoatRoughnessMap:ei,dispersion:Z,iridescence:K,iridescenceMap:er,iridescenceThicknessMap:ea,sheen:$,sheenColorMap:es,sheenRoughnessMap:eo,specularMap:el,specularColorMap:eu,specularIntensityMap:ec,transmission:Q,transmissionMap:eh,thicknessMap:ed,gradientMap:ep,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:ef,alphaTest:em,alphaHash:eg,combine:a.combine,mapUv:O&&m(a.map.channel),aoMapUv:B&&m(a.aoMap.channel),lightMapUv:k&&m(a.lightMap.channel),bumpMapUv:V&&m(a.bumpMap.channel),normalMapUv:H&&m(a.normalMap.channel),displacementMapUv:G&&m(a.displacementMap.channel),emissiveMapUv:W&&m(a.emissiveMap.channel),metalnessMapUv:j&&m(a.metalnessMap.channel),roughnessMapUv:X&&m(a.roughnessMap.channel),anisotropyMapUv:ee&&m(a.anisotropyMap.channel),clearcoatMapUv:et&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:en&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ei&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:er&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ea&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:es&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:eo&&m(a.sheenRoughnessMap.channel),specularMapUv:el&&m(a.specularMap.channel),specularColorMapUv:eu&&m(a.specularColorMap.channel),specularIntensityMapUv:ec&&m(a.specularIntensityMap.channel),transmissionMapUv:eh&&m(a.transmissionMap.channel),thicknessMapUv:ed&&m(a.thicknessMap.channel),alphaMapUv:ef&&m(a.alphaMap.channel),vertexTangents:!!S.attributes.tangent&&(H||q),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!S.attributes.color&&4===S.attributes.color.itemSize,pointsUvs:!0===g.isPoints&&!!S.attributes.uv&&(O||ef),fog:!!b,useFog:!0===a.fog,fogExp2:!!b&&b.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:d,reversedDepthBuffer:I,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==S.morphAttributes.position,morphNormals:void 0!==S.morphAttributes.normal,morphColors:void 0!==S.morphAttributes.color,morphTargetsCount:C,morphTextureStride:R,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:e_,decodeVideoTexture:O&&!0===a.map.isVideoTexture&&eb.getTransfer(a.map.colorSpace)===U,decodeVideoTextureEmissive:W&&!0===a.emissiveMap.isVideoTexture&&eb.getTransfer(a.emissiveMap.colorSpace)===U,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:ev&&!0===a.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ev&&!0===a.extensions.multiDraw||D)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ey.vertexUv1s=u.has(1),ey.vertexUv2s=u.has(2),ey.vertexUv3s=u.has(3),u.clear(),ey},getProgramCacheKey:function(t){var n,i,r,a;let s=[];if(t.shaderID?s.push(t.shaderID):(s.push(t.customVertexShaderID),s.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)s.push(e),s.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=s,i=t,n.push(i.precision),n.push(i.outputColorSpace),n.push(i.envMapMode),n.push(i.envMapCubeUVHeight),n.push(i.mapUv),n.push(i.alphaMapUv),n.push(i.lightMapUv),n.push(i.aoMapUv),n.push(i.bumpMapUv),n.push(i.normalMapUv),n.push(i.displacementMapUv),n.push(i.emissiveMapUv),n.push(i.metalnessMapUv),n.push(i.roughnessMapUv),n.push(i.anisotropyMapUv),n.push(i.clearcoatMapUv),n.push(i.clearcoatNormalMapUv),n.push(i.clearcoatRoughnessMapUv),n.push(i.iridescenceMapUv),n.push(i.iridescenceThicknessMapUv),n.push(i.sheenColorMapUv),n.push(i.sheenRoughnessMapUv),n.push(i.specularMapUv),n.push(i.specularColorMapUv),n.push(i.specularIntensityMapUv),n.push(i.transmissionMapUv),n.push(i.thicknessMapUv),n.push(i.combine),n.push(i.fogExp2),n.push(i.sizeAttenuation),n.push(i.morphTargetsCount),n.push(i.morphAttributeCount),n.push(i.numDirLights),n.push(i.numPointLights),n.push(i.numSpotLights),n.push(i.numSpotLightMaps),n.push(i.numHemiLights),n.push(i.numRectAreaLights),n.push(i.numDirLightShadows),n.push(i.numPointLightShadows),n.push(i.numSpotLightShadows),n.push(i.numSpotLightShadowsWithMaps),n.push(i.numLightProbes),n.push(i.shadowMapType),n.push(i.toneMapping),n.push(i.numClippingPlanes),n.push(i.numClipIntersection),n.push(i.depthPacking),r=s,a=t,o.disableAll(),a.instancing&&o.enable(0),a.instancingColor&&o.enable(1),a.instancingMorph&&o.enable(2),a.matcap&&o.enable(3),a.envMap&&o.enable(4),a.normalMapObjectSpace&&o.enable(5),a.normalMapTangentSpace&&o.enable(6),a.clearcoat&&o.enable(7),a.iridescence&&o.enable(8),a.alphaTest&&o.enable(9),a.vertexColors&&o.enable(10),a.vertexAlphas&&o.enable(11),a.vertexUv1s&&o.enable(12),a.vertexUv2s&&o.enable(13),a.vertexUv3s&&o.enable(14),a.vertexTangents&&o.enable(15),a.anisotropy&&o.enable(16),a.alphaHash&&o.enable(17),a.batching&&o.enable(18),a.dispersion&&o.enable(19),a.batchingColor&&o.enable(20),a.gradientMap&&o.enable(21),r.push(o.mask),o.disableAll(),a.fog&&o.enable(0),a.useFog&&o.enable(1),a.flatShading&&o.enable(2),a.logarithmicDepthBuffer&&o.enable(3),a.reversedDepthBuffer&&o.enable(4),a.skinning&&o.enable(5),a.morphTargets&&o.enable(6),a.morphNormals&&o.enable(7),a.morphColors&&o.enable(8),a.premultipliedAlpha&&o.enable(9),a.shadowMapEnabled&&o.enable(10),a.doubleSided&&o.enable(11),a.flipSided&&o.enable(12),a.useDepthPacking&&o.enable(13),a.dithering&&o.enable(14),a.transmission&&o.enable(15),a.sheen&&o.enable(16),a.opaque&&o.enable(17),a.pointsUvs&&o.enable(18),a.decodeVideoTexture&&o.enable(19),a.decodeVideoTextureEmissive&&o.enable(20),a.alphaToCoverage&&o.enable(21),r.push(o.mask),s.push(e.outputColorSpace)),s.push(t.customProgramCacheKey),s.join()},getUniforms:function(e){let t,n=f[e.type];if(n){let e=li[n];t=nP.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){let i=h.get(n);return void 0!==i?++i.usedTimes:(i=new uK(e,n,t,a),c.push(i),h.set(n,i)),i},releaseProgram:function(e){if(0==--e.usedTimes){let t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),h.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function u2(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function u3(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function u4(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function u5(){let e=[],t=0,n=[],i=[],r=[];function a(n,i,r,a,s,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,s,o,l,u){let c=a(e,t,s,o,l,u);s.transmission>0?i.push(c):!0===s.transparent?r.push(c):n.push(c)},unshift:function(e,t,s,o,l,u){let c=a(e,t,s,o,l,u);s.transmission>0?i.unshift(c):!0===s.transparent?r.unshift(c):n.unshift(c)},finish:function(){for(let n=t,i=e.length;n1&&n.sort(e||u3),i.length>1&&i.sort(t||u4),r.length>1&&r.sort(t||u4)}}}function u6(){let e=new WeakMap;return{get:function(t,n){let i,r=e.get(t);return void 0===r?(i=new u5,e.set(t,[i])):n>=r.length?(i=new u5,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function u8(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new ef,color:new tq};break;case"SpotLight":n={position:new ef,direction:new ef,color:new tq,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ef,color:new tq,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ef,skyColor:new tq,groundColor:new tq};break;case"RectAreaLight":n={color:new tq,position:new ef,halfWidth:new ef,halfHeight:new ef}}return e[t.id]=n,n}}}let u9=0;function u7(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function ce(e){let t,n=new u8,i=(t={},{get:function(e){let n;if(void 0!==t[e.id])return t[e.id];switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ed};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ed,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),r={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 e=0;e<9;e++)r.probe.push(new ef);let a=new ef,s=new tt,o=new tt;return{setup:function(t){let a=0,s=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0;t.sort(u7);for(let e=0,y=t.length;e0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=ln.LTC_FLOAT_1,r.rectAreaLTC2=ln.LTC_FLOAT_2):(r.rectAreaLTC1=ln.LTC_HALF_1,r.rectAreaLTC2=ln.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=o;let y=r.hash;(y.directionalLength!==l||y.pointLength!==u||y.spotLength!==c||y.rectAreaLength!==h||y.hemiLength!==d||y.numDirectionalShadows!==p||y.numPointShadows!==f||y.numSpotShadows!==m||y.numSpotMaps!==g||y.numLightProbes!==_)&&(r.directional.length=l,r.spot.length=c,r.rectArea.length=h,r.point.length=u,r.hemi.length=d,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=f,r.pointShadowMap.length=f,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=f,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=_,y.directionalLength=l,y.pointLength=u,y.spotLength=c,y.rectAreaLength=h,y.hemiLength=d,y.numDirectionalShadows=p,y.numPointShadows=f,y.numSpotShadows=m,y.numSpotMaps=g,y.numLightProbes=_,r.version=u9++)},setupView:function(e,t){let n=0,i=0,l=0,u=0,c=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t=a.length?(r=new ct(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}let ci=[new ef(1,0,0),new ef(-1,0,0),new ef(0,1,0),new ef(0,-1,0),new ef(0,0,1),new ef(0,0,-1)],cr=[new ef(0,-1,0),new ef(0,-1,0),new ef(0,0,1),new ef(0,0,-1),new ef(0,-1,0),new ef(0,-1,0)],ca=new tt,cs=new ef,co=new ef;function cl(e,t,n){let i=new iO,r=new ed,a=new ed,s=new eI,o=new az,l=new aB,u={},c=n.maxTextureSize,h={0:1,1:0,2:2},d=new nI({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ed},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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let f=new nd;f.setAttribute("position",new t5(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new nT(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function _(t,n,i,r){let a=null,s=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===i.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,i=u[e];void 0===i&&(i={},u[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",y)),a=r}return a.visible=n.visible,a.wireframe=n.wireframe,3===r?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=i),a}function y(e){for(let t in e.target.removeEventListener("dispose",y),u){let n=u[t],i=e.target.uuid;i in n&&(n[i].dispose(),delete n[i])}}this.render=function(n,o,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===n.length)return;2===n.type&&(J("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),n.type=1);let u=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),y=e.state;y.setBlending(0),!0===y.buffers.depth.getReversed()?y.buffers.color.setClear(0,0,0,0):y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);let x=v!==this.type;x&&o.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let u=0,h=n.length;uc||r.y>c)&&(r.x>c&&(a.x=Math.floor(c/g.x),r.x=a.x*g.x,f.mapSize.x=a.x),r.y>c&&(a.y=Math.floor(c/g.y),r.y=a.y*g.y,f.mapSize.y=a.y)),null===f.map||!0===x){if(null!==f.map&&(null!==f.map.depthTexture&&(f.map.depthTexture.dispose(),f.map.depthTexture=null),f.map.dispose()),3===this.type){if(h.isPointLight){J("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}f.map=new eN(r.x,r.y,{format:1030,type:1016,minFilter:1006,magFilter:1006,generateMipmaps:!1}),f.map.texture.name=h.name+".shadowMap",f.map.depthTexture=new rb(r.x,r.y,1015),f.map.depthTexture.name=h.name+".shadowMapDepth",f.map.depthTexture.format=1026,f.map.depthTexture.compareFunction=null,f.map.depthTexture.minFilter=1003,f.map.depthTexture.magFilter=1003}else{h.isPointLight?(f.map=new nB(r.x),f.map.depthTexture=new rS(r.x,1014)):(f.map=new eN(r.x,r.y),f.map.depthTexture=new rb(r.x,r.y,1014)),f.map.depthTexture.name=h.name+".shadowMap",f.map.depthTexture.format=1026;let t=e.state.buffers.depth.getReversed();1===this.type?(f.map.depthTexture.compareFunction=t?518:515,f.map.depthTexture.minFilter=1006,f.map.depthTexture.magFilter=1006):(f.map.depthTexture.compareFunction=null,f.map.depthTexture.minFilter=1003,f.map.depthTexture.magFilter=1003)}f.camera.updateProjectionMatrix()}let v=f.map.isWebGLCubeRenderTarget?6:1;for(let n=0;n=1:-1!==P.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(P)[1])>=2);let I=null,L={},N=e.getParameter(e.SCISSOR_BOX),U=e.getParameter(e.VIEWPORT),D=new eI().fromArray(N),O=new eI().fromArray(U);function F(t,n,i,r){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;stypeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new ed,h=new WeakMap,d=new WeakMap,p=!1;try{p="u">typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return p?new OffscreenCanvas(e,t):G("canvas")}function m(e,t,n){let i=1,r=X(e);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1)if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap||"u">typeof VideoFrame&&e instanceof VideoFrame){let n=Math.floor(i*r.width),a=Math.floor(i*r.height);void 0===o&&(o=f(n,a));let s=t?f(n,a):o;return s.width=n,s.height=a,s.getContext("2d").drawImage(e,0,0,n,a),J("WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+a+")."),s}else"data"in e&&J("WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+").");return e}function g(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function _(n,i,r,a,s=!1){if(null!==n){if(void 0!==e[n])return e[n];J("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;if(i===e.RED&&(r===e.FLOAT&&(o=e.R32F),r===e.HALF_FLOAT&&(o=e.R16F),r===e.UNSIGNED_BYTE&&(o=e.R8)),i===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.R8UI),r===e.UNSIGNED_SHORT&&(o=e.R16UI),r===e.UNSIGNED_INT&&(o=e.R32UI),r===e.BYTE&&(o=e.R8I),r===e.SHORT&&(o=e.R16I),r===e.INT&&(o=e.R32I)),i===e.RG&&(r===e.FLOAT&&(o=e.RG32F),r===e.HALF_FLOAT&&(o=e.RG16F),r===e.UNSIGNED_BYTE&&(o=e.RG8)),i===e.RG_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RG8UI),r===e.UNSIGNED_SHORT&&(o=e.RG16UI),r===e.UNSIGNED_INT&&(o=e.RG32UI),r===e.BYTE&&(o=e.RG8I),r===e.SHORT&&(o=e.RG16I),r===e.INT&&(o=e.RG32I)),i===e.RGB_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGB8UI),r===e.UNSIGNED_SHORT&&(o=e.RGB16UI),r===e.UNSIGNED_INT&&(o=e.RGB32UI),r===e.BYTE&&(o=e.RGB8I),r===e.SHORT&&(o=e.RGB16I),r===e.INT&&(o=e.RGB32I)),i===e.RGBA_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),r===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),r===e.UNSIGNED_INT&&(o=e.RGBA32UI),r===e.BYTE&&(o=e.RGBA8I),r===e.SHORT&&(o=e.RGBA16I),r===e.INT&&(o=e.RGBA32I)),i===e.RGB&&(r===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),r===e.UNSIGNED_INT_10F_11F_11F_REV&&(o=e.R11F_G11F_B10F)),i===e.RGBA){let t=s?N:eb.getTransfer(a);r===e.FLOAT&&(o=e.RGBA32F),r===e.HALF_FLOAT&&(o=e.RGBA16F),r===e.UNSIGNED_BYTE&&(o=t===U?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return(o===e.R16F||o===e.R32F||o===e.RG16F||o===e.RG32F||o===e.RGBA16F||o===e.RGBA32F)&&t.get("EXT_color_buffer_float"),o}function y(t,n){let i;return t?null===n||1014===n||1020===n?i=e.DEPTH24_STENCIL8:1015===n?i=e.DEPTH32F_STENCIL8:1012===n&&(i=e.DEPTH24_STENCIL8,J("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||1014===n||1020===n?i=e.DEPTH_COMPONENT24:1015===n?i=e.DEPTH_COMPONENT32F:1012===n&&(i=e.DEPTH_COMPONENT16),i}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function b(e){let t=e.target;t.removeEventListener("dispose",b),function(e){let t=i.get(e);if(void 0===t.__webglInit)return;let n=e.source,r=d.get(n);if(r){let i=r[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&M(e),0===Object.keys(r).length&&d.delete(n)}i.remove(e)}(t),t.isVideoTexture&&h.delete(t)}function S(t){let n=t.target;n.removeEventListener("dispose",S),function(t){let n=i.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),i.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i0&&l.__version!==t.version){let e=t.image;if(null===e)J("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void D(l,t,r);J("WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(l.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,l.__webglTexture,e.TEXTURE0+r)}let E={1e3:e.REPEAT,1001:e.CLAMP_TO_EDGE,1002:e.MIRRORED_REPEAT},A={1003:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,1006:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,1008:e.LINEAR_MIPMAP_LINEAR},C={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function R(n,a){if((1015===a.type&&!1===t.has("OES_texture_float_linear")&&(1006===a.magFilter||1007===a.magFilter||1005===a.magFilter||1008===a.magFilter||1006===a.minFilter||1007===a.minFilter||1005===a.minFilter||1008===a.minFilter)&&J("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,E[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,E[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,E[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&1003!==a.magFilter&&(1005===a.minFilter||1008===a.minFilter)&&(1015!==a.type||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||i.get(a).__currentAnisotropy)){let s=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy}}function P(t,n){let i,r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));let a=n.source,o=d.get(a);void 0===o&&(o={},d.set(a,o));let l=((i=[]).push(n.wrapS),i.push(n.wrapT),i.push(n.wrapR||0),i.push(n.magFilter),i.push(n.minFilter),i.push(n.anisotropy),i.push(n.internalFormat),i.push(n.format),i.push(n.type),i.push(n.generateMipmaps),i.push(n.premultiplyAlpha),i.push(n.flipY),i.push(n.unpackAlignment),i.push(n.colorSpace),i.join());if(l!==t.__cacheKey){void 0===o[l]&&(o[l]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),o[l].usedTimes++;let i=o[t.__cacheKey];void 0!==i&&(o[t.__cacheKey].usedTimes--,0===i.usedTimes&&M(n)),t.__cacheKey=l,t.__webglTexture=o[l].texture}return r}function I(e,t,n){return Math.floor(Math.floor(e/n)/t)}function D(t,s,o){let l=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=e.TEXTURE_3D);let u=P(t,s),c=s.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);let h=i.get(c);if(c.version!==h.__version||!0===u){let t;n.activeTexture(e.TEXTURE0+o);let i=eb.getPrimaries(eb.workingColorSpace),d=""===s.colorSpace?null:eb.getPrimaries(s.colorSpace),p=""===s.colorSpace||i===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=m(s.image,!1,r.maxTextureSize);f=j(s,f);let b=a.convert(s.format,s.colorSpace),S=a.convert(s.type),M=_(s.internalFormat,b,S,s.colorSpace,s.isVideoTexture);R(l,s);let T=s.mipmaps,w=!0!==s.isVideoTexture,E=void 0===h.__version||!0===u,A=c.dataReady,C=x(s,f);if(s.isDepthTexture)M=y(1027===s.format,s.type),E&&(w?n.texStorage2D(e.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,b,S,null));else if(s.isDataTexture)if(T.length>0){w&&E&&n.texStorage2D(e.TEXTURE_2D,C,M,T[0].width,T[0].height);for(let i=0,r=T.length;ie.start-t.start);let o=0;for(let e=1;e0){let r=o8(t.width,t.height,s.format,s.type);for(let a of s.layerUpdates){let s=t.data.subarray(a*r/t.data.BYTES_PER_ELEMENT,(a+1)*r/t.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,t.width,t.height,1,b,s)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,f.depth,b,t.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,M,t.width,t.height,f.depth,0,t.data,0,0);else J("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else w?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,f.depth,b,S,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,M,t.width,t.height,f.depth,0,b,S,t.data)}else{w&&E&&n.texStorage2D(e.TEXTURE_2D,C,M,T[0].width,T[0].height);for(let i=0,r=T.length;i0){let t=o8(f.width,f.height,s.format,s.type);for(let i of s.layerUpdates){let r=f.data.subarray(i*t/f.data.BYTES_PER_ELEMENT,(i+1)*t/f.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,i,f.width,f.height,1,b,S,r)}s.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isData3DTexture)w?(E&&n.texStorage3D(e.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)):n.texImage3D(e.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isFramebufferTexture){if(E)if(w)n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height);else{let t=f.width,i=f.height;for(let r=0;r>=1,i>>=1}}else if(T.length>0){if(w&&E){let t=X(T[0]);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}for(let i=0,r=T.length;i>c),i=Math.max(1,r.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,p,t,i,r.depth,0,h,d,null):n.texImage2D(u,c,p,t,i,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),W(r)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,u,m.__webglTexture,0,H(r)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,u,m.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function F(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,s=y(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;W(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,H(n),s,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,H(n),s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{let t=n.textures;for(let r=0;r{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),r.__depthDisposeCallback=t}r.__boundDepthTexture=e}if(t.depthTexture&&!r.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)z(r.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?z(r.__webglFramebuffer[0],t,0):z(r.__webglFramebuffer,t,0)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=e.createRenderbuffer(),F(r.__webglDepthbuffer[i],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=r.__webglDepthbuffer[i];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let i=t.texture.mipmaps;if(i&&i.length>0?n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=e.createRenderbuffer(),F(r.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,i),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,i)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}let k=[],V=[];function H(e){return Math.min(r.maxSamples,e.samples)}function W(e){let n=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function j(e,t){let n=e.colorSpace,i=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==L&&""!==n&&(eb.getTransfer(n)===U?(1023!==i||1009!==r)&&J("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):K("WebGLTextures: Unsupported texture color space:",n)),t}function X(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"u">typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){let e=T;return e>=r.maxTextures&&J("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=w,this.setTexture2DArray=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?D(a,t,r):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r))},this.setTexture3D=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?D(a,t,r):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function(t,s){let o=i.get(t);!0!==t.isCubeDepthTexture&&t.version>0&&o.__version!==t.version?function(t,s,o){if(6!==s.image.length)return;let l=P(t,s),u=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);let c=i.get(u);if(u.version!==c.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+o);let i=eb.getPrimaries(eb.workingColorSpace),h=""===s.colorSpace?null:eb.getPrimaries(s.colorSpace),d=""===s.colorSpace||i===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=s.isCompressedTexture||s.image[0].isCompressedTexture,f=s.image[0]&&s.image[0].isDataTexture,y=[];for(let e=0;e<6;e++)p||f?y[e]=f?s.image[e].image:s.image[e]:y[e]=m(s.image[e],!0,r.maxCubemapSize),y[e]=j(s,y[e]);let b=y[0],S=a.convert(s.format,s.colorSpace),M=a.convert(s.type),T=_(s.internalFormat,S,M,s.colorSpace),w=!0!==s.isVideoTexture,E=void 0===c.__version||!0===l,A=u.dataReady,C=x(s,b);if(R(e.TEXTURE_CUBE_MAP,s),p){w&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,T,b.width,b.height);for(let i=0;i<6;i++){t=y[i].mipmaps;for(let r=0;r0&&C++;let i=X(y[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,T,i.width,i.height)}for(let i=0;i<6;i++)if(f){w?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,y[i].width,y[i].height,S,M,y[i].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,T,y[i].width,y[i].height,0,S,M,y[i].data);for(let r=0;r1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=r.version,s.memory.textures++),c){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n0){o.__webglFramebuffer=[];for(let t=0;t0&&!1===W(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n0)for(let i=0;i0)for(let n=0;n0){if(!1===W(t)){let r=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=i.get(t),h=r.length>1;if(h)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class cm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){let n=new rM(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new nI({vertexShader:cp,fragmentShader:cf,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new nT(new ay(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class cg extends ee{constructor(e,t){super();const n=this;let i=null,r=1,a=null,s="local-floor",o=1,l=null,u=null,c=null,h=null,d=null,p=null;const f="u">typeof XRWebGLBinding,m=new cm,g={},v=t.getContextAttributes();let _=null,y=null;const x=[],b=[],S=new ed;let M=null;const T=new nO;T.viewport=new eI;const w=new nO;w.viewport=new eI;const E=[T,w],A=new sG;let C=null,R=null;function P(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let n=x[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){i.removeEventListener("select",P),i.removeEventListener("selectstart",P),i.removeEventListener("selectend",P),i.removeEventListener("squeeze",P),i.removeEventListener("squeezestart",P),i.removeEventListener("squeezeend",P),i.removeEventListener("end",I),i.removeEventListener("inputsourceschange",L);for(let e=0;e=0&&(b[i]=null,x[i].disconnect(n))}for(let t=0;t=b.length){b.push(n),i=e;break}else if(null===b[e]){b[e]=n,i=e;break}if(-1===i)break}let r=x[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&J("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&J("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===c&&f&&(c=new XRWebGLBinding(i,t)),c},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(u){if(null!==(i=u)){if(_=e.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",I),i.addEventListener("inputsourceschange",L),!0!==v.xrCompatible&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(S),f&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?1027:1026,a=v.stencil?1020:1014);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:r};h=(c=this.getBinding()).createProjectionLayer(o),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),y=new eN(h.textureWidth,h.textureHeight,{format:1023,type:1009,depthTexture:new rb(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new eN(d.framebufferWidth,d.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}y.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await i.requestReferenceSpace(s),F.setContext(i),F.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};const N=new ef,U=new ef;function D(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,n,r;if(null===i)return;let a=e.near,s=e.far;null!==m.texture&&(m.depthNear>0&&(a=m.depthNear),m.depthFar>0&&(s=m.depthFar)),A.near=w.near=T.near=a,A.far=w.far=T.far=s,(C!==A.near||R!==A.far)&&(i.updateRenderState({depthNear:A.near,depthFar:A.far}),C=A.near,R=A.far),A.layers.mask=6|e.layers.mask,T.layers.mask=3&A.layers.mask,w.layers.mask=5&A.layers.mask;let o=e.parent,l=A.cameras;D(A,o);for(let e=0;e0&&(e.alphaTest.value=i.alphaTest);let r=t.get(i),a=r.envMap,s=r.envMapRotation;a&&(e.envMap.value=a,cv.copy(s),cv.x*=-1,cv.y*=-1,cv.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(cv.y*=-1,cv.z*=-1),e.envMapRotation.value.setFromMatrix4(c_.makeRotationFromEuler(cv)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,nR(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,r,a,s,o){var l,u,c,h,d,p,f,m,g,v,_,y,x,b,S,M,T,w,E,A,C,R,P;let I;r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(e,r):r.isMeshToonMaterial?(i(e,r),l=e,(u=r).gradientMap&&(l.gradientMap.value=u.gradientMap)):r.isMeshPhongMaterial?(i(e,r),c=e,h=r,c.specular.value.copy(h.specular),c.shininess.value=Math.max(h.shininess,1e-4)):r.isMeshStandardMaterial?(i(e,r),d=e,p=r,d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,d.roughnessMapTransform)),p.envMap&&(d.envMapIntensity.value=p.envMapIntensity),r.isMeshPhysicalMaterial&&(f=e,m=r,g=o,f.ior.value=m.ior,m.sheen>0&&(f.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),f.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(f.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,f.sheenColorMapTransform)),m.sheenRoughnessMap&&(f.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,f.sheenRoughnessMapTransform))),m.clearcoat>0&&(f.clearcoat.value=m.clearcoat,f.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(f.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,f.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(f.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),1===m.side&&f.clearcoatNormalScale.value.negate())),m.dispersion>0&&(f.dispersion.value=m.dispersion),m.iridescence>0&&(f.iridescence.value=m.iridescence,f.iridescenceIOR.value=m.iridescenceIOR,f.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(f.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,f.iridescenceMapTransform)),m.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),m.transmission>0&&(f.transmission.value=m.transmission,f.transmissionSamplerMap.value=g.texture,f.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(f.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,f.transmissionMapTransform)),f.thickness.value=m.thickness,m.thicknessMap&&(f.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=m.attenuationDistance,f.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(f.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(f.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=m.specularIntensity,f.specularColor.value.copy(m.specularColor),m.specularColorMap&&(f.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,f.specularColorMapTransform)),m.specularIntensityMap&&(f.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,f.specularIntensityMapTransform)))):r.isMeshMatcapMaterial?(i(e,r),v=e,(_=r).matcap&&(v.matcap.value=_.matcap)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),y=e,x=r,I=t.get(x).light,y.referencePosition.value.setFromMatrixPosition(I.matrixWorld),y.nearDistance.value=I.shadow.camera.near,y.farDistance.value=I.shadow.camera.far):r.isMeshNormalMaterial?i(e,r):r.isLineBasicMaterial?(b=e,S=r,b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,S.map&&(b.map.value=S.map,n(S.map,b.mapTransform)),r.isLineDashedMaterial&&(M=e,T=r,M.dashSize.value=T.dashSize,M.totalSize.value=T.dashSize+T.gapSize,M.scale.value=T.scale)):r.isPointsMaterial?(w=e,E=r,A=a,C=s,w.diffuse.value.copy(E.color),w.opacity.value=E.opacity,w.size.value=E.size*A,w.scale.value=.5*C,E.map&&(w.map.value=E.map,n(E.map,w.uvTransform)),E.alphaMap&&(w.alphaMap.value=E.alphaMap,n(E.alphaMap,w.alphaMapTransform)),E.alphaTest>0&&(w.alphaTest.value=E.alphaTest)):r.isSpriteMaterial?(R=e,P=r,R.diffuse.value.copy(P.color),R.opacity.value=P.opacity,R.rotation.value=P.rotation,P.map&&(R.map.value=P.map,n(P.map,R.mapTransform)),P.alphaMap&&(R.alphaMap.value=P.alphaMap,n(P.alphaMap,R.alphaMapTransform)),P.alphaTest>0&&(R.alphaTest.value=P.alphaTest)):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function cx(e,t,n,i){let r={},a={},s=[],o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?J("WebGLRenderer: Texture samplers can not be part of an uniforms group."):J("WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){let n=t.target;n.removeEventListener("dispose",u);let i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),e.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;i.uniformBlockBinding(e,n)},update:function(n,c){var h;let d,p,f,m,g=r[n.id];void 0===g&&(function(e){let t=e.uniforms,n=0;for(let e=0,i=t.length;e0&&(n+=16-i),e.__size=n,e.__cache={}}(n),(h=n).__bindingPointIndex=d=function(){for(let e=0;etypeof WebGLRenderingContext&&A instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=A.getContextAttributes().alpha}else t=P;const k=new Set([1033,1031,1029]),V=new Set([1009,1014,1012,1020,1017,1018]),H=new Uint32Array(4),G=new Int32Array(4);let j=null,X=null;const q=[],Y=[];let ee=null;this.domElement=E,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 et=this;let en=!1;this._outputColorSpace=I;let ei=0,er=0,ea=null,es=-1,eo=null;const el=new eI,eu=new eI;let ec=null;const eh=new tq(0);let ed=0,ep=E.width,em=E.height,eg=1,ev=null,e_=null;const ey=new eI(0,0,ep,em),ex=new eI(0,0,ep,em);let eS=!1;const eM=new iO;let eT=!1,ew=!1;const eE=new tt,eA=new ef,eC=new eI,eR={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let eP=!1;function eL(){return null===ea?eg:1}let eU=A;function eD(e,t){return E.getContext(e,t)}try{if("setAttribute"in E&&E.setAttribute("data-engine","three.js r182"),E.addEventListener("webglcontextlost",ez,!1),E.addEventListener("webglcontextrestored",eB,!1),E.addEventListener("webglcontextcreationerror",ek,!1),null===eU){const e="webgl2";if(eU=eD(e,{alpha:!0,depth:C,stencil:R,antialias:N,premultipliedAlpha:U,preserveDrawingBuffer:D,powerPreference:O,failIfMajorPerformanceCaveat:F}),null===eU)if(eD(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw K("WebGLRenderer: "+e.message),e}function eO(){(n=new lC(eU)).init(),M=new cd(eU,n),i=new lc(eU,n,e,M),r=new cc(eU,n),i.reversedDepthBuffer&&z&&r.buffers.depth.setReversed(!0),a=new lI(eU),s=new u2,o=new ch(eU,n,r,s,i,M,a),l=new ld(et),u=new lA(et),c=new le(eU),T=new ll(eU,c),h=new lR(eU,c,a,T),d=new lN(eU,h,c,a),x=new lL(eU,i,o),v=new lh(s),p=new u1(et,l,u,n,i,T,v),f=new cy(et,s),m=new u6,g=new cn(n),y=new lo(et,l,u,r,d,t,U),_=new cl(et,d,i),w=new cx(eU,a,i,r),b=new lu(eU,n,a),S=new lP(eU,n,a),a.programs=p.programs,et.capabilities=i,et.extensions=n,et.properties=s,et.renderLists=m,et.shadowMap=_,et.state=r,et.info=a}eO(),1009!==B&&(ee=new lD(B,E.width,E.height,C,R));const eF=new cg(et,eU);function ez(e){e.preventDefault(),Z("WebGLRenderer: Context Lost."),en=!0}function eB(){Z("WebGLRenderer: Context Restored."),en=!1;let e=a.autoReset,t=_.enabled,n=_.autoUpdate,i=_.needsUpdate,r=_.type;eO(),a.autoReset=e,_.enabled=t,_.autoUpdate=n,_.needsUpdate=i,_.type=r}function ek(e){K("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function eV(e){var t,n;let i,r=e.target;r.removeEventListener("dispose",eV),n=t=r,void 0!==(i=s.get(n).programs)&&(i.forEach(function(e){p.releaseProgram(e)}),n.isShaderMaterial&&p.releaseShaderCache(n)),s.remove(t)}function eH(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,e$(e,t,n),e.side=0,e.needsUpdate=!0,e$(e,t,n),e.side=2):e$(e,t,n)}this.xr=eF,this.getContext=function(){return eU},this.getContextAttributes=function(){return eU.getContextAttributes()},this.forceContextLoss=function(){let e=n.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=n.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return eg},this.setPixelRatio=function(e){void 0!==e&&(eg=e,this.setSize(ep,em,!1))},this.getSize=function(e){return e.set(ep,em)},this.setSize=function(e,t,n=!0){eF.isPresenting?J("WebGLRenderer: Can't change size while VR device is presenting."):(ep=e,em=t,E.width=Math.floor(e*eg),E.height=Math.floor(t*eg),!0===n&&(E.style.width=e+"px",E.style.height=t+"px"),null!==ee&&ee.setSize(E.width,E.height),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(ep*eg,em*eg).floor()},this.setDrawingBufferSize=function(e,t,n){ep=e,em=t,eg=n,E.width=Math.floor(e*n),E.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.setEffects=function(e){if(1009===B)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(e){for(let t=0;tp.matrixWorld.determinant(),y=function(e,t,n,a,c){var h,d;!0!==t.isScene&&(t=eR),o.resetTextureUnits();let p=t.fog,m=a.isMeshStandardMaterial?t.environment:null,g=null===ea?et.outputColorSpace:!0===ea.isXRRenderTarget?ea.texture.colorSpace:L,_=(a.isMeshStandardMaterial?u:l).get(a.envMap||m),y=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,b=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),S=!!n.morphAttributes.position,M=!!n.morphAttributes.normal,T=!!n.morphAttributes.color,E=0;a.toneMapped&&(null===ea||!0===ea.isXRRenderTarget)&&(E=et.toneMapping);let A=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,C=void 0!==A?A.length:0,R=s.get(a),P=X.state.lights;if(!0===eT&&(!0===ew||e!==eo)){let t=e===eo&&a.id===es;v.setState(a,e,t)}let I=!1;a.version===R.__version?R.needsLights&&R.lightsStateVersion!==P.state.version||R.outputColorSpace!==g||c.isBatchedMesh&&!1===R.batching?I=!0:c.isBatchedMesh||!0!==R.batching?c.isBatchedMesh&&!0===R.batchingColor&&null===c.colorTexture||c.isBatchedMesh&&!1===R.batchingColor&&null!==c.colorTexture||c.isInstancedMesh&&!1===R.instancing?I=!0:c.isInstancedMesh||!0!==R.instancing?c.isSkinnedMesh&&!1===R.skinning?I=!0:c.isSkinnedMesh||!0!==R.skinning?c.isInstancedMesh&&!0===R.instancingColor&&null===c.instanceColor||c.isInstancedMesh&&!1===R.instancingColor&&null!==c.instanceColor||c.isInstancedMesh&&!0===R.instancingMorph&&null===c.morphTexture||c.isInstancedMesh&&!1===R.instancingMorph&&null!==c.morphTexture||R.envMap!==_||!0===a.fog&&R.fog!==p||void 0!==R.numClippingPlanes&&(R.numClippingPlanes!==v.numPlanes||R.numIntersection!==v.numIntersection)||R.vertexAlphas!==y||R.vertexTangents!==b||R.morphTargets!==S||R.morphNormals!==M||R.morphColors!==T||R.toneMapping!==E?I=!0:R.morphTargetsCount!==C&&(I=!0):I=!0:I=!0:I=!0:(I=!0,R.__version=a.version);let N=R.currentProgram;!0===I&&(N=e$(a,t,c));let U=!1,D=!1,O=!1,F=N.getUniforms(),z=R.uniforms;if(r.useProgram(N.program)&&(U=!0,D=!0,O=!0),a.id!==es&&(es=a.id,D=!0),U||eo!==e){r.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),F.setValue(eU,"projectionMatrix",e.projectionMatrix),F.setValue(eU,"viewMatrix",e.matrixWorldInverse);let t=F.map.cameraPosition;void 0!==t&&t.setValue(eU,eA.setFromMatrixPosition(e.matrixWorld)),i.logarithmicDepthBuffer&&F.setValue(eU,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&F.setValue(eU,"isOrthographic",!0===e.isOrthographicCamera),eo!==e&&(eo=e,D=!0,O=!0)}if(R.needsLights&&(P.state.directionalShadowMap.length>0&&F.setValue(eU,"directionalShadowMap",P.state.directionalShadowMap,o),P.state.spotShadowMap.length>0&&F.setValue(eU,"spotShadowMap",P.state.spotShadowMap,o),P.state.pointShadowMap.length>0&&F.setValue(eU,"pointShadowMap",P.state.pointShadowMap,o)),c.isSkinnedMesh){F.setOptional(eU,c,"bindMatrix"),F.setOptional(eU,c,"bindMatrixInverse");let e=c.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),F.setValue(eU,"boneTexture",e.boneTexture,o))}c.isBatchedMesh&&(F.setOptional(eU,c,"batchingTexture"),F.setValue(eU,"batchingTexture",c._matricesTexture,o),F.setOptional(eU,c,"batchingIdTexture"),F.setValue(eU,"batchingIdTexture",c._indirectTexture,o),F.setOptional(eU,c,"batchingColorTexture"),null!==c._colorsTexture&&F.setValue(eU,"batchingColorTexture",c._colorsTexture,o));let B=n.morphAttributes;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color)&&x.update(c,n,N),(D||R.receiveShadow!==c.receiveShadow)&&(R.receiveShadow=c.receiveShadow,F.setValue(eU,"receiveShadow",c.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(z.envMap.value=_,z.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(z.envMapIntensity.value=t.environmentIntensity),void 0!==z.dfgLUT&&(z.dfgLUT.value=(null===cS&&((cS=new ig(cb,16,16,1030,1016)).name="DFG_LUT",cS.minFilter=1006,cS.magFilter=1006,cS.wrapS=1001,cS.wrapT=1001,cS.generateMipmaps=!1,cS.needsUpdate=!0),cS)),D&&(F.setValue(eU,"toneMappingExposure",et.toneMappingExposure),R.needsLights&&(h=z,d=O,h.ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),p&&!0===a.fog&&f.refreshFogUniforms(z,p),f.refreshMaterialUniforms(z,a,eg,em,X.state.transmissionRenderTarget[e.id]),uR.upload(eU,eQ(R),z,o)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(uR.upload(eU,eQ(R),z,o),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&F.setValue(eU,"center",c.center),F.setValue(eU,"modelViewMatrix",c.modelViewMatrix),F.setValue(eU,"normalMatrix",c.normalMatrix),F.setValue(eU,"modelMatrix",c.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t{function i(){(r.forEach(function(e){s.get(e).currentProgram.isReady()&&r.delete(e)}),0===r.size)?t(e):setTimeout(i,10)}null!==n.get("KHR_parallel_shader_compile")?i():setTimeout(i,10)})};let eG=null;function eW(){eX.stop()}function ej(){eX.start()}const eX=new o7;function eq(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)X.pushLight(e),e.castShadow&&X.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||eM.intersectsSprite(e)){i&&eC.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eE);let t=d.update(e),r=e.material;r.visible&&j.push(e,t,r,n,eC.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||eM.intersectsObject(e))){let t=d.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eC.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),eC.copy(t.boundingSphere.center)),eC.applyMatrix4(e.matrixWorld).applyMatrix4(eE)),Array.isArray(r)){let i=t.groups;for(let a=0,s=i.length;a0&&eJ(a,t,n),s.length>0&&eJ(s,t,n),o.length>0&&eJ(o,t,n),r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),r.setPolygonOffset(!1)}function eZ(e,t,r,a){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;if(void 0===X.state.transmissionRenderTarget[a.id]){let e=n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float");X.state.transmissionRenderTarget[a.id]=new eN(1,1,{generateMipmaps:!0,type:e?1016:1009,minFilter:1008,samples:i.samples,stencilBuffer:R,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:eb.workingColorSpace})}let s=X.state.transmissionRenderTarget[a.id],l=a.viewport||el;s.setSize(l.z*et.transmissionResolutionScale,l.w*et.transmissionResolutionScale);let u=et.getRenderTarget(),c=et.getActiveCubeFace(),h=et.getActiveMipmapLevel();et.setRenderTarget(s),et.getClearColor(eh),(ed=et.getClearAlpha())<1&&et.setClearColor(0xffffff,.5),et.clear(),eP&&y.render(r);let d=et.toneMapping;et.toneMapping=0;let p=a.viewport;if(void 0!==a.viewport&&(a.viewport=void 0),X.setupLightsView(a),!0===eT&&v.setGlobalState(et.clippingPlanes,a),eJ(e,r,a),o.updateMultisampleRenderTarget(s),o.updateRenderTargetMipmap(s),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,i=t.length;ntypeof self&&eX.setContext(self),this.setAnimationLoop=function(e){eG=e,eF.setAnimationLoop(e),null===e?eX.stop():eX.start()},eF.addEventListener("sessionstart",eW),eF.addEventListener("sessionend",ej),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void K("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===en)return;let n=!0===eF.enabled&&!0===eF.isPresenting,i=null!==ee&&(null===ea||n)&&ee.begin(et,ea);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eF.enabled&&!0===eF.isPresenting&&(null===ee||!1===ee.isCompositing())&&(!0===eF.cameraAutoUpdate&&eF.updateCamera(t),t=eF.getCamera()),!0===e.isScene&&e.onBeforeRender(et,e,t,ea),(X=g.get(e,Y.length)).init(t),Y.push(X),eE.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),eM.setFromProjectionMatrix(eE,2e3,t.reversedDepth),ew=this.localClippingEnabled,eT=v.init(this.clippingPlanes,ew),(j=m.get(e,q.length)).init(),q.push(j),!0===eF.enabled&&!0===eF.isPresenting){let e=et.xr.getDepthSensingMesh();null!==e&&eq(e,t,-1/0,et.sortObjects)}eq(e,t,0,et.sortObjects),j.finish(),!0===et.sortObjects&&j.sort(ev,e_),(eP=!1===eF.enabled||!1===eF.isPresenting||!1===eF.hasDepthSensing())&&y.addToRenderList(j,e),this.info.render.frame++,!0===eT&&v.beginShadows();let r=X.state.shadowsArray;if(_.render(r,e,t),!0===eT&&v.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(i&&ee.hasRenderPass())){let n=j.opaque,i=j.transmissive;if(X.setupLights(),t.isArrayCamera){let r=t.cameras;if(i.length>0)for(let t=0,a=r.length;t0&&eZ(n,i,e,t),eP&&y.render(e),eY(j,e,t)}null!==ea&&0===er&&(o.updateMultisampleRenderTarget(ea),o.updateRenderTargetMipmap(ea)),i&&ee.end(et),!0===e.isScene&&e.onAfterRender(et,e,t),T.resetDefaultState(),es=-1,eo=null,Y.pop(),Y.length>0?(X=Y[Y.length-1],!0===eT&&v.setGlobalState(et.clippingPlanes,X.state.camera)):X=null,q.pop(),j=q.length>0?q[q.length-1]:null},this.getActiveCubeFace=function(){return ei},this.getActiveMipmapLevel=function(){return er},this.getRenderTarget=function(){return ea},this.setRenderTargetTextures=function(e,t,n){let i=s.get(e);i.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===i.__autoAllocateDepthBuffer&&(i.__useRenderToTexture=!1),s.get(e.texture).__webglTexture=t,s.get(e.depthTexture).__webglTexture=i.__autoAllocateDepthBuffer?void 0:n,i.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=s.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};const e1=eU.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){ea=e,ei=t,er=n;let i=null,a=!1,l=!1;if(e){let u=s.get(e);if(void 0!==u.__useDefaultFramebuffer){r.bindFramebuffer(eU.FRAMEBUFFER,u.__webglFramebuffer),el.copy(e.viewport),eu.copy(e.scissor),ec=e.scissorTest,r.viewport(el),r.scissor(eu),r.setScissorTest(ec),es=-1;return}if(void 0===u.__webglFramebuffer)o.setupRenderTarget(e);else if(u.__hasExternalTextures)o.rebindTextures(e,s.get(e.texture).__webglTexture,s.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(u.__boundDepthTexture!==t){if(null!==t&&s.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");o.setupDepthRenderbuffer(e)}}let c=e.texture;(c.isData3DTexture||c.isDataArrayTexture||c.isCompressedArrayTexture)&&(l=!0);let h=s.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(h[t])?h[t][n]:h[t],a=!0):i=e.samples>0&&!1===o.useMultisampledRTT(e)?s.get(e).__webglMultisampledFramebuffer:Array.isArray(h)?h[n]:h,el.copy(e.viewport),eu.copy(e.scissor),ec=e.scissorTest}else el.copy(ey).multiplyScalar(eg).floor(),eu.copy(ex).multiplyScalar(eg).floor(),ec=eS;if(0!==n&&(i=e1),r.bindFramebuffer(eU.FRAMEBUFFER,i)&&r.drawBuffers(e,i),r.viewport(el),r.scissor(eu),r.setScissorTest(ec),a){let i=s.get(e.texture);eU.framebufferTexture2D(eU.FRAMEBUFFER,eU.COLOR_ATTACHMENT0,eU.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(l)for(let i=0;i=0&&t<=e.width-a&&n>=0&&n<=e.height-o&&(e.textures.length>1&&eU.readBuffer(eU.COLOR_ATTACHMENT0+c),eU.readPixels(t,n,a,o,M.convert(s),M.convert(u),l))}finally{let e=null!==ea?s.get(ea).__webglFramebuffer:null;r.bindFramebuffer(eU.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,o,l,u,c=0){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(h=h[u]),h)if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o){r.bindFramebuffer(eU.FRAMEBUFFER,h);let u=e.textures[c],d=u.format,p=u.type;if(!i.textureFormatReadable(d))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let f=eU.createBuffer();eU.bindBuffer(eU.PIXEL_PACK_BUFFER,f),eU.bufferData(eU.PIXEL_PACK_BUFFER,l.byteLength,eU.STREAM_READ),e.textures.length>1&&eU.readBuffer(eU.COLOR_ATTACHMENT0+c),eU.readPixels(t,n,a,o,M.convert(d),M.convert(p),0);let m=null!==ea?s.get(ea).__webglFramebuffer:null;r.bindFramebuffer(eU.FRAMEBUFFER,m);let g=eU.fenceSync(eU.SYNC_GPU_COMMANDS_COMPLETE,0);return eU.flush(),await Q(eU,g,4),eU.bindBuffer(eU.PIXEL_PACK_BUFFER,f),eU.getBufferSubData(eU.PIXEL_PACK_BUFFER,0,l),eU.deleteBuffer(f),eU.deleteSync(g),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e,t=null,n=0){let i=Math.pow(2,-n),a=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i),l=null!==t?t.x:0,u=null!==t?t.y:0;o.setTexture2D(e,0),eU.copyTexSubImage2D(eU.TEXTURE_2D,n,0,0,l,u,a,s),r.unbindTexture()};const e2=eU.createFramebuffer(),e3=eU.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,i=null,a=0,l=null){let u,c,h,d,p,f,m,g,v,_;null===l&&(0!==a?($("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),l=a,a=0):l=0);let y=e.isCompressedTexture?e.mipmaps[l]:e.image;if(null!==n)u=n.max.x-n.min.x,c=n.max.y-n.min.y,h=n.isBox3?n.max.z-n.min.z:1,d=n.min.x,p=n.min.y,f=n.isBox3?n.min.z:0;else{let t=Math.pow(2,-a);u=Math.floor(y.width*t),c=Math.floor(y.height*t),h=e.isDataArrayTexture?y.depth:e.isData3DTexture?Math.floor(y.depth*t):1,d=0,p=0,f=0}null!==i?(m=i.x,g=i.y,v=i.z):(m=0,g=0,v=0);let x=M.convert(t.format),b=M.convert(t.type);t.isData3DTexture?(o.setTexture3D(t,0),_=eU.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(o.setTexture2DArray(t,0),_=eU.TEXTURE_2D_ARRAY):(o.setTexture2D(t,0),_=eU.TEXTURE_2D),eU.pixelStorei(eU.UNPACK_FLIP_Y_WEBGL,t.flipY),eU.pixelStorei(eU.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eU.pixelStorei(eU.UNPACK_ALIGNMENT,t.unpackAlignment);let S=eU.getParameter(eU.UNPACK_ROW_LENGTH),T=eU.getParameter(eU.UNPACK_IMAGE_HEIGHT),w=eU.getParameter(eU.UNPACK_SKIP_PIXELS),E=eU.getParameter(eU.UNPACK_SKIP_ROWS),A=eU.getParameter(eU.UNPACK_SKIP_IMAGES);eU.pixelStorei(eU.UNPACK_ROW_LENGTH,y.width),eU.pixelStorei(eU.UNPACK_IMAGE_HEIGHT,y.height),eU.pixelStorei(eU.UNPACK_SKIP_PIXELS,d),eU.pixelStorei(eU.UNPACK_SKIP_ROWS,p),eU.pixelStorei(eU.UNPACK_SKIP_IMAGES,f);let C=e.isDataArrayTexture||e.isData3DTexture,R=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=s.get(e),i=s.get(t),o=s.get(n.__renderTarget),_=s.get(i.__renderTarget);r.bindFramebuffer(eU.READ_FRAMEBUFFER,o.__webglFramebuffer),r.bindFramebuffer(eU.DRAW_FRAMEBUFFER,_.__webglFramebuffer);for(let n=0;ntypeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=eb._getDrawingBufferColorSpace(e),t.unpackColorSpace=eb._getUnpackColorSpace()}}e.s(["PMREMGenerator",()=>lb,"ShaderChunk",()=>lt,"ShaderLib",()=>li,"UniformsLib",()=>ln,"WebGLRenderer",()=>cM,"WebGLUtils",()=>cd],8560);var cT=e.i(66748);let cw=[];function cE(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let i=e.length;if(t.length!==i)return!1;for(let r=0;r0&&(r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.remove,i.lifespan)),r.response;if(!n)throw r.promise}let r={keys:t,equal:i.equal,remove:()=>{let e=cw.indexOf(r);-1!==e&&cw.splice(e,1)},promise:("object"==typeof e&&"function"==typeof e.then?e:e(...t)).then(e=>{r.response=e,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(e=>r.error=e)};if(cw.push(r),!n)throw r.promise}var cC=e.i(89499),cR=e.i(43476),cP=E;function cI(e,t,n){if(!e)return;if(!0===n(e))return e;let i=t?e.return:e.child;for(;i;){let e=cI(i,t,n);if(e)return e;i=t?null:i.sibling}}function cL(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}"u">typeof window&&((null==(y=window.document)?void 0:y.createElement)||(null==(x=window.navigator)?void 0:x.product)==="ReactNative")?cP.useLayoutEffect:cP.useEffect;let cN=cL(cP.createContext(null));class cU extends cP.Component{render(){return cP.createElement(cN.Provider,{value:this._reactInternals},this.props.children)}}function cD(){let e=cP.useContext(cN);if(null===e)throw Error("its-fine: useFiber must be called within a !");let t=cP.useId();return cP.useMemo(()=>{for(let n of[e,null==e?void 0:e.alternate]){if(!n)continue;let e=cI(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}let cO=Symbol.for("react.context"),cF=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===cO;function cz(){let e=function(){let e=cD(),[t]=cP.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;cF(e)&&e!==cN&&!t.has(e)&&t.set(e,cP.use(cL(e))),n=n.return}return t}();return cP.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>i=>cP.createElement(t,null,cP.createElement(n.Provider,{...i,value:e.get(n)})),e=>cP.createElement(cU,{...e})),[e])}function cB(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}e.s(["FiberProvider",()=>cU,"traverseFiber",()=>cI,"useContextBridge",()=>cz,"useFiber",()=>cD],46791),E.act;let ck=e=>e&&e.hasOwnProperty("current"),cV=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),cH="u">typeof window&&((null==(m=window.document)?void 0:m.createElement)||(null==(g=window.navigator)?void 0:g.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function cG(e){let t=E.useRef(e);return cH(()=>void(t.current=e),[e]),t}function cW(){let e=cD(),t=cz();return E.useMemo(()=>({children:n})=>{let i=cI(e,!0,e=>e.type===E.StrictMode)?E.StrictMode:E.Fragment;return(0,cR.jsx)(i,{children:(0,cR.jsx)(t,{children:n})})},[e,t])}function cj({set:e}){return cH(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}let cX=((v=class extends E.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}).getDerivedStateFromError=()=>({error:!0}),v);function cq(e){var t;let n="u">typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],n),e[1]):e}function cY(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}let cZ={obj:e=>e===Object(e)&&!cZ.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t,{arrays:n="shallow",objects:i="reference",strict:r=!0}={}){let a;if(typeof e!=typeof t||!!e!=!!t)return!1;if(cZ.str(e)||cZ.num(e)||cZ.boo(e))return e===t;let s=cZ.obj(e);if(s&&"reference"===i)return e===t;let o=cZ.arr(e);if(o&&"reference"===n)return e===t;if((o||s)&&e===t)return!0;for(a in e)if(!(a in t))return!1;if(s&&"shallow"===n&&"shallow"===i){for(a in r?t:e)if(!cZ.equ(e[a],t[a],{strict:r,objects:"reference"}))return!1}else for(a in r?t:e)if(e[a]!==t[a])return!1;if(cZ.und(a)){if(o&&0===e.length&&0===t.length||s&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}},cJ=["children","key","ref"];function cK(e,t,n,i){let r=null==e?void 0:e.__r3f;return!r&&(r={root:t,type:n,parent:null,children:[],props:function(e){let t={};for(let n in e)cJ.includes(n)||(t[n]=e[n]);return t}(i),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=r)),r}function c$(e,t){if(!t.includes("-")||t in e)return{root:e,key:t,target:e[t]};let n=e,i=t.split("-");for(let r of i){if("object"!=typeof n||null===n){if(void 0!==n)return{root:n,key:i.slice(i.indexOf(r)).join("-"),target:void 0};return{root:e,key:t,target:void 0}}t=r,e=n,n=n[t]}return{root:e,key:t,target:n}}let cQ=/-\d+$/;function c0(e,t){if(cZ.str(t.props.attach)){if(cQ.test(t.props.attach)){let n=t.props.attach.replace(cQ,""),{root:i,key:r}=c$(e.object,n);Array.isArray(i[r])||(i[r]=[])}let{root:n,key:i}=c$(e.object,t.props.attach);t.previousAttach=n[i],n[i]=t.object}else cZ.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function c1(e,t){if(cZ.str(t.props.attach)){let{root:n,key:i}=c$(e.object,t.props.attach),r=t.previousAttach;void 0===r?delete n[i]:n[i]=r}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}let c2=[...cJ,"args","dispose","attach","object","onUpdate","dispose"],c3=new Map,c4=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],c5=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function c6(e,t){var n,i;let r=e.__r3f,a=r&&cB(r).getState(),s=null==r?void 0:r.eventCount;for(let n in t){let s=t[n];if(c2.includes(n))continue;if(r&&c5.test(n)){"function"==typeof s?r.handlers[n]=s:delete r.handlers[n],r.eventCount=Object.keys(r.handlers).length;continue}if(void 0===s)continue;let{root:o,key:l,target:u}=c$(e,n);if(void 0===u&&("object"!=typeof o||null===o))throw Error(`R3F: Cannot set "${n}". Ensure it is an object before setting "${l}".`);u instanceof td&&s instanceof td?u.mask=s.mask:u instanceof tq&&cV(s)?u.set(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"function"==typeof u.copy&&null!=s&&s.constructor&&u.constructor===s.constructor?u.copy(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&Array.isArray(s)?"function"==typeof u.fromArray?u.fromArray(s):u.set(...s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"number"==typeof s?"function"==typeof u.setScalar?u.setScalar(s):u.set(s):(o[l]=s,a&&!a.linear&&c4.includes(l)&&null!=(i=o[l])&&i.isTexture&&1023===o[l].format&&1009===o[l].type&&(o[l].colorSpace=I))}if(null!=r&&r.parent&&null!=a&&a.internal&&null!=(n=r.object)&&n.isObject3D&&s!==r.eventCount){let e=r.object,t=a.internal.interaction.indexOf(e);t>-1&&a.internal.interaction.splice(t,1),r.eventCount&&null!==e.raycast&&a.internal.interaction.push(e)}return r&&void 0===r.props.attach&&(r.object.isBufferGeometry?r.props.attach="geometry":r.object.isMaterial&&(r.props.attach="material")),r&&c8(r),e}function c8(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let n=null==(t=e.root)||null==t.getState?void 0:t.getState();n&&0===n.internal.frames&&n.invalidate()}let c9=e=>null==e?void 0:e.isObject3D;function c7(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function he(e,t,n,i){let r=n.get(t);r&&(n.delete(t),0===n.size&&(e.delete(i),r.target.releasePointerCapture(i)))}let ht=e=>!!(null!=e&&e.render),hn=E.createContext(null);function hi(){let e=E.useContext(hn);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function hr(e=e=>e,t){return hi()(e,t)}function ha(e,t=0){let n=hi(),i=n.getState().internal.subscribe,r=cG(e);return cH(()=>i(r,t,n),[t,i,n]),null}let hs=new WeakMap;function ho(e,t){return function(n,...i){var r;let a;return"function"==typeof n&&(null==n||null==(r=n.prototype)?void 0:r.constructor)===n?(a=hs.get(n))||(a=new n,hs.set(n,a)):a=n,e&&e(a),Promise.all(i.map(e=>new Promise((n,i)=>a.load(e,e=>{var t;let i;c9(null==e?void 0:e.scene)&&Object.assign(e,(t=e.scene,i={nodes:{},materials:{},meshes:{}},t&&t.traverse(e=>{e.name&&(i.nodes[e.name]=e),e.material&&!i.materials[e.material.name]&&(i.materials[e.material.name]=e.material),e.isMesh&&!i.meshes[e.name]&&(i.meshes[e.name]=e)}),i)),n(e)},t,t=>i(Error(`Could not load ${e}: ${null==t?void 0:t.message}`))))))}}function hl(e,t,n,i){let r=Array.isArray(t)?t:[t],a=cA(ho(n,i),[e,...r],!1,{equal:cZ.equ});return Array.isArray(t)?a:a[0]}hl.preload=function(e,t,n){let i,r=Array.isArray(t)?t:[t];cA(ho(n),[e,...r],!0,i)},hl.clear=function(e,t){var n=[e,...Array.isArray(t)?t:[t]];if(void 0===n||0===n.length)cw.splice(0,cw.length);else{let e=cw.find(e=>cE(n,e.keys,e.equal));e&&e.remove()}};var hu={exports:{}},hc={exports:{}};hc.exports;let hh=(T||(T=1,M||(M=1,hc.exports=function(e){function t(e,t,n,i){return new iJ(e,t,n,i)}function n(){}function i(e){var t="https://react.dev/errors/"+e;if(1sT||(e.current=sM[sT],sM[sT]=null,sT--)}function h(e,t){sM[++sT]=e.current,e.current=t}function d(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function p(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=0x7ffffff&i;return 0!==o?0!=(i=o&~a)?r=d(i):0!=(s&=o)?r=d(s):n||0!=(n=o&~e)&&(r=d(n)):0!=(o=i&~a)?r=d(o):0!==s?r=d(s):n||0!=(n=i&~e)&&(r=d(n)),0===r?0:0!==t&&t!==r&&(t&a)==0&&((a=r&-r)>=(n=t&-t)||32===a&&(4194048&n)!=0)?t:r}function f(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)==0}function m(){var e=sI;return(0x3c00000&(sI<<=1))==0&&(sI=4194304),e}function g(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function v(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-sE(t);e.entangledLanes|=t,e.entanglements[i]=0x40000000|e.entanglements[i]|261930&n}function y(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-sE(n),r=1<)":-1r||l[i]!==u[r]){var c=` -`+l[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=r)break}}}finally{sY=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?T(n):""}function C(e){try{var t="",n=null;do t+=function(e,t){switch(e.tag){case 26:case 27:case 5:return T(e.type);case 16:return T("Lazy");case 13:return e.child!==t&&null!==t?T("Suspense Fallback"):T("Suspense");case 19:return T("SuspenseList");case 0:case 15:return A(e.type,!1);case 11:return A(e.type.render,!1);case 1:return A(e.type,!0);case 31:return T("Activity");default:return""}}(e,n),n=e,e=e.return;while(e)return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}function R(e,t){if("object"==typeof e&&null!==e){var n=sZ.get(e);return void 0!==n?n:(t={value:e,source:t,stack:C(t)},sZ.set(e,t),t)}return{value:e,source:t,stack:C(t)}}function P(e,t){sJ[sK++]=sQ,sJ[sK++]=s$,s$=e,sQ=t}function I(e,t,n){s0[s1++]=s3,s0[s1++]=s4,s0[s1++]=s2,s2=e;var i=s3;e=s4;var r=32-sE(i)-1;i&=~(1<>=s,r-=s,s3=1<<32-sE(t)+r|n<d?(p=h,h=null):p=h.sibling;var v=m(t,h,s[d],o);if(null===v){null===h&&(h=p);break}e&&h&&null===v.alternate&&n(t,h),i=l(v,i,d),null===c?u=v:c.sibling=v,c=v,h=p}if(d===s.length)return r(t,h),ot&&P(t,d),u;if(null===h){for(;dp?(v=d,d=null):v=d.sibling;var y=m(t,d,_.value,u);if(null===y){null===d&&(d=v);break}e&&d&&null===y.alternate&&n(t,d),s=l(y,s,p),null===h?c=y:h.sibling=y,h=y,d=v}if(_.done)return r(t,d),ot&&P(t,p),c;if(null===d){for(;!_.done;p++,_=o.next())null!==(_=f(t,_.value,u))&&(s=l(_,s,p),null===h?c=_:h.sibling=_,h=_);return ot&&P(t,p),c}for(d=a(d);!_.done;p++,_=o.next())null!==(_=g(d,t,p,_.value,u))&&(e&&null!==_.alternate&&d.delete(null===_.key?p:_.key),s=l(_,s,p),null===h?c=_:h.sibling=_,h=_);return e&&d.forEach(function(e){return n(t,e)}),ot&&P(t,p),c}(c,h,d=v.call(d),p)}if("function"==typeof d.then)return t(c,h,eM(d),p);if(d.$$typeof===rd)return t(c,h,ee(c,d),p);ew(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==h&&6===h.tag?(r(c,h.sibling),(p=s(h,d)).return=c):(r(c,h),(p=i2(d,c.mode,p)).return=c),u(c=p)):r(c,h)}(c,h,d,p);return oR=null,v}catch(e){if(e===oT||e===oE)throw e;var _=t(29,e,null,c.mode);return _.lanes=p,_.return=c,_}finally{}}}function eA(){for(var e=oU,t=oD=oU=0;ta?a:8);var s=rM.T,o={};rM.T=o,t$(e,!1,t,n);try{var l=r(),u=rM.S;if(null!==u&&u(o,l),null!==l&&"object"==typeof l&&"function"==typeof l.then){var c,h,d=(c=[],h={status:"pending",value:null,reason:null,then:function(e){c.push(e)}},l.then(function(){h.status="fulfilled",h.value=i;for(var e=0;e";case lu:return":has("+(id(e)||"")+")";case lc:return'[role="'+e.value+'"]';case ld:return'"'+e.value+'"';case lh:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function ip(e,t){var n=[];e=[e,0];for(var i=0;ilO&&(t.flags|=128,a=!0,nO(r,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=eK(s))){if(t.flags|=128,a=!0,t.updateQueue=e=e.updateQueue,nD(t,e),nO(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ot)return nF(t),null}else 2*sO()-r.renderingStartTime>lO&&0x20000000!==n&&(t.flags|=128,a=!0,nO(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=sO(),e.sibling=null,n=oH.current,h(oH,a?1&n|2:1&n),ot&&P(t,r.treeForkCount),e):(nF(t),null);case 22:case 23:return eJ(t),ej(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(0x20000000&n)!=0&&(128&t.flags)==0&&(nF(t),6&t.subtreeFlags&&(t.flags|=8192)):nF(t),null!==(n=t.updateQueue)&&nD(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&c(oM),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),q(oh),nF(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}(t.alternate,t,lT);if(null!==n){lv=n;return}if(null!==(t=t.sibling)){lv=t;return}lv=t=e}while(null!==t)0===lw&&(lw=5)}function iD(e,t){do{var n=function(e,t){switch(N(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return q(oh),O(),(65536&(e=t.flags))!=0&&(128&e)==0?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return z(t),null;case 31:if(null!==t.memoizedState){if(eJ(t),null===t.alternate)throw Error(i(340));G()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(eJ(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));G()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return c(oH),null;case 4:return O(),null;case 10:return q(t.type),null;case 22:case 23:return eJ(t),ej(),null!==e&&c(oM),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return q(oh),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,lv=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){lv=e;return}lv=e=n}while(null!==e)lw=6,lv=null}function iO(e,t,n,r,a,s,o,l,u){e.cancelPendingCommit=null;do iV();while(0!==lB)if((6&lm)!=0)throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(function(e,t,n,i,r,a){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0n?32:n;n=rM.T;var a=rq();try{rX(r),rM.T=null,r=lW,lW=null;var s=lk,o=lH;if(lB=0,lV=lk=null,lH=0,(6&lm)!=0)throw Error(i(331));var l=lm;if(lm|=4,il(s.current),it(s,s.current,o,r),lm=l,es(0,!1),sW&&"function"==typeof sW.onPostCommitFiberRoot)try{sW.onPostCommitFiberRoot(sG,s)}catch{}return!0}finally{rX(a),rM.T=n,ik(e,t)}}function iG(e,t,n){t=R(n,t),t=t9(e.stateNode,t,2),null!==(e=eO(e,t,2))&&(v(e,2),ea(e))}function iW(e,t,n){if(3===e.tag)iG(e,e,n);else for(;null!==t;){if(3===t.tag){iG(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===lz||!lz.has(i))){e=R(n,e),null!==(i=eO(t,n=t7(2),2))&&(ne(n,i,t,e),v(i,2),ea(i));break}}t=t.return}}function ij(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new lf;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(lM=!0,r.add(n),e=iX.bind(null,e,t,n),t.then(e,e))}function iX(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,lg===e&&(l_&n)===n&&(4===lw||3===lw&&(0x3c00000&l_)===l_&&300>sO()-lU?(2&lm)==0&&iT(e,0):lC|=n,lP===l_&&(lP=0)),ea(e)}function iq(e,t){0===t&&(t=m()),null!==(e=eP(e,t))&&(v(e,t),ea(e))}function iY(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iq(e,n)}function iZ(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iq(e,n)}function iJ(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function iK(e){return!(!(e=e.prototype)||!e.isReactComponent)}function i$(e,n){var i=e.alternate;return null===i?((i=t(e.tag,n,e.key,e.mode)).elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=0x3e00000&e.flags,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function iQ(e,t){e.flags&=0x3e00002;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,e.dependencies=null===(t=n.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function i0(e,n,r,a,s,o){var l=0;if(a=e,"function"==typeof e)iK(e)&&(l=1);else if("string"==typeof e)l=si&&sv?sr(e,r,s5.current)?26:sb(e)?27:5:si?sr(e,r,s5.current)?26:5:sv&&sb(e)?27:5;else o:switch(e){case r_:return(e=t(31,r,n,s)).elementType=r_,e.lanes=o,e;case rl:return i1(r.children,s,o,n);case ru:l=8,s|=24;break;case rc:return(e=t(12,r,n,2|s)).elementType=rc,e.lanes=o,e;case rf:return(e=t(13,r,n,s)).elementType=rf,e.lanes=o,e;case rm:return(e=t(19,r,n,s)).elementType=rm,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case rd:l=10;break o;case rh:l=9;break o;case rp:l=11;break o;case rg:l=14;break o;case rv:l=16,a=null;break o}l=29,r=Error(i(130,null===e?"null":typeof e,"")),a=null}return(n=t(l,r,n,s)).elementType=e,n.type=a,n.lanes=o,n}function i1(e,n,i,r){return(e=t(7,e,r,n)).lanes=i,e}function i2(e,n,i){return(e=t(6,e,null,n)).lanes=i,e}function i3(e){var n=t(18,null,null,0);return n.stateNode=e,n}function i4(e,n,i){return(n=t(4,null!==e.children?e.children:[],e.key,n)).lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function i5(e,t,n,i,r,a,s,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=rB,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=g(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=g(0),this.hiddenUpdates=g(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function i6(e,n,i,r,a,s,o,l,u,c,h,d){return e=new i5(e,n,i,o,u,c,h,d,l),n=1,!0===s&&(n|=24),s=t(3,null,null,n),e.current=s,s.stateNode=e,n=en(),n.refCount++,e.pooledCache=n,n.refCount++,s.memoizedState={element:r,isDehydrated:i,cache:n},eN(s),e}function i8(e){var t=e._reactInternals;if(void 0===t)throw"function"==typeof e.render?Error(i(188)):Error(i(268,e=Object.keys(e).join(",")));return null===(e=null!==(e=s(t))?function e(t){var n=t.tag;if(5===n||26===n||27===n||6===n)return t;for(t=t.child;null!==t;){if(null!==(n=e(t)))return n;t=t.sibling}return null}(e):null)?null:rA(e.stateNode)}function i9(e,t,n,i,r,a){r=sw,null===i.context?i.context=r:i.pendingContext=r,(i=eD(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(i.callback=a),null!==(n=eO(e,i,t))&&(i_(n,e,t),eF(n,e,t))}function i7(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n>>=0)?32:31-(sA(e)/sC|0)|0},sA=Math.log,sC=Math.LN2,sR=256,sP=262144,sI=4194304,sL=ri.unstable_scheduleCallback,sN=ri.unstable_cancelCallback,sU=ri.unstable_shouldYield,sD=ri.unstable_requestPaint,sO=ri.unstable_now,sF=ri.unstable_ImmediatePriority,sz=ri.unstable_UserBlockingPriority,sB=ri.unstable_NormalPriority,sk=ri.unstable_IdlePriority,sV=ri.log,sH=ri.unstable_setDisableYieldValue,sG=null,sW=null,sj="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},sX="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof w.default&&"function"==typeof w.default.emit)return void w.default.emit("uncaughtException",e);console.error(e)},sq=Object.prototype.hasOwnProperty,sY=!1,sZ=new WeakMap,sJ=[],sK=0,s$=null,sQ=0,s0=[],s1=0,s2=null,s3=1,s4="",s5=u(null),s6=u(null),s8=u(null),s9=u(null),s7=null,oe=null,ot=!1,on=null,oi=!1,or=Error(i(519)),oa=u(null),os=null,oo=null,ol="u">typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ou=ri.unstable_scheduleCallback,oc=ri.unstable_NormalPriority,oh={$$typeof:rd,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},od=null,op=null,of=!1,om=!1,og=!1,ov=0,o_=null,oy=0,ox=0,ob=null,oS=rM.S;rM.S=function(e,t){lD=sO(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===o_){var n=o_=[];oy=0,ox=ed(),ob={status:"pending",value:void 0,then:function(e){n.push(e)}}}oy++,t.then(ep,ep)}(0,t),null!==oS&&oS(e,t)};var oM=u(null),oT=Error(i(460)),ow=Error(i(474)),oE=Error(i(542)),oA={then:function(){}},oC=null,oR=null,oP=0,oI=eE(!0),oL=eE(!1),oN=[],oU=0,oD=0,oO=!1,oF=!1,oz=u(null),oB=u(0),ok=u(null),oV=null,oH=u(0),oG=0,oW=null,oj=null,oX=null,oq=!1,oY=!1,oZ=!1,oJ=0,oK=0,o$=null,oQ=0,o0={readContext:Q,use:tt,useCallback:e$,useContext:e$,useEffect:e$,useImperativeHandle:e$,useLayoutEffect:e$,useInsertionEffect:e$,useMemo:e$,useReducer:e$,useRef:e$,useState:e$,useDebugValue:e$,useDeferredValue:e$,useTransition:e$,useSyncExternalStore:e$,useId:e$,useHostTransitionStatus:e$,useFormState:e$,useActionState:e$,useOptimistic:e$,useMemoCache:e$,useCacheRefresh:e$};o0.useEffectEvent=e$;var o1={readContext:Q,use:tt,useCallback:function(e,t){return e8().memoizedState=[e,void 0===t?null:t],e},useContext:Q,useEffect:tI,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,tR(4194308,4,tO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tR(4194308,4,e,t)},useInsertionEffect:function(e,t){tR(4,2,e,t)},useMemo:function(e,t){var n=e8();t=void 0===t?null:t;var i=e();return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=e8();if(void 0!==n)var r=n(t);else r=t;return i.memoizedState=i.baseState=r,i.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},e=e.dispatch=tZ.bind(null,oW,e),[i.memoizedState,e]},useRef:function(e){return e8().memoizedState={current:e}},useState:function(e){var t=(e=tp(e)).queue,n=tJ.bind(null,oW,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tz,useDeferredValue:function(e,t){return tV(e8(),e,t)},useTransition:function(){var e=tp(!1);return e=tG.bind(null,oW,e.queue,!0,!1),e8().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oW,a=e8();if(ot){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===lg)throw Error(i(349));(127&l_)!=0||tl(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,tI(tc.bind(null,r,s,e),[e]),r.flags|=2048,tA(9,{destroy:void 0},tu.bind(null,r,s,n,t),null),n},useId:function(){var e=e8(),t=lg.identifierPrefix;if(ot){var n=s4,i=s3;t="_"+t+"R_"+(n=(i&~(1<<32-sE(i)-1)).toString(32)+n),0<(n=oJ++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=oQ++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tj,useFormState:tS,useActionState:tS,useOptimistic:function(e){var t=e8();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=t$.bind(null,oW,!0,n),n.dispatch=t,[e,t]},useMemoCache:tn,useCacheRefresh:function(){return e8().memoizedState=tY.bind(null,oW)},useEffectEvent:function(e){var t=e8(),n={impl:e};return t.memoizedState=n,function(){if((2&lm)!=0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},o2={readContext:Q,use:tt,useCallback:tB,useContext:Q,useEffect:tL,useImperativeHandle:tF,useInsertionEffect:tU,useLayoutEffect:tD,useMemo:tk,useReducer:tr,useRef:tC,useState:function(){return tr(ti)},useDebugValue:tz,useDeferredValue:function(e,t){return tH(e9(),oj.memoizedState,e,t)},useTransition:function(){var e=tr(ti)[0],t=e9().memoizedState;return["boolean"==typeof e?e:te(e),t]},useSyncExternalStore:to,useId:tX,useHostTransitionStatus:tj,useFormState:tM,useActionState:tM,useOptimistic:function(e,t){return tf(e9(),oj,e,t)},useMemoCache:tn,useCacheRefresh:tq};o2.useEffectEvent=tN;var o3={readContext:Q,use:tt,useCallback:tB,useContext:Q,useEffect:tL,useImperativeHandle:tF,useInsertionEffect:tU,useLayoutEffect:tD,useMemo:tk,useReducer:ts,useRef:tC,useState:function(){return ts(ti)},useDebugValue:tz,useDeferredValue:function(e,t){var n=e9();return null===oj?tV(n,e,t):tH(n,oj.memoizedState,e,t)},useTransition:function(){var e=ts(ti)[0],t=e9().memoizedState;return["boolean"==typeof e?e:te(e),t]},useSyncExternalStore:to,useId:tX,useHostTransitionStatus:tj,useFormState:tE,useActionState:tE,useOptimistic:function(e,t){var n=e9();return null!==oj?tf(n,oj,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:tn,useCacheRefresh:tq};o3.useEffectEvent=tN;var o4={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ig(),r=eD(i);r.payload=t,null!=n&&(r.callback=n),null!==(t=eO(e,r,i))&&(i_(t,e,i),eF(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ig(),r=eD(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=eO(e,r,i))&&(i_(t,e,i),eF(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ig(),i=eD(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=eO(e,i,n))&&(i_(t,e,n),eF(t,e,n))}},o5=Error(i(461)),o6=!1,o8={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},o9=!1,o7=!1,le=!1,lt="function"==typeof WeakSet?WeakSet:Set,ln=null,li=null,lr=!1,la=null,ls=8192,lo={getCacheForType:function(e){var t=Q(oh),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Q(oh).controller.signal}},ll=0,lu=1,lc=2,lh=3,ld=4;if("function"==typeof Symbol&&Symbol.for){var lp=Symbol.for;ll=lp("selector.component"),lu=lp("selector.has_pseudo_class"),lc=lp("selector.role"),lh=lp("selector.test_id"),ld=lp("selector.text")}var lf="function"==typeof WeakMap?WeakMap:Map,lm=0,lg=null,lv=null,l_=0,ly=0,lx=null,lb=!1,lS=!1,lM=!1,lT=0,lw=0,lE=0,lA=0,lC=0,lR=0,lP=0,lI=null,lL=null,lN=!1,lU=0,lD=0,lO=1/0,lF=null,lz=null,lB=0,lk=null,lV=null,lH=0,lG=0,lW=null,lj=null,lX=0,lq=null;return rt.attemptContinuousHydration=function(e){if(13===e.tag||31===e.tag){var t=eP(e,0x4000000);null!==t&&i_(t,e,0x4000000),re(e,0x4000000)}},rt.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag||31===e.tag){var t=ig(),n=eP(e,t=b(t));null!==n&&i_(n,e,t),re(e,t)}},rt.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if((e=e.stateNode).current.memoizedState.isDehydrated){var t=d(e.pendingLanes);if(0!==t){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-sE(t);e.entanglements[1]|=n,t&=~n}ea(e),(6&lm)==0&&(lO=sO()+500,es(0,!1))}}break;case 31:case 13:null!==(t=eP(e,2))&&i_(t,e,2),iS(),re(e,2)}},rt.batchedUpdates=function(e,t){return e(t)},rt.createComponentSelector=function(e){return{$$typeof:ll,value:e}},rt.createContainer=function(e,t,n,i,r,a,s,o,l,u){return i6(e,t,!1,null,n,i,a,null,s,o,l,u)},rt.createHasPseudoClassSelector=function(e){return{$$typeof:lu,value:e}},rt.createHydrationContainer=function(e,t,n,i,r,a,s,o,l,u,c,h,d,p){var f;return(e=i6(n,i,!0,e,r,a,o,p,l,u,c,h)).context=sw,n=e.current,(r=eD(i=b(i=ig()))).callback=null!=(f=t)?f:null,eO(n,r,i),t=i,e.current.lanes=t,v(e,t),ea(e),e},rt.createPortal=function(e,t,n){var i=3=c&&s>=d&&a<=h&&o<=p){e.splice(t,1);break}if(r!==c||n.width!==u.width||po){if(!(s!==d||n.height!==u.height||ha)){c>r&&(u.width+=c-r,u.x=r),hs&&(u.height+=d-s,u.y=s),pn&&(n=l)),l ")+` - -No matching component was found for: - `+e.join(" > ")}return null},rt.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return rA(e.child.stateNode);default:return e.child.stateNode}},rt.injectIntoDevTools=function(){var e={bundleType:0,version:rT,rendererPackageName:rw,currentDispatcherRef:rM,reconcilerVersion:"19.2.0"};if(null!==rE&&(e.rendererConfig=rE),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{sG=t.inject(e),sW=t}catch{}e=!!t.checkDCE}}return e},rt.isAlreadyRendering=function(){return(6&lm)!=0},rt.observeVisibleRects=function(e,t,n,r){if(!r7)throw Error(i(363));var a=as(e=im(e,t),n,r).disconnect;return{disconnect:function(){a()}}},rt.shouldError=function(){return null},rt.shouldSuspend=function(){return!1},rt.startHostTransition=function(e,t,r,a){if(5!==e.tag)throw Error(i(476));var s=tW(e).queue;tG(e,s,t,r4,null===r?n:function(){var t=tW(e);return null===t.next&&(t=e.alternate.memoizedState),tK(e,t.next.queue,{},ig()),r(a)})},rt.updateContainer=function(e,t,n,i){var r=t.current,a=ig();return i9(r,a,e,t,n,i),a},rt.updateContainerSync=function(e,t,n,i){return i9(t.current,2,e,t,n,i),2},rt},hc.exports.default=hc.exports,Object.defineProperty(hc.exports,"__esModule",{value:!0})),hu.exports=hc.exports),(b=hu.exports)&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default"))?b.default:b,hd={},hp=/^three(?=[A-Z])/,hf=e=>`${e[0].toUpperCase()}${e.slice(1)}`,hm=0;function hg(e){if("function"==typeof e){let t=`${hm++}`;return hd[t]=e,t}Object.assign(hd,e)}function hv(e,t){let n=hf(e),i=hd[n];if("primitive"!==e&&!i)throw Error(`R3F: ${n} 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"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function h_(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?c0(e.parent,e):c9(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,c8(e)}}function hy(e,t,n){let i=t.root.getState();if(e.parent||e.object===i.scene){if(!t.object){var r,a;let e=hd[hf(t.type)];t.object=null!=(r=t.props.object)?r:new e(...null!=(a=t.props.args)?a:[]),t.object.__r3f=t}if(c6(t.object,t.props),t.props.attach)c0(e,t);else if(c9(t.object)&&c9(e.object)){let i=e.object.children.indexOf(null==n?void 0:n.object);if(n&&-1!==i){let n=e.object.children.indexOf(t.object);-1!==n?(e.object.children.splice(n,1),e.object.children.splice(n{try{e.dispose()}catch{}};"u">typeof IS_REACT_ACT_ENVIRONMENT?t():(0,cC.unstable_scheduleCallback)(cC.unstable_IdlePriority,t)}}function hM(e,t,n){if(!t)return;t.parent=null;let i=e.children.indexOf(t);-1!==i&&e.children.splice(i,1),t.props.attach?c1(e,t):c9(t.object)&&c9(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,i)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(i)}),n.capturedMap.forEach((e,i)=>{he(n.capturedMap,t,e,i)})}(cB(t),t.object));let r=null!==t.props.dispose&&!1!==n;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];hM(t,n,r)}t.children.length=0,delete t.object.__r3f,r&&"primitive"!==t.type&&"Scene"!==t.object.type&&hS(t.object),void 0===n&&c8(t)}let hT=[],hw=()=>{},hE={},hA=0,hC=(S={isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,n){var i;return hv(e=hf(e)in hd?e:e.replace(hp,""),t),"primitive"===e&&null!=(i=t.object)&&i.__r3f&&delete t.object.__r3f,cK(t.object,n,e,t)},removeChild:hM,appendChild:hx,appendInitialChild:hx,insertBefore:hb,appendChildToContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&hx(n,t)},removeChildFromContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&hM(n,t)},insertInContainerBefore(e,t,n){let i=e.getState().scene.__r3f;t&&n&&i&&hb(i,t,n)},getRootHostContext:()=>hE,getChildHostContext:()=>hE,commitUpdate(e,t,n,i,r){var a,s,o;hv(t,i);let l=!1;if("primitive"===e.type&&n.object!==i.object||(null==(a=i.args)?void 0:a.length)!==(null==(s=n.args)?void 0:s.length)?l=!0:null!=(o=i.args)&&o.some((e,t)=>{var i;return e!==(null==(i=n.args)?void 0:i[t])})&&(l=!0),l)hT.push([e,{...i},r]);else{let t=function(e,t){let n={};for(let i in t)if(!c2.includes(i)&&!cZ.equ(t[i],e.props[i]))for(let e in n[i]=t[i],t)e.startsWith(`${i}-`)&&(n[e]=t[e]);for(let i in e.props){if(c2.includes(i)||t.hasOwnProperty(i))continue;let{root:r,key:a}=c$(e.object,i);if(r.constructor&&0===r.constructor.length){let e=function(e){let t=c3.get(e.constructor);try{t||(t=new e.constructor,c3.set(e.constructor,t))}catch(e){}return t}(r);cZ.und(e)||(n[a]=e[a])}else n[a]=0}return n}(e,i);Object.keys(t).length&&(Object.assign(e.props,t),c6(e.object,t))}(null===r.sibling||(4&r.flags)==0)&&function(){for(let[e]of hT){let t=e.parent;if(t)for(let n of(e.props.attach?c1(t,e):c9(e.object)&&c9(t.object)&&t.object.remove(e.object),e.children))n.props.attach?c1(e,n):c9(n.object)&&c9(e.object)&&e.object.remove(n.object);e.isHidden&&h_(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&hS(e.object)}for(let[i,r,a]of hT){i.props=r;let s=i.parent;if(s){let r=hd[hf(i.type)];i.object=null!=(e=i.props.object)?e:new r(...null!=(t=i.props.args)?t:[]),i.object.__r3f=i;var e,t,n=i.object;for(let e of[a,a.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let t=e.ref(n);"function"==typeof t&&(e.refCleanup=t)}else e.ref&&(e.ref.current=n);for(let e of(c6(i.object,i.props),i.props.attach?c0(s,i):c9(i.object)&&c9(s.object)&&s.object.add(i.object),i.children))e.props.attach?c0(i,e):c9(e.object)&&c9(i.object)&&i.object.add(e.object);c8(i)}}hT.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>cK(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?c1(e.parent,e):c9(e.object)&&(e.object.visible=!1),e.isHidden=!0,c8(e)}},unhideInstance:h_,createTextInstance:hw,hideTextInstance:hw,unhideTextInstance:hw,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:E.createContext(null),setCurrentUpdatePriority(e){hA=e},getCurrentUpdatePriority:()=>hA,resolveUpdatePriority(){var e;if(0!==hA)return hA;switch("u">typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return 2;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return 8;default:return 32}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:"9.5.0",applyViewTransitionName(e,t,n){},restoreViewTransitionName(e,t){},cancelViewTransitionName(e,t,n){},cancelRootViewTransitionName(e){},restoreRootViewTransitionName(e){},InstanceMeasurement:null,measureInstance:e=>null,wasInstanceInViewport:e=>!0,hasInstanceChanged:(e,t)=>!1,hasInstanceAffectedParent:(e,t)=>!1,suspendOnActiveViewTransition(e,t){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(e){},createViewTransitionInstance:e=>null,getCurrentGestureOffset(e){throw Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance:(e,t)=>e,cloneMutableTextInstance:e=>e,cloneRootViewTransitionContainer(e){throw Error("Not implemented.")},removeRootViewTransitionClone(e,t){throw Error("Not implemented.")},createFragmentInstance:e=>null,updateFragmentInstanceFiber(e,t){},commitNewChildToFragmentInstance(e,t){},deleteChildFromFragmentInstance(e,t){},measureClonedInstance:e=>null,maySuspendCommitOnUpdate:(e,t,n)=>!1,maySuspendCommitInSyncRender:(e,t)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(e,t)=>null},(_=hh(S)).injectIntoDevTools(),_),hR=new Map,hP={objects:"shallow",strict:!1};function hI(e){var t,n;let i,r,a,s,o,l,u,c=hR.get(e),h=null==c?void 0:c.fiber,d=null==c?void 0:c.store;c&&console.warn("R3F.createRoot should only be called once!");let p="function"==typeof reportError?reportError:console.error,f=d||(t=hX,n=hq,o=(s=(a=(0,cT.createWithEqualityFn)((e,i)=>{let r,a=new ef,s=new ef,o=new ef;function l(e=i().camera,t=s,n=i().size){let{width:r,height:u,top:c,left:h}=n,d=r/u;t.isVector3?o.copy(t):o.set(...t);let p=e.getWorldPosition(a).distanceTo(o);if(e&&e.isOrthographicCamera)return{width:r/e.zoom,height:u/e.zoom,top:c,left:h,factor:1,distance:p,aspect:d};{let t=2*Math.tan(e.fov*Math.PI/180/2)*p,n=r/u*t;return{width:n,height:t,top:c,left:h,factor:r/n,distance:p,aspect:d}}}let u=t=>e(e=>({performance:{...e.performance,current:t}})),c=new ed;return{set:e,get:i,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(e=1)=>t(i(),e),advance:(e,t)=>n(e,t,i()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new sW,pointer:c,mouse:c,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=i();r&&clearTimeout(r),e.performance.current!==e.performance.min&&u(e.performance.min),r=setTimeout(()=>u(i().performance.max),e.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:l},setEvents:t=>e(e=>({...e,events:{...e.events,...t}})),setSize:(t,n,r=0,a=0)=>{let o=i().camera,u={width:t,height:n,top:r,left:a};e(e=>({size:u,viewport:{...e.viewport,...l(o,s,u)}}))},setDpr:t=>e(e=>{let n=cq(t);return{viewport:{...e.viewport,dpr:n,initialDpr:e.viewport.initialDpr||n}}}),setFrameloop:(t="always")=>{let n=i().clock;n.stop(),n.elapsedTime=0,"never"!==t&&(n.start(),n.elapsedTime=0),e(()=>({frameloop:t}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:E.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{let r=i().internal;return r.priority=r.priority+ +(t>0),r.subscribers.push({ref:e,priority:t,store:n}),r.subscribers=r.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=i().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(t>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}})).getState()).size,l=s.viewport.dpr,u=s.camera,a.subscribe(()=>{let{camera:e,size:t,viewport:n,gl:i,set:r}=a.getState();if(t.width!==o.width||t.height!==o.height||n.dpr!==l){o=t,l=n.dpr;!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(t.width/2),e.right=t.width/2,e.top=t.height/2,e.bottom=-(t.height/2)):e.aspect=t.width/t.height,e.updateProjectionMatrix());n.dpr>0&&i.setPixelRatio(n.dpr);let r="u">typeof HTMLCanvasElement&&i.domElement instanceof HTMLCanvasElement;i.setSize(t.width,t.height,r)}e!==u&&(u=e,r(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),a.subscribe(e=>t(e)),a),m=h||hC.createContainer(f,1,null,!1,null,"",p,p,p,null);c||hR.set(e,{fiber:m,store:f});let g=!1,v=null;return{async configure(t={}){var n,a;let s;v=new Promise(e=>s=e);let{gl:o,size:l,scene:u,events:c,onCreated:h,shadows:d=!1,linear:p=!1,flat:m=!1,legacy:_=!1,orthographic:y=!1,frameloop:x="always",dpr:b=[1,2],performance:S,raycaster:M,camera:T,onPointerMissed:w}=t,E=f.getState(),A=E.gl;if(!E.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},n="function"==typeof o?await o(t):o;A=ht(n)?n:new cM({...t,...o}),E.set({gl:A})}let C=E.raycaster;C||E.set({raycaster:C=new op});let{params:R,...P}=M||{};if(cZ.equ(P,C,hP)||c6(C,{...P}),cZ.equ(R,C.params,hP)||c6(C,{params:{...C.params,...R}}),!E.camera||E.camera===r&&!cZ.equ(r,T,hP)){r=T;let e=null==T?void 0:T.isCamera,t=e?T:y?new sx(0,0,0,0,.1,1e3):new nO(75,0,.1,1e3);!e&&(t.position.z=5,T&&(c6(t,T),!t.manual&&("aspect"in T||"left"in T||"right"in T||"bottom"in T||"top"in T)&&(t.manual=!0,t.updateProjectionMatrix())),E.camera||null!=T&&T.rotation||t.lookAt(0,0,0)),E.set({camera:t}),C.camera=t}if(!E.scene){let e;null!=u&&u.isScene?cK(e=u,f,"",{}):(cK(e=new nj,f,"",{}),u&&c6(e,u)),E.set({scene:e})}c&&!E.events.handlers&&E.set({events:c(f)});let N=function(e,t){if(!t&&"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:n,top:i,left:r}=e.parentElement.getBoundingClientRect();return{width:t,height:n,top:i,left:r}}return!t&&"u">typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,l);if(cZ.equ(N,E.size,hP)||E.setSize(N.width,N.height,N.top,N.left),b&&E.viewport.dpr!==cq(b)&&E.setDpr(b),E.frameloop!==x&&E.setFrameloop(x),E.onPointerMissed||E.set({onPointerMissed:w}),S&&!cZ.equ(S,E.performance,hP)&&E.set(e=>({performance:{...e.performance,...S}})),!E.xr){let e=(e,t)=>{let n=f.getState();"never"!==n.frameloop&&hq(e,!0,n,t)},t=()=>{let t=f.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||hX(t)},i={connect(){let e=f.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=f.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(n=A.xr)?void 0:n.addEventListener)&&i.connect(),E.set({xr:i})}if(A.shadowMap){let e=A.shadowMap.enabled,t=A.shadowMap.type;A.shadowMap.enabled=!!d,cZ.boo(d)?A.shadowMap.type=2:cZ.str(d)?A.shadowMap.type=null!=(a=({basic:0,percentage:1,soft:2,variance:3})[d])?a:2:cZ.obj(d)&&Object.assign(A.shadowMap,d),(e!==A.shadowMap.enabled||t!==A.shadowMap.type)&&(A.shadowMap.needsUpdate=!0)}return eb.enabled=!_,g||(A.outputColorSpace=p?L:I,A.toneMapping=4*!m),E.legacy!==_&&E.set(()=>({legacy:_})),E.linear!==p&&E.set(()=>({linear:p})),E.flat!==m&&E.set(()=>({flat:m})),!o||cZ.fun(o)||ht(o)||cZ.equ(o,A,hP)||c6(A,o),i=h,g=!0,s(),this},render(t){return g||v||this.configure(),v.then(()=>{hC.updateContainer((0,cR.jsx)(hL,{store:f,children:t,onCreated:i,rootElement:e}),m,null,()=>void 0)}),f},unmount(){hN(e)}}}function hL({store:e,children:t,onCreated:n,rootElement:i}){return cH(()=>{let t=e.getState();t.set(e=>({internal:{...e.internal,active:!0}})),n&&n(t),e.getState().events.connected||null==t.events.connect||t.events.connect(i)},[]),(0,cR.jsx)(hn.Provider,{value:e,children:t})}function hN(e,t){let n=hR.get(e),i=null==n?void 0:n.fiber;if(i){let r=null==n?void 0:n.store.getState();r&&(r.internal.active=!1),hC.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{null==r.events.disconnect||r.events.disconnect(),null==(n=r.gl)||null==(i=n.renderLists)||null==i.dispose||i.dispose(),null==(a=r.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(s=r.gl)&&s.xr&&r.xr.disconnect();var n,i,a,s,o=r.scene;for(let e in"Scene"!==o.type&&(null==o.dispose||o.dispose()),o){let t=o[e];(null==t?void 0:t.type)!=="Scene"&&(null==t||null==t.dispose||t.dispose())}hR.delete(e),t&&t(e)}catch(e){}},500)})}}function hU(e,t){let n={callback:e};return t.add(n),()=>void t.delete(n)}let hD=new Set,hO=new Set,hF=new Set,hz=e=>hU(e,hD),hB=e=>hU(e,hO);function hk(e,t){if(e.size)for(let{callback:n}of e.values())n(t)}function hV(e,t){switch(e){case"before":return hk(hD,t);case"after":return hk(hO,t);case"tail":return hk(hF,t)}}function hH(e,t,n){let i=t.clock.getDelta();"never"===t.frameloop&&"number"==typeof e&&(i=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),s=t.internal.subscribers;for(let e=0;e0)&&!(null!=(t=c.gl.xr)&&t.isPresenting)&&(l+=hH(e,c))}if(hW=!1,hV("after",e),0===l)return hV("tail",e),hG=!1,cancelAnimationFrame(u)}function hX(e,t=1){var n;if(!e)return hR.forEach(e=>hX(e.store.getState(),t));(null==(n=e.gl.xr)||!n.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(t>1?e.internal.frames=Math.min(60,e.internal.frames+t):hW?e.internal.frames=2:e.internal.frames=1,hG||(hG=!0,requestAnimationFrame(hj)))}function hq(e,t=!0,n,i){if(t&&hV("before",e),n)hH(e,n,i);else for(let t of hR.values())hH(e,t.store.getState());t&&hV("after",e)}let hY={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 hZ(e){let{handlePointer:t}=function(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))}function n(t){let{internal:n}=e.getState();for(let e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let i=e.eventObject.__r3f;if(n.hovered.delete(c7(e)),null!=i&&i.eventCount){let n=i.handlers,r={...e,intersections:t};null==n.onPointerOut||n.onPointerOut(r),null==n.onPointerLeave||n.onPointerLeave(r)}}}function i(e,t){for(let n=0;nn([]);case"onLostPointerCapture":return t=>{let{internal:i}=e.getState();"pointerId"in t&&i.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{i.capturedMap.has(t.pointerId)&&(i.capturedMap.delete(t.pointerId),n([]))})}}return function(a){let{onPointerMissed:s,internal:o}=e.getState();o.lastEvent.current=a;let l="onPointerMove"===r,u="onClick"===r||"onContextMenu"===r||"onDoubleClick"===r,c=function(t,n){let i=e.getState(),r=new Set,a=[],s=n?n(i.internal.interaction):i.internal.interaction;for(let e=0;e{let n=cY(e.object),i=cY(t.object);return n&&i&&i.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{let t=c7(e);return!r.has(t)&&(r.add(t),!0)});for(let e of(i.events.filter&&(o=i.events.filter(o,i)),o)){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&i.internal.capturedMap.has(t.pointerId))for(let e of i.internal.capturedMap.get(t.pointerId).values())r.has(c7(e.intersection))||a.push(e.intersection);return a}(a,l?t:void 0),h=u?function(t){let{internal:n}=e.getState(),i=t.offsetX-n.initialClick[0],r=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(i*i+r*r))}(a):0;"onPointerDown"===r&&(o.initialClick=[a.offsetX,a.offsetY],o.initialHits=c.map(e=>e.eventObject)),u&&!c.length&&h<=2&&(i(a,o.interaction),s&&s(a)),l&&n(c),!function(e,t,i,r){if(e.length){let a={stopped:!1};for(let s of e){let o=cY(s.object);if(o||s.object.traverseAncestors(e=>{let t=cY(e);if(t)return o=t,!1}),o){let{raycaster:l,pointer:u,camera:c,internal:h}=o,d=new ef(u.x,u.y,0).unproject(c),p=e=>{var t,n;return null!=(t=null==(n=h.capturedMap.get(e))?void 0:n.has(s.eventObject))&&t},f=e=>{let n={intersection:s,target:t.target};h.capturedMap.has(e)?h.capturedMap.get(e).set(s.eventObject,n):h.capturedMap.set(e,new Map([[s.eventObject,n]])),t.target.setPointerCapture(e)},m=e=>{let t=h.capturedMap.get(e);t&&he(h.capturedMap,s.eventObject,t,e)},g={};for(let e in t){let n=t[e];"function"!=typeof n&&(g[e]=n)}let v={...s,...g,pointer:u,intersections:e,stopped:a.stopped,delta:i,unprojectedPoint:d,ray:l.ray,camera:c,stopPropagation(){let i="pointerId"in t&&h.capturedMap.get(t.pointerId);(!i||i.has(s.eventObject))&&(v.stopped=a.stopped=!0,h.hovered.size&&Array.from(h.hovered.values()).find(e=>e.eventObject===s.eventObject)&&n([...e.slice(0,e.indexOf(s)),s]))},target:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},currentTarget:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},nativeEvent:t};if(r(v),!0===a.stopped)break}}}}(c,a,h,function(e){let t=e.eventObject,n=t.__r3f;if(!(null!=n&&n.eventCount))return;let s=n.handlers;if(l){if(s.onPointerOver||s.onPointerEnter||s.onPointerOut||s.onPointerLeave){let t=c7(e),n=o.hovered.get(t);n?n.stopped&&e.stopPropagation():(o.hovered.set(t,e),null==s.onPointerOver||s.onPointerOver(e),null==s.onPointerEnter||s.onPointerEnter(e))}null==s.onPointerMove||s.onPointerMove(e)}else{let n=s[r];n?(!u||o.initialHits.includes(t))&&(i(a,o.interaction.filter(e=>!o.initialHits.includes(e))),n(e)):u&&o.initialHits.includes(t)&&i(a,o.interaction.filter(e=>!o.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-(2*(e.offsetY/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(hY).reduce((e,n)=>({...e,[n]:t(n)}),{}),update:()=>{var t;let{events:n,internal:i}=e.getState();null!=(t=i.lastEvent)&&t.current&&n.handlers&&n.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{let{set:n,events:i}=e.getState();if(null==i.disconnect||i.disconnect(),n(e=>({events:{...e.events,connected:t}})),i.handlers)for(let e in i.handlers){let n=i.handlers[e],[r,a]=hY[e];t.addEventListener(r,n,{passive:a})}},disconnect:()=>{let{set:t,events:n}=e.getState();if(n.connected){if(n.handlers)for(let e in n.handlers){let t=n.handlers[e],[i]=hY[e];n.connected.removeEventListener(i,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}e.s(["B",()=>cj,"C",()=>hr,"D",()=>ha,"E",()=>cX,"G",()=>hl,"a",()=>cG,"b",()=>cH,"c",()=>hI,"d",()=>hN,"e",()=>hg,"f",()=>hZ,"i",()=>ck,"j",()=>hz,"k",()=>hB,"u",()=>cW],40859)},71753,e=>{"use strict";var t=e.i(40859);e.s(["useFrame",()=>t.D])},15080,e=>{"use strict";var t=e.i(40859);e.s(["useThree",()=>t.C])},79123,e=>{"use strict";var t=e.i(43476),n=e.i(71645);let i=(0,n.createContext)(null),r=(0,n.createContext)(null),a=(0,n.createContext)(null);function s(){return(0,n.useContext)(i)}function o(){return(0,n.useContext)(r)}function l(){return(0,n.useContext)(a)}function u({children:e,fogEnabledOverride:s,onClearFogEnabledOverride:o}){let[l,u]=(0,n.useState)(!0),[c,h]=(0,n.useState)(!1),[d,p]=(0,n.useState)(1),[f,m]=(0,n.useState)(90),[g,v]=(0,n.useState)(!1),[_,y]=(0,n.useState)(!0),[x,b]=(0,n.useState)(!1),[S,M]=(0,n.useState)("moveLookStick"),[T,w]=(0,n.useState)("MapGenius"),E=(0,n.useCallback)(e=>{u(e),o()},[o]),A=(0,n.useMemo)(()=>({fogEnabled:s??l,setFogEnabled:E,highQualityFog:c,setHighQualityFog:h,fov:f,setFov:m,audioEnabled:g,setAudioEnabled:v,animationEnabled:_,setAnimationEnabled:y,warriorName:T,setWarriorName:w}),[l,s,E,c,f,g,_,T]),C=(0,n.useMemo)(()=>({debugMode:x,setDebugMode:b}),[x,b]),R=(0,n.useMemo)(()=>({speedMultiplier:d,setSpeedMultiplier:p,touchMode:S,setTouchMode:M}),[d,p,S,M]);(0,n.useLayoutEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&b(e.debugMode),null!=e.audioEnabled&&v(e.audioEnabled),null!=e.animationEnabled&&y(e.animationEnabled),null!=e.fogEnabled&&u(e.fogEnabled),null!=e.highQualityFog&&h(e.highQualityFog),null!=e.speedMultiplier&&p(e.speedMultiplier),null!=e.fov&&m(e.fov),null!=e.touchMode&&M(e.touchMode),null!=e.warriorName&&w(e.warriorName)},[]);let P=(0,n.useRef)(null);return(0,n.useEffect)(()=>(P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:l,highQualityFog:c,speedMultiplier:d,fov:f,audioEnabled:g,animationEnabled:_,debugMode:x,touchMode:S,warriorName:T}))}catch(e){}},500),()=>{P.current&&clearTimeout(P.current)}),[l,c,d,f,g,_,x,S,T]),(0,t.jsx)(i.Provider,{value:A,children:(0,t.jsx)(r.Provider,{value:C,children:(0,t.jsx)(a.Provider,{value:R,children:e})})})}e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>s])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/5be53d01eebba2c6.js b/docs/_next/static/chunks/5be53d01eebba2c6.js new file mode 100644 index 00000000..37523b14 --- /dev/null +++ b/docs/_next/static/chunks/5be53d01eebba2c6.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(2232);let r=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:n,modules:i}=function(){let e="info".trim();if(!e)return{globalLevel:"info",modules:new Map};let t=null,n=new Map;for(let i of e.split(",")){let e=i.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&n.set(t,r)}else r.has(e)&&(t=e)}return{globalLevel:t??=n.size>0?"silent":"info",modules:n}}(),s={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},l=(0,t.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=s[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function a(e){let t=i.get(e)??n;return l.child({module:e},{level:t})}e.s(["createLogger",()=>a])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".ogg")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/66f953934e42712b.css b/docs/_next/static/chunks/66f953934e42712b.css new file mode 100644 index 00000000..d115f611 --- /dev/null +++ b/docs/_next/static/chunks/66f953934e42712b.css @@ -0,0 +1 @@ +.TouchJoystick-module__tcddlW__Joystick{z-index:1;width:140px;height:140px;position:absolute;bottom:20px;left:50%;transform:translate(-50%)}.TouchJoystick-module__tcddlW__Left{left:20px;transform:none;}.TouchJoystick-module__tcddlW__Right{left:auto;right:20px;transform:none;} diff --git a/docs/_next/static/chunks/687860f86433eb04.js b/docs/_next/static/chunks/687860f86433eb04.js deleted file mode 100644 index 053b887e..00000000 --- a/docs/_next/static/chunks/687860f86433eb04.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(12979),c=e.i(51434),a=e.i(79123),s=e.i(89887);e.i(13876);var l=e.i(58647);let f=new Map,d=new Map;function p(e,t=1){d.set(e,t)}function m(e){d.delete(e)}let y=0;function h(){return y}function D(){for(let[e]of(y++,d)){try{e.stop()}catch{}try{e.disconnect()}catch{}}d.clear()}function g(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,c=u?.is3D??!0,a=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function v(e,t,r,n,o){let c;try{c=(0,u.audioToUrl)(e.filename)}catch{return}let a=l.engineStore.getState().playback.rate,s=y;R(c,r,r=>{if(s===y)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(a),n&&u.position.copy(n),o.add(u),d.set(u,1),u.play(),u.source.onended=()=>{d.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),d.set(n,1),n.play(),n.source.onended=()=>{d.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function R(e,t,r){f.has(e)?r(f.get(e)):t.load(e,t=>{f.set(e,t),r(t)},void 0,t=>{console.error("Audio load error",e,t)})}l.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of d)try{t.setPlaybackRate(r*e)}catch{}});let M=(0,r.memo)(function({entity:e}){let{debugMode:l}=(0,a.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,p=e.audioMinDistance??1,m=e.audioMaxDistance??1,y=e.audioMinLoopGap??0,h=e.audioMaxLoopGap??0,D=e.audioIs3D??!0?1:0,g=e.audioIsLooping??!0,[v,M,T]=e.position??[0,0,0],{scene:b,camera:x}=(0,n.useThree)(),{audioLoader:A,audioListener:S}=(0,c.useAudio)(),{audioEnabled:w}=(0,a.useSettings)(),P=(0,r.useRef)(null),k=(0,r.useRef)(null),B=(0,r.useRef)(null),L=(0,r.useRef)(!1),V=(0,r.useRef)(!1),j=(0,r.useRef)(new i.Vector3(v,M,T)),F=(0,r.useRef)(0),C=()=>{null!=k.current&&(clearTimeout(k.current),k.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)};(0,r.useEffect)(()=>{let e;if(A&&S){if(F.current++,D){let t=new i.PositionalAudio(S);t.position.copy(j.current),t.setDistanceModel("inverse"),t.setRefDistance(p),t.setMaxDistance(m),t.setRolloffFactor(1),t.setVolume(d),e=t,b.add(e)}else(e=new i.Audio(S)).setVolume(d);return P.current=e,()=>{C();try{e.stop()}catch{}try{e.disconnect()}catch{}D&&b.remove(e),P.current=null,L.current=!1,V.current=!1}}},[A,S,D,p,m,d,b]);let E=(e,t)=>{if(g)if(y>0||h>0){let r=Math.max(0,y),n=Math.max(r,h),o=r===n?r:Math.random()*(n-r)+r;e.loop=!1;let i=()=>{t===F.current&&(!1===e.isPlaying?k.current=setTimeout(()=>{if(t===F.current)try{e.play(),E(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},G=e=>{if(!A)return;let t=F.current;if(L.current)try{e.isPlaying||(e.play(),E(e,t))}catch{}else{let r;try{r=(0,u.audioToUrl)(f)}catch{return}R(r,A,r=>{if(t===F.current&&!e.buffer){e.setBuffer(r),L.current=!0;try{e.play(),E(e,t)}catch{}}})}};return(0,r.useEffect)(()=>{let e=P.current;e&&!D&&w&&f&&G(e)},[w,D,f,A,S]),(0,o.useFrame)(()=>{let e=P.current;if(!e||!D||!w||!f)return;let t=x.position.distanceTo(j.current),r=V.current,n=t<=m;if(n&&!r)V.current=!0,G(e);else if(!n&&r){V.current=!1,C();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=P.current;if(e&&!w){C();try{e.stop()}catch{}V.current=!1}},[w]),l?(0,t.jsxs)("mesh",{position:j.current,children:[(0,t.jsx)("sphereGeometry",{args:[p,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(s.FloatingLabel,{color:"#00ff00",position:[0,p+1,0],children:f})]}):null});e.s(["AudioEmitter",0,M,"audioBufferCache",0,f,"getCachedAudioBuffer",()=>R,"getSoundGeneration",()=>h,"playOneShotSound",()=>v,"resolveAudioProfile",()=>g,"stopAllTrackedSounds",()=>D,"trackSound",()=>p,"untrackSound",()=>m])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/68bae3cf9f451a9b.js b/docs/_next/static/chunks/68bae3cf9f451a9b.js new file mode 100644 index 00000000..fd4e2b3b --- /dev/null +++ b/docs/_next/static/chunks/68bae3cf9f451a9b.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},56614,e=>{e.v({CloseButton:"ServerBrowser-module__kqm3eq__CloseButton "+e.i(81847).Secondary,Dialog:"ServerBrowser-module__kqm3eq__Dialog "+e.i(81847).Dialog,Empty:"ServerBrowser-module__kqm3eq__Empty",EmptyServer:"ServerBrowser-module__kqm3eq__EmptyServer",Footer:"ServerBrowser-module__kqm3eq__Footer",Header:"ServerBrowser-module__kqm3eq__Header",HiddenRadio:"ServerBrowser-module__kqm3eq__HiddenRadio",Hint:"ServerBrowser-module__kqm3eq__Hint",JoinButton:"ServerBrowser-module__kqm3eq__JoinButton "+e.i(81847).DialogButton,Overlay:"ServerBrowser-module__kqm3eq__Overlay "+e.i(81847).Overlay,PasswordIcon:"ServerBrowser-module__kqm3eq__PasswordIcon",RefreshButton:"ServerBrowser-module__kqm3eq__RefreshButton "+e.i(81847).DialogButton,ServerCount:"ServerBrowser-module__kqm3eq__ServerCount",Table:"ServerBrowser-module__kqm3eq__Table",TableWrapper:"ServerBrowser-module__kqm3eq__TableWrapper",Title:"ServerBrowser-module__kqm3eq__Title",WarriorField:"ServerBrowser-module__kqm3eq__WarriorField",WarriorInput:"ServerBrowser-module__kqm3eq__WarriorInput",WarriorLabel:"ServerBrowser-module__kqm3eq__WarriorLabel"})},45554,e=>{"use strict";var r=e.i(43476),l=e.i(932),o=e.i(71645),t=e.i(56614),s=e.i(98755),a=e.i(79123);function n(e){let n,v,f,S,p,g,x,y,j,q,k,B,w,C,b,N,D,W,T,L,E,P,R,H,O,F,I,A,G,Z,J=(0,l.c)(88),{onClose:K}=e,M=(0,s.useLiveSelector)(h),U=(0,s.useLiveSelector)(_),Q=(0,s.useLiveSelector)(m),z=(0,s.useLiveSelector)(u),V=(0,s.useLiveSelector)(c),{warriorName:X,setWarriorName:Y}=(0,a.useSettings)(),[$,ee]=(0,o.useState)(null);J[0]!==V||J[1]!==K||J[2]!==$||J[3]!==X?(n=()=>{$&&(V($,X),K())},J[0]=V,J[1]=K,J[2]=$,J[3]=X,J[4]=n):n=J[4];let er=n;J[5]!==V||J[6]!==K||J[7]!==X?(v=e=>{V(e,X),K()},J[5]=V,J[6]=K,J[7]=X,J[8]=v):v=J[8];let el=v,[eo,et]=(0,o.useState)("ping"),[es,ea]=(0,o.useState)("asc"),en=(0,o.useRef)(null);J[9]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},S=[],J[9]=f,J[10]=S):(f=J[9],S=J[10]),(0,o.useEffect)(f,S),J[11]!==z?(p=()=>{z()},g=[z],J[11]=z,J[12]=p,J[13]=g):(p=J[12],g=J[13]),(0,o.useEffect)(p,g),J[14]!==K?(x=()=>{let e=e=>{e.stopPropagation(),"Escape"===e.key&&K()};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},y=[K],J[14]=K,J[15]=x,J[16]=y):(x=J[15],y=J[16]),(0,o.useEffect)(x,y),J[17]!==eo?(j=e=>{eo===e?ea(d):(et(e),ea("desc"))},J[17]=eo,J[18]=j):j=J[18];let ei=j;if(J[19]!==M||J[20]!==es||J[21]!==eo){let e;J[23]!==es||J[24]!==eo?(e=(e,r)=>{let l=e[eo],o=r[eo],t="number"==typeof l&&"number"==typeof o?l-o:String(l).localeCompare(String(o));return"asc"===es?t:-t},J[23]=es,J[24]=eo,J[25]=e):e=J[25],q=[...M].sort(e),J[19]=M,J[20]=es,J[21]=eo,J[22]=q}else q=J[22];let ed=q;J[26]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)("h2",{className:t.default.Title,children:"Server Browser"}),J[26]=k):k=J[26];let ec=1!==M.length?"s":"";if(J[27]!==M.length||J[28]!==ec?(B=(0,r.jsxs)("span",{className:t.default.ServerCount,children:[M.length," server",ec]}),J[27]=M.length,J[28]=ec,J[29]=B):B=J[29],J[30]!==z||J[31]!==U?(w=(0,r.jsx)("button",{className:t.default.RefreshButton,onClick:z,disabled:U,children:"Refresh"}),J[30]=z,J[31]=U,J[32]=w):w=J[32],J[33]!==B||J[34]!==w?(C=(0,r.jsxs)("div",{className:t.default.Header,children:[k,B,w]}),J[33]=B,J[34]=w,J[35]=C):C=J[35],J[36]!==ei?(b=(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{onClick:()=>ei("name"),children:"Server Name"}),(0,r.jsx)("th",{onClick:()=>ei("playerCount"),children:"Players"}),(0,r.jsx)("th",{onClick:()=>ei("ping"),children:"Ping"}),(0,r.jsx)("th",{onClick:()=>ei("mapName"),children:"Map"}),(0,r.jsx)("th",{onClick:()=>ei("gameType"),children:"Type"}),(0,r.jsx)("th",{onClick:()=>ei("mod"),children:"Mod"})]})}),J[36]=ei,J[37]=b):b=J[37],J[38]!==Q||J[39]!==el||J[40]!==K||J[41]!==$||J[42]!==ed){let e;J[44]!==Q||J[45]!==el||J[46]!==K||J[47]!==$?(e=e=>(0,r.jsxs)("tr",{onClick:()=>{ee(e.address),Array.from(document.forms.serverList.elements.serverAddress).find(r=>r.value===e.address).focus()},onDoubleClick:()=>{ee(e.address),el(e.address),K()},children:[(0,r.jsxs)("td",{children:[(0,r.jsx)("input",{type:"radio",className:t.default.HiddenRadio,name:"serverAddress",value:e.address,checked:$===e.address,onChange:e=>{ee(e.target.value)}}),e.passwordRequired&&(0,r.jsx)("span",{className:t.default.PasswordIcon,children:"🔒"}),e.name]}),(0,r.jsxs)("td",{className:0===e.playerCount?t.default.EmptyServer:void 0,children:[e.playerCount," / ",e.maxPlayers]}),(0,r.jsx)("td",{children:null!=Q?(e.ping+Q).toLocaleString():"—"}),(0,r.jsx)("td",{children:e.mapName}),(0,r.jsx)("td",{children:e.gameType}),(0,r.jsx)("td",{children:e.mod})]},e.address),J[44]=Q,J[45]=el,J[46]=K,J[47]=$,J[48]=e):e=J[48],N=ed.map(e),J[38]=Q,J[39]=el,J[40]=K,J[41]=$,J[42]=ed,J[43]=N}else N=J[43];J[49]!==U||J[50]!==ed.length?(D=0===ed.length&&!U&&(0,r.jsx)("tr",{className:t.default.Empty,children:(0,r.jsx)("td",{colSpan:6,children:"No servers found"})}),J[49]=U,J[50]=ed.length,J[51]=D):D=J[51],J[52]!==U||J[53]!==ed.length?(W=U&&0===ed.length&&(0,r.jsx)("tr",{className:t.default.Empty,children:(0,r.jsx)("td",{colSpan:6,children:"Querying master server…"})}),J[52]=U,J[53]=ed.length,J[54]=W):W=J[54],J[55]!==N||J[56]!==D||J[57]!==W?(T=(0,r.jsxs)("tbody",{children:[N,D,W]}),J[55]=N,J[56]=D,J[57]=W,J[58]=T):T=J[58],J[59]!==b||J[60]!==T?(L=(0,r.jsxs)("table",{className:t.default.Table,children:[b,T]}),J[59]=b,J[60]=T,J[61]=L):L=J[61],J[62]!==er||J[63]!==L?(E=(0,r.jsx)("div",{className:t.default.TableWrapper,children:(0,r.jsx)("form",{name:"serverList",onSubmit:er,children:L})}),J[62]=er,J[63]=L,J[64]=E):E=J[64],J[65]===Symbol.for("react.memo_cache_sentinel")?(P=(0,r.jsx)("label",{className:t.default.WarriorLabel,htmlFor:"warriorName",children:"Warrior"}),J[65]=P):P=J[65],J[66]!==Y?(R=e=>Y(e.target.value),J[66]=Y,J[67]=R):R=J[67],J[68]!==R||J[69]!==X?(H=(0,r.jsxs)("div",{className:t.default.WarriorField,children:[P,(0,r.jsx)("input",{id:"warriorName",className:t.default.WarriorInput,type:"text",value:X,onChange:R,placeholder:"Name thyself…",maxLength:24})]}),J[68]=R,J[69]=X,J[70]=H):H=J[70],J[71]===Symbol.for("react.memo_cache_sentinel")?(O=(0,r.jsx)("span",{className:t.default.Hint,children:"Double-click a server to join"}),J[71]=O):O=J[71],J[72]!==K?(F=(0,r.jsx)("button",{onClick:K,className:t.default.CloseButton,children:"Cancel"}),J[72]=K,J[73]=F):F=J[73];let eu=!$;return J[74]!==er||J[75]!==eu?(I=(0,r.jsx)("button",{onClick:er,disabled:eu,className:t.default.JoinButton,children:"Join"}),J[74]=er,J[75]=eu,J[76]=I):I=J[76],J[77]!==H||J[78]!==F||J[79]!==I?(A=(0,r.jsxs)("div",{className:t.default.Footer,children:[H,O,F,I]}),J[77]=H,J[78]=F,J[79]=I,J[80]=A):A=J[80],J[81]!==C||J[82]!==E||J[83]!==A?(G=(0,r.jsxs)("div",{className:t.default.Dialog,ref:en,tabIndex:-1,onClick:i,children:[C,E,A]}),J[81]=C,J[82]=E,J[83]=A,J[84]=G):G=J[84],J[85]!==K||J[86]!==G?(Z=(0,r.jsx)("div",{className:t.default.Overlay,onClick:K,children:G}),J[85]=K,J[86]=G,J[87]=Z):Z=J[87],Z}function i(e){return e.stopPropagation()}function d(e){return"asc"===e?"desc":"asc"}function c(e){return e.joinServer}function u(e){return e.listServers}function m(e){return e.browserToRelayPing}function _(e){return e.serversLoading}function h(e){return e.servers}e.s(["ServerBrowser",()=>n])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/6c0bdfaab43cc40b.js b/docs/_next/static/chunks/6c0bdfaab43cc40b.js new file mode 100644 index 00000000..e6d3fe9a --- /dev/null +++ b/docs/_next/static/chunks/6c0bdfaab43cc40b.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64972,e=>{"use strict";var r=e.i(43476),t=e.i(932),i=e.i(71645),s=e.i(71753),o=e.i(47071),n=e.i(90072),a=e.i(85557),c=e.i(12979);let l=new n.Vector3,u=new n.Vector3,d=new n.Vector3,f=new n.Vector3,y=new n.Vector3,b=new n.Vector3,x=new n.Vector3(0,1,0);function h(e){let i,s,a,l,u,d=(0,t.c)(14),{entity:f}=e,{visual:y}=f;d[0]!==y.texture?(i=(0,c.textureToUrl)(y.texture),d[0]=y.texture,d[1]=i):i=d[1];let b=i,x=(0,o.useTexture)(b,p),h=Array.isArray(x)?x[0]:x;d[2]!==y.color.b||d[3]!==y.color.g||d[4]!==y.color.r?(s=new n.Color().setRGB(y.color.r,y.color.g,y.color.b,n.SRGBColorSpace),d[2]=y.color.b,d[3]=y.color.g,d[4]=y.color.r,d[5]=s):s=d[5];let m=s;return d[6]!==y.size?(a=[y.size,y.size,1],d[6]=y.size,d[7]=a):a=d[7],d[8]!==m||d[9]!==h?(l=(0,r.jsx)("spriteMaterial",{map:h,color:m,transparent:!0,blending:n.AdditiveBlending,depthWrite:!1,toneMapped:!1}),d[8]=m,d[9]=h,d[10]=l):l=d[10],d[11]!==a||d[12]!==l?(u=(0,r.jsx)("sprite",{scale:a,children:l}),d[11]=a,d[12]=l,d[13]=u):u=d[13],u}function p(e){let r=Array.isArray(e)?e[0]:e;(0,a.setupEffectTexture)(r)}function m(e){let h,p,m,g,S,w,j,z,T,V,v,C,B=(0,t.c)(29),{entity:R}=e,{visual:U}=R,_=(0,i.useRef)(null),F=(0,i.useRef)(null),q=(0,i.useRef)(null);B[0]===Symbol.for("react.memo_cache_sentinel")?(h=new n.Quaternion,B[0]=h):h=B[0];let M=(0,i.useRef)(h);B[1]!==U.texture?(p=(0,c.textureToUrl)(U.texture),B[1]=U.texture,B[2]=p):p=B[2];let W=U.crossTexture??U.texture;B[3]!==W?(m=(0,c.textureToUrl)(W),B[3]=W,B[4]=m):m=B[4],B[5]!==p||B[6]!==m?(g=[p,m],B[5]=p,B[6]=m,B[7]=g):g=B[7];let G=g,P=(0,o.useTexture)(G,A);B[8]!==P?(S=Array.isArray(P)?P:[P,P],B[8]=P,B[9]=S):S=B[9];let[k,D]=S;return B[10]!==R.direction||B[11]!==R.keyframes?.[0]||B[12]!==U.crossSize||B[13]!==U.crossViewAng||B[14]!==U.renderCross||B[15]!==U.tracerLength||B[16]!==U.tracerWidth?(w=e=>{let{camera:r}=e,t=_.current,i=F.current;if(!t||!i)return;let s=R.keyframes?.[0],o=s?.position,n=R.direction??s?.velocity;if(!o||!n||((0,a.torqueVecToThree)(n,l),1e-8>l.lengthSq())){t.visible=!1,q.current&&(q.current.visible=!1);return}l.normalize(),t.visible=!0,(0,a.torqueVecToThree)(o,b),u.copy(b).sub(r.position),d.crossVectors(u,l),1e-8>d.lengthSq()&&(d.crossVectors(x,l),1e-8>d.lengthSq()&&d.set(1,0,0)),d.normalize().multiplyScalar(U.tracerWidth);let c=.5*U.tracerLength;f.copy(l).multiplyScalar(-c),y.copy(l).multiplyScalar(c);let h=i.array;h[0]=f.x+d.x,h[1]=f.y+d.y,h[2]=f.z+d.z,h[3]=f.x-d.x,h[4]=f.y-d.y,h[5]=f.z-d.z,h[6]=y.x-d.x,h[7]=y.y-d.y,h[8]=y.z-d.z,h[9]=y.x+d.x,h[10]=y.y+d.y,h[11]=y.z+d.z,i.needsUpdate=!0;let p=q.current;if(!p)return;if(!U.renderCross){p.visible=!1;return}u.normalize();let m=l.dot(u);if(m>-U.crossViewAng&&mh,"TracerProjectile",()=>m])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/6f1c1038c8b3b80c.js b/docs/_next/static/chunks/6f1c1038c8b3b80c.js deleted file mode 100644 index 48946d16..00000000 --- a/docs/_next/static/chunks/6f1c1038c8b3b80c.js +++ /dev/null @@ -1,75 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63724,e=>{"use strict";var r=e.i(43476),o=e.i(932),a=e.i(71645),t=e.i(47071),l=e.i(71753),c=e.i(90072),n=e.i(12979),i=e.i(79123);let u=` -#include - -varying vec2 vUv; - -void main() { - vUv = uv; - vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); - gl_Position = projectionMatrix * mvPosition; - #include -} -`,s=` -#include - -uniform sampler2D frame0; -uniform sampler2D frame1; -uniform sampler2D frame2; -uniform sampler2D frame3; -uniform sampler2D frame4; -uniform int currentFrame; -uniform float vScroll; -uniform vec2 uvScale; -uniform vec3 tintColor; -uniform float opacity; -uniform float opacityFactor; - -varying vec2 vUv; - -void main() { - // Scale and scroll UVs - vec2 scrolledUv = vec2(vUv.x * uvScale.x, vUv.y * uvScale.y + vScroll); - - // Sample the current frame - vec4 texColor; - if (currentFrame == 0) { - texColor = texture2D(frame0, scrolledUv); - } else if (currentFrame == 1) { - texColor = texture2D(frame1, scrolledUv); - } else if (currentFrame == 2) { - texColor = texture2D(frame2, scrolledUv); - } else if (currentFrame == 3) { - texColor = texture2D(frame3, scrolledUv); - } else { - texColor = texture2D(frame4, scrolledUv); - } - - // Tribes 2 GL_MODULATE: output = texture * vertexColor - // No gamma correction - textures use NoColorSpace and values pass through - // directly to display, matching how WaterBlock handles sRGB textures. - vec3 modulatedColor = texColor.rgb * tintColor; - - float adjustedOpacity = opacity * opacityFactor; - - gl_FragColor = vec4(modulatedColor, adjustedOpacity); - - // Custom fog for additive blending: fade out rather than blend to fog color. - // Standard fog (mix toward fogColor) doesn't work with additive blending - // because we'd still be adding fogColor to the framebuffer. - // Uses Torque's quadratic haze formula for consistency. - #ifdef USE_FOG - float dist = vFogDepth; - float fogFactor = 0.0; - if (dist > fogNear) { - if (dist >= fogFar) { - fogFactor = 1.0; - } else { - float fogScale = 1.0 / (fogFar - fogNear); - float distFactor = (dist - fogNear) * fogScale - 1.0; - fogFactor = 1.0 - distFactor * distFactor; - } - } - gl_FragColor.a *= 1.0 - fogFactor; - #endif -} -`;function f(e){let r,t,l,n=(0,o.c)(7),[i,u,s]=e;n[0]!==i||n[1]!==u||n[2]!==s?((r=new c.BoxGeometry(i,u,s)).translate(i/2,u/2,s/2),n[0]=i,n[1]=u,n[2]=s,n[3]=r):r=n[3];let f=r;return n[4]!==f?(t=()=>()=>f.dispose(),l=[f],n[4]=f,n[5]=t,n[6]=l):(t=n[5],l=n[6]),(0,a.useEffect)(t,l),f}function m(e){let a,t,l,n=(0,o.c)(10),{scale:i,color:u,baseTranslucency:s}=e,m=f(i);n[0]!==u[0]||n[1]!==u[1]||n[2]!==u[2]?(a=new c.Color(u[0],u[1],u[2]),n[0]=u[0],n[1]=u[1],n[2]=u[2],n[3]=a):a=n[3];let d=a,v=+s;return n[4]!==d||n[5]!==v?(t=(0,r.jsx)("meshBasicMaterial",{color:d,transparent:!0,opacity:v,blending:c.AdditiveBlending,side:c.DoubleSide,depthWrite:!1,fog:!1}),n[4]=d,n[5]=v,n[6]=t):t=n[6],n[7]!==m||n[8]!==t?(l=(0,r.jsx)("mesh",{geometry:m,renderOrder:1,children:t}),n[7]=m,n[8]=t,n[9]=l):l=n[9],l}function d({scale:e,data:o}){let{animationEnabled:m}=(0,i.useSettings)(),d=f(e),v=(0,a.useMemo)(()=>o.textures.map(e=>(0,n.textureToUrl)(e)),[o.textures]),g=(0,t.useTexture)(v,e=>{e.forEach(e=>{e.wrapS=e.wrapT=c.RepeatWrapping,e.colorSpace=c.NoColorSpace,e.flipY=!1,e.needsUpdate=!0})}),p=(0,a.useMemo)(()=>(function({textures:e,scale:r,umapping:o,vmapping:a,color:t,baseTranslucency:l}){let n=[...r].sort((e,r)=>r-e),i=new c.Vector2(n[0]*o,n[1]*a),f=e[0];return new c.ShaderMaterial({uniforms:{frame0:{value:f},frame1:{value:e[1]??f},frame2:{value:e[2]??f},frame3:{value:e[3]??f},frame4:{value:e[4]??f},currentFrame:{value:0},vScroll:{value:0},uvScale:{value:i},tintColor:{value:new c.Color(...t)},opacity:{value:l},opacityFactor:{value:1},fogColor:{value:new c.Color},fogNear:{value:1},fogFar:{value:2e3}},vertexShader:u,fragmentShader:s,transparent:!0,blending:c.AdditiveBlending,side:c.DoubleSide,depthWrite:!1,fog:!0})})({textures:g,scale:e,umapping:o.umapping,vmapping:o.vmapping,color:o.color,baseTranslucency:o.baseTranslucency}),[g,e,o]);(0,a.useEffect)(()=>()=>p.dispose(),[p]);let x=(0,a.useRef)(0);return(0,l.useFrame)((e,r)=>{if(!m){x.current=0,p.uniforms.currentFrame.value=0,p.uniforms.vScroll.value=0;return}x.current+=r,p.uniforms.currentFrame.value=Math.floor(x.current*o.framesPerSec)%o.numFrames,p.uniforms.vScroll.value=x.current*o.scrollSpeed}),(0,r.jsx)("mesh",{geometry:d,material:p,renderOrder:1})}function v(e){let t,l,c,n=(0,o.c)(14),{data:i,scale:u}=e;if(0===i.textures.map(g).length){let e;return n[0]!==i.baseTranslucency||n[1]!==i.color||n[2]!==u?(e=(0,r.jsx)(m,{scale:u,color:i.color,baseTranslucency:i.baseTranslucency}),n[0]=i.baseTranslucency,n[1]=i.color,n[2]=u,n[3]=e):e=n[3],e}return n[4]!==i.baseTranslucency||n[5]!==i.color||n[6]!==u?(t=(0,r.jsx)(m,{scale:u,color:i.color,baseTranslucency:i.baseTranslucency}),n[4]=i.baseTranslucency,n[5]=i.color,n[6]=u,n[7]=t):t=n[7],n[8]!==i||n[9]!==u?(l=(0,r.jsx)(d,{scale:u,data:i}),n[8]=i,n[9]=u,n[10]=l):l=n[10],n[11]!==t||n[12]!==l?(c=(0,r.jsx)(a.Suspense,{fallback:t,children:l}),n[11]=t,n[12]=l,n[13]=c):c=n[13],c}function g(e){return(0,n.textureToUrl)(e)}e.s(["ForceFieldBare",()=>v],63724)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/718b5c36c0eed37e.js b/docs/_next/static/chunks/718b5c36c0eed37e.js deleted file mode 100644 index de55c7c8..00000000 --- a/docs/_next/static/chunks/718b5c36c0eed37e.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(6090).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog",Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay",PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),n=e.i(11152),i=e.i(66027),r=e.i(12979),s=e.i(91996),o=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,n=(0,a.c)(5),{name:i}=e;n[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,r.getUrlForPath)((0,s.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),n[0]=i,n[1]=l):l=n[1];let u=l;if(u){let e;return n[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:o.default.Bitmap}),n[2]=u,n[3]=e):e=n[3],e}if(/bullet/i.test(i)){let e;return n[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:o.default.Bullet,children:"•"}),n[4]=e):e=n[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let n,i,r=(0,a.c)(4),{markup:s}=e;r[0]!==s?(n=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),n={type:"span",source:"root",style:{},children:[]},i=n,r=[i],s=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||s(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,r.push(i);break}case"spop":if("root"!==i.source){let e=r.pop();for(;"spush"!==e.source;)e=r.pop();i=r[r.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(s(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,r.push(i)}else i.style.fontSize=t;break}case"color":if(s(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,r.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,r.push(i);break}case"/a":{let e=r.pop();for(;"a"!==e.source;)e=r.pop();i=r[r.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(n)}(s),r[0]=s,r[1]=n):n=r[1];let c=n;return r[2]!==c?(i=(0,t.jsx)("div",{className:o.default.GuiMarkup,children:c}),r[2]=c,r[3]=i):i=r[3],i}var f=e.i(41973);function h(e){let n,i,r,s=(0,a.c)(7),{src:o,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(s[0]!==o?(n=()=>{let e,t=!1;return fetch(o).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(_),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[o],s[0]=o,s[1]=n,s[2]=i):(n=s[1],i=s[2]),(0,l.useEffect)(n,i),p)?(s[3]!==u||s[4]!==m||s[5]!==p?(r=(0,t.jsx)("img",{src:p,alt:u,className:m}),s[3]=u,s[4]=m,s[5]=p,s[6]=r):r=s[6],r):null}function _(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,s,o,u,c,m,p,d,h,_,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let I=`${r.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(s=()=>()=>{k.current?.pause()},o=[],y[2]=s,y[3]=o):(s=y[2],o=y[3]),(0,l.useEffect)(s,o),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==I?(d=(0,t.jsx)("audio",{ref:k,src:I,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=I,y[10]=d):d=y[10],y[11]!==M?(h=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=h):h=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(_=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(n.FaVolumeUp,{}):(0,t.jsx)(n.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=_):_=y[16],y[17]!==v||y[18]!==_||y[19]!==d||y[20]!==h?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,h,_]}),y[17]=v,y[18]=_,y[19]=d,y[20]=h,y[21]=g):g=y[21],g}function x(e){var n,o,u;let c,m,_,g,y,M,x,I,w,N,B,S,D,P,C,L,T,X,E,R,U,O,F,$,K,Q,q,G,z,A,H,V,J,W,Y,Z,ee,et=(0,a.c)(102),{open:ea,onClose:el,missionName:en,missionType:ei}=e,{data:er}=((ee=(0,a.c)(2))[0]!==en?(Z={queryKey:["parsedMission",en],queryFn:()=>(0,r.loadMission)(en)},ee[0]=en,ee[1]=Z):Z=ee[1],(0,i.useQuery)(Z)),es=(0,l.useRef)(null);if(et[0]!==ea?(c=()=>{if(ea){es.current?.focus();try{document.exitPointerLock()}catch{}}},m=[ea],et[0]=ea,et[1]=c,et[2]=m):(c=et[1],m=et[2]),(0,l.useEffect)(c,m),et[3]!==el||et[4]!==ea?(_=()=>{if(!ea)return;let e=e=>{if("KeyI"===e.code||"Escape"===e.key)el();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void el();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea,el],et[3]=el,et[4]=ea,et[5]=_,et[6]=g):(_=et[5],g=et[6]),(0,l.useEffect)(_,g),!ea)return null;et[7]!==er?(y=er?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(er.ast):{},et[7]=er,et[8]=y):y=et[8];let eo=y;et[9]!==en||et[10]!==er?(M=er?function(e,t){if(e)try{let t=(0,s.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,r.getUrlForPath)(t)}catch{}try{let e=(0,s.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,r.getUrlForPath)(e)}catch{}return null}(er.bitmap,en):null,et[9]=en,et[10]=er,et[11]=M):M=et[11];let eu=M,ec=er?.displayName??en;et[12]!==ei?(x=ei.toLowerCase(),et[12]=ei,et[13]=x):x=et[13];let em="singleplayer"===x,ep=eo.musictrack;if(et[14]!==eu||et[15]!==ec||et[16]!==em||et[17]!==ei||et[18]!==el||et[19]!==er){let e,a,l,i,r,s,c=er?.missionString?(n=er.missionString,s=ei.toUpperCase(),n.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(s)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[38]!==er?.missionQuote){if(o=i=er?.missionQuote?.trim()??"",l="",e="",!(a=p.test(o)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[38]=er?.missionQuote,et[39]=e,et[40]=a,et[41]=l,et[42]=i}else e=et[39],a=et[40],l=et[41],i=et[42];(O=f.default.Overlay,F=el,P=es,C=f.default.Dialog,L=j,T=b,X="dialog",E="true",R="Map Information",U=-1,D=f.default.Body,$=f.default.Left,et[43]!==eu||et[44]!==ec||et[45]!==em?(K=eu&&em&&(0,t.jsx)(h,{className:f.default.PreviewImageFloating,src:eu,alt:`${ec} preview`},eu),et[43]=eu,et[44]=ec,et[45]=em,et[46]=K):K=et[46],et[47]!==ec?(I=(0,t.jsx)("h1",{className:f.default.Title,children:ec}),et[47]=ec,et[48]=I):I=et[48],et[49]!==er?(r=er?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:er.planetName}),et[49]=er,et[50]=r):r=et[50],et[51]!==r?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:r}),et[51]=r,et[52]=w):w=et[52],et[53]!==e||et[54]!==a||et[55]!==l||et[56]!==i?(N=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[53]=e,et[54]=a,et[55]=l,et[56]=i,et[57]=N):N=et[57],et[58]!==er)?(B=er?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=er.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:er.missionBlurb.trim()}):er.missionBlurb.trim()}),et[58]=er,et[59]=B):B=et[59],S=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[14]=eu,et[15]=ec,et[16]=em,et[17]=ei,et[18]=el,et[19]=er,et[20]=I,et[21]=w,et[22]=N,et[23]=B,et[24]=S,et[25]=D,et[26]=P,et[27]=C,et[28]=L,et[29]=T,et[30]=X,et[31]=E,et[32]=R,et[33]=U,et[34]=O,et[35]=F,et[36]=$,et[37]=K}else I=et[20],w=et[21],N=et[22],B=et[23],S=et[24],D=et[25],P=et[26],C=et[27],L=et[28],T=et[29],X=et[30],E=et[31],R=et[32],U=et[33],O=et[34],F=et[35],$=et[36],K=et[37];return et[60]!==er?(Q=er?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:er.missionBriefing})]}),et[60]=er,et[61]=Q):Q=et[61],et[62]!==ep?(q=ep&&(0,t.jsx)(v,{track:ep}),et[62]=ep,et[63]=q):q=et[63],et[64]!==I||et[65]!==w||et[66]!==N||et[67]!==B||et[68]!==S||et[69]!==Q||et[70]!==q||et[71]!==$||et[72]!==K?(G=(0,t.jsxs)("div",{className:$,children:[K,I,w,N,B,S,Q,q]}),et[64]=I,et[65]=w,et[66]=N,et[67]=B,et[68]=S,et[69]=Q,et[70]=q,et[71]=$,et[72]=K,et[73]=G):G=et[73],et[74]!==eu||et[75]!==ec||et[76]!==em?(z=eu&&!em&&(0,t.jsx)(h,{src:eu,alt:`${ec} preview`},eu),et[74]=eu,et[75]=ec,et[76]=em,et[77]=z):z=et[77],et[78]!==D||et[79]!==G||et[80]!==z?(A=(0,t.jsxs)("div",{className:D,children:[G,z]}),et[78]=D,et[79]=G,et[80]=z,et[81]=A):A=et[81],et[82]!==el?(H=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:el,children:"Close"}),et[82]=el,et[83]=H):H=et[83],et[84]===Symbol.for("react.memo_cache_sentinel")?(V=(0,t.jsx)("span",{className:f.default.Hint,children:"I or Esc to close"}),et[84]=V):V=et[84],et[85]!==H?(J=(0,t.jsxs)("div",{className:f.default.Footer,children:[H,V]}),et[85]=H,et[86]=J):J=et[86],et[87]!==P||et[88]!==C||et[89]!==L||et[90]!==T||et[91]!==X||et[92]!==E||et[93]!==R||et[94]!==U||et[95]!==A||et[96]!==J?(W=(0,t.jsxs)("div",{ref:P,className:C,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":R,tabIndex:U,children:[A,J]}),et[87]=P,et[88]=C,et[89]=L,et[90]=T,et[91]=X,et[92]=E,et[93]=R,et[94]=U,et[95]=A,et[96]=J,et[97]=W):W=et[97],et[98]!==O||et[99]!==F||et[100]!==W?(Y=(0,t.jsx)("div",{className:O,onClick:F,children:W}),et[98]=O,et[99]=F,et[100]=W,et[101]=Y):Y=et[101],Y}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/727710e55f003daf.js b/docs/_next/static/chunks/727710e55f003daf.js new file mode 100644 index 00000000..20657ce9 --- /dev/null +++ b/docs/_next/static/chunks/727710e55f003daf.js @@ -0,0 +1,36 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90072,t=>{"use strict";let e,i,s,r,n,a,o,h,l,u={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},c={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},p="attached",d="detached",m="srgb",y="srgb-linear",f="linear",g="srgb",x={COMPUTE:"compute",RENDER:"render"},b={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},v={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function M(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}let w={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function S(t,e){return new w[t](e)}function _(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function T(){let t=A("canvas");return t.style.display="block",t}let C={},I=null;function z(t){I=t}function B(){return I}function k(...t){let e="THREE."+t.shift();I?I("log",e,...t):console.log(e,...t)}function O(...t){let e="THREE."+t.shift();I?I("warn",e,...t):console.warn(e,...t)}function P(...t){let e="THREE."+t.shift();I?I("error",e,...t):console.error(e,...t)}function R(...t){let e=t.join(" ");e in C||(C[e]=!0,O(...t))}function F(t,e,i){return new Promise(function(s,r){setTimeout(function n(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(n,i);break;default:s()}},i)})}class N{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){let i=this._listeners;return void 0!==i&&void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){let i=this._listeners;if(void 0===i)return;let s=i[t];if(void 0!==s){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let i=e[t.type];if(void 0!==i){t.target=this;let e=i.slice(0);for(let i=0,s=e.length;i>8&255]+L[t>>16&255]+L[t>>24&255]+"-"+L[255&e]+L[e>>8&255]+"-"+L[e>>16&15|64]+L[e>>24&255]+"-"+L[63&i|128]+L[i>>8&255]+"-"+L[i>>16&255]+L[i>>24&255]+L[255&s]+L[s>>8&255]+L[s>>16&255]+L[s>>24&255]).toLowerCase()}function j(t,e,i){return Math.max(e,Math.min(i,t))}function W(t,e){return(t%e+e)%e}function G(t,e,i){return(1-i)*t+i*e}function q(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/0xffffffff;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/0x7fffffff,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("Invalid component type.")}}function J(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(0xffffffff*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(0x7fffffff*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("Invalid component type.")}}let X={DEG2RAD:V,RAD2DEG:D,generateUUID:U,clamp:j,euclideanModulo:W,mapLinear:function(t,e,i,s,r){return s+(t-e)*(r-s)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:G,damp:function(t,e,i,s){return G(t,e,1-Math.exp(-i*s))},pingpong:function(t,e=1){return e-Math.abs(W(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(E=t);let e=E+=0x6d2b79f5;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000},degToRad:function(t){return t*V},radToDeg:function(t){return t*D},isPowerOfTwo:function(t){return(t&t-1)==0&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,s,r){let n=Math.cos,a=Math.sin,o=n(i/2),h=a(i/2),l=n((e+s)/2),u=a((e+s)/2),c=n((e-s)/2),p=a((e-s)/2),d=n((s-e)/2),m=a((s-e)/2);switch(r){case"XYX":t.set(o*u,h*c,h*p,o*l);break;case"YZY":t.set(h*p,o*u,h*c,o*l);break;case"ZXZ":t.set(h*c,h*p,o*u,o*l);break;case"XZX":t.set(o*u,h*m,h*d,o*l);break;case"YXY":t.set(h*d,o*u,h*m,o*l);break;case"ZYZ":t.set(h*m,h*d,o*u,o*l);break;default:O("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:J,denormalize:q};class H{constructor(t=0,e=0){H.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=j(this.x,t.x,e.x),this.y=j(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=j(this.x,t,e),this.y=j(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(j(i,t,e))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(j(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,n=this.y-t.y;return this.x=r*i-n*s+t.x,this.y=r*s+n*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Y{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,n,a){let o=i[s+0],h=i[s+1],l=i[s+2],u=i[s+3],c=r[n+0],p=r[n+1],d=r[n+2],m=r[n+3];if(a<=0){t[e+0]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u;return}if(a>=1){t[e+0]=c,t[e+1]=p,t[e+2]=d,t[e+3]=m;return}if(u!==m||o!==c||h!==p||l!==d){let t=o*c+h*p+l*d+u*m;t<0&&(c=-c,p=-p,d=-d,m=-m,t=-t);let e=1-a;if(t<.9995){let i=Math.acos(t),s=Math.sin(i);o=o*(e=Math.sin(e*i)/s)+c*(a=Math.sin(a*i)/s),h=h*e+p*a,l=l*e+d*a,u=u*e+m*a}else{let t=1/Math.sqrt((o=o*e+c*a)*o+(h=h*e+p*a)*h+(l=l*e+d*a)*l+(u=u*e+m*a)*u);o*=t,h*=t,l*=t,u*=t}}t[e]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,r,n){let a=i[s],o=i[s+1],h=i[s+2],l=i[s+3],u=r[n],c=r[n+1],p=r[n+2],d=r[n+3];return t[e]=a*d+l*u+o*p-h*c,t[e+1]=o*d+l*c+h*u-a*p,t[e+2]=h*d+l*p+a*c-o*u,t[e+3]=l*d-a*u-o*c-h*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let i=t._x,s=t._y,r=t._z,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),l=a(s/2),u=a(r/2),c=o(i/2),p=o(s/2),d=o(r/2);switch(n){case"XYZ":this._x=c*l*u+h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u-c*p*d;break;case"YXZ":this._x=c*l*u+h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u+c*p*d;break;case"ZXY":this._x=c*l*u-h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u-c*p*d;break;case"ZYX":this._x=c*l*u-h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u+c*p*d;break;case"YZX":this._x=c*l*u+h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u-c*p*d;break;case"XZY":this._x=c*l*u-h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u+c*p*d;break;default:O("Quaternion: .setFromEuler() encountered an unknown order: "+n)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],s=e[4],r=e[8],n=e[1],a=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=i+a+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-o)*t,this._y=(r-h)*t,this._z=(n-s)*t}else if(i>a&&i>u){let t=2*Math.sqrt(1+i-a-u);this._w=(l-o)/t,this._x=.25*t,this._y=(s+n)/t,this._z=(r+h)/t}else if(a>u){let t=2*Math.sqrt(1+a-i-u);this._w=(r-h)/t,this._x=(s+n)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-i-a);this._w=(n-s)/t,this._x=(r+h)/t,this._y=(o+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=i,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(j(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);if(0===i)return this;let s=Math.min(1,e/i);return this.slerp(t,s),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let i=t._x,s=t._y,r=t._z,n=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+n*a+s*h-r*o,this._y=s*l+n*o+r*a-i*h,this._z=r*l+n*h+i*o-s*a,this._w=n*l-i*a-s*o-r*h,this._onChangeCallback(),this}slerp(t,e){if(e<=0)return this;if(e>=1)return this.copy(t);let i=t._x,s=t._y,r=t._z,n=t._w,a=this.dot(t);a<0&&(i=-i,s=-s,r=-r,n=-n,a=-a);let o=1-e;if(a<.9995){let t=Math.acos(a),h=Math.sin(t);o=Math.sin(o*t)/h,e=Math.sin(e*t)/h,this._x=this._x*o+i*e,this._y=this._y*o+s*e,this._z=this._z*o+r*e,this._w=this._w*o+n*e,this._onChangeCallback()}else this._x=this._x*o+i*e,this._y=this._y*o+s*e,this._z=this._z*o+r*e,this._w=this._w*o+n*e,this.normalize();return this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Z{constructor(t=0,e=0,i=0){Z.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Q.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Q.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=t.elements,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this}applyQuaternion(t){let e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*s-a*i),l=2*(a*e-r*s),u=2*(r*i-n*e);return this.x=e+o*h+n*u-a*l,this.y=i+o*l+a*h-r*u,this.z=s+o*u+r*l-n*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=j(this.x,t.x,e.x),this.y=j(this.y,t.y,e.y),this.z=j(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=j(this.x,t,e),this.y=j(this.y,t,e),this.z=j(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(j(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return $.copy(this).projectOnVector(t),this.sub($)}reflect(t){return this.sub($.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(j(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){let s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let $=new Z,Q=new Y;class K{constructor(t,e,i,s,r,n,a,o,h){K.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,n,a,o,h)}set(t,e,i,s,r,n,a,o,h){let l=this.elements;return l[0]=t,l[1]=s,l[2]=a,l[3]=e,l[4]=r,l[5]=o,l[6]=i,l[7]=n,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,n=i[0],a=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],p=i[5],d=i[8],m=s[0],y=s[3],f=s[6],g=s[1],x=s[4],b=s[7],v=s[2],M=s[5],w=s[8];return r[0]=n*m+a*g+o*v,r[3]=n*y+a*x+o*M,r[6]=n*f+a*b+o*w,r[1]=h*m+l*g+u*v,r[4]=h*y+l*x+u*M,r[7]=h*f+l*b+u*w,r[2]=c*m+p*g+d*v,r[5]=c*y+p*x+d*M,r[8]=c*f+p*b+d*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*n*l-e*a*h-i*r*l+i*a*o+s*r*h-s*n*o}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=a*o-l*r,p=h*r-n*o,d=e*u+i*c+s*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);let m=1/d;return t[0]=u*m,t[1]=(s*h-l*i)*m,t[2]=(a*i-s*n)*m,t[3]=c*m,t[4]=(l*e-s*o)*m,t[5]=(s*r-a*e)*m,t[6]=p*m,t[7]=(i*o-h*e)*m,t[8]=(n*e-i*r)*m,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,n,a){let o=Math.cos(r),h=Math.sin(r);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-s*h,s*o,-s*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(tt.makeScale(t,e)),this}rotate(t){return this.premultiply(tt.makeRotation(-t)),this}translate(t,e){return this.premultiply(tt.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let tt=new K,te=new K().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ti=new K().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),ts=(o=[.64,.33,.3,.6,.15,.06],h=[.2126,.7152,.0722],l=[.3127,.329],(a={enabled:!0,workingColorSpace:y,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===g&&(t.r=tr(t.r),t.g=tr(t.g),t.b=tr(t.b)),this.spaces[e].primaries!==this.spaces[i].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===g&&(t.r=tn(t.r),t.g=tn(t.g),t.b=tn(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?f:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,i){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,e){return R("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(t,e)},toWorkingColorSpace:function(t,e){return R("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(t,e)}}).define({[y]:{primaries:o,whitePoint:l,transfer:f,toXYZ:te,fromXYZ:ti,luminanceCoefficients:h,workingColorSpaceConfig:{unpackColorSpace:m},outputColorSpaceConfig:{drawingBufferColorSpace:m}},[m]:{primaries:o,whitePoint:l,transfer:g,toXYZ:te,fromXYZ:ti,luminanceCoefficients:h,outputColorSpaceConfig:{drawingBufferColorSpace:m}}}),a);function tr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function tn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class ta{static getDataURL(t,i="image/png"){let s;if(/^data:/i.test(t.src)||"u"typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap){let e=A("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let t=0;ttypeof HTMLVideoElement&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):"u">typeof VideoFrame&&e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},s=this.data;if(null!==s){let t;if(Array.isArray(s)){t=[];for(let e=0,i=s.length;etypeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap?ta.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(O("Texture: Unable to serialize Texture."),{})}let tu=0,tc=new Z;class tp extends N{constructor(t=tp.DEFAULT_IMAGE,e=tp.DEFAULT_MAPPING,i=1001,s=1001,r=1006,n=1008,a=1023,o=1009,h=tp.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:tu++}),this.uuid=U(),this.name="",this.source=new th(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new H(0,0),this.repeat=new H(1,1),this.center=new H(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new K,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(tc).x}get height(){return this.source.getSize(tc).y}get depth(){return this.source.getSize(tc).z}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let i=t[e];if(void 0===i){O(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let s=this[e];if(void 0===s){O(`Texture.setValues(): property '${e}' does not exist.`);continue}s&&i&&s.isVector2&&i.isVector2||s&&i&&s.isVector3&&i.isVector3||s&&i&&s.isMatrix3&&i.isMatrix3?s.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}tp.DEFAULT_IMAGE=null,tp.DEFAULT_MAPPING=300,tp.DEFAULT_ANISOTROPY=1;class td{constructor(t=0,e=0,i=0,s=1){td.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=this.w,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r,n=t.elements,a=n[0],o=n[4],h=n[8],l=n[1],u=n[5],c=n[9],p=n[2],d=n[6],m=n[10];if(.01>Math.abs(o-l)&&.01>Math.abs(h-p)&&.01>Math.abs(c-d)){if(.1>Math.abs(o+l)&&.1>Math.abs(h+p)&&.1>Math.abs(c+d)&&.1>Math.abs(a+u+m-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(a+1)/2,n=(u+1)/2,y=(m+1)/2,f=(o+l)/4,g=(h+p)/4,x=(c+d)/4;return t>n&&t>y?t<.01?(i=0,s=.707106781,r=.707106781):(s=f/(i=Math.sqrt(t)),r=g/i):n>y?n<.01?(i=.707106781,s=0,r=.707106781):(i=f/(s=Math.sqrt(n)),r=x/s):y<.01?(i=.707106781,s=.707106781,r=0):(i=g/(r=Math.sqrt(y)),s=x/r),this.set(i,s,r,e),this}let y=Math.sqrt((d-c)*(d-c)+(h-p)*(h-p)+(l-o)*(l-o));return .001>Math.abs(y)&&(y=1),this.x=(d-c)/y,this.y=(h-p)/y,this.z=(l-o)/y,this.w=Math.acos((a+u+m-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=j(this.x,t.x,e.x),this.y=j(this.y,t.y,e.y),this.z=j(this.z,t.z,e.z),this.w=j(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=j(this.x,t,e),this.y=j(this.y,t,e),this.z=j(this.z,t,e),this.w=j(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(j(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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 tm extends N{constructor(t=1,e=1,i={}){super(),i=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},i),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=i.depth,this.scissor=new td(0,0,t,e),this.scissorTest=!1,this.viewport=new td(0,0,t,e);const s=new tp({width:t,height:e,depth:i.depth});this.textures=[];const r=i.count;for(let t=0;t1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,tw),tw.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(tB),tk.subVectors(this.max,tB),t_.subVectors(t.a,tB),tA.subVectors(t.b,tB),tT.subVectors(t.c,tB),tC.subVectors(tA,t_),tI.subVectors(tT,tA),tz.subVectors(t_,tT);let e=[0,-tC.z,tC.y,0,-tI.z,tI.y,0,-tz.z,tz.y,tC.z,0,-tC.x,tI.z,0,-tI.x,tz.z,0,-tz.x,-tC.y,tC.x,0,-tI.y,tI.x,0,-tz.y,tz.x,0];return!!tR(e,t_,tA,tT,tk)&&!!tR(e=[1,0,0,0,1,0,0,0,1],t_,tA,tT,tk)&&(tO.crossVectors(tC,tI),tR(e=[tO.x,tO.y,tO.z],t_,tA,tT,tk))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,tw).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(tw).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(tM[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),tM[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),tM[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),tM[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),tM[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),tM[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),tM[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),tM[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(tM)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}let tM=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],tw=new Z,tS=new tv,t_=new Z,tA=new Z,tT=new Z,tC=new Z,tI=new Z,tz=new Z,tB=new Z,tk=new Z,tO=new Z,tP=new Z;function tR(t,e,i,s,r){for(let n=0,a=t.length-3;n<=a;n+=3){tP.fromArray(t,n);let a=r.x*Math.abs(tP.x)+r.y*Math.abs(tP.y)+r.z*Math.abs(tP.z),o=e.dot(tP),h=i.dot(tP),l=s.dot(tP);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}let tF=new tv,tN=new Z,tL=new Z;class tE{constructor(t=new Z,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let i=this.center;void 0!==e?i.copy(e):tF.setFromPoints(t).getCenter(i);let s=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;tN.subVectors(t,this.center);let e=tN.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(tN,i/t),this.radius+=i}return this}union(t){return t.isEmpty()||(this.isEmpty()?this.copy(t):!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(tL.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(tN.copy(t.center).add(tL)),this.expandByPoint(tN.copy(t.center).sub(tL)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let tV=new Z,tD=new Z,tU=new Z,tj=new Z,tW=new Z,tG=new Z,tq=new Z;class tJ{constructor(t=new Z,e=new Z(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,tV)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=tV.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(tV.copy(this.origin).addScaledVector(this.direction,e),tV.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){let r,n,a,o;tD.copy(t).add(e).multiplyScalar(.5),tU.copy(e).sub(t).normalize(),tj.copy(this.origin).sub(tD);let h=.5*t.distanceTo(e),l=-this.direction.dot(tU),u=tj.dot(this.direction),c=-tj.dot(tU),p=tj.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(r=l*c-u,n=l*u-c,o=h*d,r>=0)if(n>=-o)if(n<=o){let t=1/d;r*=t,n*=t,a=r*(r+l*n+2*u)+n*(l*r+n+2*c)+p}else a=-(r=Math.max(0,-(l*(n=h)+u)))*r+n*(n+2*c)+p;else a=-(r=Math.max(0,-(l*(n=-h)+u)))*r+n*(n+2*c)+p;else n<=-o?(n=(r=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),a=-r*r+n*(n+2*c)+p):n<=o?(r=0,a=(n=Math.min(Math.max(-h,-c),h))*(n+2*c)+p):(n=(r=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),a=-r*r+n*(n+2*c)+p);else n=l>0?-h:h,a=-(r=Math.max(0,-(l*n+u)))*r+n*(n+2*c)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,r),s&&s.copy(tD).addScaledVector(tU,n),a}intersectSphere(t,e){tV.subVectors(t.center,this.origin);let i=tV.dot(this.direction),s=tV.dot(tV)-i*i,r=t.radius*t.radius;if(s>r)return null;let n=Math.sqrt(r-s),a=i-n,o=i+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let i,s,r,n,a,o,h=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(h>=0?(i=(t.min.x-c.x)*h,s=(t.max.x-c.x)*h):(i=(t.max.x-c.x)*h,s=(t.min.x-c.x)*h),l>=0?(r=(t.min.y-c.y)*l,n=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,n=(t.min.y-c.y)*l),i>n||r>s||((r>i||isNaN(i))&&(i=r),(n=0?(a=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(a=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),i>o||a>s||((a>i||i!=i)&&(i=a),(o=0?i:s,e)}intersectsBox(t){return null!==this.intersectBox(t,tV)}intersectTriangle(t,e,i,s,r){let n;tW.subVectors(e,t),tG.subVectors(i,t),tq.crossVectors(tW,tG);let a=this.direction.dot(tq);if(a>0){if(s)return null;n=1}else{if(!(a<0))return null;n=-1,a=-a}tj.subVectors(this.origin,t);let o=n*this.direction.dot(tG.crossVectors(tj,tG));if(o<0)return null;let h=n*this.direction.dot(tW.cross(tj));if(h<0||o+h>a)return null;let l=-n*tj.dot(tq);return l<0?null:this.at(l/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tX{constructor(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,y){tX.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,y)}set(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,y){let f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=s,f[1]=r,f[5]=n,f[9]=a,f[13]=o,f[2]=h,f[6]=l,f[10]=u,f[14]=c,f[3]=p,f[7]=d,f[11]=m,f[15]=y,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 tX().fromArray(this.elements)}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){let e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return 0===this.determinant()?(t.set(1,0,0),e.set(0,1,0),i.set(0,0,1)):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2)),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinant())return this.identity();let e=this.elements,i=t.elements,s=1/tH.setFromMatrixColumn(t,0).length(),r=1/tH.setFromMatrixColumn(t,1).length(),n=1/tH.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*n,e[9]=i[9]*n,e[10]=i[10]*n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,i=t.x,s=t.y,r=t.z,n=Math.cos(i),a=Math.sin(i),o=Math.cos(s),h=Math.sin(s),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){let t=n*l,i=n*u,s=a*l,r=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+s*h,e[5]=t-r*h,e[9]=-a*o,e[2]=r-t*h,e[6]=s+i*h,e[10]=n*o}else if("YXZ"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t+r*a,e[4]=s*a-i,e[8]=n*h,e[1]=n*u,e[5]=n*l,e[9]=-a,e[2]=i*a-s,e[6]=r+t*a,e[10]=n*o}else if("ZXY"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t-r*a,e[4]=-n*u,e[8]=s+i*a,e[1]=i+s*a,e[5]=n*l,e[9]=r-t*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if("ZYX"===t.order){let t=n*l,i=n*u,s=a*l,r=a*u;e[0]=o*l,e[4]=s*h-i,e[8]=t*h+r,e[1]=o*u,e[5]=r*h+t,e[9]=i*h-s,e[2]=-h,e[6]=a*o,e[10]=n*o}else if("YZX"===t.order){let t=n*o,i=n*h,s=a*o,r=a*h;e[0]=o*l,e[4]=r-t*u,e[8]=s*u+i,e[1]=u,e[5]=n*l,e[9]=-a*l,e[2]=-h*l,e[6]=i*u+s,e[10]=t-r*u}else if("XZY"===t.order){let t=n*o,i=n*h,s=a*o,r=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+r,e[5]=n*l,e[9]=i*u-s,e[2]=s*u-i,e[6]=a*l,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(tZ,t,t$)}lookAt(t,e,i){let s=this.elements;return t0.subVectors(t,e),0===t0.lengthSq()&&(t0.z=1),t0.normalize(),tQ.crossVectors(i,t0),0===tQ.lengthSq()&&(1===Math.abs(i.z)?t0.x+=1e-4:t0.z+=1e-4,t0.normalize(),tQ.crossVectors(i,t0)),tQ.normalize(),tK.crossVectors(t0,tQ),s[0]=tQ.x,s[4]=tK.x,s[8]=t0.x,s[1]=tQ.y,s[5]=tK.y,s[9]=t0.y,s[2]=tQ.z,s[6]=tK.z,s[10]=t0.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,n=i[0],a=i[4],o=i[8],h=i[12],l=i[1],u=i[5],c=i[9],p=i[13],d=i[2],m=i[6],y=i[10],f=i[14],g=i[3],x=i[7],b=i[11],v=i[15],M=s[0],w=s[4],S=s[8],_=s[12],A=s[1],T=s[5],C=s[9],I=s[13],z=s[2],B=s[6],k=s[10],O=s[14],P=s[3],R=s[7],F=s[11],N=s[15];return r[0]=n*M+a*A+o*z+h*P,r[4]=n*w+a*T+o*B+h*R,r[8]=n*S+a*C+o*k+h*F,r[12]=n*_+a*I+o*O+h*N,r[1]=l*M+u*A+c*z+p*P,r[5]=l*w+u*T+c*B+p*R,r[9]=l*S+u*C+c*k+p*F,r[13]=l*_+u*I+c*O+p*N,r[2]=d*M+m*A+y*z+f*P,r[6]=d*w+m*T+y*B+f*R,r[10]=d*S+m*C+y*k+f*F,r[14]=d*_+m*I+y*O+f*N,r[3]=g*M+x*A+b*z+v*P,r[7]=g*w+x*T+b*B+v*R,r[11]=g*S+x*C+b*k+v*F,r[15]=g*_+x*I+b*O+v*N,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],n=t[1],a=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],p=t[14],d=t[3],m=t[7],y=t[11],f=t[15],g=o*p-h*c,x=a*p-h*u,b=a*c-o*u,v=n*p-h*l,M=n*c-o*l,w=n*u-a*l;return e*(m*g-y*x+f*b)-i*(d*g-y*v+f*M)+s*(d*x-m*v+f*w)-r*(d*b-m*M+y*w)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,i){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],p=t[11],d=t[12],m=t[13],y=t[14],f=t[15],g=u*y*h-m*c*h+m*o*p-a*y*p-u*o*f+a*c*f,x=d*c*h-l*y*h-d*o*p+n*y*p+l*o*f-n*c*f,b=l*m*h-d*u*h+d*a*p-n*m*p-l*a*f+n*u*f,v=d*u*o-l*m*o-d*a*c+n*m*c+l*a*y-n*u*y,M=e*g+i*x+s*b+r*v;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/M;return t[0]=g*w,t[1]=(m*c*r-u*y*r-m*s*p+i*y*p+u*s*f-i*c*f)*w,t[2]=(a*y*r-m*o*r+m*s*h-i*y*h-a*s*f+i*o*f)*w,t[3]=(u*o*r-a*c*r-u*s*h+i*c*h+a*s*p-i*o*p)*w,t[4]=x*w,t[5]=(l*y*r-d*c*r+d*s*p-e*y*p-l*s*f+e*c*f)*w,t[6]=(d*o*r-n*y*r-d*s*h+e*y*h+n*s*f-e*o*f)*w,t[7]=(n*c*r-l*o*r+l*s*h-e*c*h-n*s*p+e*o*p)*w,t[8]=b*w,t[9]=(d*u*r-l*m*r-d*i*p+e*m*p+l*i*f-e*u*f)*w,t[10]=(n*m*r-d*a*r+d*i*h-e*m*h-n*i*f+e*a*f)*w,t[11]=(l*a*r-n*u*r-l*i*h+e*u*h+n*i*p-e*a*p)*w,t[12]=v*w,t[13]=(l*m*s-d*u*s+d*i*c-e*m*c-l*i*y+e*u*y)*w,t[14]=(d*a*s-n*m*s-d*i*o+e*m*o+n*i*y-e*a*y)*w,t[15]=(n*u*s-l*a*s+l*i*o-e*u*o-n*i*c+e*a*c)*w,this}scale(t){let e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.set(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,n){return this.set(1,i,r,0,t,1,n,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){let s=this.elements,r=e._x,n=e._y,a=e._z,o=e._w,h=r+r,l=n+n,u=a+a,c=r*h,p=r*l,d=r*u,m=n*l,y=n*u,f=a*u,g=o*h,x=o*l,b=o*u,v=i.x,M=i.y,w=i.z;return s[0]=(1-(m+f))*v,s[1]=(p+b)*v,s[2]=(d-x)*v,s[3]=0,s[4]=(p-b)*M,s[5]=(1-(c+f))*M,s[6]=(y+g)*M,s[7]=0,s[8]=(d+x)*w,s[9]=(y-g)*w,s[10]=(1-(c+m))*w,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){let s=this.elements;if(t.x=s[12],t.y=s[13],t.z=s[14],0===this.determinant())return i.set(1,1,1),e.identity(),this;let r=tH.set(s[0],s[1],s[2]).length(),n=tH.set(s[4],s[5],s[6]).length(),a=tH.set(s[8],s[9],s[10]).length();0>this.determinant()&&(r=-r),tY.copy(this);let o=1/r,h=1/n,l=1/a;return tY.elements[0]*=o,tY.elements[1]*=o,tY.elements[2]*=o,tY.elements[4]*=h,tY.elements[5]*=h,tY.elements[6]*=h,tY.elements[8]*=l,tY.elements[9]*=l,tY.elements[10]*=l,e.setFromRotationMatrix(tY),i.x=r,i.y=n,i.z=a,this}makePerspective(t,e,i,s,r,n,a=2e3,o=!1){let h,l,u=this.elements;if(o)h=r/(n-r),l=n*r/(n-r);else if(2e3===a)h=-(n+r)/(n-r),l=-2*n*r/(n-r);else if(2001===a)h=-n/(n-r),l=-n*r/(n-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return u[0]=2*r/(e-t),u[4]=0,u[8]=(e+t)/(e-t),u[12]=0,u[1]=0,u[5]=2*r/(i-s),u[9]=(i+s)/(i-s),u[13]=0,u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(t,e,i,s,r,n,a=2e3,o=!1){let h,l,u=this.elements;if(o)h=1/(n-r),l=n/(n-r);else if(2e3===a)h=-2/(n-r),l=-(n+r)/(n-r);else if(2001===a)h=-1/(n-r),l=-r/(n-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return u[0]=2/(e-t),u[4]=0,u[8]=0,u[12]=-(e+t)/(e-t),u[1]=0,u[5]=2/(i-s),u[9]=0,u[13]=-(i+s)/(i-s),u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}let tH=new Z,tY=new tX,tZ=new Z(0,0,0),t$=new Z(1,1,1),tQ=new Z,tK=new Z,t0=new Z,t1=new tX,t2=new Y;class t3{constructor(t=0,e=0,i=0,s=t3.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){let s=t.elements,r=s[0],n=s[4],a=s[8],o=s[1],h=s[5],l=s[9],u=s[2],c=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(j(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-n,r)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-j(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(a,p),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(j(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-j(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,p),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-n,h));break;case"YZX":this._z=Math.asin(j(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-j(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-l,p),this._y=0);break;default:O("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return t1.makeRotationFromQuaternion(t),this.setFromRotationMatrix(t1,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return t2.setFromEuler(this),this.setFromQuaternion(t2,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}t3.DEFAULT_ORDER="XYZ";class t5{constructor(){this.mask=1}set(t){this.mask=1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(t=>({...t})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(s.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let i=e.shapes;if(Array.isArray(i))for(let e=0,s=i.length;e0){s.children=[];for(let e=0;e0){s.animations=[];for(let e=0;e0&&(i.geometries=e),s.length>0&&(i.materials=s),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),h.length>0&&(i.skeletons=h),l.length>0&&(i.animations=l),u.length>0&&(i.nodes=u)}return i.object=s,i;function n(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){ec.subVectors(s,e),ep.subVectors(i,e),ed.subVectors(t,e);let n=ec.dot(ec),a=ec.dot(ep),o=ec.dot(ed),h=ep.dot(ep),l=ep.dot(ed),u=n*h-a*a;if(0===u)return r.set(0,0,0),null;let c=1/u,p=(h*o-a*l)*c,d=(n*l-a*o)*c;return r.set(1-p-d,d,p)}static containsPoint(t,e,i,s){return null!==this.getBarycoord(t,e,i,s,em)&&em.x>=0&&em.y>=0&&em.x+em.y<=1}static getInterpolation(t,e,i,s,r,n,a,o){return null===this.getBarycoord(t,e,i,s,em)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,em.x),o.addScaledVector(n,em.y),o.addScaledVector(a,em.z),o)}static getInterpolatedAttribute(t,e,i,s,r,n){return eM.setScalar(0),ew.setScalar(0),eS.setScalar(0),eM.fromBufferAttribute(t,e),ew.fromBufferAttribute(t,i),eS.fromBufferAttribute(t,s),n.setScalar(0),n.addScaledVector(eM,r.x),n.addScaledVector(ew,r.y),n.addScaledVector(eS,r.z),n}static isFrontFacing(t,e,i,s){return ec.subVectors(i,e),ep.subVectors(t,e),0>ec.cross(ep).dot(s)}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ec.subVectors(this.c,this.b),ep.subVectors(this.a,this.b),.5*ec.cross(ep).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e_.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return e_.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return e_.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return e_.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e_.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,s,r=this.a,n=this.b,a=this.c;ey.subVectors(n,r),ef.subVectors(a,r),ex.subVectors(t,r);let o=ey.dot(ex),h=ef.dot(ex);if(o<=0&&h<=0)return e.copy(r);eb.subVectors(t,n);let l=ey.dot(eb),u=ef.dot(eb);if(l>=0&&u<=l)return e.copy(n);let c=o*u-l*h;if(c<=0&&o>=0&&l<=0)return i=o/(o-l),e.copy(r).addScaledVector(ey,i);ev.subVectors(t,a);let p=ey.dot(ev),d=ef.dot(ev);if(d>=0&&p<=d)return e.copy(a);let m=p*h-o*d;if(m<=0&&h>=0&&d<=0)return s=h/(h-d),e.copy(r).addScaledVector(ef,s);let y=l*d-p*u;if(y<=0&&u-l>=0&&p-d>=0)return eg.subVectors(a,n),s=(u-l)/(u-l+(p-d)),e.copy(n).addScaledVector(eg,s);let f=1/(y+m+c);return i=m*f,s=c*f,e.copy(r).addScaledVector(ey,i).addScaledVector(ef,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let eA={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},eT={h:0,s:0,l:0},eC={h:0,s:0,l:0};function eI(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*6*(2/3-i):t}class ez{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){return void 0===e&&void 0===i?t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t):this.setRGB(t,e,i),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=m){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ts.colorSpaceToWorking(this,e),this}setRGB(t,e,i,s=ts.workingColorSpace){return this.r=t,this.g=e,this.b=i,ts.colorSpaceToWorking(this,s),this}setHSL(t,e,i,s=ts.workingColorSpace){if(t=W(t,1),e=j(e,0,1),i=j(i,0,1),0===e)this.r=this.g=this.b=i;else{let s=i<=.5?i*(1+e):i+e-i*e,r=2*i-s;this.r=eI(r,s,t+1/3),this.g=eI(r,s,t),this.b=eI(r,s,t-1/3)}return ts.colorSpaceToWorking(this,s),this}setStyle(t,e=m){let i;function s(e){void 0!==e&&1>parseFloat(e)&&O("Color: Alpha component of "+t+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,n=i[1],a=i[2];switch(n){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:O("Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],r=s.length;if(3===r)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(s,16),e);O("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=m){let i=eA[t.toLowerCase()];return void 0!==i?this.setHex(i,e):O("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=tr(t.r),this.g=tr(t.g),this.b=tr(t.b),this}copyLinearToSRGB(t){return this.r=tn(t.r),this.g=tn(t.g),this.b=tn(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=m){return ts.workingToColorSpace(eB.copy(this),t),65536*Math.round(j(255*eB.r,0,255))+256*Math.round(j(255*eB.g,0,255))+Math.round(j(255*eB.b,0,255))}getHexString(t=m){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ts.workingColorSpace){let i,s;ts.workingToColorSpace(eB.copy(this),e);let r=eB.r,n=eB.g,a=eB.b,o=Math.max(r,n,a),h=Math.min(r,n,a),l=(h+o)/2;if(h===o)i=0,s=0;else{let t=o-h;switch(s=l<=.5?t/(o+h):t/(2-o-h),o){case r:i=(n-a)/t+6*(n0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let i=t[e];if(void 0===i){O(`Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(void 0===s){O(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function s(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(i.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(i.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!1===this.allowOverride&&(i.allowOverride=!1),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){let e=s(t.textures),r=s(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,i=null;if(null!==e){let t=e.length;i=Array(t);for(let s=0;s!==t;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class eP extends eO{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ez(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 t3,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}let eR=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),s=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(s[t]=0,s[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(s[t]=1024>>-e-14,s[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(s[t]=e+15<<10,s[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(s[t]=31744,s[256|t]=64512,r[t]=24,r[256|t]=24):(s[t]=31744,s[256|t]=64512,r[t]=13,r[256|t]=13)}let n=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;(8388608&e)==0;)e<<=1,i-=8388608;e&=-8388609,i+=0x38800000,n[t]=e|i}for(let t=1024;t<2048;++t)n[t]=0x38000000+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=0x47800000,a[32]=0x80000000;for(let t=33;t<63;++t)a[t]=0x80000000+(t-32<<23);a[63]=0xc7800000;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:i,baseTable:s,shiftTable:r,mantissaTable:n,exponentTable:a,offsetTable:o}}();function eF(t){Math.abs(t)>65504&&O("DataUtils.toHalfFloat(): Value out of range."),t=j(t,-65504,65504),eR.floatView[0]=t;let e=eR.uint32View[0],i=e>>23&511;return eR.baseTable[i]+((8388607&e)>>eR.shiftTable[i])}function eN(t){let e=t>>10;return eR.uint32View[0]=eR.mantissaTable[eR.offsetTable[e]+(1023&t)]+eR.exponentTable[e],eR.floatView[0]}class eL{static toHalfFloat(t){return eF(t)}static fromHalfFloat(t){return eN(t)}}let eE=new Z,eV=new H,eD=0;class eU{constructor(t,e,i=!1){if(Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:eD++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&O("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new tv);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){P("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(Infinity,Infinity,Infinity));return}if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t0&&(t.userData=this.userData),void 0!==this.parameters){let e=this.parameters;for(let i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let e in i){let s=i[e];t.data.attributes[e]=s.toJSON(t.data)}let s={},r=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],n=[];for(let e=0,s=i.length;e0&&(s[e]=n,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let n=this.groups;n.length>0&&(t.data.groups=JSON.parse(JSON.stringify(n)));let a=this.boundingSphere;return null!==a&&(t.data.boundingSphere=a.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone());let s=t.attributes;for(let t in s){let i=s[t];this.setAttribute(t,i.clone(e))}let r=t.morphAttributes;for(let t in r){let i=[],s=r[t];for(let t=0,r=s.length;t0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t(t.far-t.near)**2)||(e4.copy(r).invert(),e6.copy(t.ray).applyMatrix4(e4),(null===i.boundingBox||!1!==e6.intersectsBox(i.boundingBox))&&this._computeIntersections(t,e,e6)))}_computeIntersections(t,e,i){let s,r=this.geometry,n=this.material,a=r.index,o=r.attributes.position,h=r.attributes.uv,l=r.attributes.uv1,u=r.attributes.normal,c=r.groups,p=r.drawRange;if(null!==a)if(Array.isArray(n))for(let r=0,o=c.length;ri.far?null:{distance:h,point:ia.clone(),object:t}}(t,e,i,s,e7,it,ie,ir);if(u){let t=new Z;e_.getBarycoord(ir,e7,it,ie,t),r&&(u.uv=e_.getInterpolatedAttribute(r,o,h,l,t,new H)),n&&(u.uv1=e_.getInterpolatedAttribute(n,o,h,l,t,new H)),a&&(u.normal=e_.getInterpolatedAttribute(a,o,h,l,t,new Z),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new Z,materialIndex:0};e_.getNormal(e7,it,ie,e.normal),u.face=e,u.barycoord=t}return u}class il extends e5{constructor(t=1,e=1,i=1,s=1,r=1,n=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:n};const a=this;s=Math.floor(s),r=Math.floor(r);const o=[],h=[],l=[],u=[];let c=0,p=0;function d(t,e,i,s,r,n,d,m,y,f,g){let x=n/y,b=d/f,v=n/2,M=d/2,w=m/2,S=y+1,_=f+1,A=0,T=0,C=new Z;for(let n=0;n<_;n++){let a=n*b-M;for(let o=0;o0?1:-1,l.push(C.x,C.y,C.z),u.push(o/y),u.push(1-n/f),A+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let i={};for(let t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class iy extends eu{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tX,this.projectionMatrix=new tX,this.projectionMatrixInverse=new tX,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let ig=new Z,ix=new H,ib=new H;class iv extends iy{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=2*D*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*V*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*D*Math.atan(Math.tan(.5*V*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){ig.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(ig.x,ig.y).multiplyScalar(-t/ig.z),ig.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ig.x,ig.y).multiplyScalar(-t/ig.z)}getViewSize(t,e){return this.getViewBounds(t,ix,ib),e.subVectors(ib,ix)}setViewOffset(t,e,i,s,r,n){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*V*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s,n=this.view;if(null!==this.view&&this.view.enabled){let t=n.fullWidth,a=n.fullHeight;r+=n.offsetX*s/t,e-=n.offsetY*i/a,s*=n.width/t,i*=n.height/a}let a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}class iM extends eu{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new iv(-90,1,t,e);s.layers=this.layers,this.add(s);const r=new iv(-90,1,t,e);r.layers=this.layers,this.add(r);const n=new iv(-90,1,t,e);n.layers=this.layers,this.add(n);const a=new iv(-90,1,t,e);a.layers=this.layers,this.add(a);const o=new iv(-90,1,t,e);o.layers=this.layers,this.add(o);const h=new iv(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,s,r,n,a,o]=e;for(let t of e)this.remove(t);if(2e3===t)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),n.up.set(0,0,1),n.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===t)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),n.up.set(0,0,-1),n.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,n,a,o,h,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;let m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,n),t.setRenderTarget(i,2,s),t.render(e,a),t.setRenderTarget(i,3,s),t.render(e,o),t.setRenderTarget(i,4,s),t.render(e,h),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class iw extends tp{constructor(t=[],e=301,i,s,r,n,a,o,h,l){super(t,e,i,s,r,n,a,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class iS extends ty{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1};this.texture=new iw([i,i,i,i,i,i]),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new il(5,5,5),r=new im({name:"CubemapFromEquirect",uniforms:iu(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;let n=new io(s,r),a=e.minFilter;return 1008===e.minFilter&&(e.minFilter=1006),new iM(1,10,this).update(t,n),e.minFilter=a,n.geometry.dispose(),n.material.dispose(),this}clear(t,e=!0,i=!0,s=!0){let r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,s);t.setRenderTarget(r)}}class i_ extends eu{constructor(){super(),this.isGroup=!0,this.type="Group"}}let iA={type:"move"};class iT{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new i_,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 i_,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new i_,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let s=null,r=null,n=null,a=this._targetRay,o=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(h&&t.hand){for(let s of(n=!0,t.hand.values())){let t=e.getJointPose(s,i),r=this._getHandJoint(h,s);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}let s=h.joints["index-finger-tip"],r=h.joints["thumb-tip"],a=s.position.distanceTo(r.position);h.inputState.pinching&&a>.025?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&a<=.015&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&null!==(r=e.getPose(t.gripSpace,i))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==a&&(null===(s=e.getPose(t.targetRaySpace,i))&&null!==r&&(s=r),null!==s&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(iA)))}return null!==a&&(a.visible=null!==s),null!==o&&(o.visible=null!==r),null!==h&&(h.visible=null!==n),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let i=new i_;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}class iC{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new ez(t),this.density=e}clone(){return new iC(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class iI{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new ez(t),this.near=e,this.far=i}clone(){return new iI(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class iz extends eu{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 t3,this.environmentIntensity=1,this.environmentRotation=new t3,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class iB{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=U()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,r=this.stride;st.far||e.push({distance:o,point:iR.clone(),uv:e_.getInterpolation(iR,iD,iU,ij,iW,iG,iq,new H),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function iX(t,e,i,s,r,n){iL.subVectors(t,i).addScalar(.5).multiply(s),void 0!==r?(iE.x=n*iL.x-r*iL.y,iE.y=r*iL.x+n*iL.y):iE.copy(iL),t.copy(e),t.x+=iE.x,t.y+=iE.y,t.applyMatrix4(iV)}let iH=new Z,iY=new Z;class iZ extends eu{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);let e=t.levels;for(let t=0,i=e.length;t0){let i,s;for(i=1,s=e.length;i0){iH.setFromMatrixPosition(this.matrixWorld);let i=t.ray.origin.distanceTo(iH);this.getObjectForDistance(i).raycast(t,e)}}update(t){let e=this.levels;if(e.length>1){let i,s;iH.setFromMatrixPosition(t.matrixWorld),iY.setFromMatrixPosition(this.matrixWorld);let r=iH.distanceTo(iY)/t.zoom;for(i=1,e[0].object.visible=!0,s=e.length;i=t)e[i-1].object.visible=!1,e[i].object.visible=!0;else break}for(this._currentLevel=i-1;i1?null:e.copy(t.start).addScaledVector(i,r)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let i=e||sd.getNormalMatrix(t),s=this.coplanarPoint(sc).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}let sy=new tE,sf=new H(.5,.5),sg=new Z;class sx{constructor(t=new sm,e=new sm,i=new sm,s=new sm,r=new sm,n=new sm){this.planes=[t,e,i,s,r,n]}set(t,e,i,s,r,n){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(n),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=2e3,i=!1){let s=this.planes,r=t.elements,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],p=r[7],d=r[8],m=r[9],y=r[10],f=r[11],g=r[12],x=r[13],b=r[14],v=r[15];if(s[0].setComponents(h-n,p-l,f-d,v-g).normalize(),s[1].setComponents(h+n,p+l,f+d,v+g).normalize(),s[2].setComponents(h+a,p+u,f+m,v+x).normalize(),s[3].setComponents(h-a,p-u,f-m,v-x).normalize(),i)s[4].setComponents(o,c,y,b).normalize(),s[5].setComponents(h-o,p-c,f-y,v-b).normalize();else if(s[4].setComponents(h-o,p-c,f-y,v-b).normalize(),2e3===e)s[5].setComponents(h+o,p+c,f+y,v+b).normalize();else if(2001===e)s[5].setComponents(o,c,y,b).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),sy.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),sy.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(sy)}intersectsSprite(t){return sy.center.set(0,0,0),sy.radius=.7071067811865476+sf.distanceTo(t.center),sy.applyMatrix4(t.matrixWorld),this.intersectsSphere(sy)}intersectsSphere(t){let e=this.planes,i=t.center,s=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)0?t.max.x:t.min.x,sg.y=s.normal.y>0?t.max.y:t.min.y,sg.z=s.normal.z>0?t.max.z:t.min.z,0>s.distanceToPoint(sg))return!1}return!0}containsPoint(t){let e=this.planes;for(let i=0;i<6;i++)if(0>e[i].distanceToPoint(t))return!1;return!0}clone(){return new this.constructor().copy(this)}}let sb=new tX,sv=new sx;class sM{constructor(){this.coordinateSystem=2e3}intersectsObject(t,e){if(!e.isArrayCamera||0===e.cameras.length)return!1;for(let i=0;i=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});let a=r[this.index];n.push(a),this.index++,a.start=t,a.count=e,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}},sF=new io,sN=[];function sL(t,e){if(t.constructor!==e.constructor){let i=Math.min(t.length,e.length);for(let s=0;s65535?new Uint32Array(s):new Uint16Array(s);e.setIndex(new eU(t,1))}this._geometryInitialized=!0}}_validateGeometry(t){let e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let i in e.attributes){if(!t.hasAttribute(i))throw Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);let s=t.getAttribute(i),r=e.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){let e=this._instanceInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){let e=this._geometryInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new tv);let t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let i=0,s=e.length;i=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let e={visible:!0,active:!0,geometryIndex:t},i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(sw),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=e):(i=this._instanceInfo.length,this._instanceInfo.push(e));let s=this._matricesTexture;sA.identity().toArray(s.image.data,16*i),s.needsUpdate=!0;let r=this._colorsTexture;return r&&(sT.toArray(r.image.data,4*i),r.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(t,e=-1,i=-1){let s;this._initializeGeometry(t),this._validateGeometry(t);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},n=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=-1===e?t.getAttribute("position").count:e;let a=t.getIndex();if(null!==a&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=-1===i?a.count:i),-1!==r.indexStart&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(sw),n[s=this._availableGeometryIds.shift()]=r):(s=this._geometryCount,this._geometryCount++,n.push(r)),this.setGeometryAt(s,t),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,s}setGeometryAt(t,e){if(t>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);let i=this.geometry,s=null!==i.getIndex(),r=i.getIndex(),n=e.getIndex(),a=this._geometryInfo[t];if(s&&n.count>a.reservedIndexCount||e.attributes.position.count>a.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=a.vertexStart,h=a.reservedVertexCount;for(let t in a.vertexCount=e.getAttribute("position").count,i.attributes){let s=e.getAttribute(t),r=i.getAttribute(t);!function(t,e,i=0){let s=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){let r=t.count;for(let n=0;n=e.length||!1===e[t].active)return this;let i=this._instanceInfo;for(let e=0,s=i.length;ee).sort((t,e)=>i[t].vertexStart-i[e].vertexStart),r=this.geometry;for(let n=0,a=i.length;n=this._geometryCount)return null;let i=this.geometry,s=this._geometryInfo[t];if(null===s.boundingBox){let t=new tv,e=i.index,r=i.attributes.position;for(let i=s.start,n=s.start+s.count;i=this._geometryCount)return null;let i=this.geometry,s=this._geometryInfo[t];if(null===s.boundingSphere){let e=new tE;this.getBoundingBoxAt(t,sz),sz.getCenter(e.center);let r=i.index,n=i.attributes.position,a=0;for(let t=s.start,i=s.start+s.count;tt.active);if(Math.max(...i.map(t=>t.vertexStart+t.reservedVertexCount))>t)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(t=>t.indexStart+t.reservedIndexCount))>e)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);let s=this.geometry;s.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new e5,this._initializeGeometry(s));let r=this.geometry;for(let t in s.index&&sL(s.index.array,r.index.array),s.attributes)sL(s.attributes[t].array,r.attributes[t].array)}raycast(t,e){let i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,n=this.geometry;sF.material=this.material,sF.geometry.index=n.index,sF.geometry.attributes=n.attributes,null===sF.geometry.boundingBox&&(sF.geometry.boundingBox=new tv),null===sF.geometry.boundingSphere&&(sF.geometry.boundingSphere=new tE);for(let n=0,a=i.length;n({...t,boundingBox:null!==t.boundingBox?t.boundingBox.clone():null,boundingSphere:null!==t.boundingSphere?t.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(t=>({...t})),this._availableInstanceIds=t._availableInstanceIds.slice(),this._availableGeometryIds=t._availableGeometryIds.slice(),this._nextIndexStart=t._nextIndexStart,this._nextVertexStart=t._nextVertexStart,this._geometryCount=t._geometryCount,this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._indirectTexture=t._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=t._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(t,e,i,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let n=s.getIndex(),a=null===n?1:n.array.BYTES_PER_ELEMENT,o=this._instanceInfo,h=this._multiDrawStarts,l=this._multiDrawCounts,u=this._geometryInfo,c=this.perObjectFrustumCulled,p=this._indirectTexture,d=p.image.data,m=i.isArrayCamera?sI:sC;c&&!i.isArrayCamera&&(sA.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),sC.setFromProjectionMatrix(sA,i.coordinateSystem,i.reversedDepth));let y=0;if(this.sortObjects){sA.copy(this.matrixWorld).invert(),sk.setFromMatrixPosition(i.matrixWorld).applyMatrix4(sA),sO.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(sA);for(let t=0,e=o.length;t0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;ts)return;sq.applyMatrix4(t.matrixWorld);let h=e.ray.origin.distanceTo(sq);if(!(he.far))return{distance:h,point:sJ.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}let sY=new Z,sZ=new Z;class s$ extends sX{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[];for(let t=0,s=e.count;t0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;tr.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:i,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class s6 extends tp{constructor(t,e,i,s,r=1006,n=1006,a,o,h){super(t,e,i,s,r,n,a,o,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const l=this;"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class s8 extends s6{constructor(t,e,i,s,r,n,a,o){super({},t,e,i,s,r,n,a,o),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(t){this.image=t,this.needsUpdate=!0}}class s9 extends tp{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}class s7 extends tp{constructor(t,e,i,s,r,n,a,o,h,l,u,c){super(null,n,a,o,h,l,s,r,u,c),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class rt extends s7{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=1001,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class re extends s7{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class ri extends tp{constructor(t,e,i,s,r,n,a,o,h){super(t,e,i,s,r,n,a,o,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class rs extends tp{constructor(t,e,i=1014,s,r,n,a=1003,o=1003,h,l=1026,u=1){if(1026!==l&&1027!==l)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},s,r,n,a,o,l,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new th(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class rr extends rs{constructor(t,e=1014,i=301,s,r,n=1003,a=1003,o,h=1026){const l={width:t,height:t,depth:1};super(t,t,e,i,s,r,n,a,o,h),this.image=[l,l,l,l,l,l],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class rn extends tp{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class ra extends e5{constructor(t=1,e=1,i=4,s=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:t,height:e,capSegments:i,radialSegments:s,heightSegments:r},e=Math.max(0,e),i=Math.max(1,Math.floor(i)),s=Math.max(3,Math.floor(s));const n=[],a=[],o=[],h=[],l=e/2,u=Math.PI/2*t,c=e,p=2*u+c,d=2*i+(r=Math.max(1,Math.floor(r))),m=s+1,y=new Z,f=new Z;for(let g=0;g<=d;g++){let x=0,b=0,v=0,M=0;if(g<=i){const e=g/i,s=e*Math.PI/2;b=-l-t*Math.cos(s),v=t*Math.sin(s),M=-t*Math.cos(s),x=e*u}else if(g<=i+r){const s=(g-i)/r;b=-l+s*e,v=t,M=0,x=u+s*c}else{const e=(g-i-r)/i,s=e*Math.PI/2;b=l+t*Math.sin(s),v=t*Math.cos(s),M=t*Math.sin(s),x=u+c+e*u}const w=Math.max(0,Math.min(1,x/p));let S=0;0===g?S=.5/s:g===d&&(S=-.5/s);for(let t=0;t<=s;t++){const e=t/s,i=e*Math.PI*2,r=Math.sin(i),n=Math.cos(i);f.x=-v*n,f.y=b,f.z=v*r,a.push(f.x,f.y,f.z),y.set(-v*n,M,v*r),y.normalize(),o.push(y.x,y.y,y.z),h.push(e+S,w)}if(g>0){const t=(g-1)*m;for(let e=0;e0||0!==s)&&(l.push(n,a,h),x+=3),(e>0||s!==r-1)&&(l.push(a,o,h),x+=3)}h.addGroup(f,x,0),f+=x})(),!1===n&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new eZ(u,3)),this.setAttribute("normal",new eZ(c,3)),this.setAttribute("uv",new eZ(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new rh(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class rl extends rh{constructor(t=1,e=1,i=32,s=1,r=!1,n=0,a=2*Math.PI){super(0,t,e,i,s,r,n,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:s,openEnded:r,thetaStart:n,thetaLength:a}}static fromJSON(t){return new rl(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ru extends e5{constructor(t=[],e=[],i=1,s=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:s};const r=[],n=[];function a(t){r.push(t.x,t.y,t.z)}function o(e,i){let s=3*e;i.x=t[s+0],i.y=t[s+1],i.z=t[s+2]}function h(t,e,i,s){s<0&&1===t.x&&(n[e]=t.x-1),0===i.x&&0===i.z&&(n[e]=s/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}(function(t){let i=new Z,s=new Z,r=new Z;for(let n=0;n.9&&a<.1&&(e<.2&&(n[t+0]+=1),i<.2&&(n[t+2]+=1),s<.2&&(n[t+4]+=1))}}()}(),this.setAttribute("position",new eZ(r,3)),this.setAttribute("normal",new eZ(r.slice(),3)),this.setAttribute("uv",new eZ(n,2)),0===s?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ru(t.vertices,t.indices,t.radius,t.detail)}}class rc extends ru{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,s=1/i;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,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],[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],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new rc(t.radius,t.detail)}}let rp=new Z,rd=new Z,rm=new Z,ry=new e_;class rf extends e5{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const i=Math.cos(V*e),s=t.getIndex(),r=t.getAttribute("position"),n=s?s.count:r.count,a=[0,0,0],o=["a","b","c"],h=[,,,],l={},u=[];for(let t=0;t0)o=r-1;else{o=r;break}if(s[r=o]===i)return r/(n-1);let l=s[r],u=s[r+1];return(r+(i-l)/(u-l))/(n-1)}getTangent(t,e){let i=t-1e-4,s=t+1e-4;i<0&&(i=0),s>1&&(s=1);let r=this.getPoint(i),n=this.getPoint(s),a=e||(r.isVector2?new H:new Z);return a.copy(n).sub(r).normalize(),a}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){let i=new Z,s=[],r=[],n=[],a=new Z,o=new tX;for(let e=0;e<=t;e++){let i=e/t;s[e]=this.getTangentAt(i,new Z)}r[0]=new Z,n[0]=new Z;let h=Number.MAX_VALUE,l=Math.abs(s[0].x),u=Math.abs(s[0].y),c=Math.abs(s[0].z);l<=h&&(h=l,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),c<=h&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),n[0].crossVectors(s[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),n[e]=n[e-1].clone(),a.crossVectors(s[e-1],s[e]),a.length()>Number.EPSILON){a.normalize();let t=Math.acos(j(s[e-1].dot(s[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}n[e].crossVectors(s[e],r[e])}if(!0===e){let e=Math.acos(j(r[0].dot(r[t]),-1,1));e/=t,s[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(o.makeRotationAxis(s[i],e*i)),n[i].crossVectors(s[i],r[i])}return{tangents:s,normals:r,binormals:n}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class rx extends rg{constructor(t=0,e=0,i=1,s=1,r=0,n=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=n,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new H){let i=2*Math.PI,s=this.aEndAngle-this.aStartAngle,r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(o)/n)+1)*n:0===h&&o===n-1&&(o=n-2,h=1),this.closed||o>0?i=r[(o-1)%n]:(rM.subVectors(r[0],r[1]).add(r[0]),i=rM);let l=r[o%n],u=r[(o+1)%n];if(this.closed||o+2i.length-2?i.length-1:r+1],l=i[r>i.length-3?i.length-1:r+2];return e.set(rT(n,a.x,o.x,h.x,l.x),rT(n,a.y,o.y,h.y,l.y)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){let t=s[r]-i,n=this.curves[r],a=n.getLength(),o=0===a?0:1-t/a;return n.getPointAt(o,e)}r++}return null}getLength(){let t=this.getCurveLengths();return t[t.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 t=[],e=0;for(let i=0,s=this.curves.length;i1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){let t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);let l=h.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class rV extends rE{constructor(t){super(t),this.uuid=U(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,s=this.holes.length;i0)for(let r=e;r=e;r-=s)n=rK(r/s|0,t[r],t[r+1],n);return n&&rX(n,n.next)&&(r0(n),n=n.next),n}function rU(t,e){if(!t)return t;e||(e=t);let i=t,s;do if(s=!1,!i.steiner&&(rX(i,i.next)||0===rJ(i.prev,i,i.next))){if(r0(i),(i=e=i.prev)===i.next)break;s=!0}else i=i.next;while(s||i!==e)return e}function rj(t,e){let i=t.x-e.x;return 0===i&&0==(i=t.y-e.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function rW(t,e,i,s,r){return(t=((t=((t=((t=((t=(t-i)*r|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(e=((e=((e=((e=((e=(e-s)*r|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)<<1}function rG(t,e,i,s,r,n,a,o){return(r-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(s-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(r-a)*(s-o)}function rq(t,e,i,s,r,n,a,o){return(t!==a||e!==o)&&rG(t,e,i,s,r,n,a,o)}function rJ(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function rX(t,e){return t.x===e.x&&t.y===e.y}function rH(t,e,i,s){let r=rZ(rJ(t,e,i)),n=rZ(rJ(t,e,s)),a=rZ(rJ(i,s,t)),o=rZ(rJ(i,s,e));return!!(r!==n&&a!==o||0===r&&rY(t,i,e)||0===n&&rY(t,s,e)||0===a&&rY(i,t,s)||0===o&&rY(i,e,s))}function rY(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function rZ(t){return t>0?1:t<0?-1:0}function r$(t,e){return 0>rJ(t.prev,t,t.next)?rJ(t,e,t.next)>=0&&rJ(t,t.prev,e)>=0:0>rJ(t,e,t.prev)||0>rJ(t,t.next,e)}function rQ(t,e){let i=r1(t.i,t.x,t.y),s=r1(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function rK(t,e,i,s){let r=r1(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function r0(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function r1(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class r2{static triangulate(t,e,i=2){return function(t,e,i=2){let s,r,n,a=e&&e.length,o=a?e[0]*i:t.length,h=rD(t,0,o,i,!0),l=[];if(!h||h.next===h.prev)return l;if(a&&(h=function(t,e,i,s){let r=[];for(let i=0,n=e.length;i=s.next.y&&s.next.y!==s.y){let t=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(t<=r&&t>a&&(a=t,i=s.x=s.x&&s.x>=h&&r!==s.x&&rG(ni.x||s.x===i.x&&(c=i,p=s,0>rJ(c.prev,c,p.prev)&&0>rJ(p.next,c,c.next))))&&(i=s,u=e)}s=s.next}while(s!==o)return i}(t,e);if(!i)return e;let s=rQ(i,t);return rU(s,s.next),rU(i,i.next)}(r[t],i);return i}(t,e,h,i)),t.length>80*i){s=t[0],r=t[1];let e=s,a=r;for(let n=i;ne&&(e=i),o>a&&(a=o)}n=0!==(n=Math.max(e-s,a-r))?32767/n:0}return function t(e,i,s,r,n,a,o){if(!e)return;!o&&a&&function(t,e,i,s){let r=t;do 0===r.z&&(r.z=rW(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t)r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i=1;do{let s,r=t;t=null;let n=null;for(e=0;r;){e++;let a=r,o=0;for(let t=0;t0||h>0&&a;)0!==o&&(0===h||!a||r.z<=a.z)?(s=r,r=r.nextZ,o--):(s=a,a=a.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;r=a}n.nextZ=null,i*=2}while(e>1)}(r)}(e,r,n,a);let h=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(a?function(t,e,i,s){let r=t.prev,n=t.next;if(rJ(r,t,n)>=0)return!1;let a=r.x,o=t.x,h=n.x,l=r.y,u=t.y,c=n.y,p=Math.min(a,o,h),d=Math.min(l,u,c),m=Math.max(a,o,h),y=Math.max(l,u,c),f=rW(p,d,e,i,s),g=rW(m,y,e,i,s),x=t.prevZ,b=t.nextZ;for(;x&&x.z>=f&&b&&b.z<=g;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=y&&x!==r&&x!==n&&rq(a,l,o,u,h,c,x.x,x.y)&&rJ(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=p&&b.x<=m&&b.y>=d&&b.y<=y&&b!==r&&b!==n&&rq(a,l,o,u,h,c,b.x,b.y)&&rJ(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=f;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=y&&x!==r&&x!==n&&rq(a,l,o,u,h,c,x.x,x.y)&&rJ(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=g;){if(b.x>=p&&b.x<=m&&b.y>=d&&b.y<=y&&b!==r&&b!==n&&rq(a,l,o,u,h,c,b.x,b.y)&&rJ(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}(e,r,n,a):function(t){let e=t.prev,i=t.next;if(rJ(e,t,i)>=0)return!1;let s=e.x,r=t.x,n=i.x,a=e.y,o=t.y,h=i.y,l=Math.min(s,r,n),u=Math.min(a,o,h),c=Math.max(s,r,n),p=Math.max(a,o,h),d=i.next;for(;d!==e;){if(d.x>=l&&d.x<=c&&d.y>=u&&d.y<=p&&rq(s,a,r,o,n,h,d.x,d.y)&&rJ(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}(e)){i.push(l.i,e.i,u.i),r0(e),e=u.next,h=u.next;continue}if((e=u)===h){o?1===o?t(e=function(t,e){let i=t;do{let s=i.prev,r=i.next.next;!rX(s,r)&&rH(s,i,i.next,r)&&r$(s,r)&&r$(r,s)&&(e.push(s.i,i.i,r.i),r0(i),r0(i.next),i=t=r),i=i.next}while(i!==t)return rU(i)}(rU(e),i),i,s,r,n,a,2):2===o&&function(e,i,s,r,n,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var h,l;if(o.i!==e.i&&(h=o,l=e,h.next.i!==l.i&&h.prev.i!==l.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&rH(i,i.next,t,e))return!0;i=i.next}while(i!==t)return!1}(h,l)&&(r$(h,l)&&r$(l,h)&&function(t,e){let i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next;while(i!==t)return s}(h,l)&&(rJ(h.prev,h,l.prev)||rJ(h,l.prev,l))||rX(h,l)&&rJ(h.prev,h,h.next)>0&&rJ(l.prev,l,l.next)>0))){let h=rQ(o,e);o=rU(o,o.next),h=rU(h,h.next),t(o,i,s,r,n,a,0),t(h,i,s,r,n,a,0);return}e=e.next}o=o.next}while(o!==e)}(e,i,s,r,n,a):t(rU(e),i,s,r,n,a,1);break}}}(h,l,i,s,r,n,0),l}(t,e,i)}}class r3{static area(t){let e=t.length,i=0;for(let s=e-1,r=0;rr3.area(t)}static triangulateShape(t,e){let i=[],s=[],r=[];r5(t),r4(i,t);let n=t.length;e.forEach(r5);for(let t=0;t2&&t[e-1].equals(t[0])&&t.pop()}function r4(t,e){for(let i=0;iNumber.EPSILON){let c=Math.sqrt(u),p=Math.sqrt(h*h+l*l),d=e.x-o/c,m=e.y+a/c,y=((i.x-l/p-d)*l-(i.y+h/p-m)*h)/(a*l-o*h),f=(s=d+a*y-t.x)*s+(r=m+o*y-t.y)*r;if(f<=2)return new H(s,r);n=Math.sqrt(f/2)}else{let t=!1;a>Number.EPSILON?h>Number.EPSILON&&(t=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(l)&&(t=!0),t?(s=-o,r=a,n=Math.sqrt(u)):(s=a,r=o,n=Math.sqrt(u/2))}return new H(s/n,r/n)}let O=[];for(let t=0,e=I.length,i=e-1,s=t+1;t=0;t--){let e=t/x,i=y*Math.cos(e*Math.PI/2),s=f*Math.sin(e*Math.PI/2)+g;for(let t=0,e=I.length;t=0;){let n=r,a=r-1;a<0&&(a=t.length-1);for(let t=0,r=p+2*x;t0)&&p.push(e,r,h),(t!==i-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class nf extends eO{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ez(0xffffff),this.specular=new ez(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ez(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new t3,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ng extends eO{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ez(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ez(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class nx extends eO{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class nb extends eO{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ez(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ez(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new t3,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nv extends eO{constructor(t){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(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class nM extends eO{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class nw extends eO{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ez(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(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(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nS extends sV{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function n_(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function nA(t){let e=t.length,i=Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}function nT(t,e,i){let s=t.length,r=new t.constructor(s);for(let n=0,a=0;a!==s;++n){let s=i[n]*e;for(let i=0;i!==e;++i)r[a++]=t[s+i]}return r}function nC(t,e,i,s){let r=1,n=t[0];for(;void 0!==n&&void 0===n[s];)n=t[r++];if(void 0===n)return;let a=n[s];if(void 0!==a)if(Array.isArray(a))do void 0!==(a=n[s])&&(e.push(n.time),i.push(...a)),n=t[r++];while(void 0!==n)else if(void 0!==a.toArray)do void 0!==(a=n[s])&&(e.push(n.time),a.toArray(i,i.length)),n=t[r++];while(void 0!==n)else do void 0!==(a=n[s])&&(e.push(n.time),i.push(a)),n=t[r++];while(void 0!==n)}class nI{static convertArray(t,e){return n_(t,e)}static isTypedArray(t){return _(t)}static getKeyframeOrder(t){return nA(t)}static sortedArray(t,e,i){return nT(t,e,i)}static flattenJSON(t,e,i,s){nC(t,e,i,s)}static subclip(t,e,i,s,r=30){return function(t,e,i,s,r=30){let n=t.clone();n.name=e;let a=[];for(let t=0;t=s)){h.push(e.times[t]);for(let i=0;in.tracks[t].times[0]&&(o=n.tracks[t].times[0]);for(let t=0;t=r.times[p]){let t=p*l+h,e=t+l-h;s=r.values.slice(t,e)}else{let t=r.createInterpolant(),e=h,i=l-h;t.evaluate(n),s=t.resultBuffer.slice(e,i)}"quaternion"===a&&new Y().fromArray(s).normalize().conjugate().toArray(s);let d=o.times.length;for(let t=0;t=r)){let a=e[1];t=(r=e[--i-1]))break e}n=i,i=0;break i}break t}for(;i>>1;te;)--n;if(++n,0!==r||n!==s){r>=n&&(r=(n=Math.max(n,1))-1);let t=this.getValueSize();this.times=i.slice(r,n),this.values=this.values.slice(r*t,n*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(P("KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,s=this.values,r=i.length;0===r&&(P("KeyframeTrack: Track is empty.",this),t=!1);let n=null;for(let e=0;e!==r;e++){let s=i[e];if("number"==typeof s&&isNaN(s)){P("KeyframeTrack: Time is not a valid number.",this,e,s),t=!1;break}if(null!==n&&n>s){P("KeyframeTrack: Out of order keys.",this,e,s,n),t=!1;break}n=s}if(void 0!==s&&_(s))for(let e=0,i=s.length;e!==i;++e){let i=s[e];if(isNaN(i)){P("KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=2302===this.getInterpolation(),r=t.length-1,n=1;for(let a=1;a0){t[n]=t[r];for(let t=r*i,s=n*i,a=0;a!==i;++a)e[s+a]=e[t+a];++n}return n!==t.length?(this.times=t.slice(0,n),this.values=e.slice(0,n*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}nP.prototype.ValueTypeName="",nP.prototype.TimeBufferType=Float32Array,nP.prototype.ValueBufferType=Float32Array,nP.prototype.DefaultInterpolation=2301;class nR extends nP{constructor(t,e,i){super(t,e,i)}}nR.prototype.ValueTypeName="bool",nR.prototype.ValueBufferType=Array,nR.prototype.DefaultInterpolation=2300,nR.prototype.InterpolantFactoryMethodLinear=void 0,nR.prototype.InterpolantFactoryMethodSmooth=void 0;class nF extends nP{constructor(t,e,i,s){super(t,e,i,s)}}nF.prototype.ValueTypeName="color";class nN extends nP{constructor(t,e,i,s){super(t,e,i,s)}}nN.prototype.ValueTypeName="number";class nL extends nz{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let r=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=(i-e)/(s-e),h=t*a;for(let t=h+a;h!==t;h+=4)Y.slerpFlat(r,0,n,h-a,n,h,o);return r}}class nE extends nP{constructor(t,e,i,s){super(t,e,i,s)}InterpolantFactoryMethodLinear(t){return new nL(this.times,this.values,this.getValueSize(),t)}}nE.prototype.ValueTypeName="quaternion",nE.prototype.InterpolantFactoryMethodSmooth=void 0;class nV extends nP{constructor(t,e,i){super(t,e,i)}}nV.prototype.ValueTypeName="string",nV.prototype.ValueBufferType=Array,nV.prototype.DefaultInterpolation=2300,nV.prototype.InterpolantFactoryMethodLinear=void 0,nV.prototype.InterpolantFactoryMethodSmooth=void 0;class nD extends nP{constructor(t,e,i,s){super(t,e,i,s)}}nD.prototype.ValueTypeName="vector";class nU{constructor(t="",e=-1,i=[],s=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=s,this.uuid=U(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],i=t.tracks,s=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push((function(t){if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return nN;case"vector":case"vector2":case"vector3":case"vector4":return nD;case"color":return nF;case"quaternion":return nE;case"bool":case"boolean":return nR;case"string":return nV}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],i=[];nC(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)})(i[t]).scale(s));let r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r.userData=JSON.parse(t.userData||"{}"),r}static toJSON(t){let e=[],i=t.tracks,s={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let t=0,s=i.length;t!==s;++t)e.push(nP.toJSON(i[t]));return s}static CreateFromMorphTargetSequence(t,e,i,s){let r=e.length,n=[];for(let t=0;t1){let t=n[1],e=s[t];e||(s[t]=e=[]),e.push(i)}}let n=[];for(let t in s)n.push(this.CreateFromMorphTargetSequence(t,s[t],e,i));return n}static parseAnimation(t,e){if(O("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!t)return P("AnimationClip: No animation in JSONLoader data."),null;let i=function(t,e,i,s,r){if(0!==i.length){let n=[],a=[];nC(i,n,a,s),0!==n.length&&r.push(new t(e,n,a))}},s=[],r=t.name||"default",n=t.fps||30,a=t.blendMode,o=t.length||-1,h=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==nJ[t])return void nJ[t].push({onLoad:e,onProgress:i,onError:s});nJ[t]=[],nJ[t].push({onLoad:e,onProgress:i,onError:s});let n=new Request(t,{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}),a=this.mimeType,o=this.responseType;fetch(n).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&O("FileLoader: HTTP Status 0 received."),"u"{if(s)t.close();else{let s=new ProgressEvent("progress",{lengthComputable:a,loaded:o+=r.byteLength,total:n});for(let t=0,e=i.length;t{t.error(e)})}()}}))}throw new nX(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>new DOMParser().parseFromString(t,a));case"json":return t.json();default:if(""===a)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(a),i=new TextDecoder(e&&e[1]?e[1].toLowerCase():void 0);return t.arrayBuffer().then(t=>i.decode(t))}}}).then(e=>{nj.add(`file:${t}`,e);let i=nJ[t];delete nJ[t];for(let t=0,s=i.length;t{let i=nJ[t];if(void 0===i)throw this.manager.itemError(t),e;delete nJ[t];for(let t=0,s=i.length;t{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class nY extends nq{constructor(t){super(t)}load(t,e,i,s){let r=this,n=new nH(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,function(i){try{e(r.parse(JSON.parse(i)))}catch(e){s?s(e):P(e),r.manager.itemError(t)}},i,s)}parse(t){let e=[];for(let i=0;i0:s.vertexColors=t.vertexColors),void 0!==t.uniforms)for(let e in t.uniforms){let r=t.uniforms[e];switch(s.uniforms[e]={},r.type){case"t":s.uniforms[e].value=i(r.value);break;case"c":s.uniforms[e].value=new ez().setHex(r.value);break;case"v2":s.uniforms[e].value=new H().fromArray(r.value);break;case"v3":s.uniforms[e].value=new Z().fromArray(r.value);break;case"v4":s.uniforms[e].value=new td().fromArray(r.value);break;case"m3":s.uniforms[e].value=new K().fromArray(r.value);break;case"m4":s.uniforms[e].value=new tX().fromArray(r.value);break;default:s.uniforms[e].value=r.value}}if(void 0!==t.defines&&(s.defines=t.defines),void 0!==t.vertexShader&&(s.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(s.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(s.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)s.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(s.lights=t.lights),void 0!==t.clipping&&(s.clipping=t.clipping),void 0!==t.size&&(s.size=t.size),void 0!==t.sizeAttenuation&&(s.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(s.map=i(t.map)),void 0!==t.matcap&&(s.matcap=i(t.matcap)),void 0!==t.alphaMap&&(s.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(s.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(s.bumpScale=t.bumpScale),void 0!==t.normalMap&&(s.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(s.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),s.normalScale=new H().fromArray(e)}return void 0!==t.displacementMap&&(s.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(s.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(s.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(s.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(s.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(s.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(s.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(s.specularMap=i(t.specularMap)),void 0!==t.specularIntensityMap&&(s.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularColorMap&&(s.specularColorMap=i(t.specularColorMap)),void 0!==t.envMap&&(s.envMap=i(t.envMap)),void 0!==t.envMapRotation&&s.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(s.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(s.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(s.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(s.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(s.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(s.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(s.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(s.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(s.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(s.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(s.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(s.clearcoatNormalScale=new H().fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(s.iridescenceMap=i(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(s.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(s.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(s.thicknessMap=i(t.thicknessMap)),void 0!==t.anisotropyMap&&(s.anisotropyMap=i(t.anisotropyMap)),void 0!==t.sheenColorMap&&(s.sheenColorMap=i(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(s.sheenRoughnessMap=i(t.sheenRoughnessMap)),s}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return al.createMaterialFromType(t)}static createMaterialFromType(t){return new({ShadowMaterial:np,SpriteMaterial:iP,RawShaderMaterial:nd,ShaderMaterial:im,PointsMaterial:sK,MeshPhysicalMaterial:ny,MeshStandardMaterial:nm,MeshPhongMaterial:nf,MeshToonMaterial:ng,MeshNormalMaterial:nx,MeshLambertMaterial:nb,MeshDepthMaterial:nv,MeshDistanceMaterial:nM,MeshBasicMaterial:eP,MeshMatcapMaterial:nw,LineDashedMaterial:nS,LineBasicMaterial:sV,Material:eO})[t]}}class au{static extractUrlBase(t){let e=t.lastIndexOf("/");return -1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t))?t:e+t}}class ac extends e5{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class ap extends nq{constructor(t){super(t)}load(t,e,i,s){let r=this,n=new nH(r.manager);n.setPath(r.path),n.setRequestHeader(r.requestHeader),n.setWithCredentials(r.withCredentials),n.load(t,function(i){try{e(r.parse(JSON.parse(i)))}catch(e){s?s(e):P(e),r.manager.itemError(t)}},i,s)}parse(t){let e={},i={};function s(t,s){if(void 0!==e[s])return e[s];let r=t.interleavedBuffers[s],n=function(t,e){if(void 0!==i[e])return i[e];let s=new Uint32Array(t.arrayBuffers[e]).buffer;return i[e]=s,s}(t,r.buffer),a=new iB(S(r.type,n),r.stride);return a.uuid=r.uuid,e[s]=a,a}let r=t.isInstancedBufferGeometry?new ac:new e5,n=t.data.index;if(void 0!==n){let t=S(n.type,n.array);r.setIndex(new eU(t,1))}let a=t.data.attributes;for(let e in a){let i,n=a[e];if(n.isInterleavedBufferAttribute)i=new iO(s(t.data,n.data),n.itemSize,n.offset,n.normalized);else{let t=S(n.type,n.array);i=new(n.isInstancedBufferAttribute?si:eU)(t,n.itemSize,n.normalized)}void 0!==n.name&&(i.name=n.name),void 0!==n.usage&&i.setUsage(n.usage),r.setAttribute(e,i)}let o=t.data.morphAttributes;if(o)for(let e in o){let i=o[e],n=[];for(let e=0,r=i.length;e0){(i=new nQ(new nW(e))).setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e0){(e=new nQ(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e{let e=null,i=null;return void 0!==t.boundingBox&&(e=new tv().fromJSON(t.boundingBox)),void 0!==t.boundingSphere&&(i=new tE().fromJSON(t.boundingSphere)),{...t,boundingBox:e,boundingSphere:i}}),n._instanceInfo=t.instanceInfo,n._availableInstanceIds=t._availableInstanceIds,n._availableGeometryIds=t._availableGeometryIds,n._nextIndexStart=t.nextIndexStart,n._nextVertexStart=t.nextVertexStart,n._geometryCount=t.geometryCount,n._maxInstanceCount=t.maxInstanceCount,n._maxVertexCount=t.maxVertexCount,n._maxIndexCount=t.maxIndexCount,n._geometryInitialized=t.geometryInitialized,n._matricesTexture=u(t.matricesTexture.uuid),n._indirectTexture=u(t.indirectTexture.uuid),void 0!==t.colorsTexture&&(n._colorsTexture=u(t.colorsTexture.uuid)),void 0!==t.boundingSphere&&(n.boundingSphere=new tE().fromJSON(t.boundingSphere)),void 0!==t.boundingBox&&(n.boundingBox=new tv().fromJSON(t.boundingBox));break;case"LOD":n=new iZ;break;case"Line":n=new sX(h(t.geometry),l(t.material));break;case"LineLoop":n=new sQ(h(t.geometry),l(t.material));break;case"LineSegments":n=new s$(h(t.geometry),l(t.material));break;case"PointCloud":case"Points":n=new s5(h(t.geometry),l(t.material));break;case"Sprite":n=new iJ(l(t.material));break;case"Group":n=new i_;break;case"Bone":n=new i8;break;default:n=new eu}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.up&&n.up.fromArray(t.up),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.intensity&&(n.shadow.intensity=t.shadow.intensity),void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(n.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children){let a=t.children;for(let t=0;t{if(!0!==ag.has(n))return e&&e(i),r.manager.itemEnd(t),i;s&&s(ag.get(n)),r.manager.itemError(t),r.manager.itemEnd(t)}):(setTimeout(function(){e&&e(n),r.manager.itemEnd(t)},0),n);let a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,a.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(t,a).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(i){return nj.add(`image-bitmap:${t}`,i),e&&e(i),r.manager.itemEnd(t),i}).catch(function(e){s&&s(e),ag.set(o,e),nj.remove(`image-bitmap:${t}`),r.manager.itemError(t),r.manager.itemEnd(t)});nj.add(`image-bitmap:${t}`,o),r.manager.itemStart(t)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class ab{static getContext(){return void 0===s&&(s=new(window.AudioContext||window.webkitAudioContext)),s}static setContext(t){s=t}}class av extends nq{constructor(t){super(t)}load(t,e,i,s){let r=this,n=new nH(this.manager);function a(e){s?s(e):P(e),r.manager.itemError(t)}n.setResponseType("arraybuffer"),n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,function(t){try{let i=t.slice(0);ab.getContext().decodeAudioData(i,function(t){e(t)}).catch(a)}catch(t){a(t)}},i,s)}}let aM=new tX,aw=new tX,aS=new tX;class a_{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new iv,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new iv,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(t){let e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){let i,s;e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,aS.copy(t.projectionMatrix);let r=e.eyeSep/2,n=r*e.near/e.focus,a=e.near*Math.tan(V*e.fov*.5)/e.zoom;aw.elements[12]=-r,aM.elements[12]=r,i=-a*e.aspect+n,s=a*e.aspect+n,aS.elements[0]=2*e.near/(s-i),aS.elements[8]=(s+i)/(s-i),this.cameraL.projectionMatrix.copy(aS),i=-a*e.aspect-n,s=a*e.aspect-n,aS.elements[0]=2*e.near/(s-i),aS.elements[8]=(s+i)/(s-i),this.cameraR.projectionMatrix.copy(aS)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(aw),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(aM)}}class aA extends iv{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class aT{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=performance.now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}let aC=new Z,aI=new Y,az=new Z,aB=new Z,ak=new Z;class aO extends eu{constructor(){super(),this.type="AudioListener",this.context=ab.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new aT}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(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);let e=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(aC,aI,az),aB.set(0,0,-1).applyQuaternion(aI),ak.set(0,1,0).applyQuaternion(aI),e.positionX){let t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(aC.x,t),e.positionY.linearRampToValueAtTime(aC.y,t),e.positionZ.linearRampToValueAtTime(aC.z,t),e.forwardX.linearRampToValueAtTime(aB.x,t),e.forwardY.linearRampToValueAtTime(aB.y,t),e.forwardZ.linearRampToValueAtTime(aB.z,t),e.upX.linearRampToValueAtTime(ak.x,t),e.upY.linearRampToValueAtTime(ak.y,t),e.upZ.linearRampToValueAtTime(ak.z,t)}else e.setPosition(aC.x,aC.y,aC.z),e.setOrientation(aB.x,aB.y,aB.z,ak.x,ak.y,ak.z)}}class aP extends eu{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.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(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void O("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void O("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;let e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void O("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(t=0){return!1===this.hasPlaybackControl?void O("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,s,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){a.setValue(i,s);break}}saveOriginalState(){let t=this.binding,e=this.buffer,i=this.valueSize,s=i*this._origIndex;t.getValue(e,s);for(let t=i;t!==s;++t)e[t]=e[s+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let s=0;s!==r;++s)t[e+s]=t[i+s]}_slerp(t,e,i,s){Y.slerpFlat(t,e,t,e,t,i,s)}_slerpAdditive(t,e,i,s,r){let n=this._workIndex*r;Y.multiplyQuaternionsFlat(t,n,t,e,t,i),Y.slerpFlat(t,e,t,e,t,n,s)}_lerp(t,e,i,s,r){let n=1-s;for(let a=0;a!==r;++a){let r=e+a;t[r]=t[r]*n+t[i+a]*s}}_lerpAdditive(t,e,i,s,r){for(let n=0;n!==r;++n){let r=e+n;t[r]=t[r]+t[i+n]*s}}}let aU="\\[\\]\\.:\\/",aj=RegExp("["+aU+"]","g"),aW="[^"+aU+"]",aG="[^"+aU.replace("\\.","")+"]",aq=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",aW)+/(WCOD+)?/.source.replace("WCOD",aG)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",aW)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",aW)+"$"),aJ=["material","materials","bones","map"];class aX{constructor(t,e,i){this.path=e,this.parsedPath=i||aX.parseTrackName(e),this.node=aX.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new aX.Composite(t,e,i):new aX(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(aj,"")}static parseTrackName(t){let e=aq.exec(t);if(null===e)throw Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==s&&-1!==s){let t=i.nodeName.substring(s+1);-1!==aJ.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){let i=function(t){for(let s=0;s=r){let n=r++,l=t[n];e[l.uuid]=h,t[h]=l,e[o]=n,t[n]=a;for(let t=0;t!==s;++t){let e=i[t],s=e[n],r=e[h];e[h]=s,e[n]=r}}}this.nCachedObjects_=r}uncache(){let t=this._objects,e=this._indicesByUUID,i=this._bindings,s=i.length,r=this.nCachedObjects_,n=t.length;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a],h=o.uuid,l=e[h];if(void 0!==l)if(delete e[h],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0;t!==s;++t){let e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){let i=this._bindingsIndicesByPath,s=i[t],r=this._bindings;if(void 0!==s)return r[s];let n=this._paths,a=this._parsedPaths,o=this._objects,h=o.length,l=this.nCachedObjects_,u=Array(h);s=r.length,i[t]=s,n.push(t),a.push(e),r.push(u);for(let i=l,s=o.length;i!==s;++i){let s=o[i];u[i]=new aX(s,t,e)}return u}unsubscribe_(t){let e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){let s=this._paths,r=this._parsedPaths,n=this._bindings,a=n.length-1,o=n[a];e[t[a]]=i,n[i]=o,n.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class aY{constructor(t,e,i=null,s=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=s;const r=e.tracks,n=r.length,a=Array(n),o={endingStart:2400,endingEnd:2400};for(let t=0;t!==n;++t){const e=r[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=Array(n),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(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i=!1){if(t.fadeOut(e),this.fadeIn(e),!0===i){let i=this._clip.duration,s=t._clip.duration;t.warp(1,s/i,e),this.warp(i/s,1,e)}return this}crossFadeTo(t,e,i=!1){return t.crossFadeFrom(this,e,i)}stopFading(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){let s=this._mixer,r=s.time,n=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);let o=a.parameterPositions,h=a.sampleValues;return o[0]=r,o[1]=r+i,h[0]=t/n,h[1]=e/n,this}stopWarping(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,s){if(!this.enabled)return void this._updateWeight(t);let r=this._startTime;if(null!==r){let s=(t-r)*i;s<0||0===i?e=0:(this._startTime=null,e=i*s)}e*=this._updateTimeScale(t);let n=this._updateTime(e),a=this._updateWeight(t);if(a>0){let t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let i=0,s=t.length;i!==s;++i)t[i].evaluate(n),e[i].accumulateAdditive(a);else for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(n),e[i].accumulate(s,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;let i=this._weightInterpolant;if(null!==i){let s=i.evaluate(t)[0];e*=s,t>i.parameterPositions[1]&&(this.stopFading(),0===s&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;let i=this._timeScaleInterpolant;null!==i&&(e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){let e=this._clip.duration,i=this.loop,s=this.time+t,r=this._loopCount,n=2202===i;if(0===t)return -1===r?s:n&&(1&r)==1?e-s:s;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));r:{if(s>=e)s=e;else if(s<0)s=0;else{this.time=s;break r}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,n)):this._setEndings(0===this.repetitions,!0,n)),s>=e||s<0){let i=Math.floor(s/e);s-=e*i,r+=Math.abs(i);let a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=t>0?e:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){let e=t<0;this._setEndings(e,!e,n)}else this._setEndings(!1,!1,n);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=s;if(n&&(1&r)==1)return e-s}return s}_setEndings(t,e,i){let s=this._interpolantSettings;i?(s.endingStart=2401,s.endingEnd=2401):(t?s.endingStart=this.zeroSlopeAtStart?2401:2400:s.endingStart=2402,e?s.endingEnd=this.zeroSlopeAtEnd?2401:2400:s.endingEnd=2402)}_scheduleFading(t,e,i){let s=this._mixer,r=s.time,n=this._weightInterpolant;null===n&&(n=s._lendControlInterpolant(),this._weightInterpolant=n);let a=n.parameterPositions,o=n.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=i,this}}let aZ=new Float32Array(1);class a$ extends N{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){let i=t._localRoot||this._root,s=t._clip.tracks,r=s.length,n=t._propertyBindings,a=t._interpolants,o=i.uuid,h=this._bindingsByRootAndName,l=h[o];void 0===l&&(l={},h[o]=l);for(let t=0;t!==r;++t){let r=s[t],h=r.name,u=l[h];if(void 0!==u)++u.referenceCount,n[t]=u;else{if(void 0!==(u=n[t])){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,h));continue}let s=e&&e._propertyBindings[t].binding.parsedPath;u=new aD(aX.create(i,h,s),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,o,h),n[t]=u}a[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){let e=(t._localRoot||this._root).uuid,i=t._clip.uuid,s=this._actionsByClip[i];this._bindAction(t,s&&s.knownActions[0]),this._addInactiveAction(t,i,e)}let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let e=t._cacheIndex;return null!==e&&e=0;--i)t[i].stop();return this}update(t){t*=this.timeScale;let e=this._actions,i=this._nActiveActions,s=this.time+=t,r=Math.sign(t),n=this._accuIndex^=1;for(let a=0;a!==i;++a)e[a]._update(s,t,r,n);let a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(n);return this}setTime(t){this.time=0;for(let t=0;t=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,os).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}let on=new Z,oa=new Z,oo=new Z,oh=new Z,ol=new Z,ou=new Z,oc=new Z;class op{constructor(t=new Z,e=new Z){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){on.subVectors(t,this.start),oa.subVectors(this.end,this.start);let i=oa.dot(oa),s=oa.dot(on)/i;return e&&(s=j(s,0,1)),s}closestPointToPoint(t,e,i){let s=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(s).add(this.start)}distanceSqToLine3(t,e=ou,i=oc){let s,r,n=1e-8*1e-8,a=this.start,o=t.start,h=this.end,l=t.end;oo.subVectors(h,a),oh.subVectors(l,o),ol.subVectors(a,o);let u=oo.dot(oo),c=oh.dot(oh),p=oh.dot(ol);if(u<=n&&c<=n)return e.copy(a),i.copy(o),e.sub(i),e.dot(e);if(u<=n)s=0,r=j(r=p/c,0,1);else{let t=oo.dot(ol);if(c<=n)r=0,s=j(-t/u,0,1);else{let e=oo.dot(oh),i=u*c-e*e;s=0!==i?j((e*p-t*c)/i,0,1):0,(r=(e*s+p)/c)<0?(r=0,s=j(-t/u,0,1)):r>1&&(r=1,s=j((e-t)/u,0,1))}}return e.copy(a).add(oo.multiplyScalar(s)),i.copy(o).add(oh.multiplyScalar(r)),e.sub(i),e.dot(e)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}let od=new Z;class om extends eu{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new e5,s=[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 t=0,e=1;t<32;t++,e++){const i=t/32*Math.PI*2,r=e/32*Math.PI*2;s.push(Math.cos(i),Math.sin(i),1,Math.cos(r),Math.sin(r),1)}i.setAttribute("position",new eZ(s,3));const r=new sV({fog:!1,toneMapped:!1});this.cone=new s$(i,r),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 t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),od.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(od),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}let oy=new Z,of=new tX,og=new tX;class ox extends s${constructor(t){const e=function t(e){let i=[];!0===e.isBone&&i.push(e);for(let s=0;s1)for(let i=0;i.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{oE.set(t.z,0,-t.x).normalize();let e=Math.acos(t.y);this.quaternion.setFromAxisAngle(oE,e)}}setLength(t,e=.2*t,i=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class oD extends s${constructor(t=1){const e=new e5;e.setAttribute("position",new eZ([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],3)),e.setAttribute("color",new eZ([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(e,new sV({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){let s=new ez,r=this.geometry.attributes.color.array;return s.set(t),s.toArray(r,0),s.toArray(r,3),s.set(e),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class oU{constructor(){this.type="ShapePath",this.color=new ez,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new rE,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.currentPath.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,r,n){return this.currentPath.bezierCurveTo(t,e,i,s,r,n),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){let e,i,s,r,n,a=r3.isClockWise,o=this.subPaths;if(0===o.length)return[];let h=[];if(1===o.length)return i=o[0],(s=new rV).curves=i.curves,h.push(s),h;let l=!a(o[0].getPoints());l=t?!l:l;let u=[],c=[],p=[],d=0;c[0]=void 0,p[d]=[];for(let s=0,n=o.length;s1){let t=!1,e=0;for(let t=0,e=c.length;tNumber.EPSILON){if(h<0&&(i=e[n],o=-o,a=e[r],h=-h),t.ya.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{let e=h*(t.x-i.x)-o*(t.y-i.y);if(0===e)return!0;if(e<0)continue;s=!s}}else{if(t.y!==i.y)continue;if(a.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=a.x)return!0}}return s})(n.p,c[s].p)&&(i!==s&&e++,a?(a=!1,u[s].push(n)):t=!0);a&&u[i].push(n)}}e>0&&!1===t&&(p=u)}for(let t=0,e=c.length;te?(t.repeat.x=1,t.repeat.y=i/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/i,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}static cover(t,e){let i;return(i=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=e/i,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=i/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}static fill(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}static getByteLength(t,e,i,s){return oW(t,e,i,s)}}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"182"}})),"u">typeof window&&(window.__THREE__?O("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="182"),t.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveAnimationBlendMode",()=>2501,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"AlwaysStencilFunc",()=>519,"AmbientLight",()=>an,"AnimationAction",()=>aY,"AnimationClip",()=>nU,"AnimationLoader",()=>nY,"AnimationMixer",()=>a$,"AnimationObjectGroup",()=>aH,"AnimationUtils",()=>nI,"ArcCurve",()=>rb,"ArrayCamera",()=>aA,"ArrowHelper",()=>oV,"AttachedBindMode",()=>p,"Audio",()=>aP,"AudioAnalyser",()=>aV,"AudioContext",()=>ab,"AudioListener",()=>aO,"AudioLoader",()=>av,"AxesHelper",()=>oD,"BackSide",()=>1,"BasicDepthPacking",()=>3200,"BasicShadowMap",()=>0,"BatchedMesh",()=>sE,"Bone",()=>i8,"BooleanKeyframeTrack",()=>nR,"Box2",()=>or,"Box3",()=>tv,"Box3Helper",()=>oN,"BoxGeometry",()=>il,"BoxHelper",()=>oF,"BufferAttribute",()=>eU,"BufferGeometry",()=>e5,"BufferGeometryLoader",()=>ap,"ByteType",()=>1010,"Cache",()=>nj,"Camera",()=>iy,"CameraHelper",()=>oO,"CanvasTexture",()=>ri,"CapsuleGeometry",()=>ra,"CatmullRomCurve3",()=>rA,"CineonToneMapping",()=>3,"CircleGeometry",()=>ro,"ClampToEdgeWrapping",()=>1001,"Clock",()=>aT,"Color",()=>ez,"ColorKeyframeTrack",()=>nF,"ColorManagement",()=>ts,"CompressedArrayTexture",()=>rt,"CompressedCubeTexture",()=>re,"CompressedTexture",()=>s7,"CompressedTextureLoader",()=>nZ,"ConeGeometry",()=>rl,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"Controls",()=>oj,"CubeCamera",()=>iM,"CubeDepthTexture",()=>rr,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>iw,"CubeTextureLoader",()=>nK,"CubeUVReflectionMapping",()=>306,"CubicBezierCurve",()=>rz,"CubicBezierCurve3",()=>rB,"CubicInterpolant",()=>nB,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceFrontBack",()=>3,"CullFaceNone",()=>0,"Curve",()=>rg,"CurvePath",()=>rL,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"CylinderGeometry",()=>rh,"Cylindrical",()=>oe,"Data3DTexture",()=>tx,"DataArrayTexture",()=>tf,"DataTexture",()=>i9,"DataTextureLoader",()=>n0,"DataUtils",()=>eL,"DecrementStencilOp",()=>7683,"DecrementWrapStencilOp",()=>34056,"DefaultLoadingManager",()=>nG,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>rs,"DetachedBindMode",()=>d,"DirectionalLight",()=>ar,"DirectionalLightHelper",()=>oz,"DiscreteInterpolant",()=>nO,"DodecahedronGeometry",()=>rc,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"DynamicCopyUsage",()=>35050,"DynamicDrawUsage",()=>35048,"DynamicReadUsage",()=>35049,"EdgesGeometry",()=>rf,"EllipseCurve",()=>rx,"EqualCompare",()=>514,"EqualDepth",()=>4,"EqualStencilFunc",()=>514,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>t3,"EventDispatcher",()=>N,"ExternalTexture",()=>rn,"ExtrudeGeometry",()=>r6,"FileLoader",()=>nH,"Float16BufferAttribute",()=>eY,"Float32BufferAttribute",()=>eZ,"FloatType",()=>1015,"Fog",()=>iI,"FogExp2",()=>iC,"FramebufferTexture",()=>s9,"FrontSide",()=>0,"Frustum",()=>sx,"FrustumArray",()=>sM,"GLBufferAttribute",()=>a3,"GLSL1",()=>"100","GLSL3",()=>"300 es","GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"GreaterEqualStencilFunc",()=>518,"GreaterStencilFunc",()=>516,"GridHelper",()=>o_,"Group",()=>i_,"HalfFloatType",()=>1016,"HemisphereLight",()=>n3,"HemisphereLightHelper",()=>oS,"IcosahedronGeometry",()=>r9,"ImageBitmapLoader",()=>ax,"ImageLoader",()=>nQ,"ImageUtils",()=>ta,"IncrementStencilOp",()=>7682,"IncrementWrapStencilOp",()=>34055,"InstancedBufferAttribute",()=>si,"InstancedBufferGeometry",()=>ac,"InstancedInterleavedBuffer",()=>a2,"InstancedMesh",()=>su,"Int16BufferAttribute",()=>eq,"Int32BufferAttribute",()=>eX,"Int8BufferAttribute",()=>ej,"IntType",()=>1013,"InterleavedBuffer",()=>iB,"InterleavedBufferAttribute",()=>iO,"Interpolant",()=>nz,"InterpolateDiscrete",()=>2300,"InterpolateLinear",()=>2301,"InterpolateSmooth",()=>2302,"InterpolationSamplingMode",()=>v,"InterpolationSamplingType",()=>b,"InvertStencilOp",()=>5386,"KeepStencilOp",()=>7680,"KeyframeTrack",()=>nP,"LOD",()=>iZ,"LatheGeometry",()=>r7,"Layers",()=>t5,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LessEqualStencilFunc",()=>515,"LessStencilFunc",()=>513,"Light",()=>n2,"LightProbe",()=>ah,"Line",()=>sX,"Line3",()=>op,"LineBasicMaterial",()=>sV,"LineCurve",()=>rk,"LineCurve3",()=>rO,"LineDashedMaterial",()=>nS,"LineLoop",()=>sQ,"LineSegments",()=>s$,"LinearFilter",()=>1006,"LinearInterpolant",()=>nk,"LinearMipMapLinearFilter",()=>1008,"LinearMipMapNearestFilter",()=>1007,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>y,"LinearToneMapping",()=>1,"LinearTransfer",()=>f,"Loader",()=>nq,"LoaderUtils",()=>au,"LoadingManager",()=>nW,"LoopOnce",()=>2200,"LoopPingPong",()=>2202,"LoopRepeat",()=>2201,"MOUSE",()=>u,"Material",()=>eO,"MaterialLoader",()=>al,"MathUtils",()=>X,"Matrix2",()=>oi,"Matrix3",()=>K,"Matrix4",()=>tX,"MaxEquation",()=>104,"Mesh",()=>io,"MeshBasicMaterial",()=>eP,"MeshDepthMaterial",()=>nv,"MeshDistanceMaterial",()=>nM,"MeshLambertMaterial",()=>nb,"MeshMatcapMaterial",()=>nw,"MeshNormalMaterial",()=>nx,"MeshPhongMaterial",()=>nf,"MeshPhysicalMaterial",()=>ny,"MeshStandardMaterial",()=>nm,"MeshToonMaterial",()=>ng,"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",()=>nN,"Object3D",()=>eu,"ObjectLoader",()=>ad,"ObjectSpaceNormalMap",()=>1,"OctahedronGeometry",()=>nt,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>ai,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"Path",()=>rE,"PerspectiveCamera",()=>iv,"Plane",()=>sm,"PlaneGeometry",()=>ne,"PlaneHelper",()=>oL,"PointLight",()=>ae,"PointLightHelper",()=>ob,"Points",()=>s5,"PointsMaterial",()=>sK,"PolarGridHelper",()=>oA,"PolyhedronGeometry",()=>ru,"PositionalAudio",()=>aE,"PropertyBinding",()=>aX,"PropertyMixer",()=>aD,"QuadraticBezierCurve",()=>rP,"QuadraticBezierCurve3",()=>rR,"Quaternion",()=>Y,"QuaternionKeyframeTrack",()=>nE,"QuaternionLinearInterpolant",()=>nL,"R11_EAC_Format",()=>37488,"RAD2DEG",()=>D,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"182","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",()=>nd,"Ray",()=>tJ,"Raycaster",()=>a4,"RectAreaLight",()=>aa,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RenderTarget",()=>tm,"RenderTarget3D",()=>aQ,"RepeatWrapping",()=>1e3,"ReplaceStencilOp",()=>7681,"ReverseSubtractEquation",()=>102,"RingGeometry",()=>ni,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>36286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>m,"SRGBTransfer",()=>g,"Scene",()=>iz,"ShaderMaterial",()=>im,"ShadowMaterial",()=>np,"Shape",()=>rV,"ShapeGeometry",()=>ns,"ShapePath",()=>oU,"ShapeUtils",()=>r3,"ShortType",()=>1011,"Skeleton",()=>se,"SkeletonHelper",()=>ox,"SkinnedMesh",()=>i6,"Source",()=>th,"Sphere",()=>tE,"SphereGeometry",()=>nr,"Spherical",()=>ot,"SphericalHarmonics3",()=>ao,"SplineCurve",()=>rF,"SpotLight",()=>n7,"SpotLightHelper",()=>om,"Sprite",()=>iJ,"SpriteMaterial",()=>iP,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"StaticCopyUsage",()=>35046,"StaticDrawUsage",()=>35044,"StaticReadUsage",()=>35045,"StereoCamera",()=>a_,"StreamCopyUsage",()=>35042,"StreamDrawUsage",()=>35040,"StreamReadUsage",()=>35041,"StringKeyframeTrack",()=>nV,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TOUCH",()=>c,"TangentSpaceNormalMap",()=>0,"TetrahedronGeometry",()=>nn,"Texture",()=>tp,"TextureLoader",()=>n1,"TextureUtils",()=>oG,"Timer",()=>a9,"TimestampQuery",()=>x,"TorusGeometry",()=>na,"TorusKnotGeometry",()=>no,"Triangle",()=>e_,"TriangleFanDrawMode",()=>2,"TriangleStripDrawMode",()=>1,"TrianglesDrawMode",()=>0,"TubeGeometry",()=>nh,"UVMapping",()=>300,"Uint16BufferAttribute",()=>eJ,"Uint32BufferAttribute",()=>eH,"Uint8BufferAttribute",()=>eW,"Uint8ClampedBufferAttribute",()=>eG,"Uniform",()=>aK,"UniformsGroup",()=>a1,"UniformsUtils",()=>id,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>H,"Vector3",()=>Z,"Vector4",()=>td,"VectorKeyframeTrack",()=>nD,"VideoFrameTexture",()=>s8,"VideoTexture",()=>s6,"WebGL3DRenderTarget",()=>tb,"WebGLArrayRenderTarget",()=>tg,"WebGLCoordinateSystem",()=>2e3,"WebGLCubeRenderTarget",()=>iS,"WebGLRenderTarget",()=>ty,"WebGPUCoordinateSystem",()=>2001,"WebXRController",()=>iT,"WireframeGeometry",()=>nl,"WrapAroundEnding",()=>2402,"ZeroCurvatureEnding",()=>2400,"ZeroFactor",()=>200,"ZeroSlopeEnding",()=>2401,"ZeroStencilOp",()=>0,"arrayNeedsUint32",()=>M,"cloneUniforms",()=>iu,"createCanvasElement",()=>T,"createElementNS",()=>A,"error",()=>P,"getByteLength",()=>oW,"getConsoleFunction",()=>B,"getUnlitUniformColorSpace",()=>ip,"log",()=>k,"mergeUniforms",()=>ic,"probeAsync",()=>F,"setConsoleFunction",()=>z,"warn",()=>O,"warnOnce",()=>R])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/744d1b0edcf40c69.js b/docs/_next/static/chunks/744d1b0edcf40c69.js new file mode 100644 index 00000000..a61baa48 --- /dev/null +++ b/docs/_next/static/chunks/744d1b0edcf40c69.js @@ -0,0 +1,521 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65883,e=>{e.v({ButtonGroup:"InspectorControls-module__gNRB6W__ButtonGroup",ButtonHint:"InspectorControls-module__gNRB6W__ButtonHint",ButtonLabel:"InspectorControls-module__gNRB6W__ButtonLabel",CheckboxField:"InspectorControls-module__gNRB6W__CheckboxField",Control:"InspectorControls-module__gNRB6W__Control",Description:"InspectorControls-module__gNRB6W__Description",Dropdown:"InspectorControls-module__gNRB6W__Dropdown",Field:"InspectorControls-module__gNRB6W__Field",ForceRenderButton:"InspectorControls-module__gNRB6W__ForceRenderButton",Group:"InspectorControls-module__gNRB6W__Group",IconButton:"InspectorControls-module__gNRB6W__IconButton",InspectorControls:"InspectorControls-module__gNRB6W__InspectorControls",Label:"InspectorControls-module__gNRB6W__Label",LabelledButton:"InspectorControls-module__gNRB6W__LabelledButton",MapInfoButton:"InspectorControls-module__gNRB6W__MapInfoButton InspectorControls-module__gNRB6W__IconButton InspectorControls-module__gNRB6W__LabelledButton",Toggle:"InspectorControls-module__gNRB6W__Toggle InspectorControls-module__gNRB6W__IconButton",Tools:"InspectorControls-module__gNRB6W__Tools"})},36679,e=>{e.v({ButtonLabel:"CopyCoordinatesButton-module__BxovtG__ButtonLabel "+e.i(65883).ButtonLabel,ClipboardCheck:"CopyCoordinatesButton-module__BxovtG__ClipboardCheck",MapPin:"CopyCoordinatesButton-module__BxovtG__MapPin",Root:"CopyCoordinatesButton-module__BxovtG__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,showClipboardCheck:"CopyCoordinatesButton-module__BxovtG__showClipboardCheck"})},28903,e=>{e.v({ButtonHint:"LoadDemoButton-module__kGZaoW__ButtonHint "+e.i(65883).ButtonHint,ButtonLabel:"LoadDemoButton-module__kGZaoW__ButtonLabel "+e.i(65883).ButtonLabel,Root:"LoadDemoButton-module__kGZaoW__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton})},9607,e=>{e.v({ButtonHint:"JoinServerButton-module__DIR70a__ButtonHint "+e.i(65883).ButtonHint,PingLabel:"JoinServerButton-module__DIR70a__PingLabel "+e.i(65883).ButtonLabel,Pulsing:"JoinServerButton-module__DIR70a__Pulsing",Root:"JoinServerButton-module__DIR70a__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,TextLabel:"JoinServerButton-module__DIR70a__TextLabel "+e.i(65883).ButtonLabel,blink:"JoinServerButton-module__DIR70a__blink"})},81323,e=>{e.v({AccordionGroup:"Accordion-module__rN-DYq__AccordionGroup",Body:"Accordion-module__rN-DYq__Body",Content:"Accordion-module__rN-DYq__Content",Trigger:"Accordion-module__rN-DYq__Trigger",TriggerIcon:"Accordion-module__rN-DYq__TriggerIcon",slideDown:"Accordion-module__rN-DYq__slideDown",slideUp:"Accordion-module__rN-DYq__slideUp"})},16964,e=>{e.v({ActionButton:"StreamingMissionInfo-module__hEaQnW__ActionButton "+e.i(65883).IconButton,Attribution:"StreamingMissionInfo-module__hEaQnW__Attribution",EjectIcon:"StreamingMissionInfo-module__hEaQnW__EjectIcon",Header:"StreamingMissionInfo-module__hEaQnW__Header",Metadata:"StreamingMissionInfo-module__hEaQnW__Metadata",MissionInfo:"StreamingMissionInfo-module__hEaQnW__MissionInfo",MissionName:"StreamingMissionInfo-module__hEaQnW__MissionName "+e.i(97442).SelectedName,MissionType:"StreamingMissionInfo-module__hEaQnW__MissionType "+e.i(97442).ItemType,MissionTypeDisplayName:"StreamingMissionInfo-module__hEaQnW__MissionTypeDisplayName",PlayerName:"StreamingMissionInfo-module__hEaQnW__PlayerName",RecordingDate:"StreamingMissionInfo-module__hEaQnW__RecordingDate",ServerInfo:"StreamingMissionInfo-module__hEaQnW__ServerInfo",ServerName:"StreamingMissionInfo-module__hEaQnW__ServerName"})},29418,e=>{e.v({Bottom:"PlayerNameplate-module__zYDm0a__Bottom PlayerNameplate-module__zYDm0a__Root",HealthBar:"PlayerNameplate-module__zYDm0a__HealthBar",HealthFill:"PlayerNameplate-module__zYDm0a__HealthFill",IffArrow:"PlayerNameplate-module__zYDm0a__IffArrow",Name:"PlayerNameplate-module__zYDm0a__Name",Root:"PlayerNameplate-module__zYDm0a__Root",Top:"PlayerNameplate-module__zYDm0a__Top PlayerNameplate-module__zYDm0a__Root"})},78779,e=>{e.v({Distance:"FlagMarker-module__INpLba__Distance",Icon:"FlagMarker-module__INpLba__Icon",Root:"FlagMarker-module__INpLba__Root"})},89271,e=>{e.v({LoadingIndicator:"LoadingIndicator-module__F20Nda__LoadingIndicator",Progress:"LoadingIndicator-module__F20Nda__Progress",ProgressBar:"LoadingIndicator-module__F20Nda__ProgressBar",ProgressText:"LoadingIndicator-module__F20Nda__ProgressText",Spinner:"LoadingIndicator-module__F20Nda__Spinner",loadingComplete:"LoadingIndicator-module__F20Nda__loadingComplete",spin:"LoadingIndicator-module__F20Nda__spin"})},82156,e=>{e.v({Backdrop:"MapInspector-module__nU0WNq__Backdrop",CancelButton:"MapInspector-module__nU0WNq__CancelButton",Content:"MapInspector-module__nU0WNq__Content",Frame:"MapInspector-module__nU0WNq__Frame",PlayerBar:"MapInspector-module__nU0WNq__PlayerBar",Sidebar:"MapInspector-module__nU0WNq__Sidebar",ThreeView:"MapInspector-module__nU0WNq__ThreeView",ToggleSidebarButton:"MapInspector-module__nU0WNq__ToggleSidebarButton",Toolbar:"MapInspector-module__nU0WNq__Toolbar",layout:"MapInspector-module__nU0WNq__layout"})},31713,e=>{"use strict";var t=e.i(43476),r=e.i(932),a=e.i(71645),n=e.i(17751),o=e.i(12598),i=e.i(38847);let l=(0,a.createContext)({live:!1});function s(e){let n,o,s=(0,r.c)(5),{children:u}=e,[d]=(0,i.useQueryState)("features",i.parseAsString);s[0]!==d?(n=()=>({live:new Set((d??"").split(",").map(c).filter(Boolean)).has("live")}),s[0]=d,s[1]=n):n=s[1];let[m]=(0,a.useState)(n);return s[2]!==u||s[3]!==m?(o=(0,t.jsx)(l.Provider,{value:m,children:u}),s[2]=u,s[3]=m,s[4]=o):o=s[4],o}function c(e){return e.trim().toLowerCase()}var u=e.i(40141);function d(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M16 21L11.2381 12.2698L15 6L23 21H16ZM8 10L14 21H2L8 10ZM5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5C8 6.88071 6.88071 8 5.5 8Z"},child:[]}]})(e)}function m(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(e)}function f(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"},child:[]}]})(e)}function h(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 8V2h6"},child:[]},{tag:"path",attr:{d:"m2 2 10 10"},child:[]},{tag:"path",attr:{d:"M12 2A10 10 0 1 1 2 12"},child:[]}]})(e)}function p(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"},child:[]},{tag:"path",attr:{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"M12 11h4"},child:[]},{tag:"path",attr:{d:"M12 16h4"},child:[]},{tag:"path",attr:{d:"M8 11h.01"},child:[]},{tag:"path",attr:{d:"M8 16h.01"},child:[]}]})(e)}function g(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"m16 15-3-3 3-3"},child:[]}]})(e)}function v(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"m14 9 3 3-3 3"},child:[]}]})(e)}function x(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"m9 16 3-3 3 3"},child:[]}]})(e)}function y(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"m15 14-3 3-3-3"},child:[]}]})(e)}var b=e.i(79123),_=e.i(11152),S=e.i(36679);function j(e){let n,o,i,l,s,c=(0,r.c)(12),{cameraRef:u,missionName:d,missionType:f,disabled:h}=e,{fogEnabled:p}=(0,b.useSettings)(),[g,v]=(0,a.useState)(!1),x=(0,a.useRef)(null);c[0]!==u||c[1]!==p||c[2]!==d||c[3]!==f?(n=async()=>{clearTimeout(x.current);let e=u.current;if(!e)return;let t=function({position:e,quaternion:t}){let r=e=>parseFloat(e.toFixed(3)),a=`${r(e.x)},${r(e.y)},${r(e.z)}`,n=`${r(t.x)},${r(t.y)},${r(t.z)},${r(t.w)}`;return`#c${a}~${n}`}(e),r=new URLSearchParams;r.set("mission",`${d}~${f}`),r.set("fog",p.toString());let a=`${window.location.pathname}?${r}${t}`,n=`${window.location.origin}${a}`;window.history.replaceState(null,"",a);try{await navigator.clipboard.writeText(n),v(!0),x.current=setTimeout(()=>{v(!1)},1100)}catch(e){console.error(e)}},c[0]=u,c[1]=p,c[2]=d,c[3]=f,c[4]=n):n=c[4];let y=n,j=g?"true":"false";return c[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(_.FaMapPin,{className:S.default.MapPin}),i=(0,t.jsx)(m,{className:S.default.ClipboardCheck}),l=(0,t.jsx)("span",{className:S.default.ButtonLabel,children:" Link to coordinates"}),c[5]=o,c[6]=i,c[7]=l):(o=c[5],i=c[6],l=c[7]),c[8]!==h||c[9]!==y||c[10]!==j?(s=(0,t.jsxs)("button",{type:"button",className:S.default.Root,"aria-label":"Link to coordinates",title:"Copy the current coordinates to URL",onClick:y,disabled:h,"data-copied":j,id:"copyCoordinatesButton",children:[o,i,l]}),c[8]=h,c[9]=y,c[10]=j,c[11]=s):s=c[11],s}function C(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z"},child:[]}]})(e)}var w=e.i(25645),M=e.i(98755),N=e.i(32865),T=e.i(28903);let k=(0,w.createLogger)("LoadDemoButton");function F({isActive:r=!1,choosingMap:n=!1,onCancelChoosingMap:o}){let i=(0,N.useRecording)(),l=i?.source==="demo",{setRecording:s}=(0,N.usePlaybackActions)(),c=(0,a.useRef)(null),u=(0,a.useRef)(0),d=(0,a.useCallback)(()=>{if(n&&l)return void o?.();if(l){u.current+=1,s(null);return}c.current?.click()},[l,n,o,s]),m=(0,a.useCallback)(async t=>{let r=t.target.files?.[0];if(r){t.target.value="";try{let t=await r.arrayBuffer(),a=u.current+1;u.current=a;let{createDemoStreamingRecording:n}=await e.A(60946),o=await n(t);if(u.current!==a)return;let i=M.liveConnectionStore.getState();i.disconnectServer(),i.disconnectRelay(),s(o)}catch(e){k.error("Failed to load demo: %o",e)}}},[s]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:c,type:"file",accept:".rec",style:{display:"none"},onChange:m}),(0,t.jsxs)("button",{type:"button",className:T.default.Root,"aria-label":l?"Unload demo":"Load demo (.rec)",title:l?"Unload demo":"Load demo (.rec)",onClick:d,"data-active":r,children:[(0,t.jsx)(C,{className:T.default.DemoIcon}),(0,t.jsx)("span",{className:T.default.ButtonLabel,children:"Demo"}),(0,t.jsx)("span",{className:T.default.ButtonHint,children:n&&l?"Return to demo":l?"Click to unload":"Load a .rec file"})]})]})}function R(e){return(0,u.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z"},child:[]}]})(e)}var D=e.i(9607);function L(e){let a,n,o,i,l,s,c=(0,r.c)(19),{isActive:u,onOpenServerBrowser:d}=e,m=(0,M.useLiveSelector)(I),f=(0,M.useLiveSelector)(M.selectPing),h=(0,M.useLiveSelector)(B),p="connected"===m,g="connecting"===m||"challenging"===m||"authenticating"===m,v=p?"Connected – click to disconnect":"Join server",x=p?"Connected – click to disconnect":"Join server";c[0]!==h||c[1]!==p||c[2]!==d?(a=()=>{p?h():d()},c[0]=h,c[1]=p,c[2]=d,c[3]=a):a=c[3];let y=`${D.default.LiveIcon} ${p?D.default.Pulsing:""}`;if(c[4]!==y?(n=(0,t.jsx)(R,{className:y}),c[4]=y,c[5]=n):n=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("span",{className:D.default.TextLabel,children:"Live"}),c[6]=o):o=c[6],c[7]!==g||c[8]!==f)i=g?"Connecting…":null!=f?`${f.toLocaleString()} ms`:"Join a game",c[7]=g,c[8]=f,c[9]=i;else i=c[9];return c[10]!==i?(l=(0,t.jsxs)(t.Fragment,{children:[o,(0,t.jsx)("span",{className:D.default.ButtonHint,children:i})]}),c[10]=i,c[11]=l):l=c[11],c[12]!==u||c[13]!==v||c[14]!==x||c[15]!==a||c[16]!==n||c[17]!==l?(s=(0,t.jsxs)("button",{type:"button",className:D.default.Root,"aria-label":v,title:x,onClick:a,"data-active":u,children:[n,l]}),c[12]=u,c[13]=v,c[14]=x,c[15]=a,c[16]=n,c[17]=l,c[18]=s):s=c[18],s}function B(e){return e.disconnectServer}function I(e){return e.gameStatus}function A(e,r=[]){let n=[],o=()=>{let t=n.map(e=>a.createContext(e));return function(r){let n=r?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){let i=a.createContext(o),l=n.length;n=[...n,o];let s=r=>{let{scope:n,children:o,...s}=r,c=n?.[e]?.[l]||i,u=a.useMemo(()=>s,Object.values(s));return(0,t.jsx)(c.Provider,{value:u,children:o})};return s.displayName=r+"Provider",[s,function(t,n){let s=n?.[e]?.[l]||i,c=a.useContext(s);if(c)return c;if(void 0!==o)return o;throw Error(`\`${t}\` must be used within \`${r}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:a})=>{let n=r(e)[`__scope${a}`];return{...t,...n}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(o,...r)]}function P(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function E(...e){return t=>{let r=!1,a=e.map(e=>{let a=P(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t{let{children:r,...n}=e;if(a.isValidElement(r)){var o;let e,i,l=(o=r,(i=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(i=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),s=function(e,t){let r={...t};for(let a in t){let n=e[a],o=t[a];/^on[A-Z]/.test(a)?n&&o?r[a]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[a]=n):"style"===a?r[a]={...n,...o}:"className"===a&&(r[a]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?E(t,l):l),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null})).displayName=`${r}.SlotClone`,n),i=a.forwardRef((e,r)=>{let{children:n,...i}=e,l=a.Children.toArray(n),s=l.find(W);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,t.jsx)(o,{...i,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,t.jsx)(o,{...i,ref:r,children:n})});return i.displayName=`${e}.Slot`,i}var U=Symbol("radix.slottable");function W(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===U}var H=new WeakMap;function O(e,t){var r,a;let n,o,i;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let l=(r=e,a=t,n=r.length,(i=(o=$(a))>=0?o:n+o)<0||i>=n?-1:i);return -1===l?void 0:e[l]}function $(e){return e!=e||0===e?0:Math.trunc(e)}function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),!1===r||!a.defaultPrevented)return t?.(a)}}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],H.set(this,!0)}set(e,t){return H.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let a,n=this.has(t),o=this.#e.length,i=$(e),l=i>=0?i:o+i,s=l<0||l>=o?-1:l;if(s===this.size||n&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!n;i<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e=this.size&&(a=this.size-1),this.at(a)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let a=r+t;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return a;r++}}findIndex(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return r;r++}return -1}filter(t,r){let a=[],n=0;for(let e of this)Reflect.apply(t,r,[e,n,this])&&a.push(e),n++;return new e(a)}map(t,r){let a=[],n=0;for(let e of this)a.push([e[0],Reflect.apply(t,r,[e,n,this])]),n++;return new e(a)}reduce(...e){let[t,r]=e,a=0,n=r??this.at(0);for(let r of this)n=0===a&&1===e.length?r:Reflect.apply(t,this,[n,r,a,this]),a++;return n}reduceRight(...e){let[t,r]=e,a=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let n=this.at(r);a=r===this.size-1&&1===e.length?n:Reflect.apply(t,this,[a,n,r,this])}return a}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),a=this.get(r);t.set(r,a)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let a=new e,n=this.size-1;if(void 0===t)return a;t<0&&(t+=this.size),void 0!==r&&r>0&&(n=r-1);for(let e=t;e<=n;e++){let t=this.keyAt(e),r=this.get(t);a.set(t,r)}return a}every(e,t){let r=0;for(let a of this){if(!Reflect.apply(e,t,[a,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return!0;r++}return!1}}),"u">typeof window&&window.document&&window.document.createElement;var q=globalThis?.document?a.useLayoutEffect:()=>{};a[" useEffectEvent ".trim().toString()],a[" useInsertionEffect ".trim().toString()];var Q=a[" useInsertionEffect ".trim().toString()]||q;function K({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,i,l]=function({defaultProp:e,onChange:t}){let[r,n]=a.useState(e),o=a.useRef(r),i=a.useRef(t);return Q(()=>{i.current=t},[t]),a.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}({defaultProp:t,onChange:r}),s=void 0!==e,c=s?e:o;{let t=a.useRef(void 0!==e);a.useEffect(()=>{let e=t.current;if(e!==s){let t=s?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,n])}return[c,a.useCallback(t=>{if(s){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else i(t)},[s,e,i,l])]}Symbol("RADIX:SYNC_STATE"),e.i(74080);var Y=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let n=G(`Primitive.${r}`),o=a.forwardRef((e,a)=>{let{asChild:o,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o?n:r,{...i,ref:a})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),J=e=>{var t;let r,n,{present:o,children:i}=e,l=function(e){var t,r;let[n,o]=a.useState(),i=a.useRef(null),l=a.useRef(e),s=a.useRef("none"),[c,u]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},a.useReducer((e,t)=>r[e][t]??e,t));return a.useEffect(()=>{let e=Z(i.current);s.current="mounted"===c?e:"none"},[c]),q(()=>{let t=i.current,r=l.current;if(r!==e){let a=s.current,n=Z(t);e?u("MOUNT"):"none"===n||t?.display==="none"?u("UNMOUNT"):r&&a!==n?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),q(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=Z(i.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(u("ANIMATION_END"),!l.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(s.current=Z(i.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{i.current=e?getComputedStyle(e):null,o(e)},[])}}(o),s="function"==typeof i?i({present:l.isPresent}):a.Children.only(i),c=z(l.ref,(t=s,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof i||l.isPresent?a.cloneElement(s,{ref:c}):null};function Z(e){return e?.animationName||"none"}J.displayName="Presence";var X=a[" useId ".trim().toString()]||(()=>void 0),ee=0;function et(e){let[t,r]=a.useState(X());return q(()=>{e||r(e=>e??String(ee++))},[e]),e||(t?`radix-${t}`:"")}var er="Collapsible",[ea,en]=A(er),[eo,ei]=ea(er),el=a.forwardRef((e,r)=>{let{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:l,onOpenChange:s,...c}=e,[u,d]=K({prop:o,defaultProp:i??!1,onChange:s,caller:er});return(0,t.jsx)(eo,{scope:n,disabled:l,contentId:et(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:(0,t.jsx)(Y.div,{"data-state":ef(u),"data-disabled":l?"":void 0,...c,ref:r})})});el.displayName=er;var es="CollapsibleTrigger",ec=a.forwardRef((e,r)=>{let{__scopeCollapsible:a,...n}=e,o=ei(es,a);return(0,t.jsx)(Y.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ef(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:r,onClick:V(e.onClick,o.onOpenToggle)})});ec.displayName=es;var eu="CollapsibleContent",ed=a.forwardRef((e,r)=>{let{forceMount:a,...n}=e,o=ei(eu,e.__scopeCollapsible);return(0,t.jsx)(J,{present:a||o.open,children:({present:e})=>(0,t.jsx)(em,{...n,ref:r,present:e})})});ed.displayName=eu;var em=a.forwardRef((e,r)=>{let{__scopeCollapsible:n,present:o,children:i,...l}=e,s=ei(eu,n),[c,u]=a.useState(o),d=a.useRef(null),m=z(r,d),f=a.useRef(0),h=f.current,p=a.useRef(0),g=p.current,v=s.open||c,x=a.useRef(v),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),q(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,p.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(o)}},[s.open,o]),(0,t.jsx)(Y.div,{"data-state":ef(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...l,ref:m,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&i})});function ef(e){return e?"open":"closed"}var eh=a.createContext(void 0),ep="Accordion",eg=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ev,ex,ey]=function(e){let r=e+"CollectionProvider",[n,o]=A(r),[i,l]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:r,children:n}=e,o=a.default.useRef(null),l=a.default.useRef(new Map).current;return(0,t.jsx)(i,{scope:r,itemMap:l,collectionRef:o,children:n})};s.displayName=r;let c=e+"CollectionSlot",u=G(c),d=a.default.forwardRef((e,r)=>{let{scope:a,children:n}=e,o=z(r,l(c,a).collectionRef);return(0,t.jsx)(u,{ref:o,children:n})});d.displayName=c;let m=e+"CollectionItemSlot",f="data-radix-collection-item",h=G(m),p=a.default.forwardRef((e,r)=>{let{scope:n,children:o,...i}=e,s=a.default.useRef(null),c=z(r,s),u=l(m,n);return a.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...i}),()=>void u.itemMap.delete(s))),(0,t.jsx)(h,{...{[f]:""},ref:c,children:o})});return p.displayName=m,[{Provider:s,Slot:d,ItemSlot:p},function(t){let r=l(e+"CollectionConsumer",t);return a.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}(ep),[eb,e_]=A(ep,[ey,en]),eS=en(),ej=a.default.forwardRef((e,r)=>{let{type:a,...n}=e;return(0,t.jsx)(ev.Provider,{scope:e.__scopeAccordion,children:"multiple"===a?(0,t.jsx)(ek,{...n,ref:r}):(0,t.jsx)(eT,{...n,ref:r})})});ej.displayName=ep;var[eC,ew]=eb(ep),[eM,eN]=eb(ep,{collapsible:!1}),eT=a.default.forwardRef((e,r)=>{let{value:n,defaultValue:o,onValueChange:i=()=>{},collapsible:l=!1,...s}=e,[c,u]=K({prop:n,defaultProp:o??"",onChange:i,caller:ep});return(0,t.jsx)(eC,{scope:e.__scopeAccordion,value:a.default.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:a.default.useCallback(()=>l&&u(""),[l,u]),children:(0,t.jsx)(eM,{scope:e.__scopeAccordion,collapsible:l,children:(0,t.jsx)(eD,{...s,ref:r})})})}),ek=a.default.forwardRef((e,r)=>{let{value:n,defaultValue:o,onValueChange:i=()=>{},...l}=e,[s,c]=K({prop:n,defaultProp:o??[],onChange:i,caller:ep}),u=a.default.useCallback(e=>c((t=[])=>[...t,e]),[c]),d=a.default.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,t.jsx)(eC,{scope:e.__scopeAccordion,value:s,onItemOpen:u,onItemClose:d,children:(0,t.jsx)(eM,{scope:e.__scopeAccordion,collapsible:!0,children:(0,t.jsx)(eD,{...l,ref:r})})})}),[eF,eR]=eb(ep),eD=a.default.forwardRef((e,r)=>{let n,{__scopeAccordion:o,disabled:i,dir:l,orientation:s="vertical",...c}=e,u=z(a.default.useRef(null),r),d=ex(o),m="ltr"===(n=a.useContext(eh),l||n||"ltr"),f=V(e.onKeyDown,e=>{if(!eg.includes(e.key))return;let t=e.target,r=d().filter(e=>!e.ref.current?.disabled),a=r.findIndex(e=>e.ref.current===t),n=r.length;if(-1===a)return;e.preventDefault();let o=a,i=n-1,l=()=>{(o=a+1)>i&&(o=0)},c=()=>{(o=a-1)<0&&(o=i)};switch(e.key){case"Home":o=0;break;case"End":o=i;break;case"ArrowRight":"horizontal"===s&&(m?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(m?c():l());break;case"ArrowUp":"vertical"===s&&c()}let u=o%n;r[u].ref.current?.focus()});return(0,t.jsx)(eF,{scope:o,disabled:i,direction:l,orientation:s,children:(0,t.jsx)(ev.Slot,{scope:o,children:(0,t.jsx)(Y.div,{...c,"data-orientation":s,ref:u,onKeyDown:i?void 0:f})})})}),eL="AccordionItem",[eB,eI]=eb(eL),eA=a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,value:n,...o}=e,i=eR(eL,a),l=ew(eL,a),s=eS(a),c=et(),u=n&&l.value.includes(n)||!1,d=i.disabled||e.disabled;return(0,t.jsx)(eB,{scope:a,open:u,disabled:d,triggerId:c,children:(0,t.jsx)(el,{"data-orientation":i.orientation,"data-state":eW(u),...s,...o,ref:r,disabled:d,open:u,onOpenChange:e=>{e?l.onItemOpen(n):l.onItemClose(n)}})})});eA.displayName=eL;var eP="AccordionHeader";a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,...n}=e,o=eR(ep,a),i=eI(eP,a);return(0,t.jsx)(Y.h3,{"data-orientation":o.orientation,"data-state":eW(i.open),"data-disabled":i.disabled?"":void 0,...n,ref:r})}).displayName=eP;var eE="AccordionTrigger",ez=a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,...n}=e,o=eR(ep,a),i=eI(eE,a),l=eN(eE,a),s=eS(a);return(0,t.jsx)(ev.ItemSlot,{scope:a,children:(0,t.jsx)(ec,{"aria-disabled":i.open&&!l.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...n,ref:r})})});ez.displayName=eE;var eG="AccordionContent",eU=a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,...n}=e,o=eR(ep,a),i=eI(eG,a),l=eS(a);return(0,t.jsx)(ed,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...l,...n,ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function eW(e){return e?"open":"closed"}function eH(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m190.06 414 163.12-139.78a24 24 0 0 0 0-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z"},child:[]}]})(e)}eU.displayName=eG;var eO=e.i(81323);function e$(e){let a,n=(0,r.c)(2);return n[0]!==e?(a=(0,t.jsx)(ej,{className:eO.default.AccordionGroup,...e}),n[0]=e,n[1]=a):a=n[1],a}function eV(e){let a,n,o,i,l=(0,r.c)(9),{value:s,label:c,children:u}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(eH,{className:eO.default.TriggerIcon}),l[0]=a):a=l[0],l[1]!==c?(n=(0,t.jsxs)(ez,{className:eO.default.Trigger,children:[a," ",c]}),l[1]=c,l[2]=n):n=l[2],l[3]!==u?(o=(0,t.jsx)(eU,{className:eO.default.Content,children:(0,t.jsx)("div",{className:eO.default.Body,children:u})}),l[3]=u,l[4]=o):o=l[4],l[5]!==n||l[6]!==o||l[7]!==s?(i=(0,t.jsxs)(eA,{value:s,children:[n,o]}),l[5]=n,l[6]=o,l[7]=s,l[8]=i):i=l[8],i}var eq=e.i(65883);let eQ=()=>null;function eK(){let e,t,n=(0,r.c)(2),o=(0,a.useRef)(null);n[0]===Symbol.for("react.memo_cache_sentinel")?(e=e=>{let t=window.matchMedia("(pointer: coarse)");return t.addEventListener("change",e),o.current=t,()=>{t.removeEventListener("change",e)}},n[0]=e):e=n[0];let i=e;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=()=>o.current?.matches??null,n[1]=t):t=n[1];let l=t;return(0,a.useSyncExternalStore)(i,l,eQ)}var eY=e.i(92224),eJ=e.i(91996);let eZ=["controls","preferences","audio"];function eX(e){let n,o,i,l,s,c,u,m,h,g,v,x,y,_,S,C,w,T,k,R,D,B,I,A,P,E,z,G,U,W,H,O,$,V,q,Q,K,Y,J,Z,X,ee,et,er,ea,en,eo,ei,el,es,ec,eu,ed,em,ef,eh,ep,eg,ev,ex,ey,eb,e_,eS,ej,eC,ew,eM,eN,eT,ek,eF=(0,r.c)(167),{missionName:eR,missionType:eD,onOpenMapInfo:eL,onOpenServerBrowser:eB,onChooseMap:eI,onCancelChoosingMap:eA,choosingMap:eP,cameraRef:eE,invalidateRef:ez}=e,eG=eK(),eU=(0,eY.useDataSource)(),eW=(0,N.useRecording)(),eH=(0,eY.useMissionName)(),eO="demo"===eU||"live"===eU?eH:eR;eF[0]!==eO?(n=!!eO&&(0,eJ.hasMission)(eO),eF[0]=eO,eF[1]=n):n=eF[1];let eQ=n,eX=(0,M.useLiveSelector)(e0),{fogEnabled:e1,setFogEnabled:e2,fov:e3,setFov:e5,audioEnabled:e4,setAudioEnabled:e6,audioVolume:e8,setAudioVolume:e7,animationEnabled:e9,setAnimationEnabled:te}=(0,b.useSettings)(),{speedMultiplier:tt,setSpeedMultiplier:tr,touchMode:ta,setTouchMode:tn,invertScroll:to,setInvertScroll:ti,invertDrag:tl,setInvertDrag:ts,invertJoystick:tc,setInvertJoystick:tu}=(0,b.useControls)(),{debugMode:td,setDebugMode:tm,renderOnDemand:tf,setRenderOnDemand:th}=(0,b.useDebug)(),[tp,tg]=(0,a.useState)(!1),tv=(0,a.useRef)(null),tx=(0,a.useRef)(null),ty=(0,a.useRef)(null);eF[2]!==tp?(o=()=>{tp&&tv.current?.focus()},i=[tp],eF[2]=tp,eF[3]=o,eF[4]=i):(o=eF[3],i=eF[4]),(0,a.useEffect)(o,i),eF[5]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let t=e.relatedTarget;t&&ty.current?.contains(t)||tg(!1)},eF[5]=l):l=eF[5];let tb=l;eF[6]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{"Escape"===e.key&&(tg(!1),tx.current?.focus())},eF[6]=s):s=eF[6];let t_=s,tS="map"===eU&&!eW||eP;eF[7]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(d,{}),u=(0,t.jsx)("span",{className:eq.default.ButtonLabel,children:"Explore"}),m=(0,t.jsx)("span",{className:eq.default.ButtonHint,children:"Browse maps"}),eF[7]=c,eF[8]=u,eF[9]=m):(c=eF[7],u=eF[8],m=eF[9]),eF[10]!==eI||eF[11]!==tS?(h=(0,t.jsxs)("button",{type:"button",className:eq.default.IconButton,"data-active":tS,onClick:eI,children:[c,u,m]}),eF[10]=eI,eF[11]=tS,eF[12]=h):h=eF[12];let tj=!eP&&eW?.source==="demo";eF[13]!==eP||eF[14]!==eA||eF[15]!==tj?(g=(0,t.jsx)(F,{isActive:tj,choosingMap:eP,onCancelChoosingMap:eA}),eF[13]=eP,eF[14]=eA,eF[15]=tj,eF[16]=g):g=eF[16],eF[17]!==eP||eF[18]!==eX||eF[19]!==eB?(v=eB&&(0,t.jsx)(L,{isActive:!eP&&eX,onOpenServerBrowser:eB}),eF[17]=eP,eF[18]=eX,eF[19]=eB,eF[20]=v):v=eF[20],eF[21]!==h||eF[22]!==g||eF[23]!==v?(x=(0,t.jsxs)("div",{className:eq.default.ButtonGroup,children:[h,g,v]}),eF[21]=h,eF[22]=g,eF[23]=v,eF[24]=x):x=eF[24];let tC=!eQ;eF[25]!==eE||eF[26]!==eR||eF[27]!==eD||eF[28]!==tC?(y=(0,t.jsx)(j,{missionName:eR,missionType:eD,cameraRef:eE,disabled:tC}),eF[25]=eE,eF[26]=eR,eF[27]=eD,eF[28]=tC,eF[29]=y):y=eF[29];let tw=!eQ;eF[30]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)(p,{}),S=(0,t.jsx)("span",{className:eq.default.ButtonLabel,children:"Show map info"}),eF[30]=_,eF[31]=S):(_=eF[30],S=eF[31]),eF[32]!==eL||eF[33]!==tw?(C=(0,t.jsxs)("button",{type:"button",className:eq.default.MapInfoButton,"aria-label":"Show map info",onClick:eL,disabled:tw,children:[_,S]}),eF[32]=eL,eF[33]=tw,eF[34]=C):C=eF[34],eF[35]!==x||eF[36]!==y||eF[37]!==C?(w=(0,t.jsxs)("div",{className:eq.default.Tools,children:[x,y,C]}),eF[35]=x,eF[36]=y,eF[37]=C,eF[38]=w):w=eF[38],eF[39]===Symbol.for("react.memo_cache_sentinel")?(T=(0,t.jsx)("label",{htmlFor:"speedInput",children:"Fly speed"}),eF[39]=T):T=eF[39],eF[40]!==tr?(k=e=>tr(parseFloat(e.target.value)),eF[40]=tr,eF[41]=k):k=eF[41],eF[42]!==tt||eF[43]!==k?(R=(0,t.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:tt,onChange:k}),eF[42]=tt,eF[43]=k,eF[44]=R):R=eF[44];let tM=!1===eG?" Use your scroll wheel or trackpad to adjust while flying.":"";return eF[45]!==tM?(D=(0,t.jsxs)("p",{className:eq.default.Description,children:["How fast you move in free-flying mode.",tM]}),eF[45]=tM,eF[46]=D):D=eF[46],eF[47]!==R||eF[48]!==D?(B=(0,t.jsxs)("div",{className:eq.default.Field,children:[T,R,D]}),eF[47]=R,eF[48]=D,eF[49]=B):B=eF[49],eF[50]!==eG||eF[51]!==tn||eF[52]!==ta?(I=eG?(0,t.jsxs)("div",{className:eq.default.Field,children:[(0,t.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick"})," ",(0,t.jsxs)("select",{id:"touchModeInput",value:ta,onChange:e=>tn(e.target.value),children:[(0,t.jsx)("option",{value:"dualStick",children:"Dual stick"}),(0,t.jsx)("option",{value:"moveLookStick",children:"Single stick"})]}),(0,t.jsx)("p",{className:eq.default.Description,children:"Single stick has a unified move + look control. Dual stick has independent move + look."})]}):null,eF[50]=eG,eF[51]=tn,eF[52]=ta,eF[53]=I):I=eF[53],eF[54]!==to||eF[55]!==eG||eF[56]!==ti?(A=!1===eG?(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[(0,t.jsx)("input",{id:"invertScroll",type:"checkbox",checked:to,onChange:e=>{ti(e.target.checked)}}),(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"invertScroll",children:"Invert scroll direction"}),(0,t.jsx)("p",{className:eq.default.Description,children:"Reverse which scroll direction increases and decreases fly speed."})]}):null,eF[54]=to,eF[55]=eG,eF[56]=ti,eF[57]=A):A=eF[57],eF[58]!==tc||eF[59]!==eG||eF[60]!==tu?(P=eG?(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[(0,t.jsx)("input",{id:"invertJoystick",type:"checkbox",checked:tc,onChange:e=>{tu(e.target.checked)}}),(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"invertJoystick",children:"Invert joystick direction"}),(0,t.jsx)("p",{className:eq.default.Description,children:"Reverse joystick look direction."})]}):null,eF[58]=tc,eF[59]=eG,eF[60]=tu,eF[61]=P):P=eF[61],eF[62]!==ts?(E=e=>{ts(e.target.checked)},eF[62]=ts,eF[63]=E):E=eF[63],eF[64]!==tl||eF[65]!==E?(z=(0,t.jsx)("input",{id:"invertDrag",type:"checkbox",checked:tl,onChange:E}),eF[64]=tl,eF[65]=E,eF[66]=z):z=eF[66],eF[67]===Symbol.for("react.memo_cache_sentinel")?(G=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"invertDrag",children:"Invert drag direction"}),U=(0,t.jsx)("p",{className:eq.default.Description,children:"Reverse how dragging the viewport aims the camera."}),eF[67]=G,eF[68]=U):(G=eF[67],U=eF[68]),eF[69]!==z?(W=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[z,G,U]}),eF[69]=z,eF[70]=W):W=eF[70],eF[71]!==B||eF[72]!==I||eF[73]!==A||eF[74]!==P||eF[75]!==W?(H=(0,t.jsxs)(eV,{value:"controls",label:"Controls",children:[B,I,A,P,W]}),eF[71]=B,eF[72]=I,eF[73]=A,eF[74]=P,eF[75]=W,eF[76]=H):H=eF[76],eF[77]===Symbol.for("react.memo_cache_sentinel")?(O=(0,t.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),eF[77]=O):O=eF[77],eF[78]!==e3?($=(0,t.jsxs)("output",{htmlFor:"fovInput",children:[e3,"°"]}),eF[78]=e3,eF[79]=$):$=eF[79],eF[80]!==e5?(V=e=>e5(parseInt(e.target.value)),eF[80]=e5,eF[81]=V):V=eF[81],eF[82]!==e3||eF[83]!==V?(q=(0,t.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:e3,onChange:V}),eF[82]=e3,eF[83]=V,eF[84]=q):q=eF[84],eF[85]!==$||eF[86]!==q?(Q=(0,t.jsx)(eV,{value:"preferences",label:"Preferences",children:(0,t.jsxs)("div",{className:eq.default.Field,children:[O,(0,t.jsxs)("div",{className:eq.default.Control,children:[$,q]})]})}),eF[85]=$,eF[86]=q,eF[87]=Q):Q=eF[87],eF[88]!==e6?(K=e=>{e6(e.target.checked)},eF[88]=e6,eF[89]=K):K=eF[89],eF[90]!==e4||eF[91]!==K?(Y=(0,t.jsx)("input",{id:"audioInput",type:"checkbox",checked:e4,onChange:K}),eF[90]=e4,eF[91]=K,eF[92]=Y):Y=eF[92],eF[93]===Symbol.for("react.memo_cache_sentinel")?(J=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"audioInput",children:"Enable audio"}),eF[93]=J):J=eF[93],eF[94]!==Y?(Z=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[Y,J]}),eF[94]=Y,eF[95]=Z):Z=eF[95],eF[96]===Symbol.for("react.memo_cache_sentinel")?(X=(0,t.jsx)("label",{htmlFor:"volumeInput",children:"Master volume"}),eF[96]=X):X=eF[96],eF[97]!==e8?(ee=Math.round(100*e8),eF[97]=e8,eF[98]=ee):ee=eF[98],eF[99]!==ee?(et=(0,t.jsxs)("output",{htmlFor:"volumeInput",children:[ee,"%"]}),eF[99]=ee,eF[100]=et):et=eF[100],eF[101]!==e7?(er=e=>e7(parseFloat(e.target.value)),eF[101]=e7,eF[102]=er):er=eF[102],eF[103]!==e8||eF[104]!==er?(ea=(0,t.jsx)("input",{id:"volumeInput",type:"range",min:0,max:1,step:.05,value:e8,onChange:er}),eF[103]=e8,eF[104]=er,eF[105]=ea):ea=eF[105],eF[106]!==et||eF[107]!==ea?(en=(0,t.jsxs)("div",{className:eq.default.Field,children:[X,(0,t.jsxs)("div",{className:eq.default.Control,children:[et,ea]})]}),eF[106]=et,eF[107]=ea,eF[108]=en):en=eF[108],eF[109]!==Z||eF[110]!==en?(eo=(0,t.jsxs)(eV,{value:"audio",label:"Audio",children:[Z,en]}),eF[109]=Z,eF[110]=en,eF[111]=eo):eo=eF[111],eF[112]!==e2?(ei=e=>{e2(e.target.checked)},eF[112]=e2,eF[113]=ei):ei=eF[113],eF[114]!==e1||eF[115]!==ei?(el=(0,t.jsx)("input",{id:"fogInput",type:"checkbox",checked:e1,onChange:ei}),eF[114]=e1,eF[115]=ei,eF[116]=el):el=eF[116],eF[117]===Symbol.for("react.memo_cache_sentinel")?(es=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"fogInput",children:"Enable fog"}),eF[117]=es):es=eF[117],eF[118]!==el?(ec=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[el,es]}),eF[118]=el,eF[119]=ec):ec=eF[119],eF[120]!==te?(eu=e=>{te(e.target.checked)},eF[120]=te,eF[121]=eu):eu=eF[121],eF[122]!==e9||eF[123]!==eu?(ed=(0,t.jsx)("input",{id:"animationInput",type:"checkbox",checked:e9,onChange:eu}),eF[122]=e9,eF[123]=eu,eF[124]=ed):ed=eF[124],eF[125]===Symbol.for("react.memo_cache_sentinel")?(em=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"animationInput",children:"Enable animations"}),eF[125]=em):em=eF[125],eF[126]!==ed?(ef=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[ed,em]}),eF[126]=ed,eF[127]=ef):ef=eF[127],eF[128]!==ec||eF[129]!==ef?(eh=(0,t.jsxs)(eV,{value:"graphics",label:"Graphics",children:[ec,ef]}),eF[128]=ec,eF[129]=ef,eF[130]=eh):eh=eF[130],eF[131]!==tm?(ep=e=>{tm(e.target.checked)},eF[131]=tm,eF[132]=ep):ep=eF[132],eF[133]!==td||eF[134]!==ep?(eg=(0,t.jsx)("input",{id:"debugInput",type:"checkbox",checked:td,onChange:ep}),eF[133]=td,eF[134]=ep,eF[135]=eg):eg=eF[135],eF[136]===Symbol.for("react.memo_cache_sentinel")?(ev=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"debugInput",children:"Render debug visuals"}),eF[136]=ev):ev=eF[136],eF[137]!==eg?(ex=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[eg,ev]}),eF[137]=eg,eF[138]=ex):ex=eF[138],eF[139]!==th?(ey=e=>{th(e.target.checked)},eF[139]=th,eF[140]=ey):ey=eF[140],eF[141]!==tf||eF[142]!==ey?(eb=(0,t.jsx)("input",{id:"onDemandInput",type:"checkbox",checked:tf,onChange:ey}),eF[141]=tf,eF[142]=ey,eF[143]=eb):eb=eF[143],eF[144]===Symbol.for("react.memo_cache_sentinel")?(e_=(0,t.jsx)("label",{htmlFor:"onDemandInput",children:"Render on demand "}),eF[144]=e_):e_=eF[144],eF[145]!==ez?(eS=()=>ez.current?.(),eF[145]=ez,eF[146]=eS):eS=eF[146],eF[147]===Symbol.for("react.memo_cache_sentinel")?(ej=(0,t.jsx)(f,{}),eF[147]=ej):ej=eF[147],eF[148]!==eS?(eC=(0,t.jsxs)("div",{className:eq.default.Label,children:[e_,(0,t.jsx)("button",{type:"button",className:eq.default.ForceRenderButton,title:"Force render","aria-label":"Force render",onClick:eS,children:ej})]}),eF[148]=eS,eF[149]=eC):eC=eF[149],eF[150]===Symbol.for("react.memo_cache_sentinel")?(ew=(0,t.jsx)("p",{className:eq.default.Description,children:"Significantly decreases CPU and GPU usage by only rendering frames when requested. Helpful when developing parts of the app unrelated to rendering."}),eF[150]=ew):ew=eF[150],eF[151]!==eb||eF[152]!==eC?(eM=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[eb,eC,ew]}),eF[151]=eb,eF[152]=eC,eF[153]=eM):eM=eF[153],eF[154]!==ex||eF[155]!==eM?(eN=(0,t.jsxs)(eV,{value:"debug",label:"Debug",children:[ex,eM]}),eF[154]=ex,eF[155]=eM,eF[156]=eN):eN=eF[156],eF[157]!==H||eF[158]!==Q||eF[159]!==eo||eF[160]!==eh||eF[161]!==eN?(eT=(0,t.jsx)("div",{className:eq.default.Accordions,children:(0,t.jsxs)(e$,{type:"multiple",defaultValue:eZ,children:[H,Q,eo,eh,eN]})}),eF[157]=H,eF[158]=Q,eF[159]=eo,eF[160]=eh,eF[161]=eN,eF[162]=eT):eT=eF[162],eF[163]!==tp||eF[164]!==w||eF[165]!==eT?(ek=(0,t.jsx)("div",{className:eq.default.InspectorControls,children:(0,t.jsx)("div",{ref:ty,children:(0,t.jsxs)("div",{className:eq.default.Dropdown,ref:tv,id:"settingsPanel",tabIndex:-1,onKeyDown:t_,onBlur:tb,"data-open":tp,children:[w,eT]})})}),eF[163]=tp,eF[164]=w,eF[165]=eT,eF[166]=ek):ek=eF[166],ek}function e0(e){return"connected"===e.gameStatus||"authenticating"===e.gameStatus}var e1=e.i(11889),e2=e.i(56373),e3=e.i(86447),e5=e.i(1559),e4=e.i(78440),e6=e.i(59129),e8=e.i(25998),e7=e.i(18364),e9=e.i(68754),te=e.i(70238),tt=e.i(29402),tr=e.i(97442);let ta=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),tn={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},to={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},ti=(0,eJ.getMissionList)().filter(e=>!ta.has(e)).map(e=>{let t,r=(0,eJ.getMissionInfo)(e),[a]=(0,eJ.getSourceAndPath)(r.resourcePath),n=(t=a.match(/^(.*)(\/[^/]+)$/))?t[1]:"",o=tn[a]??to[n]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:a,groupName:o,missionTypes:r.missionTypes}}),tl=new Map(ti.map(e=>[e.missionName,e])),ts=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,tt.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,tt.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(ti),tc="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function tu(e){let a,n,o,i,l,s=(0,r.c)(12),{mission:c}=e,u=c.displayName||c.missionName;return s[0]!==u?(a=(0,t.jsx)("span",{className:tr.default.ItemName,children:u}),s[0]=u,s[1]=a):a=s[1],s[2]!==c.missionTypes?(n=c.missionTypes.length>0&&(0,t.jsx)("span",{className:tr.default.ItemTypes,children:c.missionTypes.map(td)}),s[2]=c.missionTypes,s[3]=n):n=s[3],s[4]!==a||s[5]!==n?(o=(0,t.jsxs)("span",{className:tr.default.ItemHeader,children:[a,n]}),s[4]=a,s[5]=n,s[6]=o):o=s[6],s[7]!==c.missionName?(i=(0,t.jsx)("span",{className:tr.default.ItemMissionName,children:c.missionName}),s[7]=c.missionName,s[8]=i):i=s[8],s[9]!==o||s[10]!==i?(l=(0,t.jsxs)(t.Fragment,{children:[o,i]}),s[9]=o,s[10]=i,s[11]=l):l=s[11],l}function td(e){return(0,t.jsx)("span",{className:tr.default.ItemType,"data-mission-type":e,children:e},e)}function tm(e){let n,o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_=(0,r.c)(48),{value:S,missionType:j,onChange:C,disabled:w,autoFocus:M}=e,[N,T]=(0,a.useState)(""),k=(0,a.useRef)(null),F=(0,a.useRef)(j);_[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{(0,a.startTransition)(()=>T(e))},_[0]=n):n=_[0];let R=(0,e7.useComboboxStore)({resetValueOnHide:!0,selectedValue:S,setSelectedValue:e=>{if(e){let t=F.current,r=(0,eJ.getMissionInfo)(e).missionTypes;t&&r.includes(t)||(t=r[0]),C({missionName:e,missionType:t}),k.current?.blur()}},setValue:n}),D=(0,e9.useStoreState)(R,"open");_[1]!==R?(o=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),k.current?.focus(),R.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},i=[R],_[1]=R,_[2]=o,_[3]=i):(o=_[2],i=_[3]),(0,a.useEffect)(o,i),_[4]!==S?(l=tl.get(S),_[4]=S,_[5]=l):l=_[5];let L=l;e:{let e,t;if(!N){let e;_[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:ts},_[6]=e):e=_[6],s=e;break e}_[7]!==N?(e=(0,te.matchSorter)(ti,N,{keys:["displayName","missionName","missionTypes","groupName"]}),_[7]=N,_[8]=e):e=_[8];let r=e;_[9]!==r?(t={type:"flat",missions:r},_[9]=r,_[10]=t):t=_[10],s=t}let B=s,I=L?L.displayName||L.missionName:S,A="flat"===B.type?0===B.missions.length:0===B.groups.length,P=e=>(0,t.jsx)(e2.ComboboxItem,{value:e.missionName,className:tr.default.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(F.current=r,e.missionName===S&&C({missionName:e.missionName,missionType:r})):F.current=null}else F.current=null},children:(0,t.jsx)(tu,{mission:e})},e.missionName),E=e4.ComboboxProvider,z=D?"visible":"hidden";_[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("div",{className:tr.default.Backdrop}),_[11]=c):c=_[11],_[12]!==z?(u=(0,t.jsx)(a.Activity,{mode:z,children:c}),_[12]=z,_[13]=u):u=_[13];let G=L?void 0:"Choose a map…";_[14]!==R?(d=()=>{try{document.exitPointerLock()}catch{}R.show()},m=e=>{"Escape"!==e.key||R.getState().open||k.current?.blur()},_[14]=R,_[15]=d,_[16]=m):(d=_[15],m=_[16]),_[17]!==M||_[18]!==w||_[19]!==d||_[20]!==m||_[21]!==G?(f=(0,t.jsx)(e1.Combobox,{ref:k,autoSelect:!0,autoFocus:M,disabled:w,placeholder:G,className:tr.default.Input,onFocus:d,onKeyDown:m}),_[17]=M,_[18]=w,_[19]=d,_[20]=m,_[21]=G,_[22]=f):f=_[22],_[23]!==I||_[24]!==j||_[25]!==L?(h=L&&(0,t.jsxs)("div",{className:tr.default.SelectedValue,children:[(0,t.jsx)("span",{className:tr.default.SelectedName,children:I}),j&&(0,t.jsx)("span",{className:tr.default.ItemType,"data-mission-type":j,children:j})]}),_[23]=I,_[24]=j,_[25]=L,_[26]=h):h=_[26],_[27]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)("kbd",{className:tr.default.Shortcut,children:tc?"⌘K":"^K"}),_[27]=p):p=_[27],_[28]!==f||_[29]!==h?(g=(0,t.jsxs)("div",{className:tr.default.InputWrapper,children:[f,h,p]}),_[28]=f,_[29]=h,_[30]=g):g=_[30];let U=e5.ComboboxPopover,W=tr.default,H=e3.ComboboxList,O=tr.default,$="flat"===B.type?B.missions.map(P):B.groups.map(e=>{let[r,n]=e;return r?(0,t.jsxs)(e6.ComboboxGroup,{className:tr.default.Group,children:[(0,t.jsx)(e8.ComboboxGroupLabel,{className:tr.default.GroupLabel,children:r}),n.map(P)]},r):(0,t.jsx)(a.Fragment,{children:n.map(P)},"ungrouped")});return _[31]!==A?(v=A&&(0,t.jsx)("div",{className:tr.default.NoResults,children:"No missions found"}),_[31]=A,_[32]=v):v=_[32],_[33]!==H||_[34]!==O.List||_[35]!==$||_[36]!==v?(x=(0,t.jsxs)(H,{className:O.List,children:[$,v]}),_[33]=H,_[34]=O.List,_[35]=$,_[36]=v,_[37]=x):x=_[37],_[38]!==U||_[39]!==W.Popover||_[40]!==x?(y=(0,t.jsx)(U,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:W.Popover,children:x}),_[38]=U,_[39]=W.Popover,_[40]=x,_[41]=y):y=_[41],_[42]!==E||_[43]!==R||_[44]!==g||_[45]!==y||_[46]!==u?(b=(0,t.jsxs)(E,{store:R,children:[u,g,y]}),_[42]=E,_[43]=R,_[44]=g,_[45]=y,_[46]=u,_[47]=b):b=_[47],b}var tf=e.i(58647);function th(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 6-6 8h12zM6 16h12v2H6z"},child:[]}]})(e)}var tp=e.i(16964);function tg(){let e,a,n,o,i,l,s=(0,r.c)(24),c=(0,eY.useDataSource)(),u=(0,eY.useMissionDisplayName)(),d=(0,eY.useMissionType)(),m=(0,eY.useMissionTypeDisplayName)(),f=(0,eY.useServerDisplayName)(),p=(0,eY.useRecorderName)(),g=(0,eY.useRecordingDate)(),[v,x]=g?g.split(" "):[null,null],y="live"===c,b=(0,N.useRecording)(),_=(0,M.useLiveSelector)(ty),S=tp.default;s[0]!==u||s[1]!==d||s[2]!==m?(e=u&&d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:tp.default.MissionName,children:u}),d&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("span",{className:tp.default.MissionType,"data-mission-type":d,children:"LCTF"===m?"LCTF":d})]})]}):null,s[0]=u,s[1]=d,s[2]=m,s[3]=e):e=s[3],s[4]!==e?(a=(0,t.jsx)("div",{className:tp.default.MissionInfo,children:e}),s[4]=e,s[5]=a):a=s[5];let j=tp.default,C=y?p?(0,t.jsxs)("div",{className:tp.default.Attribution,children:["Connected as"," ",(0,t.jsx)("span",{className:tp.default.PlayerName,children:p})]}):null:p&&g?(0,t.jsxs)("div",{className:tp.default.Attribution,children:["Recorded by ",(0,t.jsx)("span",{className:tp.default.PlayerName,children:p})," ","on"," ",(0,t.jsx)("span",{className:tp.default.RecordingDate,children:v.replace(/-/g," ")})," ","at ",(0,t.jsx)("span",{className:tp.default.RecordingDate,children:x})]}):null;return s[6]!==f?(n=f?(0,t.jsxs)("div",{className:tp.default.ServerInfo,children:["Server: ",(0,t.jsx)("span",{className:tp.default.ServerName,children:f})]}):null,s[6]=f,s[7]=n):n=s[7],s[8]!==j.Metadata||s[9]!==C||s[10]!==n?(o=(0,t.jsxs)("div",{className:j.Metadata,children:[C,n]}),s[8]=j.Metadata,s[9]=C,s[10]=n,s[11]=o):o=s[11],s[12]!==c||s[13]!==tv||s[14]!==tx||s[15]!==y||s[16]!==_||s[17]!==b?(i="demo"===c?(0,t.jsx)("button",{type:"button",className:tp.default.ActionButton,title:"Unload demo","aria-label":"Unload demo",onClick:tx,disabled:!b,children:(0,t.jsx)(th,{className:tp.default.EjectIcon})}):y?(0,t.jsx)("button",{type:"button",className:tp.default.ActionButton,title:"Disconnect","aria-label":"Disconnect",onClick:tv,disabled:!_,children:(0,t.jsx)(h,{})}):null,s[12]=c,s[13]=tv,s[14]=tx,s[15]=y,s[16]=_,s[17]=b,s[18]=i):i=s[18],s[19]!==S.Header||s[20]!==a||s[21]!==o||s[22]!==i?(l=(0,t.jsxs)("div",{className:S.Header,children:[a,o,i]}),s[19]=S.Header,s[20]=a,s[21]=o,s[22]=i,s[23]=l):l=s[23],l}function tv(){let e=M.liveConnectionStore.getState();e.disconnectServer(),e.disconnectRelay(),tf.engineStore.getState().setRecording(null)}function tx(){tf.engineStore.getState().setRecording(null)}function ty(e){return"connected"===e.gameStatus||"authenticating"===e.gameStatus}var tb=e.i(31067),t_=e.i(15080),tS=e.i(71753),tj=e.i(90072);let tC=a.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:n,children:o,...i},l)=>{let s=(0,t_.useThree)(({set:e})=>e),c=(0,t_.useThree)(({camera:e})=>e),u=(0,t_.useThree)(({size:e})=>e),d=a.useRef(null);a.useImperativeHandle(l,()=>d.current,[]);let m=a.useRef(null),f=function(e,t,r){let n=(0,t_.useThree)(e=>e.size),o=(0,t_.useThree)(e=>e.viewport),i="number"==typeof e?e:n.width*o.dpr,l=n.height*o.dpr,s=("number"==typeof e?void 0:e)||{},{samples:c=0,depth:u,...d}=s,m=null!=u?u:s.depthBuffer,f=a.useMemo(()=>{let e=new tj.WebGLRenderTarget(i,l,{minFilter:tj.LinearFilter,magFilter:tj.LinearFilter,type:tj.HalfFloatType,...d});return m&&(e.depthTexture=new tj.DepthTexture(i,l,tj.FloatType)),e.samples=c,e},[]);return a.useLayoutEffect(()=>{f.setSize(i,l),c&&(f.samples=c)},[c,f,i,l]),a.useEffect(()=>()=>f.dispose(),[]),f}(t);a.useLayoutEffect(()=>{i.manual||(d.current.aspect=u.width/u.height)},[u,i]),a.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let h=0,p=null,g="function"==typeof o;return(0,tS.useFrame)(t=>{g&&(r===1/0||h{if(n)return s(()=>({camera:d.current})),()=>s(()=>({camera:c}))},[d,n,s]),a.createElement(a.Fragment,null,a.createElement("perspectiveCamera",(0,tb.default)({ref:d},i),!g&&o),a.createElement("group",{ref:m},g&&o(f.texture)))});function tw(){let e,a,n=(0,r.c)(3),{fov:o}=(0,b.useSettings)();return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],n[0]=e):e=n[0],n[1]!==o?(a=(0,t.jsx)(tC,{makeDefault:!0,position:e,fov:o}),n[1]=o,n[2]=a):a=n[2],a}var tM=e.i(51434),tN=e.i(68294),tT=e.i(77964),tk=e.i(93784),tF=e.i(91907),tR=e.i(25947),tD=e.i(46325),tL=e.i(31999),tB=e.i(89887);function tI(e){let t,n,o,i,l=(0,r.c)(12),{entity:s}=e,{registerCamera:c,unregisterCamera:u}=(0,tN.useCameras)(),d=(0,a.useId)(),m=s.cameraDataBlock;l[0]!==s.position?(t=s.position?new tj.Vector3(...s.position):new tj.Vector3,l[0]=s.position,l[1]=t):t=l[1];let f=t;l[2]!==s.rotation?(n=s.rotation?new tj.Quaternion(...s.rotation):new tj.Quaternion,l[2]=s.rotation,l[3]=n):n=l[3];let h=n;return l[4]!==m||l[5]!==d||l[6]!==f||l[7]!==c||l[8]!==h||l[9]!==u?(o=()=>{if("Observer"===m){let e={id:d,position:f,rotation:h};return c(e),()=>{u(e)}}},i=[d,m,c,u,f,h],l[4]=m,l[5]=d,l[6]=f,l[7]=c,l[8]=h,l[9]=u,l[10]=o,l[11]=i):(o=l[10],i=l[11]),(0,a.useEffect)(o,i),null}function tA(e){let a,n=(0,r.c)(3),{entity:o}=e;return n[0]!==o.label||n[1]!==o.position?(a=o.label?(0,t.jsx)(tB.FloatingLabel,{position:o.position,opacity:.6,children:o.label}):null,n[0]=o.label,n[1]=o.position,n[2]=a):a=n[2],a}var tP=e.i(66027),tE=e.i(63318),tz=e.i(12979),tG=e.i(75567),tU=e.i(47071);let tW={value:!0},tH=` +vec3 terrainLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 terrainSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`;var tO=e.i(47021),t$=e.i(48066);let tV={0:32,1:32,2:32,3:32,4:32,5:32},tq=(0,a.memo)(function({displacementMap:e,visibilityMask:r,textureNames:n,alphaTextures:o,detailTextureName:i,lightmap:l}){let{debugMode:s}=(0,b.useDebug)(),c=(0,tU.useTexture)(n.map(e=>(0,tz.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,tG.setupTexture)(e))}),u=i?(0,tz.textureToUrl)(i):null,d=(0,tU.useTexture)(u??tz.FALLBACK_TEXTURE_URL,e=>{(0,tG.setupTexture)(e)}),m=(0,a.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:n,detailTexture:o=null,lightmap:i=null}){e.uniforms.sunLightPointsDown=tW;let l=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:n[r]??32}}),i&&(e.uniforms.terrainLightmap={value:i}),o&&(e.uniforms.detailTexture={value:o},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include +varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include +vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` +uniform sampler2D albedo0; +uniform sampler2D albedo1; +uniform sampler2D albedo2; +uniform sampler2D albedo3; +uniform sampler2D albedo4; +uniform sampler2D albedo5; +uniform sampler2D mask0; +uniform sampler2D mask1; +uniform sampler2D mask2; +uniform sampler2D mask3; +uniform sampler2D mask4; +uniform sampler2D mask5; +uniform float tiling0; +uniform float tiling1; +uniform float tiling2; +uniform float tiling3; +uniform float tiling4; +uniform float tiling5; +${a?"uniform sampler2D visibilityMask;":""} +${i?"uniform sampler2D terrainLightmap;":""} +uniform bool sunLightPointsDown; +${o?`uniform sampler2D detailTexture; +uniform float detailTiling; +uniform float detailFadeDistance; +varying vec3 vTerrainWorldPos;`:""} + +${tH} + +// Global variable to store shadow factor from RE_Direct for use in output calculation +float terrainShadowFactor = 1.0; +`+e.fragmentShader,a){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} + // Early discard for invisible areas (before fog/lighting) + float visibility = texture2D(visibilityMask, vMapUv).r; + if (visibility < 0.5) { + discard; + } + `)}e.fragmentShader=e.fragmentShader.replace("#include ",` + // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) + vec2 baseUv = vMapUv; + vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; + ${l>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} + ${l>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} + ${l>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} + ${l>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} + ${l>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} + + // Sample alpha masks for all layers (use R channel) + // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), + // but GPU linear filtering samples at texel centers. This offset aligns them. + vec2 alphaUv = baseUv + vec2(0.5 / 256.0); + float a0 = texture2D(mask0, alphaUv).r; + ${l>1?"float a1 = texture2D(mask1, alphaUv).r;":""} + ${l>2?"float a2 = texture2D(mask2, alphaUv).r;":""} + ${l>3?"float a3 = texture2D(mask3, alphaUv).r;":""} + ${l>4?"float a4 = texture2D(mask4, alphaUv).r;":""} + ${l>5?"float a5 = texture2D(mask5, alphaUv).r;":""} + + // Torque-style additive weighted blending (blender.cc): + // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... + // Each layer's alpha map defines its contribution weight. + vec3 blended = c0 * a0; + ${l>1?"blended += c1 * a1;":""} + ${l>2?"blended += c2 * a2;":""} + ${l>3?"blended += c3 * a3;":""} + ${l>4?"blended += c4 * a4;":""} + ${l>5?"blended += c5 * a5;":""} + + // Assign to diffuseColor before lighting + vec3 textureColor = blended; + + ${o?`// Detail texture blending (Torque-style multiplicative blend) + // Sample detail texture at high frequency tiling + vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; + + // Calculate distance-based fade factor using world positions + // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance + float distToCamera = distance(vTerrainWorldPos, cameraPosition); + float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); + + // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) + // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray + // Direct multiplication adds subtle darkening for surface detail + textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} + + // Store blended texture in diffuseColor (still in linear space here) + // We'll convert to sRGB in the output calculation + diffuseColor.rgb = textureColor; +`),i&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include + +// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting +#undef RE_Direct +void RE_Direct_TerrainShadow( 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 ) { + // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient + // This prevents shadow acne from light hitting terrain backfaces + if (!sunLightPointsDown) { + terrainShadowFactor = 0.0; + return; + } + // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) + // Extract shadow factor by comparing to original sun color + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 originalSunColor = directionalLights[0].color; + float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); + float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); + terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); + #endif + // Don't add to reflectedLight - we'll compute lighting in gamma space at output +} +#define RE_Direct RE_Direct_TerrainShadow + +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +// Clear indirect diffuse - we'll compute ambient in gamma space +#if defined( RE_IndirectDiffuse ) + irradiance = vec3(0.0); +#endif +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include + // Clear Three.js lighting - we compute everything in gamma space + reflectedLight.directDiffuse = vec3(0.0); + reflectedLight.indirectDiffuse = vec3(0.0); +`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +{ + // Get texture in sRGB space (undo Three.js linear decode) + vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); + + ${i?` + // Sample terrain lightmap for smooth NdotL + vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); + float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; + + // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) + // Three.js interprets them as linear, but the numerical values are preserved + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 sunColorSRGB = directionalLights[0].color; + #else + vec3 sunColorSRGB = vec3(0.7); + #endif + vec3 ambientColorSRGB = ambientLightColor; + + // Torque formula (terrLighting.cc:471-483): + // lighting = ambient + NdotL * shadowFactor * sunColor + // Clamp lighting to [0,1] before multiplying by texture + vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); + `:` + // No lightmap - use simple ambient lighting + vec3 lightingSRGB = ambientLightColor; + `} + + // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space + vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + + // Convert back to linear for Three.js output pipeline + outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; +} +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE + // Debug mode: overlay green grid matching terrain grid squares (256x256) + float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); + vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green + gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); +#endif + +#include `)}({shader:e,baseTextures:c,alphaTextures:o,visibilityMask:r,tiling:tV,detailTexture:u?d:null,lightmap:l}),(0,tO.injectCustomFog)(e,t$.globalFogUniforms)},[c,o,r,d,u,l]),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=f.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!s,e.needsUpdate=!0)},[s]);let h=`${u?"detail":"nodetail"}-${l?"lightmap":"nolightmap"}`;return(0,t.jsx)("meshLambertMaterial",{ref:f,map:e,depthWrite:!0,side:tj.FrontSide,defines:{DEBUG_MODE:+!!s},onBeforeCompile:m},h)}),tQ=(0,a.memo)(function(e){let n,o,i=(0,r.c)(8),{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),i[0]=n):n=i[0],i[1]!==u||i[2]!==d||i[3]!==l||i[4]!==m||i[5]!==c||i[6]!==s?(o=(0,t.jsx)(a.Suspense,{fallback:n,children:(0,t.jsx)(tq,{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m})}),i[1]=u,i[2]=d,i[3]=l,i[4]=m,i[5]=c,i[6]=s,i[7]=o):o=i[7],o}),tK=(0,a.memo)(function(e){let a,n,o,i=(0,r.c)(15),{tileX:l,tileZ:s,blockSize:c,basePosition:u,textureNames:d,geometry:m,displacementMap:f,visibilityMask:h,alphaTextures:p,detailTextureName:g,lightmap:v,visible:x}=e,y=void 0===x||x,b=c/2,_=u.x+l*c+b,S=u.z+s*c+b;i[0]!==_||i[1]!==S?(a=[_,0,S],i[0]=_,i[1]=S,i[2]=a):a=i[2];let j=a;return i[3]!==p||i[4]!==g||i[5]!==f||i[6]!==v||i[7]!==d||i[8]!==h?(n=(0,t.jsx)(tQ,{displacementMap:f,visibilityMask:h,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),i[3]=p,i[4]=g,i[5]=f,i[6]=v,i[7]=d,i[8]=h,i[9]=n):n=i[9],i[10]!==m||i[11]!==j||i[12]!==n||i[13]!==y?(o=(0,t.jsx)("mesh",{position:j,geometry:m,castShadow:!0,receiveShadow:!0,visible:y,children:n}),i[10]=m,i[11]=j,i[12]=n,i[13]=y,i[14]=o):o=i[14],o});function tY(e){}let tJ=(0,w.createLogger)("TerrainBlock");function tZ(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,n=r>>16,o=256*a;for(let r=0;r0?S.visibleDistance:600,I=(0,t_.useThree)(t0),A=-(128*R);T[0]!==A?(n={x:A,z:A},T[0]=A,T[1]=n):n=T[1];let P=n;T[2]!==k.emptySquareRuns?(o=k.emptySquareRuns??[],T[2]=k.emptySquareRuns,T[3]=o):o=T[3];let E=o,{data:z}=((M=(0,r.c)(8))[0]!==F?(j={queryKey:["terrain",F],queryFn:()=>(tJ.debug("Loading terrain: %s",F),(0,tz.loadTerrain)(F))},M[0]=F,M[1]=j):j=M[1],N=(0,tP.useQuery)(j),M[2]!==N.data||M[3]!==N.error||M[4]!==N.status||M[5]!==F?(C=()=>{tJ.debug("Query status: %s%s%s file=%s",N.status,N.error?` error=${N.error.message}`:"",N.data?" (data ready)":" (no data)",F)},w=[N.status,N.error,N.data,F],M[2]=N.data,M[3]=N.error,M[4]=N.status,M[5]=F,M[6]=C,M[7]=w):(C=M[6],w=M[7]),(0,a.useEffect)(C,w),N);e:{let e;if(!z){i=null;break e}let t=256*R;T[4]!==t||T[5]!==R||T[6]!==z.heightMap?(!function(e,t,r){let a=e.attributes.position,n=e.attributes.uv,o=e.attributes.normal,i=a.array,l=n.array,s=o.array,c=a.count,u=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let a=Math.floor(e=Math.max(0,Math.min(255,e))),n=Math.floor(r=Math.max(0,Math.min(255,r))),o=Math.min(a+1,255),i=Math.min(n+1,255),l=e-a,s=r-n;return(t[256*n+a]/65535*2048*(1-l)+t[256*n+o]/65535*2048*l)*(1-s)+(t[256*i+a]/65535*2048*(1-l)+t[256*i+o]/65535*2048*l)*s};for(let e=0;e0?(h/=v,p/=v,g/=v):(h=0,p=1,g=0),s[3*e]=h,s[3*e+1]=p,s[3*e+2]=g}a.needsUpdate=!0,o.needsUpdate=!0}(e=function(e,t){let r=new tj.BufferGeometry,a=new Float32Array(198147),n=new Float32Array(198147),o=new Float32Array(132098),i=new Uint32Array(393216),l=0,s=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let i=257*t+r;a[3*i]=r*s-e/2,a[3*i+1]=e/2-t*s,a[3*i+2]=0,n[3*i]=0,n[3*i+1]=0,n[3*i+2]=1,o[2*i]=r/256,o[2*i+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,n=(e+1)*257+t,o=n+1;((t^e)&1)==0?(i[l++]=r,i[l++]=n,i[l++]=o,i[l++]=r,i[l++]=o,i[l++]=a):(i[l++]=r,i[l++]=n,i[l++]=a,i[l++]=a,i[l++]=n,i[l++]=o)}return r.setIndex(new tj.BufferAttribute(i,1)),r.setAttribute("position",new tj.Float32BufferAttribute(a,3)),r.setAttribute("normal",new tj.Float32BufferAttribute(n,3)),r.setAttribute("uv",new tj.Float32BufferAttribute(o,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),z.heightMap,R),T[4]=t,T[5]=R,T[6]=z.heightMap,T[7]=e):e=T[7],i=e}let G=i;T[8]!==R||T[9]!==z?(l=()=>{if(z){var e;return tY((e=z.heightMap,(t,r)=>{let a=Math.max(0,Math.min(255,t/R+128)),n=Math.max(0,Math.min(255,r/R+128)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]*(1-c)+e[256*i+l]*c)*(1-u)+(e[256*s+o]*(1-c)+e[256*s+l]*c)*u)/65535*2048})),t1}},s=[z,R],T[8]=R,T[9]=z,T[10]=l,T[11]=s):(l=T[10],s=T[11]),(0,a.useEffect)(l,s);let U=(0,eY.useSceneSun)();t:{let e,t;if(!U){let e;T[12]===Symbol.for("react.memo_cache_sentinel")?(e=new tj.Vector3(.57735,-.57735,.57735),T[12]=e):e=T[12],c=e;break t}T[13]!==U.direction?(e=(0,tE.torqueToThree)(U.direction),T[13]=U.direction,T[14]=e):e=T[14];let[r,a,n]=e,o=Math.sqrt(r*r+a*a+n*n),i=r/o,l=a/o,s=n/o;T[15]!==s||T[16]!==i||T[17]!==l?(t=new tj.Vector3(i,l,s),T[15]=s,T[16]=i,T[17]=l,T[18]=t):t=T[18],c=t}let W=c;r:{let e;if(!z){u=null;break r}T[19]!==R||T[20]!==W||T[21]!==z.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),n=Math.max(0,Math.min(255,r)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]/65535*(1-c)+e[256*i+l]/65535*c)*(1-u)+(e[256*s+o]/65535*(1-c)+e[256*s+l]/65535*c)*u)*2048},n=new tj.Vector3(-t.x,-t.y,-t.z).normalize(),o=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=t/2+.25,l=e/2+.25,s=a(i,l),c=a(i-.5,l),u=a(i+.5,l),d=a(i,l-.5),m=-((a(i,l+.5)-d)/1),f=-((u-c)/1),h=Math.sqrt(m*m+r*r+f*f),p=Math.max(0,m/h*n.x+r/h*n.y+f/h*n.z),g=1;p>0&&(g=function(e,t,r,a,n,o){let i=a.z/n,l=a.x/n,s=a.y,c=Math.sqrt(i*i+l*l);if(c<1e-4)return 1;let u=.5/c,d=i*u,m=l*u,f=s*u,h=e,p=t,g=r+.1;for(let e=0;e<768&&(h+=d,p+=m,g+=f,!(h<0)&&!(h>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(K).fill(null),T[32]=K,T[33]=g):g=T[33];let[J,Z]=(0,a.useState)(g);T[34]===Symbol.for("react.memo_cache_sentinel")?(v={xStart:0,xEnd:0,zStart:0,zEnd:0},T[34]=v):v=T[34];let X=(0,a.useRef)(v);return(T[35]!==P.x||T[36]!==P.z||T[37]!==L||T[38]!==I.position.x||T[39]!==I.position.z||T[40]!==K||T[41]!==B?(x=()=>{let e=I.position.x-P.x,t=I.position.z-P.z,r=Math.floor((e-B)/L),a=Math.ceil((e+B)/L),n=Math.floor((t-B)/L),o=Math.ceil((t+B)/L),i=X.current;if(r===i.xStart&&a===i.xEnd&&n===i.zStart&&o===i.zEnd)return;i.xStart=r,i.xEnd=a,i.zStart=n,i.zEnd=o;let l=[];for(let e=r;e{let r=J[e];return(0,t.jsx)(tK,{tileX:r?.tileX??0,tileZ:r?.tileZ??0,blockSize:L,basePosition:P,textureNames:z.textureNames,geometry:G,displacementMap:O,visibilityMask:V,alphaTextures:q,detailTextureName:D,lightmap:H,visible:null!==r},e)}),T[53]=P,T[54]=L,T[55]=D,T[56]=Y,T[57]=q,T[58]=O,T[59]=G,T[60]=z.textureNames,T[61]=H,T[62]=J,T[63]=b):b=T[63],T[64]!==y||T[65]!==b?(_=(0,t.jsxs)(t.Fragment,{children:[y,b]}),T[64]=y,T[65]=b,T[66]=_):_=T[66],_):(tJ.debug("Not ready: terrain=%s geometry=%s displacement=%s alpha=%s",!!z,!!G,!!O,!!q),null)});function t0(e){return e.camera}function t1(){return tY(null)}function t2(e){return(0,tG.setupMask)(e)}function t3(e,t){return t}var t5=e.i(8597),t4=e.i(78140);let t6=` +vec3 interiorLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 interiorSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`,t8=(0,w.createLogger)("InteriorInstance");function t7({materialName:e,material:r,lightMap:n}){let o=(0,b.useDebug)(),i=o?.debugMode??!1,l=(0,tz.textureToUrl)(e),s=(0,tU.useTexture)(l,e=>(0,tG.setupTexture)(e)),c=new Set(r?.userData?.flag_names??[]).has("SelfIlluminating"),u=new Set(r?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),d=(0,a.useCallback)(e=>{let t;(0,tO.injectCustomFog)(e,t$.globalFogUniforms),t=u??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new tj.Vector3(0,.4,1):new tj.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +${t6} +uniform bool useSceneLighting; +uniform vec3 interiorDebugColor; +`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation +#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +// Get texture in sRGB space (undo Three.js linear decode) +vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); + +// Compute lighting in sRGB space +vec3 lightingSRGB = vec3(0.0); + +if (useSceneLighting) { + // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI + // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear + vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); + vec3 extractedLighting = totalLight * PI / safeTexLinear; + // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors + // are sRGB values (Torque used them directly in gamma space). Three.js treats them + // as linear but the numerical values are the same. DO NOT convert to sRGB here! + // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap + // (sceneLighting.cc line 1785: tmp.clamp()) + lightingSRGB = clamp(extractedLighting, 0.0, 1.0); +} + +// Add lightmap contribution (for BOTH outside and inside surfaces) +// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load +// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. +#ifdef USE_LIGHTMAP + // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back + lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); +#endif +// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) +lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); + +// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space +vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + +// Convert back to linear for Three.js output pipeline +vec3 resultLinear = interiorSRGBToLinear(resultSRGB); + +// Reassign outgoingLight before opaque_fragment consumes it +outgoingLight = resultLinear + totalEmissiveRadiance; + +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering +// Blue grid = SurfaceOutsideVisible (receives scene ambient light) +// Red grid = inside surface (no scene ambient light) +#if DEBUG_MODE && defined(USE_MAP) + // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide + float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); + gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); +#endif + +#include `)},[u]),m=(0,a.useRef)(null),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=m.current??f.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let h={DEBUG_MODE:+!!i},p=`${u}`;return c?(0,t.jsx)("meshBasicMaterial",{ref:m,map:s,toneMapped:!1,defines:h,onBeforeCompile:d},p):(0,t.jsx)("meshLambertMaterial",{ref:f,map:s,lightMap:n,toneMapped:!1,defines:h,onBeforeCompile:d},p)}function t9(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=tj.SRGBColorSpace),t??null}function re(e){let a,n,o,i=(0,r.c)(13),{node:l}=e;e:{let e,t;if(!l.material){let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0],a=e;break e}if(Array.isArray(l.material)){let e;i[1]!==l.material?(e=l.material.map(rt),i[1]=l.material,i[2]=e):e=i[2],a=e;break e}i[3]!==l.material?(e=t9(l.material),i[3]=l.material,i[4]=e):e=i[4],i[5]!==e?(t=[e],i[5]=e,i[6]=t):t=i[6],a=t}let s=a;return i[7]!==s||i[8]!==l.material?(n=l.material?(0,t.jsx)(tD.DebugSuspense,{name:`InteriorTexture:${Array.isArray(l.material)?l.material[0]?.userData?.resource_path:l.material?.userData?.resource_path??"?"}`,fallback:(0,t.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,r)=>(0,t.jsx)(t7,{materialName:e.userData.resource_path,material:e,lightMap:s[r]},r)):(0,t.jsx)(t7,{materialName:l.material.userData.resource_path,material:l.material,lightMap:s[0]})}):null,i[7]=s,i[8]=l.material,i[9]=n):n=i[9],i[10]!==l.geometry||i[11]!==n?(o=(0,t.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:n}),i[10]=l.geometry,i[11]=n,i[12]=o):o=i[12],o}function rt(e){return t9(e)}let rr=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u=(0,r.c)(10),{interiorFile:d,ghostIndex:m}=e,{nodes:f}=((s=(0,r.c)(2))[0]!==d?(l=(0,tz.interiorToUrl)(d),s[0]=d,s[1]=l):l=s[1],c=l,(0,t4.useGLTF)(c)),h=(0,b.useDebug)(),p=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=[0,-Math.PI/2,0],u[0]=a):a=u[0],u[1]!==f?(n=Object.entries(f).filter(ri).map(rl),u[1]=f,u[2]=n):n=u[2],u[3]!==p||u[4]!==m||u[5]!==d?(o=p?(0,t.jsxs)(tB.FloatingLabel,{children:[m,": ",d]}):null,u[3]=p,u[4]=m,u[5]=d,u[6]=o):o=u[6],u[7]!==n||u[8]!==o?(i=(0,t.jsxs)("group",{rotation:a,children:[n,o]}),u[7]=n,u[8]=o,u[9]=i):i=u[9],i});function ra(e){let a,n,o,i,l=(0,r.c)(9),{color:s,label:c}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),l[0]=a):a=l[0],l[1]!==s?(n=(0,t.jsx)("meshStandardMaterial",{color:s,wireframe:!0}),l[1]=s,l[2]=n):n=l[2],l[3]!==s||l[4]!==c?(o=c?(0,t.jsx)(tB.FloatingLabel,{color:s,children:c}):null,l[3]=s,l[4]=c,l[5]=o):o=l[5],l[6]!==n||l[7]!==o?(i=(0,t.jsxs)("mesh",{children:[a,n,o]}),l[6]=n,l[7]=o,l[8]=i):i=l[8],i}function rn(e){let a,n=(0,r.c)(3),{label:o}=e,i=(0,b.useDebug)(),l=i?.debugMode??!1;return n[0]!==l||n[1]!==o?(a=l?(0,t.jsx)(ra,{color:"red",label:o}):null,n[0]=l,n[1]=o,n[2]=a):a=n[2],a}let ro=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u,d,m,f=(0,r.c)(26),{scene:h}=e;f[0]!==h.transform.position?(a=(0,tE.torqueToThree)(h.transform.position),f[0]=h.transform.position,f[1]=a):a=f[1];let p=a;f[2]!==h.transform?(n=(0,tE.matrixFToQuaternion)(h.transform),f[2]=h.transform,f[3]=n):n=f[3];let g=n;f[4]!==h.scale?(o=(0,tE.torqueScaleToThree)(h.scale),f[4]=h.scale,f[5]=o):o=f[5];let v=o,x=`${h.ghostIndex}: ${h.interiorFile}`;f[6]!==x?(i=(0,t.jsx)(rn,{label:x}),f[6]=x,f[7]=i):i=f[7],f[8]!==h.interiorFile?(l=e=>{t8.error("Failed to load %s: %s",h.interiorFile,e.message)},f[8]=h.interiorFile,f[9]=l):l=f[9];let y=`InteriorModel:${h.interiorFile}`;return f[10]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(ra,{color:"orange"}),f[10]=s):s=f[10],f[11]!==h.ghostIndex||f[12]!==h.interiorFile?(c=(0,t.jsx)(rr,{interiorFile:h.interiorFile,ghostIndex:h.ghostIndex}),f[11]=h.ghostIndex,f[12]=h.interiorFile,f[13]=c):c=f[13],f[14]!==y||f[15]!==c?(u=(0,t.jsx)(tD.DebugSuspense,{name:y,fallback:s,children:c}),f[14]=y,f[15]=c,f[16]=u):u=f[16],f[17]!==u||f[18]!==i||f[19]!==l?(d=(0,t.jsx)(t5.ErrorBoundary,{fallback:i,onError:l,children:u}),f[17]=u,f[18]=i,f[19]=l,f[20]=d):d=f[20],f[21]!==p||f[22]!==g||f[23]!==v||f[24]!==d?(m=(0,t.jsx)("group",{position:p,quaternion:g,scale:v,children:d}),f[21]=p,f[22]=g,f[23]=v,f[24]=d,f[25]=m):m=f[25],m});function ri(e){let[,t]=e;return t.isMesh}function rl(e){let[r,a]=e;return(0,t.jsx)(re,{node:a},r)}var rs=e.i(99143);function rc(e,{path:t}){let[r]=(0,rs.useLoader)(tj.CubeTextureLoader,[e],e=>e.setPath(t));return r}rc.preload=(e,{path:t})=>rs.useLoader.preload(tj.CubeTextureLoader,[e],e=>e.setPath(t));let ru=()=>{};function rd(e){return e.wrapS=tj.RepeatWrapping,e.wrapT=tj.RepeatWrapping,e.minFilter=tj.LinearFilter,e.magFilter=tj.LinearFilter,e.colorSpace=tj.NoColorSpace,e.needsUpdate=!0,e}let rm=` + attribute float alpha; + + uniform vec2 uvOffset; + + varying vec2 vUv; + varying float vAlpha; + + void main() { + // Apply UV offset for scrolling + vUv = uv + uvOffset; + vAlpha = alpha; + + vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + // Set depth to far plane so clouds are always visible and behind other geometry + gl_Position = pos.xyww; + } +`,rf=` + uniform sampler2D cloudTexture; + uniform float debugMode; + uniform int layerIndex; + + varying vec2 vUv; + varying float vAlpha; + + // Debug grid using screen-space derivatives for sharp, anti-aliased lines + float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); + } + + void main() { + vec4 texColor = texture2D(cloudTexture, vUv); + + // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color + // Vertex color is white with varying alpha, so: + // Final RGB = Texture RGB \xd7 1.0 = Texture RGB + // Final Alpha = Texture Alpha \xd7 Vertex Alpha + float finalAlpha = texColor.a * vAlpha; + vec3 color = texColor.rgb; + + // Debug mode: overlay R/G/B grid for layers 0/1/2 + if (debugMode > 0.5) { + float gridIntensity = debugGrid(vUv, 4.0, 1.5); + vec3 gridColor; + if (layerIndex == 0) { + gridColor = vec3(1.0, 0.0, 0.0); // Red + } else if (layerIndex == 1) { + gridColor = vec3(0.0, 1.0, 0.0); // Green + } else { + gridColor = vec3(0.0, 0.0, 1.0); // Blue + } + color = mix(color, gridColor, gridIntensity * 0.5); + } + + // Output clouds with texture color and combined alpha + gl_FragColor = vec4(color, finalAlpha); + } +`;function rh({textureUrl:e,radius:r,heightPercent:n,speed:o,windDirection:i,layerIndex:l}){let{debugMode:s}=(0,b.useDebug)(),{animationEnabled:c}=(0,b.useSettings)(),u=(0,a.useRef)(null),d=(0,tU.useTexture)(e,rd),m=(0,a.useMemo)(()=>{let e=n-.05;return function(e,t,r,a){var n;let o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_,S=new tj.BufferGeometry,j=new Float32Array(75),C=new Float32Array(50),w=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,n=-e+r*M,o=e-t*M,i=e*w[a];j[3*a]=n,j[3*a+1]=i,j[3*a+2]=o,C[2*a]=r,C[2*a+1]=t}n=j,o=e=>({x:n[3*e],y:n[3*e+1],z:n[3*e+2]}),i=(e,t,r,a)=>{n[3*e]=t,n[3*e+1]=r,n[3*e+2]=a},l=o(1),s=o(3),c=o(5),u=o(6),d=o(8),m=o(9),f=o(15),h=o(16),p=o(18),g=o(19),v=o(21),x=o(23),y=c.x+(l.x-c.x)*.5,b=c.y+(l.y-c.y)*.5,_=c.z+(l.z-c.z)*.5,i(0,u.x+(y-u.x)*2,u.y+(b-u.y)*2,u.z+(_-u.z)*2),y=m.x+(s.x-m.x)*.5,b=m.y+(s.y-m.y)*.5,_=m.z+(s.z-m.z)*.5,i(4,d.x+(y-d.x)*2,d.y+(b-d.y)*2,d.z+(_-d.z)*2),y=v.x+(f.x-v.x)*.5,b=v.y+(f.y-v.y)*.5,_=v.z+(f.z-v.z)*.5,i(20,h.x+(y-h.x)*2,h.y+(b-h.y)*2,h.z+(_-h.z)*2),y=x.x+(g.x-x.x)*.5,b=x.y+(g.y-x.y)*.5,_=x.z+(g.z-x.z)*.5,i(24,p.x+(y-p.x)*2,p.y+(b-p.y)*2,p.z+(_-p.z)*2);let N=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let n=e[3*a],o=e[3*a+2],i=1.3-Math.sqrt(n*n+o*o)/t;i<.4?i=0:i>.8&&(i=1),r[a]=i}return r}(j,e),T=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,n=r+5,o=n+1;T.push(r,n,o),T.push(r,o,a)}return S.setIndex(T),S.setAttribute("position",new tj.Float32BufferAttribute(j,3)),S.setAttribute("uv",new tj.Float32BufferAttribute(C,2)),S.setAttribute("alpha",new tj.Float32BufferAttribute(N,1)),S.computeBoundingSphere(),S}(r,n,e,0)},[r,n]);(0,a.useEffect)(()=>()=>{m.dispose()},[m]);let f=(0,a.useMemo)(()=>new tj.ShaderMaterial({uniforms:{cloudTexture:{value:d},uvOffset:{value:new tj.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:l}},vertexShader:rm,fragmentShader:rf,transparent:!0,depthWrite:!1,side:tj.DoubleSide}),[d,s,l]);return(0,a.useEffect)(()=>()=>{f.dispose()},[f]),(0,tS.useFrame)(c?(e,t)=>{let r=1e3*t/32;u.current??=new tj.Vector2(0,0),u.current.x+=i.x*o*r,u.current.y+=i.y*o*r,u.current.x-=Math.floor(u.current.x),u.current.y-=Math.floor(u.current.y),f.uniforms.uvOffset.value.copy(u.current)}:ru),(0,t.jsx)("mesh",{geometry:m,frustumCulled:!1,renderOrder:10,children:(0,t.jsx)("primitive",{object:f,attach:"material"})})}function rp(e){var n;let o,i,l,s,c,u,d,m,f,h,p,g=(0,r.c)(18),{scene:v}=e,{data:x}=(n=v.materialList||void 0,(h=(0,r.c)(7))[0]!==n?(d=["detailMapList",n],m=()=>(0,tz.loadDetailMapList)(n),h[0]=n,h[1]=d,h[2]=m):(d=h[1],m=h[2]),p=!!n,h[3]!==d||h[4]!==m||h[5]!==p?(f={queryKey:d,queryFn:m,enabled:p},h[3]=d,h[4]=m,h[5]=p,h[6]=f):f=h[6],(0,tP.useQuery)(f)),y=.95*(v.visibleDistance>0?v.visibleDistance:500);g[0]!==v.cloudLayers?(o=v.cloudLayers.map(rv),g[0]=v.cloudLayers,g[1]=o):o=g[1];let b=o;g[2]!==v.cloudLayers?(i=v.cloudLayers.map(rg),g[2]=v.cloudLayers,g[3]=i):i=g[3];let _=i;e:{let e,{x:t,y:r}=v.windVelocity;if(0!==t||0!==r){let e;g[4]!==t||g[5]!==r?(e=new tj.Vector2(r,-t).normalize(),g[4]=t,g[5]=r,g[6]=e):e=g[6],l=e;break e}g[7]===Symbol.for("react.memo_cache_sentinel")?(e=new tj.Vector2(1,0),g[7]=e):e=g[7],l=e}let S=l;t:{let e;if(!x){let e;g[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],g[8]=e):e=g[8],s=e;break t}if(g[9]!==_||g[10]!==b||g[11]!==x){e=[];for(let t=0;t<3;t++){let r=x[7+t];r&&e.push({texture:r,height:_[t],speed:b[t]})}g[9]=_,g[10]=b,g[11]=x,g[12]=e}else e=g[12];s=e}let j=s,C=(0,a.useRef)(null);return(g[13]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let{camera:t}=e;C.current&&C.current.position.copy(t.position)},g[13]=c):c=g[13],(0,tS.useFrame)(c),j&&0!==j.length)?(g[14]!==j||g[15]!==y||g[16]!==S?(u=(0,t.jsx)("group",{ref:C,children:j.map((e,r)=>{let n=(0,tz.textureToUrl)(e.texture);return(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rh,{textureUrl:n,radius:y,heightPercent:e.height,speed:e.speed,windDirection:S,layerIndex:r})},r)})}),g[14]=j,g[15]=y,g[16]=S,g[17]=u):u=g[17],u):null}function rg(e,t){return e.heightPercent||[.35,.25,.2][t]}function rv(e,t){return e.speed||[1e-4,2e-4,3e-4][t]}e.i(62395);let rx=(0,w.createLogger)("Sky"),ry=!1;function rb(e){return[new tj.Color().setRGB(e.r,e.g,e.b),new tj.Color().setRGB(e.r,e.g,e.b).convertSRGBToLinear()]}function r_({skyBoxFiles:e,fogColor:r,fogState:n}){let o=(0,t_.useThree)(e=>e.camera),i=rc(e,{path:""}),l=!!r,s=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),c=(0,a.useMemo)(()=>n?(0,t$.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),u=(0,a.useRef)({skybox:{value:i},fogColor:{value:r??new tj.Color(0,0,0)},enableFog:{value:l},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:t$.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),d=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,a.useEffect)(()=>{u.current.skybox.value=i,u.current.fogColor.value=r??new tj.Color(0,0,0),u.current.enableFog.value=l,u.current.fogVolumeData.value=c,u.current.horizonFogHeight.value=d},[i,r,l,c,d]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform samplerCube skybox; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + // shaderMaterial does NOT get automatic linear->sRGB output conversion + // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear + vec4 skyColor = textureCube(skybox, direction); + vec3 finalColor; + + if (enableFog) { + vec3 effectiveFogColor = fogColor; + + // Calculate how much fog volume the ray passes through + // For skybox at "infinite" distance, the relevant height is how much + // of the volume is above/below camera depending on view direction + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // Check if camera is inside this volume + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + // Camera is inside the fog volume + // Looking horizontally or up at shallow angles means ray travels + // through more fog before exiting the volume + float heightAboveCamera = volMaxH - cameraHeight; + float heightBelowCamera = cameraHeight - volMinH; + float volumeHeight = volMaxH - volMinH; + + // For horizontal rays (direction.y ≈ 0), maximum fog influence + // For rays going up steeply, less fog (exits volume quickly) + // For rays going down, more fog (travels through volume below) + float rayInfluence; + if (direction.y >= 0.0) { + // Looking up: influence based on how steep we're looking + // Shallow angles = long path through fog = high influence + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + // Looking down: always high fog (into the volume) + rayInfluence = 1.0; + } + + // Scale by percentage and volume depth factor + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction (for haze at horizon) + // In Torque, the fog "bans" (bands) are rendered as geometry from + // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. + // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). + // + // horizonFogHeight is the direction.y value where the fog band ends: + // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) + // + // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 + // + // Torque renders the fog bands as geometry with linear vertex alpha + // interpolation. We use a squared curve (t^2) to create a gentler + // falloff at the top of the gradient, matching Tribes 2's appearance. + float baseFogFactor; + if (direction.y <= 0.0) { + // Looking at or below horizon: full fog + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + // Above fog band: no fog + baseFogFactor = 0.0; + } else { + // Within fog band: squared curve for gentler falloff at top + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + // When inside a volume, increase fog intensity + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); + } else { + finalColor = skyColor.rgb; + } + // Convert linear result to sRGB for display + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function rS(e){let n,o,i,l,s,c,u,d=(0,r.c)(6),{materialList:m,fogColor:f,fogState:h}=e,{data:p}=((c=(0,r.c)(8))[0]!==m?(i={queryKey:["detailMapList",m],queryFn:()=>(rx.debug("Loading detail map list: %s",m),(0,tz.loadDetailMapList)(m))},c[0]=m,c[1]=i):i=c[1],u=(0,tP.useQuery)(i),c[2]!==m||c[3]!==u.data||c[4]!==u.error||c[5]!==u.status?(l=()=>{rx.debug("DML query status: %s%s%s file=%s",u.status,u.error?` error=${u.error.message}`:"",u.data?` (${u.data.length} entries)`:" (no data)",m)},s=[u.status,u.error,u.data,m],c[2]=m,c[3]=u.data,c[4]=u.error,c[5]=u.status,c[6]=l,c[7]=s):(l=c[6],s=c[7]),(0,a.useEffect)(l,s),u);d[0]!==p?(n=p?[(0,tz.textureToUrl)(p[1]),(0,tz.textureToUrl)(p[3]),(0,tz.textureToUrl)(p[4]),(0,tz.textureToUrl)(p[5]),(0,tz.textureToUrl)(p[0]),(0,tz.textureToUrl)(p[2])]:null,d[0]=p,d[1]=n):n=d[1];let g=n;return g?(d[2]!==f||d[3]!==h||d[4]!==g?(o=(0,t.jsx)(r_,{skyBoxFiles:g,fogColor:f,fogState:h}),d[2]=f,d[3]=h,d[4]=g,d[5]=o):o=d[5],o):null}function rj({skyColor:e,fogColor:r,fogState:n}){let o=(0,t_.useThree)(e=>e.camera),i=!!r,l=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),s=(0,a.useMemo)(()=>n?(0,t$.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),c=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]),u=(0,a.useRef)({skyColor:{value:e},fogColor:{value:r??new tj.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:t$.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:c}});return(0,a.useEffect)(()=>{u.current.skyColor.value=e,u.current.fogColor.value=r??new tj.Color(0,0,0),u.current.enableFog.value=i,u.current.fogVolumeData.value=s,u.current.horizonFogHeight.value=c},[e,r,i,s,c]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform vec3 skyColor; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + + vec3 finalColor; + + if (enableFog) { + // Calculate volume fog influence (same logic as SkyBoxTexture) + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float rayInfluence; + if (direction.y >= 0.0) { + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + rayInfluence = 1.0; + } + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction + float baseFogFactor; + if (direction.y <= 0.0) { + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + baseFogFactor = 0.0; + } else { + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor, fogColor, finalFogFactor); + } else { + finalColor = skyColor; + } + + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function rC(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function rw({fogState:e,enabled:t}){let r=(0,t_.useThree)(e=>e.scene),n=(0,t_.useThree)(e=>e.camera),o=(0,a.useRef)(null),i=(0,a.useMemo)(()=>(0,t$.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,a.useEffect)(()=>{ry||((0,tO.installCustomFogShader)(),ry=!0)},[]),(0,a.useEffect)(()=>{(0,t$.resetGlobalFogUniforms)();let[t,a]=rC(e,n.position.y),l=new tj.Fog(e.fogColor,t,a);return r.fog=l,o.current=l,(0,t$.updateGlobalFogUniforms)(n.position.y,i),()=>{r.fog=null,o.current=null,(0,t$.resetGlobalFogUniforms)()}},[r,n,e,i]),(0,a.useEffect)(()=>{let r=o.current;if(r)if(t){let[t,a]=rC(e,n.position.y);r.near=t,r.far=a}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,tS.useFrame)(()=>{let r=o.current;if(!r)return;let a=n.position.y;if((0,t$.updateGlobalFogUniforms)(a,i,t),t){let[t,n]=rC(e,a);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let rM=(0,a.memo)(function({entity:e}){let{skyData:r}=e;rx.debug("Rendering: materialList=%s, useSkyTextures=%s",r.materialList,r.useSkyTextures);let{fogEnabled:n}=(0,b.useSettings)(),o=r.materialList||void 0,i=(0,a.useMemo)(()=>rb(r.skySolidColor),[r.skySolidColor]),l=r.useSkyTextures,s=(0,a.useMemo)(()=>(function(e){let t=e.fogDistance,r=e.visibleDistance>0?e.visibleDistance:1e3,{r:a,g:n,b:o}=e.fogColor,i=new tj.Color().setRGB(a,n,o).convertSRGBToLinear(),l=[];for(let t of e.fogVolumes)t.visibleDistance<=0||t.maxHeight<=t.minHeight||l.push({visibleDistance:t.visibleDistance,minHeight:t.minHeight,maxHeight:t.maxHeight,percentage:1});let s=l.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:t,visibleDistance:r,fogColor:i,fogVolumes:l,fogLine:s,enabled:r>t}})(r),[r]);rx.debug("fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d",r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,s.enabled,s.fogVolumes.length);let c=(0,a.useMemo)(()=>rb(r.fogColor),[r.fogColor]),u=i||c,d=s.enabled&&n,m=s.fogColor,f=(0,t_.useThree)(e=>e.scene),h=(0,t_.useThree)(e=>e.gl);(0,a.useEffect)(()=>{if(d){let e=m.clone();f.background=e,h.setClearColor(e)}else if(u){let e=u[0].clone();f.background=e,h.setClearColor(e)}else f.background=null;return()=>{f.background=null}},[f,h,d,m,u]);let p=i?.[1];return(0,t.jsxs)(t.Fragment,{children:[o&&l&&o.length>0?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rS,{materialList:o,fogColor:d?m:void 0,fogState:d?s:void 0},o)}):p?(0,t.jsx)(rj,{skyColor:p,fogColor:d?m:void 0,fogState:d?s:void 0}):null,(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rp,{scene:r})}),s.enabled?(0,t.jsx)(rw,{fogState:s,enabled:n}):null]})});function rN(e){let n,o=(0,r.c)(3),{children:i}=e,{audioEnabled:l}=(0,b.useSettings)();return o[0]!==l||o[1]!==i?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=l,o[1]=i,o[2]=n):n=o[2],n}function rT(e,n){let o=(0,a.lazy)(()=>n().then(t=>({default:t[e]}))),i=a=>{let n,i,l=(0,r.c)(5),{entity:s}=a,c=`${e}:${s.id}`;return l[0]!==s?(n=(0,t.jsx)(o,{entity:s}),l[0]=s,l[1]=n):n=l[1],l[2]!==c||l[3]!==n?(i=(0,t.jsx)(tD.DebugSuspense,{name:c,children:n}),l[2]=c,l[3]=n,l[4]=i):i=l[4],i};return i.displayName=`createLazy(${e})`,i}let rk=rT("PlayerModel",()=>e.A(30814)),rF=rT("ExplosionShape",()=>e.A(44325)),rR=rT("TracerProjectile",()=>e.A(62125)),rD=rT("SpriteProjectile",()=>e.A(62125)),rL=rT("ForceFieldBare",()=>e.A(25147)),rB=rT("AudioEmitter",()=>e.A(61921)),rI=rT("WaterBlock",()=>e.A(18599)),rA=rT("WeaponModel",()=>e.A(44325)),rP={1:"Storm",2:"Inferno"},rE=(0,a.memo)(function(e){let a=(0,r.c)(26),{entity:n}=e;switch(n.renderType){case"Shape":{let e;return a[0]!==n?(e=(0,t.jsx)(rz,{entity:n}),a[0]=n,a[1]=e):e=a[1],e}case"ForceFieldBare":{let e;return a[2]!==n?(e=(0,t.jsx)(rL,{entity:n}),a[2]=n,a[3]=e):e=a[3],e}case"Player":{let e;return a[4]!==n?(e=(0,t.jsx)(rk,{entity:n}),a[4]=n,a[5]=e):e=a[5],e}case"Explosion":{let e;return a[6]!==n?(e=(0,t.jsx)(rF,{entity:n}),a[6]=n,a[7]=e):e=a[7],e}case"Tracer":{let e;return a[8]!==n?(e=(0,t.jsx)(rR,{entity:n}),a[8]=n,a[9]=e):e=a[9],e}case"Sprite":{let e;return a[10]!==n?(e=(0,t.jsx)(rD,{entity:n}),a[10]=n,a[11]=e):e=a[11],e}case"AudioEmitter":{let e;return a[12]!==n?(e=(0,t.jsx)(rN,{children:(0,t.jsx)(rB,{entity:n})}),a[12]=n,a[13]=e):e=a[13],e}case"Camera":{let e;return a[14]!==n?(e=(0,t.jsx)(tI,{entity:n}),a[14]=n,a[15]=e):e=a[15],e}case"WayPoint":{let e;return a[16]!==n?(e=(0,t.jsx)(tA,{entity:n}),a[16]=n,a[17]=e):e=a[17],e}case"TerrainBlock":{let e;return a[18]!==n.terrainData?(e=(0,t.jsx)(tX,{scene:n.terrainData}),a[18]=n.terrainData,a[19]=e):e=a[19],e}case"InteriorInstance":{let e;return a[20]!==n.interiorData?(e=(0,t.jsx)(ro,{scene:n.interiorData}),a[20]=n.interiorData,a[21]=e):e=a[21],e}case"Sky":{let e;return a[22]!==n?(e=(0,t.jsx)(rM,{entity:n}),a[22]=n,a[23]=e):e=a[23],e}case"Sun":case"MissionArea":case"None":default:return null;case"WaterBlock":{let e;return a[24]!==n?(e=(0,t.jsx)(rI,{entity:n}),a[24]=n,a[25]=e):e=a[25],e}}});function rz(e){let n,o,i,l,s,c,u,d=(0,r.c)(24),{entity:m}=e,{animationEnabled:f}=(0,b.useSettings)(),h=(0,a.useRef)(null);if(d[0]!==f||d[1]!==m.rotate?(n=()=>{if(!h.current||!m.rotate||!f)return;let e=performance.now()/1e3;h.current.rotation.y=e/3*Math.PI*2},d[0]=f,d[1]=m.rotate,d[2]=n):n=d[2],(0,tS.useFrame)(n),!m.shapeName)throw Error(`Shape entity missing shapeName: ${m.id}`);let p=m.runtimeObject,g=m.shapeType??"StaticShape",v=m.dataBlock?.toLowerCase()==="flag",x=m.teamId&&m.teamId>0?rP[m.teamId]:null,y=v&&x?`${x} Flag`:null,_="Item"===m.shapeType?"pink":m.threads?"#00ff88":"yellow",S=m.rotate?h:void 0,j=p?void 0:m;return d[3]!==y?(o=y?(0,t.jsx)(tB.FloatingLabel,{opacity:.6,children:y}):null,d[3]=y,d[4]=o):o=d[4],d[5]!==_||d[6]!==j||d[7]!==o?(i=(0,t.jsx)(tF.ShapeRenderer,{loadingColor:_,streamEntity:j,children:o}),d[5]=_,d[6]=j,d[7]=o,d[8]=i):i=d[8],d[9]!==m.barrelShapeName||d[10]!==p?(l=m.barrelShapeName&&(0,t.jsx)(tR.ShapeInfoProvider,{object:p,shapeName:m.barrelShapeName,type:"Turret",children:(0,t.jsx)("group",{position:[0,1.5,0],children:(0,t.jsx)(tF.ShapeRenderer,{})})}),d[9]=m.barrelShapeName,d[10]=p,d[11]=l):l=d[11],d[12]!==m?(s=m.weaponShape&&(0,t.jsx)(tL.ShapeErrorBoundary,{fallback:(0,t.jsx)(tF.ShapePlaceholder,{color:"red",label:m.weaponShape}),children:(0,t.jsx)(tD.DebugSuspense,{name:`Weapon:${m.id}/${m.weaponShape}`,fallback:(0,t.jsx)(tF.ShapePlaceholder,{color:"cyan",label:m.weaponShape}),children:(0,t.jsx)(rA,{entity:m})})}),d[12]=m,d[13]=s):s=d[13],d[14]!==S||d[15]!==i||d[16]!==l||d[17]!==s?(c=(0,t.jsxs)("group",{ref:S,children:[i,l,s]}),d[14]=S,d[15]=i,d[16]=l,d[17]=s,d[18]=c):c=d[18],d[19]!==m.shapeName||d[20]!==g||d[21]!==c||d[22]!==p?(u=(0,t.jsx)(tR.ShapeInfoProvider,{object:p,shapeName:m.shapeName,type:g,children:c}),d[19]=m.shapeName,d[20]=g,d[21]=c,d[22]=p,d[23]=u):u=d[23],u}var rG=e.i(60099),rU=e.i(85557),rW=e.i(29418);let rH=(0,tz.textureToUrl)("gui/hud_alliedtriangle"),rO=(0,tz.textureToUrl)("gui/hud_enemytriangle"),r$=new tj.Vector3;function rV(e){let n,o,i,l,s,c,u=(0,r.c)(23),{entity:d}=e,m=(0,tF.useStaticShape)(d.shapeName??d.dataBlock),f=(0,t_.useThree)(rQ),h=(0,a.useRef)(null),p=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),[y,b]=(0,a.useState)(!0),_=(0,a.useRef)(null);u[0]!==m.scene?(n=new tj.Box3().setFromObject(m.scene),u[0]=m.scene,u[1]=n):n=u[1];let S=n.max.y+.1;u[2]!==d.keyframes?(o=d.keyframes??[],u[2]=d.keyframes,u[3]=o):o=u[3];let j=o;u[4]!==j?(i=j.some(rq),u[4]=j,u[5]=i):i=u[5];let C=i;u[6]!==f||u[7]!==d.id||u[8]!==d.iffColor||u[9]!==d.playerName||u[10]!==C||u[11]!==y||u[12]!==j?(l=()=>{let e=h.current;if(!e)return;e.getWorldPosition(r$);let t=f.position.distanceTo(r$),r=f.matrixWorld.elements,a=!(-((r$.x-r[12])*r[8])+-((r$.y-r[13])*r[9])+-((r$.z-r[14])*r[10])<0)&&t<150;if(y!==a&&b(a),!a)return;let n=(0,rU.getKeyframeAtTime)(j,tk.streamPlaybackStore.getState().time),o=n?.health??1;if(n?.damageState!=null&&n.damageState>=1){p.current&&(p.current.style.opacity="0"),g.current&&(g.current.style.opacity="0");return}let i=Math.max(0,Math.min(1,1-t/150)).toString();if(p.current&&(p.current.style.opacity=i),g.current&&(g.current.style.opacity=i),_.current){let e=d.playerName??d.id;_.current.textContent!==e&&(_.current.textContent=e)}if(x.current&&d.iffColor){let e=d.iffColor.r>d.iffColor.g?rO:rH;x.current.getAttribute("src")!==e&&(x.current.src=e)}v.current&&C&&(v.current.style.width=`${Math.max(0,Math.min(100,100*o))}%`,v.current.style.background=d.iffColor?`rgb(${d.iffColor.r}, ${d.iffColor.g}, ${d.iffColor.b})`:"")},u[6]=f,u[7]=d.id,u[8]=d.iffColor,u[9]=d.playerName,u[10]=C,u[11]=y,u[12]=j,u[13]=l):l=u[13],(0,tS.useFrame)(l);let w=d.iffColor&&d.iffColor.r>d.iffColor.g?rO:rH;return u[14]!==d.id||u[15]!==d.playerName||u[16]!==C||u[17]!==S||u[18]!==w||u[19]!==y?(s=y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rG.Html,{position:[0,S,0],center:!0,children:(0,t.jsx)("div",{ref:p,className:rW.default.Top,children:(0,t.jsx)("img",{ref:x,className:rW.default.IffArrow,src:w,alt:""})})}),(0,t.jsx)(rG.Html,{position:[0,-.2,0],center:!0,children:(0,t.jsxs)("div",{ref:g,className:rW.default.Bottom,children:[(0,t.jsx)("div",{ref:_,className:rW.default.Name,children:d.playerName??d.id}),C&&(0,t.jsx)("div",{className:rW.default.HealthBar,children:(0,t.jsx)("div",{ref:v,className:rW.default.HealthFill})})]})})]}),u[14]=d.id,u[15]=d.playerName,u[16]=C,u[17]=S,u[18]=w,u[19]=y,u[20]=s):s=u[20],u[21]!==s?(c=(0,t.jsx)("group",{ref:h,children:s}),u[21]=s,u[22]=c):c=u[22],c}function rq(e){return null!=e.health}function rQ(e){return e.camera}var rK=e.i(78779);let rY=(0,tz.textureToUrl)("commander/MiniIcons/com_flag_grey"),rJ=new tj.Vector3;function rZ(e){let n,o,i,l,s,c=(0,r.c)(9),{entity:u}=e,d=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,t_.useThree)(rX);c[0]!==h||c[1]!==u.iffColor?(n=()=>{if(m.current&&u.iffColor){let{r:e,g:t,b:r}=u.iffColor;m.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(f.current&&d.current){d.current.getWorldPosition(rJ);let e=h.position.distanceTo(rJ);f.current.textContent=e.toFixed(1)}},c[0]=h,c[1]=u.iffColor,c[2]=n):n=c[2],(0,tS.useFrame)(n);let p=u.iffColor?`rgb(${u.iffColor.r},${u.iffColor.g},${u.iffColor.b})`:"rgb(200,200,200)";c[3]===Symbol.for("react.memo_cache_sentinel")?(o=[0,1.5,0],c[3]=o):o=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("span",{ref:f,className:rK.default.Distance}),c[4]=i):i=c[4],c[5]!==p?(l={backgroundColor:p,"--flag-icon-url":`url(${rY})`},c[5]=p,c[6]=l):l=c[6];let g=l;return c[7]!==g?(s=(0,t.jsx)("group",{ref:d,children:(0,t.jsx)(rG.Html,{position:o,center:!0,children:(0,t.jsxs)("div",{className:rK.default.Root,children:[i,(0,t.jsx)("div",{ref:m,className:rK.default.Icon,style:g})]})})}),c[7]=g,c[8]=s):s=c[8],s}function rX(e){return e.camera}function r0(){let e,a=(0,r.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("group",{ref:r1,children:(0,t.jsx)(r2,{})}),a[0]=e):e=a[0],e}function r1(e){tk.streamPlaybackStore.setState({root:e})}let r2=(0,a.memo)(function(){let e=(0,eY.useAllGameEntities)(),r=(0,a.useRef)(new Map).current,n=new Set;for(let t of e)n.add(t.id),r.set(t.id,t);for(let e of r.keys())n.has(e)||r.delete(e);return(0,t.jsx)(t.Fragment,{children:[...r.values()].map(e=>(0,t.jsx)(r3,{entity:e},e.id))})}),r3=(0,a.memo)(function(e){let a,n=(0,r.c)(7),{entity:o}=e;if((0,tT.isSceneEntity)(o)){let e,r;return n[0]!==o?(e=(0,t.jsx)(rE,{entity:o}),n[0]=o,n[1]=e):e=n[1],n[2]!==o.id||n[3]!==e?(r=(0,t.jsx)("group",{name:o.id,children:e}),n[2]=o.id,n[3]=e,n[4]=r):r=n[4],r}return"None"===o.renderType?null:(n[5]!==o?(a=(0,t.jsx)(r8,{entity:o}),n[5]=o,n[6]=a):a=n[6],a)});function r5(e){let a,n=(0,r.c)(2),{entity:o}=e,i=(0,tf.useEngineSelector)(r4);return o.id===i?null:(n[0]!==o?(a=(0,t.jsx)(rV,{entity:o}),n[0]=o,n[1]=a):a=n[1],a)}function r4(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function r6({entity:e}){let r=(0,a.useRef)(!1),[n,o]=(0,a.useState)(()=>((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0);return(r.current=n,(0,tS.useFrame)(()=>{let t=((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0;t!==r.current&&(r.current=t,o(t))}),n)?(0,t.jsx)(rZ,{entity:e}):null}function r8(e){let a,n,o,i,l,s,c,u,d=(0,r.c)(39),{entity:m}=e,f=m.position,h=m.scale;e:{let e;if(!m.rotation){a=void 0;break e}d[0]!==m.rotation?(e=new tj.Quaternion(...m.rotation),d[0]=m.rotation,d[1]=e):e=d[1],a=e}let p=a,g="Player"===m.renderType;if("Shape"===m.renderType&&!m.shapeName){let e,r,a,n,o,i=m.id;return d[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("sphereGeometry",{args:[.3,6,4]}),d[2]=e):e=d[2],d[3]!==m.className?(r=(0,rU.entityTypeColor)(m.className),d[3]=m.className,d[4]=r):r=d[4],d[5]!==r?(a=(0,t.jsxs)("mesh",{children:[e,(0,t.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),d[5]=r,d[6]=a):a=d[6],d[7]!==m?(n=(0,t.jsx)(r6,{entity:m}),d[7]=m,d[8]=n):n=d[8],d[9]!==m.id||d[10]!==f||d[11]!==p||d[12]!==h||d[13]!==a||d[14]!==n?(o=(0,t.jsxs)("group",{name:i,position:f,quaternion:p,scale:h,children:[a,n]}),d[9]=m.id,d[10]=f,d[11]=p,d[12]=h,d[13]=a,d[14]=n,d[15]=o):o=d[15],o}d[16]!==m.className||d[17]!==m.renderType?(n="Explosion"===m.renderType?null:(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.5,8,6]}),(0,t.jsx)("meshBasicMaterial",{color:(0,rU.entityTypeColor)(m.className),wireframe:!0})]}),d[16]=m.className,d[17]=m.renderType,d[18]=n):n=d[18];let v=n;return d[19]!==m?(o=(0,t.jsx)(rE,{entity:m}),d[19]=m,d[20]=o):o=d[20],d[21]!==v||d[22]!==o?(i=(0,t.jsx)(tL.ShapeErrorBoundary,{fallback:v,children:o}),d[21]=v,d[22]=o,d[23]=i):i=d[23],d[24]!==m||d[25]!==g?(l=g&&(0,t.jsx)(r5,{entity:m}),d[24]=m,d[25]=g,d[26]=l):l=d[26],d[27]!==m?(s=(0,t.jsx)(r6,{entity:m}),d[27]=m,d[28]=s):s=d[28],d[29]!==i||d[30]!==l||d[31]!==s?(c=(0,t.jsxs)("group",{name:"model",children:[i,l,s]}),d[29]=i,d[30]=l,d[31]=s,d[32]=c):c=d[32],d[33]!==m.id||d[34]!==f||d[35]!==p||d[36]!==h||d[37]!==c?(u=(0,t.jsx)("group",{name:m.id,position:f,quaternion:p,scale:h,children:c}),d[33]=m.id,d[34]=f,d[35]=p,d[36]=h,d[37]=c,d[38]=u):u=d[38],u}var r7=e.i(51475);let r9=(0,w.createLogger)("SceneLighting");function ae(){let e,n,o,i=(0,r.c)(6),l=(0,eY.useSceneSun)();if(i[0]!==l?(e=()=>{l?r9.debug("sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",l.direction.x.toFixed(3),l.direction.y.toFixed(3),l.direction.z.toFixed(3),l.color.r.toFixed(3),l.color.g.toFixed(3),l.color.b.toFixed(3),l.ambient.r.toFixed(3),l.ambient.g.toFixed(3),l.ambient.b.toFixed(3)):r9.debug("No sunData — using fallback ambient #888")},n=[l],i[0]=l,i[1]=e,i[2]=n):(e=i[1],n=i[2]),(0,a.useEffect)(e,n),!l){let e;return i[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("ambientLight",{color:"#888888",intensity:1}),i[3]=e):e=i[3],e}return i[4]!==l?(o=(0,t.jsx)(at,{sunData:l}),i[4]=l,i[5]=o):o=i[5],o}function at(e){let n,o,i,l,s,c,u,d,m,f,h=(0,r.c)(29),{sunData:p}=e;h[0]!==p.direction?(n=(0,tE.torqueToThree)(p.direction),h[0]=p.direction,h[1]=n):n=h[1];let[g,v,x]=n,y=Math.sqrt(g*g+v*v+x*x),b=g/y,_=v/y,S=x/y;h[2]!==b||h[3]!==_||h[4]!==S?(o=new tj.Vector3(b,_,S),h[2]=b,h[3]=_,h[4]=S,h[5]=o):o=h[5];let j=o,C=-(5e3*j.x),w=-(5e3*j.y),M=-(5e3*j.z);h[6]!==C||h[7]!==w||h[8]!==M?(i=new tj.Vector3(C,w,M),h[6]=C,h[7]=w,h[8]=M,h[9]=i):i=h[9];let N=i;h[10]!==p.color.b||h[11]!==p.color.g||h[12]!==p.color.r?(l=new tj.Color(p.color.r,p.color.g,p.color.b),h[10]=p.color.b,h[11]=p.color.g,h[12]=p.color.r,h[13]=l):l=h[13];let T=l;h[14]!==p.ambient.b||h[15]!==p.ambient.g||h[16]!==p.ambient.r?(s=new tj.Color(p.ambient.r,p.ambient.g,p.ambient.b),h[14]=p.ambient.b,h[15]=p.ambient.g,h[16]=p.ambient.r,h[17]=s):s=h[17];let k=s,F=j.y<0;return h[18]!==F?(c=()=>{tW.value=F},u=[F],h[18]=F,h[19]=c,h[20]=u):(c=h[19],u=h[20]),(0,a.useEffect)(c,u),h[21]!==T||h[22]!==N?(d=(0,t.jsx)("directionalLight",{position:N,color:T,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),h[21]=T,h[22]=N,h[23]=d):d=h[23],h[24]!==k?(m=(0,t.jsx)("ambientLight",{color:k,intensity:1}),h[24]=k,h[25]=m):m=h[25],h[26]!==d||h[27]!==m?(f=(0,t.jsxs)(t.Fragment,{children:[d,m]}),h[26]=d,h[27]=m,h[28]=f):f=h[28],f}function ar(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}let aa=(0,i.createParser)({parse(e){let[t,r]=e.split("~"),a=r,n=(0,eJ.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(a=n[0]),{missionName:t,missionType:a}},serialize({missionName:e,missionType:t}){let r=(0,eJ.getMissionInfo)(e).missionTypes;return t&&1!==r.length?`${e}~${t}`:e},eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});var an=e.i(75056);let ao={toneMapping:tj.NoToneMapping,outputColorSpace:tj.SRGBColorSpace};function ai(e){let a,n,o=(0,r.c)(6),{children:i,renderOnDemand:l,dpr:s,onCreated:c}=e,{renderOnDemand:u}=(0,b.useDebug)(),d=void 0!==l&&l||u?"demand":"always";return o[0]===Symbol.for("react.memo_cache_sentinel")?(a={type:tj.PCFShadowMap},o[0]=a):a=o[0],o[1]!==i||o[2]!==s||o[3]!==c||o[4]!==d?(n=(0,t.jsx)(an.Canvas,{frameloop:d,dpr:s,gl:ao,shadows:a,onCreated:c,children:i}),o[1]=i,o[2]=s,o[3]=c,o[4]=d,o[5]=n):n=o[5],n}var al=e.i(12631),as=e.i(66093),ac=e.i(205);let au=(0,a.lazy)(()=>e.A(34019).then(e=>({default:e.TouchHandler})));function ad(e){let a,n=(0,r.c)(2),{children:o}=e;return n[0]!==o?(a=(0,t.jsx)(al.KeyboardControls,{map:ac.KEYBOARD_CONTROLS,children:(0,t.jsx)(as.JoystickProvider,{children:o})}),n[0]=o,n[1]=a):a=n[1],a}function am(){let e,n,o,i=(0,r.c)(5),l=eK();return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(ac.KeyboardAndMouseHandler,{}),i[0]=e):e=i[0],i[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(au,{})}):null,i[1]=l,i[2]=n):n=i[2],i[3]!==n?(o=(0,t.jsxs)(t.Fragment,{children:[e,n]}),i[3]=n,i[4]=o):o=i[4],o}let af=(0,a.lazy)(()=>e.A(553).then(e=>({default:e.TouchJoystick}))),ah=(0,a.lazy)(()=>e.A(33487).then(e=>({default:e.KeyboardOverlay})));function ap(){let e,n,o,i=(0,r.c)(7),l=eK();return i[0]!==l?(e=l?(0,t.jsx)(af,{}):null,i[0]=l,i[1]=e):e=i[1],i[2]!==l?(n=!1===l?(0,t.jsx)(ah,{}):null,i[2]=l,i[3]=n):n=i[3],i[4]!==e||i[5]!==n?(o=(0,t.jsxs)(a.Suspense,{children:[e,n]}),i[4]=e,i[5]=n,i[6]=o):o=i[6],o}var ag=e.i(89271);function av(e){let a,n,o,i,l,s=(0,r.c)(11),{isLoading:c,progress:u}=e,d=!c;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:ag.default.Spinner}),s[0]=a):a=s[0];let m=`${100*u}%`;return s[1]!==m?(n=(0,t.jsx)("div",{className:ag.default.Progress,children:(0,t.jsx)("div",{className:ag.default.ProgressBar,style:{width:m}})}),s[1]=m,s[2]=n):n=s[2],s[3]!==u?(o=Math.round(100*u),s[3]=u,s[4]=o):o=s[4],s[5]!==o?(i=(0,t.jsxs)("div",{className:ag.default.ProgressText,children:[o,"%"]}),s[5]=o,s[6]=i):i=s[6],s[7]!==d||s[8]!==n||s[9]!==i?(l=(0,t.jsxs)("div",{className:ag.default.LoadingIndicator,"data-complete":d,children:[a,n,i]}),s[7]=d,s[8]=n,s[9]=i,s[10]=l):l=s[10],l}function ax(e){let n,o=(0,r.c)(3),{children:i}=e,{debugMode:l}=(0,b.useDebug)();return o[0]!==i||o[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=i,o[1]=l,o[2]=n):n=o[2],n}var ay=e.i(82156);function ab(e,t){return(0,a.lazy)(()=>t().then(t=>({default:t[e]})))}let a_=ab("StreamingController",()=>e.A(25483)),aS=ab("DemoPlaybackControls",()=>e.A(93884)),aj=ab("DebugElements",()=>e.A(88487)),aC=ab("Mission",()=>e.A(21683)),aw=ab("LiveObserver",()=>e.A(96145)),aM=ab("ChatSoundPlayer",()=>e.A(38496)),aN=ab("PlayerHUD",()=>e.A(57567)),aT=ab("MapInfoDialog",()=>e.A(59197)),ak=ab("ServerBrowser",()=>e.A(70012));function aF(){let[e,n]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("mission",aa);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),[o,s]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("fog",i.parseAsBoolean);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),c=(0,a.useCallback)(()=>{s(null)},[s]),u=(0,a.useContext)(l),{missionName:d,missionType:m}=e,[f,h]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),[S,j]=(0,a.useState)(!0),[C,w]=(0,a.useState)(!1),[T,k]=(0,a.useState)(0),[F,R]=(0,a.useState)(!0),D=(0,a.useCallback)(e=>{window.location.hash="",c(),w(!1);let t=M.liveConnectionStore.getState();t.disconnectServer(),t.disconnectRelay(),tf.engineStore.getState().setRecording(null),eY.gameEntityStore.getState().endStreaming(),n(e)},[n,c]);!function(e){let t,n,o=(0,r.c)(5),{onChangeMission:i}=e,{setRecording:l}=(0,N.usePlaybackActions)(),s=(0,a.useEffectEvent)(i);o[0]!==s||o[1]!==l?(t=()=>(window.setMissionName=e=>{let t=(0,eJ.getMissionInfo)(e).missionTypes;s({missionName:e,missionType:t[0]})},window.getMissionList=eJ.getMissionList,window.getMissionInfo=eJ.getMissionInfo,window.loadDemoRecording=l,ar),o[0]=s,o[1]=l,o[2]=t):t=o[2],o[3]!==l?(n=[l],o[3]=l,o[4]=n):n=o[4],(0,a.useEffect)(t,n)}({onChangeMission:D});let L=(0,N.useRecording)(),B=(0,eY.useDataSource)(),I="demo"===B||"live"===B,A=(0,M.useLiveSelector)(e=>null!=e.adapter),P=(0,eY.useMissionName)(),E=(0,eY.useMissionType)();(0,a.useEffect)(()=>{if(I&&P)try{let e=(0,eJ.getMissionInfo)(P),t=E&&e.missionTypes.includes(E)?E:void 0;n({missionName:P,missionType:t})}catch{n(null)}},[I,P,E,n]),(0,a.useEffect)(()=>{L&&w(!1)},[L]);let z=T<1;(0,a.useEffect)(()=>{if(z)R(!0);else{let e=setTimeout(()=>R(!1),500);return()=>clearTimeout(e)}},[z]);let G=(0,a.useCallback)((e,t=0)=>{k(t)},[]),U=(0,a.useRef)(null),W=(0,a.useRef)(null);return(0,t.jsx)("main",{className:ay.default.Frame,children:(0,t.jsx)(N.RecordingProvider,{children:(0,t.jsxs)(b.SettingsProvider,{fogEnabledOverride:o,onClearFogEnabledOverride:c,children:[(0,t.jsxs)("header",{className:ay.default.Toolbar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button",className:ay.default.ToggleSidebarButton,"data-orientation":"top","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(x,{}):(0,t.jsx)(y,{})}),(0,t.jsx)("button",{type:"button",className:ay.default.ToggleSidebarButton,"data-orientation":"left","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(g,{}):(0,t.jsx)(v,{})}),(0,t.jsx)(a.Activity,{mode:I&&!C?"visible":"hidden",children:(0,t.jsx)(tg,{})}),(0,t.jsxs)(a.Activity,{mode:!I||C?"visible":"hidden",children:[(0,t.jsx)(tm,{value:C?"":d,missionType:C?"":m,onChange:D,autoFocus:C}),C&&(0,t.jsx)("button",{type:"button",className:ay.default.CancelButton,onClick:()=>{w(!1)},children:"Cancel"})]})]}),S?(0,t.jsx)("div",{className:ay.default.Backdrop}):null,(0,t.jsx)(a.Activity,{mode:S?"visible":"hidden",children:(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)("div",{className:ay.default.Sidebar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),"data-open":S,children:(0,t.jsx)(eX,{missionName:d,missionType:m,onOpenMapInfo:()=>h(!0),onOpenServerBrowser:u.live?()=>_(!0):void 0,onChooseMap:I?()=>{w(!0)}:void 0,onCancelChoosingMap:()=>{w(!1)},choosingMap:C,cameraRef:U,invalidateRef:W})})})}),(0,t.jsx)(ad,{children:(0,t.jsxs)("div",{className:ay.default.Content,children:[(0,t.jsx)("div",{className:ay.default.ThreeView,children:(0,t.jsx)(ai,{dpr:f||p?.25:void 0,onCreated:e=>{U.current=e.camera,W.current=e.invalidate},children:(0,t.jsx)(r7.TickProvider,{children:(0,t.jsxs)(tN.CamerasProvider,{children:[(0,t.jsx)(am,{}),(0,t.jsxs)(tM.AudioProvider,{children:[(0,t.jsx)(ae,{}),(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(r0,{})}),(0,t.jsx)(tw,{}),(0,t.jsx)(rN,{children:(0,t.jsx)(aM,{})}),(0,t.jsx)(ax,{children:(0,t.jsx)(aj,{})}),L?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(a_,{recording:L})}):null,I?null:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aC,{name:d,missionType:m,onLoadingChange:G},`${d}~${m}`)}),A?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aw,{})}):null]})]})})})}),I?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aN,{})}):null,(0,t.jsx)(ap,{}),F&&(0,t.jsx)(av,{isLoading:z,progress:T})]})}),(0,t.jsx)("footer",{className:ay.default.PlayerBar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:L?.source==="demo"?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aS,{})}):null}),f?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aT,{onClose:()=>h(!1),missionName:d,missionType:m??""})}):null,p?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ak,{onClose:()=>_(!1)})}):null]})})})}let aR=new n.QueryClient;function aD(){let e,n=(0,r.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(s,{children:(0,t.jsx)(o.QueryClientProvider,{client:aR,children:(0,t.jsx)(aF,{})})})}),n[0]=e):e=n[0],e}e.s(["default",()=>aD],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/818dce712bc45cb4.js b/docs/_next/static/chunks/818dce712bc45cb4.js deleted file mode 100644 index a1230a42..00000000 --- a/docs/_next/static/chunks/818dce712bc45cb4.js +++ /dev/null @@ -1,174 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19273,80166,e=>{"use strict";e.i(47167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>i,"timeoutManager",()=>r],80166);var s="u"=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:i,fetchStatus:s,predicate:n,queryKey:a,stale:o}=e;if(a){if(i){if(t.queryHash!==d(a,t.options))return!1}else if(!v(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!n||!!n(t))}function f(e,t){let{exact:r,status:i,predicate:s,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(n))return!1}else if(!v(t.options.mutationKey,n))return!1}return(!i||t.state.status===i)&&(!s||!!s(t))}function d(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function v(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>v(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function T(e){return new Promise(t=>{r.setTimeout(t,e)})}function O(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let s=y(t)&&y(r);if(!s&&!(b(t)&&b(r)))return r;let n=(s?t:Object.keys(t)).length,a=s?r:Object.keys(r),o=a.length,u=s?Array(o):{},l=0;for(let c=0;cr?i.slice(1):i}function R(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var E=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==E?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function w(e,t){return"function"==typeof e?e(...t):!!e}function D(e,t,r){let i,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}e.s(["addConsumeAwareSignal",()=>D,"addToEnd",()=>F,"addToStart",()=>R,"ensureQueryFn",()=>C,"functionalUpdate",()=>a,"hashKey",()=>p,"hashQueryKeyByOptions",()=>d,"isServer",()=>s,"isValidTimeout",()=>o,"matchMutation",()=>f,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>v,"replaceData",()=>O,"resolveEnabled",()=>c,"resolveStaleTime",()=>l,"shallowEqualObjects",()=>g,"shouldThrowError",()=>w,"skipToken",()=>E,"sleep",()=>T,"timeUntilStale",()=>u],19273)},40143,e=>{"use strict";let t,r,i,s,n,a;var o=e.i(80166).systemSetTimeoutZero,u=(t=[],r=0,i=e=>{e()},s=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{i(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>u])},15823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},75555,e=>{"use strict";var t=e.i(15823),r=e.i(19273),i=new class extends t.Subscribable{#r;#i;#s;constructor(){super(),this.#s=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>i])},86491,14448,93803,36553,88587,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),i=e.i(75555),s=e.i(15823),n=new class extends s.Subscribable{#n=!0;#i;#s;constructor(){super(),this.#s=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function a(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function o(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||n.isOnline()}e.s(["onlineManager",()=>n],14448),e.s(["pendingThenable",()=>a],93803);var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,s=!1,c=0,h=a(),f=()=>i.focusManager.isFocused()&&("always"===e.networkMode||n.isOnline())&&e.canRun(),d=()=>u(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},v=e=>{"pending"===h.status&&(r?.(),h.reject(e))},m=()=>new Promise(t=>{r=e=>{("pending"!==h.status||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),g=()=>{let r;if("pending"!==h.status)return;let i=0===c?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(p).catch(r=>{if("pending"!==h.status)return;let i=e.retry??3*!t.isServer,n=e.retryDelay??o,a="function"==typeof n?n(c,r):n,u=!0===i||"number"==typeof i&&cf()?void 0:m()).then(()=>{s?v(r):g()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new l(t);v(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:d,start:()=>(d()?g():m().then(g),h)}}e.s(["CancelledError",()=>l,"canFetch",()=>u,"createRetryer",()=>c],36553);var h=e.i(80166),f=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>f],88587);var d=class extends f{#o;#u;#l;#c;#h;#f;#d;constructor(e){super(),this.#d=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#l=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=m(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=m(this.options);void 0!==e.data&&(this.setState(v(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#d?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,r){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,s.signal)})},a=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),s=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#d=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},o=(n(i={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),i);this.options.behavior?.onFetch(o,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#p({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof l&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof l){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#l.config.onError?.(e,this),this.#l.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...v(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function v(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function m(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>d,"fetchState",()=>p],86491)},12598,e=>{"use strict";var t=e.i(71645),r=e.i(43476),i=t.createContext(void 0),s=e=>{let r=t.useContext(i);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},n=({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(i.Provider,{value:e,children:s}));e.s(["QueryClientProvider",()=>n,"useQueryClient",()=>s])},69230,e=>{"use strict";var t=e.i(75555),r=e.i(40143),i=e.i(86491),s=e.i(15823),n=e.i(93803),a=e.i(19273),o=e.i(80166),u=class extends s.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#v=null,this.#m=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#y=void 0;#b=void 0;#S;#T;#m;#v;#O;#F;#R;#E;#C;#w;#D=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),l(this.#g,this.options)?this.#I():this.updateResult(),this.#U())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#P(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,a.resolveEnabled)(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#M(),this.#g.setOptions(this.options),t._defaulted&&!(0,a.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let i=this.hasListeners();i&&h(this.#g,r,this.options,t)&&this.#I(),this.updateResult(),i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||(0,a.resolveStaleTime)(this.options.staleTime,this.#g)!==(0,a.resolveStaleTime)(t.staleTime,this.#g))&&this.#_();let s=this.#Q();i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||s!==this.#w)&&this.#k(s)}getOptimisticResult(e){var t,r;let i=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(i,e);return t=this,r=s,(0,a.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=s,this.#T=this.options,this.#S=this.#g.state),s}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#m.status||this.#m.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#D.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#I({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#I(e){this.#M();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(a.noop)),t}#_(){this.#x();let e=(0,a.resolveStaleTime)(this.options.staleTime,this.#g);if(a.isServer||this.#b.isStale||!(0,a.isValidTimeout)(e))return;let t=(0,a.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#E=o.timeoutManager.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#k(e){this.#P(),this.#w=e,!a.isServer&&!1!==(0,a.resolveEnabled)(this.options.enabled,this.#g)&&(0,a.isValidTimeout)(this.#w)&&0!==this.#w&&(this.#C=o.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||t.focusManager.isFocused())&&this.#I()},this.#w))}#U(){this.#_(),this.#k(this.#Q())}#x(){this.#E&&(o.timeoutManager.clearTimeout(this.#E),this.#E=void 0)}#P(){this.#C&&(o.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let r,s=this.#g,o=this.options,u=this.#b,c=this.#S,d=this.#T,p=e!==s?e.state:this.#y,{state:v}=e,m={...v},g=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&l(e,t),a=r&&h(e,s,t,o);(n||a)&&(m={...m,...(0,i.fetchState)(v.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=m;r=m.data;let T=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===S){let e;u?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=u.data,T=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#R?.state.data,this.#R):t.placeholderData,void 0!==e&&(S="success",r=(0,a.replaceData)(u?.data,e,t),g=!0)}if(t.select&&void 0!==r&&!T)if(u&&r===c?.data&&t.select===this.#O)r=this.#F;else try{this.#O=t.select,r=t.select(r),r=(0,a.replaceData)(u?.data,r,t),this.#F=r,this.#v=null}catch(e){this.#v=e}this.#v&&(y=this.#v,r=this.#F,b=Date.now(),S="error");let O="fetching"===m.fetchStatus,F="pending"===S,R="error"===S,E=F&&O,C=void 0!==r,w={status:S,fetchStatus:m.fetchStatus,isPending:F,isSuccess:"success"===S,isError:R,isInitialLoading:E,isLoading:E,data:r,dataUpdatedAt:m.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>p.dataUpdateCount||m.errorUpdateCount>p.errorUpdateCount,isFetching:O,isRefetching:O&&!F,isLoadingError:R&&!C,isPaused:"paused"===m.fetchStatus,isPlaceholderData:g,isRefetchError:R&&C,isStale:f(e,t),refetch:this.refetch,promise:this.#m,isEnabled:!1!==(0,a.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,r="error"===w.status&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{i(this.#m=w.promise=(0,n.pendingThenable)())},o=this.#m;switch(o.status){case"pending":e.queryHash===s.queryHash&&i(o);break;case"fulfilled":(r||w.data!==o.value)&&a();break;case"rejected":r&&w.error===o.reason||a()}}return w}updateResult(){let e=this.#b,t=this.createResult(this.#g,this.options);if(this.#S=this.#g.state,this.#T=this.options,void 0!==this.#S.data&&(this.#R=this.#g),(0,a.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#D.size)return!0;let i=new Set(r??this.#D);return this.options.throwOnError&&i.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&i.has(t))};this.#L({listeners:r()})}#M(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#U()}#L(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function l(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,a.resolveEnabled)(t.enabled,e)&&"static"!==(0,a.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&f(e,t)}return!1}function h(e,t,r,i){return(e!==t||!1===(0,a.resolveEnabled)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&f(e,r)}function f(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",()=>u])},69637,54440,e=>{"use strict";let t;e.i(47167);var r=e.i(71645),i=e.i(19273),s=e.i(40143),n=e.i(12598);e.i(43476);var a=r.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),o=r.createContext(!1);o.Provider;var u=(e,t)=>void 0===t.state.data,l=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},c=(e,t)=>e.isLoading&&e.isFetching&&!t,h=(e,t)=>e?.suspense&&t.isPending,f=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function d(e,t,u){let d,p=r.useContext(o),v=r.useContext(a),m=(0,n.useQueryClient)(u),g=m.defaultQueryOptions(e);m.getDefaultOptions().queries?._experimental_beforeQuery?.(g);let y=m.getQueryCache().get(g.queryHash);g._optimisticResults=p?"isRestoring":"optimistic",l(g),d=y?.state.error&&"function"==typeof g.throwOnError?(0,i.shouldThrowError)(g.throwOnError,[y.state.error,y]):g.throwOnError,(g.suspense||g.experimental_prefetchInRender||d)&&!v.isReset()&&(g.retryOnMount=!1),r.useEffect(()=>{v.clearReset()},[v]);let b=!m.getQueryCache().get(g.queryHash),[S]=r.useState(()=>new t(m,g)),T=S.getOptimisticResult(g),O=!p&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{let t=O?S.subscribe(s.notifyManager.batchCalls(e)):i.noop;return S.updateResult(),t},[S,O]),()=>S.getCurrentResult(),()=>S.getCurrentResult()),r.useEffect(()=>{S.setOptions(g)},[g,S]),h(g,T))throw f(g,S,v);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||(0,i.shouldThrowError)(r,[e.error,s])))({result:T,errorResetBoundary:v,throwOnError:g.throwOnError,query:y,suspense:g.suspense}))throw T.error;if(m.getDefaultOptions().queries?._experimental_afterQuery?.(g,T),g.experimental_prefetchInRender&&!i.isServer&&c(T,p)){let e=b?f(g,S,v):y?.promise;e?.catch(i.noop).finally(()=>{S.updateResult()})}return g.notifyOnChangeProps?T:S.trackResult(T)}e.s(["defaultThrowOnError",()=>u,"ensureSuspenseTimers",()=>l,"fetchOptimistic",()=>f,"shouldSuspend",()=>h,"willFetch",()=>c],54440),e.s(["useBaseQuery",()=>d],69637)},51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(71753);let s=(0,r.createContext)(null);function n({children:e}){let n=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,i.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,n.current)for(let e of n.current)e(o.current)});let u=(0,r.useCallback)(e=>(n.current??=new Set,n.current.add(e),()=>{n.current.delete(e)}),[]),l=(0,r.useCallback)(()=>o.current,[]),c=(0,r.useMemo)(()=>({subscribe:u,getTick:l}),[u,l]);return(0,t.jsx)(s.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(s);if(!t)throw Error("useTick must be used within a TickProvider");let i=(0,r.useRef)(e);i.current=e,(0,r.useEffect)(()=>t.subscribe(e=>i.current(e)),[t])}e.s(["TICK_RATE",0,32,"TickProvider",()=>n,"useTick",()=>a])},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),u=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(u)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(u)?e=u:u instanceof r.Texture?e=[u]:n(u)&&(e=Object.values(u)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,u]),(0,t.useMemo)(()=>{if(!n(e))return u;{let t={},r=0;for(let i in e)t[i]=u[r++];return t}},[e,u])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=16,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a])},47021,e=>{"use strict";var t=e.i(8560);let r=` -#ifdef USE_FOG - // Check fog enabled uniform - allows toggling without shader recompilation - #ifdef USE_VOLUMETRIC_FOG - if (!fogEnabled) { - // Skip all fog calculations when disabled - } else { - #endif - - float dist = vFogDepth; - - // Discard fragments at or beyond visible distance - matches Torque's behavior - // where objects beyond visibleDistance are not rendered at all. - // This prevents fully-fogged geometry from showing as silhouettes against - // the sky's fog-to-sky gradient. - if (dist >= fogFar) { - discard; - } - - // Step 1: Calculate distance-based haze (quadratic falloff) - // Since we discard at fogFar, haze never reaches 1.0 here - float haze = 0.0; - if (dist > fogNear) { - float fogScale = 1.0 / (fogFar - fogNear); - float distFactor = (dist - fogNear) * fogScale - 1.0; - haze = 1.0 - distFactor * distFactor; - } - - // Step 2: Calculate fog volume contributions - // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) - // All fog uses the global fogColor - see Tribes2_Fog_System.md for details - float volumeFog = 0.0; - - #ifdef USE_VOLUMETRIC_FOG - { - #ifdef USE_FOG_WORLD_POSITION - float fragmentHeight = vFogWorldPosition.y; - #else - float fragmentHeight = cameraHeight; - #endif - - float deltaY = fragmentHeight - cameraHeight; - float absDeltaY = abs(deltaY); - - // Determine if we're going up (positive) or down (negative) - if (absDeltaY > 0.01) { - // Non-horizontal ray: ray-march through fog volumes - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - // Skip inactive volumes (visibleDistance = 0) - if (volVisDist <= 0.0) continue; - - // Calculate fog factor for this volume - // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage - // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) - // Since we don't have quality settings, we use visFactor = 1.0 - float factor = (1.0 / volVisDist) * volPct; - - // Find ray intersection with this volume's height range - float rayMinY = min(cameraHeight, fragmentHeight); - float rayMaxY = max(cameraHeight, fragmentHeight); - - // Check if ray intersects volume height range - if (rayMinY < volMaxH && rayMaxY > volMinH) { - float intersectMin = max(rayMinY, volMinH); - float intersectMax = min(rayMaxY, volMaxH); - float intersectHeight = intersectMax - intersectMin; - - // Calculate distance traveled through this volume using similar triangles: - // subDist / dist = intersectHeight / absDeltaY - float subDist = dist * (intersectHeight / absDeltaY); - - // Accumulate fog: fog += subDist * factor - volumeFog += subDist * factor; - } - } - } else { - // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // If camera is inside this volume, apply fog for full distance - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float factor = (1.0 / volVisDist) * volPct; - volumeFog += dist * factor; - } - } - } - } - #endif - - // Step 3: Combine haze and volume fog - // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct - // This gives fog volumes priority over haze - float volPct = min(volumeFog, 1.0); - float hazePct = haze; - if (volPct + hazePct > 1.0) { - hazePct = 1.0 - volPct; - } - float fogFactor = hazePct + volPct; - - // Apply fog using global fogColor (per-volume colors not used in Tribes 2) - gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); - - #ifdef USE_VOLUMETRIC_FOG - } // end fogEnabled check - #endif -#endif -`;function i(){t.ShaderChunk.fog_pars_fragment=` -#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif - - // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) - // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats - #ifdef USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - #endif - - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_fragment=r,t.ShaderChunk.fog_pars_vertex=` -#ifdef USE_FOG - varying float vFogDepth; - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_vertex=` -#ifdef USE_FOG - // Use Euclidean distance from camera, not view-space z-depth - // This ensures fog doesn't change when rotating the camera - vFogDepth = length(mvPosition.xyz); - #ifdef USE_FOG_WORLD_POSITION - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; - #endif -#endif -`}function s(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_FOG_WORLD_POSITION - #define USE_VOLUMETRIC_FOG - varying vec3 vFogWorldPosition; -#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - uniform bool fogEnabled; - #define USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/82a44da545bac352.js b/docs/_next/static/chunks/82a44da545bac352.js deleted file mode 100644 index 557b25ea..00000000 --- a/docs/_next/static/chunks/82a44da545bac352.js +++ /dev/null @@ -1,397 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66936,(e,t,n)=>{"use strict";function i(e,t){var n=e.length;for(e.push(t);0>>1,r=e[i];if(0>>1;is(l,n))us(c,l)?(e[i]=c,e[u]=n,i=u):(e[i]=l,e[o]=n,i=o);else if(us(c,n))e[i]=c,e[u]=n,i=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,_=!1,y=!1,x="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,S="u">typeof setImmediate?setImmediate:null;function M(e){for(var t=r(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,i(h,t);else break;t=r(d)}}function T(e){if(_=!1,M(e),!v)if(null!==r(h))v=!0,w||(w=!0,o());else{var t=r(d);null!==t&&N(T,t.startTime-e)}}var w=!1,E=-1,A=5,C=-1;function R(){return!!y||!(n.unstable_now()-Ce&&R());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,M(e),t=!0;break t}f===r(h)&&a(h),M(e)}else a(h);f=r(h)}if(null!==f)t=!0;else{var u=r(d);null!==u&&N(T,u.startTime-e),t=!1}}break e}finally{f=null,m=i,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof S)o=function(){S(P)};else if("u">typeof MessageChannel){var I=new MessageChannel,L=I.port2;I.port1.onmessage=P,o=function(){L.postMessage(null)}}else o=function(){x(P,0)};function N(e,t){E=x(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_forceFrameRate=function(e){0>e||125s?(e.sortIndex=a,i(d,e),null===r(h)&&e===r(d)&&(_?(b(E),E=-1):_=!0,N(T,a-s))):(e.sortIndex=l,i(h,e),v||g||(v=!0,w||(w=!0,o()))),e},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},89499,(e,t,n)=>{"use strict";t.exports=e.r(66936)},40859,90072,8560,46791,e=>{"use strict";let t,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g,v,_;var y,x,b,S,M,T,w=e.i(47167),E=e.i(71645);let A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},C={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},R="attached",P="detached",I="srgb",L="srgb-linear",N="linear",U="srgb",D="300 es",O={COMPUTE:"compute",RENDER:"render"},F={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},z={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function B(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let k={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function V(e,t){return new k[e](t)}function H(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function G(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function W(){let e=G("canvas");return e.style.display="block",e}let j={},X=null;function q(e){X=e}function Y(){return X}function Z(...e){let t="THREE."+e.shift();X?X("log",t,...e):console.log(t,...e)}function J(...e){let t="THREE."+e.shift();X?X("warn",t,...e):console.warn(t,...e)}function K(...e){let t="THREE."+e.shift();X?X("error",t,...e):console.error(t,...e)}function $(...e){let t=e.join(" ");t in j||(j[t]=!0,J(...e))}function Q(e,t,n){return new Promise(function(i,r){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}},n)})}class ee{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let i=n[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,i=t.length;n>8&255]+et[e>>16&255]+et[e>>24&255]+"-"+et[255&t]+et[t>>8&255]+"-"+et[t>>16&15|64]+et[t>>24&255]+"-"+et[63&n|128]+et[n>>8&255]+"-"+et[n>>16&255]+et[n>>24&255]+et[255&i]+et[i>>8&255]+et[i>>16&255]+et[i>>24&255]).toLowerCase()}function es(e,t,n){return Math.max(t,Math.min(n,e))}function eo(e,t){return(e%t+t)%t}function el(e,t,n){return(1-n)*e+n*t}function eu(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function ec(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let eh={DEG2RAD:ei,RAD2DEG:er,generateUUID:ea,clamp:es,euclideanModulo:eo,mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:el,damp:function(e,t,n,i){return el(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(eo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(en=e);let t=en+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*ei},radToDeg:function(e){return e*er},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){let a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((t+i)/2),c=s((t+i)/2),h=a((t-i)/2),d=s((t-i)/2),p=a((i-t)/2),f=s((i-t)/2);switch(r){case"XYX":e.set(o*c,l*h,l*d,o*u);break;case"YZY":e.set(l*d,o*c,l*h,o*u);break;case"ZXZ":e.set(l*h,l*d,o*c,o*u);break;case"XZX":e.set(o*c,l*f,l*p,o*u);break;case"YXY":e.set(l*p,o*c,l*f,o*u);break;case"ZYZ":e.set(l*f,l*p,o*c,o*u);break;default:J("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:ec,denormalize:eu};class ed{constructor(e=0,t=0){ed.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(es(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ep{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],u=n[i+2],c=n[i+3],h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(s<=0){e[t+0]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c;return}if(s>=1){e[t+0]=h,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||o!==h||l!==d||u!==p){let e=o*h+l*d+u*p+c*f;e<0&&(h=-h,d=-d,p=-p,f=-f,e=-e);let t=1-s;if(e<.9995){let n=Math.acos(e),i=Math.sin(n);o=o*(t=Math.sin(t*n)/i)+h*(s=Math.sin(s*n)/i),l=l*t+d*s,u=u*t+p*s,c=c*t+f*s}else{let e=1/Math.sqrt((o=o*t+h*s)*o+(l=l*t+d*s)*l+(u=u*t+p*s)*u+(c=c*t+f*s)*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,i,r,a){let s=n[i],o=n[i+1],l=n[i+2],u=n[i+3],c=r[a],h=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+u*c+o*d-l*h,e[t+1]=o*p+u*h+l*c-s*d,e[t+2]=l*p+u*d+s*h-o*c,e[t+3]=u*p-s*c-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),u=s(i/2),c=s(r/2),h=o(n/2),d=o(i/2),p=o(r/2);switch(a){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:J("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],u=t[6],c=t[10],h=n+s+c;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>c){let e=2*Math.sqrt(1+n-s-c);this._w=(u-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>c){let e=2*Math.sqrt(1+s-n-c);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+u)/e}else{let e=2*Math.sqrt(1+c-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(es(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)return this;let i=Math.min(1,t/n);return this.slerp(e,i),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+a*s+i*l-r*o,this._y=i*u+a*o+r*s-n*l,this._z=r*u+a*l+n*o-i*s,this._w=a*u-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,i=e._y,r=e._z,a=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let o=1-t;if(s<.9995){let e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ef{constructor(e=0,t=0,n=0){ef.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(eg.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(eg.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),u=2*(s*t-r*i),c=2*(r*n-a*t);return this.x=t+o*l+a*c-s*u,this.y=n+o*u+s*l-r*c,this.z=i+o*c+r*u-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this.z=es(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this.z=es(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return em.copy(this).projectOnVector(e),this.sub(em)}reflect(e){return this.sub(em.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(es(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let em=new ef,eg=new ep;class ev{constructor(e,t,n,i,r,a,s,o,l){ev.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){let u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=t,u[4]=r,u[5]=o,u[6]=n,u[7]=a,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],b=i[5],S=i[8];return r[0]=a*f+s*v+o*x,r[3]=a*m+s*_+o*b,r[6]=a*g+s*y+o*S,r[1]=l*f+u*v+c*x,r[4]=l*m+u*_+c*b,r[7]=l*g+u*y+c*S,r[2]=h*f+d*v+p*x,r[5]=h*m+d*_+p*b,r[8]=h*g+d*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8];return t*a*u-t*s*l-n*r*u+n*s*o+i*r*l-i*a*o}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=u*a-s*l,h=s*o-u*r,d=l*r-a*o,p=t*c+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(i*l-u*n)*f,e[2]=(s*n-i*a)*f,e[3]=h*f,e[4]=(u*t-i*o)*f,e[5]=(i*r-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*r)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(e_.makeScale(e,t)),this}rotate(e){return this.premultiply(e_.makeRotation(-e)),this}translate(e,t){return this.premultiply(e_.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let e_=new ev,ey=new ev().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ex=new ev().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),eb=(d=[.64,.33,.3,.6,.15,.06],p=[.2126,.7152,.0722],f=[.3127,.329],(h={enabled:!0,workingColorSpace:L,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===U&&(e.r=eS(e.r),e.g=eS(e.g),e.b=eS(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===U&&(e.r=eM(e.r),e.g=eM(e.g),e.b=eM(e.b))),e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return""===e?N:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,t){return $("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),h.workingToColorSpace(e,t)},toWorkingColorSpace:function(e,t){return $("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),h.colorSpaceToWorking(e,t)}}).define({[L]:{primaries:d,whitePoint:f,transfer:N,toXYZ:ey,fromXYZ:ex,luminanceCoefficients:p,workingColorSpaceConfig:{unpackColorSpace:I},outputColorSpaceConfig:{drawingBufferColorSpace:I}},[I]:{primaries:d,whitePoint:f,transfer:U,toXYZ:ey,fromXYZ:ex,luminanceCoefficients:p,outputColorSpaceConfig:{drawingBufferColorSpace:I}}}),h);function eS(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function eM(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class eT{static getDataURL(e,n="image/png"){let i;if(/^data:/i.test(e.src)||"u"typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap){let t=G("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;etypeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"u">typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;ttypeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap?eT.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(J("Texture: Unable to serialize Texture."),{})}let eC=0,eR=new ef;class eP extends ee{constructor(e=eP.DEFAULT_IMAGE,t=eP.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=eP.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:eC++}),this.uuid=ea(),this.name="",this.source=new eE(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new ed(0,0),this.repeat=new ed(1,1),this.center=new ed(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ev,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(eR).x}get height(){return this.source.getSize(eR).y}get depth(){return this.source.getSize(eR).z}get image(){return this.source.data}set image(e=null){this.source.data=e}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(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(void 0===n){J(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){J(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}eP.DEFAULT_IMAGE=null,eP.DEFAULT_MAPPING=300,eP.DEFAULT_ANISOTROPY=1;class eI{constructor(e=0,t=0,n=0,i=1){eI.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r,a=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,_=(h+p)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=v/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=_/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=v/(r=Math.sqrt(m)),i=_/r),this.set(n,i,r,t),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this.z=es(this.z,e.z,t.z),this.w=es(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this.z=es(this.z,e,t),this.w=es(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 eL extends ee{constructor(e=1,t=1,n={}){super(),n=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},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new eI(0,0,e,t),this.scissorTest=!1,this.viewport=new eI(0,0,e,t);const i=new eP({width:e,height:t,depth:n.depth});this.textures=[];const r=n.count;for(let e=0;e1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ek),ek.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(eY),eZ.subVectors(this.max,eY),eH.subVectors(e.a,eY),eG.subVectors(e.b,eY),eW.subVectors(e.c,eY),ej.subVectors(eG,eH),eX.subVectors(eW,eG),eq.subVectors(eH,eW);let t=[0,-ej.z,ej.y,0,-eX.z,eX.y,0,-eq.z,eq.y,ej.z,0,-ej.x,eX.z,0,-eX.x,eq.z,0,-eq.x,-ej.y,ej.x,0,-eX.y,eX.x,0,-eq.y,eq.x,0];return!!e$(t,eH,eG,eW,eZ)&&!!e$(t=[1,0,0,0,1,0,0,0,1],eH,eG,eW,eZ)&&(eJ.crossVectors(ej,eX),e$(t=[eJ.x,eJ.y,eJ.z],eH,eG,eW,eZ))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ek).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ek).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(eB[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eB[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eB[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eB[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eB[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eB[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eB[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eB[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eB)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}let eB=[new ef,new ef,new ef,new ef,new ef,new ef,new ef,new ef],ek=new ef,eV=new ez,eH=new ef,eG=new ef,eW=new ef,ej=new ef,eX=new ef,eq=new ef,eY=new ef,eZ=new ef,eJ=new ef,eK=new ef;function e$(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){eK.fromArray(e,a);let s=r.x*Math.abs(eK.x)+r.y*Math.abs(eK.y)+r.z*Math.abs(eK.z),o=t.dot(eK),l=n.dot(eK),u=i.dot(eK);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>s)return!1}return!0}let eQ=new ez,e0=new ef,e1=new ef;class e2{constructor(e=new ef,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):eQ.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;e0.subVectors(e,this.center);let t=e0.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(e0,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(e1.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(e0.copy(e.center).add(e1)),this.expandByPoint(e0.copy(e.center).sub(e1)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let e3=new ef,e4=new ef,e5=new ef,e6=new ef,e8=new ef,e9=new ef,e7=new ef;class te{constructor(e=new ef,t=new ef(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,e3)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=e3.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(e3.copy(this.origin).addScaledVector(this.direction,t),e3.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){let r,a,s,o;e4.copy(e).add(t).multiplyScalar(.5),e5.copy(t).sub(e).normalize(),e6.copy(this.origin).sub(e4);let l=.5*e.distanceTo(t),u=-this.direction.dot(e5),c=e6.dot(this.direction),h=-e6.dot(e5),d=e6.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(r=u*h-c,a=u*c-h,o=l*p,r>=0)if(a>=-o)if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+u*a+2*c)+a*(u*r+a+2*h)+d}else s=-(r=Math.max(0,-(u*(a=l)+c)))*r+a*(a+2*h)+d;else s=-(r=Math.max(0,-(u*(a=-l)+c)))*r+a*(a+2*h)+d;else a<=-o?(a=(r=Math.max(0,-(-u*l+c)))>0?-l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(r=Math.max(0,-(u*l+c)))>0?l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d);else a=u>0?-l:l,s=-(r=Math.max(0,-(u*a+c)))*r+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,r),i&&i.copy(e4).addScaledVector(e5,a),s}intersectSphere(e,t){e3.subVectors(e.center,this.origin);let n=e3.dot(this.direction),i=e3.dot(e3)-n*n,r=e.radius*e.radius;if(i>r)return null;let a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,i,r,a,s,o,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),u>=0?(r=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a=0?(s=(e.min.z-h.z)*c,o=(e.max.z-h.z)*c):(s=(e.max.z-h.z)*c,o=(e.min.z-h.z)*c),n>o||s>i||((s>n||n!=n)&&(n=s),(o=0?n:i,t)}intersectsBox(e){return null!==this.intersectBox(e,e3)}intersectTriangle(e,t,n,i,r){let a;e8.subVectors(t,e),e9.subVectors(n,e),e7.crossVectors(e8,e9);let s=this.direction.dot(e7);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}e6.subVectors(this.origin,e);let o=a*this.direction.dot(e9.crossVectors(e6,e9));if(o<0)return null;let l=a*this.direction.dot(e8.cross(e6));if(l<0||o+l>s)return null;let u=-a*e6.dot(e7);return u<0?null:this.at(u/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tt{constructor(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m)}set(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 tt().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return 0===this.determinant()?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1)):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2)),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinant())return this.identity();let t=this.elements,n=e.elements,i=1/tn.setFromMatrixColumn(e,0).length(),r=1/tn.setFromMatrixColumn(e,1).length(),a=1/tn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){let e=a*u,n=a*c,i=s*u,r=s*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*u,n=o*c,i=l*u,r=l*c;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*u,n=o*c,i=l*u,r=l*c;t[0]=e-r*s,t[4]=-a*c,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*u,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*u,n=a*c,i=s*u,r=s*c;t[0]=o*u,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*c,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*u,t[4]=r-e*c,t[8]=i*c+n,t[1]=c,t[5]=a*u,t[9]=-s*u,t[2]=-l*u,t[6]=n*c+i,t[10]=e-r*c}else if("XZY"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+r,t[5]=a*u,t[9]=n*c-i,t[2]=i*c-n,t[6]=s*u,t[10]=r*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(tr,e,ta)}lookAt(e,t,n){let i=this.elements;return tl.subVectors(e,t),0===tl.lengthSq()&&(tl.z=1),tl.normalize(),ts.crossVectors(n,tl),0===ts.lengthSq()&&(1===Math.abs(n.z)?tl.x+=1e-4:tl.z+=1e-4,tl.normalize(),ts.crossVectors(n,tl)),ts.normalize(),to.crossVectors(tl,ts),i[0]=ts.x,i[4]=to.x,i[8]=tl.x,i[1]=ts.y,i[5]=to.y,i[9]=tl.y,i[2]=ts.z,i[6]=to.z,i[10]=tl.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],b=i[0],S=i[4],M=i[8],T=i[12],w=i[1],E=i[5],A=i[9],C=i[13],R=i[2],P=i[6],I=i[10],L=i[14],N=i[3],U=i[7],D=i[11],O=i[15];return r[0]=a*b+s*w+o*R+l*N,r[4]=a*S+s*E+o*P+l*U,r[8]=a*M+s*A+o*I+l*D,r[12]=a*T+s*C+o*L+l*O,r[1]=u*b+c*w+h*R+d*N,r[5]=u*S+c*E+h*P+d*U,r[9]=u*M+c*A+h*I+d*D,r[13]=u*T+c*C+h*L+d*O,r[2]=p*b+f*w+m*R+g*N,r[6]=p*S+f*E+m*P+g*U,r[10]=p*M+f*A+m*I+g*D,r[14]=p*T+f*C+m*L+g*O,r[3]=v*b+_*w+y*R+x*N,r[7]=v*S+_*E+y*P+x*U,r[11]=v*M+_*A+y*I+x*D,r[15]=v*T+_*C+y*L+x*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15],v=o*d-l*h,_=s*d-l*c,y=s*h-o*c,x=a*d-l*u,b=a*h-o*u,S=a*c-s*u;return t*(f*v-m*_+g*y)-n*(p*v-m*x+g*b)+i*(p*_-f*x+g*S)-r*(p*y-f*b+m*S)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*o*d-s*m*d-c*o*g+s*h*g,_=p*h*l-u*m*l-p*o*d+a*m*d+u*o*g-a*h*g,y=u*f*l-p*c*l+p*s*d-a*f*d-u*s*g+a*c*g,x=p*c*o-u*f*o-p*s*h+a*f*h+u*s*m-a*c*m,b=t*v+n*_+i*y+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/b;return e[0]=v*S,e[1]=(f*h*r-c*m*r-f*i*d+n*m*d+c*i*g-n*h*g)*S,e[2]=(s*m*r-f*o*r+f*i*l-n*m*l-s*i*g+n*o*g)*S,e[3]=(c*o*r-s*h*r-c*i*l+n*h*l+s*i*d-n*o*d)*S,e[4]=_*S,e[5]=(u*m*r-p*h*r+p*i*d-t*m*d-u*i*g+t*h*g)*S,e[6]=(p*o*r-a*m*r-p*i*l+t*m*l+a*i*g-t*o*g)*S,e[7]=(a*h*r-u*o*r+u*i*l-t*h*l-a*i*d+t*o*d)*S,e[8]=y*S,e[9]=(p*c*r-u*f*r-p*n*d+t*f*d+u*n*g-t*c*g)*S,e[10]=(a*f*r-p*s*r+p*n*l-t*f*l-a*n*g+t*s*g)*S,e[11]=(u*s*r-a*c*r-u*n*l+t*c*l+a*n*d-t*s*d)*S,e[12]=x*S,e[13]=(u*f*i-p*c*i+p*n*h-t*f*h-u*n*m+t*c*m)*S,e[14]=(p*s*i-a*f*i-p*n*o+t*f*o+a*n*m-t*s*m)*S,e[15]=(a*c*i-u*s*i+u*n*o-t*c*o-a*n*h+t*s*h)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,u=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,u*s+n,u*o-i*a,0,l*o-i*s,u*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,u=a+a,c=s+s,h=r*l,d=r*u,p=r*c,f=a*u,m=a*c,g=s*c,v=o*l,_=o*u,y=o*c,x=n.x,b=n.y,S=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+_)*S,i[9]=(m-v)*S,i[10]=(1-(h+f))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],0===this.determinant())return n.set(1,1,1),t.identity(),this;let r=tn.set(i[0],i[1],i[2]).length(),a=tn.set(i[4],i[5],i[6]).length(),s=tn.set(i[8],i[9],i[10]).length();0>this.determinant()&&(r=-r),ti.copy(this);let o=1/r,l=1/a,u=1/s;return ti.elements[0]*=o,ti.elements[1]*=o,ti.elements[2]*=o,ti.elements[4]*=l,ti.elements[5]*=l,ti.elements[6]*=l,ti.elements[8]*=u,ti.elements[9]*=u,ti.elements[10]*=u,t.setFromRotationMatrix(ti),n.x=r,n.y=a,n.z=s,this}makePerspective(e,t,n,i,r,a,s=2e3,o=!1){let l,u,c=this.elements;if(o)l=r/(a-r),u=a*r/(a-r);else if(2e3===s)l=-(a+r)/(a-r),u=-2*a*r/(a-r);else if(2001===s)l=-a/(a-r),u=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return c[0]=2*r/(t-e),c[4]=0,c[8]=(t+e)/(t-e),c[12]=0,c[1]=0,c[5]=2*r/(n-i),c[9]=(n+i)/(n-i),c[13]=0,c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,r,a,s=2e3,o=!1){let l,u,c=this.elements;if(o)l=1/(a-r),u=a/(a-r);else if(2e3===s)l=-2/(a-r),u=-(a+r)/(a-r);else if(2001===s)l=-1/(a-r),u=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return c[0]=2/(t-e),c[4]=0,c[8]=0,c[12]=-(t+e)/(t-e),c[1]=0,c[5]=2/(n-i),c[9]=0,c[13]=-(n+i)/(n-i),c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}let tn=new ef,ti=new tt,tr=new ef(0,0,0),ta=new ef(1,1,1),ts=new ef,to=new ef,tl=new ef,tu=new tt,tc=new ep;class th{constructor(e=0,t=0,n=0,i=th.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],u=i[9],c=i[2],h=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(es(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-es(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(es(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-es(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(es(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-es(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-u,d),this._y=0);break;default:J("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return tu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(tu,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return tc.setFromEuler(this),this.setFromQuaternion(tc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}th.DEFAULT_ORDER="XYZ";class td{constructor(){this.mask=1}set(e){this.mask=1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>({...e})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t0){i.children=[];for(let t=0;t0){i.animations=[];for(let t=0;t0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=i,n;function a(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){tR.subVectors(i,t),tP.subVectors(n,t),tI.subVectors(e,t);let a=tR.dot(tR),s=tR.dot(tP),o=tR.dot(tI),l=tP.dot(tP),u=tP.dot(tI),c=a*l-s*s;if(0===c)return r.set(0,0,0),null;let h=1/c,d=(l*o-s*u)*h,p=(a*u-s*o)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,tL)&&tL.x>=0&&tL.y>=0&&tL.x+tL.y<=1}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,tL)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,tL.x),o.addScaledVector(a,tL.y),o.addScaledVector(s,tL.z),o)}static getInterpolatedAttribute(e,t,n,i,r,a){return tB.setScalar(0),tk.setScalar(0),tV.setScalar(0),tB.fromBufferAttribute(e,t),tk.fromBufferAttribute(e,n),tV.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(tB,r.x),a.addScaledVector(tk,r.y),a.addScaledVector(tV,r.z),a}static isFrontFacing(e,t,n,i){return tR.subVectors(n,t),tP.subVectors(e,t),0>tR.cross(tP).dot(i)}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tR.subVectors(this.c,this.b),tP.subVectors(this.a,this.b),.5*tR.cross(tP).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tH.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return tH.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return tH.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return tH.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tH.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,i,r=this.a,a=this.b,s=this.c;tN.subVectors(a,r),tU.subVectors(s,r),tO.subVectors(e,r);let o=tN.dot(tO),l=tU.dot(tO);if(o<=0&&l<=0)return t.copy(r);tF.subVectors(e,a);let u=tN.dot(tF),c=tU.dot(tF);if(u>=0&&c<=u)return t.copy(a);let h=o*c-u*l;if(h<=0&&o>=0&&u<=0)return n=o/(o-u),t.copy(r).addScaledVector(tN,n);tz.subVectors(e,s);let d=tN.dot(tz),p=tU.dot(tz);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return i=l/(l-p),t.copy(r).addScaledVector(tU,i);let m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return tD.subVectors(s,a),i=(c-u)/(c-u+(d-p)),t.copy(a).addScaledVector(tD,i);let g=1/(m+f+h);return n=f*g,i=h*g,t.copy(r).addScaledVector(tN,n).addScaledVector(tU,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let tG={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},tW={h:0,s:0,l:0},tj={h:0,s:0,l:0};function tX(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class tq{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=I){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,eb.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=eb.workingColorSpace){return this.r=e,this.g=t,this.b=n,eb.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=eb.workingColorSpace){if(e=eo(e,1),t=es(t,0,1),n=es(n,0,1),0===t)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=tX(r,i,e+1/3),this.g=tX(r,i,e),this.b=tX(r,i,e-1/3)}return eb.colorSpaceToWorking(this,i),this}setStyle(e,t=I){let n;function i(t){void 0!==t&&1>parseFloat(t)&&J("Color: Alpha component of "+e+" will be ignored.")}if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:J("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(i,16),t);J("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=I){let n=tG[e.toLowerCase()];return void 0!==n?this.setHex(n,t):J("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=eS(e.r),this.g=eS(e.g),this.b=eS(e.b),this}copyLinearToSRGB(e){return this.r=eM(e.r),this.g=eM(e.g),this.b=eM(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=I){return eb.workingToColorSpace(tY.copy(this),e),65536*Math.round(es(255*tY.r,0,255))+256*Math.round(es(255*tY.g,0,255))+Math.round(es(255*tY.b,0,255))}getHexString(e=I){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=eb.workingColorSpace){let n,i;eb.workingToColorSpace(tY.copy(this),t);let r=tY.r,a=tY.g,s=tY.b,o=Math.max(r,a,s),l=Math.min(r,a,s),u=(l+o)/2;if(l===o)n=0,i=0;else{let e=o-l;switch(i=u<=.5?e/(o+l):e/(2-o-l),o){case r:n=(a-s)/e+6*(a0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){J(`Material: parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){J(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(n.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(n.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(null!==t){let e=t.length;n=Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class tK extends tJ{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tq(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 th,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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let t$=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),i=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(i[e]=0,i[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(i[e]=1024>>-t-14,i[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(i[e]=t+15<<10,i[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(i[e]=31744,i[256|e]=64512,r[e]=24,r[256|e]=24):(i[e]=31744,i[256|e]=64512,r[e]=13,r[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;(8388608&t)==0;)t<<=1,n-=8388608;t&=-8388609,n+=0x38800000,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=0x47800000,s[32]=0x80000000;for(let e=33;e<63;++e)s[e]=0x80000000+(e-32<<23);s[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}();function tQ(e){Math.abs(e)>65504&&J("DataUtils.toHalfFloat(): Value out of range."),e=es(e,-65504,65504),t$.floatView[0]=e;let t=t$.uint32View[0],n=t>>23&511;return t$.baseTable[n]+((8388607&t)>>t$.shiftTable[n])}function t0(e){let t=e>>10;return t$.uint32View[0]=t$.mantissaTable[t$.offsetTable[t]+(1023&e)]+t$.exponentTable[t],t$.floatView[0]}class t1{static toHalfFloat(e){return tQ(e)}static fromHalfFloat(e){return t0(e)}}let t2=new ef,t3=new ed,t4=0;class t5{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:t4++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;it.count&&J("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ez);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){K("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ef(-1/0,-1/0,-1/0),new ef(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let i=n[t];e.data.attributes[t]=i.toJSON(e.data)}let i={},r=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;null!==n&&this.setIndex(n.clone());let i=e.attributes;for(let e in i){let n=i[e];this.setAttribute(e,n.clone(t))}let r=e.morphAttributes;for(let e in r){let n=[],i=r[e];for(let e=0,r=i.length;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2)||(np.copy(r).invert(),nf.copy(e.ray).applyMatrix4(np),(null===n.boundingBox||!1!==nf.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,nf)))}_computeIntersections(e,t,n){let i,r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,c=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let r=0,o=h.length;rn.far?null:{distance:l,point:nM.clone(),object:e}}(e,t,n,i,nv,n_,ny,nS);if(c){let e=new ef;tH.getBarycoord(nS,nv,n_,ny,e),r&&(c.uv=tH.getInterpolatedAttribute(r,o,l,u,e,new ed)),a&&(c.uv1=tH.getInterpolatedAttribute(a,o,l,u,e,new ed)),s&&(c.normal=tH.getInterpolatedAttribute(s,o,l,u,e,new ef),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let t={a:o,b:l,c:u,normal:new ef,materialIndex:0};tH.getNormal(nv,n_,ny,t.normal),c.face=t,c.barycoord=e}return c}class nE extends nd{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[];let h=0,d=0;function p(e,t,n,i,r,a,p,f,m,g,v){let _=a/m,y=p/g,x=a/2,b=p/2,S=f/2,M=m+1,T=g+1,w=0,E=0,A=new ef;for(let a=0;a0?1:-1,u.push(A.x,A.y,A.z),c.push(o/m),c.push(1-a/g),w+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class nL extends tC{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tt,this.projectionMatrix=new tt,this.projectionMatrixInverse=new tt,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let nN=new ef,nU=new ed,nD=new ed;class nO extends nL{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*er*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*ei*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*er*Math.atan(Math.tan(.5*ei*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){nN.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(nN.x,nN.y).multiplyScalar(-e/nN.z),nN.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(nN.x,nN.y).multiplyScalar(-e/nN.z)}getViewSize(e,t){return this.getViewBounds(e,nU,nD),t.subVectors(nD,nU)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*ei*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class nF extends tC{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new nO(-90,1,e,t);i.layers=this.layers,this.add(i);const r=new nO(-90,1,e,t);r.layers=this.layers,this.add(r);const a=new nO(-90,1,e,t);a.layers=this.layers,this.add(a);const s=new nO(-90,1,e,t);s.layers=this.layers,this.add(s);const o=new nO(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new nO(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,s,o]=t;for(let e of t)this.remove(e);if(2e3===e)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===e)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,s),e.setRenderTarget(n,3,i),e.render(t,o),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,i),e.render(t,u),e.setRenderTarget(c,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class nz extends eP{constructor(e=[],t=301,n,i,r,a,s,o,l,u){super(e,t,n,i,r,a,s,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class nB extends eN{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1};this.texture=new nz([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new nE(5,5,5),r=new nI({name:"CubemapFromEquirect",uniforms:nA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let a=new nT(i,r),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new nF(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}class nk extends tC{constructor(){super(),this.isGroup=!0,this.type="Group"}}let nV={type:"move"};class nH{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new nk,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 nk,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ef,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ef),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new nk,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ef,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ef),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())){let e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}let i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(i=t.getPose(e.targetRaySpace,n))&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(nV)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new nk;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class nG{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new tq(e),this.density=t}clone(){return new nG(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class nW{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new tq(e),this.near=t,this.far=n}clone(){return new nW(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class nj extends tC{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 th,this.environmentIntensity=1,this.environmentRotation=new th,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class nX{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=ea()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;ie.far||t.push({distance:o,point:nJ.clone(),uv:tH.getInterpolation(nJ,n2,n3,n4,n5,n6,n8,new ed),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function n7(e,t,n,i,r,a){nQ.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(n0.x=a*nQ.x-r*nQ.y,n0.y=r*nQ.x+a*nQ.y):n0.copy(nQ),e.copy(t),e.x+=n0.x,e.y+=n0.y,e.applyMatrix4(n1)}let ie=new ef,it=new ef;class ii extends tC{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e0){let n,i;for(n=1,i=t.length;n0){ie.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(ie);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){let n,i;ie.setFromMatrixPosition(e.matrixWorld),it.setFromMatrixPosition(this.matrixWorld);let r=ie.distanceTo(it)/e.zoom;for(n=1,t[0].object.visible=!0,i=t.length;n=e)t[n-1].object.visible=!1,t[n].object.visible=!0;else break}for(this._currentLevel=n-1;n1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||iI.getNormalMatrix(e),i=this.coplanarPoint(iR).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let iN=new e2,iU=new ed(.5,.5),iD=new ef;class iO{constructor(e=new iL,t=new iL,n=new iL,i=new iL,r=new iL,a=new iL){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3,n=!1){let i=this.planes,r=e.elements,a=r[0],s=r[1],o=r[2],l=r[3],u=r[4],c=r[5],h=r[6],d=r[7],p=r[8],f=r[9],m=r[10],g=r[11],v=r[12],_=r[13],y=r[14],x=r[15];if(i[0].setComponents(l-a,d-u,g-p,x-v).normalize(),i[1].setComponents(l+a,d+u,g+p,x+v).normalize(),i[2].setComponents(l+s,d+c,g+f,x+_).normalize(),i[3].setComponents(l-s,d-c,g-f,x-_).normalize(),n)i[4].setComponents(o,h,m,y).normalize(),i[5].setComponents(l-o,d-h,g-m,x-y).normalize();else if(i[4].setComponents(l-o,d-h,g-m,x-y).normalize(),2e3===t)i[5].setComponents(l+o,d+h,g+m,x+y).normalize();else if(2001===t)i[5].setComponents(o,h,m,y).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),iN.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),iN.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(iN)}intersectsSprite(e){return iN.center.set(0,0,0),iN.radius=.7071067811865476+iU.distanceTo(e.center),iN.applyMatrix4(e.matrixWorld),this.intersectsSphere(iN)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,iD.y=i.normal.y>0?e.max.y:e.min.y,iD.z=i.normal.z>0?e.max.z:e.min.z,0>i.distanceToPoint(iD))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}let iF=new tt,iz=new iO;class iB{constructor(){this.coordinateSystem=2e3}intersectsObject(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(let n=0;n=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});let s=r[this.index];a.push(s),this.index++,s.start=e,s.count=t,s.z=n,s.index=i}reset(){this.list.length=0,this.index=0}},iQ=new nT,i0=[];function i1(e,t){if(e.constructor!==t.constructor){let n=Math.min(e.length,t.length);for(let i=0;i65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new t5(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let i=e.getAttribute(n),r=t.getAttribute(n);if(i.itemSize!==r.itemSize||i.normalized!==r.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ez);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(ik),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let i=this._matricesTexture;iG.identity().toArray(i.image.data,16*n),i.needsUpdate=!0;let r=this._colorsTexture;return r&&(iW.toArray(r.image.data,4*n),r.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,n=-1){let i;this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=-1===t?e.getAttribute("position").count:t;let s=e.getIndex();if(null!==s&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=-1===n?s.count:n),-1!==r.indexStart&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(ik),a[i=this._availableGeometryIds.shift()]=r):(i=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(i,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,i}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);let n=this.geometry,i=null!==n.getIndex(),r=n.getIndex(),a=t.getIndex(),s=this._geometryInfo[e];if(i&&a.count>s.reservedIndexCount||t.attributes.position.count>s.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=s.vertexStart,l=s.reservedVertexCount;for(let e in s.vertexCount=t.getAttribute("position").count,n.attributes){let i=t.getAttribute(e),r=n.getAttribute(e);!function(e,t,n=0){let i=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let r=e.count;for(let a=0;a=t.length||!1===t[e].active)return this;let n=this._instanceInfo;for(let t=0,i=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),r=this.geometry;for(let a=0,s=n.length;a=this._geometryCount)return null;let n=this.geometry,i=this._geometryInfo[e];if(null===i.boundingBox){let e=new ez,t=n.index,r=n.attributes.position;for(let n=i.start,a=i.start+i.count;n=this._geometryCount)return null;let n=this.geometry,i=this._geometryInfo[e];if(null===i.boundingSphere){let t=new e2;this.getBoundingBoxAt(e,iq),iq.getCenter(t.center);let r=n.index,a=n.attributes.position,s=0;for(let e=i.start,n=i.start+i.count;ee.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let i=this.geometry;i.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new nd,this._initializeGeometry(i));let r=this.geometry;for(let e in i.index&&i1(i.index.array,r.index.array),i.attributes)i1(i.attributes[e].array,r.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,i=this._geometryInfo,r=this.matrixWorld,a=this.geometry;iQ.material=this.material,iQ.geometry.index=a.index,iQ.geometry.attributes=a.attributes,null===iQ.geometry.boundingBox&&(iQ.geometry.boundingBox=new ez),null===iQ.geometry.boundingSphere&&(iQ.geometry.boundingSphere=new e2);for(let a=0,s=n.length;a({...e,boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._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(e,t,n,i,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=i.getIndex(),s=null===a?1:a.array.BYTES_PER_ELEMENT,o=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data,f=n.isArrayCamera?iX:ij;h&&!n.isArrayCamera&&(iG.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),ij.setFromProjectionMatrix(iG,n.coordinateSystem,n.reversedDepth));let m=0;if(this.sortObjects){iG.copy(this.matrixWorld).invert(),iZ.setFromMatrixPosition(n.matrixWorld).applyMatrix4(iG),iJ.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(iG);for(let e=0,t=o.length;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei)return;i7.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(i7);if(!(lt.far))return{distance:l,point:re.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}let ri=new ef,rr=new ef;class ra extends rt{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,n=[];for(let e=0,i=t.count;e0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class rf extends eP{constructor(e,t,n,i,r=1006,a=1006,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const u=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class rm extends rf{constructor(e,t,n,i,r,a,s,o){super({},e,t,n,i,r,a,s,o),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class rg extends eP{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}class rv extends eP{constructor(e,t,n,i,r,a,s,o,l,u,c,h){super(null,a,s,o,l,u,i,r,c,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class r_ extends rv{constructor(e,t,n,i,r,a){super(e,t,n,r,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=1001,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ry extends rv{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class rx extends eP{constructor(e,t,n,i,r,a,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class rb extends eP{constructor(e,t,n=1014,i,r,a,s=1003,o=1003,l,u=1026,c=1){if(1026!==u&&1027!==u)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:c},i,r,a,s,o,u,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new eE(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class rS extends rb{constructor(e,t=1014,n=301,i,r,a=1003,s=1003,o,l=1026){const u={width:e,height:e,depth:1};super(e,e,t,n,i,r,a,s,o,l),this.image=[u,u,u,u,u,u],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class rM extends eP{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class rT extends nd{constructor(e=1,t=1,n=4,i=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i,heightSegments:r},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),i=Math.max(3,Math.floor(i));const a=[],s=[],o=[],l=[],u=t/2,c=Math.PI/2*e,h=t,d=2*c+h,p=2*n+(r=Math.max(1,Math.floor(r))),f=i+1,m=new ef,g=new ef;for(let v=0;v<=p;v++){let _=0,y=0,x=0,b=0;if(v<=n){const t=v/n,i=t*Math.PI/2;y=-u-e*Math.cos(i),x=e*Math.sin(i),b=-e*Math.cos(i),_=t*c}else if(v<=n+r){const i=(v-n)/r;y=-u+i*t,x=e,b=0,_=c+i*h}else{const t=(v-n-r)/n,i=t*Math.PI/2;y=u+e*Math.sin(i),x=e*Math.cos(i),b=e*Math.sin(i),_=c+h+t*c}const S=Math.max(0,Math.min(1,_/d));let M=0;0===v?M=.5/i:v===p&&(M=-.5/i);for(let e=0;e<=i;e++){const t=e/i,n=t*Math.PI*2,r=Math.sin(n),a=Math.cos(n);g.x=-x*a,g.y=y,g.z=x*r,s.push(g.x,g.y,g.z),m.set(-x*a,b,x*r),m.normalize(),o.push(m.x,m.y,m.z),l.push(t+M,S)}if(v>0){const e=(v-1)*f;for(let t=0;t0||0!==i)&&(u.push(a,s,l),_+=3),(t>0||i!==r-1)&&(u.push(s,o,l),_+=3)}l.addGroup(g,_,0),g+=_})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new nr(c,3)),this.setAttribute("normal",new nr(h,3)),this.setAttribute("uv",new nr(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rE(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rA extends rE{constructor(e=1,t=1,n=32,i=1,r=!1,a=0,s=2*Math.PI){super(0,e,t,n,i,r,a,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:s}}static fromJSON(e){return new rA(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rC extends nd{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],a=[];function s(e){r.push(e.x,e.y,e.z)}function o(t,n){let i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function l(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}(function(e){let n=new ef,i=new ef,r=new ef;for(let a=0;a.9&&s<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new nr(r,3)),this.setAttribute("normal",new nr(r.slice(),3)),this.setAttribute("uv",new nr(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rC(e.vertices,e.indices,e.radius,e.detail)}}class rR extends rC{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n;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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[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],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new rR(e.radius,e.detail)}}let rP=new ef,rI=new ef,rL=new ef,rN=new tH;class rU extends nd{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=Math.cos(ei*t),i=e.getIndex(),r=e.getAttribute("position"),a=i?i.count:r.count,s=[0,0,0],o=["a","b","c"],l=[,,,],u={},c=[];for(let e=0;e0)o=r-1;else{o=r;break}if(i[r=o]===n)return r/(a-1);let u=i[r],c=i[r+1];return(r+(n-u)/(c-u))/(a-1)}getTangent(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);let r=this.getPoint(n),a=this.getPoint(i),s=t||(r.isVector2?new ed:new ef);return s.copy(a).sub(r).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new ef,i=[],r=[],a=[],s=new ef,o=new tt;for(let t=0;t<=e;t++){let n=t/e;i[t]=this.getTangentAt(n,new ef)}r[0]=new ef,a[0]=new ef;let l=Number.MAX_VALUE,u=Math.abs(i[0].x),c=Math.abs(i[0].y),h=Math.abs(i[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),a[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),a[t]=a[t-1].clone(),s.crossVectors(i[t-1],i[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(es(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(es(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],t*n)),a[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class rO extends rD{constructor(e=0,t=0,n=1,i=1,r=0,a=2*Math.PI,s=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t=new ed){let n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===l&&o===a-1&&(o=a-2,l=1),this.closed||o>0?n=r[(o-1)%a]:(rB.subVectors(r[0],r[1]).add(r[0]),n=rB);let u=r[o%a],c=r[(o+1)%a];if(this.closed||o+2n.length-2?n.length-1:r+1],u=n[r>n.length-3?n.length-1:r+2];return t.set(rW(a,s.x,o.x,l.x,u.x),rW(a,s.y,o.y,l.y,u.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=i[r]-n,a=this.curves[r],s=a.getLength(),o=0===s?0:1-e/s;return a.getPointAt(o,t)}r++}return null}getLength(){let e=this.getCurveLengths();return e[e.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 e=[],t=0;for(let n=0,i=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class r3 extends r2{constructor(e){super(e),this.uuid=ea(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0)for(let r=t;r=t;r-=i)a=ao(r/i|0,e[r],e[r+1],a);return a&&at(a,a.next)&&(al(a),a=a.next),a}function r5(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(at(n,n.next)||0===ae(n.prev,n,n.next))){if(al(n),(n=t=n.prev)===n.next)break;i=!0}else n=n.next;while(i||n!==t)return t}function r6(e,t){let n=e.x-t.x;return 0===n&&0==(n=e.y-t.y)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function r8(e,t,n,i,r){return(e=((e=((e=((e=((e=(e-n)*r|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-i)*r|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function r9(e,t,n,i,r,a,s,o){return(r-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(n-s)*(t-o)&&(n-s)*(a-o)>=(r-s)*(i-o)}function r7(e,t,n,i,r,a,s,o){return(e!==s||t!==o)&&r9(e,t,n,i,r,a,s,o)}function ae(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function at(e,t){return e.x===t.x&&e.y===t.y}function an(e,t,n,i){let r=ar(ae(e,t,n)),a=ar(ae(e,t,i)),s=ar(ae(n,i,e)),o=ar(ae(n,i,t));return!!(r!==a&&s!==o||0===r&&ai(e,n,t)||0===a&&ai(e,i,t)||0===s&&ai(n,e,i)||0===o&&ai(n,t,i))}function ai(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ar(e){return e>0?1:e<0?-1:0}function aa(e,t){return 0>ae(e.prev,e,e.next)?ae(e,t,e.next)>=0&&ae(e,e.prev,t)>=0:0>ae(e,t,e.prev)||0>ae(e,e.next,t)}function as(e,t){let n=au(e.i,e.x,e.y),i=au(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function ao(e,t,n,i){let r=au(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function al(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function au(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class ac{static triangulate(e,t,n=2){return function(e,t,n=2){let i,r,a,s=t&&t.length,o=s?t[0]*n:e.length,l=r4(e,0,o,n,!0),u=[];if(!l||l.next===l.prev)return u;if(s&&(l=function(e,t,n,i){let r=[];for(let n=0,a=t.length;n=i.next.y&&i.next.y!==i.y){let e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=r&&e>s&&(s=e,n=i.x=i.x&&i.x>=l&&r!==i.x&&r9(an.x||i.x===n.x&&(h=n,d=i,0>ae(h.prev,h,d.prev)&&0>ae(d.next,h,h.next))))&&(n=i,c=t)}i=i.next}while(i!==o)return n}(e,t);if(!n)return t;let i=as(n,e);return r5(i,i.next),r5(n,n.next)}(r[e],n);return n}(e,t,l,n)),e.length>80*n){i=e[0],r=e[1];let t=i,s=r;for(let a=n;at&&(t=n),o>s&&(s=o)}a=0!==(a=Math.max(t-i,s-r))?32767/a:0}return function e(t,n,i,r,a,s,o){if(!t)return;!o&&s&&function(e,t,n,i){let r=e;do 0===r.z&&(r.z=r8(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e)r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,n=1;do{let i,r=e;e=null;let a=null;for(t=0;r;){t++;let s=r,o=0;for(let e=0;e0||l>0&&s;)0!==o&&(0===l||!s||r.z<=s.z)?(i=r,r=r.nextZ,o--):(i=s,s=s.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=s}a.nextZ=null,n*=2}while(t>1)}(r)}(t,r,a,s);let l=t;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(s?function(e,t,n,i){let r=e.prev,a=e.next;if(ae(r,e,a)>=0)return!1;let s=r.x,o=e.x,l=a.x,u=r.y,c=e.y,h=a.y,d=Math.min(s,o,l),p=Math.min(u,c,h),f=Math.max(s,o,l),m=Math.max(u,c,h),g=r8(d,p,t,n,i),v=r8(f,m,t,n,i),_=e.prevZ,y=e.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&r7(s,u,o,c,l,h,_.x,_.y)&&ae(_.prev,_,_.next)>=0||(_=_.prevZ,y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==r&&y!==a&&r7(s,u,o,c,l,h,y.x,y.y)&&ae(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&r7(s,u,o,c,l,h,_.x,_.y)&&ae(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==r&&y!==a&&r7(s,u,o,c,l,h,y.x,y.y)&&ae(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}(t,r,a,s):function(e){let t=e.prev,n=e.next;if(ae(t,e,n)>=0)return!1;let i=t.x,r=e.x,a=n.x,s=t.y,o=e.y,l=n.y,u=Math.min(i,r,a),c=Math.min(s,o,l),h=Math.max(i,r,a),d=Math.max(s,o,l),p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=c&&p.y<=d&&r7(i,s,r,o,a,l,p.x,p.y)&&ae(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){n.push(u.i,t.i,c.i),al(t),t=c.next,l=c.next;continue}if((t=c)===l){o?1===o?e(t=function(e,t){let n=e;do{let i=n.prev,r=n.next.next;!at(i,r)&&an(i,n,n.next,r)&&aa(i,r)&&aa(r,i)&&(t.push(i.i,n.i,r.i),al(n),al(n.next),n=e=r),n=n.next}while(n!==e)return r5(n)}(r5(t),n),n,i,r,a,s,2):2===o&&function(t,n,i,r,a,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){var l,u;if(o.i!==t.i&&(l=o,u=t,l.next.i!==u.i&&l.prev.i!==u.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&an(n,n.next,e,t))return!0;n=n.next}while(n!==e)return!1}(l,u)&&(aa(l,u)&&aa(u,l)&&function(e,t){let n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e)return i}(l,u)&&(ae(l.prev,l,u.prev)||ae(l,u.prev,u))||at(l,u)&&ae(l.prev,l,l.next)>0&&ae(u.prev,u,u.next)>0))){let l=as(o,t);o=r5(o,o.next),l=r5(l,l.next),e(o,n,i,r,a,s,0),e(l,n,i,r,a,s,0);return}t=t.next}o=o.next}while(o!==t)}(t,n,i,r,a,s):e(r5(t),n,i,r,a,s,1);break}}}(l,u,n,i,r,a,0),u}(e,t,n)}}class ah{static area(e){let t=e.length,n=0;for(let i=t-1,r=0;rah.area(e)}static triangulateShape(e,t){let n=[],i=[],r=[];ad(e),ap(n,e);let a=e.length;t.forEach(ad);for(let e=0;e2&&e[t-1].equals(e[0])&&e.pop()}function ap(e,t){for(let n=0;nNumber.EPSILON){let h=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-o/h,f=t.y+s/h,m=((n.x-u/d-p)*u-(n.y+l/d-f)*l)/(s*u-o*l),g=(i=p+s*m-e.x)*i+(r=f+o*m-e.y)*r;if(g<=2)return new ed(i,r);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(u)&&(e=!0),e?(i=-o,r=s,a=Math.sqrt(c)):(i=s,r=o,a=Math.sqrt(c/2))}return new ed(i/a,r/a)}let L=[];for(let e=0,t=C.length,n=t-1,i=e+1;e=0;e--){let t=e/_,n=m*Math.cos(t*Math.PI/2),i=g*Math.sin(t*Math.PI/2)+v;for(let e=0,t=C.length;e=0;){let a=r,s=r-1;s<0&&(s=e.length-1);for(let e=0,r=d+2*_;e0)&&d.push(t,r,l),(e!==n-1||o0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class aU extends tJ{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tq(0xffffff),this.specular=new tq(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tq(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new th,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class aD extends tJ{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tq(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tq(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(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(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class aO extends tJ{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class aF extends tJ{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tq(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tq(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new th,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class az extends tJ{constructor(e){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(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class aB extends tJ{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class ak extends tJ{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tq(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ed(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(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class aV extends i3{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function aH(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function aG(e){let t=e.length,n=Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(t,n){return e[t]-e[n]}),n}function aW(e,t,n){let i=e.length,r=new e.constructor(i);for(let a=0,s=0;s!==i;++a){let i=n[a]*t;for(let n=0;n!==t;++n)r[s++]=e[i+n]}return r}function aj(e,t,n,i){let r=1,a=e[0];for(;void 0!==a&&void 0===a[i];)a=e[r++];if(void 0===a)return;let s=a[i];if(void 0!==s)if(Array.isArray(s))do void 0!==(s=a[i])&&(t.push(a.time),n.push(...s)),a=e[r++];while(void 0!==a)else if(void 0!==s.toArray)do void 0!==(s=a[i])&&(t.push(a.time),s.toArray(n,n.length)),a=e[r++];while(void 0!==a)else do void 0!==(s=a[i])&&(t.push(a.time),n.push(s)),a=e[r++];while(void 0!==a)}class aX{static convertArray(e,t){return aH(e,t)}static isTypedArray(e){return H(e)}static getKeyframeOrder(e){return aG(e)}static sortedArray(e,t,n){return aW(e,t,n)}static flattenJSON(e,t,n,i){aj(e,t,n,i)}static subclip(e,t,n,i,r=30){return function(e,t,n,i,r=30){let a=e.clone();a.name=t;let s=[];for(let e=0;e=i)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(o=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){let e=d*u+l,t=e+u-l;i=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=l,n=u-l;e.evaluate(a),i=e.resultBuffer.slice(t,n)}"quaternion"===s&&new ep().fromArray(i).normalize().conjugate().toArray(i);let p=o.times.length;for(let e=0;e=r)){let s=t[1];e=(r=t[--n-1]))break i}a=n,n=0;break r}break n}for(;n>>1;et;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(K("KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,r=n.length;0===r&&(K("KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==r;t++){let i=n[t];if("number"==typeof i&&isNaN(i)){K("KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==a&&a>i){K("KeyframeTrack: Out of order keys.",this,t,i,a),e=!1;break}a=i}if(void 0!==i&&H(i))for(let t=0,n=i.length;t!==n;++t){let n=i[t];if(isNaN(n)){K("KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1,a=1;for(let s=1;s0){e[a]=e[r];for(let e=r*n,i=a*n,s=0;s!==n;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}aK.prototype.ValueTypeName="",aK.prototype.TimeBufferType=Float32Array,aK.prototype.ValueBufferType=Float32Array,aK.prototype.DefaultInterpolation=2301;class a$ extends aK{constructor(e,t,n){super(e,t,n)}}a$.prototype.ValueTypeName="bool",a$.prototype.ValueBufferType=Array,a$.prototype.DefaultInterpolation=2300,a$.prototype.InterpolantFactoryMethodLinear=void 0,a$.prototype.InterpolantFactoryMethodSmooth=void 0;class aQ extends aK{constructor(e,t,n,i){super(e,t,n,i)}}aQ.prototype.ValueTypeName="color";class a0 extends aK{constructor(e,t,n,i){super(e,t,n,i)}}a0.prototype.ValueTypeName="number";class a1 extends aq{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(i-t),l=e*s;for(let e=l+s;l!==e;l+=4)ep.slerpFlat(r,0,a,l-s,a,l,o);return r}}class a2 extends aK{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new a1(this.times,this.values,this.getValueSize(),e)}}a2.prototype.ValueTypeName="quaternion",a2.prototype.InterpolantFactoryMethodSmooth=void 0;class a3 extends aK{constructor(e,t,n){super(e,t,n)}}a3.prototype.ValueTypeName="string",a3.prototype.ValueBufferType=Array,a3.prototype.DefaultInterpolation=2300,a3.prototype.InterpolantFactoryMethodLinear=void 0,a3.prototype.InterpolantFactoryMethodSmooth=void 0;class a4 extends aK{constructor(e,t,n,i){super(e,t,n,i)}}a4.prototype.ValueTypeName="vector";class a5{constructor(e="",t=-1,n=[],i=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=ea(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,r=n.length;e!==r;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return a0;case"vector":case"vector2":case"vector3":case"vector4":return a4;case"color":return aQ;case"quaternion":return a2;case"bool":case"boolean":return a$;case"string":return a3}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],n=[];aj(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(n[e]).scale(i));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,i=n.length;e!==i;++e)t.push(aK.toJSON(n[e]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let r=t.length,a=[];for(let e=0;e1){let e=a[1],t=i[e];t||(i[e]=t=[]),t.push(n)}}let a=[];for(let e in i)a.push(this.CreateFromMorphTargetSequence(e,i[e],t,n));return a}static parseAnimation(e,t){if(J("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return K("AnimationClip: No animation in JSONLoader data."),null;let n=function(e,t,n,i,r){if(0!==n.length){let a=[],s=[];aj(n,a,s,i),0!==a.length&&r.push(new e(t,a,s))}},i=[],r=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e{t&&t(r),this.manager.itemEnd(e)},0),r;if(void 0!==se[e])return void se[e].push({onLoad:t,onProgress:n,onError:i});se[e]=[],se[e].push({onLoad:t,onProgress:n,onError:i});let a=new Request(e,{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}),s=this.mimeType,o=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&J("FileLoader: HTTP Status 0 received."),"u"{if(i)e.close();else{let i=new ProgressEvent("progress",{lengthComputable:s,loaded:o+=r.byteLength,total:a});for(let e=0,t=n.length;e{e.error(t)})}()}}))}throw new st(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(s),n=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{a6.add(`file:${e}`,t);let n=se[e];delete se[e];for(let e=0,i=n.length;e{let n=se[e];if(void 0===n)throw this.manager.itemError(e),t;delete se[e];for(let e=0,i=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class si extends a7{constructor(e){super(e)}load(e,t,n,i){let r=this,a=new sn(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):K(t),r.manager.itemError(e)}},n,i)}parse(e){let t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let t in e.uniforms){let r=e.uniforms[t];switch(i.uniforms[t]={},r.type){case"t":i.uniforms[t].value=n(r.value);break;case"c":i.uniforms[t].value=new tq().setHex(r.value);break;case"v2":i.uniforms[t].value=new ed().fromArray(r.value);break;case"v3":i.uniforms[t].value=new ef().fromArray(r.value);break;case"v4":i.uniforms[t].value=new eI().fromArray(r.value);break;case"m3":i.uniforms[t].value=new ev().fromArray(r.value);break;case"m4":i.uniforms[t].value=new tt().fromArray(r.value);break;default:i.uniforms[t].value=r.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(i.glslVersion=e.glslVersion),void 0!==e.extensions)for(let t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(i.lights=e.lights),void 0!==e.clipping&&(i.clipping=e.clipping),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=new ed().fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(i.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(i.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapRotation&&i.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=new ed().fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(i.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(i.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(i.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(i.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(i.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return sA.createMaterialFromType(e)}static createMaterialFromType(e){return new({ShadowMaterial:aP,SpriteMaterial:nZ,RawShaderMaterial:aI,ShaderMaterial:nI,PointsMaterial:ro,MeshPhysicalMaterial:aN,MeshStandardMaterial:aL,MeshPhongMaterial:aU,MeshToonMaterial:aD,MeshNormalMaterial:aO,MeshLambertMaterial:aF,MeshDepthMaterial:az,MeshDistanceMaterial:aB,MeshBasicMaterial:tK,MeshMatcapMaterial:ak,LineDashedMaterial:aV,LineBasicMaterial:i3,Material:tJ})[e]}}class sC{static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}class sR extends nd{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class sP extends a7{constructor(e){super(e)}load(e,t,n,i){let r=this,a=new sn(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):K(t),r.manager.itemError(e)}},n,i)}parse(e){let t={},n={};function i(e,i){if(void 0!==t[i])return t[i];let r=e.interleavedBuffers[i],a=function(e,t){if(void 0!==n[t])return n[t];let i=new Uint32Array(e.arrayBuffers[t]).buffer;return n[t]=i,i}(e,r.buffer),s=new nX(V(r.type,a),r.stride);return s.uuid=r.uuid,t[i]=s,s}let r=e.isInstancedBufferGeometry?new sR:new nd,a=e.data.index;if(void 0!==a){let e=V(a.type,a.array);r.setIndex(new t5(e,1))}let s=e.data.attributes;for(let t in s){let n,a=s[t];if(a.isInterleavedBufferAttribute)n=new nY(i(e.data,a.data),a.itemSize,a.offset,a.normalized);else{let e=V(a.type,a.array);n=new(a.isInstancedBufferAttribute?ix:t5)(e,a.itemSize,a.normalized)}void 0!==a.name&&(n.name=a.name),void 0!==a.usage&&n.setUsage(a.usage),r.setAttribute(t,n)}let o=e.data.morphAttributes;if(o)for(let t in o){let n=o[t],a=[];for(let t=0,r=n.length;t0){(n=new ss(new a8(t))).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){(t=new ss(this.manager)).setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t{let t=null,n=null;return void 0!==e.boundingBox&&(t=new ez().fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(n=new e2().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(a._colorsTexture=c(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(a.boundingSphere=new e2().fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(a.boundingBox=new ez().fromJSON(e.boundingBox));break;case"LOD":a=new ii;break;case"Line":a=new rt(l(e.geometry),u(e.material));break;case"LineLoop":a=new rs(l(e.geometry),u(e.material));break;case"LineSegments":a=new ra(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":a=new rd(l(e.geometry),u(e.material));break;case"Sprite":a=new n9(u(e.material));break;case"Group":a=new nk;break;case"Bone":a=new im;break;default:a=new tC}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(a.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){let s=e.children;for(let e=0;e{if(!0!==sD.has(a))return t&&t(n),r.manager.itemEnd(e),n;i&&i(sD.get(a)),r.manager.itemError(e),r.manager.itemEnd(e)}):(setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a);let s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,s.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(n){return a6.add(`image-bitmap:${e}`,n),t&&t(n),r.manager.itemEnd(e),n}).catch(function(t){i&&i(t),sD.set(o,t),a6.remove(`image-bitmap:${e}`),r.manager.itemError(e),r.manager.itemEnd(e)});a6.add(`image-bitmap:${e}`,o),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class sF{static getContext(){return void 0===i&&(i=new(window.AudioContext||window.webkitAudioContext)),i}static setContext(e){i=e}}class sz extends a7{constructor(e){super(e)}load(e,t,n,i){let r=this,a=new sn(this.manager);function s(t){i?i(t):K(t),r.manager.itemError(e)}a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){try{let n=e.slice(0);sF.getContext().decodeAudioData(n,function(e){t(e)}).catch(s)}catch(e){s(e)}},n,i)}}let sB=new tt,sk=new tt,sV=new tt;class sH{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nO,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nO,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(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){let n,i;t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,sV.copy(e.projectionMatrix);let r=t.eyeSep/2,a=r*t.near/t.focus,s=t.near*Math.tan(ei*t.fov*.5)/t.zoom;sk.elements[12]=-r,sB.elements[12]=r,n=-s*t.aspect+a,i=s*t.aspect+a,sV.elements[0]=2*t.near/(i-n),sV.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(sV),n=-s*t.aspect-a,i=s*t.aspect-a,sV.elements[0]=2*t.near/(i-n),sV.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(sV)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(sk),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(sB)}}class sG extends nO{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class sW{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}let sj=new ef,sX=new ep,sq=new ef,sY=new ef,sZ=new ef;class sJ extends tC{constructor(){super(),this.type="AudioListener",this.context=sF.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new sW}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(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(sj,sX,sq),sY.set(0,0,-1).applyQuaternion(sX),sZ.set(0,1,0).applyQuaternion(sX),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(sj.x,e),t.positionY.linearRampToValueAtTime(sj.y,e),t.positionZ.linearRampToValueAtTime(sj.z,e),t.forwardX.linearRampToValueAtTime(sY.x,e),t.forwardY.linearRampToValueAtTime(sY.y,e),t.forwardZ.linearRampToValueAtTime(sY.z,e),t.upX.linearRampToValueAtTime(sZ.x,e),t.upY.linearRampToValueAtTime(sZ.y,e),t.upZ.linearRampToValueAtTime(sZ.z,e)}else t.setPosition(sj.x,sj.y,sj.z),t.setOrientation(sY.x,sY.y,sY.z,sZ.x,sZ.y,sZ.z)}}class sK extends tC{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void J("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void J("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void J("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(e=0){return!1===this.hasPlaybackControl?void J("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(n[e]!==n[e+t]){s.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let e=n;e!==i;++e)t[e]=t[i+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let i=0;i!==r;++i)e[t+i]=e[n+i]}_slerp(e,t,n,i){ep.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,r){let a=this._workIndex*r;ep.multiplyQuaternionsFlat(e,a,e,t,e,n),ep.slerpFlat(e,t,e,t,e,a,i)}_lerp(e,t,n,i,r){let a=1-i;for(let s=0;s!==r;++s){let r=t+s;e[r]=e[r]*a+e[n+s]*i}}_lerpAdditive(e,t,n,i,r){for(let a=0;a!==r;++a){let r=t+a;e[r]=e[r]+e[n+a]*i}}}let s5="\\[\\]\\.:\\/",s6=RegExp("["+s5+"]","g"),s8="[^"+s5+"]",s9="[^"+s5.replace("\\.","")+"]",s7=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",s8)+/(WCOD+)?/.source.replace("WCOD",s9)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",s8)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",s8)+"$"),oe=["material","materials","bones","map"];class ot{constructor(e,t,n){this.path=t,this.parsedPath=n||ot.parseTrackName(t),this.node=ot.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new ot.Composite(e,t,n):new ot(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(s6,"")}static parseTrackName(e){let t=s7.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let e=n.nodeName.substring(i+1);-1!==oe.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let i=0;i=r){let a=r++,u=e[a];t[u.uuid]=l,e[l]=u,t[o]=a,e[a]=s;for(let e=0;e!==i;++e){let t=n[e],i=t[a],r=t[l];t[l]=i,t[a]=r}}}this.nCachedObjects_=r}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,r=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){let o=arguments[s],l=o.uuid,u=t[l];if(void 0!==u)if(delete t[l],u0&&(t[s.uuid]=u),e[u]=s,e.pop();for(let e=0;e!==i;++e){let t=n[e];t[u]=t[r],t.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];let a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,u=this.nCachedObjects_,c=Array(l);i=r.length,n[e]=i,a.push(e),s.push(t),r.push(c);for(let n=u,i=o.length;n!==i;++n){let i=o[n];c[n]=new ot(i,e,t)}return c}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){let i=this._paths,r=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=n,a[n]=o,a.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}}class oi{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const r=t.tracks,a=r.length,s=Array(a),o={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){const t=r[e].createInterpolant(null);s[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=Array(a),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(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),!0===n){let n=this._clip.duration,i=e._clip.duration;e.warp(1,i/n,t),this.warp(n/i,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,r=i.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=r,o[1]=r+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);let r=this._startTime;if(null!==r){let i=(e-r)*n;i<0||0===n?t=0:(this._startTime=null,t=n*i)}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulateAdditive(s);else for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulate(i,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(null!==n){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,r=this._loopCount,a=2202===n;if(0===e)return -1===r?i:a&&(1&r)==1?t-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break s}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i>=t||i<0){let n=Math.floor(i/t);i-=t*n,r+=Math.abs(n);let s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(a&&(1&r)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(e?i.endingStart=this.zeroSlopeAtStart?2401:2400:i.endingStart=2402,t?i.endingEnd=this.zeroSlopeAtEnd?2401:2400:i.endingEnd=2402)}_scheduleFading(e,t,n){let i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=r,o[0]=t,s[1]=r+e,o[1]=n,this}}let or=new Float32Array(1);class oa extends ee{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,s=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName,u=l[o];void 0===u&&(u={},l[o]=u);for(let e=0;e!==r;++e){let r=i[e],l=r.name,c=u[l];if(void 0!==c)++c.referenceCount,a[e]=c;else{if(void 0!==(c=a[e])){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,l));continue}let i=t&&t._propertyBindings[e].binding.parsedPath;c=new s4(ot.create(n,l,i),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,o,l),a[e]=c}s[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return null!==t&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==n;++s)t[s]._update(i,e,r,a);let s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ob).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let oM=new ef,oT=new ef,ow=new ef,oE=new ef,oA=new ef,oC=new ef,oR=new ef;class oP{constructor(e=new ef,t=new ef){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){oM.subVectors(e,this.start),oT.subVectors(this.end,this.start);let n=oT.dot(oT),i=oT.dot(oM)/n;return t&&(i=es(i,0,1)),i}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}distanceSqToLine3(e,t=oC,n=oR){let i,r,a=1e-8*1e-8,s=this.start,o=e.start,l=this.end,u=e.end;ow.subVectors(l,s),oE.subVectors(u,o),oA.subVectors(s,o);let c=ow.dot(ow),h=oE.dot(oE),d=oE.dot(oA);if(c<=a&&h<=a)return t.copy(s),n.copy(o),t.sub(n),t.dot(t);if(c<=a)i=0,r=es(r=d/h,0,1);else{let e=ow.dot(oA);if(h<=a)r=0,i=es(-e/c,0,1);else{let t=ow.dot(oE),n=c*h-t*t;i=0!==n?es((t*d-e*h)/n,0,1):0,(r=(t*i+d)/h)<0?(r=0,i=es(-e/c,0,1)):r>1&&(r=1,i=es((t-e)/c,0,1))}}return t.copy(s).add(ow.multiplyScalar(i)),n.copy(o).add(oE.multiplyScalar(r)),t.sub(n),t.dot(t)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}let oI=new ef;class oL extends tC{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new nd,i=[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 e=0,t=1;e<32;e++,t++){const n=e/32*Math.PI*2,r=t/32*Math.PI*2;i.push(Math.cos(n),Math.sin(n),1,Math.cos(r),Math.sin(r),1)}n.setAttribute("position",new nr(i,3));const r=new i3({fog:!1,toneMapped:!1});this.cone=new ra(n,r),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 e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),oI.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(oI),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}let oN=new ef,oU=new tt,oD=new tt;class oO extends ra{constructor(e){const t=function e(t){let n=[];!0===t.isBone&&n.push(t);for(let i=0;i1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{o2.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(o2,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class o4 extends ra{constructor(e=1){const t=new nd;t.setAttribute("position",new nr([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),t.setAttribute("color",new nr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new i3({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){let i=new tq,r=this.geometry.attributes.color.array;return i.set(e),i.toArray(r,0),i.toArray(r,3),i.set(t),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class o5{constructor(){this.type="ShapePath",this.color=new tq,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new r2,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){let t,n,i,r,a,s=ah.isClockWise,o=this.subPaths;if(0===o.length)return[];let l=[];if(1===o.length)return n=o[0],(i=new r3).curves=n.curves,l.push(i),l;let u=!s(o[0].getPoints());u=e?!u:u;let c=[],h=[],d=[],p=0;h[0]=void 0,d[p]=[];for(let i=0,a=o.length;i1){let e=!1,t=0;for(let e=0,t=h.length;eNumber.EPSILON){if(l<0&&(n=t[a],o=-o,s=t[r],l=-l),e.ys.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==n.y)continue;if(s.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=s.x)return!0}}return i})(a.p,h[i].p)&&(n!==i&&t++,s?(s=!1,c[i].push(a)):e=!0);s&&c[n].push(a)}}t>0&&!1===e&&(d=c)}for(let e=0,t=h.length;et?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}static cover(e,t){let n;return(n=e.image&&e.image.width?e.image.width/e.image.height:1)>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}static fill(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}static getByteLength(e,t,n,i){return o8(e,t,n,i)}}function o7(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0===t||null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function le(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){let e=t.get(n);(!e||e.versiontypeof Float16Array&&r instanceof Float16Array)i=e.HALF_FLOAT;else if(r instanceof Uint16Array)i=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)i=e.SHORT;else if(r instanceof Uint32Array)i=e.UNSIGNED_INT;else if(r instanceof Int32Array)i=e.INT;else if(r instanceof Int8Array)i=e.BYTE;else if(r instanceof Uint8Array)i=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)i=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);return{buffer:o,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:s}}(n,i));else if(r.versione.start-t.start);let t=0;for(let e=1;etypeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"182"}})),"u">typeof window&&(window.__THREE__?J("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="182"),e.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveAnimationBlendMode",()=>2501,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"AlwaysStencilFunc",()=>519,"AmbientLight",()=>sM,"AnimationAction",()=>oi,"AnimationClip",()=>a5,"AnimationLoader",()=>si,"AnimationMixer",()=>oa,"AnimationObjectGroup",()=>on,"AnimationUtils",()=>aX,"ArcCurve",()=>rF,"ArrayCamera",()=>sG,"ArrowHelper",()=>o3,"AttachedBindMode",()=>R,"Audio",()=>sK,"AudioAnalyser",()=>s3,"AudioContext",()=>sF,"AudioListener",()=>sJ,"AudioLoader",()=>sz,"AxesHelper",()=>o4,"BackSide",()=>1,"BasicDepthPacking",()=>3200,"BasicShadowMap",()=>0,"BatchedMesh",()=>i2,"Bone",()=>im,"BooleanKeyframeTrack",()=>a$,"Box2",()=>oS,"Box3",()=>ez,"Box3Helper",()=>o0,"BoxGeometry",()=>nE,"BoxHelper",()=>oQ,"BufferAttribute",()=>t5,"BufferGeometry",()=>nd,"BufferGeometryLoader",()=>sP,"ByteType",()=>1010,"Cache",()=>a6,"Camera",()=>nL,"CameraHelper",()=>oJ,"CanvasTexture",()=>rx,"CapsuleGeometry",()=>rT,"CatmullRomCurve3",()=>rG,"CineonToneMapping",()=>3,"CircleGeometry",()=>rw,"ClampToEdgeWrapping",()=>1001,"Clock",()=>sW,"Color",()=>tq,"ColorKeyframeTrack",()=>aQ,"ColorManagement",()=>eb,"CompressedArrayTexture",()=>r_,"CompressedCubeTexture",()=>ry,"CompressedTexture",()=>rv,"CompressedTextureLoader",()=>sr,"ConeGeometry",()=>rA,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"Controls",()=>o6,"CubeCamera",()=>nF,"CubeDepthTexture",()=>rS,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>nz,"CubeTextureLoader",()=>so,"CubeUVReflectionMapping",()=>306,"CubicBezierCurve",()=>rq,"CubicBezierCurve3",()=>rY,"CubicInterpolant",()=>aY,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceFrontBack",()=>3,"CullFaceNone",()=>0,"Curve",()=>rD,"CurvePath",()=>r1,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"CylinderGeometry",()=>rE,"Cylindrical",()=>oy,"Data3DTexture",()=>eO,"DataArrayTexture",()=>eU,"DataTexture",()=>ig,"DataTextureLoader",()=>sl,"DataUtils",()=>t1,"DecrementStencilOp",()=>7683,"DecrementWrapStencilOp",()=>34056,"DefaultLoadingManager",()=>a9,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>rb,"DetachedBindMode",()=>P,"DirectionalLight",()=>sS,"DirectionalLightHelper",()=>oq,"DiscreteInterpolant",()=>aJ,"DodecahedronGeometry",()=>rR,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"DynamicCopyUsage",()=>35050,"DynamicDrawUsage",()=>35048,"DynamicReadUsage",()=>35049,"EdgesGeometry",()=>rU,"EllipseCurve",()=>rO,"EqualCompare",()=>514,"EqualDepth",()=>4,"EqualStencilFunc",()=>514,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>th,"EventDispatcher",()=>ee,"ExternalTexture",()=>rM,"ExtrudeGeometry",()=>af,"FileLoader",()=>sn,"Float16BufferAttribute",()=>ni,"Float32BufferAttribute",()=>nr,"FloatType",()=>1015,"Fog",()=>nW,"FogExp2",()=>nG,"FramebufferTexture",()=>rg,"FrontSide",()=>0,"Frustum",()=>iO,"FrustumArray",()=>iB,"GLBufferAttribute",()=>oh,"GLSL1",()=>"100","GLSL3",()=>D,"GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"GreaterEqualStencilFunc",()=>518,"GreaterStencilFunc",()=>516,"GridHelper",()=>oH,"Group",()=>nk,"HalfFloatType",()=>1016,"HemisphereLight",()=>sh,"HemisphereLightHelper",()=>oV,"IcosahedronGeometry",()=>ag,"ImageBitmapLoader",()=>sO,"ImageLoader",()=>ss,"ImageUtils",()=>eT,"IncrementStencilOp",()=>7682,"IncrementWrapStencilOp",()=>34055,"InstancedBufferAttribute",()=>ix,"InstancedBufferGeometry",()=>sR,"InstancedInterleavedBuffer",()=>oc,"InstancedMesh",()=>iC,"Int16BufferAttribute",()=>t7,"Int32BufferAttribute",()=>nt,"Int8BufferAttribute",()=>t6,"IntType",()=>1013,"InterleavedBuffer",()=>nX,"InterleavedBufferAttribute",()=>nY,"Interpolant",()=>aq,"InterpolateDiscrete",()=>2300,"InterpolateLinear",()=>2301,"InterpolateSmooth",()=>2302,"InterpolationSamplingMode",()=>z,"InterpolationSamplingType",()=>F,"InvertStencilOp",()=>5386,"KeepStencilOp",()=>7680,"KeyframeTrack",()=>aK,"LOD",()=>ii,"LatheGeometry",()=>av,"Layers",()=>td,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LessEqualStencilFunc",()=>515,"LessStencilFunc",()=>513,"Light",()=>sc,"LightProbe",()=>sE,"Line",()=>rt,"Line3",()=>oP,"LineBasicMaterial",()=>i3,"LineCurve",()=>rZ,"LineCurve3",()=>rJ,"LineDashedMaterial",()=>aV,"LineLoop",()=>rs,"LineSegments",()=>ra,"LinearFilter",()=>1006,"LinearInterpolant",()=>aZ,"LinearMipMapLinearFilter",()=>1008,"LinearMipMapNearestFilter",()=>1007,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>L,"LinearToneMapping",()=>1,"LinearTransfer",()=>N,"Loader",()=>a7,"LoaderUtils",()=>sC,"LoadingManager",()=>a8,"LoopOnce",()=>2200,"LoopPingPong",()=>2202,"LoopRepeat",()=>2201,"MOUSE",()=>A,"Material",()=>tJ,"MaterialLoader",()=>sA,"MathUtils",()=>eh,"Matrix2",()=>ox,"Matrix3",()=>ev,"Matrix4",()=>tt,"MaxEquation",()=>104,"Mesh",()=>nT,"MeshBasicMaterial",()=>tK,"MeshDepthMaterial",()=>az,"MeshDistanceMaterial",()=>aB,"MeshLambertMaterial",()=>aF,"MeshMatcapMaterial",()=>ak,"MeshNormalMaterial",()=>aO,"MeshPhongMaterial",()=>aU,"MeshPhysicalMaterial",()=>aN,"MeshStandardMaterial",()=>aL,"MeshToonMaterial",()=>aD,"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",()=>a0,"Object3D",()=>tC,"ObjectLoader",()=>sI,"ObjectSpaceNormalMap",()=>1,"OctahedronGeometry",()=>a_,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>sx,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"Path",()=>r2,"PerspectiveCamera",()=>nO,"Plane",()=>iL,"PlaneGeometry",()=>ay,"PlaneHelper",()=>o1,"PointLight",()=>sy,"PointLightHelper",()=>oF,"Points",()=>rd,"PointsMaterial",()=>ro,"PolarGridHelper",()=>oG,"PolyhedronGeometry",()=>rC,"PositionalAudio",()=>s2,"PropertyBinding",()=>ot,"PropertyMixer",()=>s4,"QuadraticBezierCurve",()=>rK,"QuadraticBezierCurve3",()=>r$,"Quaternion",()=>ep,"QuaternionKeyframeTrack",()=>a2,"QuaternionLinearInterpolant",()=>a1,"R11_EAC_Format",()=>37488,"RAD2DEG",()=>er,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"182","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",()=>aI,"Ray",()=>te,"Raycaster",()=>op,"RectAreaLight",()=>sT,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RenderTarget",()=>eL,"RenderTarget3D",()=>os,"RepeatWrapping",()=>1e3,"ReplaceStencilOp",()=>7681,"ReverseSubtractEquation",()=>102,"RingGeometry",()=>ax,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>36286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>I,"SRGBTransfer",()=>U,"Scene",()=>nj,"ShaderMaterial",()=>nI,"ShadowMaterial",()=>aP,"Shape",()=>r3,"ShapeGeometry",()=>ab,"ShapePath",()=>o5,"ShapeUtils",()=>ah,"ShortType",()=>1011,"Skeleton",()=>iy,"SkeletonHelper",()=>oO,"SkinnedMesh",()=>ip,"Source",()=>eE,"Sphere",()=>e2,"SphereGeometry",()=>aS,"Spherical",()=>o_,"SphericalHarmonics3",()=>sw,"SplineCurve",()=>rQ,"SpotLight",()=>sv,"SpotLightHelper",()=>oL,"Sprite",()=>n9,"SpriteMaterial",()=>nZ,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"StaticCopyUsage",()=>35046,"StaticDrawUsage",()=>35044,"StaticReadUsage",()=>35045,"StereoCamera",()=>sH,"StreamCopyUsage",()=>35042,"StreamDrawUsage",()=>35040,"StreamReadUsage",()=>35041,"StringKeyframeTrack",()=>a3,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TOUCH",()=>C,"TangentSpaceNormalMap",()=>0,"TetrahedronGeometry",()=>aM,"Texture",()=>eP,"TextureLoader",()=>su,"TextureUtils",()=>o9,"Timer",()=>og,"TimestampQuery",()=>O,"TorusGeometry",()=>aT,"TorusKnotGeometry",()=>aw,"Triangle",()=>tH,"TriangleFanDrawMode",()=>2,"TriangleStripDrawMode",()=>1,"TrianglesDrawMode",()=>0,"TubeGeometry",()=>aE,"UVMapping",()=>300,"Uint16BufferAttribute",()=>ne,"Uint32BufferAttribute",()=>nn,"Uint8BufferAttribute",()=>t8,"Uint8ClampedBufferAttribute",()=>t9,"Uniform",()=>oo,"UniformsGroup",()=>ou,"UniformsUtils",()=>nP,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>ed,"Vector3",()=>ef,"Vector4",()=>eI,"VectorKeyframeTrack",()=>a4,"VideoFrameTexture",()=>rm,"VideoTexture",()=>rf,"WebGL3DRenderTarget",()=>eF,"WebGLArrayRenderTarget",()=>eD,"WebGLCoordinateSystem",()=>2e3,"WebGLCubeRenderTarget",()=>nB,"WebGLRenderTarget",()=>eN,"WebGPUCoordinateSystem",()=>2001,"WebXRController",()=>nH,"WireframeGeometry",()=>aA,"WrapAroundEnding",()=>2402,"ZeroCurvatureEnding",()=>2400,"ZeroFactor",()=>200,"ZeroSlopeEnding",()=>2401,"ZeroStencilOp",()=>0,"arrayNeedsUint32",()=>B,"cloneUniforms",()=>nA,"createCanvasElement",()=>W,"createElementNS",()=>G,"error",()=>K,"getByteLength",()=>o8,"getConsoleFunction",()=>Y,"getUnlitUniformColorSpace",()=>nR,"log",()=>Z,"mergeUniforms",()=>nC,"probeAsync",()=>Q,"setConsoleFunction",()=>q,"warn",()=>J,"warnOnce",()=>$],90072);let lt={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 vec3 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 ).rgb;\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_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\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 #else\n vec4 envColor = vec4( 0.0 );\n #endif\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",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 + ( vec3( 1.0 ) - 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 }\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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\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 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 return depth * ( near - far ) - near;\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 return ( near * far ) / ( ( far - near ) * depth - far );\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 ) * 6.28318530718;\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 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 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 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 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 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 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\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 ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).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 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 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, dp );\n #else\n shadow = step( dp, depth );\n #endif\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 \n #include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \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 \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 \n #include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \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 \n #include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \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 \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \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 \n #include \n #include \n #include \n #include \n #include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \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 \n #include \n #include \n #include \n #include \n #include \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 \n #include \n #include \n #include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \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 \n #include \n #include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"},ln={common:{diffuse:{value:new tq(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new ev},alphaMap:{value:null},alphaMapTransform:{value:new ev},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ev}},envmap:{envMap:{value:null},envMapRotation:{value:new ev},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 ev}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ev}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ev},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ev},normalScale:{value:new ed(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ev},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ev}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ev}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ev}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tq(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},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 tq(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ev},alphaTest:{value:0},uvTransform:{value:new ev}},sprite:{diffuse:{value:new tq(0xffffff)},opacity:{value:1},center:{value:new ed(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ev},alphaMap:{value:null},alphaMapTransform:{value:new ev},alphaTest:{value:0}}},li={basic:{uniforms:nC([ln.common,ln.specularmap,ln.envmap,ln.aomap,ln.lightmap,ln.fog]),vertexShader:lt.meshbasic_vert,fragmentShader:lt.meshbasic_frag},lambert:{uniforms:nC([ln.common,ln.specularmap,ln.envmap,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.fog,ln.lights,{emissive:{value:new tq(0)}}]),vertexShader:lt.meshlambert_vert,fragmentShader:lt.meshlambert_frag},phong:{uniforms:nC([ln.common,ln.specularmap,ln.envmap,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.fog,ln.lights,{emissive:{value:new tq(0)},specular:{value:new tq(1118481)},shininess:{value:30}}]),vertexShader:lt.meshphong_vert,fragmentShader:lt.meshphong_frag},standard:{uniforms:nC([ln.common,ln.envmap,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.roughnessmap,ln.metalnessmap,ln.fog,ln.lights,{emissive:{value:new tq(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag},toon:{uniforms:nC([ln.common,ln.aomap,ln.lightmap,ln.emissivemap,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.gradientmap,ln.fog,ln.lights,{emissive:{value:new tq(0)}}]),vertexShader:lt.meshtoon_vert,fragmentShader:lt.meshtoon_frag},matcap:{uniforms:nC([ln.common,ln.bumpmap,ln.normalmap,ln.displacementmap,ln.fog,{matcap:{value:null}}]),vertexShader:lt.meshmatcap_vert,fragmentShader:lt.meshmatcap_frag},points:{uniforms:nC([ln.points,ln.fog]),vertexShader:lt.points_vert,fragmentShader:lt.points_frag},dashed:{uniforms:nC([ln.common,ln.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:lt.linedashed_vert,fragmentShader:lt.linedashed_frag},depth:{uniforms:nC([ln.common,ln.displacementmap]),vertexShader:lt.depth_vert,fragmentShader:lt.depth_frag},normal:{uniforms:nC([ln.common,ln.bumpmap,ln.normalmap,ln.displacementmap,{opacity:{value:1}}]),vertexShader:lt.meshnormal_vert,fragmentShader:lt.meshnormal_frag},sprite:{uniforms:nC([ln.sprite,ln.fog]),vertexShader:lt.sprite_vert,fragmentShader:lt.sprite_frag},background:{uniforms:{uvTransform:{value:new ev},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:lt.background_vert,fragmentShader:lt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ev}},vertexShader:lt.backgroundCube_vert,fragmentShader:lt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:lt.cube_vert,fragmentShader:lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:lt.equirect_vert,fragmentShader:lt.equirect_frag},distance:{uniforms:nC([ln.common,ln.displacementmap,{referencePosition:{value:new ef},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:lt.distance_vert,fragmentShader:lt.distance_frag},shadow:{uniforms:nC([ln.lights,ln.fog,{color:{value:new tq(0)},opacity:{value:1}}]),vertexShader:lt.shadow_vert,fragmentShader:lt.shadow_frag}};li.physical={uniforms:nC([li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ev},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ev},clearcoatNormalScale:{value:new ed(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ev},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ev},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ev},sheen:{value:0},sheenColor:{value:new tq(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ev},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ev},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ev},transmissionSamplerSize:{value:new ed},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ev},attenuationDistance:{value:0},attenuationColor:{value:new tq(0)},specularColor:{value:new tq(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ev},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ev},anisotropyVector:{value:new ed},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ev}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag};let lr={r:0,b:0,g:0},la=new th,ls=new tt;function lo(e,t,n,i,r,a,s){let o,l,u=new tq(0),c=+(!0!==a),h=null,d=0,p=null;function f(e){let i=!0===e.isScene?e.background:null;return i&&i.isTexture&&(i=(e.backgroundBlurriness>0?n:t).get(i)),i}function m(t,n){t.getRGB(lr,nR(e)),i.buffers.color.setClear(lr.r,lr.g,lr.b,n,s)}return{getClearColor:function(){return u},setClearColor:function(e,t=1){u.set(e),m(u,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){m(u,c=e)},render:function(t){let n=!1,r=f(t);null===r?m(u,c):r&&r.isColor&&(m(r,1),n=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?i.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===a&&i.buffers.color.setClear(0,0,0,0,s),(e.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){let i=f(n);i&&(i.isCubeTexture||306===i.mapping)?(void 0===l&&((l=new nT(new nE(1,1,1),new nI({name:"BackgroundCubeMaterial",uniforms:nA(li.backgroundCube.uniforms),vertexShader:li.backgroundCube.vertexShader,fragmentShader:li.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),la.copy(n.backgroundRotation),la.x*=-1,la.y*=-1,la.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(la.y*=-1,la.z*=-1),l.material.uniforms.envMap.value=i,l.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(ls.makeRotationFromEuler(la)),l.material.toneMapped=eb.getTransfer(i.colorSpace)!==U,(h!==i||d!==i.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,h=i,d=i.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(void 0===o&&((o=new nT(new ay(2,2),new nI({name:"BackgroundMaterial",uniforms:nA(li.background.uniforms),vertexShader:li.background.vertexShader,fragmentShader:li.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=i,o.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,o.material.toneMapped=eb.getTransfer(i.colorSpace)!==U,!0===i.matrixAutoUpdate&&i.updateMatrix(),o.material.uniforms.uvTransform.value.copy(i.matrix),(h!==i||d!==i.version||p!==e.toneMapping)&&(o.material.needsUpdate=!0,h=i,d=i.version,p=e.toneMapping),o.layers.enableAll(),t.unshift(o,o.geometry,o.material,0,0,null))},dispose:function(){void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0),void 0!==o&&(o.geometry.dispose(),o.material.dispose(),o=void 0)}}}function ll(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=u(null),a=r,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){let t=[],i=[],r=[];for(let e=0;e=0){let n=r[t],i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n||n.attribute!==i||i&&n.data!==i.data)return!0;o++}return a.attributesNum!==o||a.index!==i}(n,m,l,g))&&function(e,t,n,i){let r={},s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,o++}a.attributes=r,a.attributesNum=o,a.index=i}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(M||s)&&(s=!1,function(n,i,r,a){c();let s=a.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(let i in o){let r=o[i];if(r.location>=0){let o=s[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){let i=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let u=l.buffer,c=l.type,p=l.bytesPerElement,m=c===e.INT||c===e.UNSIGNED_INT||1013===o.gpuType;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,g=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=void 0!==n.precision?n.precision:"highp",o=a(s);return o!==s&&(J("WebGLRenderer:",s,"not supported, using",o,"instead."),s=o),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:a,textureFormatReadable:function(t){return 1023===t||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let r=1016===n&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return 1009===n||i.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||1015===n||!!r},precision:s,logarithmicDepthBuffer:!0===n.logarithmicDepthBuffer,reversedDepthBuffer:!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function lh(e){let t=this,n=null,i=0,r=!1,a=!1,s=new iL,o=new ev,l={value:null,needsUpdate:!1};function u(e,n,i,r){let a=null!==e?e.length:0,u=null;if(0!==a){if(u=l.value,!0!==r||null===u){let t=i+4*a,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===u||u.length0),t.numPlanes=i,t.numIntersection=0)}}function ld(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping;if(303===a||304===a)if(t.has(r))return n(t.get(r).texture,r.mapping);else{let a=r.image;if(!a||!(a.height>0))return null;{let s=new nB(a.height);return s.fromEquirectangularTexture(e,r),t.set(r,s),r.addEventListener("dispose",i),n(s.texture,r.mapping)}}}return r},dispose:function(){t=new WeakMap}}}let lp=[.125,.215,.35,.446,.526,.582],lf=new sx,lm=new tq,lg=null,lv=0,l_=0,ly=!1,lx=new ef;class lb{constructor(e){this._renderer=e,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(e,t=0,n=.1,i=100,r={}){let{size:a=256,position:s=lx}=r;lg=this._renderer.getRenderTarget(),lv=this._renderer.getActiveCubeFace(),l_=this._renderer.getActiveMipmapLevel(),ly=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,i,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=lw(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=lT(),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(e){this._lodMax=Math.floor(Math.log2(e)),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 e=0;ee-4?o=lp[s-e+4-1]:0===s&&(o=0),n.push(o);let l=1/(a-2),u=-l,c=1+l,h=[u,u,c,u,c,c,u,u,c,c,u,c],d=new Float32Array(108),p=new Float32Array(72),f=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];d.set(i,18*e),p.set(h,12*e);let r=[e,e,e,e,e,e];f.set(r,6*e)}let m=new nd;m.setAttribute("position",new t5(d,3)),m.setAttribute("uv",new t5(p,2)),m.setAttribute("faceIndex",new t5(f,1)),i.push(new nT(m,null)),r>4&&r--}return{lodMeshes:i,sizeLods:t,sigmas:n}}(i)),this._blurMaterial=(r=i,new nI({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.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 ef(0,1,0)}},vertexShader:lE(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(a=i,new nI({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:lE(),fragmentShader:` - - precision highp float; - precision highp int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform float roughness; - uniform float mipInt; - - #define ENVMAP_TYPE_CUBE_UV - #include - - #define PI 3.14159265359 - - // Van der Corput radical inverse - float radicalInverse_VdC(uint bits) { - bits = (bits << 16u) | (bits >> 16u); - bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); - bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); - bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); - bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); - return float(bits) * 2.3283064365386963e-10; // / 0x100000000 - } - - // Hammersley sequence - vec2 hammersley(uint i, uint N) { - return vec2(float(i) / float(N), radicalInverse_VdC(i)); - } - - // GGX VNDF importance sampling (Eric Heitz 2018) - // "Sampling the GGX Distribution of Visible Normals" - // https://jcgt.org/published/0007/04/01/ - vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { - float alpha = roughness * roughness; - - // Section 3.2: Transform view direction to hemisphere configuration - vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); - - // Section 4.1: Orthonormal basis - float lensq = Vh.x * Vh.x + Vh.y * Vh.y; - vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); - vec3 T2 = cross(Vh, T1); - - // Section 4.2: Parameterization of projected area - float r = sqrt(Xi.x); - float phi = 2.0 * PI * Xi.y; - float t1 = r * cos(phi); - float t2 = r * sin(phi); - float s = 0.5 * (1.0 + Vh.z); - t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; - - // Section 4.3: Reprojection onto hemisphere - vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; - - // Section 3.4: Transform back to ellipsoid configuration - return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); - } - - void main() { - vec3 N = normalize(vOutputDirection); - vec3 V = N; // Assume view direction equals normal for pre-filtering - - vec3 prefilteredColor = vec3(0.0); - float totalWeight = 0.0; - - // For very low roughness, just sample the environment directly - if (roughness < 0.001) { - gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); - return; - } - - // Tangent space basis for VNDF sampling - vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - - for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { - vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); - - // For PMREM, V = N, so in tangent space V is always (0, 0, 1) - vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); - - // Transform H back to world space - vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); - vec3 L = normalize(2.0 * dot(V, H) * H - V); - - float NdotL = max(dot(N, L), 0.0); - - if(NdotL > 0.0) { - // Sample environment at fixed mip level - // VNDF importance sampling handles the distribution filtering - vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); - - // Weight by NdotL for the split-sum approximation - // VNDF PDF naturally accounts for the visible microfacet distribution - prefilteredColor += sampleColor * NdotL; - totalWeight += NdotL; - } - } - - if (totalWeight > 0.0) { - prefilteredColor = prefilteredColor / totalWeight; - } - - gl_FragColor = vec4(prefilteredColor, 1.0); - } - `,blending:0,depthTest:!1,depthWrite:!1}))}return i}_compileMaterial(e){let t=new nT(new nd,e);this._renderer.compile(t,lf)}_sceneToCubeUV(e,t,n,i,r){let a=new nO(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(lm),l.toneMapping=0,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(i),l.clearDepth(),l.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new nT(new nE,new tK({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1})));let h=this._backgroundBox,d=h.material,p=!1,f=e.background;f?f.isColor&&(d.color.copy(f),e.background=null,p=!0):(d.color.copy(lm),p=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x+o[t],r.y,r.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y+o[t],r.z)):(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y,r.z+o[t]));let u=this._cubeSize;lM(i,n*u,t>2?u:0,u,u),l.setRenderTarget(i),p&&l.render(h,a),l.render(e,a)}l.toneMapping=c,l.autoClear=u,e.background=f}_textureToCubeUV(e,t){let n=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=lw()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=lT());let r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r,r.uniforms.envMap.value=e;let s=this._cubeSize;lM(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,lf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let i=this._lodMeshes.length;for(let t=1;th-4?n-h+4:0),f=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=c*(0+1.25*l),o.mipInt.value=h-t,lM(r,p,f,3*d,2*d),i.setRenderTarget(r),i.render(s,lf),o.envMap.value=r.texture,o.roughness.value=0,o.mipInt.value=h-n,lM(e,p,f,3*d,2*d),i.setRenderTarget(e),i.render(s,lf)}_blur(e,t,n,i,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&K("blur direction must be either latitudinal or longitudinal!");let u=this._lodMeshes[i];u.material=l;let c=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&J(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);let m=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:ev-4?i-v+4:0),y,3*_,2*_),o.setRenderTarget(t),o.render(u,lf)}}function lS(e,t,n){let i=new eN(e,t,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function lM(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function lT(){return new nI({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:lE(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function lw(){return new nI({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lE(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function lE(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function lA(e){let t=new WeakMap,n=null;function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping,s=303===a||304===a,o=301===a||302===a;if(s||o){let a=t.get(r),l=void 0!==a?a.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new lb(e)),(a=s?n.fromEquirectangular(r,a):n.fromCubemap(r,a)).texture.pmremVersion=r.pmremVersion,t.set(r,a),a.texture;{if(void 0!==a)return a.texture;let l=r.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new lb(e)),(a=s?n.fromEquirectangular(r):n.fromCubemap(r)).texture.pmremVersion=r.pmremVersion,t.set(r,a),r.addEventListener("dispose",i),a.texture):null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function lC(e){let t={};function n(n){if(void 0!==t[n])return t[n];let i=e.getExtension(n);return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){let t=n(e);return null===t&&$("WebGLRenderer: "+e+" extension not supported."),t}}}function lR(e,t,n,i){let r={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],i=e.index,r=e.attributes.position,s=0;if(null!==i){let e=i.array;s=i.version;for(let t=0,i=e.length;tt.maxTextureSize&&(f=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let m=new Float32Array(p*f*4*c),g=new eU(m,p,f,c);g.type=1015,g.needsUpdate=!0;let v=4*d;for(let t=0;t - #include - - void main() { - gl_FragColor = texture2D( tDiffuse, vUv ); - - #ifdef LINEAR_TONE_MAPPING - gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); - #elif defined( REINHARD_TONE_MAPPING ) - gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); - #elif defined( CINEON_TONE_MAPPING ) - gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); - #elif defined( ACES_FILMIC_TONE_MAPPING ) - gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); - #elif defined( AGX_TONE_MAPPING ) - gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); - #elif defined( NEUTRAL_TONE_MAPPING ) - gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); - #elif defined( CUSTOM_TONE_MAPPING ) - gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); - #endif - - #ifdef SRGB_TRANSFER - gl_FragColor = sRGBTransferOETF( gl_FragColor ); - #endif - }`,depthTest:!1,depthWrite:!1}),c=new nT(l,u),h=new sx(-1,1,1,-1,0,1),d=null,p=null,f=!1,m=null,g=[],v=!1;this.setSize=function(e,t){s.setSize(e,t),o.setSize(e,t);for(let n=0;n0&&!0===g[0].isRenderPass;let t=s.width,n=s.height;for(let e=0;e0)return e;let r=t*n,a=lV[r];if(void 0===a&&(a=new Float32Array(r),lV[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function lq(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n0&&(this.seq=i.concat(r))}setValue(e,t,n,i){let r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){let i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){let a=t[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){let n=[];for(let i=0,r=e.length;i!==r;++i){let r=e[i];r.id in t&&n.push(r)}return n}}function uP(e,t,n){let i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}let uI=0,uL=new ev;function uN(e,t,n){let i=e.getShaderParameter(t,e.COMPILE_STATUS),r=(e.getShaderInfoLog(t)||"").trim();if(i&&""===r)return"";let a=/ERROR: 0:(\d+)/.exec(r);if(!a)return r;{let i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){let n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;e":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}}let uU={1:"Linear",2:"Reinhard",3:"Cineon",4:"ACESFilmic",6:"AgX",7:"Neutral",5:"Custom"},uD=new ef;function uO(e){return""!==e}function uF(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function uz(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let uB=/^[ \t]*#include +<([\w\d./]+)>/gm;function uk(e){return e.replace(uB,uH)}let uV=new Map;function uH(e,t){let n=lt[t];if(void 0===n){let e=uV.get(t);if(void 0!==e)n=lt[e],J('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return uk(n)}let uG=/#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 uW(e){return e.replace(uG,uj)}function uj(e,t,n,i){let r="";for(let e=parseInt(t);e0&&(s+="\n"),(o=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(uO).join("\n")).length>0&&(o+="\n");else{let e,t,i,l,u;s=[uX(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.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(uO).join("\n"),o=[uX(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+m:"",n.envMap?"#define "+g:"",n.envMap?"#define "+v:"",_?"#define CUBEUV_TEXEL_WIDTH "+_.texelWidth:"",_?"#define CUBEUV_TEXEL_HEIGHT "+_.texelHeight:"",_?"#define CUBEUV_MAX_MIP "+_.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?lt.tonemapping_pars_fragment:"",0!==n.toneMapping?(r="toneMapping",void 0===(e=uU[a=n.toneMapping])?(J("WebGLProgram: Unsupported toneMapping:",a),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",lt.colorspace_pars_fragment,(t=function(e){eb._getMatrix(uL,eb.workingColorSpace,e);let t=`mat3( ${uL.elements.map(e=>e.toFixed(4))} )`;switch(eb.getTransfer(e)){case N:return[t,"LinearTransferOETF"];case U:return[t,"sRGBTransferOETF"];default:return J("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(n.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) { - return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) ); -}`),(eb.getLuminanceCoefficients(uD),i=uD.x.toFixed(4),l=uD.y.toFixed(4),u=uD.z.toFixed(4),`float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( ${i}, ${l}, ${u} ); - return dot( weights, rgb ); -}`),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(uO).join("\n")}d=uz(d=uF(d=uk(d),n),n),p=uz(p=uF(p=uk(p),n),n),d=uW(d),p=uW(p),!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",s=[y,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+s,o=["#define varying in",n.glslVersion===D?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===D?"":"#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"+o);let M=S+s+d,T=S+o+p,w=uP(c,c.VERTEX_SHADER,M),E=uP(c,c.FRAGMENT_SHADER,T);function A(t){if(e.debug.checkShaderErrors){let n=c.getProgramInfoLog(b)||"",i=c.getShaderInfoLog(w)||"",r=c.getShaderInfoLog(E)||"",a=n.trim(),l=i.trim(),u=r.trim(),h=!0,d=!0;if(!1===c.getProgramParameter(b,c.LINK_STATUS))if(h=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,b,w,E);else{let e=uN(c,w,"vertex"),n=uN(c,E,"fragment");K("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(b,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+a+"\n"+e+"\n"+n)}else""!==a?J("WebGLProgram: Program Info Log:",a):(""===l||""===u)&&(d=!1);d&&(t.diagnostics={runnable:h,programLog:a,vertexShader:{log:l,prefix:s},fragmentShader:{log:u,prefix:o}})}c.deleteShader(w),c.deleteShader(E),l=new uR(c,b),u=function(e,t){let n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r0,Y=a.clearcoat>0,Z=a.dispersion>0,K=a.iridescence>0,$=a.sheen>0,Q=a.transmission>0,ee=q&&!!a.anisotropyMap,et=Y&&!!a.clearcoatMap,en=Y&&!!a.clearcoatNormalMap,ei=Y&&!!a.clearcoatRoughnessMap,er=K&&!!a.iridescenceMap,ea=K&&!!a.iridescenceThicknessMap,es=$&&!!a.sheenColorMap,eo=$&&!!a.sheenRoughnessMap,el=!!a.specularMap,eu=!!a.specularColorMap,ec=!!a.specularIntensityMap,eh=Q&&!!a.transmissionMap,ed=Q&&!!a.thicknessMap,ep=!!a.gradientMap,ef=!!a.alphaMap,em=a.alphaTest>0,eg=!!a.alphaHash,ev=!!a.extensions,e_=0;a.toneMapped&&(null===P||!0===P.isXRRenderTarget)&&(e_=e.toneMapping);let ey={shaderID:E,shaderType:a.type,shaderName:a.name,vertexShader:v,fragmentShader:_,defines:a.defines,customVertexShaderID:y,customFragmentShaderID:x,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:D,batchingColor:D&&null!==g._colorsTexture,instancing:N,instancingColor:N&&null!==g.instanceColor,instancingMorph:N&&null!==g.morphTexture,outputColorSpace:null===P?e.outputColorSpace:!0===P.isXRRenderTarget?P.texture.colorSpace:L,alphaToCoverage:!!a.alphaToCoverage,map:O,matcap:F,envMap:z,envMapMode:z&&T.mapping,envMapCubeUVHeight:w,aoMap:B,lightMap:k,bumpMap:V,normalMap:H,displacementMap:G,emissiveMap:W,normalMapObjectSpace:H&&1===a.normalMapType,normalMapTangentSpace:H&&0===a.normalMapType,metalnessMap:j,roughnessMap:X,anisotropy:q,anisotropyMap:ee,clearcoat:Y,clearcoatMap:et,clearcoatNormalMap:en,clearcoatRoughnessMap:ei,dispersion:Z,iridescence:K,iridescenceMap:er,iridescenceThicknessMap:ea,sheen:$,sheenColorMap:es,sheenRoughnessMap:eo,specularMap:el,specularColorMap:eu,specularIntensityMap:ec,transmission:Q,transmissionMap:eh,thicknessMap:ed,gradientMap:ep,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:ef,alphaTest:em,alphaHash:eg,combine:a.combine,mapUv:O&&m(a.map.channel),aoMapUv:B&&m(a.aoMap.channel),lightMapUv:k&&m(a.lightMap.channel),bumpMapUv:V&&m(a.bumpMap.channel),normalMapUv:H&&m(a.normalMap.channel),displacementMapUv:G&&m(a.displacementMap.channel),emissiveMapUv:W&&m(a.emissiveMap.channel),metalnessMapUv:j&&m(a.metalnessMap.channel),roughnessMapUv:X&&m(a.roughnessMap.channel),anisotropyMapUv:ee&&m(a.anisotropyMap.channel),clearcoatMapUv:et&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:en&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ei&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:er&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ea&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:es&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:eo&&m(a.sheenRoughnessMap.channel),specularMapUv:el&&m(a.specularMap.channel),specularColorMapUv:eu&&m(a.specularColorMap.channel),specularIntensityMapUv:ec&&m(a.specularIntensityMap.channel),transmissionMapUv:eh&&m(a.transmissionMap.channel),thicknessMapUv:ed&&m(a.thicknessMap.channel),alphaMapUv:ef&&m(a.alphaMap.channel),vertexTangents:!!S.attributes.tangent&&(H||q),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!S.attributes.color&&4===S.attributes.color.itemSize,pointsUvs:!0===g.isPoints&&!!S.attributes.uv&&(O||ef),fog:!!b,useFog:!0===a.fog,fogExp2:!!b&&b.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:d,reversedDepthBuffer:I,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==S.morphAttributes.position,morphNormals:void 0!==S.morphAttributes.normal,morphColors:void 0!==S.morphAttributes.color,morphTargetsCount:C,morphTextureStride:R,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:e_,decodeVideoTexture:O&&!0===a.map.isVideoTexture&&eb.getTransfer(a.map.colorSpace)===U,decodeVideoTextureEmissive:W&&!0===a.emissiveMap.isVideoTexture&&eb.getTransfer(a.emissiveMap.colorSpace)===U,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:ev&&!0===a.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ev&&!0===a.extensions.multiDraw||D)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ey.vertexUv1s=u.has(1),ey.vertexUv2s=u.has(2),ey.vertexUv3s=u.has(3),u.clear(),ey},getProgramCacheKey:function(t){var n,i,r,a;let s=[];if(t.shaderID?s.push(t.shaderID):(s.push(t.customVertexShaderID),s.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)s.push(e),s.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=s,i=t,n.push(i.precision),n.push(i.outputColorSpace),n.push(i.envMapMode),n.push(i.envMapCubeUVHeight),n.push(i.mapUv),n.push(i.alphaMapUv),n.push(i.lightMapUv),n.push(i.aoMapUv),n.push(i.bumpMapUv),n.push(i.normalMapUv),n.push(i.displacementMapUv),n.push(i.emissiveMapUv),n.push(i.metalnessMapUv),n.push(i.roughnessMapUv),n.push(i.anisotropyMapUv),n.push(i.clearcoatMapUv),n.push(i.clearcoatNormalMapUv),n.push(i.clearcoatRoughnessMapUv),n.push(i.iridescenceMapUv),n.push(i.iridescenceThicknessMapUv),n.push(i.sheenColorMapUv),n.push(i.sheenRoughnessMapUv),n.push(i.specularMapUv),n.push(i.specularColorMapUv),n.push(i.specularIntensityMapUv),n.push(i.transmissionMapUv),n.push(i.thicknessMapUv),n.push(i.combine),n.push(i.fogExp2),n.push(i.sizeAttenuation),n.push(i.morphTargetsCount),n.push(i.morphAttributeCount),n.push(i.numDirLights),n.push(i.numPointLights),n.push(i.numSpotLights),n.push(i.numSpotLightMaps),n.push(i.numHemiLights),n.push(i.numRectAreaLights),n.push(i.numDirLightShadows),n.push(i.numPointLightShadows),n.push(i.numSpotLightShadows),n.push(i.numSpotLightShadowsWithMaps),n.push(i.numLightProbes),n.push(i.shadowMapType),n.push(i.toneMapping),n.push(i.numClippingPlanes),n.push(i.numClipIntersection),n.push(i.depthPacking),r=s,a=t,o.disableAll(),a.instancing&&o.enable(0),a.instancingColor&&o.enable(1),a.instancingMorph&&o.enable(2),a.matcap&&o.enable(3),a.envMap&&o.enable(4),a.normalMapObjectSpace&&o.enable(5),a.normalMapTangentSpace&&o.enable(6),a.clearcoat&&o.enable(7),a.iridescence&&o.enable(8),a.alphaTest&&o.enable(9),a.vertexColors&&o.enable(10),a.vertexAlphas&&o.enable(11),a.vertexUv1s&&o.enable(12),a.vertexUv2s&&o.enable(13),a.vertexUv3s&&o.enable(14),a.vertexTangents&&o.enable(15),a.anisotropy&&o.enable(16),a.alphaHash&&o.enable(17),a.batching&&o.enable(18),a.dispersion&&o.enable(19),a.batchingColor&&o.enable(20),a.gradientMap&&o.enable(21),r.push(o.mask),o.disableAll(),a.fog&&o.enable(0),a.useFog&&o.enable(1),a.flatShading&&o.enable(2),a.logarithmicDepthBuffer&&o.enable(3),a.reversedDepthBuffer&&o.enable(4),a.skinning&&o.enable(5),a.morphTargets&&o.enable(6),a.morphNormals&&o.enable(7),a.morphColors&&o.enable(8),a.premultipliedAlpha&&o.enable(9),a.shadowMapEnabled&&o.enable(10),a.doubleSided&&o.enable(11),a.flipSided&&o.enable(12),a.useDepthPacking&&o.enable(13),a.dithering&&o.enable(14),a.transmission&&o.enable(15),a.sheen&&o.enable(16),a.opaque&&o.enable(17),a.pointsUvs&&o.enable(18),a.decodeVideoTexture&&o.enable(19),a.decodeVideoTextureEmissive&&o.enable(20),a.alphaToCoverage&&o.enable(21),r.push(o.mask),s.push(e.outputColorSpace)),s.push(t.customProgramCacheKey),s.join()},getUniforms:function(e){let t,n=f[e.type];if(n){let e=li[n];t=nP.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){let i=h.get(n);return void 0!==i?++i.usedTimes:(i=new uK(e,n,t,a),c.push(i),h.set(n,i)),i},releaseProgram:function(e){if(0==--e.usedTimes){let t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),h.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function u2(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function u3(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function u4(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function u5(){let e=[],t=0,n=[],i=[],r=[];function a(n,i,r,a,s,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,s,o,l,u){let c=a(e,t,s,o,l,u);s.transmission>0?i.push(c):!0===s.transparent?r.push(c):n.push(c)},unshift:function(e,t,s,o,l,u){let c=a(e,t,s,o,l,u);s.transmission>0?i.unshift(c):!0===s.transparent?r.unshift(c):n.unshift(c)},finish:function(){for(let n=t,i=e.length;n1&&n.sort(e||u3),i.length>1&&i.sort(t||u4),r.length>1&&r.sort(t||u4)}}}function u6(){let e=new WeakMap;return{get:function(t,n){let i,r=e.get(t);return void 0===r?(i=new u5,e.set(t,[i])):n>=r.length?(i=new u5,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function u8(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new ef,color:new tq};break;case"SpotLight":n={position:new ef,direction:new ef,color:new tq,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ef,color:new tq,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ef,skyColor:new tq,groundColor:new tq};break;case"RectAreaLight":n={color:new tq,position:new ef,halfWidth:new ef,halfHeight:new ef}}return e[t.id]=n,n}}}let u9=0;function u7(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function ce(e){let t,n=new u8,i=(t={},{get:function(e){let n;if(void 0!==t[e.id])return t[e.id];switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ed};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ed,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),r={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 e=0;e<9;e++)r.probe.push(new ef);let a=new ef,s=new tt,o=new tt;return{setup:function(t){let a=0,s=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0;t.sort(u7);for(let e=0,y=t.length;e0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=ln.LTC_FLOAT_1,r.rectAreaLTC2=ln.LTC_FLOAT_2):(r.rectAreaLTC1=ln.LTC_HALF_1,r.rectAreaLTC2=ln.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=o;let y=r.hash;(y.directionalLength!==l||y.pointLength!==u||y.spotLength!==c||y.rectAreaLength!==h||y.hemiLength!==d||y.numDirectionalShadows!==p||y.numPointShadows!==f||y.numSpotShadows!==m||y.numSpotMaps!==g||y.numLightProbes!==_)&&(r.directional.length=l,r.spot.length=c,r.rectArea.length=h,r.point.length=u,r.hemi.length=d,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=f,r.pointShadowMap.length=f,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=f,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=_,y.directionalLength=l,y.pointLength=u,y.spotLength=c,y.rectAreaLength=h,y.hemiLength=d,y.numDirectionalShadows=p,y.numPointShadows=f,y.numSpotShadows=m,y.numSpotMaps=g,y.numLightProbes=_,r.version=u9++)},setupView:function(e,t){let n=0,i=0,l=0,u=0,c=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t=a.length?(r=new ct(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}let ci=[new ef(1,0,0),new ef(-1,0,0),new ef(0,1,0),new ef(0,-1,0),new ef(0,0,1),new ef(0,0,-1)],cr=[new ef(0,-1,0),new ef(0,-1,0),new ef(0,0,1),new ef(0,0,-1),new ef(0,-1,0),new ef(0,-1,0)],ca=new tt,cs=new ef,co=new ef;function cl(e,t,n){let i=new iO,r=new ed,a=new ed,s=new eI,o=new az,l=new aB,u={},c=n.maxTextureSize,h={0:1,1:0,2:2},d=new nI({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ed},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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let f=new nd;f.setAttribute("position",new t5(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new nT(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function _(t,n,i,r){let a=null,s=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===i.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,i=u[e];void 0===i&&(i={},u[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",y)),a=r}return a.visible=n.visible,a.wireframe=n.wireframe,3===r?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=i),a}function y(e){for(let t in e.target.removeEventListener("dispose",y),u){let n=u[t],i=e.target.uuid;i in n&&(n[i].dispose(),delete n[i])}}this.render=function(n,o,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===n.length)return;2===n.type&&(J("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),n.type=1);let u=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),y=e.state;y.setBlending(0),!0===y.buffers.depth.getReversed()?y.buffers.color.setClear(0,0,0,0):y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);let x=v!==this.type;x&&o.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let u=0,h=n.length;uc||r.y>c)&&(r.x>c&&(a.x=Math.floor(c/g.x),r.x=a.x*g.x,f.mapSize.x=a.x),r.y>c&&(a.y=Math.floor(c/g.y),r.y=a.y*g.y,f.mapSize.y=a.y)),null===f.map||!0===x){if(null!==f.map&&(null!==f.map.depthTexture&&(f.map.depthTexture.dispose(),f.map.depthTexture=null),f.map.dispose()),3===this.type){if(h.isPointLight){J("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}f.map=new eN(r.x,r.y,{format:1030,type:1016,minFilter:1006,magFilter:1006,generateMipmaps:!1}),f.map.texture.name=h.name+".shadowMap",f.map.depthTexture=new rb(r.x,r.y,1015),f.map.depthTexture.name=h.name+".shadowMapDepth",f.map.depthTexture.format=1026,f.map.depthTexture.compareFunction=null,f.map.depthTexture.minFilter=1003,f.map.depthTexture.magFilter=1003}else{h.isPointLight?(f.map=new nB(r.x),f.map.depthTexture=new rS(r.x,1014)):(f.map=new eN(r.x,r.y),f.map.depthTexture=new rb(r.x,r.y,1014)),f.map.depthTexture.name=h.name+".shadowMap",f.map.depthTexture.format=1026;let t=e.state.buffers.depth.getReversed();1===this.type?(f.map.depthTexture.compareFunction=t?518:515,f.map.depthTexture.minFilter=1006,f.map.depthTexture.magFilter=1006):(f.map.depthTexture.compareFunction=null,f.map.depthTexture.minFilter=1003,f.map.depthTexture.magFilter=1003)}f.camera.updateProjectionMatrix()}let v=f.map.isWebGLCubeRenderTarget?6:1;for(let n=0;n=1:-1!==P.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(P)[1])>=2);let I=null,L={},N=e.getParameter(e.SCISSOR_BOX),U=e.getParameter(e.VIEWPORT),D=new eI().fromArray(N),O=new eI().fromArray(U);function F(t,n,i,r){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;stypeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new ed,h=new WeakMap,d=new WeakMap,p=!1;try{p="u">typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return p?new OffscreenCanvas(e,t):G("canvas")}function m(e,t,n){let i=1,r=X(e);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1)if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap||"u">typeof VideoFrame&&e instanceof VideoFrame){let n=Math.floor(i*r.width),a=Math.floor(i*r.height);void 0===o&&(o=f(n,a));let s=t?f(n,a):o;return s.width=n,s.height=a,s.getContext("2d").drawImage(e,0,0,n,a),J("WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+a+")."),s}else"data"in e&&J("WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+").");return e}function g(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function _(n,i,r,a,s=!1){if(null!==n){if(void 0!==e[n])return e[n];J("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;if(i===e.RED&&(r===e.FLOAT&&(o=e.R32F),r===e.HALF_FLOAT&&(o=e.R16F),r===e.UNSIGNED_BYTE&&(o=e.R8)),i===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.R8UI),r===e.UNSIGNED_SHORT&&(o=e.R16UI),r===e.UNSIGNED_INT&&(o=e.R32UI),r===e.BYTE&&(o=e.R8I),r===e.SHORT&&(o=e.R16I),r===e.INT&&(o=e.R32I)),i===e.RG&&(r===e.FLOAT&&(o=e.RG32F),r===e.HALF_FLOAT&&(o=e.RG16F),r===e.UNSIGNED_BYTE&&(o=e.RG8)),i===e.RG_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RG8UI),r===e.UNSIGNED_SHORT&&(o=e.RG16UI),r===e.UNSIGNED_INT&&(o=e.RG32UI),r===e.BYTE&&(o=e.RG8I),r===e.SHORT&&(o=e.RG16I),r===e.INT&&(o=e.RG32I)),i===e.RGB_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGB8UI),r===e.UNSIGNED_SHORT&&(o=e.RGB16UI),r===e.UNSIGNED_INT&&(o=e.RGB32UI),r===e.BYTE&&(o=e.RGB8I),r===e.SHORT&&(o=e.RGB16I),r===e.INT&&(o=e.RGB32I)),i===e.RGBA_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),r===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),r===e.UNSIGNED_INT&&(o=e.RGBA32UI),r===e.BYTE&&(o=e.RGBA8I),r===e.SHORT&&(o=e.RGBA16I),r===e.INT&&(o=e.RGBA32I)),i===e.RGB&&(r===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),r===e.UNSIGNED_INT_10F_11F_11F_REV&&(o=e.R11F_G11F_B10F)),i===e.RGBA){let t=s?N:eb.getTransfer(a);r===e.FLOAT&&(o=e.RGBA32F),r===e.HALF_FLOAT&&(o=e.RGBA16F),r===e.UNSIGNED_BYTE&&(o=t===U?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return(o===e.R16F||o===e.R32F||o===e.RG16F||o===e.RG32F||o===e.RGBA16F||o===e.RGBA32F)&&t.get("EXT_color_buffer_float"),o}function y(t,n){let i;return t?null===n||1014===n||1020===n?i=e.DEPTH24_STENCIL8:1015===n?i=e.DEPTH32F_STENCIL8:1012===n&&(i=e.DEPTH24_STENCIL8,J("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||1014===n||1020===n?i=e.DEPTH_COMPONENT24:1015===n?i=e.DEPTH_COMPONENT32F:1012===n&&(i=e.DEPTH_COMPONENT16),i}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function b(e){let t=e.target;t.removeEventListener("dispose",b),function(e){let t=i.get(e);if(void 0===t.__webglInit)return;let n=e.source,r=d.get(n);if(r){let i=r[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&M(e),0===Object.keys(r).length&&d.delete(n)}i.remove(e)}(t),t.isVideoTexture&&h.delete(t)}function S(t){let n=t.target;n.removeEventListener("dispose",S),function(t){let n=i.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),i.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i0&&l.__version!==t.version){let e=t.image;if(null===e)J("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void D(l,t,r);J("WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(l.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,l.__webglTexture,e.TEXTURE0+r)}let E={1e3:e.REPEAT,1001:e.CLAMP_TO_EDGE,1002:e.MIRRORED_REPEAT},A={1003:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,1006:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,1008:e.LINEAR_MIPMAP_LINEAR},C={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function R(n,a){if((1015===a.type&&!1===t.has("OES_texture_float_linear")&&(1006===a.magFilter||1007===a.magFilter||1005===a.magFilter||1008===a.magFilter||1006===a.minFilter||1007===a.minFilter||1005===a.minFilter||1008===a.minFilter)&&J("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,E[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,E[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,E[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&1003!==a.magFilter&&(1005===a.minFilter||1008===a.minFilter)&&(1015!==a.type||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||i.get(a).__currentAnisotropy)){let s=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy}}function P(t,n){let i,r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));let a=n.source,o=d.get(a);void 0===o&&(o={},d.set(a,o));let l=((i=[]).push(n.wrapS),i.push(n.wrapT),i.push(n.wrapR||0),i.push(n.magFilter),i.push(n.minFilter),i.push(n.anisotropy),i.push(n.internalFormat),i.push(n.format),i.push(n.type),i.push(n.generateMipmaps),i.push(n.premultiplyAlpha),i.push(n.flipY),i.push(n.unpackAlignment),i.push(n.colorSpace),i.join());if(l!==t.__cacheKey){void 0===o[l]&&(o[l]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),o[l].usedTimes++;let i=o[t.__cacheKey];void 0!==i&&(o[t.__cacheKey].usedTimes--,0===i.usedTimes&&M(n)),t.__cacheKey=l,t.__webglTexture=o[l].texture}return r}function I(e,t,n){return Math.floor(Math.floor(e/n)/t)}function D(t,s,o){let l=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=e.TEXTURE_3D);let u=P(t,s),c=s.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);let h=i.get(c);if(c.version!==h.__version||!0===u){let t;n.activeTexture(e.TEXTURE0+o);let i=eb.getPrimaries(eb.workingColorSpace),d=""===s.colorSpace?null:eb.getPrimaries(s.colorSpace),p=""===s.colorSpace||i===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=m(s.image,!1,r.maxTextureSize);f=j(s,f);let b=a.convert(s.format,s.colorSpace),S=a.convert(s.type),M=_(s.internalFormat,b,S,s.colorSpace,s.isVideoTexture);R(l,s);let T=s.mipmaps,w=!0!==s.isVideoTexture,E=void 0===h.__version||!0===u,A=c.dataReady,C=x(s,f);if(s.isDepthTexture)M=y(1027===s.format,s.type),E&&(w?n.texStorage2D(e.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,b,S,null));else if(s.isDataTexture)if(T.length>0){w&&E&&n.texStorage2D(e.TEXTURE_2D,C,M,T[0].width,T[0].height);for(let i=0,r=T.length;ie.start-t.start);let o=0;for(let e=1;e0){let r=o8(t.width,t.height,s.format,s.type);for(let a of s.layerUpdates){let s=t.data.subarray(a*r/t.data.BYTES_PER_ELEMENT,(a+1)*r/t.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,t.width,t.height,1,b,s)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,f.depth,b,t.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,M,t.width,t.height,f.depth,0,t.data,0,0);else J("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else w?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,f.depth,b,S,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,M,t.width,t.height,f.depth,0,b,S,t.data)}else{w&&E&&n.texStorage2D(e.TEXTURE_2D,C,M,T[0].width,T[0].height);for(let i=0,r=T.length;i0){let t=o8(f.width,f.height,s.format,s.type);for(let i of s.layerUpdates){let r=f.data.subarray(i*t/f.data.BYTES_PER_ELEMENT,(i+1)*t/f.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,i,f.width,f.height,1,b,S,r)}s.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isData3DTexture)w?(E&&n.texStorage3D(e.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,b,S,f.data)):n.texImage3D(e.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,b,S,f.data);else if(s.isFramebufferTexture){if(E)if(w)n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height);else{let t=f.width,i=f.height;for(let r=0;r>=1,i>>=1}}else if(T.length>0){if(w&&E){let t=X(T[0]);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}for(let i=0,r=T.length;i>c),i=Math.max(1,r.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,p,t,i,r.depth,0,h,d,null):n.texImage2D(u,c,p,t,i,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),W(r)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,u,m.__webglTexture,0,H(r)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,u,m.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function F(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,s=y(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;W(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,H(n),s,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,H(n),s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{let t=n.textures;for(let r=0;r{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),r.__depthDisposeCallback=t}r.__boundDepthTexture=e}if(t.depthTexture&&!r.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)z(r.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?z(r.__webglFramebuffer[0],t,0):z(r.__webglFramebuffer,t,0)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=e.createRenderbuffer(),F(r.__webglDepthbuffer[i],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=r.__webglDepthbuffer[i];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let i=t.texture.mipmaps;if(i&&i.length>0?n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=e.createRenderbuffer(),F(r.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,i),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,i)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}let k=[],V=[];function H(e){return Math.min(r.maxSamples,e.samples)}function W(e){let n=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function j(e,t){let n=e.colorSpace,i=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==L&&""!==n&&(eb.getTransfer(n)===U?(1023!==i||1009!==r)&&J("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):K("WebGLTextures: Unsupported texture color space:",n)),t}function X(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"u">typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){let e=T;return e>=r.maxTextures&&J("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=w,this.setTexture2DArray=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?D(a,t,r):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r))},this.setTexture3D=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?D(a,t,r):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function(t,s){let o=i.get(t);!0!==t.isCubeDepthTexture&&t.version>0&&o.__version!==t.version?function(t,s,o){if(6!==s.image.length)return;let l=P(t,s),u=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);let c=i.get(u);if(u.version!==c.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+o);let i=eb.getPrimaries(eb.workingColorSpace),h=""===s.colorSpace?null:eb.getPrimaries(s.colorSpace),d=""===s.colorSpace||i===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=s.isCompressedTexture||s.image[0].isCompressedTexture,f=s.image[0]&&s.image[0].isDataTexture,y=[];for(let e=0;e<6;e++)p||f?y[e]=f?s.image[e].image:s.image[e]:y[e]=m(s.image[e],!0,r.maxCubemapSize),y[e]=j(s,y[e]);let b=y[0],S=a.convert(s.format,s.colorSpace),M=a.convert(s.type),T=_(s.internalFormat,S,M,s.colorSpace),w=!0!==s.isVideoTexture,E=void 0===c.__version||!0===l,A=u.dataReady,C=x(s,b);if(R(e.TEXTURE_CUBE_MAP,s),p){w&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,T,b.width,b.height);for(let i=0;i<6;i++){t=y[i].mipmaps;for(let r=0;r0&&C++;let i=X(y[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,T,i.width,i.height)}for(let i=0;i<6;i++)if(f){w?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,y[i].width,y[i].height,S,M,y[i].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,T,y[i].width,y[i].height,0,S,M,y[i].data);for(let r=0;r1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=r.version,s.memory.textures++),c){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n0){o.__webglFramebuffer=[];for(let t=0;t0&&!1===W(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n0)for(let i=0;i0)for(let n=0;n0){if(!1===W(t)){let r=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=i.get(t),h=r.length>1;if(h)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class cm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){let n=new rM(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new nI({vertexShader:cp,fragmentShader:cf,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new nT(new ay(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class cg extends ee{constructor(e,t){super();const n=this;let i=null,r=1,a=null,s="local-floor",o=1,l=null,u=null,c=null,h=null,d=null,p=null;const f="u">typeof XRWebGLBinding,m=new cm,g={},v=t.getContextAttributes();let _=null,y=null;const x=[],b=[],S=new ed;let M=null;const T=new nO;T.viewport=new eI;const w=new nO;w.viewport=new eI;const E=[T,w],A=new sG;let C=null,R=null;function P(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let n=x[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){i.removeEventListener("select",P),i.removeEventListener("selectstart",P),i.removeEventListener("selectend",P),i.removeEventListener("squeeze",P),i.removeEventListener("squeezestart",P),i.removeEventListener("squeezeend",P),i.removeEventListener("end",I),i.removeEventListener("inputsourceschange",L);for(let e=0;e=0&&(b[i]=null,x[i].disconnect(n))}for(let t=0;t=b.length){b.push(n),i=e;break}else if(null===b[e]){b[e]=n,i=e;break}if(-1===i)break}let r=x[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&J("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&J("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===c&&f&&(c=new XRWebGLBinding(i,t)),c},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(u){if(null!==(i=u)){if(_=e.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",I),i.addEventListener("inputsourceschange",L),!0!==v.xrCompatible&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(S),f&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?1027:1026,a=v.stencil?1020:1014);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:r};h=(c=this.getBinding()).createProjectionLayer(o),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),y=new eN(h.textureWidth,h.textureHeight,{format:1023,type:1009,depthTexture:new rb(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new eN(d.framebufferWidth,d.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}y.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await i.requestReferenceSpace(s),F.setContext(i),F.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};const N=new ef,U=new ef;function D(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,n,r;if(null===i)return;let a=e.near,s=e.far;null!==m.texture&&(m.depthNear>0&&(a=m.depthNear),m.depthFar>0&&(s=m.depthFar)),A.near=w.near=T.near=a,A.far=w.far=T.far=s,(C!==A.near||R!==A.far)&&(i.updateRenderState({depthNear:A.near,depthFar:A.far}),C=A.near,R=A.far),A.layers.mask=6|e.layers.mask,T.layers.mask=3&A.layers.mask,w.layers.mask=5&A.layers.mask;let o=e.parent,l=A.cameras;D(A,o);for(let e=0;e0&&(e.alphaTest.value=i.alphaTest);let r=t.get(i),a=r.envMap,s=r.envMapRotation;a&&(e.envMap.value=a,cv.copy(s),cv.x*=-1,cv.y*=-1,cv.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(cv.y*=-1,cv.z*=-1),e.envMapRotation.value.setFromMatrix4(c_.makeRotationFromEuler(cv)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,nR(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,r,a,s,o){var l,u,c,h,d,p,f,m,g,v,_,y,x,b,S,M,T,w,E,A,C,R,P;let I;r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(e,r):r.isMeshToonMaterial?(i(e,r),l=e,(u=r).gradientMap&&(l.gradientMap.value=u.gradientMap)):r.isMeshPhongMaterial?(i(e,r),c=e,h=r,c.specular.value.copy(h.specular),c.shininess.value=Math.max(h.shininess,1e-4)):r.isMeshStandardMaterial?(i(e,r),d=e,p=r,d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,d.roughnessMapTransform)),p.envMap&&(d.envMapIntensity.value=p.envMapIntensity),r.isMeshPhysicalMaterial&&(f=e,m=r,g=o,f.ior.value=m.ior,m.sheen>0&&(f.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),f.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(f.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,f.sheenColorMapTransform)),m.sheenRoughnessMap&&(f.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,f.sheenRoughnessMapTransform))),m.clearcoat>0&&(f.clearcoat.value=m.clearcoat,f.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(f.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,f.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(f.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),1===m.side&&f.clearcoatNormalScale.value.negate())),m.dispersion>0&&(f.dispersion.value=m.dispersion),m.iridescence>0&&(f.iridescence.value=m.iridescence,f.iridescenceIOR.value=m.iridescenceIOR,f.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(f.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,f.iridescenceMapTransform)),m.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),m.transmission>0&&(f.transmission.value=m.transmission,f.transmissionSamplerMap.value=g.texture,f.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(f.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,f.transmissionMapTransform)),f.thickness.value=m.thickness,m.thicknessMap&&(f.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=m.attenuationDistance,f.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(f.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(f.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=m.specularIntensity,f.specularColor.value.copy(m.specularColor),m.specularColorMap&&(f.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,f.specularColorMapTransform)),m.specularIntensityMap&&(f.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,f.specularIntensityMapTransform)))):r.isMeshMatcapMaterial?(i(e,r),v=e,(_=r).matcap&&(v.matcap.value=_.matcap)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),y=e,x=r,I=t.get(x).light,y.referencePosition.value.setFromMatrixPosition(I.matrixWorld),y.nearDistance.value=I.shadow.camera.near,y.farDistance.value=I.shadow.camera.far):r.isMeshNormalMaterial?i(e,r):r.isLineBasicMaterial?(b=e,S=r,b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,S.map&&(b.map.value=S.map,n(S.map,b.mapTransform)),r.isLineDashedMaterial&&(M=e,T=r,M.dashSize.value=T.dashSize,M.totalSize.value=T.dashSize+T.gapSize,M.scale.value=T.scale)):r.isPointsMaterial?(w=e,E=r,A=a,C=s,w.diffuse.value.copy(E.color),w.opacity.value=E.opacity,w.size.value=E.size*A,w.scale.value=.5*C,E.map&&(w.map.value=E.map,n(E.map,w.uvTransform)),E.alphaMap&&(w.alphaMap.value=E.alphaMap,n(E.alphaMap,w.alphaMapTransform)),E.alphaTest>0&&(w.alphaTest.value=E.alphaTest)):r.isSpriteMaterial?(R=e,P=r,R.diffuse.value.copy(P.color),R.opacity.value=P.opacity,R.rotation.value=P.rotation,P.map&&(R.map.value=P.map,n(P.map,R.mapTransform)),P.alphaMap&&(R.alphaMap.value=P.alphaMap,n(P.alphaMap,R.alphaMapTransform)),P.alphaTest>0&&(R.alphaTest.value=P.alphaTest)):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function cx(e,t,n,i){let r={},a={},s=[],o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?J("WebGLRenderer: Texture samplers can not be part of an uniforms group."):J("WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){let n=t.target;n.removeEventListener("dispose",u);let i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),e.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;i.uniformBlockBinding(e,n)},update:function(n,c){var h;let d,p,f,m,g=r[n.id];void 0===g&&(function(e){let t=e.uniforms,n=0;for(let e=0,i=t.length;e0&&(n+=16-i),e.__size=n,e.__cache={}}(n),(h=n).__bindingPointIndex=d=function(){for(let e=0;etypeof WebGLRenderingContext&&A instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=A.getContextAttributes().alpha}else t=P;const k=new Set([1033,1031,1029]),V=new Set([1009,1014,1012,1020,1017,1018]),H=new Uint32Array(4),G=new Int32Array(4);let j=null,X=null;const q=[],Y=[];let ee=null;this.domElement=E,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 et=this;let en=!1;this._outputColorSpace=I;let ei=0,er=0,ea=null,es=-1,eo=null;const el=new eI,eu=new eI;let ec=null;const eh=new tq(0);let ed=0,ep=E.width,em=E.height,eg=1,ev=null,e_=null;const ey=new eI(0,0,ep,em),ex=new eI(0,0,ep,em);let eS=!1;const eM=new iO;let eT=!1,ew=!1;const eE=new tt,eA=new ef,eC=new eI,eR={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let eP=!1;function eL(){return null===ea?eg:1}let eU=A;function eD(e,t){return E.getContext(e,t)}try{if("setAttribute"in E&&E.setAttribute("data-engine","three.js r182"),E.addEventListener("webglcontextlost",ez,!1),E.addEventListener("webglcontextrestored",eB,!1),E.addEventListener("webglcontextcreationerror",ek,!1),null===eU){const e="webgl2";if(eU=eD(e,{alpha:!0,depth:C,stencil:R,antialias:N,premultipliedAlpha:U,preserveDrawingBuffer:D,powerPreference:O,failIfMajorPerformanceCaveat:F}),null===eU)if(eD(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw K("WebGLRenderer: "+e.message),e}function eO(){(n=new lC(eU)).init(),M=new cd(eU,n),i=new lc(eU,n,e,M),r=new cc(eU,n),i.reversedDepthBuffer&&z&&r.buffers.depth.setReversed(!0),a=new lI(eU),s=new u2,o=new ch(eU,n,r,s,i,M,a),l=new ld(et),u=new lA(et),c=new le(eU),T=new ll(eU,c),h=new lR(eU,c,a,T),d=new lN(eU,h,c,a),x=new lL(eU,i,o),v=new lh(s),p=new u1(et,l,u,n,i,T,v),f=new cy(et,s),m=new u6,g=new cn(n),y=new lo(et,l,u,r,d,t,U),_=new cl(et,d,i),w=new cx(eU,a,i,r),b=new lu(eU,n,a),S=new lP(eU,n,a),a.programs=p.programs,et.capabilities=i,et.extensions=n,et.properties=s,et.renderLists=m,et.shadowMap=_,et.state=r,et.info=a}eO(),1009!==B&&(ee=new lD(B,E.width,E.height,C,R));const eF=new cg(et,eU);function ez(e){e.preventDefault(),Z("WebGLRenderer: Context Lost."),en=!0}function eB(){Z("WebGLRenderer: Context Restored."),en=!1;let e=a.autoReset,t=_.enabled,n=_.autoUpdate,i=_.needsUpdate,r=_.type;eO(),a.autoReset=e,_.enabled=t,_.autoUpdate=n,_.needsUpdate=i,_.type=r}function ek(e){K("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function eV(e){var t,n;let i,r=e.target;r.removeEventListener("dispose",eV),n=t=r,void 0!==(i=s.get(n).programs)&&(i.forEach(function(e){p.releaseProgram(e)}),n.isShaderMaterial&&p.releaseShaderCache(n)),s.remove(t)}function eH(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,e$(e,t,n),e.side=0,e.needsUpdate=!0,e$(e,t,n),e.side=2):e$(e,t,n)}this.xr=eF,this.getContext=function(){return eU},this.getContextAttributes=function(){return eU.getContextAttributes()},this.forceContextLoss=function(){let e=n.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=n.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return eg},this.setPixelRatio=function(e){void 0!==e&&(eg=e,this.setSize(ep,em,!1))},this.getSize=function(e){return e.set(ep,em)},this.setSize=function(e,t,n=!0){eF.isPresenting?J("WebGLRenderer: Can't change size while VR device is presenting."):(ep=e,em=t,E.width=Math.floor(e*eg),E.height=Math.floor(t*eg),!0===n&&(E.style.width=e+"px",E.style.height=t+"px"),null!==ee&&ee.setSize(E.width,E.height),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(ep*eg,em*eg).floor()},this.setDrawingBufferSize=function(e,t,n){ep=e,em=t,eg=n,E.width=Math.floor(e*n),E.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.setEffects=function(e){if(1009===B)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(e){for(let t=0;tp.matrixWorld.determinant(),y=function(e,t,n,a,c){var h,d;!0!==t.isScene&&(t=eR),o.resetTextureUnits();let p=t.fog,m=a.isMeshStandardMaterial?t.environment:null,g=null===ea?et.outputColorSpace:!0===ea.isXRRenderTarget?ea.texture.colorSpace:L,_=(a.isMeshStandardMaterial?u:l).get(a.envMap||m),y=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,b=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),S=!!n.morphAttributes.position,M=!!n.morphAttributes.normal,T=!!n.morphAttributes.color,E=0;a.toneMapped&&(null===ea||!0===ea.isXRRenderTarget)&&(E=et.toneMapping);let A=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,C=void 0!==A?A.length:0,R=s.get(a),P=X.state.lights;if(!0===eT&&(!0===ew||e!==eo)){let t=e===eo&&a.id===es;v.setState(a,e,t)}let I=!1;a.version===R.__version?R.needsLights&&R.lightsStateVersion!==P.state.version||R.outputColorSpace!==g||c.isBatchedMesh&&!1===R.batching?I=!0:c.isBatchedMesh||!0!==R.batching?c.isBatchedMesh&&!0===R.batchingColor&&null===c.colorTexture||c.isBatchedMesh&&!1===R.batchingColor&&null!==c.colorTexture||c.isInstancedMesh&&!1===R.instancing?I=!0:c.isInstancedMesh||!0!==R.instancing?c.isSkinnedMesh&&!1===R.skinning?I=!0:c.isSkinnedMesh||!0!==R.skinning?c.isInstancedMesh&&!0===R.instancingColor&&null===c.instanceColor||c.isInstancedMesh&&!1===R.instancingColor&&null!==c.instanceColor||c.isInstancedMesh&&!0===R.instancingMorph&&null===c.morphTexture||c.isInstancedMesh&&!1===R.instancingMorph&&null!==c.morphTexture||R.envMap!==_||!0===a.fog&&R.fog!==p||void 0!==R.numClippingPlanes&&(R.numClippingPlanes!==v.numPlanes||R.numIntersection!==v.numIntersection)||R.vertexAlphas!==y||R.vertexTangents!==b||R.morphTargets!==S||R.morphNormals!==M||R.morphColors!==T||R.toneMapping!==E?I=!0:R.morphTargetsCount!==C&&(I=!0):I=!0:I=!0:I=!0:(I=!0,R.__version=a.version);let N=R.currentProgram;!0===I&&(N=e$(a,t,c));let U=!1,D=!1,O=!1,F=N.getUniforms(),z=R.uniforms;if(r.useProgram(N.program)&&(U=!0,D=!0,O=!0),a.id!==es&&(es=a.id,D=!0),U||eo!==e){r.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),F.setValue(eU,"projectionMatrix",e.projectionMatrix),F.setValue(eU,"viewMatrix",e.matrixWorldInverse);let t=F.map.cameraPosition;void 0!==t&&t.setValue(eU,eA.setFromMatrixPosition(e.matrixWorld)),i.logarithmicDepthBuffer&&F.setValue(eU,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&F.setValue(eU,"isOrthographic",!0===e.isOrthographicCamera),eo!==e&&(eo=e,D=!0,O=!0)}if(R.needsLights&&(P.state.directionalShadowMap.length>0&&F.setValue(eU,"directionalShadowMap",P.state.directionalShadowMap,o),P.state.spotShadowMap.length>0&&F.setValue(eU,"spotShadowMap",P.state.spotShadowMap,o),P.state.pointShadowMap.length>0&&F.setValue(eU,"pointShadowMap",P.state.pointShadowMap,o)),c.isSkinnedMesh){F.setOptional(eU,c,"bindMatrix"),F.setOptional(eU,c,"bindMatrixInverse");let e=c.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),F.setValue(eU,"boneTexture",e.boneTexture,o))}c.isBatchedMesh&&(F.setOptional(eU,c,"batchingTexture"),F.setValue(eU,"batchingTexture",c._matricesTexture,o),F.setOptional(eU,c,"batchingIdTexture"),F.setValue(eU,"batchingIdTexture",c._indirectTexture,o),F.setOptional(eU,c,"batchingColorTexture"),null!==c._colorsTexture&&F.setValue(eU,"batchingColorTexture",c._colorsTexture,o));let B=n.morphAttributes;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color)&&x.update(c,n,N),(D||R.receiveShadow!==c.receiveShadow)&&(R.receiveShadow=c.receiveShadow,F.setValue(eU,"receiveShadow",c.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(z.envMap.value=_,z.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(z.envMapIntensity.value=t.environmentIntensity),void 0!==z.dfgLUT&&(z.dfgLUT.value=(null===cS&&((cS=new ig(cb,16,16,1030,1016)).name="DFG_LUT",cS.minFilter=1006,cS.magFilter=1006,cS.wrapS=1001,cS.wrapT=1001,cS.generateMipmaps=!1,cS.needsUpdate=!0),cS)),D&&(F.setValue(eU,"toneMappingExposure",et.toneMappingExposure),R.needsLights&&(h=z,d=O,h.ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),p&&!0===a.fog&&f.refreshFogUniforms(z,p),f.refreshMaterialUniforms(z,a,eg,em,X.state.transmissionRenderTarget[e.id]),uR.upload(eU,eQ(R),z,o)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(uR.upload(eU,eQ(R),z,o),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&F.setValue(eU,"center",c.center),F.setValue(eU,"modelViewMatrix",c.modelViewMatrix),F.setValue(eU,"normalMatrix",c.normalMatrix),F.setValue(eU,"modelMatrix",c.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t{function i(){(r.forEach(function(e){s.get(e).currentProgram.isReady()&&r.delete(e)}),0===r.size)?t(e):setTimeout(i,10)}null!==n.get("KHR_parallel_shader_compile")?i():setTimeout(i,10)})};let eG=null;function eW(){eX.stop()}function ej(){eX.start()}const eX=new o7;function eq(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)X.pushLight(e),e.castShadow&&X.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||eM.intersectsSprite(e)){i&&eC.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eE);let t=d.update(e),r=e.material;r.visible&&j.push(e,t,r,n,eC.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||eM.intersectsObject(e))){let t=d.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eC.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),eC.copy(t.boundingSphere.center)),eC.applyMatrix4(e.matrixWorld).applyMatrix4(eE)),Array.isArray(r)){let i=t.groups;for(let a=0,s=i.length;a0&&eJ(a,t,n),s.length>0&&eJ(s,t,n),o.length>0&&eJ(o,t,n),r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),r.setPolygonOffset(!1)}function eZ(e,t,r,a){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;if(void 0===X.state.transmissionRenderTarget[a.id]){let e=n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float");X.state.transmissionRenderTarget[a.id]=new eN(1,1,{generateMipmaps:!0,type:e?1016:1009,minFilter:1008,samples:i.samples,stencilBuffer:R,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:eb.workingColorSpace})}let s=X.state.transmissionRenderTarget[a.id],l=a.viewport||el;s.setSize(l.z*et.transmissionResolutionScale,l.w*et.transmissionResolutionScale);let u=et.getRenderTarget(),c=et.getActiveCubeFace(),h=et.getActiveMipmapLevel();et.setRenderTarget(s),et.getClearColor(eh),(ed=et.getClearAlpha())<1&&et.setClearColor(0xffffff,.5),et.clear(),eP&&y.render(r);let d=et.toneMapping;et.toneMapping=0;let p=a.viewport;if(void 0!==a.viewport&&(a.viewport=void 0),X.setupLightsView(a),!0===eT&&v.setGlobalState(et.clippingPlanes,a),eJ(e,r,a),o.updateMultisampleRenderTarget(s),o.updateRenderTargetMipmap(s),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,i=t.length;ntypeof self&&eX.setContext(self),this.setAnimationLoop=function(e){eG=e,eF.setAnimationLoop(e),null===e?eX.stop():eX.start()},eF.addEventListener("sessionstart",eW),eF.addEventListener("sessionend",ej),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void K("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===en)return;let n=!0===eF.enabled&&!0===eF.isPresenting,i=null!==ee&&(null===ea||n)&&ee.begin(et,ea);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eF.enabled&&!0===eF.isPresenting&&(null===ee||!1===ee.isCompositing())&&(!0===eF.cameraAutoUpdate&&eF.updateCamera(t),t=eF.getCamera()),!0===e.isScene&&e.onBeforeRender(et,e,t,ea),(X=g.get(e,Y.length)).init(t),Y.push(X),eE.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),eM.setFromProjectionMatrix(eE,2e3,t.reversedDepth),ew=this.localClippingEnabled,eT=v.init(this.clippingPlanes,ew),(j=m.get(e,q.length)).init(),q.push(j),!0===eF.enabled&&!0===eF.isPresenting){let e=et.xr.getDepthSensingMesh();null!==e&&eq(e,t,-1/0,et.sortObjects)}eq(e,t,0,et.sortObjects),j.finish(),!0===et.sortObjects&&j.sort(ev,e_),(eP=!1===eF.enabled||!1===eF.isPresenting||!1===eF.hasDepthSensing())&&y.addToRenderList(j,e),this.info.render.frame++,!0===eT&&v.beginShadows();let r=X.state.shadowsArray;if(_.render(r,e,t),!0===eT&&v.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(i&&ee.hasRenderPass())){let n=j.opaque,i=j.transmissive;if(X.setupLights(),t.isArrayCamera){let r=t.cameras;if(i.length>0)for(let t=0,a=r.length;t0&&eZ(n,i,e,t),eP&&y.render(e),eY(j,e,t)}null!==ea&&0===er&&(o.updateMultisampleRenderTarget(ea),o.updateRenderTargetMipmap(ea)),i&&ee.end(et),!0===e.isScene&&e.onAfterRender(et,e,t),T.resetDefaultState(),es=-1,eo=null,Y.pop(),Y.length>0?(X=Y[Y.length-1],!0===eT&&v.setGlobalState(et.clippingPlanes,X.state.camera)):X=null,q.pop(),j=q.length>0?q[q.length-1]:null},this.getActiveCubeFace=function(){return ei},this.getActiveMipmapLevel=function(){return er},this.getRenderTarget=function(){return ea},this.setRenderTargetTextures=function(e,t,n){let i=s.get(e);i.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===i.__autoAllocateDepthBuffer&&(i.__useRenderToTexture=!1),s.get(e.texture).__webglTexture=t,s.get(e.depthTexture).__webglTexture=i.__autoAllocateDepthBuffer?void 0:n,i.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=s.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};const e1=eU.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){ea=e,ei=t,er=n;let i=null,a=!1,l=!1;if(e){let u=s.get(e);if(void 0!==u.__useDefaultFramebuffer){r.bindFramebuffer(eU.FRAMEBUFFER,u.__webglFramebuffer),el.copy(e.viewport),eu.copy(e.scissor),ec=e.scissorTest,r.viewport(el),r.scissor(eu),r.setScissorTest(ec),es=-1;return}if(void 0===u.__webglFramebuffer)o.setupRenderTarget(e);else if(u.__hasExternalTextures)o.rebindTextures(e,s.get(e.texture).__webglTexture,s.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(u.__boundDepthTexture!==t){if(null!==t&&s.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");o.setupDepthRenderbuffer(e)}}let c=e.texture;(c.isData3DTexture||c.isDataArrayTexture||c.isCompressedArrayTexture)&&(l=!0);let h=s.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(h[t])?h[t][n]:h[t],a=!0):i=e.samples>0&&!1===o.useMultisampledRTT(e)?s.get(e).__webglMultisampledFramebuffer:Array.isArray(h)?h[n]:h,el.copy(e.viewport),eu.copy(e.scissor),ec=e.scissorTest}else el.copy(ey).multiplyScalar(eg).floor(),eu.copy(ex).multiplyScalar(eg).floor(),ec=eS;if(0!==n&&(i=e1),r.bindFramebuffer(eU.FRAMEBUFFER,i)&&r.drawBuffers(e,i),r.viewport(el),r.scissor(eu),r.setScissorTest(ec),a){let i=s.get(e.texture);eU.framebufferTexture2D(eU.FRAMEBUFFER,eU.COLOR_ATTACHMENT0,eU.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(l)for(let i=0;i=0&&t<=e.width-a&&n>=0&&n<=e.height-o&&(e.textures.length>1&&eU.readBuffer(eU.COLOR_ATTACHMENT0+c),eU.readPixels(t,n,a,o,M.convert(s),M.convert(u),l))}finally{let e=null!==ea?s.get(ea).__webglFramebuffer:null;r.bindFramebuffer(eU.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,o,l,u,c=0){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(h=h[u]),h)if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o){r.bindFramebuffer(eU.FRAMEBUFFER,h);let u=e.textures[c],d=u.format,p=u.type;if(!i.textureFormatReadable(d))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let f=eU.createBuffer();eU.bindBuffer(eU.PIXEL_PACK_BUFFER,f),eU.bufferData(eU.PIXEL_PACK_BUFFER,l.byteLength,eU.STREAM_READ),e.textures.length>1&&eU.readBuffer(eU.COLOR_ATTACHMENT0+c),eU.readPixels(t,n,a,o,M.convert(d),M.convert(p),0);let m=null!==ea?s.get(ea).__webglFramebuffer:null;r.bindFramebuffer(eU.FRAMEBUFFER,m);let g=eU.fenceSync(eU.SYNC_GPU_COMMANDS_COMPLETE,0);return eU.flush(),await Q(eU,g,4),eU.bindBuffer(eU.PIXEL_PACK_BUFFER,f),eU.getBufferSubData(eU.PIXEL_PACK_BUFFER,0,l),eU.deleteBuffer(f),eU.deleteSync(g),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e,t=null,n=0){let i=Math.pow(2,-n),a=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i),l=null!==t?t.x:0,u=null!==t?t.y:0;o.setTexture2D(e,0),eU.copyTexSubImage2D(eU.TEXTURE_2D,n,0,0,l,u,a,s),r.unbindTexture()};const e2=eU.createFramebuffer(),e3=eU.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,i=null,a=0,l=null){let u,c,h,d,p,f,m,g,v,_;null===l&&(0!==a?($("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),l=a,a=0):l=0);let y=e.isCompressedTexture?e.mipmaps[l]:e.image;if(null!==n)u=n.max.x-n.min.x,c=n.max.y-n.min.y,h=n.isBox3?n.max.z-n.min.z:1,d=n.min.x,p=n.min.y,f=n.isBox3?n.min.z:0;else{let t=Math.pow(2,-a);u=Math.floor(y.width*t),c=Math.floor(y.height*t),h=e.isDataArrayTexture?y.depth:e.isData3DTexture?Math.floor(y.depth*t):1,d=0,p=0,f=0}null!==i?(m=i.x,g=i.y,v=i.z):(m=0,g=0,v=0);let x=M.convert(t.format),b=M.convert(t.type);t.isData3DTexture?(o.setTexture3D(t,0),_=eU.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(o.setTexture2DArray(t,0),_=eU.TEXTURE_2D_ARRAY):(o.setTexture2D(t,0),_=eU.TEXTURE_2D),eU.pixelStorei(eU.UNPACK_FLIP_Y_WEBGL,t.flipY),eU.pixelStorei(eU.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eU.pixelStorei(eU.UNPACK_ALIGNMENT,t.unpackAlignment);let S=eU.getParameter(eU.UNPACK_ROW_LENGTH),T=eU.getParameter(eU.UNPACK_IMAGE_HEIGHT),w=eU.getParameter(eU.UNPACK_SKIP_PIXELS),E=eU.getParameter(eU.UNPACK_SKIP_ROWS),A=eU.getParameter(eU.UNPACK_SKIP_IMAGES);eU.pixelStorei(eU.UNPACK_ROW_LENGTH,y.width),eU.pixelStorei(eU.UNPACK_IMAGE_HEIGHT,y.height),eU.pixelStorei(eU.UNPACK_SKIP_PIXELS,d),eU.pixelStorei(eU.UNPACK_SKIP_ROWS,p),eU.pixelStorei(eU.UNPACK_SKIP_IMAGES,f);let C=e.isDataArrayTexture||e.isData3DTexture,R=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=s.get(e),i=s.get(t),o=s.get(n.__renderTarget),_=s.get(i.__renderTarget);r.bindFramebuffer(eU.READ_FRAMEBUFFER,o.__webglFramebuffer),r.bindFramebuffer(eU.DRAW_FRAMEBUFFER,_.__webglFramebuffer);for(let n=0;ntypeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=eb._getDrawingBufferColorSpace(e),t.unpackColorSpace=eb._getUnpackColorSpace()}}e.s(["PMREMGenerator",()=>lb,"ShaderChunk",()=>lt,"ShaderLib",()=>li,"UniformsLib",()=>ln,"WebGLRenderer",()=>cM,"WebGLUtils",()=>cd],8560);var cT=e.i(66748);let cw=[];function cE(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let i=e.length;if(t.length!==i)return!1;for(let r=0;r0&&(r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.remove,i.lifespan)),r.response;if(!n)throw r.promise}let r={keys:t,equal:i.equal,remove:()=>{let e=cw.indexOf(r);-1!==e&&cw.splice(e,1)},promise:("object"==typeof e&&"function"==typeof e.then?e:e(...t)).then(e=>{r.response=e,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(e=>r.error=e)};if(cw.push(r),!n)throw r.promise}var cC=e.i(89499),cR=e.i(43476),cP=E;function cI(e,t,n){if(!e)return;if(!0===n(e))return e;let i=t?e.return:e.child;for(;i;){let e=cI(i,t,n);if(e)return e;i=t?null:i.sibling}}function cL(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}"u">typeof window&&((null==(y=window.document)?void 0:y.createElement)||(null==(x=window.navigator)?void 0:x.product)==="ReactNative")?cP.useLayoutEffect:cP.useEffect;let cN=cL(cP.createContext(null));class cU extends cP.Component{render(){return cP.createElement(cN.Provider,{value:this._reactInternals},this.props.children)}}function cD(){let e=cP.useContext(cN);if(null===e)throw Error("its-fine: useFiber must be called within a !");let t=cP.useId();return cP.useMemo(()=>{for(let n of[e,null==e?void 0:e.alternate]){if(!n)continue;let e=cI(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}let cO=Symbol.for("react.context"),cF=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===cO;function cz(){let e=function(){let e=cD(),[t]=cP.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;cF(e)&&e!==cN&&!t.has(e)&&t.set(e,cP.use(cL(e))),n=n.return}return t}();return cP.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>i=>cP.createElement(t,null,cP.createElement(n.Provider,{...i,value:e.get(n)})),e=>cP.createElement(cU,{...e})),[e])}function cB(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}e.s(["FiberProvider",()=>cU,"traverseFiber",()=>cI,"useContextBridge",()=>cz,"useFiber",()=>cD],46791),E.act;let ck=e=>e&&e.hasOwnProperty("current"),cV=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),cH="u">typeof window&&((null==(m=window.document)?void 0:m.createElement)||(null==(g=window.navigator)?void 0:g.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function cG(e){let t=E.useRef(e);return cH(()=>void(t.current=e),[e]),t}function cW(){let e=cD(),t=cz();return E.useMemo(()=>({children:n})=>{let i=cI(e,!0,e=>e.type===E.StrictMode)?E.StrictMode:E.Fragment;return(0,cR.jsx)(i,{children:(0,cR.jsx)(t,{children:n})})},[e,t])}function cj({set:e}){return cH(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}let cX=((v=class extends E.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}).getDerivedStateFromError=()=>({error:!0}),v);function cq(e){var t;let n="u">typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],n),e[1]):e}function cY(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}let cZ={obj:e=>e===Object(e)&&!cZ.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t,{arrays:n="shallow",objects:i="reference",strict:r=!0}={}){let a;if(typeof e!=typeof t||!!e!=!!t)return!1;if(cZ.str(e)||cZ.num(e)||cZ.boo(e))return e===t;let s=cZ.obj(e);if(s&&"reference"===i)return e===t;let o=cZ.arr(e);if(o&&"reference"===n)return e===t;if((o||s)&&e===t)return!0;for(a in e)if(!(a in t))return!1;if(s&&"shallow"===n&&"shallow"===i){for(a in r?t:e)if(!cZ.equ(e[a],t[a],{strict:r,objects:"reference"}))return!1}else for(a in r?t:e)if(e[a]!==t[a])return!1;if(cZ.und(a)){if(o&&0===e.length&&0===t.length||s&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}},cJ=["children","key","ref"];function cK(e,t,n,i){let r=null==e?void 0:e.__r3f;return!r&&(r={root:t,type:n,parent:null,children:[],props:function(e){let t={};for(let n in e)cJ.includes(n)||(t[n]=e[n]);return t}(i),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=r)),r}function c$(e,t){if(!t.includes("-")||t in e)return{root:e,key:t,target:e[t]};let n=e,i=t.split("-");for(let r of i){if("object"!=typeof n||null===n){if(void 0!==n)return{root:n,key:i.slice(i.indexOf(r)).join("-"),target:void 0};return{root:e,key:t,target:void 0}}t=r,e=n,n=n[t]}return{root:e,key:t,target:n}}let cQ=/-\d+$/;function c0(e,t){if(cZ.str(t.props.attach)){if(cQ.test(t.props.attach)){let n=t.props.attach.replace(cQ,""),{root:i,key:r}=c$(e.object,n);Array.isArray(i[r])||(i[r]=[])}let{root:n,key:i}=c$(e.object,t.props.attach);t.previousAttach=n[i],n[i]=t.object}else cZ.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function c1(e,t){if(cZ.str(t.props.attach)){let{root:n,key:i}=c$(e.object,t.props.attach),r=t.previousAttach;void 0===r?delete n[i]:n[i]=r}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}let c2=[...cJ,"args","dispose","attach","object","onUpdate","dispose"],c3=new Map,c4=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],c5=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function c6(e,t){var n,i;let r=e.__r3f,a=r&&cB(r).getState(),s=null==r?void 0:r.eventCount;for(let n in t){let s=t[n];if(c2.includes(n))continue;if(r&&c5.test(n)){"function"==typeof s?r.handlers[n]=s:delete r.handlers[n],r.eventCount=Object.keys(r.handlers).length;continue}if(void 0===s)continue;let{root:o,key:l,target:u}=c$(e,n);if(void 0===u&&("object"!=typeof o||null===o))throw Error(`R3F: Cannot set "${n}". Ensure it is an object before setting "${l}".`);u instanceof td&&s instanceof td?u.mask=s.mask:u instanceof tq&&cV(s)?u.set(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"function"==typeof u.copy&&null!=s&&s.constructor&&u.constructor===s.constructor?u.copy(s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&Array.isArray(s)?"function"==typeof u.fromArray?u.fromArray(s):u.set(...s):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"number"==typeof s?"function"==typeof u.setScalar?u.setScalar(s):u.set(s):(o[l]=s,a&&!a.linear&&c4.includes(l)&&null!=(i=o[l])&&i.isTexture&&1023===o[l].format&&1009===o[l].type&&(o[l].colorSpace=I))}if(null!=r&&r.parent&&null!=a&&a.internal&&null!=(n=r.object)&&n.isObject3D&&s!==r.eventCount){let e=r.object,t=a.internal.interaction.indexOf(e);t>-1&&a.internal.interaction.splice(t,1),r.eventCount&&null!==e.raycast&&a.internal.interaction.push(e)}return r&&void 0===r.props.attach&&(r.object.isBufferGeometry?r.props.attach="geometry":r.object.isMaterial&&(r.props.attach="material")),r&&c8(r),e}function c8(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let n=null==(t=e.root)||null==t.getState?void 0:t.getState();n&&0===n.internal.frames&&n.invalidate()}let c9=e=>null==e?void 0:e.isObject3D;function c7(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function he(e,t,n,i){let r=n.get(t);r&&(n.delete(t),0===n.size&&(e.delete(i),r.target.releasePointerCapture(i)))}let ht=e=>!!(null!=e&&e.render),hn=E.createContext(null);function hi(){let e=E.useContext(hn);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function hr(e=e=>e,t){return hi()(e,t)}function ha(e,t=0){let n=hi(),i=n.getState().internal.subscribe,r=cG(e);return cH(()=>i(r,t,n),[t,i,n]),null}let hs=new WeakMap;function ho(e,t){return function(n,...i){var r;let a;return"function"==typeof n&&(null==n||null==(r=n.prototype)?void 0:r.constructor)===n?(a=hs.get(n))||(a=new n,hs.set(n,a)):a=n,e&&e(a),Promise.all(i.map(e=>new Promise((n,i)=>a.load(e,e=>{var t;let i;c9(null==e?void 0:e.scene)&&Object.assign(e,(t=e.scene,i={nodes:{},materials:{},meshes:{}},t&&t.traverse(e=>{e.name&&(i.nodes[e.name]=e),e.material&&!i.materials[e.material.name]&&(i.materials[e.material.name]=e.material),e.isMesh&&!i.meshes[e.name]&&(i.meshes[e.name]=e)}),i)),n(e)},t,t=>i(Error(`Could not load ${e}: ${null==t?void 0:t.message}`))))))}}function hl(e,t,n,i){let r=Array.isArray(t)?t:[t],a=cA(ho(n,i),[e,...r],!1,{equal:cZ.equ});return Array.isArray(t)?a:a[0]}hl.preload=function(e,t,n){let i,r=Array.isArray(t)?t:[t];cA(ho(n),[e,...r],!0,i)},hl.clear=function(e,t){var n=[e,...Array.isArray(t)?t:[t]];if(void 0===n||0===n.length)cw.splice(0,cw.length);else{let e=cw.find(e=>cE(n,e.keys,e.equal));e&&e.remove()}};var hu={exports:{}},hc={exports:{}};hc.exports;let hh=(T||(T=1,M||(M=1,hc.exports=function(e){function t(e,t,n,i){return new iJ(e,t,n,i)}function n(){}function i(e){var t="https://react.dev/errors/"+e;if(1sT||(e.current=sM[sT],sM[sT]=null,sT--)}function h(e,t){sM[++sT]=e.current,e.current=t}function d(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function p(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=0x7ffffff&i;return 0!==o?0!=(i=o&~a)?r=d(i):0!=(s&=o)?r=d(s):n||0!=(n=o&~e)&&(r=d(n)):0!=(o=i&~a)?r=d(o):0!==s?r=d(s):n||0!=(n=i&~e)&&(r=d(n)),0===r?0:0!==t&&t!==r&&(t&a)==0&&((a=r&-r)>=(n=t&-t)||32===a&&(4194048&n)!=0)?t:r}function f(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)==0}function m(){var e=sI;return(0x3c00000&(sI<<=1))==0&&(sI=4194304),e}function g(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function v(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-sE(t);e.entangledLanes|=t,e.entanglements[i]=0x40000000|e.entanglements[i]|261930&n}function y(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-sE(n),r=1<)":-1r||l[i]!==u[r]){var c=` -`+l[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=r)break}}}finally{sY=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?T(n):""}function C(e){try{var t="",n=null;do t+=function(e,t){switch(e.tag){case 26:case 27:case 5:return T(e.type);case 16:return T("Lazy");case 13:return e.child!==t&&null!==t?T("Suspense Fallback"):T("Suspense");case 19:return T("SuspenseList");case 0:case 15:return A(e.type,!1);case 11:return A(e.type.render,!1);case 1:return A(e.type,!0);case 31:return T("Activity");default:return""}}(e,n),n=e,e=e.return;while(e)return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}function R(e,t){if("object"==typeof e&&null!==e){var n=sZ.get(e);return void 0!==n?n:(t={value:e,source:t,stack:C(t)},sZ.set(e,t),t)}return{value:e,source:t,stack:C(t)}}function P(e,t){sJ[sK++]=sQ,sJ[sK++]=s$,s$=e,sQ=t}function I(e,t,n){s0[s1++]=s3,s0[s1++]=s4,s0[s1++]=s2,s2=e;var i=s3;e=s4;var r=32-sE(i)-1;i&=~(1<>=s,r-=s,s3=1<<32-sE(t)+r|n<d?(p=h,h=null):p=h.sibling;var v=m(t,h,s[d],o);if(null===v){null===h&&(h=p);break}e&&h&&null===v.alternate&&n(t,h),i=l(v,i,d),null===c?u=v:c.sibling=v,c=v,h=p}if(d===s.length)return r(t,h),ot&&P(t,d),u;if(null===h){for(;dp?(v=d,d=null):v=d.sibling;var y=m(t,d,_.value,u);if(null===y){null===d&&(d=v);break}e&&d&&null===y.alternate&&n(t,d),s=l(y,s,p),null===h?c=y:h.sibling=y,h=y,d=v}if(_.done)return r(t,d),ot&&P(t,p),c;if(null===d){for(;!_.done;p++,_=o.next())null!==(_=f(t,_.value,u))&&(s=l(_,s,p),null===h?c=_:h.sibling=_,h=_);return ot&&P(t,p),c}for(d=a(d);!_.done;p++,_=o.next())null!==(_=g(d,t,p,_.value,u))&&(e&&null!==_.alternate&&d.delete(null===_.key?p:_.key),s=l(_,s,p),null===h?c=_:h.sibling=_,h=_);return e&&d.forEach(function(e){return n(t,e)}),ot&&P(t,p),c}(c,h,d=v.call(d),p)}if("function"==typeof d.then)return t(c,h,eM(d),p);if(d.$$typeof===rd)return t(c,h,ee(c,d),p);ew(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==h&&6===h.tag?(r(c,h.sibling),(p=s(h,d)).return=c):(r(c,h),(p=i2(d,c.mode,p)).return=c),u(c=p)):r(c,h)}(c,h,d,p);return oR=null,v}catch(e){if(e===oT||e===oE)throw e;var _=t(29,e,null,c.mode);return _.lanes=p,_.return=c,_}finally{}}}function eA(){for(var e=oU,t=oD=oU=0;ta?a:8);var s=rM.T,o={};rM.T=o,t$(e,!1,t,n);try{var l=r(),u=rM.S;if(null!==u&&u(o,l),null!==l&&"object"==typeof l&&"function"==typeof l.then){var c,h,d=(c=[],h={status:"pending",value:null,reason:null,then:function(e){c.push(e)}},l.then(function(){h.status="fulfilled",h.value=i;for(var e=0;e";case lu:return":has("+(id(e)||"")+")";case lc:return'[role="'+e.value+'"]';case ld:return'"'+e.value+'"';case lh:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function ip(e,t){var n=[];e=[e,0];for(var i=0;ilO&&(t.flags|=128,a=!0,nO(r,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=eK(s))){if(t.flags|=128,a=!0,t.updateQueue=e=e.updateQueue,nD(t,e),nO(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ot)return nF(t),null}else 2*sO()-r.renderingStartTime>lO&&0x20000000!==n&&(t.flags|=128,a=!0,nO(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=sO(),e.sibling=null,n=oH.current,h(oH,a?1&n|2:1&n),ot&&P(t,r.treeForkCount),e):(nF(t),null);case 22:case 23:return eJ(t),ej(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(0x20000000&n)!=0&&(128&t.flags)==0&&(nF(t),6&t.subtreeFlags&&(t.flags|=8192)):nF(t),null!==(n=t.updateQueue)&&nD(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&c(oM),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),q(oh),nF(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}(t.alternate,t,lT);if(null!==n){lv=n;return}if(null!==(t=t.sibling)){lv=t;return}lv=t=e}while(null!==t)0===lw&&(lw=5)}function iD(e,t){do{var n=function(e,t){switch(N(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return q(oh),O(),(65536&(e=t.flags))!=0&&(128&e)==0?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return z(t),null;case 31:if(null!==t.memoizedState){if(eJ(t),null===t.alternate)throw Error(i(340));G()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(eJ(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));G()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return c(oH),null;case 4:return O(),null;case 10:return q(t.type),null;case 22:case 23:return eJ(t),ej(),null!==e&&c(oM),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return q(oh),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,lv=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){lv=e;return}lv=e=n}while(null!==e)lw=6,lv=null}function iO(e,t,n,r,a,s,o,l,u){e.cancelPendingCommit=null;do iV();while(0!==lB)if((6&lm)!=0)throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(function(e,t,n,i,r,a){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0n?32:n;n=rM.T;var a=rq();try{rX(r),rM.T=null,r=lW,lW=null;var s=lk,o=lH;if(lB=0,lV=lk=null,lH=0,(6&lm)!=0)throw Error(i(331));var l=lm;if(lm|=4,il(s.current),it(s,s.current,o,r),lm=l,es(0,!1),sW&&"function"==typeof sW.onPostCommitFiberRoot)try{sW.onPostCommitFiberRoot(sG,s)}catch{}return!0}finally{rX(a),rM.T=n,ik(e,t)}}function iG(e,t,n){t=R(n,t),t=t9(e.stateNode,t,2),null!==(e=eO(e,t,2))&&(v(e,2),ea(e))}function iW(e,t,n){if(3===e.tag)iG(e,e,n);else for(;null!==t;){if(3===t.tag){iG(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===lz||!lz.has(i))){e=R(n,e),null!==(i=eO(t,n=t7(2),2))&&(ne(n,i,t,e),v(i,2),ea(i));break}}t=t.return}}function ij(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new lf;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(lM=!0,r.add(n),e=iX.bind(null,e,t,n),t.then(e,e))}function iX(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,lg===e&&(l_&n)===n&&(4===lw||3===lw&&(0x3c00000&l_)===l_&&300>sO()-lU?(2&lm)==0&&iT(e,0):lC|=n,lP===l_&&(lP=0)),ea(e)}function iq(e,t){0===t&&(t=m()),null!==(e=eP(e,t))&&(v(e,t),ea(e))}function iY(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iq(e,n)}function iZ(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iq(e,n)}function iJ(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function iK(e){return!(!(e=e.prototype)||!e.isReactComponent)}function i$(e,n){var i=e.alternate;return null===i?((i=t(e.tag,n,e.key,e.mode)).elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=0x3e00000&e.flags,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function iQ(e,t){e.flags&=0x3e00002;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,e.dependencies=null===(t=n.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function i0(e,n,r,a,s,o){var l=0;if(a=e,"function"==typeof e)iK(e)&&(l=1);else if("string"==typeof e)l=si&&sv?sr(e,r,s5.current)?26:sb(e)?27:5:si?sr(e,r,s5.current)?26:5:sv&&sb(e)?27:5;else o:switch(e){case r_:return(e=t(31,r,n,s)).elementType=r_,e.lanes=o,e;case rl:return i1(r.children,s,o,n);case ru:l=8,s|=24;break;case rc:return(e=t(12,r,n,2|s)).elementType=rc,e.lanes=o,e;case rf:return(e=t(13,r,n,s)).elementType=rf,e.lanes=o,e;case rm:return(e=t(19,r,n,s)).elementType=rm,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case rd:l=10;break o;case rh:l=9;break o;case rp:l=11;break o;case rg:l=14;break o;case rv:l=16,a=null;break o}l=29,r=Error(i(130,null===e?"null":typeof e,"")),a=null}return(n=t(l,r,n,s)).elementType=e,n.type=a,n.lanes=o,n}function i1(e,n,i,r){return(e=t(7,e,r,n)).lanes=i,e}function i2(e,n,i){return(e=t(6,e,null,n)).lanes=i,e}function i3(e){var n=t(18,null,null,0);return n.stateNode=e,n}function i4(e,n,i){return(n=t(4,null!==e.children?e.children:[],e.key,n)).lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function i5(e,t,n,i,r,a,s,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=rB,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=g(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=g(0),this.hiddenUpdates=g(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function i6(e,n,i,r,a,s,o,l,u,c,h,d){return e=new i5(e,n,i,o,u,c,h,d,l),n=1,!0===s&&(n|=24),s=t(3,null,null,n),e.current=s,s.stateNode=e,n=en(),n.refCount++,e.pooledCache=n,n.refCount++,s.memoizedState={element:r,isDehydrated:i,cache:n},eN(s),e}function i8(e){var t=e._reactInternals;if(void 0===t)throw"function"==typeof e.render?Error(i(188)):Error(i(268,e=Object.keys(e).join(",")));return null===(e=null!==(e=s(t))?function e(t){var n=t.tag;if(5===n||26===n||27===n||6===n)return t;for(t=t.child;null!==t;){if(null!==(n=e(t)))return n;t=t.sibling}return null}(e):null)?null:rA(e.stateNode)}function i9(e,t,n,i,r,a){r=sw,null===i.context?i.context=r:i.pendingContext=r,(i=eD(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(i.callback=a),null!==(n=eO(e,i,t))&&(i_(n,e,t),eF(n,e,t))}function i7(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n>>=0)?32:31-(sA(e)/sC|0)|0},sA=Math.log,sC=Math.LN2,sR=256,sP=262144,sI=4194304,sL=ri.unstable_scheduleCallback,sN=ri.unstable_cancelCallback,sU=ri.unstable_shouldYield,sD=ri.unstable_requestPaint,sO=ri.unstable_now,sF=ri.unstable_ImmediatePriority,sz=ri.unstable_UserBlockingPriority,sB=ri.unstable_NormalPriority,sk=ri.unstable_IdlePriority,sV=ri.log,sH=ri.unstable_setDisableYieldValue,sG=null,sW=null,sj="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},sX="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof w.default&&"function"==typeof w.default.emit)return void w.default.emit("uncaughtException",e);console.error(e)},sq=Object.prototype.hasOwnProperty,sY=!1,sZ=new WeakMap,sJ=[],sK=0,s$=null,sQ=0,s0=[],s1=0,s2=null,s3=1,s4="",s5=u(null),s6=u(null),s8=u(null),s9=u(null),s7=null,oe=null,ot=!1,on=null,oi=!1,or=Error(i(519)),oa=u(null),os=null,oo=null,ol="u">typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ou=ri.unstable_scheduleCallback,oc=ri.unstable_NormalPriority,oh={$$typeof:rd,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},od=null,op=null,of=!1,om=!1,og=!1,ov=0,o_=null,oy=0,ox=0,ob=null,oS=rM.S;rM.S=function(e,t){lD=sO(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===o_){var n=o_=[];oy=0,ox=ed(),ob={status:"pending",value:void 0,then:function(e){n.push(e)}}}oy++,t.then(ep,ep)}(0,t),null!==oS&&oS(e,t)};var oM=u(null),oT=Error(i(460)),ow=Error(i(474)),oE=Error(i(542)),oA={then:function(){}},oC=null,oR=null,oP=0,oI=eE(!0),oL=eE(!1),oN=[],oU=0,oD=0,oO=!1,oF=!1,oz=u(null),oB=u(0),ok=u(null),oV=null,oH=u(0),oG=0,oW=null,oj=null,oX=null,oq=!1,oY=!1,oZ=!1,oJ=0,oK=0,o$=null,oQ=0,o0={readContext:Q,use:tt,useCallback:e$,useContext:e$,useEffect:e$,useImperativeHandle:e$,useLayoutEffect:e$,useInsertionEffect:e$,useMemo:e$,useReducer:e$,useRef:e$,useState:e$,useDebugValue:e$,useDeferredValue:e$,useTransition:e$,useSyncExternalStore:e$,useId:e$,useHostTransitionStatus:e$,useFormState:e$,useActionState:e$,useOptimistic:e$,useMemoCache:e$,useCacheRefresh:e$};o0.useEffectEvent=e$;var o1={readContext:Q,use:tt,useCallback:function(e,t){return e8().memoizedState=[e,void 0===t?null:t],e},useContext:Q,useEffect:tI,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,tR(4194308,4,tO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tR(4194308,4,e,t)},useInsertionEffect:function(e,t){tR(4,2,e,t)},useMemo:function(e,t){var n=e8();t=void 0===t?null:t;var i=e();return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=e8();if(void 0!==n)var r=n(t);else r=t;return i.memoizedState=i.baseState=r,i.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},e=e.dispatch=tZ.bind(null,oW,e),[i.memoizedState,e]},useRef:function(e){return e8().memoizedState={current:e}},useState:function(e){var t=(e=tp(e)).queue,n=tJ.bind(null,oW,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tz,useDeferredValue:function(e,t){return tV(e8(),e,t)},useTransition:function(){var e=tp(!1);return e=tG.bind(null,oW,e.queue,!0,!1),e8().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oW,a=e8();if(ot){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===lg)throw Error(i(349));(127&l_)!=0||tl(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,tI(tc.bind(null,r,s,e),[e]),r.flags|=2048,tA(9,{destroy:void 0},tu.bind(null,r,s,n,t),null),n},useId:function(){var e=e8(),t=lg.identifierPrefix;if(ot){var n=s4,i=s3;t="_"+t+"R_"+(n=(i&~(1<<32-sE(i)-1)).toString(32)+n),0<(n=oJ++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=oQ++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tj,useFormState:tS,useActionState:tS,useOptimistic:function(e){var t=e8();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=t$.bind(null,oW,!0,n),n.dispatch=t,[e,t]},useMemoCache:tn,useCacheRefresh:function(){return e8().memoizedState=tY.bind(null,oW)},useEffectEvent:function(e){var t=e8(),n={impl:e};return t.memoizedState=n,function(){if((2&lm)!=0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},o2={readContext:Q,use:tt,useCallback:tB,useContext:Q,useEffect:tL,useImperativeHandle:tF,useInsertionEffect:tU,useLayoutEffect:tD,useMemo:tk,useReducer:tr,useRef:tC,useState:function(){return tr(ti)},useDebugValue:tz,useDeferredValue:function(e,t){return tH(e9(),oj.memoizedState,e,t)},useTransition:function(){var e=tr(ti)[0],t=e9().memoizedState;return["boolean"==typeof e?e:te(e),t]},useSyncExternalStore:to,useId:tX,useHostTransitionStatus:tj,useFormState:tM,useActionState:tM,useOptimistic:function(e,t){return tf(e9(),oj,e,t)},useMemoCache:tn,useCacheRefresh:tq};o2.useEffectEvent=tN;var o3={readContext:Q,use:tt,useCallback:tB,useContext:Q,useEffect:tL,useImperativeHandle:tF,useInsertionEffect:tU,useLayoutEffect:tD,useMemo:tk,useReducer:ts,useRef:tC,useState:function(){return ts(ti)},useDebugValue:tz,useDeferredValue:function(e,t){var n=e9();return null===oj?tV(n,e,t):tH(n,oj.memoizedState,e,t)},useTransition:function(){var e=ts(ti)[0],t=e9().memoizedState;return["boolean"==typeof e?e:te(e),t]},useSyncExternalStore:to,useId:tX,useHostTransitionStatus:tj,useFormState:tE,useActionState:tE,useOptimistic:function(e,t){var n=e9();return null!==oj?tf(n,oj,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:tn,useCacheRefresh:tq};o3.useEffectEvent=tN;var o4={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ig(),r=eD(i);r.payload=t,null!=n&&(r.callback=n),null!==(t=eO(e,r,i))&&(i_(t,e,i),eF(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ig(),r=eD(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=eO(e,r,i))&&(i_(t,e,i),eF(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ig(),i=eD(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=eO(e,i,n))&&(i_(t,e,n),eF(t,e,n))}},o5=Error(i(461)),o6=!1,o8={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},o9=!1,o7=!1,le=!1,lt="function"==typeof WeakSet?WeakSet:Set,ln=null,li=null,lr=!1,la=null,ls=8192,lo={getCacheForType:function(e){var t=Q(oh),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Q(oh).controller.signal}},ll=0,lu=1,lc=2,lh=3,ld=4;if("function"==typeof Symbol&&Symbol.for){var lp=Symbol.for;ll=lp("selector.component"),lu=lp("selector.has_pseudo_class"),lc=lp("selector.role"),lh=lp("selector.test_id"),ld=lp("selector.text")}var lf="function"==typeof WeakMap?WeakMap:Map,lm=0,lg=null,lv=null,l_=0,ly=0,lx=null,lb=!1,lS=!1,lM=!1,lT=0,lw=0,lE=0,lA=0,lC=0,lR=0,lP=0,lI=null,lL=null,lN=!1,lU=0,lD=0,lO=1/0,lF=null,lz=null,lB=0,lk=null,lV=null,lH=0,lG=0,lW=null,lj=null,lX=0,lq=null;return rt.attemptContinuousHydration=function(e){if(13===e.tag||31===e.tag){var t=eP(e,0x4000000);null!==t&&i_(t,e,0x4000000),re(e,0x4000000)}},rt.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag||31===e.tag){var t=ig(),n=eP(e,t=b(t));null!==n&&i_(n,e,t),re(e,t)}},rt.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if((e=e.stateNode).current.memoizedState.isDehydrated){var t=d(e.pendingLanes);if(0!==t){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-sE(t);e.entanglements[1]|=n,t&=~n}ea(e),(6&lm)==0&&(lO=sO()+500,es(0,!1))}}break;case 31:case 13:null!==(t=eP(e,2))&&i_(t,e,2),iS(),re(e,2)}},rt.batchedUpdates=function(e,t){return e(t)},rt.createComponentSelector=function(e){return{$$typeof:ll,value:e}},rt.createContainer=function(e,t,n,i,r,a,s,o,l,u){return i6(e,t,!1,null,n,i,a,null,s,o,l,u)},rt.createHasPseudoClassSelector=function(e){return{$$typeof:lu,value:e}},rt.createHydrationContainer=function(e,t,n,i,r,a,s,o,l,u,c,h,d,p){var f;return(e=i6(n,i,!0,e,r,a,o,p,l,u,c,h)).context=sw,n=e.current,(r=eD(i=b(i=ig()))).callback=null!=(f=t)?f:null,eO(n,r,i),t=i,e.current.lanes=t,v(e,t),ea(e),e},rt.createPortal=function(e,t,n){var i=3=c&&s>=d&&a<=h&&o<=p){e.splice(t,1);break}if(r!==c||n.width!==u.width||po){if(!(s!==d||n.height!==u.height||ha)){c>r&&(u.width+=c-r,u.x=r),hs&&(u.height+=d-s,u.y=s),pn&&(n=l)),l ")+` - -No matching component was found for: - `+e.join(" > ")}return null},rt.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return rA(e.child.stateNode);default:return e.child.stateNode}},rt.injectIntoDevTools=function(){var e={bundleType:0,version:rT,rendererPackageName:rw,currentDispatcherRef:rM,reconcilerVersion:"19.2.0"};if(null!==rE&&(e.rendererConfig=rE),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{sG=t.inject(e),sW=t}catch{}e=!!t.checkDCE}}return e},rt.isAlreadyRendering=function(){return(6&lm)!=0},rt.observeVisibleRects=function(e,t,n,r){if(!r7)throw Error(i(363));var a=as(e=im(e,t),n,r).disconnect;return{disconnect:function(){a()}}},rt.shouldError=function(){return null},rt.shouldSuspend=function(){return!1},rt.startHostTransition=function(e,t,r,a){if(5!==e.tag)throw Error(i(476));var s=tW(e).queue;tG(e,s,t,r4,null===r?n:function(){var t=tW(e);return null===t.next&&(t=e.alternate.memoizedState),tK(e,t.next.queue,{},ig()),r(a)})},rt.updateContainer=function(e,t,n,i){var r=t.current,a=ig();return i9(r,a,e,t,n,i),a},rt.updateContainerSync=function(e,t,n,i){return i9(t.current,2,e,t,n,i),2},rt},hc.exports.default=hc.exports,Object.defineProperty(hc.exports,"__esModule",{value:!0})),hu.exports=hc.exports),(b=hu.exports)&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default"))?b.default:b,hd={},hp=/^three(?=[A-Z])/,hf=e=>`${e[0].toUpperCase()}${e.slice(1)}`,hm=0;function hg(e){if("function"==typeof e){let t=`${hm++}`;return hd[t]=e,t}Object.assign(hd,e)}function hv(e,t){let n=hf(e),i=hd[n];if("primitive"!==e&&!i)throw Error(`R3F: ${n} 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"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function h_(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?c0(e.parent,e):c9(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,c8(e)}}function hy(e,t,n){let i=t.root.getState();if(e.parent||e.object===i.scene){if(!t.object){var r,a;let e=hd[hf(t.type)];t.object=null!=(r=t.props.object)?r:new e(...null!=(a=t.props.args)?a:[]),t.object.__r3f=t}if(c6(t.object,t.props),t.props.attach)c0(e,t);else if(c9(t.object)&&c9(e.object)){let i=e.object.children.indexOf(null==n?void 0:n.object);if(n&&-1!==i){let n=e.object.children.indexOf(t.object);-1!==n?(e.object.children.splice(n,1),e.object.children.splice(n{try{e.dispose()}catch{}};"u">typeof IS_REACT_ACT_ENVIRONMENT?t():(0,cC.unstable_scheduleCallback)(cC.unstable_IdlePriority,t)}}function hM(e,t,n){if(!t)return;t.parent=null;let i=e.children.indexOf(t);-1!==i&&e.children.splice(i,1),t.props.attach?c1(e,t):c9(t.object)&&c9(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,i)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(i)}),n.capturedMap.forEach((e,i)=>{he(n.capturedMap,t,e,i)})}(cB(t),t.object));let r=null!==t.props.dispose&&!1!==n;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];hM(t,n,r)}t.children.length=0,delete t.object.__r3f,r&&"primitive"!==t.type&&"Scene"!==t.object.type&&hS(t.object),void 0===n&&c8(t)}let hT=[],hw=()=>{},hE={},hA=0,hC=(S={isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,n){var i;return hv(e=hf(e)in hd?e:e.replace(hp,""),t),"primitive"===e&&null!=(i=t.object)&&i.__r3f&&delete t.object.__r3f,cK(t.object,n,e,t)},removeChild:hM,appendChild:hx,appendInitialChild:hx,insertBefore:hb,appendChildToContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&hx(n,t)},removeChildFromContainer(e,t){let n=e.getState().scene.__r3f;t&&n&&hM(n,t)},insertInContainerBefore(e,t,n){let i=e.getState().scene.__r3f;t&&n&&i&&hb(i,t,n)},getRootHostContext:()=>hE,getChildHostContext:()=>hE,commitUpdate(e,t,n,i,r){var a,s,o;hv(t,i);let l=!1;if("primitive"===e.type&&n.object!==i.object||(null==(a=i.args)?void 0:a.length)!==(null==(s=n.args)?void 0:s.length)?l=!0:null!=(o=i.args)&&o.some((e,t)=>{var i;return e!==(null==(i=n.args)?void 0:i[t])})&&(l=!0),l)hT.push([e,{...i},r]);else{let t=function(e,t){let n={};for(let i in t)if(!c2.includes(i)&&!cZ.equ(t[i],e.props[i]))for(let e in n[i]=t[i],t)e.startsWith(`${i}-`)&&(n[e]=t[e]);for(let i in e.props){if(c2.includes(i)||t.hasOwnProperty(i))continue;let{root:r,key:a}=c$(e.object,i);if(r.constructor&&0===r.constructor.length){let e=function(e){let t=c3.get(e.constructor);try{t||(t=new e.constructor,c3.set(e.constructor,t))}catch(e){}return t}(r);cZ.und(e)||(n[a]=e[a])}else n[a]=0}return n}(e,i);Object.keys(t).length&&(Object.assign(e.props,t),c6(e.object,t))}(null===r.sibling||(4&r.flags)==0)&&function(){for(let[e]of hT){let t=e.parent;if(t)for(let n of(e.props.attach?c1(t,e):c9(e.object)&&c9(t.object)&&t.object.remove(e.object),e.children))n.props.attach?c1(e,n):c9(n.object)&&c9(e.object)&&e.object.remove(n.object);e.isHidden&&h_(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&hS(e.object)}for(let[i,r,a]of hT){i.props=r;let s=i.parent;if(s){let r=hd[hf(i.type)];i.object=null!=(e=i.props.object)?e:new r(...null!=(t=i.props.args)?t:[]),i.object.__r3f=i;var e,t,n=i.object;for(let e of[a,a.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let t=e.ref(n);"function"==typeof t&&(e.refCleanup=t)}else e.ref&&(e.ref.current=n);for(let e of(c6(i.object,i.props),i.props.attach?c0(s,i):c9(i.object)&&c9(s.object)&&s.object.add(i.object),i.children))e.props.attach?c0(i,e):c9(e.object)&&c9(i.object)&&i.object.add(e.object);c8(i)}}hT.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>cK(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?c1(e.parent,e):c9(e.object)&&(e.object.visible=!1),e.isHidden=!0,c8(e)}},unhideInstance:h_,createTextInstance:hw,hideTextInstance:hw,unhideTextInstance:hw,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:E.createContext(null),setCurrentUpdatePriority(e){hA=e},getCurrentUpdatePriority:()=>hA,resolveUpdatePriority(){var e;if(0!==hA)return hA;switch("u">typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return 2;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return 8;default:return 32}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:"9.5.0",applyViewTransitionName(e,t,n){},restoreViewTransitionName(e,t){},cancelViewTransitionName(e,t,n){},cancelRootViewTransitionName(e){},restoreRootViewTransitionName(e){},InstanceMeasurement:null,measureInstance:e=>null,wasInstanceInViewport:e=>!0,hasInstanceChanged:(e,t)=>!1,hasInstanceAffectedParent:(e,t)=>!1,suspendOnActiveViewTransition(e,t){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(e){},createViewTransitionInstance:e=>null,getCurrentGestureOffset(e){throw Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance:(e,t)=>e,cloneMutableTextInstance:e=>e,cloneRootViewTransitionContainer(e){throw Error("Not implemented.")},removeRootViewTransitionClone(e,t){throw Error("Not implemented.")},createFragmentInstance:e=>null,updateFragmentInstanceFiber(e,t){},commitNewChildToFragmentInstance(e,t){},deleteChildFromFragmentInstance(e,t){},measureClonedInstance:e=>null,maySuspendCommitOnUpdate:(e,t,n)=>!1,maySuspendCommitInSyncRender:(e,t)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(e,t)=>null},(_=hh(S)).injectIntoDevTools(),_),hR=new Map,hP={objects:"shallow",strict:!1};function hI(e){var t,n;let i,r,a,s,o,l,u,c=hR.get(e),h=null==c?void 0:c.fiber,d=null==c?void 0:c.store;c&&console.warn("R3F.createRoot should only be called once!");let p="function"==typeof reportError?reportError:console.error,f=d||(t=hX,n=hq,o=(s=(a=(0,cT.createWithEqualityFn)((e,i)=>{let r,a=new ef,s=new ef,o=new ef;function l(e=i().camera,t=s,n=i().size){let{width:r,height:u,top:c,left:h}=n,d=r/u;t.isVector3?o.copy(t):o.set(...t);let p=e.getWorldPosition(a).distanceTo(o);if(e&&e.isOrthographicCamera)return{width:r/e.zoom,height:u/e.zoom,top:c,left:h,factor:1,distance:p,aspect:d};{let t=2*Math.tan(e.fov*Math.PI/180/2)*p,n=r/u*t;return{width:n,height:t,top:c,left:h,factor:r/n,distance:p,aspect:d}}}let u=t=>e(e=>({performance:{...e.performance,current:t}})),c=new ed;return{set:e,get:i,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(e=1)=>t(i(),e),advance:(e,t)=>n(e,t,i()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new sW,pointer:c,mouse:c,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=i();r&&clearTimeout(r),e.performance.current!==e.performance.min&&u(e.performance.min),r=setTimeout(()=>u(i().performance.max),e.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:l},setEvents:t=>e(e=>({...e,events:{...e.events,...t}})),setSize:(t,n,r=0,a=0)=>{let o=i().camera,u={width:t,height:n,top:r,left:a};e(e=>({size:u,viewport:{...e.viewport,...l(o,s,u)}}))},setDpr:t=>e(e=>{let n=cq(t);return{viewport:{...e.viewport,dpr:n,initialDpr:e.viewport.initialDpr||n}}}),setFrameloop:(t="always")=>{let n=i().clock;n.stop(),n.elapsedTime=0,"never"!==t&&(n.start(),n.elapsedTime=0),e(()=>({frameloop:t}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:E.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{let r=i().internal;return r.priority=r.priority+ +(t>0),r.subscribers.push({ref:e,priority:t,store:n}),r.subscribers=r.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=i().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(t>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}})).getState()).size,l=s.viewport.dpr,u=s.camera,a.subscribe(()=>{let{camera:e,size:t,viewport:n,gl:i,set:r}=a.getState();if(t.width!==o.width||t.height!==o.height||n.dpr!==l){o=t,l=n.dpr;!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(t.width/2),e.right=t.width/2,e.top=t.height/2,e.bottom=-(t.height/2)):e.aspect=t.width/t.height,e.updateProjectionMatrix());n.dpr>0&&i.setPixelRatio(n.dpr);let r="u">typeof HTMLCanvasElement&&i.domElement instanceof HTMLCanvasElement;i.setSize(t.width,t.height,r)}e!==u&&(u=e,r(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),a.subscribe(e=>t(e)),a),m=h||hC.createContainer(f,1,null,!1,null,"",p,p,p,null);c||hR.set(e,{fiber:m,store:f});let g=!1,v=null;return{async configure(t={}){var n,a;let s;v=new Promise(e=>s=e);let{gl:o,size:l,scene:u,events:c,onCreated:h,shadows:d=!1,linear:p=!1,flat:m=!1,legacy:_=!1,orthographic:y=!1,frameloop:x="always",dpr:b=[1,2],performance:S,raycaster:M,camera:T,onPointerMissed:w}=t,E=f.getState(),A=E.gl;if(!E.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},n="function"==typeof o?await o(t):o;A=ht(n)?n:new cM({...t,...o}),E.set({gl:A})}let C=E.raycaster;C||E.set({raycaster:C=new op});let{params:R,...P}=M||{};if(cZ.equ(P,C,hP)||c6(C,{...P}),cZ.equ(R,C.params,hP)||c6(C,{params:{...C.params,...R}}),!E.camera||E.camera===r&&!cZ.equ(r,T,hP)){r=T;let e=null==T?void 0:T.isCamera,t=e?T:y?new sx(0,0,0,0,.1,1e3):new nO(75,0,.1,1e3);!e&&(t.position.z=5,T&&(c6(t,T),!t.manual&&("aspect"in T||"left"in T||"right"in T||"bottom"in T||"top"in T)&&(t.manual=!0,t.updateProjectionMatrix())),E.camera||null!=T&&T.rotation||t.lookAt(0,0,0)),E.set({camera:t}),C.camera=t}if(!E.scene){let e;null!=u&&u.isScene?cK(e=u,f,"",{}):(cK(e=new nj,f,"",{}),u&&c6(e,u)),E.set({scene:e})}c&&!E.events.handlers&&E.set({events:c(f)});let N=function(e,t){if(!t&&"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:n,top:i,left:r}=e.parentElement.getBoundingClientRect();return{width:t,height:n,top:i,left:r}}return!t&&"u">typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,l);if(cZ.equ(N,E.size,hP)||E.setSize(N.width,N.height,N.top,N.left),b&&E.viewport.dpr!==cq(b)&&E.setDpr(b),E.frameloop!==x&&E.setFrameloop(x),E.onPointerMissed||E.set({onPointerMissed:w}),S&&!cZ.equ(S,E.performance,hP)&&E.set(e=>({performance:{...e.performance,...S}})),!E.xr){let e=(e,t)=>{let n=f.getState();"never"!==n.frameloop&&hq(e,!0,n,t)},t=()=>{let t=f.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||hX(t)},i={connect(){let e=f.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=f.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(n=A.xr)?void 0:n.addEventListener)&&i.connect(),E.set({xr:i})}if(A.shadowMap){let e=A.shadowMap.enabled,t=A.shadowMap.type;A.shadowMap.enabled=!!d,cZ.boo(d)?A.shadowMap.type=2:cZ.str(d)?A.shadowMap.type=null!=(a=({basic:0,percentage:1,soft:2,variance:3})[d])?a:2:cZ.obj(d)&&Object.assign(A.shadowMap,d),(e!==A.shadowMap.enabled||t!==A.shadowMap.type)&&(A.shadowMap.needsUpdate=!0)}return eb.enabled=!_,g||(A.outputColorSpace=p?L:I,A.toneMapping=4*!m),E.legacy!==_&&E.set(()=>({legacy:_})),E.linear!==p&&E.set(()=>({linear:p})),E.flat!==m&&E.set(()=>({flat:m})),!o||cZ.fun(o)||ht(o)||cZ.equ(o,A,hP)||c6(A,o),i=h,g=!0,s(),this},render(t){return g||v||this.configure(),v.then(()=>{hC.updateContainer((0,cR.jsx)(hL,{store:f,children:t,onCreated:i,rootElement:e}),m,null,()=>void 0)}),f},unmount(){hN(e)}}}function hL({store:e,children:t,onCreated:n,rootElement:i}){return cH(()=>{let t=e.getState();t.set(e=>({internal:{...e.internal,active:!0}})),n&&n(t),e.getState().events.connected||null==t.events.connect||t.events.connect(i)},[]),(0,cR.jsx)(hn.Provider,{value:e,children:t})}function hN(e,t){let n=hR.get(e),i=null==n?void 0:n.fiber;if(i){let r=null==n?void 0:n.store.getState();r&&(r.internal.active=!1),hC.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{null==r.events.disconnect||r.events.disconnect(),null==(n=r.gl)||null==(i=n.renderLists)||null==i.dispose||i.dispose(),null==(a=r.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(s=r.gl)&&s.xr&&r.xr.disconnect();var n,i,a,s,o=r.scene;for(let e in"Scene"!==o.type&&(null==o.dispose||o.dispose()),o){let t=o[e];(null==t?void 0:t.type)!=="Scene"&&(null==t||null==t.dispose||t.dispose())}hR.delete(e),t&&t(e)}catch(e){}},500)})}}function hU(e,t){let n={callback:e};return t.add(n),()=>void t.delete(n)}let hD=new Set,hO=new Set,hF=new Set,hz=e=>hU(e,hD),hB=e=>hU(e,hO);function hk(e,t){if(e.size)for(let{callback:n}of e.values())n(t)}function hV(e,t){switch(e){case"before":return hk(hD,t);case"after":return hk(hO,t);case"tail":return hk(hF,t)}}function hH(e,t,n){let i=t.clock.getDelta();"never"===t.frameloop&&"number"==typeof e&&(i=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),s=t.internal.subscribers;for(let e=0;e0)&&!(null!=(t=c.gl.xr)&&t.isPresenting)&&(l+=hH(e,c))}if(hW=!1,hV("after",e),0===l)return hV("tail",e),hG=!1,cancelAnimationFrame(u)}function hX(e,t=1){var n;if(!e)return hR.forEach(e=>hX(e.store.getState(),t));(null==(n=e.gl.xr)||!n.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(t>1?e.internal.frames=Math.min(60,e.internal.frames+t):hW?e.internal.frames=2:e.internal.frames=1,hG||(hG=!0,requestAnimationFrame(hj)))}function hq(e,t=!0,n,i){if(t&&hV("before",e),n)hH(e,n,i);else for(let t of hR.values())hH(e,t.store.getState());t&&hV("after",e)}let hY={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 hZ(e){let{handlePointer:t}=function(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))}function n(t){let{internal:n}=e.getState();for(let e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let i=e.eventObject.__r3f;if(n.hovered.delete(c7(e)),null!=i&&i.eventCount){let n=i.handlers,r={...e,intersections:t};null==n.onPointerOut||n.onPointerOut(r),null==n.onPointerLeave||n.onPointerLeave(r)}}}function i(e,t){for(let n=0;nn([]);case"onLostPointerCapture":return t=>{let{internal:i}=e.getState();"pointerId"in t&&i.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{i.capturedMap.has(t.pointerId)&&(i.capturedMap.delete(t.pointerId),n([]))})}}return function(a){let{onPointerMissed:s,internal:o}=e.getState();o.lastEvent.current=a;let l="onPointerMove"===r,u="onClick"===r||"onContextMenu"===r||"onDoubleClick"===r,c=function(t,n){let i=e.getState(),r=new Set,a=[],s=n?n(i.internal.interaction):i.internal.interaction;for(let e=0;e{let n=cY(e.object),i=cY(t.object);return n&&i&&i.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{let t=c7(e);return!r.has(t)&&(r.add(t),!0)});for(let e of(i.events.filter&&(o=i.events.filter(o,i)),o)){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&i.internal.capturedMap.has(t.pointerId))for(let e of i.internal.capturedMap.get(t.pointerId).values())r.has(c7(e.intersection))||a.push(e.intersection);return a}(a,l?t:void 0),h=u?function(t){let{internal:n}=e.getState(),i=t.offsetX-n.initialClick[0],r=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(i*i+r*r))}(a):0;"onPointerDown"===r&&(o.initialClick=[a.offsetX,a.offsetY],o.initialHits=c.map(e=>e.eventObject)),u&&!c.length&&h<=2&&(i(a,o.interaction),s&&s(a)),l&&n(c),!function(e,t,i,r){if(e.length){let a={stopped:!1};for(let s of e){let o=cY(s.object);if(o||s.object.traverseAncestors(e=>{let t=cY(e);if(t)return o=t,!1}),o){let{raycaster:l,pointer:u,camera:c,internal:h}=o,d=new ef(u.x,u.y,0).unproject(c),p=e=>{var t,n;return null!=(t=null==(n=h.capturedMap.get(e))?void 0:n.has(s.eventObject))&&t},f=e=>{let n={intersection:s,target:t.target};h.capturedMap.has(e)?h.capturedMap.get(e).set(s.eventObject,n):h.capturedMap.set(e,new Map([[s.eventObject,n]])),t.target.setPointerCapture(e)},m=e=>{let t=h.capturedMap.get(e);t&&he(h.capturedMap,s.eventObject,t,e)},g={};for(let e in t){let n=t[e];"function"!=typeof n&&(g[e]=n)}let v={...s,...g,pointer:u,intersections:e,stopped:a.stopped,delta:i,unprojectedPoint:d,ray:l.ray,camera:c,stopPropagation(){let i="pointerId"in t&&h.capturedMap.get(t.pointerId);(!i||i.has(s.eventObject))&&(v.stopped=a.stopped=!0,h.hovered.size&&Array.from(h.hovered.values()).find(e=>e.eventObject===s.eventObject)&&n([...e.slice(0,e.indexOf(s)),s]))},target:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},currentTarget:{hasPointerCapture:p,setPointerCapture:f,releasePointerCapture:m},nativeEvent:t};if(r(v),!0===a.stopped)break}}}}(c,a,h,function(e){let t=e.eventObject,n=t.__r3f;if(!(null!=n&&n.eventCount))return;let s=n.handlers;if(l){if(s.onPointerOver||s.onPointerEnter||s.onPointerOut||s.onPointerLeave){let t=c7(e),n=o.hovered.get(t);n?n.stopped&&e.stopPropagation():(o.hovered.set(t,e),null==s.onPointerOver||s.onPointerOver(e),null==s.onPointerEnter||s.onPointerEnter(e))}null==s.onPointerMove||s.onPointerMove(e)}else{let n=s[r];n?(!u||o.initialHits.includes(t))&&(i(a,o.interaction.filter(e=>!o.initialHits.includes(e))),n(e)):u&&o.initialHits.includes(t)&&i(a,o.interaction.filter(e=>!o.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-(2*(e.offsetY/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(hY).reduce((e,n)=>({...e,[n]:t(n)}),{}),update:()=>{var t;let{events:n,internal:i}=e.getState();null!=(t=i.lastEvent)&&t.current&&n.handlers&&n.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{let{set:n,events:i}=e.getState();if(null==i.disconnect||i.disconnect(),n(e=>({events:{...e.events,connected:t}})),i.handlers)for(let e in i.handlers){let n=i.handlers[e],[r,a]=hY[e];t.addEventListener(r,n,{passive:a})}},disconnect:()=>{let{set:t,events:n}=e.getState();if(n.connected){if(n.handlers)for(let e in n.handlers){let t=n.handlers[e],[i]=hY[e];n.connected.removeEventListener(i,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}e.s(["B",()=>cj,"C",()=>hr,"D",()=>ha,"E",()=>cX,"G",()=>hl,"a",()=>cG,"b",()=>cH,"c",()=>hI,"d",()=>hN,"e",()=>hg,"f",()=>hZ,"i",()=>ck,"j",()=>hz,"k",()=>hB,"u",()=>cW],40859)},15080,e=>{"use strict";var t=e.i(40859);e.s(["useThree",()=>t.C])},71753,e=>{"use strict";var t=e.i(40859);e.s(["useFrame",()=>t.D])},79123,e=>{"use strict";var t=e.i(43476),n=e.i(71645);let i=(0,n.createContext)(null),r=(0,n.createContext)(null),a=(0,n.createContext)(null);function s(){return(0,n.useContext)(i)}function o(){return(0,n.useContext)(r)}function l(){return(0,n.useContext)(a)}function u({children:e,fogEnabledOverride:s,onClearFogEnabledOverride:o}){let[l,u]=(0,n.useState)(!0),[c,h]=(0,n.useState)(!1),[d,p]=(0,n.useState)(1),[f,m]=(0,n.useState)(90),[g,v]=(0,n.useState)(!1),[_,y]=(0,n.useState)(!0),[x,b]=(0,n.useState)(!1),[S,M]=(0,n.useState)("moveLookStick"),[T,w]=(0,n.useState)("MapGenius"),E=(0,n.useCallback)(e=>{u(e),o()},[o]),A=(0,n.useMemo)(()=>({fogEnabled:s??l,setFogEnabled:E,highQualityFog:c,setHighQualityFog:h,fov:f,setFov:m,audioEnabled:g,setAudioEnabled:v,animationEnabled:_,setAnimationEnabled:y,warriorName:T,setWarriorName:w}),[l,s,E,c,f,g,_,T]),C=(0,n.useMemo)(()=>({debugMode:x,setDebugMode:b}),[x,b]),R=(0,n.useMemo)(()=>({speedMultiplier:d,setSpeedMultiplier:p,touchMode:S,setTouchMode:M}),[d,p,S,M]);(0,n.useLayoutEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&b(e.debugMode),null!=e.audioEnabled&&v(e.audioEnabled),null!=e.animationEnabled&&y(e.animationEnabled),null!=e.fogEnabled&&u(e.fogEnabled),null!=e.highQualityFog&&h(e.highQualityFog),null!=e.speedMultiplier&&p(e.speedMultiplier),null!=e.fov&&m(e.fov),null!=e.touchMode&&M(e.touchMode),null!=e.warriorName&&w(e.warriorName)},[]);let P=(0,n.useRef)(null);return(0,n.useEffect)(()=>(P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:l,highQualityFog:c,speedMultiplier:d,fov:f,audioEnabled:g,animationEnabled:_,debugMode:x,touchMode:S,warriorName:T}))}catch(e){}},500),()=>{P.current&&clearTimeout(P.current)}),[l,c,d,f,g,_,x,S,T]),(0,t.jsx)(i.Provider,{value:A,children:(0,t.jsx)(r.Provider,{value:C,children:(0,t.jsx)(a.Provider,{value:R,children:e})})})}e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>s])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/88a5cf0ea7f16af4.js b/docs/_next/static/chunks/88a5cf0ea7f16af4.js deleted file mode 100644 index d59879d0..00000000 --- a/docs/_next/static/chunks/88a5cf0ea7f16af4.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85413,e=>{"use strict";var t=Object.defineProperty;class i{constructor(){((e,i,s)=>{let r,n;n=void 0,(r="symbol"!=typeof i?i+"":i)in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,s=i.length;ti])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/b00acbf8afd8b4b6.js b/docs/_next/static/chunks/9236f2f78e6373a1.js similarity index 75% rename from docs/_next/static/chunks/b00acbf8afd8b4b6.js rename to docs/_next/static/chunks/9236f2f78e6373a1.js index 69c0d1e3..f46182fd 100644 --- a/docs/_next/static/chunks/b00acbf8afd8b4b6.js +++ b/docs/_next/static/chunks/9236f2f78e6373a1.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,99140,e=>{e.v({AnimationItem:"page-module__v6zvCa__AnimationItem",AnimationList:"page-module__v6zvCa__AnimationList",AnimationName:"page-module__v6zvCa__AnimationName",CanvasContainer:"page-module__v6zvCa__CanvasContainer",CheckboxField:"page-module__v6zvCa__CheckboxField",ClipName:"page-module__v6zvCa__ClipName",CyclicIcon:"page-module__v6zvCa__CyclicIcon",LoadingIndicator:"page-module__v6zvCa__LoadingIndicator",PlayButton:"page-module__v6zvCa__PlayButton",SectionLabel:"page-module__v6zvCa__SectionLabel",Sidebar:"page-module__v6zvCa__Sidebar",SidebarSection:"page-module__v6zvCa__SidebarSection",Spinner:"page-module__v6zvCa__Spinner",loadingComplete:"page-module__v6zvCa__loadingComplete",spin:"page-module__v6zvCa__spin"})},39724,e=>{"use strict";var t,n=e.i(43476),a=e.i(932),o=e.i(71645),r=e.i(75056),i=e.i(90072),s=e.i(17751),c=e.i(12598),l=e.i(31067),u=e.i(15080),m=e.i(71753),p=e.i(85413),d=Object.defineProperty,h=(e,t,n)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?d(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,n};let f=new i.Ray,b=new i.Plane,g=Math.cos(Math.PI/180*70),v=(e,t)=>(e%t+t)%t;class y extends p.EventDispatcher{constructor(e,t){super(),h(this,"object"),h(this,"domElement"),h(this,"enabled",!0),h(this,"target",new i.Vector3),h(this,"minDistance",0),h(this,"maxDistance",1/0),h(this,"minZoom",0),h(this,"maxZoom",1/0),h(this,"minPolarAngle",0),h(this,"maxPolarAngle",Math.PI),h(this,"minAzimuthAngle",-1/0),h(this,"maxAzimuthAngle",1/0),h(this,"enableDamping",!1),h(this,"dampingFactor",.05),h(this,"enableZoom",!0),h(this,"zoomSpeed",1),h(this,"enableRotate",!0),h(this,"rotateSpeed",1),h(this,"enablePan",!0),h(this,"panSpeed",1),h(this,"screenSpacePanning",!0),h(this,"keyPanSpeed",7),h(this,"zoomToCursor",!1),h(this,"autoRotate",!1),h(this,"autoRotateSpeed",2),h(this,"reverseOrbit",!1),h(this,"reverseHorizontalOrbit",!1),h(this,"reverseVerticalOrbit",!1),h(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),h(this,"mouseButtons",{LEFT:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN}),h(this,"touches",{ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN}),h(this,"target0"),h(this,"position0"),h(this,"zoom0"),h(this,"_domElementKeyEvents",null),h(this,"getPolarAngle"),h(this,"getAzimuthalAngle"),h(this,"setPolarAngle"),h(this,"setAzimuthalAngle"),h(this,"getDistance"),h(this,"getZoomScale"),h(this,"listenToKeyEvents"),h(this,"stopListenToKeyEvents"),h(this,"saveState"),h(this,"reset"),h(this,"update"),h(this,"connect"),h(this,"dispose"),h(this,"dollyIn"),h(this,"dollyOut"),h(this,"getScale"),h(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=e=>{let t=v(e,2*Math.PI),a=u.phi;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-o{let t=v(e,2*Math.PI),a=u.theta;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-on.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",ee),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ee),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(a),n.update(),c=s.NONE},this.update=(()=>{let t=new i.Vector3,o=new i.Vector3(0,1,0),r=new i.Quaternion().setFromUnitVectors(e.up,o),h=r.clone().invert(),v=new i.Vector3,y=new i.Quaternion,x=2*Math.PI;return function(){let E=n.object.position;r.setFromUnitVectors(e.up,o),h.copy(r).invert(),t.copy(E).sub(n.target),t.applyQuaternion(r),u.setFromVector3(t),n.autoRotate&&c===s.NONE&&R(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(u.theta+=m.theta*n.dampingFactor,u.phi+=m.phi*n.dampingFactor):(u.theta+=m.theta,u.phi+=m.phi);let S=n.minAzimuthAngle,j=n.maxAzimuthAngle;isFinite(S)&&isFinite(j)&&(S<-Math.PI?S+=x:S>Math.PI&&(S-=x),j<-Math.PI?j+=x:j>Math.PI&&(j-=x),S<=j?u.theta=Math.max(S,Math.min(j,u.theta)):u.theta=u.theta>(S+j)/2?Math.max(S,u.theta):Math.min(j,u.theta)),u.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,u.phi)),u.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.zoomToCursor&&A||n.object.isOrthographicCamera?u.radius=U(u.radius):u.radius=U(u.radius*p),t.setFromSpherical(u),t.applyQuaternion(h),E.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),!0===n.enableDamping?(m.theta*=1-n.dampingFactor,m.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(m.set(0,0,0),d.set(0,0,0));let C=!1;if(n.zoomToCursor&&A){let a=null;if(n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let e=t.length();a=U(e*p);let o=e-a;n.object.position.addScaledVector(w,o),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new i.Vector3(N.x,N.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),C=!0;let o=new i.Vector3(N.x,N.y,0);o.unproject(n.object),n.object.position.sub(o).add(e),n.object.updateMatrixWorld(),a=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==a&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(a).add(n.object.position):(f.origin.copy(n.object.position),f.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(f.direction))l||8*(1-y.dot(n.object.quaternion))>l)&&(n.dispatchEvent(a),v.copy(n.object.position),y.copy(n.object.quaternion),C=!1,!0)}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",et),n.domElement.addEventListener("pointerdown",G),n.domElement.addEventListener("pointercancel",$),n.domElement.addEventListener("wheel",J)},this.dispose=()=>{var e,t,a,o,r,i;n.domElement&&(n.domElement.style.touchAction="auto"),null==(e=n.domElement)||e.removeEventListener("contextmenu",et),null==(t=n.domElement)||t.removeEventListener("pointerdown",G),null==(a=n.domElement)||a.removeEventListener("pointercancel",$),null==(o=n.domElement)||o.removeEventListener("wheel",J),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",Q),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",$),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",ee)};const n=this,a={type:"change"},o={type:"start"},r={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=s.NONE;const l=1e-6,u=new i.Spherical,m=new i.Spherical;let p=1;const d=new i.Vector3,y=new i.Vector2,x=new i.Vector2,E=new i.Vector2,S=new i.Vector2,j=new i.Vector2,C=new i.Vector2,P=new i.Vector2,T=new i.Vector2,_=new i.Vector2,w=new i.Vector3,N=new i.Vector2;let A=!1;const O=[],M={};function L(){return Math.pow(.95,n.zoomSpeed)}function R(e){n.reverseOrbit||n.reverseHorizontalOrbit?m.theta+=e:m.theta-=e}function z(e){n.reverseOrbit||n.reverseVerticalOrbit?m.phi+=e:m.phi-=e}const I=(()=>{let e=new i.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),d.add(e)}})(),k=(()=>{let e=new i.Vector3;return function(t,a){!0===n.screenSpacePanning?e.setFromMatrixColumn(a,1):(e.setFromMatrixColumn(a,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),d.add(e)}})(),V=(()=>{let e=new i.Vector3;return function(t,a){let o=n.domElement;if(o&&n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let r=n.object.position;e.copy(r).sub(n.target);let i=e.length();I(2*t*(i*=Math.tan(n.object.fov/2*Math.PI/180))/o.clientHeight,n.object.matrix),k(2*a*i/o.clientHeight,n.object.matrix)}else o&&n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?(I(t*(n.object.right-n.object.left)/n.object.zoom/o.clientWidth,n.object.matrix),k(a*(n.object.top-n.object.bottom)/n.object.zoom/o.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function D(e){n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?p=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function F(e){if(!n.zoomToCursor||!n.domElement)return;A=!0;let t=n.domElement.getBoundingClientRect(),a=e.clientX-t.left,o=e.clientY-t.top,r=t.width,i=t.height;N.x=a/r*2-1,N.y=-(o/i*2)+1,w.set(N.x,N.y,1).unproject(n.object).sub(n.object.position).normalize()}function U(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function Y(e){y.set(e.clientX,e.clientY)}function H(e){S.set(e.clientX,e.clientY)}function Z(){if(1==O.length)y.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);y.set(e,t)}}function B(){if(1==O.length)S.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);S.set(e,t)}}function K(){let e=O[0].pageX-O[1].pageX,t=O[0].pageY-O[1].pageY,n=Math.sqrt(e*e+t*t);P.set(0,n)}function X(e){if(1==O.length)x.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);x.set(n,a)}E.subVectors(x,y).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x)}function W(e){if(1==O.length)j.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);j.set(n,a)}C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j)}function q(e){var t;let a=ea(e),o=e.pageX-a.x,r=e.pageY-a.y,i=Math.sqrt(o*o+r*r);T.set(0,i),_.set(0,Math.pow(T.y/P.y,n.zoomSpeed)),t=_.y,D(p/t),P.copy(T)}function G(e){var t,a,r;!1!==n.enabled&&(0===O.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",Q),null==(a=n.domElement)||a.ownerDocument.addEventListener("pointerup",$)),r=e,O.push(r),"touch"===e.pointerType?function(e){switch(en(e),O.length){case 1:switch(n.touches.ONE){case i.TOUCH.ROTATE:if(!1===n.enableRotate)return;Z(),c=s.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(!1===n.enablePan)return;B(),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(n.touches.TWO){case i.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&K(),n.enablePan&&B(),c=s.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&K(),n.enableRotate&&Z(),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case i.MOUSE.DOLLY:if(!1===n.enableZoom)return;F(e),P.set(e.clientX,e.clientY),c=s.DOLLY;break;case i.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;H(e),c=s.PAN}else{if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}break;case i.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}else{if(!1===n.enablePan)return;H(e),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e))}function Q(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(en(e),c){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;X(e),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;W(e),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&q(e),n.enablePan&&W(e),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&q(e),n.enableRotate&&X(e),n.update();break;default:c=s.NONE}}(e):function(e){if(!1!==n.enabled)switch(c){case s.ROTATE:let t;if(!1===n.enableRotate)return;x.set(e.clientX,e.clientY),E.subVectors(x,y).multiplyScalar(n.rotateSpeed),(t=n.domElement)&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x),n.update();break;case s.DOLLY:var a,o;if(!1===n.enableZoom)return;(T.set(e.clientX,e.clientY),_.subVectors(T,P),_.y>0)?(a=L(),D(p/a)):_.y<0&&(o=L(),D(p*o)),P.copy(T),n.update();break;case s.PAN:if(!1===n.enablePan)return;j.set(e.clientX,e.clientY),C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j),n.update()}}(e))}function $(e){var t,a,o;(function(e){delete M[e.pointerId];for(let t=0;t0&&(a=L(),D(p/a)),n.update(),n.dispatchEvent(r)}}function ee(e){if(!1!==n.enabled&&!1!==n.enablePan){let t=!1;switch(e.code){case n.keys.UP:V(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}}function et(e){!1!==n.enabled&&e.preventDefault()}function en(e){let t=M[e.pointerId];void 0===t&&(t=new i.Vector2,M[e.pointerId]=t),t.set(e.pageX,e.pageY)}function ea(e){return M[(e.pointerId===O[0].pointerId?O[1]:O[0]).pointerId]}this.dollyIn=(e=L())=>{D(p*e),n.update()},this.dollyOut=(e=L())=>{D(p/e),n.update()},this.getScale=()=>p,this.setScale=e=>{D(e),n.update()},this.getZoomScale=()=>L(),void 0!==t&&this.connect(t),this.update()}}let x=o.forwardRef(({makeDefault:e,camera:t,regress:n,domElement:a,enableDamping:r=!0,keyEvents:i=!1,onChange:s,onStart:c,onEnd:p,...d},h)=>{let f=(0,u.useThree)(e=>e.invalidate),b=(0,u.useThree)(e=>e.camera),g=(0,u.useThree)(e=>e.gl),v=(0,u.useThree)(e=>e.events),x=(0,u.useThree)(e=>e.setEvents),E=(0,u.useThree)(e=>e.set),S=(0,u.useThree)(e=>e.get),j=(0,u.useThree)(e=>e.performance),C=t||b,P=a||v.connected||g.domElement,T=o.useMemo(()=>new y(C),[C]);return(0,m.useFrame)(()=>{T.enabled&&T.update()},-1),o.useEffect(()=>(i&&T.connect(!0===i?P:i),T.connect(P),()=>void T.dispose()),[i,P,n,T,f]),o.useEffect(()=>{let e=e=>{f(),n&&j.regress(),s&&s(e)},t=e=>{c&&c(e)},a=e=>{p&&p(e)};return T.addEventListener("change",e),T.addEventListener("start",t),T.addEventListener("end",a),()=>{T.removeEventListener("start",t),T.removeEventListener("end",a),T.removeEventListener("change",e)}},[s,c,p,T,f,x]),o.useEffect(()=>{if(e){let e=S().controls;return E({controls:T}),()=>E({controls:e})}},[e,T]),o.createElement("primitive",(0,l.default)({ref:h,object:T,enableDamping:r},d))}),E=o.forwardRef(function({children:e,object:t,disable:n,disableX:a,disableY:r,disableZ:s,left:c,right:u,top:m,bottom:p,front:d,back:h,onCentered:f,precise:b=!0,cacheKey:g=0,...v},y){let x=o.useRef(null),E=o.useRef(null),S=o.useRef(null),[j]=o.useState(()=>new i.Box3),[C]=o.useState(()=>new i.Vector3),[P]=o.useState(()=>new i.Sphere);return o.useLayoutEffect(()=>{E.current.matrixWorld.identity(),j.setFromObject(null!=t?t:S.current,b);let e=j.max.x-j.min.x,o=j.max.y-j.min.y,i=j.max.z-j.min.z;j.getCenter(C),j.getBoundingSphere(P);let l=m?o/2:p?-o/2:0,g=c?-e/2:u?e/2:0,v=d?i/2:h?-i/2:0;E.current.position.set(n||a?0:-C.x+g,n||r?0:-C.y+l,n||s?0:-C.z+v),null==f||f({parent:x.current.parent,container:x.current,width:e,height:o,depth:i,boundingBox:j,boundingSphere:P,center:C,verticalAlignment:l,horizontalAlignment:g,depthAlignment:v})},[g,f,m,c,d,n,a,r,s,t,b,u,p,h,j,C,P]),o.useImperativeHandle(y,()=>x.current,[]),o.createElement("group",(0,l.default)({ref:x},v),o.createElement("group",{ref:E},o.createElement("group",{ref:S},e)))});var S=((t=S||{})[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t);let j=e=>1-Math.exp(-5*e)+.007*e,C=o.createContext(null);function P({children:e,maxDuration:t=1,margin:n=1.2,observe:a,fit:r,clip:s,interpolateFunc:c=j,onFit:l}){let p=o.useRef(null),{camera:d,size:h,invalidate:f}=(0,u.useThree)(),b=(0,u.useThree)(e=>e.controls),g=o.useRef(l);g.current=l;let v=o.useRef({camPos:new i.Vector3,camRot:new i.Quaternion,camZoom:1}),y=o.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),x=o.useRef(S.NONE),E=o.useRef(0),[P]=o.useState(()=>new i.Box3),T=o.useMemo(()=>{function e(){let e=P.getSize(new i.Vector3),t=P.getCenter(new i.Vector3),a=Math.max(e.x,e.y,e.z),o=d&&d.isOrthographicCamera?4*a:a/(2*Math.atan(Math.PI*d.fov/360)),r=d&&d.isOrthographicCamera?4*a:o/d.aspect;return{box:P,size:e,center:t,distance:n*Math.max(o,r)}}return{getSize:e,refresh(e){if(e&&e.isBox3)P.copy(e);else{let t=e||p.current;if(!t)return this;t.updateWorldMatrix(!0,!0),P.setFromObject(t)}if(P.isEmpty()){let e=d.position.length()||10;P.setFromCenterAndSize(new i.Vector3,new i.Vector3(e,e,e))}return v.current.camPos.copy(d.position),v.current.camRot.copy(d.quaternion),d&&d.isOrthographicCamera&&(v.current.camZoom=d.zoom),y.current.camPos=void 0,y.current.camRot=void 0,y.current.camZoom=void 0,y.current.camUp=void 0,y.current.target=void 0,this},reset(){let{center:t,distance:n}=e(),a=d.position.clone().sub(t).normalize();y.current.camPos=t.clone().addScaledVector(a,n),y.current.target=t.clone();let o=new i.Matrix4().lookAt(y.current.camPos,y.current.target,d.up);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(o),x.current=S.START,E.current=0,this},moveTo(e){return y.current.camPos=Array.isArray(e)?new i.Vector3(...e):e.clone(),x.current=S.START,E.current=0,this},lookAt({target:e,up:t}){y.current.target=Array.isArray(e)?new i.Vector3(...e):e.clone(),t?y.current.camUp=Array.isArray(t)?new i.Vector3(...t):t.clone():y.current.camUp=d.up.clone();let n=new i.Matrix4().lookAt(y.current.camPos||d.position,y.current.target,y.current.camUp);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(n),x.current=S.START,E.current=0,this},to({position:e,target:t}){return this.moveTo(e).lookAt({target:t})},fit(){if(!(d&&d.isOrthographicCamera))return this.reset();let e=0,t=0,a=[new i.Vector3(P.min.x,P.min.y,P.min.z),new i.Vector3(P.min.x,P.max.y,P.min.z),new i.Vector3(P.min.x,P.min.y,P.max.z),new i.Vector3(P.min.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.min.z),new i.Vector3(P.max.x,P.min.y,P.max.z),new i.Vector3(P.max.x,P.min.y,P.min.z)],o=y.current.camPos||d.position,r=y.current.target||(null==b?void 0:b.target),s=y.current.camUp||d.up,c=r?new i.Matrix4().lookAt(o,r,s).setPosition(o).invert():d.matrixWorldInverse;for(let n of a)n.applyMatrix4(c),e=Math.max(e,Math.abs(n.y)),t=Math.max(t,Math.abs(n.x));e*=2,t*=2;let l=(d.top-d.bottom)/e,u=(d.right-d.left)/t;return y.current.camZoom=Math.min(l,u)/n,x.current=S.START,E.current=0,g.current&&g.current(this.getSize()),this},clip(){let{distance:t}=e();return d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),b&&(b.maxDistance=10*t,b.update()),f(),this}}},[P,d,b,n,f]);o.useLayoutEffect(()=>{if(b){let e=()=>{if(b&&y.current.target&&x.current!==S.NONE){let e=new i.Vector3().setFromMatrixColumn(d.matrix,2),t=v.current.camPos.distanceTo(b.target),n=(y.current.camPos||v.current.camPos).distanceTo(y.current.target),a=(1-E.current)*t+E.current*n;b.target.copy(d.position).addScaledVector(e,-a),b.update()}x.current=S.NONE};return b.addEventListener("start",e),()=>b.removeEventListener("start",e)}},[b]);let _=o.useRef(0);return o.useLayoutEffect(()=>{(a||0==_.current++)&&(T.refresh(),r&&T.reset().fit(),s&&T.clip())},[h,s,r,a,d,b]),(0,m.useFrame)((e,n)=>{if(x.current===S.START)x.current=S.ACTIVE,f();else if(x.current===S.ACTIVE){if(E.current+=n/t,E.current>=1)y.current.camPos&&d.position.copy(y.current.camPos),y.current.camRot&&d.quaternion.copy(y.current.camRot),y.current.camUp&&d.up.copy(y.current.camUp),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix(),b&&y.current.target&&(b.target.copy(y.current.target),b.update()),x.current=S.NONE;else{let e=c(E.current);y.current.camPos&&d.position.lerpVectors(v.current.camPos,y.current.camPos,e),y.current.camRot&&d.quaternion.slerpQuaternions(v.current.camRot,y.current.camRot,e),y.current.camUp&&d.up.set(0,1,0).applyQuaternion(d.quaternion),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=(1-e)*v.current.camZoom+e*y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix()}f()}}),o.createElement("group",{ref:p},o.createElement(C.Provider,{value:T},e))}var T=e.i(79123),_=e.i(91907),w=e.i(25947),N=e.i(86855),A=e.i(51475),O=e.i(11889),M=e.i(56373),L=e.i(86447),R=e.i(1559),z=e.i(78440),I=e.i(59129),k=e.i(25998),V=e.i(18364),D=e.i(70238),F=e.i(91996),U=e.i(29402),Y=e.i(97442);let H={"shapes.vl2":"Shapes","TR2final105-client.vl2":"Team Rabbit 2"},Z=(0,F.getResourceList)().filter(e=>e.startsWith("shapes/")&&e.endsWith(".dts")).map(e=>{let[t,n]=(0,F.getSourceAndPath)(e),a=n.split("/").pop()??n,o=H[t]??(t||"Loose");return{resourceKey:e,displayName:a,shapeName:a,sourcePath:t,groupName:o}}),B=new Map(Z.map(e=>[e.shapeName,e])),K=function(e){let t=new Map;for(let n of e){let e=t.get(n.groupName)??[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,n)=>{t.set(n,(0,U.default)(e,[e=>e.displayName.toLowerCase()],["asc"]))}),(0,U.default)(Array.from(t.entries()),[([e])=>+("Shapes"!==e),([e])=>e.toLowerCase()],["asc","asc"])}(Z),X="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function W(e){let t,r,i,s,c,l,u,m,p,d,h,f,b,g,v,y,x,E=(0,a.c)(42),{value:S,onChange:j}=e,[C,P]=(0,o.useState)(""),T=(0,o.useRef)(null);E[0]!==j?(t=e=>{e&&(j(e),T.current?.blur())},E[0]=j,E[1]=t):t=E[1],E[2]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{(0,o.startTransition)(()=>P(e))},E[2]=r):r=E[2],E[3]!==t||E[4]!==S?(i={placement:"bottom-start",resetValueOnHide:!0,selectedValue:S,setSelectedValue:t,setValue:r},E[3]=t,E[4]=S,E[5]=i):i=E[5];let _=(0,V.useComboboxStore)(i);E[6]!==_?(s=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),_.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},c=[_],E[6]=_,E[7]=s,E[8]=c):(s=E[7],c=E[8]),(0,o.useEffect)(s,c),E[9]!==S?(l=B.get(S),E[9]=S,E[10]=l):l=E[10];let w=l;e:{let e,t;if(!C){let e;E[11]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:K},E[11]=e):e=E[11],u=e;break e}E[12]!==C?(e=(0,D.matchSorter)(Z,C,{keys:["displayName","groupName"]}),E[12]=C,E[13]=e):e=E[13];let n=e;E[14]!==n?(t={type:"flat",shapes:n},E[14]=n,E[15]=t):t=E[15],u=t}let N=u,A=w?.displayName??S,M="flat"===N.type?0===N.shapes.length:0===N.groups.length;return E[16]!==_?(m=()=>{try{document.exitPointerLock()}catch{}_.show()},p=e=>{"Escape"!==e.key||_.getState().open||T.current?.blur()},E[16]=_,E[17]=m,E[18]=p):(m=E[17],p=E[18]),E[19]!==A||E[20]!==m||E[21]!==p?(d=(0,n.jsx)(O.Combobox,{ref:T,autoSelect:!0,placeholder:A,className:Y.default.Input,onFocus:m,onKeyDown:p}),E[19]=A,E[20]=m,E[21]=p,E[22]=d):d=E[22],E[23]!==A?(h=(0,n.jsx)("div",{className:Y.default.SelectedValue,children:(0,n.jsx)("span",{className:Y.default.SelectedName,children:A})}),E[23]=A,E[24]=h):h=E[24],E[25]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)("kbd",{className:Y.default.Shortcut,children:X?"⌘K":"^K"}),E[25]=f):f=E[25],E[26]!==d||E[27]!==h?(b=(0,n.jsxs)("div",{className:Y.default.InputWrapper,children:[d,h,f]}),E[26]=d,E[27]=h,E[28]=b):b=E[28],E[29]!==N.groups||E[30]!==N.shapes||E[31]!==N.type?(g="flat"===N.type?N.shapes.map(q):N.groups.map(e=>{let[t,a]=e;return(0,n.jsxs)(I.ComboboxGroup,{className:Y.default.Group,children:[(0,n.jsx)(k.ComboboxGroupLabel,{className:Y.default.GroupLabel,children:t}),a.map(q)]},t)}),E[29]=N.groups,E[30]=N.shapes,E[31]=N.type,E[32]=g):g=E[32],E[33]!==M?(v=M&&(0,n.jsx)("div",{className:Y.default.NoResults,children:"No shapes found"}),E[33]=M,E[34]=v):v=E[34],E[35]!==g||E[36]!==v?(y=(0,n.jsx)(R.ComboboxPopover,{portal:!0,gutter:4,autoFocusOnHide:!1,className:Y.default.Popover,children:(0,n.jsxs)(L.ComboboxList,{className:Y.default.List,children:[g,v]})}),E[35]=g,E[36]=v,E[37]=y):y=E[37],E[38]!==_||E[39]!==b||E[40]!==y?(x=(0,n.jsxs)(z.ComboboxProvider,{store:_,children:[b,y]}),E[38]=_,E[39]=b,E[40]=y,E[41]=x):x=E[41],x}function q(e){return(0,n.jsx)(M.ComboboxItem,{value:e.shapeName,className:Y.default.Item,focusOnHover:!0,children:(0,n.jsx)("span",{className:Y.default.ItemName,children:e.displayName})},e.shapeName)}e.i(13876);var G=e.i(58647),Q=e.i(38847),$=e.i(32424),J=e.i(54970),ee=e.i(86608),et=e.i(33870),en=e.i(99140),ea=e.i(7368);let eo=new s.QueryClient,er=new i.Color(.1,.1,.1),ei={toneMapping:i.NoToneMapping,outputColorSpace:i.SRGBColorSpace},es=(0,$.createScriptLoader)(),ec=(0,et.createScriptCache)(),el={findFiles:e=>{let t=(0,J.default)(e,{nocase:!0});return(0,F.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,F.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,F.getResourceMap)()[(0,F.getResourceKey)(e)]},eu=(0,Q.createParser)({parse:e=>e,serialize:e=>e,eq:(e,t)=>e===t}).withDefault("deploy_inventory.dts");function em(e){"batch.flushed"===e.type&&G.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function ep(e){e instanceof Error&&"AbortError"===e.name||console.error("Shape runtime failed:",e)}function ed(){let e,t,n=(0,a.c)(3),r=o.useContext(C);return n[0]!==r?(e=()=>{r.refresh().fit()},t=[r],n[0]=r,n[1]=e,n[2]=t):(e=n[1],t=n[2]),(0,o.useEffect)(e,t),null}function eh(e){let t,n,r,i,s=(0,a.c)(11),{shapeName:c,onAnimations:l}=e,u=(0,_.useStaticShape)(c);s[0]!==c?(t=e=>e.runtime.sequenceAliases.get(c.toLowerCase()),s[0]=c,s[1]=t):t=s[1];let m=(0,G.useEngineSelector)(t);if(s[2]!==u.animations||s[3]!==u.scene||s[4]!==m){let e,t=new Map;if(u.scene.traverse(e=>{let n=e.userData;n?.vis_sequence&&null!=n.vis_cyclic&&t.set(n.vis_sequence.toLowerCase(),!!n.vis_cyclic)}),m)for(let[t,n]of(e=new Map,m))e.set(n,t);n=u.animations.map(n=>({name:n.name,alias:e?.get(n.name.toLowerCase())??null,cyclic:t.get(n.name.toLowerCase())??null})),s[2]=u.animations,s[3]=u.scene,s[4]=m,s[5]=n}else n=s[5];let p=n,d=(0,o.useEffectEvent)(l);return s[6]!==p||s[7]!==d?(r=()=>{d(p)},s[6]=p,s[7]=d,s[8]=r):r=s[8],s[9]!==p?(i=[p],s[9]=p,s[10]=i):i=s[10],(0,o.useEffect)(r,i),null}function ef(e){let t,n,r=(0,a.c)(5),{object:i,runtime:s,animation:c}=e;return r[0]!==c||r[1]!==i||r[2]!==s?(t=()=>{if(s&&c){for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e);return s.$.nsCall("ShapeBase","playThread",i,0,c),()=>{for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e)}}},n=[s,i,c],r[0]=c,r[1]=i,r[2]=s,r[3]=t,r[4]=n):(t=r[3],n=r[4]),(0,o.useEffect)(t,n),null}function eb(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{shapeName:m,runtime:p,onAnimations:d,selectedAnimation:h}=e;u[0]!==p||u[1]!==m?(t=function(e,t){let n;if(e){for(let a of e.state.objectsById.values())if(a.shapeFile&&String(a.shapeFile).toLowerCase()===t.toLowerCase()){n=a._name;break}}return{_id:99999,_class:"StaticShapeData",_className:"StaticShape",...n?{datablock:n}:{}}}(p,m),u[0]=p,u[1]=m,u[2]=t):t=u[2];let f=t;return u[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(_.ShapeRenderer,{}),u[3]=o):o=u[3],u[4]!==d||u[5]!==m?(r=(0,n.jsx)(eh,{shapeName:m,onAnimations:d}),u[4]=d,u[5]=m,u[6]=r):r=u[6],u[7]!==f||u[8]!==p||u[9]!==h?(i=(0,n.jsx)(ef,{object:f,runtime:p,animation:h}),u[7]=f,u[8]=p,u[9]=h,u[10]=i):i=u[10],u[11]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(ed,{}),u[11]=s):s=u[11],u[12]!==r||u[13]!==i?(c=(0,n.jsxs)(E,{children:[o,r,i,s]}),u[12]=r,u[13]=i,u[14]=c):c=u[14],u[15]!==f||u[16]!==m||u[17]!==c?(l=(0,n.jsx)(w.ShapeInfoProvider,{type:"StaticShape",object:f,shapeName:m,children:c}),u[15]=f,u[16]=m,u[17]=c,u[18]=l):l=u[18],l}function eg(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("directionalLight",{position:[50,80,30],intensity:1.2})]}),t[0]=e):e=t[0],e}function ev(){let e,t,s,l,u,m,p,d,h,f,b,g,v,y,E,S,j=(0,a.c)(31),[C,_]=(0,Q.useQueryState)("shape",eu),w=function(){let e,t,n=(0,a.c)(2),[r,i]=(0,o.useState)(null);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=new AbortController,t=!1,{runtime:n,ready:a}=(0,ee.runServer)({missionName:"SC_Normal",missionType:"CTF",runtimeOptions:{loadScript:es,fileSystem:el,cache:ec,signal:e.signal,ignoreScripts:ea.ignoreScripts}});a.then(()=>{t||e.signal.aborted||(G.engineStore.getState().setRuntime(n),i(n))}).catch(ep),G.engineStore.getState().setRuntime(n);let o=n.subscribeRuntimeEvents(em);return()=>{t=!0,e.abort(),o(),G.engineStore.getState().clearRuntime(),n.destroy()}},t=[],n[0]=e,n[1]=t):(e=n[0],t=n[1]),(0,o.useEffect)(e,t),r}();j[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],j[0]=e):e=j[0];let[O,M]=(0,o.useState)(e),[L,R]=(0,o.useState)("");j[1]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{M(e),R("")},j[1]=t):t=j[1];let z=t,[I,k]=(0,o.useState)(!0);return j[2]!==w?(s=()=>{if(w){let e=setTimeout(()=>k(!1),300);return()=>clearTimeout(e)}},l=[w],j[2]=w,j[3]=s,j[4]=l):(s=j[3],l=j[4]),(0,o.useEffect)(s,l),j[5]!==w||j[6]!==I?(u=I&&(0,n.jsx)("div",{className:en.default.LoadingIndicator,"data-complete":!!w,children:(0,n.jsx)("div",{className:en.default.Spinner})}),j[5]=w,j[6]=I,j[7]=u):u=j[7],j[8]===Symbol.for("react.memo_cache_sentinel")?(m={type:i.PCFShadowMap},p={background:er},d={position:[5,3,5],fov:90},j[8]=m,j[9]=p,j[10]=d):(m=j[8],p=j[9],d=j[10]),j[11]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(eg,{}),j[11]=h):h=j[11],j[12]!==C||j[13]!==w||j[14]!==L?(f=(0,n.jsx)(P,{fit:!0,clip:!0,observe:!0,margin:1.5,children:(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(eb,{shapeName:C,runtime:w,onAnimations:z,selectedAnimation:L},C)})}),j[12]=C,j[13]=w,j[14]=L,j[15]=f):f=j[15],j[16]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsx)(N.DebugElements,{}),g=(0,n.jsx)(x,{makeDefault:!0}),j[16]=b,j[17]=g):(b=j[16],g=j[17]),j[18]!==f?(v=(0,n.jsx)(r.Canvas,{frameloop:"always",gl:ei,shadows:m,scene:p,camera:d,children:(0,n.jsxs)(A.TickProvider,{children:[h,f,b,g]})}),j[18]=f,j[19]=v):v=j[19],j[20]!==v||j[21]!==u?(y=(0,n.jsxs)("div",{className:en.default.CanvasContainer,children:[u,v]}),j[20]=v,j[21]=u,j[22]=y):y=j[22],j[23]!==O||j[24]!==C||j[25]!==L||j[26]!==_?(E=(0,n.jsx)(ex,{currentShape:C,onChangeShape:_,animations:O,selectedAnimation:L,onChangeAnimation:R}),j[23]=O,j[24]=C,j[25]=L,j[26]=_,j[27]=E):E=j[27],j[28]!==y||j[29]!==E?(S=(0,n.jsx)(c.QueryClientProvider,{client:eo,children:(0,n.jsx)("main",{children:(0,n.jsxs)(T.SettingsProvider,{onClearFogEnabledOverride:ey,children:[y,E]})})}),j[28]=y,j[29]=E,j[30]=S):S=j[30],S}function ey(){}function ex(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{currentShape:m,onChangeShape:p,animations:d,selectedAnimation:h,onChangeAnimation:f}=e,{debugMode:b,setDebugMode:g}=(0,T.useDebug)();return u[0]!==m||u[1]!==p?(t=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)(W,{value:m,onChange:p})}),u[0]=m,u[1]=p,u[2]=t):t=u[2],u[3]!==g?(o=e=>g(e.target.checked),u[3]=g,u[4]=o):o=u[4],u[5]!==b||u[6]!==o?(r=(0,n.jsx)("input",{id:"debugInput",type:"checkbox",checked:b,onChange:o}),u[5]=b,u[6]=o,u[7]=r):r=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("label",{htmlFor:"debugInput",children:"Debug"}),u[8]=i):i=u[8],u[9]!==r?(s=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsxs)("div",{className:en.default.CheckboxField,children:[r,i]})}),u[9]=r,u[10]=s):s=u[10],u[11]!==d||u[12]!==f||u[13]!==h?(c=d.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)("div",{className:en.default.SectionLabel,children:"Animations"})}),(0,n.jsx)("div",{className:en.default.AnimationList,children:d.map(e=>(0,n.jsxs)("div",{className:en.default.AnimationItem,"data-active":h===e.name,onClick:()=>f(h===e.name?"":e.name),children:[(0,n.jsx)("button",{className:en.default.PlayButton,title:`Play ${e.alias??e.name}`,children:h===e.name?"■":"▶"}),(0,n.jsx)("span",{className:en.default.AnimationName,children:e.alias??e.name}),e.alias&&(0,n.jsx)("span",{className:en.default.ClipName,title:`GLB clip: ${e.name}`,children:e.name}),!0===e.cyclic&&(0,n.jsx)("span",{className:en.default.CyclicIcon,title:"Cyclic (looping)",children:"∞"})]},e.name))})]}),u[11]=d,u[12]=f,u[13]=h,u[14]=c):c=u[14],u[15]!==t||u[16]!==s||u[17]!==c?(l=(0,n.jsxs)("div",{className:en.default.Sidebar,children:[t,s,c]}),u[15]=t,u[16]=s,u[17]=c,u[18]=l):l=u[18],l}function eE(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(ev,{})}),t[0]=e):e=t[0],e}e.s(["default",()=>eE],39724)}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,99140,e=>{e.v({AnimationItem:"page-module__v6zvCa__AnimationItem",AnimationList:"page-module__v6zvCa__AnimationList",AnimationName:"page-module__v6zvCa__AnimationName",CanvasContainer:"page-module__v6zvCa__CanvasContainer",CheckboxField:"page-module__v6zvCa__CheckboxField",ClipName:"page-module__v6zvCa__ClipName",CyclicIcon:"page-module__v6zvCa__CyclicIcon",LoadingIndicator:"page-module__v6zvCa__LoadingIndicator",PlayButton:"page-module__v6zvCa__PlayButton",SectionLabel:"page-module__v6zvCa__SectionLabel",Sidebar:"page-module__v6zvCa__Sidebar",SidebarSection:"page-module__v6zvCa__SidebarSection",Spinner:"page-module__v6zvCa__Spinner",loadingComplete:"page-module__v6zvCa__loadingComplete",spin:"page-module__v6zvCa__spin"})},39724,e=>{"use strict";var t,n=e.i(43476),a=e.i(932),o=e.i(71645),r=e.i(75056),i=e.i(90072),s=e.i(17751),c=e.i(12598),l=e.i(31067),u=e.i(15080),m=e.i(71753),p=e.i(85413),d=Object.defineProperty,h=(e,t,n)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?d(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,n};let f=new i.Ray,b=new i.Plane,g=Math.cos(Math.PI/180*70),v=(e,t)=>(e%t+t)%t;class y extends p.EventDispatcher{constructor(e,t){super(),h(this,"object"),h(this,"domElement"),h(this,"enabled",!0),h(this,"target",new i.Vector3),h(this,"minDistance",0),h(this,"maxDistance",1/0),h(this,"minZoom",0),h(this,"maxZoom",1/0),h(this,"minPolarAngle",0),h(this,"maxPolarAngle",Math.PI),h(this,"minAzimuthAngle",-1/0),h(this,"maxAzimuthAngle",1/0),h(this,"enableDamping",!1),h(this,"dampingFactor",.05),h(this,"enableZoom",!0),h(this,"zoomSpeed",1),h(this,"enableRotate",!0),h(this,"rotateSpeed",1),h(this,"enablePan",!0),h(this,"panSpeed",1),h(this,"screenSpacePanning",!0),h(this,"keyPanSpeed",7),h(this,"zoomToCursor",!1),h(this,"autoRotate",!1),h(this,"autoRotateSpeed",2),h(this,"reverseOrbit",!1),h(this,"reverseHorizontalOrbit",!1),h(this,"reverseVerticalOrbit",!1),h(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),h(this,"mouseButtons",{LEFT:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN}),h(this,"touches",{ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN}),h(this,"target0"),h(this,"position0"),h(this,"zoom0"),h(this,"_domElementKeyEvents",null),h(this,"getPolarAngle"),h(this,"getAzimuthalAngle"),h(this,"setPolarAngle"),h(this,"setAzimuthalAngle"),h(this,"getDistance"),h(this,"getZoomScale"),h(this,"listenToKeyEvents"),h(this,"stopListenToKeyEvents"),h(this,"saveState"),h(this,"reset"),h(this,"update"),h(this,"connect"),h(this,"dispose"),h(this,"dollyIn"),h(this,"dollyOut"),h(this,"getScale"),h(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=e=>{let t=v(e,2*Math.PI),a=u.phi;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-o{let t=v(e,2*Math.PI),a=u.theta;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-on.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",ee),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ee),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(a),n.update(),c=s.NONE},this.update=(()=>{let t=new i.Vector3,o=new i.Vector3(0,1,0),r=new i.Quaternion().setFromUnitVectors(e.up,o),h=r.clone().invert(),v=new i.Vector3,y=new i.Quaternion,x=2*Math.PI;return function(){let E=n.object.position;r.setFromUnitVectors(e.up,o),h.copy(r).invert(),t.copy(E).sub(n.target),t.applyQuaternion(r),u.setFromVector3(t),n.autoRotate&&c===s.NONE&&R(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(u.theta+=m.theta*n.dampingFactor,u.phi+=m.phi*n.dampingFactor):(u.theta+=m.theta,u.phi+=m.phi);let S=n.minAzimuthAngle,j=n.maxAzimuthAngle;isFinite(S)&&isFinite(j)&&(S<-Math.PI?S+=x:S>Math.PI&&(S-=x),j<-Math.PI?j+=x:j>Math.PI&&(j-=x),S<=j?u.theta=Math.max(S,Math.min(j,u.theta)):u.theta=u.theta>(S+j)/2?Math.max(S,u.theta):Math.min(j,u.theta)),u.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,u.phi)),u.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.zoomToCursor&&A||n.object.isOrthographicCamera?u.radius=U(u.radius):u.radius=U(u.radius*p),t.setFromSpherical(u),t.applyQuaternion(h),E.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),!0===n.enableDamping?(m.theta*=1-n.dampingFactor,m.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(m.set(0,0,0),d.set(0,0,0));let C=!1;if(n.zoomToCursor&&A){let a=null;if(n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let e=t.length();a=U(e*p);let o=e-a;n.object.position.addScaledVector(w,o),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new i.Vector3(N.x,N.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),C=!0;let o=new i.Vector3(N.x,N.y,0);o.unproject(n.object),n.object.position.sub(o).add(e),n.object.updateMatrixWorld(),a=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==a&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(a).add(n.object.position):(f.origin.copy(n.object.position),f.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(f.direction))l||8*(1-y.dot(n.object.quaternion))>l)&&(n.dispatchEvent(a),v.copy(n.object.position),y.copy(n.object.quaternion),C=!1,!0)}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",et),n.domElement.addEventListener("pointerdown",G),n.domElement.addEventListener("pointercancel",$),n.domElement.addEventListener("wheel",J)},this.dispose=()=>{var e,t,a,o,r,i;n.domElement&&(n.domElement.style.touchAction="auto"),null==(e=n.domElement)||e.removeEventListener("contextmenu",et),null==(t=n.domElement)||t.removeEventListener("pointerdown",G),null==(a=n.domElement)||a.removeEventListener("pointercancel",$),null==(o=n.domElement)||o.removeEventListener("wheel",J),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",Q),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",$),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",ee)};const n=this,a={type:"change"},o={type:"start"},r={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=s.NONE;const l=1e-6,u=new i.Spherical,m=new i.Spherical;let p=1;const d=new i.Vector3,y=new i.Vector2,x=new i.Vector2,E=new i.Vector2,S=new i.Vector2,j=new i.Vector2,C=new i.Vector2,P=new i.Vector2,T=new i.Vector2,_=new i.Vector2,w=new i.Vector3,N=new i.Vector2;let A=!1;const O=[],M={};function L(){return Math.pow(.95,n.zoomSpeed)}function R(e){n.reverseOrbit||n.reverseHorizontalOrbit?m.theta+=e:m.theta-=e}function z(e){n.reverseOrbit||n.reverseVerticalOrbit?m.phi+=e:m.phi-=e}const I=(()=>{let e=new i.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),d.add(e)}})(),k=(()=>{let e=new i.Vector3;return function(t,a){!0===n.screenSpacePanning?e.setFromMatrixColumn(a,1):(e.setFromMatrixColumn(a,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),d.add(e)}})(),V=(()=>{let e=new i.Vector3;return function(t,a){let o=n.domElement;if(o&&n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let r=n.object.position;e.copy(r).sub(n.target);let i=e.length();I(2*t*(i*=Math.tan(n.object.fov/2*Math.PI/180))/o.clientHeight,n.object.matrix),k(2*a*i/o.clientHeight,n.object.matrix)}else o&&n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?(I(t*(n.object.right-n.object.left)/n.object.zoom/o.clientWidth,n.object.matrix),k(a*(n.object.top-n.object.bottom)/n.object.zoom/o.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function D(e){n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?p=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function F(e){if(!n.zoomToCursor||!n.domElement)return;A=!0;let t=n.domElement.getBoundingClientRect(),a=e.clientX-t.left,o=e.clientY-t.top,r=t.width,i=t.height;N.x=a/r*2-1,N.y=-(o/i*2)+1,w.set(N.x,N.y,1).unproject(n.object).sub(n.object.position).normalize()}function U(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function Y(e){y.set(e.clientX,e.clientY)}function H(e){S.set(e.clientX,e.clientY)}function Z(){if(1==O.length)y.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);y.set(e,t)}}function B(){if(1==O.length)S.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);S.set(e,t)}}function K(){let e=O[0].pageX-O[1].pageX,t=O[0].pageY-O[1].pageY,n=Math.sqrt(e*e+t*t);P.set(0,n)}function X(e){if(1==O.length)x.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);x.set(n,a)}E.subVectors(x,y).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x)}function W(e){if(1==O.length)j.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);j.set(n,a)}C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j)}function q(e){var t;let a=ea(e),o=e.pageX-a.x,r=e.pageY-a.y,i=Math.sqrt(o*o+r*r);T.set(0,i),_.set(0,Math.pow(T.y/P.y,n.zoomSpeed)),t=_.y,D(p/t),P.copy(T)}function G(e){var t,a,r;!1!==n.enabled&&(0===O.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",Q),null==(a=n.domElement)||a.ownerDocument.addEventListener("pointerup",$)),r=e,O.push(r),"touch"===e.pointerType?function(e){switch(en(e),O.length){case 1:switch(n.touches.ONE){case i.TOUCH.ROTATE:if(!1===n.enableRotate)return;Z(),c=s.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(!1===n.enablePan)return;B(),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(n.touches.TWO){case i.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&K(),n.enablePan&&B(),c=s.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&K(),n.enableRotate&&Z(),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case i.MOUSE.DOLLY:if(!1===n.enableZoom)return;F(e),P.set(e.clientX,e.clientY),c=s.DOLLY;break;case i.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;H(e),c=s.PAN}else{if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}break;case i.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}else{if(!1===n.enablePan)return;H(e),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e))}function Q(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(en(e),c){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;X(e),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;W(e),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&q(e),n.enablePan&&W(e),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&q(e),n.enableRotate&&X(e),n.update();break;default:c=s.NONE}}(e):function(e){if(!1!==n.enabled)switch(c){case s.ROTATE:let t;if(!1===n.enableRotate)return;x.set(e.clientX,e.clientY),E.subVectors(x,y).multiplyScalar(n.rotateSpeed),(t=n.domElement)&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x),n.update();break;case s.DOLLY:var a,o;if(!1===n.enableZoom)return;(T.set(e.clientX,e.clientY),_.subVectors(T,P),_.y>0)?(a=L(),D(p/a)):_.y<0&&(o=L(),D(p*o)),P.copy(T),n.update();break;case s.PAN:if(!1===n.enablePan)return;j.set(e.clientX,e.clientY),C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j),n.update()}}(e))}function $(e){var t,a,o;(function(e){delete M[e.pointerId];for(let t=0;t0&&(a=L(),D(p/a)),n.update(),n.dispatchEvent(r)}}function ee(e){if(!1!==n.enabled&&!1!==n.enablePan){let t=!1;switch(e.code){case n.keys.UP:V(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}}function et(e){!1!==n.enabled&&e.preventDefault()}function en(e){let t=M[e.pointerId];void 0===t&&(t=new i.Vector2,M[e.pointerId]=t),t.set(e.pageX,e.pageY)}function ea(e){return M[(e.pointerId===O[0].pointerId?O[1]:O[0]).pointerId]}this.dollyIn=(e=L())=>{D(p*e),n.update()},this.dollyOut=(e=L())=>{D(p/e),n.update()},this.getScale=()=>p,this.setScale=e=>{D(e),n.update()},this.getZoomScale=()=>L(),void 0!==t&&this.connect(t),this.update()}}let x=o.forwardRef(({makeDefault:e,camera:t,regress:n,domElement:a,enableDamping:r=!0,keyEvents:i=!1,onChange:s,onStart:c,onEnd:p,...d},h)=>{let f=(0,u.useThree)(e=>e.invalidate),b=(0,u.useThree)(e=>e.camera),g=(0,u.useThree)(e=>e.gl),v=(0,u.useThree)(e=>e.events),x=(0,u.useThree)(e=>e.setEvents),E=(0,u.useThree)(e=>e.set),S=(0,u.useThree)(e=>e.get),j=(0,u.useThree)(e=>e.performance),C=t||b,P=a||v.connected||g.domElement,T=o.useMemo(()=>new y(C),[C]);return(0,m.useFrame)(()=>{T.enabled&&T.update()},-1),o.useEffect(()=>(i&&T.connect(!0===i?P:i),T.connect(P),()=>void T.dispose()),[i,P,n,T,f]),o.useEffect(()=>{let e=e=>{f(),n&&j.regress(),s&&s(e)},t=e=>{c&&c(e)},a=e=>{p&&p(e)};return T.addEventListener("change",e),T.addEventListener("start",t),T.addEventListener("end",a),()=>{T.removeEventListener("start",t),T.removeEventListener("end",a),T.removeEventListener("change",e)}},[s,c,p,T,f,x]),o.useEffect(()=>{if(e){let e=S().controls;return E({controls:T}),()=>E({controls:e})}},[e,T]),o.createElement("primitive",(0,l.default)({ref:h,object:T,enableDamping:r},d))}),E=o.forwardRef(function({children:e,object:t,disable:n,disableX:a,disableY:r,disableZ:s,left:c,right:u,top:m,bottom:p,front:d,back:h,onCentered:f,precise:b=!0,cacheKey:g=0,...v},y){let x=o.useRef(null),E=o.useRef(null),S=o.useRef(null),[j]=o.useState(()=>new i.Box3),[C]=o.useState(()=>new i.Vector3),[P]=o.useState(()=>new i.Sphere);return o.useLayoutEffect(()=>{E.current.matrixWorld.identity(),j.setFromObject(null!=t?t:S.current,b);let e=j.max.x-j.min.x,o=j.max.y-j.min.y,i=j.max.z-j.min.z;j.getCenter(C),j.getBoundingSphere(P);let l=m?o/2:p?-o/2:0,g=c?-e/2:u?e/2:0,v=d?i/2:h?-i/2:0;E.current.position.set(n||a?0:-C.x+g,n||r?0:-C.y+l,n||s?0:-C.z+v),null==f||f({parent:x.current.parent,container:x.current,width:e,height:o,depth:i,boundingBox:j,boundingSphere:P,center:C,verticalAlignment:l,horizontalAlignment:g,depthAlignment:v})},[g,f,m,c,d,n,a,r,s,t,b,u,p,h,j,C,P]),o.useImperativeHandle(y,()=>x.current,[]),o.createElement("group",(0,l.default)({ref:x},v),o.createElement("group",{ref:E},o.createElement("group",{ref:S},e)))});var S=((t=S||{})[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t);let j=e=>1-Math.exp(-5*e)+.007*e,C=o.createContext(null);function P({children:e,maxDuration:t=1,margin:n=1.2,observe:a,fit:r,clip:s,interpolateFunc:c=j,onFit:l}){let p=o.useRef(null),{camera:d,size:h,invalidate:f}=(0,u.useThree)(),b=(0,u.useThree)(e=>e.controls),g=o.useRef(l);g.current=l;let v=o.useRef({camPos:new i.Vector3,camRot:new i.Quaternion,camZoom:1}),y=o.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),x=o.useRef(S.NONE),E=o.useRef(0),[P]=o.useState(()=>new i.Box3),T=o.useMemo(()=>{function e(){let e=P.getSize(new i.Vector3),t=P.getCenter(new i.Vector3),a=Math.max(e.x,e.y,e.z),o=d&&d.isOrthographicCamera?4*a:a/(2*Math.atan(Math.PI*d.fov/360)),r=d&&d.isOrthographicCamera?4*a:o/d.aspect;return{box:P,size:e,center:t,distance:n*Math.max(o,r)}}return{getSize:e,refresh(e){if(e&&e.isBox3)P.copy(e);else{let t=e||p.current;if(!t)return this;t.updateWorldMatrix(!0,!0),P.setFromObject(t)}if(P.isEmpty()){let e=d.position.length()||10;P.setFromCenterAndSize(new i.Vector3,new i.Vector3(e,e,e))}return v.current.camPos.copy(d.position),v.current.camRot.copy(d.quaternion),d&&d.isOrthographicCamera&&(v.current.camZoom=d.zoom),y.current.camPos=void 0,y.current.camRot=void 0,y.current.camZoom=void 0,y.current.camUp=void 0,y.current.target=void 0,this},reset(){let{center:t,distance:n}=e(),a=d.position.clone().sub(t).normalize();y.current.camPos=t.clone().addScaledVector(a,n),y.current.target=t.clone();let o=new i.Matrix4().lookAt(y.current.camPos,y.current.target,d.up);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(o),x.current=S.START,E.current=0,this},moveTo(e){return y.current.camPos=Array.isArray(e)?new i.Vector3(...e):e.clone(),x.current=S.START,E.current=0,this},lookAt({target:e,up:t}){y.current.target=Array.isArray(e)?new i.Vector3(...e):e.clone(),t?y.current.camUp=Array.isArray(t)?new i.Vector3(...t):t.clone():y.current.camUp=d.up.clone();let n=new i.Matrix4().lookAt(y.current.camPos||d.position,y.current.target,y.current.camUp);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(n),x.current=S.START,E.current=0,this},to({position:e,target:t}){return this.moveTo(e).lookAt({target:t})},fit(){if(!(d&&d.isOrthographicCamera))return this.reset();let e=0,t=0,a=[new i.Vector3(P.min.x,P.min.y,P.min.z),new i.Vector3(P.min.x,P.max.y,P.min.z),new i.Vector3(P.min.x,P.min.y,P.max.z),new i.Vector3(P.min.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.min.z),new i.Vector3(P.max.x,P.min.y,P.max.z),new i.Vector3(P.max.x,P.min.y,P.min.z)],o=y.current.camPos||d.position,r=y.current.target||(null==b?void 0:b.target),s=y.current.camUp||d.up,c=r?new i.Matrix4().lookAt(o,r,s).setPosition(o).invert():d.matrixWorldInverse;for(let n of a)n.applyMatrix4(c),e=Math.max(e,Math.abs(n.y)),t=Math.max(t,Math.abs(n.x));e*=2,t*=2;let l=(d.top-d.bottom)/e,u=(d.right-d.left)/t;return y.current.camZoom=Math.min(l,u)/n,x.current=S.START,E.current=0,g.current&&g.current(this.getSize()),this},clip(){let{distance:t}=e();return d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),b&&(b.maxDistance=10*t,b.update()),f(),this}}},[P,d,b,n,f]);o.useLayoutEffect(()=>{if(b){let e=()=>{if(b&&y.current.target&&x.current!==S.NONE){let e=new i.Vector3().setFromMatrixColumn(d.matrix,2),t=v.current.camPos.distanceTo(b.target),n=(y.current.camPos||v.current.camPos).distanceTo(y.current.target),a=(1-E.current)*t+E.current*n;b.target.copy(d.position).addScaledVector(e,-a),b.update()}x.current=S.NONE};return b.addEventListener("start",e),()=>b.removeEventListener("start",e)}},[b]);let _=o.useRef(0);return o.useLayoutEffect(()=>{(a||0==_.current++)&&(T.refresh(),r&&T.reset().fit(),s&&T.clip())},[h,s,r,a,d,b]),(0,m.useFrame)((e,n)=>{if(x.current===S.START)x.current=S.ACTIVE,f();else if(x.current===S.ACTIVE){if(E.current+=n/t,E.current>=1)y.current.camPos&&d.position.copy(y.current.camPos),y.current.camRot&&d.quaternion.copy(y.current.camRot),y.current.camUp&&d.up.copy(y.current.camUp),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix(),b&&y.current.target&&(b.target.copy(y.current.target),b.update()),x.current=S.NONE;else{let e=c(E.current);y.current.camPos&&d.position.lerpVectors(v.current.camPos,y.current.camPos,e),y.current.camRot&&d.quaternion.slerpQuaternions(v.current.camRot,y.current.camRot,e),y.current.camUp&&d.up.set(0,1,0).applyQuaternion(d.quaternion),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=(1-e)*v.current.camZoom+e*y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix()}f()}}),o.createElement("group",{ref:p},o.createElement(C.Provider,{value:T},e))}var T=e.i(79123),_=e.i(91907),w=e.i(25947),N=e.i(86855),A=e.i(51475),O=e.i(11889),M=e.i(56373),L=e.i(86447),R=e.i(1559),z=e.i(78440),I=e.i(59129),k=e.i(25998),V=e.i(18364),D=e.i(70238),F=e.i(91996),U=e.i(29402),Y=e.i(97442);let H={"shapes.vl2":"Shapes","TR2final105-client.vl2":"Team Rabbit 2"},Z=(0,F.getResourceList)().filter(e=>e.startsWith("shapes/")&&e.endsWith(".dts")).map(e=>{let[t,n]=(0,F.getSourceAndPath)(e),a=n.split("/").pop()??n,o=H[t]??(t||"Loose");return{resourceKey:e,displayName:a,shapeName:a,sourcePath:t,groupName:o}}),B=new Map(Z.map(e=>[e.shapeName,e])),K=function(e){let t=new Map;for(let n of e){let e=t.get(n.groupName)??[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,n)=>{t.set(n,(0,U.default)(e,[e=>e.displayName.toLowerCase()],["asc"]))}),(0,U.default)(Array.from(t.entries()),[([e])=>+("Shapes"!==e),([e])=>e.toLowerCase()],["asc","asc"])}(Z),X="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function W(e){let t,r,i,s,c,l,u,m,p,d,h,f,b,g,v,y,x,E=(0,a.c)(42),{value:S,onChange:j}=e,[C,P]=(0,o.useState)(""),T=(0,o.useRef)(null);E[0]!==j?(t=e=>{e&&(j(e),T.current?.blur())},E[0]=j,E[1]=t):t=E[1],E[2]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{(0,o.startTransition)(()=>P(e))},E[2]=r):r=E[2],E[3]!==t||E[4]!==S?(i={placement:"bottom-start",resetValueOnHide:!0,selectedValue:S,setSelectedValue:t,setValue:r},E[3]=t,E[4]=S,E[5]=i):i=E[5];let _=(0,V.useComboboxStore)(i);E[6]!==_?(s=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),_.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},c=[_],E[6]=_,E[7]=s,E[8]=c):(s=E[7],c=E[8]),(0,o.useEffect)(s,c),E[9]!==S?(l=B.get(S),E[9]=S,E[10]=l):l=E[10];let w=l;e:{let e,t;if(!C){let e;E[11]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:K},E[11]=e):e=E[11],u=e;break e}E[12]!==C?(e=(0,D.matchSorter)(Z,C,{keys:["displayName","groupName"]}),E[12]=C,E[13]=e):e=E[13];let n=e;E[14]!==n?(t={type:"flat",shapes:n},E[14]=n,E[15]=t):t=E[15],u=t}let N=u,A=w?.displayName??S,M="flat"===N.type?0===N.shapes.length:0===N.groups.length;return E[16]!==_?(m=()=>{try{document.exitPointerLock()}catch{}_.show()},p=e=>{"Escape"!==e.key||_.getState().open||T.current?.blur()},E[16]=_,E[17]=m,E[18]=p):(m=E[17],p=E[18]),E[19]!==A||E[20]!==m||E[21]!==p?(d=(0,n.jsx)(O.Combobox,{ref:T,autoSelect:!0,placeholder:A,className:Y.default.Input,onFocus:m,onKeyDown:p}),E[19]=A,E[20]=m,E[21]=p,E[22]=d):d=E[22],E[23]!==A?(h=(0,n.jsx)("div",{className:Y.default.SelectedValue,children:(0,n.jsx)("span",{className:Y.default.SelectedName,children:A})}),E[23]=A,E[24]=h):h=E[24],E[25]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)("kbd",{className:Y.default.Shortcut,children:X?"⌘K":"^K"}),E[25]=f):f=E[25],E[26]!==d||E[27]!==h?(b=(0,n.jsxs)("div",{className:Y.default.InputWrapper,children:[d,h,f]}),E[26]=d,E[27]=h,E[28]=b):b=E[28],E[29]!==N.groups||E[30]!==N.shapes||E[31]!==N.type?(g="flat"===N.type?N.shapes.map(q):N.groups.map(e=>{let[t,a]=e;return(0,n.jsxs)(I.ComboboxGroup,{className:Y.default.Group,children:[(0,n.jsx)(k.ComboboxGroupLabel,{className:Y.default.GroupLabel,children:t}),a.map(q)]},t)}),E[29]=N.groups,E[30]=N.shapes,E[31]=N.type,E[32]=g):g=E[32],E[33]!==M?(v=M&&(0,n.jsx)("div",{className:Y.default.NoResults,children:"No shapes found"}),E[33]=M,E[34]=v):v=E[34],E[35]!==g||E[36]!==v?(y=(0,n.jsx)(R.ComboboxPopover,{portal:!0,gutter:4,autoFocusOnHide:!1,className:Y.default.Popover,children:(0,n.jsxs)(L.ComboboxList,{className:Y.default.List,children:[g,v]})}),E[35]=g,E[36]=v,E[37]=y):y=E[37],E[38]!==_||E[39]!==b||E[40]!==y?(x=(0,n.jsxs)(z.ComboboxProvider,{store:_,children:[b,y]}),E[38]=_,E[39]=b,E[40]=y,E[41]=x):x=E[41],x}function q(e){return(0,n.jsx)(M.ComboboxItem,{value:e.shapeName,className:Y.default.Item,focusOnHover:!0,children:(0,n.jsx)("span",{className:Y.default.ItemName,children:e.displayName})},e.shapeName)}var G=e.i(58647),Q=e.i(38847),$=e.i(32424),J=e.i(54970),ee=e.i(86608),et=e.i(33870),en=e.i(99140),ea=e.i(7368);let eo=new s.QueryClient,er=new i.Color(.1,.1,.1),ei={toneMapping:i.NoToneMapping,outputColorSpace:i.SRGBColorSpace},es=(0,$.createScriptLoader)(),ec=(0,et.createScriptCache)(),el={findFiles:e=>{let t=(0,J.default)(e,{nocase:!0});return(0,F.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,F.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,F.getResourceMap)()[(0,F.getResourceKey)(e)]},eu=(0,Q.createParser)({parse:e=>e,serialize:e=>e,eq:(e,t)=>e===t}).withDefault("deploy_inventory.dts");function em(e){"batch.flushed"===e.type&&G.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function ep(e){e instanceof Error&&"AbortError"===e.name||console.error("Shape runtime failed:",e)}function ed(){let e,t,n=(0,a.c)(3),r=o.useContext(C);return n[0]!==r?(e=()=>{r.refresh().fit()},t=[r],n[0]=r,n[1]=e,n[2]=t):(e=n[1],t=n[2]),(0,o.useEffect)(e,t),null}function eh(e){let t,n,r,i,s=(0,a.c)(11),{shapeName:c,onAnimations:l}=e,u=(0,_.useStaticShape)(c);s[0]!==c?(t=e=>e.runtime.sequenceAliases.get(c.toLowerCase()),s[0]=c,s[1]=t):t=s[1];let m=(0,G.useEngineSelector)(t);if(s[2]!==u.animations||s[3]!==u.scene||s[4]!==m){let e,t=new Map;if(u.scene.traverse(e=>{let n=e.userData;n?.vis_sequence&&null!=n.vis_cyclic&&t.set(n.vis_sequence.toLowerCase(),!!n.vis_cyclic)}),m)for(let[t,n]of(e=new Map,m))e.set(n,t);n=u.animations.map(n=>({name:n.name,alias:e?.get(n.name.toLowerCase())??null,cyclic:t.get(n.name.toLowerCase())??null})),s[2]=u.animations,s[3]=u.scene,s[4]=m,s[5]=n}else n=s[5];let p=n,d=(0,o.useEffectEvent)(l);return s[6]!==p||s[7]!==d?(r=()=>{d(p)},s[6]=p,s[7]=d,s[8]=r):r=s[8],s[9]!==p?(i=[p],s[9]=p,s[10]=i):i=s[10],(0,o.useEffect)(r,i),null}function ef(e){let t,n,r=(0,a.c)(5),{object:i,runtime:s,animation:c}=e;return r[0]!==c||r[1]!==i||r[2]!==s?(t=()=>{if(s&&c){for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e);return s.$.nsCall("ShapeBase","playThread",i,0,c),()=>{for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e)}}},n=[s,i,c],r[0]=c,r[1]=i,r[2]=s,r[3]=t,r[4]=n):(t=r[3],n=r[4]),(0,o.useEffect)(t,n),null}function eb(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{shapeName:m,runtime:p,onAnimations:d,selectedAnimation:h}=e;u[0]!==p||u[1]!==m?(t=function(e,t){let n;if(e){for(let a of e.state.objectsById.values())if(a.shapeFile&&String(a.shapeFile).toLowerCase()===t.toLowerCase()){n=a._name;break}}return{_id:99999,_class:"StaticShapeData",_className:"StaticShape",...n?{datablock:n}:{}}}(p,m),u[0]=p,u[1]=m,u[2]=t):t=u[2];let f=t;return u[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(_.ShapeRenderer,{}),u[3]=o):o=u[3],u[4]!==d||u[5]!==m?(r=(0,n.jsx)(eh,{shapeName:m,onAnimations:d}),u[4]=d,u[5]=m,u[6]=r):r=u[6],u[7]!==f||u[8]!==p||u[9]!==h?(i=(0,n.jsx)(ef,{object:f,runtime:p,animation:h}),u[7]=f,u[8]=p,u[9]=h,u[10]=i):i=u[10],u[11]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(ed,{}),u[11]=s):s=u[11],u[12]!==r||u[13]!==i?(c=(0,n.jsxs)(E,{children:[o,r,i,s]}),u[12]=r,u[13]=i,u[14]=c):c=u[14],u[15]!==f||u[16]!==m||u[17]!==c?(l=(0,n.jsx)(w.ShapeInfoProvider,{type:"StaticShape",object:f,shapeName:m,children:c}),u[15]=f,u[16]=m,u[17]=c,u[18]=l):l=u[18],l}function eg(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("directionalLight",{position:[50,80,30],intensity:1.2})]}),t[0]=e):e=t[0],e}function ev(){let e,t,s,l,u,m,p,d,h,f,b,g,v,y,E,S,j=(0,a.c)(31),[C,_]=(0,Q.useQueryState)("shape",eu),w=function(){let e,t,n=(0,a.c)(2),[r,i]=(0,o.useState)(null);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=new AbortController,t=!1,{runtime:n,ready:a}=(0,ee.runServer)({missionName:"SC_Normal",missionType:"CTF",runtimeOptions:{loadScript:es,fileSystem:el,cache:ec,signal:e.signal,ignoreScripts:ea.ignoreScripts}});a.then(()=>{t||e.signal.aborted||(G.engineStore.getState().setRuntime(n),i(n))}).catch(ep),G.engineStore.getState().setRuntime(n);let o=n.subscribeRuntimeEvents(em);return()=>{t=!0,e.abort(),o(),G.engineStore.getState().clearRuntime(),n.destroy()}},t=[],n[0]=e,n[1]=t):(e=n[0],t=n[1]),(0,o.useEffect)(e,t),r}();j[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],j[0]=e):e=j[0];let[O,M]=(0,o.useState)(e),[L,R]=(0,o.useState)("");j[1]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{M(e),R("")},j[1]=t):t=j[1];let z=t,[I,k]=(0,o.useState)(!0);return j[2]!==w?(s=()=>{if(w){let e=setTimeout(()=>k(!1),300);return()=>clearTimeout(e)}},l=[w],j[2]=w,j[3]=s,j[4]=l):(s=j[3],l=j[4]),(0,o.useEffect)(s,l),j[5]!==w||j[6]!==I?(u=I&&(0,n.jsx)("div",{className:en.default.LoadingIndicator,"data-complete":!!w,children:(0,n.jsx)("div",{className:en.default.Spinner})}),j[5]=w,j[6]=I,j[7]=u):u=j[7],j[8]===Symbol.for("react.memo_cache_sentinel")?(m={type:i.PCFShadowMap},p={background:er},d={position:[5,3,5],fov:90},j[8]=m,j[9]=p,j[10]=d):(m=j[8],p=j[9],d=j[10]),j[11]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(eg,{}),j[11]=h):h=j[11],j[12]!==C||j[13]!==w||j[14]!==L?(f=(0,n.jsx)(P,{fit:!0,clip:!0,observe:!0,margin:1.5,children:(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(eb,{shapeName:C,runtime:w,onAnimations:z,selectedAnimation:L},C)})}),j[12]=C,j[13]=w,j[14]=L,j[15]=f):f=j[15],j[16]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsx)(N.DebugElements,{}),g=(0,n.jsx)(x,{makeDefault:!0}),j[16]=b,j[17]=g):(b=j[16],g=j[17]),j[18]!==f?(v=(0,n.jsx)(r.Canvas,{frameloop:"always",gl:ei,shadows:m,scene:p,camera:d,children:(0,n.jsxs)(A.TickProvider,{children:[h,f,b,g]})}),j[18]=f,j[19]=v):v=j[19],j[20]!==v||j[21]!==u?(y=(0,n.jsxs)("div",{className:en.default.CanvasContainer,children:[u,v]}),j[20]=v,j[21]=u,j[22]=y):y=j[22],j[23]!==O||j[24]!==C||j[25]!==L||j[26]!==_?(E=(0,n.jsx)(ex,{currentShape:C,onChangeShape:_,animations:O,selectedAnimation:L,onChangeAnimation:R}),j[23]=O,j[24]=C,j[25]=L,j[26]=_,j[27]=E):E=j[27],j[28]!==y||j[29]!==E?(S=(0,n.jsx)(c.QueryClientProvider,{client:eo,children:(0,n.jsx)("main",{children:(0,n.jsxs)(T.SettingsProvider,{onClearFogEnabledOverride:ey,children:[y,E]})})}),j[28]=y,j[29]=E,j[30]=S):S=j[30],S}function ey(){}function ex(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{currentShape:m,onChangeShape:p,animations:d,selectedAnimation:h,onChangeAnimation:f}=e,{debugMode:b,setDebugMode:g}=(0,T.useDebug)();return u[0]!==m||u[1]!==p?(t=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)(W,{value:m,onChange:p})}),u[0]=m,u[1]=p,u[2]=t):t=u[2],u[3]!==g?(o=e=>g(e.target.checked),u[3]=g,u[4]=o):o=u[4],u[5]!==b||u[6]!==o?(r=(0,n.jsx)("input",{id:"debugInput",type:"checkbox",checked:b,onChange:o}),u[5]=b,u[6]=o,u[7]=r):r=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("label",{htmlFor:"debugInput",children:"Debug"}),u[8]=i):i=u[8],u[9]!==r?(s=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsxs)("div",{className:en.default.CheckboxField,children:[r,i]})}),u[9]=r,u[10]=s):s=u[10],u[11]!==d||u[12]!==f||u[13]!==h?(c=d.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)("div",{className:en.default.SectionLabel,children:"Animations"})}),(0,n.jsx)("div",{className:en.default.AnimationList,children:d.map(e=>(0,n.jsxs)("div",{className:en.default.AnimationItem,"data-active":h===e.name,onClick:()=>f(h===e.name?"":e.name),children:[(0,n.jsx)("button",{className:en.default.PlayButton,title:`Play ${e.alias??e.name}`,children:h===e.name?"■":"▶"}),(0,n.jsx)("span",{className:en.default.AnimationName,children:e.alias??e.name}),e.alias&&(0,n.jsx)("span",{className:en.default.ClipName,title:`GLB clip: ${e.name}`,children:e.name}),!0===e.cyclic&&(0,n.jsx)("span",{className:en.default.CyclicIcon,title:"Cyclic (looping)",children:"∞"})]},e.name))})]}),u[11]=d,u[12]=f,u[13]=h,u[14]=c):c=u[14],u[15]!==t||u[16]!==s||u[17]!==c?(l=(0,n.jsxs)("div",{className:en.default.Sidebar,children:[t,s,c]}),u[15]=t,u[16]=s,u[17]=c,u[18]=l):l=u[18],l}function eE(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(ev,{})}),t[0]=e):e=t[0],e}e.s(["default",()=>eE],39724)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/92a585fca24d52ed.css b/docs/_next/static/chunks/92a585fca24d52ed.css new file mode 100644 index 00000000..c8fa7908 --- /dev/null +++ b/docs/_next/static/chunks/92a585fca24d52ed.css @@ -0,0 +1,14 @@ +.InspectorControls-module__gNRB6W__InspectorControls{z-index:2;font-size:13px;line-height:1.231;position:relative}.InspectorControls-module__gNRB6W__Dropdown{flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}.InspectorControls-module__gNRB6W__ButtonGroup{flex:1 0 auto;align-items:stretch;width:100%;display:flex}.InspectorControls-module__gNRB6W__ButtonGroup .InspectorControls-module__gNRB6W__IconButton{flex-direction:column;flex:1 0 0;gap:1px;padding-top:8px;padding-bottom:8px;font-size:22px}.InspectorControls-module__gNRB6W__ButtonGroup .InspectorControls-module__gNRB6W__IconButton svg{margin-bottom:3px}.InspectorControls-module__gNRB6W__ButtonGroup .InspectorControls-module__gNRB6W__IconButton[data-active=true]{background:#0572b1}.InspectorControls-module__gNRB6W__ButtonGroup .InspectorControls-module__gNRB6W__IconButton:not(:first-child){border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.InspectorControls-module__gNRB6W__ButtonGroup .InspectorControls-module__gNRB6W__IconButton:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.InspectorControls-module__gNRB6W__Group{flex-wrap:wrap;justify-content:center;align-items:center;gap:20px;display:flex}.InspectorControls-module__gNRB6W__LabelledButton{align-items:center;gap:6px;display:flex}.InspectorControls-module__gNRB6W__CheckboxField{grid-template-rows:auto auto;grid-template-columns:auto 1fr;align-items:center;gap:0 6px;margin:0 0 6px;display:grid}.InspectorControls-module__gNRB6W__CheckboxField input[type=checkbox]{grid-area:1/1;margin-left:0}.InspectorControls-module__gNRB6W__CheckboxField .InspectorControls-module__gNRB6W__Label{grid-area:1/2;align-items:center;gap:6px;display:flex}.InspectorControls-module__gNRB6W__Description{opacity:.6;margin:2px 0 4px;padding:0;font-size:12px;line-height:1.3333}.InspectorControls-module__gNRB6W__CheckboxField .InspectorControls-module__gNRB6W__Description{grid-area:2/2}.InspectorControls-module__gNRB6W__Control{align-items:center;gap:8px;display:flex}.InspectorControls-module__gNRB6W__Field select{margin-bottom:6px}.InspectorControls-module__gNRB6W__Field output{opacity:.7}.InspectorControls-module__gNRB6W__Tools{flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.InspectorControls-module__gNRB6W__Field{grid-template-rows:auto auto;grid-template-columns:1fr auto;align-items:center;margin:0 0 6px;display:grid}.InspectorControls-module__gNRB6W__Field label{grid-area:1/1}.InspectorControls-module__gNRB6W__Field .InspectorControls-module__gNRB6W__Control{grid-area:1/2}.InspectorControls-module__gNRB6W__Field .InspectorControls-module__gNRB6W__Description{grid-area:2/1/auto/-1}.InspectorControls-module__gNRB6W__IconButton{color:#fff;cursor:pointer;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d;border-radius:5px;flex:auto;justify-content:center;align-items:center;gap:8px;width:auto;min-width:28px;height:auto;min-height:32px;margin:0;padding:4px 8px;font-family:inherit;font-size:18px;font-weight:500;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}.InspectorControls-module__gNRB6W__IconButton svg{pointer-events:none;opacity:.6;flex:none;transition:opacity .2s}.InspectorControls-module__gNRB6W__IconButton:disabled{opacity:.6;cursor:default}@media (hover:hover){.InspectorControls-module__gNRB6W__IconButton:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}.InspectorControls-module__gNRB6W__IconButton:not(:disabled):hover svg{opacity:1}}.InspectorControls-module__gNRB6W__IconButton:not(:disabled):active,.InspectorControls-module__gNRB6W__IconButton[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}.InspectorControls-module__gNRB6W__IconButton[data-active=true]{background:#0075d5e6;border-color:#fff6}.InspectorControls-module__gNRB6W__ButtonLabel{font-size:14px}.InspectorControls-module__gNRB6W__ButtonHint{opacity:.7;font-size:10px}.InspectorControls-module__gNRB6W__Toggle{margin:0;}.InspectorControls-module__gNRB6W__MapInfoButton{}.InspectorControls-module__gNRB6W__ForceRenderButton{color:#4cb5ff;cursor:pointer;background:0 0;border:0;place-content:center;margin:0;padding:0 2px;font-size:16px;display:grid} +.CopyCoordinatesButton-module__BxovtG__Root{}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true]{background:#0075d5e6;border-color:#fff6}.CopyCoordinatesButton-module__BxovtG__ClipboardCheck{opacity:1;display:none}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true] .CopyCoordinatesButton-module__BxovtG__ClipboardCheck{animation:.22s linear infinite CopyCoordinatesButton-module__BxovtG__showClipboardCheck;display:block}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true] .CopyCoordinatesButton-module__BxovtG__MapPin{display:none}.CopyCoordinatesButton-module__BxovtG__ButtonLabel{}@keyframes CopyCoordinatesButton-module__BxovtG__showClipboardCheck{0%{opacity:1}to{opacity:.2}} +.LoadDemoButton-module__kGZaoW__Root{}.LoadDemoButton-module__kGZaoW__ButtonLabel{}.LoadDemoButton-module__kGZaoW__ButtonHint{} +.JoinServerButton-module__DIR70a__Root{}.JoinServerButton-module__DIR70a__TextLabel{}.JoinServerButton-module__DIR70a__PingLabel{margin-right:2px;display:flex!important;}.JoinServerButton-module__DIR70a__Pulsing{animation:1.2s ease-out infinite JoinServerButton-module__DIR70a__blink}@keyframes JoinServerButton-module__DIR70a__blink{0%{opacity:1}to{opacity:.25}}.JoinServerButton-module__DIR70a__ButtonHint{} +.Accordion-module__rN-DYq__AccordionGroup{flex-direction:column;gap:1px;display:flex}.Accordion-module__rN-DYq__Trigger{color:#fff;text-align:left;text-transform:uppercase;letter-spacing:.0417em;background:#ffffff1a;border:0;align-items:center;gap:4px;width:100%;padding:6px 8px;font-family:inherit;font-size:12px;font-weight:400;display:flex}.Accordion-module__rN-DYq__TriggerIcon{opacity:.5;font-size:12px;transition:transform .2s;transform:rotate(0)}.Accordion-module__rN-DYq__Trigger[data-state=open] .Accordion-module__rN-DYq__TriggerIcon{transform:rotate(90deg)}.Accordion-module__rN-DYq__Content{overflow:hidden}.Accordion-module__rN-DYq__Content[data-state=open]{animation:.3s Accordion-module__rN-DYq__slideDown}.Accordion-module__rN-DYq__Content[data-state=closed]{animation:.3s Accordion-module__rN-DYq__slideUp}.Accordion-module__rN-DYq__Body{padding:10px}@keyframes Accordion-module__rN-DYq__slideDown{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes Accordion-module__rN-DYq__slideUp{0%{height:var(--radix-accordion-content-height)}to{height:0}} +.MissionSelect-module__N_AIjG__InputWrapper{z-index:2;align-items:center;margin:10px 10px 10px 4px;display:flex;position:relative}.MissionSelect-module__N_AIjG__Shortcut{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__Shortcut{display:none}.MissionSelect-module__N_AIjG__Input{color:#fff;-webkit-user-select:text;user-select:text;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]{padding-right:8px}.MissionSelect-module__N_AIjG__Input:focus{border-color:#fff9}.MissionSelect-module__N_AIjG__Input::placeholder{color:#777;font-family:inherit;font-size:12px}.MissionSelect-module__N_AIjG__SelectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__SelectedValue{display:none}.MissionSelect-module__N_AIjG__SelectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;line-height:1.28571;overflow:hidden}.MissionSelect-module__N_AIjG__SelectedValue>.MissionSelect-module__N_AIjG__ItemType{flex-shrink:0}.MissionSelect-module__N_AIjG__Popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-module__N_AIjG__List{padding:4px 0}.MissionSelect-module__N_AIjG__List:has(>.MissionSelect-module__N_AIjG__Group:first-child){padding-top:0}.MissionSelect-module__N_AIjG__Group{padding-bottom:4px}.MissionSelect-module__N_AIjG__GroupLabel{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}.MissionSelect-module__N_AIjG__Group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-module__N_AIjG__Item{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}.MissionSelect-module__N_AIjG__List>.MissionSelect-module__N_AIjG__Item:first-child{margin-top:0}.MissionSelect-module__N_AIjG__Item[data-active-item]{background:#ffffff26}.MissionSelect-module__N_AIjG__Item[aria-selected=true]{background:#6496ff4d}.MissionSelect-module__N_AIjG__ItemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-module__N_AIjG__ItemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-module__N_AIjG__ItemTypes{gap:3px;display:flex}.MissionSelect-module__N_AIjG__ItemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600;line-height:1.3}.MissionSelect-module__N_AIjG__ItemType:hover{background:#ff9d00b3}.MissionSelect-module__N_AIjG__ItemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-module__N_AIjG__NoResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}.MissionSelect-module__N_AIjG__Backdrop{z-index:1;background:#00000080;position:fixed;inset:0} +.StreamingMissionInfo-module__hEaQnW__Header{flex:auto;align-items:center;display:flex}.StreamingMissionInfo-module__hEaQnW__MissionInfo{color:#fff;background:0 0;border:1px solid #fff0;border-radius:3px;align-items:center;gap:6px;margin:10px auto 10px 4px;padding:5px 8px;display:flex}.StreamingMissionInfo-module__hEaQnW__MissionName{}.StreamingMissionInfo-module__hEaQnW__MissionType{pointer-events:none;}.StreamingMissionInfo-module__hEaQnW__MissionTypeDisplayName{opacity:.5;font-size:12px}.StreamingMissionInfo-module__hEaQnW__Metadata{text-align:right;flex-direction:column;gap:2px;margin:0 0 0 auto;padding:8px 12px;font-size:12px;line-height:1.16667;display:flex}.StreamingMissionInfo-module__hEaQnW__Attribution,.StreamingMissionInfo-module__hEaQnW__ServerInfo{color:#83938b}.StreamingMissionInfo-module__hEaQnW__PlayerName,.StreamingMissionInfo-module__hEaQnW__RecordingDate,.StreamingMissionInfo-module__hEaQnW__ServerName{color:#eceae7}.StreamingMissionInfo-module__hEaQnW__ActionButton{flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px;}.StreamingMissionInfo-module__hEaQnW__EjectIcon{margin-top:-.5px;font-size:21px}@media (max-width:899px){.StreamingMissionInfo-module__hEaQnW__Metadata{display:none}} +.FloatingLabel-module__8y09Ka__Label{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px} +.PlayerNameplate-module__zYDm0a__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;display:inline-flex}.PlayerNameplate-module__zYDm0a__Top{padding-bottom:20px;}.PlayerNameplate-module__zYDm0a__Bottom{padding-top:20px;}.PlayerNameplate-module__zYDm0a__IffArrow{width:12px;height:12px;image-rendering:pixelated;filter:drop-shadow(0 1px 2px #000000b3)}.PlayerNameplate-module__zYDm0a__Name{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;font-size:11px}.PlayerNameplate-module__zYDm0a__HealthBar{background:#00000080;border:1px solid #fff3;width:60px;height:4px;margin:2px auto 0;overflow:hidden}.PlayerNameplate-module__zYDm0a__HealthFill{background:#2ecc40;height:100%} +.FlagMarker-module__INpLba__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;gap:1px;display:inline-flex}.FlagMarker-module__INpLba__Distance{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;opacity:.5;font-size:10px}.FlagMarker-module__INpLba__Icon{width:16px;height:16px;image-rendering:pixelated;opacity:.5;filter:drop-shadow(0 1px 3px #000c);-webkit-mask-image:var(--flag-icon-url);mask-image:var(--flag-icon-url);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--flag-icon-url);-webkit-mask-position:50%;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat} +.page-module__v6zvCa__CanvasContainer{z-index:0;position:absolute;inset:0}.page-module__v6zvCa__LoadingIndicator{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.page-module__v6zvCa__LoadingIndicator[data-complete=true]{animation:.3s ease-out forwards page-module__v6zvCa__loadingComplete}.page-module__v6zvCa__Spinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite page-module__v6zvCa__spin}@keyframes page-module__v6zvCa__spin{to{transform:rotate(360deg)}}@keyframes page-module__v6zvCa__loadingComplete{0%{opacity:1}to{opacity:0}}.page-module__v6zvCa__Sidebar{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:#fff;z-index:2;background:#000000b3;flex-direction:column;width:260px;font-size:13px;display:flex;position:fixed;top:0;bottom:0;left:0;overflow:hidden}.page-module__v6zvCa__SidebarSection{border-bottom:1px solid #ffffff1a;padding:10px 12px}.page-module__v6zvCa__SidebarSection:last-child{border-bottom:none}.page-module__v6zvCa__SectionLabel{text-transform:uppercase;letter-spacing:.05em;color:#fff6;margin-bottom:6px;font-size:10px}.page-module__v6zvCa__AnimationList{flex:1;padding:0 12px 12px;overflow-y:auto}.page-module__v6zvCa__AnimationItem{cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:4px;align-items:center;gap:6px;padding:4px 6px;display:flex}.page-module__v6zvCa__AnimationItem:hover{background:#ffffff14}.page-module__v6zvCa__AnimationItem[data-active=true]{background:#ffffff26}.page-module__v6zvCa__PlayButton{color:#fff9;cursor:pointer;background:#ffffff1a;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:22px;height:22px;padding:0;font-size:11px;display:flex}.page-module__v6zvCa__PlayButton:hover{color:#fff;background:#fff3}.page-module__v6zvCa__AnimationItem[data-active=true] .page-module__v6zvCa__PlayButton{color:#fff;background:#64b4ff4d}.page-module__v6zvCa__AnimationName{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.page-module__v6zvCa__ClipName{color:#ffffff4d;white-space:nowrap;flex-shrink:0;font-size:10px}.page-module__v6zvCa__CyclicIcon{color:#ffffff4d;title:"Cyclic (looping)";flex-shrink:0;font-size:13px}.page-module__v6zvCa__CheckboxField{align-items:center;gap:6px;display:flex} +.LoadingIndicator-module__F20Nda__LoadingIndicator{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.LoadingIndicator-module__F20Nda__LoadingIndicator[data-complete=true]{animation:.3s ease-out forwards LoadingIndicator-module__F20Nda__loadingComplete}.LoadingIndicator-module__F20Nda__Spinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite LoadingIndicator-module__F20Nda__spin}.LoadingIndicator-module__F20Nda__Progress{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}.LoadingIndicator-module__F20Nda__ProgressBar{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}.LoadingIndicator-module__F20Nda__ProgressText{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}@keyframes LoadingIndicator-module__F20Nda__spin{to{transform:rotate(360deg)}}@keyframes LoadingIndicator-module__F20Nda__loadingComplete{0%{opacity:1}to{opacity:0}} +.DebugElements-module__Cmeo9W__StatsPanel{bottom:0;right:0;top:auto!important;left:auto!important}.DebugElements-module__Cmeo9W__AxisLabel{pointer-events:none;font-size:12px}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=x]{color:#f90}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=y]{color:#9f0}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=z]{color:#09f} +.MapInspector-module__nU0WNq__Frame{grid-template:"sidebar toolbar""sidebar content"1fr"sidebar footer"/auto 1fr;width:100dvw;height:100dvh;display:grid;overflow:hidden}.MapInspector-module__nU0WNq__Toolbar{color:#fff;z-index:3;view-transition-class:MapInspector-module__nU0WNq__layout;background:#191f1f;border-bottom:1px solid #465555;grid-area:toolbar;align-items:center;display:flex;position:relative;box-shadow:0 0 3px 1px #0006}.MapInspector-module__nU0WNq__CancelButton{color:#ffffffb3;cursor:pointer;white-space:nowrap;z-index:1;background:#ffffff0d;border:1px solid #ffffff4d;border-radius:3px;padding:4px 6px;font-size:12px}.MapInspector-module__nU0WNq__CancelButton:hover{color:#fff;background:#ffffff1a}.MapInspector-module__nU0WNq__Sidebar{color:#fff;z-index:2;background:#191f1f;border-right:1px solid #465555;grid-area:sidebar;width:320px;height:100%;min-height:0;position:relative;overflow-y:auto;box-shadow:0 0 3px 1px #0006}.MapInspector-module__nU0WNq__Content{z-index:0;grid-area:content;min-width:0;min-height:0;position:relative;overflow:hidden}.MapInspector-module__nU0WNq__ThreeView{z-index:0;position:absolute;inset:0}.MapInspector-module__nU0WNq__PlayerBar{color:#fff;z-index:1;background:#191f1f;border-top:1px solid #465555;grid-area:footer;position:relative;box-shadow:0 0 3px 1px #0006}.MapInspector-module__nU0WNq__ToggleSidebarButton{color:#fff;cursor:pointer;opacity:.6;background:0 0;border:0;border-radius:4px;flex:none;place-content:center;min-width:30px;min-height:30px;margin:0 0 0 8px;padding:2px;font-size:24px;display:grid}.MapInspector-module__nU0WNq__ToggleSidebarButton[data-orientation=top]{min-width:48px;min-height:48px;margin:0;display:none}.MapInspector-module__nU0WNq__ToggleSidebarButton:not(:disabled):hover{opacity:1}.MapInspector-module__nU0WNq__ToggleSidebarButton svg{pointer-events:none}.MapInspector-module__nU0WNq__Backdrop{display:none}@media (max-width:899px){.MapInspector-module__nU0WNq__Frame{grid-template:"toolbar""content"1fr"footer"/1fr;display:grid}.MapInspector-module__nU0WNq__Sidebar{border:1px solid #465555;border-top:0;grid-area:content-start/content/footer-end;justify-self:center;width:auto;max-width:500px;height:calc(100% + 1px);margin:0 -1px}.MapInspector-module__nU0WNq__Toolbar{justify-content:center}.MapInspector-module__nU0WNq__ToggleSidebarButton[data-orientation=left]{display:none}.MapInspector-module__nU0WNq__ToggleSidebarButton[data-orientation=top]{display:grid}.MapInspector-module__nU0WNq__Backdrop{z-index:2;background:#000000b3;display:block;position:fixed;inset:0}} diff --git a/docs/_next/static/chunks/9542fc38c512bd1a.css b/docs/_next/static/chunks/9542fc38c512bd1a.css deleted file mode 100644 index 8fe9cfc9..00000000 --- a/docs/_next/static/chunks/9542fc38c512bd1a.css +++ /dev/null @@ -1,5 +0,0 @@ -.GuiMarkup-module__CLgNnq__GuiMarkup{white-space:pre-wrap;font-size:14px;line-height:1.5}.GuiMarkup-module__CLgNnq__GuiMarkup a{color:inherit;text-decoration:underline}.GuiMarkup-module__CLgNnq__Bullet{margin-left:.5em;margin-right:.5em} -.DialogButton-module__LxvdOa__DialogButton{color:#99fff1;text-shadow:0 -1px 1px #0006;cursor:pointer;background:linear-gradient(#30a497cc,#1f9688cc 33%,#218377cc 67%,#046564cc);border:1px solid #387c74cc;border-top-color:#57b7b9cc;border-radius:4px;padding:4px 18px;font-family:inherit;font-size:14px;font-weight:500;box-shadow:inset 0 0 4px #02808e80}.DialogButton-module__LxvdOa__DialogButton:hover:not(:disabled){color:#b1fff5;border:1px solid #409188e6;border-top-color:#5ac6c2e6;box-shadow:inset 0 0 4px #02808e80,0 0 5px #3effbf80}.DialogButton-module__LxvdOa__DialogButton:active:not(:disabled){transform:translateY(1px)}.DialogButton-module__LxvdOa__DialogButton:disabled{opacity:.4;cursor:not-allowed}.DialogButton-module__LxvdOa__Secondary{box-shadow:none;color:#a2e2cfcc;text-shadow:none;background:0 0;border:1px solid #387c74cc;}.DialogButton-module__LxvdOa__Secondary:hover:not(:disabled){color:#a9ffe5cc;border:1px solid #3f9087e6} -.ServerBrowser-module__kqm3eq__Dialog{color:#b0d5c9;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;grid-template-rows:auto 1fr auto;grid-template-columns:100%;width:860px;max-width:calc(100dvw - 40px);height:560px;max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;display:grid;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}.ServerBrowser-module__kqm3eq__Overlay{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.ServerBrowser-module__kqm3eq__Header{border-bottom:1px solid #00bedc40;align-items:center;gap:12px;padding:12px 16px 10px;display:flex}.ServerBrowser-module__kqm3eq__Title{color:#7dffff;text-shadow:0 1px 6px #0006;flex:1;margin:0;font-size:18px;font-weight:500}.ServerBrowser-module__kqm3eq__RefreshButton{padding:3px 14px;font-size:12px;}.ServerBrowser-module__kqm3eq__ServerCount{color:#c9dcd866;font-size:12px}.ServerBrowser-module__kqm3eq__TableWrapper{min-height:0;overflow-y:auto}.ServerBrowser-module__kqm3eq__Table{border-collapse:collapse;width:100%;font-size:13px}.ServerBrowser-module__kqm3eq__Table th{text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;letter-spacing:.04em;text-transform:uppercase;color:#7dffff99;background:#0a191af2;border-bottom:1px solid #00bedc33;padding:6px 12px;font-size:11px;font-weight:500;position:sticky;top:0}.ServerBrowser-module__kqm3eq__Table th:hover{color:#7dffff}.ServerBrowser-module__kqm3eq__Table th:nth-child(2),.ServerBrowser-module__kqm3eq__Table td:nth-child(2),.ServerBrowser-module__kqm3eq__Table th:nth-child(3),.ServerBrowser-module__kqm3eq__Table td:nth-child(3){text-align:right}.ServerBrowser-module__kqm3eq__Table td{white-space:nowrap;text-overflow:ellipsis;border-bottom:1px solid #ffffff0a;max-width:340px;padding:3px 12px;font-weight:500;overflow:hidden}.ServerBrowser-module__kqm3eq__Table tbody tr{cursor:pointer}.ServerBrowser-module__kqm3eq__Table tbody tr:hover{background:#41838b1f}.ServerBrowser-module__kqm3eq__Selected{color:#1e2828;background:#5dffe1e6!important}.ServerBrowser-module__kqm3eq__PasswordIcon{color:#ffc83c99;margin-right:4px;font-size:11px}.ServerBrowser-module__kqm3eq__Empty{text-align:center;color:#c9dcd84d;font-style:italic;padding:32px 12px!important}.ServerBrowser-module__kqm3eq__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;align-items:center;gap:16px;padding:10px 12px;display:flex}.ServerBrowser-module__kqm3eq__JoinButton{min-width:100px;}.ServerBrowser-module__kqm3eq__CloseButton{}.ServerBrowser-module__kqm3eq__WarriorField{align-items:center;gap:8px;display:flex}.ServerBrowser-module__kqm3eq__WarriorLabel{color:#7dffff99;font-size:12px;font-weight:500}.ServerBrowser-module__kqm3eq__WarriorInput{color:#b0d5c9;background:#00323ccc;border:1px solid #41838b80;border-radius:2px;outline:none;width:130px;padding:4px 6px;font-family:inherit;font-size:13px}.ServerBrowser-module__kqm3eq__WarriorInput:focus{border-color:#7dffff99}.ServerBrowser-module__kqm3eq__WarriorInput::placeholder{color:#c9dcd84d}.ServerBrowser-module__kqm3eq__Hint{color:#c9dcd84d;margin:0 auto;font-size:12px}@media (max-width:719px){.ServerBrowser-module__kqm3eq__Dialog{border-radius:0;width:100%;max-width:100dvw;height:100%;max-height:100dvh}.ServerBrowser-module__kqm3eq__Hint{display:none}.ServerBrowser-module__kqm3eq__Table td{max-width:200px}} -.page-module__E0kJGG__CanvasContainer{z-index:0;position:absolute;inset:0}.page-module__E0kJGG__LoadingIndicator{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.page-module__E0kJGG__LoadingIndicator[data-complete=true]{animation:.3s ease-out forwards page-module__E0kJGG__loadingComplete}.page-module__E0kJGG__Spinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite page-module__E0kJGG__spin}.page-module__E0kJGG__Progress{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}.page-module__E0kJGG__ProgressBar{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}.page-module__E0kJGG__ProgressText{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}@keyframes page-module__E0kJGG__spin{to{transform:rotate(360deg)}}@keyframes page-module__E0kJGG__loadingComplete{0%{opacity:1}to{opacity:0}} -.MapInfoDialog-module__m0lXla__Dialog{color:#bccec3;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;grid-template-rows:1fr auto;grid-template-columns:100%;width:800px;max-width:calc(100dvw - 40px);height:600px;max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;display:grid;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}.MapInfoDialog-module__m0lXla__Overlay{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.MapInfoDialog-module__m0lXla__Body{grid-template-rows:100%;grid-template-columns:1fr auto;min-height:0;display:grid;overflow:hidden}.MapInfoDialog-module__m0lXla__Left{padding:24px 28px;overflow-y:auto}.MapInfoDialog-module__m0lXla__PreviewImage{border-left:1px solid #00bedc40;height:100%;display:block}.MapInfoDialog-module__m0lXla__PreviewImageFloating{float:right;clear:right;width:auto;max-width:30%;max-height:260px;margin:0 0 16px 20px;display:block}.MapInfoDialog-module__m0lXla__Title{color:#7dffff;text-shadow:0 1px 6px #0006;margin:0;font-size:26px;font-weight:500}.MapInfoDialog-module__m0lXla__MapMeta{flex-wrap:wrap;gap:8px 16px;margin-bottom:4px;font-size:15px;font-weight:400;display:flex}.MapInfoDialog-module__m0lXla__MapPlanet{color:#dbcaa8b3}.MapInfoDialog-module__m0lXla__MapQuote{border-left:2px solid #00bedc59;margin:16px 0;padding:0 0 0 14px;font-style:italic}.MapInfoDialog-module__m0lXla__MapQuote p{white-space:pre-line;margin:0 0 4px}.MapInfoDialog-module__m0lXla__MapQuote cite{color:#ffffff73;font-size:12px;font-style:normal;display:block}.MapInfoDialog-module__m0lXla__MapBlurb{margin:0 0 16px;font-size:13px}.MapInfoDialog-module__m0lXla__Section{margin-top:20px}.MapInfoDialog-module__m0lXla__SectionTitle{color:#7dffff;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 16px #00d2f040;margin:0 0 8px;font-size:16px;font-weight:500}.MapInfoDialog-module__m0lXla__MusicTrack{color:#cad0ac80;align-items:center;gap:6px;margin-top:16px;font-size:14px;font-style:italic;display:flex}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true]{color:#f7fdd8b3}.MapInfoDialog-module__m0lXla__MusicButton{cursor:pointer;color:#557663;opacity:.5;background:0 0;border:0;border-radius:20px;flex-shrink:0;place-content:center;width:32px;height:32px;padding:0;font-size:20px;font-style:normal;line-height:1;display:grid}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true] .MapInfoDialog-module__m0lXla__MusicButton{color:#6dffaa;opacity:1}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true] .MapInfoDialog-module__m0lXla__MusicButton:hover{opacity:.7}.MapInfoDialog-module__m0lXla__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;align-items:center;gap:16px;padding:10px 12px;display:flex}.MapInfoDialog-module__m0lXla__CloseButton{}.MapInfoDialog-module__m0lXla__Hint{color:#c9dcd84d;margin-left:auto;font-size:12px}.MapInfoDialog-module__m0lXla__MusicTrackName{text-transform:capitalize}@media (max-width:719px){.MapInfoDialog-module__m0lXla__Body{display:block;overflow:auto}.MapInfoDialog-module__m0lXla__Hint{display:none}.MapInfoDialog-module__m0lXla__Left{width:100%;height:auto;margin:0;padding:16px 20px;overflow:auto}.MapInfoDialog-module__m0lXla__PreviewImage{width:auto;height:auto;margin:16px auto}.MapInfoDialog-module__m0lXla__CloseButton{width:220px;height:36px;margin:0 auto}} diff --git a/docs/_next/static/chunks/96ae05ebba99dcff.js b/docs/_next/static/chunks/96ae05ebba99dcff.js new file mode 100644 index 00000000..e676475d --- /dev/null +++ b/docs/_next/static/chunks/96ae05ebba99dcff.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66789,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(71753),r=e.i(90072),n=e.i(58647),o=e.i(82816),l=e.i(85557),s=e.i(71505),u=e.i(91907),c=e.i(25947),m=e.i(93784);function f({entity:e}){let i=e.weaponShape,r=e.shapeName,n=(0,u.useStaticShape)(r),o=(0,u.useStaticShape)(i),s=(0,a.useMemo)(()=>{let e,t,a=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(i),r=(0,l.getPosedNodeTransform)(n.scene,n.animations,"Mount0",[a]);if(!r)return{position:void 0,quaternion:void 0};let s=(0,l.getPosedNodeTransform)(o.scene,o.animations,"Mountpoint");if(s){let a=s.quaternion.clone().invert(),i=s.position.clone().negate().applyQuaternion(a);t=r.quaternion.clone().multiply(a),e=i.clone().applyQuaternion(r.quaternion).add(r.position)}else e=r.position.clone(),t=r.quaternion.clone();return{position:e.applyQuaternion(l._r90),quaternion:l._r90.clone().multiply(t).multiply(l._r90inv)}},[n,o]),m=(0,a.useMemo)(()=>({_class:"weapon",_className:"Weapon",_id:0}),[]);return(0,t.jsx)(c.ShapeInfoProvider,{object:m,shapeName:i,type:"Item",children:(0,t.jsx)("group",{position:s.position,quaternion:s.quaternion,children:(0,t.jsx)(u.ShapeRenderer,{loadingColor:"#4488ff"})})})}function p({entity:e}){let c=m.streamPlaybackStore.getState().playback,f=(0,u.useStaticShape)(e.shapeName),p=(0,a.useRef)(null),h=(0,a.useRef)((0,n.effectNow)()),d=(0,a.useRef)(Math.random()*Math.PI*2),y=(0,a.useRef)([]),g=(0,a.useMemo)(()=>{if(e.explosionDataBlockId)return c.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,c]),v=(0,a.useMemo)(()=>g?function(e){let t=e.sizes,a=e.times;if(!Array.isArray(t)||0===t.length)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let i=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(a)?a:i.map((e,t)=>t/Math.max(i.length-1,1)),sizes:i}}(g):void 0,[g]),M=(0,a.useMemo)(()=>{let e=g?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[g]),A=32*(g?.lifetimeMS??31),S=!1!==e.faceViewer,{scene:_,mixer:x,visNodes:b,iflInfos:q,materials:k}=(0,a.useMemo)(()=>{let t=o.clone(f.scene),a=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let i=new Set(t.userData.flag_names??[]),r=t.userData.resource_path;if(i.has("IflMaterial")&&r){let t=e.userData;a.push({mesh:e,iflPath:`textures/${r}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0})}}),(0,l.processShapeScene)(t,e.shapeName);let i=[];for(let e of(t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let a=t.vis_keyframes,r=t.vis_duration,n=(t.vis_sequence??"").toLowerCase();n&&Array.isArray(a)&&!(a.length<=1)&&r&&!(r<=0)&&"ambient"===n&&i.push({mesh:e,keyframes:a,duration:r,cyclic:!!t.vis_cyclic})}),i))e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of a)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let n=new Map;for(let e of f.animations)n.set(e.name.toLowerCase(),e);let s=n.get("ambient"),u=null;if(s){let e=(u=new r.AnimationMixer(t)).clipAction(s);e.setLoop(r.LoopOnce,1),e.clampWhenFinished=!0,e.timeScale=(g?.playSpeed??20)/20,e.play()}let c=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?c.push(...e.material):e.material&&c.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:u,visNodes:i,iflInfos:a,materials:c}},[f,g]);return(0,a.useEffect)(()=>{for(let e of(y.current=[],q))(0,s.loadIflAtlas)(e.iflPath).then(t=>{let a=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;a&&(a.map=t.texture,a.needsUpdate=!0),y.current.push({atlas:t,info:e})}).catch(()=>{})},[q]),(0,i.useFrame)((e,t)=>{let a=p.current;if(!a)return;let i=n.engineStore.getState().playback,r="playing"===i.status?t*i.rate:0,o=(0,n.effectNow)()-h.current,l=Math.min(o/A,1),u=o/1e3;x&&x.update(r);let c=l>.8?1-(l-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:a,cyclic:i}of b){let r=e.material;if(!r||Array.isArray(r))continue;let n=u/a,o=i?n%1:Math.min(n,1),l=t.length,s=o*l,m=Math.floor(s)%l,f=(m+1)%l,p=s-Math.floor(s);r.opacity=(t[m]+(t[f]-t[m])*p)*c}if(c<1)for(let e of k)"opacity"in e&&(e.transparent=!0,e.opacity*=c);for(let{atlas:e,info:t}of y.current){let a;a=t.sequenceName&&t.duration?(t.cyclic?u/t.duration%1:Math.min(u/t.duration,1))*t.duration+(t.toolBegin??0):u,(0,s.updateAtlasFrame)(e,(0,s.getFrameIndexForTime)(e,a))}if(v){let e=function(e,t){let{times:a,sizes:i}=e;if(0===a.length)return[1,1,1];if(t<=a[0])return i[0];if(t>=a[a.length-1])return i[i.length-1];for(let e=0;e=a[e]&&t<=a[e+1]){let r=(t-a[e])/(a[e+1]-a[e]);return[i[e][0]+(i[e+1][0]-i[e][0])*r,i[e][1]+(i[e+1][1]-i[e][1])*r,i[e][2]+(i[e+1][2]-i[e][2])*r]}return i[i.length-1]}(v,l);a.scale.set(e[0]*M[0],e[1]*M[1],e[2]*M[2])}S&&(a.lookAt(e.camera.position),a.rotateZ(d.current))}),(0,t.jsx)("group",{ref:p,children:(0,t.jsx)("group",{rotation:[0,Math.PI,0],children:(0,t.jsx)("primitive",{object:_})})})}e.s(["ExplosionShape",()=>p,"WeaponModel",()=>f])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/97346c3751717c47.js b/docs/_next/static/chunks/97346c3751717c47.js new file mode 100644 index 00000000..df3179c1 --- /dev/null +++ b/docs/_next/static/chunks/97346c3751717c47.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(25645),c=e.i(12979),a=e.i(51434),s=e.i(79123),l=e.i(89887),f=e.i(58647);let d=(0,u.createLogger)("AudioEmitter"),h=new Map,p=new Map;function y(e,t=1){p.set(e,t)}function m(e){p.delete(e)}let g=0;function S(){return g}function R(){for(let[e]of(g++,p)){try{e.stop()}catch{}try{e.disconnect()}catch{}}p.clear()}function b(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,c=u?.is3D??!0,a=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:c,isLooping:a,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function M(e,t,r,n,o){let u;try{u=(0,c.audioToUrl)(e.filename)}catch{return}let a=f.engineStore.getState().playback.rate,s=g;D(u,r,r=>{if(s===g)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(a),n&&u.position.copy(n),o.add(u),p.set(u,1),u.play(),u.source.onended=()=>{p.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(a),p.set(n,1),n.play(),n.source.onended=()=>{p.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function D(e,t,r){h.has(e)?r(h.get(e)):t.load(e,t=>{h.set(e,t),r(t)},void 0,t=>{d.error("Audio load error %s: %o",e,t)})}f.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of p)try{t.setPlaybackRate(r*e)}catch{}});let k=(0,r.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,h=e.audioMinDistance??1,p=e.audioMaxDistance??1,y=e.audioMinLoopGap??0,m=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,S=e.audioIsLooping??!0,[R,b,M]=e.position??[0,0,0],k=(0,n.useThree)(e=>e.scene),v=(0,n.useThree)(e=>e.camera),{audioLoader:A,audioListener:T}=(0,a.useAudio)(),{audioEnabled:P}=(0,s.useSettings)(),w=(0,r.useRef)(null),x=(0,r.useRef)(null),B=(0,r.useRef)(null),E=(0,r.useRef)(!1),L=(0,r.useRef)(!1),C=(0,r.useRef)(new i.Vector3(R,b,M)),G=(0,r.useRef)(0),V=()=>{null!=x.current&&(clearTimeout(x.current),x.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)};(0,r.useEffect)(()=>{let e;if(A&&T){if(G.current++,g){let t=new i.PositionalAudio(T);t.position.copy(C.current),t.setDistanceModel("inverse"),t.setRefDistance(h),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(d),e=t,k.add(e)}else(e=new i.Audio(T)).setVolume(d);return w.current=e,()=>{V();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&k.remove(e),w.current=null,E.current=!1,L.current=!1}}},[A,T,g,h,p,d,k]);let j=(e,t)=>{if(S)if(y>0||m>0){let r=Math.max(0,y),n=Math.max(r,m),o=r===n?r:Math.random()*(n-r)+r;e.loop=!1;let i=()=>{t===G.current&&(!1===e.isPlaying?x.current=setTimeout(()=>{if(t===G.current)try{e.play(),j(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},F=e=>{if(!A)return;let t=G.current;if(E.current)try{e.isPlaying||(e.play(),j(e,t))}catch{}else{let r;try{r=(0,c.audioToUrl)(f)}catch{return}D(r,A,r=>{if(t===G.current&&!e.buffer){e.setBuffer(r),E.current=!0;try{e.play(),j(e,t)}catch{}}})}};return(0,r.useEffect)(()=>{let e=w.current;e&&!g&&P&&f&&F(e)},[P,g,f,A,T]),(0,o.useFrame)(()=>{let e=w.current;if(!e||!g||!P||!f)return;let t=v.position.distanceTo(C.current),r=L.current,n=t<=p;if(n&&!r)L.current=!0,F(e);else if(!n&&r){L.current=!1,V();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=w.current;if(e&&!P){V();try{e.stop()}catch{}L.current=!1}},[P]),u?(0,t.jsxs)("mesh",{position:C.current,children:[(0,t.jsx)("sphereGeometry",{args:[h,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(l.FloatingLabel,{color:"#00ff00",position:[0,h+1,0],children:f})]}):null});e.s(["AudioEmitter",0,k,"audioBufferCache",0,h,"getCachedAudioBuffer",()=>D,"getSoundGeneration",()=>S,"playOneShotSound",()=>M,"resolveAudioProfile",()=>b,"stopAllTrackedSounds",()=>R,"trackSound",()=>y,"untrackSound",()=>m])},9962,e=>{"use strict";var t=e.i(71645),r=e.i(90072),n=e.i(12979),o=e.i(51434),i=e.i(29055),u=e.i(79123),c=e.i(58647);function a(){let{audioLoader:e,audioListener:a}=(0,o.useAudio)(),{audioEnabled:s}=(0,u.useSettings)(),l=(0,c.useEngineSelector)(e=>e.playback.streamSnapshot?.chatMessages),f=(0,c.useEngineSelector)(e=>e.playback.streamSnapshot?.timeSec),d=(0,t.useRef)(new WeakSet),h=(0,t.useRef)(new Map);return(0,t.useEffect)(()=>{if(!s||!e||!a||!l?.length||null==f)return;let t=d.current,o=h.current;for(let u of l){if(!t.has(u)){if((t.add(u),u.soundPath)&&!(Math.abs(f-u.timeSec)>2))try{let t=(0,n.audioToUrl)(u.soundPath),s=u.soundPitch??1,l=c.engineStore.getState().playback.rate,f=u.sender,d=(0,i.getSoundGeneration)();(0,i.getCachedAudioBuffer)(t,e,e=>{if(d!==(0,i.getSoundGeneration)())return;if(f){let e=o.get(f);if(e){try{e.stop()}catch{}(0,i.untrackSound)(e);try{e.disconnect()}catch{}o.delete(f)}}let t=new r.Audio(a);t.setBuffer(e),t.setPlaybackRate(s*l),(0,i.trackSound)(t,s),f&&o.set(f,t),t.play(),t.source.onended=()=>{(0,i.untrackSound)(t);try{t.disconnect()}catch{}f&&o.get(f)===t&&o.delete(f)}})}catch{}}}},[s,e,a,l,f]),null}e.s(["ChatSoundPlayer",()=>a])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/994d42eb1af43673.js b/docs/_next/static/chunks/994d42eb1af43673.js new file mode 100644 index 00000000..095c7ed8 --- /dev/null +++ b/docs/_next/static/chunks/994d42eb1af43673.js @@ -0,0 +1,211 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(71753);let s=(0,r.createContext)(null);function n({children:e}){let n=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,i.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,n.current)for(let e of n.current)e(o.current)});let l=(0,r.useCallback)(e=>(n.current??=new Set,n.current.add(e),()=>{n.current.delete(e)}),[]),u=(0,r.useCallback)(()=>o.current,[]),c=(0,r.useMemo)(()=>({subscribe:l,getTick:u}),[l,u]);return(0,t.jsx)(s.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(s);if(!t)throw Error("useTick must be used within a TickProvider");let i=(0,r.useRef)(e);i.current=e,(0,r.useEffect)(()=>t.subscribe(e=>i.current(e)),[t])}e.s(["TICK_RATE",0,32,"TickProvider",()=>n,"useTick",()=>a])},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),l=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(l)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(l)?e=l:l instanceof r.Texture?e=[l]:n(l)&&(e=Object.values(l)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,l]),(0,t.useMemo)(()=>{if(!n(e))return l;{let t={},r=0;for(let i in e)t[i]=l[r++];return t}},[e,l])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=16,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a])},47021,e=>{"use strict";var t=e.i(8560);let r=` +#ifdef USE_FOG + // Check fog enabled uniform - allows toggling without shader recompilation + #ifdef USE_VOLUMETRIC_FOG + if (!fogEnabled) { + // Skip all fog calculations when disabled + } else { + #endif + + float dist = vFogDepth; + + // Discard fragments at or beyond visible distance - matches Torque's behavior + // where objects beyond visibleDistance are not rendered at all. + // This prevents fully-fogged geometry from showing as silhouettes against + // the sky's fog-to-sky gradient. + if (dist >= fogFar) { + discard; + } + + // Step 1: Calculate distance-based haze (quadratic falloff) + // Since we discard at fogFar, haze never reaches 1.0 here + float haze = 0.0; + if (dist > fogNear) { + float fogScale = 1.0 / (fogFar - fogNear); + float distFactor = (dist - fogNear) * fogScale - 1.0; + haze = 1.0 - distFactor * distFactor; + } + + // Step 2: Calculate fog volume contributions + // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) + // All fog uses the global fogColor - see Tribes2_Fog_System.md for details + float volumeFog = 0.0; + + #ifdef USE_VOLUMETRIC_FOG + { + #ifdef USE_FOG_WORLD_POSITION + float fragmentHeight = vFogWorldPosition.y; + #else + float fragmentHeight = cameraHeight; + #endif + + float deltaY = fragmentHeight - cameraHeight; + float absDeltaY = abs(deltaY); + + // Determine if we're going up (positive) or down (negative) + if (absDeltaY > 0.01) { + // Non-horizontal ray: ray-march through fog volumes + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + // Skip inactive volumes (visibleDistance = 0) + if (volVisDist <= 0.0) continue; + + // Calculate fog factor for this volume + // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage + // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) + // Since we don't have quality settings, we use visFactor = 1.0 + float factor = (1.0 / volVisDist) * volPct; + + // Find ray intersection with this volume's height range + float rayMinY = min(cameraHeight, fragmentHeight); + float rayMaxY = max(cameraHeight, fragmentHeight); + + // Check if ray intersects volume height range + if (rayMinY < volMaxH && rayMaxY > volMinH) { + float intersectMin = max(rayMinY, volMinH); + float intersectMax = min(rayMaxY, volMaxH); + float intersectHeight = intersectMax - intersectMin; + + // Calculate distance traveled through this volume using similar triangles: + // subDist / dist = intersectHeight / absDeltaY + float subDist = dist * (intersectHeight / absDeltaY); + + // Accumulate fog: fog += subDist * factor + volumeFog += subDist * factor; + } + } + } else { + // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // If camera is inside this volume, apply fog for full distance + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float factor = (1.0 / volVisDist) * volPct; + volumeFog += dist * factor; + } + } + } + } + #endif + + // Step 3: Combine haze and volume fog + // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct + // This gives fog volumes priority over haze + float volPct = min(volumeFog, 1.0); + float hazePct = haze; + if (volPct + hazePct > 1.0) { + hazePct = 1.0 - volPct; + } + float fogFactor = hazePct + volPct; + + // Apply fog using global fogColor (per-volume colors not used in Tribes 2) + gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); + + #ifdef USE_VOLUMETRIC_FOG + } // end fogEnabled check + #endif +#endif +`;function i(){t.ShaderChunk.fog_pars_fragment=` +#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif + + // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) + // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats + #ifdef USE_VOLUMETRIC_FOG + uniform float fogVolumeData[12]; + uniform float cameraHeight; + #endif + + #ifdef USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; + #endif +#endif +`,t.ShaderChunk.fog_fragment=r,t.ShaderChunk.fog_pars_vertex=` +#ifdef USE_FOG + varying float vFogDepth; + #ifdef USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; + #endif +#endif +`,t.ShaderChunk.fog_vertex=` +#ifdef USE_FOG + // Use Euclidean distance from camera, not view-space z-depth + // This ensures fog doesn't change when rotating the camera + vFogDepth = length(mvPosition.xyz); + #ifdef USE_FOG_WORLD_POSITION + vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; + #endif +#endif +`}function s(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include +#ifdef USE_FOG + #define USE_FOG_WORLD_POSITION + #define USE_VOLUMETRIC_FOG + varying vec3 vFogWorldPosition; +#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include +#ifdef USE_FOG + vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +#ifdef USE_FOG + #define USE_VOLUMETRIC_FOG + uniform float fogVolumeData[12]; + uniform float cameraHeight; + uniform bool fogEnabled; + #define USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])},67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,e=>{"use strict";var t=e.i(43476),r=e.i(932),i=e.i(71645),s=e.i(90072),n=e.i(71753),a=e.i(60099),o=e.i(67191);let l=[0,0,0],u=new s.Vector3,c=(0,i.memo)(function(e){let s,c,h,d=(0,r.c)(11),{children:f,color:p,position:m,opacity:v}=e,g=void 0===p?"white":p,y=void 0===m?l:m,b=void 0===v?"fadeWithDistance":v,S="fadeWithDistance"===b,x=(0,i.useRef)(null),[T,F]=(0,i.useState)(0!==b),O=(0,i.useRef)(null);return d[0]!==S||d[1]!==T||d[2]!==b?(s=e=>{var t,r,i;let s,{camera:n}=e,a=x.current;if(!a)return;a.getWorldPosition(u);let o=(t=u.x,r=u.y,i=u.z,-((t-(s=n.matrixWorld.elements)[12])*s[8])+-((r-s[13])*s[9])+-((i-s[14])*s[10])<0);if(S){let e=o?1/0:n.position.distanceTo(u),t=e<200;if(T!==t&&F(t),O.current&&t){let t=Math.max(0,Math.min(1,1-e/200));O.current.style.opacity=t.toString()}}else{let e=!o&&0!==b;T!==e&&F(e),O.current&&(O.current.style.opacity=b.toString())}},d[0]=S,d[1]=T,d[2]=b,d[3]=s):s=d[3],(0,n.useFrame)(s),d[4]!==f||d[5]!==g||d[6]!==T||d[7]!==y?(c=T?(0,t.jsx)(a.Html,{position:y,center:!0,children:(0,t.jsx)("div",{ref:O,className:o.default.Label,style:{color:g},children:f})}):null,d[4]=f,d[5]=g,d[6]=T,d[7]=y,d[8]=c):c=d[8],d[9]!==c?(h=(0,t.jsx)("group",{ref:x,children:c}),d[9]=c,d[10]=h):h=d[10],h});e.s(["FloatingLabel",0,c])},79123,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let i=(0,r.createContext)(null),s=(0,r.createContext)(null),n=(0,r.createContext)(null);function a(){return(0,r.useContext)(i)}function o(){return(0,r.useContext)(s)}function l(){return(0,r.useContext)(n)}function u({children:e,fogEnabledOverride:a,onClearFogEnabledOverride:o}){let[l,u]=(0,r.useState)(!0),[c,h]=(0,r.useState)(!1),[d,f]=(0,r.useState)(1),[p,m]=(0,r.useState)(90),[v,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(.75),[S,x]=(0,r.useState)(!0),[T,F]=(0,r.useState)(!1),[O,R]=(0,r.useState)("moveLookStick"),[E,w]=(0,r.useState)("MapGenius"),[M,C]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[I,_]=(0,r.useState)(!1),[U,Q]=(0,r.useState)(!1),k=(0,r.useCallback)(e=>{u(e),o()},[o]),L=(0,r.useMemo)(()=>({fogEnabled:a??l,setFogEnabled:k,highQualityFog:c,setHighQualityFog:h,fov:p,setFov:m,audioEnabled:v,setAudioEnabled:g,animationEnabled:S,setAnimationEnabled:x,warriorName:E,setWarriorName:w,audioVolume:y,setAudioVolume:b}),[l,a,k,c,p,v,S,E,y]),j=(0,r.useMemo)(()=>({debugMode:T,setDebugMode:F,renderOnDemand:U,setRenderOnDemand:Q}),[T,F,U]),H=(0,r.useMemo)(()=>({speedMultiplier:d,setSpeedMultiplier:f,touchMode:O,setTouchMode:R,invertScroll:M,setInvertScroll:C,invertDrag:P,setInvertDrag:D,invertJoystick:I,setInvertJoystick:_}),[d,f,O,R,M,P,I]);(0,r.useEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&F(e.debugMode),null!=e.audioEnabled&&g(e.audioEnabled),null!=e.animationEnabled&&x(e.animationEnabled),null!=e.fogEnabled&&u(e.fogEnabled),null!=e.highQualityFog&&h(e.highQualityFog),null!=e.speedMultiplier&&f(Math.max(0,Math.min(1,e.speedMultiplier))),null!=e.fov&&m(e.fov),null!=e.touchMode&&R(e.touchMode),null!=e.warriorName&&w(e.warriorName),null!=e.audioVolume&&b(e.audioVolume),null!=e.invertScroll&&C(e.invertScroll),null!=e.invertDrag&&D(e.invertDrag),null!=e.invertJoystick&&_(e.invertJoystick)},[]);let W=(0,r.useRef)(null);return(0,r.useEffect)(()=>(W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:l,highQualityFog:c,speedMultiplier:d,fov:p,audioEnabled:v,animationEnabled:S,debugMode:T,touchMode:O,warriorName:E,audioVolume:y,invertScroll:M,invertDrag:P,invertJoystick:I}))}catch(e){}},500),()=>{W.current&&clearTimeout(W.current)}),[l,c,d,p,v,S,T,O,E,y,M,P,I]),(0,t.jsx)(i.Provider,{value:L,children:(0,t.jsx)(s.Provider,{value:j,children:(0,t.jsx)(n.Provider,{value:H,children:e})})})}e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>a])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},60099,e=>{"use strict";let t,r;var i=e.i(31067),s=e.i(71645),n=e.i(88014),a=e.i(90072),o=e.i(15080),l=e.i(71753);let u=new a.Vector3,c=new a.Vector3,h=new a.Vector3,d=new a.Vector2;function f(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let s=r.width/2,n=r.height/2;return[i.x*s+s,-(i.y*n)+n]}let p=e=>1e-10>Math.abs(e)?0:e;function m(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=p(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>m(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>m(e,r(t),"translate(-50%,-50%)")),y=s.forwardRef(({children:e,eps:t=.001,style:r,className:m,prepend:y,center:b,fullscreen:S,portal:x,distanceFactor:T,sprite:F=!1,transform:O=!1,occlude:R,onOcclude:E,castShadow:w,receiveShadow:M,material:C,geometry:P,zIndexRange:D=[0x1000037,0],calculatePosition:I=f,as:_="div",wrapperClass:U,pointerEvents:Q="auto",...k},L)=>{let{gl:j,camera:H,scene:W,size:A,raycaster:V,events:q,viewport:G}=(0,o.useThree)(),[z]=s.useState(()=>document.createElement(_)),N=s.useRef(null),$=s.useRef(null),K=s.useRef(0),Y=s.useRef([0,0]),B=s.useRef(null),J=s.useRef(null),Z=(null==x?void 0:x.current)||q.connected||j.domElement.parentNode,X=s.useRef(null),ee=s.useRef(!1),et=s.useMemo(()=>{var e;return R&&"blending"!==R||Array.isArray(R)&&R.length&&(e=R[0])&&"object"==typeof e&&"current"in e},[R]);s.useLayoutEffect(()=>{let e=j.domElement;R&&"blending"===R?(e.style.zIndex=`${Math.floor(D[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[R]),s.useLayoutEffect(()=>{if($.current){let e=N.current=n.createRoot(z);if(W.updateMatrixWorld(),O)z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=I($.current,H,A);z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(y?Z.prepend(z):Z.appendChild(z)),()=>{Z&&Z.removeChild(z),e.unmount()}}},[Z,O]),s.useLayoutEffect(()=>{U&&(z.className=U)},[U]);let er=s.useMemo(()=>O?{position:"absolute",top:0,left:0,width:A.width,height:A.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-A.height/2,left:-A.width/2,width:A.width,height:A.height},...r},[r,b,S,A,O]),ei=s.useMemo(()=>({position:"absolute",pointerEvents:Q}),[Q]);s.useLayoutEffect(()=>{var t,i;ee.current=!1,O?null==(t=N.current)||t.render(s.createElement("div",{ref:B,style:er},s.createElement("div",{ref:J,style:ei},s.createElement("div",{ref:L,className:m,style:r,children:e})))):null==(i=N.current)||i.render(s.createElement("div",{ref:L,style:er,className:m,children:e}))});let es=s.useRef(!0);(0,l.useFrame)(e=>{if($.current){H.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);let e=O?Y.current:I($.current,H,A);if(O||Math.abs(K.current-H.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,s,n,o=(r=$.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(H.matrixWorld),s=t.sub(i),n=H.getWorldDirection(h),s.angleTo(n)>Math.PI/2),l=!1;et&&(Array.isArray(R)?l=R.map(e=>e.current):"blending"!==R&&(l=[W]));let f=es.current;l?es.current=function(e,t,r,i){let s=u.setFromMatrixPosition(e.matrixWorld),n=s.clone();n.project(t),d.set(n.x,n.y),r.setFromCamera(d,t);let a=r.intersectObjects(i,!0);if(a.length){let e=a[0].distance;return s.distanceTo(r.ray.origin)({vertexShader:O?void 0:` + /* + This shader is from the THREE's SpriteMaterial. + We need to turn the backing plane into a Sprite + (make it always face the camera) if "transfrom" + is false. + */ + #include + + void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + // This is somewhat arbitrary, but it seems to work well + // Need to figure out how to derive this dynamically if it even matters + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; + } + `,fragmentShader:` + void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + `}),[O]);return s.createElement("group",(0,i.default)({},k,{ref:$}),R&&!et&&s.createElement("mesh",{castShadow:w,receiveShadow:M,ref:X},P||s.createElement("planeGeometry",null),C||s.createElement("shaderMaterial",{side:a.DoubleSide,vertexShader:en.vertexShader,fragmentShader:en.fragmentShader})))});e.s(["Html",()=>y])},19273,80166,e=>{"use strict";e.i(47167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>i,"timeoutManager",()=>r],80166);var s="u"=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:i,fetchStatus:s,predicate:n,queryKey:a,stale:o}=e;if(a){if(i){if(t.queryHash!==f(a,t.options))return!1}else if(!m(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:r,status:i,predicate:s,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(n))return!1}else if(!m(t.options.mutationKey,n))return!1}return(!i||t.state.status===i)&&(!s||!!s(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>m(e[r],t[r]))}var v=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return new Promise(t=>{r.setTimeout(t,e)})}function T(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let s=y(t)&&y(r);if(!s&&!(b(t)&&b(r)))return r;let n=(s?t:Object.keys(t)).length,a=s?r:Object.keys(r),o=a.length,l=s?Array(o):{},u=0;for(let c=0;cr?i.slice(1):i}function O(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var R=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==R?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function w(e,t){return"function"==typeof e?e(...t):!!e}function M(e,t,r){let i,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}e.s(["addConsumeAwareSignal",()=>M,"addToEnd",()=>F,"addToStart",()=>O,"ensureQueryFn",()=>E,"functionalUpdate",()=>a,"hashKey",()=>p,"hashQueryKeyByOptions",()=>f,"isServer",()=>s,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>m,"replaceData",()=>T,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>g,"shouldThrowError",()=>w,"skipToken",()=>R,"sleep",()=>x,"timeUntilStale",()=>l],19273)},40143,e=>{"use strict";let t,r,i,s,n,a;var o=e.i(80166).systemSetTimeoutZero,l=(t=[],r=0,i=e=>{e()},s=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{i(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>l])},15823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},75555,e=>{"use strict";var t=e.i(15823),r=e.i(19273),i=new class extends t.Subscribable{#r;#i;#s;constructor(){super(),this.#s=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>i])},86491,14448,93803,36553,88587,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),i=e.i(75555),s=e.i(15823),n=new class extends s.Subscribable{#n=!0;#i;#s;constructor(){super(),this.#s=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function a(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||n.isOnline()}e.s(["onlineManager",()=>n],14448),e.s(["pendingThenable",()=>a],93803);var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,s=!1,c=0,h=a(),d=()=>i.focusManager.isFocused()&&("always"===e.networkMode||n.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},m=e=>{"pending"===h.status&&(r?.(),h.reject(e))},v=()=>new Promise(t=>{r=e=>{("pending"!==h.status||d())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),g=()=>{let r;if("pending"!==h.status)return;let i=0===c?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(p).catch(r=>{if("pending"!==h.status)return;let i=e.retry??3*!t.isServer,n=e.retryDelay??o,a="function"==typeof n?n(c,r):n,l=!0===i||"number"==typeof i&&cd()?void 0:v()).then(()=>{s?m(r):g()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new u(t);m(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:f,start:()=>(f()?g():v().then(g),h)}}e.s(["CancelledError",()=>u,"canFetch",()=>l,"createRetryer",()=>c],36553);var h=e.i(80166),d=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>d],88587);var f=class extends d{#o;#l;#u;#c;#h;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=v(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=v(this.options);void 0!==e.data&&(this.setState(m(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#f?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,r){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,s.signal)})},a=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),s=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#f=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},o=(n(i={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),i);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#p({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof u){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...m(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>f,"fetchState",()=>p],86491)},12598,e=>{"use strict";var t=e.i(71645),r=e.i(43476),i=t.createContext(void 0),s=e=>{let r=t.useContext(i);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},n=({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(i.Provider,{value:e,children:s}));e.s(["QueryClientProvider",()=>n,"useQueryClient",()=>s])},69230,e=>{"use strict";var t=e.i(75555),r=e.i(40143),i=e.i(86491),s=e.i(15823),n=e.i(93803),a=e.i(19273),o=e.i(80166),l=class extends s.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#m=null,this.#v=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#y=void 0;#b=void 0;#S;#x;#v;#m;#T;#F;#O;#R;#E;#w;#M=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),u(this.#g,this.options)?this.#C():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#I(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,a.resolveEnabled)(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#g.setOptions(this.options),t._defaulted&&!(0,a.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let i=this.hasListeners();i&&h(this.#g,r,this.options,t)&&this.#C(),this.updateResult(),i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||(0,a.resolveStaleTime)(this.options.staleTime,this.#g)!==(0,a.resolveStaleTime)(t.staleTime,this.#g))&&this.#U();let s=this.#Q();i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||s!==this.#w)&&this.#k(s)}getOptimisticResult(e){var t,r;let i=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(i,e);return t=this,r=s,(0,a.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=s,this.#x=this.options,this.#S=this.#g.state),s}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#M.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#C({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#C(e){this.#_();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(a.noop)),t}#U(){this.#D();let e=(0,a.resolveStaleTime)(this.options.staleTime,this.#g);if(a.isServer||this.#b.isStale||!(0,a.isValidTimeout)(e))return;let t=(0,a.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#R=o.timeoutManager.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#k(e){this.#I(),this.#w=e,!a.isServer&&!1!==(0,a.resolveEnabled)(this.options.enabled,this.#g)&&(0,a.isValidTimeout)(this.#w)&&0!==this.#w&&(this.#E=o.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||t.focusManager.isFocused())&&this.#C()},this.#w))}#P(){this.#U(),this.#k(this.#Q())}#D(){this.#R&&(o.timeoutManager.clearTimeout(this.#R),this.#R=void 0)}#I(){this.#E&&(o.timeoutManager.clearInterval(this.#E),this.#E=void 0)}createResult(e,t){let r,s=this.#g,o=this.options,l=this.#b,c=this.#S,f=this.#x,p=e!==s?e.state:this.#y,{state:m}=e,v={...m},g=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&u(e,t),a=r&&h(e,s,t,o);(n||a)&&(v={...v,...(0,i.fetchState)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(v.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=v;r=v.data;let x=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===S){let e;l?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(e=l.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#O?.state.data,this.#O):t.placeholderData,void 0!==e&&(S="success",r=(0,a.replaceData)(l?.data,e,t),g=!0)}if(t.select&&void 0!==r&&!x)if(l&&r===c?.data&&t.select===this.#T)r=this.#F;else try{this.#T=t.select,r=t.select(r),r=(0,a.replaceData)(l?.data,r,t),this.#F=r,this.#m=null}catch(e){this.#m=e}this.#m&&(y=this.#m,r=this.#F,b=Date.now(),S="error");let T="fetching"===v.fetchStatus,F="pending"===S,O="error"===S,R=F&&T,E=void 0!==r,w={status:S,fetchStatus:v.fetchStatus,isPending:F,isSuccess:"success"===S,isError:O,isInitialLoading:R,isLoading:R,data:r,dataUpdatedAt:v.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!F,isLoadingError:O&&!E,isPaused:"paused"===v.fetchStatus,isPlaceholderData:g,isRefetchError:O&&E,isStale:d(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,a.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,r="error"===w.status&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{i(this.#v=w.promise=(0,n.pendingThenable)())},o=this.#v;switch(o.status){case"pending":e.queryHash===s.queryHash&&i(o);break;case"fulfilled":(r||w.data!==o.value)&&a();break;case"rejected":r&&w.error===o.reason||a()}}return w}updateResult(){let e=this.#b,t=this.createResult(this.#g,this.options);if(this.#S=this.#g.state,this.#x=this.options,void 0!==this.#S.data&&(this.#O=this.#g),(0,a.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#M.size)return!0;let i=new Set(r??this.#M);return this.options.throwOnError&&i.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&i.has(t))};this.#L({listeners:r()})}#_(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#L(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function u(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,a.resolveEnabled)(t.enabled,e)&&"static"!==(0,a.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&d(e,t)}return!1}function h(e,t,r,i){return(e!==t||!1===(0,a.resolveEnabled)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&d(e,r)}function d(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",()=>l])},69637,54440,e=>{"use strict";let t;e.i(47167);var r=e.i(71645),i=e.i(19273),s=e.i(40143),n=e.i(12598);e.i(43476);var a=r.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),o=r.createContext(!1);o.Provider;var l=(e,t)=>void 0===t.state.data,u=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},c=(e,t)=>e.isLoading&&e.isFetching&&!t,h=(e,t)=>e?.suspense&&t.isPending,d=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function f(e,t,l){let f,p=r.useContext(o),m=r.useContext(a),v=(0,n.useQueryClient)(l),g=v.defaultQueryOptions(e);v.getDefaultOptions().queries?._experimental_beforeQuery?.(g);let y=v.getQueryCache().get(g.queryHash);g._optimisticResults=p?"isRestoring":"optimistic",u(g),f=y?.state.error&&"function"==typeof g.throwOnError?(0,i.shouldThrowError)(g.throwOnError,[y.state.error,y]):g.throwOnError,(g.suspense||g.experimental_prefetchInRender||f)&&!m.isReset()&&(g.retryOnMount=!1),r.useEffect(()=>{m.clearReset()},[m]);let b=!v.getQueryCache().get(g.queryHash),[S]=r.useState(()=>new t(v,g)),x=S.getOptimisticResult(g),T=!p&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{let t=T?S.subscribe(s.notifyManager.batchCalls(e)):i.noop;return S.updateResult(),t},[S,T]),()=>S.getCurrentResult(),()=>S.getCurrentResult()),r.useEffect(()=>{S.setOptions(g)},[g,S]),h(g,x))throw d(g,S,m);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||(0,i.shouldThrowError)(r,[e.error,s])))({result:x,errorResetBoundary:m,throwOnError:g.throwOnError,query:y,suspense:g.suspense}))throw x.error;if(v.getDefaultOptions().queries?._experimental_afterQuery?.(g,x),g.experimental_prefetchInRender&&!i.isServer&&c(x,p)){let e=b?d(g,S,m):y?.promise;e?.catch(i.noop).finally(()=>{S.updateResult()})}return g.notifyOnChangeProps?x:S.trackResult(x)}e.s(["defaultThrowOnError",()=>l,"ensureSuspenseTimers",()=>u,"fetchOptimistic",()=>d,"shouldSuspend",()=>h,"willFetch",()=>c],54440),e.s(["useBaseQuery",()=>f],69637)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/99bc9f3ae93187f1.css b/docs/_next/static/chunks/99bc9f3ae93187f1.css deleted file mode 100644 index a2253092..00000000 --- a/docs/_next/static/chunks/99bc9f3ae93187f1.css +++ /dev/null @@ -1 +0,0 @@ -.DemoPlaybackControls-module__A_AHSq__Root{color:#fff;z-index:2;background:#000000b3;align-items:center;gap:10px;padding:8px 12px;font-size:13px;display:flex;position:fixed;bottom:0;left:0;right:0}.DemoPlaybackControls-module__A_AHSq__PlayPause{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;font-size:14px;display:flex}@media (hover:hover){.DemoPlaybackControls-module__A_AHSq__PlayPause:hover{background:#0062b3cc}}.DemoPlaybackControls-module__A_AHSq__Time{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}.DemoPlaybackControls-module__A_AHSq__Seek[type=range]{flex:1 1 0;min-width:0;max-width:none}.DemoPlaybackControls-module__A_AHSq__Speed{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:2px 4px;font-size:12px} diff --git a/docs/_next/static/chunks/9a99559140e82f06.js b/docs/_next/static/chunks/9a99559140e82f06.js new file mode 100644 index 00000000..83e5c30c --- /dev/null +++ b/docs/_next/static/chunks/9a99559140e82f06.js @@ -0,0 +1,362 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66936,(e,n,t)=>{"use strict";function r(e,n){var t=e.length;for(e.push(n);0>>1,a=e[r];if(0>>1;ro(s,t))uo(c,s)?(e[r]=c,e[u]=t,r=u):(e[r]=s,e[l]=t,r=l);else if(uo(c,t))e[r]=c,e[u]=t,r=u;else break}}return n}function o(e,n){var t=e.sortIndex-n.sortIndex;return 0!==t?t:e.id-n.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,s=performance;t.unstable_now=function(){return s.now()}}else{var u=Date,c=u.now();t.unstable_now=function(){return u.now()-c}}var d=[],f=[],p=1,m=null,h=3,g=!1,_=!1,v=!1,S=!1,E="function"==typeof setTimeout?setTimeout:null,T="function"==typeof clearTimeout?clearTimeout:null,M="u">typeof setImmediate?setImmediate:null;function b(e){for(var n=a(f);null!==n;){if(null===n.callback)i(f);else if(n.startTime<=e)i(f),n.sortIndex=n.expirationTime,r(d,n);else break;n=a(f)}}function x(e){if(v=!1,b(e),!_)if(null!==a(d))_=!0,R||(R=!0,l());else{var n=a(f);null!==n&&U(x,n.startTime-e)}}var R=!1,C=-1,y=5,A=-1;function P(){return!!S||!(t.unstable_now()-Ae&&P());){var o=m.callback;if("function"==typeof o){m.callback=null,h=m.priorityLevel;var s=o(m.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof s){m.callback=s,b(e),n=!0;break n}m===a(d)&&i(d),b(e)}else i(d);m=a(d)}if(null!==m)n=!0;else{var u=a(f);null!==u&&U(x,u.startTime-e),n=!1}}break e}finally{m=null,h=r,g=!1}}}finally{n?l():R=!1}}}if("function"==typeof M)l=function(){M(w)};else if("u">typeof MessageChannel){var L=new MessageChannel,N=L.port2;L.port1.onmessage=w,l=function(){N.postMessage(null)}}else l=function(){E(w,0)};function U(e,n){C=E(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=i,r(f,e),null===a(d)&&e===a(f)&&(v?(T(C),C=-1):v=!0,U(x,i-o))):(e.sortIndex=s,r(d,e),_||g||(_=!0,R||(R=!0,l()))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var n=h;return function(){var t=h;h=n;try{return e.apply(this,arguments)}finally{h=t}}}},89499,(e,n,t)=>{"use strict";n.exports=e.r(66936)},40859,8560,46791,e=>{"use strict";let n,t,r,a,i,o,l,s,u;var c,d,f,p,m,h,g=e.i(47167),_=e.i(71645),v=e.i(90072),S=v;function E(){let e=null,n=!1,t=null,r=null;function a(n,i){t(n,i),r=e.requestAnimationFrame(a)}return{start:function(){!0===n||null!==t&&(r=e.requestAnimationFrame(a),n=!0)},stop:function(){e.cancelAnimationFrame(r),n=!1},setAnimationLoop:function(e){t=e},setContext:function(n){e=n}}}function T(e){let n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);let r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,r){if(t.isInterleavedBufferAttribute&&(t=t.data),t.isGLBufferAttribute){let e=n.get(t);(!e||e.versiontypeof Float16Array&&a instanceof Float16Array)r=e.HALF_FLOAT;else if(a instanceof Uint16Array)r=n.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(a instanceof Int16Array)r=e.SHORT;else if(a instanceof Uint32Array)r=e.UNSIGNED_INT;else if(a instanceof Int32Array)r=e.INT;else if(a instanceof Int8Array)r=e.BYTE;else if(a instanceof Uint8Array)r=e.UNSIGNED_BYTE;else if(a instanceof Uint8ClampedArray)r=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+a);return{buffer:l,type:r,bytesPerElement:a.BYTES_PER_ELEMENT,version:n.version,size:o}}(t,r));else if(a.versione.start-n.start);let n=0;for(let e=1;e 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_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\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 #else\n vec4 envColor = vec4( 0.0 );\n #endif\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",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 + ( vec3( 1.0 ) - 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 }\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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\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 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 return depth * ( near - far ) - near;\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 return ( near * far ) / ( ( far - near ) * depth - far );\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 ) * 6.28318530718;\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 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 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 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 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 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 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\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 ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).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 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 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, dp );\n #else\n shadow = step( dp, depth );\n #endif\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 \n #include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \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 \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 \n #include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \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 \n #include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \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 \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include \n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \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 \n #include \n #include \n #include \n #include \n #include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \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 \n #include \n #include \n #include \n #include \n #include \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 \n #include \n #include \n #include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \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 \n #include \n #include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"},b={common:{diffuse:{value:new S.Color(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new S.Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new S.Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new S.Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new S.Matrix3},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 S.Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new S.Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new S.Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new S.Matrix3},normalScale:{value:new S.Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new S.Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new S.Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new S.Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new S.Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new S.Color(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},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 S.Color(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new S.Matrix3},alphaTest:{value:0},uvTransform:{value:new S.Matrix3}},sprite:{diffuse:{value:new S.Color(0xffffff)},opacity:{value:1},center:{value:new S.Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new S.Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new S.Matrix3},alphaTest:{value:0}}},x={basic:{uniforms:(0,S.mergeUniforms)([b.common,b.specularmap,b.envmap,b.aomap,b.lightmap,b.fog]),vertexShader:M.meshbasic_vert,fragmentShader:M.meshbasic_frag},lambert:{uniforms:(0,S.mergeUniforms)([b.common,b.specularmap,b.envmap,b.aomap,b.lightmap,b.emissivemap,b.bumpmap,b.normalmap,b.displacementmap,b.fog,b.lights,{emissive:{value:new S.Color(0)}}]),vertexShader:M.meshlambert_vert,fragmentShader:M.meshlambert_frag},phong:{uniforms:(0,S.mergeUniforms)([b.common,b.specularmap,b.envmap,b.aomap,b.lightmap,b.emissivemap,b.bumpmap,b.normalmap,b.displacementmap,b.fog,b.lights,{emissive:{value:new S.Color(0)},specular:{value:new S.Color(1118481)},shininess:{value:30}}]),vertexShader:M.meshphong_vert,fragmentShader:M.meshphong_frag},standard:{uniforms:(0,S.mergeUniforms)([b.common,b.envmap,b.aomap,b.lightmap,b.emissivemap,b.bumpmap,b.normalmap,b.displacementmap,b.roughnessmap,b.metalnessmap,b.fog,b.lights,{emissive:{value:new S.Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:M.meshphysical_vert,fragmentShader:M.meshphysical_frag},toon:{uniforms:(0,S.mergeUniforms)([b.common,b.aomap,b.lightmap,b.emissivemap,b.bumpmap,b.normalmap,b.displacementmap,b.gradientmap,b.fog,b.lights,{emissive:{value:new S.Color(0)}}]),vertexShader:M.meshtoon_vert,fragmentShader:M.meshtoon_frag},matcap:{uniforms:(0,S.mergeUniforms)([b.common,b.bumpmap,b.normalmap,b.displacementmap,b.fog,{matcap:{value:null}}]),vertexShader:M.meshmatcap_vert,fragmentShader:M.meshmatcap_frag},points:{uniforms:(0,S.mergeUniforms)([b.points,b.fog]),vertexShader:M.points_vert,fragmentShader:M.points_frag},dashed:{uniforms:(0,S.mergeUniforms)([b.common,b.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:M.linedashed_vert,fragmentShader:M.linedashed_frag},depth:{uniforms:(0,S.mergeUniforms)([b.common,b.displacementmap]),vertexShader:M.depth_vert,fragmentShader:M.depth_frag},normal:{uniforms:(0,S.mergeUniforms)([b.common,b.bumpmap,b.normalmap,b.displacementmap,{opacity:{value:1}}]),vertexShader:M.meshnormal_vert,fragmentShader:M.meshnormal_frag},sprite:{uniforms:(0,S.mergeUniforms)([b.sprite,b.fog]),vertexShader:M.sprite_vert,fragmentShader:M.sprite_frag},background:{uniforms:{uvTransform:{value:new S.Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:M.background_vert,fragmentShader:M.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new S.Matrix3}},vertexShader:M.backgroundCube_vert,fragmentShader:M.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:M.cube_vert,fragmentShader:M.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:M.equirect_vert,fragmentShader:M.equirect_frag},distance:{uniforms:(0,S.mergeUniforms)([b.common,b.displacementmap,{referencePosition:{value:new S.Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:M.distance_vert,fragmentShader:M.distance_frag},shadow:{uniforms:(0,S.mergeUniforms)([b.lights,b.fog,{color:{value:new S.Color(0)},opacity:{value:1}}]),vertexShader:M.shadow_vert,fragmentShader:M.shadow_frag}};x.physical={uniforms:(0,S.mergeUniforms)([x.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new S.Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new S.Matrix3},clearcoatNormalScale:{value:new S.Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new S.Matrix3},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new S.Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new S.Matrix3},sheen:{value:0},sheenColor:{value:new S.Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new S.Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new S.Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new S.Matrix3},transmissionSamplerSize:{value:new S.Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new S.Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new S.Color(0)},specularColor:{value:new S.Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new S.Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new S.Matrix3},anisotropyVector:{value:new S.Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new S.Matrix3}}]),vertexShader:M.meshphysical_vert,fragmentShader:M.meshphysical_frag};let R={r:0,b:0,g:0},C=new S.Euler,y=new S.Matrix4;function A(e,n,t,r,a,i,o){let l,s,u=new S.Color(0),c=+(!0!==i),d=null,f=0,p=null;function m(e){let r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?t:n).get(r)),r}function h(n,t){n.getRGB(R,(0,S.getUnlitUniformColorSpace)(e)),r.buffers.color.setClear(R.r,R.g,R.b,t,o)}return{getClearColor:function(){return u},setClearColor:function(e,n=1){u.set(e),h(u,c=n)},getClearAlpha:function(){return c},setClearAlpha:function(e){h(u,c=e)},render:function(n){let t=!1,a=m(n);null===a?h(u,c):a&&a.isColor&&(h(a,1),t=!0);let i=e.xr.getEnvironmentBlendMode();"additive"===i?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===i&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||t)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(n,t){let r=m(t);r&&(r.isCubeTexture||r.mapping===S.CubeUVReflectionMapping)?(void 0===s&&((s=new S.Mesh(new S.BoxGeometry(1,1,1),new S.ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:(0,S.cloneUniforms)(x.backgroundCube.uniforms),vertexShader:x.backgroundCube.vertexShader,fragmentShader:x.backgroundCube.fragmentShader,side:S.BackSide,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,n,t){this.matrixWorld.copyPosition(t.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(s)),C.copy(t.backgroundRotation),C.x*=-1,C.y*=-1,C.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(C.y*=-1,C.z*=-1),s.material.uniforms.envMap.value=r,s.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,s.material.uniforms.backgroundBlurriness.value=t.backgroundBlurriness,s.material.uniforms.backgroundIntensity.value=t.backgroundIntensity,s.material.uniforms.backgroundRotation.value.setFromMatrix4(y.makeRotationFromEuler(C)),s.material.toneMapped=S.ColorManagement.getTransfer(r.colorSpace)!==S.SRGBTransfer,(d!==r||f!==r.version||p!==e.toneMapping)&&(s.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),s.layers.enableAll(),n.unshift(s,s.geometry,s.material,0,0,null)):r&&r.isTexture&&(void 0===l&&((l=new S.Mesh(new S.PlaneGeometry(2,2),new S.ShaderMaterial({name:"BackgroundMaterial",uniforms:(0,S.cloneUniforms)(x.background.uniforms),vertexShader:x.background.vertexShader,fragmentShader:x.background.fragmentShader,side:S.FrontSide,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=t.backgroundIntensity,l.material.toneMapped=S.ColorManagement.getTransfer(r.colorSpace)!==S.SRGBTransfer,!0===r.matrixAutoUpdate&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),(d!==r||f!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),n.unshift(l,l.geometry,l.material,0,0,null))},dispose:function(){void 0!==s&&(s.geometry.dispose(),s.material.dispose(),s=void 0),void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}}}function P(e,n){let t=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},a=u(null),i=a,o=!1;function l(n){return e.bindVertexArray(n)}function s(n){return e.deleteVertexArray(n)}function u(e){let n=[],r=[],a=[];for(let e=0;e=0){let t=a[n],r=o[n];if(void 0===r&&("instanceMatrix"===n&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===n&&e.instanceColor&&(r=e.instanceColor)),void 0===t||t.attribute!==r||r&&t.data!==r.data)return!0;l++}return i.attributesNum!==l||i.index!==r}(t,h,s,g))&&function(e,n,t,r){let a={},o=n.attributes,l=0,s=t.getAttributes();for(let n in s)if(s[n].location>=0){let t=o[n];void 0===t&&("instanceMatrix"===n&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===n&&e.instanceColor&&(t=e.instanceColor));let r={};r.attribute=t,t&&t.data&&(r.data=t.data),a[n]=r,l++}i.attributes=a,i.attributesNum=l,i.index=r}(t,h,s,g),null!==g&&n.update(g,e.ELEMENT_ARRAY_BUFFER),(x||o)&&(o=!1,function(t,r,a,i){c();let o=i.attributes,l=a.getAttributes(),s=r.defaultAttributeValues;for(let r in l){let a=l[r];if(a.location>=0){let l=o[r];if(void 0===l&&("instanceMatrix"===r&&t.instanceMatrix&&(l=t.instanceMatrix),"instanceColor"===r&&t.instanceColor&&(l=t.instanceColor)),void 0!==l){let r=l.normalized,o=l.itemSize,s=n.get(l);if(void 0===s)continue;let u=s.buffer,c=s.type,p=s.bytesPerElement,h=c===e.INT||c===e.UNSIGNED_INT||l.gpuType===S.IntType;if(l.isInterleavedBufferAttribute){let n=l.data,s=n.stride,g=l.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";n="mediump"}return"mediump"===n&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==t.precision?t.precision:"highp",l=i(o);return l!==o&&((0,S.warn)("WebGLRenderer:",o,"not supported, using",l,"instead."),o=l),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==a)return a;if(!0===n.has("EXT_texture_filter_anisotropic")){let t=n.get("EXT_texture_filter_anisotropic");a=e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else a=0;return a},getMaxPrecision:i,textureFormatReadable:function(n){return n===S.RGBAFormat||r.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(t){let a=t===S.HalfFloatType&&(n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float"));return t===S.UnsignedByteType||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||t===S.FloatType||!!a},precision:o,logarithmicDepthBuffer:!0===t.logarithmicDepthBuffer,reversedDepthBuffer:!0===t.reversedDepthBuffer&&n.has("EXT_clip_control"),maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function N(e){let n=this,t=null,r=0,a=!1,i=!1,o=new S.Plane,l=new S.Matrix3,s={value:null,needsUpdate:!1};function u(e,t,r,a){let i=null!==e?e.length:0,u=null;if(0!==i){if(u=s.value,!0!==a||null===u){let n=r+4*i,a=t.matrixWorldInverse;l.getNormalMatrix(a),(null===u||u.length0),n.numPlanes=r,n.numIntersection=0)}}function U(e){let n=new WeakMap;function t(e,n){return n===S.EquirectangularReflectionMapping?e.mapping=S.CubeReflectionMapping:n===S.EquirectangularRefractionMapping&&(e.mapping=S.CubeRefractionMapping),e}function r(e){let t=e.target;t.removeEventListener("dispose",r);let a=n.get(t);void 0!==a&&(n.delete(t),a.dispose())}return{get:function(a){if(a&&a.isTexture){let i=a.mapping;if(i===S.EquirectangularReflectionMapping||i===S.EquirectangularRefractionMapping)if(n.has(a))return t(n.get(a).texture,a.mapping);else{let i=a.image;if(!i||!(i.height>0))return null;{let o=new S.WebGLCubeRenderTarget(i.height);return o.fromEquirectangularTexture(e,a),n.set(a,o),a.addEventListener("dispose",r),t(o.texture,a.mapping)}}}return a},dispose:function(){n=new WeakMap}}}let D=[.125,.215,.35,.446,.526,.582],I=new S.OrthographicCamera,F=new S.Color,O=null,B=0,G=0,H=!1,k=new S.Vector3;class V{constructor(e){this._renderer=e,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(e,n=0,t=.1,r=100,a={}){let{size:i=256,position:o=k}=a;O=this._renderer.getRenderTarget(),B=this._renderer.getActiveCubeFace(),G=this._renderer.getActiveMipmapLevel(),H=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(i);let l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,t,r,l,o),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=j(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=X(),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(e){this._lodMax=Math.floor(Math.log2(e)),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 e=0;ee-4?l=D[o-e+4-1]:0===o&&(l=0),t.push(l);let s=1/(i-2),u=-s,c=1+s,d=[u,u,c,u,c,c,u,u,c,c,u,c],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let n=e%3*2/3-1,t=e>2?0:-1,r=[n,t,0,n+2/3,t,0,n+2/3,t+1,0,n,t,0,n+2/3,t+1,0,n,t+1,0];f.set(r,18*e),p.set(d,12*e);let a=[e,e,e,e,e,e];m.set(a,6*e)}let h=new S.BufferGeometry;h.setAttribute("position",new S.BufferAttribute(f,3)),h.setAttribute("uv",new S.BufferAttribute(p,2)),h.setAttribute("faceIndex",new S.BufferAttribute(m,1)),r.push(new S.Mesh(h,null)),a>4&&a--}return{lodMeshes:r,sizeLods:n,sigmas:t}}(d)),this._blurMaterial=(a=d,i=e,o=n,r=new Float32Array(20),c=new S.Vector3(0,1,0),new S.ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/i,CUBEUV_TEXEL_HEIGHT:1/o,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:c}},vertexShader:q(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:S.NoBlending,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(l=d,s=e,u=n,new S.ShaderMaterial({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/s,CUBEUV_TEXEL_HEIGHT:1/u,CUBEUV_MAX_MIP:`${l}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:q(),fragmentShader:` + + precision highp float; + precision highp int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform float roughness; + uniform float mipInt; + + #define ENVMAP_TYPE_CUBE_UV + #include + + #define PI 3.14159265359 + + // Van der Corput radical inverse + float radicalInverse_VdC(uint bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10; // / 0x100000000 + } + + // Hammersley sequence + vec2 hammersley(uint i, uint N) { + return vec2(float(i) / float(N), radicalInverse_VdC(i)); + } + + // GGX VNDF importance sampling (Eric Heitz 2018) + // "Sampling the GGX Distribution of Visible Normals" + // https://jcgt.org/published/0007/04/01/ + vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { + float alpha = roughness * roughness; + + // Section 3.2: Transform view direction to hemisphere configuration + vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); + + // Section 4.1: Orthonormal basis + float lensq = Vh.x * Vh.x + Vh.y * Vh.y; + vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); + vec3 T2 = cross(Vh, T1); + + // Section 4.2: Parameterization of projected area + float r = sqrt(Xi.x); + float phi = 2.0 * PI * Xi.y; + float t1 = r * cos(phi); + float t2 = r * sin(phi); + float s = 0.5 * (1.0 + Vh.z); + t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; + + // Section 4.3: Reprojection onto hemisphere + vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; + + // Section 3.4: Transform back to ellipsoid configuration + return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); + } + + void main() { + vec3 N = normalize(vOutputDirection); + vec3 V = N; // Assume view direction equals normal for pre-filtering + + vec3 prefilteredColor = vec3(0.0); + float totalWeight = 0.0; + + // For very low roughness, just sample the environment directly + if (roughness < 0.001) { + gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); + return; + } + + // Tangent space basis for VNDF sampling + vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + + for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { + vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); + + // For PMREM, V = N, so in tangent space V is always (0, 0, 1) + vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); + + // Transform H back to world space + vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); + vec3 L = normalize(2.0 * dot(V, H) * H - V); + + float NdotL = max(dot(N, L), 0.0); + + if(NdotL > 0.0) { + // Sample environment at fixed mip level + // VNDF importance sampling handles the distribution filtering + vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); + + // Weight by NdotL for the split-sum approximation + // VNDF PDF naturally accounts for the visible microfacet distribution + prefilteredColor += sampleColor * NdotL; + totalWeight += NdotL; + } + } + + if (totalWeight > 0.0) { + prefilteredColor = prefilteredColor / totalWeight; + } + + gl_FragColor = vec4(prefilteredColor, 1.0); + } + `,blending:S.NoBlending,depthTest:!1,depthWrite:!1}))}return r}_compileMaterial(e){let n=new S.Mesh(new S.BufferGeometry,e);this._renderer.compile(n,I)}_sceneToCubeUV(e,n,t,r,a){let i=new S.PerspectiveCamera(90,1,n,t),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],s=this._renderer,u=s.autoClear,c=s.toneMapping;s.getClearColor(F),s.toneMapping=S.NoToneMapping,s.autoClear=!1,s.state.buffers.depth.getReversed()&&(s.setRenderTarget(r),s.clearDepth(),s.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new S.Mesh(new S.BoxGeometry,new S.MeshBasicMaterial({name:"PMREM.Background",side:S.BackSide,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(F),p=!0);for(let n=0;n<6;n++){let t=n%3;0===t?(i.up.set(0,o[n],0),i.position.set(a.x,a.y,a.z),i.lookAt(a.x+l[n],a.y,a.z)):1===t?(i.up.set(0,0,o[n]),i.position.set(a.x,a.y,a.z),i.lookAt(a.x,a.y+l[n],a.z)):(i.up.set(0,o[n],0),i.position.set(a.x,a.y,a.z),i.lookAt(a.x,a.y,a.z+l[n]));let u=this._cubeSize;W(r,t*u,n>2?u:0,u,u),s.setRenderTarget(r),p&&s.render(d,i),s.render(e,i)}s.toneMapping=c,s.autoClear=u,e.background=m}_textureToCubeUV(e,n){let t=this._renderer,r=e.mapping===S.CubeReflectionMapping||e.mapping===S.CubeRefractionMapping;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=j()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=X());let a=r?this._cubemapMaterial:this._equirectMaterial,i=this._lodMeshes[0];i.material=a,a.uniforms.envMap.value=e;let o=this._cubeSize;W(n,0,0,3*o,2*o),t.setRenderTarget(n),t.render(i,I)}_applyPMREM(e){let n=this._renderer,t=n.autoClear;n.autoClear=!1;let r=this._lodMeshes.length;for(let n=1;nd-4?t-d+4:0),m=4*(this._cubeSize-f);l.envMap.value=e.texture,l.roughness.value=c*(0+1.25*s),l.mipInt.value=d-n,W(a,p,m,3*f,2*f),r.setRenderTarget(a),r.render(o,I),l.envMap.value=a.texture,l.roughness.value=0,l.mipInt.value=d-t,W(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,I)}_blur(e,n,t,r,a){let i=this._pingPongRenderTarget;this._halfBlur(e,i,n,t,r,"latitudinal",a),this._halfBlur(i,e,t,t,r,"longitudinal",a)}_halfBlur(e,n,t,r,a,i,o){let l=this._renderer,s=this._blurMaterial;"latitudinal"!==i&&"longitudinal"!==i&&(0,S.error)("blur direction must be either latitudinal or longitudinal!");let u=this._lodMeshes[r];u.material=s;let c=s.uniforms,d=this._sizeLods[t]-1,f=isFinite(a)?Math.PI/(2*d):2*Math.PI/39,p=a/f,m=isFinite(a)?1+Math.floor(3*p):20;m>20&&(0,S.warn)(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);let h=[],g=0;for(let e=0;e<20;++e){let n=e/p,t=Math.exp(-n*n/2);h.push(t),0===e?g+=t:e_-4?r-_+4:0),E,3*v,2*v),l.setRenderTarget(n),l.render(u,I)}}function z(e,n,t){let r=new S.WebGLRenderTarget(e,n,t);return r.texture.mapping=S.CubeUVReflectionMapping,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function W(e,n,t,r,a){e.viewport.set(n,t,r,a),e.scissor.set(n,t,r,a)}function X(){return new S.ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:q(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:S.NoBlending,depthTest:!1,depthWrite:!1})}function j(){return new S.ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:q(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:S.NoBlending,depthTest:!1,depthWrite:!1})}function q(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function Y(e){let n=new WeakMap,t=null;function r(e){let t=e.target;t.removeEventListener("dispose",r);let a=n.get(t);void 0!==a&&(n.delete(t),a.dispose())}return{get:function(a){if(a&&a.isTexture){let i=a.mapping,o=i===S.EquirectangularReflectionMapping||i===S.EquirectangularRefractionMapping,l=i===S.CubeReflectionMapping||i===S.CubeRefractionMapping;if(o||l){let i=n.get(a),s=void 0!==i?i.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==s)return null===t&&(t=new V(e)),(i=o?t.fromEquirectangular(a,i):t.fromCubemap(a,i)).texture.pmremVersion=a.pmremVersion,n.set(a,i),i.texture;{if(void 0!==i)return i.texture;let s=a.image;return o&&s&&s.height>0||l&&s&&function(e){let n=0;for(let t=0;t<6;t++)void 0!==e[t]&&n++;return 6===n}(s)?(null===t&&(t=new V(e)),(i=o?t.fromEquirectangular(a):t.fromCubemap(a)).texture.pmremVersion=a.pmremVersion,n.set(a,i),a.addEventListener("dispose",r),i.texture):null}}}return a},dispose:function(){n=new WeakMap,null!==t&&(t.dispose(),t=null)}}}function K(e){let n={};function t(t){if(void 0!==n[t])return n[t];let r=e.getExtension(t);return n[t]=r,r}return{has:function(e){return null!==t(e)},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(e){let n=t(e);return null===n&&(0,S.warnOnce)("WebGLRenderer: "+e+" extension not supported."),n}}}function $(e,n,t,r){let a={},i=new WeakMap;function o(e){let l=e.target;for(let e in null!==l.index&&n.remove(l.index),l.attributes)n.remove(l.attributes[e]);l.removeEventListener("dispose",o),delete a[l.id];let s=i.get(l);s&&(n.remove(s),i.delete(l)),r.releaseStatesOfGeometry(l),!0===l.isInstancedBufferGeometry&&delete l._maxInstanceCount,t.memory.geometries--}function l(e){let t=[],r=e.index,a=e.attributes.position,o=0;if(null!==r){let e=r.array;o=r.version;for(let n=0,r=e.length;nn.maxTextureSize&&(m=Math.ceil(p/n.maxTextureSize),p=n.maxTextureSize);let h=new Float32Array(p*m*4*c),g=new S.DataArrayTexture(h,p,m,c);g.type=S.FloatType,g.needsUpdate=!0;let _=4*f;for(let n=0;n + #include + + void main() { + gl_FragColor = texture2D( tDiffuse, vUv ); + + #ifdef LINEAR_TONE_MAPPING + gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); + #elif defined( REINHARD_TONE_MAPPING ) + gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); + #elif defined( CINEON_TONE_MAPPING ) + gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); + #elif defined( ACES_FILMIC_TONE_MAPPING ) + gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); + #elif defined( AGX_TONE_MAPPING ) + gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); + #elif defined( NEUTRAL_TONE_MAPPING ) + gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); + #elif defined( CUSTOM_TONE_MAPPING ) + gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); + #endif + + #ifdef SRGB_TRANSFER + gl_FragColor = sRGBTransferOETF( gl_FragColor ); + #endif + }`,depthTest:!1,depthWrite:!1}),c=new S.Mesh(s,u),d=new S.OrthographicCamera(-1,1,1,-1,0,1),f=null,p=null,m=!1,h=null,g=[],_=!1;this.setSize=function(e,n){o.setSize(e,n),l.setSize(e,n);for(let t=0;t0&&!0===g[0].isRenderPass;let n=o.width,t=o.height;for(let e=0;e0)return e;let a=n*t,i=es[a];if(void 0===i&&(i=new Float32Array(a),es[a]=i),0!==n){r.toArray(i,0);for(let r=1,a=0;r!==n;++r)a+=t,e[r].toArray(i,a)}return i}function em(e,n){if(e.length!==n.length)return!1;for(let t=0,r=e.length;t0&&(this.seq=r.concat(a))}setValue(e,n,t,r){let a=this.map[n];void 0!==a&&a.setValue(e,t,r)}setOptional(e,n,t){let r=n[t];void 0!==r&&this.setValue(e,t,r)}static upload(e,n,t,r){for(let a=0,i=n.length;a!==i;++a){let i=n[a],o=t[i.id];!1!==o.needsUpdate&&i.setValue(e,o.value,r)}}static seqWithValue(e,n){let t=[];for(let r=0,a=e.length;r!==a;++r){let a=e[r];a.id in n&&t.push(a)}return t}}function e8(e,n,t){let r=e.createShader(n);return e.shaderSource(r,t),e.compileShader(r),r}let e9=0,e7=new S.Matrix3;function ne(e,n,t){let r=e.getShaderParameter(n,e.COMPILE_STATUS),a=(e.getShaderInfoLog(n)||"").trim();if(r&&""===a)return"";let i=/ERROR: 0:(\d+)/.exec(a);if(!i)return a;{let r=parseInt(i[1]);return t.toUpperCase()+"\n\n"+a+"\n\n"+function(e,n){let t=e.split("\n"),r=[],a=Math.max(n-6,0),i=Math.min(n+6,t.length);for(let e=a;e":" "} ${a}: ${t[e]}`)}return r.join("\n")}(e.getShaderSource(n),r)}}let nn={[S.LinearToneMapping]:"Linear",[S.ReinhardToneMapping]:"Reinhard",[S.CineonToneMapping]:"Cineon",[S.ACESFilmicToneMapping]:"ACESFilmic",[S.AgXToneMapping]:"AgX",[S.NeutralToneMapping]:"Neutral",[S.CustomToneMapping]:"Custom"},nt=new S.Vector3;function nr(e){return""!==e}function na(e,n){let t=n.numSpotLightShadows+n.numSpotLightMaps-n.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,n.numDirLights).replace(/NUM_SPOT_LIGHTS/g,n.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,n.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,n.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,n.numPointLights).replace(/NUM_HEMI_LIGHTS/g,n.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,n.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,n.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,n.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,n.numPointLightShadows)}function ni(e,n){return e.replace(/NUM_CLIPPING_PLANES/g,n.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,n.numClippingPlanes-n.numClipIntersection)}let no=/^[ \t]*#include +<([\w\d./]+)>/gm;function nl(e){return e.replace(no,nu)}let ns=new Map;function nu(e,n){let t=M[n];if(void 0===t){let e=ns.get(n);if(void 0!==e)t=M[e],(0,S.warn)('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',n,e);else throw Error("Can not resolve #include <"+n+">")}return nl(t)}let nc=/#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 nd(e){return e.replace(nc,nf)}function nf(e,n,t,r){let a="";for(let e=parseInt(n);e0&&(o+="\n"),(l=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,T].filter(nr).join("\n")).length>0&&(l+="\n");else{let e,n,r,s,u;o=[np(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,T,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+g:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&!1===t.flatShading?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&!1===t.flatShading?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+m:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.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(nr).join("\n"),l=[np(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,T,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+g:"",t.envMap?"#define "+_:"",v?"#define CUBEUV_TEXEL_WIDTH "+v.texelWidth:"",v?"#define CUBEUV_TEXEL_HEIGHT "+v.texelHeight:"",v?"#define CUBEUV_MAX_MIP "+v.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&!1===t.flatShading?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+m:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==S.NoToneMapping?"#define TONE_MAPPING":"",t.toneMapping!==S.NoToneMapping?M.tonemapping_pars_fragment:"",t.toneMapping!==S.NoToneMapping?(a="toneMapping",void 0===(e=nn[i=t.toneMapping])?((0,S.warn)("WebGLProgram: Unsupported toneMapping:",i),"vec3 "+a+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+a+"( vec3 color ) { return "+e+"ToneMapping( color ); }"):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",M.colorspace_pars_fragment,(n=function(e){S.ColorManagement._getMatrix(e7,S.ColorManagement.workingColorSpace,e);let n=`mat3( ${e7.elements.map(e=>e.toFixed(4))} )`;switch(S.ColorManagement.getTransfer(e)){case S.LinearTransfer:return[n,"LinearTransferOETF"];case S.SRGBTransfer:return[n,"sRGBTransferOETF"];default:return(0,S.warn)("WebGLProgram: Unsupported color space: ",e),[n,"LinearTransferOETF"]}}(t.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) { + return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) ); +}`),(S.ColorManagement.getLuminanceCoefficients(nt),r=nt.x.toFixed(4),s=nt.y.toFixed(4),u=nt.z.toFixed(4),`float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( ${r}, ${s}, ${u} ); + return dot( weights, rgb ); +}`),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"","\n"].filter(nr).join("\n")}f=ni(f=na(f=nl(f),t),t),p=ni(p=na(p=nl(p),t),t),f=nd(f),p=nd(p),!0!==t.isRawShaderMaterial&&(x="#version 300 es\n",o=[E,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+o,l=["#define varying in",t.glslVersion===S.GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===S.GLSL3?"":"#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"+l);let R=x+o+f,C=x+l+p,y=e8(c,c.VERTEX_SHADER,R),A=e8(c,c.FRAGMENT_SHADER,C);function P(n){if(e.debug.checkShaderErrors){let t=c.getProgramInfoLog(b)||"",r=c.getShaderInfoLog(y)||"",a=c.getShaderInfoLog(A)||"",i=t.trim(),s=r.trim(),u=a.trim(),d=!0,f=!0;if(!1===c.getProgramParameter(b,c.LINK_STATUS))if(d=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,b,y,A);else{let e=ne(c,y,"vertex"),t=ne(c,A,"fragment");(0,S.error)("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(b,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+n.name+"\nMaterial Type: "+n.type+"\n\nProgram Info Log: "+i+"\n"+e+"\n"+t)}else""!==i?(0,S.warn)("WebGLProgram: Program Info Log:",i):(""===s||""===u)&&(f=!1);f&&(n.diagnostics={runnable:d,programLog:i,vertexShader:{log:s,prefix:o},fragmentShader:{log:u,prefix:l}})}c.deleteShader(y),c.deleteShader(A),s=new e6(c,b),u=function(e,n){let t={},r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES);for(let a=0;a0,Y=i.clearcoat>0,K=i.dispersion>0,$=i.iridescence>0,Q=i.sheen>0,Z=i.transmission>0,J=q&&!!i.anisotropyMap,ee=Y&&!!i.clearcoatMap,en=Y&&!!i.clearcoatNormalMap,et=Y&&!!i.clearcoatRoughnessMap,er=$&&!!i.iridescenceMap,ea=$&&!!i.iridescenceThicknessMap,ei=Q&&!!i.sheenColorMap,eo=Q&&!!i.sheenRoughnessMap,el=!!i.specularMap,es=!!i.specularColorMap,eu=!!i.specularIntensityMap,ec=Z&&!!i.transmissionMap,ed=Z&&!!i.thicknessMap,ef=!!i.gradientMap,ep=!!i.alphaMap,em=i.alphaTest>0,eh=!!i.alphaHash,eg=!!i.extensions,e_=S.NoToneMapping;i.toneMapped&&(null===N||!0===N.isXRRenderTarget)&&(e_=e.toneMapping);let ev={shaderID:A,shaderType:i.type,shaderName:i.name,vertexShader:_,fragmentShader:v,defines:i.defines,customVertexShaderID:E,customFragmentShaderID:T,isRawShaderMaterial:!0===i.isRawShaderMaterial,glslVersion:i.glslVersion,precision:p,batching:I,batchingColor:I&&null!==g._colorsTexture,instancing:D,instancingColor:D&&null!==g.instanceColor,instancingMorph:D&&null!==g.morphTexture,outputColorSpace:null===N?e.outputColorSpace:!0===N.isXRRenderTarget?N.texture.colorSpace:S.LinearSRGBColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:F,matcap:O,envMap:B,envMapMode:B&&C.mapping,envMapCubeUVHeight:y,aoMap:G,lightMap:H,bumpMap:k,normalMap:V,displacementMap:z,emissiveMap:W,normalMapObjectSpace:V&&i.normalMapType===S.ObjectSpaceNormalMap,normalMapTangentSpace:V&&i.normalMapType===S.TangentSpaceNormalMap,metalnessMap:X,roughnessMap:j,anisotropy:q,anisotropyMap:J,clearcoat:Y,clearcoatMap:ee,clearcoatNormalMap:en,clearcoatRoughnessMap:et,dispersion:K,iridescence:$,iridescenceMap:er,iridescenceThicknessMap:ea,sheen:Q,sheenColorMap:ei,sheenRoughnessMap:eo,specularMap:el,specularColorMap:es,specularIntensityMap:eu,transmission:Z,transmissionMap:ec,thicknessMap:ed,gradientMap:ef,opaque:!1===i.transparent&&i.blending===S.NormalBlending&&!1===i.alphaToCoverage,alphaMap:ep,alphaTest:em,alphaHash:eh,combine:i.combine,mapUv:F&&h(i.map.channel),aoMapUv:G&&h(i.aoMap.channel),lightMapUv:H&&h(i.lightMap.channel),bumpMapUv:k&&h(i.bumpMap.channel),normalMapUv:V&&h(i.normalMap.channel),displacementMapUv:z&&h(i.displacementMap.channel),emissiveMapUv:W&&h(i.emissiveMap.channel),metalnessMapUv:X&&h(i.metalnessMap.channel),roughnessMapUv:j&&h(i.roughnessMap.channel),anisotropyMapUv:J&&h(i.anisotropyMap.channel),clearcoatMapUv:ee&&h(i.clearcoatMap.channel),clearcoatNormalMapUv:en&&h(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:et&&h(i.clearcoatRoughnessMap.channel),iridescenceMapUv:er&&h(i.iridescenceMap.channel),iridescenceThicknessMapUv:ea&&h(i.iridescenceThicknessMap.channel),sheenColorMapUv:ei&&h(i.sheenColorMap.channel),sheenRoughnessMapUv:eo&&h(i.sheenRoughnessMap.channel),specularMapUv:el&&h(i.specularMap.channel),specularColorMapUv:es&&h(i.specularColorMap.channel),specularIntensityMapUv:eu&&h(i.specularIntensityMap.channel),transmissionMapUv:ec&&h(i.transmissionMap.channel),thicknessMapUv:ed&&h(i.thicknessMap.channel),alphaMapUv:ep&&h(i.alphaMap.channel),vertexTangents:!!b.attributes.tangent&&(V||q),vertexColors:i.vertexColors,vertexAlphas:!0===i.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,pointsUvs:!0===g.isPoints&&!!b.attributes.uv&&(F||ep),fog:!!M,useFog:!0===i.fog,fogExp2:!!M&&M.isFogExp2,flatShading:!0===i.flatShading&&!1===i.wireframe,sizeAttenuation:!0===i.sizeAttenuation,logarithmicDepthBuffer:f,reversedDepthBuffer:U,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:w,morphTextureStride:L,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numLightProbes:l.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:e_,decodeVideoTexture:F&&!0===i.map.isVideoTexture&&S.ColorManagement.getTransfer(i.map.colorSpace)===S.SRGBTransfer,decodeVideoTextureEmissive:W&&!0===i.emissiveMap.isVideoTexture&&S.ColorManagement.getTransfer(i.emissiveMap.colorSpace)===S.SRGBTransfer,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===S.DoubleSide,flipSided:i.side===S.BackSide,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:eg&&!0===i.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(eg&&!0===i.extensions.multiDraw||I)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:i.customProgramCacheKey()};return ev.vertexUv1s=u.has(1),ev.vertexUv2s=u.has(2),ev.vertexUv3s=u.has(3),u.clear(),ev},getProgramCacheKey:function(n){var t,r,a,i;let o=[];if(n.shaderID?o.push(n.shaderID):(o.push(n.customVertexShaderID),o.push(n.customFragmentShaderID)),void 0!==n.defines)for(let e in n.defines)o.push(e),o.push(n.defines[e]);return!1===n.isRawShaderMaterial&&(t=o,r=n,t.push(r.precision),t.push(r.outputColorSpace),t.push(r.envMapMode),t.push(r.envMapCubeUVHeight),t.push(r.mapUv),t.push(r.alphaMapUv),t.push(r.lightMapUv),t.push(r.aoMapUv),t.push(r.bumpMapUv),t.push(r.normalMapUv),t.push(r.displacementMapUv),t.push(r.emissiveMapUv),t.push(r.metalnessMapUv),t.push(r.roughnessMapUv),t.push(r.anisotropyMapUv),t.push(r.clearcoatMapUv),t.push(r.clearcoatNormalMapUv),t.push(r.clearcoatRoughnessMapUv),t.push(r.iridescenceMapUv),t.push(r.iridescenceThicknessMapUv),t.push(r.sheenColorMapUv),t.push(r.sheenRoughnessMapUv),t.push(r.specularMapUv),t.push(r.specularColorMapUv),t.push(r.specularIntensityMapUv),t.push(r.transmissionMapUv),t.push(r.thicknessMapUv),t.push(r.combine),t.push(r.fogExp2),t.push(r.sizeAttenuation),t.push(r.morphTargetsCount),t.push(r.morphAttributeCount),t.push(r.numDirLights),t.push(r.numPointLights),t.push(r.numSpotLights),t.push(r.numSpotLightMaps),t.push(r.numHemiLights),t.push(r.numRectAreaLights),t.push(r.numDirLightShadows),t.push(r.numPointLightShadows),t.push(r.numSpotLightShadows),t.push(r.numSpotLightShadowsWithMaps),t.push(r.numLightProbes),t.push(r.shadowMapType),t.push(r.toneMapping),t.push(r.numClippingPlanes),t.push(r.numClipIntersection),t.push(r.depthPacking),a=o,i=n,l.disableAll(),i.instancing&&l.enable(0),i.instancingColor&&l.enable(1),i.instancingMorph&&l.enable(2),i.matcap&&l.enable(3),i.envMap&&l.enable(4),i.normalMapObjectSpace&&l.enable(5),i.normalMapTangentSpace&&l.enable(6),i.clearcoat&&l.enable(7),i.iridescence&&l.enable(8),i.alphaTest&&l.enable(9),i.vertexColors&&l.enable(10),i.vertexAlphas&&l.enable(11),i.vertexUv1s&&l.enable(12),i.vertexUv2s&&l.enable(13),i.vertexUv3s&&l.enable(14),i.vertexTangents&&l.enable(15),i.anisotropy&&l.enable(16),i.alphaHash&&l.enable(17),i.batching&&l.enable(18),i.dispersion&&l.enable(19),i.batchingColor&&l.enable(20),i.gradientMap&&l.enable(21),a.push(l.mask),l.disableAll(),i.fog&&l.enable(0),i.useFog&&l.enable(1),i.flatShading&&l.enable(2),i.logarithmicDepthBuffer&&l.enable(3),i.reversedDepthBuffer&&l.enable(4),i.skinning&&l.enable(5),i.morphTargets&&l.enable(6),i.morphNormals&&l.enable(7),i.morphColors&&l.enable(8),i.premultipliedAlpha&&l.enable(9),i.shadowMapEnabled&&l.enable(10),i.doubleSided&&l.enable(11),i.flipSided&&l.enable(12),i.useDepthPacking&&l.enable(13),i.dithering&&l.enable(14),i.transmission&&l.enable(15),i.sheen&&l.enable(16),i.opaque&&l.enable(17),i.pointsUvs&&l.enable(18),i.decodeVideoTexture&&l.enable(19),i.decodeVideoTextureEmissive&&l.enable(20),i.alphaToCoverage&&l.enable(21),a.push(l.mask),o.push(e.outputColorSpace)),o.push(n.customProgramCacheKey),o.join()},getUniforms:function(e){let n,t=m[e.type];if(t){let e=x[t];n=S.UniformsUtils.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(n,t){let r=d.get(t);return void 0!==r?++r.usedTimes:(r=new nv(e,t,n,i),c.push(r),d.set(t,r)),r},releaseProgram:function(e){if(0==--e.usedTimes){let n=c.indexOf(e);c[n]=c[c.length-1],c.pop(),d.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){s.remove(e)},programs:c,dispose:function(){s.dispose()}}}function nb(){let e=new WeakMap;return{has:function(n){return e.has(n)},get:function(n){let t=e.get(n);return void 0===t&&(t={},e.set(n,t)),t},remove:function(n){e.delete(n)},update:function(n,t,r){e.get(n)[t]=r},dispose:function(){e=new WeakMap}}}function nx(e,n){return e.groupOrder!==n.groupOrder?e.groupOrder-n.groupOrder:e.renderOrder!==n.renderOrder?e.renderOrder-n.renderOrder:e.material.id!==n.material.id?e.material.id-n.material.id:e.z!==n.z?e.z-n.z:e.id-n.id}function nR(e,n){return e.groupOrder!==n.groupOrder?e.groupOrder-n.groupOrder:e.renderOrder!==n.renderOrder?e.renderOrder-n.renderOrder:e.z!==n.z?n.z-e.z:e.id-n.id}function nC(){let e=[],n=0,t=[],r=[],a=[];function i(t,r,a,i,o,l){let s=e[n];return void 0===s?(s={id:t.id,object:t,geometry:r,material:a,groupOrder:i,renderOrder:t.renderOrder,z:o,group:l},e[n]=s):(s.id=t.id,s.object=t,s.geometry=r,s.material=a,s.groupOrder=i,s.renderOrder=t.renderOrder,s.z=o,s.group=l),n++,s}return{opaque:t,transmissive:r,transparent:a,init:function(){n=0,t.length=0,r.length=0,a.length=0},push:function(e,n,o,l,s,u){let c=i(e,n,o,l,s,u);o.transmission>0?r.push(c):!0===o.transparent?a.push(c):t.push(c)},unshift:function(e,n,o,l,s,u){let c=i(e,n,o,l,s,u);o.transmission>0?r.unshift(c):!0===o.transparent?a.unshift(c):t.unshift(c)},finish:function(){for(let t=n,r=e.length;t1&&t.sort(e||nx),r.length>1&&r.sort(n||nR),a.length>1&&a.sort(n||nR)}}}function ny(){let e=new WeakMap;return{get:function(n,t){let r,a=e.get(n);return void 0===a?(r=new nC,e.set(n,[r])):t>=a.length?(r=new nC,a.push(r)):r=a[t],r},dispose:function(){e=new WeakMap}}}function nA(){let e={};return{get:function(n){let t;if(void 0!==e[n.id])return e[n.id];switch(n.type){case"DirectionalLight":t={direction:new S.Vector3,color:new S.Color};break;case"SpotLight":t={position:new S.Vector3,direction:new S.Vector3,color:new S.Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new S.Vector3,color:new S.Color,distance:0,decay:0};break;case"HemisphereLight":t={direction:new S.Vector3,skyColor:new S.Color,groundColor:new S.Color};break;case"RectAreaLight":t={color:new S.Color,position:new S.Vector3,halfWidth:new S.Vector3,halfHeight:new S.Vector3}}return e[n.id]=t,t}}}let nP=0;function nw(e,n){return 2*!!n.castShadow-2*!!e.castShadow+ +!!n.map-!!e.map}function nL(e){let n,t=new nA,r=(n={},{get:function(e){let t;if(void 0!==n[e.id])return n[e.id];switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new S.Vector2};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new S.Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return n[e.id]=t,t}}),a={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 e=0;e<9;e++)a.probe.push(new S.Vector3);let i=new S.Vector3,o=new S.Matrix4,l=new S.Matrix4;return{setup:function(n){let i=0,o=0,l=0;for(let e=0;e<9;e++)a.probe[e].set(0,0,0);let s=0,u=0,c=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;n.sort(nw);for(let e=0,E=n.length;e0&&(!0===e.has("OES_texture_float_linear")?(a.rectAreaLTC1=b.LTC_FLOAT_1,a.rectAreaLTC2=b.LTC_FLOAT_2):(a.rectAreaLTC1=b.LTC_HALF_1,a.rectAreaLTC2=b.LTC_HALF_2)),a.ambient[0]=i,a.ambient[1]=o,a.ambient[2]=l;let E=a.hash;(E.directionalLength!==s||E.pointLength!==u||E.spotLength!==c||E.rectAreaLength!==d||E.hemiLength!==f||E.numDirectionalShadows!==p||E.numPointShadows!==m||E.numSpotShadows!==h||E.numSpotMaps!==g||E.numLightProbes!==v)&&(a.directional.length=s,a.spot.length=c,a.rectArea.length=d,a.point.length=u,a.hemi.length=f,a.directionalShadow.length=p,a.directionalShadowMap.length=p,a.pointShadow.length=m,a.pointShadowMap.length=m,a.spotShadow.length=h,a.spotShadowMap.length=h,a.directionalShadowMatrix.length=p,a.pointShadowMatrix.length=m,a.spotLightMatrix.length=h+g-_,a.spotLightMap.length=g,a.numSpotLightShadowsWithMaps=_,a.numLightProbes=v,E.directionalLength=s,E.pointLength=u,E.spotLength=c,E.rectAreaLength=d,E.hemiLength=f,E.numDirectionalShadows=p,E.numPointShadows=m,E.numSpotShadows=h,E.numSpotMaps=g,E.numLightProbes=v,a.version=nP++)},setupView:function(e,n){let t=0,r=0,s=0,u=0,c=0,d=n.matrixWorldInverse;for(let n=0,f=e.length;n=i.length?(a=new nN(e),i.push(a)):a=i[r],a},dispose:function(){n=new WeakMap}}}let nD=[new S.Vector3(1,0,0),new S.Vector3(-1,0,0),new S.Vector3(0,1,0),new S.Vector3(0,-1,0),new S.Vector3(0,0,1),new S.Vector3(0,0,-1)],nI=[new S.Vector3(0,-1,0),new S.Vector3(0,-1,0),new S.Vector3(0,0,1),new S.Vector3(0,0,-1),new S.Vector3(0,-1,0),new S.Vector3(0,-1,0)],nF=new S.Matrix4,nO=new S.Vector3,nB=new S.Vector3;function nG(e,n,t){let r=new S.Frustum,a=new S.Vector2,i=new S.Vector2,o=new S.Vector4,l=new S.MeshDepthMaterial,s=new S.MeshDistanceMaterial,u={},c=t.maxTextureSize,d={[S.FrontSide]:S.BackSide,[S.BackSide]:S.FrontSide,[S.DoubleSide]:S.DoubleSide},f=new S.ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new S.Vector2},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}"}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new S.BufferGeometry;m.setAttribute("position",new S.BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new S.Mesh(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=S.PCFShadowMap;let _=this.type;function v(n,t,r,a){let i=null,o=!0===r.isPointLight?n.customDistanceMaterial:n.customDepthMaterial;if(void 0!==o)i=o;else if(i=!0===r.isPointLight?s:l,e.localClippingEnabled&&!0===t.clipShadows&&Array.isArray(t.clippingPlanes)&&0!==t.clippingPlanes.length||t.displacementMap&&0!==t.displacementScale||t.alphaMap&&t.alphaTest>0||t.map&&t.alphaTest>0||!0===t.alphaToCoverage){let e=i.uuid,n=t.uuid,r=u[e];void 0===r&&(r={},u[e]=r);let a=r[n];void 0===a&&(a=i.clone(),r[n]=a,t.addEventListener("dispose",E)),i=a}return i.visible=t.visible,i.wireframe=t.wireframe,a===S.VSMShadowMap?i.side=null!==t.shadowSide?t.shadowSide:t.side:i.side=null!==t.shadowSide?t.shadowSide:d[t.side],i.alphaMap=t.alphaMap,i.alphaTest=!0===t.alphaToCoverage?.5:t.alphaTest,i.map=t.map,i.clipShadows=t.clipShadows,i.clippingPlanes=t.clippingPlanes,i.clipIntersection=t.clipIntersection,i.displacementMap=t.displacementMap,i.displacementScale=t.displacementScale,i.displacementBias=t.displacementBias,i.wireframeLinewidth=t.wireframeLinewidth,i.linewidth=t.linewidth,!0===r.isPointLight&&!0===i.isMeshDistanceMaterial&&(e.properties.get(i).light=r),i}function E(e){for(let n in e.target.removeEventListener("dispose",E),u){let t=u[n],r=e.target.uuid;r in t&&(t[r].dispose(),delete t[r])}}this.render=function(t,l,s){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===t.length)return;t.type===S.PCFSoftShadowMap&&((0,S.warn)("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),t.type=S.PCFShadowMap);let u=e.getRenderTarget(),d=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),E=e.state;E.setBlending(S.NoBlending),!0===E.buffers.depth.getReversed()?E.buffers.color.setClear(0,0,0,0):E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);let T=_!==this.type;T&&l.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let u=0,d=t.length;uc||a.y>c)&&(a.x>c&&(i.x=Math.floor(c/g.x),a.x=i.x*g.x,m.mapSize.x=i.x),a.y>c&&(i.y=Math.floor(c/g.y),a.y=i.y*g.y,m.mapSize.y=i.y)),null===m.map||!0===T){if(null!==m.map&&(null!==m.map.depthTexture&&(m.map.depthTexture.dispose(),m.map.depthTexture=null),m.map.dispose()),this.type===S.VSMShadowMap){if(d.isPointLight){(0,S.warn)("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}m.map=new S.WebGLRenderTarget(a.x,a.y,{format:S.RGFormat,type:S.HalfFloatType,minFilter:S.LinearFilter,magFilter:S.LinearFilter,generateMipmaps:!1}),m.map.texture.name=d.name+".shadowMap",m.map.depthTexture=new S.DepthTexture(a.x,a.y,S.FloatType),m.map.depthTexture.name=d.name+".shadowMapDepth",m.map.depthTexture.format=S.DepthFormat,m.map.depthTexture.compareFunction=null,m.map.depthTexture.minFilter=S.NearestFilter,m.map.depthTexture.magFilter=S.NearestFilter}else{d.isPointLight?(m.map=new S.WebGLCubeRenderTarget(a.x),m.map.depthTexture=new S.CubeDepthTexture(a.x,S.UnsignedIntType)):(m.map=new S.WebGLRenderTarget(a.x,a.y),m.map.depthTexture=new S.DepthTexture(a.x,a.y,S.UnsignedIntType)),m.map.depthTexture.name=d.name+".shadowMap",m.map.depthTexture.format=S.DepthFormat;let n=e.state.buffers.depth.getReversed();this.type===S.PCFShadowMap?(m.map.depthTexture.compareFunction=n?S.GreaterEqualCompare:S.LessEqualCompare,m.map.depthTexture.minFilter=S.LinearFilter,m.map.depthTexture.magFilter=S.LinearFilter):(m.map.depthTexture.compareFunction=null,m.map.depthTexture.minFilter=S.NearestFilter,m.map.depthTexture.magFilter=S.NearestFilter)}m.camera.updateProjectionMatrix()}let _=m.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<_;t++){if(m.map.isWebGLCubeRenderTarget)e.setRenderTarget(m.map,t),e.clear();else{0===t&&(e.setRenderTarget(m.map),e.clear());let n=m.getViewport(t);o.set(i.x*n.x,i.y*n.y,i.x*n.z,i.y*n.w),E.viewport(o)}if(d.isPointLight){let e=m.camera,n=m.matrix,r=d.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),nO.setFromMatrixPosition(d.matrixWorld),e.position.copy(nO),nB.copy(e.position),nB.add(nD[t]),e.up.copy(nI[t]),e.lookAt(nB),e.updateMatrixWorld(),n.makeTranslation(-nO.x,-nO.y,-nO.z),nF.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),m._frustum.setFromProjectionMatrix(nF,e.coordinateSystem,e.reversedDepth)}else m.updateMatrices(d);r=m.getFrustum(),function t(a,i,o,l,s){if(!1===a.visible)return;if(a.layers.test(i.layers)&&(a.isMesh||a.isLine||a.isPoints)&&(a.castShadow||a.receiveShadow&&s===S.VSMShadowMap)&&(!a.frustumCulled||r.intersectsObject(a))){a.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,a.matrixWorld);let t=n.update(a),r=a.material;if(Array.isArray(r)){let n=t.groups;for(let u=0,c=n.length;u=1:-1!==L.indexOf("OpenGL ES")&&(w=parseFloat(/^OpenGL ES (\d)/.exec(L)[1])>=2);let N=null,U={},D=e.getParameter(e.SCISSOR_BOX),I=e.getParameter(e.VIEWPORT),F=new S.Vector4().fromArray(D),O=new S.Vector4().fromArray(I);function B(n,t,r,a){let i=new Uint8Array(4),o=e.createTexture();e.bindTexture(n,o),e.texParameteri(n,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(n,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;otypeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new S.Vector2,d=new WeakMap,f=new WeakMap,p=!1;try{p="u">typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function m(e,n){return p?new OffscreenCanvas(e,n):(0,S.createElementNS)("canvas")}function h(e,n,t){let r=1,a=z(e);if((a.width>t||a.height>t)&&(r=t/Math.max(a.width,a.height)),r<1)if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap||"u">typeof VideoFrame&&e instanceof VideoFrame){let t=Math.floor(r*a.width),i=Math.floor(r*a.height);void 0===l&&(l=m(t,i));let o=n?m(t,i):l;return o.width=t,o.height=i,o.getContext("2d").drawImage(e,0,0,t,i),(0,S.warn)("WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+t+"x"+i+")."),o}else"data"in e&&(0,S.warn)("WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").");return e}function g(e){return e.generateMipmaps}function _(n){e.generateMipmap(n)}function v(t,r,a,i,o=!1){if(null!==t){if(void 0!==e[t])return e[t];(0,S.warn)("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}let l=r;if(r===e.RED&&(a===e.FLOAT&&(l=e.R32F),a===e.HALF_FLOAT&&(l=e.R16F),a===e.UNSIGNED_BYTE&&(l=e.R8)),r===e.RED_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.R8UI),a===e.UNSIGNED_SHORT&&(l=e.R16UI),a===e.UNSIGNED_INT&&(l=e.R32UI),a===e.BYTE&&(l=e.R8I),a===e.SHORT&&(l=e.R16I),a===e.INT&&(l=e.R32I)),r===e.RG&&(a===e.FLOAT&&(l=e.RG32F),a===e.HALF_FLOAT&&(l=e.RG16F),a===e.UNSIGNED_BYTE&&(l=e.RG8)),r===e.RG_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RG8UI),a===e.UNSIGNED_SHORT&&(l=e.RG16UI),a===e.UNSIGNED_INT&&(l=e.RG32UI),a===e.BYTE&&(l=e.RG8I),a===e.SHORT&&(l=e.RG16I),a===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RGB8UI),a===e.UNSIGNED_SHORT&&(l=e.RGB16UI),a===e.UNSIGNED_INT&&(l=e.RGB32UI),a===e.BYTE&&(l=e.RGB8I),a===e.SHORT&&(l=e.RGB16I),a===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(a===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),a===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),a===e.UNSIGNED_INT&&(l=e.RGBA32UI),a===e.BYTE&&(l=e.RGBA8I),a===e.SHORT&&(l=e.RGBA16I),a===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(a===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),a===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let n=o?S.LinearTransfer:S.ColorManagement.getTransfer(i);a===e.FLOAT&&(l=e.RGBA32F),a===e.HALF_FLOAT&&(l=e.RGBA16F),a===e.UNSIGNED_BYTE&&(l=n===S.SRGBTransfer?e.SRGB8_ALPHA8:e.RGBA8),a===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),a===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&n.get("EXT_color_buffer_float"),l}function E(n,t){let r;return n?null===t||t===S.UnsignedIntType||t===S.UnsignedInt248Type?r=e.DEPTH24_STENCIL8:t===S.FloatType?r=e.DEPTH32F_STENCIL8:t===S.UnsignedShortType&&(r=e.DEPTH24_STENCIL8,(0,S.warn)("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===t||t===S.UnsignedIntType||t===S.UnsignedInt248Type?r=e.DEPTH_COMPONENT24:t===S.FloatType?r=e.DEPTH_COMPONENT32F:t===S.UnsignedShortType&&(r=e.DEPTH_COMPONENT16),r}function T(e,n){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==S.NearestFilter&&e.minFilter!==S.LinearFilter?Math.log2(Math.max(n.width,n.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?n.mipmaps.length:1}function M(e){let n=e.target;n.removeEventListener("dispose",M),function(e){let n=r.get(e);if(void 0===n.__webglInit)return;let t=e.source,a=f.get(t);if(a){let r=a[n.__cacheKey];r.usedTimes--,0===r.usedTimes&&x(e),0===Object.keys(a).length&&f.delete(t)}r.remove(e)}(n),n.isVideoTexture&&d.delete(n)}function b(n){let t=n.target;t.removeEventListener("dispose",b),function(n){let t=r.get(n);if(n.depthTexture&&(n.depthTexture.dispose(),r.remove(n.depthTexture)),n.isWebGLCubeRenderTarget)for(let n=0;n<6;n++){if(Array.isArray(t.__webglFramebuffer[n]))for(let r=0;r0&&s.__version!==n.version){let e=n.image;if(null===e)(0,S.warn)("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void U(s,n,a);(0,S.warn)("WebGLRenderer: Texture marked for update but image is incomplete")}}else n.isExternalTexture&&(s.__webglTexture=n.sourceTexture?n.sourceTexture:null);t.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+a)}let y={[S.RepeatWrapping]:e.REPEAT,[S.ClampToEdgeWrapping]:e.CLAMP_TO_EDGE,[S.MirroredRepeatWrapping]:e.MIRRORED_REPEAT},A={[S.NearestFilter]:e.NEAREST,[S.NearestMipmapNearestFilter]:e.NEAREST_MIPMAP_NEAREST,[S.NearestMipmapLinearFilter]:e.NEAREST_MIPMAP_LINEAR,[S.LinearFilter]:e.LINEAR,[S.LinearMipmapNearestFilter]:e.LINEAR_MIPMAP_NEAREST,[S.LinearMipmapLinearFilter]:e.LINEAR_MIPMAP_LINEAR},P={[S.NeverCompare]:e.NEVER,[S.AlwaysCompare]:e.ALWAYS,[S.LessCompare]:e.LESS,[S.LessEqualCompare]:e.LEQUAL,[S.EqualCompare]:e.EQUAL,[S.GreaterEqualCompare]:e.GEQUAL,[S.GreaterCompare]:e.GREATER,[S.NotEqualCompare]:e.NOTEQUAL};function w(t,i){if((i.type===S.FloatType&&!1===n.has("OES_texture_float_linear")&&(i.magFilter===S.LinearFilter||i.magFilter===S.LinearMipmapNearestFilter||i.magFilter===S.NearestMipmapLinearFilter||i.magFilter===S.LinearMipmapLinearFilter||i.minFilter===S.LinearFilter||i.minFilter===S.LinearMipmapNearestFilter||i.minFilter===S.NearestMipmapLinearFilter||i.minFilter===S.LinearMipmapLinearFilter)&&(0,S.warn)("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(t,e.TEXTURE_WRAP_S,y[i.wrapS]),e.texParameteri(t,e.TEXTURE_WRAP_T,y[i.wrapT]),(t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY)&&e.texParameteri(t,e.TEXTURE_WRAP_R,y[i.wrapR]),e.texParameteri(t,e.TEXTURE_MAG_FILTER,A[i.magFilter]),e.texParameteri(t,e.TEXTURE_MIN_FILTER,A[i.minFilter]),i.compareFunction&&(e.texParameteri(t,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(t,e.TEXTURE_COMPARE_FUNC,P[i.compareFunction])),!0===n.has("EXT_texture_filter_anisotropic"))&&i.magFilter!==S.NearestFilter&&(i.minFilter===S.NearestMipmapLinearFilter||i.minFilter===S.LinearMipmapLinearFilter)&&(i.type!==S.FloatType||!1!==n.has("OES_texture_float_linear"))&&(i.anisotropy>1||r.get(i).__currentAnisotropy)){let o=n.get("EXT_texture_filter_anisotropic");e.texParameterf(t,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i.anisotropy,a.getMaxAnisotropy())),r.get(i).__currentAnisotropy=i.anisotropy}}function L(n,t){let r,a=!1;void 0===n.__webglInit&&(n.__webglInit=!0,t.addEventListener("dispose",M));let i=t.source,l=f.get(i);void 0===l&&(l={},f.set(i,l));let s=((r=[]).push(t.wrapS),r.push(t.wrapT),r.push(t.wrapR||0),r.push(t.magFilter),r.push(t.minFilter),r.push(t.anisotropy),r.push(t.internalFormat),r.push(t.format),r.push(t.type),r.push(t.generateMipmaps),r.push(t.premultiplyAlpha),r.push(t.flipY),r.push(t.unpackAlignment),r.push(t.colorSpace),r.join());if(s!==n.__cacheKey){void 0===l[s]&&(l[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,a=!0),l[s].usedTimes++;let r=l[n.__cacheKey];void 0!==r&&(l[n.__cacheKey].usedTimes--,0===r.usedTimes&&x(t)),n.__cacheKey=s,n.__webglTexture=l[s].texture}return a}function N(e,n,t){return Math.floor(Math.floor(e/t)/n)}function U(n,o,l){let s=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(s=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(s=e.TEXTURE_3D);let u=L(n,o),c=o.source;t.bindTexture(s,n.__webglTexture,e.TEXTURE0+l);let d=r.get(c);if(c.version!==d.__version||!0===u){let n;t.activeTexture(e.TEXTURE0+l);let r=S.ColorManagement.getPrimaries(S.ColorManagement.workingColorSpace),f=o.colorSpace===S.NoColorSpace?null:S.ColorManagement.getPrimaries(o.colorSpace),p=o.colorSpace===S.NoColorSpace||r===f?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let m=h(o.image,!1,a.maxTextureSize);m=V(o,m);let M=i.convert(o.format,o.colorSpace),b=i.convert(o.type),x=v(o.internalFormat,M,b,o.colorSpace,o.isVideoTexture);w(s,o);let R=o.mipmaps,C=!0!==o.isVideoTexture,y=void 0===d.__version||!0===u,A=c.dataReady,P=T(o,m);if(o.isDepthTexture)x=E(o.format===S.DepthStencilFormat,o.type),y&&(C?t.texStorage2D(e.TEXTURE_2D,1,x,m.width,m.height):t.texImage2D(e.TEXTURE_2D,0,x,m.width,m.height,0,M,b,null));else if(o.isDataTexture)if(R.length>0){C&&y&&t.texStorage2D(e.TEXTURE_2D,P,x,R[0].width,R[0].height);for(let r=0,a=R.length;re.start-n.start);let l=0;for(let e=1;e0){let a=(0,S.getByteLength)(n.width,n.height,o.format,o.type);for(let i of o.layerUpdates){let o=n.data.subarray(i*a/n.data.BYTES_PER_ELEMENT,(i+1)*a/n.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,i,n.width,n.height,1,M,o)}o.clearLayerUpdates()}else t.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,n.width,n.height,m.depth,M,n.data)}else t.compressedTexImage3D(e.TEXTURE_2D_ARRAY,r,x,n.width,n.height,m.depth,0,n.data,0,0);else(0,S.warn)("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else C?A&&t.texSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,n.width,n.height,m.depth,M,b,n.data):t.texImage3D(e.TEXTURE_2D_ARRAY,r,x,n.width,n.height,m.depth,0,M,b,n.data)}else{C&&y&&t.texStorage2D(e.TEXTURE_2D,P,x,R[0].width,R[0].height);for(let r=0,a=R.length;r0){let n=(0,S.getByteLength)(m.width,m.height,o.format,o.type);for(let r of o.layerUpdates){let a=m.data.subarray(r*n/m.data.BYTES_PER_ELEMENT,(r+1)*n/m.data.BYTES_PER_ELEMENT);t.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,m.width,m.height,1,M,b,a)}o.clearLayerUpdates()}else t.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,m.width,m.height,m.depth,M,b,m.data)}else t.texImage3D(e.TEXTURE_2D_ARRAY,0,x,m.width,m.height,m.depth,0,M,b,m.data);else if(o.isData3DTexture)C?(y&&t.texStorage3D(e.TEXTURE_3D,P,x,m.width,m.height,m.depth),A&&t.texSubImage3D(e.TEXTURE_3D,0,0,0,0,m.width,m.height,m.depth,M,b,m.data)):t.texImage3D(e.TEXTURE_3D,0,x,m.width,m.height,m.depth,0,M,b,m.data);else if(o.isFramebufferTexture){if(y)if(C)t.texStorage2D(e.TEXTURE_2D,P,x,m.width,m.height);else{let n=m.width,r=m.height;for(let a=0;a>=1,r>>=1}}else if(R.length>0){if(C&&y){let n=z(R[0]);t.texStorage2D(e.TEXTURE_2D,P,x,n.width,n.height)}for(let r=0,a=R.length;r>c),r=Math.max(1,a.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?t.texImage3D(u,c,p,n,r,a.depth,0,d,f,null):t.texImage2D(u,c,p,n,r,0,d,f,null)}t.bindFramebuffer(e.FRAMEBUFFER,n),k(a)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,u,h.__webglTexture,0,H(a)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,u,h.__webglTexture,c),t.bindFramebuffer(e.FRAMEBUFFER,null)}function I(n,t,r){if(e.bindRenderbuffer(e.RENDERBUFFER,n),t.depthBuffer){let a=t.depthTexture,i=a&&a.isDepthTexture?a.type:null,o=E(t.stencilBuffer,i),l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;k(t)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,H(t),o,t.width,t.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,H(t),o,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,o,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,n)}else{let n=t.textures;for(let a=0;a{delete a.__boundDepthTexture,delete a.__depthDisposeCallback,e.removeEventListener("dispose",n)};e.addEventListener("dispose",n),a.__depthDisposeCallback=n}a.__boundDepthTexture=e}if(n.depthTexture&&!a.__autoAllocateDepthBuffer)if(i)for(let e=0;e<6;e++)F(a.__webglFramebuffer[e],n,e);else{let e=n.texture.mipmaps;e&&e.length>0?F(a.__webglFramebuffer[0],n,0):F(a.__webglFramebuffer,n,0)}else if(i){a.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(t.bindFramebuffer(e.FRAMEBUFFER,a.__webglFramebuffer[r]),void 0===a.__webglDepthbuffer[r])a.__webglDepthbuffer[r]=e.createRenderbuffer(),I(a.__webglDepthbuffer[r],n,!1);else{let t=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,i=a.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,i),e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,i)}}else{let r=n.texture.mipmaps;if(r&&r.length>0?t.bindFramebuffer(e.FRAMEBUFFER,a.__webglFramebuffer[0]):t.bindFramebuffer(e.FRAMEBUFFER,a.__webglFramebuffer),void 0===a.__webglDepthbuffer)a.__webglDepthbuffer=e.createRenderbuffer(),I(a.__webglDepthbuffer,n,!1);else{let t=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=a.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,r)}}t.bindFramebuffer(e.FRAMEBUFFER,null)}let B=[],G=[];function H(e){return Math.min(a.maxSamples,e.samples)}function k(e){let t=r.get(e);return e.samples>0&&!0===n.has("WEBGL_multisampled_render_to_texture")&&!1!==t.__useRenderToTexture}function V(e,n){let t=e.colorSpace,r=e.format,a=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||t!==S.LinearSRGBColorSpace&&t!==S.NoColorSpace&&(S.ColorManagement.getTransfer(t)===S.SRGBTransfer?(r!==S.RGBAFormat||a!==S.UnsignedByteType)&&(0,S.warn)("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):(0,S.error)("WebGLTextures: Unsupported texture color space:",t)),n}function z(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"u">typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){let e=R;return e>=a.maxTextures&&(0,S.warn)("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+a.maxTextures),R+=1,e},this.resetTextureUnits=function(){R=0},this.setTexture2D=C,this.setTexture2DArray=function(n,a){let i=r.get(n);!1===n.isRenderTargetTexture&&n.version>0&&i.__version!==n.version?U(i,n,a):(n.isExternalTexture&&(i.__webglTexture=n.sourceTexture?n.sourceTexture:null),t.bindTexture(e.TEXTURE_2D_ARRAY,i.__webglTexture,e.TEXTURE0+a))},this.setTexture3D=function(n,a){let i=r.get(n);!1===n.isRenderTargetTexture&&n.version>0&&i.__version!==n.version?U(i,n,a):t.bindTexture(e.TEXTURE_3D,i.__webglTexture,e.TEXTURE0+a)},this.setTextureCube=function(n,o){let l=r.get(n);!0!==n.isCubeDepthTexture&&n.version>0&&l.__version!==n.version?function(n,o,l){if(6!==o.image.length)return;let s=L(n,o),u=o.source;t.bindTexture(e.TEXTURE_CUBE_MAP,n.__webglTexture,e.TEXTURE0+l);let c=r.get(u);if(u.version!==c.__version||!0===s){let n;t.activeTexture(e.TEXTURE0+l);let r=S.ColorManagement.getPrimaries(S.ColorManagement.workingColorSpace),d=o.colorSpace===S.NoColorSpace?null:S.ColorManagement.getPrimaries(o.colorSpace),f=o.colorSpace===S.NoColorSpace||r===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let p=o.isCompressedTexture||o.image[0].isCompressedTexture,m=o.image[0]&&o.image[0].isDataTexture,E=[];for(let e=0;e<6;e++)p||m?E[e]=m?o.image[e].image:o.image[e]:E[e]=h(o.image[e],!0,a.maxCubemapSize),E[e]=V(o,E[e]);let M=E[0],b=i.convert(o.format,o.colorSpace),x=i.convert(o.type),R=v(o.internalFormat,b,x,o.colorSpace),C=!0!==o.isVideoTexture,y=void 0===c.__version||!0===s,A=u.dataReady,P=T(o,M);if(w(e.TEXTURE_CUBE_MAP,o),p){C&&y&&t.texStorage2D(e.TEXTURE_CUBE_MAP,P,R,M.width,M.height);for(let r=0;r<6;r++){n=E[r].mipmaps;for(let a=0;a0&&P++;let r=z(E[0]);t.texStorage2D(e.TEXTURE_CUBE_MAP,P,R,r.width,r.height)}for(let r=0;r<6;r++)if(m){C?A&&t.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,0,0,E[r].width,E[r].height,b,x,E[r].data):t.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,R,E[r].width,E[r].height,0,b,x,E[r].data);for(let a=0;a1;if(!d&&(void 0===s.__webglTexture&&(s.__webglTexture=e.createTexture()),s.__version=a.version,o.memory.textures++),c){l.__webglFramebuffer=[];for(let n=0;n<6;n++)if(a.mipmaps&&a.mipmaps.length>0){l.__webglFramebuffer[n]=[];for(let t=0;t0){l.__webglFramebuffer=[];for(let n=0;n0&&!1===k(n)){l.__webglMultisampledFramebuffer=e.createFramebuffer(),l.__webglColorRenderbuffer=[],t.bindFramebuffer(e.FRAMEBUFFER,l.__webglMultisampledFramebuffer);for(let t=0;t0)for(let r=0;r0)for(let t=0;t0){if(!1===k(n)){let a=n.textures,i=n.width,o=n.height,l=e.COLOR_BUFFER_BIT,s=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(n),d=a.length>1;if(d)for(let n=0;n0?t.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):t.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let t=0;t= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class nj{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(null===this.texture){let t=new S.ExternalTexture(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=t}}getMesh(e){if(null!==this.texture&&null===this.mesh){let n=e.cameras[0].viewport,t=new S.ShaderMaterial({vertexShader:nW,fragmentShader:nX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new S.Mesh(new S.PlaneGeometry(20,20),t)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class nq extends S.EventDispatcher{constructor(e,n){super();const t=this;let r=null,a=1,i=null,o="local-floor",l=1,s=null,u=null,c=null,d=null,f=null,p=null;const m="u">typeof XRWebGLBinding,h=new nj,g={},_=n.getContextAttributes();let v=null,T=null;const M=[],b=[],x=new S.Vector2;let R=null;const C=new S.PerspectiveCamera;C.viewport=new S.Vector4;const y=new S.PerspectiveCamera;y.viewport=new S.Vector4;const A=[C,y],P=new S.ArrayCamera;let w=null,L=null;function N(e){let n=b.indexOf(e.inputSource);if(-1===n)return;let t=M[n];void 0!==t&&(t.update(e.inputSource,e.frame,s||i),t.dispatchEvent({type:e.type,data:e.inputSource}))}function U(){r.removeEventListener("select",N),r.removeEventListener("selectstart",N),r.removeEventListener("selectend",N),r.removeEventListener("squeeze",N),r.removeEventListener("squeezestart",N),r.removeEventListener("squeezeend",N),r.removeEventListener("end",U),r.removeEventListener("inputsourceschange",D);for(let e=0;e=0&&(b[r]=null,M[r].disconnect(t))}for(let n=0;n=b.length){b.push(t),r=e;break}else if(null===b[e]){b[e]=t,r=e;break}if(-1===r)break}let a=M[r];a&&a.connect(t)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let n=M[e];return void 0===n&&(n=new S.WebXRController,M[e]=n),n.getTargetRaySpace()},this.getControllerGrip=function(e){let n=M[e];return void 0===n&&(n=new S.WebXRController,M[e]=n),n.getGripSpace()},this.getHand=function(e){let n=M[e];return void 0===n&&(n=new S.WebXRController,M[e]=n),n.getHandSpace()},this.setFramebufferScaleFactor=function(e){a=e,!0===t.isPresenting&&(0,S.warn)("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===t.isPresenting&&(0,S.warn)("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s||i},this.setReferenceSpace=function(e){s=e},this.getBaseLayer=function(){return null!==d?d:f},this.getBinding=function(){return null===c&&m&&(c=new XRWebGLBinding(r,n)),c},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(u){if(null!==(r=u)){if(v=e.getRenderTarget(),r.addEventListener("select",N),r.addEventListener("selectstart",N),r.addEventListener("selectend",N),r.addEventListener("squeeze",N),r.addEventListener("squeezestart",N),r.addEventListener("squeezeend",N),r.addEventListener("end",U),r.addEventListener("inputsourceschange",D),!0!==_.xrCompatible&&await n.makeXRCompatible(),R=e.getPixelRatio(),e.getSize(x),m&&"createProjectionLayer"in XRWebGLBinding.prototype){let t=null,i=null,o=null;_.depth&&(o=_.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,t=_.stencil?S.DepthStencilFormat:S.DepthFormat,i=_.stencil?S.UnsignedInt248Type:S.UnsignedIntType);let l={colorFormat:n.RGBA8,depthFormat:o,scaleFactor:a};d=(c=this.getBinding()).createProjectionLayer(l),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),T=new S.WebGLRenderTarget(d.textureWidth,d.textureHeight,{format:S.RGBAFormat,type:S.UnsignedByteType,depthTexture:new S.DepthTexture(d.textureWidth,d.textureHeight,i,void 0,void 0,void 0,void 0,void 0,void 0,t),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:4*!!_.antialias,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}else{let t={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:a};f=new XRWebGLLayer(r,n,t),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),T=new S.WebGLRenderTarget(f.framebufferWidth,f.framebufferHeight,{format:S.RGBAFormat,type:S.UnsignedByteType,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:!1===f.ignoreDepthValues,resolveStencilBuffer:!1===f.ignoreDepthValues})}T.isXRRenderTarget=!0,this.setFoveation(l),s=null,i=await r.requestReferenceSpace(o),G.setContext(r),G.start(),t.isPresenting=!0,t.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};const I=new S.Vector3,F=new S.Vector3;function O(e,n){null===n?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(n.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var n,t,a;if(null===r)return;let i=e.near,o=e.far;null!==h.texture&&(h.depthNear>0&&(i=h.depthNear),h.depthFar>0&&(o=h.depthFar)),P.near=y.near=C.near=i,P.far=y.far=C.far=o,(w!==P.near||L!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),w=P.near,L=P.far),P.layers.mask=6|e.layers.mask,C.layers.mask=3&P.layers.mask,y.layers.mask=5&P.layers.mask;let l=e.parent,s=P.cameras;O(P,l);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let a=n.get(r),i=a.envMap,o=a.envMapRotation;i&&(e.envMap.value=i,nY.copy(o),nY.x*=-1,nY.y*=-1,nY.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(nY.y*=-1,nY.z*=-1),e.envMapRotation.value.setFromMatrix4(nK.makeRotationFromEuler(nY)),e.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,t(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,t(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(n,t){t.color.getRGB(n.fogColor.value,(0,S.getUnlitUniformColorSpace)(e)),t.isFog?(n.fogNear.value=t.near,n.fogFar.value=t.far):t.isFogExp2&&(n.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,a,i,o,l){var s,u,c,d,f,p,m,h,g,_,v,E,T,M,b,x,R,C,y,A,P,w,L;let N;a.isMeshBasicMaterial||a.isMeshLambertMaterial?r(e,a):a.isMeshToonMaterial?(r(e,a),s=e,(u=a).gradientMap&&(s.gradientMap.value=u.gradientMap)):a.isMeshPhongMaterial?(r(e,a),c=e,d=a,c.specular.value.copy(d.specular),c.shininess.value=Math.max(d.shininess,1e-4)):a.isMeshStandardMaterial?(r(e,a),f=e,p=a,f.metalness.value=p.metalness,p.metalnessMap&&(f.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,f.metalnessMapTransform)),f.roughness.value=p.roughness,p.roughnessMap&&(f.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,f.roughnessMapTransform)),p.envMap&&(f.envMapIntensity.value=p.envMapIntensity),a.isMeshPhysicalMaterial&&(m=e,h=a,g=l,m.ior.value=h.ior,h.sheen>0&&(m.sheenColor.value.copy(h.sheenColor).multiplyScalar(h.sheen),m.sheenRoughness.value=h.sheenRoughness,h.sheenColorMap&&(m.sheenColorMap.value=h.sheenColorMap,t(h.sheenColorMap,m.sheenColorMapTransform)),h.sheenRoughnessMap&&(m.sheenRoughnessMap.value=h.sheenRoughnessMap,t(h.sheenRoughnessMap,m.sheenRoughnessMapTransform))),h.clearcoat>0&&(m.clearcoat.value=h.clearcoat,m.clearcoatRoughness.value=h.clearcoatRoughness,h.clearcoatMap&&(m.clearcoatMap.value=h.clearcoatMap,t(h.clearcoatMap,m.clearcoatMapTransform)),h.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=h.clearcoatRoughnessMap,t(h.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),h.clearcoatNormalMap&&(m.clearcoatNormalMap.value=h.clearcoatNormalMap,t(h.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(h.clearcoatNormalScale),h.side===S.BackSide&&m.clearcoatNormalScale.value.negate())),h.dispersion>0&&(m.dispersion.value=h.dispersion),h.iridescence>0&&(m.iridescence.value=h.iridescence,m.iridescenceIOR.value=h.iridescenceIOR,m.iridescenceThicknessMinimum.value=h.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=h.iridescenceThicknessRange[1],h.iridescenceMap&&(m.iridescenceMap.value=h.iridescenceMap,t(h.iridescenceMap,m.iridescenceMapTransform)),h.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=h.iridescenceThicknessMap,t(h.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),h.transmission>0&&(m.transmission.value=h.transmission,m.transmissionSamplerMap.value=g.texture,m.transmissionSamplerSize.value.set(g.width,g.height),h.transmissionMap&&(m.transmissionMap.value=h.transmissionMap,t(h.transmissionMap,m.transmissionMapTransform)),m.thickness.value=h.thickness,h.thicknessMap&&(m.thicknessMap.value=h.thicknessMap,t(h.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=h.attenuationDistance,m.attenuationColor.value.copy(h.attenuationColor)),h.anisotropy>0&&(m.anisotropyVector.value.set(h.anisotropy*Math.cos(h.anisotropyRotation),h.anisotropy*Math.sin(h.anisotropyRotation)),h.anisotropyMap&&(m.anisotropyMap.value=h.anisotropyMap,t(h.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=h.specularIntensity,m.specularColor.value.copy(h.specularColor),h.specularColorMap&&(m.specularColorMap.value=h.specularColorMap,t(h.specularColorMap,m.specularColorMapTransform)),h.specularIntensityMap&&(m.specularIntensityMap.value=h.specularIntensityMap,t(h.specularIntensityMap,m.specularIntensityMapTransform)))):a.isMeshMatcapMaterial?(r(e,a),_=e,(v=a).matcap&&(_.matcap.value=v.matcap)):a.isMeshDepthMaterial?r(e,a):a.isMeshDistanceMaterial?(r(e,a),E=e,T=a,N=n.get(T).light,E.referencePosition.value.setFromMatrixPosition(N.matrixWorld),E.nearDistance.value=N.shadow.camera.near,E.farDistance.value=N.shadow.camera.far):a.isMeshNormalMaterial?r(e,a):a.isLineBasicMaterial?(M=e,b=a,M.diffuse.value.copy(b.color),M.opacity.value=b.opacity,b.map&&(M.map.value=b.map,t(b.map,M.mapTransform)),a.isLineDashedMaterial&&(x=e,R=a,x.dashSize.value=R.dashSize,x.totalSize.value=R.dashSize+R.gapSize,x.scale.value=R.scale)):a.isPointsMaterial?(C=e,y=a,A=i,P=o,C.diffuse.value.copy(y.color),C.opacity.value=y.opacity,C.size.value=y.size*A,C.scale.value=.5*P,y.map&&(C.map.value=y.map,t(y.map,C.uvTransform)),y.alphaMap&&(C.alphaMap.value=y.alphaMap,t(y.alphaMap,C.alphaMapTransform)),y.alphaTest>0&&(C.alphaTest.value=y.alphaTest)):a.isSpriteMaterial?(w=e,L=a,w.diffuse.value.copy(L.color),w.opacity.value=L.opacity,w.rotation.value=L.rotation,L.map&&(w.map.value=L.map,t(L.map,w.mapTransform)),L.alphaMap&&(w.alphaMap.value=L.alphaMap,t(L.alphaMap,w.alphaMapTransform)),L.alphaTest>0&&(w.alphaTest.value=L.alphaTest)):a.isShadowMaterial?(e.color.value.copy(a.color),e.opacity.value=a.opacity):a.isShaderMaterial&&(a.uniformsNeedUpdate=!1)}}}function nQ(e,n,t,r){let a={},i={},o=[],l=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function s(e){let n={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(n.boundary=4,n.storage=4):e.isVector2?(n.boundary=8,n.storage=8):e.isVector3||e.isColor?(n.boundary=16,n.storage=12):e.isVector4?(n.boundary=16,n.storage=16):e.isMatrix3?(n.boundary=48,n.storage=48):e.isMatrix4?(n.boundary=64,n.storage=64):e.isTexture?(0,S.warn)("WebGLRenderer: Texture samplers can not be part of an uniforms group."):(0,S.warn)("WebGLRenderer: Unsupported uniform value type.",e),n}function u(n){let t=n.target;t.removeEventListener("dispose",u);let r=o.indexOf(t.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(a[t.id]),delete a[t.id],delete i[t.id]}return{bind:function(e,n){let t=n.program;r.uniformBlockBinding(e,t)},update:function(t,c){var d;let f,p,m,h,g=a[t.id];void 0===g&&(function(e){let n=e.uniforms,t=0;for(let e=0,r=n.length;e0&&(t+=16-r),e.__size=t,e.__cache={}}(t),(d=t).__bindingPointIndex=f=function(){for(let e=0;etypeof WebGLRenderingContext&&F instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");n=F.getContextAttributes().alpha}else n=G;const q=new Set([S.RGBAIntegerFormat,S.RGIntegerFormat,S.RedIntegerFormat]),en=new Set([S.UnsignedByteType,S.UnsignedIntType,S.UnsignedShortType,S.UnsignedInt248Type,S.UnsignedShort4444Type,S.UnsignedShort5551Type]),er=new Uint32Array(4),ea=new Int32Array(4);let ei=null,eo=null;const el=[],es=[];let eu=null;this.domElement=I,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=S.NoToneMapping,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const ec=this;let ed=!1;this._outputColorSpace=S.SRGBColorSpace;let ef=0,ep=0,em=null,eh=-1,eg=null;const e_=new S.Vector4,ev=new S.Vector4;let eS=null;const eE=new S.Color(0);let eT=0,eM=I.width,eb=I.height,ex=1,eR=null,eC=null;const ey=new S.Vector4(0,0,eM,eb),eA=new S.Vector4(0,0,eM,eb);let eP=!1;const ew=new S.Frustum;let eL=!1,eN=!1;const eU=new S.Matrix4,eD=new S.Vector3,eI=new S.Vector4,eF={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let eO=!1;function eB(){return null===em?ex:1}let eG=F;function eH(e,n){return I.getContext(e,n)}try{if("setAttribute"in I&&I.setAttribute("data-engine",`three.js r${S.REVISION}`),I.addEventListener("webglcontextlost",ez,!1),I.addEventListener("webglcontextrestored",eW,!1),I.addEventListener("webglcontextcreationerror",eX,!1),null===eG){const e="webgl2";if(eG=eH(e,{alpha:!0,depth:O,stencil:B,antialias:H,premultipliedAlpha:k,preserveDrawingBuffer:V,powerPreference:z,failIfMajorPerformanceCaveat:W}),null===eG)if(eH(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw(0,S.error)("WebGLRenderer: "+e.message),e}function ek(){(t=new K(eG)).init(),C=new nz(eG,t),r=new L(eG,t,e,C),a=new nk(eG,t),r.reversedDepthBuffer&&X&&a.buffers.depth.setReversed(!0),i=new Z(eG),o=new nb,l=new nV(eG,t,a,o,r,C,i),s=new U(ec),u=new Y(ec),c=new T(eG),y=new P(eG,c),d=new $(eG,c,i,y),f=new ee(eG,d,c,i),b=new J(eG,r,l),_=new N(o),p=new nM(ec,s,u,t,r,y,_),m=new n$(ec,o),h=new ny,g=new nU(t),M=new A(ec,s,u,a,f,n,k),v=new nG(ec,f,r),D=new nQ(eG,i,r,a),x=new w(eG,t,i),R=new Q(eG,t,i),i.programs=p.programs,ec.capabilities=r,ec.extensions=t,ec.properties=o,ec.renderLists=h,ec.shadowMap=v,ec.state=a,ec.info=i}ek(),j!==S.UnsignedByteType&&(eu=new et(j,I.width,I.height,O,B));const eV=new nq(ec,eG);function ez(e){e.preventDefault(),(0,S.log)("WebGLRenderer: Context Lost."),ed=!0}function eW(){(0,S.log)("WebGLRenderer: Context Restored."),ed=!1;let e=i.autoReset,n=v.enabled,t=v.autoUpdate,r=v.needsUpdate,a=v.type;ek(),i.autoReset=e,v.enabled=n,v.autoUpdate=t,v.needsUpdate=r,v.type=a}function eX(e){(0,S.error)("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function ej(e){var n,t;let r,a=e.target;a.removeEventListener("dispose",ej),t=n=a,void 0!==(r=o.get(t).programs)&&(r.forEach(function(e){p.releaseProgram(e)}),t.isShaderMaterial&&p.releaseShaderCache(t)),o.remove(n)}function eq(e,n,t){!0===e.transparent&&e.side===S.DoubleSide&&!1===e.forceSinglePass?(e.side=S.BackSide,e.needsUpdate=!0,e2(e,n,t),e.side=S.FrontSide,e.needsUpdate=!0,e2(e,n,t),e.side=S.DoubleSide):e2(e,n,t)}this.xr=eV,this.getContext=function(){return eG},this.getContextAttributes=function(){return eG.getContextAttributes()},this.forceContextLoss=function(){let e=t.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=t.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ex},this.setPixelRatio=function(e){void 0!==e&&(ex=e,this.setSize(eM,eb,!1))},this.getSize=function(e){return e.set(eM,eb)},this.setSize=function(e,n,t=!0){eV.isPresenting?(0,S.warn)("WebGLRenderer: Can't change size while VR device is presenting."):(eM=e,eb=n,I.width=Math.floor(e*ex),I.height=Math.floor(n*ex),!0===t&&(I.style.width=e+"px",I.style.height=n+"px"),null!==eu&&eu.setSize(I.width,I.height),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(eM*ex,eb*ex).floor()},this.setDrawingBufferSize=function(e,n,t){eM=e,eb=n,ex=t,I.width=Math.floor(e*t),I.height=Math.floor(n*t),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(j===S.UnsignedByteType)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(e){for(let n=0;np.matrixWorld.determinant(),E=function(e,n,t,i,c){var d,f;!0!==n.isScene&&(n=eF),l.resetTextureUnits();let p=n.fog,h=i.isMeshStandardMaterial?n.environment:null,g=null===em?ec.outputColorSpace:!0===em.isXRRenderTarget?em.texture.colorSpace:S.LinearSRGBColorSpace,v=(i.isMeshStandardMaterial?u:s).get(i.envMap||h),E=!0===i.vertexColors&&!!t.attributes.color&&4===t.attributes.color.itemSize,T=!!t.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),M=!!t.morphAttributes.position,x=!!t.morphAttributes.normal,R=!!t.morphAttributes.color,C=S.NoToneMapping;i.toneMapped&&(null===em||!0===em.isXRRenderTarget)&&(C=ec.toneMapping);let y=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,A=void 0!==y?y.length:0,P=o.get(i),w=eo.state.lights;if(!0===eL&&(!0===eN||e!==eg)){let n=e===eg&&i.id===eh;_.setState(i,e,n)}let L=!1;i.version===P.__version?P.needsLights&&P.lightsStateVersion!==w.state.version||P.outputColorSpace!==g||c.isBatchedMesh&&!1===P.batching?L=!0:c.isBatchedMesh||!0!==P.batching?c.isBatchedMesh&&!0===P.batchingColor&&null===c.colorTexture||c.isBatchedMesh&&!1===P.batchingColor&&null!==c.colorTexture||c.isInstancedMesh&&!1===P.instancing?L=!0:c.isInstancedMesh||!0!==P.instancing?c.isSkinnedMesh&&!1===P.skinning?L=!0:c.isSkinnedMesh||!0!==P.skinning?c.isInstancedMesh&&!0===P.instancingColor&&null===c.instanceColor||c.isInstancedMesh&&!1===P.instancingColor&&null!==c.instanceColor||c.isInstancedMesh&&!0===P.instancingMorph&&null===c.morphTexture||c.isInstancedMesh&&!1===P.instancingMorph&&null!==c.morphTexture||P.envMap!==v||!0===i.fog&&P.fog!==p||void 0!==P.numClippingPlanes&&(P.numClippingPlanes!==_.numPlanes||P.numIntersection!==_.numIntersection)||P.vertexAlphas!==E||P.vertexTangents!==T||P.morphTargets!==M||P.morphNormals!==x||P.morphColors!==R||P.toneMapping!==C?L=!0:P.morphTargetsCount!==A&&(L=!0):L=!0:L=!0:L=!0:(L=!0,P.__version=i.version);let N=P.currentProgram;!0===L&&(N=e2(i,n,c));let U=!1,I=!1,F=!1,O=N.getUniforms(),B=P.uniforms;if(a.useProgram(N.program)&&(U=!0,I=!0,F=!0),i.id!==eh&&(eh=i.id,I=!0),U||eg!==e){a.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(eG,"projectionMatrix",e.projectionMatrix),O.setValue(eG,"viewMatrix",e.matrixWorldInverse);let n=O.map.cameraPosition;void 0!==n&&n.setValue(eG,eD.setFromMatrixPosition(e.matrixWorld)),r.logarithmicDepthBuffer&&O.setValue(eG,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&O.setValue(eG,"isOrthographic",!0===e.isOrthographicCamera),eg!==e&&(eg=e,I=!0,F=!0)}if(P.needsLights&&(w.state.directionalShadowMap.length>0&&O.setValue(eG,"directionalShadowMap",w.state.directionalShadowMap,l),w.state.spotShadowMap.length>0&&O.setValue(eG,"spotShadowMap",w.state.spotShadowMap,l),w.state.pointShadowMap.length>0&&O.setValue(eG,"pointShadowMap",w.state.pointShadowMap,l)),c.isSkinnedMesh){O.setOptional(eG,c,"bindMatrix"),O.setOptional(eG,c,"bindMatrixInverse");let e=c.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),O.setValue(eG,"boneTexture",e.boneTexture,l))}c.isBatchedMesh&&(O.setOptional(eG,c,"batchingTexture"),O.setValue(eG,"batchingTexture",c._matricesTexture,l),O.setOptional(eG,c,"batchingIdTexture"),O.setValue(eG,"batchingIdTexture",c._indirectTexture,l),O.setOptional(eG,c,"batchingColorTexture"),null!==c._colorsTexture&&O.setValue(eG,"batchingColorTexture",c._colorsTexture,l));let G=t.morphAttributes;if((void 0!==G.position||void 0!==G.normal||void 0!==G.color)&&b.update(c,t,N),(I||P.receiveShadow!==c.receiveShadow)&&(P.receiveShadow=c.receiveShadow,O.setValue(eG,"receiveShadow",c.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(B.envMap.value=v,B.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1),i.isMeshStandardMaterial&&null===i.envMap&&null!==n.environment&&(B.envMapIntensity.value=n.environmentIntensity),void 0!==B.dfgLUT&&(B.dfgLUT.value=(null===nJ&&((nJ=new S.DataTexture(nZ,16,16,S.RGFormat,S.HalfFloatType)).name="DFG_LUT",nJ.minFilter=S.LinearFilter,nJ.magFilter=S.LinearFilter,nJ.wrapS=S.ClampToEdgeWrapping,nJ.wrapT=S.ClampToEdgeWrapping,nJ.generateMipmaps=!1,nJ.needsUpdate=!0),nJ)),I&&(O.setValue(eG,"toneMappingExposure",ec.toneMappingExposure),P.needsLights&&(d=B,f=F,d.ambientLightColor.needsUpdate=f,d.lightProbe.needsUpdate=f,d.directionalLights.needsUpdate=f,d.directionalLightShadows.needsUpdate=f,d.pointLights.needsUpdate=f,d.pointLightShadows.needsUpdate=f,d.spotLights.needsUpdate=f,d.spotLightShadows.needsUpdate=f,d.rectAreaLights.needsUpdate=f,d.hemisphereLights.needsUpdate=f),p&&!0===i.fog&&m.refreshFogUniforms(B,p),m.refreshMaterialUniforms(B,i,ex,eb,eo.state.transmissionRenderTarget[e.id]),e6.upload(eG,e4(P),B,l)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(e6.upload(eG,e4(P),B,l),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&O.setValue(eG,"center",c.center),O.setValue(eG,"modelViewMatrix",c.modelViewMatrix),O.setValue(eG,"normalMatrix",c.normalMatrix),O.setValue(eG,"modelMatrix",c.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){let e=i.uniformsGroups;for(let n=0,t=e.length;n{function r(){(a.forEach(function(e){o.get(e).currentProgram.isReady()&&a.delete(e)}),0===a.size)?n(e):setTimeout(r,10)}null!==t.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)})};let eY=null;function eK(){eQ.stop()}function e$(){eQ.start()}const eQ=new E;function eZ(e,n,t,r){if(!1===e.visible)return;if(e.layers.test(n.layers)){if(e.isGroup)t=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(n);else if(e.isLight)eo.pushLight(e),e.castShadow&&eo.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ew.intersectsSprite(e)){r&&eI.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eU);let n=f.update(e),a=e.material;a.visible&&ei.push(e,n,a,t,eI.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ew.intersectsObject(e))){let n=f.update(e),a=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eI.copy(e.boundingSphere.center)):(null===n.boundingSphere&&n.computeBoundingSphere(),eI.copy(n.boundingSphere.center)),eI.applyMatrix4(e.matrixWorld).applyMatrix4(eU)),Array.isArray(a)){let r=n.groups;for(let i=0,o=r.length;i0&&e1(i,n,t),o.length>0&&e1(o,n,t),l.length>0&&e1(l,n,t),a.buffers.depth.setTest(!0),a.buffers.depth.setMask(!0),a.buffers.color.setMask(!0),a.setPolygonOffset(!1)}function e0(e,n,a,i){if(null!==(!0===a.isScene?a.overrideMaterial:null))return;if(void 0===eo.state.transmissionRenderTarget[i.id]){let e=t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float");eo.state.transmissionRenderTarget[i.id]=new S.WebGLRenderTarget(1,1,{generateMipmaps:!0,type:e?S.HalfFloatType:S.UnsignedByteType,minFilter:S.LinearMipmapLinearFilter,samples:r.samples,stencilBuffer:B,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:S.ColorManagement.workingColorSpace})}let o=eo.state.transmissionRenderTarget[i.id],s=i.viewport||e_;o.setSize(s.z*ec.transmissionResolutionScale,s.w*ec.transmissionResolutionScale);let u=ec.getRenderTarget(),c=ec.getActiveCubeFace(),d=ec.getActiveMipmapLevel();ec.setRenderTarget(o),ec.getClearColor(eE),(eT=ec.getClearAlpha())<1&&ec.setClearColor(0xffffff,.5),ec.clear(),eO&&M.render(a);let f=ec.toneMapping;ec.toneMapping=S.NoToneMapping;let p=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),eo.setupLightsView(i),!0===eL&&_.setGlobalState(ec.clippingPlanes,i),e1(e,a,i),l.updateMultisampleRenderTarget(o),l.updateRenderTargetMipmap(o),!1===t.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let t=0,r=n.length;ttypeof self&&eQ.setContext(self),this.setAnimationLoop=function(e){eY=e,eV.setAnimationLoop(e),null===e?eQ.stop():eQ.start()},eV.addEventListener("sessionstart",eK),eV.addEventListener("sessionend",e$),this.render=function(e,n){if(void 0!==n&&!0!==n.isCamera)return void(0,S.error)("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===ed)return;let t=!0===eV.enabled&&!0===eV.isPresenting,r=null!==eu&&(null===em||t)&&eu.begin(ec,em);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===n.parent&&!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),!0===eV.enabled&&!0===eV.isPresenting&&(null===eu||!1===eu.isCompositing())&&(!0===eV.cameraAutoUpdate&&eV.updateCamera(n),n=eV.getCamera()),!0===e.isScene&&e.onBeforeRender(ec,e,n,em),(eo=g.get(e,es.length)).init(n),es.push(eo),eU.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ew.setFromProjectionMatrix(eU,S.WebGLCoordinateSystem,n.reversedDepth),eN=this.localClippingEnabled,eL=_.init(this.clippingPlanes,eN),(ei=h.get(e,el.length)).init(),el.push(ei),!0===eV.enabled&&!0===eV.isPresenting){let e=ec.xr.getDepthSensingMesh();null!==e&&eZ(e,n,-1/0,ec.sortObjects)}eZ(e,n,0,ec.sortObjects),ei.finish(),!0===ec.sortObjects&&ei.sort(eR,eC),(eO=!1===eV.enabled||!1===eV.isPresenting||!1===eV.hasDepthSensing())&&M.addToRenderList(ei,e),this.info.render.frame++,!0===eL&&_.beginShadows();let a=eo.state.shadowsArray;if(v.render(a,e,n),!0===eL&&_.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(r&&eu.hasRenderPass())){let t=ei.opaque,r=ei.transmissive;if(eo.setupLights(),n.isArrayCamera){let a=n.cameras;if(r.length>0)for(let n=0,i=a.length;n0&&e0(t,r,e,n),eO&&M.render(e),eJ(ei,e,n)}null!==em&&0===ep&&(l.updateMultisampleRenderTarget(em),l.updateRenderTargetMipmap(em)),r&&eu.end(ec),!0===e.isScene&&e.onAfterRender(ec,e,n),y.resetDefaultState(),eh=-1,eg=null,es.pop(),es.length>0?(eo=es[es.length-1],!0===eL&&_.setGlobalState(ec.clippingPlanes,eo.state.camera)):eo=null,el.pop(),ei=el.length>0?el[el.length-1]:null},this.getActiveCubeFace=function(){return ef},this.getActiveMipmapLevel=function(){return ep},this.getRenderTarget=function(){return em},this.setRenderTargetTextures=function(e,n,t){let r=o.get(e);r.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===r.__autoAllocateDepthBuffer&&(r.__useRenderToTexture=!1),o.get(e.texture).__webglTexture=n,o.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:t,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,n){let t=o.get(e);t.__webglFramebuffer=n,t.__useDefaultFramebuffer=void 0===n};const e8=eG.createFramebuffer();this.setRenderTarget=function(e,n=0,t=0){em=e,ef=n,ep=t;let r=null,i=!1,s=!1;if(e){let u=o.get(e);if(void 0!==u.__useDefaultFramebuffer){a.bindFramebuffer(eG.FRAMEBUFFER,u.__webglFramebuffer),e_.copy(e.viewport),ev.copy(e.scissor),eS=e.scissorTest,a.viewport(e_),a.scissor(ev),a.setScissorTest(eS),eh=-1;return}if(void 0===u.__webglFramebuffer)l.setupRenderTarget(e);else if(u.__hasExternalTextures)l.rebindTextures(e,o.get(e.texture).__webglTexture,o.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let n=e.depthTexture;if(u.__boundDepthTexture!==n){if(null!==n&&o.has(n)&&(e.width!==n.image.width||e.height!==n.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");l.setupDepthRenderbuffer(e)}}let c=e.texture;(c.isData3DTexture||c.isDataArrayTexture||c.isCompressedArrayTexture)&&(s=!0);let d=o.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(d[n])?d[n][t]:d[n],i=!0):r=e.samples>0&&!1===l.useMultisampledRTT(e)?o.get(e).__webglMultisampledFramebuffer:Array.isArray(d)?d[t]:d,e_.copy(e.viewport),ev.copy(e.scissor),eS=e.scissorTest}else e_.copy(ey).multiplyScalar(ex).floor(),ev.copy(eA).multiplyScalar(ex).floor(),eS=eP;if(0!==t&&(r=e8),a.bindFramebuffer(eG.FRAMEBUFFER,r)&&a.drawBuffers(e,r),a.viewport(e_),a.scissor(ev),a.setScissorTest(eS),i){let r=o.get(e.texture);eG.framebufferTexture2D(eG.FRAMEBUFFER,eG.COLOR_ATTACHMENT0,eG.TEXTURE_CUBE_MAP_POSITIVE_X+n,r.__webglTexture,t)}else if(s)for(let r=0;r=0&&n<=e.width-i&&t>=0&&t<=e.height-l&&(e.textures.length>1&&eG.readBuffer(eG.COLOR_ATTACHMENT0+c),eG.readPixels(n,t,i,l,C.convert(o),C.convert(u),s))}finally{let e=null!==em?o.get(em).__webglFramebuffer:null;a.bindFramebuffer(eG.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,n,t,i,l,s,u,c=0){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let d=o.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(d=d[u]),d)if(n>=0&&n<=e.width-i&&t>=0&&t<=e.height-l){a.bindFramebuffer(eG.FRAMEBUFFER,d);let u=e.textures[c],f=u.format,p=u.type;if(!r.textureFormatReadable(f))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let m=eG.createBuffer();eG.bindBuffer(eG.PIXEL_PACK_BUFFER,m),eG.bufferData(eG.PIXEL_PACK_BUFFER,s.byteLength,eG.STREAM_READ),e.textures.length>1&&eG.readBuffer(eG.COLOR_ATTACHMENT0+c),eG.readPixels(n,t,i,l,C.convert(f),C.convert(p),0);let h=null!==em?o.get(em).__webglFramebuffer:null;a.bindFramebuffer(eG.FRAMEBUFFER,h);let g=eG.fenceSync(eG.SYNC_GPU_COMMANDS_COMPLETE,0);return eG.flush(),await (0,S.probeAsync)(eG,g,4),eG.bindBuffer(eG.PIXEL_PACK_BUFFER,m),eG.getBufferSubData(eG.PIXEL_PACK_BUFFER,0,s),eG.deleteBuffer(m),eG.deleteSync(g),s}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e,n=null,t=0){let r=Math.pow(2,-t),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),s=null!==n?n.x:0,u=null!==n?n.y:0;l.setTexture2D(e,0),eG.copyTexSubImage2D(eG.TEXTURE_2D,t,0,0,s,u,i,o),a.unbindTexture()};const e9=eG.createFramebuffer(),e7=eG.createFramebuffer();this.copyTextureToTexture=function(e,n,t=null,r=null,i=0,s=null){let u,c,d,f,p,m,h,g,_,v;null===s&&(0!==i?((0,S.warnOnce)("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),s=i,i=0):s=0);let E=e.isCompressedTexture?e.mipmaps[s]:e.image;if(null!==t)u=t.max.x-t.min.x,c=t.max.y-t.min.y,d=t.isBox3?t.max.z-t.min.z:1,f=t.min.x,p=t.min.y,m=t.isBox3?t.min.z:0;else{let n=Math.pow(2,-i);u=Math.floor(E.width*n),c=Math.floor(E.height*n),d=e.isDataArrayTexture?E.depth:e.isData3DTexture?Math.floor(E.depth*n):1,f=0,p=0,m=0}null!==r?(h=r.x,g=r.y,_=r.z):(h=0,g=0,_=0);let T=C.convert(n.format),M=C.convert(n.type);n.isData3DTexture?(l.setTexture3D(n,0),v=eG.TEXTURE_3D):n.isDataArrayTexture||n.isCompressedArrayTexture?(l.setTexture2DArray(n,0),v=eG.TEXTURE_2D_ARRAY):(l.setTexture2D(n,0),v=eG.TEXTURE_2D),eG.pixelStorei(eG.UNPACK_FLIP_Y_WEBGL,n.flipY),eG.pixelStorei(eG.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),eG.pixelStorei(eG.UNPACK_ALIGNMENT,n.unpackAlignment);let b=eG.getParameter(eG.UNPACK_ROW_LENGTH),x=eG.getParameter(eG.UNPACK_IMAGE_HEIGHT),R=eG.getParameter(eG.UNPACK_SKIP_PIXELS),y=eG.getParameter(eG.UNPACK_SKIP_ROWS),A=eG.getParameter(eG.UNPACK_SKIP_IMAGES);eG.pixelStorei(eG.UNPACK_ROW_LENGTH,E.width),eG.pixelStorei(eG.UNPACK_IMAGE_HEIGHT,E.height),eG.pixelStorei(eG.UNPACK_SKIP_PIXELS,f),eG.pixelStorei(eG.UNPACK_SKIP_ROWS,p),eG.pixelStorei(eG.UNPACK_SKIP_IMAGES,m);let P=e.isDataArrayTexture||e.isData3DTexture,w=n.isDataArrayTexture||n.isData3DTexture;if(e.isDepthTexture){let t=o.get(e),r=o.get(n),l=o.get(t.__renderTarget),v=o.get(r.__renderTarget);a.bindFramebuffer(eG.READ_FRAMEBUFFER,l.__webglFramebuffer),a.bindFramebuffer(eG.DRAW_FRAMEBUFFER,v.__webglFramebuffer);for(let t=0;ttypeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return S.WebGLCoordinateSystem}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let n=this.getContext();n.drawingBufferColorSpace=S.ColorManagement._getDrawingBufferColorSpace(e),n.unpackColorSpace=S.ColorManagement._getUnpackColorSpace()}}e.s(["PMREMGenerator",()=>V,"ShaderChunk",()=>M,"ShaderLib",()=>x,"UniformsLib",()=>b,"WebGLRenderer",()=>n0,"WebGLUtils",()=>nz],8560);var n1=e.i(66748);let n3=[];function n2(e,n,t=(e,n)=>e===n){if(e===n)return!0;if(!e||!n)return!1;let r=e.length;if(n.length!==r)return!1;for(let a=0;a0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,r.lifespan)),a.response;if(!t)throw a.promise}let a={keys:n,equal:r.equal,remove:()=>{let e=n3.indexOf(a);-1!==e&&n3.splice(e,1)},promise:("object"==typeof e&&"function"==typeof e.then?e:e(...n)).then(e=>{a.response=e,r.lifespan&&r.lifespan>0&&(a.timeout=setTimeout(a.remove,r.lifespan))}).catch(e=>a.error=e)};if(n3.push(a),!t)throw a.promise}var n5=e.i(89499),n6=e.i(43476),n8=_;function n9(e,n,t){if(!e)return;if(!0===t(e))return e;let r=n?e.return:e.child;for(;r;){let e=n9(r,n,t);if(e)return e;r=n?null:r.sibling}}function n7(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(n){return e}}"u">typeof window&&((null==(c=window.document)?void 0:c.createElement)||(null==(d=window.navigator)?void 0:d.product)==="ReactNative")?n8.useLayoutEffect:n8.useEffect;let te=n7(n8.createContext(null));class tn extends n8.Component{render(){return n8.createElement(te.Provider,{value:this._reactInternals},this.props.children)}}function tt(){let e=n8.useContext(te);if(null===e)throw Error("its-fine: useFiber must be called within a !");let n=n8.useId();return n8.useMemo(()=>{for(let t of[e,null==e?void 0:e.alternate]){if(!t)continue;let e=n9(t,!1,e=>{let t=e.memoizedState;for(;t;){if(t.memoizedState===n)return!0;t=t.next}});if(e)return e}},[e,n])}let tr=Symbol.for("react.context"),ta=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===tr;function ti(){let e=function(){let e=tt(),[n]=n8.useState(()=>new Map);n.clear();let t=e;for(;t;){let e=t.type;ta(e)&&e!==te&&!n.has(e)&&n.set(e,n8.use(n7(e))),t=t.return}return n}();return n8.useMemo(()=>Array.from(e.keys()).reduce((n,t)=>r=>n8.createElement(n,null,n8.createElement(t.Provider,{...r,value:e.get(t)})),e=>n8.createElement(tn,{...e})),[e])}function to(e){let n=e.root;for(;n.getState().previousRoot;)n=n.getState().previousRoot;return n}e.s(["FiberProvider",()=>tn,"traverseFiber",()=>n9,"useContextBridge",()=>ti,"useFiber",()=>tt],46791),_.act;let tl=e=>e&&e.hasOwnProperty("current"),ts=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),tu="u">typeof window&&((null==(o=window.document)?void 0:o.createElement)||(null==(l=window.navigator)?void 0:l.product)==="ReactNative")?_.useLayoutEffect:_.useEffect;function tc(e){let n=_.useRef(e);return tu(()=>void(n.current=e),[e]),n}function td(){let e=tt(),n=ti();return _.useMemo(()=>({children:t})=>{let r=n9(e,!0,e=>e.type===_.StrictMode)?_.StrictMode:_.Fragment;return(0,n6.jsx)(r,{children:(0,n6.jsx)(n,{children:t})})},[e,n])}function tf({set:e}){return tu(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}let tp=((s=class extends _.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}).getDerivedStateFromError=()=>({error:!0}),s);function tm(e){var n;let t="u">typeof window?null!=(n=window.devicePixelRatio)?n:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],t),e[1]):e}function th(e){var n;return null==(n=e.__r3f)?void 0:n.root.getState()}let tg={obj:e=>e===Object(e)&&!tg.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,n,{arrays:t="shallow",objects:r="reference",strict:a=!0}={}){let i;if(typeof e!=typeof n||!!e!=!!n)return!1;if(tg.str(e)||tg.num(e)||tg.boo(e))return e===n;let o=tg.obj(e);if(o&&"reference"===r)return e===n;let l=tg.arr(e);if(l&&"reference"===t)return e===n;if((l||o)&&e===n)return!0;for(i in e)if(!(i in n))return!1;if(o&&"shallow"===t&&"shallow"===r){for(i in a?n:e)if(!tg.equ(e[i],n[i],{strict:a,objects:"reference"}))return!1}else for(i in a?n:e)if(e[i]!==n[i])return!1;if(tg.und(i)){if(l&&0===e.length&&0===n.length||o&&0===Object.keys(e).length&&0===Object.keys(n).length)return!0;if(e!==n)return!1}return!0}},t_=["children","key","ref"];function tv(e,n,t,r){let a=null==e?void 0:e.__r3f;return!a&&(a={root:n,type:t,parent:null,children:[],props:function(e){let n={};for(let t in e)t_.includes(t)||(n[t]=e[t]);return n}(r),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=a)),a}function tS(e,n){if(!n.includes("-")||n in e)return{root:e,key:n,target:e[n]};let t=e,r=n.split("-");for(let a of r){if("object"!=typeof t||null===t){if(void 0!==t)return{root:t,key:r.slice(r.indexOf(a)).join("-"),target:void 0};return{root:e,key:n,target:void 0}}n=a,e=t,t=t[n]}return{root:e,key:n,target:t}}let tE=/-\d+$/;function tT(e,n){if(tg.str(n.props.attach)){if(tE.test(n.props.attach)){let t=n.props.attach.replace(tE,""),{root:r,key:a}=tS(e.object,t);Array.isArray(r[a])||(r[a]=[])}let{root:t,key:r}=tS(e.object,n.props.attach);n.previousAttach=t[r],t[r]=n.object}else tg.fun(n.props.attach)&&(n.previousAttach=n.props.attach(e.object,n.object))}function tM(e,n){if(tg.str(n.props.attach)){let{root:t,key:r}=tS(e.object,n.props.attach),a=n.previousAttach;void 0===a?delete t[r]:t[r]=a}else null==n.previousAttach||n.previousAttach(e.object,n.object);delete n.previousAttach}let tb=[...t_,"args","dispose","attach","object","onUpdate","dispose"],tx=new Map,tR=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],tC=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function ty(e,n){var t,r;let a=e.__r3f,i=a&&to(a).getState(),o=null==a?void 0:a.eventCount;for(let t in n){let o=n[t];if(tb.includes(t))continue;if(a&&tC.test(t)){"function"==typeof o?a.handlers[t]=o:delete a.handlers[t],a.eventCount=Object.keys(a.handlers).length;continue}if(void 0===o)continue;let{root:l,key:s,target:u}=tS(e,t);if(void 0===u&&("object"!=typeof l||null===l))throw Error(`R3F: Cannot set "${t}". Ensure it is an object before setting "${s}".`);u instanceof v.Layers&&o instanceof v.Layers?u.mask=o.mask:u instanceof v.Color&&ts(o)?u.set(o):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"function"==typeof u.copy&&null!=o&&o.constructor&&u.constructor===o.constructor?u.copy(o):null!==u&&"object"==typeof u&&"function"==typeof u.set&&Array.isArray(o)?"function"==typeof u.fromArray?u.fromArray(o):u.set(...o):null!==u&&"object"==typeof u&&"function"==typeof u.set&&"number"==typeof o?"function"==typeof u.setScalar?u.setScalar(o):u.set(o):(l[s]=o,i&&!i.linear&&tR.includes(s)&&null!=(r=l[s])&&r.isTexture&&l[s].format===v.RGBAFormat&&l[s].type===v.UnsignedByteType&&(l[s].colorSpace=v.SRGBColorSpace))}if(null!=a&&a.parent&&null!=i&&i.internal&&null!=(t=a.object)&&t.isObject3D&&o!==a.eventCount){let e=a.object,n=i.internal.interaction.indexOf(e);n>-1&&i.internal.interaction.splice(n,1),a.eventCount&&null!==e.raycast&&i.internal.interaction.push(e)}return a&&void 0===a.props.attach&&(a.object.isBufferGeometry?a.props.attach="geometry":a.object.isMaterial&&(a.props.attach="material")),a&&tA(a),e}function tA(e){var n;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let t=null==(n=e.root)||null==n.getState?void 0:n.getState();t&&0===t.internal.frames&&t.invalidate()}let tP=e=>null==e?void 0:e.isObject3D;function tw(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function tL(e,n,t,r){let a=t.get(n);a&&(t.delete(n),0===t.size&&(e.delete(r),a.target.releasePointerCapture(r)))}let tN=e=>!!(null!=e&&e.render),tU=_.createContext(null);function tD(){let e=_.useContext(tU);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function tI(e=e=>e,n){return tD()(e,n)}function tF(e,n=0){let t=tD(),r=t.getState().internal.subscribe,a=tc(e);return tu(()=>r(a,n,t),[n,r,t]),null}let tO=new WeakMap;function tB(e,n){return function(t,...r){var a;let i;return"function"==typeof t&&(null==t||null==(a=t.prototype)?void 0:a.constructor)===t?(i=tO.get(t))||(i=new t,tO.set(t,i)):i=t,e&&e(i),Promise.all(r.map(e=>new Promise((t,r)=>i.load(e,e=>{var n;let r;tP(null==e?void 0:e.scene)&&Object.assign(e,(n=e.scene,r={nodes:{},materials:{},meshes:{}},n&&n.traverse(e=>{e.name&&(r.nodes[e.name]=e),e.material&&!r.materials[e.material.name]&&(r.materials[e.material.name]=e.material),e.isMesh&&!r.meshes[e.name]&&(r.meshes[e.name]=e)}),r)),t(e)},n,n=>r(Error(`Could not load ${e}: ${null==n?void 0:n.message}`))))))}}function tG(e,n,t,r){let a=Array.isArray(n)?n:[n],i=n4(tB(t,r),[e,...a],!1,{equal:tg.equ});return Array.isArray(n)?i:i[0]}tG.preload=function(e,n,t){let r,a=Array.isArray(n)?n:[n];n4(tB(t),[e,...a],!0,r)},tG.clear=function(e,n){var t=[e,...Array.isArray(n)?n:[n]];if(void 0===t||0===t.length)n3.splice(0,n3.length);else{let e=n3.find(e=>n2(t,e.keys,e.equal));e&&e.remove()}};var tH={exports:{}},tk={exports:{}};tk.exports;let tV=(h||(h=1,m||(m=1,tk.exports=function(e){function n(e,n,t,r){return new rK(e,n,t,r)}function t(){}function r(e){var n="https://react.dev/errors/"+e;if(1oR||(e.current=ox[oR],ox[oR]=null,oR--)}function d(e,n){ox[++oR]=e.current,e.current=n}function f(e){var n=42&e;if(0!==n)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function p(e,n,t){var r=e.pendingLanes;if(0===r)return 0;var a=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=0x7ffffff&r;return 0!==l?0!=(r=l&~i)?a=f(r):0!=(o&=l)?a=f(o):t||0!=(t=l&~e)&&(a=f(t)):0!=(l=r&~i)?a=f(l):0!==o?a=f(o):t||0!=(t=r&~e)&&(a=f(t)),0===a?0:0!==n&&n!==a&&(n&i)==0&&((i=a&-a)>=(t=n&-n)||32===i&&(4194048&t)!=0)?n:a}function m(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)==0}function h(){var e=oN;return(0x3c00000&(oN<<=1))==0&&(oN=4194304),e}function v(e){for(var n=[],t=0;31>t;t++)n.push(e);return n}function S(e,n){e.pendingLanes|=n,0x10000000!==n&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function E(e,n,t){e.pendingLanes|=n,e.suspendedLanes&=~n;var r=31-oy(n);e.entangledLanes|=n,e.entanglements[r]=0x40000000|e.entanglements[r]|261930&t}function T(e,n){var t=e.entangledLanes|=n;for(e=e.entanglements;t;){var r=31-oy(t),a=1<)":-1a||s[r]!==u[a]){var c=` +`+s[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=a)break}}}finally{oK=!1,Error.prepareStackTrace=t}return(t=e?e.displayName||e.name:"")?C(t):""}function A(e){try{var n="",t=null;do n+=function(e,n){switch(e.tag){case 26:case 27:case 5:return C(e.type);case 16:return C("Lazy");case 13:return e.child!==n&&null!==n?C("Suspense Fallback"):C("Suspense");case 19:return C("SuspenseList");case 0:case 15:return y(e.type,!1);case 11:return y(e.type.render,!1);case 1:return y(e.type,!0);case 31:return C("Activity");default:return""}}(e,t),t=e,e=e.return;while(e)return n}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}function P(e,n){if("object"==typeof e&&null!==e){var t=o$.get(e);return void 0!==t?t:(n={value:e,source:n,stack:A(n)},o$.set(e,n),n)}return{value:e,source:n,stack:A(n)}}function w(e,n){oQ[oZ++]=o0,oQ[oZ++]=oJ,oJ=e,o0=n}function L(e,n,t){o1[o3++]=o4,o1[o3++]=o5,o1[o3++]=o2,o2=e;var r=o4;e=o5;var a=32-oy(r)-1;r&=~(1<>=o,a-=o,o4=1<<32-oy(n)+a|t<f?(p=d,d=null):p=d.sibling;var _=h(n,d,o[f],l);if(null===_){null===d&&(d=p);break}e&&d&&null===_.alternate&&t(n,d),r=s(_,r,f),null===c?u=_:c.sibling=_,c=_,d=p}if(f===o.length)return a(n,d),lt&&w(n,f),u;if(null===d){for(;fp?(_=f,f=null):_=f.sibling;var S=h(n,f,v.value,u);if(null===S){null===f&&(f=_);break}e&&f&&null===S.alternate&&t(n,f),o=s(S,o,p),null===d?c=S:d.sibling=S,d=S,f=_}if(v.done)return a(n,f),lt&&w(n,p),c;if(null===f){for(;!v.done;p++,v=l.next())null!==(v=m(n,v.value,u))&&(o=s(v,o,p),null===d?c=v:d.sibling=v,d=v);return lt&&w(n,p),c}for(f=i(f);!v.done;p++,v=l.next())null!==(v=g(f,n,p,v.value,u))&&(e&&null!==v.alternate&&f.delete(null===v.key?p:v.key),o=s(v,o,p),null===d?c=v:d.sibling=v,d=v);return e&&f.forEach(function(e){return t(n,e)}),lt&&w(n,p),c}(c,d,f=_.call(f),p)}if("function"==typeof f.then)return n(c,d,eb(f),p);if(f.$$typeof===ad)return n(c,d,ee(c,f),p);eR(c,f)}return"string"==typeof f&&""!==f||"number"==typeof f||"bigint"==typeof f?(f=""+f,null!==d&&6===d.tag?(a(c,d.sibling),(p=o(d,f)).return=c):(a(c,d),(p=r1(f,c.mode,p)).return=c),u(c=p)):a(c,d)}(c,d,f,p);return lw=null,_}catch(e){if(e===lR||e===ly)throw e;var v=n(29,e,null,c.mode);return v.lanes=p,v.return=c,v}finally{}}}function ey(){for(var e=lI,n=lF=lI=0;ni?i:8);var o=aM.T,l={};aM.T=l,nZ(e,!1,n,t);try{var s=a(),u=aM.S;if(null!==u&&u(l,s),null!==s&&"object"==typeof s&&"function"==typeof s.then){var c,d,f=(c=[],d={status:"pending",value:null,reason:null,then:function(e){c.push(e)}},s.then(function(){d.status="fulfilled",d.value=r;for(var e=0;e";case sc:return":has("+(rf(e)||"")+")";case sd:return'[role="'+e.value+'"]';case sp:return'"'+e.value+'"';case sf:return'[data-testname="'+e.value+'"]';default:throw Error(r(365))}}function rp(e,n){var t=[];e=[e,0];for(var r=0;rsO&&(n.flags|=128,i=!0,tO(a,!1),n.lanes=4194304)}else{if(!i)if(null!==(e=eQ(o))){if(n.flags|=128,i=!0,n.updateQueue=e=e.updateQueue,tF(n,e),tO(a,!0),null===a.tail&&"hidden"===a.tailMode&&!o.alternate&&!lt)return tB(n),null}else 2*oO()-a.renderingStartTime>sO&&0x20000000!==t&&(n.flags|=128,i=!0,tO(a,!1),n.lanes=4194304);a.isBackwards?(o.sibling=n.child,n.child=o):(null!==(e=a.last)?e.sibling=o:n.child=o,a.last=o)}return null!==a.tail?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=oO(),e.sibling=null,t=lz.current,d(lz,i?1&t|2:1&t),lt&&w(n,a.treeForkCount),e):(tB(n),null);case 22:case 23:return e$(n),eX(),a=null!==n.memoizedState,null!==e?null!==e.memoizedState!==a&&(n.flags|=8192):a&&(n.flags|=8192),a?(0x20000000&t)!=0&&(128&n.flags)==0&&(tB(n),6&n.subtreeFlags&&(n.flags|=8192)):tB(n),null!==(t=n.updateQueue)&&tF(n,t.retryQueue),t=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(t=e.memoizedState.cachePool.pool),a=null,null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(a=n.memoizedState.cachePool.pool),a!==t&&(n.flags|=2048),null!==e&&c(lx),null;case 24:return t=null,null!==e&&(t=e.memoizedState.cache),n.memoizedState.cache!==t&&(n.flags|=2048),q(lf),tB(n),null;case 25:case 30:return null}throw Error(r(156,n.tag))}(n.alternate,n,sR);if(null!==t){sv=t;return}if(null!==(n=n.sibling)){sv=n;return}sv=n=e}while(null!==n)0===sC&&(sC=5)}function rD(e,n){do{var t=function(e,n){switch(U(n),n.tag){case 1:return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 3:return q(lf),F(),(65536&(e=n.flags))!=0&&(128&e)==0?(n.flags=-65537&e|128,n):null;case 26:case 27:case 5:return B(n),null;case 31:if(null!==n.memoizedState){if(e$(n),null===n.alternate)throw Error(r(340));z()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 13:if(e$(n),null!==(e=n.memoizedState)&&null!==e.dehydrated){if(null===n.alternate)throw Error(r(340));z()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 19:return c(lz),null;case 4:return F(),null;case 10:return q(n.type),null;case 22:case 23:return e$(n),eX(),null!==e&&c(lx),65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 24:return q(lf),null;default:return null}}(e.alternate,e);if(null!==t){t.flags&=32767,sv=t;return}if(null!==(t=e.return)&&(t.flags|=32768,t.subtreeFlags=0,t.deletions=null),!n&&null!==(e=e.sibling)){sv=e;return}sv=e=t}while(null!==e)sC=6,sv=null}function rI(e,n,t,a,i,o,l,s,u){e.cancelPendingCommit=null;do rH();while(0!==sH)if((6&sg)!=0)throw Error(r(327));if(null!==n){if(n===e.current)throw Error(r(177));if(function(e,n,t,r,a,i){var o=e.pendingLanes;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(t=o&~t;0t?32:t;t=aM.T;var i=aj();try{aX(a),aM.T=null,a=sX,sX=null;var o=sk,l=sz;if(sH=0,sV=sk=null,sz=0,(6&sg)!=0)throw Error(r(331));var s=sg;if(sg|=4,rs(o.current),rt(o,o.current,l,a),sg=s,eo(0,!1),oX&&"function"==typeof oX.onPostCommitFiberRoot)try{oX.onPostCommitFiberRoot(oW,o)}catch{}return!0}finally{aX(i),aM.T=t,rG(e,n)}}function rV(e,n,t){n=P(t,n),n=n7(e.stateNode,n,2),null!==(e=eF(e,n,2))&&(S(e,2),ei(e))}function rz(e,n,t){if(3===e.tag)rV(e,e,t);else for(;null!==n;){if(3===n.tag){rV(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===sG||!sG.has(r))){e=P(t,e),null!==(r=eF(n,t=te(2),2))&&(tn(t,r,n,e),S(r,2),ei(r));break}}n=n.return}}function rW(e,n,t){var r=e.pingCache;if(null===r){r=e.pingCache=new sh;var a=new Set;r.set(n,a)}else void 0===(a=r.get(n))&&(a=new Set,r.set(n,a));a.has(t)||(sx=!0,a.add(t),e=rX.bind(null,e,n,t),n.then(e,e))}function rX(e,n,t){var r=e.pingCache;null!==r&&r.delete(n),e.pingedLanes|=e.suspendedLanes&t,e.warmLanes&=~t,s_===e&&(sS&t)===t&&(4===sC||3===sC&&(0x3c00000&sS)===sS&&300>oO()-sI?(2&sg)==0&&rb(e,0):sP|=t,sL===sS&&(sL=0)),ei(e)}function rj(e,n){0===n&&(n=h()),null!==(e=ew(e,n))&&(S(e,n),ei(e))}function rq(e){var n=e.memoizedState,t=0;null!==n&&(t=n.retryLane),rj(e,t)}function rY(e,n){var t=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;null!==i&&(t=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==a&&a.delete(n),rj(e,t)}function rK(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function r$(e){return!(!(e=e.prototype)||!e.isReactComponent)}function rQ(e,t){var r=e.alternate;return null===r?((r=n(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=0x3e00000&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function rZ(e,n){e.flags&=0x3e00002;var t=e.alternate;return null===t?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=t.childLanes,e.lanes=t.lanes,e.child=t.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=t.memoizedProps,e.memoizedState=t.memoizedState,e.updateQueue=t.updateQueue,e.type=t.type,e.dependencies=null===(n=t.dependencies)?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function rJ(e,t,a,i,o,l){var s=0;if(i=e,"function"==typeof e)r$(e)&&(s=1);else if("string"==typeof e)s=oa&&ov?oi(e,a,o6.current)?26:oM(e)?27:5:oa?oi(e,a,o6.current)?26:5:ov&&oM(e)?27:5;else t:switch(e){case a_:return(e=n(31,a,t,o)).elementType=a_,e.lanes=l,e;case al:return r0(a.children,o,l,t);case as:s=8,o|=24;break;case au:return(e=n(12,a,t,2|o)).elementType=au,e.lanes=l,e;case ap:return(e=n(13,a,t,o)).elementType=ap,e.lanes=l,e;case am:return(e=n(19,a,t,o)).elementType=am,e.lanes=l,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case ad:s=10;break t;case ac:s=9;break t;case af:s=11;break t;case ah:s=14;break t;case ag:s=16,i=null;break t}s=29,a=Error(r(130,null===e?"null":typeof e,"")),i=null}return(t=n(s,a,t,o)).elementType=e,t.type=i,t.lanes=l,t}function r0(e,t,r,a){return(e=n(7,e,a,t)).lanes=r,e}function r1(e,t,r){return(e=n(6,e,null,t)).lanes=r,e}function r3(e){var t=n(18,null,null,0);return t.stateNode=e,t}function r2(e,t,r){return(t=n(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function r4(e,n,t,r,a,i,o,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=aB,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=v(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v(0),this.hiddenUpdates=v(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function r5(e,t,r,a,i,o,l,s,u,c,d,f){return e=new r4(e,t,r,l,u,c,d,f,s),t=1,!0===o&&(t|=24),o=n(3,null,null,t),e.current=o,o.stateNode=e,t=et(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:r,cache:t},eU(o),e}function r6(e){var n=e._reactInternals;if(void 0===n)throw"function"==typeof e.render?Error(r(188)):Error(r(268,e=Object.keys(e).join(",")));return null===(e=null!==(e=o(n))?function e(n){var t=n.tag;if(5===t||26===t||27===t||6===t)return n;for(n=n.child;null!==n;){if(null!==(t=e(n)))return t;n=n.sibling}return null}(e):null)?null:aC(e.stateNode)}function r8(e,n,t,r,a,i){a=oC,null===r.context?r.context=a:r.pendingContext=a,(r=eI(n)).payload={element:t},null!==(i=void 0===i?null:i)&&(r.callback=i),null!==(t=eF(e,r,n))&&(r_(t,e,n),eO(t,e,n))}function r9(e,n){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var t=e.retryLane;e.retryLane=0!==t&&t>>=0)?32:31-(oA(e)/oP|0)|0},oA=Math.log,oP=Math.LN2,ow=256,oL=262144,oN=4194304,oU=at.unstable_scheduleCallback,oD=at.unstable_cancelCallback,oI=at.unstable_shouldYield,oF=at.unstable_requestPaint,oO=at.unstable_now,oB=at.unstable_ImmediatePriority,oG=at.unstable_UserBlockingPriority,oH=at.unstable_NormalPriority,ok=at.unstable_IdlePriority,oV=at.log,oz=at.unstable_setDisableYieldValue,oW=null,oX=null,oj="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},oq="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if("object"==typeof g.default&&"function"==typeof g.default.emit)return void g.default.emit("uncaughtException",e);console.error(e)},oY=Object.prototype.hasOwnProperty,oK=!1,o$=new WeakMap,oQ=[],oZ=0,oJ=null,o0=0,o1=[],o3=0,o2=null,o4=1,o5="",o6=u(null),o8=u(null),o9=u(null),o7=u(null),le=null,ln=null,lt=!1,lr=null,la=!1,li=Error(r(519)),lo=u(null),ll=null,ls=null,lu="u">typeof AbortController?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(n,t){e.push(t)}};this.abort=function(){n.aborted=!0,e.forEach(function(e){return e()})}},lc=at.unstable_scheduleCallback,ld=at.unstable_NormalPriority,lf={$$typeof:ad,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},lp=null,lm=null,lh=!1,lg=!1,l_=!1,lv=0,lS=null,lE=0,lT=0,lM=null,lb=aM.S;aM.S=function(e,n){sF=oO(),"object"==typeof n&&null!==n&&"function"==typeof n.then&&function(e,n){if(null===lS){var t=lS=[];lE=0,lT=ef(),lM={status:"pending",value:void 0,then:function(e){t.push(e)}}}lE++,n.then(ep,ep)}(0,n),null!==lb&&lb(e,n)};var lx=u(null),lR=Error(r(460)),lC=Error(r(474)),ly=Error(r(542)),lA={then:function(){}},lP=null,lw=null,lL=0,lN=eC(!0),lU=eC(!1),lD=[],lI=0,lF=0,lO=!1,lB=!1,lG=u(null),lH=u(0),lk=u(null),lV=null,lz=u(0),lW=0,lX=null,lj=null,lq=null,lY=!1,lK=!1,l$=!1,lQ=0,lZ=0,lJ=null,l0=0,l1={readContext:J,use:nn,useCallback:eZ,useContext:eZ,useEffect:eZ,useImperativeHandle:eZ,useLayoutEffect:eZ,useInsertionEffect:eZ,useMemo:eZ,useReducer:eZ,useRef:eZ,useState:eZ,useDebugValue:eZ,useDeferredValue:eZ,useTransition:eZ,useSyncExternalStore:eZ,useId:eZ,useHostTransitionStatus:eZ,useFormState:eZ,useActionState:eZ,useOptimistic:eZ,useMemoCache:eZ,useCacheRefresh:eZ};l1.useEffectEvent=eZ;var l3={readContext:J,use:nn,useCallback:function(e,n){return e8().memoizedState=[e,void 0===n?null:n],e},useContext:J,useEffect:nL,useImperativeHandle:function(e,n,t){t=null!=t?t.concat([e]):null,nP(4194308,4,nF.bind(null,n,e),t)},useLayoutEffect:function(e,n){return nP(4194308,4,e,n)},useInsertionEffect:function(e,n){nP(4,2,e,n)},useMemo:function(e,n){var t=e8();n=void 0===n?null:n;var r=e();return t.memoizedState=[r,n],r},useReducer:function(e,n,t){var r=e8();if(void 0!==t)var a=t(n);else a=n;return r.memoizedState=r.baseState=a,r.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},e=e.dispatch=nK.bind(null,lX,e),[r.memoizedState,e]},useRef:function(e){return e8().memoizedState={current:e}},useState:function(e){var n=(e=np(e)).queue,t=n$.bind(null,lX,n);return n.dispatch=t,[e.memoizedState,t]},useDebugValue:nB,useDeferredValue:function(e,n){return nk(e8(),e,n)},useTransition:function(){var e=np(!1);return e=nz.bind(null,lX,e.queue,!0,!1),e8().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,t){var a=lX,i=e8();if(lt){if(void 0===t)throw Error(r(407));t=t()}else{if(t=n(),null===s_)throw Error(r(349));(127&sS)!=0||ns(a,n,t)}i.memoizedState=t;var o={value:t,getSnapshot:n};return i.queue=o,nL(nc.bind(null,a,o,e),[e]),a.flags|=2048,ny(9,{destroy:void 0},nu.bind(null,a,o,t,n),null),t},useId:function(){var e=e8(),n=s_.identifierPrefix;if(lt){var t=o5,r=o4;n="_"+n+"R_"+(t=(r&~(1<<32-oy(r)-1)).toString(32)+t),0<(t=lQ++)&&(n+="H"+t.toString(32)),n+="_"}else n="_"+n+"r_"+(t=l0++).toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:nX,useFormState:nM,useActionState:nM,useOptimistic:function(e){var n=e8();n.memoizedState=n.baseState=e;var t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=t,n=nZ.bind(null,lX,!0,t),t.dispatch=n,[e,n]},useMemoCache:nt,useCacheRefresh:function(){return e8().memoizedState=nY.bind(null,lX)},useEffectEvent:function(e){var n=e8(),t={impl:e};return n.memoizedState=t,function(){if((2&sg)!=0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}},l2={readContext:J,use:nn,useCallback:nG,useContext:J,useEffect:nN,useImperativeHandle:nO,useInsertionEffect:nD,useLayoutEffect:nI,useMemo:nH,useReducer:na,useRef:nA,useState:function(){return na(nr)},useDebugValue:nB,useDeferredValue:function(e,n){return nV(e9(),lj.memoizedState,e,n)},useTransition:function(){var e=na(nr)[0],n=e9().memoizedState;return["boolean"==typeof e?e:ne(e),n]},useSyncExternalStore:nl,useId:nj,useHostTransitionStatus:nX,useFormState:nb,useActionState:nb,useOptimistic:function(e,n){return nm(e9(),lj,e,n)},useMemoCache:nt,useCacheRefresh:nq};l2.useEffectEvent=nU;var l4={readContext:J,use:nn,useCallback:nG,useContext:J,useEffect:nN,useImperativeHandle:nO,useInsertionEffect:nD,useLayoutEffect:nI,useMemo:nH,useReducer:no,useRef:nA,useState:function(){return no(nr)},useDebugValue:nB,useDeferredValue:function(e,n){var t=e9();return null===lj?nk(t,e,n):nV(t,lj.memoizedState,e,n)},useTransition:function(){var e=no(nr)[0],n=e9().memoizedState;return["boolean"==typeof e?e:ne(e),n]},useSyncExternalStore:nl,useId:nj,useHostTransitionStatus:nX,useFormState:nC,useActionState:nC,useOptimistic:function(e,n){var t=e9();return null!==lj?nm(t,lj,e,n):(t.baseState=e,[e,t.queue.dispatch])},useMemoCache:nt,useCacheRefresh:nq};l4.useEffectEvent=nU;var l5={enqueueSetState:function(e,n,t){e=e._reactInternals;var r=rh(),a=eI(r);a.payload=n,null!=t&&(a.callback=t),null!==(n=eF(e,a,r))&&(r_(n,e,r),eO(n,e,r))},enqueueReplaceState:function(e,n,t){e=e._reactInternals;var r=rh(),a=eI(r);a.tag=1,a.payload=n,null!=t&&(a.callback=t),null!==(n=eF(e,a,r))&&(r_(n,e,r),eO(n,e,r))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var t=rh(),r=eI(t);r.tag=2,null!=n&&(r.callback=n),null!==(n=eF(e,r,t))&&(r_(n,e,t),eO(n,e,t))}},l6=Error(r(461)),l8=!1,l9={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},l7=!1,se=!1,sn=!1,st="function"==typeof WeakSet?WeakSet:Set,sr=null,sa=null,si=!1,so=null,sl=8192,ss={getCacheForType:function(e){var n=J(lf),t=n.data.get(e);return void 0===t&&(t=e(),n.data.set(e,t)),t},cacheSignal:function(){return J(lf).controller.signal}},su=0,sc=1,sd=2,sf=3,sp=4;if("function"==typeof Symbol&&Symbol.for){var sm=Symbol.for;su=sm("selector.component"),sc=sm("selector.has_pseudo_class"),sd=sm("selector.role"),sf=sm("selector.test_id"),sp=sm("selector.text")}var sh="function"==typeof WeakMap?WeakMap:Map,sg=0,s_=null,sv=null,sS=0,sE=0,sT=null,sM=!1,sb=!1,sx=!1,sR=0,sC=0,sy=0,sA=0,sP=0,sw=0,sL=0,sN=null,sU=null,sD=!1,sI=0,sF=0,sO=1/0,sB=null,sG=null,sH=0,sk=null,sV=null,sz=0,sW=0,sX=null,sj=null,sq=0,sY=null;return ae.attemptContinuousHydration=function(e){if(13===e.tag||31===e.tag){var n=ew(e,0x4000000);null!==n&&r_(n,e,0x4000000),r7(e,0x4000000)}},ae.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag||31===e.tag){var n=rh(),t=ew(e,n=b(n));null!==t&&r_(t,e,n),r7(e,n)}},ae.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if((e=e.stateNode).current.memoizedState.isDehydrated){var n=f(e.pendingLanes);if(0!==n){for(e.pendingLanes|=2,e.entangledLanes|=2;n;){var t=1<<31-oy(n);e.entanglements[1]|=t,n&=~t}ei(e),(6&sg)==0&&(sO=oO()+500,eo(0,!1))}}break;case 31:case 13:null!==(n=ew(e,2))&&r_(n,e,2),rT(),r7(e,2)}},ae.batchedUpdates=function(e,n){return e(n)},ae.createComponentSelector=function(e){return{$$typeof:su,value:e}},ae.createContainer=function(e,n,t,r,a,i,o,l,s,u){return r5(e,n,!1,null,t,r,i,null,o,l,s,u)},ae.createHasPseudoClassSelector=function(e){return{$$typeof:sc,value:e}},ae.createHydrationContainer=function(e,n,t,r,a,i,o,l,s,u,c,d,f,p){var m;return(e=r5(t,r,!0,e,a,i,l,p,s,u,c,d)).context=oC,t=e.current,(a=eI(r=b(r=rh()))).callback=null!=(m=n)?m:null,eF(t,a,r),n=r,e.current.lanes=n,S(e,n),ei(e),e},ae.createPortal=function(e,n,t){var r=3=c&&o>=f&&i<=d&&l<=p){e.splice(n,1);break}if(a!==c||t.width!==u.width||pl){if(!(o!==f||t.height!==u.height||di)){c>a&&(u.width+=c-a,u.x=a),do&&(u.height+=f-o,u.y=o),pt&&(t=s)),s ")+` + +No matching component was found for: + `+e.join(" > ")}return null},ae.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return aC(e.child.stateNode);default:return e.child.stateNode}},ae.injectIntoDevTools=function(){var e={bundleType:0,version:ab,rendererPackageName:ax,currentDispatcherRef:aM,reconcilerVersion:"19.2.0"};if(null!==aR&&(e.rendererConfig=aR),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled||!n.supportsFiber)e=!0;else{try{oW=n.inject(e),oX=n}catch{}e=!!n.checkDCE}}return e},ae.isAlreadyRendering=function(){return(6&sg)!=0},ae.observeVisibleRects=function(e,n,t,a){if(!a9)throw Error(r(363));var i=io(e=rm(e,n),t,a).disconnect;return{disconnect:function(){i()}}},ae.shouldError=function(){return null},ae.shouldSuspend=function(){return!1},ae.startHostTransition=function(e,n,a,i){if(5!==e.tag)throw Error(r(476));var o=nW(e).queue;nz(e,o,n,a2,null===a?t:function(){var n=nW(e);return null===n.next&&(n=e.alternate.memoizedState),nQ(e,n.next.queue,{},rh()),a(i)})},ae.updateContainer=function(e,n,t,r){var a=n.current,i=rh();return r8(a,i,e,n,t,r),i},ae.updateContainerSync=function(e,n,t,r){return r8(n.current,2,e,n,t,r),2},ae},tk.exports.default=tk.exports,Object.defineProperty(tk.exports,"__esModule",{value:!0})),tH.exports=tk.exports),(f=tH.exports)&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default"))?f.default:f,tz={},tW=/^three(?=[A-Z])/,tX=e=>`${e[0].toUpperCase()}${e.slice(1)}`,tj=0;function tq(e){if("function"==typeof e){let n=`${tj++}`;return tz[n]=e,n}Object.assign(tz,e)}function tY(e,n){let t=tX(e),r=tz[t];if("primitive"!==e&&!r)throw Error(`R3F: ${t} 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"===e&&!n.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==n.args&&!Array.isArray(n.args))throw Error("R3F: The args prop must be an array!")}function tK(e){if(e.isHidden){var n;e.props.attach&&null!=(n=e.parent)&&n.object?tT(e.parent,e):tP(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,tA(e)}}function t$(e,n,t){let r=n.root.getState();if(e.parent||e.object===r.scene){if(!n.object){var a,i;let e=tz[tX(n.type)];n.object=null!=(a=n.props.object)?a:new e(...null!=(i=n.props.args)?i:[]),n.object.__r3f=n}if(ty(n.object,n.props),n.props.attach)tT(e,n);else if(tP(n.object)&&tP(e.object)){let r=e.object.children.indexOf(null==t?void 0:t.object);if(t&&-1!==r){let t=e.object.children.indexOf(n.object);-1!==t?(e.object.children.splice(t,1),e.object.children.splice(t{try{e.dispose()}catch{}};"u">typeof IS_REACT_ACT_ENVIRONMENT?n():(0,n5.unstable_scheduleCallback)(n5.unstable_IdlePriority,n)}}function t0(e,n,t){if(!n)return;n.parent=null;let r=e.children.indexOf(n);-1!==r&&e.children.splice(r,1),n.props.attach?tM(e,n):tP(n.object)&&tP(e.object)&&(e.object.remove(n.object),function(e,n){let{internal:t}=e.getState();t.interaction=t.interaction.filter(e=>e!==n),t.initialHits=t.initialHits.filter(e=>e!==n),t.hovered.forEach((e,r)=>{(e.eventObject===n||e.object===n)&&t.hovered.delete(r)}),t.capturedMap.forEach((e,r)=>{tL(t.capturedMap,n,e,r)})}(to(n),n.object));let a=null!==n.props.dispose&&!1!==t;for(let e=n.children.length-1;e>=0;e--){let t=n.children[e];t0(n,t,a)}n.children.length=0,delete n.object.__r3f,a&&"primitive"!==n.type&&"Scene"!==n.object.type&&tJ(n.object),void 0===t&&tA(n)}let t1=[],t3=()=>{},t2={},t4=0,t5=(p={isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,n,t){var r;return tY(e=tX(e)in tz?e:e.replace(tW,""),n),"primitive"===e&&null!=(r=n.object)&&r.__r3f&&delete n.object.__r3f,tv(n.object,t,e,n)},removeChild:t0,appendChild:tQ,appendInitialChild:tQ,insertBefore:tZ,appendChildToContainer(e,n){let t=e.getState().scene.__r3f;n&&t&&tQ(t,n)},removeChildFromContainer(e,n){let t=e.getState().scene.__r3f;n&&t&&t0(t,n)},insertInContainerBefore(e,n,t){let r=e.getState().scene.__r3f;n&&t&&r&&tZ(r,n,t)},getRootHostContext:()=>t2,getChildHostContext:()=>t2,commitUpdate(e,n,t,r,a){var i,o,l;tY(n,r);let s=!1;if("primitive"===e.type&&t.object!==r.object||(null==(i=r.args)?void 0:i.length)!==(null==(o=t.args)?void 0:o.length)?s=!0:null!=(l=r.args)&&l.some((e,n)=>{var r;return e!==(null==(r=t.args)?void 0:r[n])})&&(s=!0),s)t1.push([e,{...r},a]);else{let n=function(e,n){let t={};for(let r in n)if(!tb.includes(r)&&!tg.equ(n[r],e.props[r]))for(let e in t[r]=n[r],n)e.startsWith(`${r}-`)&&(t[e]=n[e]);for(let r in e.props){if(tb.includes(r)||n.hasOwnProperty(r))continue;let{root:a,key:i}=tS(e.object,r);if(a.constructor&&0===a.constructor.length){let e=function(e){let n=tx.get(e.constructor);try{n||(n=new e.constructor,tx.set(e.constructor,n))}catch(e){}return n}(a);tg.und(e)||(t[i]=e[i])}else t[i]=0}return t}(e,r);Object.keys(n).length&&(Object.assign(e.props,n),ty(e.object,n))}(null===a.sibling||(4&a.flags)==0)&&function(){for(let[e]of t1){let n=e.parent;if(n)for(let t of(e.props.attach?tM(n,e):tP(e.object)&&tP(n.object)&&n.object.remove(e.object),e.children))t.props.attach?tM(e,t):tP(t.object)&&tP(e.object)&&e.object.remove(t.object);e.isHidden&&tK(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&tJ(e.object)}for(let[r,a,i]of t1){r.props=a;let o=r.parent;if(o){let a=tz[tX(r.type)];r.object=null!=(e=r.props.object)?e:new a(...null!=(n=r.props.args)?n:[]),r.object.__r3f=r;var e,n,t=r.object;for(let e of[i,i.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let n=e.ref(t);"function"==typeof n&&(e.refCleanup=n)}else e.ref&&(e.ref.current=t);for(let e of(ty(r.object,r.props),r.props.attach?tT(o,r):tP(r.object)&&tP(o.object)&&o.object.add(r.object),r.children))e.props.attach?tT(r,e):tP(e.object)&&tP(r.object)&&r.object.add(e.object);tA(r)}}t1.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>tv(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var n;e.props.attach&&null!=(n=e.parent)&&n.object?tM(e.parent,e):tP(e.object)&&(e.object.visible=!1),e.isHidden=!0,tA(e)}},unhideInstance:tK,createTextInstance:t3,hideTextInstance:t3,unhideTextInstance:t3,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:_.createContext(null),setCurrentUpdatePriority(e){t4=e},getCurrentUpdatePriority:()=>t4,resolveUpdatePriority(){var e;if(0!==t4)return t4;switch("u">typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return 2;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return 8;default:return 32}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:"9.5.0",applyViewTransitionName(e,n,t){},restoreViewTransitionName(e,n){},cancelViewTransitionName(e,n,t){},cancelRootViewTransitionName(e){},restoreRootViewTransitionName(e){},InstanceMeasurement:null,measureInstance:e=>null,wasInstanceInViewport:e=>!0,hasInstanceChanged:(e,n)=>!1,hasInstanceAffectedParent:(e,n)=>!1,suspendOnActiveViewTransition(e,n){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(e){},createViewTransitionInstance:e=>null,getCurrentGestureOffset(e){throw Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance:(e,n)=>e,cloneMutableTextInstance:e=>e,cloneRootViewTransitionContainer(e){throw Error("Not implemented.")},removeRootViewTransitionClone(e,n){throw Error("Not implemented.")},createFragmentInstance:e=>null,updateFragmentInstanceFiber(e,n){},commitNewChildToFragmentInstance(e,n){},deleteChildFromFragmentInstance(e,n){},measureClonedInstance:e=>null,maySuspendCommitOnUpdate:(e,n,t)=>!1,maySuspendCommitInSyncRender:(e,n)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(e,n)=>null},(u=tV(p)).injectIntoDevTools(),u),t6=new Map,t8={objects:"shallow",strict:!1};function t9(e){var n,t;let r,a,i,o,l,s,u,c=t6.get(e),d=null==c?void 0:c.fiber,f=null==c?void 0:c.store;c&&console.warn("R3F.createRoot should only be called once!");let p="function"==typeof reportError?reportError:console.error,m=f||(n=rp,t=rm,l=(o=(i=(0,n1.createWithEqualityFn)((e,r)=>{let a,i=new v.Vector3,o=new v.Vector3,l=new v.Vector3;function s(e=r().camera,n=o,t=r().size){let{width:a,height:u,top:c,left:d}=t,f=a/u;n.isVector3?l.copy(n):l.set(...n);let p=e.getWorldPosition(i).distanceTo(l);if(e&&e.isOrthographicCamera)return{width:a/e.zoom,height:u/e.zoom,top:c,left:d,factor:1,distance:p,aspect:f};{let n=2*Math.tan(e.fov*Math.PI/180/2)*p,t=a/u*n;return{width:t,height:n,top:c,left:d,factor:a/t,distance:p,aspect:f}}}let u=n=>e(e=>({performance:{...e.performance,current:n}})),c=new v.Vector2;return{set:e,get:r,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(e=1)=>n(r(),e),advance:(e,n)=>t(e,n,r()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new v.Clock,pointer:c,mouse:c,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=r();a&&clearTimeout(a),e.performance.current!==e.performance.min&&u(e.performance.min),a=setTimeout(()=>u(r().performance.max),e.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:s},setEvents:n=>e(e=>({...e,events:{...e.events,...n}})),setSize:(n,t,a=0,i=0)=>{let l=r().camera,u={width:n,height:t,top:a,left:i};e(e=>({size:u,viewport:{...e.viewport,...s(l,o,u)}}))},setDpr:n=>e(e=>{let t=tm(n);return{viewport:{...e.viewport,dpr:t,initialDpr:e.viewport.initialDpr||t}}}),setFrameloop:(n="always")=>{let t=r().clock;t.stop(),t.elapsedTime=0,"never"!==n&&(t.start(),t.elapsedTime=0),e(()=>({frameloop:n}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:_.createRef(),active:!1,frames:0,priority:0,subscribe:(e,n,t)=>{let a=r().internal;return a.priority=a.priority+ +(n>0),a.subscribers.push({ref:e,priority:n,store:t}),a.subscribers=a.subscribers.sort((e,n)=>e.priority-n.priority),()=>{let t=r().internal;null!=t&&t.subscribers&&(t.priority=t.priority-(n>0),t.subscribers=t.subscribers.filter(n=>n.ref!==e))}}}}})).getState()).size,s=o.viewport.dpr,u=o.camera,i.subscribe(()=>{let{camera:e,size:n,viewport:t,gl:r,set:a}=i.getState();if(n.width!==l.width||n.height!==l.height||t.dpr!==s){l=n,s=t.dpr;!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(n.width/2),e.right=n.width/2,e.top=n.height/2,e.bottom=-(n.height/2)):e.aspect=n.width/n.height,e.updateProjectionMatrix());t.dpr>0&&r.setPixelRatio(t.dpr);let a="u">typeof HTMLCanvasElement&&r.domElement instanceof HTMLCanvasElement;r.setSize(n.width,n.height,a)}e!==u&&(u=e,a(n=>({viewport:{...n.viewport,...n.viewport.getCurrentViewport(e)}})))}),i.subscribe(e=>n(e)),i),h=d||t5.createContainer(m,1,null,!1,null,"",p,p,p,null);c||t6.set(e,{fiber:h,store:m});let g=!1,S=null;return{async configure(n={}){var t,i;let o;S=new Promise(e=>o=e);let{gl:l,size:s,scene:u,events:c,onCreated:d,shadows:f=!1,linear:p=!1,flat:h=!1,legacy:_=!1,orthographic:E=!1,frameloop:T="always",dpr:M=[1,2],performance:b,raycaster:x,camera:R,onPointerMissed:C}=n,y=m.getState(),A=y.gl;if(!y.gl){let n={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},t="function"==typeof l?await l(n):l;A=tN(t)?t:new n0({...n,...l}),y.set({gl:A})}let P=y.raycaster;P||y.set({raycaster:P=new v.Raycaster});let{params:w,...L}=x||{};if(tg.equ(L,P,t8)||ty(P,{...L}),tg.equ(w,P.params,t8)||ty(P,{params:{...P.params,...w}}),!y.camera||y.camera===a&&!tg.equ(a,R,t8)){a=R;let e=null==R?void 0:R.isCamera,n=e?R:E?new v.OrthographicCamera(0,0,0,0,.1,1e3):new v.PerspectiveCamera(75,0,.1,1e3);!e&&(n.position.z=5,R&&(ty(n,R),!n.manual&&("aspect"in R||"left"in R||"right"in R||"bottom"in R||"top"in R)&&(n.manual=!0,n.updateProjectionMatrix())),y.camera||null!=R&&R.rotation||n.lookAt(0,0,0)),y.set({camera:n}),P.camera=n}if(!y.scene){let e;null!=u&&u.isScene?tv(e=u,m,"",{}):(tv(e=new v.Scene,m,"",{}),u&&ty(e,u)),y.set({scene:e})}c&&!y.events.handlers&&y.set({events:c(m)});let N=function(e,n){if(!n&&"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:n,height:t,top:r,left:a}=e.parentElement.getBoundingClientRect();return{width:n,height:t,top:r,left:a}}return!n&&"u">typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...n}}(e,s);if(tg.equ(N,y.size,t8)||y.setSize(N.width,N.height,N.top,N.left),M&&y.viewport.dpr!==tm(M)&&y.setDpr(M),y.frameloop!==T&&y.setFrameloop(T),y.onPointerMissed||y.set({onPointerMissed:C}),b&&!tg.equ(b,y.performance,t8)&&y.set(e=>({performance:{...e.performance,...b}})),!y.xr){let e=(e,n)=>{let t=m.getState();"never"!==t.frameloop&&rm(e,!0,t,n)},n=()=>{let n=m.getState();n.gl.xr.enabled=n.gl.xr.isPresenting,n.gl.xr.setAnimationLoop(n.gl.xr.isPresenting?e:null),n.gl.xr.isPresenting||rp(n)},r={connect(){let e=m.getState().gl;e.xr.addEventListener("sessionstart",n),e.xr.addEventListener("sessionend",n)},disconnect(){let e=m.getState().gl;e.xr.removeEventListener("sessionstart",n),e.xr.removeEventListener("sessionend",n)}};"function"==typeof(null==(t=A.xr)?void 0:t.addEventListener)&&r.connect(),y.set({xr:r})}if(A.shadowMap){let e=A.shadowMap.enabled,n=A.shadowMap.type;if(A.shadowMap.enabled=!!f,tg.boo(f))A.shadowMap.type=v.PCFSoftShadowMap;else if(tg.str(f)){let e={basic:v.BasicShadowMap,percentage:v.PCFShadowMap,soft:v.PCFSoftShadowMap,variance:v.VSMShadowMap};A.shadowMap.type=null!=(i=e[f])?i:v.PCFSoftShadowMap}else tg.obj(f)&&Object.assign(A.shadowMap,f);(e!==A.shadowMap.enabled||n!==A.shadowMap.type)&&(A.shadowMap.needsUpdate=!0)}return v.ColorManagement.enabled=!_,g||(A.outputColorSpace=p?v.LinearSRGBColorSpace:v.SRGBColorSpace,A.toneMapping=h?v.NoToneMapping:v.ACESFilmicToneMapping),y.legacy!==_&&y.set(()=>({legacy:_})),y.linear!==p&&y.set(()=>({linear:p})),y.flat!==h&&y.set(()=>({flat:h})),!l||tg.fun(l)||tN(l)||tg.equ(l,A,t8)||ty(A,l),r=d,g=!0,o(),this},render(n){return g||S||this.configure(),S.then(()=>{t5.updateContainer((0,n6.jsx)(t7,{store:m,children:n,onCreated:r,rootElement:e}),h,null,()=>void 0)}),m},unmount(){re(e)}}}function t7({store:e,children:n,onCreated:t,rootElement:r}){return tu(()=>{let n=e.getState();n.set(e=>({internal:{...e.internal,active:!0}})),t&&t(n),e.getState().events.connected||null==n.events.connect||n.events.connect(r)},[]),(0,n6.jsx)(tU.Provider,{value:e,children:n})}function re(e,n){let t=t6.get(e),r=null==t?void 0:t.fiber;if(r){let a=null==t?void 0:t.store.getState();a&&(a.internal.active=!1),t5.updateContainer(null,r,null,()=>{a&&setTimeout(()=>{try{null==a.events.disconnect||a.events.disconnect(),null==(t=a.gl)||null==(r=t.renderLists)||null==r.dispose||r.dispose(),null==(i=a.gl)||null==i.forceContextLoss||i.forceContextLoss(),null!=(o=a.gl)&&o.xr&&a.xr.disconnect();var t,r,i,o,l=a.scene;for(let e in"Scene"!==l.type&&(null==l.dispose||l.dispose()),l){let n=l[e];(null==n?void 0:n.type)!=="Scene"&&(null==n||null==n.dispose||n.dispose())}t6.delete(e),n&&n(e)}catch(e){}},500)})}}function rn(e,n){let t={callback:e};return n.add(t),()=>void n.delete(t)}let rt=new Set,rr=new Set,ra=new Set,ri=e=>rn(e,rt),ro=e=>rn(e,rr);function rl(e,n){if(e.size)for(let{callback:t}of e.values())t(n)}function rs(e,n){switch(e){case"before":return rl(rt,n);case"after":return rl(rr,n);case"tail":return rl(ra,n)}}function ru(e,r,a){let i=r.clock.getDelta();"never"===r.frameloop&&"number"==typeof e&&(i=e-r.clock.elapsedTime,r.clock.oldTime=r.clock.elapsedTime,r.clock.elapsedTime=e),n=r.internal.subscribers;for(let e=0;e0)&&!(null!=(n=i.gl.xr)&&n.isPresenting)&&(r+=ru(e,i))}if(rd=!1,rs("after",e),0===r)return rs("tail",e),rc=!1,cancelAnimationFrame(a)}function rp(e,n=1){var t;if(!e)return t6.forEach(e=>rp(e.store.getState(),n));(null==(t=e.gl.xr)||!t.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(n>1?e.internal.frames=Math.min(60,e.internal.frames+n):rd?e.internal.frames=2:e.internal.frames=1,rc||(rc=!0,requestAnimationFrame(rf)))}function rm(e,n=!0,t,r){if(n&&rs("before",e),t)ru(e,t,r);else for(let n of t6.values())ru(e,n.store.getState());n&&rs("after",e)}let rh={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 rg(e){let{handlePointer:n}=function(e){function n(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(n=>{var t;return null==(t=e.__r3f)?void 0:t.handlers["onPointer"+n]}))}function t(n){let{internal:t}=e.getState();for(let e of t.hovered.values())if(!n.length||!n.find(n=>n.object===e.object&&n.index===e.index&&n.instanceId===e.instanceId)){let r=e.eventObject.__r3f;if(t.hovered.delete(tw(e)),null!=r&&r.eventCount){let t=r.handlers,a={...e,intersections:n};null==t.onPointerOut||t.onPointerOut(a),null==t.onPointerLeave||t.onPointerLeave(a)}}}function r(e,n){for(let t=0;tt([]);case"onLostPointerCapture":return n=>{let{internal:r}=e.getState();"pointerId"in n&&r.capturedMap.has(n.pointerId)&&requestAnimationFrame(()=>{r.capturedMap.has(n.pointerId)&&(r.capturedMap.delete(n.pointerId),t([]))})}}return function(i){let{onPointerMissed:o,internal:l}=e.getState();l.lastEvent.current=i;let s="onPointerMove"===a,u="onClick"===a||"onContextMenu"===a||"onDoubleClick"===a,c=function(n,t){let r=e.getState(),a=new Set,i=[],o=t?t(r.internal.interaction):r.internal.interaction;for(let e=0;e{let t=th(e.object),r=th(n.object);return t&&r&&r.events.priority-t.events.priority||e.distance-n.distance}).filter(e=>{let n=tw(e);return!a.has(n)&&(a.add(n),!0)});for(let e of(r.events.filter&&(l=r.events.filter(l,r)),l)){let n=e.object;for(;n;){var s;null!=(s=n.__r3f)&&s.eventCount&&i.push({...e,eventObject:n}),n=n.parent}}if("pointerId"in n&&r.internal.capturedMap.has(n.pointerId))for(let e of r.internal.capturedMap.get(n.pointerId).values())a.has(tw(e.intersection))||i.push(e.intersection);return i}(i,s?n:void 0),d=u?function(n){let{internal:t}=e.getState(),r=n.offsetX-t.initialClick[0],a=n.offsetY-t.initialClick[1];return Math.round(Math.sqrt(r*r+a*a))}(i):0;"onPointerDown"===a&&(l.initialClick=[i.offsetX,i.offsetY],l.initialHits=c.map(e=>e.eventObject)),u&&!c.length&&d<=2&&(r(i,l.interaction),o&&o(i)),s&&t(c),!function(e,n,r,a){if(e.length){let i={stopped:!1};for(let o of e){let l=th(o.object);if(l||o.object.traverseAncestors(e=>{let n=th(e);if(n)return l=n,!1}),l){let{raycaster:s,pointer:u,camera:c,internal:d}=l,f=new v.Vector3(u.x,u.y,0).unproject(c),p=e=>{var n,t;return null!=(n=null==(t=d.capturedMap.get(e))?void 0:t.has(o.eventObject))&&n},m=e=>{let t={intersection:o,target:n.target};d.capturedMap.has(e)?d.capturedMap.get(e).set(o.eventObject,t):d.capturedMap.set(e,new Map([[o.eventObject,t]])),n.target.setPointerCapture(e)},h=e=>{let n=d.capturedMap.get(e);n&&tL(d.capturedMap,o.eventObject,n,e)},g={};for(let e in n){let t=n[e];"function"!=typeof t&&(g[e]=t)}let _={...o,...g,pointer:u,intersections:e,stopped:i.stopped,delta:r,unprojectedPoint:f,ray:s.ray,camera:c,stopPropagation(){let r="pointerId"in n&&d.capturedMap.get(n.pointerId);(!r||r.has(o.eventObject))&&(_.stopped=i.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(e=>e.eventObject===o.eventObject)&&t([...e.slice(0,e.indexOf(o)),o]))},target:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:h},currentTarget:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:h},nativeEvent:n};if(a(_),!0===i.stopped)break}}}}(c,i,d,function(e){let n=e.eventObject,t=n.__r3f;if(!(null!=t&&t.eventCount))return;let o=t.handlers;if(s){if(o.onPointerOver||o.onPointerEnter||o.onPointerOut||o.onPointerLeave){let n=tw(e),t=l.hovered.get(n);t?t.stopped&&e.stopPropagation():(l.hovered.set(n,e),null==o.onPointerOver||o.onPointerOver(e),null==o.onPointerEnter||o.onPointerEnter(e))}null==o.onPointerMove||o.onPointerMove(e)}else{let t=o[a];t?(!u||l.initialHits.includes(n))&&(r(i,l.interaction.filter(e=>!l.initialHits.includes(e))),t(e)):u&&l.initialHits.includes(n)&&r(i,l.interaction.filter(e=>!l.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,n,t){n.pointer.set(e.offsetX/n.size.width*2-1,-(2*(e.offsetY/n.size.height))+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(rh).reduce((e,t)=>({...e,[t]:n(t)}),{}),update:()=>{var n;let{events:t,internal:r}=e.getState();null!=(n=r.lastEvent)&&n.current&&t.handlers&&t.handlers.onPointerMove(r.lastEvent.current)},connect:n=>{let{set:t,events:r}=e.getState();if(null==r.disconnect||r.disconnect(),t(e=>({events:{...e.events,connected:n}})),r.handlers)for(let e in r.handlers){let t=r.handlers[e],[a,i]=rh[e];n.addEventListener(a,t,{passive:i})}},disconnect:()=>{let{set:n,events:t}=e.getState();if(t.connected){if(t.handlers)for(let e in t.handlers){let n=t.handlers[e],[r]=rh[e];t.connected.removeEventListener(r,n)}n(e=>({events:{...e.events,connected:void 0}}))}}}}e.s(["B",()=>tf,"C",()=>tI,"D",()=>tF,"E",()=>tp,"G",()=>tG,"a",()=>tc,"b",()=>tu,"c",()=>t9,"d",()=>re,"e",()=>tq,"f",()=>rg,"i",()=>tl,"j",()=>ri,"k",()=>ro,"u",()=>td],40859)},15080,e=>{"use strict";var n=e.i(40859);e.s(["useThree",()=>n.C])},71753,e=>{"use strict";var n=e.i(40859);e.s(["useFrame",()=>n.D])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/9ffe862a9787606f.css b/docs/_next/static/chunks/9ffe862a9787606f.css new file mode 100644 index 00000000..5c000ebe --- /dev/null +++ b/docs/_next/static/chunks/9ffe862a9787606f.css @@ -0,0 +1 @@ +.KeyboardOverlay-module__HsRBsa__Root{pointer-events:none;z-index:1;align-items:flex-end;gap:10px;display:flex;position:absolute;bottom:16px;left:50%;transform:translate(-50%)}.KeyboardOverlay-module__HsRBsa__Column{flex-direction:column;justify-content:center;gap:4px;display:flex}.KeyboardOverlay-module__HsRBsa__Row{justify-content:stretch;gap:4px;display:flex}.KeyboardOverlay-module__HsRBsa__Spacer{width:32px}.KeyboardOverlay-module__HsRBsa__Key{color:#ffffff80;white-space:nowrap;background:#0006;border:1px solid #fff3;border-radius:4px;flex:1 0 0;justify-content:center;align-items:center;min-width:32px;height:32px;padding:0 8px;font-size:11px;font-weight:600;display:flex}.KeyboardOverlay-module__HsRBsa__Key[data-pressed=true]{color:#fff;background:#34bbab99;border-color:#23fddc80}.KeyboardOverlay-module__HsRBsa__Arrow{margin-right:3px} diff --git a/docs/_next/static/chunks/a05c1cf573184d15.css b/docs/_next/static/chunks/a05c1cf573184d15.css new file mode 100644 index 00000000..986417c0 --- /dev/null +++ b/docs/_next/static/chunks/a05c1cf573184d15.css @@ -0,0 +1,4 @@ +.GuiMarkup-module__CLgNnq__GuiMarkup{white-space:pre-wrap;font-size:14px;line-height:1.5}.GuiMarkup-module__CLgNnq__GuiMarkup a{color:inherit;text-decoration:underline}.GuiMarkup-module__CLgNnq__Bullet{margin-left:.5em;margin-right:.5em} +.GameDialog-module__C6hZDW__Dialog{color:#b0d5c9;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;max-width:calc(100dvw - 40px);max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}.GameDialog-module__C6hZDW__Overlay{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.GameDialog-module__C6hZDW__DialogButton{color:#99fff1;text-shadow:0 -1px 1px #0006;cursor:pointer;background:linear-gradient(#30a497cc,#1f9688cc 33%,#218377cc 67%,#046564cc);border:1px solid #387c74cc;border-top-color:#57b7b9cc;border-radius:4px;padding:4px 18px;font-family:inherit;font-size:14px;font-weight:500;box-shadow:inset 0 0 4px #02808e80}.GameDialog-module__C6hZDW__DialogButton:hover:not(:disabled){color:#b1fff5;border:1px solid #409188e6;border-top-color:#5ac6c2e6;box-shadow:inset 0 0 4px #02808e80,0 0 5px #3effbf80}.GameDialog-module__C6hZDW__DialogButton:active:not(:disabled){transform:translateY(1px)}.GameDialog-module__C6hZDW__DialogButton:disabled{opacity:.4;cursor:not-allowed}.GameDialog-module__C6hZDW__Secondary{box-shadow:none;color:#a2e2cfcc;text-shadow:none;background:0 0;border:1px solid #387c74cc;}.GameDialog-module__C6hZDW__Secondary:hover:not(:disabled){color:#a9ffe5cc;border:1px solid #3f9087e6} +.MapInfoDialog-module__m0lXla__Dialog{grid-template-rows:1fr auto;grid-template-columns:100%;width:800px;height:600px;display:grid;}.MapInfoDialog-module__m0lXla__Overlay{}.MapInfoDialog-module__m0lXla__Body{grid-template-rows:100%;grid-template-columns:1fr auto;min-height:0;display:grid;overflow:hidden}.MapInfoDialog-module__m0lXla__Left{padding:24px 28px;overflow-y:auto}.MapInfoDialog-module__m0lXla__PreviewImage{border-left:1px solid #00bedc40;height:100%;display:block}.MapInfoDialog-module__m0lXla__PreviewImageFloating{float:right;clear:right;width:auto;max-width:30%;max-height:260px;margin:0 0 16px 20px;display:block}.MapInfoDialog-module__m0lXla__Title{color:#7dffff;text-shadow:0 1px 6px #0006;margin:0;font-size:26px;font-weight:500}.MapInfoDialog-module__m0lXla__MapMeta{flex-wrap:wrap;gap:8px 16px;margin-bottom:4px;font-size:15px;font-weight:400;display:flex}.MapInfoDialog-module__m0lXla__MapPlanet{color:#dbcaa8b3}.MapInfoDialog-module__m0lXla__MapQuote{border-left:2px solid #00bedc59;margin:16px 0;padding:0 0 0 14px;font-style:italic}.MapInfoDialog-module__m0lXla__MapQuote p{white-space:pre-line;margin:0 0 4px}.MapInfoDialog-module__m0lXla__MapQuote cite{color:#d7edcb80;font-size:12px;font-style:normal;display:block}.MapInfoDialog-module__m0lXla__MapBlurb{margin:0 0 16px;font-size:13px}.MapInfoDialog-module__m0lXla__Section{margin-top:20px}.MapInfoDialog-module__m0lXla__SectionTitle{color:#7dffff;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 16px #00d2f040;margin:0 0 8px;font-size:16px;font-weight:500}.MapInfoDialog-module__m0lXla__MusicTrack{color:#d7edcb80;align-items:center;gap:6px;margin-top:16px;font-size:14px;font-style:italic;display:flex}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true]{color:#f7fdd8b3}.MapInfoDialog-module__m0lXla__MusicButton{cursor:pointer;color:#557663;opacity:.5;background:0 0;border:0;border-radius:20px;flex-shrink:0;place-content:center;width:32px;height:32px;padding:0;font-size:20px;font-style:normal;line-height:1;display:grid}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true] .MapInfoDialog-module__m0lXla__MusicButton{color:#6dffaa;opacity:1}.MapInfoDialog-module__m0lXla__MusicTrack[data-playing=true] .MapInfoDialog-module__m0lXla__MusicButton:hover{opacity:.7}.MapInfoDialog-module__m0lXla__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;align-items:center;gap:16px;padding:10px 12px;display:flex}.MapInfoDialog-module__m0lXla__CloseButton{}.MapInfoDialog-module__m0lXla__Hint{color:#c9dcd84d;margin-left:auto;font-size:12px}.MapInfoDialog-module__m0lXla__MusicTrackName{text-transform:capitalize}@media (max-width:719px){.MapInfoDialog-module__m0lXla__Body{display:block;overflow:auto}.MapInfoDialog-module__m0lXla__Hint{display:none}.MapInfoDialog-module__m0lXla__Left{width:100%;height:auto;margin:0;padding:16px 20px;overflow:auto}.MapInfoDialog-module__m0lXla__PreviewImage{width:auto;height:auto;margin:16px auto}.MapInfoDialog-module__m0lXla__CloseButton{width:220px;height:36px;margin:0 auto}} +.ServerBrowser-module__kqm3eq__Dialog{grid-template-rows:auto 1fr auto;grid-template-columns:100%;width:860px;height:560px;display:grid;}.ServerBrowser-module__kqm3eq__Overlay{}.ServerBrowser-module__kqm3eq__Header{border-bottom:1px solid #00bedc40;align-items:center;gap:12px;padding:12px 16px 10px;display:flex}.ServerBrowser-module__kqm3eq__Title{color:#7dffff;text-shadow:0 1px 6px #0006;flex:1;margin:0;font-size:18px;font-weight:500}.ServerBrowser-module__kqm3eq__HiddenRadio{opacity:0;z-index:-1;pointer-events:none;width:0;height:0;position:absolute;overflow:hidden}.ServerBrowser-module__kqm3eq__RefreshButton{padding:3px 14px;font-size:12px;}.ServerBrowser-module__kqm3eq__ServerCount{color:#c9dcd866;font-size:12px}.ServerBrowser-module__kqm3eq__TableWrapper{min-height:0;overflow-y:auto}.ServerBrowser-module__kqm3eq__Table{border-collapse:collapse;width:100%;font-size:13px}.ServerBrowser-module__kqm3eq__Table th{z-index:1;text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;letter-spacing:.04em;text-transform:uppercase;color:#7dffff99;background:#0a191af2;border-bottom:1px solid #00bedc33;padding:6px 12px;font-size:11px;font-weight:500;position:sticky;top:0}.ServerBrowser-module__kqm3eq__Table th:hover{color:#7dffff}.ServerBrowser-module__kqm3eq__Table th:nth-child(2),.ServerBrowser-module__kqm3eq__Table td:nth-child(2),.ServerBrowser-module__kqm3eq__Table th:nth-child(3),.ServerBrowser-module__kqm3eq__Table td:nth-child(3){text-align:right}.ServerBrowser-module__kqm3eq__Table td{z-index:0;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px solid #ffffff0a;max-width:340px;padding:3px 12px;font-weight:500;position:relative;overflow:hidden}.ServerBrowser-module__kqm3eq__Table td.ServerBrowser-module__kqm3eq__EmptyServer{opacity:.4}.ServerBrowser-module__kqm3eq__Table tbody tr:not(.ServerBrowser-module__kqm3eq__Empty){cursor:pointer}.ServerBrowser-module__kqm3eq__Table tbody tr:not(.ServerBrowser-module__kqm3eq__Empty):hover{background:#41838b1f}.ServerBrowser-module__kqm3eq__Table tbody tr:has(input:checked){color:#1e2828;background:#5dffe1e6!important}.ServerBrowser-module__kqm3eq__PasswordIcon{color:#ffc83c99;margin-right:4px;font-size:11px}.ServerBrowser-module__kqm3eq__Empty td{text-align:center;color:#c9dcd84d;font-style:italic;padding:32px 12px!important}.ServerBrowser-module__kqm3eq__Footer{background:#021415b3;border-top:1px solid #00bedc40;flex-shrink:0;align-items:center;gap:16px;padding:10px 12px;display:flex}.ServerBrowser-module__kqm3eq__JoinButton{min-width:100px;}.ServerBrowser-module__kqm3eq__CloseButton{}.ServerBrowser-module__kqm3eq__WarriorField{align-items:center;gap:8px;display:flex}.ServerBrowser-module__kqm3eq__WarriorLabel{color:#7dffff99;font-size:12px;font-weight:500}.ServerBrowser-module__kqm3eq__WarriorInput{color:#b0d5c9;background:#00323ccc;border:1px solid #41838b80;border-radius:2px;outline:none;width:130px;padding:4px 6px;font-family:inherit;font-size:13px}.ServerBrowser-module__kqm3eq__WarriorInput:focus{border-color:#7dffff99}.ServerBrowser-module__kqm3eq__WarriorInput::placeholder{color:#c9dcd84d}.ServerBrowser-module__kqm3eq__Hint{color:#c9dcd84d;margin:0 auto;font-size:12px}@media (max-width:719px){.ServerBrowser-module__kqm3eq__Dialog{border-radius:0;width:100%;max-width:100dvw;height:100%;max-height:100dvh}.ServerBrowser-module__kqm3eq__Hint{display:none}.ServerBrowser-module__kqm3eq__Table td{max-width:200px}} diff --git a/docs/_next/static/chunks/a2e31798d9bc121e.css b/docs/_next/static/chunks/a2e31798d9bc121e.css deleted file mode 100644 index 47650970..00000000 --- a/docs/_next/static/chunks/a2e31798d9bc121e.css +++ /dev/null @@ -1,13 +0,0 @@ -.KeyboardOverlay-module__HsRBsa__Root{pointer-events:none;z-index:1;align-items:flex-end;gap:10px;display:flex;position:fixed;bottom:16px;left:50%;transform:translate(-50%)}.KeyboardOverlay-module__HsRBsa__Column{flex-direction:column;justify-content:center;gap:4px;display:flex}.KeyboardOverlay-module__HsRBsa__Row{justify-content:stretch;gap:4px;display:flex}.KeyboardOverlay-module__HsRBsa__Spacer{width:32px}.KeyboardOverlay-module__HsRBsa__Key{color:#ffffff80;white-space:nowrap;background:#0006;border:1px solid #fff3;border-radius:4px;flex:1 0 0;justify-content:center;align-items:center;min-width:32px;height:32px;padding:0 8px;font-size:11px;font-weight:600;display:flex}.KeyboardOverlay-module__HsRBsa__Key[data-pressed=true]{color:#fff;background:#34bbab99;border-color:#23fddc80}.KeyboardOverlay-module__HsRBsa__Arrow{margin-right:3px} -.TouchControls-module__AkxfgW__Joystick{z-index:1;width:140px;height:140px;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}.TouchControls-module__AkxfgW__Left{left:20px;transform:none;}.TouchControls-module__AkxfgW__Right{left:auto;right:20px;transform:none;} -.MissionSelect-module__N_AIjG__InputWrapper{align-items:center;display:flex;position:relative}.MissionSelect-module__N_AIjG__Shortcut{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__Shortcut{display:none}.MissionSelect-module__N_AIjG__Input{color:#fff;-webkit-user-select:text;user-select:text;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]{padding-right:8px}.MissionSelect-module__N_AIjG__Input:focus{border-color:#fff9}.MissionSelect-module__N_AIjG__Input::placeholder{color:#0000}.MissionSelect-module__N_AIjG__SelectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__SelectedValue{display:none}.MissionSelect-module__N_AIjG__SelectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden}.MissionSelect-module__N_AIjG__SelectedValue>.MissionSelect-module__N_AIjG__ItemType{flex-shrink:0}.MissionSelect-module__N_AIjG__Popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-module__N_AIjG__List{padding:4px 0}.MissionSelect-module__N_AIjG__List:has(>.MissionSelect-module__N_AIjG__Group:first-child){padding-top:0}.MissionSelect-module__N_AIjG__Group{padding-bottom:4px}.MissionSelect-module__N_AIjG__GroupLabel{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}.MissionSelect-module__N_AIjG__Group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-module__N_AIjG__Item{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}.MissionSelect-module__N_AIjG__List>.MissionSelect-module__N_AIjG__Item:first-child{margin-top:0}.MissionSelect-module__N_AIjG__Item[data-active-item]{background:#ffffff26}.MissionSelect-module__N_AIjG__Item[aria-selected=true]{background:#6496ff4d}.MissionSelect-module__N_AIjG__ItemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-module__N_AIjG__ItemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-module__N_AIjG__ItemTypes{gap:3px;display:flex}.MissionSelect-module__N_AIjG__ItemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600}.MissionSelect-module__N_AIjG__ItemType:hover{background:#ff9d00b3}.MissionSelect-module__N_AIjG__ItemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-module__N_AIjG__NoResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px} -.InspectorControls-module__gNRB6W__Controls{color:#fff;z-index:2;background:#00000080;border-radius:0 0 4px;justify-content:center;align-items:center;gap:20px;padding:8px 12px 8px 8px;font-size:13px;display:flex;position:fixed;top:0;left:0}.InspectorControls-module__gNRB6W__Dropdown,.InspectorControls-module__gNRB6W__Group{justify-content:center;align-items:center;gap:20px;display:flex}.InspectorControls-module__gNRB6W__CheckboxField,.InspectorControls-module__gNRB6W__LabelledButton,.InspectorControls-module__gNRB6W__Field{align-items:center;gap:6px;display:flex}.InspectorControls-module__gNRB6W__IconButton{color:#fff;cursor:pointer;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d;border-radius:4px;justify-content:center;align-items:center;min-width:28px;height:28px;margin:0 0 0 -12px;padding:0;font-size:15px;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}.InspectorControls-module__gNRB6W__IconButton svg{pointer-events:none}@media (hover:hover){.InspectorControls-module__gNRB6W__IconButton:hover{background:#0062b3cc;border-color:#fff6}}.InspectorControls-module__gNRB6W__IconButton:active,.InspectorControls-module__gNRB6W__IconButton[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}.InspectorControls-module__gNRB6W__IconButton[data-active=true]{background:#0075d5e6;border-color:#fff6}.InspectorControls-module__gNRB6W__ButtonLabel{font-size:12px}.InspectorControls-module__gNRB6W__Toggle{margin:0;}.InspectorControls-module__gNRB6W__MapInfoButton{}@media (max-width:1279px){.InspectorControls-module__gNRB6W__Dropdown[data-open=false]{display:none}.InspectorControls-module__gNRB6W__Dropdown{background:#000c;border:1px solid #fff3;border-radius:4px;flex-direction:column;align-items:center;gap:12px;max-height:calc(100dvh - 56px);padding:12px;display:flex;position:absolute;top:calc(100% + 2px);left:2px;right:2px;overflow:auto;box-shadow:0 0 12px #0006}.InspectorControls-module__gNRB6W__Group{flex-wrap:wrap;gap:12px 20px}.InspectorControls-module__gNRB6W__LabelledButton{width:auto;padding:0 10px}}@media (max-width:639px){.InspectorControls-module__gNRB6W__Controls{border-radius:0;right:0}.InspectorControls-module__gNRB6W__MissionSelectWrapper{flex:1 1 0;min-width:0}.InspectorControls-module__gNRB6W__MissionSelectWrapper input{width:100%}.InspectorControls-module__gNRB6W__Toggle{flex:none}}@media (min-width:1280px){.InspectorControls-module__gNRB6W__Toggle,.InspectorControls-module__gNRB6W__LabelledButton .InspectorControls-module__gNRB6W__ButtonLabel,.InspectorControls-module__gNRB6W__MapInfoButton{display:none}} -.CopyCoordinatesButton-module__BxovtG__Root{}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true]{background:#0075d5e6;border-color:#fff6}.CopyCoordinatesButton-module__BxovtG__ClipboardCheck{opacity:1;display:none}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true] .CopyCoordinatesButton-module__BxovtG__ClipboardCheck{animation:.22s linear infinite CopyCoordinatesButton-module__BxovtG__showClipboardCheck;display:block}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true] .CopyCoordinatesButton-module__BxovtG__MapPin{display:none}.CopyCoordinatesButton-module__BxovtG__ButtonLabel{}@keyframes CopyCoordinatesButton-module__BxovtG__showClipboardCheck{0%{opacity:1}to{opacity:.2}} -.LoadDemoButton-module__kGZaoW__Root{}.LoadDemoButton-module__kGZaoW__ButtonLabel{}.LoadDemoButton-module__kGZaoW__DemoIcon{font-size:19px} -.JoinServerButton-module__DIR70a__Root{padding:0 5px;}.JoinServerButton-module__DIR70a__TextLabel{}.JoinServerButton-module__DIR70a__PingLabel{margin-right:2px;display:flex!important;}.JoinServerButton-module__DIR70a__LiveIcon{font-size:15px}.JoinServerButton-module__DIR70a__Pulsing{animation:1.2s ease-out infinite JoinServerButton-module__DIR70a__blink}@keyframes JoinServerButton-module__DIR70a__blink{0%{opacity:1}to{opacity:.25}} -.DebugElements-module__Cmeo9W__StatsPanel{bottom:0;right:0;top:auto!important;left:auto!important}.DebugElements-module__Cmeo9W__AxisLabel{pointer-events:none;font-size:12px}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=x]{color:#f90}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=y]{color:#9f0}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=z]{color:#09f} -.FloatingLabel-module__8y09Ka__Label{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px} -.PlayerNameplate-module__zYDm0a__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;display:inline-flex}.PlayerNameplate-module__zYDm0a__Top{padding-bottom:20px;}.PlayerNameplate-module__zYDm0a__Bottom{padding-top:20px;}.PlayerNameplate-module__zYDm0a__IffArrow{width:12px;height:12px;image-rendering:pixelated;filter:drop-shadow(0 1px 2px #000000b3)}.PlayerNameplate-module__zYDm0a__Name{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;font-size:11px}.PlayerNameplate-module__zYDm0a__HealthBar{background:#00000080;border:1px solid #fff3;width:60px;height:4px;margin:2px auto 0;overflow:hidden}.PlayerNameplate-module__zYDm0a__HealthFill{background:#2ecc40;height:100%} -.FlagMarker-module__INpLba__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;gap:1px;display:inline-flex}.FlagMarker-module__INpLba__Distance{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;opacity:.5;font-size:10px}.FlagMarker-module__INpLba__Icon{width:16px;height:16px;image-rendering:pixelated;opacity:.5;filter:drop-shadow(0 1px 3px #000c);-webkit-mask-image:var(--flag-icon-url);mask-image:var(--flag-icon-url);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--flag-icon-url);-webkit-mask-position:50%;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat} -.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__TopRight{align-items:flex-start;gap:6px;display:flex;position:absolute;top:56px;right:8px}.PlayerHUD-module__-E1Scq__Compass{flex-shrink:0;width:64px;height:64px;position:relative}.PlayerHUD-module__-E1Scq__CompassRing{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__CompassNSEW{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__Bars{flex-direction:column;gap:3px;padding-top:10px;display:flex}.PlayerHUD-module__-E1Scq__BarTrack{background:#00000080;border:1px solid #ffffff26;width:120px;height:10px;overflow:hidden}.PlayerHUD-module__-E1Scq__BarFillHealth{background:#2ecc40;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__BarFillEnergy{background:#0af;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__WeaponHUD{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:8px;transform:translateY(-50%)}.PlayerHUD-module__-E1Scq__WeaponSeparator{height:6px}.PlayerHUD-module__-E1Scq__ChatContainer{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;max-width:420px;display:flex;position:absolute;top:56px;left:0}.PlayerHUD-module__-E1Scq__ChatWindow{-webkit-user-select:text;user-select:text;scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;max-width:450px;max-height:12.5em;padding:6px 8px;font-size:12px;line-height:1.33333;overflow-y:auto}.PlayerHUD-module__-E1Scq__ChatMessage{color:#2cacb5;padding:1px 0}.PlayerHUD-module__-E1Scq__ChatInputForm{display:flex}.PlayerHUD-module__-E1Scq__ChatInput{color:#28e7f0;background:#00323ccc;border:0;border-top:1px solid #4eb3a733;border-radius:0;outline:none;width:100%;margin:0;padding:6px 8px;font-family:inherit;font-size:12px}.PlayerHUD-module__-E1Scq__ChatInput::placeholder{color:#2cacb580}.PlayerHUD-module__-E1Scq__ChatInput:focus{background:#00323ce6}.PlayerHUD-module__-E1Scq__ChatColor0{color:#2cacb5}.PlayerHUD-module__-E1Scq__ChatColor1{color:#04eb69}.PlayerHUD-module__-E1Scq__ChatColor2{color:#dbc880}.PlayerHUD-module__-E1Scq__ChatColor3{color:#4dfd5f}.PlayerHUD-module__-E1Scq__ChatColor4{color:#28e7f0}.PlayerHUD-module__-E1Scq__ChatColor5{color:#c8c832}.PlayerHUD-module__-E1Scq__ChatColor6{color:#c8c8c8}.PlayerHUD-module__-E1Scq__ChatColor7{color:#dcdc14}.PlayerHUD-module__-E1Scq__ChatColor8{color:#9696fa}.PlayerHUD-module__-E1Scq__ChatColor9{color:#3cdc96}.PlayerHUD-module__-E1Scq__TeamScores{font-family:monospace;font-size:12px;position:absolute;bottom:130px;left:0}.PlayerHUD-module__-E1Scq__TeamRow{background:#00323ca6;gap:6px;padding:2px 8px;display:flex}.PlayerHUD-module__-E1Scq__TeamRow+.PlayerHUD-module__-E1Scq__TeamRow{border-top:1px solid #80ffc826}.PlayerHUD-module__-E1Scq__TeamNameFriendly{color:#2ecc40;min-width:60px}.PlayerHUD-module__-E1Scq__TeamNameEnemy{color:#e44;min-width:60px}.PlayerHUD-module__-E1Scq__TeamScore{color:#fff;text-align:right;min-width:24px;font-weight:700}.PlayerHUD-module__-E1Scq__TeamCount{color:#9ba;text-align:right;min-width:24px}.PlayerHUD-module__-E1Scq__PackInventoryHUD{align-items:center;gap:4px;display:flex;position:absolute;bottom:100px;right:8px}.PlayerHUD-module__-E1Scq__PackInvItem{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}.PlayerHUD-module__-E1Scq__PackInvItemActive{border-color:#80ffc880;box-shadow:0 0 6px #80ffc84d}.PlayerHUD-module__-E1Scq__PackInvItemDim{opacity:.5}.PlayerHUD-module__-E1Scq__PackInvIcon{image-rendering:pixelated;display:block}.PlayerHUD-module__-E1Scq__PackInvCount{color:#bfe;text-align:center;min-width:12px;font-family:monospace;font-size:11px}.PlayerHUD-module__-E1Scq__PackInvInfinity{image-rendering:pixelated;opacity:.8;display:block}.PlayerHUD-module__-E1Scq__Reticle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.PlayerHUD-module__-E1Scq__ReticleImage{opacity:.85;width:64px;height:64px;image-rendering:pixelated}.PlayerHUD-module__-E1Scq__ReticleDot{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080} -.page-module__v6zvCa__CanvasContainer{z-index:0;position:absolute;inset:0}.page-module__v6zvCa__LoadingIndicator{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.page-module__v6zvCa__LoadingIndicator[data-complete=true]{animation:.3s ease-out forwards page-module__v6zvCa__loadingComplete}.page-module__v6zvCa__Spinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite page-module__v6zvCa__spin}@keyframes page-module__v6zvCa__spin{to{transform:rotate(360deg)}}@keyframes page-module__v6zvCa__loadingComplete{0%{opacity:1}to{opacity:0}}.page-module__v6zvCa__Sidebar{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:#fff;z-index:2;background:#000000b3;flex-direction:column;width:260px;font-size:13px;display:flex;position:fixed;top:0;bottom:0;left:0;overflow:hidden}.page-module__v6zvCa__SidebarSection{border-bottom:1px solid #ffffff1a;padding:10px 12px}.page-module__v6zvCa__SidebarSection:last-child{border-bottom:none}.page-module__v6zvCa__SectionLabel{text-transform:uppercase;letter-spacing:.05em;color:#fff6;margin-bottom:6px;font-size:10px}.page-module__v6zvCa__AnimationList{flex:1;padding:0 12px 12px;overflow-y:auto}.page-module__v6zvCa__AnimationItem{cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:4px;align-items:center;gap:6px;padding:4px 6px;display:flex}.page-module__v6zvCa__AnimationItem:hover{background:#ffffff14}.page-module__v6zvCa__AnimationItem[data-active=true]{background:#ffffff26}.page-module__v6zvCa__PlayButton{color:#fff9;cursor:pointer;background:#ffffff1a;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:22px;height:22px;padding:0;font-size:11px;display:flex}.page-module__v6zvCa__PlayButton:hover{color:#fff;background:#fff3}.page-module__v6zvCa__AnimationItem[data-active=true] .page-module__v6zvCa__PlayButton{color:#fff;background:#64b4ff4d}.page-module__v6zvCa__AnimationName{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.page-module__v6zvCa__ClipName{color:#ffffff4d;white-space:nowrap;flex-shrink:0;font-size:10px}.page-module__v6zvCa__CyclicIcon{color:#ffffff4d;title:"Cyclic (looping)";flex-shrink:0;font-size:13px}.page-module__v6zvCa__CheckboxField{align-items:center;gap:6px;display:flex} diff --git a/docs/_next/static/chunks/ac206141b5c1882c.js b/docs/_next/static/chunks/ac206141b5c1882c.js deleted file mode 100644 index 759e547b..00000000 --- a/docs/_next/static/chunks/ac206141b5c1882c.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85413,e=>{"use strict";var t=Object.defineProperty;class i{constructor(){((e,i,n)=>{let r,s;s=void 0,(r="symbol"!=typeof i?i+"":i)in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,n=i.length;ti])},32865,e=>{"use strict";var t=e.i(43476),i=e.i(932);e.i(13876);var n=e.i(58647);function r(e){let n,r=(0,i.c)(2),{children:s}=e;return r[0]!==s?(n=(0,t.jsx)(t.Fragment,{children:s}),r[0]=s,r[1]=n):n=r[1],n}function s(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function u(){return(0,n.useEngineSelector)(c)}function c(e){return e.playback.timeMs/1e3}function m(){return(0,n.useEngineSelector)(d)}function d(e){return e.playback.durationMs/1e3}function f(){return(0,n.useEngineSelector)(h)}function h(e){return e.playback.rate}function p(){let e,t,r,a,o,l,u=(0,i.c)(17),c=s(),m=(0,n.useEngineSelector)(v),d=(0,n.useEngineSelector)(b),f=(0,n.useEngineSelector)(g),h=(0,n.useEngineSelector)(y);u[0]!==m?(e=e=>{m(e)},u[0]=m,u[1]=e):e=u[1];let p=e;u[2]!==c||u[3]!==d?(t=()=>{c&&d("playing")},u[2]=c,u[3]=d,u[4]=t):t=u[4];let x=t;u[5]!==d?(r=()=>{d("paused")},u[5]=d,u[6]=r):r=u[6];let k=r;u[7]!==f?(a=e=>{f(1e3*e)},u[7]=f,u[8]=a):a=u[8];let S=a;u[9]!==h?(o=e=>{h(e)},u[9]=h,u[10]=o):o=u[10];let w=o;return u[11]!==k||u[12]!==x||u[13]!==S||u[14]!==p||u[15]!==w?(l={setRecording:p,play:x,pause:k,seek:S,setSpeed:w},u[11]=k,u[12]=x,u[13]=S,u[14]=p,u[15]=w,u[16]=l):l=u[16],l}function y(e){return e.setPlaybackRate}function g(e){return e.setPlaybackTime}function b(e){return e.setPlaybackStatus}function v(e){return e.setRecording}e.s(["RecordingProvider",()=>r,"useCurrentTime",()=>u,"useDuration",()=>m,"useIsPlaying",()=>o,"usePlaybackActions",()=>p,"useRecording",()=>s,"useSpeed",()=>f])},9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function i(e,i){let n=t(e,i);if(null==n)return;let r=parseFloat(n);return Number.isFinite(r)?r:void 0}function n(e,i){let n=t(e,i);if(null==n)return;let r=parseInt(n,10);return Number.isFinite(r)?r:void 0}function r(e,t={x:0,y:0,z:0}){if(!e)return t;let i=e.split(" ").map(Number);return{x:i[0]??t.x,y:i[1]??t.y,z:i[2]??t.z}}function s(e,t={r:0,g:0,b:0}){if(!e)return t;let i=e.split(" ").map(Number);return{r:i[0]??t.r,g:i[1]??t.g,b:i[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let i=e.split(" ").map(Number);return{r:i[0]??t.r,g:i[1]??t.g,b:i[2]??t.b,a:i[3]??t.a}}function o(e,t){let i=r(e),n=(t??"1 0 0 0").split(" ").map(Number),s=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),u=Math.sqrt(s*s+a*a+o*o),c=0,m=0,d=1;u>1e-8&&(c=s/u,m=a/u,d=o/u);let f=Math.cos(l),h=Math.sin(l),p=1-f,y=Array(16).fill(0);return y[0]=p*c*c+f,y[1]=p*c*m+h*d,y[2]=p*c*d-h*m,y[4]=p*c*m-h*d,y[5]=p*m*m+f,y[6]=p*m*d+h*c,y[8]=p*c*d+h*m,y[9]=p*m*d-h*c,y[10]=p*d*d+f,y[12]=i.x,y[13]=i.y,y[14]=i.z,y[15]=1,{elements:y,position:i}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function u(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:r(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function c(e){let a=[];for(let i=1;i<=3;i++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),i=t[0]??0,n=t[1]??0,r=t[2]??0;return 0===i&&0===n&&0===r?null:{visibleDistance:i,minHeight:n,maxHeight:r,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${i}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let r=t(e,`cloudText${n+1}`)??"",s=i(e,`cloudHeightPer[${n}]`)??i(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=i(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:r,heightPercent:s,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:s(t(e,"fogColor")),visibleDistance:i(e,"visibleDistance")??1e3,fogDistance:i(e,"fogDistance")??0,skySolidColor:s(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:r(t(e,"windVelocity"))}}function m(e){return{className:"Sun",ghostIndex:e._id,direction:r(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function d(e){let n=t(e,"area"),r={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);r={x:e[0]??r.x,y:e[1]??r.y,w:e[2]??r.w,h:e[3]??r.h}}return{className:"MissionArea",ghostIndex:e._id,area:r,flightCeiling:i(e,"flightCeiling")??2e3,flightCeilingRange:i(e,"flightCeilingRange")??50}}function f(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:r(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:i(e,"surfaceOpacity")??.75,waveMagnitude:i(e,"waveMagnitude")??1,envMapIntensity:i(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>u,"missionAreaFromMis",()=>d,"skyFromMis",()=>c,"sunFromMis",()=>m,"terrainFromMis",()=>l,"waterBlockFromMis",()=>f])},19402,47566,e=>{"use strict";function t(e,i={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:i}function i(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function n(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:i}=e,n=i.x*i.x,r=i.y*i.y,s=i.z*i.z,a=i.x*i.y,o=i.x*i.z,l=i.y*i.z,u=i.w*i.x,c=i.w*i.y,m=i.w*i.z;return{elements:[1-2*(r+s),2*(a+m),2*(o-c),0,2*(a-m),1-2*(n+s),2*(l+u),0,2*(o+c),2*(l-u),1-2*(n+r),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function s(e,s,a){switch(e){case"TerrainBlock":return{className:"TerrainBlock",ghostIndex:s,terrFileName:a.terrFileName??"",detailTextureName:a.detailTextureName??"",squareSize:a.squareSize??8,emptySquareRuns:a.emptySquareRuns};case"InteriorInstance":return{className:"InteriorInstance",ghostIndex:s,interiorFile:a.interiorFile??"",transform:r(a.transform),scale:t(a.scale,{x:1,y:1,z:1}),showTerrainInside:a.showTerrainInside??!1,skinBase:a.skinBase??"",alarmState:a.alarmState??!1};case"TSStatic":return{className:"TSStatic",ghostIndex:s,shapeName:a.shapeName??"",transform:r(a.transform),scale:t(a.scale,{x:1,y:1,z:1})};case"Sky":let o,l;return o=Array.isArray(a.fogVolumes)?a.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:i(e.color)})):[],l=Array.isArray(a.cloudLayers)?a.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[],{className:"Sky",ghostIndex:s,materialList:a.materialList??"",fogColor:i(a.fogColor),visibleDistance:a.visibleDistance??1e3,fogDistance:a.fogDistance??0,skySolidColor:i(a.skySolidColor),useSkyTextures:a.useSkyTextures??!0,fogVolumes:o,cloudLayers:l,windVelocity:t(a.windVelocity)};case"Sun":return{className:"Sun",ghostIndex:s,direction:t(a.direction,{x:.57735,y:.57735,z:-.57735}),color:n(a.color,{r:.7,g:.7,b:.7,a:1}),ambient:n(a.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(a.textures)?a.textures:void 0};case"MissionArea":return{className:"MissionArea",ghostIndex:s,area:a.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:a.flightCeiling??2e3,flightCeilingRange:a.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:s,transform:r(a.transform),scale:t(a.scale,{x:1,y:1,z:1}),surfaceName:a.surfaceName??"",envMapName:a.envMapName??"",surfaceOpacity:a.surfaceOpacity??.75,waveMagnitude:a.waveMagnitude??1,envMapIntensity:a.envMapIntensity??1};default:return null}}e.s([],19402),e.s(["ghostToSceneObject",()=>s],47566)},70847,e=>{"use strict";e.i(19402),e.i(47566),e.i(9672),e.i(63318),e.s([])},51434,e=>{"use strict";var t=e.i(43476),i=e.i(932),n=e.i(71645),r=e.i(15080),s=e.i(90072);e.i(13876);var a=e.i(58647);let o=(0,n.createContext)(void 0);function l(e){let l,m,d,f,h=(0,i.c)(7),{children:p}=e,{camera:y}=(0,r.useThree)();h[0]===Symbol.for("react.memo_cache_sentinel")?(l={audioLoader:null,audioListener:null},h[0]=l):l=h[0];let[g,b]=(0,n.useState)(l);return h[1]!==y?(m=()=>{let e=new s.AudioLoader,t=y.children.find(c);t||(t=new s.AudioListener,y.add(t)),t.setMasterVolume(.8),b({audioLoader:e,audioListener:t});let i=()=>{let e=t?.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",i),document.removeEventListener("keydown",i)})};document.addEventListener("click",i),document.addEventListener("keydown",i);let n=a.engineStore.subscribe(u,e=>{let i=t?.context;i&&("paused"===e?i.suspend():"suspended"===i.state&&i.resume())});return()=>{document.removeEventListener("click",i),document.removeEventListener("keydown",i),n(),t&&y.remove(t)}},d=[y],h[1]=y,h[2]=m,h[3]=d):(m=h[2],d=h[3]),(0,n.useEffect)(m,d),h[4]!==g||h[5]!==p?(f=(0,t.jsx)(o.Provider,{value:g,children:p}),h[4]=g,h[5]=p,h[6]=f):f=h[6],f}function u(e){return e.playback.status}function c(e){return e instanceof s.AudioListener}function m(){let e=(0,n.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>l,"useAudio",()=>m])},66027,e=>{"use strict";var t=e.i(69230),i=e.i(69637);function n(e,n){return(0,i.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},63318,e=>{"use strict";var t=e.i(90072);function i(e){return[e.y,e.z,e.x]}function n(e){return[e.y,e.z,e.x]}function r(e){let i=e.elements,n=new t.Matrix4,r=n.elements;r[0]=i[5],r[1]=i[6],r[2]=i[4],r[3]=0,r[4]=i[9],r[5]=i[10],r[6]=i[8],r[7]=0,r[8]=i[1],r[9]=i[2],r[10]=i[0],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1;let s=new t.Quaternion;return s.setFromRotationMatrix(n),s.conjugate(),s}e.s(["matrixFToQuaternion",()=>r,"torqueScaleToThree",()=>n,"torqueToThree",()=>i])},68294,e=>{"use strict";var t=e.i(43476),i=e.i(90072),n=e.i(15080),r=e.i(71645);let s=(0,r.createContext)(null);function a(){let e=(0,r.useContext)(s);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function o({children:e}){let{camera:a}=(0,n.useThree)(),[o,l]=(0,r.useState)(-1),[u,c]=(0,r.useState)({}),[m,d]=(0,r.useState)(()=>({initialized:!1,position:null,quarternion:null})),f=(0,r.useCallback)(e=>{c(t=>({...t,[e.id]:e}))},[]),h=(0,r.useCallback)(e=>{c(t=>{let{[e.id]:i,...n}=t;return n})},[]),p=Object.keys(u).length,y=(0,r.useCallback)(e=>{if(e>=0&&e{y(p?(o+1)%p:-1)},[p,o,y]);(0,r.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,n]=e.slice(2).split("~"),r=t.split(",").map(e=>parseFloat(e)),s=n.split(",").map(e=>parseFloat(e));d({initialized:!0,position:new i.Vector3(...r),quarternion:new i.Quaternion(...s)})}else d({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,r.useEffect)(()=>{m.initialized&&m.position&&(a.position.copy(m.position),m.quarternion&&a.quaternion.copy(m.quarternion))},[a,m]),(0,r.useEffect)(()=>{m.initialized&&!m.position&&p>0&&-1===o&&y(0)},[p,y,o,m]);let b=(0,r.useMemo)(()=>({registerCamera:f,unregisterCamera:h,nextCamera:g,setCameraIndex:y,cameraCount:p}),[f,h,g,y,p]);return 0===p&&-1!==o&&l(-1),(0,t.jsx)(s.Provider,{value:b,children:e})}e.s(["CamerasProvider",()=>o,"useCameras",()=>a])},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function i(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>i,"streamPlaybackStore",0,t])},8328,e=>{"use strict";let t=null;function i(e){t=e}function n(e,i){return t?t(e,i):null}function r(e,t){return(i,n)=>{let r=Math.max(0,Math.min(255,i/t+128)),s=Math.max(0,Math.min(255,n/t+128)),a=Math.floor(r),o=Math.floor(s),l=Math.min(a+1,255),u=Math.min(o+1,255),c=r-a,m=s-o;return((e[256*o+a]*(1-c)+e[256*o+l]*c)*(1-m)+(e[256*u+a]*(1-c)+e[256*u+l]*c)*m)/65535*2048}}e.s(["createTerrainHeightSampler",()=>r,"getTerrainHeightAt",()=>n,"setTerrainHeightSampler",()=>i])},84968,e=>{e.v(t=>Promise.all(["static/chunks/6e9a6efec350bf8d.js"].map(t=>e.l(t))).then(()=>t(90208)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/463a5d636c02e0db.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/aed6ada67562a5fc.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/e5617268e3c7a140.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/6f1c1038c8b3b80c.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/687860f86433eb04.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/796073b9f885dcbc.js"].map(t=>e.l(t))).then(()=>t(42585)))},67521,e=>{e.v(t=>Promise.all(["static/chunks/463a5d636c02e0db.js","static/chunks/3fc0c5e684385765.js"].map(t=>e.l(t))).then(()=>t(53272)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/99bc9f3ae93187f1.css","static/chunks/ca289845e0f08110.js"].map(t=>e.l(t))).then(()=>t(94737)))},96145,e=>{e.v(t=>Promise.all(["static/chunks/d16b6f1b4eacbf2b.js"].map(t=>e.l(t))).then(()=>t(60505)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/e16c267496b8de91.js"].map(t=>e.l(t))).then(()=>t(9962)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/9542fc38c512bd1a.css","static/chunks/718b5c36c0eed37e.js"].map(t=>e.l(t))).then(()=>t(94247)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/acace6aadc879a08.js b/docs/_next/static/chunks/acace6aadc879a08.js new file mode 100644 index 00000000..427d46e3 --- /dev/null +++ b/docs/_next/static/chunks/acace6aadc879a08.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,68754,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function A(e){return e}function E(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eA(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eE(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eE(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eA);return(t&&eA(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,A=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),E=i.onFocusCapture,w=W(t=>{if(null==E||E(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:A,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();E(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,A=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:A,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e4=(0,R.createContext)(void 0),e5=ec([e1,ev],[e2,eg]),e8=e5.useContext,e6=e5.useScopedContext,e9=e5.useProviderContext,e7=e5.ContextProvider,te=e5.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return E(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,A=e9();E(e=e||A,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();E(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=A,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tA=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tA(e))});var{useSyncExternalStore:tE}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=A){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tE(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tE(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&atR,"useStoreProps",()=>tM,"useStoreState",()=>t_,"useStoreStateObject",()=>tT],68754);var tI=es(function({store:e,rowId:t,preventScrollOnKeyDown:r=!1,moveOnKeyPress:i=!0,tabbable:o=!1,getItem:a,"aria-setsize":l,"aria-posinset":s,...c}){let m=em();e=e||m;let h=z(c.id),v=(0,R.useRef)(null),g=(0,R.useContext)(eb),S=_(c)&&!c.accessibleWhenDisabled,{rowId:C,baseElement:x,isActiveItem:A,ariaSetSize:E,ariaPosInSet:w,isTabbable:M}=tT(e,{rowId:e=>t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":A||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tA(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":E,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();E(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),A=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e4)])?d:"option",children:t,...s,onClick:A,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();E(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;E(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e4.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t4(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t5(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t4(e,t,t=>{t5(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:A,unstable_treeSnapshotKey:E,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t4(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,E]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t4(q,t,n=>{t5(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,E]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eA]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eA,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rA(e){return e.split("-")[1]}function rE(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rE(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rA(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r4(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r4(){return!("u"rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();E(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),A=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==A?void 0:A.isConnected))return;A.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return E(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:E=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!E?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==A;!C&&I&&O.push(...(f=rA(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===A,R),f&&(d=d.map(e=>e+"-"+f),E&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rA(l),r=rw(t=rE(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rE(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rE(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rE(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,A=rm(f[v?"top":"left"],x),E=rm(f[v?"bottom":"right"],x),w=C-h[m]-E,_=C/2-h[m]/2+(y/2-b/2),T=rh(A,rm(_,w)),M=!u.arrow&&null!=rA(i)&&_!==T&&o.reference[m]/2-(_{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rA(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,A=S,E=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(A=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?E=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):A=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:E,availableHeight:A});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,A,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(A.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;A.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,A,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,A,S,C,A,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==A?void 0:A.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{A.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,A,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();E(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nA=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nA],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nE=ec([ev],[eg]),nw=nE.useContext;nE.useScopedContext,nE.useProviderContext,nE.ContextProvider,nE.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),A=y&&c&&(m?"horizontal"!==c:"vertical"!==c),E=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(A&&!E?v:nM(v,g.rowId),l,E),l);return null==e?void 0:e.id}if(A){let e=nT(E?C:S,l);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&E?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return E(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",A="[object WeakMap]",E="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[E]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[A]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eA.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eA.prototype.delete=function(e){return eP(this,e).delete(e)},eA.prototype.get=function(e){return eP(this,e).get(e)},eA.prototype.has=function(e){return eP(this,e).has(e)},eA.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eE.prototype.add=eE.prototype.push=function(e){return this.__data__.set(e,l),this},eE.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eA(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eE:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Backdrop:"MissionSelect-module__N_AIjG__Backdrop",Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),A=x.searchParams,E=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,A??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,A),Object.keys(E.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t)),E.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?A?.getAll(r):A?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${A?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},E.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,A=!1,E=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);bt(e),A?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e620039d1c837dab.css b/docs/_next/static/chunks/ad52ebedad251428.css similarity index 71% rename from docs/_next/static/chunks/e620039d1c837dab.css rename to docs/_next/static/chunks/ad52ebedad251428.css index 5e92debc..562af034 100644 --- a/docs/_next/static/chunks/e620039d1c837dab.css +++ b/docs/_next/static/chunks/ad52ebedad251428.css @@ -1 +1 @@ -html{box-sizing:border-box;background:#000;margin:0;padding:0;overflow:hidden}*,:before,:after{box-sizing:inherit}body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:100%}body{margin:0;padding:0;overflow:hidden}main{width:100dvw;height:100dvh}input[type=range]{max-width:80px} +html{box-sizing:border-box;background:#000;margin:0;padding:0;overflow:hidden}*,:before,:after{box-sizing:inherit}body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:100%}body{margin:0;padding:0;overflow:hidden}input[type=range]{max-width:80px} diff --git a/docs/_next/static/chunks/aed6ada67562a5fc.js b/docs/_next/static/chunks/aed6ada67562a5fc.js deleted file mode 100644 index d3de4ba7..00000000 --- a/docs/_next/static/chunks/aed6ada67562a5fc.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66789,e=>{"use strict";var t=e.i(43476),i=e.i(71645),r=e.i(71753),a=e.i(90072);e.i(13876);var n=e.i(58647),o=e.i(82816),l=e.i(85557),s=e.i(71505),u=e.i(91907),c=e.i(25947);function m({shapeName:e,playerShapeName:r}){let a=(0,u.useStaticShape)(r),n=(0,u.useStaticShape)(e),o=(0,i.useMemo)(()=>{let t,i,r=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(e),o=(0,l.getPosedNodeTransform)(a.scene,a.animations,"Mount0",[r]);if(!o)return{position:void 0,quaternion:void 0};let s=(0,l.getPosedNodeTransform)(n.scene,n.animations,"Mountpoint");if(s){let e=s.quaternion.clone().invert(),r=s.position.clone().negate().applyQuaternion(e);i=o.quaternion.clone().multiply(e),t=r.clone().applyQuaternion(o.quaternion).add(o.position)}else t=o.position.clone(),i=o.quaternion.clone();return{position:t.applyQuaternion(l._r90),quaternion:l._r90.clone().multiply(i).multiply(l._r90inv)}},[a,n]),s=(0,i.useMemo)(()=>({_class:"weapon",_className:"Weapon",_id:0}),[]);return(0,t.jsx)(c.ShapeInfoProvider,{object:s,shapeName:e,type:"Item",children:(0,t.jsx)("group",{position:o.position,quaternion:o.quaternion,children:(0,t.jsx)(u.ShapeRenderer,{loadingColor:"#4488ff"})})})}function f({entity:e,playback:c}){let m=(0,u.useStaticShape)(e.dataBlock),f=(0,i.useRef)(null),p=(0,i.useRef)((0,n.effectNow)()),h=(0,i.useRef)(Math.random()*Math.PI*2),d=(0,i.useRef)([]),y=(0,i.useMemo)(()=>{if(e.explosionDataBlockId)return c.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,c]),g=(0,i.useMemo)(()=>y?function(e){let t=e.sizes,i=e.times;if(!Array.isArray(t)||0===t.length)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let r=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(i)?i:r.map((e,t)=>t/Math.max(r.length-1,1)),sizes:r}}(y):void 0,[y]),v=(0,i.useMemo)(()=>{let e=y?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[y]),M=32*(y?.lifetimeMS??31),A=!1!==e.faceViewer,{scene:_,mixer:S,visNodes:x,iflInfos:q,materials:b}=(0,i.useMemo)(()=>{let t=o.clone(m.scene),i=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let r=new Set(t.userData.flag_names??[]),a=t.userData.resource_path;if(r.has("IflMaterial")&&a){let t=e.userData;i.push({mesh:e,iflPath:`textures/${a}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0})}}),(0,l.processShapeScene)(t,e.dataBlock);let r=[];for(let e of(t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let i=t.vis_keyframes,a=t.vis_duration,n=(t.vis_sequence??"").toLowerCase();n&&Array.isArray(i)&&!(i.length<=1)&&a&&!(a<=0)&&"ambient"===n&&r.push({mesh:e,keyframes:i,duration:a,cyclic:!!t.vis_cyclic})}),r))e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of i)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let n=new Map;for(let e of m.animations)n.set(e.name.toLowerCase(),e);let s=n.get("ambient"),u=null;if(s){let e=(u=new a.AnimationMixer(t)).clipAction(s);e.setLoop(a.LoopOnce,1),e.clampWhenFinished=!0,e.timeScale=(y?.playSpeed??20)/20,e.play()}let c=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?c.push(...e.material):e.material&&c.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:u,visNodes:r,iflInfos:i,materials:c}},[m,y]);return(0,i.useEffect)(()=>{for(let e of(d.current=[],q))(0,s.loadIflAtlas)(e.iflPath).then(t=>{let i=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;i&&(i.map=t.texture,i.needsUpdate=!0),d.current.push({atlas:t,info:e})}).catch(()=>{})},[q]),(0,r.useFrame)((e,t)=>{let i=f.current;if(!i)return;let r=n.engineStore.getState().playback,a="playing"===r.status?t*r.rate:0,o=(0,n.effectNow)()-p.current,l=Math.min(o/M,1),u=o/1e3;S&&S.update(a);let c=l>.8?1-(l-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:i,cyclic:r}of x){let a=e.material;if(!a||Array.isArray(a))continue;let n=u/i,o=r?n%1:Math.min(n,1),l=t.length,s=o*l,m=Math.floor(s)%l,f=(m+1)%l,p=s-Math.floor(s);a.opacity=(t[m]+(t[f]-t[m])*p)*c}if(c<1)for(let e of b)"opacity"in e&&(e.transparent=!0,e.opacity*=c);for(let{atlas:e,info:t}of d.current){let i;i=t.sequenceName&&t.duration?(t.cyclic?u/t.duration%1:Math.min(u/t.duration,1))*t.duration+(t.toolBegin??0):u,(0,s.updateAtlasFrame)(e,(0,s.getFrameIndexForTime)(e,i))}if(g){let e=function(e,t){let{times:i,sizes:r}=e;if(0===i.length)return[1,1,1];if(t<=i[0])return r[0];if(t>=i[i.length-1])return r[r.length-1];for(let e=0;e=i[e]&&t<=i[e+1]){let a=(t-i[e])/(i[e+1]-i[e]);return[r[e][0]+(r[e+1][0]-r[e][0])*a,r[e][1]+(r[e+1][1]-r[e][1])*a,r[e][2]+(r[e+1][2]-r[e][2])*a]}return r[r.length-1]}(g,l);i.scale.set(e[0]*v[0],e[1]*v[1],e[2]*v[2])}A&&(i.lookAt(e.camera.position),i.rotateZ(h.current))}),(0,t.jsx)("group",{ref:f,children:(0,t.jsx)("group",{rotation:[0,Math.PI,0],children:(0,t.jsx)("primitive",{object:_})})})}e.s(["ExplosionShape",()=>f,"WeaponModel",()=>m])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/9eaea0ae086bad69.js b/docs/_next/static/chunks/af18e4f3fa33de6b.js similarity index 57% rename from docs/_next/static/chunks/9eaea0ae086bad69.js rename to docs/_next/static/chunks/af18e4f3fa33de6b.js index d3cb05e5..205230c8 100644 --- a/docs/_next/static/chunks/9eaea0ae086bad69.js +++ b/docs/_next/static/chunks/af18e4f3fa33de6b.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11152,40141,t=>{"use strict";var e=t.i(71645),r={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=e.default.createContext&&e.default.createContext(r),n=["attr","size","title"];function c(){return(c=Object.assign.bind()).apply(this,arguments)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o)}return r}function a(t){for(var e=1;ee.default.createElement(u,c({attr:a({},t.attr)},r),function t(r){return r&&r.map((r,o)=>e.default.createElement(r.tag,a({key:o},r.attr),t(r.child)))}(t.child))}function u(t){var l=r=>{var o,{attr:l,size:i,title:u}=t,s=function(t,e){if(null==t)return{};var r,o,n=function(t,e){if(null==t)return{};var r={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(e.indexOf(o)>=0)continue;r[o]=t[o]}return r}(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}(t,n),f=i||r.size||"1em";return r.className&&(o=r.className),t.className&&(o=(o?o+" ":"")+t.className),e.default.createElement("svg",c({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,l,s,{className:o,style:a(a({color:t.color||r.color},r.style),t.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),u&&e.default.createElement("title",null,u),t.children)};return void 0!==o?e.default.createElement(o.Consumer,null,t=>l(t)):l(r)}function s(t){return i({tag:"svg",attr:{viewBox:"0 0 288 512"},child:[{tag:"path",attr:{d:"M112 316.94v156.69l22.02 33.02c4.75 7.12 15.22 7.12 19.97 0L176 473.63V316.94c-10.39 1.92-21.06 3.06-32 3.06s-21.61-1.14-32-3.06zM144 0C64.47 0 0 64.47 0 144s64.47 144 144 144 144-64.47 144-144S223.53 0 144 0zm0 76c-37.5 0-68 30.5-68 68 0 6.62-5.38 12-12 12s-12-5.38-12-12c0-50.73 41.28-92 92-92 6.62 0 12 5.38 12 12s-5.38 12-12 12z"},child:[]}]})(t)}function f(t){return i({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},child:[]}]})(t)}function d(t){return i({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},child:[]}]})(t)}t.s(["GenIcon",()=>i],40141),t.s(["FaMapPin",()=>s,"FaVolumeMute",()=>f,"FaVolumeUp",()=>d],11152)},6090,t=>{t.v({DialogButton:"DialogButton-module__LxvdOa__DialogButton",Secondary:"DialogButton-module__LxvdOa__Secondary DialogButton-module__LxvdOa__DialogButton"})}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11152,40141,t=>{"use strict";var e=t.i(71645),r={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},c=e.default.createContext&&e.default.createContext(r),n=["attr","size","title"];function o(){return(o=Object.assign.bind()).apply(this,arguments)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,c)}return r}function i(t){for(var e=1;ee.default.createElement(u,o({attr:i({},t.attr)},r),function t(r){return r&&r.map((r,c)=>e.default.createElement(r.tag,i({key:c},r.attr),t(r.child)))}(t.child))}function u(t){var l=r=>{var c,{attr:l,size:a,title:u}=t,s=function(t,e){if(null==t)return{};var r,c,n=function(t,e){if(null==t)return{};var r={};for(var c in t)if(Object.prototype.hasOwnProperty.call(t,c)){if(e.indexOf(c)>=0)continue;r[c]=t[c]}return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(c=0;c=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}(t,n),f=a||r.size||"1em";return r.className&&(c=r.className),t.className&&(c=(c?c+" ":"")+t.className),e.default.createElement("svg",o({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,l,s,{className:c,style:i(i({color:t.color||r.color},r.style),t.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),u&&e.default.createElement("title",null,u),t.children)};return void 0!==c?e.default.createElement(c.Consumer,null,t=>l(t)):l(r)}function s(t){return a({tag:"svg",attr:{viewBox:"0 0 288 512"},child:[{tag:"path",attr:{d:"M112 316.94v156.69l22.02 33.02c4.75 7.12 15.22 7.12 19.97 0L176 473.63V316.94c-10.39 1.92-21.06 3.06-32 3.06s-21.61-1.14-32-3.06zM144 0C64.47 0 0 64.47 0 144s64.47 144 144 144 144-64.47 144-144S223.53 0 144 0zm0 76c-37.5 0-68 30.5-68 68 0 6.62-5.38 12-12 12s-12-5.38-12-12c0-50.73 41.28-92 92-92 6.62 0 12 5.38 12 12s-5.38 12-12 12z"},child:[]}]})(t)}function f(t){return a({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},child:[]}]})(t)}function p(t){return a({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},child:[]}]})(t)}t.s(["GenIcon",()=>a],40141),t.s(["FaMapPin",()=>s,"FaVolumeMute",()=>f,"FaVolumeUp",()=>p],11152)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/b89dc6fc9051e9fe.js b/docs/_next/static/chunks/b89dc6fc9051e9fe.js new file mode 100644 index 00000000..8d5432f9 --- /dev/null +++ b/docs/_next/static/chunks/b89dc6fc9051e9fe.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(15080),i=e.i(71753),r=e.i(90072),o=e.i(25645),l=e.i(12979),s=e.i(51434),c=e.i(79123),u=e.i(89887),m=e.i(58647);let f=(0,o.createLogger)("AudioEmitter"),d=new Map,p=new Map;function h(e,t=1){p.set(e,t)}function S(e){p.delete(e)}let g=0;function y(){return g}function T(){for(let[e]of(g++,p)){try{e.stop()}catch{}try{e.disconnect()}catch{}}p.clear()}function I(e,t){let n=t(e),a=n?.filename;if(!a)return null;let i=a.endsWith(".wav")?a:`${a}.wav`,r=n.description,o=null!=r?t(r):void 0,l=o?.is3D??!0,s=o?.isLooping??!1,c=o?.referenceDistance??20;return{filename:i,is3D:l,isLooping:s,refDist:c,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function w(e,t,n,a,i){let o;try{o=(0,l.audioToUrl)(e.filename)}catch{return}let s=m.engineStore.getState().playback.rate,c=g;k(o,n,n=>{if(c===g)try{if(e.is3D&&i){let o=new r.PositionalAudio(t);o.setBuffer(n),o.setDistanceModel("inverse"),o.setRefDistance(e.refDist),o.setMaxDistance(e.maxDist),o.setRolloffFactor(1),o.setVolume(e.volume),o.setPlaybackRate(s),a&&o.position.copy(a),i.add(o),p.set(o,1),o.play(),o.source.onended=()=>{p.delete(o);try{o.disconnect()}catch{}i.remove(o)}}else{let a=new r.Audio(t);a.setBuffer(n),a.setVolume(e.volume),a.setPlaybackRate(s),p.set(a,1),a.play(),a.source.onended=()=>{p.delete(a);try{a.disconnect()}catch{}}}}catch{}})}function k(e,t,n){d.has(e)?n(d.get(e)):t.load(e,t=>{d.set(e,t),n(t)},void 0,t=>{f.error("Audio load error %s: %o",e,t)})}m.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of p)try{t.setPlaybackRate(n*e)}catch{}});let A=(0,n.memo)(function({entity:e}){let{debugMode:o}=(0,c.useDebug)(),m=e.audioFileName??"",f=e.audioVolume??1,d=e.audioMinDistance??1,p=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,S=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,y=e.audioIsLooping??!0,[T,I,w]=e.position??[0,0,0],A=(0,a.useThree)(e=>e.scene),M=(0,a.useThree)(e=>e.camera),{audioLoader:b,audioListener:x}=(0,s.useAudio)(),{audioEnabled:N}=(0,c.useSettings)(),v=(0,n.useRef)(null),R=(0,n.useRef)(null),_=(0,n.useRef)(null),E=(0,n.useRef)(!1),L=(0,n.useRef)(!1),C=(0,n.useRef)(new r.Vector3(T,I,w)),O=(0,n.useRef)(0),D=()=>{null!=R.current&&(clearTimeout(R.current),R.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)};(0,n.useEffect)(()=>{let e;if(b&&x){if(O.current++,g){let t=new r.PositionalAudio(x);t.position.copy(C.current),t.setDistanceModel("inverse"),t.setRefDistance(d),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(f),e=t,A.add(e)}else(e=new r.Audio(x)).setVolume(f);return v.current=e,()=>{D();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&A.remove(e),v.current=null,E.current=!1,L.current=!1}}},[b,x,g,d,p,f,A]);let P=(e,t)=>{if(y)if(h>0||S>0){let n=Math.max(0,h),a=Math.max(n,S),i=n===a?n:Math.random()*(a-n)+n;e.loop=!1;let r=()=>{t===O.current&&(!1===e.isPlaying?R.current=setTimeout(()=>{if(t===O.current)try{e.play(),P(e,t)}catch{}},i):_.current=setTimeout(r,100))};_.current=setTimeout(r,100)}else e.setLoop(!0)},j=e=>{if(!b)return;let t=O.current;if(E.current)try{e.isPlaying||(e.play(),P(e,t))}catch{}else{let n;try{n=(0,l.audioToUrl)(m)}catch{return}k(n,b,n=>{if(t===O.current&&!e.buffer){e.setBuffer(n),E.current=!0;try{e.play(),P(e,t)}catch{}}})}};return(0,n.useEffect)(()=>{let e=v.current;e&&!g&&N&&m&&j(e)},[N,g,m,b,x]),(0,i.useFrame)(()=>{let e=v.current;if(!e||!g||!N||!m)return;let t=M.position.distanceTo(C.current),n=L.current,a=t<=p;if(a&&!n)L.current=!0,j(e);else if(!a&&n){L.current=!1,D();try{e.stop()}catch{}}}),(0,n.useEffect)(()=>{let e=v.current;if(e&&!N){D();try{e.stop()}catch{}L.current=!1}},[N]),o?(0,t.jsxs)("mesh",{position:C.current,children:[(0,t.jsx)("sphereGeometry",{args:[d,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(u.FloatingLabel,{color:"#00ff00",position:[0,d+1,0],children:m})]}):null});e.s(["AudioEmitter",0,A,"audioBufferCache",0,d,"getCachedAudioBuffer",()=>k,"getSoundGeneration",()=>y,"playOneShotSound",()=>w,"resolveAudioProfile",()=>I,"stopAllTrackedSounds",()=>T,"trackSound",()=>h,"untrackSound",()=>S])},9721,e=>{"use strict";var t=e.i(43476),n=e.i(932),a=e.i(71645),i=e.i(71753),r=e.i(90072),o=e.i(82816),l=e.i(85557);class s{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(0===this.states.length)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let a=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&a.push(t)}}this.delayTime-=e;let i=n,r=this.evaluateTickTransitions(t),o=0;for(;r>=0&&o<32;){if(o++,i=!0,r===this.currentStateIndex){this.delayTime=this.states[r].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=r;let l=this.states[r].timeoutValue??0;this.delayTime=l;let s=this.states[r].soundDataBlockId;switch(s>=0&&a.push(s),this.states[r].spin){case 1:this.spinTimeScale=0;break;case 4:this.spinTimeScale=1;break;case 2:3===e&&l>0&&(this.delayTime*=1-n/l);break;case 3:2===e&&l>0&&(this.delayTime*=1-n/l)}r=this.evaluateEntryTransitions(t)}let l=this.states[this.currentStateIndex],s=l.timeoutValue??0;switch(l.spin){case 1:this.spinTimeScale=0;break;case 2:this.spinTimeScale=s>0?Math.max(0,1-this.delayTime/s):1;break;case 4:this.spinTimeScale=1;break;case 3:this.spinTimeScale=s>0?Math.max(0,this.delayTime/s):0}return{sequenceName:this.resolveSequenceName(l),isFiring:l.fire,spinTimeScale:this.spinTimeScale,reverse:!l.direction,scaleAnimation:l.scaleAnimation,timeoutValue:l.timeoutValue??0,transitioned:i,soundDataBlockIds:a,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return -1;let a=this.evaluateConditions(t,e);if(-1!==a)return a;if(n){let e=t.transitionOnTimeout;if(-1!==e)return e}return -1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(-1!==n)return n;let a=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(-1!==a)return a;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(-1!==i)return i;let r=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(-1!==r)return r;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return -1!==o?o:-1}resolveSequenceName(e){return null==e.sequence||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}}var c=e.i(43595),u=e.i(91907),m=e.i(31999),f=e.i(46325),d=e.i(51434),p=e.i(29055),h=e.i(12979),S=e.i(79123),g=e.i(58647),y=e.i(93784);let T=["root","run","back","side","fall","jet","jump","land"];function I(e,t,n){let a=e.current;if(a){(0,p.untrackSound)(a);try{a.stop()}catch{}try{a.disconnect()}catch{}n?.remove(a),e.current=null,t.current=-1}}function w(e){let s,d,p,h,S,I,w,v,R,_,L,C,O,D,P,j,F,B,q,V,W,U,$,G,z=(0,n.c)(65),{entity:Y}=e,K=(0,g.useEngineStoreApi)(),H=Y.shapeName??Y.dataBlock,Q=(0,u.useStaticShape)(H);z[0]!==H?(s=e=>{let t=H?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0},z[0]=H,z[1]=s):s=z[1];let J=(0,g.useEngineSelector)(s);z[2]!==Q.scene?(w=o.clone(Q.scene),d=(0,l.processShapeScene)(w),w.traverse(x),I=new r.AnimationMixer(w),p=null,h=null,S=null,w.traverse(e=>{p||"Mount0"!==e.name||(p=e),h||"Mount1"!==e.name||(h=e),S||"Mount2"!==e.name||(S=e)}),z[2]=Q.scene,z[3]=d,z[4]=p,z[5]=h,z[6]=S,z[7]=I,z[8]=w):(d=z[3],p=z[4],h=z[5],S=z[6],I=z[7],w=z[8]),z[9]!==d||z[10]!==p||z[11]!==h||z[12]!==S||z[13]!==I||z[14]!==w?(v={clonedScene:w,mixer:I,mount0:p,mount1:h,mount2:S,iflInitializers:d},z[9]=d,z[10]=p,z[11]=h,z[12]=S,z[13]=I,z[14]=w,z[15]=v):v=z[15];let{clonedScene:X,mixer:Z,mount0:ee,mount1:et,mount2:en,iflInitializers:ea}=v;z[16]===Symbol.for("react.memo_cache_sentinel")?(R=new Map,z[16]=R):R=z[16];let ei=(0,a.useRef)(R);z[17]===Symbol.for("react.memo_cache_sentinel")?(_={head:null,headside:null},z[17]=_):_=z[17];let er=(0,a.useRef)(_);z[18]===Symbol.for("react.memo_cache_sentinel")?(L=new Map,z[18]=L):L=z[18];let eo=(0,a.useRef)(L),el=(0,a.useRef)(null);z[19]===Symbol.for("react.memo_cache_sentinel")?(C={name:"root",timeScale:1},z[19]=C):C=z[19];let es=(0,a.useRef)(C),ec=(0,a.useRef)(!1),eu=(0,a.useRef)(void 0);if(z[20]!==K||z[21]!==H){e:{let e=K.getState().playback,t=e.recording?.streamingPlayback,n=H?.toLowerCase();if(!t||!n){let e;z[23]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,z[23]=e):e=z[23],O=e;break e}let a=t.getShapeConstructorSequences(n);if(!a){let e;z[24]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,z[24]=e):e=z[24],O=e;break e}O=function(e,t){let n=new Map,a=[];for(let n of e){let e=n.indexOf(" ");if(-1===e)continue;let i=n.slice(0,e).toLowerCase(),r=n.slice(e+1).trim().toLowerCase();if(!r||!i.startsWith(t)||!i.endsWith(".dsq"))continue;let o=i.slice(t.length,-4);o&&a.push({clipName:o,alias:r})}let i=new Set;for(let e=0;e{let e=(0,c.getAliasedActions)(Q.animations,Z,J);ei.current=e;let t=e.get("root");t&&t.play(),es.current={name:"root",timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:"head",names:["head"]},{key:"headside",names:["headside"]}]){let a=Q.animations.find(e=>t.includes(e.name.toLowerCase()));if(!a)continue;let i=a.clone(),o=Math.round(30*a.duration/2);r.AnimationUtils.makeClipAdditive(i,o,a,30);let l=Z.clipAction(i);l.blendMode=r.AdditiveAnimationBlendMode,l.timeScale=0,l.weight=1,l.play(),n[e]=l}er.current=n;let a=new Map,i=Q.animations.find(b),o=i?Math.round(30*i.duration/2):0;for(let e of["lookde","lookms","looksn"]){let t=Q.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),l=i??t;r.AnimationUtils.makeClipAdditive(n,o,l,30);let s=Z.clipAction(n);s.blendMode=r.AdditiveAnimationBlendMode,s.timeScale=0,s.weight=0,s.play(),a.set(e,s)}eo.current=a;let l=a.get("lookde");return l&&(l.weight=1,el.current="lookde"),Z.update(0),()=>{Z.stopAllAction(),ei.current=new Map,er.current={head:null,headside:null},eo.current=new Map,el.current=null}},P=[Z,Q.animations,J],z[25]=Q.animations,z[26]=Z,z[27]=J,z[28]=D,z[29]=P):(D=z[28],P=z[29]),(0,a.useEffect)(D,P),z[30]!==ea?(j=()=>{let e=[];for(let{mesh:t,initialize:n}of ea)n(t,M).then(t=>e.push(t)).catch(A);return()=>e.forEach(k)},F=[ea],z[30]=ea,z[31]=j,z[32]=F):(j=z[31],F=z[32]),(0,a.useEffect)(j,F);let ef=(0,a.useRef)(Y.weaponShape),[ed,ep]=(0,a.useState)(Y.weaponShape),eh=(0,a.useRef)(Y.packShape),[eS,eg]=(0,a.useState)(Y.packShape),ey=(0,a.useRef)(Y.flagShape),[eT,eI]=(0,a.useState)(Y.flagShape);return z[33]!==em||z[34]!==K||z[35]!==Y.falling||z[36]!==Y.flagShape||z[37]!==Y.headPitch||z[38]!==Y.headYaw||z[39]!==Y.jetting||z[40]!==Y.keyframes||z[41]!==Y.packShape||z[42]!==Y.weaponShape||z[43]!==Z?(B=(e,t)=>{Y.weaponShape!==ef.current&&(ef.current=Y.weaponShape,ep(Y.weaponShape)),Y.packShape!==eh.current&&(eh.current=Y.packShape,eg(Y.packShape)),Y.flagShape!==ey.current&&(ey.current=Y.flagShape,eI(Y.flagShape));let n=K.getState().playback,a="playing"===n.status,i=y.streamPlaybackStore.getState().time,o=(0,l.getKeyframeAtTime)(Y.keyframes??[],i),s=o?.damageState!=null&&o.damageState>=1,c=ei.current;if(s&&!ec.current){ec.current=!0;let e=null!=o.actionAnim?em.get(o.actionAnim):void 0;if(e){let t=c.get(e.clipName);if(t){let n=c.get(es.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),es.current={name:e.clipName,timeScale:1},eu.current=o.actionAnim}}}if(!s&&ec.current){ec.current=!1,eu.current=void 0;let e=c.get(es.current.name.toLowerCase());e&&(e.stop(),e.setLoop(r.LoopRepeat,1/0),e.clampWhenFinished=!1),es.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().play()}let u=o?.actionAnim,m=eu.current;if(!ec.current&&u!==m){eu.current=u;let e=null!=m&&m>=8;if(null!=u&&u>=8){let e=em.get(u);if(e){let t=c.get(e.clipName);if(t){let n=c.get(es.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),es.current={name:e.clipName,timeScale:1}}}}else if(e){let e=em.get(m);if(e){let t=c.get(e.clipName);t&&(t.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopRepeat,1/0),t.clampWhenFinished=!1)}es.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()}}if(null!=u&&u>=8&&o?.actionAtEnd){let e=em.get(u);if(e){let t=c.get(e.clipName);t&&(t.paused=!0)}}let f=null!=eu.current&&eu.current>=8;if(!ec.current&&!f){let e=function(e,t,n,a){if(n)return{animation:"fall",timeScale:1};if(!e)return a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1};let[i,r,o]=e,l=-2*Math.atan2(t[1],t[3]),s=Math.cos(l),c=Math.sin(l),u=i*s+r*c,m=-i*c+r*s,f=-m,d=-u,p=Math.max(m,f,d,u);return p<.1?a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1}:p===m?{animation:"run",timeScale:1}:p===f?{animation:"back",timeScale:1}:p===d?{animation:"side",timeScale:1}:{animation:"side",timeScale:-1}}(o?.velocity,o?.rotation??[0,0,0,1],Y.falling,Y.jetting),t=es.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let n=c.get(t.name.toLowerCase()),i=c.get(e.animation.toLowerCase());i&&(a&&n&&n!==i?(n.fadeOut(l.ANIM_TRANSITION_TIME),i.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):(n&&n!==i&&n.stop(),i.reset().play()),i.timeScale=e.timeScale,es.current={name:e.animation,timeScale:e.timeScale})}}let d=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(Y.weaponShape);if(d!==el.current){let e=eo.current,t=el.current?e.get(el.current):null,n=e.get(d);n&&(t&&(t.weight=0),n.weight=+!s,el.current=d)}let{head:p,headside:h}=er.current,S=el.current?eo.current.get(el.current):null,g=+!s,T=Y.headPitch??0,I=Y.headYaw??0,w=(T+1)/2;S&&(S.time=w*S.getClip().duration,S.weight=g),p&&(p.time=w*p.getClip().duration,p.weight=g),h&&(h.time=(I+1)/2*h.getClip().duration,h.weight=g),a?Z.update(t*n.rate):Z.update(0)},z[33]=em,z[34]=K,z[35]=Y.falling,z[36]=Y.flagShape,z[37]=Y.headPitch,z[38]=Y.headYaw,z[39]=Y.jetting,z[40]=Y.keyframes,z[41]=Y.packShape,z[42]=Y.weaponShape,z[43]=Z,z[44]=B):B=z[44],(0,i.useFrame)(B),z[45]===Symbol.for("react.memo_cache_sentinel")?(q=[0,Math.PI/2,0],z[45]=q):q=z[45],z[46]!==X?(V=(0,t.jsx)("group",{rotation:q,children:(0,t.jsx)("primitive",{object:X})}),z[46]=X,z[47]=V):V=z[47],z[48]!==ed||z[49]!==Y||z[50]!==ee?(W=ed&&ee&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:ed}),children:(0,t.jsx)(f.DebugSuspense,{name:`Weapon:${Y.id}/${ed}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:ed}),children:(0,t.jsx)(N,{entity:Y,weaponShape:ed,mount0:ee})})},ed),z[48]=ed,z[49]=Y,z[50]=ee,z[51]=W):W=z[51],z[52]!==eS||z[53]!==Y.id||z[54]!==et?(U=eS&&et&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eS}),children:(0,t.jsx)(f.DebugSuspense,{name:`Pack:${Y.id}/${eS}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eS}),children:(0,t.jsx)(E,{packShape:eS,mountBone:et})})},eS),z[52]=eS,z[53]=Y.id,z[54]=et,z[55]=U):U=z[55],z[56]!==eT||z[57]!==Y.id||z[58]!==en?($=eT&&en&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"red",label:eT}),children:(0,t.jsx)(f.DebugSuspense,{name:`Flag:${Y.id}/${eT}`,fallback:(0,t.jsx)(u.ShapePlaceholder,{color:"cyan",label:eT}),children:(0,t.jsx)(E,{packShape:eT,mountBone:en})})},eT),z[56]=eT,z[57]=Y.id,z[58]=en,z[59]=$):$=z[59],z[60]!==V||z[61]!==W||z[62]!==U||z[63]!==$?(G=(0,t.jsxs)(t.Fragment,{children:[V,W,U,$]}),z[60]=V,z[61]=W,z[62]=U,z[63]=$,z[64]=G):G=z[64],G}function k(e){return e()}function A(){}function M(){return y.streamPlaybackStore.getState().time}function b(e){return"lookde"===e.name.toLowerCase()}function x(e){if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.side=r.FrontSide}function N(e){let t,c,m,f,y,T,w,k,A,M,b,x,N,E,L=(0,n.c)(38),{entity:C,weaponShape:O,mount0:D}=e,P=(0,g.useEngineStoreApi)(),j=(0,u.useStaticShape)(O);if(L[0]!==j.animations||L[1]!==j.scene){t=o.clone(j.scene),c=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(j.scene,j.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}f=new Map,t.traverse(e=>{if(!e.isMesh)return;let t=e.userData,n=(t?.vis_sequence??"").toLowerCase();if(!n)return;let a=f.get(n);a||(a=[],f.set(n,a)),a.push(e)}),m=new r.AnimationMixer(t),L[0]=j.animations,L[1]=j.scene,L[2]=t,L[3]=c,L[4]=m,L[5]=f}else t=L[2],c=L[3],m=L[4],f=L[5];let F=m,B=j.scene;L[6]!==B||L[7]!==j.animations?(y=function(e,t){let n=e.userData?.dts_sequence_names;if("string"==typeof n)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}(B,j.animations),L[6]=B,L[7]=j.animations,L[8]=y):y=L[8];let q=y;L[9]!==t||L[10]!==c||L[11]!==F||L[12]!==q||L[13]!==f?(T={weaponClone:t,weaponMixer:F,seqIndexToName:q,visNodesBySequence:f,weaponIflInitializers:c},L[9]=t,L[10]=c,L[11]=F,L[12]=q,L[13]=f,L[14]=T):T=L[14];let{weaponClone:V,weaponMixer:W,seqIndexToName:U,visNodesBySequence:$,weaponIflInitializers:G}=T;L[15]===Symbol.for("react.memo_cache_sentinel")?(w=new Map,L[15]=w):w=L[15];let z=(0,a.useRef)(w),Y=(0,a.useRef)(null);L[16]!==j.animations||L[17]!==W?(k=()=>{let e=new Map;for(let t of j.animations)e.set(t.name.toLowerCase(),W.clipAction(t));z.current=e;let t=e.get("spin");return t&&(t.setLoop(r.LoopRepeat,1/0),t.timeScale=0,t.play()),Y.current=t??null,W.update(0),()=>{W.stopAllAction(),z.current=new Map,Y.current=null,I(et,en)}},A=[W,j.animations],L[16]=j.animations,L[17]=W,L[18]=k,L[19]=A):(k=L[18],A=L[19]),(0,a.useEffect)(k,A),L[20]!==G?(M=()=>{let e=[];for(let{mesh:t,initialize:n}of G)n(t,_).then(t=>e.push(t)).catch(R);return()=>e.forEach(v)},b=[G],L[20]=G,L[21]=M,L[22]=b):(M=L[21],b=L[22]),(0,a.useEffect)(M,b);let{audioLoader:K,audioListener:H}=(0,d.useAudio)(),Q=(0,S.useSettings)(),J=Q?.audioEnabled??!1,X=(0,a.useRef)(null),Z=(0,a.useRef)(null),ee=(0,a.useRef)(C.weaponImageStates),et=(0,a.useRef)(null),en=(0,a.useRef)(-1);return L[23]!==D||L[24]!==V?(x=()=>(D.add(V),()=>{D.remove(V)}),N=[V,D],L[23]=D,L[24]=V,L[25]=x,L[26]=N):(x=L[25],N=L[26]),(0,a.useEffect)(x,N),L[27]!==J||L[28]!==H||L[29]!==K||L[30]!==P||L[31]!==C.weaponImageState||L[32]!==C.weaponImageStates||L[33]!==U||L[34]!==$||L[35]!==V||L[36]!==W?(E=(e,t)=>{let n=P.getState().playback,a="playing"===n.status,i=z.current,o=C.weaponImageState,c=C.weaponImageStates;c!==ee.current&&(ee.current=c,c&&c.length>0?X.current=new s(c,U):X.current=null,Z.current=null,I(et,en,V)),!X.current&&c&&c.length>0&&(X.current=new s(c,U));let u=X.current;if(u&&o&&a){let e=t*n.rate,a=u.tick(e,o);if(function(e,t,n,a){let i=e.sequenceName,o=n.current;if(i===o&&!e.transitioned)return;if(i!==o){if(o){let e=a.get(o);if(e)for(let t of e)t.visible=!1}if(i){let e=a.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(o){let e=t.get(o);e&&e.fadeOut(l.ANIM_TRANSITION_TIME),n.current=null}return}let s=t.get(i);if(s&&(e.transitioned||i!==o)){let a=o?t.get(o):null;if(e.isFiring||e.timeoutValue>0?(s.setLoop(r.LoopOnce,1),s.clampWhenFinished=!0):(s.setLoop(r.LoopRepeat,1/0),s.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=s.getClip().duration;s.timeScale=t>0?t/e.timeoutValue:1}else s.timeScale=e.reverse?-1:1;a&&a!==s?(a.fadeOut(l.ANIM_TRANSITION_TIME),s.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):s.reset().play(),n.current=i}}(a,i,Z,$),et.current&&a.stateIndex!==en.current&&I(et,en,V),J&&K&&H&&a.soundDataBlockIds.length>0){let e=n.recording?.streamingPlayback.getDataBlockData.bind(n.recording.streamingPlayback);if(e)for(let t of a.soundDataBlockIds){let a=(0,p.resolveAudioProfile)(t,e);if(a)if(a.isLooping){if(!et.current)try{let e=(0,h.audioToUrl)(a.filename),t=(0,p.getSoundGeneration)();(0,p.getCachedAudioBuffer)(e,K,e=>{if(t!==(0,p.getSoundGeneration)()||et.current)return;let i=u.stateIndex,o=new r.PositionalAudio(H);o.setBuffer(e),o.setDistanceModel("inverse"),o.setRefDistance(a.refDist),o.setMaxDistance(a.maxDist),o.setRolloffFactor(1),o.setVolume(a.volume),o.setPlaybackRate(n.rate),o.setLoop(!0),V.add(o),(0,p.trackSound)(o),o.play(),et.current=o,en.current=i})}catch{}}else(0,p.playOneShotSound)(a,H,K,void 0,V)}}Y.current&&(Y.current.timeScale=a.spinTimeScale)}a?W.update(t*n.rate):W.update(0)},L[27]=J,L[28]=H,L[29]=K,L[30]=P,L[31]=C.weaponImageState,L[32]=C.weaponImageStates,L[33]=U,L[34]=$,L[35]=V,L[36]=W,L[37]=E):E=L[37],(0,i.useFrame)(E),null}function v(e){return e()}function R(){}function _(){return y.streamPlaybackStore.getState().time}function E(e){let t,i,r,s,c,m,f,d=(0,n.c)(14),{packShape:p,mountBone:h}=e,S=(0,u.useStaticShape)(p);if(d[0]!==S.animations||d[1]!==S.scene){t=o.clone(S.scene),i=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(S.scene,S.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}d[0]=S.animations,d[1]=S.scene,d[2]=t,d[3]=i}else t=d[2],i=d[3];d[4]!==t||d[5]!==i?(r={packClone:t,packIflInitializers:i},d[4]=t,d[5]=i,d[6]=r):r=d[6];let{packClone:g,packIflInitializers:y}=r;return d[7]!==h||d[8]!==g?(s=()=>(h.add(g),()=>{h.remove(g)}),c=[g,h],d[7]=h,d[8]=g,d[9]=s,d[10]=c):(s=d[9],c=d[10]),(0,a.useEffect)(s,c),d[11]!==y?(m=()=>{let e=[];for(let{mesh:t,initialize:n}of y)n(t,O).then(t=>e.push(t)).catch(C);return()=>e.forEach(L)},f=[y],d[11]=y,d[12]=m,d[13]=f):(m=d[12],f=d[13]),(0,a.useEffect)(m,f),null}function L(e){return e()}function C(){}function O(){return y.streamPlaybackStore.getState().time}function D(e){let t,i,r=(0,n.c)(7),{shapeName:o,eyeOffsetRef:s}=e,c=(0,u.useStaticShape)(o);return r[0]!==s||r[1]!==c.animations||r[2]!==c.scene?(t=()=>{let e=(0,l.getPosedNodeTransform)(c.scene,c.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,l.DEFAULT_EYE_HEIGHT,0)},r[0]=s,r[1]=c.animations,r[2]=c.scene,r[3]=t):t=r[3],r[4]!==s||r[5]!==c?(i=[c,s],r[4]=s,r[5]=c,r[6]=i):i=r[6],(0,a.useEffect)(t,i),null}e.s(["PlayerEyeOffset",()=>D,"PlayerModel",()=>w],9721)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/bc2b324cb2101ffe.js b/docs/_next/static/chunks/bc2b324cb2101ffe.js new file mode 100644 index 00000000..4dacabc7 --- /dev/null +++ b/docs/_next/static/chunks/bc2b324cb2101ffe.js @@ -0,0 +1,89 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51295,e=>{"use strict";var t=e.i(43476),i=e.i(932),r=e.i(71645),a=e.i(71753),o=e.i(78140),n=e.i(90072),s=e.i(85557),l=e.i(12979),c=e.i(15080),u=e.i(75567);let d=Math.PI/180,m=Math.PI/18e4;function p(e,t,i){let r=e[t];return"number"==typeof r&&Number.isFinite(r)?r:i}function f(e,t,i){let r=e[t];return"boolean"==typeof r?r:"number"==typeof r?0!==r:i}function h(e,t){let i,r=e.particles;if(Array.isArray(r)){for(let e of r)if("number"==typeof e&&(i=t(e)))break}return i?{ejectionPeriodMS:p(e,"ejectionPeriodMS",100),periodVarianceMS:p(e,"periodVarianceMS",0),ejectionVelocity:.01*p(e,"ejectionVelocity",200),velocityVariance:.01*p(e,"velocityVariance",100),ejectionOffset:.01*p(e,"ejectionOffset",0),thetaMin:p(e,"thetaMin",0),thetaMax:p(e,"thetaMax",90),phiReferenceVel:p(e,"phiReferenceVel",0),phiVariance:p(e,"phiVariance",360),overrideAdvances:f(e,"overrideAdvances",!1),orientParticles:f(e,"orientParticles",!1),orientOnVelocity:f(e,"orientOnVelocity",!0),lifetimeMS:p(e,"lifetimeMS",0)<<5,lifetimeVarianceMS:p(e,"lifetimeVarianceMS",0)<<5,particles:function(e){let t=e.keys,i=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e0&&t[0]&&(r=t[0])}return{dragCoefficient:5*p(e,"dragCoefficient",0),windCoefficient:p(e,"windCoefficient",1),gravityCoefficient:10*p(e,"gravityCoefficient",0),inheritedVelFactor:p(e,"inheritedVelFactor",0),constantAcceleration:p(e,"constantAcceleration",0),lifetimeMS:p(e,"lifetimeMS",31)<<5,lifetimeVarianceMS:p(e,"lifetimeVarianceMS",0)<<5,spinSpeed:p(e,"spinSpeed",0),spinRandomMin:p(e,"spinRandomMin",1e3)+-1e3,spinRandomMax:p(e,"spinRandomMax",1e3)+-1e3,useInvAlpha:f(e,"useInvAlpha",!1),keys:i,textureName:r}}(i)}:null}function g(e,t){return e+(2*Math.random()-1)*t}function y(e,t,i,r,a,o,n){let s=Math.cos(n),l=Math.sin(n),c=e*r+t*a+i*o;return[e*s+(a*i-o*t)*l+r*c*(1-s),t*s+(o*e-r*i)*l+a*c*(1-s),i*s+(r*t-a*e)*l+o*c*(1-s)]}class S{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,i){this.data=e,this.maxParticles=t;let r=i??e.lifetimeMS;!i&&e.lifetimeVarianceMS>0&&(r+=Math.round(g(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,i=[0,0,1]){for(let r=0;r0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(g(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,i=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let a=this.particles[r];if(a.currentAge+=e,a.currentAge>=a.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let o=i.dragCoefficient,n=i.gravityCoefficient,s=a.acc[0]-a.vel[0]*o,l=a.acc[1]-a.vel[1]*o,c=a.acc[2]-a.vel[2]*o+-9.81*n;a.vel[0]+=s*t,a.vel[1]+=l*t,a.vel[2]+=c*t,a.pos[0]+=a.vel[0]*t,a.pos[1]+=a.vel[1]*t,a.pos[2]+=a.vel[2]*t;let u=a.currentAge/a.totalLifetime,d=function(e,t){for(let i=1;i=t){let r=e[i-1],a=e[i],o=a.time-r.time,n=o>0?(t-r.time)/o:0;return{r:r.r+(a.r-r.r)*n,g:r.g+(a.g-r.g)*n,b:r.b+(a.b-r.b)*n,a:r.a+(a.a-r.a)*n,size:r.size+(a.size-r.size)*n}}let i=e[e.length-1];return{r:i.r,g:i.g,b:i.b,a:i.a,size:i.size}}(i.keys,u);a.r=d.r,a.g=d.g,a.b=d.b,a.a=d.a,a.size=d.size,a.currentSpin=a.spinSpeed*a.currentAge*m}}isDead(){return this.emitterDead&&0===this.particles.length}kill(){this.emitterDead=!0}addParticle(e,t){var i,r,a,o;let n,s,l,c,u=this.data,m=u.particles,p=t[0],f=t[1],h=t[2],S=(i=p,r=f,.9>Math.abs(a=h)?(n=r,s=-i,l=0):(n=-a,s=0,l=i),(c=Math.sqrt(n*n+s*s+l*l))<1e-8?[1,0,0]:[n/c,s/c,l/c]),v=(u.thetaMin+Math.random()*(u.thetaMax-u.thetaMin))*d,b=(this.internalClock/1e3*u.phiReferenceVel+Math.random()*u.phiVariance)*d;[p,f,h]=y(p,f,h,S[0],S[1],S[2],v),[p,f,h]=y(p,f,h,t[0],t[1],t[2],b);let M=Math.sqrt(p*p+f*f+h*h);M>1e-8&&(p/=M,f/=M,h/=M);let x=g(u.ejectionVelocity,u.velocityVariance),w=[e[0]+p*u.ejectionOffset,e[1]+f*u.ejectionOffset,e[2]+h*u.ejectionOffset],T=[p*x,f*x,h*x],A=m.constantAcceleration,P=[T[0]*A,T[1]*A,T[2]*A],k=m.lifetimeMS;m.lifetimeVarianceMS>0&&(k+=Math.round(g(0,m.lifetimeVarianceMS))),k=Math.max(1,k);let C=m.spinSpeed+((o=m.spinRandomMin)+Math.random()*(m.spinRandomMax-o)),D=m.keys[0];this.particles.push({pos:w,vel:T,acc:P,orientDir:[p,f,h],currentAge:0,totalLifetime:k,dataIndex:0,spinSpeed:C,currentSpin:0,r:D.r,g:D.g,b:D.b,a:D.a,size:D.size})}}let v=` +// 'position' is auto-declared by Three.js for ShaderMaterial. +attribute vec4 particleColor; +attribute float particleSize; +attribute float particleSpin; +attribute vec2 quadCorner; // (-0.5,-0.5) to (0.5,0.5) +attribute vec3 orientDir; + +uniform bool uOrientParticles; +// cameraPosition is a built-in Three.js uniform. + +varying vec2 vUv; +varying vec4 vColor; + +void main() { + vUv = quadCorner + 0.5; // [0,1] range + vColor = particleColor; + + if (uOrientParticles) { + if (length(orientDir) < 0.0001) { + // V12: don't render oriented particles with zero velocity. + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + return; + } + // V12 oriented particle: quad aligned along direction, facing camera. + vec3 worldPos = (modelMatrix * vec4(position, 1.0)).xyz; + vec3 dir = normalize(orientDir); + vec3 dirFromCam = worldPos - cameraPosition; + vec3 crossDir = normalize(cross(dirFromCam, dir)); + + // V12 maps U along dir (velocity) — match by using quadCorner.x for dir. + vec3 offset = dir * quadCorner.x + crossDir * quadCorner.y; + worldPos += offset * particleSize; + + gl_Position = projectionMatrix * viewMatrix * vec4(worldPos, 1.0); + } else { + // Standard camera-facing billboard. + vec3 viewPos = (modelViewMatrix * vec4(position, 1.0)).xyz; + + // Apply spin rotation to quad corner. + float c = cos(particleSpin); + float s = sin(particleSpin); + vec2 rotated = vec2( + c * quadCorner.x - s * quadCorner.y, + s * quadCorner.x + c * quadCorner.y + ); + + // Offset in view space (camera-facing billboard). + viewPos.xy += rotated * particleSize; + + gl_Position = projectionMatrix * vec4(viewPos, 1.0); + } +} +`,b=` +uniform sampler2D particleTexture; +uniform bool hasTexture; +uniform float debugOpacity; + +varying vec2 vUv; +varying vec4 vColor; + +void main() { + if (hasTexture) { + vec4 texColor = texture2D(particleTexture, vUv); + gl_FragColor = texColor * vColor; + } else { + gl_FragColor = vColor; + } + gl_FragColor.a *= debugOpacity; +} +`;var M=e.i(25645),x=e.i(79123),w=e.i(51434),T=e.i(29055),A=e.i(58647);let P=(0,M.createLogger)("ParticleEffects"),k=new Float32Array([-.5,-.5,.5,-.5,.5,.5,-.5,.5]),C=new Map,D=new Set,I=new n.DataTexture(new Uint8Array([255,255,255,255]),1,1,n.RGBAFormat,n.UnsignedByteType);function B(e){if(!e)return I;let t=C.get(e);if(t)return t;try{let t=(0,l.textureToUrl)(e),i=(0,u.loadTexture)(t,e=>{(0,s.setupEffectTexture)(e),D.add(e)});return(0,s.setupEffectTexture)(i),C.set(e,i),i}catch{return I}}I.needsUpdate=!0;let N=new n.SphereGeometry(1,6,6),E=new n.MeshBasicMaterial({color:0xff0000,wireframe:!0}),R=new n.BoxGeometry(.3,.3,.3),V=new n.MeshBasicMaterial({color:65280,wireframe:!0}),F=new n.SphereGeometry(1,12,8),_=` + attribute vec4 vertexColor; + attribute vec2 texCoord; + varying vec4 vColor; + varying vec2 vUV; + void main() { + vColor = vertexColor; + vUV = texCoord; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } +`,O=` + uniform sampler2D uTexture; + varying vec4 vColor; + varying vec2 vUV; + void main() { + vec4 tex = texture2D(uTexture, vUV); + gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); + } +`;function z(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),o=new Uint16Array(6*e);for(let t=0;t{let i=Q.current,r=C.current;if(!i||!r)return;let a=A.engineStore.getState().playback,o="playing"===a.status,s=o?t*a.rate:0,c=1e3*s,u=k.getDataBlockData.bind(k);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],o=i.particleEmitter;if("number"==typeof o){let e=t(o);if(e){let a=h(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let n=i.emitters;if(Array.isArray(n))for(let e of n){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=h(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new S(e.data,256);t.emitBurst(r,e.density);let a=B(e.data.particles.textureName),o=j(256),s=q(a,e.data.particles.useInvAlpha,e.data.orientParticles),l=new n.Mesh(o,s);l.frustumCulled=!1,i.add(l),J.current.push({emitter:t,mesh:l,geometry:o,material:s,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new S(e,256,t.lifetimeMS),o=B(e.particles.textureName),s=j(256),l=q(o,e.particles.useInvAlpha,e.orientParticles),c=new n.Mesh(s,l);c.frustumCulled=!1,i.add(c),J.current.push({emitter:a,mesh:c,geometry:s,material:l,targetTexture:o,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(I){let o=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,s=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),l=new n.MeshBasicMaterial({color:s,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new n.Mesh(F,l);c.frustumCulled=!1,c.scale.setScalar(o),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new n.CanvasTexture(i),o=new n.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),s=new n.Sprite(o),l=i.width/i.height;return s.scale.set(2*l,2,1),{sprite:s,material:o}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,s);u.position.set(r[1],r[2]+o+2,r[0]),u.frustumCulled=!1,i.add(u),ei.current.push({entityId:e.id,mesh:c,material:l,label:u,labelMaterial:d,creationTime:(0,A.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:o})}let o=a?.shockwave;if("number"==typeof o){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(o,u);if(t){let a=B(t.textureName),o=z(t.numSegments),s=new n.ShaderMaterial({vertexShader:_,fragmentShader:O,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:n.AdditiveBlending,side:n.DoubleSide}),l=new n.Mesh(o,s);l.frustumCulled=!1,l.position.set(r[1],r[2],r[0]),i.add(l);let c=null,u=null;t.renderBottom&&(u=z(t.numSegments),(c=new n.Mesh(u,s)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;er.current.push({entityId:e.id,mesh:l,bottomMesh:c,geometry:o,bottomGeometry:u,material:s,creationTime:(0,A.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||Z.current.has(e.id))continue;Z.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=h(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],o=new S(r,256),s=B(r.particles.textureName),l=j(256),c=q(s,r.particles.useInvAlpha,r.orientParticles),m=new n.Mesh(l,c);m.frustumCulled=!1,i.add(m),J.current.push({emitter:o,mesh:m,geometry:l,material:c,targetTexture:s,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of J.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of Z.current)d.has(e)||Z.current.delete(e);let m=J.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,o=e.getContext();o.getProgramParameter(a,o.LINK_STATUS)||P.error("Shader LINK ERROR (%s): %s",i,o.getProgramInfoLog(a))}(Y,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,c,t.emitAxis),t.emitter.update(c),D.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=I?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),o=i.getAttribute("particleSize"),n=i.getAttribute("particleSpin"),s=i.getAttribute("orientDir"),l=r.array,c=a.array,u=o.array,d=n.array,m=s.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e=0;e--){let t=p[e],r=Math.min((f-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let g=er.current;for(let t=g.length-1;t>=0;t--){let r=g[t],a=Math.min((f-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*s,r.radius=r.radius+r.velocity*s;let o=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e=r[e]&&(a=e);let o=Math.min(a+1,i.length-1),n=r[a]??0,s=(r[o]??1)-n,l=s>0?Math.min((t-n)/s,1):0,c=i[a]??i[0],u=i[o]??i[0];return[c.r+(u.r-c.r)*l,c.g+(u.g-c.g)*l,c.b+(u.b-c.b)*l,c.a+(u.a-c.a)*l]}(r.data,a);U(r.geometry,r.data,r.radius,o,r.data.is2D),r.bottomGeometry&&U(r.bottomGeometry,r.data,r.radius,o,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),g.splice(t,1))}if(o&&L&&K&&$&&Q.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(et.current.has(t))continue;et.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,T.resolveAudioProfile)(r,u);if(!a)continue;let o=new n.Vector3(e.position[1],e.position[2],e.position[0]);(0,T.playOneShotSound)(a,$,K,o,Q.current)}let e=ee.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let o=(0,T.resolveAudioProfile)(r,u);if(o&&o.isLooping&&o.is3D)try{let i=(0,l.audioToUrl)(o.filename),r=(0,T.getSoundGeneration)();(0,T.getCachedAudioBuffer)(i,K,i=>{if(r!==(0,T.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let s=Q.current;if(!s)return;let l=new n.PositionalAudio($);l.setBuffer(i),l.setDistanceModel("inverse"),l.setRefDistance(o.refDist),l.setMaxDistance(o.maxDist),l.setRolloffFactor(1),l.setVolume(o.volume),l.setPlaybackRate(a.rate),l.setLoop(!0),l.position.set(t.position[1],t.position[2],t.position[0]),s.add(l),(0,T.trackSound)(l),l.play(),e.set(t.id,l)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,T.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Q.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(et.current.has(t))continue;et.current.add(t);let i=(0,T.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new n.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,T.playOneShotSound)(i,$,K,r,Q.current)}}if(X.current.size>500){let e=new Set(r.entities.map(W));for(let t of X.current)e.has(t)||X.current.delete(t)}if(et.current.size>500){let e=new Set(r.entities.map(G));for(let t of et.current)t.startsWith("snd:")&&e.has(t.slice(4))||et.current.delete(t)}},M[7]=L,M[8]=$,M[9]=K,M[10]=I,M[11]=Y,M[12]=k,M[13]=C,M[14]=g):g=M[14],(0,a.useFrame)(g),M[15]===Symbol.for("react.memo_cache_sentinel")?(v=()=>()=>{let e=Q.current;for(let t of J.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(J.current=[],ei.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(ei.current=[],er.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(er.current=[],X.current.clear(),Z.current.clear(),ee.current)){(0,T.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}ee.current.clear(),et.current.clear()},y=[],M[15]=y,M[16]=v):(y=M[15],v=M[16]),(0,r.useEffect)(v,y),M[17]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("group",{ref:Q}),M[17]=b):b=M[17],b}function G(e){return e.id}function W(e){return e.id}function H(e){return e.gl}var K=e.i(9721),$=e.i(92224),Y=e.i(93784);function Q(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var J=e.i(77964);let X=new WeakMap;function Z(e){let t=X.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),X.set(e,t)),t}let ee=new n.Vector3,et=new n.Quaternion,ei=new n.Quaternion,er=new n.Quaternion(0,1,0,0),ea=new n.Vector3,eo=new n.Vector3,en=new n.Vector3;function es(e){let c,u,d,m,p,f,h,g,y,S=(0,i.c)(25),{recording:v}=e,b=(0,A.useEngineStoreApi)(),M=(0,r.useRef)(0),x=(0,r.useRef)(null),w=(0,r.useRef)(null);S[0]===Symbol.for("react.memo_cache_sentinel")?(c=new n.Vector3(0,s.DEFAULT_EYE_HEIGHT,0),S[0]=c):c=S[0];let P=(0,r.useRef)(c),k=(0,r.useRef)(v.streamingPlayback??null),C=(0,r.useRef)(null);S[1]===Symbol.for("react.memo_cache_sentinel")?(u=new Map,S[1]=u):u=S[1];let D=(0,r.useRef)(u),I=(0,r.useRef)(null),[B,N]=(0,r.useState)(null);S[2]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{if(e===I.current)return;I.current=e;let t=D.current,i=new Map;for(let a of e.entities){let o=t.get(a.id),n=o&&("Shape"===o.renderType||"Player"===o.renderType||"Explosion"===o.renderType);if(!o||o.className!==(a.className??a.type)||o.ghostIndex!==a.ghostIndex||o.dataBlockId!==a.dataBlockId||o.shapeHint!==a.shapeHint||n&&null!=a.dataBlock&&o.shapeName!==a.dataBlock||"Player"!==o.renderType&&n&&o.weaponShape!==a.weaponShape)o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Q(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Q(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Q(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Q(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Q(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Q(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Q(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Q(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Q(e,t),renderType:"Camera"}:{...Q(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(a,e.timeSec);else{var r=o;switch(r.renderType){case"Player":r.threads=a.threads,r.weaponShape=a.weaponShape,r.packShape=a.packShape,r.flagShape=a.flagShape,r.falling=a.falling,r.jetting=a.jetting,r.weaponImageState=a.weaponImageState,r.weaponImageStates=a.weaponImageStates,r.playerName=a.playerName,r.iffColor=a.iffColor,r.headPitch=a.headPitch,r.headYaw=a.headYaw,r.targetRenderFlags=a.targetRenderFlags;break;case"Shape":r.threads=a.threads,r.targetRenderFlags=a.targetRenderFlags,r.iffColor=a.iffColor}}if(i.set(a.id,o),(0,J.isSceneEntity)(o)||"None"===o.renderType)continue;let s=o.keyframes;0===s.length&&s.push({time:e.timeSec,position:a.position??[0,0,0],rotation:a.rotation??[0,0,0,1]});let l=s[0];l.time=e.timeSec,a.position&&(l.position=a.position),a.rotation&&(l.rotation=a.rotation),l.velocity=a.velocity,l.health=a.health,l.energy=a.energy,l.actionAnim=a.actionAnim,l.actionAtEnd=a.actionAtEnd,l.damageState=a.damageState}for(let[r,a]of t)if(!i.has(r)&&"Explosion"===a.renderType&&a.shapeName&&null!=a.spawnTime&&e.timeSec-a.spawnTime<5){i.set(r,a);continue}let a=i.size!==t.size||[...i.keys()].some(e=>!t.has(e));D.current=i,a&&$.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let o=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(o=r)}N(e=>e===o?e:o)},S[2]=d):d=S[2];let E=d;return S[3]!==b||S[4]!==v.gameType||S[5]!==v.missionName||S[6]!==v.recorderName||S[7]!==v.recordingDate||S[8]!==v.serverDisplayName||S[9]!==v.source||S[10]!==v.streamingPlayback?(m=()=>{(0,T.stopAllTrackedSounds)(),k.current=v.streamingPlayback??null,D.current=new Map,I.current=null,C.current=null,(0,Y.resetStreamPlayback)(),M.current=0,x.current=null,w.current=null;let e=k.current;if(Y.streamPlaybackStore.setState({playback:e}),$.gameEntityStore.getState().beginStreaming(v.source),!e)return void b.getState().setPlaybackStreamSnapshot(null);e.onMissionInfoChange=()=>{$.gameEntityStore.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,r=e.gameClassName,a=e.serverDisplayName,n=e.connectedPlayerName;for(let s of("live"!==v.source&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=r,e.serverDisplayName=a,e.connectedPlayerName=n,$.gameEntityStore.getState().setMissionInfo({missionName:v.missionName??void 0,missionTypeDisplayName:v.gameType??void 0,missionDisplayName:t??void 0,gameClassName:r??void 0,serverDisplayName:a??v.serverDisplayName??void 0,recorderName:n??v.recorderName??void 0,recordingDate:v.recordingDate??void 0}),e.getEffectShapes()))o.useGLTF.preload((0,l.shapeToUrl)(s));let s=e.getSnapshot();return Y.streamPlaybackStore.setState({time:s.timeSec}),M.current=s.timeSec,x.current=s,w.current=s,E(s),b.getState().setPlaybackStreamSnapshot(s),C.current=s,()=>{(0,T.stopAllTrackedSounds)(),k.current=null,(0,Y.resetStreamPlayback)()}},S[3]=b,S[4]=v.gameType,S[5]=v.missionName,S[6]=v.recorderName,S[7]=v.recordingDate,S[8]=v.serverDisplayName,S[9]=v.source,S[10]=v.streamingPlayback,S[11]=m):m=S[11],S[12]!==b||S[13]!==v?(p=[v,b,E],S[12]=b,S[13]=v,S[14]=p):p=S[14],(0,r.useEffect)(m,p),S[15]!==b||S[16]!==v.source?(f=(e,t)=>{let i=k.current;if(!i)return;let r=b.getState(),a=r.playback,o="playing"===a.status,n=a.timeMs/1e3,l=!o&&Math.abs(n-M.current)>5e-4,c=o&&Math.abs(n-Y.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(M.current=n),o&&((0,A.advanceEffectClock)(t,a.rate),M.current=M.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=M.current+s.STREAM_TICK_SEC,p=i.stepToTime(m,o&&!u?d:1/0),f=w.current;!f||p.timeSec1.5*s.STREAM_TICK_SEC?(x.current=p,w.current=p):p.timeSec!==f.timeSec&&(x.current=f,w.current=p);let h=w.current??p,g=x.current??h,y=h.timeSec-s.STREAM_TICK_SEC,S=Math.max(0,Math.min(1,(M.current-y)/s.STREAM_TICK_SEC));Y.streamPlaybackStore.setState({time:M.current}),p.exhausted&&o&&(M.current=Math.min(M.current,p.timeSec)),E(h),Y.streamPlaybackStore.getState().entities=D.current,h!==C.current&&(C.current=h,r.setPlaybackStreamSnapshot(h));let T=h.camera,I=T&&g.camera&&g.camera.mode===T.mode&&g.camera.controlEntityId===T.controlEntityId&&g.camera.orbitTargetId===T.orbitTargetId?g.camera:null,B=Y.streamPlaybackStore.getState().freeFlyCamera,N="live"===v.source;if(T&&!B){if(I){let t=I.position[0],i=I.position[1],r=I.position[2],a=T.position[0],o=T.position[1],n=T.position[2];e.camera.position.set(i+(o-i)*S,r+(n-r)*S,t+(a-t)*S),N||(et.set(...I.rotation),ei.set(...T.rotation),et.slerp(ei,S),e.camera.quaternion.copy(et))}else e.camera.position.set(T.position[1],T.position[2],T.position[0]),N||e.camera.quaternion.set(...T.rotation);if(Number.isFinite(T.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=I&&Number.isFinite(I.fov)?I.fov+(T.fov-I.fov)*S:T.fov,r=(0,s.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let R=Z(h),V=Z(g),F=D.current,_=Y.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=F.get(t.name);if(i&&(0,J.isSceneEntity)(i))continue;let r=R.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=V.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],o=a.position[2],n=r.position[0],s=r.position[1],l=r.position[2],c=e+(n-e)*S,u=i+(s-i)*S,d=o+(l-o)*S;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(er):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(et.set(...a.rotation),ei.set(...r.rotation),et.slerp(ei,S),t.quaternion.copy(et)):t.quaternion.set(...r.rotation))}let O=T?.mode;if(!B&&!N&&"third-person"===O&&_&&T?.orbitTargetId){let t=_.children.find(e=>e.name===T.orbitTargetId);if(t){let i=R.get(T.orbitTargetId);eo.copy(t.position),i?.type==="Player"&&(eo.y=eo.y+1);let r=!1;if(T.orbitDirection)ea.set(T.orbitDirection[0],T.orbitDirection[1],T.orbitDirection[2]),r=ea.lengthSq()>1e-8;else if("number"==typeof T.yaw&&"number"==typeof T.pitch){let e=Math.sin(T.pitch),t=Math.cos(T.pitch),i=Math.sin(T.yaw),a=Math.cos(T.yaw);ea.set(-a*t,-e,-i*t),r=ea.lengthSq()>1e-8}if(r||(ea.copy(e.camera.position).sub(eo),r=ea.lengthSq()>1e-8),r){ea.normalize();let t=Math.max(.1,T.orbitDistance??4);en.copy(eo).addScaledVector(ea,t),e.camera.position.copy(en),e.camera.lookAt(eo)}}}if(!B&&"first-person"===O&&_&&T?.controlEntityId){let t=_.children.find(e=>e.name===T.controlEntityId);t?(ee.copy(P.current).applyQuaternion(t.quaternion),e.camera.position.add(ee)):e.camera.position.y=e.camera.position.y+P.current.y}o&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*M.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},S[15]=b,S[16]=v.source,S[17]=f):f=S[17],(0,a.useFrame)(f),S[18]!==v.streamingPlayback?(h=(0,t.jsx)(L,{playback:v.streamingPlayback,snapshotRef:w}),S[18]=v.streamingPlayback,S[19]=h):h=S[19],S[20]!==B?(g=B&&(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(K.PlayerEyeOffset,{shapeName:B,eyeOffsetRef:P})}),S[20]=B,S[21]=g):g=S[21],S[22]!==h||S[23]!==g?(y=(0,t.jsxs)(t.Fragment,{children:[h,g]}),S[22]=h,S[23]=g,S[24]=y):y=S[24],y}e.s(["StreamingController",()=>es],51295)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/c293826b70147a61.js b/docs/_next/static/chunks/c293826b70147a61.js deleted file mode 100644 index 2412c13d..00000000 --- a/docs/_next/static/chunks/c293826b70147a61.js +++ /dev/null @@ -1,521 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29418,e=>{e.v({Bottom:"PlayerNameplate-module__zYDm0a__Bottom PlayerNameplate-module__zYDm0a__Root",HealthBar:"PlayerNameplate-module__zYDm0a__HealthBar",HealthFill:"PlayerNameplate-module__zYDm0a__HealthFill",IffArrow:"PlayerNameplate-module__zYDm0a__IffArrow",Name:"PlayerNameplate-module__zYDm0a__Name",Root:"PlayerNameplate-module__zYDm0a__Root",Top:"PlayerNameplate-module__zYDm0a__Top PlayerNameplate-module__zYDm0a__Root"})},78779,e=>{e.v({Distance:"FlagMarker-module__INpLba__Distance",Icon:"FlagMarker-module__INpLba__Icon",Root:"FlagMarker-module__INpLba__Root"})},87297,38437,e=>{"use strict";var t=e.i(43476),r=e.i(932),a=e.i(71645),i=e.i(90072),o=e.i(71753);e.i(13876);var l=e.i(92224),n=e.i(77964),s=e.i(93784),u=e.i(91907),c=e.i(25947),f=e.i(89887),d=e.i(79123),m=e.i(68294);function g(e){let t,o,l,n,s=(0,r.c)(12),{entity:u}=e,{registerCamera:c,unregisterCamera:f}=(0,m.useCameras)(),d=(0,a.useId)(),g=u.cameraDataBlock;s[0]!==u.position?(t=u.position?new i.Vector3(...u.position):new i.Vector3,s[0]=u.position,s[1]=t):t=s[1];let h=t;s[2]!==u.rotation?(o=u.rotation?new i.Quaternion(...u.rotation):new i.Quaternion,s[2]=u.rotation,s[3]=o):o=s[3];let p=o;return s[4]!==g||s[5]!==d||s[6]!==h||s[7]!==c||s[8]!==p||s[9]!==f?(l=()=>{if("Observer"===g){let e={id:d,position:h,rotation:p};return c(e),()=>{f(e)}}},n=[d,g,c,f,h,p],s[4]=g,s[5]=d,s[6]=h,s[7]=c,s[8]=p,s[9]=f,s[10]=l,s[11]=n):(l=s[10],n=s[11]),(0,a.useEffect)(l,n),null}function h(e){let a,i=(0,r.c)(3),{entity:o}=e;return i[0]!==o.label||i[1]!==o.position?(a=o.label?(0,t.jsx)(f.FloatingLabel,{position:o.position,opacity:.6,children:o.label}):null,i[0]=o.label,i[1]=o.position,i[2]=a):a=i[2],a}var p=e.i(15080),v=e.i(66027),x=e.i(63318),b=e.i(12979),y=e.i(75567),S=e.i(47071);let F={sunLightPointsDown:{value:!0}};function w(e){F.sunLightPointsDown.value=e}e.s(["globalSunUniforms",0,F,"updateGlobalSunUniforms",()=>w],38437);let T=` -vec3 terrainLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 terrainSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;var M=e.i(47021),D=e.i(48066);let C={0:32,1:32,2:32,3:32,4:32,5:32},j=(0,a.memo)(function({displacementMap:e,visibilityMask:r,textureNames:o,alphaTextures:l,detailTextureName:n,lightmap:s}){let{debugMode:u}=(0,d.useDebug)(),c=(0,S.useTexture)(o.map(e=>(0,b.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,y.setupTexture)(e))}),f=n?(0,b.textureToUrl)(n):null,m=(0,S.useTexture)(f??b.FALLBACK_TEXTURE_URL,e=>{(0,y.setupTexture)(e)}),g=(0,a.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:i,detailTexture:o=null,lightmap:l=null}){e.uniforms.sunLightPointsDown=F.sunLightPointsDown;let n=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:i[r]??32}}),l&&(e.uniforms.terrainLightmap={value:l}),o&&(e.uniforms.detailTexture={value:o},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include -varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include -vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` -uniform sampler2D albedo0; -uniform sampler2D albedo1; -uniform sampler2D albedo2; -uniform sampler2D albedo3; -uniform sampler2D albedo4; -uniform sampler2D albedo5; -uniform sampler2D mask0; -uniform sampler2D mask1; -uniform sampler2D mask2; -uniform sampler2D mask3; -uniform sampler2D mask4; -uniform sampler2D mask5; -uniform float tiling0; -uniform float tiling1; -uniform float tiling2; -uniform float tiling3; -uniform float tiling4; -uniform float tiling5; -${a?"uniform sampler2D visibilityMask;":""} -${l?"uniform sampler2D terrainLightmap;":""} -uniform bool sunLightPointsDown; -${o?`uniform sampler2D detailTexture; -uniform float detailTiling; -uniform float detailFadeDistance; -varying vec3 vTerrainWorldPos;`:""} - -${T} - -// Global variable to store shadow factor from RE_Direct for use in output calculation -float terrainShadowFactor = 1.0; -`+e.fragmentShader,a){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} - // Early discard for invisible areas (before fog/lighting) - float visibility = texture2D(visibilityMask, vMapUv).r; - if (visibility < 0.5) { - discard; - } - `)}e.fragmentShader=e.fragmentShader.replace("#include ",` - // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) - vec2 baseUv = vMapUv; - vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; - ${n>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} - ${n>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} - ${n>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} - ${n>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} - ${n>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} - - // Sample alpha masks for all layers (use R channel) - // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), - // but GPU linear filtering samples at texel centers. This offset aligns them. - vec2 alphaUv = baseUv + vec2(0.5 / 256.0); - float a0 = texture2D(mask0, alphaUv).r; - ${n>1?"float a1 = texture2D(mask1, alphaUv).r;":""} - ${n>2?"float a2 = texture2D(mask2, alphaUv).r;":""} - ${n>3?"float a3 = texture2D(mask3, alphaUv).r;":""} - ${n>4?"float a4 = texture2D(mask4, alphaUv).r;":""} - ${n>5?"float a5 = texture2D(mask5, alphaUv).r;":""} - - // Torque-style additive weighted blending (blender.cc): - // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... - // Each layer's alpha map defines its contribution weight. - vec3 blended = c0 * a0; - ${n>1?"blended += c1 * a1;":""} - ${n>2?"blended += c2 * a2;":""} - ${n>3?"blended += c3 * a3;":""} - ${n>4?"blended += c4 * a4;":""} - ${n>5?"blended += c5 * a5;":""} - - // Assign to diffuseColor before lighting - vec3 textureColor = blended; - - ${o?`// Detail texture blending (Torque-style multiplicative blend) - // Sample detail texture at high frequency tiling - vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; - - // Calculate distance-based fade factor using world positions - // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance - float distToCamera = distance(vTerrainWorldPos, cameraPosition); - float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); - - // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) - // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray - // Direct multiplication adds subtle darkening for surface detail - textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} - - // Store blended texture in diffuseColor (still in linear space here) - // We'll convert to sRGB in the output calculation - diffuseColor.rgb = textureColor; -`),l&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include - -// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting -#undef RE_Direct -void RE_Direct_TerrainShadow( 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 ) { - // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient - // This prevents shadow acne from light hitting terrain backfaces - if (!sunLightPointsDown) { - terrainShadowFactor = 0.0; - return; - } - // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) - // Extract shadow factor by comparing to original sun color - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 originalSunColor = directionalLights[0].color; - float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); - float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); - terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); - #endif - // Don't add to reflectedLight - we'll compute lighting in gamma space at output -} -#define RE_Direct RE_Direct_TerrainShadow - -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -// Clear indirect diffuse - we'll compute ambient in gamma space -#if defined( RE_IndirectDiffuse ) - irradiance = vec3(0.0); -#endif -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include - // Clear Three.js lighting - we compute everything in gamma space - reflectedLight.directDiffuse = vec3(0.0); - reflectedLight.indirectDiffuse = vec3(0.0); -`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -{ - // Get texture in sRGB space (undo Three.js linear decode) - vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); - - ${l?` - // Sample terrain lightmap for smooth NdotL - vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); - float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; - - // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) - // Three.js interprets them as linear, but the numerical values are preserved - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 sunColorSRGB = directionalLights[0].color; - #else - vec3 sunColorSRGB = vec3(0.7); - #endif - vec3 ambientColorSRGB = ambientLightColor; - - // Torque formula (terrLighting.cc:471-483): - // lighting = ambient + NdotL * shadowFactor * sunColor - // Clamp lighting to [0,1] before multiplying by texture - vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); - `:` - // No lightmap - use simple ambient lighting - vec3 lightingSRGB = ambientLightColor; - `} - - // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space - vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - - // Convert back to linear for Three.js output pipeline - outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; -} -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE - // Debug mode: overlay green grid matching terrain grid squares (256x256) - float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); - vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green - gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); -#endif - -#include `)}({shader:e,baseTextures:c,alphaTextures:l,visibilityMask:r,tiling:C,detailTexture:f?m:null,lightmap:s}),(0,M.injectCustomFog)(e,D.globalFogUniforms)},[c,l,r,m,f,s]),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!u,e.needsUpdate=!0)},[u]);let p=`${f?"detail":"nodetail"}-${s?"lightmap":"nolightmap"}`;return(0,t.jsx)("meshLambertMaterial",{ref:h,map:e,depthWrite:!0,side:i.FrontSide,defines:{DEBUG_MODE:+!!u},onBeforeCompile:g},p)}),_=(0,a.memo)(function(e){let i,o,l=(0,r.c)(8),{displacementMap:n,visibilityMask:s,textureNames:u,alphaTextures:c,detailTextureName:f,lightmap:d}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),l[0]=i):i=l[0],l[1]!==c||l[2]!==f||l[3]!==n||l[4]!==d||l[5]!==u||l[6]!==s?(o=(0,t.jsx)(a.Suspense,{fallback:i,children:(0,t.jsx)(j,{displacementMap:n,visibilityMask:s,textureNames:u,alphaTextures:c,detailTextureName:f,lightmap:d})}),l[1]=c,l[2]=f,l[3]=n,l[4]=d,l[5]=u,l[6]=s,l[7]=o):o=l[7],o}),k=(0,a.memo)(function(e){let a,i,o,l=(0,r.c)(15),{tileX:n,tileZ:s,blockSize:u,basePosition:c,textureNames:f,geometry:d,displacementMap:m,visibilityMask:g,alphaTextures:h,detailTextureName:p,lightmap:v,visible:x}=e,b=void 0===x||x,y=u/2,S=c.x+n*u+y,F=c.z+s*u+y;l[0]!==S||l[1]!==F?(a=[S,0,F],l[0]=S,l[1]=F,l[2]=a):a=l[2];let w=a;return l[3]!==h||l[4]!==p||l[5]!==m||l[6]!==v||l[7]!==f||l[8]!==g?(i=(0,t.jsx)(_,{displacementMap:m,visibilityMask:g,textureNames:f,alphaTextures:h,detailTextureName:p,lightmap:v}),l[3]=h,l[4]=p,l[5]=m,l[6]=v,l[7]=f,l[8]=g,l[9]=i):i=l[9],l[10]!==d||l[11]!==w||l[12]!==i||l[13]!==b?(o=(0,t.jsx)("mesh",{position:w,geometry:d,castShadow:!0,receiveShadow:!0,visible:b,children:i}),l[10]=d,l[11]=w,l[12]=i,l[13]=b,l[14]=o):o=l[14],o});var R=e.i(8328);function B(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,i=r>>16,o=256*a;for(let r=0;r0?_.visibleDistance:600,W=(0,p.useThree)(G),O=-(128*H);A[0]!==O?(n={x:O,z:O},A[0]=O,A[1]=n):n=A[1];let Y=n;A[2]!==E.emptySquareRuns?(s=E.emptySquareRuns??[],A[2]=E.emptySquareRuns,A[3]=s):s=A[3];let K=s,{data:Q}=((I=(0,r.c)(2))[0]!==P?(L={queryKey:["terrain",P],queryFn:()=>(0,b.loadTerrain)(P)},I[0]=P,I[1]=L):L=I[1],(0,v.useQuery)(L));e:{let e;if(!Q){u=null;break e}let t=256*H;A[4]!==t||A[5]!==H||A[6]!==Q.heightMap?(!function(e,t,r){let a=e.attributes.position,i=e.attributes.uv,o=e.attributes.normal,l=a.array,n=i.array,s=o.array,u=a.count,c=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),f=(e,r)=>{let a=Math.floor(e=Math.max(0,Math.min(255,e))),i=Math.floor(r=Math.max(0,Math.min(255,r))),o=Math.min(a+1,255),l=Math.min(i+1,255),n=e-a,s=r-i;return(t[256*i+a]/65535*2048*(1-n)+t[256*i+o]/65535*2048*n)*(1-s)+(t[256*l+a]/65535*2048*(1-n)+t[256*l+o]/65535*2048*n)*s};for(let e=0;e0?(g/=v,h/=v,p/=v):(g=0,h=1,p=0),s[3*e]=g,s[3*e+1]=h,s[3*e+2]=p}a.needsUpdate=!0,o.needsUpdate=!0}(e=function(e,t){let r=new i.BufferGeometry,a=new Float32Array(198147),o=new Float32Array(198147),l=new Float32Array(132098),n=new Uint32Array(393216),s=0,u=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let i=257*t+r;a[3*i]=r*u-e/2,a[3*i+1]=e/2-t*u,a[3*i+2]=0,o[3*i]=0,o[3*i+1]=0,o[3*i+2]=1,l[2*i]=r/256,l[2*i+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,i=(e+1)*257+t,o=i+1;((t^e)&1)==0?(n[s++]=r,n[s++]=i,n[s++]=o,n[s++]=r,n[s++]=o,n[s++]=a):(n[s++]=r,n[s++]=i,n[s++]=a,n[s++]=a,n[s++]=i,n[s++]=o)}return r.setIndex(new i.BufferAttribute(n,1)),r.setAttribute("position",new i.Float32BufferAttribute(a,3)),r.setAttribute("normal",new i.Float32BufferAttribute(o,3)),r.setAttribute("uv",new i.Float32BufferAttribute(l,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),Q.heightMap,H),A[4]=t,A[5]=H,A[6]=Q.heightMap,A[7]=e):e=A[7],u=e}let X=u;A[8]!==H||A[9]!==Q?(c=()=>{if(Q)return(0,R.setTerrainHeightSampler)((0,R.createTerrainHeightSampler)(Q.heightMap,H)),z},f=[Q,H],A[8]=H,A[9]=Q,A[10]=c,A[11]=f):(c=A[10],f=A[11]),(0,a.useEffect)(c,f);let Z=(0,l.useSceneSun)();t:{let e,t;if(!Z){let e;A[12]===Symbol.for("react.memo_cache_sentinel")?(e=new i.Vector3(.57735,-.57735,.57735),A[12]=e):e=A[12],d=e;break t}A[13]!==Z.direction?(e=(0,x.torqueToThree)(Z.direction),A[13]=Z.direction,A[14]=e):e=A[14];let[r,a,o]=e,l=Math.sqrt(r*r+a*a+o*o),n=r/l,s=a/l,u=o/l;A[15]!==u||A[16]!==n||A[17]!==s?(t=new i.Vector3(n,s,u),A[15]=u,A[16]=n,A[17]=s,A[18]=t):t=A[18],d=t}let J=d;r:{let e;if(!Q){m=null;break r}A[19]!==H||A[20]!==J||A[21]!==Q.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),i=Math.max(0,Math.min(255,r)),o=Math.floor(a),l=Math.floor(i),n=Math.min(o+1,255),s=Math.min(l+1,255),u=a-o,c=i-l;return((e[256*l+o]/65535*(1-u)+e[256*l+n]/65535*u)*(1-c)+(e[256*s+o]/65535*(1-u)+e[256*s+n]/65535*u)*c)*2048},o=new i.Vector3(-t.x,-t.y,-t.z).normalize(),l=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=t/2+.25,n=e/2+.25,s=a(i,n),u=a(i-.5,n),c=a(i+.5,n),f=a(i,n-.5),d=-((a(i,n+.5)-f)/1),m=-((c-u)/1),g=Math.sqrt(d*d+r*r+m*m),h=Math.max(0,d/g*o.x+r/g*o.y+m/g*o.z),p=1;h>0&&(p=function(e,t,r,a,i,o){let l=a.z/i,n=a.x/i,s=a.y,u=Math.sqrt(l*l+n*n);if(u<1e-4)return 1;let c=.5/u,f=l*c,d=n*c,m=s*c,g=e,h=t,p=r+.1;for(let e=0;e<768&&(g+=f,h+=d,p+=m,!(g<0)&&!(g>=256)&&!(h<0)&&!(h>=256)&&!(p>2048));e++)if(pArray(el).fill(null),A[32]=el,A[33]=w):w=A[33];let[es,eu]=(0,a.useState)(w);A[34]===Symbol.for("react.memo_cache_sentinel")?(T={xStart:0,xEnd:0,zStart:0,zEnd:0},A[34]=T):T=A[34];let ec=(0,a.useRef)(T);return(A[35]!==Y.x||A[36]!==Y.z||A[37]!==q||A[38]!==W.position.x||A[39]!==W.position.z||A[40]!==el||A[41]!==$?(M=()=>{let e=W.position.x-Y.x,t=W.position.z-Y.z,r=Math.floor((e-$)/q),a=Math.ceil((e+$)/q),i=Math.floor((t-$)/q),o=Math.ceil((t+$)/q),l=ec.current;if(r===l.xStart&&a===l.xEnd&&i===l.zStart&&o===l.zEnd)return;l.xStart=r,l.xEnd=a,l.zStart=i,l.zEnd=o;let n=[];for(let e=r;e{let r=es[e];return(0,t.jsx)(k,{tileX:r?.tileX??0,tileZ:r?.tileZ??0,blockSize:q,basePosition:Y,textureNames:Q.textureNames,geometry:X,displacementMap:et,visibilityMask:ea,alphaTextures:ei,detailTextureName:V,lightmap:ee,visible:null!==r},e)}),A[53]=Y,A[54]=q,A[55]=V,A[56]=en,A[57]=ei,A[58]=et,A[59]=X,A[60]=Q.textureNames,A[61]=ee,A[62]=es,A[63]=C):C=A[63],A[64]!==D||A[65]!==C?(j=(0,t.jsxs)(t.Fragment,{children:[D,C]}),A[64]=D,A[65]=C,A[66]=j):j=A[66],j):null});function G(e){return e.camera}function z(){return(0,R.setTerrainHeightSampler)(null)}function U(e){return(0,y.setupMask)(e)}function N(e,t){return t}var I=e.i(8597),A=e.i(78140);let E=` -vec3 interiorLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 interiorSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;function P({materialName:e,material:r,lightMap:o}){let l=(0,d.useDebug)(),n=l?.debugMode??!1,s=(0,b.textureToUrl)(e),u=(0,S.useTexture)(s,e=>(0,y.setupTexture)(e)),c=new Set(r?.userData?.flag_names??[]).has("SelfIlluminating"),f=new Set(r?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),m=(0,a.useCallback)(e=>{let t;(0,M.injectCustomFog)(e,D.globalFogUniforms),t=f??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new i.Vector3(0,.4,1):new i.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include -${E} -uniform bool useSceneLighting; -uniform vec3 interiorDebugColor; -`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation -#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -// Get texture in sRGB space (undo Three.js linear decode) -vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); - -// Compute lighting in sRGB space -vec3 lightingSRGB = vec3(0.0); - -if (useSceneLighting) { - // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI - // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear - vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); - vec3 extractedLighting = totalLight * PI / safeTexLinear; - // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors - // are sRGB values (Torque used them directly in gamma space). Three.js treats them - // as linear but the numerical values are the same. DO NOT convert to sRGB here! - // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap - // (sceneLighting.cc line 1785: tmp.clamp()) - lightingSRGB = clamp(extractedLighting, 0.0, 1.0); -} - -// Add lightmap contribution (for BOTH outside and inside surfaces) -// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load -// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. -#ifdef USE_LIGHTMAP - // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back - lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); -#endif -// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) -lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); - -// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space -vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - -// Convert back to linear for Three.js output pipeline -vec3 resultLinear = interiorSRGBToLinear(resultSRGB); - -// Reassign outgoingLight before opaque_fragment consumes it -outgoingLight = resultLinear + totalEmissiveRadiance; - -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering -// Blue grid = SurfaceOutsideVisible (receives scene ambient light) -// Red grid = inside surface (no scene ambient light) -#if DEBUG_MODE && defined(USE_MAP) - // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide - float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); - gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); -#endif - -#include `)},[f]),g=(0,a.useRef)(null),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=g.current??h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!n,e.needsUpdate=!0)},[n]);let p={DEBUG_MODE:+!!n},v=`${f}`;return c?(0,t.jsx)("meshBasicMaterial",{ref:g,map:u,toneMapped:!1,defines:p,onBeforeCompile:m},v):(0,t.jsx)("meshLambertMaterial",{ref:h,map:u,lightMap:o,toneMapped:!1,defines:p,onBeforeCompile:m},v)}function H(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=i.SRGBColorSpace),t??null}function V(e){let i,o,l,n=(0,r.c)(13),{node:s}=e;e:{let e,t;if(!s.material){let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],n[0]=e):e=n[0],i=e;break e}if(Array.isArray(s.material)){let e;n[1]!==s.material?(e=s.material.map(q),n[1]=s.material,n[2]=e):e=n[2],i=e;break e}n[3]!==s.material?(e=H(s.material),n[3]=s.material,n[4]=e):e=n[4],n[5]!==e?(t=[e],n[5]=e,n[6]=t):t=n[6],i=t}let u=i;return n[7]!==u||n[8]!==s.material?(o=s.material?(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(s.material)?s.material.map((e,r)=>(0,t.jsx)(P,{materialName:e.userData.resource_path,material:e,lightMap:u[r]},r)):(0,t.jsx)(P,{materialName:s.material.userData.resource_path,material:s.material,lightMap:u[0]})}):null,n[7]=u,n[8]=s.material,n[9]=o):o=n[9],n[10]!==s.geometry||n[11]!==o?(l=(0,t.jsx)("mesh",{geometry:s.geometry,castShadow:!0,receiveShadow:!0,children:o}),n[10]=s.geometry,n[11]=o,n[12]=l):l=n[12],l}function q(e){return H(e)}let $=(0,a.memo)(function(e){let a,i,o,l,n,s,u,c=(0,r.c)(10),{interiorFile:m,ghostIndex:g}=e,{nodes:h}=((s=(0,r.c)(2))[0]!==m?(n=(0,b.interiorToUrl)(m),s[0]=m,s[1]=n):n=s[1],u=n,(0,A.useGLTF)(u)),p=(0,d.useDebug)(),v=p?.debugMode??!1;return c[0]===Symbol.for("react.memo_cache_sentinel")?(a=[0,-Math.PI/2,0],c[0]=a):a=c[0],c[1]!==h?(i=Object.entries(h).filter(K).map(Q),c[1]=h,c[2]=i):i=c[2],c[3]!==v||c[4]!==g||c[5]!==m?(o=v?(0,t.jsxs)(f.FloatingLabel,{children:[g,": ",m]}):null,c[3]=v,c[4]=g,c[5]=m,c[6]=o):o=c[6],c[7]!==i||c[8]!==o?(l=(0,t.jsxs)("group",{rotation:a,children:[i,o]}),c[7]=i,c[8]=o,c[9]=l):l=c[9],l});function W(e){let a,i,o,l,n=(0,r.c)(9),{color:s,label:u}=e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),n[0]=a):a=n[0],n[1]!==s?(i=(0,t.jsx)("meshStandardMaterial",{color:s,wireframe:!0}),n[1]=s,n[2]=i):i=n[2],n[3]!==s||n[4]!==u?(o=u?(0,t.jsx)(f.FloatingLabel,{color:s,children:u}):null,n[3]=s,n[4]=u,n[5]=o):o=n[5],n[6]!==i||n[7]!==o?(l=(0,t.jsxs)("mesh",{children:[a,i,o]}),n[6]=i,n[7]=o,n[8]=l):l=n[8],l}function O(e){let a,i=(0,r.c)(3),{label:o}=e,l=(0,d.useDebug)(),n=l?.debugMode??!1;return i[0]!==n||i[1]!==o?(a=n?(0,t.jsx)(W,{color:"red",label:o}):null,i[0]=n,i[1]=o,i[2]=a):a=i[2],a}let Y=(0,a.memo)(function(e){let i,o,l,n,s,u,c,f,d,m=(0,r.c)(23),{scene:g}=e;m[0]!==g.transform.position?(i=(0,x.torqueToThree)(g.transform.position),m[0]=g.transform.position,m[1]=i):i=m[1];let h=i;m[2]!==g.transform?(o=(0,x.matrixFToQuaternion)(g.transform),m[2]=g.transform,m[3]=o):o=m[3];let p=o;m[4]!==g.scale?(l=(0,x.torqueScaleToThree)(g.scale),m[4]=g.scale,m[5]=l):l=m[5];let v=l,b=`${g.ghostIndex}: ${g.interiorFile}`;return m[6]!==b?(n=(0,t.jsx)(O,{label:b}),m[6]=b,m[7]=n):n=m[7],m[8]!==g.interiorFile?(s=e=>{console.warn(`[interior] Failed to load ${g.interiorFile}:`,e.message)},m[8]=g.interiorFile,m[9]=s):s=m[9],m[10]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(W,{color:"orange"}),m[10]=u):u=m[10],m[11]!==g.ghostIndex||m[12]!==g.interiorFile?(c=(0,t.jsx)(a.Suspense,{fallback:u,children:(0,t.jsx)($,{interiorFile:g.interiorFile,ghostIndex:g.ghostIndex})}),m[11]=g.ghostIndex,m[12]=g.interiorFile,m[13]=c):c=m[13],m[14]!==n||m[15]!==s||m[16]!==c?(f=(0,t.jsx)(I.ErrorBoundary,{fallback:n,onError:s,children:c}),m[14]=n,m[15]=s,m[16]=c,m[17]=f):f=m[17],m[18]!==h||m[19]!==p||m[20]!==v||m[21]!==f?(d=(0,t.jsx)("group",{position:h,quaternion:p,scale:v,children:f}),m[18]=h,m[19]=p,m[20]=v,m[21]=f,m[22]=d):d=m[22],d});function K(e){let[,t]=e;return t.isMesh}function Q(e){let[r,a]=e;return(0,t.jsx)(V,{node:a},r)}var X=e.i(99143);function Z(e,{path:t}){let[r]=(0,X.useLoader)(i.CubeTextureLoader,[e],e=>e.setPath(t));return r}Z.preload=(e,{path:t})=>X.useLoader.preload(i.CubeTextureLoader,[e],e=>e.setPath(t));let J=()=>{};function ee(e){return e.wrapS=i.RepeatWrapping,e.wrapT=i.RepeatWrapping,e.minFilter=i.LinearFilter,e.magFilter=i.LinearFilter,e.colorSpace=i.NoColorSpace,e.needsUpdate=!0,e}let et=` - attribute float alpha; - - uniform vec2 uvOffset; - - varying vec2 vUv; - varying float vAlpha; - - void main() { - // Apply UV offset for scrolling - vUv = uv + uvOffset; - vAlpha = alpha; - - vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - // Set depth to far plane so clouds are always visible and behind other geometry - gl_Position = pos.xyww; - } -`,er=` - uniform sampler2D cloudTexture; - uniform float debugMode; - uniform int layerIndex; - - varying vec2 vUv; - varying float vAlpha; - - // Debug grid using screen-space derivatives for sharp, anti-aliased lines - float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); - } - - void main() { - vec4 texColor = texture2D(cloudTexture, vUv); - - // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color - // Vertex color is white with varying alpha, so: - // Final RGB = Texture RGB \xd7 1.0 = Texture RGB - // Final Alpha = Texture Alpha \xd7 Vertex Alpha - float finalAlpha = texColor.a * vAlpha; - vec3 color = texColor.rgb; - - // Debug mode: overlay R/G/B grid for layers 0/1/2 - if (debugMode > 0.5) { - float gridIntensity = debugGrid(vUv, 4.0, 1.5); - vec3 gridColor; - if (layerIndex == 0) { - gridColor = vec3(1.0, 0.0, 0.0); // Red - } else if (layerIndex == 1) { - gridColor = vec3(0.0, 1.0, 0.0); // Green - } else { - gridColor = vec3(0.0, 0.0, 1.0); // Blue - } - color = mix(color, gridColor, gridIntensity * 0.5); - } - - // Output clouds with texture color and combined alpha - gl_FragColor = vec4(color, finalAlpha); - } -`;function ea({textureUrl:e,radius:r,heightPercent:l,speed:n,windDirection:s,layerIndex:u}){let{debugMode:c}=(0,d.useDebug)(),{animationEnabled:f}=(0,d.useSettings)(),m=(0,a.useRef)(null),g=(0,S.useTexture)(e,ee),h=(0,a.useMemo)(()=>{let e=l-.05;return function(e,t,r,a){var o;let l,n,s,u,c,f,d,m,g,h,p,v,x,b,y,S,F,w=new i.BufferGeometry,T=new Float32Array(75),M=new Float32Array(50),D=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],C=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,i=-e+r*C,o=e-t*C,l=e*D[a];T[3*a]=i,T[3*a+1]=l,T[3*a+2]=o,M[2*a]=r,M[2*a+1]=t}o=T,l=e=>({x:o[3*e],y:o[3*e+1],z:o[3*e+2]}),n=(e,t,r,a)=>{o[3*e]=t,o[3*e+1]=r,o[3*e+2]=a},s=l(1),u=l(3),c=l(5),f=l(6),d=l(8),m=l(9),g=l(15),h=l(16),p=l(18),v=l(19),x=l(21),b=l(23),y=c.x+(s.x-c.x)*.5,S=c.y+(s.y-c.y)*.5,F=c.z+(s.z-c.z)*.5,n(0,f.x+(y-f.x)*2,f.y+(S-f.y)*2,f.z+(F-f.z)*2),y=m.x+(u.x-m.x)*.5,S=m.y+(u.y-m.y)*.5,F=m.z+(u.z-m.z)*.5,n(4,d.x+(y-d.x)*2,d.y+(S-d.y)*2,d.z+(F-d.z)*2),y=x.x+(g.x-x.x)*.5,S=x.y+(g.y-x.y)*.5,F=x.z+(g.z-x.z)*.5,n(20,h.x+(y-h.x)*2,h.y+(S-h.y)*2,h.z+(F-h.z)*2),y=b.x+(v.x-b.x)*.5,S=b.y+(v.y-b.y)*.5,F=b.z+(v.z-b.z)*.5,n(24,p.x+(y-p.x)*2,p.y+(S-p.y)*2,p.z+(F-p.z)*2);let j=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let i=e[3*a],o=e[3*a+2],l=1.3-Math.sqrt(i*i+o*o)/t;l<.4?l=0:l>.8&&(l=1),r[a]=l}return r}(T,e),_=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,i=r+5,o=i+1;_.push(r,i,o),_.push(r,o,a)}return w.setIndex(_),w.setAttribute("position",new i.Float32BufferAttribute(T,3)),w.setAttribute("uv",new i.Float32BufferAttribute(M,2)),w.setAttribute("alpha",new i.Float32BufferAttribute(j,1)),w.computeBoundingSphere(),w}(r,l,e,0)},[r,l]);(0,a.useEffect)(()=>()=>{h.dispose()},[h]);let p=(0,a.useMemo)(()=>new i.ShaderMaterial({uniforms:{cloudTexture:{value:g},uvOffset:{value:new i.Vector2(0,0)},debugMode:{value:+!!c},layerIndex:{value:u}},vertexShader:et,fragmentShader:er,transparent:!0,depthWrite:!1,side:i.DoubleSide}),[g,c,u]);return(0,a.useEffect)(()=>()=>{p.dispose()},[p]),(0,o.useFrame)(f?(e,t)=>{let r=1e3*t/32;m.current??=new i.Vector2(0,0),m.current.x+=s.x*n*r,m.current.y+=s.y*n*r,m.current.x-=Math.floor(m.current.x),m.current.y-=Math.floor(m.current.y),p.uniforms.uvOffset.value.copy(m.current)}:J),(0,t.jsx)("mesh",{geometry:h,frustumCulled:!1,renderOrder:10,children:(0,t.jsx)("primitive",{object:p,attach:"material"})})}function ei(e){var l;let n,s,u,c,f,d,m,g,h,p,x,y=(0,r.c)(18),{scene:S}=e,{data:F}=(l=S.materialList||void 0,(p=(0,r.c)(7))[0]!==l?(m=["detailMapList",l],g=()=>(0,b.loadDetailMapList)(l),p[0]=l,p[1]=m,p[2]=g):(m=p[1],g=p[2]),x=!!l,p[3]!==m||p[4]!==g||p[5]!==x?(h={queryKey:m,queryFn:g,enabled:x},p[3]=m,p[4]=g,p[5]=x,p[6]=h):h=p[6],(0,v.useQuery)(h)),w=.95*(S.visibleDistance>0?S.visibleDistance:500);y[0]!==S.cloudLayers?(n=S.cloudLayers.map(el),y[0]=S.cloudLayers,y[1]=n):n=y[1];let T=n;y[2]!==S.cloudLayers?(s=S.cloudLayers.map(eo),y[2]=S.cloudLayers,y[3]=s):s=y[3];let M=s;e:{let e,{x:t,y:r}=S.windVelocity;if(0!==t||0!==r){let e;y[4]!==t||y[5]!==r?(e=new i.Vector2(r,-t).normalize(),y[4]=t,y[5]=r,y[6]=e):e=y[6],u=e;break e}y[7]===Symbol.for("react.memo_cache_sentinel")?(e=new i.Vector2(1,0),y[7]=e):e=y[7],u=e}let D=u;t:{let e;if(!F){let e;y[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],y[8]=e):e=y[8],c=e;break t}if(y[9]!==M||y[10]!==T||y[11]!==F){e=[];for(let t=0;t<3;t++){let r=F[7+t];r&&e.push({texture:r,height:M[t],speed:T[t]})}y[9]=M,y[10]=T,y[11]=F,y[12]=e}else e=y[12];c=e}let C=c,j=(0,a.useRef)(null);return(y[13]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{let{camera:t}=e;j.current&&j.current.position.copy(t.position)},y[13]=f):f=y[13],(0,o.useFrame)(f),C&&0!==C.length)?(y[14]!==C||y[15]!==w||y[16]!==D?(d=(0,t.jsx)("group",{ref:j,children:C.map((e,r)=>{let i=(0,b.textureToUrl)(e.texture);return(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ea,{textureUrl:i,radius:w,heightPercent:e.height,speed:e.speed,windDirection:D,layerIndex:r})},r)})}),y[14]=C,y[15]=w,y[16]=D,y[17]=d):d=y[17],d):null}function eo(e,t){return e.heightPercent||[.35,.25,.2][t]}function el(e,t){return e.speed||[1e-4,2e-4,3e-4][t]}e.i(62395);let en=!1;function es(e){return[new i.Color().setRGB(e.r,e.g,e.b),new i.Color().setRGB(e.r,e.g,e.b).convertSRGBToLinear()]}function eu({skyBoxFiles:e,fogColor:r,fogState:o}){let{camera:l}=(0,p.useThree)(),n=Z(e,{path:""}),s=!!r,u=(0,a.useMemo)(()=>l.projectionMatrixInverse,[l]),c=(0,a.useMemo)(()=>o?(0,D.packFogVolumeData)(o.fogVolumes):new Float32Array(12),[o]),f=(0,a.useRef)({skybox:{value:n},fogColor:{value:r??new i.Color(0,0,0)},enableFog:{value:s},inverseProjectionMatrix:{value:u},cameraMatrixWorld:{value:l.matrixWorld},cameraHeight:D.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),d=(0,a.useMemo)(()=>{if(!o)return .18;let e=.95*o.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[o]);return(0,a.useEffect)(()=>{f.current.skybox.value=n,f.current.fogColor.value=r??new i.Color(0,0,0),f.current.enableFog.value=s,f.current.fogVolumeData.value=c,f.current.horizonFogHeight.value=d},[n,r,s,c,d]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:f.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform samplerCube skybox; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - // shaderMaterial does NOT get automatic linear->sRGB output conversion - // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear - vec4 skyColor = textureCube(skybox, direction); - vec3 finalColor; - - if (enableFog) { - vec3 effectiveFogColor = fogColor; - - // Calculate how much fog volume the ray passes through - // For skybox at "infinite" distance, the relevant height is how much - // of the volume is above/below camera depending on view direction - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // Check if camera is inside this volume - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - // Camera is inside the fog volume - // Looking horizontally or up at shallow angles means ray travels - // through more fog before exiting the volume - float heightAboveCamera = volMaxH - cameraHeight; - float heightBelowCamera = cameraHeight - volMinH; - float volumeHeight = volMaxH - volMinH; - - // For horizontal rays (direction.y ≈ 0), maximum fog influence - // For rays going up steeply, less fog (exits volume quickly) - // For rays going down, more fog (travels through volume below) - float rayInfluence; - if (direction.y >= 0.0) { - // Looking up: influence based on how steep we're looking - // Shallow angles = long path through fog = high influence - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - // Looking down: always high fog (into the volume) - rayInfluence = 1.0; - } - - // Scale by percentage and volume depth factor - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction (for haze at horizon) - // In Torque, the fog "bans" (bands) are rendered as geometry from - // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. - // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). - // - // horizonFogHeight is the direction.y value where the fog band ends: - // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) - // - // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 - // - // Torque renders the fog bands as geometry with linear vertex alpha - // interpolation. We use a squared curve (t^2) to create a gentler - // falloff at the top of the gradient, matching Tribes 2's appearance. - float baseFogFactor; - if (direction.y <= 0.0) { - // Looking at or below horizon: full fog - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - // Above fog band: no fog - baseFogFactor = 0.0; - } else { - // Within fog band: squared curve for gentler falloff at top - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - // When inside a volume, increase fog intensity - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); - } else { - finalColor = skyColor.rgb; - } - // Convert linear result to sRGB for display - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function ec(e){let a,i,o,l,n=(0,r.c)(6),{materialList:s,fogColor:u,fogState:c}=e,{data:f}=((l=(0,r.c)(2))[0]!==s?(o={queryKey:["detailMapList",s],queryFn:()=>(0,b.loadDetailMapList)(s)},l[0]=s,l[1]=o):o=l[1],(0,v.useQuery)(o));n[0]!==f?(a=f?[(0,b.textureToUrl)(f[1]),(0,b.textureToUrl)(f[3]),(0,b.textureToUrl)(f[4]),(0,b.textureToUrl)(f[5]),(0,b.textureToUrl)(f[0]),(0,b.textureToUrl)(f[2])]:null,n[0]=f,n[1]=a):a=n[1];let d=a;return d?(n[2]!==u||n[3]!==c||n[4]!==d?(i=(0,t.jsx)(eu,{skyBoxFiles:d,fogColor:u,fogState:c}),n[2]=u,n[3]=c,n[4]=d,n[5]=i):i=n[5],i):null}function ef({skyColor:e,fogColor:r,fogState:o}){let{camera:l}=(0,p.useThree)(),n=!!r,s=(0,a.useMemo)(()=>l.projectionMatrixInverse,[l]),u=(0,a.useMemo)(()=>o?(0,D.packFogVolumeData)(o.fogVolumes):new Float32Array(12),[o]),c=(0,a.useMemo)(()=>{if(!o)return .18;let e=.95*o.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[o]),f=(0,a.useRef)({skyColor:{value:e},fogColor:{value:r??new i.Color(0,0,0)},enableFog:{value:n},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:l.matrixWorld},cameraHeight:D.globalFogUniforms.cameraHeight,fogVolumeData:{value:u},horizonFogHeight:{value:c}});return(0,a.useEffect)(()=>{f.current.skyColor.value=e,f.current.fogColor.value=r??new i.Color(0,0,0),f.current.enableFog.value=n,f.current.fogVolumeData.value=u,f.current.horizonFogHeight.value=c},[e,r,n,u,c]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:f.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform vec3 skyColor; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - - vec3 finalColor; - - if (enableFog) { - // Calculate volume fog influence (same logic as SkyBoxTexture) - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float rayInfluence; - if (direction.y >= 0.0) { - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - rayInfluence = 1.0; - } - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction - float baseFogFactor; - if (direction.y <= 0.0) { - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - baseFogFactor = 0.0; - } else { - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor, fogColor, finalFogFactor); - } else { - finalColor = skyColor; - } - - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function ed(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function em({fogState:e,enabled:t}){let{scene:r,camera:l}=(0,p.useThree)(),n=(0,a.useRef)(null),s=(0,a.useMemo)(()=>(0,D.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,a.useEffect)(()=>{en||((0,M.installCustomFogShader)(),en=!0)},[]),(0,a.useEffect)(()=>{(0,D.resetGlobalFogUniforms)();let[t,a]=ed(e,l.position.y),o=new i.Fog(e.fogColor,t,a);return r.fog=o,n.current=o,(0,D.updateGlobalFogUniforms)(l.position.y,s),()=>{r.fog=null,n.current=null,(0,D.resetGlobalFogUniforms)()}},[r,l,e,s]),(0,a.useEffect)(()=>{let r=n.current;if(r)if(t){let[t,a]=ed(e,l.position.y);r.near=t,r.far=a}else r.near=1e10,r.far=1e10},[t,e,l.position.y]),(0,o.useFrame)(()=>{let r=n.current;if(!r)return;let a=l.position.y;if((0,D.updateGlobalFogUniforms)(a,s,t),t){let[t,i]=ed(e,a);r.near=t,r.far=i,r.color.copy(e.fogColor)}}),null}function eg({scene:e}){let{fogEnabled:r}=(0,d.useSettings)(),o=e.materialList||void 0,l=(0,a.useMemo)(()=>es(e.skySolidColor),[e.skySolidColor]),n=e.useSkyTextures,s=(0,a.useMemo)(()=>(function(e){let t=e.fogDistance,r=e.visibleDistance>0?e.visibleDistance:1e3,{r:a,g:o,b:l}=e.fogColor,n=new i.Color().setRGB(a,o,l).convertSRGBToLinear(),s=[];for(let t of e.fogVolumes)t.visibleDistance<=0||t.maxHeight<=t.minHeight||s.push({visibleDistance:t.visibleDistance,minHeight:t.minHeight,maxHeight:t.maxHeight,percentage:1});let u=s.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:t,visibleDistance:r,fogColor:n,fogVolumes:s,fogLine:u,enabled:r>t}})(e),[e]),u=(0,a.useMemo)(()=>es(e.fogColor),[e.fogColor]),c=l||u,f=s.enabled&&r,m=s.fogColor,{scene:g,gl:h}=(0,p.useThree)();(0,a.useEffect)(()=>{if(f){let e=m.clone();g.background=e,h.setClearColor(e)}else if(c){let e=c[0].clone();g.background=e,h.setClearColor(e)}else g.background=null;return()=>{g.background=null}},[g,h,f,m,c]);let v=l?.[1];return(0,t.jsxs)(t.Fragment,{children:[o&&n&&o.length>0?(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ec,{materialList:o,fogColor:f?m:void 0,fogState:f?s:void 0},o)}):v?(0,t.jsx)(ef,{skyColor:v,fogColor:f?m:void 0,fogState:f?s:void 0}):null,(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ei,{scene:e})}),s.enabled?(0,t.jsx)(em,{fogState:s,enabled:r}):null]})}let eh=(0,a.lazy)(()=>e.A(30814).then(e=>({default:e.PlayerModel}))),ep=(0,a.lazy)(()=>e.A(44325).then(e=>({default:e.ExplosionShape}))),ev=(0,a.lazy)(()=>e.A(62125).then(e=>({default:e.TracerProjectile}))),ex=(0,a.lazy)(()=>e.A(62125).then(e=>({default:e.SpriteProjectile}))),eb=(0,a.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),ey=(0,a.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),eS=(0,a.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),eF={1:"Storm",2:"Inferno"},ew=(0,a.memo)(function(e){let i=(0,r.c)(26),{entity:o}=e;switch(o.renderType){case"Shape":{let e;return i[0]!==o?(e=(0,t.jsx)(eT,{entity:o}),i[0]=o,i[1]=e):e=i[1],e}case"ForceFieldBare":{let e;return i[2]!==o?(e=(0,t.jsx)(eM,{entity:o}),i[2]=o,i[3]=e):e=i[3],e}case"Player":{let e;return i[4]!==o?(e=(0,t.jsx)(eD,{entity:o}),i[4]=o,i[5]=e):e=i[5],e}case"Explosion":{let e;return i[6]!==o?(e=(0,t.jsx)(eC,{entity:o}),i[6]=o,i[7]=e):e=i[7],e}case"Tracer":{let e;return i[8]!==o?(e=(0,t.jsx)(ej,{entity:o}),i[8]=o,i[9]=e):e=i[9],e}case"Sprite":{let e;return i[10]!==o?(e=(0,t.jsx)(e_,{entity:o}),i[10]=o,i[11]=e):e=i[11],e}case"AudioEmitter":{let e;return i[12]!==o?(e=(0,t.jsx)(ek,{entity:o}),i[12]=o,i[13]=e):e=i[13],e}case"Camera":{let e;return i[14]!==o?(e=(0,t.jsx)(g,{entity:o}),i[14]=o,i[15]=e):e=i[15],e}case"WayPoint":{let e;return i[16]!==o?(e=(0,t.jsx)(h,{entity:o}),i[16]=o,i[17]=e):e=i[17],e}case"TerrainBlock":{let e;return i[18]!==o.terrainData?(e=(0,t.jsx)(L,{scene:o.terrainData}),i[18]=o.terrainData,i[19]=e):e=i[19],e}case"InteriorInstance":{let e;return i[20]!==o.interiorData?(e=(0,t.jsx)(Y,{scene:o.interiorData}),i[20]=o.interiorData,i[21]=e):e=i[21],e}case"Sky":{let e;return i[22]!==o.skyData?(e=(0,t.jsx)(eg,{scene:o.skyData}),i[22]=o.skyData,i[23]=e):e=i[23],e}case"Sun":case"MissionArea":case"None":return null;case"WaterBlock":{let e;return i[24]!==o.waterData?(e=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(eS,{scene:o.waterData})}),i[24]=o.waterData,i[25]=e):e=i[25],e}}});function eT(e){let i,l,n,s,m,g,h=(0,r.c)(21),{entity:p}=e,{animationEnabled:v}=(0,d.useSettings)(),x=(0,a.useRef)(null);if(h[0]!==v||h[1]!==p.rotate?(i=()=>{if(!x.current||!p.rotate||!v)return;let e=performance.now()/1e3;x.current.rotation.y=e/3*Math.PI*2},h[0]=v,h[1]=p.rotate,h[2]=i):i=h[2],(0,o.useFrame)(i),!p.shapeName)return null;let b=p.runtimeObject,y=p.shapeType??"StaticShape",S=p.dataBlock?.toLowerCase()==="flag",F=p.teamId&&p.teamId>0?eF[p.teamId]:null,w=S&&F?`${F} Flag`:null,T="Item"===p.shapeType?"pink":p.threads?"#00ff88":"yellow",M=p.rotate?x:void 0,D=b?void 0:p;return h[3]!==w?(l=w?(0,t.jsx)(f.FloatingLabel,{opacity:.6,children:w}):null,h[3]=w,h[4]=l):l=h[4],h[5]!==T||h[6]!==D||h[7]!==l?(n=(0,t.jsx)(u.ShapeRenderer,{loadingColor:T,streamEntity:D,children:l}),h[5]=T,h[6]=D,h[7]=l,h[8]=n):n=h[8],h[9]!==p.barrelShapeName||h[10]!==b?(s=p.barrelShapeName&&(0,t.jsx)(c.ShapeInfoProvider,{object:b,shapeName:p.barrelShapeName,type:"Turret",children:(0,t.jsx)("group",{position:[0,1.5,0],children:(0,t.jsx)(u.ShapeRenderer,{})})}),h[9]=p.barrelShapeName,h[10]=b,h[11]=s):s=h[11],h[12]!==M||h[13]!==n||h[14]!==s?(m=(0,t.jsxs)("group",{ref:M,children:[n,s]}),h[12]=M,h[13]=n,h[14]=s,h[15]=m):m=h[15],h[16]!==p.shapeName||h[17]!==y||h[18]!==m||h[19]!==b?(g=(0,t.jsx)(c.ShapeInfoProvider,{object:b,shapeName:p.shapeName,type:y,children:m}),h[16]=p.shapeName,h[17]=y,h[18]=m,h[19]=b,h[20]=g):g=h[20],g}function eM(e){let i,o=(0,r.c)(2),{entity:l}=e;return l.forceFieldData?(o[0]!==l.forceFieldData?(i=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(eb,{data:l.forceFieldData,scale:l.forceFieldData.dimensions})}),o[0]=l.forceFieldData,o[1]=i):i=o[1],i):null}function eD(e){let i,o=(0,r.c)(2),{entity:l}=e;return l.shapeName?(o[0]!==l?(i=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(eh,{entity:l})}),o[0]=l,o[1]=i):i=o[1],i):null}function eC(e){let i,o,l,n=(0,r.c)(10),{entity:u}=e;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.streamPlaybackStore.getState(),n[0]=i):i=n[0];let c=i.playback;n[1]!==u.explosionDataBlockId||n[2]!==u.faceViewer||n[3]!==u.id||n[4]!==u.position||n[5]!==u.rotation||n[6]!==u.shapeName?(o={id:u.id,type:"Explosion",dataBlock:u.shapeName,position:u.position,rotation:u.rotation,faceViewer:u.faceViewer,explosionDataBlockId:u.explosionDataBlockId},n[1]=u.explosionDataBlockId,n[2]=u.faceViewer,n[3]=u.id,n[4]=u.position,n[5]=u.rotation,n[6]=u.shapeName,n[7]=o):o=n[7];let f=o;return u.shapeName&&c?(n[8]!==f?(l=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ep,{entity:f,playback:c})}),n[8]=f,n[9]=l):l=n[9],l):null}function ej(e){let i,o=(0,r.c)(2),{entity:l}=e;return o[0]!==l?(i=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ev,{entity:l,visual:l.visual})}),o[0]=l,o[1]=i):i=o[1],i}function e_(e){let i,o=(0,r.c)(2),{entity:l}=e;return o[0]!==l.visual?(i=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ex,{visual:l.visual})}),o[0]=l.visual,o[1]=i):i=o[1],i}function ek(e){let i,o=(0,r.c)(2),{entity:l}=e,{audioEnabled:n}=(0,d.useSettings)();return l.audioFileName&&n?(o[0]!==l?(i=(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ey,{entity:l})}),o[0]=l,o[1]=i):i=o[1],i):null}var eR=e.i(60099),eB=e.i(85557),eL=e.i(29418);let eG=(0,b.textureToUrl)("gui/hud_alliedtriangle"),ez=(0,b.textureToUrl)("gui/hud_enemytriangle"),eU=new i.Vector3;function eN(e){let l,n,c,f,d,m,g=(0,r.c)(23),{entity:h}=e,v=(0,u.useStaticShape)(h.shapeName??h.dataBlock),{camera:x}=(0,p.useThree)(),b=(0,a.useRef)(null),y=(0,a.useRef)(null),S=(0,a.useRef)(null),F=(0,a.useRef)(null),w=(0,a.useRef)(null),[T,M]=(0,a.useState)(!0),D=(0,a.useRef)(null);g[0]!==v.scene?(l=new i.Box3().setFromObject(v.scene),g[0]=v.scene,g[1]=l):l=g[1];let C=l.max.y+.1;g[2]!==h.keyframes?(n=h.keyframes??[],g[2]=h.keyframes,g[3]=n):n=g[3];let j=n;g[4]!==j?(c=j.some(eI),g[4]=j,g[5]=c):c=g[5];let _=c;g[6]!==x||g[7]!==h.id||g[8]!==h.iffColor||g[9]!==h.playerName||g[10]!==_||g[11]!==T||g[12]!==j?(f=()=>{let e=b.current;if(!e)return;e.getWorldPosition(eU);let t=x.position.distanceTo(eU),r=x.matrixWorld.elements,a=!(-((eU.x-r[12])*r[8])+-((eU.y-r[13])*r[9])+-((eU.z-r[14])*r[10])<0)&&t<150;if(T!==a&&M(a),!a)return;let i=(0,eB.getKeyframeAtTime)(j,s.streamPlaybackStore.getState().time),o=i?.health??1;if(i?.damageState!=null&&i.damageState>=1){y.current&&(y.current.style.opacity="0"),S.current&&(S.current.style.opacity="0");return}let l=Math.max(0,Math.min(1,1-t/150)).toString();if(y.current&&(y.current.style.opacity=l),S.current&&(S.current.style.opacity=l),D.current){let e=h.playerName??h.id;D.current.textContent!==e&&(D.current.textContent=e)}if(w.current&&h.iffColor){let e=h.iffColor.r>h.iffColor.g?ez:eG;w.current.getAttribute("src")!==e&&(w.current.src=e)}F.current&&_&&(F.current.style.width=`${Math.max(0,Math.min(100,100*o))}%`,F.current.style.background=h.iffColor?`rgb(${h.iffColor.r}, ${h.iffColor.g}, ${h.iffColor.b})`:"")},g[6]=x,g[7]=h.id,g[8]=h.iffColor,g[9]=h.playerName,g[10]=_,g[11]=T,g[12]=j,g[13]=f):f=g[13],(0,o.useFrame)(f);let k=h.iffColor&&h.iffColor.r>h.iffColor.g?ez:eG;return g[14]!==h.id||g[15]!==h.playerName||g[16]!==_||g[17]!==C||g[18]!==k||g[19]!==T?(d=T&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eR.Html,{position:[0,C,0],center:!0,children:(0,t.jsx)("div",{ref:y,className:eL.default.Top,children:(0,t.jsx)("img",{ref:w,className:eL.default.IffArrow,src:k,alt:""})})}),(0,t.jsx)(eR.Html,{position:[0,-.2,0],center:!0,children:(0,t.jsxs)("div",{ref:S,className:eL.default.Bottom,children:[(0,t.jsx)("div",{ref:D,className:eL.default.Name,children:h.playerName??h.id}),_&&(0,t.jsx)("div",{className:eL.default.HealthBar,children:(0,t.jsx)("div",{ref:F,className:eL.default.HealthFill})})]})})]}),g[14]=h.id,g[15]=h.playerName,g[16]=_,g[17]=C,g[18]=k,g[19]=T,g[20]=d):d=g[20],g[21]!==d?(m=(0,t.jsx)("group",{ref:b,children:d}),g[21]=d,g[22]=m):m=g[22],m}function eI(e){return null!=e.health}var eA=e.i(78779);let eE=(0,b.textureToUrl)("commander/MiniIcons/com_flag_grey"),eP=new i.Vector3;function eH(e){let i,l,n,s,u,c=(0,r.c)(9),{entity:f}=e,d=(0,a.useRef)(null),m=(0,a.useRef)(null),g=(0,a.useRef)(null),{camera:h}=(0,p.useThree)();c[0]!==h||c[1]!==f.iffColor?(i=()=>{if(m.current&&f.iffColor){let{r:e,g:t,b:r}=f.iffColor;m.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(g.current&&d.current){d.current.getWorldPosition(eP);let e=h.position.distanceTo(eP);g.current.textContent=e.toFixed(1)}},c[0]=h,c[1]=f.iffColor,c[2]=i):i=c[2],(0,o.useFrame)(i);let v=f.iffColor?`rgb(${f.iffColor.r},${f.iffColor.g},${f.iffColor.b})`:"rgb(200,200,200)";c[3]===Symbol.for("react.memo_cache_sentinel")?(l=[0,1.5,0],c[3]=l):l=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("span",{ref:g,className:eA.default.Distance}),c[4]=n):n=c[4],c[5]!==v?(s={backgroundColor:v,"--flag-icon-url":`url(${eE})`},c[5]=v,c[6]=s):s=c[6];let x=s;return c[7]!==x?(u=(0,t.jsx)("group",{ref:d,children:(0,t.jsx)(eR.Html,{position:l,center:!0,children:(0,t.jsxs)("div",{className:eA.default.Root,children:[n,(0,t.jsx)("div",{ref:m,className:eA.default.Icon,style:x})]})})}),c[7]=x,c[8]=u):u=c[8],u}var eV=e.i(58647);let eq=(0,a.lazy)(()=>e.A(44325).then(e=>({default:e.WeaponModel})));function e$(e){let a,i=(0,r.c)(3),{missionType:o}=e,l=(0,d.useDebug)(),n=l?.debugMode??!1;return i[0]!==n||i[1]!==o?(a=(0,t.jsx)("group",{ref:eW,children:(0,t.jsx)(eO,{missionType:o,debugMode:n})}),i[0]=n,i[1]=o,i[2]=a):a=i[2],a}function eW(e){s.streamPlaybackStore.setState({root:e})}let eO=(0,a.memo)(function({missionType:e,debugMode:r}){let i=(0,l.useAllGameEntities)(),o=(0,a.useRef)(new Map).current,n=new Set;for(let e of i)n.add(e.id),o.set(e.id,e);for(let e of o.keys())n.has(e)||o.delete(e);let s=(0,a.useMemo)(()=>{let t=[],r=e?.toLowerCase();for(let e of o.values()){if(r&&e.missionTypesList){let t=new Set(e.missionTypesList.toLowerCase().split(/\s+/).filter(Boolean));if(t.size>0&&!t.has(r))continue}t.push(e)}return t},[i,e]);return(0,t.jsx)(t.Fragment,{children:s.map(e=>(0,t.jsx)(eY,{entity:e,debugMode:r},e.id))})}),eY=(0,a.memo)(function(e){let a,i=(0,r.c)(8),{entity:o,debugMode:l}=e;if((0,n.isSceneEntity)(o)){let e,r;return i[0]!==o?(e=(0,t.jsx)(ew,{entity:o}),i[0]=o,i[1]=e):e=i[1],i[2]!==o.id||i[3]!==e?(r=(0,t.jsx)("group",{name:o.id,children:e}),i[2]=o.id,i[3]=e,i[4]=r):r=i[4],r}return"None"===o.renderType?null:(i[5]!==l||i[6]!==o?(a=(0,t.jsx)(eZ,{entity:o,debugMode:l}),i[5]=l,i[6]=o,i[7]=a):a=i[7],a)});function eK(e){let a,i=(0,r.c)(2),{entity:o}=e,l=(0,eV.useEngineSelector)(eQ);return o.id===l?null:(i[0]!==o?(a=(0,t.jsx)(eN,{entity:o}),i[0]=o,i[1]=a):a=i[1],a)}function eQ(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function eX({entity:e}){let r=(0,a.useRef)(!1),[i,l]=(0,a.useState)(()=>((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0);return(r.current=i,(0,o.useFrame)(()=>{let t=((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0;t!==r.current&&(r.current=t,l(t))}),i)?(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(eH,{entity:e})}):null}function eZ(e){let o,l,n,s,u,c,f,d,m,g,h,p=(0,r.c)(56),{entity:v,debugMode:x}=e,b=v.position,y=v.scale;e:{let e;if(!v.rotation){o=void 0;break e}p[0]!==v.rotation?(e=new i.Quaternion(...v.rotation),p[0]=v.rotation,p[1]=e):e=p[1],o=e}let S=o,F="Player"===v.renderType;if("Shape"===v.renderType&&!v.shapeName){let e,r,a,i,o,l,n=v.id;return p[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("sphereGeometry",{args:[.3,6,4]}),p[2]=e):e=p[2],p[3]!==v.className?(r=(0,eB.entityTypeColor)(v.className),p[3]=v.className,p[4]=r):r=p[4],p[5]!==r?(a=(0,t.jsxs)("mesh",{children:[e,(0,t.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),p[5]=r,p[6]=a):a=p[6],p[7]!==x||p[8]!==v?(i=x&&(0,t.jsx)(eJ,{entity:v}),p[7]=x,p[8]=v,p[9]=i):i=p[9],p[10]!==v?(o=(0,t.jsx)(eX,{entity:v}),p[10]=v,p[11]=o):o=p[11],p[12]!==v.id||p[13]!==b||p[14]!==S||p[15]!==y||p[16]!==a||p[17]!==i||p[18]!==o?(l=(0,t.jsxs)("group",{name:n,position:b,quaternion:S,scale:y,children:[a,i,o]}),p[12]=v.id,p[13]=b,p[14]=S,p[15]=y,p[16]=a,p[17]=i,p[18]=o,p[19]=l):l=p[19],l}p[20]!==v.className||p[21]!==v.renderType?(l="Explosion"===v.renderType?null:(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.5,8,6]}),(0,t.jsx)("meshBasicMaterial",{color:(0,eB.entityTypeColor)(v.className),wireframe:!0})]}),p[20]=v.className,p[21]=v.renderType,p[22]=l):l=p[22];let w=l,T="shapeName"in v?v.shapeName:void 0,M="weaponShape"in v?v.weaponShape:void 0;return p[23]!==v?(n=(0,t.jsx)(ew,{entity:v}),p[23]=v,p[24]=n):n=p[24],p[25]!==w||p[26]!==n?(s=(0,t.jsx)(a.Suspense,{fallback:w,children:n}),p[25]=w,p[26]=n,p[27]=s):s=p[27],p[28]!==w||p[29]!==s?(u=(0,t.jsx)(e0,{fallback:w,children:s}),p[28]=w,p[29]=s,p[30]=u):u=p[30],p[31]!==v||p[32]!==F?(c=F&&(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(eK,{entity:v})}),p[31]=v,p[32]=F,p[33]=c):c=p[33],p[34]!==v?(f=(0,t.jsx)(eX,{entity:v}),p[34]=v,p[35]=f):f=p[35],p[36]!==x||p[37]!==v||p[38]!==T?(d=x&&!T&&"Shape"!==v.renderType&&(0,t.jsx)(eJ,{entity:v}),p[36]=x,p[37]=v,p[38]=T,p[39]=d):d=p[39],p[40]!==u||p[41]!==c||p[42]!==f||p[43]!==d?(m=(0,t.jsxs)("group",{name:"model",children:[u,c,f,d]}),p[40]=u,p[41]=c,p[42]=f,p[43]=d,p[44]=m):m=p[44],p[45]!==F||p[46]!==T||p[47]!==M?(g=M&&T&&!F&&(0,t.jsx)("group",{name:"weapon",children:(0,t.jsx)(e0,{fallback:null,children:(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(eq,{shapeName:M,playerShapeName:T})})})}),p[45]=F,p[46]=T,p[47]=M,p[48]=g):g=p[48],p[49]!==v.id||p[50]!==b||p[51]!==S||p[52]!==y||p[53]!==g||p[54]!==m?(h=(0,t.jsxs)("group",{name:v.id,position:b,quaternion:S,scale:y,children:[m,g]}),p[49]=v.id,p[50]=b,p[51]=S,p[52]=y,p[53]=g,p[54]=m,p[55]=h):h=p[55],h}function eJ(e){let a,i,o=(0,r.c)(8),{entity:l}=e;o[0]!==l.className||o[1]!==l.dataBlockId||o[2]!==l.ghostIndex||o[3]!==l.id||o[4]!==l.shapeHint?((a=[]).push(`${l.id} (${l.className})`),"number"==typeof l.ghostIndex&&a.push(`ghost ${l.ghostIndex}`),"number"==typeof l.dataBlockId&&a.push(`db ${l.dataBlockId}`),a.push(l.shapeHint?`shapeHint ${l.shapeHint}`:"shapeHint "),o[0]=l.className,o[1]=l.dataBlockId,o[2]=l.ghostIndex,o[3]=l.id,o[4]=l.shapeHint,o[5]=a):a=o[5];let n=a.join(" | ");return o[6]!==n?(i=(0,t.jsx)(f.FloatingLabel,{color:"#ff6688",children:n}),o[6]=n,o[7]=i):i=o[7],i}class e0 extends a.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.warn("[entity] Shape load failed:",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["EntityScene",()=>e$,"ShapeErrorBoundary",()=>e0],87297)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/ca289845e0f08110.js b/docs/_next/static/chunks/ca289845e0f08110.js deleted file mode 100644 index 24b4d621..00000000 --- a/docs/_next/static/chunks/ca289845e0f08110.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78462,e=>{e.v({PlayPause:"DemoPlaybackControls-module__A_AHSq__PlayPause",Root:"DemoPlaybackControls-module__A_AHSq__Root",Seek:"DemoPlaybackControls-module__A_AHSq__Seek",Speed:"DemoPlaybackControls-module__A_AHSq__Speed",Time:"DemoPlaybackControls-module__A_AHSq__Time"})},94737,e=>{"use strict";var t=e.i(43476),a=e.i(932),o=e.i(71645),n=e.i(32865),l=e.i(78462);let r=[.25,.5,1,2,4];function s(e){let t=Math.floor(e/60),a=Math.floor(e%60);return`${t}:${a.toString().padStart(2,"0")}`}function i(){let e,i,_,p,P,f,g,y,S,b,A,C,k=(0,a.c)(33),T=(0,n.useRecording)(),h=(0,n.useIsPlaying)(),v=(0,n.useCurrentTime)(),N=(0,n.useDuration)(),D=(0,n.useSpeed)(),{play:w,pause:x,seek:E,setSpeed:j}=(0,n.usePlaybackActions)();k[0]!==h||k[1]!==x||k[2]!==w||k[3]!==T?(e=()=>{if(!T)return;let e=e=>{if("Space"!==e.code)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||"BUTTON"===t.tagName||t.isContentEditable||(e.preventDefault(),h?x():w())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},i=[T,h,w,x],k[0]=h,k[1]=x,k[2]=w,k[3]=T,k[4]=e,k[5]=i):(e=k[4],i=k[5]),(0,o.useEffect)(e,i),k[6]!==E?(_=e=>{E(parseFloat(e.target.value))},k[6]=E,k[7]=_):_=k[7];let R=_;k[8]!==j?(p=e=>{j(parseFloat(e.target.value))},k[8]=j,k[9]=p):p=k[9];let q=p;if(!T||!Number.isFinite(T.duration))return null;let H=h?x:w,U=h?"Pause":"Play",$=h?"❚❚":"▶";k[10]!==H||k[11]!==U||k[12]!==$?(P=(0,t.jsx)("button",{className:l.default.PlayPause,onClick:H,"aria-label":U,children:$}),k[10]=H,k[11]=U,k[12]=$,k[13]=P):P=k[13],k[14]!==v?(f=s(v),k[14]=v,k[15]=f):f=k[15],k[16]!==N?(g=s(N),k[16]=N,k[17]=g):g=k[17];let B=`${f} / ${g}`;return k[18]!==B?(y=(0,t.jsx)("span",{className:l.default.Time,children:B}),k[18]=B,k[19]=y):y=k[19],k[20]!==v||k[21]!==N||k[22]!==R?(S=(0,t.jsx)("input",{className:l.default.Seek,type:"range",min:0,max:N,step:.01,value:v,onChange:R}),k[20]=v,k[21]=N,k[22]=R,k[23]=S):S=k[23],k[24]===Symbol.for("react.memo_cache_sentinel")?(b=r.map(u),k[24]=b):b=k[24],k[25]!==q||k[26]!==D?(A=(0,t.jsx)("select",{className:l.default.Speed,value:D,onChange:q,children:b}),k[25]=q,k[26]=D,k[27]=A):A=k[27],k[28]!==y||k[29]!==S||k[30]!==A||k[31]!==P?(C=(0,t.jsxs)("div",{className:l.default.Root,onKeyDown:m,onPointerDown:d,onClick:c,children:[P,y,S,A]}),k[28]=y,k[29]=S,k[30]=A,k[31]=P,k[32]=C):C=k[32],C}function u(e){return(0,t.jsxs)("option",{value:e,children:[e,"x"]},e)}function c(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}function m(e){return e.stopPropagation()}e.s(["DemoPlaybackControls",()=>i])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/d16b6f1b4eacbf2b.js b/docs/_next/static/chunks/d16b6f1b4eacbf2b.js deleted file mode 100644 index 36aa7e67..00000000 --- a/docs/_next/static/chunks/d16b6f1b4eacbf2b.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60505,e=>{"use strict";var t=e.i(932),r=e.i(71645),n=e.i(71753),c=e.i(15080),i=e.i(90072),o=e.i(12631),a=e.i(98755),u=e.i(58647),l=e.i(93784),m=e.i(5729),s=e.i(79123),d=e.i(51475),v=e.i(89119);let p=1/d.TICK_RATE,y=new i.Vector3,E=new i.Vector3;function h(){let e,i,h,w,T,b,M,P,L,_,O,R,I,A,C=(0,t.c)(27),k=(0,a.useLiveSelector)(S),K=(0,a.useLiveSelector)(g),z=(0,a.useLiveSelector)(f),X=(0,u.useEngineStoreApi)(),{speedMultiplier:Y}=(0,s.useControls)(),N=(0,r.useRef)(null),{gl:x}=(0,c.useThree)(),[,H]=(0,o.useKeyboardControls)(),D=(0,r.useRef)(0),U=(0,r.useRef)(0);C[0]===Symbol.for("react.memo_cache_sentinel")?(e={yaw:0,pitch:0,prevYaw:0,prevPitch:0,initialized:!1,lastSyncedCamera:null},C[0]=e):e=C[0];let V=(0,r.useRef)(e),W=(0,r.useRef)(0);return C[1]!==k||C[2]!==K||C[3]!==X?(i=()=>{k&&("connected"===K||"authenticating"===K)?N.current!==k&&(console.log("[LiveObserver] wiring adapter to engine store"),X.getState().setRecording({source:"live",duration:1/0,missionName:null,gameType:null,streamingPlayback:k}),X.getState().setPlaybackStatus("playing"),N.current=k,V.current.initialized=!1,V.current.lastSyncedCamera=null):!k&&N.current&&(X.getState().setRecording(null),N.current=null,V.current.initialized=!1)},h=[k,K,X],C[1]=k,C[2]=K,C[3]=X,C[4]=i,C[5]=h):(i=C[4],h=C[5]),(0,r.useEffect)(i,h),C[6]!==x.domElement?(w=()=>{let e=!1,t=t=>{document.pointerLockElement?(D.current=D.current+.002*t.movementX,U.current=U.current+.002*t.movementY):e&&(D.current=D.current+t.movementX*m.MOUSE_SENSITIVITY,U.current=U.current+t.movementY*m.MOUSE_SENSITIVITY)},r=t=>{document.pointerLockElement||t.target!==x.domElement||(e=!0)},n=()=>{e=!1};return document.addEventListener("mousemove",t),document.addEventListener("mousedown",r),document.addEventListener("mouseup",n),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mousedown",r),document.removeEventListener("mouseup",n)}},T=[x.domElement],C[6]=x.domElement,C[7]=w,C[8]=T):(w=C[7],T=C[8]),(0,r.useEffect)(w,T),C[9]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{let e=e=>{document.pointerLockElement&&N.current&&"follow"===N.current.observerMode&&(e.stopImmediatePropagation(),N.current.cycleObserveNext())};return document.addEventListener("click",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0})}},C[9]=b):b=C[9],C[10]!==x.domElement?(M=[x.domElement],C[10]=x.domElement,C[11]=M):M=C[11],(0,r.useEffect)(b,M),C[12]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{let e=e=>{if("KeyO"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||N.current&&(N.current.toggleObserverMode(),console.log(`[LiveObserver] observer mode: ${N.current.observerMode}`))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},L=[],C[12]=P,C[13]=L):(P=C[12],L=C[13]),(0,r.useEffect)(P,L),C[14]!==K||C[15]!==H?(_=(e,t)=>{if(!N.current||"connected"!==K)return;let{lookUp:r,lookDown:n,lookLeft:c,lookRight:i}=H();i&&(D.current=D.current+m.ARROW_LOOK_SPEED*t),c&&(D.current=D.current-m.ARROW_LOOK_SPEED*t),n&&(U.current=U.current+m.ARROW_LOOK_SPEED*t),r&&(U.current=U.current-m.ARROW_LOOK_SPEED*t)},C[14]=K,C[15]=H,C[16]=_):_=C[16],(0,n.useFrame)(_),C[17]!==K||C[18]!==H||C[19]!==z||C[20]!==Y?(O=()=>{if(!N.current||"connected"!==K)return;let{forward:e,backward:t,left:r,right:n,up:c,down:i}=H(),o=0,a=0,u=0;e&&(a=1),t&&(a-=1),r&&(o=-1),n&&(o+=1),c&&(u=1),i&&(u-=1);let l=D.current,m=U.current;D.current=0,U.current=0;let s=V.current;s.prevYaw=s.yaw,s.prevPitch=s.pitch,s.yaw=s.yaw+l,s.pitch=Math.max(-v.MAX_PITCH,Math.min(v.MAX_PITCH,s.pitch+m)),W.current=0;let d=Math.min(1,Y);z({x:o*d,y:a*d,z:u*d,yaw:l,pitch:m,roll:0,trigger:[!1,!0,!1,!1,!1,!1],freeLook:!1})},C[17]=K,C[18]=H,C[19]=z,C[20]=Y,C[21]=O):O=C[21],(0,d.useTick)(O),C[22]!==K?(R=(e,t)=>{if(!N.current||"connected"!==K)return;let r=V.current,n=N.current.getSnapshot(),c=n?.camera;if(c&&c!==r.lastSyncedCamera&&"number"==typeof c.yaw&&"number"==typeof c.pitch){let e=D.current,t=U.current;r.prevYaw=r.initialized?r.yaw:c.yaw,r.prevPitch=r.initialized?r.pitch:c.pitch,r.yaw=c.yaw+e,r.pitch=Math.max(-v.MAX_PITCH,Math.min(v.MAX_PITCH,c.pitch+t)),r.lastSyncedCamera=c,r.initialized=!0}if(!r.initialized)return;W.current=W.current+t;let i=Math.min(1,W.current/p),o=r.prevYaw+(r.yaw-r.prevYaw)*i+D.current,a=Math.max(-v.MAX_PITCH,Math.min(v.MAX_PITCH,r.prevPitch+(r.pitch-r.prevPitch)*i+U.current)),[u,m,s,d]=(0,v.yawPitchToQuaternion)(o,a);if(c?.mode==="third-person"&&c.orbitTargetId){let t=l.streamPlaybackStore.getState().root,r=t?.children.find(e=>e.name===c.orbitTargetId);if(r){E.copy(r.position);let t=l.streamPlaybackStore.getState().entities.get(c.orbitTargetId);t?.renderType==="Player"&&(E.y=E.y+1);let n=Math.sin(a),i=Math.cos(a),u=Math.sin(o),m=Math.cos(o);if(y.set(-m*i,-n,u*i),y.lengthSq()>1e-8){y.normalize();let t=Math.max(.1,c.orbitDistance??4);e.camera.position.copy(E).addScaledVector(y,t),e.camera.lookAt(E)}}}else e.camera.quaternion.set(u,m,s,d)},C[22]=K,C[23]=R):R=C[23],(0,n.useFrame)(R,1),C[24]!==X?(I=()=>()=>{N.current&&(X.getState().setRecording(null),N.current=null)},A=[X],C[24]=X,C[25]=I,C[26]=A):(I=C[25],A=C[26]),(0,r.useEffect)(I,A),null}function f(e){return e.sendMove}function g(e){return e.gameStatus}function S(e){return e.adapter}e.s(["LiveObserver",()=>h])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e16c267496b8de91.js b/docs/_next/static/chunks/e16c267496b8de91.js deleted file mode 100644 index c0ca6a51..00000000 --- a/docs/_next/static/chunks/e16c267496b8de91.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(15080),o=e.i(71753),i=e.i(90072),u=e.i(12979),a=e.i(51434),c=e.i(79123),s=e.i(89887);e.i(13876);var l=e.i(58647);let f=new Map,d=new Map;function p(e,t=1){d.set(e,t)}function h(e){d.delete(e)}let y=0;function m(){return y}function g(){for(let[e]of(y++,d)){try{e.stop()}catch{}try{e.disconnect()}catch{}}d.clear()}function S(e,t){let r=t(e),n=r?.filename;if(!n)return null;let o=n.endsWith(".wav")?n:`${n}.wav`,i=r.description,u=null!=i?t(i):void 0,a=u?.is3D??!0,c=u?.isLooping??!1,s=u?.referenceDistance??20;return{filename:o,is3D:a,isLooping:c,refDist:s,maxDist:u?.maxDistance??100,volume:u?.volume??1}}function b(e,t,r,n,o){let a;try{a=(0,u.audioToUrl)(e.filename)}catch{return}let c=l.engineStore.getState().playback.rate,s=y;R(a,r,r=>{if(s===y)try{if(e.is3D&&o){let u=new i.PositionalAudio(t);u.setBuffer(r),u.setDistanceModel("inverse"),u.setRefDistance(e.refDist),u.setMaxDistance(e.maxDist),u.setRolloffFactor(1),u.setVolume(e.volume),u.setPlaybackRate(c),n&&u.position.copy(n),o.add(u),d.set(u,1),u.play(),u.source.onended=()=>{d.delete(u);try{u.disconnect()}catch{}o.remove(u)}}else{let n=new i.Audio(t);n.setBuffer(r),n.setVolume(e.volume),n.setPlaybackRate(c),d.set(n,1),n.play(),n.source.onended=()=>{d.delete(n);try{n.disconnect()}catch{}}}}catch{}})}function R(e,t,r){f.has(e)?r(f.get(e)):t.load(e,t=>{f.set(e,t),r(t)},void 0,t=>{console.error("Audio load error",e,t)})}l.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,r]of d)try{t.setPlaybackRate(r*e)}catch{}});let v=(0,r.memo)(function({entity:e}){let{debugMode:l}=(0,c.useDebug)(),f=e.audioFileName??"",d=e.audioVolume??1,p=e.audioMinDistance??1,h=e.audioMaxDistance??1,y=e.audioMinLoopGap??0,m=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,S=e.audioIsLooping??!0,[b,v,M]=e.position??[0,0,0],{scene:D,camera:k}=(0,n.useThree)(),{audioLoader:A,audioListener:P}=(0,a.useAudio)(),{audioEnabled:T}=(0,c.useSettings)(),w=(0,r.useRef)(null),x=(0,r.useRef)(null),B=(0,r.useRef)(null),E=(0,r.useRef)(!1),C=(0,r.useRef)(!1),G=(0,r.useRef)(new i.Vector3(b,v,M)),L=(0,r.useRef)(0),V=()=>{null!=x.current&&(clearTimeout(x.current),x.current=null),null!=B.current&&(clearTimeout(B.current),B.current=null)};(0,r.useEffect)(()=>{let e;if(A&&P){if(L.current++,g){let t=new i.PositionalAudio(P);t.position.copy(G.current),t.setDistanceModel("inverse"),t.setRefDistance(p),t.setMaxDistance(h),t.setRolloffFactor(1),t.setVolume(d),e=t,D.add(e)}else(e=new i.Audio(P)).setVolume(d);return w.current=e,()=>{V();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&D.remove(e),w.current=null,E.current=!1,C.current=!1}}},[A,P,g,p,h,d,D]);let j=(e,t)=>{if(S)if(y>0||m>0){let r=Math.max(0,y),n=Math.max(r,m),o=r===n?r:Math.random()*(n-r)+r;e.loop=!1;let i=()=>{t===L.current&&(!1===e.isPlaying?x.current=setTimeout(()=>{if(t===L.current)try{e.play(),j(e,t)}catch{}},o):B.current=setTimeout(i,100))};B.current=setTimeout(i,100)}else e.setLoop(!0)},F=e=>{if(!A)return;let t=L.current;if(E.current)try{e.isPlaying||(e.play(),j(e,t))}catch{}else{let r;try{r=(0,u.audioToUrl)(f)}catch{return}R(r,A,r=>{if(t===L.current&&!e.buffer){e.setBuffer(r),E.current=!0;try{e.play(),j(e,t)}catch{}}})}};return(0,r.useEffect)(()=>{let e=w.current;e&&!g&&T&&f&&F(e)},[T,g,f,A,P]),(0,o.useFrame)(()=>{let e=w.current;if(!e||!g||!T||!f)return;let t=k.position.distanceTo(G.current),r=C.current,n=t<=h;if(n&&!r)C.current=!0,F(e);else if(!n&&r){C.current=!1,V();try{e.stop()}catch{}}}),(0,r.useEffect)(()=>{let e=w.current;if(e&&!T){V();try{e.stop()}catch{}C.current=!1}},[T]),l?(0,t.jsxs)("mesh",{position:G.current,children:[(0,t.jsx)("sphereGeometry",{args:[p,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(s.FloatingLabel,{color:"#00ff00",position:[0,p+1,0],children:f})]}):null});e.s(["AudioEmitter",0,v,"audioBufferCache",0,f,"getCachedAudioBuffer",()=>R,"getSoundGeneration",()=>m,"playOneShotSound",()=>b,"resolveAudioProfile",()=>S,"stopAllTrackedSounds",()=>g,"trackSound",()=>p,"untrackSound",()=>h])},9962,e=>{"use strict";var t=e.i(71645),r=e.i(90072),n=e.i(12979),o=e.i(51434),i=e.i(29055),u=e.i(79123);e.i(13876);var a=e.i(58647);function c(){let{audioLoader:e,audioListener:c}=(0,o.useAudio)(),s=(0,u.useSettings)(),l=s?.audioEnabled??!1,f=(0,a.useEngineSelector)(e=>e.playback.streamSnapshot?.chatMessages),d=(0,a.useEngineSelector)(e=>e.playback.streamSnapshot?.timeSec),p=(0,t.useRef)(new WeakSet),h=(0,t.useRef)(new Map);return(0,t.useEffect)(()=>{if(!l||!e||!c||!f?.length||null==d)return;let t=p.current,o=h.current;for(let u of f){if(!t.has(u)){if((t.add(u),u.soundPath)&&!(Math.abs(d-u.timeSec)>2))try{let t=(0,n.audioToUrl)(u.soundPath),s=u.soundPitch??1,l=a.engineStore.getState().playback.rate,f=u.sender,d=(0,i.getSoundGeneration)();(0,i.getCachedAudioBuffer)(t,e,e=>{if(d!==(0,i.getSoundGeneration)())return;if(f){let e=o.get(f);if(e){try{e.stop()}catch{}(0,i.untrackSound)(e);try{e.disconnect()}catch{}o.delete(f)}}let t=new r.Audio(c);t.setBuffer(e),t.setPlaybackRate(s*l),(0,i.trackSound)(t,s),f&&o.set(f,t),t.play(),t.source.onended=()=>{(0,i.untrackSound)(t);try{t.disconnect()}catch{}f&&o.get(f)===t&&o.delete(f)}})}catch{}}}},[l,e,c,f,d]),null}e.s(["ChatSoundPlayer",()=>c])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e1a8caa90a5343cf.js b/docs/_next/static/chunks/e1a8caa90a5343cf.js deleted file mode 100644 index e1854e20..00000000 --- a/docs/_next/static/chunks/e1a8caa90a5343cf.js +++ /dev/null @@ -1,17 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92552,(e,t,r)=>{"use strict";let n,s;function i(e,t){return t.reduce((e,[t,r])=>({type:"BinaryExpression",operator:t,left:e,right:r}),e)}function o(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class a extends SyntaxError{constructor(e,t,r,n){super(e),this.expected=t,this.found=r,this.location=n,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null,n=e.find(e=>e.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));let s=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,o=this.location.source+":"+i.line+":"+i.column;if(r){let e=this.location.end,n="".padEnd(i.line.toString().length," "),a=r[s.line-1],l=(s.line===e.line?e.column:a.length+1)-s.column||1;t+="\n --> "+o+"\n"+n+" |\n"+i.line+" | "+a+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}let n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(e){return n?e.replace(n,e=>"\\u{"+r(e)+"}"):e}function i(e){return s(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function o(e){return s(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}let a={literal:e=>'"'+i(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r]/,k=/^[+\-]/,R=/^[%*\/]/,L=/^[!\-~]/,N=/^[a-zA-Z_]/,O=/^[a-zA-Z0-9_]/,I=/^[ \t]/,j=/^[^"\\\n\r]/,T=/^[^'\\\n\r]/,M=/^[0-9a-fA-F]/,B=/^[0-9]/,P=/^[xX]/,H=/^[^\n\r]/,D=/^[\n\r]/,F=/^[ \t\n\r]/,G=tE(";",!1),U=tE("package",!1),q=tE("{",!1),J=tE("}",!1),K=tE("function",!1),W=tE("(",!1),z=tE(")",!1),V=tE("::",!1),Z=tE(",",!1),Q=tE("datablock",!1),X=tE(":",!1),Y=tE("new",!1),ee=tE("[",!1),et=tE("]",!1),er=tE("=",!1),en=tE(".",!1),es=tE("if",!1),ei=tE("else",!1),eo=tE("for",!1),ea=tE("while",!1),el=tE("do",!1),eu=tE("switch$",!1),ec=tE("switch",!1),ep=tE("case",!1),ef=tE("default",!1),eh=tE("or",!1),ed=tE("return",!1),eg=tE("break",!1),em=tE("continue",!1),eb=tE("+=",!1),e$=tE("-=",!1),ey=tE("*=",!1),ex=tE("/=",!1),eA=tE("%=",!1),eC=tE("<<=",!1),eS=tE(">>=",!1),ev=tE("&=",!1),ew=tE("|=",!1),eE=tE("^=",!1),e_=tE("?",!1),ek=tE("||",!1),eR=tE("&&",!1),eL=tE("|",!1),eN=tE("^",!1),eO=tE("&",!1),eI=tE("==",!1),ej=tE("!=",!1),eT=tE("<=",!1),eM=tE(">=",!1),eB=t_(["<",">"],!1,!1,!1),eP=tE("$=",!1),eH=tE("!$=",!1),eD=tE("@",!1),eF=tE("NL",!1),eG=tE("TAB",!1),eU=tE("SPC",!1),eq=tE("<<",!1),eJ=tE(">>",!1),eK=t_(["+","-"],!1,!1,!1),eW=t_(["%","*","/"],!1,!1,!1),ez=t_(["!","-","~"],!1,!1,!1),eV=tE("++",!1),eZ=tE("--",!1),eQ=tE("*",!1),eX=tE("%",!1),eY=t_([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=t_([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tE("$",!1),e2=tE("parent",!1),e4=t_([" "," "],!1,!1,!1),e3=tE('"',!1),e9=tE("'",!1),e5=tE("\\",!1),e6=t_(['"',"\\","\n","\r"],!0,!1,!1),e8=t_(["'","\\","\n","\r"],!0,!1,!1),e7=tE("n",!1),te=tE("r",!1),tt=tE("t",!1),tr=tE("x",!1),tn=t_([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ts=tE("cr",!1),ti=tE("cp",!1),to=tE("co",!1),ta=tE("c",!1),tl=t_([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tE("0",!1),tp=t_(["x","X"],!1,!1,!1),tf=tE("-",!1),th=tE("true",!1),td=tE("false",!1),tg=tE("//",!1),tm=t_(["\n","\r"],!0,!1,!1),tb=t_(["\n","\r"],!1,!1,!1),t$=tE("/*",!1),ty=tE("*/",!1),tx=t_([" "," ","\n","\r"],!1,!1,!1),tA=0|t.peg$currPos,tC=[{line:1,column:1}],tS=tA,tv=t.peg$maxFailExpected||[],tw=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');p=c[t.startRule]}function tE(e,t){return{type:"literal",text:e,ignoreCase:t}}function t_(e,t,r,n){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:n}}function tk(t){let r,n=tC[t];if(n)return n;if(t>=tC.length)r=tC.length-1;else for(r=t;!tC[--r];);for(n={line:(n=tC[r]).line,column:n.column};rtS&&(tS=tA,tv=[]),tv.push(e))}function tN(){let e,t,r;for(rp(),e=[],t=tA,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tA=t,t=l);t!==l;)e.push(t),t=tA,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tA=t,t=l);return{type:"Program",body:e.map(([e])=>e).filter(Boolean),execScriptPaths:Array.from(n),hasDynamicExec:s}}function tO(){let t,r,n,s,i,o,a,u,c,p,d,y,x,v,w,E,_;return(t=function(){let t,r,n,s,i,o,a,u;if(t=tA,e.substr(tA,7)===f?(r=f,tA+=7):(r=l,0===tw&&tL(U)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),123===e.charCodeAt(tA)?(s="{",tA++):(s=l,0===tw&&tL(q)),s!==l){for(rp(),i=[],o=tA,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tA=o,o=l);o!==l;)i.push(o),o=tA,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tA=o,o=l);(125===e.charCodeAt(tA)?(o="}",tA++):(o=l,0===tw&&tL(J)),o!==l)?(a=ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),t={type:"PackageDeclaration",name:n,body:i.map(([e])=>e).filter(Boolean)}):(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tA,e.substr(tA,8)===h?(r=h,tA+=8):(r=l,0===tw&&tL(K)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s;if(t=tA,(r=rn())!==l)if("::"===e.substr(tA,2)?(n="::",tA+=2):(n=l,0===tw&&tL(V)),n!==l)if((s=rn())!==l)t={type:"MethodName",namespace:r,method:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=rn()),t}())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=function(){let t,r,n,s,i,o,a,u;if(t=tA,(r=rn())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tA=t,t=l;return t}())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l)if(ru(),(a=tF())!==l)t={type:"FunctionDeclaration",name:n,params:i||[],body:a};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&((n=tA,(s=tI())!==l)?(ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i===l&&(i=null),ru(),n=s):(tA=n,n=l),(t=n)===l&&((o=tA,(a=tj())!==l)?(ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),ru(),o=a):(tA=o,o=l),(t=o)===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tA,"if"===e.substr(tA,2)?(r="if",tA+=2):(r=l,0===tw&&tL(es)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),(o=tO())!==l){var h;a=tA,u=ru(),e.substr(tA,4)===g?(c=g,tA+=4):(c=l,0===tw&&tL(ei)),c!==l?(p=ru(),(f=tO())!==l?a=u=[u,c,p,f]:(tA=a,a=l)):(tA=a,a=l),a===l&&(a=null),t={type:"IfStatement",test:s,consequent:o,alternate:(h=a)?h[3]:null}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tA,"for"===e.substr(tA,3)?(r="for",tA+=3):(r=l,0===tw&&tL(eo)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())===l&&(s=null),ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i!==l)if(ru(),(o=tG())===l&&(o=null),ru(),59===e.charCodeAt(tA)?(a=";",tA++):(a=l,0===tw&&tL(G)),a!==l)if(ru(),(u=tG())===l&&(u=null),ru(),41===e.charCodeAt(tA)?(c=")",tA++):(c=l,0===tw&&tL(z)),c!==l)if(ru(),(p=tO())!==l){var f,h;f=s,h=o,t={type:"ForStatement",init:f,test:h,update:u,body:p}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u;if(t=tA,"do"===e.substr(tA,2)?(r="do",tA+=2):(r=l,0===tw&&tL(el)),r!==l)if(ru(),(n=tO())!==l)if(ru(),e.substr(tA,5)===m?(s=m,tA+=5):(s=l,0===tw&&tL(ea)),s!==l)if(ru(),40===e.charCodeAt(tA)?(i="(",tA++):(i=l,0===tw&&tL(W)),i!==l)if(ru(),(o=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(a=")",tA++):(a=l,0===tw&&tL(z)),a!==l)ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),t={type:"DoWhileStatement",test:o,body:n};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o;if(t=tA,e.substr(tA,5)===m?(r=m,tA+=5):(r=l,0===tw&&tL(ea)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),(o=tO())!==l)t={type:"WhileStatement",test:s,body:o};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tA,e.substr(tA,7)===b?(r=b,tA+=7):(r=l,0===tw&&tL(eu)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),123===e.charCodeAt(tA)?(o="{",tA++):(o=l,0===tw&&tL(q)),o!==l){for(rp(),a=[],u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);u!==l;)a.push(u),u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);(125===e.charCodeAt(tA)?(u="}",tA++):(u=l,0===tw&&tL(J)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;if(t===l)if(t=tA,e.substr(tA,6)===$?(r=$,tA+=6):(r=l,0===tw&&tL(ec)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),123===e.charCodeAt(tA)?(o="{",tA++):(o=l,0===tw&&tL(q)),o!==l){for(rp(),a=[],u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);u!==l;)a.push(u),u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);(125===e.charCodeAt(tA)?(u="}",tA++):(u=l,0===tw&&tL(J)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i;if(t=tA,e.substr(tA,6)===A?(r=A,tA+=6):(r=l,0===tw&&tL(ed)),r!==l)if(n=tA,(s=rc())!==l&&(i=tG())!==l?n=s=[s,i]:(tA=n,n=l),n===l&&(n=null),s=ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i!==l){var o;t={type:"ReturnStatement",value:(o=n)?o[1]:null}}else tA=t,t=l;else tA=t,t=l;return t}())===l&&(c=tA,e.substr(tA,5)===C?(p=C,tA+=5):(p=l,0===tw&&tL(eg)),p!==l?(ru(),59===e.charCodeAt(tA)?(d=";",tA++):(d=l,0===tw&&tL(G)),d!==l?c={type:"BreakStatement"}:(tA=c,c=l)):(tA=c,c=l),(t=c)===l&&(y=tA,e.substr(tA,8)===S?(x=S,tA+=8):(x=l,0===tw&&tL(em)),x!==l?(ru(),59===e.charCodeAt(tA)?(v=";",tA++):(v=l,0===tw&&tL(G)),v!==l?y={type:"ContinueStatement"}:(tA=y,y=l)):(tA=y,y=l),(t=y)===l&&((w=tA,(E=tG())!==l&&(ru(),59===e.charCodeAt(tA)?(_=";",tA++):(_=l,0===tw&&tL(G)),_!==l))?w={type:"ExpressionStatement",expression:E}:(tA=w,w=l),(t=w)===l&&(t=tF())===l&&(t=rl())===l)))))&&(t=tA,ru(),59===e.charCodeAt(tA)?(r=";",tA++):(r=l,0===tw&&tL(G)),r!==l?(ru(),t=null):(tA=t,t=l)),t}function tI(){let t,r,n,s,i,o,a,u,c,p,f,h,g,m;if(t=tA,e.substr(tA,9)===d?(r=d,tA+=9):(r=l,0===tw&&tL(Q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=tM())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l){var b,$,y;if(ru(),a=tA,58===e.charCodeAt(tA)?(u=":",tA++):(u=l,0===tw&&tL(X)),u!==l?(c=ru(),(p=rn())!==l?a=u=[u,c,p]:(tA=a,a=l)):(tA=a,a=l),a===l&&(a=null),u=ru(),c=tA,123===e.charCodeAt(tA)?(p="{",tA++):(p=l,0===tw&&tL(q)),p!==l){for(f=ru(),h=[],g=tT();g!==l;)h.push(g),g=tT();g=ru(),125===e.charCodeAt(tA)?(m="}",tA++):(m=l,0===tw&&tL(J)),m!==l?c=p=[p,f,h,g,m,ru()]:(tA=c,c=l)}else tA=c,c=l;c===l&&(c=null),b=i,$=a,y=c,t={type:"DatablockDeclaration",className:n,instanceName:b,parent:$?$[2]:null,body:y?y[2].filter(Boolean):[]}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}function tj(){let t,r,n,s,i,o,a,u,c,p,f,h;if(t=tA,"new"===e.substr(tA,3)?(r="new",tA+=3):(r=l,0===tw&&tL(Y)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u,c,p;if((t=tA,40===e.charCodeAt(tA)?(r="(",tA++):(r=l,0===tw&&tL(W)),r!==l&&(n=ru(),(s=tG())!==l&&(i=ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l)))?t=s:(tA=t,t=l),t===l)if(t=tA,(r=rn())!==l){var f;for(n=[],s=tA,i=ru(),91===e.charCodeAt(tA)?(o="[",tA++):(o=l,0===tw&&tL(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tA)?(p="]",tA++):(p=l,0===tw&&tL(et)),p!==l?s=i=[i,o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),91===e.charCodeAt(tA)?(o="[",tA++):(o=l,0===tw&&tL(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tA)?(p="]",tA++):(p=l,0===tw&&tL(et)),p!==l?s=i=[i,o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);f=r,t=n.reduce((e,[,,,t])=>({type:"IndexExpression",object:e,index:t}),f)}else tA=t,t=l;return t}())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=tM())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l){var d;if(ru(),a=tA,123===e.charCodeAt(tA)?(u="{",tA++):(u=l,0===tw&&tL(q)),u!==l){for(c=ru(),p=[],f=tT();f!==l;)p.push(f),f=tT();f=ru(),125===e.charCodeAt(tA)?(h="}",tA++):(h=l,0===tw&&tL(J)),h!==l?a=u=[u,c,p,f,h,ru()]:(tA=a,a=l)}else tA=a,a=l;a===l&&(a=null),t={type:"ObjectDeclaration",className:n,instanceName:i,body:(d=a)?d[2].filter(Boolean):[]}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}function tT(){let t,r,n;return(t=tA,(r=tj())!==l)?(ru(),59===e.charCodeAt(tA)?(n=";",tA++):(n=l,0===tw&&tL(G)),n===l&&(n=null),ru(),t=r):(tA=t,t=l),t===l&&((t=tA,(r=tI())!==l)?(ru(),59===e.charCodeAt(tA)?(n=";",tA++):(n=l,0===tw&&tL(G)),n===l&&(n=null),ru(),t=r):(tA=t,t=l),t===l&&(t=function(){let t,r,n,s,i;if(t=tA,ru(),(r=tB())!==l)if(ru(),61===e.charCodeAt(tA)?(n="=",tA++):(n=l,0===tw&&tL(er)),n!==l)if(ru(),(s=tG())!==l)ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i===l&&(i=null),ru(),t={type:"Assignment",target:r,value:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=rl())===l&&(t=function(){let t,r;if(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r!==l)for(;r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));else t=l;return t!==l&&(t=null),t}())),t}function tM(){let e;return(e=tY())===l&&(e=rn())===l&&(e=ra()),e}function tB(){let e,t,r,n;if(e=tA,(t=t8())!==l){for(r=[],n=tP();n!==l;)r.push(n),n=tP();e=r.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tA=e,e=l;return e}function tP(){let t,r,n,s;return(t=tA,46===e.charCodeAt(tA)?(r=".",tA++):(r=l,0===tw&&tL(en)),r!==l&&(ru(),(n=rn())!==l))?t={type:"property",value:n}:(tA=t,t=l),t===l&&((t=tA,91===e.charCodeAt(tA)?(r="[",tA++):(r=l,0===tw&&tL(ee)),r!==l&&(ru(),(n=tH())!==l&&(ru(),93===e.charCodeAt(tA)?(s="]",tA++):(s=l,0===tw&&tL(et)),s!==l)))?t={type:"index",value:n}:(tA=t,t=l)),t}function tH(){let t,r,n,s,i,o,a,u;if(t=tA,(r=tG())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tA=t,t=l;return t}function tD(){let t,r,n,s,i,o,a,u,c;if(t=tA,e.substr(tA,4)===y?(r=y,tA+=4):(r=l,0===tw&&tL(ep)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u;if(t=tA,(r=t3())!==l){for(n=[],s=tA,i=ru(),"or"===e.substr(tA,2)?(o="or",tA+=2):(o=l,0===tw&&tL(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),"or"===e.substr(tA,2)?(o="or",tA+=2):(o=l,0===tw&&tL(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tA=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tA=t,t=l;return t}())!==l)if(ru(),58===e.charCodeAt(tA)?(s=":",tA++):(s=l,0===tw&&tL(X)),s!==l){for(i=rp(),o=[],a=tA,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tA=a,a=l);a!==l;)o.push(a),a=tA,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tA=a,a=l);t={type:"SwitchCase",test:n,consequent:o.map(([e])=>e).filter(Boolean)}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;if(t===l)if(t=tA,e.substr(tA,7)===x?(r=x,tA+=7):(r=l,0===tw&&tL(ef)),r!==l)if(ru(),58===e.charCodeAt(tA)?(n=":",tA++):(n=l,0===tw&&tL(X)),n!==l){for(rp(),s=[],i=tA,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tA=i,i=l);i!==l;)s.push(i),i=tA,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tA=i,i=l);t={type:"SwitchCase",test:null,consequent:s.map(([e])=>e).filter(Boolean)}}else tA=t,t=l;else tA=t,t=l;return t}function tF(){let t,r,n,s,i,o;if(t=tA,123===e.charCodeAt(tA)?(r="{",tA++):(r=l,0===tw&&tL(q)),r!==l){for(rp(),n=[],s=tA,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tA=s,s=l);s!==l;)n.push(s),s=tA,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tA=s,s=l);(125===e.charCodeAt(tA)?(s="}",tA++):(s=l,0===tw&&tL(J)),s!==l)?t={type:"BlockStatement",body:n.map(([e])=>e).filter(Boolean)}:(tA=t,t=l)}else tA=t,t=l;return t}function tG(){let t,r,n,s;if(t=tA,(r=tB())!==l)if(ru(),(n=tU())!==l)if(ru(),(s=tG())!==l)t={type:"AssignmentExpression",operator:n,target:r,value:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=function(){let t,r,n,s,i,o;if(t=tA,(r=tq())!==l)if(ru(),63===e.charCodeAt(tA)?(n="?",tA++):(n=l,0===tw&&tL(e_)),n!==l)if(ru(),(s=tG())!==l)if(ru(),58===e.charCodeAt(tA)?(i=":",tA++):(i=l,0===tw&&tL(X)),i!==l)if(ru(),(o=tG())!==l)t={type:"ConditionalExpression",test:r,consequent:s,alternate:o};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=tq()),t}()),t}function tU(){let t;return 61===e.charCodeAt(tA)?(t="=",tA++):(t=l,0===tw&&tL(er)),t===l&&("+="===e.substr(tA,2)?(t="+=",tA+=2):(t=l,0===tw&&tL(eb)),t===l&&("-="===e.substr(tA,2)?(t="-=",tA+=2):(t=l,0===tw&&tL(e$)),t===l&&("*="===e.substr(tA,2)?(t="*=",tA+=2):(t=l,0===tw&&tL(ey)),t===l&&("/="===e.substr(tA,2)?(t="/=",tA+=2):(t=l,0===tw&&tL(ex)),t===l&&("%="===e.substr(tA,2)?(t="%=",tA+=2):(t=l,0===tw&&tL(eA)),t===l&&("<<="===e.substr(tA,3)?(t="<<=",tA+=3):(t=l,0===tw&&tL(eC)),t===l&&(">>="===e.substr(tA,3)?(t=">>=",tA+=3):(t=l,0===tw&&tL(eS)),t===l&&("&="===e.substr(tA,2)?(t="&=",tA+=2):(t=l,0===tw&&tL(ev)),t===l&&("|="===e.substr(tA,2)?(t="|=",tA+=2):(t=l,0===tw&&tL(ew)),t===l&&("^="===e.substr(tA,2)?(t="^=",tA+=2):(t=l,0===tw&&tL(eE)))))))))))),t}function tq(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tJ())!==l){for(n=[],s=tA,o=ru(),"||"===e.substr(tA,2)?(a="||",tA+=2):(a=l,0===tw&&tL(ek)),a!==l?(u=ru(),(c=tJ())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),"||"===e.substr(tA,2)?(a="||",tA+=2):(a=l,0===tw&&tL(ek)),a!==l?(u=ru(),(c=tJ())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tJ(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tK())!==l){for(n=[],s=tA,o=ru(),"&&"===e.substr(tA,2)?(a="&&",tA+=2):(a=l,0===tw&&tL(eR)),a!==l?(u=ru(),(c=tK())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),"&&"===e.substr(tA,2)?(a="&&",tA+=2):(a=l,0===tw&&tL(eR)),a!==l?(u=ru(),(c=tK())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tK(){let t,r,n,s,o,a,u,c,p;if(t=tA,(r=tW())!==l){for(n=[],s=tA,o=ru(),124===e.charCodeAt(tA)?(a="|",tA++):(a=l,0===tw&&tL(eL)),a!==l?(u=tA,tw++,124===e.charCodeAt(tA)?(c="|",tA++):(c=l,0===tw&&tL(eL)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tW())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),124===e.charCodeAt(tA)?(a="|",tA++):(a=l,0===tw&&tL(eL)),a!==l?(u=tA,tw++,124===e.charCodeAt(tA)?(c="|",tA++):(c=l,0===tw&&tL(eL)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tW())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tA=t,t=l;return t}function tW(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tz())!==l){for(n=[],s=tA,o=ru(),94===e.charCodeAt(tA)?(a="^",tA++):(a=l,0===tw&&tL(eN)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),94===e.charCodeAt(tA)?(a="^",tA++):(a=l,0===tw&&tL(eN)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tz(){let t,r,n,s,o,a,u,c,p;if(t=tA,(r=tV())!==l){for(n=[],s=tA,o=ru(),38===e.charCodeAt(tA)?(a="&",tA++):(a=l,0===tw&&tL(eO)),a!==l?(u=tA,tw++,38===e.charCodeAt(tA)?(c="&",tA++):(c=l,0===tw&&tL(eO)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tV())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),38===e.charCodeAt(tA)?(a="&",tA++):(a=l,0===tw&&tL(eO)),a!==l?(u=tA,tw++,38===e.charCodeAt(tA)?(c="&",tA++):(c=l,0===tw&&tL(eO)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tV())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tA=t,t=l;return t}function tV(){let e,t,r,n,s,o,a,u;if(e=tA,(t=tQ())!==l){for(r=[],n=tA,s=ru(),(o=tZ())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=tZ())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function tZ(){let t;return"=="===e.substr(tA,2)?(t="==",tA+=2):(t=l,0===tw&&tL(eI)),t===l&&("!="===e.substr(tA,2)?(t="!=",tA+=2):(t=l,0===tw&&tL(ej))),t}function tQ(){let e,t,r,n,s,o,a,u;if(e=tA,(t=tY())!==l){for(r=[],n=tA,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function tX(){let t;return"<="===e.substr(tA,2)?(t="<=",tA+=2):(t=l,0===tw&&tL(eT)),t===l&&(">="===e.substr(tA,2)?(t=">=",tA+=2):(t=l,0===tw&&tL(eM)),t===l&&(t=e.charAt(tA),_.test(t)?tA++:(t=l,0===tw&&tL(eB)))),t}function tY(){let e,t,r,n,s,o,a,u;if(e=tA,(t=t2())!==l){for(r=[],n=tA,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function t0(){let e,t,r,n;if(e=tA,(t=tB())!==l)if(ru(),(r=tU())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tA=e,e=l;else tA=e,e=l;else tA=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tA,2)?(t="$=",tA+=2):(t=l,0===tw&&tL(eP)),t===l&&("!$="===e.substr(tA,3)?(t="!$=",tA+=3):(t=l,0===tw&&tL(eH)),t===l&&(64===e.charCodeAt(tA)?(t="@",tA++):(t=l,0===tw&&tL(eD)),t===l&&("NL"===e.substr(tA,2)?(t="NL",tA+=2):(t=l,0===tw&&tL(eF)),t===l&&("TAB"===e.substr(tA,3)?(t="TAB",tA+=3):(t=l,0===tw&&tL(eG)),t===l&&("SPC"===e.substr(tA,3)?(t="SPC",tA+=3):(t=l,0===tw&&tL(eU))))))),t}function t2(){let e,t,r,n,s,o,a,u;if(e=tA,(t=t3())!==l){for(r=[],n=tA,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function t4(){let t;return"<<"===e.substr(tA,2)?(t="<<",tA+=2):(t=l,0===tw&&tL(eq)),t===l&&(">>"===e.substr(tA,2)?(t=">>",tA+=2):(t=l,0===tw&&tL(eJ))),t}function t3(){let t,r,n,s,o,a,u,c;if(t=tA,(r=t9())!==l){for(n=[],s=tA,o=ru(),a=e.charAt(tA),k.test(a)?tA++:(a=l,0===tw&&tL(eK)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),a=e.charAt(tA),k.test(a)?tA++:(a=l,0===tw&&tL(eK)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function t9(){let t,r,n,s,o,a,u,c;if(t=tA,(r=t5())!==l){for(n=[],s=tA,o=ru(),a=e.charAt(tA),R.test(a)?tA++:(a=l,0===tw&&tL(eW)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),a=e.charAt(tA),R.test(a)?tA++:(a=l,0===tw&&tL(eW)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function t5(){let t,r,n;return(t=tA,r=e.charAt(tA),L.test(r)?tA++:(r=l,0===tw&&tL(ez)),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tA=t,t=l),t===l&&((t=tA,"++"===e.substr(tA,2)?(r="++",tA+=2):(r=l,0===tw&&tL(eV)),r===l&&("--"===e.substr(tA,2)?(r="--",tA+=2):(r=l,0===tw&&tL(eZ))),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tA=t,t=l),t===l&&((t=tA,42===e.charCodeAt(tA)?(r="*",tA++):(r=l,0===tw&&tL(eQ)),r!==l&&(ru(),(n=t6())!==l))?t={type:"TagDereferenceExpression",argument:n}:(tA=t,t=l),t===l&&(t=function(){let t,r,n;if(t=tA,(r=t8())!==l)if(ru(),"++"===e.substr(tA,2)?(n="++",tA+=2):(n=l,0===tw&&tL(eV)),n===l&&("--"===e.substr(tA,2)?(n="--",tA+=2):(n=l,0===tw&&tL(eZ))),n!==l)t={type:"PostfixExpression",operator:n,argument:r};else tA=t,t=l;else tA=t,t=l;return t===l&&(t=t8()),t}()))),t}function t6(){let e,t,r,n;if(e=tA,(t=tB())!==l)if(ru(),(r=tU())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tA=e,e=l;else tA=e,e=l;else tA=e,e=l;return e===l&&(e=t5()),e}function t8(){let t,r,i,o,a,u,c,p,f,h;if(t=tA,(r=function(){let t,r,n,s,i,o,a,u,c,p,f,h,d,g,m,b;if(t=tA,(a=tj())===l&&(a=tI())===l&&(a=function(){let t,r,n,s;if(t=tA,34===e.charCodeAt(tA)?(r='"',tA++):(r=l,0===tw&&tL(e3)),r!==l){for(n=[],s=rs();s!==l;)n.push(s),s=rs();(34===e.charCodeAt(tA)?(s='"',tA++):(s=l,0===tw&&tL(e3)),s!==l)?t={type:"StringLiteral",value:n.join("")}:(tA=t,t=l)}else tA=t,t=l;if(t===l)if(t=tA,39===e.charCodeAt(tA)?(r="'",tA++):(r=l,0===tw&&tL(e9)),r!==l){for(n=[],s=ri();s!==l;)n.push(s),s=ri();(39===e.charCodeAt(tA)?(s="'",tA++):(s=l,0===tw&&tL(e9)),s!==l)?t={type:"StringLiteral",value:n.join(""),tagged:!0}:(tA=t,t=l)}else tA=t,t=l;return t}())===l&&(a=ra())===l&&((u=tA,e.substr(tA,4)===w?(c=w,tA+=4):(c=l,0===tw&&tL(th)),c===l&&(e.substr(tA,5)===E?(c=E,tA+=5):(c=l,0===tw&&tL(td))),c!==l&&(p=tA,tw++,f=rh(),tw--,f===l?p=void 0:(tA=p,p=l),p!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tA=u,u=l),(a=u)===l&&((h=re())===l&&(h=rt())===l&&(h=rr()),(a=h)===l))&&((d=tA,40===e.charCodeAt(tA)?(g="(",tA++):(g=l,0===tw&&tL(W)),g!==l&&(ru(),(m=tG())!==l&&(ru(),41===e.charCodeAt(tA)?(b=")",tA++):(b=l,0===tw&&tL(z)),b!==l)))?d=m:(tA=d,d=l),a=d),(r=a)!==l){for(n=[],s=tA,i=ru(),(o=tP())!==l?s=i=[i,o]:(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),(o=tP())!==l?s=i=[i,o]:(tA=s,s=l);t=n.reduce((e,[,t])=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},r)}else tA=t,t=l;return t}())!==l){for(i=[],o=tA,a=ru(),40===e.charCodeAt(tA)?(u="(",tA++):(u=l,0===tw&&tL(W)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tA)?(h=")",tA++):(h=l,0===tw&&tL(z)),h!==l?o=a=[a,u,c,p,f,h]:(tA=o,o=l)):(tA=o,o=l),o===l&&(o=tA,a=ru(),(u=tP())!==l?o=a=[a,u]:(tA=o,o=l));o!==l;)i.push(o),o=tA,a=ru(),40===e.charCodeAt(tA)?(u="(",tA++):(u=l,0===tw&&tL(W)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tA)?(h=")",tA++):(h=l,0===tw&&tL(z)),h!==l?o=a=[a,u,c,p,f,h]:(tA=o,o=l)):(tA=o,o=l),o===l&&(o=tA,a=ru(),(u=tP())!==l?o=a=[a,u]:(tA=o,o=l));t=i.reduce((e,t)=>{if("("===t[1]){var r;let[,,,i]=t;return r=i||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(r.length>0&&"StringLiteral"===r[0].type?n.add(r[0].value):s=!0),{type:"CallExpression",callee:e,arguments:r}}let i=t[1];return"property"===i.type?{type:"MemberExpression",object:e,property:i.value}:{type:"IndexExpression",object:e,index:i.value}},r)}else tA=t,t=l;return t}function t7(){let t,r,n,s,i,o,a,u;if(t=tA,(r=tG())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tA=t,t=l;return t}function re(){let t,r,n,s,i,o,a;if(t=tA,37===e.charCodeAt(tA)?(r="%",tA++):(r=l,0===tw&&tL(eX)),r!==l){if(n=tA,s=tA,i=e.charAt(tA),N.test(i)?tA++:(i=l,0===tw&&tL(eY)),i!==l){for(o=[],a=e.charAt(tA),O.test(a)?tA++:(a=l,0===tw&&tL(e0));a!==l;)o.push(a),a=e.charAt(tA),O.test(a)?tA++:(a=l,0===tw&&tL(e0));s=i=[i,o]}else tA=s,s=l;(n=s!==l?e.substring(n,tA):s)!==l?t={type:"Variable",scope:"local",name:n}:(tA=t,t=l)}else tA=t,t=l;return t}function rt(){let t,r,n,s,i,o,a,u,c,p,f,h,d;if(t=tA,36===e.charCodeAt(tA)?(r="$",tA++):(r=l,0===tw&&tL(e1)),r!==l){if(n=tA,s=tA,"::"===e.substr(tA,2)?(i="::",tA+=2):(i=l,0===tw&&tL(V)),i===l&&(i=null),o=e.charAt(tA),N.test(o)?tA++:(o=l,0===tw&&tL(eY)),o!==l){for(a=[],u=e.charAt(tA),O.test(u)?tA++:(u=l,0===tw&&tL(e0));u!==l;)a.push(u),u=e.charAt(tA),O.test(u)?tA++:(u=l,0===tw&&tL(e0));if(u=[],c=tA,"::"===e.substr(tA,2)?(p="::",tA+=2):(p=l,0===tw&&tL(V)),p!==l)if(f=e.charAt(tA),N.test(f)?tA++:(f=l,0===tw&&tL(eY)),f!==l){for(h=[],d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));d!==l;)h.push(d),d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));c=p=[p,f,h]}else tA=c,c=l;else tA=c,c=l;for(;c!==l;)if(u.push(c),c=tA,"::"===e.substr(tA,2)?(p="::",tA+=2):(p=l,0===tw&&tL(V)),p!==l)if(f=e.charAt(tA),N.test(f)?tA++:(f=l,0===tw&&tL(eY)),f!==l){for(h=[],d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));d!==l;)h.push(d),d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));c=p=[p,f,h]}else tA=c,c=l;else tA=c,c=l;s=i=[i,o,a,u]}else tA=s,s=l;(n=s!==l?e.substring(n,tA):s)!==l?t={type:"Variable",scope:"global",name:n}:(tA=t,t=l)}else tA=t,t=l;return t}function rr(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tA,r=tA,n=tA,e.substr(tA,6)===v?(s=v,tA+=6):(s=l,0===tw&&tL(e2)),s!==l){for(i=[],o=e.charAt(tA),I.test(o)?tA++:(o=l,0===tw&&tL(e4));o!==l;)i.push(o),o=e.charAt(tA),I.test(o)?tA++:(o=l,0===tw&&tL(e4));if("::"===e.substr(tA,2)?(o="::",tA+=2):(o=l,0===tw&&tL(V)),o!==l){for(a=[],u=e.charAt(tA),I.test(u)?tA++:(u=l,0===tw&&tL(e4));u!==l;)a.push(u),u=e.charAt(tA),I.test(u)?tA++:(u=l,0===tw&&tL(e4));if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));n=s=[s,i,o,a,u,c]}else tA=n,n=l}else tA=n,n=l}else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r.replace(/\s+/g,"")}),(t=r)===l){if(t=tA,r=tA,n=tA,e.substr(tA,6)===v?(s=v,tA+=6):(s=l,0===tw&&tL(e2)),s!==l){if(i=[],o=tA,"::"===e.substr(tA,2)?(a="::",tA+=2):(a=l,0===tw&&tL(V)),a!==l)if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));o=a=[a,u,c]}else tA=o,o=l;else tA=o,o=l;if(o!==l)for(;o!==l;)if(i.push(o),o=tA,"::"===e.substr(tA,2)?(a="::",tA+=2):(a=l,0===tw&&tL(V)),a!==l)if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));o=a=[a,u,c]}else tA=o,o=l;else tA=o,o=l;else i=l;i!==l?n=s=[s,i]:(tA=n,n=l)}else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r}),(t=r)===l){if(t=tA,r=tA,n=tA,s=e.charAt(tA),N.test(s)?tA++:(s=l,0===tw&&tL(eY)),s!==l){for(i=[],o=e.charAt(tA),O.test(o)?tA++:(o=l,0===tw&&tL(e0));o!==l;)i.push(o),o=e.charAt(tA),O.test(o)?tA++:(o=l,0===tw&&tL(e0));if(o=[],a=tA,"::"===e.substr(tA,2)?(u="::",tA+=2):(u=l,0===tw&&tL(V)),u!==l)if(c=e.charAt(tA),N.test(c)?tA++:(c=l,0===tw&&tL(eY)),c!==l){for(p=[],f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));f!==l;)p.push(f),f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));a=u=[u,c,p]}else tA=a,a=l;else tA=a,a=l;for(;a!==l;)if(o.push(a),a=tA,"::"===e.substr(tA,2)?(u="::",tA+=2):(u=l,0===tw&&tL(V)),u!==l)if(c=e.charAt(tA),N.test(c)?tA++:(c=l,0===tw&&tL(eY)),c!==l){for(p=[],f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));f!==l;)p.push(f),f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));a=u=[u,c,p]}else tA=a,a=l;else tA=a,a=l;n=s=[s,i,o]}else tA=n,n=l;(r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r}),t=r}}return t}function rn(){let e;return(e=re())===l&&(e=rt())===l&&(e=rr()),e}function rs(){let t,r,n;return(t=tA,92===e.charCodeAt(tA)?(r="\\",tA++):(r=l,0===tw&&tL(e5)),r!==l&&(n=ro())!==l)?t=n:(tA=t,t=l),t===l&&(t=e.charAt(tA),j.test(t)?tA++:(t=l,0===tw&&tL(e6))),t}function ri(){let t,r,n;return(t=tA,92===e.charCodeAt(tA)?(r="\\",tA++):(r=l,0===tw&&tL(e5)),r!==l&&(n=ro())!==l)?t=n:(tA=t,t=l),t===l&&(t=e.charAt(tA),T.test(t)?tA++:(t=l,0===tw&&tL(e8))),t}function ro(){let t,r,n,s,i,o;return t=tA,110===e.charCodeAt(tA)?(r="n",tA++):(r=l,0===tw&&tL(e7)),r!==l&&(r="\n"),(t=r)===l&&(t=tA,114===e.charCodeAt(tA)?(r="r",tA++):(r=l,0===tw&&tL(te)),r!==l&&(r="\r"),(t=r)===l)&&(t=tA,116===e.charCodeAt(tA)?(r="t",tA++):(r=l,0===tw&&tL(tt)),r!==l&&(r=" "),(t=r)===l)&&((t=tA,120===e.charCodeAt(tA)?(r="x",tA++):(r=l,0===tw&&tL(tr)),r!==l&&(n=tA,s=tA,i=e.charAt(tA),M.test(i)?tA++:(i=l,0===tw&&tL(tn)),i!==l?(o=e.charAt(tA),M.test(o)?tA++:(o=l,0===tw&&tL(tn)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l),(n=s!==l?e.substring(n,tA):s)!==l))?t=String.fromCharCode(parseInt(n,16)):(tA=t,t=l),t===l&&(t=tA,"cr"===e.substr(tA,2)?(r="cr",tA+=2):(r=l,0===tw&&tL(ts)),r!==l&&(r="\x0f"),(t=r)===l&&(t=tA,"cp"===e.substr(tA,2)?(r="cp",tA+=2):(r=l,0===tw&&tL(ti)),r!==l&&(r="\x10"),(t=r)===l))&&(t=tA,"co"===e.substr(tA,2)?(r="co",tA+=2):(r=l,0===tw&&tL(to)),r!==l&&(r="\x11"),(t=r)===l)&&((t=tA,99===e.charCodeAt(tA)?(r="c",tA++):(r=l,0===tw&&tL(ta)),r!==l&&(n=e.charAt(tA),B.test(n)?tA++:(n=l,0===tw&&tL(tl)),n!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(n,10)]):(tA=t,t=l),t===l&&(t=tA,e.length>tA?(r=e.charAt(tA),tA++):(r=l,0===tw&&tL(tu)),t=r))),t}function ra(){let t,r,n,s,i,o,a,u,c;if(t=tA,r=tA,n=tA,48===e.charCodeAt(tA)?(s="0",tA++):(s=l,0===tw&&tL(tc)),s!==l)if(i=e.charAt(tA),P.test(i)?tA++:(i=l,0===tw&&tL(tp)),i!==l){if(o=[],a=e.charAt(tA),M.test(a)?tA++:(a=l,0===tw&&tL(tn)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tA),M.test(a)?tA++:(a=l,0===tw&&tL(tn));else o=l;o!==l?n=s=[s,i,o]:(tA=n,n=l)}else tA=n,n=l;else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(n=tA,tw++,s=rh(),tw--,s===l?n=void 0:(tA=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseInt(r,16)}:(tA=t,t=l),t===l){if(t=tA,r=tA,n=tA,45===e.charCodeAt(tA)?(s="-",tA++):(s=l,0===tw&&tL(tf)),s===l&&(s=null),i=[],o=e.charAt(tA),B.test(o)?tA++:(o=l,0===tw&&tL(tl)),o!==l)for(;o!==l;)i.push(o),o=e.charAt(tA),B.test(o)?tA++:(o=l,0===tw&&tL(tl));else i=l;if(i!==l){if(o=tA,46===e.charCodeAt(tA)?(a=".",tA++):(a=l,0===tw&&tL(en)),a!==l){if(u=[],c=e.charAt(tA),B.test(c)?tA++:(c=l,0===tw&&tL(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tA),B.test(c)?tA++:(c=l,0===tw&&tL(tl));else u=l;u!==l?o=a=[a,u]:(tA=o,o=l)}else tA=o,o=l;o===l&&(o=null),n=s=[s,i,o]}else tA=n,n=l;if(n===l)if(n=tA,45===e.charCodeAt(tA)?(s="-",tA++):(s=l,0===tw&&tL(tf)),s===l&&(s=null),46===e.charCodeAt(tA)?(i=".",tA++):(i=l,0===tw&&tL(en)),i!==l){if(o=[],a=e.charAt(tA),B.test(a)?tA++:(a=l,0===tw&&tL(tl)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tA),B.test(a)?tA++:(a=l,0===tw&&tL(tl));else o=l;o!==l?n=s=[s,i,o]:(tA=n,n=l)}else tA=n,n=l;(r=n!==l?e.substring(r,tA):n)!==l&&(n=tA,tw++,s=rh(),tw--,s===l?n=void 0:(tA=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseFloat(r)}:(tA=t,t=l)}return t}function rl(){let t;return(t=function(){let t,r,n,s,i;if(t=tA,"//"===e.substr(tA,2)?(r="//",tA+=2):(r=l,0===tw&&tL(tg)),r!==l){for(n=tA,s=[],i=e.charAt(tA),H.test(i)?tA++:(i=l,0===tw&&tL(tm));i!==l;)s.push(i),i=e.charAt(tA),H.test(i)?tA++:(i=l,0===tw&&tL(tm));n=e.substring(n,tA),s=e.charAt(tA),D.test(s)?tA++:(s=l,0===tw&&tL(tb)),s===l&&(s=null),t={type:"Comment",value:n}}else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tA,"/*"===e.substr(tA,2)?(r="/*",tA+=2):(r=l,0===tw&&tL(t$)),r!==l){for(n=tA,s=[],i=tA,o=tA,tw++,"*/"===e.substr(tA,2)?(a="*/",tA+=2):(a=l,0===tw&&tL(ty)),tw--,a===l?o=void 0:(tA=o,o=l),o!==l?(e.length>tA?(a=e.charAt(tA),tA++):(a=l,0===tw&&tL(tu)),a!==l?i=o=[o,a]:(tA=i,i=l)):(tA=i,i=l);i!==l;)s.push(i),i=tA,o=tA,tw++,"*/"===e.substr(tA,2)?(a="*/",tA+=2):(a=l,0===tw&&tL(ty)),tw--,a===l?o=void 0:(tA=o,o=l),o!==l?(e.length>tA?(a=e.charAt(tA),tA++):(a=l,0===tw&&tL(tu)),a!==l?i=o=[o,a]:(tA=i,i=l)):(tA=i,i=l);(n=e.substring(n,tA),"*/"===e.substr(tA,2)?(s="*/",tA+=2):(s=l,0===tw&&tL(ty)),s!==l)?t={type:"Comment",value:n}:(tA=t,t=l)}else tA=t,t=l;return t}()),t}function ru(){let t,r;for(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r===l&&(r=rf());r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r===l&&(r=rf());return t}function rc(){let t,r,n,s;if(t=tA,r=[],n=e.charAt(tA),F.test(n)?tA++:(n=l,0===tw&&tL(tx)),n!==l)for(;n!==l;)r.push(n),n=e.charAt(tA),F.test(n)?tA++:(n=l,0===tw&&tL(tx));else r=l;if(r!==l){for(n=[],s=e.charAt(tA),F.test(s)?tA++:(s=l,0===tw&&tL(tx)),s===l&&(s=rf());s!==l;)n.push(s),s=e.charAt(tA),F.test(s)?tA++:(s=l,0===tw&&tL(tx)),s===l&&(s=rf());t=r=[r,n]}else tA=t,t=l;return t}function rp(){let t,r;for(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));return t}function rf(){let t,r,n,s,i,o;if(t=tA,"//"===e.substr(tA,2)?(r="//",tA+=2):(r=l,0===tw&&tL(tg)),r!==l){for(n=[],s=e.charAt(tA),H.test(s)?tA++:(s=l,0===tw&&tL(tm));s!==l;)n.push(s),s=e.charAt(tA),H.test(s)?tA++:(s=l,0===tw&&tL(tm));s=e.charAt(tA),D.test(s)?tA++:(s=l,0===tw&&tL(tb)),s===l&&(s=null),t=r=[r,n,s]}else tA=t,t=l;if(t===l)if(t=tA,"/*"===e.substr(tA,2)?(r="/*",tA+=2):(r=l,0===tw&&tL(t$)),r!==l){for(n=[],s=tA,i=tA,tw++,"*/"===e.substr(tA,2)?(o="*/",tA+=2):(o=l,0===tw&&tL(ty)),tw--,o===l?i=void 0:(tA=i,i=l),i!==l?(e.length>tA?(o=e.charAt(tA),tA++):(o=l,0===tw&&tL(tu)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=tA,tw++,"*/"===e.substr(tA,2)?(o="*/",tA+=2):(o=l,0===tw&&tL(ty)),tw--,o===l?i=void 0:(tA=i,i=l),i!==l?(e.length>tA?(o=e.charAt(tA),tA++):(o=l,0===tw&&tL(tu)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l);"*/"===e.substr(tA,2)?(s="*/",tA+=2):(s=l,0===tw&&tL(ty)),s!==l?t=r=[r,n,s]:(tA=t,t=l)}else tA=t,t=l;return t}function rh(){let t;return t=e.charAt(tA),O.test(t)?tA++:(t=l,0===tw&&tL(e0)),t}n=new Set,s=!1;let rd=(r=p())!==l&&tA===e.length;function rg(){var t,n,s;throw r!==l&&tA{"use strict";let n="[^\\\\/]",s="[^/]",i="(?:\\/|$)",o="(?:^|\\/)",a=`\\.{1,2}${i}`,l=`(?!${o}${a})`,u=`(?!\\.{0,1}${i})`,c=`(?!${a})`,p=`${s}*?`,f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:"(?!\\.)",NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:o,SEP:"/"},h={...f,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:f}},19241,(e,t,r)=>{"use strict";var n=e.i(47167);let{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=e.r(53487);r.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r.hasRegexChars=e=>o.test(e),r.isRegexChar=e=>1===e.length&&r.hasRegexChars(e),r.escapeRegex=e=>e.replace(a,"\\$1"),r.toPosixSlashes=e=>e.replace(s,"/"),r.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==n.default&&!!n.default.platform&&"win32"===n.default.platform},r.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),r.escapeLast=(e,t,n)=>{let s=e.lastIndexOf(t,n);return -1===s?e:"\\"===e[s-1]?r.escapeLast(e,t,s-1):`${e.slice(0,s)}\\${e.slice(s)}`},r.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},r.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},r.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return""===n?r[r.length-2]:n}},26094,(e,t,r)=>{"use strict";let n=e.r(19241),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:$}=e.r(53487),y=e=>e===c||e===o,x=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let r,A,C=t||{},S=e.length-1,v=!0===C.parts||!0===C.scanToEnd,w=[],E=[],_=[],k=e,R=-1,L=0,N=0,O=!1,I=!1,j=!1,T=!1,M=!1,B=!1,P=!1,H=!1,D=!1,F=!1,G=0,U={value:"",depth:0,isGlob:!1},q=()=>R>=S,J=()=>k.charCodeAt(R+1),K=()=>(r=A,k.charCodeAt(++R));for(;R0&&(z=k.slice(0,L),k=k.slice(L),N-=L),W&&!0===j&&N>0?(W=k.slice(0,N),V=k.slice(N)):!0===j?(W="",V=k):W=k,W&&""!==W&&"/"!==W&&W!==k&&y(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===C.unescape&&(V&&(V=n.removeBackslashes(V)),W&&!0===P&&(W=n.removeBackslashes(W)));let Z={prefix:z,input:e,start:L,base:W,glob:V,isBrace:O,isBracket:I,isGlob:j,isExtglob:T,isGlobstar:M,negated:H,negatedExtglob:D};if(!0===C.tokens&&(Z.maxDepth=0,y(A)||E.push(U),Z.tokens=E),!0===C.parts||!0===C.tokens){let t;for(let r=0;r{"use strict";let n=e.r(53487),s=e.r(19241),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>s.escapeRegex(e)).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,f=(e,t)=>{let r;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let h={...t},d="number"==typeof h.maxLength?Math.min(i,h.maxLength):i,g=e.length;if(g>d)throw SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);let m={type:"bos",value:"",output:h.prepend||""},b=[m],$=h.capture?"":"?:",y=n.globChars(h.windows),x=n.extglobChars(y),{DOT_LITERAL:A,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:w,NO_DOT:E,NO_DOT_SLASH:_,NO_DOTS_SLASH:k,QMARK:R,QMARK_NO_DOT:L,STAR:N,START_ANCHOR:O}=y,I=e=>`(${$}(?:(?!${O}${e.dot?w:A}).)*?)`,j=h.dot?"":E,T=h.dot?R:L,M=!0===h.bash?I(h):N;h.capture&&(M=`(${M})`),"boolean"==typeof h.noext&&(h.noextglob=h.noext);let B={input:e,index:-1,start:0,dot:!0===h.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};g=(e=s.removePrefix(e,B)).length;let P=[],H=[],D=[],F=m,G=()=>B.index===g-1,U=B.peek=(t=1)=>e[B.index+t],q=B.advance=()=>e[++B.index]||"",J=()=>e.slice(B.index+1),K=(e="",t=0)=>{B.consumed+=e,B.index+=t},W=e=>{B.output+=null!=e.output?e.output:e.value,K(e.value)},z=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},V=e=>{B[e]++,D.push(e)},Z=e=>{B[e]--,D.pop()},Q=e=>{if("globstar"===F.type){let t=B.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||P.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(B.output=B.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=M,B.output+=F.output)}if(P.length&&"paren"!==e.type&&(P[P.length-1].inner+=e.value),(e.value||e.output)&&W(e),F&&"text"===F.type&&"text"===e.type){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,b.push(e),F=e},X=(e,t)=>{let r={...x[t],conditions:1,inner:""};r.prev=F,r.parens=B.parens,r.output=B.output;let n=(h.capture?"(":"")+r.open;V("parens"),Q({type:e,value:t,output:B.output?"":v}),Q({type:"paren",extglob:!0,value:q(),output:n}),P.push(r)},Y=e=>{let n,s=e.close+(h.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=I(h)),(r!==M||G()||/^\)+$/.test(J()))&&(s=e.close=`)$))${r}`),e.inner.includes("*")&&(n=J())&&/^\.[^\\/.]+$/.test(n)){let i=f(n,{...t,fastpaths:!1}).output;s=e.close=`)${i})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:r,output:s}),Z("parens")};if(!1!==h.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,n=e.replace(l,(e,t,n,s,i,o)=>"\\"===s?(r=!0,e):"?"===s?t?t+s+(i?R.repeat(i.length):""):0===o?T+(i?R.repeat(i.length):""):R.repeat(n.length):"."===s?A.repeat(n.length):"*"===s?t?t+s+(i?M:""):M:t?e:`\\${e}`);return(!0===r&&(n=!0===h.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===e&&!0===h.contains)?B.output=e:B.output=s.wrapOutput(n,B,t),B}for(;!G();){if("\0"===(r=q()))continue;if("\\"===r){let e=U();if("/"===e&&!0!==h.bash||"."===e||";"===e)continue;if(!e){Q({type:"text",value:r+="\\"});continue}let t=/^\\+/.exec(J()),n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(r+="\\")),!0===h.unescape?r=q():r+=q(),0===B.brackets){Q({type:"text",value:r});continue}}if(B.brackets>0&&("]"!==r||"["===F.value||"[^"===F.value)){if(!1!==h.posix&&":"===r){let e=F.value.slice(1);if(e.includes("[")&&(F.posix=!0,e.includes(":"))){let e=F.value.lastIndexOf("["),t=F.value.slice(0,e),r=o[F.value.slice(e+2)];if(r){F.value=t+r,B.backtrack=!0,q(),m.output||1!==b.indexOf(F)||(m.output=v);continue}}}("["===r&&":"!==U()||"-"===r&&"]"===U())&&(r=`\\${r}`),"]"===r&&("["===F.value||"[^"===F.value)&&(r=`\\${r}`),!0===h.posix&&"!"===r&&"["===F.value&&(r="^"),F.value+=r,W({value:r});continue}if(1===B.quotes&&'"'!==r){r=s.escapeRegex(r),F.value+=r,W({value:r});continue}if('"'===r){B.quotes=+(1!==B.quotes),!0===h.keepQuotes&&Q({type:"text",value:r});continue}if("("===r){V("parens"),Q({type:"paren",value:r});continue}if(")"===r){if(0===B.parens&&!0===h.strictBrackets)throw SyntaxError(p("opening","("));let e=P[P.length-1];if(e&&B.parens===e.parens+1){Y(P.pop());continue}Q({type:"paren",value:r,output:B.parens?")":"\\)"}),Z("parens");continue}if("["===r){if(!0!==h.nobracket&&J().includes("]"))V("brackets");else{if(!0!==h.nobracket&&!0===h.strictBrackets)throw SyntaxError(p("closing","]"));r=`\\${r}`}Q({type:"bracket",value:r});continue}if("]"===r){if(!0===h.nobracket||F&&"bracket"===F.type&&1===F.value.length){Q({type:"text",value:r,output:`\\${r}`});continue}if(0===B.brackets){if(!0===h.strictBrackets)throw SyntaxError(p("opening","["));Q({type:"text",value:r,output:`\\${r}`});continue}Z("brackets");let e=F.value.slice(1);if(!0===F.posix||"^"!==e[0]||e.includes("/")||(r=`/${r}`),F.value+=r,W({value:r}),!1===h.literalBrackets||s.hasRegexChars(e))continue;let t=s.escapeRegex(F.value);if(B.output=B.output.slice(0,-F.value.length),!0===h.literalBrackets){B.output+=t,F.value=t;continue}F.value=`(${$}${t}|${F.value})`,B.output+=F.value;continue}if("{"===r&&!0!==h.nobrace){V("braces");let e={type:"brace",value:r,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};H.push(e),Q(e);continue}if("}"===r){let e=H[H.length-1];if(!0===h.nobrace||!e){Q({type:"text",value:r,output:r});continue}let t=")";if(!0===e.dots){let e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=c(r,h),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=B.output.slice(0,e.outputIndex),s=B.tokens.slice(e.tokensIndex);for(let i of(e.value=e.output="\\{",r=t="\\}",B.output=n,s))B.output+=i.output||i.value}Q({type:"brace",value:r,output:t}),Z("braces"),H.pop();continue}if("|"===r){P.length>0&&P[P.length-1].conditions++,Q({type:"text",value:r});continue}if(","===r){let e=r,t=H[H.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:r,output:e});continue}if("/"===r){if("dot"===F.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",b.pop(),F=m;continue}Q({type:"slash",value:r,output:S});continue}if("."===r){if(B.braces>0&&"dot"===F.type){"."===F.value&&(F.output=A);let e=H[H.length-1];F.type="dots",F.output+=r,F.value+=r,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==F.type&&"slash"!==F.type){Q({type:"text",value:r,output:A});continue}Q({type:"dot",value:r,output:A});continue}if("?"===r){if(!(F&&"("===F.value)&&!0!==h.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",r);continue}if(F&&"paren"===F.type){let e=U(),t=r;("("!==F.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(J()))||(t=`\\${r}`),Q({type:"text",value:r,output:t});continue}if(!0!==h.dot&&("slash"===F.type||"bos"===F.type)){Q({type:"qmark",value:r,output:L});continue}Q({type:"qmark",value:r,output:R});continue}if("!"===r){if(!0!==h.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",r);continue}if(!0!==h.nonegate&&0===B.index){z();continue}}if("+"===r){if(!0!==h.noextglob&&"("===U()&&"?"!==U(2)){X("plus",r);continue}if(F&&"("===F.value||!1===h.regex){Q({type:"plus",value:r,output:C});continue}if(F&&("bracket"===F.type||"paren"===F.type||"brace"===F.type)||B.parens>0){Q({type:"plus",value:r});continue}Q({type:"plus",value:C});continue}if("@"===r){if(!0!==h.noextglob&&"("===U()&&"?"!==U(2)){Q({type:"at",extglob:!0,value:r,output:""});continue}Q({type:"text",value:r});continue}if("*"!==r){("$"===r||"^"===r)&&(r=`\\${r}`);let e=a.exec(J());e&&(r+=e[0],B.index+=e[0].length),Q({type:"text",value:r});continue}if(F&&("globstar"===F.type||!0===F.star)){F.type="star",F.star=!0,F.value+=r,F.output=M,B.backtrack=!0,B.globstar=!0,K(r);continue}let t=J();if(!0!==h.noextglob&&/^\([^?]/.test(t)){X("star",r);continue}if("star"===F.type){if(!0===h.noglobstar){K(r);continue}let n=F.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,o=s&&("star"===s.type||"globstar"===s.type);if(!0===h.bash&&(!i||t[0]&&"/"!==t[0])){Q({type:"star",value:r,output:""});continue}let a=B.braces>0&&("comma"===n.type||"brace"===n.type),l=P.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!l){Q({type:"star",value:r,output:""});continue}for(;"/**"===t.slice(0,3);){let r=e[B.index+4];if(r&&"/"!==r)break;t=t.slice(3),K("/**",3)}if("bos"===n.type&&G()){F.type="globstar",F.value+=r,F.output=I(h),B.output=F.output,B.globstar=!0,K(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&G()){B.output=B.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=I(h)+(h.strictSlashes?")":"|$)"),F.value+=r,B.globstar=!0,B.output+=n.output+F.output,K(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";B.output=B.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=`${I(h)}${S}|${S}${e})`,F.value+=r,B.output+=n.output+F.output,B.globstar=!0,K(r+q()),Q({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){F.type="globstar",F.value+=r,F.output=`(?:^|${S}|${I(h)}${S})`,B.output=F.output,B.globstar=!0,K(r+q()),Q({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-F.output.length),F.type="globstar",F.output=I(h),F.value+=r,B.output+=F.output,B.globstar=!0,K(r);continue}let n={type:"star",value:r,output:M};if(!0===h.bash){n.output=".*?",("bos"===F.type||"slash"===F.type)&&(n.output=j+n.output),Q(n);continue}if(F&&("bracket"===F.type||"paren"===F.type)&&!0===h.regex){n.output=r,Q(n);continue}(B.index===B.start||"slash"===F.type||"dot"===F.type)&&("dot"===F.type?(B.output+=_,F.output+=_):!0===h.dot?(B.output+=k,F.output+=k):(B.output+=j,F.output+=j),"*"!==U()&&(B.output+=v,F.output+=v)),Q(n)}for(;B.brackets>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","]"));B.output=s.escapeLast(B.output,"["),Z("brackets")}for(;B.parens>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing",")"));B.output=s.escapeLast(B.output,"("),Z("parens")}for(;B.braces>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","}"));B.output=s.escapeLast(B.output,"{"),Z("braces")}if(!0!==h.strictSlashes&&("star"===F.type||"bracket"===F.type)&&Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===B.backtrack)for(let e of(B.output="",B.tokens))B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix);return B};f.fastpaths=(e,t)=>{let r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:b}=n.globChars(r.windows),$=r.dot?d:h,y=r.dot?g:h,x=r.capture?"":"?:",A=!0===r.bash?".*?":m;r.capture&&(A=`(${A})`);let C=e=>!0===e.noglobstar?A:`(${x}(?:(?!${b}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case"*":return`${$}${p}${A}`;case".*":return`${l}${p}${A}`;case"*.*":return`${$}${A}${l}${p}${A}`;case"*/*":return`${$}${A}${c}${p}${y}${A}`;case"**":return $+C(r);case"**/*":return`(?:${$}${C(r)}${c})?${y}${p}${A}`;case"**/*.*":return`(?:${$}${C(r)}${c})?${y}${A}${l}${p}${A}`;case"**/.*":return`(?:${$}${C(r)}${c})?${l}${p}${A}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let r=S(t[1]);if(!r)return;return r+l+t[2]}}},v=S(s.removePrefix(e,{negated:!1,prefix:""}));return v&&!0!==r.strictSlashes&&(v+=`${c}?`),v},t.exports=f},53174,(e,t,r)=>{"use strict";let n=e.r(26094),s=e.r(17932),i=e.r(19241),o=e.r(53487),a=(e,t,r=!1)=>{if(Array.isArray(e)){let n=e.map(e=>a(e,t,r));return e=>{for(let t of n){let r=t(e);if(r)return r}return!1}}let n=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,o=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),l=o.state;delete o.state;let u=()=>!1;if(s.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=a(s.ignore,e,r)}let c=(r,n=!1)=>{let{isMatch:c,match:p,output:f}=a.test(r,o,t,{glob:e,posix:i}),h={glob:e,state:l,regex:o,posix:i,input:r,output:f,match:p,isMatch:c};return("function"==typeof s.onResult&&s.onResult(h),!1===c)?(h.isMatch=!1,!!n&&h):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!n&&h):("function"==typeof s.onMatch&&s.onMatch(h),!n||h)};return r&&(c.state=l),c};a.test=(e,t,r,{glob:n,posix:s}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let o=r||{},l=o.format||(s?i.toPosixSlashes:null),u=e===n,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===n),(!1===u||!0===o.capture)&&(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,s):t.exec(c)),{isMatch:!!u,match:u,output:c}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):s(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;let s=t||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===n&&(u.state=e),u},a.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),a.compileRe(i,t,r,n)},a.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,t.exports=a},54970,(e,t,r)=>{"use strict";let n=e.r(53174),s=e.r(19241);function i(e,t,r=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:s.isWindows()}),n(e,t,r)}Object.assign(i,n),t.exports=i},12979,91996,33870,38433,86608,62395,e=>{"use strict";function t(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}let r=e.i(87447).default;function n(e){return t(e).toLowerCase()}function s(){return r.resources}function i(e){let[t,...n]=r.resources[e],[s,i]=n[n.length-1];return[s,i??t]}function o(e){let t=n(e);if(r.resources[t])return t;let s=t.replace(/\d+(\.(png))$/i,"$1");if(r.resources[s])return s;throw Error(`Resource not found in manifest: ${e}`)}function a(){return Object.keys(r.resources)}let l=["",".jpg",".png",".gif",".bmp"];function u(e){let t=n(e);for(let e of l){let n=`${t}${e}`;if(r.resources[n])return n}return t}function c(e){let t=r.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function p(){return Object.keys(r.missions)}e.s(["getActualResourceKey",()=>o,"getMissionInfo",()=>c,"getMissionList",()=>p,"getResourceKey",()=>n,"getResourceList",()=>a,"getResourceMap",()=>s,"getSourceAndPath",()=>i,"getStandardTextureResourceKey",()=>u],91996),e.s(["parse",()=>q,"runServer",()=>W],86608);var f=e.i(92552);function h(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let d={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class g{indent;runtime;functions;globals;locals;indentLevel=0;currentClass=null;currentFunction=null;constructor(e={}){this.indent=e.indent??" ",this.runtime=e.runtime??"$",this.functions=e.functions??"$f",this.globals=e.globals??"$g",this.locals=e.locals??"$l"}getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),r="global"===e.scope?this.globals:this.locals;return{getter:`${r}.get(${t})`,setter:e=>`${r}.set(${t}, ${e})`,postIncHelper:`${r}.postInc(${t})`,postDecHelper:`${r}.postDec(${t})`}}if("MemberExpression"===e.type){let t=this.expression(e.object),r="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:`${this.runtime}.prop(${t}, ${r})`,setter:e=>`${this.runtime}.setProp(${t}, ${r}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${t}, ${r})`,postDecHelper:`${this.runtime}.propPostDec(${t}, ${r})`}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals,s=t.join(", ");return{getter:`${n}.get(${r}, ${s})`,setter:e=>`${n}.set(${r}, ${s}, ${e})`,postIncHelper:`${n}.postInc(${r}, ${s})`,postDecHelper:`${n}.postDec(${r}, ${s})`}}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return{getter:`${this.runtime}.prop(${n}, ${i})`,setter:e=>`${this.runtime}.setProp(${n}, ${i}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${n}, ${i})`,postDecHelper:`${this.runtime}.propPostDec(${n}, ${i})`}}let r=this.expression(e.object),n=1===t.length?t[0]:`${this.runtime}.key(${t.join(", ")})`;return{getter:`${this.runtime}.getIndex(${r}, ${n})`,setter:e=>`${this.runtime}.setIndex(${r}, ${n}, ${e})`,postIncHelper:`${this.runtime}.indexPostInc(${r}, ${n})`,postDecHelper:`${this.runtime}.indexPostDec(${r}, ${n})`}}return null}generate(e){let t=[];for(let r of e.body){let e=this.statement(r);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line(`${this.expression(e.expression)};`);case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line(`${this.objectDeclaration(e)};`);case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error(`Unknown statement type: ${e.type}`)}}functionDeclaration(e){let t=h(e.name.name);if(t){let r=t.namespace,n=t.method;this.currentClass=r.toLowerCase(),this.currentFunction=n.toLowerCase();let s=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,`${this.line(`${this.runtime}.registerMethod(${JSON.stringify(r)}, ${JSON.stringify(n)}, function() {`)} -${s} -${this.line("});")}`}{let t=e.name.name;this.currentFunction=t.toLowerCase();let r=this.functionBody(e.body,e.params);return this.currentFunction=null,`${this.line(`${this.runtime}.registerFunction(${JSON.stringify(t)}, function() {`)} -${r} -${this.line("});")}`}}functionBody(e,t){this.indentLevel++;let r=[];r.push(this.line(`const ${this.locals} = ${this.runtime}.locals();`));for(let e=0;ethis.statement(e)).join("\n\n");return this.indentLevel--,`${this.line(`${this.runtime}.package(${t}, function() {`)} -${r} -${this.line("});")}`}datablockDeclaration(e){let t=JSON.stringify(e.className.name),r=e.instanceName?JSON.stringify(e.instanceName.name):"null",n=e.parent?JSON.stringify(e.parent.name):"null",s=this.objectBody(e.body);return this.line(`${this.runtime}.datablock(${t}, ${r}, ${n}, ${s});`)}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),r=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),n=[],s=[];for(let t of e.body)"Assignment"===t.type?n.push(t):s.push(t);let i=this.objectBody(n);if(s.length>0){let e=s.map(e=>this.objectDeclaration(e)).join(",\n");return`${this.runtime}.create(${t}, ${r}, ${i}, [ -${e} -])`}return`${this.runtime}.create(${t}, ${r}, ${i})`}objectBody(e){if(0===e.length)return"{}";let t=[];for(let r of e)if("Assignment"===r.type){let e=this.expression(r.value);if("Identifier"===r.target.type){let n=r.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?t.push(`${n}: ${e}`):t.push(`[${JSON.stringify(n)}]: ${e}`)}else if("IndexExpression"===r.target.type){let n=this.objectPropertyKey(r.target);t.push(`[${n}]: ${e}`)}else{let n=this.expression(r.target);t.push(`[${n}]: ${e}`)}}if(t.length<=1)return`{ ${t.join(", ")} }`;let r=this.indent.repeat(this.indentLevel+1),n=this.indent.repeat(this.indentLevel);return`{ -${r}${t.join(",\n"+r)} -${n}}`}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),r=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return`${this.runtime}.key(${t}, ${r})`}ifStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let n=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line(`if (${t}) ${r} else ${n}`)}else{let n=this.statementAsBlock(e.alternate);return this.line(`if (${t}) ${r} else ${n}`)}return this.line(`if (${t}) ${r}`)}forStatement(e){let t=e.init?this.expression(e.init):"",r=e.test?this.expression(e.test):"",n=e.update?this.expression(e.update):"",s=this.statementAsBlock(e.body);return this.line(`for (${t}; ${r}; ${n}) ${s}`)}whileStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.body);return this.line(`while (${t}) ${r}`)}doWhileStatement(e){let t=this.statementAsBlock(e.body),r=this.expression(e.test);return this.line(`do ${t} while (${r});`)}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let r=[];for(let t of e.cases)r.push(this.switchCase(t));return this.indentLevel--,`${this.line(`switch (${t}) {`)} -${r.join("\n")} -${this.line("}")}`}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let r of e.test)t.push(this.line(`case ${this.expression(r)}:`));else t.push(this.line(`case ${this.expression(e.test)}:`));for(let r of(this.indentLevel++,e.consequent))t.push(this.statement(r));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),r=[];for(let t of e.cases)if(null===t.test)r.push(`default: () => { ${this.blockContent(t.consequent)} }`);else if(Array.isArray(t.test))for(let e of t.test)r.push(`${this.expression(e)}: () => { ${this.blockContent(t.consequent)} }`);else r.push(`${this.expression(t.test)}: () => { ${this.blockContent(t.consequent)} }`);return this.line(`${this.runtime}.switchStr(${t}, { ${r.join(", ")} });`)}returnStatement(e){return e.value?this.line(`return ${this.expression(e.value)};`):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,`{ -${t} -${this.line("}")}`}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,`{ -${t} -${this.line("}")}`}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return`(${this.expression(e.test)} ? ${this.expression(e.consequent)} : ${this.expression(e.alternate)})`;case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return`${this.runtime}.deref(${this.expression(e.argument)})`;case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return`${this.runtime}.datablock(${JSON.stringify(e.className.name)}, ${e.instanceName?JSON.stringify(e.instanceName.name):"null"}, ${e.parent?JSON.stringify(e.parent.name):"null"}, ${this.objectBody(e.body)})`;default:throw Error(`Unknown expression type: ${e.type}`)}}identifier(e){let t=h(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?`${this.runtime}.nsRef(${JSON.stringify(t.namespace)}, ${JSON.stringify(t.method)})`:JSON.stringify(e.name)}variable(e){return"global"===e.scope?`${this.globals}.get(${JSON.stringify(e.name)})`:`${this.locals}.get(${JSON.stringify(e.name)})`}binaryExpression(e){let t=this.expression(e.left),r=this.expression(e.right),n=e.operator,s=this.concatExpression(t,n,r);if(s)return s;if("$="===n)return`${this.runtime}.streq(${t}, ${r})`;if("!$="===n)return`!${this.runtime}.streq(${t}, ${r})`;if("&&"===n||"||"===n)return`(${t} ${n} ${r})`;let i=d[n];return i?`${i}(${t}, ${r})`:`(${t} ${n} ${r})`}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?1:-1;return t.setter(`${this.runtime}.add(${t.getter}, ${r})`)}}let t=this.expression(e.argument);return"~"===e.operator?`${this.runtime}.bitnot(${t})`:"-"===e.operator?`${this.runtime}.neg(${t})`:`${e.operator}${t}`}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?t.postIncHelper:t.postDecHelper;if(r)return r}return`${this.expression(e.argument)}${e.operator}`}assignmentExpression(e){let t=this.expression(e.value),r=e.operator,n=this.getAccessInfo(e.target);if(!n)throw Error(`Unhandled assignment target type: ${e.target.type}`);if("="===r)return n.setter(t);{let e=r.slice(0,-1),s=this.compoundAssignmentValue(n.getter,e,t);return n.setter(s)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let r=e.callee.name,n=h(r);if(n&&"parent"===n.namespace.toLowerCase())if(this.currentClass)return`${this.runtime}.parent(${JSON.stringify(this.currentClass)}, ${JSON.stringify(n.method)}, arguments[0]${t?", "+t:""})`;else if(this.currentFunction)return`${this.runtime}.parentFunc(${JSON.stringify(this.currentFunction)}${t?", "+t:""})`;else throw Error("Parent:: call outside of function context");return n?`${this.runtime}.nsCall(${JSON.stringify(n.namespace)}, ${JSON.stringify(n.method)}${t?", "+t:""})`:`${this.functions}.call(${JSON.stringify(r)}${t?", "+t:""})`}if("MemberExpression"===e.callee.type){let r=this.expression(e.callee.object),n="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return`${this.runtime}.call(${r}, ${n}${t?", "+t:""})`}let r=this.expression(e.callee);return`${r}(${t})`}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?`${this.runtime}.prop(${t}, ${this.expression(e.property)})`:`${this.runtime}.prop(${t}, ${JSON.stringify(e.property.name)})`}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals;return`${n}.get(${r}, ${t.join(", ")})`}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return`${this.runtime}.prop(${n}, ${i})`}let r=this.expression(e.object);return 1===t.length?`${this.runtime}.getIndex(${r}, ${t[0]})`:`${this.runtime}.getIndex(${r}, ${this.runtime}.key(${t.join(", ")}))`}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,r){switch(t){case"@":return`${this.runtime}.concat(${e}, ${r})`;case"SPC":return`${this.runtime}.concat(${e}, " ", ${r})`;case"TAB":return`${this.runtime}.concat(${e}, "\\t", ${r})`;case"NL":return`${this.runtime}.concat(${e}, "\\n", ${r})`;default:return null}}compoundAssignmentValue(e,t,r){let n=this.concatExpression(e,t,r);if(n)return n;let s=d[t];return s?`${s}(${e}, ${r})`:`(${e} ${t} ${r})`}}e.s(["createRuntime",()=>G,"createScriptCache",()=>P],33870);var m=e.i(54970);class b{map=new Map;keyLookup=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let r=e.toLowerCase(),n=this.keyLookup.get(r);return void 0!==n?this.map.set(n,t):(this.keyLookup.set(r,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),r=this.keyLookup.get(t);return void 0!==r&&(this.keyLookup.delete(t),this.map.delete(r))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,r]of this.map)e(r,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}}class ${set=new Set;constructor(e){if(e)for(const t of e)this.add(t)}get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}}function y(e){return e.replace(/\\/g,"/").toLowerCase()}function x(e){return String(e??"")}function A(e){return Number(e)||0}function C(e){let t=x(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function S(e,t,r){let n=0;for(;t+n0;){if(n>=e.length)return"";let s=S(e,n,r);if(n+s>=e.length)return"";n+=s+1,t--}let s=S(e,n,r);return 0===s?"":e.substring(n,n+s)}function w(e,t,r,n){let s=0,i=t;for(;i>0;){if(s>=e.length)return"";let t=S(e,s,n);if(s+t>=e.length)return"";s+=t+1,i--}let o=s,a=r-t+1;for(;a>0;){let t=S(e,s,n);if((s+=t)>=e.length)break;s++,a--}let l=s;return l>o&&n.includes(e[l-1])&&l--,e.substring(o,l)}function E(e,t){if(""===e)return 0;let r=0;for(let n=0;nt&&o>=e.length)break}return i.join(s)}function k(e,t,r,n){let s=[],i=0,o=0;for(;it().$f.call(x(e),...r),eval(e){throw Error("eval() not implemented: requires runtime parsing and execution")},collapseescape:e=>x(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>x(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,r){console.warn(`export(${e}): not implemented`)},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>x(e).length,strchr(e,t){let r=x(e),n=x(t)[0]??"",s=r.indexOf(n);return s>=0?r.substring(s):""},strpos:(e,t,r)=>x(e).indexOf(x(t),A(r)),strcmp(e,t){let r=x(e),n=x(t);return rn)},stricmp(e,t){let r=x(e).toLowerCase(),n=x(t).toLowerCase();return rn)},strstr:(e,t)=>x(e).indexOf(x(t)),getsubstr(e,t,r){let n=x(e),s=A(t);return void 0===r?n.substring(s):n.substring(s,s+A(r))},getword:(e,t)=>v(x(e),A(t)," \n"),getwordcount:e=>E(x(e)," \n"),getfield:(e,t)=>v(x(e),A(t)," \n"),getfieldcount:e=>E(x(e)," \n"),setword:(e,t,r)=>_(x(e),A(t),x(r)," \n"," "),setfield:(e,t,r)=>_(x(e),A(t),x(r)," \n"," "),firstword:e=>v(x(e),0," \n"),restwords:e=>w(x(e),1,1e6," \n"),trim:e=>x(e).trim(),ltrim:e=>x(e).replace(/^\s+/,""),rtrim:e=>x(e).replace(/\s+$/,""),strupr:e=>x(e).toUpperCase(),strlwr:e=>x(e).toLowerCase(),strreplace:(e,t,r)=>x(e).split(x(t)).join(x(r)),filterstring:(e,t)=>x(e),stripchars(e,t){let r=x(e),n=new Set(x(t).split(""));return r.split("").filter(e=>!n.has(e)).join("")},getfields(e,t,r){let n=void 0!==r?Number(r):1e6;return w(x(e),A(t),n," \n")},getwords(e,t,r){let n=void 0!==r?Number(r):1e6;return w(x(e),A(t),n," \n")},removeword:(e,t)=>k(x(e),A(t)," \n"," "),removefield:(e,t)=>k(x(e),A(t)," \n"," "),getrecord:(e,t)=>v(x(e),A(t),"\n"),getrecordcount:e=>E(x(e),"\n"),setrecord:(e,t,r)=>_(x(e),A(t),x(r),"\n","\n"),removerecord:(e,t)=>k(x(e),A(t),"\n","\n"),nexttoken(e,t,r){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>x(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(A(e)),mfloor:e=>Math.floor(A(e)),mceil:e=>Math.ceil(A(e)),msqrt:e=>Math.sqrt(A(e)),mpow:(e,t)=>Math.pow(A(e),A(t)),msin:e=>Math.sin(A(e)),mcos:e=>Math.cos(A(e)),mtan:e=>Math.tan(A(e)),masin:e=>Math.asin(A(e)),macos:e=>Math.acos(A(e)),matan:(e,t)=>Math.atan2(A(e),A(t)),mlog:e=>Math.log(A(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(A(e)+1));let r=A(e);return Math.floor(Math.random()*(A(t)-r+1))+r},mdegtorad:e=>A(e)*(Math.PI/180),mradtodeg:e=>A(e)*(180/Math.PI),mfloatlength:(e,t)=>A(e).toFixed(A(t)),getboxcenter(e){let t=x(e).split(" ").map(Number),r=t[0]||0,n=t[1]||0,s=t[2]||0,i=t[3]||0,o=t[4]||0,a=t[5]||0;return`${(r+i)/2} ${(n+o)/2} ${(s+a)/2}`},vectoradd(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${r+i} ${n+o} ${s+a}`},vectorsub(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${r-i} ${n-o} ${s-a}`},vectorscale(e,t){let[r,n,s]=C(e),i=A(t);return`${r*i} ${n*i} ${s*i}`},vectordot(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return r*i+n*o+s*a},vectorcross(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${n*a-s*o} ${s*i-r*a} ${r*o-n*i}`},vectorlen(e){let[t,r,n]=C(e);return Math.sqrt(t*t+r*r+n*n)},vectornormalize(e){let[t,r,n]=C(e),s=Math.sqrt(t*t+r*r+n*n);return 0===s?"0 0 0":`${t/s} ${r/s} ${n/s}`},vectordist(e,t){let[r,n,s]=C(e),[i,o,a]=C(t),l=r-i,u=n-o,c=s-a;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,r,n,...s){let i=Number(e)||0,o=t(),a=setTimeout(()=>{o.state.pendingTimeouts.delete(a);try{o.$f.call(String(n),...s)}catch(e){throw console.error(`schedule: error calling ${n}:`,e),e}},i);return o.state.pendingTimeouts.add(a),a},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let r=String(e??"");if(console.debug(`exec(${JSON.stringify(r)}): preparing to execute…`),!r.includes("."))return console.error(`exec: invalid script file name ${JSON.stringify(r)}.`),!1;let n=y(r),s=t(),{executedScripts:i,scripts:o}=s.state;if(i.has(n))return console.debug(`exec(${JSON.stringify(r)}): skipping (already executed)`),!0;let a=o.get(n);return null==a?(console.warn(`exec(${JSON.stringify(r)}): script not found`),!1):(i.add(n),console.debug(`exec(${JSON.stringify(r)}): executing!`),s.executeAST(a),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>r?r.isFile(x(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=x(e),r=t.lastIndexOf(".");return r>=0?t.substring(r):""},filebase(e){let t=x(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),n=t.lastIndexOf("."),s=r>=0?r+1:0,i=n>s?n:t.length;return t.substring(s,i)},filepath(e){let t=x(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.substring(0,r):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile:e=>r?(i=x(e),n=r.findFiles(i),s=0,n[s++]??""):(console.warn("findFirstFile(): no fileSystem handler configured"),""),findnextfile(e){let t=x(e);if(t!==i){if(!r)return"";i=t,n=r.findFiles(t)}return n[s++]??""},getfilecrc:e=>x(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(x(e))},deactivatepackage(e){t().$.deactivatePackage(x(e))},ispackage:e=>t().$.isPackage(x(e)),isactivepackage:e=>t().$.isActivePackage(x(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource:(...e)=>0,alxgetwavelen:e=>0,alxlistenerf(e,t){},alxplay:(...e)=>0,alxsetchannelvolume(e,t){},alxsourcef(e,t,r){},alxstop(e){},alxstopall(){},activatedirectinput(){},activatekeyboard(){},deactivatedirectinput(){},deactivatekeyboard(){},disablejoystick(){},enablejoystick(){},enablewinconsole(e){},isjoystickdetected:()=>!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,r,n){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring:(e,...t)=>"",detag:e=>x(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){},commandtoserver(e){},cancelserverquery(){},querymasterserver(){},querysingleserver(){},setnetport:e=>!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty:(...e)=>!0,containerraycast:(...e)=>"",containersearchcurrdist:()=>0,containersearchnext:()=>0,initcontainerradiussearch(){},calcexplosioncoverage:(...e)=>1,getcontrolobjectaltitude:()=>0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){},pathonmissionloaddone(){}}}function L(e){return e.toLowerCase()}function N(e){let t=e.trim();return L(t.startsWith("$")?t.slice(1):t)}function O(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function I(e,t){for(let r of t)e.add(L(r))}function j(e,t,r){if(e.anyClassValues.has("*")||e.anyClassValues.has(r))return!0;for(let n of t){let t=e.valuesByClass.get(L(n));if(t&&(t.has("*")||t.has(r)))return!0}return!1}let T=[{classNames:["SceneObject","GameBase","ShapeBase","Item","Player"],fields:["position","rotation","scale","transform","hidden","renderingdistance","datablock","shapename","shapefile","initialbarrel","skin","team","health","energy","energylevel","damagelevel","damageflash","damagepercent","damagestate","mountobject","mountedimage","targetposition","targetrotation","targetscale","missiontypeslist","renderenabled","vis","velocity","name"]},{classNames:["*"],fields:["position","rotation","scale","hidden","shapefile","datablock"]}],M=[{classNames:["SceneObject","GameBase","ShapeBase","SimObject"],methods:["settransform","setposition","setrotation","setscale","sethidden","setdatablock","setshapename","mountimage","unmountimage","mountobject","unmountobject","setdamagelevel","setenergylevel","schedule","delete","deleteallobjects","add","remove","playthread","stopthread","setthreaddir","pausethread"]},{classNames:["*"],methods:["settransform","setscale","delete","add","remove"]}],B=["missionrunning","loadingmission"];function P(){return{scripts:new Map,generatedCode:new WeakMap}}function H(e){return e.toLowerCase()}function D(e){return Number(e)>>>0}function F(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error(`Invalid instance name type: ${typeof e}`)}function G(e={}){let t,r,n,s=e.reactiveFieldRules??T,i=e.reactiveMethodRules??M,o=e.reactiveGlobalNames??B,a=(t=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=L(e);if("*"===s){I(t,n.fields);continue}I(O(r,s),n.fields)}return{anyClassValues:t,valuesByClass:r}}(s),(e,r)=>j(t,e,L(r))),l=(r=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=L(e);if("*"===s){I(t,n.methods);continue}I(O(r,s),n.methods)}return{anyClassValues:t,valuesByClass:r}}(i),(e,t)=>j(r,e,L(t))),u=(n=function(e){let t=new Set;for(let r of e)t.add(N(r));return t}(o),e=>{let t=N(e);return n.has("*")||n.has(t)}),c=new b,p=new b,f=new b,h=[],d=new $,x=3,A=1027,C=new Map,S=new b,v=new b,w=new b,E=new b,_=new b,k=new Set,U=[],J=!1,K=0;if(e.globals)for(let[t,r]of Object.entries(e.globals)){if(!t.startsWith("$"))throw Error(`Global variable "${t}" must start with $, e.g. "$${t}"`);w.set(t.slice(1),r)}let W=new Set,z=new Set,V=e.ignoreScripts&&e.ignoreScripts.length>0?(0,m.default)(e.ignoreScripts,{nocase:!0}):null,Z=e.cache??P(),Q=Z.scripts,X=Z.generatedCode,Y=new Map;function ee(e){let t=Y.get(e);return t&&t.length>0?t[t.length-1]:void 0}function et(e,t,r){let n;(n=Y.get(e))||(n=[],Y.set(e,n)),n.push(t);try{return r()}finally{let t;(t=Y.get(e))&&t.pop()}}function er(e,t){return`${e.toLowerCase()}::${t.toLowerCase()}`}function en(e,t){return c.get(e)?.get(t)??null}function es(e){if(!e)return[];let t=[],r=new Set,n=e.class||e._className||e._class,s=n?H(String(n)):"";for(;s&&!r.has(s);)t.push(s),r.add(s),s=_.get(s)??"";return e._superClass&&!r.has(e._superClass)&&t.push(e._superClass),t}function ei(){if(J=!1,0===U.length)return;let e=U.splice(0,U.length);for(let t of(K+=1,k))t({type:"batch.flushed",tick:K,events:e})}function eo(e){for(let t of(U.push(e),k))t(e);J||(J=!0,queueMicrotask(ei))}function ea(e){eo({type:"object.created",objectId:e._id,object:e})}function el(e,t,r,n){let s=H(t);Object.is(r,n)||a(es(e),s)&&eo({type:"field.changed",objectId:e._id,field:s,value:r,previousValue:n,object:e})}let eu=new Set,ec=null,ep=null,ef=(e.builtins??R)({runtime:()=>ep,fileSystem:e.fileSystem??null});function eh(e){let t=f.get(e);if(!t)return void d.add(e);if(!t.active){for(let[e,r]of(t.active=!0,h.push(t.name),t.methods)){c.has(e)||c.set(e,new b);let t=c.get(e);for(let[e,n]of r)t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[e,r]of t.functions)p.has(e)||p.set(e,[]),p.get(e).push(r)}}function ed(e){return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?S.get(e)??null:"number"==typeof e?C.get(e)??null:null}function eg(e,t,r){let n=ed(e);if(null==n)return 0;let s=ey(n[t]);return n[t]=s+r,el(n,t,n[t],s),s}function em(e,t){let r=en(e,t);return r&&r.length>0?r[r.length-1]:null}function eb(e,t,r,n){let s=en(e,t);return s&&0!==s.length?{found:!0,result:et(er(e,t),s.length-1,()=>s[s.length-1](r,...n))}:{found:!1}}function e$(e,t,r,n){let s;l((s=es(r)).length?s:[e],t)&&eo({type:"method.called",className:H(e),methodName:H(t),objectId:r._id,args:[...n]});let i=E.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(r,...n)}}function ey(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function ex(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),r=null;for(let e=0;et._name?.toLowerCase()===e)??null}if(!r)return null}}return r}function eA(e){return null==e||""===e?null:ex(String(e))}function eC(e,t){function r(e,t){return e+t.join("_")}return{get:(t,...n)=>e.get(r(t,n))??"",set(n,...s){if(0===s.length)throw Error("set() requires at least a value argument");if(1===s.length){let r=e.get(n);return e.set(n,s[0]),t?.onSet?.(n,s[0],r),s[0]}let i=s[s.length-1],o=r(n,s.slice(0,-1)),a=e.get(o);return e.set(o,i),t?.onSet?.(o,i,a),i},postInc(n,...s){let i=r(n,s),o=ey(e.get(i)),a=o+1;return e.set(i,a),t?.onSet?.(i,a,o),o},postDec(n,...s){let i=r(n,s),o=ey(e.get(i)),a=o-1;return e.set(i,a),t?.onSet?.(i,a,o),o}}}function eS(){return eC(new b)}let ev={registerMethod:function(e,t,r){if(ec)ec.methods.has(e)||ec.methods.set(e,new b),ec.methods.get(e).set(t,r);else{c.has(e)||c.set(e,new b);let n=c.get(e);n.has(t)||n.set(t,[]),n.get(t).push(r)}},registerFunction:function(e,t){ec?ec.functions.set(e,t):(p.has(e)||p.set(e,[]),p.get(e).push(t))},package:function(e,t){let r=f.get(e);r||(r={name:e,active:!1,methods:new b,functions:new b},f.set(e,r));let n=ec;ec=r,t(),ec=n,d.has(e)&&(d.delete(e),eh(e))},activatePackage:eh,deactivatePackage:function(e){let t=f.get(e);if(!t||!t.active)return;t.active=!1;let r=h.findIndex(t=>t.toLowerCase()===e.toLowerCase());for(let[e,n]of(-1!==r&&h.splice(r,1),t.methods)){let t=c.get(e);if(t)for(let[e,r]of n){let n=t.get(e);if(n){let e=n.indexOf(r);-1!==e&&n.splice(e,1)}}}for(let[e,r]of t.functions){let t=p.get(e);if(t){let e=t.indexOf(r);-1!==e&&t.splice(e,1)}}},create:function(e,t,r,n){let s=H(e),i=function(){for(;C.has(A);)A+=1;let e=A;return A+=1,e}(),o={_class:s,_className:e,_id:i};for(let[e,t]of Object.entries(r))o[H(e)]=t;o.superclass&&(o._superClass=H(String(o.superclass)),o.class&&_.set(H(String(o.class)),o._superClass)),C.set(i,o);let a=F(t);if(a&&(o._name=a,S.set(a,o)),n){for(let e of n)e._parent=o;o._children=n}let l=em(e,"onAdd");return l&&l(o),ea(o),o},datablock:function(e,t,r,n){let s=H(e),i=function(){for(;C.has(x);)x+=1;let e=x;return x+=1,e}(),o={_class:s,_className:e,_id:i,_isDatablock:!0},a=F(r);if(a){let e=v.get(a);if(e){for(let[t,r]of Object.entries(e))t.startsWith("_")||(o[t]=r);o._parent=e}}for(let[e,t]of Object.entries(n))o[H(e)]=t;C.set(i,o);let l=F(t);return l&&(o._name=l,S.set(l,o),v.set(l,o)),ea(o),o},deleteObject:function e(t){var r;let n;if(null==t||("number"==typeof t?n=C.get(t):"string"==typeof t?n=S.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let s=em(n._className,"onRemove");if(s&&s(n),C.delete(n._id),n._name&&S.delete(n._name),n._isDatablock&&n._name&&v.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return eo({type:"object.deleted",objectId:(r=n)._id,object:r}),!0},prop:function(e,t){let r=ed(e);return null==r?"":r[H(t)]??""},setProp:function(e,t,r){let n=ed(e);if(null==n)return r;let s=H(t),i=n[s];return n[s]=r,el(n,s,r,i),r},getIndex:function(e,t){let r=ed(e);return null==r?"":r[String(t)]??""},setIndex:function(e,t,r){let n=ed(e);if(null==n)return r;let s=String(t),i=n[s];return n[s]=r,el(n,s,r,i),r},propPostInc:function(e,t){return eg(e,H(t),1)},propPostDec:function(e,t){return eg(e,H(t),-1)},indexPostInc:function(e,t){return eg(e,String(t),1)},indexPostDec:function(e,t){return eg(e,String(t),-1)},key:function(e,...t){return e+t.join("_")},call:function(e,t,...r){if(null==e||("string"==typeof e||"number"==typeof e)&&null==(e=eA(e)))return"";let n=e.class||e._className||e._class;if(n){let s=eb(n,t,e,r);if(s.found)return e$(n,t,e,r),s.result}let s=e._superClass||_.get(n);for(;s;){let n=eb(s,t,e,r);if(n.found)return e$(s,t,e,r),n.result;s=_.get(s)}return""},nsCall:function(e,t,...r){let n=en(e,t);if(!n||0===n.length)return"";let s=er(e,t),i=n[n.length-1],o=et(s,n.length-1,()=>i(...r)),a=r[0];return a&&"object"==typeof a&&e$(e,t,a,r.slice(1)),o},nsRef:function(e,t){let r=en(e,t);if(!r||0===r.length)return null;let n=er(e,t),s=r[r.length-1];return(...e)=>et(n,r.length-1,()=>s(...e))},parent:function(e,t,r,...n){let s=en(e,t),i=er(e,t),o=ee(i);if(s&&void 0!==o&&o>=1){let a=o-1,l=et(i,a,()=>s[a](r,...n));return r&&"object"==typeof r&&e$(e,t,r,n),l}let a=_.get(e);for(;a;){let e=en(a,t);if(e&&e.length>0){let s=et(er(a,t),e.length-1,()=>e[e.length-1](r,...n));return r&&"object"==typeof r&&e$(a,t,r,n),s}a=_.get(a)}return""},parentFunc:function(e,...t){let r=p.get(e);if(!r)return"";let n=e.toLowerCase(),s=ee(n);if(void 0===s||s<1)return"";let i=s-1;return et(n,i,()=>r[i](...t))},add:function(e,t){return ey(e)+ey(t)},sub:function(e,t){return ey(e)-ey(t)},mul:function(e,t){return ey(e)*ey(t)},div:function(e,t){return ey(e)/ey(t)},neg:function(e){return-ey(e)},lt:function(e,t){return ey(e)ey(t)},ge:function(e,t){return ey(e)>=ey(t)},eq:function(e,t){return ey(e)===ey(t)},ne:function(e,t){return ey(e)!==ey(t)},mod:function(e,t){let r=0|Number(t);return 0===r?0:(0|Number(e))%r},bitand:function(e,t){return D(e)&D(t)},bitor:function(e,t){return D(e)|D(t)},bitxor:function(e,t){return D(e)^D(t)},shl:function(e,t){return D(D(e)<<(31&D(t)))},shr:function(e,t){return D(e)>>>(31&D(t))},bitnot:function(e){return~D(e)>>>0},concat:function(...e){return e.map(e=>String(e??"")).join("")},streq:function(e,t){return String(e??"").toLowerCase()===String(t??"").toLowerCase()},switchStr:function(e,t){let r=String(e??"").toLowerCase();for(let[e,n]of Object.entries(t))if("default"!==e&&H(e)===r)return void n();t.default&&t.default()},deref:eA,nameToId:function(e){let t=ex(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?C.has(e):"string"==typeof e&&S.has(e)))},isFunction:function(e){return p.has(e)||e.toLowerCase()in ef},isPackage:function(e){return f.has(e)},isActivePackage:function(e){let t=f.get(e);return t?.active??!1},getPackageList:function(){return h.join(" ")},locals:eS,onMethodCalled(e,t,r){let n=E.get(e);n||(n=new b,E.set(e,n));let s=n.get(t);return s||(s=[],n.set(t,s)),s.push(r),()=>{let e=s.indexOf(r);-1!==e&&s.splice(e,1)}}},ew={call(e,...t){let r=p.get(e);if(r&&r.length>0)return et(e.toLowerCase(),r.length-1,()=>r[r.length-1](...t));let n=ef[e.toLowerCase()];return n?n(...t):(console.warn(`Unknown function: ${e}(${t.map(e=>JSON.stringify(e)).join(", ")})`),"")}},eE=eC(w,{onSet:function(e,t,r){let n=H(e.startsWith("$")?e.slice(1):e);Object.is(t,r)||u(n)&&eo({type:"global.changed",name:n,value:t,previousValue:r})}}),e_={methods:c,functions:p,packages:f,activePackages:h,objectsById:C,objectsByName:S,datablocks:v,globals:w,executedScripts:W,failedScripts:z,scripts:Q,generatedCode:X,pendingTimeouts:eu,startTime:Date.now()};function ek(e){let t=function(e){let t=X.get(e);null==t&&(t=new g(void 0).generate(e),X.set(e,t));return t}(e),r=eS();Function("$","$f","$g","$l",t)(ev,ew,eE,r)}function eR(e,t){return{execute(){if(t){let e=y(t);e_.executedScripts.add(e)}ek(e)}}}async function eL(t,r,n){let s=e.loadScript;if(!s){t.length>0&&console.warn("Script has exec() calls but no loadScript provided:",t);return}async function i(t){e.signal?.throwIfAborted();let i=y(t);if(e_.scripts.has(i)||e_.failedScripts.has(i))return;if(V&&V(i)){console.warn(`Ignoring script: ${t}`),e_.failedScripts.add(i);return}if(n.has(i))return;let o=r.get(i);if(o)return void await o;e.progress?.addItem(t);let a=(async()=>{let o,a=await s(t);if(null==a){console.warn(`Script not found: ${t}`),e_.failedScripts.add(i),e.progress?.completeItem();return}try{o=q(a,{filename:t})}catch(r){console.warn(`Failed to parse script: ${t}`,r),e_.failedScripts.add(i),e.progress?.completeItem();return}let l=new Set(n);l.add(i),await eL(o.execScriptPaths,r,l),e_.scripts.set(i,o),e.progress?.completeItem()})();r.set(i,a),await a}await Promise.all(t.map(i))}async function eN(t){let r=e.loadScript;if(!r)throw Error("loadFromPath requires loadScript option to be set");let n=y(t);if(e_.scripts.has(n))return eR(e_.scripts.get(n),t);e.progress?.addItem(t);let s=await r(t);if(null==s)throw e.progress?.completeItem(),Error(`Script not found: ${t}`);let i=await eO(s,{path:t});return e.progress?.completeItem(),i}async function eO(e,t){if(t?.path){let e=y(t.path);if(e_.scripts.has(e))return eR(e_.scripts.get(e),t.path)}return eI(q(e,{filename:t?.path}),t)}async function eI(t,r){let n=new Map,s=new Set;if(r?.path){let e=y(r.path);e_.scripts.set(e,t),s.add(e)}let i=[...t.execScriptPaths,...e.preloadScripts??[]];return await eL(i,n,s),eR(t,r?.path)}return ep={$:ev,$f:ew,$g:eE,state:e_,destroy:function(){for(let e of(U.length>0&&ei(),e_.pendingTimeouts))clearTimeout(e);e_.pendingTimeouts.clear(),k.clear()},executeAST:ek,loadFromPath:eN,loadFromSource:eO,loadFromAST:eI,call:(e,...t)=>ew.call(e,...t),getObjectByName:e=>S.get(e),subscribeRuntimeEvents:e=>(k.add(e),()=>{k.delete(e)})}}function U(){let e=new Set,t=0,r=0,n=null;function s(){for(let t of e)t()}return{get total(){return t},get loaded(){return r},get current(){return n},get progress(){return 0===t?0:r/t},on(t,r){e.add(r)},off(t,r){e.delete(r)},addItem(e){t++,n=e,s()},completeItem(){r++,n=null,s()},setCurrent(e){n=e,s()}}}function q(e,t){try{return f.default.parse(e)}catch(e){if(t?.filename&&e.location)throw Error(`${t.filename}:${e.location.start.line}:${e.location.start.column}: ${e.message}`,{cause:e});throw e}}function J(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();return""!==t&&"0"!==t&&"false"!==t}return!!e}function K(){let e=Error("Operation aborted");return e.name="AbortError",e}function W(e){let t,{missionName:r,missionType:n,runtimeOptions:s,onMissionLoadDone:i}=e,{signal:o,fileSystem:a,globals:l={},preloadScripts:u=[],reactiveGlobalNames:c}=s??{},p=a?.findFiles("scripts/*Game.cs")??[],f=c?Array.from(new Set([...c,"missionRunning"])):void 0,h=G({...s,reactiveGlobalNames:f,globals:{...l,"$Host::Map":r,"$Host::MissionType":n},preloadScripts:[...u,...p]});(t=h.$.registerMethod.bind(h.$))("ShapeBase","playThread",(e,t,r)=>{e._threads||(e._threads={}),e._threads[Number(t)]={sequence:String(r),playing:!0,direction:!0}}),t("ShapeBase","stopThread",(e,t)=>{e._threads&&delete e._threads[Number(t)]}),t("ShapeBase","setThreadDir",(e,t,r)=>{e._threads||(e._threads={});let n=Number(t);e._threads[n]?e._threads[n].direction=!!Number(r):e._threads[n]={sequence:"",playing:!1,direction:!!Number(r)}}),t("ShapeBase","pauseThread",(e,t)=>{e._threads?.[Number(t)]&&(e._threads[Number(t)].playing=!1)}),t("ShapeBase","playAudio",()=>{}),t("ShapeBase","stopAudio",()=>{}),t("SimObject","getDatablock",e=>{let t=e.datablock;return t?h.getObjectByName(String(t))??"":""}),t("SimObject","getGroup",e=>e._parent??""),t("SimObject","getName",e=>e._name??""),t("SimObject","getType",()=>16384),t("SimGroup","getCount",e=>e._children?e._children.length:0),t("SimGroup","getObject",(e,t)=>{let r=e._children;return r?r[Number(t)]??"":""}),t("GameBase","isEnabled",()=>!0),t("GameBase","isDisabled",()=>!1),t("GameBase","setPoweredState",()=>{}),t("GameBase","setRechargeRate",()=>{}),t("GameBase","getRechargeRate",()=>0),t("GameBase","setEnergyLevel",()=>{}),t("GameBase","getEnergyLevel",()=>0),t("ShapeBase","getDamageLevel",()=>0),t("ShapeBase","setDamageLevel",()=>{}),t("ShapeBase","getRepairRate",()=>0),t("ShapeBase","setRepairRate",()=>{}),t("ShapeBase","getDamagePercent",()=>0),t("GameBase","getControllingClient",()=>0),t("SimObject","schedule",(e,t,r,...n)=>{let s=setTimeout(()=>{h.state.pendingTimeouts.delete(s);try{h.$.call(e,String(r),...n)}catch(t){console.error(`schedule: error calling ${r} on ${e._id}:`,t)}},Number(t)||0);return h.state.pendingTimeouts.add(s),s});let d=async function(){try{let e=await h.loadFromPath("scripts/server.cs");o?.throwIfAborted(),await h.loadFromPath(`missions/${r}.mis`),o?.throwIfAborted(),e.execute();let t=function(e,t){let{signal:r,onMissionLoadDone:n}=t;return new Promise((t,s)=>{let i=!1,o=!1,a=()=>J(e.$g.get("missionRunning")),l=()=>{i||(i=!0,h(),t())},u=e=>{i||(i=!0,h(),s(e))},c=t=>{if(!n||o)return;let r=t??e.getObjectByName("Game");r&&(o=!0,n(r))},p=()=>u(K()),f=e.subscribeRuntimeEvents(e=>{if("global.changed"===e.type&&"missionrunning"===e.name){J(e.value)&&(c(),l());return}"batch.flushed"===e.type&&a()&&(c(),l())});function h(){f(),r?.removeEventListener("abort",p)}if(r){if(r.aborted)return void u(K());r.addEventListener("abort",p,{once:!0})}a()&&(c(),l())})}(h,{signal:o,onMissionLoadDone:i}),n=await h.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");o?.throwIfAborted(),n.execute(),await t}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:h,ready:d}}e.s(["createProgressTracker",()=>U],38433);let z=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,V=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,Z=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i,Q={arena:"Arena",bounty:"Bounty",cnh:"CnH",ctf:"CTF",dm:"DM",dnd:"DnD",hunters:"Hunters",lakrabbit:"LakRabbit",lakzm:"LakZM",lctf:"LCTF",none:"None",rabbit:"Rabbit",sctf:"SCtF",siege:"Siege",singleplayer:"SinglePlayer",tdm:"TDM",teamhunters:"TeamHunters",teamlak:"TeamLak",tr2:"TR2"};function X(e){let t=q(e),{pragma:r,sections:n}=function(e){let t={},r=[],n={name:null,comments:[]};for(let s of e.body)if("Comment"===s.type){let e=function(e){let t;return(t=e.match(V))?{type:"sectionBegin",name:t[1]}:(t=e.match(Z))?{type:"sectionEnd",name:t[1]}:(t=e.match(z))?{type:"definition",identifier:t[1],value:t[2]}:null}(s.value);if(e)switch(e.type){case"definition":null===n.name?t[e.identifier.toLowerCase()]=e.value:n.comments.push(s.value);break;case"sectionBegin":(null!==n.name||n.comments.length>0)&&r.push(n),n={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==n.name&&r.push(n),n={name:null,comments:[]}}else n.comments.push(s.value)}return(null!==n.name||n.comments.length>0)&&r.push(n),{pragma:t,sections:r}}(t);function s(e){return n.find(t=>t.name===e)?.comments.map(e=>e.trimStart()).join("\n")??null}return{displayName:r.displayname??null,missionTypes:r.missiontypes?.split(/\s+/).filter(Boolean).map(e=>Q[e.toLowerCase()]??e)??[],missionBriefing:s("MISSION BRIEFING"),briefingWav:r.briefingwav??null,bitmap:r.bitmap??null,planetName:r.planetname??null,missionBlurb:s("MISSION BLURB"),missionQuote:s("MISSION QUOTE"),missionString:s("MISSION STRING"),execScriptPaths:t.execScriptPaths,hasDynamicExec:t.hasDynamicExec,ast:t}}function Y(e,t){if(e)return e[t.toLowerCase()]}function ee(e){let[t,r,n]=(e.position??"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}function et(e){let[t,r,n]=(e.scale??"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}e.s(["getPosition",()=>ee,"getProperty",()=>Y,"getScale",()=>et,"parseMissionScript",()=>X],62395);let er="/t2-mapper",en=`${er}/base/`,es=`${er}/magenta.png`;function ei(e,t){let r;try{r=o(e)}catch(r){if(t)return console.warn(`Resource "${e}" not found - rendering fallback.`),t;throw r}let[n,s]=i(r);return n?`${en}@vl2/${n}/${s}`:`${en}${s}`}function eo(e){return ei(`interiors/${e}`).replace(/\.dif$/i,".glb")}function ea(e){return ei(`shapes/${e}`).replace(/\.dts$/i,".glb")}function el(e){return e=e.replace(/^terrain\./,""),ei(u(`textures/terrain/${e}`),es)}function eu(e,r){let n=t(r).split("/"),s=n.length>1?n.slice(0,-1).join("/")+"/":"";return ei(u(`${s}${e}`),es)}function ec(e){return ei(u(`textures/${e}`),es)}function ep(e){return ei(`audio/${e}`).replace(/\.wav$/i,".ogg")}async function ef(e){let t=ei(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function eh(e){let t,r=c(e),n=await fetch(ei(r.resourcePath)),s=await n.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(s)}catch{t=new TextDecoder("windows-1252").decode(s)}return X(t=t.replaceAll("�","'"))}async function ed(e){let t=await fetch(ei(`terrains/${e}`));return function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),s=new Uint16Array(65536),i=[],o=e=>{let n="";for(let s=0;s0&&i.push(s)}let a=[];for(let e of i){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let s=t.getUint8(r++);e[n]=s}a.push(e)}return{version:n,textureNames:i,heightMap:s,alphaMaps:a}}(await t.arrayBuffer())}async function eg(e){let t=ei(e),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["FALLBACK_TEXTURE_URL",0,es,"RESOURCE_ROOT_URL",0,en,"audioToUrl",()=>ep,"getUrlForPath",()=>ei,"iflTextureToUrl",()=>eu,"interiorToUrl",()=>eo,"loadDetailMapList",()=>ef,"loadImageFrameList",()=>eg,"loadMission",()=>eh,"loadTerrain",()=>ed,"shapeToUrl",()=>ea,"terrainTextureToUrl",()=>el,"textureToUrl",()=>ec],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e27b13e203064a85.js b/docs/_next/static/chunks/e27b13e203064a85.js new file mode 100644 index 00000000..be8f2487 --- /dev/null +++ b/docs/_next/static/chunks/e27b13e203064a85.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12862,e=>{e.v({Joystick:"TouchJoystick-module__tcddlW__Joystick",Left:"TouchJoystick-module__tcddlW__Left TouchJoystick-module__tcddlW__Joystick",Right:"TouchJoystick-module__tcddlW__Right TouchJoystick-module__tcddlW__Joystick"})},18339,e=>{"use strict";var t=e.i(43476),o=e.i(71645),c=e.i(79123),l=e.i(66093),n=e.i(12862);function r(e){let t=e.querySelector(".back");t&&(t.style.background="rgba(3, 79, 76, 0.6)",t.style.border="1px solid rgba(0, 219, 223, 0.5)",t.style.boxShadow="inset 0 0 10px rgba(0, 0, 0, 0.7)");let o=e.querySelector(".front");o&&(o.style.background="radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)",o.style.border="2px solid rgba(255, 255, 255, 0.4)",o.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)")}function a(){let{touchMode:a}=(0,c.useControls)(),[i,s]=(0,o.useState)(null),[u,d]=(0,o.useState)(null),{moveState:f,lookState:m,setMoveState:y,setLookState:b}=(0,l.useJoystick)();(0,o.useEffect)(()=>{if(!i)return;let t=null,o=!1;return e.A(84968).then(e=>{o||(t=e.default.create({zone:i,mode:"static",position:{left:"70px",bottom:"70px"},size:120,restOpacity:.9}),r(i),t.on("move",(e,t)=>{y({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on("end",()=>{y({force:0})}))}),()=>{o=!0,t?.destroy()}},[f,i,y]),(0,o.useEffect)(()=>{if(!u)return;let t=null,o=!1;return e.A(84968).then(e=>{o||(t=e.default.create({zone:u,mode:"static",position:{right:"70px",bottom:"70px"},size:120,restOpacity:.9}),r(u),t.on("move",(e,t)=>{b({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on("end",()=>{b({force:0})}))}),()=>{o=!0,t?.destroy()}},[m,u,b]);let g=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:s,className:"dualStick"===a?n.default.Left:n.default.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:g},a),"dualStick"===a?(0,t.jsx)("div",{ref:d,className:n.default.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:g}):null]})}e.s(["TouchJoystick",()=>a])},84968,e=>{e.v(t=>Promise.all(["static/chunks/6e9a6efec350bf8d.js"].map(t=>e.l(t))).then(()=>t(90208)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e4a5074909f0df67.js b/docs/_next/static/chunks/e4a5074909f0df67.js deleted file mode 100644 index 06462906..00000000 --- a/docs/_next/static/chunks/e4a5074909f0df67.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12631,e=>{"use strict";var t=e.i(71645),a=e.i(8155);let r=e=>{let r=(0,a.createStore)(e),n=e=>(function(e,a=e=>e){let r=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>a(e.getState()),[e,a]),t.default.useCallback(()=>a(e.getInitialState()),[e,a]));return t.default.useDebugValue(r),r})(r,e);return Object.assign(n,r),n};var n=e.i(79473);let i=t.createContext(null);function o({map:e,children:a,onChange:o,domElement:s}){let l=e.map(e=>e.name+e.keys).join("-"),d=t.useMemo(()=>{let t;return(t=(0,n.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?r(t):r},[l]),c=t.useMemo(()=>[d.subscribe,d.getState,d],[l]),h=d.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:a})=>({keys:t,up:a,fn:t=>{h({[e]:t}),o&&o(e,t,c[1]())}})).reduce((e,{keys:t,fn:a,up:r=!0})=>(t.forEach(t=>e[t]={fn:a,pressed:!1,up:r}),e),{}),a=({key:e,code:a})=>{let r=t[e]||t[a];if(!r)return;let{fn:n,pressed:i,up:o}=r;r.pressed=!0,(o||!i)&&n(!0)},r=({key:e,code:a})=>{let r=t[e]||t[a];if(!r)return;let{fn:n,up:i}=r;r.pressed=!1,i&&n(!1)},n=s||window;return n.addEventListener("keydown",a,{passive:!0}),n.addEventListener("keyup",r,{passive:!0}),()=>{n.removeEventListener("keydown",a),n.removeEventListener("keyup",r)}},[s,l]),t.createElement(i.Provider,{value:c,children:a})}function s(e){let[a,r,n]=t.useContext(i);return e?n(e):[a,r]}e.s(["KeyboardControls",()=>o,"useKeyboardControls",()=>s],12631)},5729,e=>{"use strict";var t,a=e.i(43476),r=e.i(932),n=e.i(71645),i=e.i(90072),o=e.i(71753),s=e.i(15080),l=e.i(12631),d=e.i(85413),c=Object.defineProperty,h=(e,t,a)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?c(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,a};let u=new i.Euler(0,0,0,"YXZ"),g=new i.Vector3,p={type:"change"},m={type:"lock"},f={type:"unlock"},F=Math.PI/2;class v extends d.EventDispatcher{constructor(e,t){super(),h(this,"camera"),h(this,"domElement"),h(this,"isLocked"),h(this,"minPolarAngle"),h(this,"maxPolarAngle"),h(this,"pointerSpeed"),h(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(u.setFromQuaternion(this.camera.quaternion),u.y-=.002*e.movementX*this.pointerSpeed,u.x-=.002*e.movementY*this.pointerSpeed,u.x=Math.max(F-this.maxPolarAngle,Math.min(F-this.minPolarAngle,u.x)),this.camera.quaternion.setFromEuler(u),this.dispatchEvent(p))}),h(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(m),this.isLocked=!0):(this.dispatchEvent(f),this.isLocked=!1))}),h(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),h(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),h(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),h(this,"dispose",()=>{this.disconnect()}),h(this,"getObject",()=>this.camera),h(this,"direction",new i.Vector3(0,0,-1)),h(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),h(this,"moveForward",e=>{g.setFromMatrixColumn(this.camera.matrix,0),g.crossVectors(this.camera.up,g),this.camera.position.addScaledVector(g,e)}),h(this,"moveRight",e=>{g.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(g,e)}),h(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),h(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}var y=e.i(79123),S=e.i(68294),k=e.i(93784);(t={}).forward="forward",t.backward="backward",t.left="left",t.right="right",t.up="up",t.down="down",t.lookUp="lookUp",t.lookDown="lookDown",t.lookLeft="lookLeft",t.lookRight="lookRight",t.camera1="camera1",t.camera2="camera2",t.camera3="camera3",t.camera4="camera4",t.camera5="camera5",t.camera6="camera6",t.camera7="camera7",t.camera8="camera8",t.camera9="camera9";let b=Math.PI/2-.01;function P(){let e,t,a,d,c,h,u,g,p,m,f,F,P,I=(0,r.c)(26),{speedMultiplier:x,setSpeedMultiplier:D}=(0,y.useControls)(),[C,E]=(0,l.useKeyboardControls)(),{camera:w,gl:M}=(0,s.useThree)(),{nextCamera:B,setCameraIndex:T,cameraCount:R}=(0,S.useCameras)(),N=(0,n.useRef)(null);I[0]===Symbol.for("react.memo_cache_sentinel")?(e=new i.Vector3,I[0]=e):e=I[0];let G=(0,n.useRef)(e);I[1]===Symbol.for("react.memo_cache_sentinel")?(t=new i.Vector3,I[1]=t):t=I[1];let j=(0,n.useRef)(t);I[2]===Symbol.for("react.memo_cache_sentinel")?(a=new i.Vector3,I[2]=a):a=I[2];let A=(0,n.useRef)(a);I[3]===Symbol.for("react.memo_cache_sentinel")?(d=new i.Euler(0,0,0,"YXZ"),I[3]=d):d=I[3];let U=(0,n.useRef)(d);return I[4]!==w||I[5]!==M.domElement?(c=()=>{let e=new v(w,M.domElement);return N.current=e,()=>{e.dispose()}},h=[w,M.domElement],I[4]=w,I[5]=M.domElement,I[6]=c,I[7]=h):(c=I[6],h=I[7]),(0,n.useEffect)(c,h),I[8]!==w||I[9]!==M.domElement||I[10]!==B?(u=()=>{let e=M.domElement,t=new i.Euler(0,0,0,"YXZ"),a=!1,r=!1,n=0,o=0,s=t=>{N.current?.isLocked||t.target===e&&(a=!0,r=!1,n=t.clientX,o=t.clientY)},l=e=>{!a||!r&&3>Math.abs(e.clientX-n)&&3>Math.abs(e.clientY-o)||(r=!0,t.setFromQuaternion(w.quaternion,"YXZ"),t.y=t.y-.003*e.movementX,t.x=t.x-.003*e.movementY,t.x=Math.max(-b,Math.min(b,t.x)),w.quaternion.setFromEuler(t))},d=()=>{a=!1},c=t=>{let a=N.current;!a||a.isLocked?B():t.target!==e||r||a.lock()};return e.addEventListener("mousedown",s),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d),document.addEventListener("click",c),()=>{e.removeEventListener("mousedown",s),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),document.removeEventListener("click",c)}},g=[w,M.domElement,B],I[8]=w,I[9]=M.domElement,I[10]=B,I[11]=u,I[12]=g):(u=I[11],g=I[12]),(0,n.useEffect)(u,g),I[13]!==R||I[14]!==T||I[15]!==C?(p=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return C(t=>{for(let a=0;a{let e=e=>{e.preventDefault();let t=e.deltaY>0?-1:1,a=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*t;D(e=>Math.max(.1,Math.min(5,Math.round((e+a)*20)/20)))},t=M.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},F=[M.domElement,D],I[18]=M.domElement,I[19]=D,I[20]=f,I[21]=F):(f=I[20],F=I[21]),(0,n.useEffect)(f,F),I[22]!==w||I[23]!==E||I[24]!==x?(P=(e,t)=>{let a=k.streamPlaybackStore.getState();if(a.playback&&!a.freeFlyCamera)return;let{forward:r,backward:n,left:i,right:o,up:s,down:l,lookUp:d,lookDown:c,lookLeft:h,lookRight:u}=E();if((d||c||h||u)&&(U.current.setFromQuaternion(w.quaternion,"YXZ"),h&&(U.current.y=U.current.y+ +t),u&&(U.current.y=U.current.y-t),d&&(U.current.x=U.current.x+ +t),c&&(U.current.x=U.current.x-t),U.current.x=Math.max(-b,Math.min(b,U.current.x)),w.quaternion.setFromEuler(U.current)),!r&&!n&&!i&&!o&&!s&&!l)return;let g=80*x;w.getWorldDirection(G.current),G.current.normalize(),j.current.crossVectors(w.up,G.current).normalize(),A.current.set(0,0,0),r&&A.current.add(G.current),n&&A.current.sub(G.current),i&&A.current.add(j.current),o&&A.current.sub(j.current),s&&(A.current.y=A.current.y+1),l&&(A.current.y=A.current.y-1),A.current.lengthSq()>0&&(A.current.normalize().multiplyScalar(g*t),w.position.add(A.current))},I[22]=w,I[23]=E,I[24]=x,I[25]=P):P=I[25],(0,o.useFrame)(P),null}function I(){let e,t,i=(0,r.c)(2);return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0],(0,n.useEffect)(x,e),i[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(P,{}),i[1]=t):t=i[1],t}function x(){return window.addEventListener("keydown",D,{capture:!0}),window.addEventListener("keyup",D,{capture:!0}),()=>{window.removeEventListener("keydown",D,{capture:!0}),window.removeEventListener("keyup",D,{capture:!0})}}function D(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}e.s(["ARROW_LOOK_SPEED",0,1,"KEYBOARD_CONTROLS",0,[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}],"MOUSE_SENSITIVITY",0,.003,"ObserverControls",()=>I],5729)},76775,(e,t,a)=>{function r(e,t,a,r){return Math.round(e/a)+" "+r+(t>=1.5*a?"s":"")}t.exports=function(e,t){t=t||{};var a,n,i,o,s=typeof e;if("string"===s&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var c=parseFloat(d[1]);switch((d[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===s&&isFinite(e)){return t.long?(n=Math.abs(a=e))>=864e5?r(a,n,864e5,"day"):n>=36e5?r(a,n,36e5,"hour"):n>=6e4?r(a,n,6e4,"minute"):n>=1e3?r(a,n,1e3,"second"):a+" ms":(o=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":o>=36e5?Math.round(i/36e5)+"h":o>=6e4?Math.round(i/6e4)+"m":o>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},7003,(e,t,a)=>{t.exports=function(t){function a(e){let t,n,i,o=null;function s(...e){if(!s.enabled)return;let r=Number(new Date);s.diff=r-(t||r),s.prev=t,s.curr=r,t=r,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let n=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,r)=>{if("%%"===t)return"%";n++;let i=a.formatters[r];if("function"==typeof i){let a=e[n];t=i.call(s,a),e.splice(n,1),n--}return t}),a.formatArgs.call(s,e),(s.log||a.log).apply(s,e)}return s.namespace=e,s.useColors=a.useColors(),s.color=a.selectColor(e),s.extend=r,s.destroy=a.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==a.namespaces&&(n=a.namespaces,i=a.enabled(e)),i),set:e=>{o=e}}),"function"==typeof a.init&&a.init(s),s}function r(e,t){let r=a(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function n(e,t){let a=0,r=0,n=-1,i=0;for(;a"-"+e)].join(",");return a.enable(""),e},a.enable=function(e){for(let t of(a.save(e),a.namespaces=e,a.names=[],a.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===t[0]?a.skips.push(t.slice(1)):a.names.push(t)},a.enabled=function(e){for(let t of a.skips)if(n(e,t))return!1;for(let t of a.names)if(n(e,t))return!0;return!1},a.humanize=e.r(76775),a.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(e=>{a[e]=t[e]}),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let t=0;for(let a=0;a{let r;var n=e.i(47167);a.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let a="color: "+this.color;e.splice(1,0,a,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,a)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")||a.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n.default&&"env"in n.default&&(e=n.default.env.DEBUG),e},a.useColors=function(){let e;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},a.storage=function(){try{return localStorage}catch(e){}}(),r=!1,a.destroy=()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.log=console.debug||console.log||(()=>{}),t.exports=e.r(7003)(a);let{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},91891,11251,88787,94802,25311,89119,10244,e=>{"use strict";var t={},a=function(e,a,r,n,i){var o=new Worker(t[a]||(t[a]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var t=e.data,a=t.$e$;if(a){var r=Error(a[0]);r.code=a[1],r.stack=a[2],i(r,null)}else i(null,t)},o.postMessage(r,n),o},r=Uint8Array,n=Uint16Array,i=Int32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(e,t){for(var a=new n(31),r=0;r<31;++r)a[r]=t+=1<>1|(21845&F)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,f[F]=((65280&v)>>8|(255&v)<<8)>>1}for(var y=function(e,t,a){for(var r,i=e.length,o=0,s=new n(t);o>d]=c}else for(o=0,r=new n(i);o>15-e[o]);return r},S=new r(288),F=0;F<144;++F)S[F]=8;for(var F=144;F<256;++F)S[F]=9;for(var F=256;F<280;++F)S[F]=7;for(var F=280;F<288;++F)S[F]=8;for(var k=new r(32),F=0;F<32;++F)k[F]=5;var b=y(S,9,0),P=y(S,9,1),I=y(k,5,0),x=y(k,5,1),D=function(e){for(var t=e[0],a=1;at&&(t=e[a]);return t},C=function(e,t,a){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&a},E=function(e,t){var a=t/8|0;return(e[a]|e[a+1]<<8|e[a+2]<<16)>>(7&t)},w=function(e){return(e+7)/8|0},M=function(e,t,a){return(null==t||t<0)&&(t=0),(null==a||a>e.length)&&(a=e.length),new r(e.subarray(t,a))},B=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],T=function(e,t,a){var r=Error(t||B[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,T),!a)throw r;return r},R=function(e,t,a,n){var i=e.length,d=n?n.length:0;if(!i||t.f&&!t.l)return a||new r(0);var c=!a,u=c||2!=t.i,g=t.i;c&&(a=new r(3*i));var m=function(e){var t=a.length;if(e>t){var n=new r(Math.max(2*t,e));n.set(a),a=n}},f=t.f||0,F=t.p||0,v=t.b||0,S=t.l,k=t.d,b=t.m,I=t.n,B=8*i;do{if(!S){f=C(e,F,1);var R=C(e,F+1,3);if(F+=3,R)if(1==R)S=P,k=x,b=9,I=5;else if(2==R){var N=C(e,F,31)+257,G=C(e,F+10,15)+4,j=N+C(e,F+5,31)+1;F+=14;for(var A=new r(j),U=new r(19),O=0;O>4;if(q<16)A[O++]=q;else{var $=0,H=0;for(16==q?(H=3+C(e,F,3),F+=2,$=A[O-1]):17==q?(H=3+C(e,F,7),F+=3):18==q&&(H=11+C(e,F,127),F+=7);H--;)A[O++]=$}}var W=A.subarray(0,N),X=A.subarray(N);b=D(W),I=D(X),S=y(W,b,1),k=y(X,I,1)}else T(1);else{var q=w(F)+4,Z=e[q-4]|e[q-3]<<8,Y=q+Z;if(Y>i){g&&T(0);break}u&&m(v+Z),a.set(e.subarray(q,Y),v),t.b=v+=Z,t.p=F=8*Y,t.f=f;continue}if(F>B){g&&T(0);break}}u&&m(v+131072);for(var J=(1<>4;if((F+=15&$)>B){g&&T(0);break}if($||T(2),ee<256)a[v++]=ee;else if(256==ee){Q=F,S=null;break}else{var et=ee-254;if(ee>264){var O=ee-257,ea=o[O];et=C(e,F,(1<>4;er||T(3),F+=15&er;var X=p[en];if(en>3){var ea=s[en];X+=E(e,F)&(1<B){g&&T(0);break}u&&m(v+131072);var ei=v+et;if(v>8},G=function(e,t,a){a<<=7&t;var r=t/8|0;e[r]|=a,e[r+1]|=a>>8,e[r+2]|=a>>16},j=function(e,t){for(var a=[],i=0;ip&&(p=s[i].s);var m=new n(p+1),f=A(a[u-1],m,0);if(f>t){var i=0,F=0,v=f-t,y=1<t)F+=y-(1<>=v;F>0;){var k=s[i].s;m[k]=0&&F;--i){var b=s[i].s;m[b]==t&&(--m[b],++F)}f=t}return{t:new r(m),l:f}},A=function(e,t,a){return -1==e.s?Math.max(A(e.l,t,a+1),A(e.r,t,a+1)):t[e.s]=a},U=function(e){for(var t=e.length;t&&!e[--t];);for(var a=new n(++t),r=0,i=e[0],o=1,s=function(e){a[r++]=e},l=1;l<=t;++l)if(e[l]==i&&l!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[l]}return{c:a.subarray(0,r),n:t}},O=function(e,t){for(var a=0,r=0;r>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var i=0;i4&&!$[l[W-1]];--W);var X=g+5<<3,Z=O(i,S)+O(d,k)+c,Y=O(i,x)+O(d,E)+c+14+3*W+O(L,$)+2*L[16]+3*L[17]+7*L[18];if(u>=0&&X<=Z&&X<=Y)return V(t,p,e.subarray(u,u+g));if(N(t,p,1+(Y15&&(N(t,p,ee[_]>>5&127),p+=ee[_]>>12)}}else m=b,f=S,F=I,v=k;for(var _=0;_255){var et=ea>>18&31;G(t,p,m[et+257]),p+=f[et+257],et>7&&(N(t,p,ea>>23&31),p+=o[et]);var er=31&ea;G(t,p,F[er]),p+=v[er],er>3&&(G(t,p,ea>>5&8191),p+=s[er])}else G(t,p,m[ea]),p+=f[ea]}return G(t,p,m[256]),p+f[256]},L=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_=new r(0),q=function(e,t,a,l,d,c){var h=c.z||e.length,g=new r(l+h+5*(1+Math.ceil(h/7e3))+d),p=g.subarray(l,g.length-d),f=c.l,F=7&(c.r||0);if(t){F&&(p[0]=c.r>>3);for(var v=L[t-1],y=v>>13,S=8191&v,k=(1<7e3||G>24576)&&(q>423||!f)){F=z(e,p,0,C,E,B,R,G,A,N-A,F),G=T=R=0,A=N;for(var $=0;$<286;++$)E[$]=0;for(var $=0;$<30;++$)B[$]=0}var H=2,W=0,X=S,Z=O-_&32767;if(q>2&&U==D(N-Z))for(var Y=Math.min(y,q)-1,J=Math.min(32767,N),K=Math.min(258,q);Z<=J&&--X&&O!=_;){if(e[N+H]==e[N+H-Z]){for(var Q=0;QH){if(H=Q,W=Z,Q>Y)break;for(var ee=Math.min(Z,Q-2),et=0,$=0;$et&&(et=en,_=ea)}}}_=b[O=_],Z+=O-_&32767}if(W){C[G++]=0x10000000|u[H]<<18|m[W];var ei=31&u[H],eo=31&m[W];R+=o[ei]+s[eo],++E[257+ei],++B[eo],j=N+H,++T}else C[G++]=e[N],++E[e[N]]}}for(N=Math.max(N,j);N=h&&(p[F/8|0]=f,es=h),F=V(p,F+1,e.subarray(N,es))}c.i=h}return M(g,0,l+w(F)+d)},$=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var a=t,r=9;--r;)a=(1&a&&-0x12477ce0)^a>>>1;e[t]=a}return e}(),H=function(){var e=-1;return{p:function(t){for(var a=e,r=0;r>>8;e=a},d:function(){return~e}}},W=function(){var e=1,t=0;return{p:function(a){for(var r=e,n=t,i=0|a.length,o=0;o!=i;){for(var s=Math.min(o+2655,i);o>16),n=(65535&n)+15*(n>>16)}e=r,t=n},d:function(){return e%=65521,t%=65521,(255&e)<<24|(65280&e)<<8|(255&t)<<8|t>>8}}},X=function(e,t,a,n,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new r(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return q(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,a,n,i)},Z=function(e,t){var a={};for(var r in e)a[r]=e[r];for(var r in t)a[r]=t[r];return a},Y=function(e,t,a){for(var r=e(),n=e.toString(),i=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},eh=function(e,t){return ec(e,t)+0x100000000*ec(e,t+4)},eu=function(e,t,a){for(;a;++t)e[t]=a,a>>>=8},eg=function(e,t){var a=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&eu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),a){e[3]=8;for(var r=0;r<=a.length;++r)e[r+10]=a.charCodeAt(r)}},ep=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&T(6,"invalid gzip data");var t=e[3],a=10;4&t&&(a+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[a++]);return a+(2&t)},em=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ef=function(e){return 10+(e.filename?e.filename.length+1:0)},eF=function(e,t){var a=t.level;if(e[0]=120,e[1]=(0==a?0:a<6?1:9==a?3:2)<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var r=W();r.p(t.dictionary),eu(e,2,r.d())}},ev=function(e,t){return((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&T(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&T(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function ey(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var eS=function(){function e(e,t){if("function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var a=this.o.dictionary.subarray(-32768);this.b.set(a,32768-a.length),this.s.i=32768-a.length}}return e.prototype.p=function(e,t){this.ondata(X(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,t){this.ondata||T(5),this.s.l&&T(4);var a=e.length+this.s.z;if(a>this.b.length){if(a>2*this.b.length-32768){var n=new r(-32768&a);n.set(this.b.subarray(0,this.s.z)),this.b=n}var i=this.b.length-this.s.z;this.b.set(e.subarray(0,i),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(i),32768),this.s.z=e.length-i+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&t,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||T(5),this.s.l&&T(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),ek=function(e,t){el([et,function(){return[es,eS]}],this,ey.call(this,e,t),function(e){onmessage=es(new eS(e.data))},6,1)};function eb(e,t){return X(e,t||{},0,0)}var eP=function(){function e(e,t){"function"==typeof e&&(t=e,e={}),this.ondata=t;var a=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:a?a.length:0},this.o=new r(32768),this.p=new r(0),a&&this.o.set(a)}return e.prototype.e=function(e){if(this.ondata||T(5),this.d&&T(4),this.p.length){if(e.length){var t=new r(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,a=R(this.p,this.s,this.o);this.ondata(M(a,t,this.s.b),this.d),this.o=M(a,this.s.b-32768),this.s.b=this.o.length,this.p=M(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),eI=function(e,t){el([ee,function(){return[es,eP]}],this,ey.call(this,e,t),function(e){onmessage=es(new eP(e.data))},7,0)};function ex(e,t){return R(e,{i:2},t&&t.out,t&&t.dictionary)}(function(){function e(e,t){this.c=H(),this.l=0,this.v=1,eS.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,eS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var a=X(e,this.o,this.v&&ef(this.o),t&&8,this.s);this.v&&(eg(a,this.o),this.v=0),t&&(eu(a,a.length-8,this.c.d()),eu(a,a.length-4,this.l)),this.ondata(a,t)},e.prototype.flush=function(){eS.prototype.flush.call(this)}})();var eD=function(){function e(e,t){this.v=1,this.r=0,eP.call(this,e,t)}return e.prototype.push=function(e,t){if(eP.prototype.e.call(this,e),this.r+=e.length,this.v){var a=this.p.subarray(this.v-1),n=a.length>3?ep(a):4;if(n>a.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-a.length);this.p=a.subarray(n),this.v=0}eP.prototype.c.call(this,t),!this.s.f||this.s.l||t||(this.v=w(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),t))},e}(),eC=function(e,t){var a=this;el([ee,ea,function(){return[es,eP,eD]}],this,ey.call(this,e,t),function(e){var t=new eD(e.data);t.onmember=function(e){return postMessage(e)},onmessage=es(t)},9,0,function(e){return a.onmember&&a.onmember(e)})},eE=(function(){function e(e,t){this.c=W(),this.v=1,eS.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),eS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var a=X(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(eF(a,this.o),this.v=0),t&&eu(a,a.length-4,this.c.d()),this.ondata(a,t)},e.prototype.flush=function(){eS.prototype.flush.call(this)}}(),function(){function e(e,t){eP.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(eP.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(ev(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&T(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),eP.prototype.c.call(this,t)},e}()),ew=function(e,t){el([ee,er,function(){return[es,eP,eE]}],this,ey.call(this,e,t),function(e){onmessage=es(new eE(e.data))},11,0)},eM=function(){function e(e,t){this.o=ey.call(this,e,t)||{},this.G=eD,this.I=eP,this.Z=eE}return e.prototype.i=function(){var e=this;this.s.ondata=function(t,a){e.ondata(t,a)}},e.prototype.push=function(e,t){if(this.ondata||T(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var a=new r(this.p.length+e.length);a.set(this.p),a.set(e,this.p.length)}else this.p=e;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,t),this.p=null)}},e}();function eB(e,t){eM.call(this,e,t),this.queuedSize=0,this.G=eC,this.I=eI,this.Z=ew}eB.prototype.i=function(){var e=this;this.s.ondata=function(t,a,r){e.ondata(t,a,r)},this.s.ondrain=function(t){e.queuedSize-=t,e.ondrain&&e.ondrain(t)}},eB.prototype.push=function(e,t){this.queuedSize+=e.length,eM.prototype.push.call(this,e,t)};var eT="u">typeof TextEncoder&&new TextEncoder,eR="u">typeof TextDecoder&&new TextDecoder,eN=0;try{eR.decode(_,{stream:!0}),eN=1}catch(e){}var eG=function(e){for(var t="",a=0;;){var r=e[a++],n=(r>127)+(r>223)+(r>239);if(a+n>e.length)return{s:t,r:M(e,a-1)};n?3==n?t+=String.fromCharCode(55296|(r=((15&r)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++])-65536)>>10,56320|1023&r):1&n?t+=String.fromCharCode((31&r)<<6|63&e[a++]):t+=String.fromCharCode((15&r)<<12|(63&e[a++])<<6|63&e[a++]):t+=String.fromCharCode(r)}};function ej(e,t){if(t){for(var a=new r(e.length),n=0;n>1)),s=0,l=function(e){o[s++]=e},n=0;no.length){var d=new r(s+8+(i-n<<1));d.set(o),o=d}var c=e.charCodeAt(n);c<128||t?l(c):(c<2048?l(192|c>>6):(c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++n))>>18),l(128|c>>12&63)):l(224|c>>12),l(128|c>>6&63)),l(128|63&c))}return M(o,0,s)}(function(e){this.ondata=e,eN?this.t=new TextDecoder:this.p=_}).prototype.push=function(e,t){if(this.ondata||T(5),t=!!t,this.t){this.ondata(this.t.decode(e,{stream:!0}),t),t&&(this.t.decode().length&&T(8),this.t=null);return}this.p||T(4);var a=new r(this.p.length+e.length);a.set(this.p),a.set(e,this.p.length);var n=eG(a),i=n.s,o=n.r;t?(o.length&&T(8),this.p=null):this.p=o,this.ondata(i,t)},(function(e){this.ondata=e}).prototype.push=function(e,t){this.ondata||T(5),this.d&&T(4),this.ondata(ej(e),this.d=t||!1)};var eA=function(e){return 1==e?3:e<6?2:+(9==e)},eU=function(e,t){for(;1!=ed(e,t);t+=4+ed(e,t+2));return[eh(e,t+12),eh(e,t+4),eh(e,t+20)]},eO=function(e){var t=0;if(e)for(var a in e){var r=e[a].length;r>65535&&T(9),t+=r+4}return t},eV=function(e,t,a,r,n,i,o,s){var l=r.length,d=a.extra,c=s&&s.length,h=eO(d);eu(e,t,null!=o?0x2014b50:0x4034b50),t+=4,null!=o&&(e[t++]=20,e[t++]=a.os),e[t]=20,t+=2,e[t++]=a.flag<<1|(i<0&&8),e[t++]=n&&8,e[t++]=255&a.compression,e[t++]=a.compression>>8;var u=new Date(null==a.mtime?Date.now():a.mtime),g=u.getFullYear()-1980;if((g<0||g>119)&&T(10),eu(e,t,g<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>1),t+=4,-1!=i&&(eu(e,t,a.crc),eu(e,t+4,i<0?-i-2:i),eu(e,t+8,a.size)),eu(e,t+12,l),eu(e,t+14,h),t+=16,null!=o&&(eu(e,t,c),eu(e,t+6,a.attrs),eu(e,t+10,o),t+=14),e.set(r,t),t+=l,h)for(var p in d){var m=d[p],f=m.length;eu(e,t,+p),eu(e,t+2,f),e.set(m,t+4),t+=4+f}return c&&(e.set(s,t),t+=c),t},ez=function(e,t,a,r,n){eu(e,t,0x6054b50),eu(e,t+8,a),eu(e,t+10,a),eu(e,t+12,r),eu(e,t+16,n)},eL=function(){function e(e){this.filename=e,this.c=H(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||T(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();function e_(e,t){var a=this;t||(t={}),eL.call(this,e),this.d=new eS(t,function(e,t){a.ondata(null,e,t)}),this.compression=8,this.flag=eA(t.level)}function eq(e,t){var a=this;t||(t={}),eL.call(this,e),this.d=new ek(t,function(e,t,r){a.ondata(e,t,r)}),this.compression=8,this.flag=eA(t.level),this.terminate=this.d.terminate}function e$(e){this.ondata=e,this.u=[],this.d=1}e_.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e_.prototype.push=function(e,t){eL.prototype.push.call(this,e,t)},eq.prototype.process=function(e,t){this.d.push(e,t)},eq.prototype.push=function(e,t){eL.prototype.push.call(this,e,t)},e$.prototype.add=function(e){var t=this;if(this.ondata||T(5),2&this.d)this.ondata(T(4+(1&this.d)*8,0,1),null,!1);else{var a=ej(e.filename),n=a.length,i=e.comment,o=i&&ej(i),s=n!=e.filename.length||o&&i.length!=o.length,l=n+eO(e.extra)+30;n>65535&&this.ondata(T(11,0,1),null,!1);var d=new r(l);eV(d,0,e,a,s,-1);var c=[d],h=function(){for(var e=0,a=c;e0){var n=Math.min(this.c,e.length),i=e.subarray(0,n);if(this.c-=n,this.d?this.d.push(i,!this.c):this.k[0].push(i),(e=e.subarray(n)).length)return this.push(e,t)}else{var o=0,s=0,l=void 0,d=void 0;this.p.length?e.length?((d=new r(this.p.length+e.length)).set(this.p),d.set(e,this.p.length)):d=this.p:d=e;for(var c=d.length,h=this.c,u=h&&this.d,g=this;ss+30+i+u){var p,m,f=[];g.k.unshift(f),o=2;var F=ec(d,s+18),v=ec(d,s+22),y=function(e,t){if(t){for(var a="",r=0;r=0&&(S.size=F,S.originalSize=v),g.onfile(S)}return"break"}if(h){if(0x8074b50==e)return l=s+=12+(-2==h&&8),o=3,g.c=0,"break";else if(0x2014b50==e)return l=s-=4,o=3,g.c=0,"break"}}();++s);if(this.p=_,h<0){var p=o?d.subarray(0,l-12-(-2==h&&8)-(0x8074b50==ec(d,l-16)&&4)):d.subarray(0,s);u?u.push(p,!!o):this.k[+(2==o)].push(p)}if(2&o)return this.push(d.subarray(s),t);this.p=d.subarray(s)}t&&(this.c&&T(13),this.p=null)},eZ.prototype.register=function(e){this.o[e.compression]=e},"function"==typeof queueMicrotask&&queueMicrotask;var eY=e.i(48450);let eJ=[0,0,0,0,0,0,0,0,0,329,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2809,68,0,27,0,58,3,62,4,7,0,0,15,65,554,3,394,404,189,117,30,51,27,15,34,32,80,1,142,3,142,39,0,144,125,44,122,275,70,135,61,127,8,12,113,246,122,36,185,1,149,309,335,12,11,14,54,151,0,0,2,0,0,211,0,2090,344,736,993,2872,701,605,646,1552,328,305,1240,735,1533,1713,562,3,1775,1149,1469,979,407,553,59,279,31,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function eK(e){return e.node?e.node.pop:e.leaf.pop}let eQ=new class{nodes=[];leaves=[];tablesBuilt=!1;buildTables(){if(this.tablesBuilt)return;this.tablesBuilt=!0,this.leaves=[];for(let t=0;t<256;t++){var e;this.leaves.push({pop:eJ[t]+ +((e=t)>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)+1,symbol:t,numBits:0,code:0})}this.nodes=[{pop:0,index0:0,index1:0}];let t=256,a=[];for(let e=0;e<256;e++)a.push({node:null,leaf:this.leaves[e]});for(;1!==t;){let e=0xfffffffe,r=0xffffffff,n=-1,i=-1;for(let o=0;oi?n:i;a[s]={node:o,leaf:null},l!==t-1&&(a[l]=a[t-1]),t--}this.nodes[0]=a[0].node,this.generateCodes(0,0,0)}determineIndex(e){return null!==e.leaf?-(this.leaves.indexOf(e.leaf)+1):this.nodes.indexOf(e.node)}generateCodes(e,t,a){if(t<0){let r=this.leaves[-(t+1)];r.code=e,r.numBits=a}else{let r=this.nodes[t];this.generateCodes(e,r.index0,a+1),this.generateCodes(e|1<=0)t=e.readFlag()?this.nodes[t].index1:this.nodes[t].index0;else{a.push(this.leaves[-(t+1)].symbol);break}}return String.fromCharCode(...a)}{let t=e.readInt(8);return String.fromCharCode(...e.readBytes(t))}}};class e0{data;bitNum;maxReadBitNum;error;stringBuffer=null;constructor(e,t=0){this.data=e,this.bitNum=t,this.maxReadBitNum=e.length<<3,this.error=!1}getCurPos(){return this.bitNum}setCurPos(e){this.bitNum=e}getBytePosition(){return this.bitNum+7>>3}isError(){return this.error}isFull(){return this.bitNum>this.maxReadBitNum}getRemainingBits(){return this.maxReadBitNum-this.bitNum}getMaxPos(){return this.maxReadBitNum}readFlag(){if(this.bitNum>=this.maxReadBitNum)return this.error=!0,!1;let e=1<<(7&this.bitNum),t=(this.data[this.bitNum>>3]&e)!=0;return this.bitNum++,t}readInt(e){if(0===e)return 0;if(this.bitNum+e>this.maxReadBitNum)return this.error=!0,0;let t=this.bitNum>>3,a=7&this.bitNum;if(this.bitNum+=e,e+a<=32){let r=0,n=e+a+7>>3;for(let e=0;e>>=a,32===e)?r>>>0:r&(1<>3;for(let e=0;e>>0:r&(1<>3,a=new Uint8Array(t),r=this.bitNum>>3,n=7&this.bitNum,i=8-n;if(0===n)a.set(this.data.subarray(r,r+t));else{let e=this.data[r];for(let o=0;o>n|t<this.maxReadBitNum)return this.error=!0,0;let e=this.bitNum>>3,t=7&this.bitNum,a=e0.f32U8;if(0===t)a[0]=this.data[e],a[1]=this.data[e+1],a[2]=this.data[e+2],a[3]=this.data[e+3];else{let r=8-t;for(let n=0;n<4;n++){let i=this.data[e+n],o=e+n+1>t|o<>>0)}getCompressionPoint(){return this.compressionPoint}getDataBlockDataMap(){return this.dataBlockDataMap}getConnectionContext(){let e=this.dataBlockDataMap;return{compressionPoint:this.compressionPoint,ghostTracker:this.ghostTracker,getDataBlockParser:e=>this.registry.getDataBlockParser(e),getDataBlockData:e?t=>e.get(t):void 0,getGhostParser:e=>this.registry.getGhostParser(e)}}_setNextRecvEventSeq(e){this.nextRecvEventSeq=e>>>0}setConnectionProtocolState(e){for(this.lastSeqRecvdAtSend=e.lastSeqRecvdAtSend.slice(0,32);this.lastSeqRecvdAtSend.length<32;)this.lastSeqRecvdAtSend.push(0);this.lastSeqRecvd=e.lastSeqRecvd>>>0,this.highestAckedSeq=e.highestAckedSeq>>>0,this.lastSendSeq=e.lastSendSeq>>>0,this.recvAckMask=e.ackMask>>>0,this.connectSequence=e.connectSequence>>>0,this.lastRecvAckAck=e.lastRecvAckAck>>>0,this._connectionEstablished=e.connectionEstablished}onSendPacketTrigger(){this.lastSendSeq=this.lastSendSeq+1>>>0,this.lastSeqRecvdAtSend[31&this.lastSendSeq]=this.lastSeqRecvd>>>0}applyProtocolHeader(e){if(e.connectSeqBit!==(1&this.connectSequence)||e.ackByteCount>4||e.packetType>2)return{accepted:!1,dispatchData:!1};let t=(e.seqNumber|0xfffffe00&this.lastSeqRecvd)>>>0;if(t>>0),this.lastSeqRecvd+31>>0;if(a>>0),this.lastSendSeq>>0,0===e.packetType&&(this.recvAckMask=(1|this.recvAckMask)>>>0);for(let t=this.highestAckedSeq+1;t<=a;t++)(e.ackMask&1<<(a-t&31))!=0&&(this.lastRecvAckAck=this.lastSeqRecvdAtSend[31&t]>>>0);t-this.lastRecvAckAck>32&&(this.lastRecvAckAck=t-32),this.highestAckedSeq=a;let n=this.lastSeqRecvd!==t&&0===e.packetType;return this.lastSeqRecvd=t,{accepted:!0,dispatchData:n}}parsePacket(e){let t=new e0(e),a=this.readDnetHeader(t),r=this.applyProtocolHeader(a);if(this.packetsParsed++,!r.accepted)return this.protocolRejected++,{dnetHeader:a,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};if(!r.dispatchData)return this.protocolNoDispatch++,{dnetHeader:a,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};let n=this.readRateInfo(t);t.setStringBuffer(!0);let i=this.readGameState(t),o=void 0===i.controlObjectDataStart||void 0!==i.controlObjectData,s=o?this.readEvents(t):[],l=s[s.length-1],d=!l||l.dataBitsEnd!==l.dataBitsStart,c=o&&d?t.getCurPos():void 0,h=o&&d?this.readGhosts(t,a.seqNumber):[];return t.setStringBuffer(!1),{dnetHeader:a,rateInfo:n,gameState:i,events:s,ghosts:h,ghostSectionStart:c}}readDnetHeader(e){let t=e.readFlag(),a=e.readInt(1),r=e.readInt(9),n=e.readInt(9),i=e.readInt(2),o=e.readInt(3),s=o>0?e.readInt(8*o):0;return{gameFlag:t,connectSeqBit:a,seqNumber:r,highestAck:n,packetType:i,ackByteCount:o,ackMask:s}}readRateInfo(e){let t={};return e.readFlag()&&(t.updateDelay=e.readInt(10),t.packetSize=e.readInt(10)),e.readFlag()&&(t.maxUpdateDelay=e.readInt(10),t.maxPacketSize=e.readInt(10)),t}readGameState(e){let t,a,r,n,i,o,s,l,d,c,h,u,g,p,m,f=e.readInt(32);e.readFlag()&&(e.readFlag()&&(t=e.readFloat(7)),e.readFlag()&&(a=1.5*e.readFloat(7))),e.readFlag()&&(r=e.readFlag(),n=e.readFlag()),e.readFlag()&&((i=e.readFlag())&&(o={x:e.readF32(),y:e.readF32(),z:e.readF32()}),1===(s=e.readRangedU32(0,2))?e.readFlag()&&(l=e.readRangedU32(0,1023)):2===s&&(d={x:e.readF32(),y:e.readF32(),z:e.readF32()}));let F=e.readFlag(),v=e.readFlag();if(e.readFlag())if(e.readFlag()){let m=e.readInt(10);c=m,h=e.getCurPos();let y=e.savePos(),S=this.ghostTracker.getGhost(m),k=S?this.registry.getGhostParser(S.classId):void 0,b=this.controlParserByGhostIndex.get(m),P=this.registry.getGhostParser(25),I=this.registry.getGhostParser(4),x=[],D=new Set,C=e=>{!e?.readPacketData||D.has(e.name)||(D.add(e.name),x.push(e))};C(k),C(b),C(P),C(I);let E=!1;for(let t of x){e.restorePos(y);try{let a=this.getConnectionContext(),r=t.readPacketData(e,a);if(e.getCurPos()-h<=0||e.isError())continue;g=r,u=e.getCurPos(),this.controlParserByGhostIndex.set(m,t),a.compressionPoint!==this.compressionPoint&&(this.compressionPoint=a.compressionPoint,p=this.compressionPoint),this.controlObjectParsed++,E=!0;break}catch{}}if(!E)return e.restorePos(y),u=h,this.controlObjectFailed++,{lastMoveAck:f,damageFlash:t,whiteOut:a,selfLocked:r,selfHomed:n,seekerTracking:i,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:d,pinged:F,jammed:v,controlObjectGhostIndex:c,controlObjectDataStart:h,controlObjectDataEnd:u,controlObjectData:g,targetVisibility:[]}}else p={x:e.readF32(),y:e.readF32(),z:e.readF32()},this.compressionPoint=p;let y=[];for(;e.readFlag();)y.push({index:e.readInt(4),mask:e.readInt(32)});return e.readFlag()&&(m=e.readInt(8)),{lastMoveAck:f,damageFlash:t,whiteOut:a,selfLocked:r,selfHomed:n,seekerTracking:i,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:d,pinged:F,jammed:v,controlObjectGhostIndex:c,controlObjectDataStart:h,controlObjectDataEnd:u,controlObjectData:g,compressionPoint:p,targetVisibility:y.length>0?y:void 0,cameraFov:m}}readEvents(e){let t=[],a=!0,r=-2;for(;;){let n,i,o,s=e.readFlag();if(a&&!s){if(a=!1,!e.readFlag()){this.dispatchGuaranteedEvents(t);break}}else if(a||s){if(!s)break}else{this.dispatchGuaranteedEvents(t);break}!a&&(r=n=e.readFlag()?r+1&127:e.readInt(7),(i=n|0xffffff80&this.nextRecvEventSeq)0&&this.pendingGuaranteedEvents[0].absoluteSequenceNumber===this.nextRecvEventSeq;){let t=this.pendingGuaranteedEvents.shift();if(!t)break;this.nextRecvEventSeq=this.nextRecvEventSeq+1>>>0,e.push(t.event),t.event.parsedData&&this.applyEventSideEffects(t.event.parsedData)}}applyEventSideEffects(e){let t=e.type;if("GhostingMessageEvent"===t){let t=e.message;"number"==typeof t&&2===t&&this.ghostTracker.clear();return}if("GhostAlwaysObjectEvent"===t){let t=e.ghostIndex,a=e.classId;if("number"==typeof t&&"number"==typeof a){let e=this.registry.getGhostParser(a);this.ghostTracker.createGhost(t,a,e?.name??`unknown_${a}`)}}"SimDataBlockEvent"===t&&this.dataBlockDataMap&&e.dataBlockData&&"number"==typeof e.objectId&&this.dataBlockDataMap.set(e.objectId,e.dataBlockData)}readGhosts(e,t){let a=[];if(!e.readFlag())return a;let r=e.readInt(3)+3;for(;e.readFlag();){let n;if(e.isError())break;let i=e.readInt(r);if(e.isError())break;if(e.readFlag()){this.ghostTracker.deleteGhost(i),this.ghostDeletes++,a.push({index:i,type:"delete",updateBitsStart:e.getCurPos(),updateBitsEnd:e.getCurPos()});continue}let o=!this.ghostTracker.hasGhost(i);n=o?e.readInt(7)+0:this.ghostTracker.getGhost(i)?.classId;let s=e.getCurPos(),l=void 0!==n?this.registry.getGhostParser(n):void 0;if(o&&!l){this.ghostsTrackerDiverged++,e5("DIVERGED pkt=%d seq=%d idx=%d classId=%d bit=%d/%d trackerSize=%d (server sent UPDATE for ghost not in our tracker; 7-bit classId is actually update data)",this.packetsParsed,t,i,n,s,e.getMaxPos(),this.ghostTracker.size()),a.push({index:i,type:"create",classId:n,updateBitsStart:s,updateBitsEnd:s});break}let d=!1;if(l)try{let t=this.getConnectionContext();t.currentGhostIndex=i;let r=l.unpackUpdate(e,o,t),c=e.getCurPos();o&&void 0!==n?(this.ghostTracker.createGhost(i,n,l.name),this.ghostCreatesParsed++):this.ghostUpdatesParsed++,a.push({index:i,type:o?"create":"update",classId:n,updateBitsStart:s,updateBitsEnd:c,parsedData:r}),d=!0}catch(c){this.ghostsFailed++;let r=o?"create":"update",d=c instanceof Error?c.message:String(c);e5("FAIL pkt=%d seq=%d #%d idx=%d op=%s classId=%d parser=%s bit=%d/%d trackerSize=%d err=%s",this.packetsParsed,t,a.length,i,r,n,l.name,s,e.getMaxPos(),this.ghostTracker.size(),d)}if(!d){e5("STOP pkt=%d seq=%d idx=%d op=%s classId=%d parser=%s bit=%d/%d",this.packetsParsed,t,i,o?"create":"update",n,l?.name??"NONE",s,e.getMaxPos()),a.push({index:i,type:o?"create":"update",classId:n,updateBitsStart:s,updateBitsEnd:s});break}}return a}emptyGameState(){return{lastMoveAck:0,pinged:!1,jammed:!1}}}class e6{eventParsers=new Map;ghostParsers=new Map;dataBlockParsers=new Map;eventCatalog=new Map;ghostCatalog=new Map;dataBlockCatalog=new Map;catalogEvent(e){this.eventCatalog.set(e.name,e)}catalogGhost(e){this.ghostCatalog.set(e.name,e)}catalogDataBlock(e){this.dataBlockCatalog.set(e.name,e)}bindDeterministicDataBlocks(e,t){let a=0,r=[];for(let n=0;n0&&(r.sounds=t)}if(e.readFlag()){let t=[];for(let a=0;a<4;a++)e.readFlag()&&t.push({index:a,sequence:e.readInt(5),state:e.readInt(2),forward:e.readFlag(),atEnd:e.readFlag()});t.length>0&&(r.threads=t)}let n=!1;if(e.readFlag()){let a=[];for(let r=0;r<8;r++)if(e.readFlag()){let i={index:r};e.readFlag()?i.dataBlockId=e9(e):i.dataBlockId=0,e.readFlag()&&(e.readFlag()?i.skinTagIndex=e.readInt(10):i.skinName=e.readString(),n=!0),i.triggerDown=e.readFlag(),i.loaded=e.readFlag(),i.ammo=e.readFlag(),i.wet=e.readFlag(),i.target=e.readFlag(),i.fireCount=e.readInt(3),t&&(i.imageExtraFlag=e.readFlag()),a.push(i)}a.length>0&&(r.images=a)}if(e.readFlag()){if(e.readFlag()){r.stateAEnabled=e.readFlag(),r.stateB=e.readFlag();let t=e.readFlag();r.hasInvulnerability=t,t?(r.invulnerabilityVisual=e.readFlag(),r.invulnerabilityTicks=e.readU32()):r.binaryCloak=e.readFlag()}if(e.readFlag())if(e.readFlag()){let t=e.readFlag();r.stateBMode=t,t?r.energyPackOn=!0:r.energyPackOn=!1}else r.shieldNormal=e.readNormalVector(8),r.energyPercent=e.readFloat(5);e.readFlag()&&(r.stateValue1=e.readU32(),r.stateValue2=e.readU32())}return n&&(r.imageSkinDirty=!0),e.readFlag()&&(e.readFlag()?(r.mountObject=e.readInt(10),r.mountNode=e.readInt(5)):r.mountObject=-1),r}function ta(e,t,a){let r=tt(e,t,a);if(e.readFlag()&&(r.impactSound=e.readInt(3)),e.readFlag()&&(r.action=e.readInt(8),r.actionHoldAtEnd=e.readFlag(),r.actionAtEnd=e.readFlag(),r.actionFirstPerson=e.readFlag(),!r.actionAtEnd&&e.readFlag()&&(r.actionAnimPos=e.readSignedFloat(6))),e.readFlag()&&(r.armAction=e.readInt(8)),e.readFlag())return r;if(e.readFlag()){if(r.actionState=e.readInt(3),e.readFlag()&&(r.recoverTicks=e.readInt(7)),r.moveFlag0=e.readFlag(),r.moveFlag1=e.readFlag(),r.position=e.readCompressedPoint(a.compressionPoint),e.readFlag()){let t=e.readInt(13)/32,a=e.readNormalVector(10);r.velocity={x:a.x*t,y:a.y*t,z:a.z*t}}else r.velocity={x:0,y:0,z:0};r.headX=e.readSignedFloat(6),r.headZ=e.readSignedFloat(6),r.rotationZ=2*e.readFloat(7)*Math.PI,r.move=e7(e),r.allowWarp=e.readFlag()}return r.energy=e.readFloat(5),r}function tr(e,t){let a={};if(a.energyLevel=e.readF32(),a.rechargeRate=e.readF32(),a.actionState=e.readInt(3),e.readFlag()&&(a.recoverTicks=e.readInt(7)),e.readFlag()&&(a.jumpDelay=e.readInt(7)),e.readFlag()){let r={x:e.readF32(),y:e.readF32(),z:e.readF32()};a.position=r,t.compressionPoint=r,a.velocity={x:e.readF32(),y:e.readF32(),z:e.readF32()},a.jumpSurfaceLastContact=e.readInt(4)}if(a.headX=e.readF32(),a.headZ=e.readF32(),a.rotationZ=e.readF32(),e.readFlag()){let r=e.readInt(10);a.controlObjectGhost=r;let n=t.ghostTracker.getGhost(r),i=n?t.getGhostParser?.(n.classId):void 0;if(i?.readPacketData){let n=t.currentGhostIndex;t.currentGhostIndex=r,a.controlObjectData=i.readPacketData(e,t),t.currentGhostIndex=n}}return a.disableMove=e.readFlag(),a.pilot=e.readFlag(),a}function tn(e,t,a){let r=tt(e,t,a);return(r.jetting=e.readFlag(),e.readFlag())?r._controlledEarlyReturn=!0:(r.steeringYaw=e.readFloat(9),r.steeringPitch=e.readFloat(9),r.move=e7(e),r.frozen=e.readFlag(),e.readFlag()&&(r.position=e.readCompressedPoint(a.compressionPoint),r.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},r.linMomentum=e.readPoint3F(),r.angMomentum=e.readPoint3F()),e.readFlag()&&(r.energy=e.readFloat(8))),r}function ti(e,t){let a={};a.energyLevel=e.readF32(),a.rechargeRate=e.readF32(),a.steering={x:e.readF32(),y:e.readF32()};let r={x:e.readF32(),y:e.readF32(),z:e.readF32()};return a.linPosition=r,a.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},a.linMomentum=e.readPoint3F(),a.angMomentum=e.readPoint3F(),a.disableMove=e.readFlag(),a.frozen=e.readFlag(),t.compressionPoint=r,a}function to(e,t){let a=ti(e,t);a.braking=e.readFlag();let r=4,n=t.currentGhostIndex;if(void 0!==n){let e=tX.get(n);void 0!==e&&(r=e)}let i=[];for(let t=0;t64)throw Error(`Invalid Sky fogVolumeCount: ${t}`);r.fogVolumeCount=t,r.useSkyTextures=e.readBool(),r.renderBottomTexture=e.readBool(),r.skySolidColor={r:e.readF32(),g:e.readF32(),b:e.readF32()},r.windEffectPrecipitation=e.readBool();let a=[];for(let r=0;r3)throw Error(`Invalid precipitation colorCount: ${t}`);let a=[];for(let r=0;rMath.floor(e.getRemainingBits()/96))throw Error(`Invalid physicalZone point count: ${t}`);let a=[];for(let r=0;rMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone plane count: ${n}`);let i=[];for(let t=0;tMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone edge count: ${o}`);let s=[];for(let t=0;t0&&(a.audioData=e.readBitsBuffer(8*r)),a}function ad(e,t){return{type:"GhostingMessageEvent",sequence:e.readU32(),message:e.readInt(3),ghostCount:e.readInt(11)}}function ac(e,t){let a={type:"GhostAlwaysObjectEvent"};a.ghostIndex=e.readInt(10);let r=e.readFlag();if(a._hasObjectData=r,r){let r=e.readInt(7);a.classId=r;let n=t.getGhostParser?.(r);if(!n)throw Error(`No ghost parser for GhostAlwaysObjectEvent classId=${r}`);a.objectData=n.unpackUpdate(e,!0,t)}return a}function ah(e,t){let a={type:"PathManagerEvent"};if(e.readFlag()){a.messageType="NewPaths";let t=e.readU32(),r=[];for(let a=0;a0&&(t.hudImages=a),t}function aE(e){let t={};e.readFlag()&&(t.crc=e.readU32()),t.shapeName=e.readString(),t.mountPoint=e.readU32(),e.readFlag()||(t.offset=e.readAffineTransform()),t.firstPerson=e.readFlag(),t.mass=e.readF32(),t.usesEnergy=e.readFlag(),t.minEnergy=e.readF32(),t.hasFlash=e.readFlag(),t.projectile=ab(e),t.muzzleFlash=ab(e),t.isSeeker=e.readFlag(),t.isSeeker&&(t.seekerRadius=e.readF32(),t.maxSeekAngle=e.readF32(),t.seekerLockTime=e.readF32(),t.seekerFreeTime=e.readF32(),t.isTargetLockRequired=e.readFlag(),t.maxLockRange=e.readF32()),t.cloakable=e.readFlag(),t.lightType=e.readRangedU32(0,3),0!==t.lightType&&(t.lightRadius=e.readF32(),t.lightTime=e.readS32(),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)}),t.shellExitDir={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.shellExitVariance=e.readF32(),t.shellVelocity=e.readF32(),t.casing=ab(e),t.accuFire=e.readFlag();let a=[];for(let t=0;t<31;t++){if(!e.readFlag())continue;let t={};t.name=e.readString(),t.transitionOnAmmo=e.readInt(5),t.transitionOnNoAmmo=e.readInt(5),t.transitionOnTarget=e.readInt(5),t.transitionOnNoTarget=e.readInt(5),t.transitionOnWet=e.readInt(5),t.transitionOnNotWet=e.readInt(5),t.transitionOnTriggerUp=e.readInt(5),t.transitionOnTriggerDown=e.readInt(5),t.transitionOnTimeout=e.readInt(5),t.transitionGeneric0In=e.readInt(5),t.transitionGeneric0Out=e.readInt(5),e.readFlag()&&(t.timeoutValue=e.readF32()),t.waitForTimeout=e.readFlag(),t.fire=e.readFlag(),t.ejectShell=e.readFlag(),t.scaleAnimation=e.readFlag(),t.direction=e.readFlag(),t.reload=e.readFlag(),e.readFlag()&&(t.energyDrain=e.readF32()),t.loaded=e.readInt(3),t.spin=e.readInt(3),t.recoil=e.readInt(3),e.readFlag()&&(t.sequence=e.readSignedInt(16)),e.readFlag()&&(t.sequenceVis=e.readSignedInt(16)),t.flashSequence=e.readFlag(),t.ignoreLoadedForReady=e.readFlag(),t.emitter=ab(e),null!==t.emitter&&(t.emitterTime=e.readF32(),t.emitterNode=e.readS32()),t.sound=ab(e),a.push(t)}return t.states=a,t}function aw(e){let t=aC(e);t.renderFirstPerson=e.readFlag(),t.minLookAngle=e.readF32(),t.maxLookAngle=e.readF32(),t.maxFreelookAngle=e.readF32(),t.maxTimeScale=e.readF32(),t.maxStepHeight=e.readF32(),t.runForce=e.readF32(),t.runEnergyDrain=e.readF32(),t.minRunEnergy=e.readF32(),t.maxForwardSpeed=e.readF32(),t.maxBackwardSpeed=e.readF32(),t.maxSideSpeed=e.readF32(),t.maxUnderwaterForwardSpeed=e.readF32(),t.maxUnderwaterBackwardSpeed=e.readF32(),t.maxUnderwaterSideSpeedRef=ab(e),e.readFlag()&&(t.runSurfaceAngleRef=e.readInt(11)),t.runSurfaceAngle=e.readF32(),t.recoverDelay=e.readF32(),t.recoverRunForceScale=e.readF32(),t.jumpForce=e.readF32(),t.jumpEnergyDrain=e.readF32(),t.minJumpEnergy=e.readF32(),t.minJumpSpeed=e.readF32(),t.maxJumpSpeed=e.readF32(),t.jumpSurfaceAngle=e.readF32(),t.minJetEnergy=e.readF32(),t.splashVelocity=e.readF32(),t.splashAngle=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.bubbleEmitTime=e.readF32(),t.medSplashSoundVel=e.readF32(),t.hardSplashSoundVel=e.readF32(),t.exitSplashSoundVel=e.readF32(),t.jumpDelay=e.readInt(7),t.horizMaxSpeed=e.readF32(),t.horizResistSpeed=e.readF32(),t.horizResistFactor=e.readF32(),t.upMaxSpeed=e.readF32(),t.upResistSpeed=e.readF32(),t.upResistFactor=e.readF32(),t.jetEnergyDrain=e.readF32(),t.canJet=e.readF32(),t.maxJetHorizontalPercentage=e.readF32(),t.maxJetForwardSpeed=e.readF32(),t.jetForce=e.readF32(),t.minJetSpeed=e.readF32(),t.maxDamage=e.readF32(),t.minImpactDamageSpeed=e.readF32(),t.impactDamageScale=e.readF32(),t.footSplashHeight=e.readF32();let a=[];for(let t=0;t<32;t++)e.readFlag()?a.push(e.readInt(11)):a.push(null);t.sounds=a,t.boxSize={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.footPuffEmitter=ab(e),t.footPuffNumParts=e.readF32(),t.footPuffRadius=e.readF32(),t.decalData=ab(e),t.decalOffset=e.readF32(),t.dustEmitter=ab(e),t.splash=ab(e);let r=[];for(let t=0;t<3;t++)r.push(ab(e));return t.splashEmitters=r,t.groundImpactMinSpeed=e.readF32(),t.groundImpactShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeDuration=e.readF32(),t.groundImpactShakeFalloff=e.readF32(),t.boundingRadius=e.readF32(),t.moveBubbleSize=e.readF32(),t}function aM(e){let t=aC(e);t.bodyRestitution=e.readF32(),t.bodyFriction=e.readF32();let a=[];for(let t=0;t<2;t++)a.push(ab(e));t.impactSounds=a,t.minImpactSpeed=e.readF32(),t.softImpactSpeed=e.readF32(),t.hardImpactSpeed=e.readF32(),t.minRollSpeed=e.readF32(),t.maxSteeringAngle=e.readF32(),t.maxDrag=e.readF32(),t.minDrag=e.readF32(),t.cameraOffset=e.readF32(),t.cameraLag=e.readF32(),t.jetForce=e.readF32(),t.jetEnergyDrain=e.readF32(),t.minJetEnergy=e.readF32(),t.integration=e.readF32(),t.collisionTol=e.readF32(),t.massCenter=e.readF32(),t.exitSplashSoundVelocity=e.readF32(),t.softSplashSoundVelocity=e.readF32(),t.mediumSplashSoundVelocity=e.readF32(),t.hardSplashSoundVelocity=e.readF32();let r=[];for(let t=0;t<5;t++)r.push(ab(e));t.waterSounds=r,t.dustEmitter=ab(e);let n=[];for(let t=0;t<3;t++)n.push(ab(e));t.damageEmitters=n;let i=[];for(let t=0;t<2;t++)i.push(ab(e));return t.splashEmitters=i,t.damageEmitterOffset0={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageEmitterOffset1={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageLevelTolerance0=e.readF32(),t.damageLevelTolerance1=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.collDamageThresholdVel=e.readF32(),t.collDamageMultiplier=e.readF32(),t}function aB(e){let t=aM(e);t.jetActivateSound=ab(e),t.jetDeactivateSound=ab(e);let a=[];for(let t=0;t<4;t++)a.push(ab(e));return t.jetEmitters=a,t.maneuveringForce=e.readF32(),t.horizontalSurfaceForce=e.readF32(),t.verticalSurfaceForce=e.readF32(),t.autoInputDamping=e.readF32(),t.steeringForce=e.readF32(),t.steeringRollForce=e.readF32(),t.rollForce=e.readF32(),t.autoAngularForce=e.readF32(),t.rotationalDrag=e.readF32(),t.maxAutoSpeed=e.readF32(),t.autoLinearForce=e.readF32(),t.hoverHeight=e.readF32(),t.createHoverHeight=e.readF32(),t.minTrailSpeed=e.readF32(),t.vertThrustMultiple=e.readF32(),t.maxForwardSpeed=e.readF32(),t}function aT(e){let t=aM(e);t.dragForce=e.readF32(),t.mainThrustForce=e.readF32(),t.reverseThrustForce=e.readF32(),t.strafeThrustForce=e.readF32(),t.turboFactor=e.readF32(),t.stabLenMin=e.readF32(),t.stabLenMax=e.readF32(),t.stabSpringConstant=e.readF32(),t.stabDampingConstant=e.readF32(),t.gyroDrag=e.readF32(),t.normalForce=e.readF32(),t.restorativeForce=e.readF32(),t.steeringForce=e.readF32(),t.rollForce=e.readF32(),t.pitchForce=e.readF32(),t.floatingThrustFactor=e.readF32(),t.brakingForce=e.readF32(),t.dustTrailOffset={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.dustTrailFreqMod=e.readF32(),t.triggerTrailHeight=e.readF32(),t.floatSound=ab(e),t.thrustSound=ab(e),t.turboSound=ab(e);let a=[];for(let t=0;t<3;t++)a.push(ab(e));return t.jetEmitters=a,t.dustTrailEmitter=ab(e),t.mainThrustEmitterFactor=e.readF32(),t.strafeThrustEmitterFactor=e.readF32(),t.reverseThrustEmitterFactor=e.readF32(),t}function aR(e){let t=aM(e);return t.tireRadius=e.readF32(),t.tireStaticFriction=e.readF32(),t.tireKineticFriction=e.readF32(),t.tireRestitution=e.readF32(),t.tireLateralForce=e.readF32(),t.tireLateralDamping=e.readF32(),t.tireLateralRelaxation=e.readF32(),t.tireLongitudinalForce=e.readF32(),t.tireLongitudinalDamping=e.readF32(),t.tireEmitter=ab(e),t.jetSound=ab(e),t.engineSound=ab(e),t.squealSound=ab(e),t.wadeSound=ab(e),t.spring=e.readF32(),t.springDamping=e.readF32(),t.springLength=e.readF32(),t.brakeTorque=e.readF32(),t.engineTorque=e.readF32(),t.engineBrake=e.readF32(),t.maxWheelSpeed=e.readF32(),t.steeringAngle=e.readF32(),t.steeringReturn=e.readF32(),t.steeringDamping=e.readF32(),t.powerSteeringFactor=e.readF32(),t}function aN(e){let t=aC(e);return t.noIndividualDamage=e.readFlag(),t.dynamicTypeField=e.readS32(),t}function aG(e){let t=aN(e);return t.thetaMin=e.readF32(),t.thetaMax=e.readF32(),t.thetaNull=e.readF32(),t.neverUpdateControl=e.readFlag(),t.primaryAxis=e.readRangedU32(0,3),t.maxCapacitorEnergy=e.readF32(),t.capacitorRechargeRate=e.readF32(),t}function aj(e){let t=aE(e);return t.activationMS=e.readInt(8),t.deactivateDelayMS=e.readInt(8),t.degPerSecTheta=e.readRangedU32(0,1080),t.degPerSecPhi=e.readRangedU32(0,1080),t.dontFireInsideDamageRadius=e.readFlag(),t.damageRadius=e.readF32(),t.useCapacitor=e.readFlag(),t}function aA(e){let t=aC(e);return t.friction=e.readFloat(10),t.elasticity=e.readFloat(10),t.sticky=e.readFlag(),e.readFlag()&&(t.gravityMod=e.readFloat(10)),e.readFlag()&&(t.maxVelocity=e.readF32()),e.readFlag()&&(t.lightType=e.readInt(2),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)},t.lightTime=e.readS32(),t.lightRadius=e.readF32(),t.lightOnlyStatic=e.readFlag()),t}function aU(e){let t={};t.projectileShapeName=e.readString(),t.faceViewerLinkTime=e.readS32(),t.lifetime=e.readS32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.scale={x:e.readF32(),y:e.readF32(),z:e.readF32()}),t.baseEmitter=ab(e),t.delayEmitter=ab(e),t.bubbleEmitter=ab(e),t.explosion=ab(e),t.underwaterExplosion=ab(e),t.splash=ab(e),t.sound=ab(e),t.wetFireSound=ab(e),t.fireSound=ab(e);let a=[];for(let t=0;t<6;t++)a.push(ab(e));return t.decals=a,e.readFlag()&&(t.lightRadius=e.readFloat(8),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),e.readFlag()&&(t.underwaterLightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),t.explodeOnWaterImpact=ax(e),t.depthTolerance=e.readF32(),t}function aO(e){let t=aU(e);return t.dryVelocity=e.readF32(),t.wetVelocity=e.readF32(),t.fizzleTime=e.readU32(),t.fizzleType=e.readU32(),t.hardRetarget=e.readFlag(),t.inheritedVelocityScale=e.readRangedU32(0,90),t.lifetimeMS=e.readRangedU32(0,90),t.collideWithOwnerTimeMS=e.readU32(),t.proximityRadius=e.readU32(),t.tracerProjectile=e.readFlag(),t}function aV(e){let t=aU(e);return t.armingDelayMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.grenadeElasticity=e.readF32(),t.grenadeFriction=e.readF32(),t.drag=e.readF32(),t.density=e.readF32(),t.gravityMod=e.readF32(),t.lifetimeMS=e.readS32(),t}function az(e){let t=aU(e);return t.lifetimeMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.turningSpeed=e.readF32(),t.proximityRadius=e.readF32(),t.terrainAvoidanceSpeed=e.readF32(),t.terrainScanAhead=e.readF32(),t.terrainHeightFail=e.readF32(),t.terrainAvoidanceRadius=e.readF32(),t.flareDistance=e.readF32(),t.flareAngle=e.readF32(),t.useFlechette=ax(e),t.maxVelocity=e.readF32(),t.acceleration=e.readF32(),t.flechetteDelayMs=e.readS32(),t.exhaustTimeMs=e.readS32(),t.exhaustNodeName=e.readString(),t.casingShapeName=e.readString(),t.casingDebris=ab(e),t.puffEmitter=ab(e),t.exhaustEmitter=ab(e),t}function aL(e){let t=aU(e);t.maxRifleRange=e.readF32(),t.rifleHeadMultiplier=e.readF32(),t.beamColor=aI(e),t.fadeTime=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32(),t.lightColor=aI(e),t.lightRadius=e.readF32();let a=[];for(let t=0;t<12;t++)a.push(e.readString());return t.textures=a,t}function a_(e){let t=aU(e);t.zapDuration=e.readF32(),t.boltLength=e.readF32(),t.numParts=e.readF32(),t.lightningFreq=e.readF32(),t.lightningDensity=e.readF32(),t.lightningAmp=e.readF32(),t.lightningWidth=e.readF32(),t.shockwave=ab(e);let a=[],r=[],n=[],i=[];for(let t=0;t<2;t++)a.push(e.readF32()),r.push(e.readF32()),n.push(e.readF32()),i.push(e.readF32());t.startWidth=a,t.endWidth=r,t.boltSpeed=n,t.texWrap=i;let o=[];for(let t=0;t<4;t++)o.push(e.readString());return t.textures=o,t.emitter=ab(e),t}function aq(e){let t=aU(e);return t.beamRange=e.readF32(),t.beamDrainRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t.flareTexture=e.readString(),t.hitEmitter=ab(e),t}function a$(e){let t=aU(e);return t.beamRange=e.readF32(),t.beamRepairRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t}function aH(e){let t=aU(e);t.maxRifleRange=e.readF32(),t.beamColor=aI(e),t.startBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32();let a=[];for(let t=0;t<4;t++)a.push(e.readString());return t.textures=a,t}function aW(e){let t=aO(e);return t.tracerLength=e.readF32(),t.tracerAlpha=e.readF32(),t.tracerMinPixels=e.readF32(),t.crossViewFraction=ax(e),t.tracerColor=aI(e),t.tracerWidth=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=ax(e),t.textureName0=e.readString(),t.textureName1=e.readString(),t}function aX(e){let t=aV(e);return t.energyDrainPerSecond=e.readF32(),t.energyMinDrain=e.readF32(),t.beamWidth=e.readF32(),t.beamRange=e.readF32(),t.numSegments=e.readF32(),t.texRepeat=e.readF32(),t.beamFlareAngle=e.readF32(),t.beamTexture=e.readString(),t.flareTexture=e.readString(),t}function aZ(e){let t=aO(e);return t.numFlares=e.readF32(),t.flareColor=aI(e),t.flareTexture=e.readString(),t.smokeTexture=e.readString(),t.size=e.readF32(),t.flareModTexture=e.readF32(),t.smokeSize=e.readF32(),t}function aY(e){let t=aV(e);return t.smokeDist=e.readF32(),t.noSmoke=e.readF32(),t.boomTime=e.readF32(),t.casingDist=e.readF32(),t.smokeCushion=e.readF32(),t.noSmokeCounter=e.readF32(),t.smokeTexture=e.readString(),t.bombTexture=e.readString(),t}function aJ(e){let t=aV(e);return t.size=e.readF32(),t.useLensFlare=ax(e),t.flareTexture=e.readString(),t.lensFlareTexture=e.readString(),t}function aK(e){let t={};t.dtsFileName=e.readString(),t.soundProfile=ab(e),t.particleEmitter=ab(e),t.particleDensity=e.readInt(14),t.particleRadius=e.readF32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.explosionScale={x:e.readInt(16),y:e.readInt(16),z:e.readInt(16)}),t.playSpeed=e.readInt(14),t.debrisThetaMin=e.readRangedU32(0,180),t.debrisThetaMax=e.readRangedU32(0,180),t.debrisPhiMin=e.readRangedU32(0,360),t.debrisPhiMax=e.readRangedU32(0,360),t.debrisMinVelocity=e.readRangedU32(0,1e3),t.debrisMaxVelocity=e.readRangedU32(0,1e3),t.debrisNum=e.readInt(14),t.debrisVariance=e.readRangedU32(0,1e4),t.delayMS=e.readInt(16),t.delayVariance=e.readInt(16),t.lifetimeMS=e.readInt(16),t.lifetimeVariance=e.readInt(16),t.offset=e.readF32(),t.shakeCamera=e.readFlag(),t.hasLight=e.readFlag(),t.camShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeDuration=e.readF32(),t.camShakeRadius=e.readF32(),t.camShakeFalloff=e.readF32(),t.shockwave=ab(e),t.debris=ab(e);let a=[];for(let t=0;t<4;t++)a.push(ab(e));t.emitters=a;let r=[];for(let t=0;t<5;t++)r.push(ab(e));t.subExplosions=r;let n=e.readRangedU32(0,4),i=[];for(let t=0;t0&&ry("DataBlock binding: %d/%d bound, missing parsers: %s",t,e2.length,a.join(", "));const{bound:r,missing:n}=this.registry.bindDeterministicGhosts(e3,0);n.length>0&&ry("Ghost binding: %d/%d bound, missing parsers: %s",r,e3.length,n.join(", "));const{bound:i,missing:o}=this.registry.bindDeterministicEvents(e1,255);o.length>0&&ry("Event binding: %d/%d bound, missing parsers: %s",i,e1.length,o.join(", ")),this.packetParser=new e8(this.registry,this.ghostTracker)}getRegistry(){return this.registry}getGhostTracker(){return this.ghostTracker}getPacketParser(){return this.packetParser}get loaded(){return this._loaded}get header(){if(!this._loaded)throw Error("must call load() first");return this._header}get initialBlock(){if(!this._loaded)throw Error("must call load() first");return this._initialBlock}get blockCount(){if(!this._loaded)throw Error("must call load() first");if(void 0===this._blockCount){let e=this._decompressedData,t=this._decompressedView,a=0,r=0;for(;r+2<=e.length;){let n=4095&t.getUint16(r,!0);if((r+=2+n)>e.length)break;a++}this._blockCount=a}return this._blockCount}get blockCursor(){if(!this._loaded)throw Error("must call load() first");return this._blockCursor}async load(){if(this._loaded)return{header:this._header,initialBlock:this._initialBlock};let e=this.readHeader();ry('header: "%s" version=0x%s length=%dms (%smin) initialBlockSize=%d',e.identString,e.protocolVersion.toString(16),e.demoLengthMs,(e.demoLengthMs/1e3/60).toFixed(1),e.initialBlockSize);let t=this.buffer.subarray(this.offset,this.offset+e.initialBlockSize),a=this.readInitialBlock(t);this.offset+=e.initialBlockSize;let r=this.buffer.subarray(this.offset);ry("compressed block stream: %d bytes",r.length);let n=await new Promise((e,t)=>{var a,n;a=(a,r)=>{a?t(a):e(r)},n||(n=a,a={}),"function"!=typeof n&&T(7),eo(r,a,[ee],function(e){return en(ex(e.data[0],ei(e.data[1])))},1,n)});return ry("decompressed block stream: %d bytes",n.length),this._decompressedData=n,this._decompressedView=new DataView(n.buffer,n.byteOffset,n.byteLength),this.setupPacketParser(a),this._header=e,this._initialBlock=a,this._blockStreamOffset=0,this._blockCursor=0,this._loaded=!0,{header:e,initialBlock:a}}nextBlock(){if(!this._loaded)throw Error("must call load() first");let e=this._decompressedData,t=this._decompressedView,a=this._blockStreamOffset;if(a+2>e.length)return;let r=t.getUint16(a,!0),n=r>>12,i=4095&r;if(a+2+i>e.length)return void rk("block %d: size %d would exceed decompressed data (offset=%d remaining=%d), stopping",this._blockCursor,i,a+2,e.length-a-2);let o=e.subarray(a+2,a+2+i);this._blockStreamOffset=a+2+i;let s={index:this._blockCursor,type:n,size:i,data:o};if(this._blockCursor++,0===n)try{s.parsed=this.packetParser.parsePacket(o)}catch{}else if(1===n)this.packetParser.onSendPacketTrigger();else if(2===n&&64===i)try{s.parsed=this.readRawMove(o)}catch{}else if(3===n&&8===i)try{s.parsed=this.readInfoBlock(o)}catch{}return s}reset(){if(!this._loaded)throw Error("must call load() first");this._blockStreamOffset=0,this._blockCursor=0,this._blockCount=void 0,this.setupPacketParser(this._initialBlock)}processBlocks(e){if(!this._loaded)throw Error("must call load() first");let t=0;for(let a=0;a=128&&t<128+e2.length?e2[t-128]:`unknown(${t})`;throw Error(`No parser for DataBlock classId ${t} (${e}) at bit ${i}`)}}ry("all %d/%d DataBlocks parsed (%d payloads), bit position after DataBlocks: %d",l,i,s.size,r.getCurPos());let d=0!==r.readU8(),c=[];for(let e=0;e<6;e++)c.push(r.readU32());let h=[];for(let e=0;e<16;e++)h.push(r.readU32());let u=r.readU32(),g=[];for(let e=0;e>3<<3),this.readSimpleTargetManager(r),this.readSimpleTargetManager(r),rS('after sequential tail bit=%d mission="%s" CRC=0x%s',r.getCurPos(),M,B.toString(16))}catch(e){a=e instanceof Error?e.message:String(e)}finally{this.ghostTracker=I}let T=b-r.getCurPos(),R=M.length>0?M.split("").filter(e=>{let t=e.charCodeAt(0);return t>=32&&t<=126}).length/M.length:1,N=M.length>0&&R>=.8&&void 0===a;return ry('initial block: events=%d ghosts=%d ghostingSeq=%d controlObj=%d mission="%s" CRC=0x%s valid=%s%s',x.length,E.length,C,w,M,B.toString(16),N,a?` error=${a}`:""),{taggedStrings:n,dataBlockHeaders:o,dataBlockCount:l,dataBlocks:s,firstPerson:d,connectionFields:c,stateArray:h,scoreEntries:g,demoValues:p,sensorGroupColors:m,targetEntries:f,connectionState:F,roundTripTime:v,packetLoss:y,pathManager:S,notifyCount:k,nextRecvEventSeq:D,ghostingSequence:C,initialGhosts:E,initialEvents:x,controlObjectGhostIndex:w,controlObjectData:t,missionName:M,missionCRC:B,phase2TrailingBits:T,phase2Valid:N,phase2Error:a}}readScoreEntry(e){let t=e.readFlag()?e.readInt(16):0,a=e.readFlag()?e.readInt(16):0,r=e.readFlag()?e.readInt(16):0,n=e.readInt(6),i=e.readInt(6),o=e.readInt(6),s=e.readFlag(),l=[];for(let t=0;t<6;t++)l.push(e.readFlag());return{clientId:t,teamId:a,score:r,field0:n,field1:i,field2:o,isBot:s,triggerFlags:l}}readDemoValues(e){let t=[];for(;e.readFlag();)t.push(e.readString());return t}readComplexTargetManager(e){e.readU8(),e.readU8(),e.readU8(),e.readU8();let t=[];for(let a=0;a<32;a++)for(let r=0;r<32;r++)e.readFlag()&&t.push({group:a,targetGroup:r,r:e.readU8(),g:e.readU8(),b:e.readU8(),a:e.readU8()});let a=[];for(let t=0;t<512;t++){if(!e.readFlag())continue;let r={targetId:t,sensorGroup:0,targetData:0,damageLevel:0};e.readFlag()&&(r.sensorData=e.readU32()),e.readFlag()&&(r.voiceMapData=e.readU32()),e.readFlag()&&(r.name=e.readString()),e.readFlag()&&(r.skin=e.readString()),e.readFlag()&&(r.skinPref=e.readString()),e.readFlag()&&(r.voice=e.readString()),e.readFlag()&&(r.typeDescription=e.readString()),r.sensorGroup=e.readInt(5),r.targetData=e.readInt(9),t>=32&&e.readFlag()&&(r.dataBlockRef=e.readInt(11)),r.damageLevel=e.readFloat(7),a.push(r)}return{sensorGroupColors:t,targets:a}}readPathManager(e){let t=[],a=e.readU32();for(let r=0;rthis.registry.getDataBlockParser(e)};t=i.unpack(e,a)}catch{a.push({classId:r,guaranteed:!0,dataBitsStart:n,dataBitsEnd:n});break}else{a.push({classId:r,guaranteed:!0,dataBitsStart:n,dataBitsEnd:n});break}a.push({classId:r,guaranteed:!0,dataBitsStart:n,dataBitsEnd:e.getCurPos(),parsedData:t}),rS(" event classId=%d bits=%d",r,e.getCurPos()-n)}return{nextRecvEventSeq:t,events:a}}readGhostStartBlock(e,t){let a=e.readU32(),r=[];rS("ghost block: seq=%d bit=%d",a,e.getCurPos());let n=this.registry.getGhostCatalog(),i=8*e.getBuffer().length,o=new Map;for(let[e,a]of t)o.set(e,a.data);for(;e.readFlag()&&!e.isError();){let a=e.readInt(10),s=e.readInt(7)+0,l=e.getCurPos(),d=[],c=new Set,{entry:h}=this.identifyGhostViaDataBlock(e,t,n),u=this.registry.getGhostParser(s);u&&(d.push({entry:u,method:"registry"}),c.add(u)),h&&!c.has(h)&&(d.push({entry:h,method:"datablock"}),c.add(h));let g={getDataBlockData:e=>o.get(e),getDataBlockParser:e=>this.registry.getDataBlockParser(e)},p=!1;for(let{entry:t,method:n}of d){let o="registry"===n,d=this.tryGhostParser(e,t,l,i,!1,g,o);if(!1!==d){this.ghostTracker.createGhost(a,s,t.name),rS(" ghost idx=%d classId=%d parser=%s bits=%d via=%s",a,s,t.name,e.getCurPos()-l,n),r.push({index:a,type:"create",classId:s,updateBitsStart:l,updateBitsEnd:e.getCurPos(),parsedData:d}),p=!0;break}}if(!p){rS(" ghost idx=%d classId=%d NO PARSER (stopping at bit=%d, remaining=%d)",a,s,l,i-l);break}}return rS("ghost loop ended at bit=%d remaining=%d count=%d",e.getCurPos(),i-e.getCurPos(),r.length),{ghostingSequence:a,ghosts:r}}tryGhostParser(e,t,a,r,n=!1,i,o=!1){let s=e.savePos();n||rS(" try %s: startBit=%d",t.name,a);try{let l=t.unpackUpdate(e,!0,{compressionPoint:{x:0,y:0,z:0},ghostTracker:this.ghostTracker,...i}),d=e.getCurPos()-a,c=r-e.getCurPos();if(e.isError()||!o&&d<3)return n||rS(" reject %s: bits=%d isError=%s",t.name,d,e.isError()),e.restorePos(s),!1;if(c>1e3){let a=e.getCurPos(),r=e.readFlag();if(e.setCurPos(a),!r)return n||rS(" reject %s: bits=%d misaligned (remaining=%d)",t.name,d,c),e.restorePos(s),!1}return l??{}}catch(a){return n||rS(" reject %s: error at bit=%d: %s",t.name,e.getCurPos(),a instanceof Error?a.message:String(a)),e.restorePos(s),!1}}identifyGhostViaDataBlock(e,t,a){let r;if(!t)return{entry:void 0,dbFlag:!1};let n=e.savePos(),i=!1;try{if(i=e.readFlag()){let n=e.readInt(11),i=t.get(n);if(i){let e=i.className.replace(/Data$/,"");(r=a.get(e))||rS(" identifyGhostViaDataBlock: dbId=%d className=%s ghostName=%s (no ghost parser)",n,i.className,e)}else rS(" identifyGhostViaDataBlock: dbId=%d (no DataBlock found)",n)}else rS(" identifyGhostViaDataBlock: DataBlock flag=0")}catch{}return e.restorePos(n),{entry:r,dbFlag:i}}readRawMove(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getInt32(0,!0),r=t.getInt32(4,!0),n=t.getInt32(8,!0),i=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getFloat32(24,!0),d=t.getFloat32(28,!0),c=t.getFloat32(32,!0),h=t.getFloat32(36,!0),u=t.getFloat32(40,!0),g=t.getFloat32(44,!0),p=t.getUint32(48,!0),m=t.getUint32(52,!0),f=0!==e[56],F=[];for(let t=0;t<6;t++)F.push(0!==e[57+t]);return{px:a,py:r,pz:n,pyaw:i,ppitch:o,proll:s,x:l,y:d,z:c,yaw:h,pitch:u,roll:g,id:p,sendCount:m,freeLook:f,trigger:F}}readInfoBlock(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{value1:t.getUint32(0,!0),value2:t.getFloat32(4,!0)}}}function rP(){let e=new e6,t=new e4;ak(e),t2(e),rv(e),e.bindDeterministicDataBlocks(e2,128),e.bindDeterministicGhosts(e3,0),e.bindDeterministicEvents(e1,255);let a=new e8(e,t,{dataBlockDataMap:new Map});return{registry:e,ghostTracker:t,packetParser:a}}e.s(["DemoParser",()=>rb],88787),e.s(["createLiveParser",()=>rP],94802),e.s([],91891);var rI=e.i(90072);let rx=new Set(["FlyingVehicle","HoverVehicle","WheeledVehicle"]),rD=new Set(["BombProjectile","EnergyProjectile","FlareProjectile","GrenadeProjectile","LinearFlareProjectile","LinearProjectile","Projectile","SeekerProjectile","TracerProjectile"]),rC=new Set(["LinearProjectile","TracerProjectile","LinearFlareProjectile","Projectile"]),rE=new Set(["GrenadeProjectile","EnergyProjectile","FlareProjectile","BombProjectile"]),rw=new Set(["SeekerProjectile"]),rM=new Set(["StaticShape","ScopeAlwaysShape","Turret","BeaconObject","ForceFieldBare"]);function rB(e){return"Player"===e?"Player":rx.has(e)?"Vehicle":"Item"===e?"Item":rD.has(e)?"Projectile":rM.has(e)?"Deployable":"Ghost"}function rT(e,t){return`${e}_${t}`}let rR=Object.freeze({r:0,g:255,b:0}),rN=Object.freeze({r:255,g:0,b:0});e.s(["IFF_GREEN",0,rR,"IFF_RED",0,rN,"TICK_DURATION_MS",0,32,"ballisticProjectileClassNames",0,rE,"linearProjectileClassNames",0,rC,"projectileClassNames",0,rD,"seekerProjectileClassNames",0,rw,"toEntityId",()=>rT,"toEntityType",()=>rB],25311);let rG=new rI.Matrix4,rj=new rI.Quaternion;function rA(e,t,a){return ea?a:e}let rU=.494*Math.PI;function rO(e,t){let a=Math.sin(t),r=Math.cos(t),n=Math.sin(e),i=Math.cos(e);return rG.set(-n,i*a,-i*r,0,0,r,a,0,i,n*a,-n*r,0,0,0,0,1),rj.setFromRotationMatrix(rG),[rj.x,rj.y,rj.z,rj.w]}function rV(e){let t=-e/2;return[0,Math.sin(t),0,Math.cos(t)]}function rz(e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(e.z)||!Number.isFinite(e.w))return null;let t=-e.y,a=-e.z,r=-e.x,n=e.w,i=t*t+a*a+r*r+n*n;if(i<=1e-12)return null;let o=1/Math.sqrt(i);return[t*o,a*o,r*o,n*o]}function rL(e){return Math.atan2(2*(e.w*e.z+e.x*e.y),e.w*e.w+e.x*e.x-e.y*e.y-e.z*e.z)}function r_(e){return Math.asin(Math.max(-1,Math.min(1,2*(e.w*e.x-e.y*e.z))))}function rq(e){return null!=e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function r$(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z}function rH(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z&&"number"==typeof e.w}function rW(e,t){let a;if(t)return"string"==typeof(a=rD.has(e)||e.endsWith("ProjectileData")?t.projectileShapeName:"DebrisData"===e?t.shapeFileName:t.shapeName)&&a.length>0?a:void 0}function rX(e,t){if(e)for(let a of t){let t=e[a];if("number"==typeof t&&Number.isFinite(t))return t}}function rZ(e,t){if(e)for(let a of t){let t=e[a];if("string"==typeof t&&t.length>0)return t}}function rY(e,t){if(!t)return;let a=rZ(t,["tracerTex0","textureName0","texture0"])??"";if(!("TracerProjectile"===e||a.length>0&&null!=rX(t,["tracerLength"]))||!a)return;let r=rZ(t,["tracerTex1","textureName1","texture1"]),n=rX(t,["tracerLength"])??10,i=rX(t,["tracerWidth"]),o=rX(t,["tracerAlpha"]),s=null!=i&&(null!=rX(t,["crossViewAng"])||i<=.7)?i:o??i??.5,l=rX(t,["crossViewAng","crossViewFraction"])??("number"==typeof t.tracerWidth&&t.tracerWidth>.7?t.tracerWidth:.98);return{kind:"tracer",texture:a,crossTexture:r,tracerLength:n,tracerWidth:s,crossViewAng:l,crossSize:rX(t,["crossSize","muzzleVelocity"])??.45,renderCross:function(e,t){if(e)for(let a of t){let t=e[a];if("boolean"==typeof t)return t}}(t,["renderCross","proximityRadius"])??!0}}function rJ(e,t){if(t){if("LinearFlareProjectile"===e){let e=rZ(t,["smokeTexture","flareTexture"]);if(!e)return;let a=t.flareColor,r=rX(t,["size"])??.5;return{kind:"sprite",texture:e,color:a?{r:a.r,g:a.g,b:a.b}:{r:1,g:1,b:1},size:r}}if("FlareProjectile"===e){let e=rZ(t,["flareTexture"]);if(!e)return;return{kind:"sprite",texture:e,color:{r:1,g:.9,b:.5},size:rX(t,["size"])??4}}}}function rK(e){let t=e.states;if(Array.isArray(t)&&0!==t.length)return t.map(e=>{let t=e=>null==e?-1:e-1;return{name:e.name??"",transitionOnNotLoaded:t(e.transitionOnAmmo),transitionOnLoaded:t(e.transitionOnNoAmmo),transitionOnNoAmmo:t(e.transitionOnTarget),transitionOnAmmo:t(e.transitionOnNoTarget),transitionOnNoTarget:t(e.transitionOnWet),transitionOnTarget:t(e.transitionOnNotWet),transitionOnNotWet:t(e.transitionOnTriggerUp),transitionOnWet:t(e.transitionOnTriggerDown),transitionOnTriggerUp:t(e.transitionOnTimeout),transitionOnTriggerDown:t(e.transitionGeneric0In),transitionOnTimeout:t(e.transitionGeneric0Out),timeoutValue:e.timeoutValue,waitForTimeout:e.waitForTimeout??!1,fire:e.fire??!1,sequence:e.sequence,spin:e.spin??0,direction:e.direction??!0,scaleAnimation:e.scaleAnimation??!1,loaded:e.loaded??0,soundDataBlockId:e.sound??-1}})}function rQ(e){let t="";for(let a=0;a=32&&(t+=e[a]);return t}let r0={2:0,3:1,4:2,5:3,6:4,7:5,8:6,11:7,12:8,14:9};function r2(e){for(let t=0;t=32)break}}function r3(e){let t=[],a=0,r="",n=!1;for(let i=0;i=32&&(r+=e[i]);continue}let s=r0[o];void 0!==s?(r&&(t.push({text:r,colorCode:a}),r=""),a=s):15===o?(r&&(t.push({text:r,colorCode:a}),r=""),a=0):o>=32&&(r+=e[i])}return r&&t.push({text:r,colorCode:a}),t}function r1(e){let t=e.indexOf("~w");return -1===t?{text:e,wavPath:null}:{text:e.substring(0,t),wavPath:e.substring(t+2)}}function r5(e){return e?"number"==typeof e.cameraMode?"camera":"number"==typeof e.rotationZ?"player":null:null}let r8=new Map([["gui/hud_new_packammo",0],["gui/hud_new_packcloak",1],["gui/hud_new_packenergy",2],["gui/hud_new_packrepair",3],["gui/hud_new_packsatchel",4],["gui/hud_new_packshield",5],["gui/hud_new_packinventory",6],["gui/hud_new_packmotionsens",7],["gui/hud_new_packradar",8],["gui/hud_new_packturretout",9],["gui/hud_new_packturretin",10],["gui/hud_new_packsensjam",11],["gui/hud_new_packturret",12],["gui/hud_satchel_unarmed",18]]);function r6(e){let t=e.toLowerCase();for(let[e,a]of r8)if(e===t)return a;return -1}e.s(["CameraMode_OrbitObject",0,3,"MAX_PITCH",0,rU,"backpackBitmapToIndex",()=>r6,"clamp",()=>rA,"detectColorCode",()=>r2,"detectControlObjectType",()=>r5,"extractWavTag",()=>r1,"getNumberField",()=>rX,"isQuatLike",()=>rH,"isValidPosition",()=>rq,"isVec3Like",()=>r$,"parseColorSegments",()=>r3,"parseWeaponImageStates",()=>rK,"playerYawToQuaternion",()=>rV,"resolveShapeName",()=>rW,"resolveSpriteVisual",()=>rJ,"resolveTracerVisual",()=>rY,"stripTaggedStringMarkup",()=>rQ,"torqueQuatHeading",()=>rL,"torqueQuatPitch",()=>r_,"torqueQuatToThreeJS",()=>rz,"yawPitchToQuaternion",()=>rO],89119),e.i(70847);var r4=e.i(47566),r7=e.i(8328);class r9{registry;ghostTracker;entities=new Map;entityIdByGhostIndex=new Map;tickCount=0;camera=null;chatMessages=[];chatMessageIdCounter=0;audioEvents=[];netStrings=new Map;targetNames=new Map;targetTeams=new Map;targetRenderFlags=new Map;pendingNameTags=new Map;sensorGroupColors=new Map;playerSensorGroup=0;lastStatus={health:1,energy:1};latestControl={ghostIndex:-1};controlPlayerGhostId;lastControlType="camera";isPiloting=!1;lastPilotGhostIndex;lastVehicleHeading=0;lastVehiclePitch=0;lastVehicleOrbitDir;lastVehicleVelocity;lastVehiclePosTime=0;lastVehiclePos;firstPerson=!0;lastCameraMode;lastOrbitGhostIndex;lastOrbitDistance;latestFov=90;weaponsHud={slots:new Map,activeIndex:-1};backpackHud={packIndex:-1,active:!1,text:""};inventoryHud={slots:new Map,activeSlot:-1};teamScores=[];playerRoster=new Map;nextExplosionId=0;resolveGhostClassName(e,t){if("number"==typeof t){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let a=this.entityIdByGhostIndex.get(e);if(a){let e=this.entities.get(a);if(e?.className)return e.className}let r=this.ghostTracker.getGhost(e);if(r?.className)return r.className}resolveEntityIdForGhostIndex(e){let t=this.entityIdByGhostIndex.get(e);if(t)return t;let a=this.ghostTracker.getGhost(e);if(a)return rT(a.className,e)}resetSharedState(){this.entities.clear(),this.entityIdByGhostIndex.clear(),this.tickCount=0,this.camera=null,this.chatMessages=[],this.chatMessageIdCounter=0,this.audioEvents=[],this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.targetRenderFlags.clear(),this.sensorGroupColors.clear(),this.playerSensorGroup=0,this.lastStatus={health:1,energy:1},this.latestControl={ghostIndex:-1},this.controlPlayerGhostId=void 0,this.lastControlType="camera",this.isPiloting=!1,this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0,this.firstPerson=!0,this.lastCameraMode=void 0,this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0,this.latestFov=90,this.weaponsHud={slots:new Map,activeIndex:-1},this.backpackHud={packIndex:-1,active:!1,text:""},this.inventoryHud={slots:new Map,activeSlot:-1},this.teamScores=[],this.playerRoster.clear(),this.nextExplosionId=0}resolveNetString(e){if(e.length>=2&&1===e.charCodeAt(0)){let t=parseInt(e.slice(1),10);if(Number.isFinite(t))return this.netStrings.get(t)??e}return e}formatRemoteArgs(e,t){let a=this.resolveNetString(e);for(let e=0;e0&&(this.playerSensorGroup=t.sensorGroup)}if(t){let e=r5(t);if(e&&(this.lastControlType=e),"player"===this.lastControlType)this.isPiloting=!!(t.pilot||null!=t.controlObjectGhost),this.isPiloting&&"number"==typeof t.controlObjectGhost?this.lastPilotGhostIndex=t.controlObjectGhost:this.isPiloting||(this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0);else if(this.isPiloting=!1,"number"==typeof t.cameraMode)if(this.lastCameraMode=t.cameraMode,3===t.cameraMode){"number"==typeof t.orbitObjectGhostIndex&&(this.lastOrbitGhostIndex=t.orbitObjectGhostIndex);let e=t.minOrbitDist,a=t.maxOrbitDist,r=t.curOrbitDist;"number"==typeof e&&"number"==typeof a&&Number.isFinite(e)&&Number.isFinite(a)?this.lastOrbitDistance=Math.max(0,a-e):"number"==typeof r&&Number.isFinite(r)&&(this.lastOrbitDistance=Math.max(0,r))}else this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0}void 0!==e.cameraFov&&(this.latestFov=e.cameraFov)}processEvent(e,t){let a=e.parsedData;if(!a)return;let r=a.type;if("GhostAlwaysObjectEvent"===r){let e=a.ghostIndex,t=a.classId,r=a.objectData;null!=e&&null!=t&&this.processGhostUpdate({index:e,type:"create",classId:t,parsedData:r});return}if("NetStringEvent"===r||"NetStringEvent"===t){let e=a.id,t=a.value;if(null!=e&&"string"==typeof t){this.netStrings.set(e,t);let a=this.pendingNameTags.get(e);if(null!=a){this.pendingNameTags.delete(e);let r=rQ(t);for(let e of(this.targetNames.set(a,r),this.entities.values()))e.targetId===a&&(e.playerName=r)}}return}if("TargetInfoEvent"===r||"TargetInfoEvent"===t){let e=a.targetId,t=a.nameTag;if(null!=e&&null!=t){let a=this.netStrings.get(t);a?this.targetNames.set(e,rQ(a)):this.pendingNameTags.set(t,e)}let r=a.sensorGroup;null!=e&&null!=r&&this.targetTeams.set(e,r);let n=a.renderFlags;if(null!=e&&null!=n&&this.targetRenderFlags.set(e,n),null!=e){let t=this.targetNames.get(e),a=this.targetTeams.get(e),r=this.targetRenderFlags.get(e);for(let n of this.entities.values())n.targetId===e&&(t&&(n.playerName=t),null!=a&&(n.sensorGroup=a),null!=r&&(n.targetRenderFlags=r))}return}if("SetSensorGroupEvent"===r||"SetSensorGroupEvent"===t){let e=a.sensorGroup;null!=e&&(this.playerSensorGroup=e);return}if("SensorGroupColorEvent"===r||"SensorGroupColorEvent"===t){let e=a.sensorGroup,t=a.colors;if(t){let a=this.sensorGroupColors.get(e);for(let r of(a||(a=new Map,this.sensorGroupColors.set(e,a)),t))r.default?a.delete(r.index):a.set(r.index,{r:r.r??0,g:r.g??0,b:r.b??0})}return}if("RemoteCommandEvent"===r||"RemoteCommandEvent"===t){let e=this.resolveNetString(a.funcName),t=a.args,r=this.getTimeSec();if("ChatMessage"===e&&t.length>=4){let e=r2(this.resolveNetString(t[3])),a=t[4]?rQ(this.resolveNetString(t[4])):"",n=this.formatRemoteArgs(t[3],t.slice(4));if(n){let i,o,s=n.indexOf(": "),{text:l,wavPath:d}=r1(s>=0?n.slice(s+2):n);if(d){let e=this.resolveNetString(t[1]);i=e?`voice/${e}/${d}.wav`:d;let a=this.resolveNetString(t[2]);if(a){let e=parseFloat(a);Number.isFinite(e)&&(o=Math.max(.5,Math.min(2,e)))}}let c=e??0;this.pushChatMessage({timeSec:r,sender:a,text:l,kind:"chat",colorCode:c,segments:[{text:a?`${a}: ${l}`:l,colorCode:c}],soundPath:i,soundPitch:o})}}else if("CannedChatMessage"===e&&t.length>=6){let e=r2(this.resolveNetString(t[1])),a=rQ(this.resolveNetString(t[2])),n=rQ(this.resolveNetString(t[4])),i=this.formatRemoteArgs(t[1],t.slice(2));if(i){let o,s,{wavPath:l}=r1(i),d=r1(rQ(this.resolveNetString(t[3]))).text;if(l){let e=this.resolveNetString(t[5]);if(o=e?`voice/${e}/${l}.wav`:l,t[6]){let e=parseFloat(this.resolveNetString(t[6]));Number.isFinite(e)&&(s=Math.max(.5,Math.min(2,e)))}}let c=e??0,h=[];n&&h.push({text:`[${n}] `,colorCode:0}),h.push({text:a?`${a}: ${d}`:d,colorCode:c}),this.pushChatMessage({timeSec:r,sender:a,text:d,kind:"chat",colorCode:c,segments:h,soundPath:o,soundPitch:s})}}else if("ServerMessage"===e&&t.length>=2){this.handleServerMessage(t);let e=r2(this.resolveNetString(t[1])),a=this.formatRemoteArgs(t[1],t.slice(2));if(a){let{text:t,wavPath:n}=r1(a),i=e??0;this.pushChatMessage({timeSec:r,sender:"",text:t,kind:"server",colorCode:i,segments:[{text:t,colorCode:i}],soundPath:n??void 0})}}else this.handleHudRemoteCommand(e,t);return}if("Sim3DAudioEvent"===r||"Sim2DAudioEvent"===r||"Sim3DAudioEvent"===t||"Sim2DAudioEvent"===t){let e=a.profileId;if("number"==typeof e){let n=this.getTimeSec(),i="Sim3DAudioEvent"===r||"Sim3DAudioEvent"===t?a.position:void 0;this.audioEvents.push({profileId:e,position:i,timeSec:n}),this.audioEvents.length>100&&this.audioEvents.splice(0,this.audioEvents.length-100)}}}processGhostUpdate(e){let t,a=e.index,r=this.entityIdByGhostIndex.get(a);if(r){let t=this.entities.get(r);t&&"Projectile"===t.type&&!t.hasExploded&&null!=t.explosionDataBlockId&&t.position&&("delete"===e.type||"create"===e.type)&&this.spawnExplosion(t,[...t.position])}if("delete"===e.type){r&&(this.removeSoundSlotEntities(r),this.entities.delete(r),this.entityIdByGhostIndex.delete(a));return}let n=this.resolveGhostClassName(a,e.classId);if(!n){if("create"===e.type)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${a})`);return}let i=rT(n,a);r&&r!==i&&(this.removeSoundSlotEntities(r),this.entities.delete(r));let o=this.entities.get(i);if(o&&"create"===e.type?(this.removeSoundSlotEntities(i),o.spawnTick=this.tickCount,this.resetEntity(o),t=o):o?t=o:(t={id:i,ghostIndex:a,className:n,spawnTick:this.tickCount,type:rB(n),rotation:[0,0,0,1]},this.entities.set(i,t)),t.ghostIndex=a,t.className=n,t.type=rB(n),this.entityIdByGhostIndex.set(a,i),this.applyGhostData(t,e.parsedData),"create"===e.type&&e.parsedData){let r=(0,r4.ghostToSceneObject)(n,a,e.parsedData);r&&(t.sceneData=r)}}resetEntity(e){e.rotation=[0,0,0,1],e.hasExploded=void 0,e.explosionShape=void 0,e.explosionLifetimeTicks=void 0,e.faceViewer=void 0,e.simulatedVelocity=void 0,e.projectilePhysics=void 0,e.gravityMod=void 0,e.direction=void 0,e.velocity=void 0,e.position=void 0,e.dataBlock=void 0,e.dataBlockId=void 0,e.shapeHint=void 0,e.visual=void 0,e.targetId=void 0,e.targetRenderFlags=void 0,e.carryingFlag=void 0,e.sensorGroup=void 0,e.playerName=void 0,e.weaponShape=void 0,e.packShape=void 0,e.falling=void 0,e.jetting=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0,e.weaponImageStatesDbId=void 0,e.itemPhysics=void 0,e.threads=void 0,e.headPitch=void 0,e.headYaw=void 0,e.health=void 0,e.energy=void 0,e.maxEnergy=void 0,e.damageState=void 0,e.actionAnim=void 0,e.actionAtEnd=void 0,e.explosionDataBlockId=void 0,e.maintainEmitterId=void 0}applyGhostData(e,t){if(!t)return;let a=t.dataBlockId;if(null!=a){e.dataBlockId=a;let t=this.getDataBlockData(a),r=rW(e.className,t);if(e.visual=rY(e.className,t)??rJ(e.className,t),"string"==typeof r&&(e.shapeHint=r,e.dataBlock=r),"Player"===e.type&&"number"==typeof t?.maxEnergy&&(e.maxEnergy=t.maxEnergy),"Projectile"===e.type&&(rC.has(e.className)?e.projectilePhysics="linear":rE.has(e.className)?(e.projectilePhysics="ballistic",e.gravityMod=rX(t,["gravityMod"])??1):rw.has(e.className)&&(e.projectilePhysics="seeker")),"Projectile"===e.type&&null==e.explosionDataBlockId){let t=this.resolveExplosionInfo(a);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks,e.explosionDataBlockId=t.explosionDataBlockId)}if("Projectile"===e.type&&null==e.maintainEmitterId){let a=t?.baseEmitter;"number"==typeof a&&a>0&&(e.maintainEmitterId=a)}}if("Player"===e.type){let a=t.images;if(Array.isArray(a)&&a.length>0){let t=a.find(e=>0===e.index);if(t?.dataBlockId&&t.dataBlockId>0){let a=this.getDataBlockData(t.dataBlockId),r=rW("ShapeBaseImageData",a);if(r){let t=a?.mountPoint;(null==t||t<=0)&&!/pack_/i.test(r)&&(e.weaponShape=r)}let n=e.weaponImageState;e.weaponImageState={dataBlockId:t.dataBlockId,triggerDown:t.triggerDown??n?.triggerDown??!1,ammo:t.ammo??n?.ammo??!0,loaded:t.loaded??n?.loaded??!0,target:t.target??n?.target??!1,wet:t.wet??n?.wet??!1,fireCount:t.fireCount??n?.fireCount??0},a&&e.weaponImageStatesDbId!==t.dataBlockId&&(e.weaponImageStates=rK(a),e.weaponImageStatesDbId=t.dataBlockId)}else t&&!t.dataBlockId&&(e.weaponShape=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0);let r=a.find(e=>2===e.index);if(r?.dataBlockId&&r.dataBlockId>0){let t=rW("ShapeBaseImageData",this.getDataBlockData(r.dataBlockId));t&&(e.packShape=t)}else r&&!r.dataBlockId&&(e.packShape=void 0);let n=a.find(e=>3===e.index);if(n){let t=!!n.dataBlockId&&n.dataBlockId>0;if(e.carryingFlag=t,null!=e.targetId&&e.targetId>=0){let a=this.targetRenderFlags.get(e.targetId)??0,r=t?2|a:-3&a;r!==a&&(this.targetRenderFlags.set(e.targetId,r),e.targetRenderFlags=r)}}}}let r=rq(t.position)?t.position:rq(t.initialPosition)?t.initialPosition:rq(t.explodePosition)?t.explodePosition:rq(t.endPoint)?t.endPoint:rq(t.transform?.position)?t.transform.position:void 0;r&&(e.position=[r.x,r.y,r.z],this.updateSoundSlotPositions(e));let n=r$(t.direction)?t.direction:void 0;if(n&&(e.direction=[n.x,n.y,n.z]),"Player"===e.type&&"number"==typeof t.rotationZ&&(e.rotation=rV(t.rotationZ)),"Player"===e.type&&("number"==typeof t.headX&&(e.headPitch=t.headX),"number"==typeof t.headZ&&(e.headYaw=t.headZ)),rH(t.angPosition)){let a=rz(t.angPosition);a&&(e.rotation=a)}else if(rH(t.transform?.rotation)){let a=rz(t.transform.rotation);a&&(e.rotation=a)}else if("Item"===e.type&&"number"==typeof t.rotation?.angle){let a=t.rotation;e.rotation=rV((a.zSign??1)*a.angle)}else if("Projectile"===e.type){let a=t.velocity??t.direction??(rq(t.initialPosition)&&rq(t.endPos)?{x:t.endPos.x-t.initialPosition.x,y:t.endPos.y-t.initialPosition.y,z:t.endPos.z-t.initialPosition.z}:void 0);r$(a)&&(0!==a.x||0!==a.y)&&(e.rotation=rV(Math.atan2(a.x,a.y)))}if(r$(t.velocity)&&(e.velocity=[t.velocity.x,t.velocity.y,t.velocity.z],e.direction||(e.direction=[t.velocity.x,t.velocity.y,t.velocity.z])),"boolean"==typeof t.moveFlag0&&(e.falling=t.moveFlag0),"boolean"==typeof t.moveFlag1&&(e.jetting=t.moveFlag1),"Item"===e.type){let a=t.atRest;if(!1===a&&r$(t.velocity)){let a=null!=e.dataBlockId?this.getDataBlockData(e.dataBlockId):void 0;e.itemPhysics={velocity:[t.velocity.x,t.velocity.y,t.velocity.z],atRest:!1,elasticity:rX(a,["elasticity"])??.2,friction:rX(a,["friction"])??.6,gravityMod:rX(a,["gravityMod"])??1}}else!0===a&&(e.itemPhysics=void 0)}if(e.projectilePhysics){if("linear"===e.projectilePhysics){let a=rX(null!=e.dataBlockId?this.getDataBlockData(e.dataBlockId):void 0,["dryVelocity","muzzleVelocity","bulletVelocity"])??80,r=e.direction??[0,1,0],n=r[0]*a,i=r[1]*a,o=r[2]*a,s=t.excessVel,l=t.excessDir;"number"==typeof s&&s>0&&r$(l)&&(n+=l.x*s,i+=l.y*s,o+=l.z*s),e.simulatedVelocity=[n,i,o]}else r$(t.velocity)&&(e.simulatedVelocity=[t.velocity.x,t.velocity.y,t.velocity.z]);let a=t.currTick;if("number"==typeof a&&a>0&&e.simulatedVelocity&&e.position){let t=.032*a,r=e.simulatedVelocity;if(e.position[0]+=r[0]*t,e.position[1]+=r[1]*t,e.position[2]+=r[2]*t,"ballistic"===e.projectilePhysics){let a=-9.81*(e.gravityMod??1);e.position[2]+=.5*a*t*t,r[2]+=a*t}}}let i=rq(t.explodePosition)?t.explodePosition:rq(t.explodePoint)?t.explodePoint:void 0;if("Projectile"===e.type&&!e.hasExploded&&i&&null!=e.explosionDataBlockId&&this.spawnExplosion(e,[i.x,i.y,i.z]),"number"==typeof t.damageLevel&&(e.health=rA(1-t.damageLevel,0,1)),"number"==typeof t.damageState&&(e.damageState=t.damageState),"number"==typeof t.action&&(e.actionAnim=t.action,e.actionAtEnd=!!t.actionAtEnd),Array.isArray(t.threads)){let a=t.threads;if(e.threads){let t=[...e.threads];for(let e of a){let a=t.findIndex(t=>t.index===e.index);a>=0?t[a]=e:t.push(e)}e.threads=t}else e.threads=a}if("number"==typeof t.energy&&(e.energy=rA(t.energy,0,1)),"number"==typeof t.targetId){e.targetId=t.targetId;let a=this.targetNames.get(t.targetId);a&&(e.playerName=a);let r=this.targetTeams.get(t.targetId);null!=r&&(e.sensorGroup=r,e.ghostIndex===this.latestControl.ghostIndex&&"player"===this.lastControlType&&(this.playerSensorGroup=r));let n=this.targetRenderFlags.get(t.targetId);null!=n&&(e.targetRenderFlags=n)}let o=t.sounds;Array.isArray(o)&&this.syncSoundSlotEntities(e,o),"WayPoint"===e.className&&"string"==typeof t.name&&(e.label=t.name),"AudioEmitter"===e.className&&("string"==typeof t.filename&&(e.audioFileName=t.filename),"number"==typeof t.volume&&(e.audioVolume=t.volume),"boolean"==typeof t.is3D&&(e.audioIs3D=t.is3D),"boolean"==typeof t.isLooping&&(e.audioIsLooping=t.isLooping),"number"==typeof t.minDistance&&(e.audioMinDistance=t.minDistance),"number"==typeof t.maxDistance&&(e.audioMaxDistance=t.maxDistance),"number"==typeof t.minLoopGap&&(e.audioMinLoopGap=t.minLoopGap),"number"==typeof t.maxLoopGap&&(e.audioMaxLoopGap=t.maxLoopGap))}syncSoundSlotEntities(e,t){for(let a of t){let t=`${e.id}:sound:${a.index}`;if(a.playing&&"number"==typeof a.profileId){let r=this.getDataBlockData(a.profileId),n=r?.filename;if(!n)continue;let i=n.endsWith(".wav")?n:`${n}.wav`,o=r.description,s=null!=o?this.getDataBlockData(o):void 0,l=this.entities.get(t);l?l.position=e.position:this.entities.set(t,{id:t,ghostIndex:e.ghostIndex,className:"AudioEmitter",type:"AudioEmitter",spawnTick:this.tickCount,position:e.position,rotation:[0,0,0,1],audioFileName:i,audioVolume:s?.volume??1,audioIs3D:s?.is3D??!0,audioIsLooping:s?.isLooping??!1,audioMinDistance:s?.referenceDistance??20,audioMaxDistance:s?.maxDistance??100,audioMinLoopGap:s?.minLoopGap??0,audioMaxLoopGap:s?.maxLoopGap??0})}else this.entities.delete(t)}}updateSoundSlotPositions(e){for(let t=0;t<4;t++){let a=this.entities.get(`${e.id}:sound:${t}`);a&&(a.position=e.position)}}removeSoundSlotEntities(e){for(let t=0;t<4;t++)this.entities.delete(`${e}:sound:${t}`)}resolveExplosionInfo(e){let t=this.getDataBlockData(e);if(!t)return;let a=t.explosion;if(null==a)return;let r=this.getDataBlockData(a);if(!r)return;let n=r.dtsFileName||void 0,i=r.lifetimeMS??31;return{shape:n,faceViewer:!1!==r.faceViewer&&0!==r.faceViewer,lifetimeTicks:i,explosionDataBlockId:a}}spawnExplosion(e,t){e.hasExploded=!0;let a=e.explosionLifetimeTicks??31,r=`fx_${this.nextExplosionId++}`,n={id:r,ghostIndex:-1,className:"Explosion",spawnTick:this.tickCount,type:"Explosion",dataBlock:e.explosionShape,explosionDataBlockId:e.explosionDataBlockId,position:t,rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==e.faceViewer,expiryTick:this.tickCount+a};if(this.entities.set(r,n),null!=e.explosionDataBlockId){let a=this.getDataBlockData(e.explosionDataBlockId),r=a?.subExplosions;if(Array.isArray(r))for(let e of r){if(null==e)continue;let a=this.getDataBlockData(e);if(!a)continue;let r=a.dtsFileName||void 0;if(!r)continue;let n=a.lifetimeMS??31,i=a.offset??0,o=Math.random()*Math.PI*2,s=[t[0]+Math.cos(o)*i,t[1]+Math.sin(o)*i,t[2]],l=`fx_${this.nextExplosionId++}`,d={id:l,ghostIndex:-1,className:"Explosion",spawnTick:this.tickCount,type:"Explosion",dataBlock:r,explosionDataBlockId:e,position:s,rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==a.faceViewer&&0!==a.faceViewer,expiryTick:this.tickCount+n};this.entities.set(l,d)}}e.position=void 0,e.simulatedVelocity=void 0}advanceProjectiles(){for(let e of this.entities.values()){if(!e.simulatedVelocity||!e.position)continue;let t=e.simulatedVelocity,a=e.position;"ballistic"===e.projectilePhysics&&(t[2]+=-9.81*(e.gravityMod??1)*.032),a[0]+=.032*t[0],a[1]+=.032*t[1],a[2]+=.032*t[2],(0!==t[0]||0!==t[1])&&(e.rotation=rV(Math.atan2(t[0],t[1])))}}advanceItems(){for(let e of this.entities.values()){let t=e.itemPhysics;if(!t||t.atRest||!e.position)continue;let a=t.velocity,r=e.position;a[2]+=-20*t.gravityMod*.032,r[0]+=.032*a[0],r[1]+=.032*a[1],r[2]+=.032*a[2];let n=(0,r7.getTerrainHeightAt)(r[0],r[1]);if(null!=n&&r[2]0){let e=Math.max(0,1-i/o);a[0]*=e,a[1]*=e}.15>Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2])&&(a[0]=a[1]=a[2]=0,t.atRest=!0)}}}removeExpiredExplosions(){for(let[e,t]of this.entities)t.isExplosion&&null!=t.expiryTick&&this.tickCount>=t.expiryTick&&this.entities.delete(e)}updateCameraAndHud(){let e=this.latestControl,t=this.getTimeSec(),a=e.data,r=this.lastControlType;if(this.removeExpiredExplosions(),e.position){let{yaw:n,pitch:i}=this.getCameraYawPitch(a);if(this.isPiloting){if(a){let e=a.controlObjectData,t=e?.angPosition;if(t&&"number"==typeof t.w){this.lastVehicleHeading=rL(t),this.lastVehiclePitch=r_(t);let e=rz(t);if(e){let[t,a,r,n]=e;this.lastVehicleOrbitDir=[-(1-2*(a*a+r*r)),-(2*(t*a+r*n)),-(2*(t*r-a*n))]}}}n=this.lastVehicleHeading,i=this.lastVehiclePitch}if(this.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:rO(n,rA(i,-rU,rU)),fov:this.latestFov,mode:"observer",yaw:n,pitch:i},"camera"===r)if(("number"==typeof a?.cameraMode?a.cameraMode:this.lastCameraMode)===3){this.camera.mode="third-person","number"==typeof this.lastOrbitDistance&&(this.camera.orbitDistance=this.lastOrbitDistance);let e="number"==typeof a?.orbitObjectGhostIndex?a.orbitObjectGhostIndex:this.lastOrbitGhostIndex;"number"==typeof e&&e>=0&&(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.camera.mode="observer";else e.ghostIndex>=0&&(this.controlPlayerGhostId=this.resolveEntityIdForGhostIndex(e.ghostIndex)),this.firstPerson?this.camera.mode="first-person":(this.camera.mode="third-person",this.isPiloting&&null!=this.lastPilotGhostIndex?(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),this.camera.orbitDistance=15,this.lastVehicleOrbitDir&&(this.camera.orbitDirection=this.lastVehicleOrbitDir)):(this.camera.orbitTargetId=this.controlPlayerGhostId,this.camera.orbitDistance=3)),this.controlPlayerGhostId&&(this.camera.controlEntityId=this.controlPlayerGhostId);if("player"===r&&e.position){if(this.isPiloting&&null!=this.lastPilotGhostIndex){let r=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),n=r?this.entities.get(r):void 0;if(n){let r=a?.controlObjectData;if(r){n.position=[e.position.x,e.position.y,e.position.z],this.lastVehiclePos=n.position.slice(),this.lastVehiclePosTime=t;let a=r.linMomentum;if(a&&rq(a)){let e=n.dataBlockId,t=null!=e?this.getDataBlockData(e):void 0,r=t?.mass??200,i=r>0?1/r:.005;this.lastVehicleVelocity=[a.x*i,a.y*i,a.z*i],n.velocity=this.lastVehicleVelocity}let i=r.angPosition;if(i&&"number"==typeof i.w){let e=rz(i);e&&(n.rotation=e)}}else if(this.lastVehiclePos&&this.lastVehicleVelocity&&this.lastVehiclePosTime>0){let e=t-this.lastVehiclePosTime;if(e>0&&e<1){let[t,a,r]=this.lastVehicleVelocity;n.position=[this.lastVehiclePos[0]+t*e,this.lastVehiclePos[1]+a*e,this.lastVehiclePos[2]+r*e]}}}}else if(this.controlPlayerGhostId){let t=this.entities.get(this.controlPlayerGhostId);if(t){t.position=[e.position.x,e.position.y,e.position.z],t.rotation=rV(n),t.headPitch=this.getControlPlayerHeadPitch(i);let r=a?.velocity;r$(r)&&(t.velocity=[r.x,r.y,r.z],t.falling=r.z<-10)}}}}else this.camera&&(this.camera={...this.camera,time:t,fov:this.latestFov});let n={health:1,energy:1};if(this.camera?.mode==="first-person"){let e=this.controlPlayerGhostId,t=e?this.entities.get(e):void 0;n.health=t?.health??1;let r=a?.energyLevel;if("number"==typeof r){let e=t?.maxEnergy??60;e>0&&(n.energy=rA(r/e,0,1))}else n.energy=t?.energy??1}else if(this.camera?.mode==="third-person"&&this.camera.orbitTargetId){let e=this.entities.get(this.camera.orbitTargetId);n.health=e?.health??1,n.energy=e?.energy??1}this.lastStatus=n}getControlPlayerHeadPitch(e){return rA(e/rU,-1,1)}getAbsoluteRotation(e){return e?"number"==typeof e.rotationZ&&"number"==typeof e.headX?{yaw:e.rotationZ,pitch:e.headX}:"number"==typeof e.rotZ&&"number"==typeof e.rotX?{yaw:e.rotZ,pitch:e.rotX}:null:null}resolveIffColor(e){if(0===this.playerSensorGroup)return;let t=this.sensorGroupColors.get(this.playerSensorGroup);if(t){let a=t.get(e);if(a)return a}return e===this.playerSensorGroup?rR:0!==e?rN:void 0}pushChatMessage(e){this.chatMessages.push({...e,id:++this.chatMessageIdCounter}),this.chatMessages.length>200&&this.chatMessages.splice(0,this.chatMessages.length-200)}handleServerMessage(e){if(e.length<2)return;let t=this.resolveNetString(e[0]);if("MsgTeamScoreIs"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(a)){let e=this.teamScores.find(e=>e.teamId===t);e&&(e.score=a,this.onTeamScoresChanged())}}else if("MsgCTFAddTeam"===t&&e.length>=6){let t=parseInt(this.resolveNetString(e[2]),10),a=rQ(this.resolveNetString(e[3])),r=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)){let e=t+1,n=this.teamScores.find(t=>t.teamId===e);n?(n.name=a,n.score=isNaN(r)?n.score:r):this.teamScores.push({teamId:e,name:a,score:isNaN(r)?0:r,playerCount:0}),this.onTeamScoresChanged()}}else if("MsgClientJoin"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=rQ(this.resolveNetString(e[3]));if(!isNaN(t)){let e=this.playerRoster.get(t);this.playerRoster.set(t,{name:a,teamId:e?.teamId??0}),this.onRosterChanged()}}else if("MsgClientDrop"===t&&e.length>=3){let t=parseInt(this.resolveNetString(e[2]),10);isNaN(t)||(this.playerRoster.delete(t),this.onRosterChanged())}else if("MsgClientJoinTeam"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(a)){let e=this.playerRoster.get(t);e?e.teamId=a:this.playerRoster.set(t,{name:"",teamId:a}),this.onRosterChanged()}}}onTeamScoresChanged(){}onRosterChanged(){}handleHudRemoteCommand(e,t){if("setWeaponsHudItem"===e&&t.length>=3){let e=parseInt(t[0],10),a=parseInt(t[1],10),r="1"===t[2]||"true"===t[2];isNaN(e)||(r?this.weaponsHud.slots.set(e,isNaN(a)?-1:a):this.weaponsHud.slots.delete(e),this.onWeaponsHudChanged())}else if("setWeaponsHudAmmo"===e&&t.length>=2){let e=parseInt(t[0],10),a=parseInt(t[1],10);isNaN(e)||(this.weaponsHud.slots.set(e,isNaN(a)?-1:a),this.onWeaponsHudChanged())}else if("setWeaponsHudActive"===e&&t.length>=1){let e=parseInt(t[0],10);this.weaponsHud.activeIndex=isNaN(e)?-1:e,isNaN(e)||!(e>=0)||this.weaponsHud.slots.has(e)||this.weaponsHud.slots.set(e,-1),this.onWeaponsHudChanged()}else if("setWeaponsHudClearAll"===e)this.weaponsHud.slots.clear(),this.weaponsHud.activeIndex=-1,this.onWeaponsHudChanged();else if("setBackpackHudItem"===e&&t.length>=2){let e=parseInt(t[0],10);"1"!==t[1]&&"true"!==t[1]||isNaN(e)?this.backpackHud.packIndex=-1:this.backpackHud.packIndex=e,this.backpackHud.active=!1,this.backpackHud.text=""}else if("setSatchelArmed"===e)this.backpackHud.active=!0;else if("setCloakIconOn"===e||"setRepairPackIconOn"===e||"setShieldIconOn"===e||"setSenJamIconOn"===e)this.backpackHud.active=!0;else if("setCloakIconOff"===e||"setRepairPackIconOff"===e||"setShieldIconOff"===e||"setSenJamIconOff"===e)this.backpackHud.active=!1;else if("updatePackText"===e&&t.length>=1)this.backpackHud.text=t[0]??"";else if("setInventoryHudItem"===e&&t.length>=3){let e=parseInt(t[0],10),a=parseInt(t[1],10),r="1"===t[2]||"true"===t[2];isNaN(e)||(r&&!isNaN(a)?this.inventoryHud.slots.set(e,a):this.inventoryHud.slots.delete(e),this.onInventoryHudChanged())}else if("setInventoryHudAmount"===e&&t.length>=2){let e=parseInt(t[0],10),a=parseInt(t[1],10);isNaN(e)||isNaN(a)||(this.inventoryHud.slots.set(e,a),this.onInventoryHudChanged())}else"setInventoryHudClearAll"===e&&(this.inventoryHud.slots.clear(),this.inventoryHud.activeSlot=-1,this.onInventoryHudChanged())}onWeaponsHudChanged(){}onInventoryHudChanged(){}buildEntityList(e){let t=[];for(let a of this.entities.values()){if(e&&!e(a))continue;let r=null!=a.targetId&&a.targetId>=0?this.targetRenderFlags.get(a.targetId)??a.targetRenderFlags:a.targetRenderFlags;"Player"!==a.type||a.carryingFlag||(r=null!=r?-3&r:r),t.push({id:a.id,type:a.type,visual:a.visual,direction:a.direction,ghostIndex:a.ghostIndex,className:a.className,dataBlockId:a.dataBlockId,shapeHint:a.shapeHint,dataBlock:a.dataBlock,weaponShape:a.weaponShape,packShape:a.packShape,falling:a.falling,jetting:a.jetting,playerName:a.playerName,targetRenderFlags:r,iffColor:("Player"===a.type||((r??0)&2)!=0)&&null!=a.sensorGroup?this.resolveIffColor(a.sensorGroup):void 0,position:a.position&&(a.simulatedVelocity||a.itemPhysics&&!a.itemPhysics.atRest)?[...a.position]:a.position,rotation:a.rotation,velocity:a.velocity,health:a.health,energy:a.energy,actionAnim:a.actionAnim,actionAtEnd:a.actionAtEnd,damageState:a.damageState,faceViewer:a.faceViewer,threads:a.threads,explosionDataBlockId:a.explosionDataBlockId,maintainEmitterId:a.maintainEmitterId,weaponImageState:a.weaponImageState,weaponImageStates:a.weaponImageStates,headPitch:a.headPitch,headYaw:a.headYaw,label:a.label,audioFileName:a.audioFileName,audioVolume:a.audioVolume,audioIs3D:a.audioIs3D,audioIsLooping:a.audioIsLooping,audioMinDistance:a.audioMinDistance,audioMaxDistance:a.audioMaxDistance,audioMinLoopGap:a.audioMinLoopGap,audioMaxLoopGap:a.audioMaxLoopGap,sceneData:a.sceneData})}return t}buildHudState(){let e={slots:Array.from(this.weaponsHud.slots.entries()).map(([e,t])=>({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},t={slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},a=this.backpackHud.packIndex>=0?{...this.backpackHud}:null,r=this.teamScores.map(e=>({...e})),n=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&n.set(e,(n.get(e)??0)+1);for(let e of r)e.playerCount=n.get(e.teamId)??0;return{weaponsHud:e,inventoryHud:t,backpackHud:a,teamScores:r}}buildTimeFilteredEvents(e){return{chatMessages:this.chatMessages.slice(),audioEvents:this.audioEvents.filter(t=>t.timeSec>e-.5&&t.timeSec<=e)}}}e.s(["StreamEngine",()=>r9],10244)},71051,e=>{"use strict";class t{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{console.log("[relay] WebSocket connected to",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){console.error("Failed to parse relay message:",e)}},this.ws.onclose=()=>{console.log("[relay] WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{console.error("[relay] WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){console.log("[relay] Joining server:",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,a){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:a})}sendCRCCompute(e,t,a,r){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:r,datablocks:a})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMove(e){this.send({type:"sendMove",move:e})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):console.warn("[relay] send dropped (ws not open):",e.type)}}e.s(["RelayClient",()=>t])},98755,e=>{"use strict";e.i(47167);var t=e.i(8155),a=e.i(66748),r=e.i(71051);e.i(91891);var n=e.i(94802),i=e.i(89119),o=e.i(10244);class s extends o.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:a,packetParser:r}=(0,n.createLiveParser)();this.packetParser=r,this.ghostTracker=a,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,a=e.sequences;t&&a&&this._shapeConstructorCache.set(t.toLowerCase(),a)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,a]of t){let r=a.explosion;if(null==r)continue;let n=t.get(r);n?.dtsFileName&&e.add(n.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly"}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let a=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(a)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);console.log(`[live] auth event: ${a}`,t),this.relay.sendAuthEvent(a,t);return}let r=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===a){let e=r[0]??"";console.log(`[live] mission phase 1, seq=${e}`),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===a){let e=r[0]??"";console.log(`[live] mission phase 2 (datablocks), seq=${e}`),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===a){let e=r[0]??"";console.log(`[live] mission phase 3 (ghosting), seq=${e}`),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,a=e.field1,r=e.field2,n=(1&a)!=0;console.log(`[live] CRC challenge: seed=0x${(t>>>0).toString(16)} f1=0x${(a>>>0).toString(16)} f2=0x${(r>>>0).toString(16)} includeTextures=${n}`);let o=this.packetParser.getDataBlockDataMap(),s=[];if(o)for(let[e,t]of o){let a=this.dataBlockClassNames.get(e);if(!a)continue;let r=(0,i.resolveShapeName)(a,t);s.push({objectId:e,className:a,shapeName:r??""})}console.log(`[live] CRC: sending ${s.length} datablocks for computation`),this.relay.sendCRCCompute(t,r,s,n)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,a=e.sequence,r=e.ghostCount;console.log(`[live] GhostingMessageEvent: message=${t} sequence=${a} ghostCount=${r}`),0===t&&(console.log(`[live] Sending ghost ack (type 1) for sequence ${a}`),this.relay.sendGhostAck(a,r))}observerMode="fly";cycleObserveNext(){"fly"===this.observerMode?(console.log("[live] observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(console.log("[live] observer: cycle next (fire trigger)"),this.sendTrigger(0))}toggleObserverMode(){"fly"===this.observerMode?(console.log("[live] observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(console.log("[live] observer: follow → fly (jump trigger)"),this.sendTrigger(2),this.observerMode="fly")}sendTrigger(e){let t=[!1,!1,!1,!1,!1,!1];t[e]=!0,this.relay.sendMove({x:0,y:0,z:0,yaw:0,pitch:0,roll:0,trigger:t,freeLook:!1})}getPlayerList(){let e=[];for(let[t,a]of this.targetNames){let r=this.targetTeams.get(t)??0;e.push({targetId:t,name:a,sensorGroup:r})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,a=this.packetParser.protocolNoDispatch,r=this.packetParser.parsePacket(e),n=this.packetParser.protocolRejected>t,o=this.packetParser.protocolNoDispatch>a;(n||o)&&console.warn(`[live] packet #${this.tickCount} ${n?"REJECTED":"no-dispatch"}: ${e.length} bytes (total rejected=${this.packetParser.protocolRejected}, noDispatch=${this.packetParser.protocolNoDispatch})`);let s=this.tickCount<20,l=this.tickCount%100==0,d=s||l;for(let t of(d&&console.log(`[live] packet #${this.tickCount}: ${r.events.length} events, ${r.ghosts.length} ghosts, ${e.length} bytes`+(void 0!==r.gameState.controlObjectGhostIndex?`, control=${r.gameState.controlObjectGhostIndex}`:"")+(void 0!==r.gameState.cameraFov?`, fov=${r.gameState.cameraFov}`:"")),this.processControlObject(r.gameState),r.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");console.log(`[live] remote: ${e}`)}if(s&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&console.log(`[live] event: ${e}`,"SimDataBlockEvent"===e?{id:t.parsedData.objectId,className:t.parsedData.dataBlockClassName}:void 0),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,a=t.parsedData.dataBlockClassName;if(null!=e&&a&&this.dataBlockClassNames.set(e,a),d){let r=t.parsedData.dataBlockData,n=(0,i.resolveShapeName)(a??"",r);console.log(`[live] datablock: id=${e} class=${a??"?"}`+(n?` shape=${n}`:""))}}let a=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,a),s&&"NetStringEvent"===e){let e=t.parsedData.id,a=t.parsedData.value;null!=e&&"string"==typeof a&&console.log(`[live] netString #${e} = "${a.length>60?a.slice(0,60)+"…":a}"`)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,a=t.parsedData.nameTag;if(null!=e&&null!=a){let r=this.netStrings.get(a);if(r){let a=(0,i.stripTaggedStringMarkup)(r);console.log(`[live] target #${e}: "${a}" team=${t.parsedData.sensorGroup??"?"}`)}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&console.log(`[live] sensor group changed: → ${e}`)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,a=t.parsedData.colors;a&&console.log(`[live] sensor group colors: group=${e}, ${a.length} entries`)}}for(let e of r.ghosts){if("create"===e.type){let t=e.parsedData?.position,a=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,r=this.resolveGhostClassName(e.index,e.classId);console.log(`[live] ghost create: #${e.index} ${r??"?"}`+(a?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"")+` (${this.entities.size+1} entities total)`),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),a=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&console.log(`[live] ghost delete: #${e.index} ${a?.className??"?"} (${this.entities.size-1} entities remaining)`)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),l&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();console.log(`[live] status @ tick ${this.tickCount}: ${this.entities.size} entities, ${e?.size??0} datablocks, rejected=${this.packetParser.protocolRejected}, noDispatch=${this.packetParser.protocolNoDispatch}`)}let c=this.entities.size;if(1===this.tickCount||c>0&&c%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");console.log(`[live] entity count: ${c} (${t})`)}let h=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==h&&console.log(`[live] camera mode: ${h??"none"} → ${this.camera.mode}`+("third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:"")),this.tickCount<=5&&this.camera){let[e,t,a]=this.camera.position;console.log(`[live] camera: mode=${this.camera.mode} pos=(${e.toFixed(1)}, ${t.toFixed(1)}, ${a.toFixed(1)}) fov=${this.camera.fov}`)}}catch(t){console.error("Failed to process live packet:",t,{tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced})}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:a,audioEvents:r}=this.buildTimeFilteredEvents(t),{weaponsHud:n,inventoryHud:i,backpackHud:o,teamScores:s}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:a,audioEvents:r,weaponsHud:n,backpackHud:o,inventoryHud:i,teamScores:s};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}let l="wss://t2-relay.fly.dev",d=(0,t.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(a=l){let n=t();n._relay&&n._relay.close();let i=new r.RelayClient(a,{onOpen(){e({relayConnected:!0});let a=t();for(let e of a._pending)e();a._pending=[]},onStatus(t,a,r,n){console.log(`[relay] game status: ${t}${a?` — ${a}`:""}${n?` map=${n}`:""}`),e({gameStatus:t,gameStatusMessage:a,...n?{mapName:n}:{}})},onServerList(a){t()._listInFlight=!1,e({servers:a,serversLoading:!1})},onGamePacket(e){let a=t()._adapter;a||console.warn("[relay] received game packet but no adapter is active"),a?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(a){console.error("Relay error:",a),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let a=t();a._relay===i&&(a._relay=null,a._adapter=null,a._pending=[],a._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let a=t();a._relay?.close(),a._relay=null,a._adapter=null,a._pending=[],a._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let a=t();if(a._listInFlight)return;a._listInFlight=!0;let r=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),a._relay?.connected?r():(a._pending.push(r),a._relay||t().connectRelay())},joinServer(a,r){let n=t();if(!n._relay)return;let i=n.servers.find(e=>e.address===a),o=new s(n._relay);o.onReady=()=>e({liveReady:!0}),n._adapter=o,e({mapName:i?.mapName??n.mapName,serverName:i?.name,liveReady:!1,gameStatus:null,adapter:o}),n._relay.joinServer(a,r)},disconnectServer(){let a=t();a._relay?.disconnectServer(),a._adapter?.reset(),a._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMove(e){t()._relay?.sendMove(e)},sendCommand(e,...a){t()._relay?.sendCommand(e,a)}}));function c(e,t){return(0,a.useStoreWithEqualityFn)(d,e,t)}function h(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}function u(){let e=d.getState();e._relay?.close(),e._relay=null}e.s(["disposeLiveConnection",()=>u,"liveConnectionStore",0,d,"selectPing",()=>h,"useLiveSelector",()=>c],98755)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e5617268e3c7a140.js b/docs/_next/static/chunks/e5617268e3c7a140.js deleted file mode 100644 index e6d1ad19..00000000 --- a/docs/_next/static/chunks/e5617268e3c7a140.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64972,e=>{"use strict";var r=e.i(43476),t=e.i(932),i=e.i(71645),s=e.i(71753),o=e.i(47071),n=e.i(90072),a=e.i(85557),c=e.i(12979);let l=new n.Vector3,u=new n.Vector3,d=new n.Vector3,f=new n.Vector3,b=new n.Vector3,x=new n.Vector3,y=new n.Vector3(0,1,0);function h(e){let i,s,a,l,u,d=(0,t.c)(14),{visual:f}=e;d[0]!==f.texture?(i=(0,c.textureToUrl)(f.texture),d[0]=f.texture,d[1]=i):i=d[1];let b=i,x=(0,o.useTexture)(b,p),y=Array.isArray(x)?x[0]:x;d[2]!==f.color.b||d[3]!==f.color.g||d[4]!==f.color.r?(s=new n.Color().setRGB(f.color.r,f.color.g,f.color.b,n.SRGBColorSpace),d[2]=f.color.b,d[3]=f.color.g,d[4]=f.color.r,d[5]=s):s=d[5];let h=s;return d[6]!==f.size?(a=[f.size,f.size,1],d[6]=f.size,d[7]=a):a=d[7],d[8]!==h||d[9]!==y?(l=(0,r.jsx)("spriteMaterial",{map:y,color:h,transparent:!0,blending:n.AdditiveBlending,depthWrite:!1,toneMapped:!1}),d[8]=h,d[9]=y,d[10]=l):l=d[10],d[11]!==a||d[12]!==l?(u=(0,r.jsx)("sprite",{scale:a,children:l}),d[11]=a,d[12]=l,d[13]=u):u=d[13],u}function p(e){let r=Array.isArray(e)?e[0]:e;(0,a.setupEffectTexture)(r)}function m(e){let h,p,m,g,S,w,j,z,T,V,v,C,B=(0,t.c)(28),{entity:R,visual:U}=e,_=(0,i.useRef)(null),F=(0,i.useRef)(null),q=(0,i.useRef)(null);B[0]===Symbol.for("react.memo_cache_sentinel")?(h=new n.Quaternion,B[0]=h):h=B[0];let M=(0,i.useRef)(h);B[1]!==U.texture?(p=(0,c.textureToUrl)(U.texture),B[1]=U.texture,B[2]=p):p=B[2];let W=U.crossTexture??U.texture;B[3]!==W?(m=(0,c.textureToUrl)(W),B[3]=W,B[4]=m):m=B[4],B[5]!==p||B[6]!==m?(g=[p,m],B[5]=p,B[6]=m,B[7]=g):g=B[7];let G=g,P=(0,o.useTexture)(G,A);B[8]!==P?(S=Array.isArray(P)?P:[P,P],B[8]=P,B[9]=S):S=B[9];let[D,L]=S;return B[10]!==R||B[11]!==U.crossSize||B[12]!==U.crossViewAng||B[13]!==U.renderCross||B[14]!==U.tracerLength||B[15]!==U.tracerWidth?(w=e=>{let{camera:r}=e,t=_.current,i=F.current;if(!t||!i)return;let s=R.keyframes?.[0],o=s?.position,n=R.direction??s?.velocity;if(!o||!n||((0,a.torqueVecToThree)(n,l),1e-8>l.lengthSq())){t.visible=!1,q.current&&(q.current.visible=!1);return}l.normalize(),t.visible=!0,(0,a.torqueVecToThree)(o,x),u.copy(x).sub(r.position),d.crossVectors(u,l),1e-8>d.lengthSq()&&(d.crossVectors(y,l),1e-8>d.lengthSq()&&d.set(1,0,0)),d.normalize().multiplyScalar(U.tracerWidth);let c=.5*U.tracerLength;f.copy(l).multiplyScalar(-c),b.copy(l).multiplyScalar(c);let h=i.array;h[0]=f.x+d.x,h[1]=f.y+d.y,h[2]=f.z+d.z,h[3]=f.x-d.x,h[4]=f.y-d.y,h[5]=f.z-d.z,h[6]=b.x-d.x,h[7]=b.y-d.y,h[8]=b.z-d.z,h[9]=b.x+d.x,h[10]=b.y+d.y,h[11]=b.z+d.z,i.needsUpdate=!0;let p=q.current;if(!p)return;if(!U.renderCross){p.visible=!1;return}u.normalize();let m=l.dot(u);if(m>-U.crossViewAng&&mh,"TracerProjectile",()=>m])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/796073b9f885dcbc.js b/docs/_next/static/chunks/ebf99400aa3d97c0.js similarity index 55% rename from docs/_next/static/chunks/796073b9f885dcbc.js rename to docs/_next/static/chunks/ebf99400aa3d97c0.js index 66b4e73c..e24869d4 100644 --- a/docs/_next/static/chunks/796073b9f885dcbc.js +++ b/docs/_next/static/chunks/ebf99400aa3d97c0.js @@ -163,4 +163,4 @@ // Apply volumetric fog using shared Torque-style fog shader ${m.fogFragmentShader} } -`;var h=e.i(79123);function x(e){let o,r,n=(0,a.c)(5),{surfaceTexture:l,attach:u}=e;n[0]!==l?(o=(0,c.textureToUrl)(l),n[0]=l,n[1]=o):o=n[1];let f=o,v=(0,s.useTexture)(f,T);return n[2]!==u||n[3]!==v?(r=(0,t.jsx)("meshStandardMaterial",{attach:u,map:v,transparent:!0,opacity:.8,side:i.DoubleSide}),n[2]=u,n[3]=v,n[4]=r):r=n[4],r}function T(e){return(0,v.setupTexture)(e)}let b=(0,o.memo)(function(e){let r,s,c,v,d,m,p,g,x,T,b,E,_,S,V,P,U,C,F,D=(0,a.c)(59),{scene:A}=e,{debugMode:O}=(0,h.useDebug)();D[0]!==A.transform?(r=(0,f.matrixFToQuaternion)(A.transform),D[0]=A.transform,D[1]=r):r=D[1];let W=r;D[2]!==A.transform.position?(s=(0,f.torqueToThree)(A.transform.position),D[2]=A.transform.position,D[3]=s):s=D[3];let I=s;D[4]!==A.scale?(c=(0,f.torqueScaleToThree)(A.scale),D[4]=A.scale,D[5]=c):c=D[5];let R=c,[z,B,j]=R,G=(0,u.useThree)(w),N=(C=(0,a.c)(1),F=(0,o.useRef)(null),C[0]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{if(!F.current)return F.current=e.clone(),!0;let t=F.current.x===e.x&&F.current.y===e.y&&F.current.z===e.z;return t||F.current.copy(e),t},C[0]=U):U=C[0],U),L=A.waveMagnitude,[Q,Y,X]=I,q=Q+1024,H=X+1024;D[6]!==q?(v=Math.round(q/8),D[6]=q,D[7]=v):v=D[7];let $=v;D[8]!==H?(d=Math.round(H/8),D[8]=H,D[9]=d):d=D[9];let Z=d,k=8*($=Math.max(0,Math.min(2040,$))),J=8*(Z=Math.max(0,Math.min(2040,Z)));D[10]!==k||D[11]!==J||D[12]!==Y?(m=[k,Y,J],D[10]=k,D[11]=J,D[12]=Y,D[13]=m):m=D[13];let K=m,ee=M;D[14]!==G.position.x||D[15]!==G.position.z?(p=()=>ee(G.position.x,G.position.z),D[14]=G.position.x,D[15]=G.position.z,D[16]=p):p=D[16];let[et,ea]=(0,o.useState)(p);D[17]!==G.position||D[18]!==N?(g=()=>{if(!N(G.position))return;let e=ee(G.position.x,G.position.z);ea(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)},D[17]=G.position,D[18]=N,D[19]=g):g=D[19],(0,l.useFrame)(g);let eo=A.surfaceName||"liquidTiles/BlueWater",er=A.envMapName||void 0,ei=A.surfaceOpacity,en=A.envMapIntensity;if(D[20]!==z||D[21]!==B||D[22]!==j){let e,[t,a]=(e=z<=1024&&j<=1024?8:16,[Math.max(4,Math.ceil(z/e)),Math.max(4,Math.ceil(j/e))]);(x=new i.PlaneGeometry(z,j,t,a)).rotateX(-Math.PI/2),x.translate(z/2,B,j/2),D[20]=z,D[21]=B,D[22]=j,D[23]=x}else x=D[23];let es=x;if(D[24]!==es?(b=()=>()=>{es.dispose()},T=[es],D[24]=es,D[25]=T,D[26]=b):(T=D[25],b=D[26]),(0,o.useEffect)(b,T),D[27]!==O||D[28]!==I[0]||D[29]!==I[1]||D[30]!==I[2]||D[31]!==R||D[32]!==z||D[33]!==B||D[34]!==j?(E=O&&(0,t.jsx)(n,{args:R,position:[I[0]+z/2,I[1]+B/2,I[2]+j/2],children:(0,t.jsx)("meshBasicMaterial",{color:"#00fbff",wireframe:!0})}),D[27]=O,D[28]=I[0],D[29]=I[1],D[30]=I[2],D[31]=R,D[32]=z,D[33]=B,D[34]=j,D[35]=E):E=D[35],D[36]!==K||D[37]!==et||D[38]!==es){let e;D[40]!==K||D[41]!==es?(e=e=>{let[a,o]=e,r=K[0]+2048*a-1024,n=K[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:es,position:[r,K[1],n],children:(0,t.jsx)("meshStandardMaterial",{color:"#00fbff",transparent:!0,opacity:.4,wireframe:!0,side:i.DoubleSide})},`${a},${o}`)},D[40]=K,D[41]=es,D[42]=e):e=D[42],_=et.map(e),D[36]=K,D[37]=et,D[38]=es,D[39]=_}else _=D[39];return D[43]!==K||D[44]!==en||D[45]!==er||D[46]!==ei||D[47]!==et||D[48]!==es||D[49]!==eo||D[50]!==L?(S=(0,t.jsx)(y,{reps:et,basePosition:K,surfaceGeometry:es,surfaceTexture:eo,envMapTexture:er,opacity:ei,waveMagnitude:L,envMapIntensity:en}),D[43]=K,D[44]=en,D[45]=er,D[46]=ei,D[47]=et,D[48]=es,D[49]=eo,D[50]=L,D[51]=S):S=D[51],D[52]!==_||D[53]!==S?(V=(0,t.jsx)(o.Suspense,{fallback:_,children:S}),D[52]=_,D[53]=S,D[54]=V):V=D[54],D[55]!==W||D[56]!==E||D[57]!==V?(P=(0,t.jsxs)("group",{quaternion:W,children:[E,V]}),D[55]=W,D[56]=E,D[57]=V,D[58]=P):P=D[58],P}),y=(0,o.memo)(function({reps:e,basePosition:a,surfaceGeometry:r,surfaceTexture:n,envMapTexture:u,opacity:f,waveMagnitude:m,envMapIntensity:x}){let T=(0,c.textureToUrl)(n),b=(0,c.textureToUrl)(u??"special/lush_env"),[y,w]=(0,s.useTexture)([T,b],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,v.setupTexture)(e),e.colorSpace=i.NoColorSpace,e.wrapS=i.RepeatWrapping,e.wrapT=i.RepeatWrapping})}),{animationEnabled:M}=(0,h.useSettings)(),E=(0,o.useMemo)(()=>{var e;return e={opacity:f,waveMagnitude:m,envMapIntensity:x,baseTexture:y,envMapTexture:w},new i.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:e?.opacity??.75},uWaveMagnitude:{value:e?.waveMagnitude??1},uEnvMapIntensity:{value:e?.envMapIntensity??1},uBaseTexture:{value:e?.baseTexture??null},uEnvMapTexture:{value:e?.envMapTexture??null},fogColor:{value:new i.Color},fogNear:{value:1},fogFar:{value:2e3},fogVolumeData:d.globalFogUniforms.fogVolumeData,cameraHeight:d.globalFogUniforms.cameraHeight,fogEnabled:d.globalFogUniforms.fogEnabled},vertexShader:p,fragmentShader:g,transparent:!0,side:i.DoubleSide,depthWrite:!0,fog:!0})},[f,m,x,y,w]),_=(0,o.useRef)(0);return(0,l.useFrame)((e,t)=>{M?(_.current+=t,E.uniforms.uTime.value=_.current):(_.current=0,E.uniforms.uTime.value=0)}),(0,o.useEffect)(()=>()=>{E.dispose()},[E]),(0,t.jsx)(t.Fragment,{children:e.map(([e,o])=>{let i=a[0]+2048*e-1024,n=a[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:r,material:E,position:[i,a[1],n]},`${e},${o}`)})})});function w(e){return e.camera}function M(e,t){let a=e+1024,o=t+1024,r=Math.trunc(a/2048),i=Math.trunc(o/2048);a<0&&r--,o<0&&i--;let n=[];for(let e=i-1;e<=i+1;e++)for(let t=r-1;t<=r+1;t++)n.push([t,e]);return n}e.s(["WaterBlock",0,b,"WaterMaterial",()=>x],42585)}]); \ No newline at end of file +`;var h=e.i(79123);function x(e){let o,r,n=(0,a.c)(5),{surfaceTexture:l,attach:u}=e;n[0]!==l?(o=(0,c.textureToUrl)(l),n[0]=l,n[1]=o):o=n[1];let f=o,v=(0,s.useTexture)(f,T);return n[2]!==u||n[3]!==v?(r=(0,t.jsx)("meshStandardMaterial",{attach:u,map:v,transparent:!0,opacity:.8,side:i.DoubleSide}),n[2]=u,n[3]=v,n[4]=r):r=n[4],r}function T(e){return(0,v.setupTexture)(e)}let b=(0,o.memo)(function(e){let r,s,c,v,d,m,p,g,x,T,b,E,_,S,V,P,U,C,D,F=(0,a.c)(59),{entity:A}=e,O=A.waterData,{debugMode:W}=(0,h.useDebug)();F[0]!==O.transform?(r=(0,f.matrixFToQuaternion)(O.transform),F[0]=O.transform,F[1]=r):r=F[1];let I=r;F[2]!==O.transform.position?(s=(0,f.torqueToThree)(O.transform.position),F[2]=O.transform.position,F[3]=s):s=F[3];let R=s;F[4]!==O.scale?(c=(0,f.torqueScaleToThree)(O.scale),F[4]=O.scale,F[5]=c):c=F[5];let z=c,[B,j,G]=z,N=(0,u.useThree)(w),L=(C=(0,a.c)(1),D=(0,o.useRef)(null),C[0]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{if(!D.current)return D.current=e.clone(),!0;let t=D.current.x===e.x&&D.current.y===e.y&&D.current.z===e.z;return t||D.current.copy(e),t},C[0]=U):U=C[0],U),Q=O.waveMagnitude,[Y,X,q]=R,H=Y+1024,$=q+1024;F[6]!==H?(v=Math.round(H/8),F[6]=H,F[7]=v):v=F[7];let Z=v;F[8]!==$?(d=Math.round($/8),F[8]=$,F[9]=d):d=F[9];let k=d,J=8*(Z=Math.max(0,Math.min(2040,Z))),K=8*(k=Math.max(0,Math.min(2040,k)));F[10]!==J||F[11]!==K||F[12]!==X?(m=[J,X,K],F[10]=J,F[11]=K,F[12]=X,F[13]=m):m=F[13];let ee=m,et=M;F[14]!==N.position.x||F[15]!==N.position.z?(p=()=>et(N.position.x,N.position.z),F[14]=N.position.x,F[15]=N.position.z,F[16]=p):p=F[16];let[ea,eo]=(0,o.useState)(p);F[17]!==N.position||F[18]!==L?(g=()=>{if(!L(N.position))return;let e=et(N.position.x,N.position.z);eo(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)},F[17]=N.position,F[18]=L,F[19]=g):g=F[19],(0,l.useFrame)(g);let er=O.surfaceName||"liquidTiles/BlueWater",ei=O.envMapName||void 0,en=O.surfaceOpacity,es=O.envMapIntensity;if(F[20]!==B||F[21]!==j||F[22]!==G){let e,[t,a]=(e=B<=1024&&G<=1024?8:16,[Math.max(4,Math.ceil(B/e)),Math.max(4,Math.ceil(G/e))]);(x=new i.PlaneGeometry(B,G,t,a)).rotateX(-Math.PI/2),x.translate(B/2,j,G/2),F[20]=B,F[21]=j,F[22]=G,F[23]=x}else x=F[23];let el=x;if(F[24]!==el?(b=()=>()=>{el.dispose()},T=[el],F[24]=el,F[25]=T,F[26]=b):(T=F[25],b=F[26]),(0,o.useEffect)(b,T),F[27]!==W||F[28]!==R[0]||F[29]!==R[1]||F[30]!==R[2]||F[31]!==z||F[32]!==B||F[33]!==j||F[34]!==G?(E=W&&(0,t.jsx)(n,{args:z,position:[R[0]+B/2,R[1]+j/2,R[2]+G/2],children:(0,t.jsx)("meshBasicMaterial",{color:"#00fbff",wireframe:!0})}),F[27]=W,F[28]=R[0],F[29]=R[1],F[30]=R[2],F[31]=z,F[32]=B,F[33]=j,F[34]=G,F[35]=E):E=F[35],F[36]!==ee||F[37]!==ea||F[38]!==el){let e;F[40]!==ee||F[41]!==el?(e=e=>{let[a,o]=e,r=ee[0]+2048*a-1024,n=ee[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:el,position:[r,ee[1],n],children:(0,t.jsx)("meshStandardMaterial",{color:"#00fbff",transparent:!0,opacity:.4,wireframe:!0,side:i.DoubleSide})},`${a},${o}`)},F[40]=ee,F[41]=el,F[42]=e):e=F[42],_=ea.map(e),F[36]=ee,F[37]=ea,F[38]=el,F[39]=_}else _=F[39];return F[43]!==ee||F[44]!==es||F[45]!==ei||F[46]!==en||F[47]!==ea||F[48]!==el||F[49]!==er||F[50]!==Q?(S=(0,t.jsx)(y,{reps:ea,basePosition:ee,surfaceGeometry:el,surfaceTexture:er,envMapTexture:ei,opacity:en,waveMagnitude:Q,envMapIntensity:es}),F[43]=ee,F[44]=es,F[45]=ei,F[46]=en,F[47]=ea,F[48]=el,F[49]=er,F[50]=Q,F[51]=S):S=F[51],F[52]!==_||F[53]!==S?(V=(0,t.jsx)(o.Suspense,{fallback:_,children:S}),F[52]=_,F[53]=S,F[54]=V):V=F[54],F[55]!==I||F[56]!==E||F[57]!==V?(P=(0,t.jsxs)("group",{quaternion:I,children:[E,V]}),F[55]=I,F[56]=E,F[57]=V,F[58]=P):P=F[58],P}),y=(0,o.memo)(function({reps:e,basePosition:a,surfaceGeometry:r,surfaceTexture:n,envMapTexture:u,opacity:f,waveMagnitude:m,envMapIntensity:x}){let T=(0,c.textureToUrl)(n),b=(0,c.textureToUrl)(u??"special/lush_env"),[y,w]=(0,s.useTexture)([T,b],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,v.setupTexture)(e),e.colorSpace=i.NoColorSpace,e.wrapS=i.RepeatWrapping,e.wrapT=i.RepeatWrapping})}),{animationEnabled:M}=(0,h.useSettings)(),E=(0,o.useMemo)(()=>{var e;return e={opacity:f,waveMagnitude:m,envMapIntensity:x,baseTexture:y,envMapTexture:w},new i.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:e?.opacity??.75},uWaveMagnitude:{value:e?.waveMagnitude??1},uEnvMapIntensity:{value:e?.envMapIntensity??1},uBaseTexture:{value:e?.baseTexture??null},uEnvMapTexture:{value:e?.envMapTexture??null},fogColor:{value:new i.Color},fogNear:{value:1},fogFar:{value:2e3},fogVolumeData:d.globalFogUniforms.fogVolumeData,cameraHeight:d.globalFogUniforms.cameraHeight,fogEnabled:d.globalFogUniforms.fogEnabled},vertexShader:p,fragmentShader:g,transparent:!0,side:i.DoubleSide,depthWrite:!0,fog:!0})},[f,m,x,y,w]),_=(0,o.useRef)(0);return(0,l.useFrame)((e,t)=>{M?(_.current+=t,E.uniforms.uTime.value=_.current):(_.current=0,E.uniforms.uTime.value=0)}),(0,o.useEffect)(()=>()=>{E.dispose()},[E]),(0,t.jsx)(t.Fragment,{children:e.map(([e,o])=>{let i=a[0]+2048*e-1024,n=a[2]+2048*o-1024;return(0,t.jsx)("mesh",{geometry:r,material:E,position:[i,a[1],n]},`${e},${o}`)})})});function w(e){return e.camera}function M(e,t){let a=e+1024,o=t+1024,r=Math.trunc(a/2048),i=Math.trunc(o/2048);a<0&&r--,o<0&&i--;let n=[];for(let e=i-1;e<=i+1;e++)for(let t=r-1;t<=r+1;t++)n.push([t,e]);return n}e.s(["WaterBlock",0,b,"WaterMaterial",()=>x],42585)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/fcfc8a45de71c4a4.js b/docs/_next/static/chunks/fcfc8a45de71c4a4.js new file mode 100644 index 00000000..97c46aac --- /dev/null +++ b/docs/_next/static/chunks/fcfc8a45de71c4a4.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),A=x.searchParams,E=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,A??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,A),Object.keys(E.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t)),E.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?A?.getAll(r):A?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${A?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},E.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,A=!1,E=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);bt(e),A?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,68754,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function A(e){return e}function E(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eA(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eE(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eE(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eA);return(t&&eA(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,A=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),E=i.onFocusCapture,w=W(t=>{if(null==E||E(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:A,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();E(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,A=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:A,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e4=(0,R.createContext)(void 0),e5=ec([e1,ev],[e2,eg]),e8=e5.useContext,e6=e5.useScopedContext,e9=e5.useProviderContext,e7=e5.ContextProvider,te=e5.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return E(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,A=e9();E(e=e||A,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();E(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=A,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tA=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tA(e))});var{useSyncExternalStore:tE}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=A){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tE(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tE(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&atR,"useStoreProps",()=>tM,"useStoreState",()=>t_,"useStoreStateObject",()=>tT],68754);var tI=es(function({store:e,rowId:t,preventScrollOnKeyDown:r=!1,moveOnKeyPress:i=!0,tabbable:o=!1,getItem:a,"aria-setsize":l,"aria-posinset":s,...c}){let m=em();e=e||m;let h=z(c.id),v=(0,R.useRef)(null),g=(0,R.useContext)(eb),S=_(c)&&!c.accessibleWhenDisabled,{rowId:C,baseElement:x,isActiveItem:A,ariaSetSize:E,ariaPosInSet:w,isTabbable:M}=tT(e,{rowId:e=>t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":A||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tA(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":E,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();E(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),A=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e4)])?d:"option",children:t,...s,onClick:A,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();E(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;E(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e4.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t4(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t5(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t4(e,t,t=>{t5(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:A,unstable_treeSnapshotKey:E,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t4(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,E]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t4(q,t,n=>{t5(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,E]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eA]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eA,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rA(e){return e.split("-")[1]}function rE(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rE(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rA(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r4(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r4(){return!("u"rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();E(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),A=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==A?void 0:A.isConnected))return;A.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return E(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:E=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!E?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==A;!C&&I&&O.push(...(f=rA(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===A,R),f&&(d=d.map(e=>e+"-"+f),E&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rA(l),r=rw(t=rE(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rE(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rE(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rE(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,A=rm(f[v?"top":"left"],x),E=rm(f[v?"bottom":"right"],x),w=C-h[m]-E,_=C/2-h[m]/2+(y/2-b/2),T=rh(A,rm(_,w)),M=!u.arrow&&null!=rA(i)&&_!==T&&o.reference[m]/2-(_{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rA(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,A=S,E=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(A=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?E=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):A=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:E,availableHeight:A});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,A,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(A.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;A.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,A,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,A,S,C,A,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==A?void 0:A.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{A.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,A,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();E(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nA=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nA],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nE=ec([ev],[eg]),nw=nE.useContext;nE.useScopedContext,nE.useProviderContext,nE.ContextProvider,nE.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),A=y&&c&&(m?"horizontal"!==c:"vertical"!==c),E=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(A&&!E?v:nM(v,g.rowId),l,E),l);return null==e?void 0:e.id}if(A){let e=nT(E?C:S,l);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&E?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return E(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",A="[object WeakMap]",E="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[E]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[A]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eA.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eA.prototype.delete=function(e){return eP(this,e).delete(e)},eA.prototype.get=function(e){return eP(this,e).get(e)},eA.prototype.has=function(e){return eP(this,e).has(e)},eA.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eE.prototype.add=eE.prototype.push=function(e){return this.__data__.set(e,l),this},eE.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eA(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eE:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Backdrop:"MissionSelect-module__N_AIjG__Backdrop",Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)}]); \ No newline at end of file diff --git a/docs/_next/static/MrEXjMpW9X_XkpwJ2-Z7S/_buildManifest.js b/docs/_next/static/n8myNCT_KvBz4YicTIvRW/_buildManifest.js similarity index 100% rename from docs/_next/static/MrEXjMpW9X_XkpwJ2-Z7S/_buildManifest.js rename to docs/_next/static/n8myNCT_KvBz4YicTIvRW/_buildManifest.js diff --git a/docs/_next/static/MrEXjMpW9X_XkpwJ2-Z7S/_clientMiddlewareManifest.json b/docs/_next/static/n8myNCT_KvBz4YicTIvRW/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/MrEXjMpW9X_XkpwJ2-Z7S/_clientMiddlewareManifest.json rename to docs/_next/static/n8myNCT_KvBz4YicTIvRW/_clientMiddlewareManifest.json diff --git a/docs/_next/static/MrEXjMpW9X_XkpwJ2-Z7S/_ssgManifest.js b/docs/_next/static/n8myNCT_KvBz4YicTIvRW/_ssgManifest.js similarity index 100% rename from docs/_next/static/MrEXjMpW9X_XkpwJ2-Z7S/_ssgManifest.js rename to docs/_next/static/n8myNCT_KvBz4YicTIvRW/_ssgManifest.js diff --git a/docs/_not-found/__next._full.txt b/docs/_not-found/__next._full.txt index 5d404cf6..f56f2c1a 100644 --- a/docs/_not-found/__next._full.txt +++ b/docs/_not-found/__next._full.txt @@ -7,8 +7,8 @@ 8:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] a:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -0:{"P":null,"b":"MrEXjMpW9X_XkpwJ2-Z7S","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +0:{"P":null,"b":"n8myNCT_KvBz4YicTIvRW","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} 9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] 7:null diff --git a/docs/_not-found/__next._head.txt b/docs/_not-found/__next._head.txt index bb4fbe05..ec4eb6ad 100644 --- a/docs/_not-found/__next._head.txt +++ b/docs/_not-found/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._index.txt b/docs/_not-found/__next._index.txt index 58c2cae6..7b7002dc 100644 --- a/docs/_not-found/__next._index.txt +++ b/docs/_not-found/__next._index.txt @@ -2,5 +2,5 @@ 2:I[12985,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js"],"NuqsAdapter"] 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._not-found.__PAGE__.txt b/docs/_not-found/__next._not-found.__PAGE__.txt index 498249c5..49b452bf 100644 --- a/docs/_not-found/__next._not-found.__PAGE__.txt +++ b/docs/_not-found/__next._not-found.__PAGE__.txt @@ -1,5 +1,5 @@ 1:"$Sreact.fragment" 2:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 3:"$Sreact.suspense" -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} 4:null diff --git a/docs/_not-found/__next._not-found.txt b/docs/_not-found/__next._not-found.txt index 5226b333..564023ae 100644 --- a/docs/_not-found/__next._not-found.txt +++ b/docs/_not-found/__next._not-found.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._tree.txt b/docs/_not-found/__next._tree.txt index 384c241f..69afba48 100644 --- a/docs/_not-found/__next._tree.txt +++ b/docs/_not-found/__next._tree.txt @@ -1,2 +1,2 @@ -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_not-found/index.html b/docs/_not-found/index.html index be6e873b..2b94f253 100644 --- a/docs/_not-found/index.html +++ b/docs/_not-found/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_not-found/index.txt b/docs/_not-found/index.txt index 5d404cf6..f56f2c1a 100644 --- a/docs/_not-found/index.txt +++ b/docs/_not-found/index.txt @@ -7,8 +7,8 @@ 8:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] a:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -0:{"P":null,"b":"MrEXjMpW9X_XkpwJ2-Z7S","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +0:{"P":null,"b":"n8myNCT_KvBz4YicTIvRW","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} 9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] 7:null diff --git a/docs/index.html b/docs/index.html index fbbab887..c4529816 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index 4761c8c1..88f109fa 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -3,16 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/ac206141b5c1882c.js","/t2-mapper/_next/static/chunks/164bc8495505bc95.js","/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/c293826b70147a61.js","/t2-mapper/_next/static/chunks/576b06837c0cb7a0.js","/t2-mapper/_next/static/chunks/534ef931e88eb989.js","/t2-mapper/_next/static/chunks/5b60a5e8e48bc409.js","/t2-mapper/_next/static/chunks/9eaea0ae086bad69.js","/t2-mapper/_next/static/chunks/037fbc56cebf7caa.js","/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","/t2-mapper/_next/static/chunks/e4a5074909f0df67.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/5be53d01eebba2c6.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/2afaf0aea010c2be.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/1a6c33d7ed444b1d.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/744d1b0edcf40c69.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -:HL["/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","style"] -0:{"P":null,"b":"MrEXjMpW9X_XkpwJ2-Z7S","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/9542fc38c512bd1a.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ac206141b5c1882c.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/164bc8495505bc95.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/c293826b70147a61.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/576b06837c0cb7a0.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/534ef931e88eb989.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/5b60a5e8e48bc409.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9eaea0ae086bad69.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/037fbc56cebf7caa.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/e4a5074909f0df67.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"P":null,"b":"n8myNCT_KvBz4YicTIvRW","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/5be53d01eebba2c6.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/2afaf0aea010c2be.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/1a6c33d7ed444b1d.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/744d1b0edcf40c69.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/shapes/__next._full.txt b/docs/shapes/__next._full.txt index 118f1760..bc145ac0 100644 --- a/docs/shapes/__next._full.txt +++ b/docs/shapes/__next._full.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/88a5cf0ea7f16af4.js","/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","/t2-mapper/_next/static/chunks/b00acbf8afd8b4b6.js","/t2-mapper/_next/static/chunks/818dce712bc45cb4.js","/t2-mapper/_next/static/chunks/2edeeda5ca6dc680.js","/t2-mapper/_next/static/chunks/82a44da545bac352.js","/t2-mapper/_next/static/chunks/e1a8caa90a5343cf.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/1a2c6dc513278881.js"],"default"] +6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/3f45dfa93dd54d72.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -0:{"P":null,"b":"MrEXjMpW9X_XkpwJ2-Z7S","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/88a5cf0ea7f16af4.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/b00acbf8afd8b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/818dce712bc45cb4.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/2edeeda5ca6dc680.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/82a44da545bac352.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/e1a8caa90a5343cf.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"P":null,"b":"n8myNCT_KvBz4YicTIvRW","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/3f45dfa93dd54d72.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/shapes/__next._head.txt b/docs/shapes/__next._head.txt index 653a1b4e..5ebe2af2 100644 --- a/docs/shapes/__next._head.txt +++ b/docs/shapes/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/__next._index.txt b/docs/shapes/__next._index.txt index 58c2cae6..7b7002dc 100644 --- a/docs/shapes/__next._index.txt +++ b/docs/shapes/__next._index.txt @@ -2,5 +2,5 @@ 2:I[12985,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js"],"NuqsAdapter"] 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/__next._tree.txt b/docs/shapes/__next._tree.txt index 18d7b855..4c093d59 100644 --- a/docs/shapes/__next._tree.txt +++ b/docs/shapes/__next._tree.txt @@ -1,3 +1,3 @@ -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"shapes","paramType":null,"paramKey":"shapes","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"shapes","paramType":null,"paramKey":"shapes","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/shapes/__next.shapes.__PAGE__.txt b/docs/shapes/__next.shapes.__PAGE__.txt index e259b6f1..c3137c84 100644 --- a/docs/shapes/__next.shapes.__PAGE__.txt +++ b/docs/shapes/__next.shapes.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -3:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/88a5cf0ea7f16af4.js","/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","/t2-mapper/_next/static/chunks/b00acbf8afd8b4b6.js","/t2-mapper/_next/static/chunks/818dce712bc45cb4.js","/t2-mapper/_next/static/chunks/2edeeda5ca6dc680.js","/t2-mapper/_next/static/chunks/82a44da545bac352.js","/t2-mapper/_next/static/chunks/e1a8caa90a5343cf.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/1a2c6dc513278881.js"],"default"] +3:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/3f45dfa93dd54d72.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 7:"$Sreact.suspense" -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/88a5cf0ea7f16af4.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/b00acbf8afd8b4b6.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/818dce712bc45cb4.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/2edeeda5ca6dc680.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/82a44da545bac352.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/e1a8caa90a5343cf.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/3f45dfa93dd54d72.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/docs/shapes/__next.shapes.txt b/docs/shapes/__next.shapes.txt index 5226b333..564023ae 100644 --- a/docs/shapes/__next.shapes.txt +++ b/docs/shapes/__next.shapes.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -0:{"buildId":"MrEXjMpW9X_XkpwJ2-Z7S","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"n8myNCT_KvBz4YicTIvRW","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/index.html b/docs/shapes/index.html index 440fedc9..3a379609 100644 --- a/docs/shapes/index.html +++ b/docs/shapes/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/shapes/index.txt b/docs/shapes/index.txt index 118f1760..bc145ac0 100644 --- a/docs/shapes/index.txt +++ b/docs/shapes/index.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/88a5cf0ea7f16af4.js","/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","/t2-mapper/_next/static/chunks/b00acbf8afd8b4b6.js","/t2-mapper/_next/static/chunks/818dce712bc45cb4.js","/t2-mapper/_next/static/chunks/2edeeda5ca6dc680.js","/t2-mapper/_next/static/chunks/82a44da545bac352.js","/t2-mapper/_next/static/chunks/e1a8caa90a5343cf.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/1a2c6dc513278881.js"],"default"] +6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/3f45dfa93dd54d72.js","/t2-mapper/_next/static/chunks/3b423df62fc674df.js","/t2-mapper/_next/static/chunks/994d42eb1af43673.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] -:HL["/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","style"] -0:{"P":null,"b":"MrEXjMpW9X_XkpwJ2-Z7S","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/a2e31798d9bc121e.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/88a5cf0ea7f16af4.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/14c6376ae0b23060.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/b00acbf8afd8b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/818dce712bc45cb4.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/2edeeda5ca6dc680.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/82a44da545bac352.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/e1a8caa90a5343cf.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/1a2c6dc513278881.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] +:HL["/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","style"] +0:{"P":null,"b":"n8myNCT_KvBz4YicTIvRW","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/92a585fca24d52ed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/3f45dfa93dd54d72.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/3b423df62fc674df.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/994d42eb1af43673.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/next-env.d.ts b/next-env.d.ts index 1d9923a0..9edff1c7 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./docs/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/src/components/EntityRenderer.tsx b/src/components/EntityRenderer.tsx index 1ad0d348..eb161ef3 100644 --- a/src/components/EntityRenderer.tsx +++ b/src/components/EntityRenderer.tsx @@ -20,13 +20,15 @@ import { Sky } from "./Sky"; import { AudioEnabled } from "./AudioEnabled"; import type { TorqueObject } from "../torqueScript"; -function createLazy( - name: K, - loader: () => Promise>>, +function createLazy( + name: string, + loader: () => Promise<{ [key: string]: unknown }>, ): React.ComponentType<{ entity: GameEntity }> { const LazyComponent = lazy(() => loader().then((mod) => { - const NamedComponent = mod[name]; + const NamedComponent = mod[name] as React.ComponentType<{ + entity: GameEntity; + }>; return { default: NamedComponent }; }), ); @@ -191,10 +193,7 @@ function ShapeEntity({ entity }: { entity: ShapeEntityType }) { } > - + )} diff --git a/src/components/InteriorInstance.tsx b/src/components/InteriorInstance.tsx index 7125a809..e278fd56 100644 --- a/src/components/InteriorInstance.tsx +++ b/src/components/InteriorInstance.tsx @@ -156,7 +156,7 @@ function InteriorMesh({ node }: { node: Mesh }) { {node.material ? ( } > void; }) { const gameStatus = useLiveSelector((s) => s.gameStatus); - const serverName = useLiveSelector((s) => s.serverName); + // const serverName = useLiveSelector((s) => s.serverName); const ping = useLiveSelector(selectPing); const disconnectServer = useLiveSelector((s) => s.disconnectServer); @@ -45,7 +45,11 @@ export function JoinServerButton({ <> Live - {ping != null ? formatPing(ping) : "Join a game"} + {isConnecting + ? "Connecting…" + : ping != null + ? formatPing(ping) + : "Join a game"} {/* {isLive && ping != null && ( diff --git a/src/components/PlayerModel.tsx b/src/components/PlayerModel.tsx index 341537ac..884f4311 100644 --- a/src/components/PlayerModel.tsx +++ b/src/components/PlayerModel.tsx @@ -570,7 +570,7 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) { fallback={} > } @@ -589,7 +589,7 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) { fallback={} > } @@ -604,7 +604,7 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) { fallback={} > } diff --git a/src/components/SettingsProvider.tsx b/src/components/SettingsProvider.tsx index a185b93a..bae6cc7b 100644 --- a/src/components/SettingsProvider.tsx +++ b/src/components/SettingsProvider.tsx @@ -4,7 +4,6 @@ import { useCallback, useContext, useEffect, - useLayoutEffect, useMemo, useRef, useState, diff --git a/src/components/ShapeModel.tsx b/src/components/ShapeModel.tsx index b557c26d..7d5b0a25 100644 --- a/src/components/ShapeModel.tsx +++ b/src/components/ShapeModel.tsx @@ -19,7 +19,7 @@ import type { IflAtlas } from "./useIflTexture"; import { ShapeRenderer, useStaticShape } from "./GenericShape"; import { ShapeInfoProvider } from "./ShapeInfoProvider"; import type { TorqueObject } from "../torqueScript"; -import type { ExplosionEntity } from "../state/gameEntityTypes"; +import type { ExplosionEntity, ShapeEntity } from "../state/gameEntityTypes"; import { streamPlaybackStore } from "../state/streamPlaybackStore"; /** @@ -44,13 +44,9 @@ function getArmThread(weaponShape: string | undefined): string { * The mount transform is conjugated by ShapeRenderer's 90° Y rotation: * T_mount = R90 * M0 * MP^(-1) * R90^(-1). */ -export function WeaponModel({ - shapeName, - playerShapeName, -}: { - shapeName: string; - playerShapeName: string; -}) { +export function WeaponModel({ entity }: { entity: ShapeEntity }) { + const shapeName = entity.weaponShape; + const playerShapeName = entity.shapeName; const playerGltf = useStaticShape(playerShapeName); const weaponGltf = useStaticShape(shapeName); diff --git a/src/components/WaterBlock.tsx b/src/components/WaterBlock.tsx index 02ce7249..21b2ee1d 100644 --- a/src/components/WaterBlock.tsx +++ b/src/components/WaterBlock.tsx @@ -3,7 +3,6 @@ import { Box, useTexture } from "@react-three/drei"; import { useFrame, useThree } from "@react-three/fiber"; import { DoubleSide, NoColorSpace, PlaneGeometry, RepeatWrapping } from "three"; import { textureToUrl } from "../loaders"; -import type { SceneWaterBlock } from "../scene/types"; import { torqueToThree, torqueScaleToThree,