diff --git a/CNAME b/CNAME deleted file mode 100644 index fba3868..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -test.openpv.de \ No newline at end of file diff --git a/assets/About-hHljlKAu.js b/assets/About-DxBDVk_Y.js similarity index 91% rename from assets/About-hHljlKAu.js rename to assets/About-DxBDVk_Y.js index f58dc19..160b92b 100644 --- a/assets/About-hHljlKAu.js +++ b/assets/About-DxBDVk_Y.js @@ -1 +1 @@ -import{f as u,k as F,o as L,j as t,b as j,i as A,t as B,F as D,e as N,M as _}from"./index-C4jKHMt0.js";import{T as b,U as H,a as g,F as I,g as f}from"./Footer-Cdi5kbhN.js";import{m as w,S as M}from"./chunk-ZHMYA64R-FVqXPkJW.js";import{C as Y,a as W,H as C,b as $}from"./chunk-7OLJDQMT-DRboIhh9.js";import{I as z}from"./chunk-QINAG4RG-7Gste7mX.js";var i=u(function(a,s){const n=F("Link",a),{className:o,isExternal:r,...l}=L(a);return t.jsx(j.a,{target:r?"_blank":void 0,rel:r?"noopener":void 0,ref:s,className:A("chakra-link",o),...l,__css:n})});i.displayName="Link";var k=u(function(a,s){const{templateAreas:n,gap:o,rowGap:r,columnGap:l,column:c,row:m,autoFlow:p,autoRows:h,templateRows:G,autoColumns:T,templateColumns:R,...E}=a,S={display:"grid",gridTemplateAreas:n,gridGap:o,gridRowGap:r,gridColumnGap:l,gridAutoColumns:T,gridColumn:c,gridRow:m,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:G,gridTemplateColumns:R};return t.jsx(j.div,{ref:s,__css:S,...E})});k.displayName="Grid";var y=u(function(a,s){const{columns:n,spacingX:o,spacingY:r,spacing:l,minChildWidth:c,...m}=a,p=B(),h=c?P(c,p):U(n);return t.jsx(k,{ref:s,gap:l,columnGap:o,rowGap:r,templateColumns:h,...m})});y.displayName="SimpleGrid";function O(e){return typeof e=="number"?`${e}px`:e}function P(e,a){return w(e,s=>{const n=D("sizes",s,O(s))(a);return s===null?null:`repeat(auto-fit, minmax(${n}, 1fr))`})}function U(e){return w(e,a=>a===null?null:`repeat(${a}, minmax(0, 1fr))`)}var v=u((e,a)=>t.jsx(M,{align:"center",...e,direction:"column",ref:a}));v.displayName="VStack";const Q=()=>{const{t:e}=N();return t.jsxs(t.Fragment,{children:[t.jsx(_,{title:e("about.title"),description:e("about.description"),children:t.jsxs(Y,{height:"100%",overflow:"auto",children:[t.jsx(W,{children:t.jsx(C,{children:e("about.description")})}),t.jsx($,{children:t.jsxs(v,{spacing:"6",align:"start",children:[t.jsxs(d,{heading:e("about.generalDescription.h"),content:e("about.generalDescription.p"),children:[t.jsx(b,{children:e("about.advantages.introduction")}),t.jsxs(H,{children:[t.jsx(g,{children:e("about.advantages.1")}),t.jsx(g,{children:e("about.advantages.2")}),t.jsx(g,{children:e("about.advantages.3")})]})]}),t.jsx(x,{images:["images/about/about1.png","images/WelcomeMessage2.png","images/WelcomeMessage3.png"]}),t.jsxs(d,{heading:e("about.data.h"),children:[e("about.data.p1")," ",t.jsx(i,{href:"https://www.dwd.de/DE/leistungen/cdc/climate-data-center.html",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",e("about.data.p2")," ",t.jsx(i,{href:"https://sonny.4lima.de/",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",e("about.data.p3")," ",t.jsx(i,{href:"https://www.bkg.bund.de/DE/Home/home.html",isExternal:!0,color:"teal",children:"[DL-DE/BY-2-0]"}),"."]}),t.jsx(d,{heading:e("about.whyOpenSource.h"),content:e("about.whyOpenSource.p")}),t.jsx(d,{heading:e("about.team.h"),content:e("about.team.p"),children:t.jsx(i,{href:"https://github.com/orgs/open-pv/people",isExternal:!0,color:"teal",children:e("about.team.link")})}),t.jsx(d,{heading:e("about.sponsors.h"),content:e("about.sponsors.p")}),t.jsx(x,{images:["images/about/ptf.png","images/about/bmbf.jpg"],links:["https://prototypefund.de/","https://www.bmbf.de"],objectFit:"contain"})]})})]})}),t.jsx(I,{})]})};function d({content:e,heading:a,children:s}){return t.jsxs(f,{children:[t.jsx(C,{as:"h3",size:"md",children:a}),t.jsx(b,{children:e}),s]})}const x=({images:e,links:a=[],objectFit:s="cover"})=>t.jsx(y,{columns:e.length,spacing:4,children:e.map((n,o)=>{const r=t.jsx(z,{src:n,objectFit:s,width:"100%",height:"150px",borderRadius:"md"});return t.jsx(f,{padding:2,children:a[o]?t.jsx(i,{href:a[o],isExternal:!0,children:r}):r},o)})});export{Q as default}; +import{f as u,k as F,o as L,j as t,b as j,i as A,t as B,F as D,e as N,M as _}from"./index-oAnJD5lr.js";import{T as b,U as H,a as g,F as I,g as f}from"./Footer-CN0UQ_Me.js";import{m as w,S as M}from"./chunk-ZHMYA64R-n90-wtrP.js";import{C as Y,a as W,H as C,b as $}from"./chunk-7OLJDQMT-E6ec7czU.js";import{I as z}from"./chunk-QINAG4RG-B3RP3bKW.js";var i=u(function(a,s){const n=F("Link",a),{className:o,isExternal:r,...l}=L(a);return t.jsx(j.a,{target:r?"_blank":void 0,rel:r?"noopener":void 0,ref:s,className:A("chakra-link",o),...l,__css:n})});i.displayName="Link";var k=u(function(a,s){const{templateAreas:n,gap:o,rowGap:r,columnGap:l,column:c,row:m,autoFlow:p,autoRows:h,templateRows:G,autoColumns:T,templateColumns:R,...E}=a,S={display:"grid",gridTemplateAreas:n,gridGap:o,gridRowGap:r,gridColumnGap:l,gridAutoColumns:T,gridColumn:c,gridRow:m,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:G,gridTemplateColumns:R};return t.jsx(j.div,{ref:s,__css:S,...E})});k.displayName="Grid";var y=u(function(a,s){const{columns:n,spacingX:o,spacingY:r,spacing:l,minChildWidth:c,...m}=a,p=B(),h=c?P(c,p):U(n);return t.jsx(k,{ref:s,gap:l,columnGap:o,rowGap:r,templateColumns:h,...m})});y.displayName="SimpleGrid";function O(e){return typeof e=="number"?`${e}px`:e}function P(e,a){return w(e,s=>{const n=D("sizes",s,O(s))(a);return s===null?null:`repeat(auto-fit, minmax(${n}, 1fr))`})}function U(e){return w(e,a=>a===null?null:`repeat(${a}, minmax(0, 1fr))`)}var v=u((e,a)=>t.jsx(M,{align:"center",...e,direction:"column",ref:a}));v.displayName="VStack";const Q=()=>{const{t:e}=N();return t.jsxs(t.Fragment,{children:[t.jsx(_,{title:e("about.title"),description:e("about.description"),children:t.jsxs(Y,{height:"100%",overflow:"auto",children:[t.jsx(W,{children:t.jsx(C,{children:e("about.description")})}),t.jsx($,{children:t.jsxs(v,{spacing:"6",align:"start",children:[t.jsxs(d,{heading:e("about.generalDescription.h"),content:e("about.generalDescription.p"),children:[t.jsx(b,{children:e("about.advantages.introduction")}),t.jsxs(H,{children:[t.jsx(g,{children:e("about.advantages.1")}),t.jsx(g,{children:e("about.advantages.2")}),t.jsx(g,{children:e("about.advantages.3")})]})]}),t.jsx(x,{images:["images/about/about1.png","images/WelcomeMessage2.png","images/WelcomeMessage3.png"]}),t.jsxs(d,{heading:e("about.data.h"),children:[e("about.data.p1")," ",t.jsx(i,{href:"https://www.dwd.de/DE/leistungen/cdc/climate-data-center.html",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",e("about.data.p2")," ",t.jsx(i,{href:"https://sonny.4lima.de/",isExternal:!0,color:"teal",children:"[CC-BY-4.0]"}),", ",e("about.data.p3")," ",t.jsx(i,{href:"https://www.bkg.bund.de/DE/Home/home.html",isExternal:!0,color:"teal",children:"[DL-DE/BY-2-0]"}),"."]}),t.jsx(d,{heading:e("about.whyOpenSource.h"),content:e("about.whyOpenSource.p")}),t.jsx(d,{heading:e("about.team.h"),content:e("about.team.p"),children:t.jsx(i,{href:"https://github.com/orgs/open-pv/people",isExternal:!0,color:"teal",children:e("about.team.link")})}),t.jsx(d,{heading:e("about.sponsors.h"),content:e("about.sponsors.p")}),t.jsx(x,{images:["images/about/ptf.png","images/about/bmbf.jpg"],links:["https://prototypefund.de/","https://www.bmbf.de"],objectFit:"contain"})]})})]})}),t.jsx(I,{})]})};function d({content:e,heading:a,children:s}){return t.jsxs(f,{children:[t.jsx(C,{as:"h3",size:"md",children:a}),t.jsx(b,{children:e}),s]})}const x=({images:e,links:a=[],objectFit:s="cover"})=>t.jsx(y,{columns:e.length,spacing:4,children:e.map((n,o)=>{const r=t.jsx(z,{src:n,objectFit:s,width:"100%",height:"150px",borderRadius:"md"});return t.jsx(f,{padding:2,children:a[o]?t.jsx(i,{href:a[o],isExternal:!0,children:r}):r},o)})});export{Q as default}; diff --git a/assets/Datenschutz-BvJtWswR.js b/assets/Datenschutz-D4rOodQl.js similarity index 98% rename from assets/Datenschutz-BvJtWswR.js rename to assets/Datenschutz-D4rOodQl.js index 691dfda..1a4a542 100644 --- a/assets/Datenschutz-BvJtWswR.js +++ b/assets/Datenschutz-D4rOodQl.js @@ -1 +1 @@ -import{j as e,M as n}from"./index-C4jKHMt0.js";import{C as r,a as i,H as t,b as s}from"./chunk-7OLJDQMT-DRboIhh9.js";const a=()=>e.jsx(n,{title:"Datenschutz",description:"Datenschutzerklaerung der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(i,{children:e.jsx(t,{children:"Datenschutz"})}),e.jsxs(s,{children:[e.jsx("h1",{children:"Datenschutzerklärung"}),e.jsx("p",{children:"Verantwortlicher im Sinne der Datenschutzgesetze, insbesondere der EU-Datenschutzgrundverordnung (DSGVO), ist:"}),e.jsxs("p",{children:["Großhauser Heidler Kotthoff Pöppel GbR ",e.jsx("br",{}),"p r i v a c y @ o p e n p v . d e"]}),e.jsx("h2",{children:"Ihre Betroffenenrechte"}),e.jsx("p",{children:"Unter den angegebenen Kontaktdaten unseres Datenschutzbeauftragten können Sie jederzeit folgende Rechte ausüben:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten Daten und deren Verarbeitung (Art. 15 DSGVO),"}),e.jsx("li",{children:"Berichtigung unrichtiger personenbezogener Daten (Art. 16 DSGVO),"}),e.jsx("li",{children:"Löschung Ihrer bei uns gespeicherten Daten (Art. 17 DSGVO),"}),e.jsx("li",{children:"Einschränkung der Datenverarbeitung, sofern wir Ihre Daten aufgrund gesetzlicher Pflichten noch nicht löschen dürfen (Art. 18 DSGVO),"}),e.jsx("li",{children:"Widerspruch gegen die Verarbeitung Ihrer Daten bei uns (Art. 21 DSGVO) und"}),e.jsx("li",{children:"Datenübertragbarkeit, sofern Sie in die Datenverarbeitung eingewilligt haben oder einen Vertrag mit uns abgeschlossen haben (Art. 20 DSGVO)."})]}),e.jsx("p",{children:"Sofern Sie uns eine Einwilligung erteilt haben, können Sie diese jederzeit mit Wirkung für die Zukunft widerrufen."}),e.jsx("p",{children:"Sie können sich jederzeit mit einer Beschwerde an eine Aufsichtsbehörde wenden, z. B. an die zuständige Aufsichtsbehörde des Bundeslands Ihres Wohnsitzes oder an die für uns als verantwortliche Stelle zuständige Behörde."}),e.jsxs("p",{children:["Eine Liste der Aufsichtsbehörden (für den nichtöffentlichen Bereich) mit Anschrift finden Sie unter:"," ",e.jsx("a",{href:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html",target:"_blank",rel:"noopener nofollow",children:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html"}),"."]}),e.jsx("p",{}),e.jsx("h2",{children:"Erfassung allgemeiner Informationen beim Besuch unserer Website"}),e.jsx("h3",{children:"Art und Zweck der Verarbeitung:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Verkehrsdaten (wie zB IP-Adresse): Wenn Sie auf unsere Website zugreifen, werden automatisch Informationen allgemeiner Natur erfasst. Diese Informationen (Server-Logfiles) beinhalten die Art des Webbrowsers, das verwendete Betriebssystem, den Domainnamen Ihres Internet-Service-Providers, Ihre IP-Adresse und ähnliches. Ohne die IP-Adresse ist der Dienst und die Funktionsfähigkeit unserer Website nicht gewährleistet. Zudem können einzelne Dienste und Services nicht verfügbar oder eingeschränkt sein. Der Zweck dieser Datenverarbeitung ist die Sicherstellung eines problemlosen Verbindungsaufbaus der Website, Sicherstellung einer reibungslosen Nutzung unserer Website, Auswertung der Systemsicherheit und -stabilität sowie zur Optimierung unserer Website."}),e.jsx("li",{children:'Adresse und Koordinaten: Die Adresse, welche Sie in die Suchmaske eingeben, wird an Nominatim zur Koordinatenermittlung übermittelt. Weitere Infos zu Nominatim finden Sie unter dem Abschnitt "Plugins und Tools". Zur automatischen Adressvervollständigung wird die Eingabe in das Suchfeld an https://photon.komoot.io/ gesendet. Weitere Infos zu Photon von Komoot finden Sie unter dem Abschnitt "Plugins und Tools". Die Koordinaten werden verwendet, um die relevanten Gebäude und Geländedaten von unserem Server zu laden. Die genauen Koordinaten werden nicht auf unserem Server gespeichert. Zu statistischen Zwecken und zur Optimierung unseres Angebotes speichern wir die Region (gerundete Koordinaten) der angefragten Adresse (aufgelöst auf wenige Kilometer).'})]}),e.jsx("p",{children:"Wir verwenden Ihre Daten nicht, um Rückschlüsse auf Ihre Person zu ziehen."}),e.jsx("h3",{children:"Rechtsgrundlage und berechtigtes Interesse:"}),e.jsx("p",{children:"Die Verarbeitung erfolgt gemäß Art. 6 Abs. 1 lit. f DSGVO auf Basis unseres berechtigten Interesses an der Verbesserung der Stabilität und Funktionalität unserer Website."}),e.jsx("h3",{children:"Empfänger:"}),e.jsx("p",{children:"Empfänger der Daten sind technische Dienstleister, die den Betrieb unserer Server ermöglichen. Diese Dienstleister sind die netcup GmbH und Hetzner Online GmbH."}),e.jsx("h3",{children:"Drittlandtransfer:"}),e.jsx("p",{children:"Unsere eigene Datenverarbeitung findet in Deutschland statt. Für die Konvertierung von Adresse in Koordinaten werden Daten über Nominatim in Drittländern (Stand August 2024: Niederlande und UK) verarbeitet. Eine Auflistung dieser Drittländer finden Sie hier: https://osmfoundation.org/wiki/Privacy_Policy#Where_do_we_store_the_data"}),e.jsx("p",{}),e.jsx("h3",{children:"Speicherdauer:"}),e.jsx("p",{children:"Die Daten werden gelöscht, sobald diese für den Zweck der Erhebung nicht mehr erforderlich sind. Dies ist für die Daten, die der Bereitstellung der Website dienen, grundsätzlich der Fall, wenn die jeweilige Sitzung beendet ist."}),e.jsx("p",{children:"Im Falle der Speicherung der Verkehrsdaten in Logfiles ist dies nach 14 Tagen der Fall, es sei denn, es gibt einen besonderen Grund, Informationen länger aufzubewahren (z.B. wenn einzelne IP-Adressen gesperrt werden)."}),e.jsx("h3",{children:"Plugins und Tools"}),e.jsxs("p",{children:["Nominatim Geocoding ",e.jsx("br",{}),"Diese Seite nutzt über eine API Nominatim, den Geocoding Dienst von OpenStreetMaps.nominatim.openstreetmap.org Zur Nutzung der GeoCodingFunktion bei der Umwandlung ihrer Adresse in Koordinaten werden die eingegebenen Adressdaten an Nominatim zur Koordinatenermittlung übermittelt. Die Nutzung von Nominatim erfolgt im Interesse einer ansprechenden Darstellung unserer Online-Angebote und an einer leichten Auffindbarkeit der von uns simulierten PV-Erträge auf der Website. Dies stellt ein berechtigtes Interesse im Sinne von Art. 6 Abs. 1 lit. f DSGVO dar. Mehr Informationen zum Umgang mit Nutzerdaten finden Sie in der Datenschutzerklärung von OpenStreetMaps: https://wiki.osmfoundation.org/wiki/Privacy_Policy"]}),e.jsx("br",{}),e.jsxs("p",{children:["Photon von Komoot ",e.jsx("br",{}),"openpv nutzt die API von komoot zur automatischen Adressvervollständigung. Dabei werden die eingegebenen Buchstaben an https://photon.komoot.io/ gesendet. Die Auswahl einer finalen Adresse wird nicht an komoot mitgeteilt."]}),e.jsx("hr",{}),e.jsx("h2",{children:"Information über Ihr Widerspruchsrecht nach Art. 21 DSGVO"}),e.jsx("h3",{children:"Einzelfallbezogenes Widerspruchsrecht"}),e.jsx("p",{children:"Sie haben das Recht, aus Gründen, die sich aus Ihrer besonderen Situation ergeben, jederzeit gegen die Verarbeitung Sie betreffender personenbezogener Daten, die aufgrund Art. 6 Abs. 1 lit. f DSGVO (Datenverarbeitung auf der Grundlage einer Interessenabwägung) erfolgt, Widerspruch einzulegen."}),e.jsx("p",{children:"Legen Sie Widerspruch ein, werden wir Ihre personenbezogenen Daten nicht mehr verarbeiten, es sei denn, wir können zwingende schutzwürdige Gründe für die Verarbeitung nachweisen, die Ihre Interessen, Rechte und Freiheiten überwiegen, oder die Verarbeitung dient der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen."}),e.jsx("hr",{}),e.jsx("h2",{children:"Änderung unserer Datenschutzbestimmungen"}),e.jsx("p",{children:"Wir behalten uns vor, diese Datenschutzerklärung anzupassen, damit sie stets den aktuellen rechtlichen Anforderungen entspricht oder um Änderungen unserer Leistungen in der Datenschutzerklärung umzusetzen, z.B. bei der Einführung neuer Services. Für Ihren erneuten Besuch gilt dann die neue Datenschutzerklärung."}),e.jsx("h2",{children:"Fragen an den Datenschutzbeauftragten"}),e.jsx("p",{children:"Wenn Sie Fragen zum Datenschutz haben, schreiben Sie uns bitte eine E-Mail oder wenden Sie sich direkt an die für den Datenschutz verantwortliche Person in unserer Organisation:"}),e.jsx("p",{children:e.jsxs("em",{children:["Die Datenschutzerklärung wurde mithilfe der activeMind AG erstellt, den Experten für"," ",e.jsx("a",{href:"https://www.activemind.de/datenschutz/datenschutzbeauftragter/",target:"_blank",rel:"noopener",children:"externe Datenschutzbeauftragte"})," ","(Version #2020-09-30)."]})})]})]})});export{a as default}; +import{j as e,M as n}from"./index-oAnJD5lr.js";import{C as r,a as i,H as t,b as s}from"./chunk-7OLJDQMT-E6ec7czU.js";const a=()=>e.jsx(n,{title:"Datenschutz",description:"Datenschutzerklaerung der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(i,{children:e.jsx(t,{children:"Datenschutz"})}),e.jsxs(s,{children:[e.jsx("h1",{children:"Datenschutzerklärung"}),e.jsx("p",{children:"Verantwortlicher im Sinne der Datenschutzgesetze, insbesondere der EU-Datenschutzgrundverordnung (DSGVO), ist:"}),e.jsxs("p",{children:["Großhauser Heidler Kotthoff Pöppel GbR ",e.jsx("br",{}),"p r i v a c y @ o p e n p v . d e"]}),e.jsx("h2",{children:"Ihre Betroffenenrechte"}),e.jsx("p",{children:"Unter den angegebenen Kontaktdaten unseres Datenschutzbeauftragten können Sie jederzeit folgende Rechte ausüben:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten Daten und deren Verarbeitung (Art. 15 DSGVO),"}),e.jsx("li",{children:"Berichtigung unrichtiger personenbezogener Daten (Art. 16 DSGVO),"}),e.jsx("li",{children:"Löschung Ihrer bei uns gespeicherten Daten (Art. 17 DSGVO),"}),e.jsx("li",{children:"Einschränkung der Datenverarbeitung, sofern wir Ihre Daten aufgrund gesetzlicher Pflichten noch nicht löschen dürfen (Art. 18 DSGVO),"}),e.jsx("li",{children:"Widerspruch gegen die Verarbeitung Ihrer Daten bei uns (Art. 21 DSGVO) und"}),e.jsx("li",{children:"Datenübertragbarkeit, sofern Sie in die Datenverarbeitung eingewilligt haben oder einen Vertrag mit uns abgeschlossen haben (Art. 20 DSGVO)."})]}),e.jsx("p",{children:"Sofern Sie uns eine Einwilligung erteilt haben, können Sie diese jederzeit mit Wirkung für die Zukunft widerrufen."}),e.jsx("p",{children:"Sie können sich jederzeit mit einer Beschwerde an eine Aufsichtsbehörde wenden, z. B. an die zuständige Aufsichtsbehörde des Bundeslands Ihres Wohnsitzes oder an die für uns als verantwortliche Stelle zuständige Behörde."}),e.jsxs("p",{children:["Eine Liste der Aufsichtsbehörden (für den nichtöffentlichen Bereich) mit Anschrift finden Sie unter:"," ",e.jsx("a",{href:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html",target:"_blank",rel:"noopener nofollow",children:"https://www.bfdi.bund.de/DE/Service/Anschriften/Laender/Laender-node.html"}),"."]}),e.jsx("p",{}),e.jsx("h2",{children:"Erfassung allgemeiner Informationen beim Besuch unserer Website"}),e.jsx("h3",{children:"Art und Zweck der Verarbeitung:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Verkehrsdaten (wie zB IP-Adresse): Wenn Sie auf unsere Website zugreifen, werden automatisch Informationen allgemeiner Natur erfasst. Diese Informationen (Server-Logfiles) beinhalten die Art des Webbrowsers, das verwendete Betriebssystem, den Domainnamen Ihres Internet-Service-Providers, Ihre IP-Adresse und ähnliches. Ohne die IP-Adresse ist der Dienst und die Funktionsfähigkeit unserer Website nicht gewährleistet. Zudem können einzelne Dienste und Services nicht verfügbar oder eingeschränkt sein. Der Zweck dieser Datenverarbeitung ist die Sicherstellung eines problemlosen Verbindungsaufbaus der Website, Sicherstellung einer reibungslosen Nutzung unserer Website, Auswertung der Systemsicherheit und -stabilität sowie zur Optimierung unserer Website."}),e.jsx("li",{children:'Adresse und Koordinaten: Die Adresse, welche Sie in die Suchmaske eingeben, wird an Nominatim zur Koordinatenermittlung übermittelt. Weitere Infos zu Nominatim finden Sie unter dem Abschnitt "Plugins und Tools". Zur automatischen Adressvervollständigung wird die Eingabe in das Suchfeld an https://photon.komoot.io/ gesendet. Weitere Infos zu Photon von Komoot finden Sie unter dem Abschnitt "Plugins und Tools". Die Koordinaten werden verwendet, um die relevanten Gebäude und Geländedaten von unserem Server zu laden. Die genauen Koordinaten werden nicht auf unserem Server gespeichert. Zu statistischen Zwecken und zur Optimierung unseres Angebotes speichern wir die Region (gerundete Koordinaten) der angefragten Adresse (aufgelöst auf wenige Kilometer).'})]}),e.jsx("p",{children:"Wir verwenden Ihre Daten nicht, um Rückschlüsse auf Ihre Person zu ziehen."}),e.jsx("h3",{children:"Rechtsgrundlage und berechtigtes Interesse:"}),e.jsx("p",{children:"Die Verarbeitung erfolgt gemäß Art. 6 Abs. 1 lit. f DSGVO auf Basis unseres berechtigten Interesses an der Verbesserung der Stabilität und Funktionalität unserer Website."}),e.jsx("h3",{children:"Empfänger:"}),e.jsx("p",{children:"Empfänger der Daten sind technische Dienstleister, die den Betrieb unserer Server ermöglichen. Diese Dienstleister sind die netcup GmbH und Hetzner Online GmbH."}),e.jsx("h3",{children:"Drittlandtransfer:"}),e.jsx("p",{children:"Unsere eigene Datenverarbeitung findet in Deutschland statt. Für die Konvertierung von Adresse in Koordinaten werden Daten über Nominatim in Drittländern (Stand August 2024: Niederlande und UK) verarbeitet. Eine Auflistung dieser Drittländer finden Sie hier: https://osmfoundation.org/wiki/Privacy_Policy#Where_do_we_store_the_data"}),e.jsx("p",{}),e.jsx("h3",{children:"Speicherdauer:"}),e.jsx("p",{children:"Die Daten werden gelöscht, sobald diese für den Zweck der Erhebung nicht mehr erforderlich sind. Dies ist für die Daten, die der Bereitstellung der Website dienen, grundsätzlich der Fall, wenn die jeweilige Sitzung beendet ist."}),e.jsx("p",{children:"Im Falle der Speicherung der Verkehrsdaten in Logfiles ist dies nach 14 Tagen der Fall, es sei denn, es gibt einen besonderen Grund, Informationen länger aufzubewahren (z.B. wenn einzelne IP-Adressen gesperrt werden)."}),e.jsx("h3",{children:"Plugins und Tools"}),e.jsxs("p",{children:["Nominatim Geocoding ",e.jsx("br",{}),"Diese Seite nutzt über eine API Nominatim, den Geocoding Dienst von OpenStreetMaps.nominatim.openstreetmap.org Zur Nutzung der GeoCodingFunktion bei der Umwandlung ihrer Adresse in Koordinaten werden die eingegebenen Adressdaten an Nominatim zur Koordinatenermittlung übermittelt. Die Nutzung von Nominatim erfolgt im Interesse einer ansprechenden Darstellung unserer Online-Angebote und an einer leichten Auffindbarkeit der von uns simulierten PV-Erträge auf der Website. Dies stellt ein berechtigtes Interesse im Sinne von Art. 6 Abs. 1 lit. f DSGVO dar. Mehr Informationen zum Umgang mit Nutzerdaten finden Sie in der Datenschutzerklärung von OpenStreetMaps: https://wiki.osmfoundation.org/wiki/Privacy_Policy"]}),e.jsx("br",{}),e.jsxs("p",{children:["Photon von Komoot ",e.jsx("br",{}),"openpv nutzt die API von komoot zur automatischen Adressvervollständigung. Dabei werden die eingegebenen Buchstaben an https://photon.komoot.io/ gesendet. Die Auswahl einer finalen Adresse wird nicht an komoot mitgeteilt."]}),e.jsx("hr",{}),e.jsx("h2",{children:"Information über Ihr Widerspruchsrecht nach Art. 21 DSGVO"}),e.jsx("h3",{children:"Einzelfallbezogenes Widerspruchsrecht"}),e.jsx("p",{children:"Sie haben das Recht, aus Gründen, die sich aus Ihrer besonderen Situation ergeben, jederzeit gegen die Verarbeitung Sie betreffender personenbezogener Daten, die aufgrund Art. 6 Abs. 1 lit. f DSGVO (Datenverarbeitung auf der Grundlage einer Interessenabwägung) erfolgt, Widerspruch einzulegen."}),e.jsx("p",{children:"Legen Sie Widerspruch ein, werden wir Ihre personenbezogenen Daten nicht mehr verarbeiten, es sei denn, wir können zwingende schutzwürdige Gründe für die Verarbeitung nachweisen, die Ihre Interessen, Rechte und Freiheiten überwiegen, oder die Verarbeitung dient der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen."}),e.jsx("hr",{}),e.jsx("h2",{children:"Änderung unserer Datenschutzbestimmungen"}),e.jsx("p",{children:"Wir behalten uns vor, diese Datenschutzerklärung anzupassen, damit sie stets den aktuellen rechtlichen Anforderungen entspricht oder um Änderungen unserer Leistungen in der Datenschutzerklärung umzusetzen, z.B. bei der Einführung neuer Services. Für Ihren erneuten Besuch gilt dann die neue Datenschutzerklärung."}),e.jsx("h2",{children:"Fragen an den Datenschutzbeauftragten"}),e.jsx("p",{children:"Wenn Sie Fragen zum Datenschutz haben, schreiben Sie uns bitte eine E-Mail oder wenden Sie sich direkt an die für den Datenschutz verantwortliche Person in unserer Organisation:"}),e.jsx("p",{children:e.jsxs("em",{children:["Die Datenschutzerklärung wurde mithilfe der activeMind AG erstellt, den Experten für"," ",e.jsx("a",{href:"https://www.activemind.de/datenschutz/datenschutzbeauftragter/",target:"_blank",rel:"noopener",children:"externe Datenschutzbeauftragte"})," ","(Version #2020-09-30)."]})})]})]})});export{a as default}; diff --git a/assets/Footer-Cdi5kbhN.js b/assets/Footer-CN0UQ_Me.js similarity index 99% rename from assets/Footer-Cdi5kbhN.js rename to assets/Footer-CN0UQ_Me.js index 9796f51..0763ad0 100644 --- a/assets/Footer-Cdi5kbhN.js +++ b/assets/Footer-CN0UQ_Me.js @@ -1,4 +1,4 @@ -import{r as u,j as v,A as pe,m as oe,i as O,s as be,b as P,S as $n,f as F,k as kt,o as He,p as ut,B as Ie,R as zn,J as qn,x as Ft,I as Yn,q as J,P as Xn,K as Kn,N as Zn,e as Qn,O as Jn}from"./index-C4jKHMt0.js";function er(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var tr=er();function nr(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function rr(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Me(...e){return t=>{e.forEach(n=>{rr(n,t)})}}function ar(...e){return u.useMemo(()=>Me(...e),e)}var ct={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Z={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function Ko(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Z.slideRight;case"left":return Z.slideLeft;case"bottom":return Z.slideDown;case"top":return Z.slideUp;default:return Z.slideRight}}var D={enter:{duration:.2,ease:ct.easeOut},exit:{duration:.1,ease:ct.easeIn}},R={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},or={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:R.enter(D.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:R.exit(D.exit,n),transitionEnd:t==null?void 0:t.exit}}},Nt={initial:"exit",animate:"enter",exit:"exit",variants:or},ir=u.forwardRef(function(t,n){const{unmountOnExit:r,in:a,className:o,transition:s,transitionEnd:i,delay:m,...c}=t,h=a||r?"enter":"exit",l=r?a&&r:!0,d={transition:s,transitionEnd:i,delay:m};return v.jsx(pe,{custom:d,children:l&&v.jsx(oe.div,{ref:n,className:O("chakra-fade",o),custom:d,...Nt,animate:h,...c})})});ir.displayName="Fade";var sr={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:a})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:R.exit(D.exit,a)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:R.enter(D.enter,n),transitionEnd:e==null?void 0:e.enter}}},Pt={initial:"exit",animate:"enter",exit:"exit",variants:sr},ur=u.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,initialScale:s=.95,className:i,transition:m,transitionEnd:c,delay:h,...l}=t,d=r?a&&r:!0,p=a||r?"enter":"exit",b={initialScale:s,reverse:o,transition:m,transitionEnd:c,delay:h};return v.jsx(pe,{custom:b,children:d&&v.jsx(oe.div,{ref:n,className:O("chakra-offset-slide",i),...Pt,animate:p,custom:b,...l})})});ur.displayName="ScaleFade";var cr={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:a})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:R.exit(D.exit,a),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:R.enter(D.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:a,delay:o})=>{var s;const i={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:R.exit(D.exit,o),...a?{...i,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...i,...r==null?void 0:r.exit}}}}},ee={initial:"initial",animate:"enter",exit:"exit",variants:cr},lr=u.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,className:s,offsetX:i=0,offsetY:m=8,transition:c,transitionEnd:h,delay:l,...d}=t,p=r?a&&r:!0,b=a||r?"enter":"exit",f={offsetX:i,offsetY:m,reverse:o,transition:c,transitionEnd:h,delay:l};return v.jsx(pe,{custom:f,children:p&&v.jsx(oe.div,{ref:n,className:O("chakra-offset-slide",s),custom:f,...ee,animate:b,...d})})});lr.displayName="SlideFade";function dr(e){return u.Children.toArray(e).filter(t=>u.isValidElement(t))}var[Zo,fr]=be({strict:!1,name:"ButtonGroupContext"});function vr(e){const[t,n]=u.useState(!e);return{ref:u.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}function _e(e){const{children:t,className:n,...r}=e,a=u.isValidElement(t)?u.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=O("chakra-button__icon",n);return v.jsx(P.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:a})}_e.displayName="ButtonIcon";function Ae(e){const{label:t,placement:n,spacing:r="0.5rem",children:a=v.jsx($n,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:s,...i}=e,m=O("chakra-button__spinner",o),c=n==="start"?"marginEnd":"marginStart",h=u.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[c]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,c,r]);return v.jsx(P.div,{className:m,...i,__css:h,children:a})}Ae.displayName="ButtonSpinner";var Ot=F((e,t)=>{const n=fr(),r=kt("Button",{...n,...e}),{isDisabled:a=n==null?void 0:n.isDisabled,isLoading:o,isActive:s,children:i,leftIcon:m,rightIcon:c,loadingText:h,iconSpacing:l="0.5rem",type:d,spinner:p,spinnerPlacement:b="start",className:f,as:g,...y}=He(e),x=u.useMemo(()=>{const k={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:k}}},[r,n]),{ref:w,type:C}=vr(g),S={rightIcon:c,leftIcon:m,iconSpacing:l,children:i};return v.jsxs(P.button,{ref:ar(t,w),as:g,type:d??C,"data-active":ut(s),"data-loading":ut(o),__css:x,className:O("chakra-button",f),...y,disabled:a||o,children:[o&&b==="start"&&v.jsx(Ae,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:l,children:p}),o?h||v.jsx(P.span,{opacity:0,children:v.jsx(lt,{...S})}):v.jsx(lt,{...S}),o&&b==="end"&&v.jsx(Ae,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:l,children:p})]})});Ot.displayName="Button";function lt(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:a}=e;return v.jsxs(v.Fragment,{children:[t&&v.jsx(_e,{marginEnd:a,children:t}),r,n&&v.jsx(_e,{marginStart:a,children:n})]})}function mr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Te="data-focus-lock",It="data-focus-lock-disabled",hr="data-no-focus-lock",pr="data-autofocus-inside",br="data-no-autofocus";function Se(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gr(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var yr=typeof window<"u"?u.useLayoutEffect:u.useEffect,dt=new WeakMap;function Mt(e,t){var n=gr(null,function(r){return e.forEach(function(a){return Se(a,r)})});return yr(function(){var r=dt.get(n);if(r){var a=new Set(r),o=new Set(e),s=n.current;a.forEach(function(i){o.has(i)||Se(i,null)}),o.forEach(function(i){a.has(i)||Se(i,s)})}dt.set(n,e)},[e]),n}var Ce={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},M=function(){return M=Object.assign||function(t){for(var n,r=1,a=arguments.length;r=0}).sort(jr)},Wr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],qe=Wr.join(","),Hr="".concat(qe,", [data-focus-guard]"),qt=function(e,t){return _((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Hr:qe)?[r]:[],qt(r))},[])},Ur=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?X([e.contentDocument.body],t):[e]},X=function(e,t){return e.reduce(function(n,r){var a,o=qt(r,t),s=(a=[]).concat.apply(a,o.map(function(i){return Ur(i,t)}));return n.concat(s,r.parentNode?_(r.parentNode.querySelectorAll(qe)).filter(function(i){return i===r}):[])},[])},Vr=function(e){var t=e.querySelectorAll("[".concat(pr,"]"));return _(t).map(function(n){return X([n])}).reduce(function(n,r){return n.concat(r)},[])},Ye=function(e,t){return _(e).filter(function(n){return Ht(t,n)}).filter(function(n){return Dr(n)})},ft=function(e,t){return t===void 0&&(t=new Map),_(e).filter(function(n){return Ut(t,n)})},Xe=function(e,t,n){return ze(Ye(X(e,n),t),!0,n)},ne=function(e,t){return ze(Ye(X(e),t),!1)},$r=function(e,t){return Ye(Vr(e),t)},B=function(e,t){return e.shadowRoot?B(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:_(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var a=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return a?B(a,t):!1}return B(n,t)})},zr=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(a),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,i){return!t.has(i)})},Yt=function(e){return e.parentNode?Yt(e.parentNode):e},Ke=function(e){var t=j(e);return t.filter(Boolean).reduce(function(n,r){var a=r.getAttribute(Te);return n.push.apply(n,a?zr(_(Yt(r).querySelectorAll("[".concat(Te,'="').concat(a,'"]:not([').concat(It,'="disabled"])')))):[r]),n},[])},qr=function(e){try{return e()}catch{return}},re=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?re(t.shadowRoot):t instanceof HTMLIFrameElement&&qr(function(){return t.contentWindow.document})?re(t.contentWindow.document):t}},Yr=function(e,t){return e===t},Xr=function(e,t){return!!_(e.querySelectorAll("iframe")).some(function(n){return Yr(n,t)})},Xt=function(e,t){return t===void 0&&(t=re(jt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Ke(e).some(function(n){return B(n,t)||Xr(n,t)})},Kr=function(e){e===void 0&&(e=document);var t=re(e);return t?_(e.querySelectorAll("[".concat(hr,"]"))).some(function(n){return B(n,t)}):!1},Zr=function(e,t){return t.filter(zt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ze=function(e,t){return zt(e)&&e.name?Zr(e,t):e},Qr=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ze(n,e))}),e.filter(function(n){return t.has(n)})},vt=function(e){return e[0]&&e.length>1?Ze(e[0],e):e[0]},mt=function(e,t){return e.indexOf(Ze(t,e))},Re="NEW_FOCUS",Jr=function(e,t,n,r,a){var o=e.length,s=e[0],i=e[o-1],m=$e(r);if(!(r&&e.indexOf(r)>=0)){var c=r!==void 0?n.indexOf(r):-1,h=a?n.indexOf(a):c,l=a?e.indexOf(a):-1;if(c===-1)return l!==-1?l:Re;if(l===-1)return Re;var d=c-h,p=n.indexOf(s),b=n.indexOf(i),f=Qr(n),g=r!==void 0?f.indexOf(r):-1,y=g-(a?f.indexOf(a):c);if(!d&&l>=0||t.length===0)return l;var x=mt(e,t[0]),w=mt(e,t[t.length-1]);if(c<=p&&m&&Math.abs(d)>1)return w;if(c>=b&&m&&Math.abs(d)>1)return x;if(d&&Math.abs(y)>1)return l;if(c<=p)return w;if(c>b)return x;if(d)return Math.abs(d)>1?l:(o+l+d)%o}},ea=function(e){return function(t){var n,r=(n=Vt(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},ht=function(e,t,n){var r=e.map(function(o){var s=o.node;return s}),a=ft(r.filter(ea(n)));return a&&a.length?vt(a):vt(ft(t))},Be=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Be(e.parentNode.host||e.parentNode,t),t},Ee=function(e,t){for(var n=Be(e),r=Be(t),a=0;a=0)return o}return!1},Kt=function(e,t,n){var r=j(e),a=j(t),o=r[0],s=!1;return a.filter(Boolean).forEach(function(i){s=Ee(s||i,i)||s,n.filter(Boolean).forEach(function(m){var c=Ee(o,m);c&&(!s||B(c,s)?s=c:s=Ee(c,s))})}),s},pt=function(e,t){return e.reduce(function(n,r){return n.concat($r(r,t))},[])},ta=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Br)},na=function(e,t){var n=re(j(e).length>0?document:jt(e).ownerDocument),r=Ke(e).filter(De),a=Kt(n||e,e,r),o=new Map,s=ne(r,o),i=s.filter(function(b){var f=b.node;return De(f)});if(i[0]){var m=ne([a],o).map(function(b){var f=b.node;return f}),c=ta(m,i),h=c.map(function(b){var f=b.node;return f}),l=c.filter(function(b){var f=b.tabIndex;return f>=0}).map(function(b){var f=b.node;return f}),d=Jr(h,l,m,n,t);if(d===Re){var p=ht(s,l,pt(r,o))||ht(s,h,pt(r,o));if(p)return{node:p};console.warn("focus-lock: cannot find any node to move focus into");return}return d===void 0?d:c[d]}},ra=function(e){var t=Ke(e).filter(De),n=Kt(e,e,t),r=ze(X([n],!0),!0,!0),a=X(t,!1);return r.map(function(o){var s=o.node,i=o.index;return{node:s,index:i,lockItem:a.indexOf(s)>=0,guard:$e(s)}})},Qe=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},ke=0,Fe=!1,Zt=function(e,t,n){n===void 0&&(n={});var r=na(e,t);if(!Fe&&r){if(ke>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Fe=!0,setTimeout(function(){Fe=!1},1);return}ke++,Qe(r.node,n.focusOptions),ke--}};function Q(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var aa=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:Q(n),parent:Q(n.parentElement),left:Q(n.previousElementSibling),right:Q(n.nextElementSibling)}),n=n.parentElement;return{element:Q(e),stack:t,ownerDocument:e.ownerDocument}},oa=function(e){var t,n,r,a,o;if(e)for(var s=e.stack,i=e.ownerDocument,m=new Map,c=0,h=s;c-1&&(g.filter(function(x){var w=x.guard,C=x.node;return w&&C.dataset.focusAutoGuard}).forEach(function(x){var w=x.node;return w.removeAttribute("tabIndex")}),gt(y,g.length,1,g),gt(y,-1,-1,g))}}}return t},rn=function(t){he()&&t&&(t.stopPropagation(),t.preventDefault())},tt=function(){return Je(he)},Ca=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||ba(r,n)},Ea=function(){return null},an=function(){et=!0},on=function(){et=!1,ae="just",Je(function(){ae="meanwhile"})},ka=function(){document.addEventListener("focusin",rn),document.addEventListener("focusout",tt),window.addEventListener("focus",an),window.addEventListener("blur",on)},Fa=function(){document.removeEventListener("focusin",rn),document.removeEventListener("focusout",tt),window.removeEventListener("focus",an),window.removeEventListener("blur",on)};function Na(e){return e.filter(function(t){var n=t.disabled;return!n})}var sn={moveFocusInside:Zt,focusInside:Xt,focusNextElement:ca,focusPrevElement:la,focusFirstElement:da,focusLastElement:fa,captureFocusRestore:Qt};function Pa(e){var t=e.slice(-1)[0];t&&!z&&ka();var n=z,r=n&&t&&t.id===n.id;z=t,n&&!r&&(n.onDeactivation(),e.filter(function(a){var o=a.id;return o===n.id}).length||n.returnFocus(!t)),t?(N=null,(!r||n.observed!==t.observed)&&t.onActivation(sn),he(),Je(he)):(Fa(),N=null)}Rt.assignSyncMedium(Ca);Bt.assignMedium(tt);Sr.assignMedium(function(e){return e(sn)});const Oa=Ir(Na,Pa)(Ea);var je=u.forwardRef(function(t,n){return u.createElement(Ve,Ie({sideCar:Oa,ref:n},t))}),un=Ve.propTypes||{};un.sideCar;mr(un,["sideCar"]);je.propTypes={};function Ia(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ma(e){var t;if(!Ia(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}var _a=e=>e.hasAttribute("tabindex");function Aa(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function cn(e){return e.parentElement&&cn(e.parentElement)?!0:e.hidden}function Ta(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function La(e){if(!Ma(e)||cn(e)||Aa(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():Ta(e)?!0:_a(e)}var Da=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],Ra=Da.join(),Ba=e=>e.offsetWidth>0&&e.offsetHeight>0;function ja(e){const t=Array.from(e.querySelectorAll(Ra));return t.unshift(e),t.filter(n=>La(n)&&Ba(n))}var yt,Ga=(yt=je.default)!=null?yt:je,ln=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:a,children:o,isDisabled:s,autoFocus:i,persistentFocus:m,lockFocusAcrossFrames:c}=e,h=u.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&ja(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),l=u.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),d=a&&!n;return v.jsx(Ga,{crossFrame:c,persistentFocus:m,autoFocus:i,disabled:s,onActivation:h,onDeactivation:l,returnFocus:d,children:o})};ln.displayName="FocusLock";var Wa=tr?u.useLayoutEffect:u.useEffect;function xt(e,t=[]){const n=u.useRef(e);return Wa(()=>{n.current=e}),u.useCallback((...r)=>{var a;return(a=n.current)==null?void 0:a.call(n,...r)},t)}function Ha(e,t){const n=u.useId();return u.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Ua(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Va(e={}){const{onClose:t,onOpen:n,isOpen:r,id:a}=e,o=xt(n),s=xt(t),[i,m]=u.useState(e.defaultIsOpen||!1),[c,h]=Ua(r,i),l=Ha(a,"disclosure"),d=u.useCallback(()=>{c||m(!1),s==null||s()},[c,s]),p=u.useCallback(()=>{c||m(!0),o==null||o()},[c,o]),b=u.useCallback(()=>{(h?d:p)()},[h,p,d]);return{isOpen:!!h,onOpen:p,onClose:d,onToggle:b,isControlled:c,getButtonProps:(f={})=>({...f,"aria-expanded":h,"aria-controls":l,onClick:qn(f.onClick,b)}),getDisclosureProps:(f={})=>({...f,hidden:!h,id:l})}}var[$a,dn]=be({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nt=F(function(t,n){const r=Ft("List",t),{children:a,styleType:o="none",stylePosition:s,spacing:i,...m}=He(t),c=dr(a),l=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return v.jsx($a,{value:r,children:v.jsx(P.ul,{ref:n,listStyleType:o,listStylePosition:s,role:"list",__css:{...r.container,...l},...m,children:c})})});nt.displayName="List";var za=F((e,t)=>{const{as:n,...r}=e;return v.jsx(nt,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});za.displayName="OrderedList";var qa=F(function(t,n){const{as:r,...a}=t;return v.jsx(nt,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})});qa.displayName="UnorderedList";var Ya=F(function(t,n){const r=dn();return v.jsx(P.li,{ref:n,...t,__css:r.item})});Ya.displayName="ListItem";var Xa=F(function(t,n){const r=dn();return v.jsx(Yn,{ref:n,role:"presentation",...t,__css:r.icon})});Xa.displayName="ListIcon";var Ka=F(function(t,n){const r=kt("Text",t),{className:a,align:o,decoration:s,casing:i,...m}=He(t),c=nr({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return v.jsx(P.p,{ref:n,className:O("chakra-text",t.className),...c,...m,__css:r})});Ka.displayName="Text";var fn=P("div");fn.displayName="Box";var vn=F(function(t,n){const{size:r,centerContent:a=!0,...o}=t,s=a?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return v.jsx(fn,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...o})});vn.displayName="Square";var Za=F(function(t,n){const{size:r,...a}=t;return v.jsx(vn,{size:r,ref:n,borderRadius:"9999px",...a})});Za.displayName="Circle";var Qa={slideInBottom:{...ee,custom:{offsetY:16,reverse:!0}},slideInRight:{...ee,custom:{offsetX:16,reverse:!0}},slideInTop:{...ee,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...ee,custom:{offsetX:-16,reverse:!0}},scale:{...Pt,custom:{initialScale:.95,reverse:!0}},none:{}},Ja=P(oe.section),eo=e=>Qa[e||"none"],mn=u.forwardRef((e,t)=>{const{preset:n,motionProps:r=eo(n),...a}=e;return v.jsx(Ja,{ref:t,...r,...a})});mn.displayName="ModalTransition";var to=Object.defineProperty,no=(e,t,n)=>t in e?to(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ro=(e,t,n)=>(no(e,t+"",n),n),ao=class{constructor(){ro(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},Ge=new ao;function hn(e,t){const[n,r]=u.useState(0);return u.useEffect(()=>{const a=e.current;if(a){if(t){const o=Ge.add(a);r(o)}return()=>{Ge.remove(a),r(0)}}},[t,e]),n}var oo=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U=new WeakMap,ce=new WeakMap,le={},Ne=0,pn=function(e){return e&&(e.host||pn(e.parentNode))},io=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},so=function(e,t,n,r){var a=io(t,Array.isArray(e)?e:[e]);le[n]||(le[n]=new WeakMap);var o=le[n],s=[],i=new Set,m=new Set(a),c=function(l){!l||i.has(l)||(i.add(l),c(l.parentNode))};a.forEach(c);var h=function(l){!l||m.has(l)||Array.prototype.forEach.call(l.children,function(d){if(i.has(d))h(d);else try{var p=d.getAttribute(r),b=p!==null&&p!=="false",f=(U.get(d)||0)+1,g=(o.get(d)||0)+1;U.set(d,f),o.set(d,g),s.push(d),f===1&&b&&ce.set(d,!0),g===1&&d.setAttribute(n,"true"),b||d.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",d,y)}})};return h(t),i.clear(),Ne++,function(){s.forEach(function(l){var d=U.get(l)-1,p=o.get(l)-1;U.set(l,d),o.set(l,p),d||(ce.has(l)||l.removeAttribute(r),ce.delete(l)),p||l.removeAttribute(n)}),Ne--,Ne||(U=new WeakMap,U=new WeakMap,ce=new WeakMap,le={})}},uo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=oo(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),so(r,a,n,"aria-hidden")):function(){return null}};function co(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:s=!0,onOverlayClick:i,onEsc:m}=e,c=u.useRef(null),h=u.useRef(null),[l,d,p]=fo(r,"chakra-modal","chakra-modal--header","chakra-modal--body");lo(c,t&&s);const b=hn(c,t),f=u.useRef(null),g=u.useCallback(E=>{f.current=E.target},[]),y=u.useCallback(E=>{E.key==="Escape"&&(E.stopPropagation(),o&&(n==null||n()),m==null||m())},[o,n,m]),[x,w]=u.useState(!1),[C,S]=u.useState(!1),k=u.useCallback((E={},K=null)=>({role:"dialog",...E,ref:Me(K,c),id:l,tabIndex:-1,"aria-modal":!0,"aria-labelledby":x?d:void 0,"aria-describedby":C?p:void 0,onClick:J(E.onClick,se=>se.stopPropagation())}),[p,C,l,d,x]),I=u.useCallback(E=>{E.stopPropagation(),f.current===E.target&&Ge.isTopModal(c.current)&&(a&&(n==null||n()),i==null||i())},[n,a,i]),T=u.useCallback((E={},K=null)=>({...E,ref:Me(K,h),onClick:J(E.onClick,I),onKeyDown:J(E.onKeyDown,y),onMouseDown:J(E.onMouseDown,g)}),[y,g,I]);return{isOpen:t,onClose:n,headerId:d,bodyId:p,setBodyMounted:S,setHeaderMounted:w,dialogRef:c,overlayRef:h,getDialogProps:k,getDialogContainerProps:T,index:b}}function lo(e,t){const n=e.current;u.useEffect(()=>{if(!(!e.current||!t))return uo(e.current)},[t,e,n])}function fo(e,...t){const n=u.useId(),r=e||n;return u.useMemo(()=>t.map(a=>`${a}-${r}`),[r,t])}var[vo,ie]=be({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[mo,G]=be({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),bn=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:c,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p,onCloseComplete:b}=t,f=Ft("Modal",t),y={...co(t),autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:c,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p};return v.jsx(mo,{value:y,children:v.jsx(vo,{value:f,children:v.jsx(pe,{onExitComplete:b,children:y.isOpen&&v.jsx(Xn,{...n,children:r})})})})};bn.displayName="Modal";var ve="right-scroll-bar-position",me="width-before-scroll-bar",ho="with-scroll-bars-hidden",po="--removed-body-scroll-bar-size",gn=Lt(),Pe=function(){},ge=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:Pe,onWheelCapture:Pe,onTouchMoveCapture:Pe}),a=r[0],o=r[1],s=e.forwardProps,i=e.children,m=e.className,c=e.removeScrollBar,h=e.enabled,l=e.shards,d=e.sideCar,p=e.noIsolation,b=e.inert,f=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,x=e.gapMode,w=_t(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=d,S=Mt([n,t]),k=M(M({},w),a);return u.createElement(u.Fragment,null,h&&u.createElement(C,{sideCar:gn,removeScrollBar:c,shards:l,noIsolation:p,inert:b,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:x}),s?u.cloneElement(u.Children.only(i),M(M({},k),{ref:S})):u.createElement(y,M({},k,{className:m,ref:S}),i))});ge.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ge.classNames={fullWidth:me,zeroRight:ve};var bo=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function go(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bo();return t&&e.setAttribute("nonce",t),e}function yo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xo(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=go())&&(yo(t,n),xo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},So=function(){var e=wo();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yn=function(){var e=So(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Co={left:0,top:0,right:0,gap:0},Oe=function(e){return parseInt(e||"",10)||0},Eo=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Oe(n),Oe(r),Oe(a)]},ko=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Co;var t=Eo(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Fo=yn(),Y="data-scroll-locked",No=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),` +import{r as u,j as v,A as pe,m as oe,i as O,s as be,b as P,S as $n,f as F,k as kt,o as He,p as ut,B as Ie,R as zn,J as qn,x as Ft,I as Yn,q as J,P as Xn,K as Kn,N as Zn,e as Qn,O as Jn}from"./index-oAnJD5lr.js";function er(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var tr=er();function nr(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function rr(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Me(...e){return t=>{e.forEach(n=>{rr(n,t)})}}function ar(...e){return u.useMemo(()=>Me(...e),e)}var ct={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Z={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function Ko(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Z.slideRight;case"left":return Z.slideLeft;case"bottom":return Z.slideDown;case"top":return Z.slideUp;default:return Z.slideRight}}var D={enter:{duration:.2,ease:ct.easeOut},exit:{duration:.1,ease:ct.easeIn}},R={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},or={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:R.enter(D.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:R.exit(D.exit,n),transitionEnd:t==null?void 0:t.exit}}},Nt={initial:"exit",animate:"enter",exit:"exit",variants:or},ir=u.forwardRef(function(t,n){const{unmountOnExit:r,in:a,className:o,transition:s,transitionEnd:i,delay:m,...c}=t,h=a||r?"enter":"exit",l=r?a&&r:!0,d={transition:s,transitionEnd:i,delay:m};return v.jsx(pe,{custom:d,children:l&&v.jsx(oe.div,{ref:n,className:O("chakra-fade",o),custom:d,...Nt,animate:h,...c})})});ir.displayName="Fade";var sr={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:a})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:R.exit(D.exit,a)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:R.enter(D.enter,n),transitionEnd:e==null?void 0:e.enter}}},Pt={initial:"exit",animate:"enter",exit:"exit",variants:sr},ur=u.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,initialScale:s=.95,className:i,transition:m,transitionEnd:c,delay:h,...l}=t,d=r?a&&r:!0,p=a||r?"enter":"exit",b={initialScale:s,reverse:o,transition:m,transitionEnd:c,delay:h};return v.jsx(pe,{custom:b,children:d&&v.jsx(oe.div,{ref:n,className:O("chakra-offset-slide",i),...Pt,animate:p,custom:b,...l})})});ur.displayName="ScaleFade";var cr={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:a})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:R.exit(D.exit,a),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:R.enter(D.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:a,delay:o})=>{var s;const i={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:R.exit(D.exit,o),...a?{...i,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...i,...r==null?void 0:r.exit}}}}},ee={initial:"initial",animate:"enter",exit:"exit",variants:cr},lr=u.forwardRef(function(t,n){const{unmountOnExit:r,in:a,reverse:o=!0,className:s,offsetX:i=0,offsetY:m=8,transition:c,transitionEnd:h,delay:l,...d}=t,p=r?a&&r:!0,b=a||r?"enter":"exit",f={offsetX:i,offsetY:m,reverse:o,transition:c,transitionEnd:h,delay:l};return v.jsx(pe,{custom:f,children:p&&v.jsx(oe.div,{ref:n,className:O("chakra-offset-slide",s),custom:f,...ee,animate:b,...d})})});lr.displayName="SlideFade";function dr(e){return u.Children.toArray(e).filter(t=>u.isValidElement(t))}var[Zo,fr]=be({strict:!1,name:"ButtonGroupContext"});function vr(e){const[t,n]=u.useState(!e);return{ref:u.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}function _e(e){const{children:t,className:n,...r}=e,a=u.isValidElement(t)?u.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=O("chakra-button__icon",n);return v.jsx(P.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:a})}_e.displayName="ButtonIcon";function Ae(e){const{label:t,placement:n,spacing:r="0.5rem",children:a=v.jsx($n,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:s,...i}=e,m=O("chakra-button__spinner",o),c=n==="start"?"marginEnd":"marginStart",h=u.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[c]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,c,r]);return v.jsx(P.div,{className:m,...i,__css:h,children:a})}Ae.displayName="ButtonSpinner";var Ot=F((e,t)=>{const n=fr(),r=kt("Button",{...n,...e}),{isDisabled:a=n==null?void 0:n.isDisabled,isLoading:o,isActive:s,children:i,leftIcon:m,rightIcon:c,loadingText:h,iconSpacing:l="0.5rem",type:d,spinner:p,spinnerPlacement:b="start",className:f,as:g,...y}=He(e),x=u.useMemo(()=>{const k={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:k}}},[r,n]),{ref:w,type:C}=vr(g),S={rightIcon:c,leftIcon:m,iconSpacing:l,children:i};return v.jsxs(P.button,{ref:ar(t,w),as:g,type:d??C,"data-active":ut(s),"data-loading":ut(o),__css:x,className:O("chakra-button",f),...y,disabled:a||o,children:[o&&b==="start"&&v.jsx(Ae,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:l,children:p}),o?h||v.jsx(P.span,{opacity:0,children:v.jsx(lt,{...S})}):v.jsx(lt,{...S}),o&&b==="end"&&v.jsx(Ae,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:l,children:p})]})});Ot.displayName="Button";function lt(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:a}=e;return v.jsxs(v.Fragment,{children:[t&&v.jsx(_e,{marginEnd:a,children:t}),r,n&&v.jsx(_e,{marginStart:a,children:n})]})}function mr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Te="data-focus-lock",It="data-focus-lock-disabled",hr="data-no-focus-lock",pr="data-autofocus-inside",br="data-no-autofocus";function Se(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gr(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var yr=typeof window<"u"?u.useLayoutEffect:u.useEffect,dt=new WeakMap;function Mt(e,t){var n=gr(null,function(r){return e.forEach(function(a){return Se(a,r)})});return yr(function(){var r=dt.get(n);if(r){var a=new Set(r),o=new Set(e),s=n.current;a.forEach(function(i){o.has(i)||Se(i,null)}),o.forEach(function(i){a.has(i)||Se(i,s)})}dt.set(n,e)},[e]),n}var Ce={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},M=function(){return M=Object.assign||function(t){for(var n,r=1,a=arguments.length;r=0}).sort(jr)},Wr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],qe=Wr.join(","),Hr="".concat(qe,", [data-focus-guard]"),qt=function(e,t){return _((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Hr:qe)?[r]:[],qt(r))},[])},Ur=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?X([e.contentDocument.body],t):[e]},X=function(e,t){return e.reduce(function(n,r){var a,o=qt(r,t),s=(a=[]).concat.apply(a,o.map(function(i){return Ur(i,t)}));return n.concat(s,r.parentNode?_(r.parentNode.querySelectorAll(qe)).filter(function(i){return i===r}):[])},[])},Vr=function(e){var t=e.querySelectorAll("[".concat(pr,"]"));return _(t).map(function(n){return X([n])}).reduce(function(n,r){return n.concat(r)},[])},Ye=function(e,t){return _(e).filter(function(n){return Ht(t,n)}).filter(function(n){return Dr(n)})},ft=function(e,t){return t===void 0&&(t=new Map),_(e).filter(function(n){return Ut(t,n)})},Xe=function(e,t,n){return ze(Ye(X(e,n),t),!0,n)},ne=function(e,t){return ze(Ye(X(e),t),!1)},$r=function(e,t){return Ye(Vr(e),t)},B=function(e,t){return e.shadowRoot?B(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:_(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var a=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return a?B(a,t):!1}return B(n,t)})},zr=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(a),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,i){return!t.has(i)})},Yt=function(e){return e.parentNode?Yt(e.parentNode):e},Ke=function(e){var t=j(e);return t.filter(Boolean).reduce(function(n,r){var a=r.getAttribute(Te);return n.push.apply(n,a?zr(_(Yt(r).querySelectorAll("[".concat(Te,'="').concat(a,'"]:not([').concat(It,'="disabled"])')))):[r]),n},[])},qr=function(e){try{return e()}catch{return}},re=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?re(t.shadowRoot):t instanceof HTMLIFrameElement&&qr(function(){return t.contentWindow.document})?re(t.contentWindow.document):t}},Yr=function(e,t){return e===t},Xr=function(e,t){return!!_(e.querySelectorAll("iframe")).some(function(n){return Yr(n,t)})},Xt=function(e,t){return t===void 0&&(t=re(jt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Ke(e).some(function(n){return B(n,t)||Xr(n,t)})},Kr=function(e){e===void 0&&(e=document);var t=re(e);return t?_(e.querySelectorAll("[".concat(hr,"]"))).some(function(n){return B(n,t)}):!1},Zr=function(e,t){return t.filter(zt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ze=function(e,t){return zt(e)&&e.name?Zr(e,t):e},Qr=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ze(n,e))}),e.filter(function(n){return t.has(n)})},vt=function(e){return e[0]&&e.length>1?Ze(e[0],e):e[0]},mt=function(e,t){return e.indexOf(Ze(t,e))},Re="NEW_FOCUS",Jr=function(e,t,n,r,a){var o=e.length,s=e[0],i=e[o-1],m=$e(r);if(!(r&&e.indexOf(r)>=0)){var c=r!==void 0?n.indexOf(r):-1,h=a?n.indexOf(a):c,l=a?e.indexOf(a):-1;if(c===-1)return l!==-1?l:Re;if(l===-1)return Re;var d=c-h,p=n.indexOf(s),b=n.indexOf(i),f=Qr(n),g=r!==void 0?f.indexOf(r):-1,y=g-(a?f.indexOf(a):c);if(!d&&l>=0||t.length===0)return l;var x=mt(e,t[0]),w=mt(e,t[t.length-1]);if(c<=p&&m&&Math.abs(d)>1)return w;if(c>=b&&m&&Math.abs(d)>1)return x;if(d&&Math.abs(y)>1)return l;if(c<=p)return w;if(c>b)return x;if(d)return Math.abs(d)>1?l:(o+l+d)%o}},ea=function(e){return function(t){var n,r=(n=Vt(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},ht=function(e,t,n){var r=e.map(function(o){var s=o.node;return s}),a=ft(r.filter(ea(n)));return a&&a.length?vt(a):vt(ft(t))},Be=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Be(e.parentNode.host||e.parentNode,t),t},Ee=function(e,t){for(var n=Be(e),r=Be(t),a=0;a=0)return o}return!1},Kt=function(e,t,n){var r=j(e),a=j(t),o=r[0],s=!1;return a.filter(Boolean).forEach(function(i){s=Ee(s||i,i)||s,n.filter(Boolean).forEach(function(m){var c=Ee(o,m);c&&(!s||B(c,s)?s=c:s=Ee(c,s))})}),s},pt=function(e,t){return e.reduce(function(n,r){return n.concat($r(r,t))},[])},ta=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Br)},na=function(e,t){var n=re(j(e).length>0?document:jt(e).ownerDocument),r=Ke(e).filter(De),a=Kt(n||e,e,r),o=new Map,s=ne(r,o),i=s.filter(function(b){var f=b.node;return De(f)});if(i[0]){var m=ne([a],o).map(function(b){var f=b.node;return f}),c=ta(m,i),h=c.map(function(b){var f=b.node;return f}),l=c.filter(function(b){var f=b.tabIndex;return f>=0}).map(function(b){var f=b.node;return f}),d=Jr(h,l,m,n,t);if(d===Re){var p=ht(s,l,pt(r,o))||ht(s,h,pt(r,o));if(p)return{node:p};console.warn("focus-lock: cannot find any node to move focus into");return}return d===void 0?d:c[d]}},ra=function(e){var t=Ke(e).filter(De),n=Kt(e,e,t),r=ze(X([n],!0),!0,!0),a=X(t,!1);return r.map(function(o){var s=o.node,i=o.index;return{node:s,index:i,lockItem:a.indexOf(s)>=0,guard:$e(s)}})},Qe=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},ke=0,Fe=!1,Zt=function(e,t,n){n===void 0&&(n={});var r=na(e,t);if(!Fe&&r){if(ke>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Fe=!0,setTimeout(function(){Fe=!1},1);return}ke++,Qe(r.node,n.focusOptions),ke--}};function Q(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var aa=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:Q(n),parent:Q(n.parentElement),left:Q(n.previousElementSibling),right:Q(n.nextElementSibling)}),n=n.parentElement;return{element:Q(e),stack:t,ownerDocument:e.ownerDocument}},oa=function(e){var t,n,r,a,o;if(e)for(var s=e.stack,i=e.ownerDocument,m=new Map,c=0,h=s;c-1&&(g.filter(function(x){var w=x.guard,C=x.node;return w&&C.dataset.focusAutoGuard}).forEach(function(x){var w=x.node;return w.removeAttribute("tabIndex")}),gt(y,g.length,1,g),gt(y,-1,-1,g))}}}return t},rn=function(t){he()&&t&&(t.stopPropagation(),t.preventDefault())},tt=function(){return Je(he)},Ca=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||ba(r,n)},Ea=function(){return null},an=function(){et=!0},on=function(){et=!1,ae="just",Je(function(){ae="meanwhile"})},ka=function(){document.addEventListener("focusin",rn),document.addEventListener("focusout",tt),window.addEventListener("focus",an),window.addEventListener("blur",on)},Fa=function(){document.removeEventListener("focusin",rn),document.removeEventListener("focusout",tt),window.removeEventListener("focus",an),window.removeEventListener("blur",on)};function Na(e){return e.filter(function(t){var n=t.disabled;return!n})}var sn={moveFocusInside:Zt,focusInside:Xt,focusNextElement:ca,focusPrevElement:la,focusFirstElement:da,focusLastElement:fa,captureFocusRestore:Qt};function Pa(e){var t=e.slice(-1)[0];t&&!z&&ka();var n=z,r=n&&t&&t.id===n.id;z=t,n&&!r&&(n.onDeactivation(),e.filter(function(a){var o=a.id;return o===n.id}).length||n.returnFocus(!t)),t?(N=null,(!r||n.observed!==t.observed)&&t.onActivation(sn),he(),Je(he)):(Fa(),N=null)}Rt.assignSyncMedium(Ca);Bt.assignMedium(tt);Sr.assignMedium(function(e){return e(sn)});const Oa=Ir(Na,Pa)(Ea);var je=u.forwardRef(function(t,n){return u.createElement(Ve,Ie({sideCar:Oa,ref:n},t))}),un=Ve.propTypes||{};un.sideCar;mr(un,["sideCar"]);je.propTypes={};function Ia(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ma(e){var t;if(!Ia(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}var _a=e=>e.hasAttribute("tabindex");function Aa(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function cn(e){return e.parentElement&&cn(e.parentElement)?!0:e.hidden}function Ta(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function La(e){if(!Ma(e)||cn(e)||Aa(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():Ta(e)?!0:_a(e)}var Da=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],Ra=Da.join(),Ba=e=>e.offsetWidth>0&&e.offsetHeight>0;function ja(e){const t=Array.from(e.querySelectorAll(Ra));return t.unshift(e),t.filter(n=>La(n)&&Ba(n))}var yt,Ga=(yt=je.default)!=null?yt:je,ln=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:a,children:o,isDisabled:s,autoFocus:i,persistentFocus:m,lockFocusAcrossFrames:c}=e,h=u.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&ja(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),l=u.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),d=a&&!n;return v.jsx(Ga,{crossFrame:c,persistentFocus:m,autoFocus:i,disabled:s,onActivation:h,onDeactivation:l,returnFocus:d,children:o})};ln.displayName="FocusLock";var Wa=tr?u.useLayoutEffect:u.useEffect;function xt(e,t=[]){const n=u.useRef(e);return Wa(()=>{n.current=e}),u.useCallback((...r)=>{var a;return(a=n.current)==null?void 0:a.call(n,...r)},t)}function Ha(e,t){const n=u.useId();return u.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Ua(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Va(e={}){const{onClose:t,onOpen:n,isOpen:r,id:a}=e,o=xt(n),s=xt(t),[i,m]=u.useState(e.defaultIsOpen||!1),[c,h]=Ua(r,i),l=Ha(a,"disclosure"),d=u.useCallback(()=>{c||m(!1),s==null||s()},[c,s]),p=u.useCallback(()=>{c||m(!0),o==null||o()},[c,o]),b=u.useCallback(()=>{(h?d:p)()},[h,p,d]);return{isOpen:!!h,onOpen:p,onClose:d,onToggle:b,isControlled:c,getButtonProps:(f={})=>({...f,"aria-expanded":h,"aria-controls":l,onClick:qn(f.onClick,b)}),getDisclosureProps:(f={})=>({...f,hidden:!h,id:l})}}var[$a,dn]=be({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nt=F(function(t,n){const r=Ft("List",t),{children:a,styleType:o="none",stylePosition:s,spacing:i,...m}=He(t),c=dr(a),l=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return v.jsx($a,{value:r,children:v.jsx(P.ul,{ref:n,listStyleType:o,listStylePosition:s,role:"list",__css:{...r.container,...l},...m,children:c})})});nt.displayName="List";var za=F((e,t)=>{const{as:n,...r}=e;return v.jsx(nt,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});za.displayName="OrderedList";var qa=F(function(t,n){const{as:r,...a}=t;return v.jsx(nt,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})});qa.displayName="UnorderedList";var Ya=F(function(t,n){const r=dn();return v.jsx(P.li,{ref:n,...t,__css:r.item})});Ya.displayName="ListItem";var Xa=F(function(t,n){const r=dn();return v.jsx(Yn,{ref:n,role:"presentation",...t,__css:r.icon})});Xa.displayName="ListIcon";var Ka=F(function(t,n){const r=kt("Text",t),{className:a,align:o,decoration:s,casing:i,...m}=He(t),c=nr({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return v.jsx(P.p,{ref:n,className:O("chakra-text",t.className),...c,...m,__css:r})});Ka.displayName="Text";var fn=P("div");fn.displayName="Box";var vn=F(function(t,n){const{size:r,centerContent:a=!0,...o}=t,s=a?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return v.jsx(fn,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...o})});vn.displayName="Square";var Za=F(function(t,n){const{size:r,...a}=t;return v.jsx(vn,{size:r,ref:n,borderRadius:"9999px",...a})});Za.displayName="Circle";var Qa={slideInBottom:{...ee,custom:{offsetY:16,reverse:!0}},slideInRight:{...ee,custom:{offsetX:16,reverse:!0}},slideInTop:{...ee,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...ee,custom:{offsetX:-16,reverse:!0}},scale:{...Pt,custom:{initialScale:.95,reverse:!0}},none:{}},Ja=P(oe.section),eo=e=>Qa[e||"none"],mn=u.forwardRef((e,t)=>{const{preset:n,motionProps:r=eo(n),...a}=e;return v.jsx(Ja,{ref:t,...r,...a})});mn.displayName="ModalTransition";var to=Object.defineProperty,no=(e,t,n)=>t in e?to(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ro=(e,t,n)=>(no(e,t+"",n),n),ao=class{constructor(){ro(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},Ge=new ao;function hn(e,t){const[n,r]=u.useState(0);return u.useEffect(()=>{const a=e.current;if(a){if(t){const o=Ge.add(a);r(o)}return()=>{Ge.remove(a),r(0)}}},[t,e]),n}var oo=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U=new WeakMap,ce=new WeakMap,le={},Ne=0,pn=function(e){return e&&(e.host||pn(e.parentNode))},io=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},so=function(e,t,n,r){var a=io(t,Array.isArray(e)?e:[e]);le[n]||(le[n]=new WeakMap);var o=le[n],s=[],i=new Set,m=new Set(a),c=function(l){!l||i.has(l)||(i.add(l),c(l.parentNode))};a.forEach(c);var h=function(l){!l||m.has(l)||Array.prototype.forEach.call(l.children,function(d){if(i.has(d))h(d);else try{var p=d.getAttribute(r),b=p!==null&&p!=="false",f=(U.get(d)||0)+1,g=(o.get(d)||0)+1;U.set(d,f),o.set(d,g),s.push(d),f===1&&b&&ce.set(d,!0),g===1&&d.setAttribute(n,"true"),b||d.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",d,y)}})};return h(t),i.clear(),Ne++,function(){s.forEach(function(l){var d=U.get(l)-1,p=o.get(l)-1;U.set(l,d),o.set(l,p),d||(ce.has(l)||l.removeAttribute(r),ce.delete(l)),p||l.removeAttribute(n)}),Ne--,Ne||(U=new WeakMap,U=new WeakMap,ce=new WeakMap,le={})}},uo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=oo(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),so(r,a,n,"aria-hidden")):function(){return null}};function co(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:s=!0,onOverlayClick:i,onEsc:m}=e,c=u.useRef(null),h=u.useRef(null),[l,d,p]=fo(r,"chakra-modal","chakra-modal--header","chakra-modal--body");lo(c,t&&s);const b=hn(c,t),f=u.useRef(null),g=u.useCallback(E=>{f.current=E.target},[]),y=u.useCallback(E=>{E.key==="Escape"&&(E.stopPropagation(),o&&(n==null||n()),m==null||m())},[o,n,m]),[x,w]=u.useState(!1),[C,S]=u.useState(!1),k=u.useCallback((E={},K=null)=>({role:"dialog",...E,ref:Me(K,c),id:l,tabIndex:-1,"aria-modal":!0,"aria-labelledby":x?d:void 0,"aria-describedby":C?p:void 0,onClick:J(E.onClick,se=>se.stopPropagation())}),[p,C,l,d,x]),I=u.useCallback(E=>{E.stopPropagation(),f.current===E.target&&Ge.isTopModal(c.current)&&(a&&(n==null||n()),i==null||i())},[n,a,i]),T=u.useCallback((E={},K=null)=>({...E,ref:Me(K,h),onClick:J(E.onClick,I),onKeyDown:J(E.onKeyDown,y),onMouseDown:J(E.onMouseDown,g)}),[y,g,I]);return{isOpen:t,onClose:n,headerId:d,bodyId:p,setBodyMounted:S,setHeaderMounted:w,dialogRef:c,overlayRef:h,getDialogProps:k,getDialogContainerProps:T,index:b}}function lo(e,t){const n=e.current;u.useEffect(()=>{if(!(!e.current||!t))return uo(e.current)},[t,e,n])}function fo(e,...t){const n=u.useId(),r=e||n;return u.useMemo(()=>t.map(a=>`${a}-${r}`),[r,t])}var[vo,ie]=be({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[mo,G]=be({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),bn=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:c,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p,onCloseComplete:b}=t,f=Ft("Modal",t),y={...co(t),autoFocus:a,trapFocus:o,initialFocusRef:s,finalFocusRef:i,returnFocusOnClose:m,blockScrollOnMount:c,allowPinchZoom:h,preserveScrollBarGap:l,motionPreset:d,lockFocusAcrossFrames:p};return v.jsx(mo,{value:y,children:v.jsx(vo,{value:f,children:v.jsx(pe,{onExitComplete:b,children:y.isOpen&&v.jsx(Xn,{...n,children:r})})})})};bn.displayName="Modal";var ve="right-scroll-bar-position",me="width-before-scroll-bar",ho="with-scroll-bars-hidden",po="--removed-body-scroll-bar-size",gn=Lt(),Pe=function(){},ge=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:Pe,onWheelCapture:Pe,onTouchMoveCapture:Pe}),a=r[0],o=r[1],s=e.forwardProps,i=e.children,m=e.className,c=e.removeScrollBar,h=e.enabled,l=e.shards,d=e.sideCar,p=e.noIsolation,b=e.inert,f=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,x=e.gapMode,w=_t(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=d,S=Mt([n,t]),k=M(M({},w),a);return u.createElement(u.Fragment,null,h&&u.createElement(C,{sideCar:gn,removeScrollBar:c,shards:l,noIsolation:p,inert:b,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:x}),s?u.cloneElement(u.Children.only(i),M(M({},k),{ref:S})):u.createElement(y,M({},k,{className:m,ref:S}),i))});ge.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ge.classNames={fullWidth:me,zeroRight:ve};var bo=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function go(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bo();return t&&e.setAttribute("nonce",t),e}function yo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xo(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=go())&&(yo(t,n),xo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},So=function(){var e=wo();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yn=function(){var e=So(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Co={left:0,top:0,right:0,gap:0},Oe=function(e){return parseInt(e||"",10)||0},Eo=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Oe(n),Oe(r),Oe(a)]},ko=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Co;var t=Eo(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Fo=yn(),Y="data-scroll-locked",No=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),` .`.concat(ho,` { overflow: hidden `).concat(r,`; padding-right: `).concat(i,"px ").concat(r,`; diff --git a/assets/Impressum-mtZspX0T.js b/assets/Impressum-0nu2Idu7.js similarity index 97% rename from assets/Impressum-mtZspX0T.js rename to assets/Impressum-0nu2Idu7.js index 421ec90..971372d 100644 --- a/assets/Impressum-mtZspX0T.js +++ b/assets/Impressum-0nu2Idu7.js @@ -1 +1 @@ -import{j as e,M as n}from"./index-C4jKHMt0.js";import{C as r,a as t,H as i,b as s}from"./chunk-7OLJDQMT-DRboIhh9.js";const l=()=>e.jsx(n,{title:"Impressum",description:"Impressum der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(t,{children:e.jsx(i,{children:"Impressum"})}),e.jsxs(s,{children:[e.jsxs("p",{children:["Martin Großhauser ",e.jsx("br",{}),"Arnulfstraße 138 ",e.jsx("br",{}),"80634 München ",e.jsx("br",{}),"info@openpv.de ",e.jsx("br",{})]}),e.jsx("h3",{children:"Haftung für Inhalte"}),e.jsx("p",{children:"Alle Inhalte unseres Internetauftritts wurden mit größter Sorgfalt und nach bestem Gewissen erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntniserlangung einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von den o.g. Rechtsverletzungen werden wir diese Inhalte unverzüglich entfernen."}),e.jsx("h3",{children:"Haftungsbeschränkung für externe Links"}),e.jsx("p",{children:"Unsere Webseite enthält Links auf externe Webseiten Dritter. Auf die Inhalte dieser direkt oder indirekt verlinkten Webseiten haben wir keinen Einfluss. Daher können wir für die „externen Links“ auch keine Gewähr auf Richtigkeit der Inhalte übernehmen. Für die Inhalte der externen Links sind die jeweilige Anbieter oder Betreiber (Urheber) der Seiten verantwortlich. Die externen Links wurden zum Zeitpunkt der Linksetzung auf eventuelle Rechtsverstöße überprüft und waren im Zeitpunkt der Linksetzung frei von rechtswidrigen Inhalten. Eine ständige inhaltliche Überprüfung der externen Links ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht möglich. Bei direkten oder indirekten Verlinkungen auf die Webseiten Dritter, die außerhalb unseres Verantwortungsbereichs liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall nur bestehen, wenn wir von den Inhalten Kenntnis erlangen und es uns technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern. Diese Haftungsausschlusserklärung gilt auch innerhalb des eigenen Internetauftrittes „Name Ihrer Domain“ gesetzten Links und Verweise von Fragestellern, Blogeinträgern, Gästen des Diskussionsforums. Für illegale, fehlerhafte oder unvollständige Inhalte und insbesondere für Schäden, die aus der Nutzung oder Nichtnutzung solcherart dargestellten Informationen entstehen, haftet allein der Diensteanbieter der Seite, auf welche verwiesen wurde, nicht derjenige, der über Links auf die jeweilige Veröffentlichung lediglich verweist. Werden uns Rechtsverletzungen bekannt, werden die externen Links durch uns unverzüglich entfernt."}),e.jsx("h3",{children:"Urheberrecht"}),e.jsx("p",{children:"Die auf unserer Webseite veröffentlichen Inhalte und Werke unterliegen dem deutschen Urheberrecht (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf) . Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung des geistigen Eigentums in ideeller und materieller Sicht des Urhebers außerhalb der Grenzen des Urheberrechtes bedürfen der vorherigen schriftlichen Zustimmung des jeweiligen Urhebers i.S.d. Urhebergesetzes (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf ). Downloads und Kopien dieser Seite sind nur für den privaten und nicht kommerziellen Gebrauch erlaubt. Sind die Inhalte auf unserer Webseite nicht von uns erstellt wurden, sind die Urheberrechte Dritter zu beachten. Die Inhalte Dritter werden als solche kenntlich gemacht. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte unverzüglich entfernen."})]})]})});export{l as default}; +import{j as e,M as n}from"./index-oAnJD5lr.js";import{C as r,a as t,H as i,b as s}from"./chunk-7OLJDQMT-E6ec7czU.js";const l=()=>e.jsx(n,{title:"Impressum",description:"Impressum der Website.",children:e.jsxs(r,{height:"100%",overflow:"auto",children:[e.jsx(t,{children:e.jsx(i,{children:"Impressum"})}),e.jsxs(s,{children:[e.jsxs("p",{children:["Martin Großhauser ",e.jsx("br",{}),"Arnulfstraße 138 ",e.jsx("br",{}),"80634 München ",e.jsx("br",{}),"info@openpv.de ",e.jsx("br",{})]}),e.jsx("h3",{children:"Haftung für Inhalte"}),e.jsx("p",{children:"Alle Inhalte unseres Internetauftritts wurden mit größter Sorgfalt und nach bestem Gewissen erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntniserlangung einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von den o.g. Rechtsverletzungen werden wir diese Inhalte unverzüglich entfernen."}),e.jsx("h3",{children:"Haftungsbeschränkung für externe Links"}),e.jsx("p",{children:"Unsere Webseite enthält Links auf externe Webseiten Dritter. Auf die Inhalte dieser direkt oder indirekt verlinkten Webseiten haben wir keinen Einfluss. Daher können wir für die „externen Links“ auch keine Gewähr auf Richtigkeit der Inhalte übernehmen. Für die Inhalte der externen Links sind die jeweilige Anbieter oder Betreiber (Urheber) der Seiten verantwortlich. Die externen Links wurden zum Zeitpunkt der Linksetzung auf eventuelle Rechtsverstöße überprüft und waren im Zeitpunkt der Linksetzung frei von rechtswidrigen Inhalten. Eine ständige inhaltliche Überprüfung der externen Links ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht möglich. Bei direkten oder indirekten Verlinkungen auf die Webseiten Dritter, die außerhalb unseres Verantwortungsbereichs liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall nur bestehen, wenn wir von den Inhalten Kenntnis erlangen und es uns technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern. Diese Haftungsausschlusserklärung gilt auch innerhalb des eigenen Internetauftrittes „Name Ihrer Domain“ gesetzten Links und Verweise von Fragestellern, Blogeinträgern, Gästen des Diskussionsforums. Für illegale, fehlerhafte oder unvollständige Inhalte und insbesondere für Schäden, die aus der Nutzung oder Nichtnutzung solcherart dargestellten Informationen entstehen, haftet allein der Diensteanbieter der Seite, auf welche verwiesen wurde, nicht derjenige, der über Links auf die jeweilige Veröffentlichung lediglich verweist. Werden uns Rechtsverletzungen bekannt, werden die externen Links durch uns unverzüglich entfernt."}),e.jsx("h3",{children:"Urheberrecht"}),e.jsx("p",{children:"Die auf unserer Webseite veröffentlichen Inhalte und Werke unterliegen dem deutschen Urheberrecht (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf) . Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung des geistigen Eigentums in ideeller und materieller Sicht des Urhebers außerhalb der Grenzen des Urheberrechtes bedürfen der vorherigen schriftlichen Zustimmung des jeweiligen Urhebers i.S.d. Urhebergesetzes (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf ). Downloads und Kopien dieser Seite sind nur für den privaten und nicht kommerziellen Gebrauch erlaubt. Sind die Inhalte auf unserer Webseite nicht von uns erstellt wurden, sind die Urheberrechte Dritter zu beachten. Die Inhalte Dritter werden als solche kenntlich gemacht. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte unverzüglich entfernen."})]})]})});export{l as default}; diff --git a/assets/Map-Bdq5r1vl.js b/assets/Map-Dk16L0g4.js similarity index 98% rename from assets/Map-Bdq5r1vl.js rename to assets/Map-Dk16L0g4.js index 732c350..f62d8e4 100644 --- a/assets/Map-Bdq5r1vl.js +++ b/assets/Map-Dk16L0g4.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-gl-aXS8hSAW.js","assets/index-C4jKHMt0.js","assets/index-BZpzF2_o.css"])))=>i.map(i=>d[i]); -import{u as K,a as Q,r as i,c as J,f as Y,j as f,b as X,d as $,_ as ee,e as k,g as te,M as ne}from"./index-C4jKHMt0.js";import{T as oe,B as T,L as se,a as re,u as ae,M as ie,b as le,c as ce,d as ue,e as de,f as fe,C as me,g as he,F as ge}from"./Footer-Cdi5kbhN.js";import{I as pe,r as N,M as ve}from"./location-qV39J3P0.js";import{I as ye}from"./chunk-QINAG4RG-7Gste7mX.js";function _e(e){const{theme:t}=K(),o=Q();return i.useMemo(()=>J(t.direction,{...o,...e}),[e,t.direction,o])}var G=Y(function(t,o){const{direction:n,align:s,justify:r,wrap:a,basis:l,grow:u,shrink:c,...d}=t,_={display:"flex",flexDirection:n,alignItems:s,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:c};return f.jsx(X.div,{ref:o,__css:_,...d})});G.displayName="Flex";const xe=i.createContext(null);function be(e,t){const o=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,s=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return o===s&&n===r}function M(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;o{let s=null;"interactive"in n&&(s=Object.assign({},n),delete s.interactive);const r=t[n.ref];if(r){s=s||Object.assign({},n),delete s.ref;for(const a of Se)a in r&&(s[a]=r[a])}return s||n});return{...e,layers:o}}var B={};const V={version:8,sources:{},layers:[]},U={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},A={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Z={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Me=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],we=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class L{constructor(t,o,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=s=>{const r=this.props[Z[s.type]];r?r(s):s.type==="error"&&console.error(s.error)},this._onPointerEvent=s=>{(s.type==="mousemove"||s.type==="mouseout")&&this._updateHover(s);const r=this.props[U[s.type]];r&&(this.props.interactiveLayerIds&&s.type!=="mouseover"&&s.type!=="mouseout"&&(s.features=this._hoveredFeatures||this._queryRenderedFeatures(s.point)),r(s),delete s.features)},this._onCameraEvent=s=>{if(!this._internalUpdate){const r=this.props[A[s.type]];r&&r(s)}s.type in this._deferredEvents&&(this._deferredEvents[s.type]=!1)},this._MapClass=t,this.props=o,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const o=this.props;this.props=t;const n=this._updateSettings(t,o);n&&this._createShadowTransform(this._map);const s=this._updateSize(t),r=this._updateViewState(t,!0);this._updateStyle(t,o),this._updateStyleComponents(t,o),this._updateHandlers(t,o),(n||s||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,o){const n=L.savedMaps.pop();if(!n)return null;const s=n.map,r=s.getContainer();for(o.className=r.className;r.childNodes.length>0;)o.appendChild(r.childNodes[0]);s._container=o;const a=s._resizeObserver;a&&(a.disconnect(),a.observe(o)),n.setProps({...t,styleDiffing:!1}),s.resize();const{initialViewState:l}=t;return l&&(l.bounds?s.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):n._updateViewState(l,!1)),s.isStyleLoaded()?s.fire("load"):s.once("styledata",()=>s.fire("load")),s._update(),n}_initialize(t){const{props:o}=this,{mapStyle:n=V}=o,s={...o,...o.initialViewState,accessToken:o.mapboxAccessToken||Ee()||null,container:t,style:W(n)},r=s.initialViewState||s.viewState||s;if(Object.assign(s,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),o.gl){const d=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=d,o.gl)}const a=new this._MapClass(s);r.padding&&a.setPadding(r.padding),o.cursor&&(a.getCanvas().style.cursor=o.cursor),this._createShadowTransform(a);const l=a._render;a._render=d=>{this._inRender=!0,l.call(a,d),this._inRender=!1};const u=a._renderTaskQueue.run;a._renderTaskQueue.run=d=>{u.call(a._renderTaskQueue,d),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const c=a.fire;a.fire=this._fireEvent.bind(this,c),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),O(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const d in U)a.on(d,this._onPointerEvent);for(const d in A)a.on(d,this._onCameraEvent);for(const d in Z)a.on(d,this._onEvent);this._map=a}recycle(){const o=this.map.getContainer().querySelector("[mapboxgl-children]");o==null||o.remove(),L.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const o=Ce(t.transform);t.painter.transform=o,this._renderTransform=o}_updateSize(t){const{viewState:o}=t;if(o){const n=this._map;if(o.width!==n.transform.width||o.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,o){if(this._internalUpdate)return!1;const n=this._map,s=this._renderTransform,{zoom:r,pitch:a,bearing:l}=s,u=n.isMoving();u&&(s.cameraElevationReference="sea");const c=I(s,{...D(n.transform),...t});if(u&&(s.cameraElevationReference="ground"),c&&o){const d=this._deferredEvents;d.move=!0,d.zoom||(d.zoom=r!==s.zoom),d.rotate||(d.rotate=l!==s.bearing),d.pitch||(d.pitch=a!==s.pitch)}return u||I(n.transform,t),c}_updateSettings(t,o){const n=this._map;let s=!1;for(const r of Me)if(r in t&&!M(t[r],o[r])){s=!0;const a=n[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(n,t[r])}return s}_updateStyle(t,o){if(t.cursor!==o.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==o.mapStyle){const{mapStyle:n=V,styleDiffing:s=!0}=t,r={diff:s};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(W(n),r),!0}return!1}_updateStyleComponents(t,o){const n=this._map;let s=!1;return n.isStyleLoaded()&&("light"in t&&n.setLight&&!M(t.light,o.light)&&(s=!0,n.setLight(t.light)),"fog"in t&&n.setFog&&!M(t.fog,o.fog)&&(s=!0,n.setFog(t.fog)),"terrain"in t&&n.setTerrain&&!M(t.terrain,o.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(s=!0,n.setTerrain(t.terrain))),s}_updateHandlers(t,o){var n,s;const r=this._map;let a=!1;for(const l of we){const u=(n=t[l])!==null&&n!==void 0?n:!0,c=(s=o[l])!==null&&s!==void 0?s:!0;M(u,c)||(a=!0,u?r[l].enable(u):r[l].disable())}return a}_queryRenderedFeatures(t){const o=this._map,n=o.transform,{interactiveLayerIds:s=[]}=this.props;try{return o.transform=this._renderTransform,o.queryRenderedFeatures(t,{layers:s.filter(o.getLayer.bind(o))})}catch{return[]}finally{o.transform=n}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((o=this._hoveredFeatures)===null||o===void 0?void 0:o.length)>0,l=this._queryRenderedFeatures(t.point),u=l.length>0;!u&&a&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,u&&!a&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}_fireEvent(t,o,n){const s=this._map,r=s.transform,a=typeof o=="string"?o:o.type;return a==="move"&&this._updateViewState(this.props,!1),a in A&&(typeof o=="object"&&(o.viewState=D(r)),this._map.isMoving())?(s.transform=this._renderTransform,t.call(s,o,n),s.transform=r,s):(t.call(s,o,n),s)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const o=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{O(this._renderTransform,o),t.transform=o}}}L.savedMaps=[];function Ee(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||B.MapboxAccessToken}catch{}try{e=e||B.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Le=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Re(e){if(!e)return null;const t=e.map,o={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>{const s=t.transform;t.transform=e.transform;const r=t.project(n);return t.transform=s,r},unproject:n=>{const s=t.transform;t.transform=e.transform;const r=t.unproject(n);return t.transform=s,r},queryTerrainElevation:(n,s)=>{const r=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(n,s);return t.transform=r,a},queryRenderedFeatures:(n,s)=>{const r=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(n,s);return t.transform=r,a}};for(const n of Te(t))!(n in o)&&!Le.includes(n)&&(o[n]=t[n].bind(t));return o}function Te(e){const t=new Set;let o=e;for(;o;){for(const n of Object.getOwnPropertyNames(o))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);o=Object.getPrototypeOf(o)}return Array.from(t)}const je=typeof document<"u"?i.useLayoutEffect:i.useEffect,ke=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Pe(e,t){for(const n of ke)n in t&&(e[n]=t[n]);const{RTLTextPlugin:o="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;o&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(o,n=>{n&&console.error(n)},!0)}const P=i.createContext(null);function ze(e,t,o){const n=i.useContext(xe),[s,r]=i.useState(null),a=i.useRef(),{current:l}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const d=e.mapLib;let _=!0,v;return Promise.resolve(d||o).then(g=>{if(!_)return;if(!g)throw new Error("Invalid mapLib");const p="Map"in g?g:g.default;if(!p.Map)throw new Error("Invalid mapLib");if(Pe(p,e),!p.supported||p.supported(e))e.reuseMaps&&(v=L.reuse(e,a.current)),v||(v=new L(p.Map,e,a.current)),l.map=Re(v),l.mapLib=p,r(v),n==null||n.onMapMount(l.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:p}=e;p?p({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{_=!1,v&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),je(()=>{s&&s.setProps(e)}),i.useImperativeHandle(t,()=>l.map,[s]);const u=i.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return i.createElement("div",{id:e.id,ref:a,style:u},s&&i.createElement(P.Provider,{value:l},i.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Ae=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const o=e.style;for(const n in t){const s=t[n];Number.isFinite(s)&&!Ae.test(n)?o[n]=`${s}px`:o[n]=s}}function Fe(e,t){const{map:o,mapLib:n}=i.useContext(P),s=i.useRef({props:e});s.current.props=e;const r=i.useMemo(()=>{let S=!1;i.Children.forEach(e.children,m=>{m&&(S=!0)});const E={...e,element:S?document.createElement("div"):null},x=new n.Marker(E);return x.setLngLat([e.longitude,e.latitude]),x.getElement().addEventListener("click",m=>{var h,y;(y=(h=s.current.props).onClick)===null||y===void 0||y.call(h,{type:"click",target:x,originalEvent:m})}),x.on("dragstart",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=s.current.props).onDragStart)===null||y===void 0||y.call(h,b)}),x.on("drag",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=s.current.props).onDrag)===null||y===void 0||y.call(h,b)}),x.on("dragend",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=s.current.props).onDragEnd)===null||y===void 0||y.call(h,b)}),x},[]);i.useEffect(()=>(r.addTo(o.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:l,offset:u,style:c,draggable:d=!1,popup:_=null,rotation:v=0,rotationAlignment:g="auto",pitchAlignment:p="auto"}=e;return i.useEffect(()=>{w(r.getElement(),c)},[c]),i.useImperativeHandle(t,()=>r,[]),(r.getLngLat().lng!==a||r.getLngLat().lat!==l)&&r.setLngLat([a,l]),u&&!be(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==d&&r.setDraggable(d),r.getRotation()!==v&&r.setRotation(v),r.getRotationAlignment()!==g&&r.setRotationAlignment(g),r.getPitchAlignment()!==p&&r.setPitchAlignment(p),r.getPopup()!==_&&r.setPopup(_),$.createPortal(e.children,r.getElement())}i.memo(i.forwardRef(Fe));function H(e){return new Set(e?e.trim().split(/\s+/):[])}function Ne(e,t){const{map:o,mapLib:n}=i.useContext(P),s=i.useMemo(()=>document.createElement("div"),[]),r=i.useRef({props:e});r.current.props=e;const a=i.useMemo(()=>{const l={...e},u=new n.Popup(l);return u.setLngLat([e.longitude,e.latitude]),u.once("open",c=>{var d,_;(_=(d=r.current.props).onOpen)===null||_===void 0||_.call(d,c)}),u},[]);if(i.useEffect(()=>{const l=u=>{var c,d;(d=(c=r.current.props).onClose)===null||d===void 0||d.call(c,u)};return a.on("close",l),a.setDOMContent(s).addTo(o.getMap()),()=>{a.off("close",l),a.isOpen()&&a.remove()}},[]),i.useEffect(()=>{w(a.getElement(),e.style)},[e.style]),i.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!M(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const l=H(a.options.className),u=H(e.className);for(const c of l)u.has(c)||a.removeClassName(c);for(const c of u)l.has(c)||a.addClassName(c);a.options.className=e.className}return $.createPortal(e.children,s)}const Oe=i.memo(i.forwardRef(Ne));function j(e,t,o,n){const s=i.useContext(P),r=i.useMemo(()=>e(s),[]);return i.useEffect(()=>{const a=t,l=typeof t=="function"&&typeof o=="function"?t:null,u=typeof t=="function"?t:null,{map:c}=s;return c.hasControl(r)||(c.addControl(r,a==null?void 0:a.position),l&&l(s)),()=>{u&&u(s),c.hasControl(r)&&c.removeControl(r)}},[]),r}function De(e){const t=j(({mapLib:o})=>new o.AttributionControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}i.memo(De);function Ie(e){const t=j(({mapLib:o})=>new o.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{w(t._controlContainer,e.style)},[e.style]),null}i.memo(Ie);function We(e,t){const o=i.useRef({props:e}),n=j(({mapLib:s})=>{const r=new s.GeolocateControl(e),a=r._setupUI;return r._setupUI=l=>{r._container.hasChildNodes()||a(l)},r.on("geolocate",l=>{var u,c;(c=(u=o.current.props).onGeolocate)===null||c===void 0||c.call(u,l)}),r.on("error",l=>{var u,c;(c=(u=o.current.props).onError)===null||c===void 0||c.call(u,l)}),r.on("outofmaxbounds",l=>{var u,c;(c=(u=o.current.props).onOutOfMaxBounds)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationstart",l=>{var u,c;(c=(u=o.current.props).onTrackUserLocationStart)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationend",l=>{var u,c;(c=(u=o.current.props).onTrackUserLocationEnd)===null||c===void 0||c.call(u,l)}),r},{position:e.position});return o.current.props=e,i.useImperativeHandle(t,()=>n,[]),i.useEffect(()=>{w(n._container,e.style)},[e.style]),null}i.memo(i.forwardRef(We));function Be(e){const t=j(({mapLib:o})=>new o.NavigationControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}const Ve=i.memo(Be);function Ue(e){const t=j(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),o=i.useRef(e),n=o.current;o.current=e;const{style:s}=e;return e.maxWidth!==void 0&&e.maxWidth!==n.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==n.unit&&t.setUnit(e.unit),i.useEffect(()=>{w(t._container,s)},[s]),null}i.memo(Ue);const Ze=ee(()=>import("./maplibre-gl-aXS8hSAW.js").then(e=>e.m),__vite__mapDeps([0,1,2])),He=i.forwardRef(function(t,o){return ze(t,o,Ze)}),qe=Oe,$e=Ve;function q({lat:e,lon:t,display_name:o}){const{t:n}=k(),s=te(),r=()=>{s(`/simulation/${t}/${e}`)},[a,l]=i.useState(!0);return i.useEffect(()=>{console.log("effect changed"),l(!0)},[e,t]),f.jsx(f.Fragment,{children:a&&f.jsxs(qe,{latitude:e,longitude:t,closeOnClick:!1,onClose:()=>l(!1),children:[f.jsx(oe,{children:o}),f.jsx(T,{onClick:r,children:n("startSimulation")})]})})}function Ge({callback:e}){const[t,o]=i.useState(""),[n,s]=i.useState([]),[r,a]=i.useState(!1),[l,u]=i.useState(!1),c=i.useRef([]),d=i.useRef(),_=i.useRef(),[v,g]=i.useState(-1);window.searchFieldInput=t;const{t:p}=k();i.useEffect(()=>{const m=h=>{_.current&&!_.current.contains(h.target)&&(a(!1),g(-1))};return document.addEventListener("mousedown",m),document.addEventListener("touchstart",m),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("touchstart",m)}}),i.useEffect(()=>{const h=setTimeout(async()=>{if(t.length<3&&u(!1),!l){if(t.length>2)try{const y=t.split(" ");let b=null;for(let C of y)if(C[C.length-1]===","&&(C=C.slice(0,-1)),C.length!=5&&/^\d{1,3}[a-zA-Z]?$/.test(C)){b=C;break}const F=await(await fetch(`https://photon.komoot.io/api/?q=${encodeURIComponent(t)}&bbox=5.98865807458,47.3024876979,15.0169958839,54.983104153&limit=5&lang=de&layer=street`)).json();console.log("data",F),s(F.features.map(C=>{let z=C.properties.name;return b&&(z+=" "+b),z+=", "+C.properties.postcode+" "+C.properties.city,z}))}catch(y){console.error("Error fetching suggestions:",y)}else s([]);a(n.length>0)}},200);return()=>clearTimeout(h)},[t,l]);const S=async m=>{m.preventDefault();const h=await N(t);console.warn(h),e(h)},E=m=>{o(m),N(m).then(h=>{console.warn(h),e(h)}),s([]),u(!0)},x=m=>{m.key==="ArrowDown"?(m.preventDefault(),g(h=>hh>-1?h-1:-1)):m.key==="Enter"&&v>-1&&(m.preventDefault(),E(n[v]))};return i.useEffect(()=>{v>-1&&c.current[v]?c.current[v].focus():v===-1&&d.current.focus()},[v]),f.jsxs("form",{ref:_,onSubmit:S,style:{display:"flex",flexDirection:"column",alignItems:"stretch",padding:"5px",position:"relative"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[f.jsx(pe,{ref:d,value:t,placeholder:p("searchField.placeholder"),onChange:m=>o(m.target.value),onKeyDown:x,margin:"5px",autoComplete:"street-address"}),f.jsx(T,{margin:"5px",minWidth:"150px",type:"submit",children:p("Search")})]}),r&&f.jsx(se,{style:{paddingLeft:"0",marginTop:"0"},borderWidth:1,borderColor:"gray.200",mt:2,position:"absolute",top:"100%",left:0,right:0,zIndex:1,bg:"white",boxShadow:"md",children:n.map((m,h)=>f.jsx(re,{ref:y=>c.current[h]=y,p:2,style:{paddingLeft:"1em"},cursor:"pointer",_hover:{backgroundColor:"gray.100"},backgroundColor:v===h?"gray.100":"white",onClick:()=>E(m),onKeyDown:x,children:m},h))})]})}function R({image:e,text:t}){return f.jsxs(he,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",children:[e&&f.jsx(ye,{src:e.src,alt:e.alt,style:{maxHeight:"200px",width:"auto",margin:"20px"}}),t]})}function Ke(){const{isOpen:e,onOpen:t,onClose:o}=ae({defaultIsOpen:!0}),[n,s]=i.useState(1),{t:r,i18n:a}=k(),l=5,u=()=>{n{n>1&&s(n-1)};return f.jsxs(ie,{isOpen:e,onClose:o,size:"xl",children:[f.jsx(le,{}),f.jsxs(ce,{children:[f.jsx(ue,{children:r("WelcomeMessage.title")}),f.jsx(de,{}),f.jsxs(fe,{children:[n===1&&f.jsx(R,{image:{src:"images/WelcomeMessage1.png",alt:"Screenshot from the Search Input, where some address is written down."},text:r("WelcomeMessage.firstPage")}),n===2&&f.jsx(R,{image:{src:"images/WelcomeMessage2.png",alt:"Screenshot from a possible Simulation Result, where the solar potential of a 3D building is shown."},text:r("WelcomeMessage.secondPage")}),n===3&&f.jsx(R,{image:{src:"images/WelcomeMessage3.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.thirdPage")}),n===4&&f.jsx(R,{image:{src:"images/WelcomeMessage4.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.fourthPage")}),n===5&&f.jsx(R,{text:r("WelcomeMessage.fifthPage")})]}),f.jsxs(ve,{children:[f.jsx(T,{mr:3,onClick:c,isDisabled:n===1,children:r("previous")}),n!=5&&f.jsx(T,{mr:3,onClick:u,isDisabled:n===l,children:r("next")}),n==5&&f.jsx(T,{mr:3,onClick:o,children:r("close")})]}),f.jsx(G,{justifyContent:"center",mb:4,children:Array.from({length:l},(d,_)=>_+1).map(d=>f.jsx(me,{size:"10px",bg:n===d?"blue.500":"gray.300",m:1},d))})]})]})}function tt(){const{t:e}=k(),t=[5.98,47.3,15.1,55],[o,n]=i.useState({bounds:t}),[s,r]=i.useState([]),a=_e(),l=g=>{if(g.length==0)console.error("No search results!"),a({title:e("noSearchResults.title"),description:e("noSearchResults.description"),status:"error",duration:4e3,isClosable:!0});else{g=[g[0]];const p=g.map(x=>x.lon),S=g.map(x=>x.lat),E=[Math.min(...p),Math.min(...S),Math.max(...p),Math.max(...S)];u.current.fitBounds(E,{maxZoom:17,speed:2})}r(g.map(p=>f.jsx(q,{...p},p.key)))},u=i.useRef(),c=i.useCallback(g=>{u.current=g,g!==null&&(g.getMap().dragRotate.disable(),g.getMap().touchZoomRotate.disableRotation())},[]),[d,_]=i.useState(null),v=i.useCallback(g=>{console.log(g);const{lng:p,lat:S}=g.lngLat;_([S,p])});return f.jsxs(ne,{description:"Berechne das Potential deiner Solaranlage.",children:[f.jsx("header",{children:f.jsx("div",{className:"title",children:f.jsx(Ge,{callback:l})})}),f.jsx(Ke,{}),f.jsxs("div",{className:"content",children:[f.jsxs(He,{ref:c,...o,maxZoom:19,style:{width:"100%",height:"100%"},mapStyle:"https://sgx.geodatenzentrum.de/gdz_basemapde_vektor/styles/bm_web_col.json",onMove:g=>n(g.viewState),onClick:v,attributionControl:!1,maxBounds:[-10,35,30,65],children:[f.jsx(f.Fragment,{children:s}),d&&f.jsx(q,{lat:d[0],lon:d[1],display_name:e("map.userSelection")},"userSelectiion"),f.jsx($e,{position:"bottom-right",showCompass:!1})]}),f.jsx(ge,{federalState:"",frontendState:"Map"})]})]})}export{tt as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-gl-vlagFC0R.js","assets/index-oAnJD5lr.js","assets/index-BZpzF2_o.css"])))=>i.map(i=>d[i]); +import{u as K,a as Q,r as i,c as J,f as Y,j as f,b as X,d as $,_ as ee,e as k,g as te,M as ne}from"./index-oAnJD5lr.js";import{T as oe,B as T,L as se,a as re,u as ae,M as ie,b as le,c as ce,d as ue,e as de,f as fe,C as me,g as he,F as ge}from"./Footer-CN0UQ_Me.js";import{I as pe,r as N,M as ve}from"./location-BLLHg7ZW.js";import{I as ye}from"./chunk-QINAG4RG-B3RP3bKW.js";function _e(e){const{theme:t}=K(),o=Q();return i.useMemo(()=>J(t.direction,{...o,...e}),[e,t.direction,o])}var G=Y(function(t,o){const{direction:n,align:s,justify:r,wrap:a,basis:l,grow:u,shrink:c,...d}=t,_={display:"flex",flexDirection:n,alignItems:s,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:c};return f.jsx(X.div,{ref:o,__css:_,...d})});G.displayName="Flex";const xe=i.createContext(null);function be(e,t){const o=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,s=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return o===s&&n===r}function M(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;o{let s=null;"interactive"in n&&(s=Object.assign({},n),delete s.interactive);const r=t[n.ref];if(r){s=s||Object.assign({},n),delete s.ref;for(const a of Se)a in r&&(s[a]=r[a])}return s||n});return{...e,layers:o}}var B={};const V={version:8,sources:{},layers:[]},U={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},A={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Z={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Me=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],we=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class L{constructor(t,o,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=s=>{const r=this.props[Z[s.type]];r?r(s):s.type==="error"&&console.error(s.error)},this._onPointerEvent=s=>{(s.type==="mousemove"||s.type==="mouseout")&&this._updateHover(s);const r=this.props[U[s.type]];r&&(this.props.interactiveLayerIds&&s.type!=="mouseover"&&s.type!=="mouseout"&&(s.features=this._hoveredFeatures||this._queryRenderedFeatures(s.point)),r(s),delete s.features)},this._onCameraEvent=s=>{if(!this._internalUpdate){const r=this.props[A[s.type]];r&&r(s)}s.type in this._deferredEvents&&(this._deferredEvents[s.type]=!1)},this._MapClass=t,this.props=o,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const o=this.props;this.props=t;const n=this._updateSettings(t,o);n&&this._createShadowTransform(this._map);const s=this._updateSize(t),r=this._updateViewState(t,!0);this._updateStyle(t,o),this._updateStyleComponents(t,o),this._updateHandlers(t,o),(n||s||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,o){const n=L.savedMaps.pop();if(!n)return null;const s=n.map,r=s.getContainer();for(o.className=r.className;r.childNodes.length>0;)o.appendChild(r.childNodes[0]);s._container=o;const a=s._resizeObserver;a&&(a.disconnect(),a.observe(o)),n.setProps({...t,styleDiffing:!1}),s.resize();const{initialViewState:l}=t;return l&&(l.bounds?s.fitBounds(l.bounds,{...l.fitBoundsOptions,duration:0}):n._updateViewState(l,!1)),s.isStyleLoaded()?s.fire("load"):s.once("styledata",()=>s.fire("load")),s._update(),n}_initialize(t){const{props:o}=this,{mapStyle:n=V}=o,s={...o,...o.initialViewState,accessToken:o.mapboxAccessToken||Ee()||null,container:t,style:W(n)},r=s.initialViewState||s.viewState||s;if(Object.assign(s,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),o.gl){const d=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=d,o.gl)}const a=new this._MapClass(s);r.padding&&a.setPadding(r.padding),o.cursor&&(a.getCanvas().style.cursor=o.cursor),this._createShadowTransform(a);const l=a._render;a._render=d=>{this._inRender=!0,l.call(a,d),this._inRender=!1};const u=a._renderTaskQueue.run;a._renderTaskQueue.run=d=>{u.call(a._renderTaskQueue,d),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const c=a.fire;a.fire=this._fireEvent.bind(this,c),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),O(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const d in U)a.on(d,this._onPointerEvent);for(const d in A)a.on(d,this._onCameraEvent);for(const d in Z)a.on(d,this._onEvent);this._map=a}recycle(){const o=this.map.getContainer().querySelector("[mapboxgl-children]");o==null||o.remove(),L.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const o=Ce(t.transform);t.painter.transform=o,this._renderTransform=o}_updateSize(t){const{viewState:o}=t;if(o){const n=this._map;if(o.width!==n.transform.width||o.height!==n.transform.height)return n.resize(),!0}return!1}_updateViewState(t,o){if(this._internalUpdate)return!1;const n=this._map,s=this._renderTransform,{zoom:r,pitch:a,bearing:l}=s,u=n.isMoving();u&&(s.cameraElevationReference="sea");const c=I(s,{...D(n.transform),...t});if(u&&(s.cameraElevationReference="ground"),c&&o){const d=this._deferredEvents;d.move=!0,d.zoom||(d.zoom=r!==s.zoom),d.rotate||(d.rotate=l!==s.bearing),d.pitch||(d.pitch=a!==s.pitch)}return u||I(n.transform,t),c}_updateSettings(t,o){const n=this._map;let s=!1;for(const r of Me)if(r in t&&!M(t[r],o[r])){s=!0;const a=n[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(n,t[r])}return s}_updateStyle(t,o){if(t.cursor!==o.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==o.mapStyle){const{mapStyle:n=V,styleDiffing:s=!0}=t,r={diff:s};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(W(n),r),!0}return!1}_updateStyleComponents(t,o){const n=this._map;let s=!1;return n.isStyleLoaded()&&("light"in t&&n.setLight&&!M(t.light,o.light)&&(s=!0,n.setLight(t.light)),"fog"in t&&n.setFog&&!M(t.fog,o.fog)&&(s=!0,n.setFog(t.fog)),"terrain"in t&&n.setTerrain&&!M(t.terrain,o.terrain)&&(!t.terrain||n.getSource(t.terrain.source))&&(s=!0,n.setTerrain(t.terrain))),s}_updateHandlers(t,o){var n,s;const r=this._map;let a=!1;for(const l of we){const u=(n=t[l])!==null&&n!==void 0?n:!0,c=(s=o[l])!==null&&s!==void 0?s:!0;M(u,c)||(a=!0,u?r[l].enable(u):r[l].disable())}return a}_queryRenderedFeatures(t){const o=this._map,n=o.transform,{interactiveLayerIds:s=[]}=this.props;try{return o.transform=this._renderTransform,o.queryRenderedFeatures(t,{layers:s.filter(o.getLayer.bind(o))})}catch{return[]}finally{o.transform=n}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((o=this._hoveredFeatures)===null||o===void 0?void 0:o.length)>0,l=this._queryRenderedFeatures(t.point),u=l.length>0;!u&&a&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=l,u&&!a&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}_fireEvent(t,o,n){const s=this._map,r=s.transform,a=typeof o=="string"?o:o.type;return a==="move"&&this._updateViewState(this.props,!1),a in A&&(typeof o=="object"&&(o.viewState=D(r)),this._map.isMoving())?(s.transform=this._renderTransform,t.call(s,o,n),s.transform=r,s):(t.call(s,o,n),s)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const n in this._deferredEvents)this._deferredEvents[n]&&t.fire(n);this._internalUpdate=!1;const o=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{O(this._renderTransform,o),t.transform=o}}}L.savedMaps=[];function Ee(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||B.MapboxAccessToken}catch{}try{e=e||B.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const Le=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Re(e){if(!e)return null;const t=e.map,o={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>{const s=t.transform;t.transform=e.transform;const r=t.project(n);return t.transform=s,r},unproject:n=>{const s=t.transform;t.transform=e.transform;const r=t.unproject(n);return t.transform=s,r},queryTerrainElevation:(n,s)=>{const r=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(n,s);return t.transform=r,a},queryRenderedFeatures:(n,s)=>{const r=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(n,s);return t.transform=r,a}};for(const n of Te(t))!(n in o)&&!Le.includes(n)&&(o[n]=t[n].bind(t));return o}function Te(e){const t=new Set;let o=e;for(;o;){for(const n of Object.getOwnPropertyNames(o))n[0]!=="_"&&typeof e[n]=="function"&&n!=="fire"&&n!=="setEventedParent"&&t.add(n);o=Object.getPrototypeOf(o)}return Array.from(t)}const je=typeof document<"u"?i.useLayoutEffect:i.useEffect,ke=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Pe(e,t){for(const n of ke)n in t&&(e[n]=t[n]);const{RTLTextPlugin:o="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;o&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(o,n=>{n&&console.error(n)},!0)}const P=i.createContext(null);function ze(e,t,o){const n=i.useContext(xe),[s,r]=i.useState(null),a=i.useRef(),{current:l}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const d=e.mapLib;let _=!0,v;return Promise.resolve(d||o).then(g=>{if(!_)return;if(!g)throw new Error("Invalid mapLib");const p="Map"in g?g:g.default;if(!p.Map)throw new Error("Invalid mapLib");if(Pe(p,e),!p.supported||p.supported(e))e.reuseMaps&&(v=L.reuse(e,a.current)),v||(v=new L(p.Map,e,a.current)),l.map=Re(v),l.mapLib=p,r(v),n==null||n.onMapMount(l.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(g=>{const{onError:p}=e;p?p({type:"error",target:null,originalEvent:null,error:g}):console.error(g)}),()=>{_=!1,v&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?v.recycle():v.destroy())}},[]),je(()=>{s&&s.setProps(e)}),i.useImperativeHandle(t,()=>l.map,[s]);const u=i.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return i.createElement("div",{id:e.id,ref:a,style:u},s&&i.createElement(P.Provider,{value:l},i.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const Ae=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const o=e.style;for(const n in t){const s=t[n];Number.isFinite(s)&&!Ae.test(n)?o[n]=`${s}px`:o[n]=s}}function Fe(e,t){const{map:o,mapLib:n}=i.useContext(P),s=i.useRef({props:e});s.current.props=e;const r=i.useMemo(()=>{let S=!1;i.Children.forEach(e.children,m=>{m&&(S=!0)});const E={...e,element:S?document.createElement("div"):null},x=new n.Marker(E);return x.setLngLat([e.longitude,e.latitude]),x.getElement().addEventListener("click",m=>{var h,y;(y=(h=s.current.props).onClick)===null||y===void 0||y.call(h,{type:"click",target:x,originalEvent:m})}),x.on("dragstart",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=s.current.props).onDragStart)===null||y===void 0||y.call(h,b)}),x.on("drag",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=s.current.props).onDrag)===null||y===void 0||y.call(h,b)}),x.on("dragend",m=>{var h,y;const b=m;b.lngLat=r.getLngLat(),(y=(h=s.current.props).onDragEnd)===null||y===void 0||y.call(h,b)}),x},[]);i.useEffect(()=>(r.addTo(o.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:l,offset:u,style:c,draggable:d=!1,popup:_=null,rotation:v=0,rotationAlignment:g="auto",pitchAlignment:p="auto"}=e;return i.useEffect(()=>{w(r.getElement(),c)},[c]),i.useImperativeHandle(t,()=>r,[]),(r.getLngLat().lng!==a||r.getLngLat().lat!==l)&&r.setLngLat([a,l]),u&&!be(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==d&&r.setDraggable(d),r.getRotation()!==v&&r.setRotation(v),r.getRotationAlignment()!==g&&r.setRotationAlignment(g),r.getPitchAlignment()!==p&&r.setPitchAlignment(p),r.getPopup()!==_&&r.setPopup(_),$.createPortal(e.children,r.getElement())}i.memo(i.forwardRef(Fe));function H(e){return new Set(e?e.trim().split(/\s+/):[])}function Ne(e,t){const{map:o,mapLib:n}=i.useContext(P),s=i.useMemo(()=>document.createElement("div"),[]),r=i.useRef({props:e});r.current.props=e;const a=i.useMemo(()=>{const l={...e},u=new n.Popup(l);return u.setLngLat([e.longitude,e.latitude]),u.once("open",c=>{var d,_;(_=(d=r.current.props).onOpen)===null||_===void 0||_.call(d,c)}),u},[]);if(i.useEffect(()=>{const l=u=>{var c,d;(d=(c=r.current.props).onClose)===null||d===void 0||d.call(c,u)};return a.on("close",l),a.setDOMContent(s).addTo(o.getMap()),()=>{a.off("close",l),a.isOpen()&&a.remove()}},[]),i.useEffect(()=>{w(a.getElement(),e.style)},[e.style]),i.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!M(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const l=H(a.options.className),u=H(e.className);for(const c of l)u.has(c)||a.removeClassName(c);for(const c of u)l.has(c)||a.addClassName(c);a.options.className=e.className}return $.createPortal(e.children,s)}const Oe=i.memo(i.forwardRef(Ne));function j(e,t,o,n){const s=i.useContext(P),r=i.useMemo(()=>e(s),[]);return i.useEffect(()=>{const a=t,l=typeof t=="function"&&typeof o=="function"?t:null,u=typeof t=="function"?t:null,{map:c}=s;return c.hasControl(r)||(c.addControl(r,a==null?void 0:a.position),l&&l(s)),()=>{u&&u(s),c.hasControl(r)&&c.removeControl(r)}},[]),r}function De(e){const t=j(({mapLib:o})=>new o.AttributionControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}i.memo(De);function Ie(e){const t=j(({mapLib:o})=>new o.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{w(t._controlContainer,e.style)},[e.style]),null}i.memo(Ie);function We(e,t){const o=i.useRef({props:e}),n=j(({mapLib:s})=>{const r=new s.GeolocateControl(e),a=r._setupUI;return r._setupUI=l=>{r._container.hasChildNodes()||a(l)},r.on("geolocate",l=>{var u,c;(c=(u=o.current.props).onGeolocate)===null||c===void 0||c.call(u,l)}),r.on("error",l=>{var u,c;(c=(u=o.current.props).onError)===null||c===void 0||c.call(u,l)}),r.on("outofmaxbounds",l=>{var u,c;(c=(u=o.current.props).onOutOfMaxBounds)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationstart",l=>{var u,c;(c=(u=o.current.props).onTrackUserLocationStart)===null||c===void 0||c.call(u,l)}),r.on("trackuserlocationend",l=>{var u,c;(c=(u=o.current.props).onTrackUserLocationEnd)===null||c===void 0||c.call(u,l)}),r},{position:e.position});return o.current.props=e,i.useImperativeHandle(t,()=>n,[]),i.useEffect(()=>{w(n._container,e.style)},[e.style]),null}i.memo(i.forwardRef(We));function Be(e){const t=j(({mapLib:o})=>new o.NavigationControl(e),{position:e.position});return i.useEffect(()=>{w(t._container,e.style)},[e.style]),null}const Ve=i.memo(Be);function Ue(e){const t=j(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),o=i.useRef(e),n=o.current;o.current=e;const{style:s}=e;return e.maxWidth!==void 0&&e.maxWidth!==n.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==n.unit&&t.setUnit(e.unit),i.useEffect(()=>{w(t._container,s)},[s]),null}i.memo(Ue);const Ze=ee(()=>import("./maplibre-gl-vlagFC0R.js").then(e=>e.m),__vite__mapDeps([0,1,2])),He=i.forwardRef(function(t,o){return ze(t,o,Ze)}),qe=Oe,$e=Ve;function q({lat:e,lon:t,display_name:o}){const{t:n}=k(),s=te(),r=()=>{s(`/simulation/${t}/${e}`)},[a,l]=i.useState(!0);return i.useEffect(()=>{console.log("effect changed"),l(!0)},[e,t]),f.jsx(f.Fragment,{children:a&&f.jsxs(qe,{latitude:e,longitude:t,closeOnClick:!1,onClose:()=>l(!1),children:[f.jsx(oe,{children:o}),f.jsx(T,{onClick:r,children:n("startSimulation")})]})})}function Ge({callback:e}){const[t,o]=i.useState(""),[n,s]=i.useState([]),[r,a]=i.useState(!1),[l,u]=i.useState(!1),c=i.useRef([]),d=i.useRef(),_=i.useRef(),[v,g]=i.useState(-1);window.searchFieldInput=t;const{t:p}=k();i.useEffect(()=>{const m=h=>{_.current&&!_.current.contains(h.target)&&(a(!1),g(-1))};return document.addEventListener("mousedown",m),document.addEventListener("touchstart",m),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("touchstart",m)}}),i.useEffect(()=>{const h=setTimeout(async()=>{if(t.length<3&&u(!1),!l){if(t.length>2)try{const y=t.split(" ");let b=null;for(let C of y)if(C[C.length-1]===","&&(C=C.slice(0,-1)),C.length!=5&&/^\d{1,3}[a-zA-Z]?$/.test(C)){b=C;break}const F=await(await fetch(`https://photon.komoot.io/api/?q=${encodeURIComponent(t)}&bbox=5.98865807458,47.3024876979,15.0169958839,54.983104153&limit=5&lang=de&layer=street`)).json();console.log("data",F),s(F.features.map(C=>{let z=C.properties.name;return b&&(z+=" "+b),z+=", "+C.properties.postcode+" "+C.properties.city,z}))}catch(y){console.error("Error fetching suggestions:",y)}else s([]);a(n.length>0)}},200);return()=>clearTimeout(h)},[t,l]);const S=async m=>{m.preventDefault();const h=await N(t);console.warn(h),e(h)},E=m=>{o(m),N(m).then(h=>{console.warn(h),e(h)}),s([]),u(!0)},x=m=>{m.key==="ArrowDown"?(m.preventDefault(),g(h=>hh>-1?h-1:-1)):m.key==="Enter"&&v>-1&&(m.preventDefault(),E(n[v]))};return i.useEffect(()=>{v>-1&&c.current[v]?c.current[v].focus():v===-1&&d.current.focus()},[v]),f.jsxs("form",{ref:_,onSubmit:S,style:{display:"flex",flexDirection:"column",alignItems:"stretch",padding:"5px",position:"relative"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[f.jsx(pe,{ref:d,value:t,placeholder:p("searchField.placeholder"),onChange:m=>o(m.target.value),onKeyDown:x,margin:"5px",autoComplete:"street-address"}),f.jsx(T,{margin:"5px",minWidth:"150px",type:"submit",children:p("Search")})]}),r&&f.jsx(se,{style:{paddingLeft:"0",marginTop:"0"},borderWidth:1,borderColor:"gray.200",mt:2,position:"absolute",top:"100%",left:0,right:0,zIndex:1,bg:"white",boxShadow:"md",children:n.map((m,h)=>f.jsx(re,{ref:y=>c.current[h]=y,p:2,style:{paddingLeft:"1em"},cursor:"pointer",_hover:{backgroundColor:"gray.100"},backgroundColor:v===h?"gray.100":"white",onClick:()=>E(m),onKeyDown:x,children:m},h))})]})}function R({image:e,text:t}){return f.jsxs(he,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",children:[e&&f.jsx(ye,{src:e.src,alt:e.alt,style:{maxHeight:"200px",width:"auto",margin:"20px"}}),t]})}function Ke(){const{isOpen:e,onOpen:t,onClose:o}=ae({defaultIsOpen:!0}),[n,s]=i.useState(1),{t:r,i18n:a}=k(),l=5,u=()=>{n{n>1&&s(n-1)};return f.jsxs(ie,{isOpen:e,onClose:o,size:"xl",children:[f.jsx(le,{}),f.jsxs(ce,{children:[f.jsx(ue,{children:r("WelcomeMessage.title")}),f.jsx(de,{}),f.jsxs(fe,{children:[n===1&&f.jsx(R,{image:{src:"images/WelcomeMessage1.png",alt:"Screenshot from the Search Input, where some address is written down."},text:r("WelcomeMessage.firstPage")}),n===2&&f.jsx(R,{image:{src:"images/WelcomeMessage2.png",alt:"Screenshot from a possible Simulation Result, where the solar potential of a 3D building is shown."},text:r("WelcomeMessage.secondPage")}),n===3&&f.jsx(R,{image:{src:"images/WelcomeMessage3.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.thirdPage")}),n===4&&f.jsx(R,{image:{src:"images/WelcomeMessage4.png",alt:"Screenshot from a possible Simulation Result, where a PV system was created and the annual result was calculated."},text:r("WelcomeMessage.fourthPage")}),n===5&&f.jsx(R,{text:r("WelcomeMessage.fifthPage")})]}),f.jsxs(ve,{children:[f.jsx(T,{mr:3,onClick:c,isDisabled:n===1,children:r("previous")}),n!=5&&f.jsx(T,{mr:3,onClick:u,isDisabled:n===l,children:r("next")}),n==5&&f.jsx(T,{mr:3,onClick:o,children:r("close")})]}),f.jsx(G,{justifyContent:"center",mb:4,children:Array.from({length:l},(d,_)=>_+1).map(d=>f.jsx(me,{size:"10px",bg:n===d?"blue.500":"gray.300",m:1},d))})]})]})}function tt(){const{t:e}=k(),t=[5.98,47.3,15.1,55],[o,n]=i.useState({bounds:t}),[s,r]=i.useState([]),a=_e(),l=g=>{if(g.length==0)console.error("No search results!"),a({title:e("noSearchResults.title"),description:e("noSearchResults.description"),status:"error",duration:4e3,isClosable:!0});else{g=[g[0]];const p=g.map(x=>x.lon),S=g.map(x=>x.lat),E=[Math.min(...p),Math.min(...S),Math.max(...p),Math.max(...S)];u.current.fitBounds(E,{maxZoom:17,speed:2})}r(g.map(p=>f.jsx(q,{...p},p.key)))},u=i.useRef(),c=i.useCallback(g=>{u.current=g,g!==null&&(g.getMap().dragRotate.disable(),g.getMap().touchZoomRotate.disableRotation())},[]),[d,_]=i.useState(null),v=i.useCallback(g=>{console.log(g);const{lng:p,lat:S}=g.lngLat;_([S,p])});return f.jsxs(ne,{description:"Berechne das Potential deiner Solaranlage.",children:[f.jsx("header",{children:f.jsx("div",{className:"title",children:f.jsx(Ge,{callback:l})})}),f.jsx(Ke,{}),f.jsxs("div",{className:"content",children:[f.jsxs(He,{ref:c,...o,maxZoom:19,style:{width:"100%",height:"100%"},mapStyle:"https://sgx.geodatenzentrum.de/gdz_basemapde_vektor/styles/bm_web_col.json",onMove:g=>n(g.viewState),onClick:v,attributionControl:!1,maxBounds:[-10,35,30,65],children:[f.jsx(f.Fragment,{children:s}),d&&f.jsx(q,{lat:d[0],lon:d[1],display_name:e("map.userSelection")},"userSelectiion"),f.jsx($e,{position:"bottom-right",showCompass:!1})]}),f.jsx(ge,{federalState:"",frontendState:"Map"})]})]})}export{tt as default}; diff --git a/assets/NotFound-DicV6AYF.js b/assets/NotFound-VorW0SAJ.js similarity index 84% rename from assets/NotFound-DicV6AYF.js rename to assets/NotFound-VorW0SAJ.js index fe6b47f..2d0c4e7 100644 --- a/assets/NotFound-DicV6AYF.js +++ b/assets/NotFound-VorW0SAJ.js @@ -1 +1 @@ -import{j as e,H as n,E as o,L as t}from"./index-C4jKHMt0.js";const r=()=>e.jsx(n,{children:e.jsxs("div",{className:"not-found",children:[e.jsx(o,{title:"404 Not Found",children:e.jsx("meta",{name:"description",content:"The content you are looking for cannot be found."})}),e.jsx("h1",{children:"Page Not Found"}),e.jsxs("p",{children:["Return ",e.jsx(t,{to:"/",children:"home"}),"."]})]})});export{r as default}; +import{j as e,H as n,E as o,L as t}from"./index-oAnJD5lr.js";const r=()=>e.jsx(n,{children:e.jsxs("div",{className:"not-found",children:[e.jsx(o,{title:"404 Not Found",children:e.jsx("meta",{name:"description",content:"The content you are looking for cannot be found."})}),e.jsx("h1",{children:"Page Not Found"}),e.jsxs("p",{children:["Return ",e.jsx(t,{to:"/",children:"home"}),"."]})]})});export{r as default}; diff --git a/assets/Simulation-C3BVol_5.js b/assets/Simulation-C4ya-gKI.js similarity index 89% rename from assets/Simulation-C3BVol_5.js rename to assets/Simulation-C4ya-gKI.js index fabdceb..bf63ceb 100644 --- a/assets/Simulation-C3BVol_5.js +++ b/assets/Simulation-C4ya-gKI.js @@ -1,9 +1,9 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/raw-Dt1HMqYc.js","assets/basedecoder-DvumDe3Y.js","assets/lzw-DpvbRwG5.js","assets/jpeg-CdeCw_eT.js","assets/deflate-C_ni00X0.js","assets/index-C4jKHMt0.js","assets/index-BZpzF2_o.css","assets/chunk-7OLJDQMT-DRboIhh9.js","assets/Footer-Cdi5kbhN.js","assets/location-qV39J3P0.js","assets/chunk-ZHMYA64R-FVqXPkJW.js","assets/packbits-DQnG8s9w.js","assets/lerc-D-WbCUY3.js","assets/webimage-BcnuJlio.js"])))=>i.map(i=>d[i]); -var JP=Object.defineProperty;var QP=(n,t,e)=>t in n?JP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var as=(n,t,e)=>QP(n,typeof t!="symbol"?t+"":t,e);import{h as yr,r as Q,w as tI,j as X,A as Ev,m as Av,i as rh,f as br,k as xT,o as _f,b as _n,l as Oy,n as _T,p as sn,q as li,s as L0,t as Tv,v as D0,x as Cv,y as eI,P as nI,e as sh,z as vf,_ as ll,R as N0,I as iI,B as rI,C as sI,M as aI}from"./index-C4jKHMt0.js";import{C as oI,a as lI,H as cI,b as hI}from"./chunk-7OLJDQMT-DRboIhh9.js";import{w as km,h as lu,i as R_,m as Fa,j as uI,M as Rv,k as fI,l as dI,n as pI,o as mI,u as zm,B as $s,b as Pv,c as vT,d as Iv,e as Lv,f as Dv,T as Lo,g as zu,U as MT,a as No,F as gI}from"./Footer-Cdi5kbhN.js";import{u as wT,a as yI,b as xI,c as _I,p as vI,d as Bm,F as Fy,I as Uy,M as MI,e as wI,x as bI}from"./location-qV39J3P0.js";import{S as SI}from"./chunk-ZHMYA64R-FVqXPkJW.js";const bT=1/60*1e3,EI=typeof performance<"u"?()=>performance.now():()=>Date.now(),ST=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(EI()),bT);function AI(n){let t=[],e=[],i=0,r=!1,s=!1;const a=new WeakSet,o={schedule:(l,c=!1,h=!1)=>{const u=h&&r,p=u?t:e;return c&&a.add(l),p.indexOf(l)===-1&&(p.push(l),u&&r&&(i=t.length)),l},cancel:l=>{const c=e.indexOf(l);c!==-1&&e.splice(c,1),a.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[t,e]=[e,t],e.length=0,i=t.length,i)for(let c=0;c(n[t]=AI(()=>Bu=!0),n),{}),CI=Mf.reduce((n,t)=>{const e=O0[t];return n[t]=(i,r=!1,s=!1)=>(Bu||II(),e.schedule(i,r,s)),n},{}),RI=Mf.reduce((n,t)=>(n[t]=O0[t].cancel,n),{});Mf.reduce((n,t)=>(n[t]=()=>O0[t].process(Rc),n),{});const PI=n=>O0[n].process(Rc),ET=n=>{Bu=!1,Rc.delta=P_?bT:Math.max(Math.min(n-Rc.timestamp,TI),1),Rc.timestamp=n,I_=!0,Mf.forEach(PI),I_=!1,Bu&&(P_=!1,ST(ET))},II=()=>{Bu=!0,P_=!0,I_||ST(ET)},Yw=()=>Rc;function LI(n){const{value:t,defaultValue:e,onChange:i,shouldUpdate:r=(p,m)=>p!==m}=n,s=yr(i),a=yr(r),[o,l]=Q.useState(e),c=t!==void 0,h=c?t:o,u=yr(p=>{const g=typeof p=="function"?p(h):p;a(h,g)&&(c||l(g),s(g))},[c,s,h,a]);return[h,u]}var DI=n=>n!=null&&parseInt(n.toString(),10)>0,Zw={exit:{height:{duration:.2,ease:lu.ease},opacity:{duration:.3,ease:lu.ease}},enter:{height:{duration:.3,ease:lu.ease},opacity:{duration:.4,ease:lu.ease}}},NI={exit:({animateOpacity:n,startingHeight:t,transition:e,transitionEnd:i,delay:r})=>{var s;return{...n&&{opacity:DI(t)?1:0},height:t,transitionEnd:i==null?void 0:i.exit,transition:(s=e==null?void 0:e.exit)!=null?s:km.exit(Zw.exit,r)}},enter:({animateOpacity:n,endingHeight:t,transition:e,transitionEnd:i,delay:r})=>{var s;return{...n&&{opacity:1},height:t,transitionEnd:i==null?void 0:i.enter,transition:(s=e==null?void 0:e.enter)!=null?s:km.enter(Zw.enter,r)}}},AT=Q.forwardRef((n,t)=>{const{in:e,unmountOnExit:i,animateOpacity:r=!0,startingHeight:s=0,endingHeight:a="auto",style:o,className:l,transition:c,transitionEnd:h,...u}=n,[p,m]=Q.useState(!1);Q.useEffect(()=>{const M=setTimeout(()=>{m(!0)});return()=>clearTimeout(M)},[]),tI({condition:Number(s)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const g=parseFloat(s.toString())>0,_={startingHeight:s,endingHeight:a,animateOpacity:r,transition:p?c:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:i?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:g?"block":"none"}}},y=i?e:!0,x=e||i?"enter":"exit";return X.jsx(Ev,{initial:!1,custom:_,children:y&&X.jsx(Av.div,{ref:t,...u,className:rh("chakra-collapse",l),style:{overflow:"hidden",display:"block",...o},custom:_,variants:NI,initial:i?"exit":!1,animate:x,exit:"exit"})})});AT.displayName="Collapse";var Kw={exit:{duration:.15,ease:lu.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},OI={exit:({direction:n,transition:t,transitionEnd:e,delay:i})=>{var r;const{exit:s}=R_({direction:n});return{...s,transition:(r=t==null?void 0:t.exit)!=null?r:km.exit(Kw.exit,i),transitionEnd:e==null?void 0:e.exit}},enter:({direction:n,transitionEnd:t,transition:e,delay:i})=>{var r;const{enter:s}=R_({direction:n});return{...s,transition:(r=e==null?void 0:e.enter)!=null?r:km.enter(Kw.enter,i),transitionEnd:t==null?void 0:t.enter}}},TT=Q.forwardRef(function(t,e){const{direction:i="right",style:r,unmountOnExit:s,in:a,className:o,transition:l,transitionEnd:c,delay:h,motionProps:u,...p}=t,m=R_({direction:i}),g=Object.assign({position:"fixed"},m.position,r),_=s?a&&s:!0,y=a||s?"enter":"exit",x={transitionEnd:c,transition:l,direction:i,delay:h};return X.jsx(Ev,{custom:x,children:_&&X.jsx(Av.div,{...p,ref:e,initial:"exit",className:rh("chakra-slide",o),animate:y,exit:"exit",custom:x,variants:OI,style:g,...u})})});TT.displayName="Slide";var yu=br(function(t,e){var i;const r=xT("FormLabel",t),s=_f(t),{className:a,children:o,requiredIndicator:l=X.jsx(CT,{}),optionalIndicator:c=null,...h}=s,u=wT(),p=(i=u==null?void 0:u.getLabelProps(h,e))!=null?i:{ref:e,...h};return X.jsxs(_n.label,{...p,className:rh("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...r},children:[o,u!=null&&u.isRequired?l:c]})});yu.displayName="FormLabel";var CT=br(function(t,e){const i=wT(),r=yI();if(!(i!=null&&i.isRequired))return null;const s=rh("chakra-form__required-indicator",t.className);return X.jsx(_n.span,{...i==null?void 0:i.getRequiredIndicatorProps(t,e),__css:r.requiredIndicator,className:s})});CT.displayName="RequiredIndicator";var FI={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},UI=()=>typeof document<"u",Jw=!1,wf=null,Yo=!1,L_=!1,D_=new Set;function Nv(n,t){D_.forEach(e=>e(n,t))}var kI=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function zI(n){return!(n.metaKey||!kI&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function Qw(n){Yo=!0,zI(n)&&(wf="keyboard",Nv("keyboard",n))}function Rl(n){if(wf="pointer",n.type==="mousedown"||n.type==="pointerdown"){Yo=!0;const t=n.composedPath?n.composedPath()[0]:n.target;let e=!1;try{e=t.matches(":focus-visible")}catch{}if(e)return;Nv("pointer",n)}}function BI(n){return n.mozInputSource===0&&n.isTrusted?!0:n.detail===0&&!n.pointerType}function HI(n){BI(n)&&(Yo=!0,wf="virtual")}function GI(n){n.target===window||n.target===document||(!Yo&&!L_&&(wf="virtual",Nv("virtual",n)),Yo=!1,L_=!1)}function VI(){Yo=!1,L_=!0}function tb(){return wf!=="pointer"}function WI(){if(!UI()||Jw)return;const{focus:n}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){Yo=!0,n.apply(this,e)},document.addEventListener("keydown",Qw,!0),document.addEventListener("keyup",Qw,!0),document.addEventListener("click",HI,!0),window.addEventListener("focus",GI,!0),window.addEventListener("blur",VI,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Rl,!0),document.addEventListener("pointermove",Rl,!0),document.addEventListener("pointerup",Rl,!0)):(document.addEventListener("mousedown",Rl,!0),document.addEventListener("mousemove",Rl,!0),document.addEventListener("mouseup",Rl,!0)),Jw=!0}function jI(n){WI(),n(tb());const t=()=>n(tb());return D_.add(t),()=>{D_.delete(t)}}function XI(n,t=[]){const e=Object.assign({},n);for(const i of t)i in e&&delete e[i];return e}function qI(n={}){const t=xI(n),{isDisabled:e,isReadOnly:i,isRequired:r,isInvalid:s,id:a,onBlur:o,onFocus:l,"aria-describedby":c}=t,{defaultChecked:h,isChecked:u,isFocusable:p,onChange:m,isIndeterminate:g,name:_,value:y,tabIndex:x=void 0,"aria-label":M,"aria-labelledby":b,"aria-invalid":S,...R}=n,T=XI(R,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=yr(m),N=yr(o),P=yr(l),[E,L]=Q.useState(!1),[B,V]=Q.useState(!1),[j,Y]=Q.useState(!1),[q,at]=Q.useState(!1);Q.useEffect(()=>jI(L),[]);const G=Q.useRef(null),[nt,K]=Q.useState(!0),[$,ht]=Q.useState(!!h),vt=u!==void 0,Z=vt?u:$,rt=Q.useCallback(mt=>{if(i||e){mt.preventDefault();return}vt||ht(Z?mt.target.checked:g?!0:mt.target.checked),C==null||C(mt)},[i,e,Z,vt,g,C]);Oy(()=>{G.current&&(G.current.indeterminate=!!g)},[g]),_T(()=>{e&&V(!1)},[e,V]),Oy(()=>{const mt=G.current;if(!(mt!=null&&mt.form))return;const dt=()=>{ht(!!h)};return mt.form.addEventListener("reset",dt),()=>{var kt;return(kt=mt.form)==null?void 0:kt.removeEventListener("reset",dt)}},[]);const St=e&&!p,_t=Q.useCallback(mt=>{mt.key===" "&&at(!0)},[at]),Ot=Q.useCallback(mt=>{mt.key===" "&&at(!1)},[at]);Oy(()=>{if(!G.current)return;G.current.checked!==Z&&ht(G.current.checked)},[G.current]);const Xt=Q.useCallback((mt={},dt=null)=>{const kt=Rt=>{B&&Rt.preventDefault(),at(!0)};return{...mt,ref:dt,"data-active":sn(q),"data-hover":sn(j),"data-checked":sn(Z),"data-focus":sn(B),"data-focus-visible":sn(B&&E),"data-indeterminate":sn(g),"data-disabled":sn(e),"data-invalid":sn(s),"data-readonly":sn(i),"aria-hidden":!0,onMouseDown:li(mt.onMouseDown,kt),onMouseUp:li(mt.onMouseUp,()=>at(!1)),onMouseEnter:li(mt.onMouseEnter,()=>Y(!0)),onMouseLeave:li(mt.onMouseLeave,()=>Y(!1))}},[q,Z,e,B,E,j,g,s,i]),Gt=Q.useCallback((mt={},dt=null)=>({...mt,ref:dt,"data-active":sn(q),"data-hover":sn(j),"data-checked":sn(Z),"data-focus":sn(B),"data-focus-visible":sn(B&&E),"data-indeterminate":sn(g),"data-disabled":sn(e),"data-invalid":sn(s),"data-readonly":sn(i)}),[q,Z,e,B,E,j,g,s,i]),Qt=Q.useCallback((mt={},dt=null)=>({...T,...mt,ref:Fa(dt,kt=>{kt&&K(kt.tagName==="LABEL")}),onClick:li(mt.onClick,()=>{var kt;nt||((kt=G.current)==null||kt.click(),requestAnimationFrame(()=>{var Rt;(Rt=G.current)==null||Rt.focus({preventScroll:!0})}))}),"data-disabled":sn(e),"data-checked":sn(Z),"data-invalid":sn(s)}),[T,e,Z,s,nt]),F=Q.useCallback((mt={},dt=null)=>({...mt,ref:Fa(G,dt),type:"checkbox",name:_,value:y,id:a,tabIndex:x,onChange:li(mt.onChange,rt),onBlur:li(mt.onBlur,N,()=>V(!1)),onFocus:li(mt.onFocus,P,()=>V(!0)),onKeyDown:li(mt.onKeyDown,_t),onKeyUp:li(mt.onKeyUp,Ot),required:r,checked:Z,disabled:St,readOnly:i,"aria-label":M,"aria-labelledby":b,"aria-invalid":S?!!S:s,"aria-describedby":c,"aria-disabled":e,style:FI}),[_,y,a,rt,N,P,_t,Ot,r,Z,St,i,M,b,S,s,c,e,x]),wt=Q.useCallback((mt={},dt=null)=>({...mt,ref:dt,onMouseDown:li(mt.onMouseDown,$I),"data-disabled":sn(e),"data-checked":sn(Z),"data-invalid":sn(s)}),[Z,e,s]);return{state:{isInvalid:s,isFocused:B,isChecked:Z,isActive:q,isHovered:j,isIndeterminate:g,isDisabled:e,isReadOnly:i,isRequired:r},getRootProps:Qt,getCheckboxProps:Xt,getIndicatorProps:Gt,getInputProps:F,getLabelProps:wt,htmlProps:T}}function $I(n){n.preventDefault(),n.stopPropagation()}function YI(n){const t=parseFloat(n);return typeof t!="number"||Number.isNaN(t)?0:t}function ZI(n,t){let e=YI(n);const i=10**(t??10);return e=Math.round(e*i)/i,t?e.toFixed(t):e.toString()}function KI(n){if(!Number.isFinite(n))return 0;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e+=1;return e}function eb(n,t,e){return(n-t)*100/(e-t)}function JI(n,t,e){return(e-t)*n+t}function nb(n,t,e){const i=Math.round((n-t)/e)*e+t,r=KI(e);return ZI(i,r)}function ky(n,t,e){return n==null?n:(e{const s=typeof n=="function"?n():n??document;if(!(!e||!s))return s.addEventListener(t,r,i),()=>{s.removeEventListener(t,r,i)}},[t,n,i,r,e]),()=>{const s=typeof n=="function"?n():n??document;s==null||s.removeEventListener(t,r,i)}}function QI(n){const t=n.ownerDocument.defaultView||window,{overflow:e,overflowX:i,overflowY:r}=t.getComputedStyle(n);return/auto|scroll|overlay|hidden/.test(e+r+i)}function tL(n){return n.localName==="html"?n:n.assignedSlot||n.parentElement||n.ownerDocument.documentElement}function RT(n){return["html","body","#document"].includes(n.localName)?n.ownerDocument.body:uI(n)&&QI(n)?n:RT(tL(n))}var Pl=(n,t)=>({var:n,varRef:t?`var(${n}, ${t})`:`var(${n})`}),Yn={arrowShadowColor:Pl("--popper-arrow-shadow-color"),arrowSize:Pl("--popper-arrow-size","8px"),arrowSizeHalf:Pl("--popper-arrow-size-half"),arrowBg:Pl("--popper-arrow-bg"),transformOrigin:Pl("--popper-transform-origin"),arrowOffset:Pl("--popper-arrow-offset")};function eL(n){if(n.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var nL={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},iL=n=>nL[n],ib={scroll:!0,resize:!0};function rL(n){let t;return typeof n=="object"?t={enabled:!0,options:{...ib,...n}}:t={enabled:n,options:ib},t}var sL={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:n})=>{n.styles.popper.width=`${n.rects.reference.width}px`},effect:({state:n})=>()=>{const t=n.elements.reference;n.elements.popper.style.width=`${t.offsetWidth}px`}},aL={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:n})=>{rb(n)},effect:({state:n})=>()=>{rb(n)}},rb=n=>{n.elements.popper.style.setProperty(Yn.transformOrigin.var,iL(n.placement))},oL={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:n})=>{lL(n)}},lL=n=>{var t;if(!n.placement)return;const e=cL(n.placement);if((t=n.elements)!=null&&t.arrow&&e){Object.assign(n.elements.arrow.style,{[e.property]:e.value,width:Yn.arrowSize.varRef,height:Yn.arrowSize.varRef,zIndex:-1});const i={[Yn.arrowSizeHalf.var]:`calc(${Yn.arrowSize.varRef} / 2 - 1px)`,[Yn.arrowOffset.var]:`calc(${Yn.arrowSizeHalf.varRef} * -1)`};for(const r in i)n.elements.arrow.style.setProperty(r,i[r])}},cL=n=>{if(n.startsWith("top"))return{property:"bottom",value:Yn.arrowOffset.varRef};if(n.startsWith("bottom"))return{property:"top",value:Yn.arrowOffset.varRef};if(n.startsWith("left"))return{property:"right",value:Yn.arrowOffset.varRef};if(n.startsWith("right"))return{property:"left",value:Yn.arrowOffset.varRef}},hL={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:n})=>{sb(n)},effect:({state:n})=>()=>{sb(n)}},sb=n=>{if(!n.elements.arrow)return;const t=n.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const e=eL(n.placement);e&&t.style.setProperty("--popper-arrow-default-shadow",e),Object.assign(t.style,{transform:"rotate(45deg)",background:Yn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},uL={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},fL={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function dL(n,t="ltr"){var e,i;const r=((e=uL[n])==null?void 0:e[t])||n;return t==="ltr"?r:(i=fL[n])!=null?i:r}var Fi="top",_r="bottom",vr="right",Ui="left",Ov="auto",bf=[Fi,_r,vr,Ui],zc="start",Hu="end",pL="clippingParents",PT="viewport",kh="popper",mL="reference",ab=bf.reduce(function(n,t){return n.concat([t+"-"+zc,t+"-"+Hu])},[]),IT=[].concat(bf,[Ov]).reduce(function(n,t){return n.concat([t,t+"-"+zc,t+"-"+Hu])},[]),gL="beforeRead",yL="read",xL="afterRead",_L="beforeMain",vL="main",ML="afterMain",wL="beforeWrite",bL="write",SL="afterWrite",EL=[gL,yL,xL,_L,vL,ML,wL,bL,SL];function As(n){return n?(n.nodeName||"").toLowerCase():null}function er(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Zo(n){var t=er(n).Element;return n instanceof t||n instanceof Element}function xr(n){var t=er(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Fv(n){if(typeof ShadowRoot>"u")return!1;var t=er(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function AL(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},r=t.attributes[e]||{},s=t.elements[e];!xr(s)||!As(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var o=r[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function TL(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],s=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!xr(r)||!As(r)||(Object.assign(r.style,o),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}const CL={name:"applyStyles",enabled:!0,phase:"write",fn:AL,effect:TL,requires:["computeStyles"]};function _s(n){return n.split("-")[0]}var Vo=Math.max,Hm=Math.min,Bc=Math.round;function N_(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function LT(){return!/^((?!chrome|android).)*safari/i.test(N_())}function Hc(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),r=1,s=1;t&&xr(n)&&(r=n.offsetWidth>0&&Bc(i.width)/n.offsetWidth||1,s=n.offsetHeight>0&&Bc(i.height)/n.offsetHeight||1);var a=Zo(n)?er(n):window,o=a.visualViewport,l=!LT()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/r,h=(i.top+(l&&o?o.offsetTop:0))/s,u=i.width/r,p=i.height/s;return{width:u,height:p,top:h,right:c+u,bottom:h+p,left:c,x:c,y:h}}function Uv(n){var t=Hc(n),e=n.offsetWidth,i=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:i}}function DT(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Fv(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ra(n){return er(n).getComputedStyle(n)}function RL(n){return["table","td","th"].indexOf(As(n))>=0}function $a(n){return((Zo(n)?n.ownerDocument:n.document)||window.document).documentElement}function F0(n){return As(n)==="html"?n:n.assignedSlot||n.parentNode||(Fv(n)?n.host:null)||$a(n)}function ob(n){return!xr(n)||ra(n).position==="fixed"?null:n.offsetParent}function PL(n){var t=/firefox/i.test(N_()),e=/Trident/i.test(N_());if(e&&xr(n)){var i=ra(n);if(i.position==="fixed")return null}var r=F0(n);for(Fv(r)&&(r=r.host);xr(r)&&["html","body"].indexOf(As(r))<0;){var s=ra(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Sf(n){for(var t=er(n),e=ob(n);e&&RL(e)&&ra(e).position==="static";)e=ob(e);return e&&(As(e)==="html"||As(e)==="body"&&ra(e).position==="static")?t:e||PL(n)||t}function kv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function xu(n,t,e){return Vo(n,Hm(t,e))}function IL(n,t,e){var i=xu(n,t,e);return i>e?e:i}function NT(){return{top:0,right:0,bottom:0,left:0}}function OT(n){return Object.assign({},NT(),n)}function FT(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var LL=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,OT(typeof t!="number"?t:FT(t,bf))};function DL(n){var t,e=n.state,i=n.name,r=n.options,s=e.elements.arrow,a=e.modifiersData.popperOffsets,o=_s(e.placement),l=kv(o),c=[Ui,vr].indexOf(o)>=0,h=c?"height":"width";if(!(!s||!a)){var u=LL(r.padding,e),p=Uv(s),m=l==="y"?Fi:Ui,g=l==="y"?_r:vr,_=e.rects.reference[h]+e.rects.reference[l]-a[l]-e.rects.popper[h],y=a[l]-e.rects.reference[l],x=Sf(s),M=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,b=_/2-y/2,S=u[m],R=M-p[h]-u[g],T=M/2-p[h]/2+b,C=xu(S,T,R),N=l;e.modifiersData[i]=(t={},t[N]=C,t.centerOffset=C-T,t)}}function NL(n){var t=n.state,e=n.options,i=e.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||DT(t.elements.popper,r)&&(t.elements.arrow=r))}const OL={name:"arrow",enabled:!0,phase:"main",fn:DL,effect:NL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gc(n){return n.split("-")[1]}var FL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function UL(n,t){var e=n.x,i=n.y,r=t.devicePixelRatio||1;return{x:Bc(e*r)/r||0,y:Bc(i*r)/r||0}}function lb(n){var t,e=n.popper,i=n.popperRect,r=n.placement,s=n.variation,a=n.offsets,o=n.position,l=n.gpuAcceleration,c=n.adaptive,h=n.roundOffsets,u=n.isFixed,p=a.x,m=p===void 0?0:p,g=a.y,_=g===void 0?0:g,y=typeof h=="function"?h({x:m,y:_}):{x:m,y:_};m=y.x,_=y.y;var x=a.hasOwnProperty("x"),M=a.hasOwnProperty("y"),b=Ui,S=Fi,R=window;if(c){var T=Sf(e),C="clientHeight",N="clientWidth";if(T===er(e)&&(T=$a(e),ra(T).position!=="static"&&o==="absolute"&&(C="scrollHeight",N="scrollWidth")),T=T,r===Fi||(r===Ui||r===vr)&&s===Hu){S=_r;var P=u&&T===R&&R.visualViewport?R.visualViewport.height:T[C];_-=P-i.height,_*=l?1:-1}if(r===Ui||(r===Fi||r===_r)&&s===Hu){b=vr;var E=u&&T===R&&R.visualViewport?R.visualViewport.width:T[N];m-=E-i.width,m*=l?1:-1}}var L=Object.assign({position:o},c&&FL),B=h===!0?UL({x:m,y:_},er(e)):{x:m,y:_};if(m=B.x,_=B.y,l){var V;return Object.assign({},L,(V={},V[S]=M?"0":"",V[b]=x?"0":"",V.transform=(R.devicePixelRatio||1)<=1?"translate("+m+"px, "+_+"px)":"translate3d("+m+"px, "+_+"px, 0)",V))}return Object.assign({},L,(t={},t[S]=M?_+"px":"",t[b]=x?m+"px":"",t.transform="",t))}function kL(n){var t=n.state,e=n.options,i=e.gpuAcceleration,r=i===void 0?!0:i,s=e.adaptive,a=s===void 0?!0:s,o=e.roundOffsets,l=o===void 0?!0:o,c={placement:_s(t.placement),variation:Gc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,lb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,lb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const zL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kL,data:{}};var Zd={passive:!0};function BL(n){var t=n.state,e=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,o=a===void 0?!0:a,l=er(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(h){h.addEventListener("scroll",e.update,Zd)}),o&&l.addEventListener("resize",e.update,Zd),function(){s&&c.forEach(function(h){h.removeEventListener("scroll",e.update,Zd)}),o&&l.removeEventListener("resize",e.update,Zd)}}const HL={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:BL,data:{}};var GL={left:"right",right:"left",bottom:"top",top:"bottom"};function bm(n){return n.replace(/left|right|bottom|top/g,function(t){return GL[t]})}var VL={start:"end",end:"start"};function cb(n){return n.replace(/start|end/g,function(t){return VL[t]})}function zv(n){var t=er(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function Bv(n){return Hc($a(n)).left+zv(n).scrollLeft}function WL(n,t){var e=er(n),i=$a(n),r=e.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(r){s=r.width,a=r.height;var c=LT();(c||!c&&t==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}return{width:s,height:a,x:o+Bv(n),y:l}}function jL(n){var t,e=$a(n),i=zv(n),r=(t=n.ownerDocument)==null?void 0:t.body,s=Vo(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Vo(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-i.scrollLeft+Bv(n),l=-i.scrollTop;return ra(r||e).direction==="rtl"&&(o+=Vo(e.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function Hv(n){var t=ra(n),e=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+i)}function UT(n){return["html","body","#document"].indexOf(As(n))>=0?n.ownerDocument.body:xr(n)&&Hv(n)?n:UT(F0(n))}function _u(n,t){var e;t===void 0&&(t=[]);var i=UT(n),r=i===((e=n.ownerDocument)==null?void 0:e.body),s=er(i),a=r?[s].concat(s.visualViewport||[],Hv(i)?i:[]):i,o=t.concat(a);return r?o:o.concat(_u(F0(a)))}function O_(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function XL(n,t){var e=Hc(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function hb(n,t,e){return t===PT?O_(WL(n,e)):Zo(t)?XL(t,e):O_(jL($a(n)))}function qL(n){var t=_u(F0(n)),e=["absolute","fixed"].indexOf(ra(n).position)>=0,i=e&&xr(n)?Sf(n):n;return Zo(i)?t.filter(function(r){return Zo(r)&&DT(r,i)&&As(r)!=="body"}):[]}function $L(n,t,e,i){var r=t==="clippingParents"?qL(n):[].concat(t),s=[].concat(r,[e]),a=s[0],o=s.reduce(function(l,c){var h=hb(n,c,i);return l.top=Vo(h.top,l.top),l.right=Hm(h.right,l.right),l.bottom=Hm(h.bottom,l.bottom),l.left=Vo(h.left,l.left),l},hb(n,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function kT(n){var t=n.reference,e=n.element,i=n.placement,r=i?_s(i):null,s=i?Gc(i):null,a=t.x+t.width/2-e.width/2,o=t.y+t.height/2-e.height/2,l;switch(r){case Fi:l={x:a,y:t.y-e.height};break;case _r:l={x:a,y:t.y+t.height};break;case vr:l={x:t.x+t.width,y:o};break;case Ui:l={x:t.x-e.width,y:o};break;default:l={x:t.x,y:t.y}}var c=r?kv(r):null;if(c!=null){var h=c==="y"?"height":"width";switch(s){case zc:l[c]=l[c]-(t[h]/2-e[h]/2);break;case Hu:l[c]=l[c]+(t[h]/2-e[h]/2);break}}return l}function Gu(n,t){t===void 0&&(t={});var e=t,i=e.placement,r=i===void 0?n.placement:i,s=e.strategy,a=s===void 0?n.strategy:s,o=e.boundary,l=o===void 0?pL:o,c=e.rootBoundary,h=c===void 0?PT:c,u=e.elementContext,p=u===void 0?kh:u,m=e.altBoundary,g=m===void 0?!1:m,_=e.padding,y=_===void 0?0:_,x=OT(typeof y!="number"?y:FT(y,bf)),M=p===kh?mL:kh,b=n.rects.popper,S=n.elements[g?M:p],R=$L(Zo(S)?S:S.contextElement||$a(n.elements.popper),l,h,a),T=Hc(n.elements.reference),C=kT({reference:T,element:b,strategy:"absolute",placement:r}),N=O_(Object.assign({},b,C)),P=p===kh?N:T,E={top:R.top-P.top+x.top,bottom:P.bottom-R.bottom+x.bottom,left:R.left-P.left+x.left,right:P.right-R.right+x.right},L=n.modifiersData.offset;if(p===kh&&L){var B=L[r];Object.keys(E).forEach(function(V){var j=[vr,_r].indexOf(V)>=0?1:-1,Y=[Fi,_r].indexOf(V)>=0?"y":"x";E[V]+=B[Y]*j})}return E}function YL(n,t){t===void 0&&(t={});var e=t,i=e.placement,r=e.boundary,s=e.rootBoundary,a=e.padding,o=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?IT:l,h=Gc(i),u=h?o?ab:ab.filter(function(g){return Gc(g)===h}):bf,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var m=p.reduce(function(g,_){return g[_]=Gu(n,{placement:_,boundary:r,rootBoundary:s,padding:a})[_s(_)],g},{});return Object.keys(m).sort(function(g,_){return m[g]-m[_]})}function ZL(n){if(_s(n)===Ov)return[];var t=bm(n);return[cb(n),t,cb(t)]}function KL(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var r=e.mainAxis,s=r===void 0?!0:r,a=e.altAxis,o=a===void 0?!0:a,l=e.fallbackPlacements,c=e.padding,h=e.boundary,u=e.rootBoundary,p=e.altBoundary,m=e.flipVariations,g=m===void 0?!0:m,_=e.allowedAutoPlacements,y=t.options.placement,x=_s(y),M=x===y,b=l||(M||!g?[bm(y)]:ZL(y)),S=[y].concat(b).reduce(function(Z,rt){return Z.concat(_s(rt)===Ov?YL(t,{placement:rt,boundary:h,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:_}):rt)},[]),R=t.rects.reference,T=t.rects.popper,C=new Map,N=!0,P=S[0],E=0;E=0,Y=j?"width":"height",q=Gu(t,{placement:L,boundary:h,rootBoundary:u,altBoundary:p,padding:c}),at=j?V?vr:Ui:V?_r:Fi;R[Y]>T[Y]&&(at=bm(at));var G=bm(at),nt=[];if(s&&nt.push(q[B]<=0),o&&nt.push(q[at]<=0,q[G]<=0),nt.every(function(Z){return Z})){P=L,N=!1;break}C.set(L,nt)}if(N)for(var K=g?3:1,$=function(rt){var St=S.find(function(_t){var Ot=C.get(_t);if(Ot)return Ot.slice(0,rt).every(function(Xt){return Xt})});if(St)return P=St,"break"},ht=K;ht>0;ht--){var vt=$(ht);if(vt==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const JL={name:"flip",enabled:!0,phase:"main",fn:KL,requiresIfExists:["offset"],data:{_skip:!1}};function ub(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function fb(n){return[Fi,vr,_r,Ui].some(function(t){return n[t]>=0})}function QL(n){var t=n.state,e=n.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=Gu(t,{elementContext:"reference"}),o=Gu(t,{altBoundary:!0}),l=ub(a,i),c=ub(o,r,s),h=fb(l),u=fb(c);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const tD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:QL};function eD(n,t,e){var i=_s(n),r=[Ui,Fi].indexOf(i)>=0?-1:1,s=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=s[0],o=s[1];return a=a||0,o=(o||0)*r,[Ui,vr].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function nD(n){var t=n.state,e=n.options,i=n.name,r=e.offset,s=r===void 0?[0,0]:r,a=IT.reduce(function(h,u){return h[u]=eD(u,t.rects,s),h},{}),o=a[t.placement],l=o.x,c=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}const iD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:nD};function rD(n){var t=n.state,e=n.name;t.modifiersData[e]=kT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const sD={name:"popperOffsets",enabled:!0,phase:"read",fn:rD,data:{}};function aD(n){return n==="x"?"y":"x"}function oD(n){var t=n.state,e=n.options,i=n.name,r=e.mainAxis,s=r===void 0?!0:r,a=e.altAxis,o=a===void 0?!1:a,l=e.boundary,c=e.rootBoundary,h=e.altBoundary,u=e.padding,p=e.tether,m=p===void 0?!0:p,g=e.tetherOffset,_=g===void 0?0:g,y=Gu(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),x=_s(t.placement),M=Gc(t.placement),b=!M,S=kv(x),R=aD(S),T=t.modifiersData.popperOffsets,C=t.rects.reference,N=t.rects.popper,P=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(T){if(s){var V,j=S==="y"?Fi:Ui,Y=S==="y"?_r:vr,q=S==="y"?"height":"width",at=T[S],G=at+y[j],nt=at-y[Y],K=m?-N[q]/2:0,$=M===zc?C[q]:N[q],ht=M===zc?-N[q]:-C[q],vt=t.elements.arrow,Z=m&&vt?Uv(vt):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:NT(),St=rt[j],_t=rt[Y],Ot=xu(0,C[q],Z[q]),Xt=b?C[q]/2-K-Ot-St-E.mainAxis:$-Ot-St-E.mainAxis,Gt=b?-C[q]/2+K+Ot+_t+E.mainAxis:ht+Ot+_t+E.mainAxis,Qt=t.elements.arrow&&Sf(t.elements.arrow),F=Qt?S==="y"?Qt.clientTop||0:Qt.clientLeft||0:0,wt=(V=L==null?void 0:L[S])!=null?V:0,bt=at+Xt-wt-F,mt=at+Gt-wt,dt=xu(m?Hm(G,bt):G,at,m?Vo(nt,mt):nt);T[S]=dt,B[S]=dt-at}if(o){var kt,Rt=S==="x"?Fi:Ui,zt=S==="x"?_r:vr,z=T[R],O=R==="y"?"height":"width",ot=z+y[Rt],At=z-y[zt],Et=[Fi,Ui].indexOf(x)!==-1,Tt=(kt=L==null?void 0:L[R])!=null?kt:0,ne=Et?ot:z-C[O]-N[O]-Tt+E.altAxis,Ft=Et?z+C[O]+N[O]-Tt-E.altAxis:At,Wt=m&&Et?IL(ne,z,Ft):xu(m?ne:ot,z,m?Ft:At);T[R]=Wt,B[R]=Wt-z}t.modifiersData[i]=B}}const lD={name:"preventOverflow",enabled:!0,phase:"main",fn:oD,requiresIfExists:["offset"]};function cD(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function hD(n){return n===er(n)||!xr(n)?zv(n):cD(n)}function uD(n){var t=n.getBoundingClientRect(),e=Bc(t.width)/n.offsetWidth||1,i=Bc(t.height)/n.offsetHeight||1;return e!==1||i!==1}function fD(n,t,e){e===void 0&&(e=!1);var i=xr(t),r=xr(t)&&uD(t),s=$a(t),a=Hc(n,r,e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!e)&&((As(t)!=="body"||Hv(s))&&(o=hD(t)),xr(t)?(l=Hc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=Bv(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function dD(n){var t=new Map,e=new Set,i=[];n.forEach(function(s){t.set(s.name,s)});function r(s){e.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!e.has(o)){var l=t.get(o);l&&r(l)}}),i.push(s)}return n.forEach(function(s){e.has(s.name)||r(s)}),i}function pD(n){var t=dD(n);return EL.reduce(function(e,i){return e.concat(t.filter(function(r){return r.phase===i}))},[])}function mD(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function gD(n){var t=n.reduce(function(e,i){var r=e[i.name];return e[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var db={placement:"bottom",modifiers:[],strategy:"absolute"};function pb(){for(var n=arguments.length,t=new Array(n),e=0;e{}),b=Q.useCallback(()=>{var E;!t||!g.current||!_.current||((E=M.current)==null||E.call(M),y.current=_D(g.current,_.current,{placement:x,modifiers:[hL,oL,aL,{...sL,enabled:!!p},{name:"eventListeners",...rL(a)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:o??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!u,options:{boundary:h}},...e??[]],strategy:r}),y.current.forceUpdate(),M.current=y.current.destroy)},[x,t,e,p,a,s,o,l,c,u,h,r]);Q.useEffect(()=>()=>{var E;!g.current&&!_.current&&((E=y.current)==null||E.destroy(),y.current=null)},[]);const S=Q.useCallback(E=>{g.current=E,b()},[b]),R=Q.useCallback((E={},L=null)=>({...E,ref:Fa(S,L)}),[S]),T=Q.useCallback(E=>{_.current=E,b()},[b]),C=Q.useCallback((E={},L=null)=>({...E,ref:Fa(T,L),style:{...E.style,position:r,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[r,T,p]),N=Q.useCallback((E={},L=null)=>{const{size:B,shadowColor:V,bg:j,style:Y,...q}=E;return{...q,ref:L,"data-popper-arrow":"",style:MD(E)}},[]),P=Q.useCallback((E={},L=null)=>({...E,ref:L,"data-popper-arrow-inner":""}),[]);return{update(){var E;(E=y.current)==null||E.update()},forceUpdate(){var E;(E=y.current)==null||E.forceUpdate()},transformOrigin:Yn.transformOrigin.varRef,referenceRef:S,popperRef:T,getPopperProps:C,getArrowProps:N,getArrowInnerProps:P,getReferenceProps:R}}function MD(n){const{size:t,shadowColor:e,bg:i,style:r}=n,s={...r,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),e&&(s["--popper-arrow-shadow-color"]=e),i&&(s["--popper-arrow-bg"]=i),s}function wD(n={}){const{onClose:t,onOpen:e,isOpen:i,id:r}=n,s=yr(e),a=yr(t),[o,l]=Q.useState(n.defaultIsOpen||!1),c=i!==void 0?i:o,h=i!==void 0,u=Q.useId(),p=r??`disclosure-${u}`,m=Q.useCallback(()=>{h||l(!1),a==null||a()},[h,a]),g=Q.useCallback(()=>{h||l(!0),s==null||s()},[h,s]),_=Q.useCallback(()=>{c?m():g()},[c,g,m]);function y(M={}){return{...M,"aria-expanded":c,"aria-controls":p,onClick(b){var S;(S=M.onClick)==null||S.call(M,b),_()}}}function x(M={}){return{...M,hidden:!c,id:p}}return{isOpen:c,onOpen:g,onClose:m,onToggle:_,isControlled:h,getButtonProps:y,getDisclosureProps:x}}var[bD,SD]=L0(),ED={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function AD(n,t){var e,i;if(n)return(i=(e=ED[n])==null?void 0:e[t])!=null?i:n}function TD(n){var t;const{isOpen:e,onClose:i,placement:r="right",children:s,...a}=n,o=Tv(),l=(t=o.components)==null?void 0:t.Drawer,c=AD(r,o.direction);return X.jsx(bD,{value:{placement:c},children:X.jsx(Rv,{isOpen:e,onClose:i,styleConfig:l,...a,children:s})})}var CD=_n(TT),zT=br((n,t)=>{const{className:e,children:i,motionProps:r,containerProps:s,...a}=n,{getDialogProps:o,getDialogContainerProps:l,isOpen:c}=fI(),h=o(a,t),u=l(s),p=rh("chakra-modal__content",e),m=dI(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},_={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:y}=SD();return X.jsx(pI,{children:X.jsx(_n.div,{...u,className:"chakra-modal__content-container",__css:_,children:X.jsx(CD,{motionProps:r,direction:y,in:c,className:p,...h,__css:g,children:i})})})});zT.displayName="DrawerContent";function RD(n,t,e){return(n-t)*100/(e-t)}D0({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});D0({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var PD=D0({"0%":{left:"-40%"},"100%":{left:"100%"}}),ID=D0({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function LD(n){const{value:t=0,min:e,max:i,valueText:r,getValueText:s,isIndeterminate:a,role:o="progressbar"}=n,l=RD(t,e,i);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":i,"aria-valuemin":e,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,l):r})(),role:o},percent:l,value:t}}var[DD,ND]=L0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),OD=br((n,t)=>{const{min:e,max:i,value:r,isIndeterminate:s,role:a,...o}=n,l=LD({value:r,min:e,max:i,isIndeterminate:s,role:a}),h={height:"100%",...ND().filledTrack};return X.jsx(_n.div,{ref:t,style:{width:`${l.percent}%`,...o.style},...l.bind,...o,__css:h})}),BT=br((n,t)=>{var e;const{value:i,min:r=0,max:s=100,hasStripe:a,isAnimated:o,children:l,borderRadius:c,isIndeterminate:h,"aria-label":u,"aria-labelledby":p,"aria-valuetext":m,title:g,role:_,...y}=_f(n),x=Cv("Progress",n),M=c??((e=x.track)==null?void 0:e.borderRadius),b={animation:`${ID} 1s linear infinite`},T={...!h&&a&&o&&b,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${PD} 1s ease infinite normal none running`}},C={overflow:"hidden",position:"relative",...x.track};return X.jsx(_n.div,{ref:t,borderRadius:M,__css:C,...y,children:X.jsxs(DD,{value:x,children:[X.jsx(OD,{"aria-label":u,"aria-labelledby":p,"aria-valuetext":m,min:r,max:s,value:i,isIndeterminate:h,css:T,borderRadius:M,title:g,role:_}),l]})})});BT.displayName="Progress";var Il=n=>n?"":void 0,By=n=>n?!0:void 0,Ef=(...n)=>n.filter(Boolean).join(" ");function Hy(...n){return function(e){n.some(i=>(i==null||i(e),e==null?void 0:e.defaultPrevented))}}function Kd(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}var Sm={width:0,height:0},Jd=n=>n||Sm;function FD(n){const{orientation:t,thumbPercents:e,thumbRects:i,isReversed:r}=n,s=_=>{var y;const x=(y=i[_])!=null?y:Sm;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Kd({orientation:t,vertical:{bottom:`calc(${e[_]}% - ${x.height/2}px)`},horizontal:{left:`calc(${e[_]}% - ${x.width/2}px)`}})}},a=t==="vertical"?i.reduce((_,y)=>Jd(_).height>Jd(y).height?_:y,Sm):i.reduce((_,y)=>Jd(_).width>Jd(y).width?_:y,Sm),o={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Kd({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Kd({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},c=e.length===1,h=[0,r?100-e[0]:e[0]],u=c?h:e;let p=u[0];!c&&r&&(p=100-p);const m=Math.abs(u[u.length-1]-u[0]),g={...l,...Kd({orientation:t,vertical:r?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:r?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:o,getThumbStyle:s}}function UD(n){const{isReversed:t,direction:e,orientation:i}=n;return e==="ltr"||i==="vertical"?t:!t}function kD(n,t,e,i){return n.addEventListener(t,e,i),()=>{n.removeEventListener(t,e,i)}}function zD(n){const t=HD(n);return typeof t.PointerEvent<"u"&&n instanceof t.PointerEvent?n.pointerType==="mouse":n instanceof t.MouseEvent}function HT(n){return!!n.touches}function BD(n){return HT(n)&&n.touches.length>1}function HD(n){var t;return(t=n.view)!=null?t:window}function GD(n,t="page"){const e=n.touches[0]||n.changedTouches[0];return{x:e[`${t}X`],y:e[`${t}Y`]}}function VD(n,t="page"){return{x:n[`${t}X`],y:n[`${t}Y`]}}function GT(n,t="page"){return HT(n)?GD(n,t):VD(n,t)}function WD(n){return t=>{const e=zD(t);(!e||e&&t.button===0)&&n(t)}}function jD(n,t=!1){function e(r){n(r,{point:GT(r)})}return t?WD(e):e}function Em(n,t,e,i){return kD(n,t,jD(e,t==="pointerdown"),i)}var XD=Object.defineProperty,qD=(n,t,e)=>t in n?XD(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Rr=(n,t,e)=>(qD(n,typeof t!="symbol"?t+"":t,e),e),$D=class{constructor(n,t,e){Rr(this,"history",[]),Rr(this,"startEvent",null),Rr(this,"lastEvent",null),Rr(this,"lastEventInfo",null),Rr(this,"handlers",{}),Rr(this,"removeListeners",()=>{}),Rr(this,"threshold",3),Rr(this,"win"),Rr(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const o=Gy(this.lastEventInfo,this.history),l=this.startEvent!==null,c=JD(o.offset,{x:0,y:0})>=this.threshold;if(!l&&!c)return;const{timestamp:h}=Yw();this.history.push({...o.point,timestamp:h});const{onStart:u,onMove:p}=this.handlers;l||(u==null||u(this.lastEvent,o),this.startEvent=this.lastEvent),p==null||p(this.lastEvent,o)}),Rr(this,"onPointerMove",(o,l)=>{this.lastEvent=o,this.lastEventInfo=l,CI.update(this.updatePoint,!0)}),Rr(this,"onPointerUp",(o,l)=>{const c=Gy(l,this.history),{onEnd:h,onSessionEnd:u}=this.handlers;u==null||u(o,c),this.end(),!(!h||!this.startEvent)&&(h==null||h(o,c))});var i;if(this.win=(i=n.view)!=null?i:window,BD(n))return;this.handlers=t,e&&(this.threshold=e),n.stopPropagation(),n.preventDefault();const r={point:GT(n)},{timestamp:s}=Yw();this.history=[{...r.point,timestamp:s}];const{onSessionStart:a}=t;a==null||a(n,Gy(r,this.history)),this.removeListeners=KD(Em(this.win,"pointermove",this.onPointerMove),Em(this.win,"pointerup",this.onPointerUp),Em(this.win,"pointercancel",this.onPointerUp))}updateHandlers(n){this.handlers=n}end(){var n;(n=this.removeListeners)==null||n.call(this),RI.update(this.updatePoint)}};function mb(n,t){return{x:n.x-t.x,y:n.y-t.y}}function Gy(n,t){return{point:n.point,delta:mb(n.point,t[t.length-1]),offset:mb(n.point,t[0]),velocity:ZD(t,.1)}}var YD=n=>n*1e3;function ZD(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const r=n[n.length-1];for(;e>=0&&(i=n[e],!(r.timestamp-i.timestamp>YD(t)));)e--;if(!i)return{x:0,y:0};const s=(r.timestamp-i.timestamp)/1e3;if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function KD(...n){return t=>n.reduce((e,i)=>i(e),t)}function Vy(n,t){return Math.abs(n-t)}function gb(n){return"x"in n&&"y"in n}function JD(n,t){if(typeof n=="number"&&typeof t=="number")return Vy(n,t);if(gb(n)&&gb(t)){const e=Vy(n.x,t.x),i=Vy(n.y,t.y);return Math.sqrt(e**2+i**2)}return 0}function VT(n){const t=Q.useRef(null);return t.current=n,t}function QD(n,t){const{onPan:e,onPanStart:i,onPanEnd:r,onPanSessionStart:s,onPanSessionEnd:a,threshold:o}=t,l=!!(e||i||r||s||a),c=Q.useRef(null),h=VT({onSessionStart:s,onSessionEnd:a,onStart:i,onMove:e,onEnd(u,p){c.current=null,r==null||r(u,p)}});Q.useEffect(()=>{var u;(u=c.current)==null||u.updateHandlers(h.current)}),Q.useEffect(()=>{const u=n.current;if(!u||!l)return;function p(m){c.current=new $D(m,h.current,o)}return Em(u,"pointerdown",p)},[n,l,h,o]),Q.useEffect(()=>()=>{var u;(u=c.current)==null||u.end(),c.current=null},[])}function tN(n,t){if(!n){t(void 0);return}t({width:n.offsetWidth,height:n.offsetHeight});const e=n.ownerDocument.defaultView??window,i=new e.ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const[s]=r;let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=n.offsetWidth,o=n.offsetHeight;t({width:a,height:o})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}var eN=globalThis!=null&&globalThis.document?Q.useLayoutEffect:Q.useEffect;function nN(n,t){var e,i;if(!n||!n.parentElement)return;const r=(i=(e=n.ownerDocument)==null?void 0:e.defaultView)!=null?i:window,s=new r.MutationObserver(()=>{t()});return s.observe(n.parentElement,{childList:!0}),()=>{s.disconnect()}}function iN({getNodes:n,observeMutation:t=!0}){const[e,i]=Q.useState([]),[r,s]=Q.useState(0);return eN(()=>{const a=n(),o=a.map((l,c)=>tN(l,h=>{i(u=>[...u.slice(0,c),h,...u.slice(c+1)])}));if(t){const l=a[0];o.push(nN(l,()=>{s(c=>c+1)}))}return()=>{o.forEach(l=>{l==null||l()})}},[r]),e}function rN(n){return typeof n=="object"&&n!==null&&"current"in n}function sN(n){const[t]=iN({observeMutation:!1,getNodes(){return[rN(n)?n.current:n]}});return t}function aN(n){var t;const{min:e=0,max:i=100,onChange:r,value:s,defaultValue:a,isReversed:o,direction:l="ltr",orientation:c="horizontal",id:h,isDisabled:u,isReadOnly:p,onChangeStart:m,onChangeEnd:g,step:_=1,getAriaValueText:y,"aria-valuetext":x,"aria-label":M,"aria-labelledby":b,name:S,focusThumbOnChange:R=!0,...T}=n,C=yr(m),N=yr(g),P=yr(y),E=UD({isReversed:o,direction:l,orientation:c}),[L,B]=LI({value:s,defaultValue:a??lN(e,i),onChange:r}),[V,j]=Q.useState(!1),[Y,q]=Q.useState(!1),at=!(u||p),G=(i-e)/10,nt=_||(i-e)/100,K=ky(L,e,i),$=i-K+e,vt=eb(E?$:K,e,i),Z=c==="vertical",rt=VT({min:e,max:i,step:_,isDisabled:u,value:K,isInteractive:at,isReversed:E,isVertical:Z,eventSource:null,focusThumbOnChange:R,orientation:c}),St=Q.useRef(null),_t=Q.useRef(null),Ot=Q.useRef(null),Xt=Q.useId(),Gt=h??Xt,[Qt,F]=[`slider-thumb-${Gt}`,`slider-track-${Gt}`],wt=Q.useCallback(It=>{var Nt,qt;if(!St.current)return;const W=rt.current;W.eventSource="pointer";const gt=St.current.getBoundingClientRect(),{clientX:jt,clientY:D}=(qt=(Nt=It.touches)==null?void 0:Nt[0])!=null?qt:It,it=Z?gt.bottom-D:jt-gt.left,lt=Z?gt.height:gt.width;let ut=it/lt;E&&(ut=1-ut);let Ct=JI(ut,W.min,W.max);return W.step&&(Ct=parseFloat(nb(Ct,W.min,W.step))),Ct=ky(Ct,W.min,W.max),Ct},[Z,E,rt]),bt=Q.useCallback(It=>{const Nt=rt.current;Nt.isInteractive&&(It=parseFloat(nb(It,Nt.min,nt)),It=ky(It,Nt.min,Nt.max),B(It))},[nt,B,rt]),mt=Q.useMemo(()=>({stepUp(It=nt){const Nt=E?K-It:K+It;bt(Nt)},stepDown(It=nt){const Nt=E?K+It:K-It;bt(Nt)},reset(){bt(a||0)},stepTo(It){bt(It)}}),[bt,E,K,nt,a]),dt=Q.useCallback(It=>{const Nt=rt.current,W={ArrowRight:()=>mt.stepUp(),ArrowUp:()=>mt.stepUp(),ArrowLeft:()=>mt.stepDown(),ArrowDown:()=>mt.stepDown(),PageUp:()=>mt.stepUp(G),PageDown:()=>mt.stepDown(G),Home:()=>bt(Nt.min),End:()=>bt(Nt.max)}[It.key];W&&(It.preventDefault(),It.stopPropagation(),W(It),Nt.eventSource="keyboard")},[mt,bt,G,rt]),kt=(t=P==null?void 0:P(K))!=null?t:x,Rt=sN(_t),{getThumbStyle:zt,rootStyle:z,trackStyle:O,innerTrackStyle:ot}=Q.useMemo(()=>{const It=rt.current,Nt=Rt??{width:0,height:0};return FD({isReversed:E,orientation:It.orientation,thumbRects:[Nt],thumbPercents:[vt]})},[E,Rt,vt,rt]),At=Q.useCallback(()=>{rt.current.focusThumbOnChange&&setTimeout(()=>{var Nt;return(Nt=_t.current)==null?void 0:Nt.focus()})},[rt]);_T(()=>{const It=rt.current;At(),It.eventSource==="keyboard"&&(N==null||N(It.value))},[K,N]);function Et(It){const Nt=wt(It);Nt!=null&&Nt!==rt.current.value&&B(Nt)}QD(Ot,{onPanSessionStart(It){const Nt=rt.current;Nt.isInteractive&&(j(!0),At(),Et(It),C==null||C(Nt.value))},onPanSessionEnd(){const It=rt.current;It.isInteractive&&(j(!1),N==null||N(It.value))},onPan(It){rt.current.isInteractive&&Et(It)}});const Tt=Q.useCallback((It={},Nt=null)=>({...It,...T,ref:Fa(Nt,Ot),tabIndex:-1,"aria-disabled":By(u),"data-focused":Il(Y),style:{...It.style,...z}}),[T,u,Y,z]),ne=Q.useCallback((It={},Nt=null)=>({...It,ref:Fa(Nt,St),id:F,"data-disabled":Il(u),style:{...It.style,...O}}),[u,F,O]),Ft=Q.useCallback((It={},Nt=null)=>({...It,ref:Nt,style:{...It.style,...ot}}),[ot]),Wt=Q.useCallback((It={},Nt=null)=>({...It,ref:Fa(Nt,_t),role:"slider",tabIndex:at?0:void 0,id:Qt,"data-active":Il(V),"aria-valuetext":kt,"aria-valuemin":e,"aria-valuemax":i,"aria-valuenow":K,"aria-orientation":c,"aria-disabled":By(u),"aria-readonly":By(p),"aria-label":M,"aria-labelledby":M?void 0:b,style:{...It.style,...zt(0)},onKeyDown:Hy(It.onKeyDown,dt),onFocus:Hy(It.onFocus,()=>q(!0)),onBlur:Hy(It.onBlur,()=>q(!1))}),[at,Qt,V,kt,e,i,K,c,u,p,M,b,zt,dt]),ge=Q.useCallback((It,Nt=null)=>{const qt=!(It.valuei),W=K>=It.value,gt=eb(It.value,e,i),jt={position:"absolute",pointerEvents:"none",...oN({orientation:c,vertical:{bottom:E?`${100-gt}%`:`${gt}%`},horizontal:{left:E?`${100-gt}%`:`${gt}%`}})};return{...It,ref:Nt,role:"presentation","aria-hidden":!0,"data-disabled":Il(u),"data-invalid":Il(!qt),"data-highlighted":Il(W),style:{...It.style,...jt}}},[u,E,i,e,c,K]),Dt=Q.useCallback((It={},Nt=null)=>({...It,ref:Nt,type:"hidden",value:K,name:S}),[S,K]);return{state:{value:K,isFocused:Y,isDragging:V},actions:mt,getRootProps:Tt,getTrackProps:ne,getInnerTrackProps:Ft,getThumbProps:Wt,getMarkerProps:ge,getInputProps:Dt}}function oN(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}function lN(n,t){return t"}),[hN,k0]=L0({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),WT=br((n,t)=>{var e;const i={...n,orientation:(e=n==null?void 0:n.orientation)!=null?e:"horizontal"},r=Cv("Slider",i),s=_f(i),{direction:a}=Tv();s.direction=a;const{getInputProps:o,getRootProps:l,...c}=aN(s),h=l(),u=o({},t);return X.jsx(cN,{value:c,children:X.jsx(hN,{value:r,children:X.jsxs(_n.div,{...h,className:Ef("chakra-slider",i.className),__css:r.container,children:[i.children,X.jsx("input",{...u})]})})})});WT.displayName="Slider";var jT=br((n,t)=>{const{getThumbProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__thumb",n.className),__css:i.thumb})});jT.displayName="SliderThumb";var XT=br((n,t)=>{const{getTrackProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__track",n.className),__css:i.track})});XT.displayName="SliderTrack";var qT=br((n,t)=>{const{getInnerTrackProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__filled-track",n.className),__css:i.filledTrack})});qT.displayName="SliderFilledTrack";var uN=br((n,t)=>{const{getMarkerProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__marker",n.className),__css:i.mark})});uN.displayName="SliderMark";var $T=br(function(t,e){const i=Cv("Switch",t),{spacing:r="0.5rem",children:s,...a}=_f(t),{getIndicatorProps:o,getInputProps:l,getCheckboxProps:c,getRootProps:h,getLabelProps:u}=qI(a),p=Q.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...i.container}),[i.container]),m=Q.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...i.track}),[i.track]),g=Q.useMemo(()=>({userSelect:"none",marginStart:r,...i.label}),[r,i.label]);return X.jsxs(_n.label,{...h(),className:rh("chakra-switch",t.className),__css:p,children:[X.jsx("input",{className:"chakra-switch__input",...l({},e)}),X.jsx(_n.span,{...c(),className:"chakra-switch__track",__css:m,children:X.jsx(_n.span,{__css:i.thumb,className:"chakra-switch__thumb",...o()})}),s&&X.jsx(_n.span,{className:"chakra-switch__label",...u(),__css:g,children:s})]})});$T.displayName="Switch";var fN={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},F_=n=>{var t;return((t=n.current)==null?void 0:t.ownerDocument)||document},Am=n=>{var t,e;return((e=(t=n.current)==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)||window};function dN(n={}){const{openDelay:t=0,closeDelay:e=0,closeOnClick:i=!0,closeOnMouseDown:r,closeOnScroll:s,closeOnPointerDown:a=r,closeOnEsc:o=!0,onOpen:l,onClose:c,placement:h,id:u,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:_,arrowPadding:y,modifiers:x,isDisabled:M,gutter:b,offset:S,direction:R,...T}=n,{isOpen:C,onOpen:N,onClose:P}=wD({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:c}),{referenceRef:E,getPopperProps:L,getArrowInnerProps:B,getArrowProps:V}=vD({enabled:C,placement:h,arrowPadding:y,modifiers:x,gutter:b,offset:S,direction:R}),j=Q.useId(),q=`tooltip-${u??j}`,at=Q.useRef(null),G=Q.useRef(),nt=Q.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=void 0)},[]),K=Q.useRef(),$=Q.useCallback(()=>{K.current&&(clearTimeout(K.current),K.current=void 0)},[]),ht=Q.useCallback(()=>{$(),P()},[P,$]),vt=pN(at,ht),Z=Q.useCallback(()=>{if(!M&&!G.current){C&&vt();const F=Am(at);G.current=F.setTimeout(N,t)}},[vt,M,C,N,t]),rt=Q.useCallback(()=>{nt();const F=Am(at);K.current=F.setTimeout(ht,e)},[e,ht,nt]),St=Q.useCallback(()=>{C&&i&&rt()},[i,rt,C]),_t=Q.useCallback(()=>{C&&a&&rt()},[a,rt,C]),Ot=Q.useCallback(F=>{C&&F.key==="Escape"&&rt()},[C,rt]);zy(()=>F_(at),"keydown",o?Ot:void 0),zy(()=>{if(!s)return null;const F=at.current;if(!F)return null;const wt=RT(F);return wt.localName==="body"?Am(at):wt},"scroll",()=>{C&&s&&ht()},{passive:!0,capture:!0}),Q.useEffect(()=>{M&&(nt(),C&&P())},[M,C,P,nt]),Q.useEffect(()=>()=>{nt(),$()},[nt,$]),zy(()=>at.current,"pointerleave",rt);const Xt=Q.useCallback((F={},wt=null)=>({...F,ref:Fa(at,wt,E),onPointerEnter:li(F.onPointerEnter,mt=>{mt.pointerType!=="touch"&&Z()}),onClick:li(F.onClick,St),onPointerDown:li(F.onPointerDown,_t),onFocus:li(F.onFocus,Z),onBlur:li(F.onBlur,rt),"aria-describedby":C?q:void 0}),[Z,rt,_t,C,q,St,E]),Gt=Q.useCallback((F={},wt=null)=>L({...F,style:{...F.style,[Yn.arrowSize.var]:g?`${g}px`:void 0,[Yn.arrowShadowColor.var]:_}},wt),[L,g,_]),Qt=Q.useCallback((F={},wt=null)=>{const bt={...F.style,position:"relative",transformOrigin:Yn.transformOrigin.varRef};return{ref:wt,...T,...F,id:q,role:"tooltip",style:bt}},[T,q]);return{isOpen:C,show:Z,hide:rt,getTriggerProps:Xt,getTooltipProps:Qt,getTooltipPositionerProps:Gt,getArrowProps:V,getArrowInnerProps:B}}var Wy="chakra-ui:close-tooltip";function pN(n,t){return Q.useEffect(()=>{const e=F_(n);return e.addEventListener(Wy,t),()=>e.removeEventListener(Wy,t)},[t,n]),()=>{const e=F_(n),i=Am(n);e.dispatchEvent(new i.CustomEvent(Wy))}}function mN(n,t=[]){const e=Object.assign({},n);for(const i of t)i in e&&delete e[i];return e}function gN(n,t){const e={};for(const i of t)i in n&&(e[i]=n[i]);return e}var yN=_n(Av.div),Af=br((n,t)=>{var e,i;const r=xT("Tooltip",n),s=_f(n),a=Tv(),{children:o,label:l,shouldWrapChildren:c,"aria-label":h,hasArrow:u,bg:p,portalProps:m,background:g,backgroundColor:_,bgColor:y,motionProps:x,...M}=s,b=(i=(e=g??_)!=null?e:p)!=null?i:y;if(b){r.bg=b;const L=eI(a,"colors",b);r[Yn.arrowBg.var]=L}const S=dN({...M,direction:a.direction}),R=typeof o=="string"||c;let T;if(R)T=X.jsx(_n.span,{display:"inline-block",tabIndex:0,...S.getTriggerProps(),children:o});else{const L=Q.Children.only(o);T=Q.cloneElement(L,S.getTriggerProps(L.props,L.ref))}const C=!!h,N=S.getTooltipProps({},t),P=C?mN(N,["role","id"]):N,E=gN(N,["role","id"]);return l?X.jsxs(X.Fragment,{children:[T,X.jsx(Ev,{children:S.isOpen&&X.jsx(nI,{...m,children:X.jsx(_n.div,{...S.getTooltipPositionerProps(),__css:{zIndex:r.zIndex,pointerEvents:"none"},children:X.jsxs(yN,{variants:fN,initial:"exit",animate:"enter",exit:"exit",...x,...P,__css:r,children:[l,C&&X.jsx(_n.span,{srOnly:!0,...E,children:h}),u&&X.jsx(_n.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:X.jsx(_n.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:r.bg}})})]})})})})]}):X.jsx(X.Fragment,{children:o})});Af.displayName="Tooltip";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/raw-Dt1HMqYc.js","assets/basedecoder-DvumDe3Y.js","assets/lzw-DpvbRwG5.js","assets/jpeg-CdeCw_eT.js","assets/deflate-B1g-JsHt.js","assets/index-oAnJD5lr.js","assets/index-BZpzF2_o.css","assets/chunk-7OLJDQMT-E6ec7czU.js","assets/Footer-CN0UQ_Me.js","assets/location-BLLHg7ZW.js","assets/chunk-ZHMYA64R-n90-wtrP.js","assets/packbits-DQnG8s9w.js","assets/lerc-DxCAHPKn.js","assets/webimage-BcnuJlio.js"])))=>i.map(i=>d[i]); +var JP=Object.defineProperty;var QP=(n,t,e)=>t in n?JP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var as=(n,t,e)=>QP(n,typeof t!="symbol"?t+"":t,e);import{h as yr,r as Q,w as tI,j as X,A as Ev,m as Av,i as rh,f as br,k as xT,o as _f,b as _n,l as Oy,n as _T,p as sn,q as li,s as L0,t as Tv,v as D0,x as Cv,y as eI,P as nI,e as sh,z as vf,_ as ll,R as N0,I as iI,B as rI,C as sI,M as aI}from"./index-oAnJD5lr.js";import{C as oI,a as lI,H as cI,b as hI}from"./chunk-7OLJDQMT-E6ec7czU.js";import{w as km,h as lu,i as R_,m as Fa,j as uI,M as Rv,k as fI,l as dI,n as pI,o as mI,u as zm,B as $s,b as Pv,c as vT,d as Iv,e as Lv,f as Dv,T as Lo,g as zu,U as MT,a as No,F as gI}from"./Footer-CN0UQ_Me.js";import{u as wT,a as yI,b as xI,c as _I,p as vI,d as Bm,F as Fy,I as Uy,M as MI,e as wI,x as bI}from"./location-BLLHg7ZW.js";import{S as SI}from"./chunk-ZHMYA64R-n90-wtrP.js";const bT=1/60*1e3,EI=typeof performance<"u"?()=>performance.now():()=>Date.now(),ST=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(EI()),bT);function AI(n){let t=[],e=[],i=0,r=!1,s=!1;const a=new WeakSet,o={schedule:(l,c=!1,h=!1)=>{const u=h&&r,p=u?t:e;return c&&a.add(l),p.indexOf(l)===-1&&(p.push(l),u&&r&&(i=t.length)),l},cancel:l=>{const c=e.indexOf(l);c!==-1&&e.splice(c,1),a.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[t,e]=[e,t],e.length=0,i=t.length,i)for(let c=0;c(n[t]=AI(()=>Bu=!0),n),{}),CI=Mf.reduce((n,t)=>{const e=O0[t];return n[t]=(i,r=!1,s=!1)=>(Bu||II(),e.schedule(i,r,s)),n},{}),RI=Mf.reduce((n,t)=>(n[t]=O0[t].cancel,n),{});Mf.reduce((n,t)=>(n[t]=()=>O0[t].process(Rc),n),{});const PI=n=>O0[n].process(Rc),ET=n=>{Bu=!1,Rc.delta=P_?bT:Math.max(Math.min(n-Rc.timestamp,TI),1),Rc.timestamp=n,I_=!0,Mf.forEach(PI),I_=!1,Bu&&(P_=!1,ST(ET))},II=()=>{Bu=!0,P_=!0,I_||ST(ET)},Yw=()=>Rc;function LI(n){const{value:t,defaultValue:e,onChange:i,shouldUpdate:r=(p,m)=>p!==m}=n,s=yr(i),a=yr(r),[o,l]=Q.useState(e),c=t!==void 0,h=c?t:o,u=yr(p=>{const g=typeof p=="function"?p(h):p;a(h,g)&&(c||l(g),s(g))},[c,s,h,a]);return[h,u]}var DI=n=>n!=null&&parseInt(n.toString(),10)>0,Zw={exit:{height:{duration:.2,ease:lu.ease},opacity:{duration:.3,ease:lu.ease}},enter:{height:{duration:.3,ease:lu.ease},opacity:{duration:.4,ease:lu.ease}}},NI={exit:({animateOpacity:n,startingHeight:t,transition:e,transitionEnd:i,delay:r})=>{var s;return{...n&&{opacity:DI(t)?1:0},height:t,transitionEnd:i==null?void 0:i.exit,transition:(s=e==null?void 0:e.exit)!=null?s:km.exit(Zw.exit,r)}},enter:({animateOpacity:n,endingHeight:t,transition:e,transitionEnd:i,delay:r})=>{var s;return{...n&&{opacity:1},height:t,transitionEnd:i==null?void 0:i.enter,transition:(s=e==null?void 0:e.enter)!=null?s:km.enter(Zw.enter,r)}}},AT=Q.forwardRef((n,t)=>{const{in:e,unmountOnExit:i,animateOpacity:r=!0,startingHeight:s=0,endingHeight:a="auto",style:o,className:l,transition:c,transitionEnd:h,...u}=n,[p,m]=Q.useState(!1);Q.useEffect(()=>{const M=setTimeout(()=>{m(!0)});return()=>clearTimeout(M)},[]),tI({condition:Number(s)>0&&!!i,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const g=parseFloat(s.toString())>0,_={startingHeight:s,endingHeight:a,animateOpacity:r,transition:p?c:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:i?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:g?"block":"none"}}},y=i?e:!0,x=e||i?"enter":"exit";return X.jsx(Ev,{initial:!1,custom:_,children:y&&X.jsx(Av.div,{ref:t,...u,className:rh("chakra-collapse",l),style:{overflow:"hidden",display:"block",...o},custom:_,variants:NI,initial:i?"exit":!1,animate:x,exit:"exit"})})});AT.displayName="Collapse";var Kw={exit:{duration:.15,ease:lu.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},OI={exit:({direction:n,transition:t,transitionEnd:e,delay:i})=>{var r;const{exit:s}=R_({direction:n});return{...s,transition:(r=t==null?void 0:t.exit)!=null?r:km.exit(Kw.exit,i),transitionEnd:e==null?void 0:e.exit}},enter:({direction:n,transitionEnd:t,transition:e,delay:i})=>{var r;const{enter:s}=R_({direction:n});return{...s,transition:(r=e==null?void 0:e.enter)!=null?r:km.enter(Kw.enter,i),transitionEnd:t==null?void 0:t.enter}}},TT=Q.forwardRef(function(t,e){const{direction:i="right",style:r,unmountOnExit:s,in:a,className:o,transition:l,transitionEnd:c,delay:h,motionProps:u,...p}=t,m=R_({direction:i}),g=Object.assign({position:"fixed"},m.position,r),_=s?a&&s:!0,y=a||s?"enter":"exit",x={transitionEnd:c,transition:l,direction:i,delay:h};return X.jsx(Ev,{custom:x,children:_&&X.jsx(Av.div,{...p,ref:e,initial:"exit",className:rh("chakra-slide",o),animate:y,exit:"exit",custom:x,variants:OI,style:g,...u})})});TT.displayName="Slide";var yu=br(function(t,e){var i;const r=xT("FormLabel",t),s=_f(t),{className:a,children:o,requiredIndicator:l=X.jsx(CT,{}),optionalIndicator:c=null,...h}=s,u=wT(),p=(i=u==null?void 0:u.getLabelProps(h,e))!=null?i:{ref:e,...h};return X.jsxs(_n.label,{...p,className:rh("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...r},children:[o,u!=null&&u.isRequired?l:c]})});yu.displayName="FormLabel";var CT=br(function(t,e){const i=wT(),r=yI();if(!(i!=null&&i.isRequired))return null;const s=rh("chakra-form__required-indicator",t.className);return X.jsx(_n.span,{...i==null?void 0:i.getRequiredIndicatorProps(t,e),__css:r.requiredIndicator,className:s})});CT.displayName="RequiredIndicator";var FI={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},UI=()=>typeof document<"u",Jw=!1,wf=null,Yo=!1,L_=!1,D_=new Set;function Nv(n,t){D_.forEach(e=>e(n,t))}var kI=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function zI(n){return!(n.metaKey||!kI&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function Qw(n){Yo=!0,zI(n)&&(wf="keyboard",Nv("keyboard",n))}function Rl(n){if(wf="pointer",n.type==="mousedown"||n.type==="pointerdown"){Yo=!0;const t=n.composedPath?n.composedPath()[0]:n.target;let e=!1;try{e=t.matches(":focus-visible")}catch{}if(e)return;Nv("pointer",n)}}function BI(n){return n.mozInputSource===0&&n.isTrusted?!0:n.detail===0&&!n.pointerType}function HI(n){BI(n)&&(Yo=!0,wf="virtual")}function GI(n){n.target===window||n.target===document||(!Yo&&!L_&&(wf="virtual",Nv("virtual",n)),Yo=!1,L_=!1)}function VI(){Yo=!1,L_=!0}function tb(){return wf!=="pointer"}function WI(){if(!UI()||Jw)return;const{focus:n}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){Yo=!0,n.apply(this,e)},document.addEventListener("keydown",Qw,!0),document.addEventListener("keyup",Qw,!0),document.addEventListener("click",HI,!0),window.addEventListener("focus",GI,!0),window.addEventListener("blur",VI,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Rl,!0),document.addEventListener("pointermove",Rl,!0),document.addEventListener("pointerup",Rl,!0)):(document.addEventListener("mousedown",Rl,!0),document.addEventListener("mousemove",Rl,!0),document.addEventListener("mouseup",Rl,!0)),Jw=!0}function jI(n){WI(),n(tb());const t=()=>n(tb());return D_.add(t),()=>{D_.delete(t)}}function XI(n,t=[]){const e=Object.assign({},n);for(const i of t)i in e&&delete e[i];return e}function qI(n={}){const t=xI(n),{isDisabled:e,isReadOnly:i,isRequired:r,isInvalid:s,id:a,onBlur:o,onFocus:l,"aria-describedby":c}=t,{defaultChecked:h,isChecked:u,isFocusable:p,onChange:m,isIndeterminate:g,name:_,value:y,tabIndex:x=void 0,"aria-label":M,"aria-labelledby":b,"aria-invalid":S,...R}=n,C=XI(R,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),T=yr(m),N=yr(o),P=yr(l),[E,L]=Q.useState(!1),[B,V]=Q.useState(!1),[j,Y]=Q.useState(!1),[q,at]=Q.useState(!1);Q.useEffect(()=>jI(L),[]);const G=Q.useRef(null),[tt,K]=Q.useState(!0),[$,ht]=Q.useState(!!h),vt=u!==void 0,Z=vt?u:$,rt=Q.useCallback(mt=>{if(i||e){mt.preventDefault();return}vt||ht(Z?mt.target.checked:g?!0:mt.target.checked),T==null||T(mt)},[i,e,Z,vt,g,T]);Oy(()=>{G.current&&(G.current.indeterminate=!!g)},[g]),_T(()=>{e&&V(!1)},[e,V]),Oy(()=>{const mt=G.current;if(!(mt!=null&&mt.form))return;const dt=()=>{ht(!!h)};return mt.form.addEventListener("reset",dt),()=>{var kt;return(kt=mt.form)==null?void 0:kt.removeEventListener("reset",dt)}},[]);const St=e&&!p,_t=Q.useCallback(mt=>{mt.key===" "&&at(!0)},[at]),Ot=Q.useCallback(mt=>{mt.key===" "&&at(!1)},[at]);Oy(()=>{if(!G.current)return;G.current.checked!==Z&&ht(G.current.checked)},[G.current]);const Xt=Q.useCallback((mt={},dt=null)=>{const kt=Rt=>{B&&Rt.preventDefault(),at(!0)};return{...mt,ref:dt,"data-active":sn(q),"data-hover":sn(j),"data-checked":sn(Z),"data-focus":sn(B),"data-focus-visible":sn(B&&E),"data-indeterminate":sn(g),"data-disabled":sn(e),"data-invalid":sn(s),"data-readonly":sn(i),"aria-hidden":!0,onMouseDown:li(mt.onMouseDown,kt),onMouseUp:li(mt.onMouseUp,()=>at(!1)),onMouseEnter:li(mt.onMouseEnter,()=>Y(!0)),onMouseLeave:li(mt.onMouseLeave,()=>Y(!1))}},[q,Z,e,B,E,j,g,s,i]),Gt=Q.useCallback((mt={},dt=null)=>({...mt,ref:dt,"data-active":sn(q),"data-hover":sn(j),"data-checked":sn(Z),"data-focus":sn(B),"data-focus-visible":sn(B&&E),"data-indeterminate":sn(g),"data-disabled":sn(e),"data-invalid":sn(s),"data-readonly":sn(i)}),[q,Z,e,B,E,j,g,s,i]),Qt=Q.useCallback((mt={},dt=null)=>({...C,...mt,ref:Fa(dt,kt=>{kt&&K(kt.tagName==="LABEL")}),onClick:li(mt.onClick,()=>{var kt;tt||((kt=G.current)==null||kt.click(),requestAnimationFrame(()=>{var Rt;(Rt=G.current)==null||Rt.focus({preventScroll:!0})}))}),"data-disabled":sn(e),"data-checked":sn(Z),"data-invalid":sn(s)}),[C,e,Z,s,tt]),F=Q.useCallback((mt={},dt=null)=>({...mt,ref:Fa(G,dt),type:"checkbox",name:_,value:y,id:a,tabIndex:x,onChange:li(mt.onChange,rt),onBlur:li(mt.onBlur,N,()=>V(!1)),onFocus:li(mt.onFocus,P,()=>V(!0)),onKeyDown:li(mt.onKeyDown,_t),onKeyUp:li(mt.onKeyUp,Ot),required:r,checked:Z,disabled:St,readOnly:i,"aria-label":M,"aria-labelledby":b,"aria-invalid":S?!!S:s,"aria-describedby":c,"aria-disabled":e,style:FI}),[_,y,a,rt,N,P,_t,Ot,r,Z,St,i,M,b,S,s,c,e,x]),wt=Q.useCallback((mt={},dt=null)=>({...mt,ref:dt,onMouseDown:li(mt.onMouseDown,$I),"data-disabled":sn(e),"data-checked":sn(Z),"data-invalid":sn(s)}),[Z,e,s]);return{state:{isInvalid:s,isFocused:B,isChecked:Z,isActive:q,isHovered:j,isIndeterminate:g,isDisabled:e,isReadOnly:i,isRequired:r},getRootProps:Qt,getCheckboxProps:Xt,getIndicatorProps:Gt,getInputProps:F,getLabelProps:wt,htmlProps:C}}function $I(n){n.preventDefault(),n.stopPropagation()}function YI(n){const t=parseFloat(n);return typeof t!="number"||Number.isNaN(t)?0:t}function ZI(n,t){let e=YI(n);const i=10**(t??10);return e=Math.round(e*i)/i,t?e.toFixed(t):e.toString()}function KI(n){if(!Number.isFinite(n))return 0;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e+=1;return e}function eb(n,t,e){return(n-t)*100/(e-t)}function JI(n,t,e){return(e-t)*n+t}function nb(n,t,e){const i=Math.round((n-t)/e)*e+t,r=KI(e);return ZI(i,r)}function ky(n,t,e){return n==null?n:(e{const s=typeof n=="function"?n():n??document;if(!(!e||!s))return s.addEventListener(t,r,i),()=>{s.removeEventListener(t,r,i)}},[t,n,i,r,e]),()=>{const s=typeof n=="function"?n():n??document;s==null||s.removeEventListener(t,r,i)}}function QI(n){const t=n.ownerDocument.defaultView||window,{overflow:e,overflowX:i,overflowY:r}=t.getComputedStyle(n);return/auto|scroll|overlay|hidden/.test(e+r+i)}function tL(n){return n.localName==="html"?n:n.assignedSlot||n.parentElement||n.ownerDocument.documentElement}function RT(n){return["html","body","#document"].includes(n.localName)?n.ownerDocument.body:uI(n)&&QI(n)?n:RT(tL(n))}var Pl=(n,t)=>({var:n,varRef:t?`var(${n}, ${t})`:`var(${n})`}),Yn={arrowShadowColor:Pl("--popper-arrow-shadow-color"),arrowSize:Pl("--popper-arrow-size","8px"),arrowSizeHalf:Pl("--popper-arrow-size-half"),arrowBg:Pl("--popper-arrow-bg"),transformOrigin:Pl("--popper-transform-origin"),arrowOffset:Pl("--popper-arrow-offset")};function eL(n){if(n.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(n.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var nL={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},iL=n=>nL[n],ib={scroll:!0,resize:!0};function rL(n){let t;return typeof n=="object"?t={enabled:!0,options:{...ib,...n}}:t={enabled:n,options:ib},t}var sL={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:n})=>{n.styles.popper.width=`${n.rects.reference.width}px`},effect:({state:n})=>()=>{const t=n.elements.reference;n.elements.popper.style.width=`${t.offsetWidth}px`}},aL={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:n})=>{rb(n)},effect:({state:n})=>()=>{rb(n)}},rb=n=>{n.elements.popper.style.setProperty(Yn.transformOrigin.var,iL(n.placement))},oL={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:n})=>{lL(n)}},lL=n=>{var t;if(!n.placement)return;const e=cL(n.placement);if((t=n.elements)!=null&&t.arrow&&e){Object.assign(n.elements.arrow.style,{[e.property]:e.value,width:Yn.arrowSize.varRef,height:Yn.arrowSize.varRef,zIndex:-1});const i={[Yn.arrowSizeHalf.var]:`calc(${Yn.arrowSize.varRef} / 2 - 1px)`,[Yn.arrowOffset.var]:`calc(${Yn.arrowSizeHalf.varRef} * -1)`};for(const r in i)n.elements.arrow.style.setProperty(r,i[r])}},cL=n=>{if(n.startsWith("top"))return{property:"bottom",value:Yn.arrowOffset.varRef};if(n.startsWith("bottom"))return{property:"top",value:Yn.arrowOffset.varRef};if(n.startsWith("left"))return{property:"right",value:Yn.arrowOffset.varRef};if(n.startsWith("right"))return{property:"left",value:Yn.arrowOffset.varRef}},hL={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:n})=>{sb(n)},effect:({state:n})=>()=>{sb(n)}},sb=n=>{if(!n.elements.arrow)return;const t=n.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const e=eL(n.placement);e&&t.style.setProperty("--popper-arrow-default-shadow",e),Object.assign(t.style,{transform:"rotate(45deg)",background:Yn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},uL={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},fL={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function dL(n,t="ltr"){var e,i;const r=((e=uL[n])==null?void 0:e[t])||n;return t==="ltr"?r:(i=fL[n])!=null?i:r}var Fi="top",_r="bottom",vr="right",Ui="left",Ov="auto",bf=[Fi,_r,vr,Ui],zc="start",Hu="end",pL="clippingParents",PT="viewport",kh="popper",mL="reference",ab=bf.reduce(function(n,t){return n.concat([t+"-"+zc,t+"-"+Hu])},[]),IT=[].concat(bf,[Ov]).reduce(function(n,t){return n.concat([t,t+"-"+zc,t+"-"+Hu])},[]),gL="beforeRead",yL="read",xL="afterRead",_L="beforeMain",vL="main",ML="afterMain",wL="beforeWrite",bL="write",SL="afterWrite",EL=[gL,yL,xL,_L,vL,ML,wL,bL,SL];function As(n){return n?(n.nodeName||"").toLowerCase():null}function er(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Zo(n){var t=er(n).Element;return n instanceof t||n instanceof Element}function xr(n){var t=er(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Fv(n){if(typeof ShadowRoot>"u")return!1;var t=er(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function AL(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},r=t.attributes[e]||{},s=t.elements[e];!xr(s)||!As(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var o=r[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function TL(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],s=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!xr(r)||!As(r)||(Object.assign(r.style,o),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}const CL={name:"applyStyles",enabled:!0,phase:"write",fn:AL,effect:TL,requires:["computeStyles"]};function _s(n){return n.split("-")[0]}var Vo=Math.max,Hm=Math.min,Bc=Math.round;function N_(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function LT(){return!/^((?!chrome|android).)*safari/i.test(N_())}function Hc(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),r=1,s=1;t&&xr(n)&&(r=n.offsetWidth>0&&Bc(i.width)/n.offsetWidth||1,s=n.offsetHeight>0&&Bc(i.height)/n.offsetHeight||1);var a=Zo(n)?er(n):window,o=a.visualViewport,l=!LT()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/r,h=(i.top+(l&&o?o.offsetTop:0))/s,u=i.width/r,p=i.height/s;return{width:u,height:p,top:h,right:c+u,bottom:h+p,left:c,x:c,y:h}}function Uv(n){var t=Hc(n),e=n.offsetWidth,i=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:i}}function DT(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Fv(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ra(n){return er(n).getComputedStyle(n)}function RL(n){return["table","td","th"].indexOf(As(n))>=0}function $a(n){return((Zo(n)?n.ownerDocument:n.document)||window.document).documentElement}function F0(n){return As(n)==="html"?n:n.assignedSlot||n.parentNode||(Fv(n)?n.host:null)||$a(n)}function ob(n){return!xr(n)||ra(n).position==="fixed"?null:n.offsetParent}function PL(n){var t=/firefox/i.test(N_()),e=/Trident/i.test(N_());if(e&&xr(n)){var i=ra(n);if(i.position==="fixed")return null}var r=F0(n);for(Fv(r)&&(r=r.host);xr(r)&&["html","body"].indexOf(As(r))<0;){var s=ra(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Sf(n){for(var t=er(n),e=ob(n);e&&RL(e)&&ra(e).position==="static";)e=ob(e);return e&&(As(e)==="html"||As(e)==="body"&&ra(e).position==="static")?t:e||PL(n)||t}function kv(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function xu(n,t,e){return Vo(n,Hm(t,e))}function IL(n,t,e){var i=xu(n,t,e);return i>e?e:i}function NT(){return{top:0,right:0,bottom:0,left:0}}function OT(n){return Object.assign({},NT(),n)}function FT(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var LL=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,OT(typeof t!="number"?t:FT(t,bf))};function DL(n){var t,e=n.state,i=n.name,r=n.options,s=e.elements.arrow,a=e.modifiersData.popperOffsets,o=_s(e.placement),l=kv(o),c=[Ui,vr].indexOf(o)>=0,h=c?"height":"width";if(!(!s||!a)){var u=LL(r.padding,e),p=Uv(s),m=l==="y"?Fi:Ui,g=l==="y"?_r:vr,_=e.rects.reference[h]+e.rects.reference[l]-a[l]-e.rects.popper[h],y=a[l]-e.rects.reference[l],x=Sf(s),M=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,b=_/2-y/2,S=u[m],R=M-p[h]-u[g],C=M/2-p[h]/2+b,T=xu(S,C,R),N=l;e.modifiersData[i]=(t={},t[N]=T,t.centerOffset=T-C,t)}}function NL(n){var t=n.state,e=n.options,i=e.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||DT(t.elements.popper,r)&&(t.elements.arrow=r))}const OL={name:"arrow",enabled:!0,phase:"main",fn:DL,effect:NL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gc(n){return n.split("-")[1]}var FL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function UL(n,t){var e=n.x,i=n.y,r=t.devicePixelRatio||1;return{x:Bc(e*r)/r||0,y:Bc(i*r)/r||0}}function lb(n){var t,e=n.popper,i=n.popperRect,r=n.placement,s=n.variation,a=n.offsets,o=n.position,l=n.gpuAcceleration,c=n.adaptive,h=n.roundOffsets,u=n.isFixed,p=a.x,m=p===void 0?0:p,g=a.y,_=g===void 0?0:g,y=typeof h=="function"?h({x:m,y:_}):{x:m,y:_};m=y.x,_=y.y;var x=a.hasOwnProperty("x"),M=a.hasOwnProperty("y"),b=Ui,S=Fi,R=window;if(c){var C=Sf(e),T="clientHeight",N="clientWidth";if(C===er(e)&&(C=$a(e),ra(C).position!=="static"&&o==="absolute"&&(T="scrollHeight",N="scrollWidth")),C=C,r===Fi||(r===Ui||r===vr)&&s===Hu){S=_r;var P=u&&C===R&&R.visualViewport?R.visualViewport.height:C[T];_-=P-i.height,_*=l?1:-1}if(r===Ui||(r===Fi||r===_r)&&s===Hu){b=vr;var E=u&&C===R&&R.visualViewport?R.visualViewport.width:C[N];m-=E-i.width,m*=l?1:-1}}var L=Object.assign({position:o},c&&FL),B=h===!0?UL({x:m,y:_},er(e)):{x:m,y:_};if(m=B.x,_=B.y,l){var V;return Object.assign({},L,(V={},V[S]=M?"0":"",V[b]=x?"0":"",V.transform=(R.devicePixelRatio||1)<=1?"translate("+m+"px, "+_+"px)":"translate3d("+m+"px, "+_+"px, 0)",V))}return Object.assign({},L,(t={},t[S]=M?_+"px":"",t[b]=x?m+"px":"",t.transform="",t))}function kL(n){var t=n.state,e=n.options,i=e.gpuAcceleration,r=i===void 0?!0:i,s=e.adaptive,a=s===void 0?!0:s,o=e.roundOffsets,l=o===void 0?!0:o,c={placement:_s(t.placement),variation:Gc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,lb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,lb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const zL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kL,data:{}};var Zd={passive:!0};function BL(n){var t=n.state,e=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,o=a===void 0?!0:a,l=er(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(h){h.addEventListener("scroll",e.update,Zd)}),o&&l.addEventListener("resize",e.update,Zd),function(){s&&c.forEach(function(h){h.removeEventListener("scroll",e.update,Zd)}),o&&l.removeEventListener("resize",e.update,Zd)}}const HL={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:BL,data:{}};var GL={left:"right",right:"left",bottom:"top",top:"bottom"};function bm(n){return n.replace(/left|right|bottom|top/g,function(t){return GL[t]})}var VL={start:"end",end:"start"};function cb(n){return n.replace(/start|end/g,function(t){return VL[t]})}function zv(n){var t=er(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function Bv(n){return Hc($a(n)).left+zv(n).scrollLeft}function WL(n,t){var e=er(n),i=$a(n),r=e.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(r){s=r.width,a=r.height;var c=LT();(c||!c&&t==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}return{width:s,height:a,x:o+Bv(n),y:l}}function jL(n){var t,e=$a(n),i=zv(n),r=(t=n.ownerDocument)==null?void 0:t.body,s=Vo(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Vo(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-i.scrollLeft+Bv(n),l=-i.scrollTop;return ra(r||e).direction==="rtl"&&(o+=Vo(e.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function Hv(n){var t=ra(n),e=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+i)}function UT(n){return["html","body","#document"].indexOf(As(n))>=0?n.ownerDocument.body:xr(n)&&Hv(n)?n:UT(F0(n))}function _u(n,t){var e;t===void 0&&(t=[]);var i=UT(n),r=i===((e=n.ownerDocument)==null?void 0:e.body),s=er(i),a=r?[s].concat(s.visualViewport||[],Hv(i)?i:[]):i,o=t.concat(a);return r?o:o.concat(_u(F0(a)))}function O_(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function XL(n,t){var e=Hc(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function hb(n,t,e){return t===PT?O_(WL(n,e)):Zo(t)?XL(t,e):O_(jL($a(n)))}function qL(n){var t=_u(F0(n)),e=["absolute","fixed"].indexOf(ra(n).position)>=0,i=e&&xr(n)?Sf(n):n;return Zo(i)?t.filter(function(r){return Zo(r)&&DT(r,i)&&As(r)!=="body"}):[]}function $L(n,t,e,i){var r=t==="clippingParents"?qL(n):[].concat(t),s=[].concat(r,[e]),a=s[0],o=s.reduce(function(l,c){var h=hb(n,c,i);return l.top=Vo(h.top,l.top),l.right=Hm(h.right,l.right),l.bottom=Hm(h.bottom,l.bottom),l.left=Vo(h.left,l.left),l},hb(n,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function kT(n){var t=n.reference,e=n.element,i=n.placement,r=i?_s(i):null,s=i?Gc(i):null,a=t.x+t.width/2-e.width/2,o=t.y+t.height/2-e.height/2,l;switch(r){case Fi:l={x:a,y:t.y-e.height};break;case _r:l={x:a,y:t.y+t.height};break;case vr:l={x:t.x+t.width,y:o};break;case Ui:l={x:t.x-e.width,y:o};break;default:l={x:t.x,y:t.y}}var c=r?kv(r):null;if(c!=null){var h=c==="y"?"height":"width";switch(s){case zc:l[c]=l[c]-(t[h]/2-e[h]/2);break;case Hu:l[c]=l[c]+(t[h]/2-e[h]/2);break}}return l}function Gu(n,t){t===void 0&&(t={});var e=t,i=e.placement,r=i===void 0?n.placement:i,s=e.strategy,a=s===void 0?n.strategy:s,o=e.boundary,l=o===void 0?pL:o,c=e.rootBoundary,h=c===void 0?PT:c,u=e.elementContext,p=u===void 0?kh:u,m=e.altBoundary,g=m===void 0?!1:m,_=e.padding,y=_===void 0?0:_,x=OT(typeof y!="number"?y:FT(y,bf)),M=p===kh?mL:kh,b=n.rects.popper,S=n.elements[g?M:p],R=$L(Zo(S)?S:S.contextElement||$a(n.elements.popper),l,h,a),C=Hc(n.elements.reference),T=kT({reference:C,element:b,strategy:"absolute",placement:r}),N=O_(Object.assign({},b,T)),P=p===kh?N:C,E={top:R.top-P.top+x.top,bottom:P.bottom-R.bottom+x.bottom,left:R.left-P.left+x.left,right:P.right-R.right+x.right},L=n.modifiersData.offset;if(p===kh&&L){var B=L[r];Object.keys(E).forEach(function(V){var j=[vr,_r].indexOf(V)>=0?1:-1,Y=[Fi,_r].indexOf(V)>=0?"y":"x";E[V]+=B[Y]*j})}return E}function YL(n,t){t===void 0&&(t={});var e=t,i=e.placement,r=e.boundary,s=e.rootBoundary,a=e.padding,o=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?IT:l,h=Gc(i),u=h?o?ab:ab.filter(function(g){return Gc(g)===h}):bf,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var m=p.reduce(function(g,_){return g[_]=Gu(n,{placement:_,boundary:r,rootBoundary:s,padding:a})[_s(_)],g},{});return Object.keys(m).sort(function(g,_){return m[g]-m[_]})}function ZL(n){if(_s(n)===Ov)return[];var t=bm(n);return[cb(n),t,cb(t)]}function KL(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var r=e.mainAxis,s=r===void 0?!0:r,a=e.altAxis,o=a===void 0?!0:a,l=e.fallbackPlacements,c=e.padding,h=e.boundary,u=e.rootBoundary,p=e.altBoundary,m=e.flipVariations,g=m===void 0?!0:m,_=e.allowedAutoPlacements,y=t.options.placement,x=_s(y),M=x===y,b=l||(M||!g?[bm(y)]:ZL(y)),S=[y].concat(b).reduce(function(Z,rt){return Z.concat(_s(rt)===Ov?YL(t,{placement:rt,boundary:h,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:_}):rt)},[]),R=t.rects.reference,C=t.rects.popper,T=new Map,N=!0,P=S[0],E=0;E=0,Y=j?"width":"height",q=Gu(t,{placement:L,boundary:h,rootBoundary:u,altBoundary:p,padding:c}),at=j?V?vr:Ui:V?_r:Fi;R[Y]>C[Y]&&(at=bm(at));var G=bm(at),tt=[];if(s&&tt.push(q[B]<=0),o&&tt.push(q[at]<=0,q[G]<=0),tt.every(function(Z){return Z})){P=L,N=!1;break}T.set(L,tt)}if(N)for(var K=g?3:1,$=function(rt){var St=S.find(function(_t){var Ot=T.get(_t);if(Ot)return Ot.slice(0,rt).every(function(Xt){return Xt})});if(St)return P=St,"break"},ht=K;ht>0;ht--){var vt=$(ht);if(vt==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const JL={name:"flip",enabled:!0,phase:"main",fn:KL,requiresIfExists:["offset"],data:{_skip:!1}};function ub(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function fb(n){return[Fi,vr,_r,Ui].some(function(t){return n[t]>=0})}function QL(n){var t=n.state,e=n.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=Gu(t,{elementContext:"reference"}),o=Gu(t,{altBoundary:!0}),l=ub(a,i),c=ub(o,r,s),h=fb(l),u=fb(c);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const tD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:QL};function eD(n,t,e){var i=_s(n),r=[Ui,Fi].indexOf(i)>=0?-1:1,s=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=s[0],o=s[1];return a=a||0,o=(o||0)*r,[Ui,vr].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function nD(n){var t=n.state,e=n.options,i=n.name,r=e.offset,s=r===void 0?[0,0]:r,a=IT.reduce(function(h,u){return h[u]=eD(u,t.rects,s),h},{}),o=a[t.placement],l=o.x,c=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}const iD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:nD};function rD(n){var t=n.state,e=n.name;t.modifiersData[e]=kT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const sD={name:"popperOffsets",enabled:!0,phase:"read",fn:rD,data:{}};function aD(n){return n==="x"?"y":"x"}function oD(n){var t=n.state,e=n.options,i=n.name,r=e.mainAxis,s=r===void 0?!0:r,a=e.altAxis,o=a===void 0?!1:a,l=e.boundary,c=e.rootBoundary,h=e.altBoundary,u=e.padding,p=e.tether,m=p===void 0?!0:p,g=e.tetherOffset,_=g===void 0?0:g,y=Gu(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),x=_s(t.placement),M=Gc(t.placement),b=!M,S=kv(x),R=aD(S),C=t.modifiersData.popperOffsets,T=t.rects.reference,N=t.rects.popper,P=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,E=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(C){if(s){var V,j=S==="y"?Fi:Ui,Y=S==="y"?_r:vr,q=S==="y"?"height":"width",at=C[S],G=at+y[j],tt=at-y[Y],K=m?-N[q]/2:0,$=M===zc?T[q]:N[q],ht=M===zc?-N[q]:-T[q],vt=t.elements.arrow,Z=m&&vt?Uv(vt):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:NT(),St=rt[j],_t=rt[Y],Ot=xu(0,T[q],Z[q]),Xt=b?T[q]/2-K-Ot-St-E.mainAxis:$-Ot-St-E.mainAxis,Gt=b?-T[q]/2+K+Ot+_t+E.mainAxis:ht+Ot+_t+E.mainAxis,Qt=t.elements.arrow&&Sf(t.elements.arrow),F=Qt?S==="y"?Qt.clientTop||0:Qt.clientLeft||0:0,wt=(V=L==null?void 0:L[S])!=null?V:0,bt=at+Xt-wt-F,mt=at+Gt-wt,dt=xu(m?Hm(G,bt):G,at,m?Vo(tt,mt):tt);C[S]=dt,B[S]=dt-at}if(o){var kt,Rt=S==="x"?Fi:Ui,zt=S==="x"?_r:vr,z=C[R],O=R==="y"?"height":"width",ot=z+y[Rt],At=z-y[zt],Et=[Fi,Ui].indexOf(x)!==-1,Tt=(kt=L==null?void 0:L[R])!=null?kt:0,ne=Et?ot:z-T[O]-N[O]-Tt+E.altAxis,Ft=Et?z+T[O]+N[O]-Tt-E.altAxis:At,Wt=m&&Et?IL(ne,z,Ft):xu(m?ne:ot,z,m?Ft:At);C[R]=Wt,B[R]=Wt-z}t.modifiersData[i]=B}}const lD={name:"preventOverflow",enabled:!0,phase:"main",fn:oD,requiresIfExists:["offset"]};function cD(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function hD(n){return n===er(n)||!xr(n)?zv(n):cD(n)}function uD(n){var t=n.getBoundingClientRect(),e=Bc(t.width)/n.offsetWidth||1,i=Bc(t.height)/n.offsetHeight||1;return e!==1||i!==1}function fD(n,t,e){e===void 0&&(e=!1);var i=xr(t),r=xr(t)&&uD(t),s=$a(t),a=Hc(n,r,e),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!e)&&((As(t)!=="body"||Hv(s))&&(o=hD(t)),xr(t)?(l=Hc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=Bv(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function dD(n){var t=new Map,e=new Set,i=[];n.forEach(function(s){t.set(s.name,s)});function r(s){e.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!e.has(o)){var l=t.get(o);l&&r(l)}}),i.push(s)}return n.forEach(function(s){e.has(s.name)||r(s)}),i}function pD(n){var t=dD(n);return EL.reduce(function(e,i){return e.concat(t.filter(function(r){return r.phase===i}))},[])}function mD(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function gD(n){var t=n.reduce(function(e,i){var r=e[i.name];return e[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var db={placement:"bottom",modifiers:[],strategy:"absolute"};function pb(){for(var n=arguments.length,t=new Array(n),e=0;e{}),b=Q.useCallback(()=>{var E;!t||!g.current||!_.current||((E=M.current)==null||E.call(M),y.current=_D(g.current,_.current,{placement:x,modifiers:[hL,oL,aL,{...sL,enabled:!!p},{name:"eventListeners",...rL(a)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:o??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!u,options:{boundary:h}},...e??[]],strategy:r}),y.current.forceUpdate(),M.current=y.current.destroy)},[x,t,e,p,a,s,o,l,c,u,h,r]);Q.useEffect(()=>()=>{var E;!g.current&&!_.current&&((E=y.current)==null||E.destroy(),y.current=null)},[]);const S=Q.useCallback(E=>{g.current=E,b()},[b]),R=Q.useCallback((E={},L=null)=>({...E,ref:Fa(S,L)}),[S]),C=Q.useCallback(E=>{_.current=E,b()},[b]),T=Q.useCallback((E={},L=null)=>({...E,ref:Fa(C,L),style:{...E.style,position:r,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[r,C,p]),N=Q.useCallback((E={},L=null)=>{const{size:B,shadowColor:V,bg:j,style:Y,...q}=E;return{...q,ref:L,"data-popper-arrow":"",style:MD(E)}},[]),P=Q.useCallback((E={},L=null)=>({...E,ref:L,"data-popper-arrow-inner":""}),[]);return{update(){var E;(E=y.current)==null||E.update()},forceUpdate(){var E;(E=y.current)==null||E.forceUpdate()},transformOrigin:Yn.transformOrigin.varRef,referenceRef:S,popperRef:C,getPopperProps:T,getArrowProps:N,getArrowInnerProps:P,getReferenceProps:R}}function MD(n){const{size:t,shadowColor:e,bg:i,style:r}=n,s={...r,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),e&&(s["--popper-arrow-shadow-color"]=e),i&&(s["--popper-arrow-bg"]=i),s}function wD(n={}){const{onClose:t,onOpen:e,isOpen:i,id:r}=n,s=yr(e),a=yr(t),[o,l]=Q.useState(n.defaultIsOpen||!1),c=i!==void 0?i:o,h=i!==void 0,u=Q.useId(),p=r??`disclosure-${u}`,m=Q.useCallback(()=>{h||l(!1),a==null||a()},[h,a]),g=Q.useCallback(()=>{h||l(!0),s==null||s()},[h,s]),_=Q.useCallback(()=>{c?m():g()},[c,g,m]);function y(M={}){return{...M,"aria-expanded":c,"aria-controls":p,onClick(b){var S;(S=M.onClick)==null||S.call(M,b),_()}}}function x(M={}){return{...M,hidden:!c,id:p}}return{isOpen:c,onOpen:g,onClose:m,onToggle:_,isControlled:h,getButtonProps:y,getDisclosureProps:x}}var[bD,SD]=L0(),ED={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function AD(n,t){var e,i;if(n)return(i=(e=ED[n])==null?void 0:e[t])!=null?i:n}function TD(n){var t;const{isOpen:e,onClose:i,placement:r="right",children:s,...a}=n,o=Tv(),l=(t=o.components)==null?void 0:t.Drawer,c=AD(r,o.direction);return X.jsx(bD,{value:{placement:c},children:X.jsx(Rv,{isOpen:e,onClose:i,styleConfig:l,...a,children:s})})}var CD=_n(TT),zT=br((n,t)=>{const{className:e,children:i,motionProps:r,containerProps:s,...a}=n,{getDialogProps:o,getDialogContainerProps:l,isOpen:c}=fI(),h=o(a,t),u=l(s),p=rh("chakra-modal__content",e),m=dI(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},_={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:y}=SD();return X.jsx(pI,{children:X.jsx(_n.div,{...u,className:"chakra-modal__content-container",__css:_,children:X.jsx(CD,{motionProps:r,direction:y,in:c,className:p,...h,__css:g,children:i})})})});zT.displayName="DrawerContent";function RD(n,t,e){return(n-t)*100/(e-t)}D0({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});D0({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var PD=D0({"0%":{left:"-40%"},"100%":{left:"100%"}}),ID=D0({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function LD(n){const{value:t=0,min:e,max:i,valueText:r,getValueText:s,isIndeterminate:a,role:o="progressbar"}=n,l=RD(t,e,i);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":i,"aria-valuemin":e,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,l):r})(),role:o},percent:l,value:t}}var[DD,ND]=L0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),OD=br((n,t)=>{const{min:e,max:i,value:r,isIndeterminate:s,role:a,...o}=n,l=LD({value:r,min:e,max:i,isIndeterminate:s,role:a}),h={height:"100%",...ND().filledTrack};return X.jsx(_n.div,{ref:t,style:{width:`${l.percent}%`,...o.style},...l.bind,...o,__css:h})}),BT=br((n,t)=>{var e;const{value:i,min:r=0,max:s=100,hasStripe:a,isAnimated:o,children:l,borderRadius:c,isIndeterminate:h,"aria-label":u,"aria-labelledby":p,"aria-valuetext":m,title:g,role:_,...y}=_f(n),x=Cv("Progress",n),M=c??((e=x.track)==null?void 0:e.borderRadius),b={animation:`${ID} 1s linear infinite`},C={...!h&&a&&o&&b,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${PD} 1s ease infinite normal none running`}},T={overflow:"hidden",position:"relative",...x.track};return X.jsx(_n.div,{ref:t,borderRadius:M,__css:T,...y,children:X.jsxs(DD,{value:x,children:[X.jsx(OD,{"aria-label":u,"aria-labelledby":p,"aria-valuetext":m,min:r,max:s,value:i,isIndeterminate:h,css:C,borderRadius:M,title:g,role:_}),l]})})});BT.displayName="Progress";var Il=n=>n?"":void 0,By=n=>n?!0:void 0,Ef=(...n)=>n.filter(Boolean).join(" ");function Hy(...n){return function(e){n.some(i=>(i==null||i(e),e==null?void 0:e.defaultPrevented))}}function Kd(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}var Sm={width:0,height:0},Jd=n=>n||Sm;function FD(n){const{orientation:t,thumbPercents:e,thumbRects:i,isReversed:r}=n,s=_=>{var y;const x=(y=i[_])!=null?y:Sm;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Kd({orientation:t,vertical:{bottom:`calc(${e[_]}% - ${x.height/2}px)`},horizontal:{left:`calc(${e[_]}% - ${x.width/2}px)`}})}},a=t==="vertical"?i.reduce((_,y)=>Jd(_).height>Jd(y).height?_:y,Sm):i.reduce((_,y)=>Jd(_).width>Jd(y).width?_:y,Sm),o={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Kd({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Kd({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},c=e.length===1,h=[0,r?100-e[0]:e[0]],u=c?h:e;let p=u[0];!c&&r&&(p=100-p);const m=Math.abs(u[u.length-1]-u[0]),g={...l,...Kd({orientation:t,vertical:r?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:r?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:o,getThumbStyle:s}}function UD(n){const{isReversed:t,direction:e,orientation:i}=n;return e==="ltr"||i==="vertical"?t:!t}function kD(n,t,e,i){return n.addEventListener(t,e,i),()=>{n.removeEventListener(t,e,i)}}function zD(n){const t=HD(n);return typeof t.PointerEvent<"u"&&n instanceof t.PointerEvent?n.pointerType==="mouse":n instanceof t.MouseEvent}function HT(n){return!!n.touches}function BD(n){return HT(n)&&n.touches.length>1}function HD(n){var t;return(t=n.view)!=null?t:window}function GD(n,t="page"){const e=n.touches[0]||n.changedTouches[0];return{x:e[`${t}X`],y:e[`${t}Y`]}}function VD(n,t="page"){return{x:n[`${t}X`],y:n[`${t}Y`]}}function GT(n,t="page"){return HT(n)?GD(n,t):VD(n,t)}function WD(n){return t=>{const e=zD(t);(!e||e&&t.button===0)&&n(t)}}function jD(n,t=!1){function e(r){n(r,{point:GT(r)})}return t?WD(e):e}function Em(n,t,e,i){return kD(n,t,jD(e,t==="pointerdown"),i)}var XD=Object.defineProperty,qD=(n,t,e)=>t in n?XD(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Rr=(n,t,e)=>(qD(n,typeof t!="symbol"?t+"":t,e),e),$D=class{constructor(n,t,e){Rr(this,"history",[]),Rr(this,"startEvent",null),Rr(this,"lastEvent",null),Rr(this,"lastEventInfo",null),Rr(this,"handlers",{}),Rr(this,"removeListeners",()=>{}),Rr(this,"threshold",3),Rr(this,"win"),Rr(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const o=Gy(this.lastEventInfo,this.history),l=this.startEvent!==null,c=JD(o.offset,{x:0,y:0})>=this.threshold;if(!l&&!c)return;const{timestamp:h}=Yw();this.history.push({...o.point,timestamp:h});const{onStart:u,onMove:p}=this.handlers;l||(u==null||u(this.lastEvent,o),this.startEvent=this.lastEvent),p==null||p(this.lastEvent,o)}),Rr(this,"onPointerMove",(o,l)=>{this.lastEvent=o,this.lastEventInfo=l,CI.update(this.updatePoint,!0)}),Rr(this,"onPointerUp",(o,l)=>{const c=Gy(l,this.history),{onEnd:h,onSessionEnd:u}=this.handlers;u==null||u(o,c),this.end(),!(!h||!this.startEvent)&&(h==null||h(o,c))});var i;if(this.win=(i=n.view)!=null?i:window,BD(n))return;this.handlers=t,e&&(this.threshold=e),n.stopPropagation(),n.preventDefault();const r={point:GT(n)},{timestamp:s}=Yw();this.history=[{...r.point,timestamp:s}];const{onSessionStart:a}=t;a==null||a(n,Gy(r,this.history)),this.removeListeners=KD(Em(this.win,"pointermove",this.onPointerMove),Em(this.win,"pointerup",this.onPointerUp),Em(this.win,"pointercancel",this.onPointerUp))}updateHandlers(n){this.handlers=n}end(){var n;(n=this.removeListeners)==null||n.call(this),RI.update(this.updatePoint)}};function mb(n,t){return{x:n.x-t.x,y:n.y-t.y}}function Gy(n,t){return{point:n.point,delta:mb(n.point,t[t.length-1]),offset:mb(n.point,t[0]),velocity:ZD(t,.1)}}var YD=n=>n*1e3;function ZD(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,i=null;const r=n[n.length-1];for(;e>=0&&(i=n[e],!(r.timestamp-i.timestamp>YD(t)));)e--;if(!i)return{x:0,y:0};const s=(r.timestamp-i.timestamp)/1e3;if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function KD(...n){return t=>n.reduce((e,i)=>i(e),t)}function Vy(n,t){return Math.abs(n-t)}function gb(n){return"x"in n&&"y"in n}function JD(n,t){if(typeof n=="number"&&typeof t=="number")return Vy(n,t);if(gb(n)&&gb(t)){const e=Vy(n.x,t.x),i=Vy(n.y,t.y);return Math.sqrt(e**2+i**2)}return 0}function VT(n){const t=Q.useRef(null);return t.current=n,t}function QD(n,t){const{onPan:e,onPanStart:i,onPanEnd:r,onPanSessionStart:s,onPanSessionEnd:a,threshold:o}=t,l=!!(e||i||r||s||a),c=Q.useRef(null),h=VT({onSessionStart:s,onSessionEnd:a,onStart:i,onMove:e,onEnd(u,p){c.current=null,r==null||r(u,p)}});Q.useEffect(()=>{var u;(u=c.current)==null||u.updateHandlers(h.current)}),Q.useEffect(()=>{const u=n.current;if(!u||!l)return;function p(m){c.current=new $D(m,h.current,o)}return Em(u,"pointerdown",p)},[n,l,h,o]),Q.useEffect(()=>()=>{var u;(u=c.current)==null||u.end(),c.current=null},[])}function tN(n,t){if(!n){t(void 0);return}t({width:n.offsetWidth,height:n.offsetHeight});const e=n.ownerDocument.defaultView??window,i=new e.ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const[s]=r;let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=n.offsetWidth,o=n.offsetHeight;t({width:a,height:o})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}var eN=globalThis!=null&&globalThis.document?Q.useLayoutEffect:Q.useEffect;function nN(n,t){var e,i;if(!n||!n.parentElement)return;const r=(i=(e=n.ownerDocument)==null?void 0:e.defaultView)!=null?i:window,s=new r.MutationObserver(()=>{t()});return s.observe(n.parentElement,{childList:!0}),()=>{s.disconnect()}}function iN({getNodes:n,observeMutation:t=!0}){const[e,i]=Q.useState([]),[r,s]=Q.useState(0);return eN(()=>{const a=n(),o=a.map((l,c)=>tN(l,h=>{i(u=>[...u.slice(0,c),h,...u.slice(c+1)])}));if(t){const l=a[0];o.push(nN(l,()=>{s(c=>c+1)}))}return()=>{o.forEach(l=>{l==null||l()})}},[r]),e}function rN(n){return typeof n=="object"&&n!==null&&"current"in n}function sN(n){const[t]=iN({observeMutation:!1,getNodes(){return[rN(n)?n.current:n]}});return t}function aN(n){var t;const{min:e=0,max:i=100,onChange:r,value:s,defaultValue:a,isReversed:o,direction:l="ltr",orientation:c="horizontal",id:h,isDisabled:u,isReadOnly:p,onChangeStart:m,onChangeEnd:g,step:_=1,getAriaValueText:y,"aria-valuetext":x,"aria-label":M,"aria-labelledby":b,name:S,focusThumbOnChange:R=!0,...C}=n,T=yr(m),N=yr(g),P=yr(y),E=UD({isReversed:o,direction:l,orientation:c}),[L,B]=LI({value:s,defaultValue:a??lN(e,i),onChange:r}),[V,j]=Q.useState(!1),[Y,q]=Q.useState(!1),at=!(u||p),G=(i-e)/10,tt=_||(i-e)/100,K=ky(L,e,i),$=i-K+e,vt=eb(E?$:K,e,i),Z=c==="vertical",rt=VT({min:e,max:i,step:_,isDisabled:u,value:K,isInteractive:at,isReversed:E,isVertical:Z,eventSource:null,focusThumbOnChange:R,orientation:c}),St=Q.useRef(null),_t=Q.useRef(null),Ot=Q.useRef(null),Xt=Q.useId(),Gt=h??Xt,[Qt,F]=[`slider-thumb-${Gt}`,`slider-track-${Gt}`],wt=Q.useCallback(It=>{var Nt,qt;if(!St.current)return;const W=rt.current;W.eventSource="pointer";const gt=St.current.getBoundingClientRect(),{clientX:jt,clientY:D}=(qt=(Nt=It.touches)==null?void 0:Nt[0])!=null?qt:It,it=Z?gt.bottom-D:jt-gt.left,lt=Z?gt.height:gt.width;let ut=it/lt;E&&(ut=1-ut);let Ct=JI(ut,W.min,W.max);return W.step&&(Ct=parseFloat(nb(Ct,W.min,W.step))),Ct=ky(Ct,W.min,W.max),Ct},[Z,E,rt]),bt=Q.useCallback(It=>{const Nt=rt.current;Nt.isInteractive&&(It=parseFloat(nb(It,Nt.min,tt)),It=ky(It,Nt.min,Nt.max),B(It))},[tt,B,rt]),mt=Q.useMemo(()=>({stepUp(It=tt){const Nt=E?K-It:K+It;bt(Nt)},stepDown(It=tt){const Nt=E?K+It:K-It;bt(Nt)},reset(){bt(a||0)},stepTo(It){bt(It)}}),[bt,E,K,tt,a]),dt=Q.useCallback(It=>{const Nt=rt.current,W={ArrowRight:()=>mt.stepUp(),ArrowUp:()=>mt.stepUp(),ArrowLeft:()=>mt.stepDown(),ArrowDown:()=>mt.stepDown(),PageUp:()=>mt.stepUp(G),PageDown:()=>mt.stepDown(G),Home:()=>bt(Nt.min),End:()=>bt(Nt.max)}[It.key];W&&(It.preventDefault(),It.stopPropagation(),W(It),Nt.eventSource="keyboard")},[mt,bt,G,rt]),kt=(t=P==null?void 0:P(K))!=null?t:x,Rt=sN(_t),{getThumbStyle:zt,rootStyle:z,trackStyle:O,innerTrackStyle:ot}=Q.useMemo(()=>{const It=rt.current,Nt=Rt??{width:0,height:0};return FD({isReversed:E,orientation:It.orientation,thumbRects:[Nt],thumbPercents:[vt]})},[E,Rt,vt,rt]),At=Q.useCallback(()=>{rt.current.focusThumbOnChange&&setTimeout(()=>{var Nt;return(Nt=_t.current)==null?void 0:Nt.focus()})},[rt]);_T(()=>{const It=rt.current;At(),It.eventSource==="keyboard"&&(N==null||N(It.value))},[K,N]);function Et(It){const Nt=wt(It);Nt!=null&&Nt!==rt.current.value&&B(Nt)}QD(Ot,{onPanSessionStart(It){const Nt=rt.current;Nt.isInteractive&&(j(!0),At(),Et(It),T==null||T(Nt.value))},onPanSessionEnd(){const It=rt.current;It.isInteractive&&(j(!1),N==null||N(It.value))},onPan(It){rt.current.isInteractive&&Et(It)}});const Tt=Q.useCallback((It={},Nt=null)=>({...It,...C,ref:Fa(Nt,Ot),tabIndex:-1,"aria-disabled":By(u),"data-focused":Il(Y),style:{...It.style,...z}}),[C,u,Y,z]),ne=Q.useCallback((It={},Nt=null)=>({...It,ref:Fa(Nt,St),id:F,"data-disabled":Il(u),style:{...It.style,...O}}),[u,F,O]),Ft=Q.useCallback((It={},Nt=null)=>({...It,ref:Nt,style:{...It.style,...ot}}),[ot]),Wt=Q.useCallback((It={},Nt=null)=>({...It,ref:Fa(Nt,_t),role:"slider",tabIndex:at?0:void 0,id:Qt,"data-active":Il(V),"aria-valuetext":kt,"aria-valuemin":e,"aria-valuemax":i,"aria-valuenow":K,"aria-orientation":c,"aria-disabled":By(u),"aria-readonly":By(p),"aria-label":M,"aria-labelledby":M?void 0:b,style:{...It.style,...zt(0)},onKeyDown:Hy(It.onKeyDown,dt),onFocus:Hy(It.onFocus,()=>q(!0)),onBlur:Hy(It.onBlur,()=>q(!1))}),[at,Qt,V,kt,e,i,K,c,u,p,M,b,zt,dt]),ge=Q.useCallback((It,Nt=null)=>{const qt=!(It.valuei),W=K>=It.value,gt=eb(It.value,e,i),jt={position:"absolute",pointerEvents:"none",...oN({orientation:c,vertical:{bottom:E?`${100-gt}%`:`${gt}%`},horizontal:{left:E?`${100-gt}%`:`${gt}%`}})};return{...It,ref:Nt,role:"presentation","aria-hidden":!0,"data-disabled":Il(u),"data-invalid":Il(!qt),"data-highlighted":Il(W),style:{...It.style,...jt}}},[u,E,i,e,c,K]),Dt=Q.useCallback((It={},Nt=null)=>({...It,ref:Nt,type:"hidden",value:K,name:S}),[S,K]);return{state:{value:K,isFocused:Y,isDragging:V},actions:mt,getRootProps:Tt,getTrackProps:ne,getInnerTrackProps:Ft,getThumbProps:Wt,getMarkerProps:ge,getInputProps:Dt}}function oN(n){const{orientation:t,vertical:e,horizontal:i}=n;return t==="vertical"?e:i}function lN(n,t){return t"}),[hN,k0]=L0({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),WT=br((n,t)=>{var e;const i={...n,orientation:(e=n==null?void 0:n.orientation)!=null?e:"horizontal"},r=Cv("Slider",i),s=_f(i),{direction:a}=Tv();s.direction=a;const{getInputProps:o,getRootProps:l,...c}=aN(s),h=l(),u=o({},t);return X.jsx(cN,{value:c,children:X.jsx(hN,{value:r,children:X.jsxs(_n.div,{...h,className:Ef("chakra-slider",i.className),__css:r.container,children:[i.children,X.jsx("input",{...u})]})})})});WT.displayName="Slider";var jT=br((n,t)=>{const{getThumbProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__thumb",n.className),__css:i.thumb})});jT.displayName="SliderThumb";var XT=br((n,t)=>{const{getTrackProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__track",n.className),__css:i.track})});XT.displayName="SliderTrack";var qT=br((n,t)=>{const{getInnerTrackProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__filled-track",n.className),__css:i.filledTrack})});qT.displayName="SliderFilledTrack";var uN=br((n,t)=>{const{getMarkerProps:e}=U0(),i=k0(),r=e(n,t);return X.jsx(_n.div,{...r,className:Ef("chakra-slider__marker",n.className),__css:i.mark})});uN.displayName="SliderMark";var $T=br(function(t,e){const i=Cv("Switch",t),{spacing:r="0.5rem",children:s,...a}=_f(t),{getIndicatorProps:o,getInputProps:l,getCheckboxProps:c,getRootProps:h,getLabelProps:u}=qI(a),p=Q.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...i.container}),[i.container]),m=Q.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...i.track}),[i.track]),g=Q.useMemo(()=>({userSelect:"none",marginStart:r,...i.label}),[r,i.label]);return X.jsxs(_n.label,{...h(),className:rh("chakra-switch",t.className),__css:p,children:[X.jsx("input",{className:"chakra-switch__input",...l({},e)}),X.jsx(_n.span,{...c(),className:"chakra-switch__track",__css:m,children:X.jsx(_n.span,{__css:i.thumb,className:"chakra-switch__thumb",...o()})}),s&&X.jsx(_n.span,{className:"chakra-switch__label",...u(),__css:g,children:s})]})});$T.displayName="Switch";var fN={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},F_=n=>{var t;return((t=n.current)==null?void 0:t.ownerDocument)||document},Am=n=>{var t,e;return((e=(t=n.current)==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)||window};function dN(n={}){const{openDelay:t=0,closeDelay:e=0,closeOnClick:i=!0,closeOnMouseDown:r,closeOnScroll:s,closeOnPointerDown:a=r,closeOnEsc:o=!0,onOpen:l,onClose:c,placement:h,id:u,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:_,arrowPadding:y,modifiers:x,isDisabled:M,gutter:b,offset:S,direction:R,...C}=n,{isOpen:T,onOpen:N,onClose:P}=wD({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:c}),{referenceRef:E,getPopperProps:L,getArrowInnerProps:B,getArrowProps:V}=vD({enabled:T,placement:h,arrowPadding:y,modifiers:x,gutter:b,offset:S,direction:R}),j=Q.useId(),q=`tooltip-${u??j}`,at=Q.useRef(null),G=Q.useRef(),tt=Q.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=void 0)},[]),K=Q.useRef(),$=Q.useCallback(()=>{K.current&&(clearTimeout(K.current),K.current=void 0)},[]),ht=Q.useCallback(()=>{$(),P()},[P,$]),vt=pN(at,ht),Z=Q.useCallback(()=>{if(!M&&!G.current){T&&vt();const F=Am(at);G.current=F.setTimeout(N,t)}},[vt,M,T,N,t]),rt=Q.useCallback(()=>{tt();const F=Am(at);K.current=F.setTimeout(ht,e)},[e,ht,tt]),St=Q.useCallback(()=>{T&&i&&rt()},[i,rt,T]),_t=Q.useCallback(()=>{T&&a&&rt()},[a,rt,T]),Ot=Q.useCallback(F=>{T&&F.key==="Escape"&&rt()},[T,rt]);zy(()=>F_(at),"keydown",o?Ot:void 0),zy(()=>{if(!s)return null;const F=at.current;if(!F)return null;const wt=RT(F);return wt.localName==="body"?Am(at):wt},"scroll",()=>{T&&s&&ht()},{passive:!0,capture:!0}),Q.useEffect(()=>{M&&(tt(),T&&P())},[M,T,P,tt]),Q.useEffect(()=>()=>{tt(),$()},[tt,$]),zy(()=>at.current,"pointerleave",rt);const Xt=Q.useCallback((F={},wt=null)=>({...F,ref:Fa(at,wt,E),onPointerEnter:li(F.onPointerEnter,mt=>{mt.pointerType!=="touch"&&Z()}),onClick:li(F.onClick,St),onPointerDown:li(F.onPointerDown,_t),onFocus:li(F.onFocus,Z),onBlur:li(F.onBlur,rt),"aria-describedby":T?q:void 0}),[Z,rt,_t,T,q,St,E]),Gt=Q.useCallback((F={},wt=null)=>L({...F,style:{...F.style,[Yn.arrowSize.var]:g?`${g}px`:void 0,[Yn.arrowShadowColor.var]:_}},wt),[L,g,_]),Qt=Q.useCallback((F={},wt=null)=>{const bt={...F.style,position:"relative",transformOrigin:Yn.transformOrigin.varRef};return{ref:wt,...C,...F,id:q,role:"tooltip",style:bt}},[C,q]);return{isOpen:T,show:Z,hide:rt,getTriggerProps:Xt,getTooltipProps:Qt,getTooltipPositionerProps:Gt,getArrowProps:V,getArrowInnerProps:B}}var Wy="chakra-ui:close-tooltip";function pN(n,t){return Q.useEffect(()=>{const e=F_(n);return e.addEventListener(Wy,t),()=>e.removeEventListener(Wy,t)},[t,n]),()=>{const e=F_(n),i=Am(n);e.dispatchEvent(new i.CustomEvent(Wy))}}function mN(n,t=[]){const e=Object.assign({},n);for(const i of t)i in e&&delete e[i];return e}function gN(n,t){const e={};for(const i of t)i in n&&(e[i]=n[i]);return e}var yN=_n(Av.div),Af=br((n,t)=>{var e,i;const r=xT("Tooltip",n),s=_f(n),a=Tv(),{children:o,label:l,shouldWrapChildren:c,"aria-label":h,hasArrow:u,bg:p,portalProps:m,background:g,backgroundColor:_,bgColor:y,motionProps:x,...M}=s,b=(i=(e=g??_)!=null?e:p)!=null?i:y;if(b){r.bg=b;const L=eI(a,"colors",b);r[Yn.arrowBg.var]=L}const S=dN({...M,direction:a.direction}),R=typeof o=="string"||c;let C;if(R)C=X.jsx(_n.span,{display:"inline-block",tabIndex:0,...S.getTriggerProps(),children:o});else{const L=Q.Children.only(o);C=Q.cloneElement(L,S.getTriggerProps(L.props,L.ref))}const T=!!h,N=S.getTooltipProps({},t),P=T?mN(N,["role","id"]):N,E=gN(N,["role","id"]);return l?X.jsxs(X.Fragment,{children:[C,X.jsx(Ev,{children:S.isOpen&&X.jsx(nI,{...m,children:X.jsx(_n.div,{...S.getTooltipPositionerProps(),__css:{zIndex:r.zIndex,pointerEvents:"none"},children:X.jsxs(yN,{variants:fN,initial:"exit",animate:"enter",exit:"exit",...x,...P,__css:r,children:[l,T&&X.jsx(_n.span,{srOnly:!0,...E,children:h}),u&&X.jsx(_n.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:X.jsx(_n.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:r.bg}})})]})})})})]}):X.jsx(X.Fragment,{children:o})});Af.displayName="Tooltip";/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const z0="167",Wn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Zi={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},YT=0,U_=1,ZT=2,xN=3,KT=0,B0=1,vu=2,Ur=3,Gr=0,wi=1,hi=2,ea=0,Wo=1,k_=2,z_=3,B_=4,JT=5,La=100,QT=101,t2=102,e2=103,n2=104,i2=200,r2=201,s2=202,a2=203,Gm=204,Vm=205,o2=206,l2=207,c2=208,h2=209,u2=210,f2=211,d2=212,p2=213,m2=214,g2=0,y2=1,x2=2,Vu=3,_2=4,v2=5,M2=6,w2=7,Tf=0,b2=1,S2=2,vs=0,E2=1,A2=2,T2=3,Gv=4,C2=5,R2=6,P2=7,H_="attached",I2="detached",H0=300,sa=301,Va=302,Wu=303,ju=304,ah=306,Wa=1e3,Ki=1001,Vc=1002,Ln=1003,G0=1004,_N=1004,Oo=1005,vN=1005,mn=1006,Pc=1007,MN=1007,gr=1008,wN=1008,Vr=1009,Vv=1010,Wv=1011,Wc=1012,V0=1013,aa=1014,Ni=1015,oh=1016,W0=1017,j0=1018,Ko=1020,jv=35902,Xv=1021,qv=1022,ui=1023,$v=1024,Yv=1025,jo=1026,Jo=1027,X0=1028,Cf=1029,Zv=1030,q0=1031,bN=1032,$0=1033,Mu=33776,wu=33777,bu=33778,Su=33779,Wm=35840,jm=35841,Xm=35842,qm=35843,$m=36196,Ym=37492,Zm=37496,Km=37808,Jm=37809,Qm=37810,t0=37811,e0=37812,n0=37813,i0=37814,r0=37815,s0=37816,a0=37817,o0=37818,l0=37819,c0=37820,h0=37821,Eu=36492,u0=36494,f0=36495,Kv=36283,d0=36284,p0=36285,m0=36286,L2=2200,D2=2201,N2=2202,jc=2300,Xc=2301,Tm=2302,Fo=2400,Uo=2401,Xu=2402,Y0=2500,Jv=2501,O2=0,Qv=1,g0=2,F2=3200,U2=3201,SN=3202,EN=3203,Ya=0,k2=1,Ks="",Tn="srgb",Dn="srgb-linear",Z0="display-p3",Rf="display-p3-linear",qu="linear",tn="srgb",$u="rec709",Yu="p3",AN=0,Ro=7680,TN=7681,CN=7682,RN=7683,PN=34055,IN=34056,LN=5386,DN=512,NN=513,ON=514,FN=515,UN=516,kN=517,zN=518,G_=519,z2=512,B2=513,H2=514,t1=515,G2=516,V2=517,W2=518,j2=519,Zu=35044,BN=35048,HN=35040,GN=35045,VN=35049,WN=35041,jN=35046,XN=35050,qN=35042,$N="100",V_="300 es",gs=2e3,Ku=2001;let qr=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,a=r.length;s>8&255]+ii[n>>16&255]+ii[n>>24&255]+"-"+ii[t&255]+ii[t>>8&255]+"-"+ii[t>>16&15|64]+ii[t>>24&255]+"-"+ii[e&63|128]+ii[e>>8&255]+"-"+ii[e>>16&255]+ii[e>>24&255]+ii[i&255]+ii[i>>8&255]+ii[i>>16&255]+ii[i>>24&255]).toLowerCase()}function pn(n,t,e){return Math.max(t,Math.min(e,n))}function e1(n,t){return(n%t+t)%t}function YN(n,t,e,i,r){return i+(n-t)*(r-i)/(e-t)}function ZN(n,t,e){return n!==t?(e-n)/(t-n):0}function Au(n,t,e){return(1-e)*n+e*t}function KN(n,t,e,i){return Au(n,t,1-Math.exp(-e*i))}function JN(n,t=1){return t-Math.abs(e1(n,t*2)-t)}function QN(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function tO(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function eO(n,t){return n+Math.floor(Math.random()*(t-n+1))}function nO(n,t){return n+Math.random()*(t-n)}function iO(n){return n*(.5-Math.random())}function rO(n){n!==void 0&&(yb=n);let t=yb+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function sO(n){return n*Xo}function aO(n){return n*qc}function oO(n){return(n&n-1)===0&&n!==0}function lO(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function cO(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function hO(n,t,e,i,r){const s=Math.cos,a=Math.sin,o=s(e/2),l=a(e/2),c=s((t+i)/2),h=a((t+i)/2),u=s((t-i)/2),p=a((t-i)/2),m=s((i-t)/2),g=a((i-t)/2);switch(r){case"XYX":n.set(o*h,l*u,l*p,o*c);break;case"YZY":n.set(l*p,o*h,l*u,o*c);break;case"ZXZ":n.set(l*u,l*p,o*h,o*c);break;case"XZX":n.set(o*h,l*g,l*m,o*c);break;case"YXY":n.set(l*m,o*h,l*g,o*c);break;case"ZYZ":n.set(l*g,l*m,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function _i(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ee(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const n1={DEG2RAD:Xo,RAD2DEG:qc,generateUUID:tr,clamp:pn,euclideanModulo:e1,mapLinear:YN,inverseLerp:ZN,lerp:Au,damp:KN,pingpong:JN,smoothstep:QN,smootherstep:tO,randInt:eO,randFloat:nO,randFloatSpread:iO,seededRandom:rO,degToRad:sO,radToDeg:aO,isPowerOfTwo:oO,ceilPowerOfTwo:lO,floorPowerOfTwo:cO,setQuaternionFromProperEuler:hO,normalize:Ee,denormalize:_i};let xt=class X2{constructor(t=0,e=0){X2.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 new 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 new 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){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(pn(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const 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){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Re=class q2{constructor(t,e,i,r,s,a,o,l,c){q2.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c)}set(t,e,i,r,s,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=r,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const 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){const 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){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],u=i[7],p=i[2],m=i[5],g=i[8],_=r[0],y=r[3],x=r[6],M=r[1],b=r[4],S=r[7],R=r[2],T=r[5],C=r[8];return s[0]=a*_+o*M+l*R,s[3]=a*y+o*b+l*T,s[6]=a*x+o*S+l*C,s[1]=c*_+h*M+u*R,s[4]=c*y+h*b+u*T,s[7]=c*x+h*S+u*C,s[2]=p*_+m*M+g*R,s[5]=p*y+m*b+g*T,s[8]=p*x+m*S+g*C,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-i*s*h+i*o*l+r*s*c-r*a*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,p=o*l-h*s,m=c*s-a*l,g=e*u+i*p+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(r*c-h*i)*_,t[2]=(o*i-r*a)*_,t[3]=p*_,t[4]=(h*e-r*l)*_,t[5]=(r*s-o*e)*_,t[6]=m*_,t[7]=(i*l-c*e)*_,t[8]=(a*e-i*s)*_,this}transpose(){let t;const 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){const 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,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-r*c,r*l,-r*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(jy.makeScale(t,e)),this}rotate(t){return this.premultiply(jy.makeRotation(-t)),this}translate(t,e){return this.premultiply(jy.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){const 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){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])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){const 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)}};const jy=new Re;function $2(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}const uO={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Mc(n,t){return new uO[n](t)}function Ju(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Y2(){const n=Ju("canvas");return n.style.display="block",n}const xb={};function Ic(n){n in xb||(xb[n]=!0,console.warn(n))}function fO(n,t,e){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,e);break;default:i()}}setTimeout(s,e)})}const _b=new Re().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),vb=new Re().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zh={[Dn]:{transfer:qu,primaries:$u,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Tn]:{transfer:tn,primaries:$u,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Rf]:{transfer:qu,primaries:Yu,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(vb),fromReference:n=>n.applyMatrix3(_b)},[Z0]:{transfer:tn,primaries:Yu,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(vb),fromReference:n=>n.applyMatrix3(_b).convertLinearToSRGB()}},dO=new Set([Dn,Rf]),Fe={enabled:!0,_workingColorSpace:Dn,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!dO.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;const i=zh[t].toReference,r=zh[e].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return zh[n].primaries},getTransfer:function(n){return n===Ks?qu:zh[n].transfer},getLuminanceCoefficients:function(n,t=this._workingColorSpace){return n.fromArray(zh[t].luminanceCoefficients)}};function Lc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Xy(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ll,Z2=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Ll===void 0&&(Ll=Ju("canvas")),Ll.width=t.width,Ll.height=t.height;const i=Ll.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Ll}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Ju("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==H0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Wa:t.x=t.x-Math.floor(t.x);break;case Ki:t.x=t.x<0?0:1;break;case Vc:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Wa:t.y=t.y-Math.floor(t.y);break;case Ki:t.y=t.y<0?0:1;break;case Vc:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};Mn.DEFAULT_IMAGE=null;Mn.DEFAULT_MAPPING=H0;Mn.DEFAULT_ANISOTROPY=1;class je{constructor(t=0,e=0,i=0,r=1){je.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}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,r){return this.x=t,this.y=e,this.z=i,this.w=r,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 new 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 new 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=t.w!==void 0?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){const e=this.x,i=this.y,r=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*e+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*e+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*e+a[7]*i+a[11]*r+a[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const 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,r,s;const l=t.elements,c=l[0],h=l[4],u=l[8],p=l[1],m=l[5],g=l[9],_=l[2],y=l[6],x=l[10];if(Math.abs(h-p)<.01&&Math.abs(u-_)<.01&&Math.abs(g-y)<.01){if(Math.abs(h+p)<.1&&Math.abs(u+_)<.1&&Math.abs(g+y)<.1&&Math.abs(c+m+x-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,S=(m+1)/2,R=(x+1)/2,T=(h+p)/4,C=(u+_)/4,N=(g+y)/4;return b>S&&b>R?b<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(b),r=T/i,s=C/i):S>R?S<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),i=T/r,s=N/r):R<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(R),i=C/s,r=N/s),this.set(i,r,s,e),this}let M=Math.sqrt((y-g)*(y-g)+(u-_)*(u-_)+(p-h)*(p-h));return Math.abs(M)<.001&&(M=1),this.x=(y-g)/M,this.y=(u-_)/M,this.z=(p-h)/M,this.w=Math.acos((c+m+x-1)/2),this}setFromMatrixPosition(t){const 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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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 K2 extends qr{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new je(0,0,t,e),this.scissorTest=!1,this.viewport=new je(0,0,t,e);const r={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:mn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Mn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const a=i.count;for(let o=0;o=0?1:-1,b=1-x*x;if(b>Number.EPSILON){const R=Math.sqrt(b),T=Math.atan2(R,x*M);y=Math.sin(y*T)/R,o=Math.sin(o*T)/R}const S=o*M;if(l=l*y+p*S,c=c*y+m*S,h=h*y+g*S,u=u*y+_*S,y===1-o){const R=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=R,c*=R,h*=R,u*=R}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],h=i[r+3],u=s[a],p=s[a+1],m=s[a+2],g=s[a+3];return t[e]=o*g+h*u+l*m-c*p,t[e+1]=l*g+h*p+c*u-o*m,t[e+2]=c*g+h*m+o*p-l*u,t[e+3]=h*g-o*u-l*p-c*m,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,r){return this._x=t,this._y=e,this._z=i,this._w=r,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){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(r/2),u=o(s/2),p=l(i/2),m=l(r/2),g=l(s/2);switch(a){case"XYZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"YXZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"ZXY":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"ZYX":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"YZX":this._x=p*h*u+c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u-p*m*g;break;case"XZY":this._x=p*h*u-c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],p=i+o+u;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(i>o&&i>u){const m=2*Math.sqrt(1+i-o-u);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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(pn(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,r),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 t===0?(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){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-i*c,this._z=s*h+a*c+i*l-r*o,this._w=a*h-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+i*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*i+e*this._x,this._y=m*r+e*this._y,this._z=m*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,p=Math.sin(e*h)/c;return this._w=a*u+this._w*p,this._x=i*u+this._x*p,this._y=r*u+this._y*p,this._z=s*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*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}},U=class J2{constructor(t=0,e=0,i=0){J2.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(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 new 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 new 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(Mb.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Mb.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*r-o*i),h=2*(o*e-s*r),u=2*(s*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-s*u,this.z=r+l*u+s*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return $y.copy(this).projectOnVector(t),this.sub($y)}reflect(t){return this.sub($y.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(pn(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}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){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*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){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}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(){const t=Math.random()*Math.PI*2,e=Math.random()*2-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}};const $y=new U,Mb=new Cn;let fi=class{constructor(t=new U(1/0,1/0,1/0),e=new U(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.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,Pr),Pr.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(Bh),tp.subVectors(this.max,Bh),Dl.subVectors(t.a,Bh),Nl.subVectors(t.b,Bh),Ol.subVectors(t.c,Bh),xa.subVectors(Nl,Dl),_a.subVectors(Ol,Nl),fo.subVectors(Dl,Ol);let e=[0,-xa.z,xa.y,0,-_a.z,_a.y,0,-fo.z,fo.y,xa.z,0,-xa.x,_a.z,0,-_a.x,fo.z,0,-fo.x,-xa.y,xa.x,0,-_a.y,_a.x,0,-fo.y,fo.x,0];return!Yy(e,Dl,Nl,Ol,tp)||(e=[1,0,0,0,1,0,0,0,1],!Yy(e,Dl,Nl,Ol,tp))?!1:(ep.crossVectors(xa,_a),e=[ep.x,ep.y,ep.z],Yy(e,Dl,Nl,Ol,tp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Pr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Pr).length()*.5),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()?this:(Os[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Os[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Os[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Os[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Os[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Os[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Os[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Os[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Os),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)}};const Os=[new U,new U,new U,new U,new U,new U,new U,new U],Pr=new U,Qd=new fi,Dl=new U,Nl=new U,Ol=new U,xa=new U,_a=new U,fo=new U,Bh=new U,tp=new U,ep=new U,po=new U;function Yy(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){po.fromArray(n,s);const o=r.x*Math.abs(po.x)+r.y*Math.abs(po.y)+r.z*Math.abs(po.z),l=t.dot(po),c=e.dot(po),h=i.dot(po);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const xO=new fi,Hh=new U,Zy=new U;let Zn=class{constructor(t=new U,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){const i=this.center;e!==void 0?i.copy(e):xO.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(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;Hh.subVectors(t,this.center);const e=Hh.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(Hh,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Zy.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Hh.copy(t.center).add(Zy)),this.expandByPoint(Hh.copy(t.center).sub(Zy))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Fs=new U,Ky=new U,np=new U,va=new U,Jy=new U,ip=new U,Qy=new U;let Za=class{constructor(t=new U,e=new U(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,Fs)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const 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){const e=Fs.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Fs.copy(this.origin).addScaledVector(this.direction,e),Fs.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){Ky.copy(t).add(e).multiplyScalar(.5),np.copy(e).sub(t).normalize(),va.copy(this.origin).sub(Ky);const s=t.distanceTo(e)*.5,a=-this.direction.dot(np),o=va.dot(this.direction),l=-va.dot(np),c=va.lengthSq(),h=Math.abs(1-a*a);let u,p,m,g;if(h>0)if(u=a*l-o,p=a*o-l,g=s*h,u>=0)if(p>=-g)if(p<=g){const _=1/h;u*=_,p*=_,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*s+o)),p=u>0?-s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(u=Math.max(0,-(a*s+o)),p=u>0?s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c);else p=a>0?-s:s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Ky).addScaledVector(np,p),m}intersectSphere(t,e){Fs.subVectors(t.center,this.origin);const i=Fs.dot(this.direction),r=Fs.dot(Fs)-i*i,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,p=this.origin;return c>=0?(i=(t.min.x-p.x)*c,r=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,r=(t.min.x-p.x)*c),h>=0?(s=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(s=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a=0?(o=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(o=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),i>l||o>r)||((o>i||i!==i)&&(i=o),(l=0?i:r,e)}intersectsBox(t){return this.intersectBox(t,Fs)!==null}intersectTriangle(t,e,i,r,s){Jy.subVectors(e,t),ip.subVectors(i,t),Qy.crossVectors(Jy,ip);let a=this.direction.dot(Qy),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;va.subVectors(this.origin,t);const l=o*this.direction.dot(ip.crossVectors(va,ip));if(l<0)return null;const c=o*this.direction.dot(Jy.cross(va));if(c<0||l+c>a)return null;const h=-o*va.dot(Qy);return h<0?null:this.at(h/a,s)}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)}},de=class W_{constructor(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){W_.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y)}set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){const x=this.elements;return x[0]=t,x[4]=e,x[8]=i,x[12]=r,x[1]=s,x[5]=a,x[9]=o,x[13]=l,x[2]=c,x[6]=h,x[10]=u,x[14]=p,x[3]=m,x[7]=g,x[11]=_,x[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 W_().fromArray(this.elements)}copy(t){const 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){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const 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 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){const e=this.elements,i=t.elements,r=1/Fl.setFromMatrixColumn(t,0).length(),s=1/Fl.setFromMatrixColumn(t,1).length(),a=1/Fl.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-_*c,e[9]=-o*l,e[2]=_-p*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p+_*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=_+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p-_*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=_-p*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+_,e[1]=l*u,e[5]=_*c+p,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=_-p*u,e[8]=g*u+m,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*u+g,e[10]=p-_*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+_,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=_*u+p}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(_O,t,vO)}lookAt(t,e,i){const r=this.elements;return Wi.subVectors(t,e),Wi.lengthSq()===0&&(Wi.z=1),Wi.normalize(),Ma.crossVectors(i,Wi),Ma.lengthSq()===0&&(Math.abs(i.z)===1?Wi.x+=1e-4:Wi.z+=1e-4,Wi.normalize(),Ma.crossVectors(i,Wi)),Ma.normalize(),rp.crossVectors(Wi,Ma),r[0]=Ma.x,r[4]=rp.x,r[8]=Wi.x,r[1]=Ma.y,r[5]=rp.y,r[9]=Wi.y,r[2]=Ma.z,r[6]=rp.z,r[10]=Wi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],u=i[5],p=i[9],m=i[13],g=i[2],_=i[6],y=i[10],x=i[14],M=i[3],b=i[7],S=i[11],R=i[15],T=r[0],C=r[4],N=r[8],P=r[12],E=r[1],L=r[5],B=r[9],V=r[13],j=r[2],Y=r[6],q=r[10],at=r[14],G=r[3],nt=r[7],K=r[11],$=r[15];return s[0]=a*T+o*E+l*j+c*G,s[4]=a*C+o*L+l*Y+c*nt,s[8]=a*N+o*B+l*q+c*K,s[12]=a*P+o*V+l*at+c*$,s[1]=h*T+u*E+p*j+m*G,s[5]=h*C+u*L+p*Y+m*nt,s[9]=h*N+u*B+p*q+m*K,s[13]=h*P+u*V+p*at+m*$,s[2]=g*T+_*E+y*j+x*G,s[6]=g*C+_*L+y*Y+x*nt,s[10]=g*N+_*B+y*q+x*K,s[14]=g*P+_*V+y*at+x*$,s[3]=M*T+b*E+S*j+R*G,s[7]=M*C+b*L+S*Y+R*nt,s[11]=M*N+b*B+S*q+R*K,s[15]=M*P+b*V+S*at+R*$,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],p=t[10],m=t[14],g=t[3],_=t[7],y=t[11],x=t[15];return g*(+s*l*u-r*c*u-s*o*p+i*c*p+r*o*m-i*l*m)+_*(+e*l*m-e*c*p+s*a*p-r*a*m+r*c*h-s*l*h)+y*(+e*c*u-e*o*m-s*a*u+i*a*m+s*o*h-i*c*h)+x*(-r*o*h-e*l*u+e*o*p+r*a*u-i*a*p+i*l*h)}transpose(){const t=this.elements;let e;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(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],p=t[10],m=t[11],g=t[12],_=t[13],y=t[14],x=t[15],M=u*y*c-_*p*c+_*l*m-o*y*m-u*l*x+o*p*x,b=g*p*c-h*y*c-g*l*m+a*y*m+h*l*x-a*p*x,S=h*_*c-g*u*c+g*o*m-a*_*m-h*o*x+a*u*x,R=g*u*l-h*_*l-g*o*p+a*_*p+h*o*y-a*u*y,T=e*M+i*b+r*S+s*R;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/T;return t[0]=M*C,t[1]=(_*p*s-u*y*s-_*r*m+i*y*m+u*r*x-i*p*x)*C,t[2]=(o*y*s-_*l*s+_*r*c-i*y*c-o*r*x+i*l*x)*C,t[3]=(u*l*s-o*p*s-u*r*c+i*p*c+o*r*m-i*l*m)*C,t[4]=b*C,t[5]=(h*y*s-g*p*s+g*r*m-e*y*m-h*r*x+e*p*x)*C,t[6]=(g*l*s-a*y*s-g*r*c+e*y*c+a*r*x-e*l*x)*C,t[7]=(a*p*s-h*l*s+h*r*c-e*p*c-a*r*m+e*l*m)*C,t[8]=S*C,t[9]=(g*u*s-h*_*s-g*i*m+e*_*m+h*i*x-e*u*x)*C,t[10]=(a*_*s-g*o*s+g*i*c-e*_*c-a*i*x+e*o*x)*C,t[11]=(h*o*s-a*u*s-h*i*c+e*u*c+a*i*m-e*o*m)*C,t[12]=R*C,t[13]=(h*_*r-g*u*r+g*i*p-e*_*p-h*i*y+e*u*y)*C,t[14]=(g*o*r-a*_*r-g*i*l+e*_*l+a*i*y-e*o*y)*C,t[15]=(a*u*r-h*o*r+h*i*l-e*u*l-a*i*p+e*o*p)*C,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}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){const 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){const 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){const 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){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,l=t.z,c=s*a,h=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+i,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+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,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,h=a+a,u=o+o,p=s*c,m=s*h,g=s*u,_=a*h,y=a*u,x=o*u,M=l*c,b=l*h,S=l*u,R=i.x,T=i.y,C=i.z;return r[0]=(1-(_+x))*R,r[1]=(m+S)*R,r[2]=(g-b)*R,r[3]=0,r[4]=(m-S)*T,r[5]=(1-(p+x))*T,r[6]=(y+M)*T,r[7]=0,r[8]=(g+b)*C,r[9]=(y-M)*C,r[10]=(1-(p+_))*C,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=Fl.set(r[0],r[1],r[2]).length();const a=Fl.set(r[4],r[5],r[6]).length(),o=Fl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],Ir.copy(this);const c=1/s,h=1/a,u=1/o;return Ir.elements[0]*=c,Ir.elements[1]*=c,Ir.elements[2]*=c,Ir.elements[4]*=h,Ir.elements[5]*=h,Ir.elements[6]*=h,Ir.elements[8]*=u,Ir.elements[9]*=u,Ir.elements[10]*=u,e.setFromRotationMatrix(Ir),i.x=s,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,a,o=gs){const l=this.elements,c=2*s/(e-t),h=2*s/(i-r),u=(e+t)/(e-t),p=(i+r)/(i-r);let m,g;if(o===gs)m=-(a+s)/(a-s),g=-2*a*s/(a-s);else if(o===Ku)m=-a/(a-s),g=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=gs){const l=this.elements,c=1/(e-t),h=1/(i-r),u=1/(a-s),p=(e+t)*c,m=(i+r)*h;let g,_;if(o===gs)g=(a+s)*u,_=-2*u;else if(o===Ku)g=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=_,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])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){const 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}};const Fl=new U,Ir=new de,_O=new U(0,0,0),vO=new U(1,1,1),Ma=new U,rp=new U,Wi=new U,wb=new de,bb=new Cn;let jr=class Q2{constructor(t=0,e=0,i=0,r=Q2.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}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,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,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){const r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],u=r[2],p=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(pn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-pn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(pn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-pn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(pn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-pn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return wb.makeRotationFromQuaternion(t),this.setFromRotationMatrix(wb,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return bb.setFromEuler(this),this.setFromQuaternion(bb,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],t[3]!==void 0&&(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}};jr.DEFAULT_ORDER="XYZ";let qo=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){r.children=[];for(let o=0;o0){r.animations=[];for(let o=0;o0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),h.length>0&&(i.images=h),u.length>0&&(i.shapes=u),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=r,i;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}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)),e===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){Lr.subVectors(r,e),ks.subVectors(i,e),ex.subVectors(t,e);const a=Lr.dot(Lr),o=Lr.dot(ks),l=Lr.dot(ex),c=ks.dot(ks),h=ks.dot(ex),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return s.set(1-m-g,g,m)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,zs)===null?!1:zs.x>=0&&zs.y>=0&&zs.x+zs.y<=1}static getInterpolation(t,e,i,r,s,a,o,l){return this.getBarycoord(t,e,i,r,zs)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,zs.x),l.addScaledVector(a,zs.y),l.addScaledVector(o,zs.z),l)}static isFrontFacing(t,e,i,r){return Lr.subVectors(i,e),ks.subVectors(t,e),Lr.cross(ks).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),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 Lr.subVectors(this.c,this.b),ks.subVectors(this.a,this.b),Lr.cross(ks).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return yc.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return yc.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return yc.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return yc.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return yc.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let a,o;zl.subVectors(r,i),Bl.subVectors(s,i),nx.subVectors(t,i);const l=zl.dot(nx),c=Bl.dot(nx);if(l<=0&&c<=0)return e.copy(i);ix.subVectors(t,r);const h=zl.dot(ix),u=Bl.dot(ix);if(h>=0&&u<=h)return e.copy(r);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(zl,a);rx.subVectors(t,s);const m=zl.dot(rx),g=Bl.dot(rx);if(g>=0&&m<=g)return e.copy(s);const _=m*c-l*g;if(_<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(Bl,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return Rb.subVectors(s,r),o=(u-h)/(u-h+(m-g)),e.copy(r).addScaledVector(Rb,o);const x=1/(y+_+p);return a=_*x,o=p*x,e.copy(i).addScaledVector(zl,a).addScaledVector(Bl,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};const tC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},wa={h:0,s:0,l:0},ap={h:0,s:0,l:0};function sx(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}let Ht=class{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){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Tn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Fe.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=Fe.workingColorSpace){return this.r=t,this.g=e,this.b=i,Fe.toWorkingColorSpace(this,r),this}setHSL(t,e,i,r=Fe.workingColorSpace){if(t=e1(t,1),e=pn(e,0,1),i=pn(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=sx(a,s,t+1/3),this.g=sx(a,s,t),this.b=sx(a,s,t-1/3)}return Fe.toWorkingColorSpace(this,r),this}setStyle(t,e=Tn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Tn){const i=tC[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.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=Lc(t.r),this.g=Lc(t.g),this.b=Lc(t.b),this}copyLinearToSRGB(t){return this.r=Xy(t.r),this.g=Xy(t.g),this.b=Xy(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Tn){return Fe.fromWorkingColorSpace(ri.copy(this),t),Math.round(pn(ri.r*255,0,255))*65536+Math.round(pn(ri.g*255,0,255))*256+Math.round(pn(ri.b*255,0,255))}getHexString(t=Tn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Fe.workingColorSpace){Fe.fromWorkingColorSpace(ri.copy(this),e);const i=ri.r,r=ri.g,s=ri.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case i:l=(r-s)/u+(r0!=t>0&&this.version++,this._alphaTest=t}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(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),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Wo&&(i.blending=this.blending),this.side!==Gr&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Gm&&(i.blendSrc=this.blendSrc),this.blendDst!==Vm&&(i.blendDst=this.blendDst),this.blendEquation!==La&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Vu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==G_&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ro&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ro&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ro&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}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;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++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.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}},Ji=class extends Rn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ht(16777215),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 jr,this.combine=Tf,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}};const Js=AO();function AO(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;!(c&8388608);)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:t,uint32View:e,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function Pi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=pn(n,-65504,65504),Js.floatView[0]=n;const t=Js.uint32View[0],e=t>>23&511;return Js.baseTable[e]+((t&8388607)>>Js.shiftTable[e])}function cu(n){const t=n>>10;return Js.uint32View[0]=Js.mantissaTable[Js.offsetTable[t]+(n&1023)]+Js.exponentTable[t],Js.floatView[0]}const TO={toHalfFloat:Pi,fromHalfFloat:cu},En=new U,op=new xt;let Pe=class{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=Zu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ni,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Ic("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.itemSize;r0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),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;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],u=s[c];for(let p=0,m=u.length;p0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s(t.far-t.near)**2))&&(Pb.copy(s).invert(),mo.copy(t.ray).applyMatrix4(Pb),!(i.boundingBox!==null&&mo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,mo)))}_computeIntersections(t,e,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,p=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,_=p.length;g<_;g++){const y=p[g],x=a[y.materialIndex],M=Math.max(y.start,m.start),b=Math.min(o.count,Math.min(y.start+y.count,m.start+m.count));for(let S=M,R=b;Se.far?null:{distance:c,point:pp.clone(),object:n}}function mp(n,t,e,i,r,s,a,o,l,c){n.getVertexPosition(o,Gl),n.getVertexPosition(l,Vl),n.getVertexPosition(c,Wl);const h=OO(n,t,e,i,Gl,Vl,Wl,dp);if(h){r&&(hp.fromBufferAttribute(r,o),up.fromBufferAttribute(r,l),fp.fromBufferAttribute(r,c),h.uv=Na.getInterpolation(dp,Gl,Vl,Wl,hp,up,fp,new xt)),s&&(hp.fromBufferAttribute(s,o),up.fromBufferAttribute(s,l),fp.fromBufferAttribute(s,c),h.uv1=Na.getInterpolation(dp,Gl,Vl,Wl,hp,up,fp,new xt)),a&&(Lb.fromBufferAttribute(a,o),Db.fromBufferAttribute(a,l),Nb.fromBufferAttribute(a,c),h.normal=Na.getInterpolation(dp,Gl,Vl,Wl,Lb,Db,Nb,new U),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new U,materialIndex:0};Na.getNormal(Gl,Vl,Wl,u.normal),h.face=u}return h}class Ka extends ve{constructor(t=1,e=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let p=0,m=0;g("z","y","x",-1,-1,i,e,t,a,s,0),g("z","y","x",1,-1,i,e,-t,a,s,1),g("x","z","y",1,1,t,i,e,r,a,2),g("x","z","y",1,-1,t,i,-e,r,a,3),g("x","y","z",1,-1,t,e,i,r,s,4),g("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ae(c,3)),this.setAttribute("normal",new ae(h,3)),this.setAttribute("uv",new ae(u,2));function g(_,y,x,M,b,S,R,T,C,N,P){const E=S/C,L=R/N,B=S/2,V=R/2,j=T/2,Y=C+1,q=N+1;let at=0,G=0;const nt=new U;for(let K=0;K0?1:-1,h.push(nt.x,nt.y,nt.z),u.push(ht/C),u.push(1-K/N),at+=1}}for(let K=0;K>8&255]+ii[n>>16&255]+ii[n>>24&255]+"-"+ii[t&255]+ii[t>>8&255]+"-"+ii[t>>16&15|64]+ii[t>>24&255]+"-"+ii[e&63|128]+ii[e>>8&255]+"-"+ii[e>>16&255]+ii[e>>24&255]+ii[i&255]+ii[i>>8&255]+ii[i>>16&255]+ii[i>>24&255]).toLowerCase()}function pn(n,t,e){return Math.max(t,Math.min(e,n))}function e1(n,t){return(n%t+t)%t}function YN(n,t,e,i,r){return i+(n-t)*(r-i)/(e-t)}function ZN(n,t,e){return n!==t?(e-n)/(t-n):0}function Au(n,t,e){return(1-e)*n+e*t}function KN(n,t,e,i){return Au(n,t,1-Math.exp(-e*i))}function JN(n,t=1){return t-Math.abs(e1(n,t*2)-t)}function QN(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function tO(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function eO(n,t){return n+Math.floor(Math.random()*(t-n+1))}function nO(n,t){return n+Math.random()*(t-n)}function iO(n){return n*(.5-Math.random())}function rO(n){n!==void 0&&(yb=n);let t=yb+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function sO(n){return n*Xo}function aO(n){return n*qc}function oO(n){return(n&n-1)===0&&n!==0}function lO(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function cO(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function hO(n,t,e,i,r){const s=Math.cos,a=Math.sin,o=s(e/2),l=a(e/2),c=s((t+i)/2),h=a((t+i)/2),u=s((t-i)/2),p=a((t-i)/2),m=s((i-t)/2),g=a((i-t)/2);switch(r){case"XYX":n.set(o*h,l*u,l*p,o*c);break;case"YZY":n.set(l*p,o*h,l*u,o*c);break;case"ZXZ":n.set(l*u,l*p,o*h,o*c);break;case"XZX":n.set(o*h,l*g,l*m,o*c);break;case"YXY":n.set(l*m,o*h,l*g,o*c);break;case"ZYZ":n.set(l*g,l*m,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function _i(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ee(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const n1={DEG2RAD:Xo,RAD2DEG:qc,generateUUID:tr,clamp:pn,euclideanModulo:e1,mapLinear:YN,inverseLerp:ZN,lerp:Au,damp:KN,pingpong:JN,smoothstep:QN,smootherstep:tO,randInt:eO,randFloat:nO,randFloatSpread:iO,seededRandom:rO,degToRad:sO,radToDeg:aO,isPowerOfTwo:oO,ceilPowerOfTwo:lO,floorPowerOfTwo:cO,setQuaternionFromProperEuler:hO,normalize:Ee,denormalize:_i};let xt=class X2{constructor(t=0,e=0){X2.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 new 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 new 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){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(pn(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const 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){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Re=class q2{constructor(t,e,i,r,s,a,o,l,c){q2.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c)}set(t,e,i,r,s,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=r,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const 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){const 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){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],u=i[7],p=i[2],m=i[5],g=i[8],_=r[0],y=r[3],x=r[6],M=r[1],b=r[4],S=r[7],R=r[2],C=r[5],T=r[8];return s[0]=a*_+o*M+l*R,s[3]=a*y+o*b+l*C,s[6]=a*x+o*S+l*T,s[1]=c*_+h*M+u*R,s[4]=c*y+h*b+u*C,s[7]=c*x+h*S+u*T,s[2]=p*_+m*M+g*R,s[5]=p*y+m*b+g*C,s[8]=p*x+m*S+g*T,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-i*s*h+i*o*l+r*s*c-r*a*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,p=o*l-h*s,m=c*s-a*l,g=e*u+i*p+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(r*c-h*i)*_,t[2]=(o*i-r*a)*_,t[3]=p*_,t[4]=(h*e-r*l)*_,t[5]=(r*s-o*e)*_,t[6]=m*_,t[7]=(i*l-c*e)*_,t[8]=(a*e-i*s)*_,this}transpose(){let t;const 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){const 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,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-r*c,r*l,-r*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(jy.makeScale(t,e)),this}rotate(t){return this.premultiply(jy.makeRotation(-t)),this}translate(t,e){return this.premultiply(jy.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){const 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){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])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){const 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)}};const jy=new Re;function $2(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}const uO={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Mc(n,t){return new uO[n](t)}function Ju(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Y2(){const n=Ju("canvas");return n.style.display="block",n}const xb={};function Ic(n){n in xb||(xb[n]=!0,console.warn(n))}function fO(n,t,e){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,e);break;default:i()}}setTimeout(s,e)})}const _b=new Re().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),vb=new Re().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zh={[Dn]:{transfer:qu,primaries:$u,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Tn]:{transfer:tn,primaries:$u,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Rf]:{transfer:qu,primaries:Yu,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(vb),fromReference:n=>n.applyMatrix3(_b)},[Z0]:{transfer:tn,primaries:Yu,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(vb),fromReference:n=>n.applyMatrix3(_b).convertLinearToSRGB()}},dO=new Set([Dn,Rf]),Fe={enabled:!0,_workingColorSpace:Dn,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!dO.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;const i=zh[t].toReference,r=zh[e].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return zh[n].primaries},getTransfer:function(n){return n===Ks?qu:zh[n].transfer},getLuminanceCoefficients:function(n,t=this._workingColorSpace){return n.fromArray(zh[t].luminanceCoefficients)}};function Lc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Xy(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ll,Z2=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Ll===void 0&&(Ll=Ju("canvas")),Ll.width=t.width,Ll.height=t.height;const i=Ll.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Ll}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Ju("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==H0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Wa:t.x=t.x-Math.floor(t.x);break;case Ki:t.x=t.x<0?0:1;break;case Vc:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Wa:t.y=t.y-Math.floor(t.y);break;case Ki:t.y=t.y<0?0:1;break;case Vc:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};Mn.DEFAULT_IMAGE=null;Mn.DEFAULT_MAPPING=H0;Mn.DEFAULT_ANISOTROPY=1;class je{constructor(t=0,e=0,i=0,r=1){je.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}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,r){return this.x=t,this.y=e,this.z=i,this.w=r,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 new 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 new 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=t.w!==void 0?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){const e=this.x,i=this.y,r=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*e+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*e+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*e+a[7]*i+a[11]*r+a[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const 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,r,s;const l=t.elements,c=l[0],h=l[4],u=l[8],p=l[1],m=l[5],g=l[9],_=l[2],y=l[6],x=l[10];if(Math.abs(h-p)<.01&&Math.abs(u-_)<.01&&Math.abs(g-y)<.01){if(Math.abs(h+p)<.1&&Math.abs(u+_)<.1&&Math.abs(g+y)<.1&&Math.abs(c+m+x-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,S=(m+1)/2,R=(x+1)/2,C=(h+p)/4,T=(u+_)/4,N=(g+y)/4;return b>S&&b>R?b<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(b),r=C/i,s=T/i):S>R?S<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),i=C/r,s=N/r):R<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(R),i=T/s,r=N/s),this.set(i,r,s,e),this}let M=Math.sqrt((y-g)*(y-g)+(u-_)*(u-_)+(p-h)*(p-h));return Math.abs(M)<.001&&(M=1),this.x=(y-g)/M,this.y=(u-_)/M,this.z=(p-h)/M,this.w=Math.acos((c+m+x-1)/2),this}setFromMatrixPosition(t){const 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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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 K2 extends qr{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new je(0,0,t,e),this.scissorTest=!1,this.viewport=new je(0,0,t,e);const r={width:t,height:e,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:mn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Mn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const a=i.count;for(let o=0;o=0?1:-1,b=1-x*x;if(b>Number.EPSILON){const R=Math.sqrt(b),C=Math.atan2(R,x*M);y=Math.sin(y*C)/R,o=Math.sin(o*C)/R}const S=o*M;if(l=l*y+p*S,c=c*y+m*S,h=h*y+g*S,u=u*y+_*S,y===1-o){const R=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=R,c*=R,h*=R,u*=R}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],h=i[r+3],u=s[a],p=s[a+1],m=s[a+2],g=s[a+3];return t[e]=o*g+h*u+l*m-c*p,t[e+1]=l*g+h*p+c*u-o*m,t[e+2]=c*g+h*m+o*p-l*u,t[e+3]=h*g-o*u-l*p-c*m,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,r){return this._x=t,this._y=e,this._z=i,this._w=r,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){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(r/2),u=o(s/2),p=l(i/2),m=l(r/2),g=l(s/2);switch(a){case"XYZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"YXZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"ZXY":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"ZYX":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"YZX":this._x=p*h*u+c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u-p*m*g;break;case"XZY":this._x=p*h*u-c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],p=i+o+u;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(i>o&&i>u){const m=2*Math.sqrt(1+i-o-u);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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(pn(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,r),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 t===0?(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){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-i*c,this._z=s*h+a*c+i*l-r*o,this._w=a*h-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+i*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*i+e*this._x,this._y=m*r+e*this._y,this._z=m*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,p=Math.sin(e*h)/c;return this._w=a*u+this._w*p,this._x=i*u+this._x*p,this._y=r*u+this._y*p,this._z=s*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*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}},U=class J2{constructor(t=0,e=0,i=0){J2.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(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 new 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 new 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(Mb.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Mb.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*r-o*i),h=2*(o*e-s*r),u=2*(s*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-s*u,this.z=r+l*u+s*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return $y.copy(this).projectOnVector(t),this.sub($y)}reflect(t){return this.sub($y.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(pn(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}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){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*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){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}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(){const t=Math.random()*Math.PI*2,e=Math.random()*2-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}};const $y=new U,Mb=new Cn;let fi=class{constructor(t=new U(1/0,1/0,1/0),e=new U(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.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,Pr),Pr.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(Bh),tp.subVectors(this.max,Bh),Dl.subVectors(t.a,Bh),Nl.subVectors(t.b,Bh),Ol.subVectors(t.c,Bh),xa.subVectors(Nl,Dl),_a.subVectors(Ol,Nl),fo.subVectors(Dl,Ol);let e=[0,-xa.z,xa.y,0,-_a.z,_a.y,0,-fo.z,fo.y,xa.z,0,-xa.x,_a.z,0,-_a.x,fo.z,0,-fo.x,-xa.y,xa.x,0,-_a.y,_a.x,0,-fo.y,fo.x,0];return!Yy(e,Dl,Nl,Ol,tp)||(e=[1,0,0,0,1,0,0,0,1],!Yy(e,Dl,Nl,Ol,tp))?!1:(ep.crossVectors(xa,_a),e=[ep.x,ep.y,ep.z],Yy(e,Dl,Nl,Ol,tp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Pr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Pr).length()*.5),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()?this:(Os[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Os[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Os[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Os[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Os[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Os[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Os[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Os[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Os),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)}};const Os=[new U,new U,new U,new U,new U,new U,new U,new U],Pr=new U,Qd=new fi,Dl=new U,Nl=new U,Ol=new U,xa=new U,_a=new U,fo=new U,Bh=new U,tp=new U,ep=new U,po=new U;function Yy(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){po.fromArray(n,s);const o=r.x*Math.abs(po.x)+r.y*Math.abs(po.y)+r.z*Math.abs(po.z),l=t.dot(po),c=e.dot(po),h=i.dot(po);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const xO=new fi,Hh=new U,Zy=new U;let Zn=class{constructor(t=new U,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){const i=this.center;e!==void 0?i.copy(e):xO.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(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;Hh.subVectors(t,this.center);const e=Hh.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(Hh,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Zy.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Hh.copy(t.center).add(Zy)),this.expandByPoint(Hh.copy(t.center).sub(Zy))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Fs=new U,Ky=new U,np=new U,va=new U,Jy=new U,ip=new U,Qy=new U;let Za=class{constructor(t=new U,e=new U(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,Fs)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const 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){const e=Fs.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Fs.copy(this.origin).addScaledVector(this.direction,e),Fs.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){Ky.copy(t).add(e).multiplyScalar(.5),np.copy(e).sub(t).normalize(),va.copy(this.origin).sub(Ky);const s=t.distanceTo(e)*.5,a=-this.direction.dot(np),o=va.dot(this.direction),l=-va.dot(np),c=va.lengthSq(),h=Math.abs(1-a*a);let u,p,m,g;if(h>0)if(u=a*l-o,p=a*o-l,g=s*h,u>=0)if(p>=-g)if(p<=g){const _=1/h;u*=_,p*=_,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*s+o)),p=u>0?-s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(u=Math.max(0,-(a*s+o)),p=u>0?s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c);else p=a>0?-s:s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Ky).addScaledVector(np,p),m}intersectSphere(t,e){Fs.subVectors(t.center,this.origin);const i=Fs.dot(this.direction),r=Fs.dot(Fs)-i*i,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,p=this.origin;return c>=0?(i=(t.min.x-p.x)*c,r=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,r=(t.min.x-p.x)*c),h>=0?(s=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(s=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a=0?(o=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(o=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),i>l||o>r)||((o>i||i!==i)&&(i=o),(l=0?i:r,e)}intersectsBox(t){return this.intersectBox(t,Fs)!==null}intersectTriangle(t,e,i,r,s){Jy.subVectors(e,t),ip.subVectors(i,t),Qy.crossVectors(Jy,ip);let a=this.direction.dot(Qy),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;va.subVectors(this.origin,t);const l=o*this.direction.dot(ip.crossVectors(va,ip));if(l<0)return null;const c=o*this.direction.dot(Jy.cross(va));if(c<0||l+c>a)return null;const h=-o*va.dot(Qy);return h<0?null:this.at(h/a,s)}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)}},de=class W_{constructor(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){W_.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y)}set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){const x=this.elements;return x[0]=t,x[4]=e,x[8]=i,x[12]=r,x[1]=s,x[5]=a,x[9]=o,x[13]=l,x[2]=c,x[6]=h,x[10]=u,x[14]=p,x[3]=m,x[7]=g,x[11]=_,x[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 W_().fromArray(this.elements)}copy(t){const 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){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const 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 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){const e=this.elements,i=t.elements,r=1/Fl.setFromMatrixColumn(t,0).length(),s=1/Fl.setFromMatrixColumn(t,1).length(),a=1/Fl.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-_*c,e[9]=-o*l,e[2]=_-p*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p+_*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=_+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p-_*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=_-p*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+_,e[1]=l*u,e[5]=_*c+p,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=_-p*u,e[8]=g*u+m,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*u+g,e[10]=p-_*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+_,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=_*u+p}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(_O,t,vO)}lookAt(t,e,i){const r=this.elements;return Wi.subVectors(t,e),Wi.lengthSq()===0&&(Wi.z=1),Wi.normalize(),Ma.crossVectors(i,Wi),Ma.lengthSq()===0&&(Math.abs(i.z)===1?Wi.x+=1e-4:Wi.z+=1e-4,Wi.normalize(),Ma.crossVectors(i,Wi)),Ma.normalize(),rp.crossVectors(Wi,Ma),r[0]=Ma.x,r[4]=rp.x,r[8]=Wi.x,r[1]=Ma.y,r[5]=rp.y,r[9]=Wi.y,r[2]=Ma.z,r[6]=rp.z,r[10]=Wi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],u=i[5],p=i[9],m=i[13],g=i[2],_=i[6],y=i[10],x=i[14],M=i[3],b=i[7],S=i[11],R=i[15],C=r[0],T=r[4],N=r[8],P=r[12],E=r[1],L=r[5],B=r[9],V=r[13],j=r[2],Y=r[6],q=r[10],at=r[14],G=r[3],tt=r[7],K=r[11],$=r[15];return s[0]=a*C+o*E+l*j+c*G,s[4]=a*T+o*L+l*Y+c*tt,s[8]=a*N+o*B+l*q+c*K,s[12]=a*P+o*V+l*at+c*$,s[1]=h*C+u*E+p*j+m*G,s[5]=h*T+u*L+p*Y+m*tt,s[9]=h*N+u*B+p*q+m*K,s[13]=h*P+u*V+p*at+m*$,s[2]=g*C+_*E+y*j+x*G,s[6]=g*T+_*L+y*Y+x*tt,s[10]=g*N+_*B+y*q+x*K,s[14]=g*P+_*V+y*at+x*$,s[3]=M*C+b*E+S*j+R*G,s[7]=M*T+b*L+S*Y+R*tt,s[11]=M*N+b*B+S*q+R*K,s[15]=M*P+b*V+S*at+R*$,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],p=t[10],m=t[14],g=t[3],_=t[7],y=t[11],x=t[15];return g*(+s*l*u-r*c*u-s*o*p+i*c*p+r*o*m-i*l*m)+_*(+e*l*m-e*c*p+s*a*p-r*a*m+r*c*h-s*l*h)+y*(+e*c*u-e*o*m-s*a*u+i*a*m+s*o*h-i*c*h)+x*(-r*o*h-e*l*u+e*o*p+r*a*u-i*a*p+i*l*h)}transpose(){const t=this.elements;let e;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(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],p=t[10],m=t[11],g=t[12],_=t[13],y=t[14],x=t[15],M=u*y*c-_*p*c+_*l*m-o*y*m-u*l*x+o*p*x,b=g*p*c-h*y*c-g*l*m+a*y*m+h*l*x-a*p*x,S=h*_*c-g*u*c+g*o*m-a*_*m-h*o*x+a*u*x,R=g*u*l-h*_*l-g*o*p+a*_*p+h*o*y-a*u*y,C=e*M+i*b+r*S+s*R;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return t[0]=M*T,t[1]=(_*p*s-u*y*s-_*r*m+i*y*m+u*r*x-i*p*x)*T,t[2]=(o*y*s-_*l*s+_*r*c-i*y*c-o*r*x+i*l*x)*T,t[3]=(u*l*s-o*p*s-u*r*c+i*p*c+o*r*m-i*l*m)*T,t[4]=b*T,t[5]=(h*y*s-g*p*s+g*r*m-e*y*m-h*r*x+e*p*x)*T,t[6]=(g*l*s-a*y*s-g*r*c+e*y*c+a*r*x-e*l*x)*T,t[7]=(a*p*s-h*l*s+h*r*c-e*p*c-a*r*m+e*l*m)*T,t[8]=S*T,t[9]=(g*u*s-h*_*s-g*i*m+e*_*m+h*i*x-e*u*x)*T,t[10]=(a*_*s-g*o*s+g*i*c-e*_*c-a*i*x+e*o*x)*T,t[11]=(h*o*s-a*u*s-h*i*c+e*u*c+a*i*m-e*o*m)*T,t[12]=R*T,t[13]=(h*_*r-g*u*r+g*i*p-e*_*p-h*i*y+e*u*y)*T,t[14]=(g*o*r-a*_*r-g*i*l+e*_*l+a*i*y-e*o*y)*T,t[15]=(a*u*r-h*o*r+h*i*l-e*u*l-a*i*p+e*o*p)*T,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}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){const 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){const 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){const 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){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,l=t.z,c=s*a,h=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+i,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+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,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,h=a+a,u=o+o,p=s*c,m=s*h,g=s*u,_=a*h,y=a*u,x=o*u,M=l*c,b=l*h,S=l*u,R=i.x,C=i.y,T=i.z;return r[0]=(1-(_+x))*R,r[1]=(m+S)*R,r[2]=(g-b)*R,r[3]=0,r[4]=(m-S)*C,r[5]=(1-(p+x))*C,r[6]=(y+M)*C,r[7]=0,r[8]=(g+b)*T,r[9]=(y-M)*T,r[10]=(1-(p+_))*T,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=Fl.set(r[0],r[1],r[2]).length();const a=Fl.set(r[4],r[5],r[6]).length(),o=Fl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],Ir.copy(this);const c=1/s,h=1/a,u=1/o;return Ir.elements[0]*=c,Ir.elements[1]*=c,Ir.elements[2]*=c,Ir.elements[4]*=h,Ir.elements[5]*=h,Ir.elements[6]*=h,Ir.elements[8]*=u,Ir.elements[9]*=u,Ir.elements[10]*=u,e.setFromRotationMatrix(Ir),i.x=s,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,a,o=gs){const l=this.elements,c=2*s/(e-t),h=2*s/(i-r),u=(e+t)/(e-t),p=(i+r)/(i-r);let m,g;if(o===gs)m=-(a+s)/(a-s),g=-2*a*s/(a-s);else if(o===Ku)m=-a/(a-s),g=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=gs){const l=this.elements,c=1/(e-t),h=1/(i-r),u=1/(a-s),p=(e+t)*c,m=(i+r)*h;let g,_;if(o===gs)g=(a+s)*u,_=-2*u;else if(o===Ku)g=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=_,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])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){const 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}};const Fl=new U,Ir=new de,_O=new U(0,0,0),vO=new U(1,1,1),Ma=new U,rp=new U,Wi=new U,wb=new de,bb=new Cn;let jr=class Q2{constructor(t=0,e=0,i=0,r=Q2.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}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,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,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){const r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],u=r[2],p=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(pn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-pn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(pn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-pn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(pn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-pn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return wb.makeRotationFromQuaternion(t),this.setFromRotationMatrix(wb,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return bb.setFromEuler(this),this.setFromQuaternion(bb,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],t[3]!==void 0&&(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}};jr.DEFAULT_ORDER="XYZ";let qo=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){r.children=[];for(let o=0;o0){r.animations=[];for(let o=0;o0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),h.length>0&&(i.images=h),u.length>0&&(i.shapes=u),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=r,i;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}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)),e===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){Lr.subVectors(r,e),ks.subVectors(i,e),ex.subVectors(t,e);const a=Lr.dot(Lr),o=Lr.dot(ks),l=Lr.dot(ex),c=ks.dot(ks),h=ks.dot(ex),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return s.set(1-m-g,g,m)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,zs)===null?!1:zs.x>=0&&zs.y>=0&&zs.x+zs.y<=1}static getInterpolation(t,e,i,r,s,a,o,l){return this.getBarycoord(t,e,i,r,zs)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,zs.x),l.addScaledVector(a,zs.y),l.addScaledVector(o,zs.z),l)}static isFrontFacing(t,e,i,r){return Lr.subVectors(i,e),ks.subVectors(t,e),Lr.cross(ks).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),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 Lr.subVectors(this.c,this.b),ks.subVectors(this.a,this.b),Lr.cross(ks).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return yc.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return yc.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return yc.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return yc.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return yc.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let a,o;zl.subVectors(r,i),Bl.subVectors(s,i),nx.subVectors(t,i);const l=zl.dot(nx),c=Bl.dot(nx);if(l<=0&&c<=0)return e.copy(i);ix.subVectors(t,r);const h=zl.dot(ix),u=Bl.dot(ix);if(h>=0&&u<=h)return e.copy(r);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(zl,a);rx.subVectors(t,s);const m=zl.dot(rx),g=Bl.dot(rx);if(g>=0&&m<=g)return e.copy(s);const _=m*c-l*g;if(_<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(Bl,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return Rb.subVectors(s,r),o=(u-h)/(u-h+(m-g)),e.copy(r).addScaledVector(Rb,o);const x=1/(y+_+p);return a=_*x,o=p*x,e.copy(i).addScaledVector(zl,a).addScaledVector(Bl,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};const tC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},wa={h:0,s:0,l:0},ap={h:0,s:0,l:0};function sx(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}let Ht=class{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){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Tn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Fe.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=Fe.workingColorSpace){return this.r=t,this.g=e,this.b=i,Fe.toWorkingColorSpace(this,r),this}setHSL(t,e,i,r=Fe.workingColorSpace){if(t=e1(t,1),e=pn(e,0,1),i=pn(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=sx(a,s,t+1/3),this.g=sx(a,s,t),this.b=sx(a,s,t-1/3)}return Fe.toWorkingColorSpace(this,r),this}setStyle(t,e=Tn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Tn){const i=tC[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.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=Lc(t.r),this.g=Lc(t.g),this.b=Lc(t.b),this}copyLinearToSRGB(t){return this.r=Xy(t.r),this.g=Xy(t.g),this.b=Xy(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Tn){return Fe.fromWorkingColorSpace(ri.copy(this),t),Math.round(pn(ri.r*255,0,255))*65536+Math.round(pn(ri.g*255,0,255))*256+Math.round(pn(ri.b*255,0,255))}getHexString(t=Tn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Fe.workingColorSpace){Fe.fromWorkingColorSpace(ri.copy(this),e);const i=ri.r,r=ri.g,s=ri.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case i:l=(r-s)/u+(r0!=t>0&&this.version++,this._alphaTest=t}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(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),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Wo&&(i.blending=this.blending),this.side!==Gr&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Gm&&(i.blendSrc=this.blendSrc),this.blendDst!==Vm&&(i.blendDst=this.blendDst),this.blendEquation!==La&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Vu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==G_&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ro&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ro&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ro&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}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;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++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.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}},Ji=class extends Rn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ht(16777215),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 jr,this.combine=Tf,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}};const Js=AO();function AO(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;!(c&8388608);)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:t,uint32View:e,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function Pi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=pn(n,-65504,65504),Js.floatView[0]=n;const t=Js.uint32View[0],e=t>>23&511;return Js.baseTable[e]+((t&8388607)>>Js.shiftTable[e])}function cu(n){const t=n>>10;return Js.uint32View[0]=Js.mantissaTable[Js.offsetTable[t]+(n&1023)]+Js.exponentTable[t],Js.floatView[0]}const TO={toHalfFloat:Pi,fromHalfFloat:cu},En=new U,op=new xt;let Pe=class{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=Zu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ni,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Ic("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.itemSize;r0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),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;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],u=s[c];for(let p=0,m=u.length;p0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s(t.far-t.near)**2))&&(Pb.copy(s).invert(),mo.copy(t.ray).applyMatrix4(Pb),!(i.boundingBox!==null&&mo.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,mo)))}_computeIntersections(t,e,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,p=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,_=p.length;g<_;g++){const y=p[g],x=a[y.materialIndex],M=Math.max(y.start,m.start),b=Math.min(o.count,Math.min(y.start+y.count,m.start+m.count));for(let S=M,R=b;Se.far?null:{distance:c,point:pp.clone(),object:n}}function mp(n,t,e,i,r,s,a,o,l,c){n.getVertexPosition(o,Gl),n.getVertexPosition(l,Vl),n.getVertexPosition(c,Wl);const h=OO(n,t,e,i,Gl,Vl,Wl,dp);if(h){r&&(hp.fromBufferAttribute(r,o),up.fromBufferAttribute(r,l),fp.fromBufferAttribute(r,c),h.uv=Na.getInterpolation(dp,Gl,Vl,Wl,hp,up,fp,new xt)),s&&(hp.fromBufferAttribute(s,o),up.fromBufferAttribute(s,l),fp.fromBufferAttribute(s,c),h.uv1=Na.getInterpolation(dp,Gl,Vl,Wl,hp,up,fp,new xt)),a&&(Lb.fromBufferAttribute(a,o),Db.fromBufferAttribute(a,l),Nb.fromBufferAttribute(a,c),h.normal=Na.getInterpolation(dp,Gl,Vl,Wl,Lb,Db,Nb,new U),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new U,materialIndex:0};Na.getNormal(Gl,Vl,Wl,u.normal),h.face=u}return h}class Ka extends ve{constructor(t=1,e=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let p=0,m=0;g("z","y","x",-1,-1,i,e,t,a,s,0),g("z","y","x",1,-1,i,e,-t,a,s,1),g("x","z","y",1,1,t,i,e,r,a,2),g("x","z","y",1,-1,t,i,-e,r,a,3),g("x","y","z",1,-1,t,e,i,r,s,4),g("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ae(c,3)),this.setAttribute("normal",new ae(h,3)),this.setAttribute("uv",new ae(u,2));function g(_,y,x,M,b,S,R,C,T,N,P){const E=S/T,L=R/N,B=S/2,V=R/2,j=C/2,Y=T+1,q=N+1;let at=0,G=0;const tt=new U;for(let K=0;K0?1:-1,h.push(tt.x,tt.y,tt.z),u.push(ht/T),u.push(1-K/N),at+=1}}for(let K=0;Kt in n?JP(n,t,{enumerable:!0,config gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new Ka(5,5,5),s=new Xr({name:"CubemapFromEquirect",uniforms:$c(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:wi,blending:ea});s.uniforms.tEquirect.value=e;const a=new vn(r,s),o=e.minFilter;return e.minFilter===gr&&(e.minFilter=mn),new rC(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,i,r){const s=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,i,r);t.setRenderTarget(s)}}const lx=new U,zO=new U,BO=new Re;class ds{constructor(t=new U(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const r=lx.subVectors(i,e).cross(zO.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const i=t.delta(lx),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:e.copy(t.start).addScaledVector(i,s)}intersectsLine(t){const 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){const i=e||BO.getNormalMatrix(t),r=this.coplanarPoint(lx).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),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)}}const go=new Zn,gp=new U;class Lf{constructor(t=new ds,e=new ds,i=new ds,r=new ds,s=new ds,a=new ds){this.planes=[t,e,i,r,s,a]}set(t,e,i,r,s,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=gs){const i=this.planes,r=t.elements,s=r[0],a=r[1],o=r[2],l=r[3],c=r[4],h=r[5],u=r[6],p=r[7],m=r[8],g=r[9],_=r[10],y=r[11],x=r[12],M=r[13],b=r[14],S=r[15];if(i[0].setComponents(l-s,p-c,y-m,S-x).normalize(),i[1].setComponents(l+s,p+c,y+m,S+x).normalize(),i[2].setComponents(l+a,p+h,y+g,S+M).normalize(),i[3].setComponents(l-a,p-h,y-g,S-M).normalize(),i[4].setComponents(l-o,p-u,y-_,S-b).normalize(),e===gs)i[5].setComponents(l+o,p+u,y+_,S+b).normalize();else if(e===Ku)i[5].setComponents(o,u,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),go.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),go.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(go)}intersectsSprite(t){return go.center.set(0,0,0),go.radius=.7071067811865476,go.applyMatrix4(t.matrixWorld),this.intersectsSphere(go)}intersectsSphere(t){const e=this.planes,i=t.center,r=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(i)0?t.max.x:t.min.x,gp.y=r.normal.y>0?t.max.y:t.min.y,gp.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(gp)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function aC(){let n=null,t=!1,e=null,i=null;function r(s,a){e(s,a),i=n.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(r),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){n=s}}}function HO(n){const t=new WeakMap;function e(o,l){const c=o.array,h=o.usage,u=c.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,c,h),o.onUploadCallback();let m;if(c instanceof Float32Array)m=n.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?m=n.HALF_FLOAT:m=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=n.SHORT;else if(c instanceof Uint32Array)m=n.UNSIGNED_INT;else if(c instanceof Int32Array)m=n.INT;else if(c instanceof Int8Array)m=n.BYTE;else if(c instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:p,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:u}}function i(o,l,c){const h=l.array,u=l._updateRange,p=l.updateRanges;if(n.bindBuffer(c,o),u.count===-1&&p.length===0&&n.bufferSubData(c,0,h),p.length!==0){for(let m=0,g=p.length;m1?null:e.copy(t.start).addScaledVector(i,s)}intersectsLine(t){const 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){const i=e||BO.getNormalMatrix(t),r=this.coplanarPoint(lx).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),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)}}const go=new Zn,gp=new U;class Lf{constructor(t=new ds,e=new ds,i=new ds,r=new ds,s=new ds,a=new ds){this.planes=[t,e,i,r,s,a]}set(t,e,i,r,s,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=gs){const i=this.planes,r=t.elements,s=r[0],a=r[1],o=r[2],l=r[3],c=r[4],h=r[5],u=r[6],p=r[7],m=r[8],g=r[9],_=r[10],y=r[11],x=r[12],M=r[13],b=r[14],S=r[15];if(i[0].setComponents(l-s,p-c,y-m,S-x).normalize(),i[1].setComponents(l+s,p+c,y+m,S+x).normalize(),i[2].setComponents(l+a,p+h,y+g,S+M).normalize(),i[3].setComponents(l-a,p-h,y-g,S-M).normalize(),i[4].setComponents(l-o,p-u,y-_,S-b).normalize(),e===gs)i[5].setComponents(l+o,p+u,y+_,S+b).normalize();else if(e===Ku)i[5].setComponents(o,u,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),go.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),go.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(go)}intersectsSprite(t){return go.center.set(0,0,0),go.radius=.7071067811865476,go.applyMatrix4(t.matrixWorld),this.intersectsSphere(go)}intersectsSphere(t){const e=this.planes,i=t.center,r=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(i)0?t.max.x:t.min.x,gp.y=r.normal.y>0?t.max.y:t.min.y,gp.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(gp)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function aC(){let n=null,t=!1,e=null,i=null;function r(s,a){e(s,a),i=n.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(r),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){n=s}}}function HO(n){const t=new WeakMap;function e(o,l){const c=o.array,h=o.usage,u=c.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,c,h),o.onUploadCallback();let m;if(c instanceof Float32Array)m=n.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?m=n.HALF_FLOAT:m=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=n.SHORT;else if(c instanceof Uint32Array)m=n.UNSIGNED_INT;else if(c instanceof Int32Array)m=n.INT;else if(c instanceof Int8Array)m=n.BYTE;else if(c instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:p,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:u}}function i(o,l,c){const h=l.array,u=l._updateRange,p=l.updateRanges;if(n.bindBuffer(c,o),u.count===-1&&p.length===0&&n.bufferSubData(c,0,h),p.length!==0){for(let m=0,g=p.length;m #include #include -}`,Ae={alphahash_fragment:GO,alphahash_pars_fragment:VO,alphamap_fragment:WO,alphamap_pars_fragment:jO,alphatest_fragment:XO,alphatest_pars_fragment:qO,aomap_fragment:$O,aomap_pars_fragment:YO,batching_pars_vertex:ZO,batching_vertex:KO,begin_vertex:JO,beginnormal_vertex:QO,bsdfs:tF,iridescence_fragment:eF,bumpmap_pars_fragment:nF,clipping_planes_fragment:iF,clipping_planes_pars_fragment:rF,clipping_planes_pars_vertex:sF,clipping_planes_vertex:aF,color_fragment:oF,color_pars_fragment:lF,color_pars_vertex:cF,color_vertex:hF,common:uF,cube_uv_reflection_fragment:fF,defaultnormal_vertex:dF,displacementmap_pars_vertex:pF,displacementmap_vertex:mF,emissivemap_fragment:gF,emissivemap_pars_fragment:yF,colorspace_fragment:xF,colorspace_pars_fragment:_F,envmap_fragment:vF,envmap_common_pars_fragment:MF,envmap_pars_fragment:wF,envmap_pars_vertex:bF,envmap_physical_pars_fragment:NF,envmap_vertex:SF,fog_vertex:EF,fog_pars_vertex:AF,fog_fragment:TF,fog_pars_fragment:CF,gradientmap_pars_fragment:RF,lightmap_pars_fragment:PF,lights_lambert_fragment:IF,lights_lambert_pars_fragment:LF,lights_pars_begin:DF,lights_toon_fragment:OF,lights_toon_pars_fragment:FF,lights_phong_fragment:UF,lights_phong_pars_fragment:kF,lights_physical_fragment:zF,lights_physical_pars_fragment:BF,lights_fragment_begin:HF,lights_fragment_maps:GF,lights_fragment_end:VF,logdepthbuf_fragment:WF,logdepthbuf_pars_fragment:jF,logdepthbuf_pars_vertex:XF,logdepthbuf_vertex:qF,map_fragment:$F,map_pars_fragment:YF,map_particle_fragment:ZF,map_particle_pars_fragment:KF,metalnessmap_fragment:JF,metalnessmap_pars_fragment:QF,morphinstance_vertex:tU,morphcolor_vertex:eU,morphnormal_vertex:nU,morphtarget_pars_vertex:iU,morphtarget_vertex:rU,normal_fragment_begin:sU,normal_fragment_maps:aU,normal_pars_fragment:oU,normal_pars_vertex:lU,normal_vertex:cU,normalmap_pars_fragment:hU,clearcoat_normal_fragment_begin:uU,clearcoat_normal_fragment_maps:fU,clearcoat_pars_fragment:dU,iridescence_pars_fragment:pU,opaque_fragment:mU,packing:gU,premultiplied_alpha_fragment:yU,project_vertex:xU,dithering_fragment:_U,dithering_pars_fragment:vU,roughnessmap_fragment:MU,roughnessmap_pars_fragment:wU,shadowmap_pars_fragment:bU,shadowmap_pars_vertex:SU,shadowmap_vertex:EU,shadowmask_pars_fragment:AU,skinbase_vertex:TU,skinning_pars_vertex:CU,skinning_vertex:RU,skinnormal_vertex:PU,specularmap_fragment:IU,specularmap_pars_fragment:LU,tonemapping_fragment:DU,tonemapping_pars_fragment:NU,transmission_fragment:OU,transmission_pars_fragment:FU,uv_pars_fragment:UU,uv_pars_vertex:kU,uv_vertex:zU,worldpos_vertex:BU,background_vert:HU,background_frag:GU,backgroundCube_vert:VU,backgroundCube_frag:WU,cube_vert:jU,cube_frag:XU,depth_vert:qU,depth_frag:$U,distanceRGBA_vert:YU,distanceRGBA_frag:ZU,equirect_vert:KU,equirect_frag:JU,linedashed_vert:QU,linedashed_frag:tk,meshbasic_vert:ek,meshbasic_frag:nk,meshlambert_vert:ik,meshlambert_frag:rk,meshmatcap_vert:sk,meshmatcap_frag:ak,meshnormal_vert:ok,meshnormal_frag:lk,meshphong_vert:ck,meshphong_frag:hk,meshphysical_vert:uk,meshphysical_frag:fk,meshtoon_vert:dk,meshtoon_frag:pk,points_vert:mk,points_frag:gk,shadow_vert:yk,shadow_frag:xk,sprite_vert:_k,sprite_frag:vk},Yt={common:{diffuse:{value:new Ht(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Re},alphaMap:{value:null},alphaMapTransform:{value:new Re},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Re}},envmap:{envMap:{value:null},envMapRotation:{value:new Re},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Re}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Re}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Re},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Re},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Re},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Re}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Re}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Re}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ht(16777215)}},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 Ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Re},alphaTest:{value:0},uvTransform:{value:new Re}},sprite:{diffuse:{value:new Ht(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Re},alphaMap:{value:null},alphaMapTransform:{value:new Re},alphaTest:{value:0}}},zr={basic:{uniforms:yi([Yt.common,Yt.specularmap,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.fog]),vertexShader:Ae.meshbasic_vert,fragmentShader:Ae.meshbasic_frag},lambert:{uniforms:yi([Yt.common,Yt.specularmap,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)}}]),vertexShader:Ae.meshlambert_vert,fragmentShader:Ae.meshlambert_frag},phong:{uniforms:yi([Yt.common,Yt.specularmap,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)},specular:{value:new Ht(1118481)},shininess:{value:30}}]),vertexShader:Ae.meshphong_vert,fragmentShader:Ae.meshphong_frag},standard:{uniforms:yi([Yt.common,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.roughnessmap,Yt.metalnessmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ae.meshphysical_vert,fragmentShader:Ae.meshphysical_frag},toon:{uniforms:yi([Yt.common,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.gradientmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)}}]),vertexShader:Ae.meshtoon_vert,fragmentShader:Ae.meshtoon_frag},matcap:{uniforms:yi([Yt.common,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.fog,{matcap:{value:null}}]),vertexShader:Ae.meshmatcap_vert,fragmentShader:Ae.meshmatcap_frag},points:{uniforms:yi([Yt.points,Yt.fog]),vertexShader:Ae.points_vert,fragmentShader:Ae.points_frag},dashed:{uniforms:yi([Yt.common,Yt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ae.linedashed_vert,fragmentShader:Ae.linedashed_frag},depth:{uniforms:yi([Yt.common,Yt.displacementmap]),vertexShader:Ae.depth_vert,fragmentShader:Ae.depth_frag},normal:{uniforms:yi([Yt.common,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,{opacity:{value:1}}]),vertexShader:Ae.meshnormal_vert,fragmentShader:Ae.meshnormal_frag},sprite:{uniforms:yi([Yt.sprite,Yt.fog]),vertexShader:Ae.sprite_vert,fragmentShader:Ae.sprite_frag},background:{uniforms:{uvTransform:{value:new Re},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ae.background_vert,fragmentShader:Ae.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Re}},vertexShader:Ae.backgroundCube_vert,fragmentShader:Ae.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ae.cube_vert,fragmentShader:Ae.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ae.equirect_vert,fragmentShader:Ae.equirect_frag},distanceRGBA:{uniforms:yi([Yt.common,Yt.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ae.distanceRGBA_vert,fragmentShader:Ae.distanceRGBA_frag},shadow:{uniforms:yi([Yt.lights,Yt.fog,{color:{value:new Ht(0)},opacity:{value:1}}]),vertexShader:Ae.shadow_vert,fragmentShader:Ae.shadow_frag}};zr.physical={uniforms:yi([zr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Re},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Re},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Re},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Re},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Re},sheen:{value:0},sheenColor:{value:new Ht(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Re},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Re},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Re},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Re},attenuationDistance:{value:0},attenuationColor:{value:new Ht(0)},specularColor:{value:new Ht(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Re},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Re},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Re}}]),vertexShader:Ae.meshphysical_vert,fragmentShader:Ae.meshphysical_frag};const yp={r:0,b:0,g:0},yo=new jr,Mk=new de;function wk(n,t,e,i,r,s,a){const o=new Ht(0);let l=s===!0?0:1,c,h,u=null,p=0,m=null;function g(M){let b=M.isScene===!0?M.background:null;return b&&b.isTexture&&(b=(M.backgroundBlurriness>0?e:t).get(b)),b}function _(M){let b=!1;const S=g(M);S===null?x(o,l):S&&S.isColor&&(x(S,1),b=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,a):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,a),(n.autoClear||b)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(M,b){const S=g(b);S&&(S.isCubeTexture||S.mapping===ah)?(h===void 0&&(h=new vn(new Ka(1,1,1),new Xr({name:"BackgroundCubeMaterial",uniforms:$c(zr.backgroundCube.uniforms),vertexShader:zr.backgroundCube.vertexShader,fragmentShader:zr.backgroundCube.fragmentShader,side:wi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(R,T,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),yo.copy(b.backgroundRotation),yo.x*=-1,yo.y*=-1,yo.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(yo.y*=-1,yo.z*=-1),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Mk.makeRotationFromEuler(yo)),h.material.toneMapped=Fe.getTransfer(S.colorSpace)!==tn,(u!==S||p!==S.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,u=S,p=S.version,m=n.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new vn(new lh(2,2),new Xr({name:"BackgroundMaterial",uniforms:$c(zr.background.uniforms),vertexShader:zr.background.vertexShader,fragmentShader:zr.background.fragmentShader,side:Gr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=Fe.getTransfer(S.colorSpace)!==tn,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(u!==S||p!==S.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,u=S,p=S.version,m=n.toneMapping),c.layers.enableAll(),M.unshift(c,c.geometry,c.material,0,0,null))}function x(M,b){M.getRGB(yp,nC(n)),i.buffers.color.setClear(yp.r,yp.g,yp.b,b,a)}return{getClearColor:function(){return o},setClearColor:function(M,b=1){o.set(M),l=b,x(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(M){l=M,x(o,l)},render:_,addToRenderList:y}}function bk(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,a=!1;function o(E,L,B,V,j){let Y=!1;const q=u(V,B,L);s!==q&&(s=q,c(s.object)),Y=m(E,V,B,j),Y&&g(E,V,B,j),j!==null&&t.update(j,n.ELEMENT_ARRAY_BUFFER),(Y||a)&&(a=!1,S(E,L,B,V),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function l(){return n.createVertexArray()}function c(E){return n.bindVertexArray(E)}function h(E){return n.deleteVertexArray(E)}function u(E,L,B){const V=B.wireframe===!0;let j=i[E.id];j===void 0&&(j={},i[E.id]=j);let Y=j[L.id];Y===void 0&&(Y={},j[L.id]=Y);let q=Y[V];return q===void 0&&(q=p(l()),Y[V]=q),q}function p(E){const L=[],B=[],V=[];for(let j=0;j=0){const K=j[G];let $=Y[G];if($===void 0&&(G==="instanceMatrix"&&E.instanceMatrix&&($=E.instanceMatrix),G==="instanceColor"&&E.instanceColor&&($=E.instanceColor)),K===void 0||K.attribute!==$||$&&K.data!==$.data)return!0;q++}return s.attributesNum!==q||s.index!==V}function g(E,L,B,V){const j={},Y=L.attributes;let q=0;const at=B.getAttributes();for(const G in at)if(at[G].location>=0){let K=Y[G];K===void 0&&(G==="instanceMatrix"&&E.instanceMatrix&&(K=E.instanceMatrix),G==="instanceColor"&&E.instanceColor&&(K=E.instanceColor));const $={};$.attribute=K,K&&K.data&&($.data=K.data),j[G]=$,q++}s.attributes=j,s.attributesNum=q,s.index=V}function _(){const E=s.newAttributes;for(let L=0,B=E.length;L=0){let nt=j[at];if(nt===void 0&&(at==="instanceMatrix"&&E.instanceMatrix&&(nt=E.instanceMatrix),at==="instanceColor"&&E.instanceColor&&(nt=E.instanceColor)),nt!==void 0){const K=nt.normalized,$=nt.itemSize,ht=t.get(nt);if(ht===void 0)continue;const vt=ht.buffer,Z=ht.type,rt=ht.bytesPerElement,St=Z===n.INT||Z===n.UNSIGNED_INT||nt.gpuType===V0;if(nt.isInterleavedBufferAttribute){const _t=nt.data,Ot=_t.stride,Xt=nt.offset;if(_t.isInstancedInterleavedBuffer){for(let Gt=0;Gt0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=e.logarithmicDepthBuffer===!0,p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),M=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),S=m>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,maxTextures:p,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:_,maxAttributes:y,maxVertexUniforms:x,maxVaryings:M,maxFragmentUniforms:b,vertexTextures:S,maxSamples:R}}function Ak(n){const t=this;let e=null,i=0,r=!1,s=!1;const a=new ds,o=new Re,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,p){const m=u.length!==0||p||i!==0||r;return r=p,i=u.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,p){e=h(u,p,0)},this.setState=function(u,p,m){const g=u.clippingPlanes,_=u.clipIntersection,y=u.clipShadows,x=n.get(u);if(!r||g===null||g.length===0||s&&!y)s?h(null):c();else{const M=s?0:i,b=M*4;let S=x.clippingState||null;l.value=S,S=h(g,p,b,m);for(let R=0;R!==b;++R)S[R]=e[R];x.clippingState=S,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=M}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function h(u,p,m,g){const _=u!==null?u.length:0;let y=null;if(_!==0){if(y=l.value,g!==!0||y===null){const x=m+_*4,M=p.matrixWorldInverse;o.getNormalMatrix(M),(y===null||y.length0){const c=new sC(l.height);return c.fromEquirectangularTexture(n,a),t.set(a,c),a.addEventListener("dispose",r),e(c.texture,a.mapping)}else return null}}return a}function r(a){const o=a.target;o.removeEventListener("dispose",r);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function s(){t=new WeakMap}return{get:i,dispose:s}}class ys extends Pf{constructor(t=-1,e=1,i=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,i,r,s,a){this.view===null&&(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=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-t,a=i+t,o=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const wc=4,Ub=[.125,.215,.35,.446,.526,.582],Do=20,cx=new ys,kb=new Ht;let hx=null,ux=0,fx=0,dx=!1;const Po=(1+Math.sqrt(5))/2,ql=1/Po,zb=[new U(-Po,ql,0),new U(Po,ql,0),new U(-ql,0,Po),new U(ql,0,Po),new U(0,Po,-ql),new U(0,Po,ql),new U(-1,1,-1),new U(1,1,-1),new U(-1,1,1),new U(1,1,1)];class j_{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,r=100){hx=this._renderer.getRenderTarget(),ux=this._renderer.getActiveCubeFace(),fx=this._renderer.getActiveMipmapLevel(),dx=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,i,r,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Gb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Hb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),h.setRenderTarget(r),_&&h.render(g,o),h.render(t,o)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=p,h.autoClear=u,t.background=y}_textureToCubeUV(t,e){const i=this._renderer,r=t.mapping===sa||t.mapping===Va;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Gb()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Hb());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new vn(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;const l=this._cubeSize;xp(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(a,cx)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sDo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Do}`);const x=[];let M=0;for(let C=0;Cb-wc?r-b+wc:0),T=4*(this._cubeSize-S);xp(e,R,T,3*S,2*S),l.setRenderTarget(e),l.render(u,cx)}}function Ck(n){const t=[],e=[],i=[];let r=n;const s=n-wc+1+Ub.length;for(let a=0;an-wc?l=Ub[a-n+wc-1]:a===0&&(l=0),i.push(l);const c=1/(o-2),h=-c,u=1+c,p=[h,h,u,h,u,u,h,h,u,u,h,u],m=6,g=6,_=3,y=2,x=1,M=new Float32Array(_*g*m),b=new Float32Array(y*g*m),S=new Float32Array(x*g*m);for(let T=0;T2?0:-1,P=[C,N,0,C+2/3,N,0,C+2/3,N+1,0,C,N,0,C+2/3,N+1,0,C,N+1,0];M.set(P,_*g*T),b.set(p,y*g*T);const E=[T,T,T,T,T,T];S.set(E,x*g*T)}const R=new ve;R.setAttribute("position",new Pe(M,_)),R.setAttribute("uv",new Pe(b,y)),R.setAttribute("faceIndex",new Pe(S,x)),t.push(R),r>wc&&r--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function Bb(n,t,e){const i=new Wr(n,t,e);return i.texture.mapping=ah,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function xp(n,t,e,i,r){n.viewport.set(t,e,i,r),n.scissor.set(t,e,i,r)}function Rk(n,t,e){const i=new Float32Array(Do),r=new U(0,1,0);return new Xr({name:"SphericalGaussianBlur",defines:{n:Do,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:a1(),fragmentShader:` +}`,Ae={alphahash_fragment:GO,alphahash_pars_fragment:VO,alphamap_fragment:WO,alphamap_pars_fragment:jO,alphatest_fragment:XO,alphatest_pars_fragment:qO,aomap_fragment:$O,aomap_pars_fragment:YO,batching_pars_vertex:ZO,batching_vertex:KO,begin_vertex:JO,beginnormal_vertex:QO,bsdfs:tF,iridescence_fragment:eF,bumpmap_pars_fragment:nF,clipping_planes_fragment:iF,clipping_planes_pars_fragment:rF,clipping_planes_pars_vertex:sF,clipping_planes_vertex:aF,color_fragment:oF,color_pars_fragment:lF,color_pars_vertex:cF,color_vertex:hF,common:uF,cube_uv_reflection_fragment:fF,defaultnormal_vertex:dF,displacementmap_pars_vertex:pF,displacementmap_vertex:mF,emissivemap_fragment:gF,emissivemap_pars_fragment:yF,colorspace_fragment:xF,colorspace_pars_fragment:_F,envmap_fragment:vF,envmap_common_pars_fragment:MF,envmap_pars_fragment:wF,envmap_pars_vertex:bF,envmap_physical_pars_fragment:NF,envmap_vertex:SF,fog_vertex:EF,fog_pars_vertex:AF,fog_fragment:TF,fog_pars_fragment:CF,gradientmap_pars_fragment:RF,lightmap_pars_fragment:PF,lights_lambert_fragment:IF,lights_lambert_pars_fragment:LF,lights_pars_begin:DF,lights_toon_fragment:OF,lights_toon_pars_fragment:FF,lights_phong_fragment:UF,lights_phong_pars_fragment:kF,lights_physical_fragment:zF,lights_physical_pars_fragment:BF,lights_fragment_begin:HF,lights_fragment_maps:GF,lights_fragment_end:VF,logdepthbuf_fragment:WF,logdepthbuf_pars_fragment:jF,logdepthbuf_pars_vertex:XF,logdepthbuf_vertex:qF,map_fragment:$F,map_pars_fragment:YF,map_particle_fragment:ZF,map_particle_pars_fragment:KF,metalnessmap_fragment:JF,metalnessmap_pars_fragment:QF,morphinstance_vertex:tU,morphcolor_vertex:eU,morphnormal_vertex:nU,morphtarget_pars_vertex:iU,morphtarget_vertex:rU,normal_fragment_begin:sU,normal_fragment_maps:aU,normal_pars_fragment:oU,normal_pars_vertex:lU,normal_vertex:cU,normalmap_pars_fragment:hU,clearcoat_normal_fragment_begin:uU,clearcoat_normal_fragment_maps:fU,clearcoat_pars_fragment:dU,iridescence_pars_fragment:pU,opaque_fragment:mU,packing:gU,premultiplied_alpha_fragment:yU,project_vertex:xU,dithering_fragment:_U,dithering_pars_fragment:vU,roughnessmap_fragment:MU,roughnessmap_pars_fragment:wU,shadowmap_pars_fragment:bU,shadowmap_pars_vertex:SU,shadowmap_vertex:EU,shadowmask_pars_fragment:AU,skinbase_vertex:TU,skinning_pars_vertex:CU,skinning_vertex:RU,skinnormal_vertex:PU,specularmap_fragment:IU,specularmap_pars_fragment:LU,tonemapping_fragment:DU,tonemapping_pars_fragment:NU,transmission_fragment:OU,transmission_pars_fragment:FU,uv_pars_fragment:UU,uv_pars_vertex:kU,uv_vertex:zU,worldpos_vertex:BU,background_vert:HU,background_frag:GU,backgroundCube_vert:VU,backgroundCube_frag:WU,cube_vert:jU,cube_frag:XU,depth_vert:qU,depth_frag:$U,distanceRGBA_vert:YU,distanceRGBA_frag:ZU,equirect_vert:KU,equirect_frag:JU,linedashed_vert:QU,linedashed_frag:tk,meshbasic_vert:ek,meshbasic_frag:nk,meshlambert_vert:ik,meshlambert_frag:rk,meshmatcap_vert:sk,meshmatcap_frag:ak,meshnormal_vert:ok,meshnormal_frag:lk,meshphong_vert:ck,meshphong_frag:hk,meshphysical_vert:uk,meshphysical_frag:fk,meshtoon_vert:dk,meshtoon_frag:pk,points_vert:mk,points_frag:gk,shadow_vert:yk,shadow_frag:xk,sprite_vert:_k,sprite_frag:vk},Yt={common:{diffuse:{value:new Ht(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Re},alphaMap:{value:null},alphaMapTransform:{value:new Re},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Re}},envmap:{envMap:{value:null},envMapRotation:{value:new Re},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Re}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Re}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Re},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Re},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Re},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Re}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Re}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Re}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ht(16777215)}},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 Ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Re},alphaTest:{value:0},uvTransform:{value:new Re}},sprite:{diffuse:{value:new Ht(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Re},alphaMap:{value:null},alphaMapTransform:{value:new Re},alphaTest:{value:0}}},zr={basic:{uniforms:yi([Yt.common,Yt.specularmap,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.fog]),vertexShader:Ae.meshbasic_vert,fragmentShader:Ae.meshbasic_frag},lambert:{uniforms:yi([Yt.common,Yt.specularmap,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)}}]),vertexShader:Ae.meshlambert_vert,fragmentShader:Ae.meshlambert_frag},phong:{uniforms:yi([Yt.common,Yt.specularmap,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)},specular:{value:new Ht(1118481)},shininess:{value:30}}]),vertexShader:Ae.meshphong_vert,fragmentShader:Ae.meshphong_frag},standard:{uniforms:yi([Yt.common,Yt.envmap,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.roughnessmap,Yt.metalnessmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ae.meshphysical_vert,fragmentShader:Ae.meshphysical_frag},toon:{uniforms:yi([Yt.common,Yt.aomap,Yt.lightmap,Yt.emissivemap,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.gradientmap,Yt.fog,Yt.lights,{emissive:{value:new Ht(0)}}]),vertexShader:Ae.meshtoon_vert,fragmentShader:Ae.meshtoon_frag},matcap:{uniforms:yi([Yt.common,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,Yt.fog,{matcap:{value:null}}]),vertexShader:Ae.meshmatcap_vert,fragmentShader:Ae.meshmatcap_frag},points:{uniforms:yi([Yt.points,Yt.fog]),vertexShader:Ae.points_vert,fragmentShader:Ae.points_frag},dashed:{uniforms:yi([Yt.common,Yt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ae.linedashed_vert,fragmentShader:Ae.linedashed_frag},depth:{uniforms:yi([Yt.common,Yt.displacementmap]),vertexShader:Ae.depth_vert,fragmentShader:Ae.depth_frag},normal:{uniforms:yi([Yt.common,Yt.bumpmap,Yt.normalmap,Yt.displacementmap,{opacity:{value:1}}]),vertexShader:Ae.meshnormal_vert,fragmentShader:Ae.meshnormal_frag},sprite:{uniforms:yi([Yt.sprite,Yt.fog]),vertexShader:Ae.sprite_vert,fragmentShader:Ae.sprite_frag},background:{uniforms:{uvTransform:{value:new Re},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ae.background_vert,fragmentShader:Ae.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Re}},vertexShader:Ae.backgroundCube_vert,fragmentShader:Ae.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ae.cube_vert,fragmentShader:Ae.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ae.equirect_vert,fragmentShader:Ae.equirect_frag},distanceRGBA:{uniforms:yi([Yt.common,Yt.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ae.distanceRGBA_vert,fragmentShader:Ae.distanceRGBA_frag},shadow:{uniforms:yi([Yt.lights,Yt.fog,{color:{value:new Ht(0)},opacity:{value:1}}]),vertexShader:Ae.shadow_vert,fragmentShader:Ae.shadow_frag}};zr.physical={uniforms:yi([zr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Re},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Re},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Re},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Re},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Re},sheen:{value:0},sheenColor:{value:new Ht(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Re},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Re},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Re},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Re},attenuationDistance:{value:0},attenuationColor:{value:new Ht(0)},specularColor:{value:new Ht(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Re},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Re},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Re}}]),vertexShader:Ae.meshphysical_vert,fragmentShader:Ae.meshphysical_frag};const yp={r:0,b:0,g:0},yo=new jr,Mk=new de;function wk(n,t,e,i,r,s,a){const o=new Ht(0);let l=s===!0?0:1,c,h,u=null,p=0,m=null;function g(M){let b=M.isScene===!0?M.background:null;return b&&b.isTexture&&(b=(M.backgroundBlurriness>0?e:t).get(b)),b}function _(M){let b=!1;const S=g(M);S===null?x(o,l):S&&S.isColor&&(x(S,1),b=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,a):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,a),(n.autoClear||b)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(M,b){const S=g(b);S&&(S.isCubeTexture||S.mapping===ah)?(h===void 0&&(h=new vn(new Ka(1,1,1),new Xr({name:"BackgroundCubeMaterial",uniforms:$c(zr.backgroundCube.uniforms),vertexShader:zr.backgroundCube.vertexShader,fragmentShader:zr.backgroundCube.fragmentShader,side:wi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(R,C,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),yo.copy(b.backgroundRotation),yo.x*=-1,yo.y*=-1,yo.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(yo.y*=-1,yo.z*=-1),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Mk.makeRotationFromEuler(yo)),h.material.toneMapped=Fe.getTransfer(S.colorSpace)!==tn,(u!==S||p!==S.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,u=S,p=S.version,m=n.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new vn(new lh(2,2),new Xr({name:"BackgroundMaterial",uniforms:$c(zr.background.uniforms),vertexShader:zr.background.vertexShader,fragmentShader:zr.background.fragmentShader,side:Gr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=Fe.getTransfer(S.colorSpace)!==tn,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(u!==S||p!==S.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,u=S,p=S.version,m=n.toneMapping),c.layers.enableAll(),M.unshift(c,c.geometry,c.material,0,0,null))}function x(M,b){M.getRGB(yp,nC(n)),i.buffers.color.setClear(yp.r,yp.g,yp.b,b,a)}return{getClearColor:function(){return o},setClearColor:function(M,b=1){o.set(M),l=b,x(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(M){l=M,x(o,l)},render:_,addToRenderList:y}}function bk(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,a=!1;function o(E,L,B,V,j){let Y=!1;const q=u(V,B,L);s!==q&&(s=q,c(s.object)),Y=m(E,V,B,j),Y&&g(E,V,B,j),j!==null&&t.update(j,n.ELEMENT_ARRAY_BUFFER),(Y||a)&&(a=!1,S(E,L,B,V),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function l(){return n.createVertexArray()}function c(E){return n.bindVertexArray(E)}function h(E){return n.deleteVertexArray(E)}function u(E,L,B){const V=B.wireframe===!0;let j=i[E.id];j===void 0&&(j={},i[E.id]=j);let Y=j[L.id];Y===void 0&&(Y={},j[L.id]=Y);let q=Y[V];return q===void 0&&(q=p(l()),Y[V]=q),q}function p(E){const L=[],B=[],V=[];for(let j=0;j=0){const K=j[G];let $=Y[G];if($===void 0&&(G==="instanceMatrix"&&E.instanceMatrix&&($=E.instanceMatrix),G==="instanceColor"&&E.instanceColor&&($=E.instanceColor)),K===void 0||K.attribute!==$||$&&K.data!==$.data)return!0;q++}return s.attributesNum!==q||s.index!==V}function g(E,L,B,V){const j={},Y=L.attributes;let q=0;const at=B.getAttributes();for(const G in at)if(at[G].location>=0){let K=Y[G];K===void 0&&(G==="instanceMatrix"&&E.instanceMatrix&&(K=E.instanceMatrix),G==="instanceColor"&&E.instanceColor&&(K=E.instanceColor));const $={};$.attribute=K,K&&K.data&&($.data=K.data),j[G]=$,q++}s.attributes=j,s.attributesNum=q,s.index=V}function _(){const E=s.newAttributes;for(let L=0,B=E.length;L=0){let tt=j[at];if(tt===void 0&&(at==="instanceMatrix"&&E.instanceMatrix&&(tt=E.instanceMatrix),at==="instanceColor"&&E.instanceColor&&(tt=E.instanceColor)),tt!==void 0){const K=tt.normalized,$=tt.itemSize,ht=t.get(tt);if(ht===void 0)continue;const vt=ht.buffer,Z=ht.type,rt=ht.bytesPerElement,St=Z===n.INT||Z===n.UNSIGNED_INT||tt.gpuType===V0;if(tt.isInterleavedBufferAttribute){const _t=tt.data,Ot=_t.stride,Xt=tt.offset;if(_t.isInstancedInterleavedBuffer){for(let Gt=0;Gt0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=e.logarithmicDepthBuffer===!0,p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),M=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),S=m>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,maxTextures:p,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:_,maxAttributes:y,maxVertexUniforms:x,maxVaryings:M,maxFragmentUniforms:b,vertexTextures:S,maxSamples:R}}function Ak(n){const t=this;let e=null,i=0,r=!1,s=!1;const a=new ds,o=new Re,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,p){const m=u.length!==0||p||i!==0||r;return r=p,i=u.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,p){e=h(u,p,0)},this.setState=function(u,p,m){const g=u.clippingPlanes,_=u.clipIntersection,y=u.clipShadows,x=n.get(u);if(!r||g===null||g.length===0||s&&!y)s?h(null):c();else{const M=s?0:i,b=M*4;let S=x.clippingState||null;l.value=S,S=h(g,p,b,m);for(let R=0;R!==b;++R)S[R]=e[R];x.clippingState=S,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=M}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function h(u,p,m,g){const _=u!==null?u.length:0;let y=null;if(_!==0){if(y=l.value,g!==!0||y===null){const x=m+_*4,M=p.matrixWorldInverse;o.getNormalMatrix(M),(y===null||y.length0){const c=new sC(l.height);return c.fromEquirectangularTexture(n,a),t.set(a,c),a.addEventListener("dispose",r),e(c.texture,a.mapping)}else return null}}return a}function r(a){const o=a.target;o.removeEventListener("dispose",r);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function s(){t=new WeakMap}return{get:i,dispose:s}}class ys extends Pf{constructor(t=-1,e=1,i=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,i,r,s,a){this.view===null&&(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=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-t,a=i+t,o=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const wc=4,Ub=[.125,.215,.35,.446,.526,.582],Do=20,cx=new ys,kb=new Ht;let hx=null,ux=0,fx=0,dx=!1;const Po=(1+Math.sqrt(5))/2,ql=1/Po,zb=[new U(-Po,ql,0),new U(Po,ql,0),new U(-ql,0,Po),new U(ql,0,Po),new U(0,Po,-ql),new U(0,Po,ql),new U(-1,1,-1),new U(1,1,-1),new U(-1,1,1),new U(1,1,1)];class j_{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,r=100){hx=this._renderer.getRenderTarget(),ux=this._renderer.getActiveCubeFace(),fx=this._renderer.getActiveMipmapLevel(),dx=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,i,r,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Gb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Hb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),h.setRenderTarget(r),_&&h.render(g,o),h.render(t,o)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=p,h.autoClear=u,t.background=y}_textureToCubeUV(t,e){const i=this._renderer,r=t.mapping===sa||t.mapping===Va;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Gb()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Hb());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new vn(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;const l=this._cubeSize;xp(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(a,cx)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sDo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Do}`);const x=[];let M=0;for(let T=0;Tb-wc?r-b+wc:0),C=4*(this._cubeSize-S);xp(e,R,C,3*S,2*S),l.setRenderTarget(e),l.render(u,cx)}}function Ck(n){const t=[],e=[],i=[];let r=n;const s=n-wc+1+Ub.length;for(let a=0;an-wc?l=Ub[a-n+wc-1]:a===0&&(l=0),i.push(l);const c=1/(o-2),h=-c,u=1+c,p=[h,h,u,h,u,u,h,h,u,u,h,u],m=6,g=6,_=3,y=2,x=1,M=new Float32Array(_*g*m),b=new Float32Array(y*g*m),S=new Float32Array(x*g*m);for(let C=0;C2?0:-1,P=[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];M.set(P,_*g*C),b.set(p,y*g*C);const E=[C,C,C,C,C,C];S.set(E,x*g*C)}const R=new ve;R.setAttribute("position",new Pe(M,_)),R.setAttribute("uv",new Pe(b,y)),R.setAttribute("faceIndex",new Pe(S,x)),t.push(R),r>wc&&r--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function Bb(n,t,e){const i=new Wr(n,t,e);return i.texture.mapping=ah,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function xp(n,t,e,i,r){n.viewport.set(t,e,i,r),n.scissor.set(t,e,i,r)}function Rk(n,t,e){const i=new Float32Array(Do),r=new U(0,1,0);return new Xr({name:"SphericalGaussianBlur",defines:{n:Do,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:a1(),fragmentShader:` precision mediump float; precision mediump int; @@ -3737,7 +3737,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function Pk(n){let t=new WeakMap,e=null;function i(o){if(o&&o.isTexture){const l=o.mapping,c=l===Wu||l===ju,h=l===sa||l===Va;if(c||h){let u=t.get(o);const p=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==p)return e===null&&(e=new j_(n)),u=c?e.fromEquirectangular(o,u):e.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),u.texture;if(u!==void 0)return u.texture;{const m=o.image;return c&&m&&m.height>0||h&&m&&r(m)?(e===null&&(e=new j_(n)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",s),u.texture):null}}}return o}function r(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const T=new Float32Array(S*R*4*u),C=new K0(T,S,R,u);C.type=Ni,C.needsUpdate=!0;const N=b*4;for(let E=0;E0)return n;const r=t*e;let s=Wb[r];if(s===void 0&&(s=new Float32Array(r),Wb[r]=s),t!==0){i.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,n[a].toArray(s,o)}return s}function Nn(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e0||h&&m&&r(m)?(e===null&&(e=new j_(n)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",s),u.texture):null}}}return o}function r(o){let l=0;const c=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const C=new Float32Array(S*R*4*u),T=new K0(C,S,R,u);T.type=Ni,T.needsUpdate=!0;const N=b*4;for(let E=0;E0)return n;const r=t*e;let s=Wb[r];if(s===void 0&&(s=new Float32Array(r),Wb[r]=s),t!==0){i.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,n[a].toArray(s,o)}return s}function Nn(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e":" "} ${o}: ${e[a]}`)}return i.join(` `)}function Pz(n){const t=Fe.getPrimaries(Fe.workingColorSpace),e=Fe.getPrimaries(n);let i;switch(t===e?i="":t===Yu&&e===$u?i="LinearDisplayP3ToLinearSRGB":t===$u&&e===Yu&&(i="LinearSRGBToLinearDisplayP3"),n){case Dn:case Rf:return[i,"LinearTransferOETF"];case Tn:case Z0:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function Kb(n,t,e){const i=n.getShaderParameter(t,n.COMPILE_STATUS),r=n.getShaderInfoLog(t).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const a=parseInt(s[1]);return e.toUpperCase()+` @@ -3780,14 +3780,14 @@ void main() { `)+` `+y,x=["#define varying in",e.glslVersion===V_?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===V_?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+x);const b=M+y+a,S=M+x+o,R=Zb(r,r.VERTEX_SHADER,b),T=Zb(r,r.FRAGMENT_SHADER,S);r.attachShader(_,R),r.attachShader(_,T),e.index0AttributeName!==void 0?r.bindAttribLocation(_,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function C(L){if(n.debug.checkShaderErrors){const B=r.getProgramInfoLog(_).trim(),V=r.getShaderInfoLog(R).trim(),j=r.getShaderInfoLog(T).trim();let Y=!0,q=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(Y=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,R,T);else{const at=Kb(r,R,"vertex"),G=Kb(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` +`+x);const b=M+y+a,S=M+x+o,R=Zb(r,r.VERTEX_SHADER,b),C=Zb(r,r.FRAGMENT_SHADER,S);r.attachShader(_,R),r.attachShader(_,C),e.index0AttributeName!==void 0?r.bindAttribLocation(_,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function T(L){if(n.debug.checkShaderErrors){const B=r.getProgramInfoLog(_).trim(),V=r.getShaderInfoLog(R).trim(),j=r.getShaderInfoLog(C).trim();let Y=!0,q=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(Y=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,R,C);else{const at=Kb(r,R,"vertex"),G=Kb(r,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` Material Name: `+L.name+` Material Type: `+L.type+` Program Info Log: `+B+` `+at+` -`+G)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(V===""||j==="")&&(q=!1);q&&(L.diagnostics={runnable:Y,programLog:B,vertexShader:{log:V,prefix:y},fragmentShader:{log:j,prefix:x}})}r.deleteShader(R),r.deleteShader(T),N=new Pm(r,_),P=Fz(r,_)}let N;this.getUniforms=function(){return N===void 0&&C(this),N};let P;this.getAttributes=function(){return P===void 0&&C(this),P};let E=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=r.getProgramParameter(_,Tz)),E},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Cz++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=R,this.fragmentShader=T,this}let $z=0;class Yz{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(e),s=this._getShaderStage(i),a=this._getShaderCacheForMaterial(t);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const i of e)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return i===void 0&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return i===void 0&&(i=new Zz(t),e.set(t,i)),i}}class Zz{constructor(t){this.id=$z++,this.code=t,this.usedTimes=0}}function Kz(n,t,e,i,r,s,a){const o=new qo,l=new Yz,c=new Set,h=[],u=r.logarithmicDepthBuffer,p=r.vertexTextures;let m=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(P){return c.add(P),P===0?"uv":`uv${P}`}function y(P,E,L,B,V){const j=B.fog,Y=V.geometry,q=P.isMeshStandardMaterial?B.environment:null,at=(P.isMeshStandardMaterial?e:t).get(P.envMap||q),G=at&&at.mapping===ah?at.image.height:null,nt=g[P.type];P.precision!==null&&(m=r.getMaxPrecision(P.precision),m!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",m,"instead."));const K=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,$=K!==void 0?K.length:0;let ht=0;Y.morphAttributes.position!==void 0&&(ht=1),Y.morphAttributes.normal!==void 0&&(ht=2),Y.morphAttributes.color!==void 0&&(ht=3);let vt,Z,rt,St;if(nt){const Se=zr[nt];vt=Se.vertexShader,Z=Se.fragmentShader}else vt=P.vertexShader,Z=P.fragmentShader,l.update(P),rt=l.getVertexShaderID(P),St=l.getFragmentShaderID(P);const _t=n.getRenderTarget(),Ot=V.isInstancedMesh===!0,Xt=V.isBatchedMesh===!0,Gt=!!P.map,Qt=!!P.matcap,F=!!at,wt=!!P.aoMap,bt=!!P.lightMap,mt=!!P.bumpMap,dt=!!P.normalMap,kt=!!P.displacementMap,Rt=!!P.emissiveMap,zt=!!P.metalnessMap,z=!!P.roughnessMap,O=P.anisotropy>0,ot=P.clearcoat>0,At=P.dispersion>0,Et=P.iridescence>0,Tt=P.sheen>0,ne=P.transmission>0,Ft=O&&!!P.anisotropyMap,Wt=ot&&!!P.clearcoatMap,ge=ot&&!!P.clearcoatNormalMap,Dt=ot&&!!P.clearcoatRoughnessMap,$t=Et&&!!P.iridescenceMap,It=Et&&!!P.iridescenceThicknessMap,Nt=Tt&&!!P.sheenColorMap,qt=Tt&&!!P.sheenRoughnessMap,W=!!P.specularMap,gt=!!P.specularColorMap,jt=!!P.specularIntensityMap,D=ne&&!!P.transmissionMap,it=ne&&!!P.thicknessMap,lt=!!P.gradientMap,ut=!!P.alphaMap,Ct=P.alphaTest>0,oe=!!P.alphaHash,le=!!P.extensions;let Ne=vs;P.toneMapped&&(_t===null||_t.isXRRenderTarget===!0)&&(Ne=n.toneMapping);const Ye={shaderID:nt,shaderType:P.type,shaderName:P.name,vertexShader:vt,fragmentShader:Z,defines:P.defines,customVertexShaderID:rt,customFragmentShaderID:St,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:m,batching:Xt,batchingColor:Xt&&V._colorsTexture!==null,instancing:Ot,instancingColor:Ot&&V.instanceColor!==null,instancingMorph:Ot&&V.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:_t===null?n.outputColorSpace:_t.isXRRenderTarget===!0?_t.texture.colorSpace:Dn,alphaToCoverage:!!P.alphaToCoverage,map:Gt,matcap:Qt,envMap:F,envMapMode:F&&at.mapping,envMapCubeUVHeight:G,aoMap:wt,lightMap:bt,bumpMap:mt,normalMap:dt,displacementMap:p&&kt,emissiveMap:Rt,normalMapObjectSpace:dt&&P.normalMapType===k2,normalMapTangentSpace:dt&&P.normalMapType===Ya,metalnessMap:zt,roughnessMap:z,anisotropy:O,anisotropyMap:Ft,clearcoat:ot,clearcoatMap:Wt,clearcoatNormalMap:ge,clearcoatRoughnessMap:Dt,dispersion:At,iridescence:Et,iridescenceMap:$t,iridescenceThicknessMap:It,sheen:Tt,sheenColorMap:Nt,sheenRoughnessMap:qt,specularMap:W,specularColorMap:gt,specularIntensityMap:jt,transmission:ne,transmissionMap:D,thicknessMap:it,gradientMap:lt,opaque:P.transparent===!1&&P.blending===Wo&&P.alphaToCoverage===!1,alphaMap:ut,alphaTest:Ct,alphaHash:oe,combine:P.combine,mapUv:Gt&&_(P.map.channel),aoMapUv:wt&&_(P.aoMap.channel),lightMapUv:bt&&_(P.lightMap.channel),bumpMapUv:mt&&_(P.bumpMap.channel),normalMapUv:dt&&_(P.normalMap.channel),displacementMapUv:kt&&_(P.displacementMap.channel),emissiveMapUv:Rt&&_(P.emissiveMap.channel),metalnessMapUv:zt&&_(P.metalnessMap.channel),roughnessMapUv:z&&_(P.roughnessMap.channel),anisotropyMapUv:Ft&&_(P.anisotropyMap.channel),clearcoatMapUv:Wt&&_(P.clearcoatMap.channel),clearcoatNormalMapUv:ge&&_(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Dt&&_(P.clearcoatRoughnessMap.channel),iridescenceMapUv:$t&&_(P.iridescenceMap.channel),iridescenceThicknessMapUv:It&&_(P.iridescenceThicknessMap.channel),sheenColorMapUv:Nt&&_(P.sheenColorMap.channel),sheenRoughnessMapUv:qt&&_(P.sheenRoughnessMap.channel),specularMapUv:W&&_(P.specularMap.channel),specularColorMapUv:gt&&_(P.specularColorMap.channel),specularIntensityMapUv:jt&&_(P.specularIntensityMap.channel),transmissionMapUv:D&&_(P.transmissionMap.channel),thicknessMapUv:it&&_(P.thicknessMap.channel),alphaMapUv:ut&&_(P.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(dt||O),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Y.attributes.uv&&(Gt||ut),fog:!!j,useFog:P.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:V.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:$,morphTextureStride:ht,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:P.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ne,decodeVideoTexture:Gt&&P.map.isVideoTexture===!0&&Fe.getTransfer(P.map.colorSpace)===tn,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===hi,flipSided:P.side===wi,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionClipCullDistance:le&&P.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(le&&P.extensions.multiDraw===!0||Xt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()};return Ye.vertexUv1s=c.has(1),Ye.vertexUv2s=c.has(2),Ye.vertexUv3s=c.has(3),c.clear(),Ye}function x(P){const E=[];if(P.shaderID?E.push(P.shaderID):(E.push(P.customVertexShaderID),E.push(P.customFragmentShaderID)),P.defines!==void 0)for(const L in P.defines)E.push(L),E.push(P.defines[L]);return P.isRawShaderMaterial===!1&&(M(E,P),b(E,P),E.push(n.outputColorSpace)),E.push(P.customProgramCacheKey),E.join()}function M(P,E){P.push(E.precision),P.push(E.outputColorSpace),P.push(E.envMapMode),P.push(E.envMapCubeUVHeight),P.push(E.mapUv),P.push(E.alphaMapUv),P.push(E.lightMapUv),P.push(E.aoMapUv),P.push(E.bumpMapUv),P.push(E.normalMapUv),P.push(E.displacementMapUv),P.push(E.emissiveMapUv),P.push(E.metalnessMapUv),P.push(E.roughnessMapUv),P.push(E.anisotropyMapUv),P.push(E.clearcoatMapUv),P.push(E.clearcoatNormalMapUv),P.push(E.clearcoatRoughnessMapUv),P.push(E.iridescenceMapUv),P.push(E.iridescenceThicknessMapUv),P.push(E.sheenColorMapUv),P.push(E.sheenRoughnessMapUv),P.push(E.specularMapUv),P.push(E.specularColorMapUv),P.push(E.specularIntensityMapUv),P.push(E.transmissionMapUv),P.push(E.thicknessMapUv),P.push(E.combine),P.push(E.fogExp2),P.push(E.sizeAttenuation),P.push(E.morphTargetsCount),P.push(E.morphAttributeCount),P.push(E.numDirLights),P.push(E.numPointLights),P.push(E.numSpotLights),P.push(E.numSpotLightMaps),P.push(E.numHemiLights),P.push(E.numRectAreaLights),P.push(E.numDirLightShadows),P.push(E.numPointLightShadows),P.push(E.numSpotLightShadows),P.push(E.numSpotLightShadowsWithMaps),P.push(E.numLightProbes),P.push(E.shadowMapType),P.push(E.toneMapping),P.push(E.numClippingPlanes),P.push(E.numClipIntersection),P.push(E.depthPacking)}function b(P,E){o.disableAll(),E.supportsVertexTextures&&o.enable(0),E.instancing&&o.enable(1),E.instancingColor&&o.enable(2),E.instancingMorph&&o.enable(3),E.matcap&&o.enable(4),E.envMap&&o.enable(5),E.normalMapObjectSpace&&o.enable(6),E.normalMapTangentSpace&&o.enable(7),E.clearcoat&&o.enable(8),E.iridescence&&o.enable(9),E.alphaTest&&o.enable(10),E.vertexColors&&o.enable(11),E.vertexAlphas&&o.enable(12),E.vertexUv1s&&o.enable(13),E.vertexUv2s&&o.enable(14),E.vertexUv3s&&o.enable(15),E.vertexTangents&&o.enable(16),E.anisotropy&&o.enable(17),E.alphaHash&&o.enable(18),E.batching&&o.enable(19),E.dispersion&&o.enable(20),E.batchingColor&&o.enable(21),P.push(o.mask),o.disableAll(),E.fog&&o.enable(0),E.useFog&&o.enable(1),E.flatShading&&o.enable(2),E.logarithmicDepthBuffer&&o.enable(3),E.skinning&&o.enable(4),E.morphTargets&&o.enable(5),E.morphNormals&&o.enable(6),E.morphColors&&o.enable(7),E.premultipliedAlpha&&o.enable(8),E.shadowMapEnabled&&o.enable(9),E.doubleSided&&o.enable(10),E.flipSided&&o.enable(11),E.useDepthPacking&&o.enable(12),E.dithering&&o.enable(13),E.transmission&&o.enable(14),E.sheen&&o.enable(15),E.opaque&&o.enable(16),E.pointsUvs&&o.enable(17),E.decodeVideoTexture&&o.enable(18),E.alphaToCoverage&&o.enable(19),P.push(o.mask)}function S(P){const E=g[P.type];let L;if(E){const B=zr[E];L=iC.clone(B.uniforms)}else L=P.uniforms;return L}function R(P,E){let L;for(let B=0,V=h.length;B0?i.push(x):m.transparent===!0?r.push(x):e.push(x)}function l(u,p,m,g,_,y){const x=a(u,p,m,g,_,y);m.transmission>0?i.unshift(x):m.transparent===!0?r.unshift(x):e.unshift(x)}function c(u,p){e.length>1&&e.sort(u||Qz),i.length>1&&i.sort(p||nS),r.length>1&&r.sort(p||nS)}function h(){for(let u=t,p=n.length;u=s.length?(a=new iS,s.push(a)):a=s[r],a}function e(){n=new WeakMap}return{get:t,dispose:e}}function eB(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new U,color:new Ht};break;case"SpotLight":e={position:new U,direction:new U,color:new Ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new U,color:new Ht,distance:0,decay:0};break;case"HemisphereLight":e={direction:new U,skyColor:new Ht,groundColor:new Ht};break;case"RectAreaLight":e={color:new Ht,position:new U,halfWidth:new U,halfHeight:new U};break}return n[t.id]=e,e}}}function nB(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let iB=0;function rB(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function sB(n){const t=new eB,e=nB(),i={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 c=0;c<9;c++)i.probe.push(new U);const r=new U,s=new de,a=new de;function o(c){let h=0,u=0,p=0;for(let P=0;P<9;P++)i.probe[P].set(0,0,0);let m=0,g=0,_=0,y=0,x=0,M=0,b=0,S=0,R=0,T=0,C=0;c.sort(rB);for(let P=0,E=c.length;P0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Yt.LTC_FLOAT_1,i.rectAreaLTC2=Yt.LTC_FLOAT_2):(i.rectAreaLTC1=Yt.LTC_HALF_1,i.rectAreaLTC2=Yt.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=u,i.ambient[2]=p;const N=i.hash;(N.directionalLength!==m||N.pointLength!==g||N.spotLength!==_||N.rectAreaLength!==y||N.hemiLength!==x||N.numDirectionalShadows!==M||N.numPointShadows!==b||N.numSpotShadows!==S||N.numSpotMaps!==R||N.numLightProbes!==C)&&(i.directional.length=m,i.spot.length=_,i.rectArea.length=y,i.point.length=g,i.hemi.length=x,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=S+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=C,N.directionalLength=m,N.pointLength=g,N.spotLength=_,N.rectAreaLength=y,N.hemiLength=x,N.numDirectionalShadows=M,N.numPointShadows=b,N.numSpotShadows=S,N.numSpotMaps=R,N.numLightProbes=C,i.version=iB++)}function l(c,h){let u=0,p=0,m=0,g=0,_=0;const y=h.matrixWorldInverse;for(let x=0,M=c.length;x=a.length?(o=new rS(n),a.push(o)):o=a[s],o}function i(){t=new WeakMap}return{get:e,dispose:i}}class l1 extends Rn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=F2,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 c1 extends Rn{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}}const oB=`void main() { +`+G)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(V===""||j==="")&&(q=!1);q&&(L.diagnostics={runnable:Y,programLog:B,vertexShader:{log:V,prefix:y},fragmentShader:{log:j,prefix:x}})}r.deleteShader(R),r.deleteShader(C),N=new Pm(r,_),P=Fz(r,_)}let N;this.getUniforms=function(){return N===void 0&&T(this),N};let P;this.getAttributes=function(){return P===void 0&&T(this),P};let E=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=r.getProgramParameter(_,Tz)),E},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Cz++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=R,this.fragmentShader=C,this}let $z=0;class Yz{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(e),s=this._getShaderStage(i),a=this._getShaderCacheForMaterial(t);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const i of e)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return i===void 0&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return i===void 0&&(i=new Zz(t),e.set(t,i)),i}}class Zz{constructor(t){this.id=$z++,this.code=t,this.usedTimes=0}}function Kz(n,t,e,i,r,s,a){const o=new qo,l=new Yz,c=new Set,h=[],u=r.logarithmicDepthBuffer,p=r.vertexTextures;let m=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(P){return c.add(P),P===0?"uv":`uv${P}`}function y(P,E,L,B,V){const j=B.fog,Y=V.geometry,q=P.isMeshStandardMaterial?B.environment:null,at=(P.isMeshStandardMaterial?e:t).get(P.envMap||q),G=at&&at.mapping===ah?at.image.height:null,tt=g[P.type];P.precision!==null&&(m=r.getMaxPrecision(P.precision),m!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",m,"instead."));const K=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,$=K!==void 0?K.length:0;let ht=0;Y.morphAttributes.position!==void 0&&(ht=1),Y.morphAttributes.normal!==void 0&&(ht=2),Y.morphAttributes.color!==void 0&&(ht=3);let vt,Z,rt,St;if(tt){const Se=zr[tt];vt=Se.vertexShader,Z=Se.fragmentShader}else vt=P.vertexShader,Z=P.fragmentShader,l.update(P),rt=l.getVertexShaderID(P),St=l.getFragmentShaderID(P);const _t=n.getRenderTarget(),Ot=V.isInstancedMesh===!0,Xt=V.isBatchedMesh===!0,Gt=!!P.map,Qt=!!P.matcap,F=!!at,wt=!!P.aoMap,bt=!!P.lightMap,mt=!!P.bumpMap,dt=!!P.normalMap,kt=!!P.displacementMap,Rt=!!P.emissiveMap,zt=!!P.metalnessMap,z=!!P.roughnessMap,O=P.anisotropy>0,ot=P.clearcoat>0,At=P.dispersion>0,Et=P.iridescence>0,Tt=P.sheen>0,ne=P.transmission>0,Ft=O&&!!P.anisotropyMap,Wt=ot&&!!P.clearcoatMap,ge=ot&&!!P.clearcoatNormalMap,Dt=ot&&!!P.clearcoatRoughnessMap,$t=Et&&!!P.iridescenceMap,It=Et&&!!P.iridescenceThicknessMap,Nt=Tt&&!!P.sheenColorMap,qt=Tt&&!!P.sheenRoughnessMap,W=!!P.specularMap,gt=!!P.specularColorMap,jt=!!P.specularIntensityMap,D=ne&&!!P.transmissionMap,it=ne&&!!P.thicknessMap,lt=!!P.gradientMap,ut=!!P.alphaMap,Ct=P.alphaTest>0,oe=!!P.alphaHash,le=!!P.extensions;let Ne=vs;P.toneMapped&&(_t===null||_t.isXRRenderTarget===!0)&&(Ne=n.toneMapping);const Ye={shaderID:tt,shaderType:P.type,shaderName:P.name,vertexShader:vt,fragmentShader:Z,defines:P.defines,customVertexShaderID:rt,customFragmentShaderID:St,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:m,batching:Xt,batchingColor:Xt&&V._colorsTexture!==null,instancing:Ot,instancingColor:Ot&&V.instanceColor!==null,instancingMorph:Ot&&V.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:_t===null?n.outputColorSpace:_t.isXRRenderTarget===!0?_t.texture.colorSpace:Dn,alphaToCoverage:!!P.alphaToCoverage,map:Gt,matcap:Qt,envMap:F,envMapMode:F&&at.mapping,envMapCubeUVHeight:G,aoMap:wt,lightMap:bt,bumpMap:mt,normalMap:dt,displacementMap:p&&kt,emissiveMap:Rt,normalMapObjectSpace:dt&&P.normalMapType===k2,normalMapTangentSpace:dt&&P.normalMapType===Ya,metalnessMap:zt,roughnessMap:z,anisotropy:O,anisotropyMap:Ft,clearcoat:ot,clearcoatMap:Wt,clearcoatNormalMap:ge,clearcoatRoughnessMap:Dt,dispersion:At,iridescence:Et,iridescenceMap:$t,iridescenceThicknessMap:It,sheen:Tt,sheenColorMap:Nt,sheenRoughnessMap:qt,specularMap:W,specularColorMap:gt,specularIntensityMap:jt,transmission:ne,transmissionMap:D,thicknessMap:it,gradientMap:lt,opaque:P.transparent===!1&&P.blending===Wo&&P.alphaToCoverage===!1,alphaMap:ut,alphaTest:Ct,alphaHash:oe,combine:P.combine,mapUv:Gt&&_(P.map.channel),aoMapUv:wt&&_(P.aoMap.channel),lightMapUv:bt&&_(P.lightMap.channel),bumpMapUv:mt&&_(P.bumpMap.channel),normalMapUv:dt&&_(P.normalMap.channel),displacementMapUv:kt&&_(P.displacementMap.channel),emissiveMapUv:Rt&&_(P.emissiveMap.channel),metalnessMapUv:zt&&_(P.metalnessMap.channel),roughnessMapUv:z&&_(P.roughnessMap.channel),anisotropyMapUv:Ft&&_(P.anisotropyMap.channel),clearcoatMapUv:Wt&&_(P.clearcoatMap.channel),clearcoatNormalMapUv:ge&&_(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Dt&&_(P.clearcoatRoughnessMap.channel),iridescenceMapUv:$t&&_(P.iridescenceMap.channel),iridescenceThicknessMapUv:It&&_(P.iridescenceThicknessMap.channel),sheenColorMapUv:Nt&&_(P.sheenColorMap.channel),sheenRoughnessMapUv:qt&&_(P.sheenRoughnessMap.channel),specularMapUv:W&&_(P.specularMap.channel),specularColorMapUv:gt&&_(P.specularColorMap.channel),specularIntensityMapUv:jt&&_(P.specularIntensityMap.channel),transmissionMapUv:D&&_(P.transmissionMap.channel),thicknessMapUv:it&&_(P.thicknessMap.channel),alphaMapUv:ut&&_(P.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(dt||O),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Y.attributes.uv&&(Gt||ut),fog:!!j,useFog:P.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:V.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:$,morphTextureStride:ht,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:P.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ne,decodeVideoTexture:Gt&&P.map.isVideoTexture===!0&&Fe.getTransfer(P.map.colorSpace)===tn,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===hi,flipSided:P.side===wi,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionClipCullDistance:le&&P.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(le&&P.extensions.multiDraw===!0||Xt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()};return Ye.vertexUv1s=c.has(1),Ye.vertexUv2s=c.has(2),Ye.vertexUv3s=c.has(3),c.clear(),Ye}function x(P){const E=[];if(P.shaderID?E.push(P.shaderID):(E.push(P.customVertexShaderID),E.push(P.customFragmentShaderID)),P.defines!==void 0)for(const L in P.defines)E.push(L),E.push(P.defines[L]);return P.isRawShaderMaterial===!1&&(M(E,P),b(E,P),E.push(n.outputColorSpace)),E.push(P.customProgramCacheKey),E.join()}function M(P,E){P.push(E.precision),P.push(E.outputColorSpace),P.push(E.envMapMode),P.push(E.envMapCubeUVHeight),P.push(E.mapUv),P.push(E.alphaMapUv),P.push(E.lightMapUv),P.push(E.aoMapUv),P.push(E.bumpMapUv),P.push(E.normalMapUv),P.push(E.displacementMapUv),P.push(E.emissiveMapUv),P.push(E.metalnessMapUv),P.push(E.roughnessMapUv),P.push(E.anisotropyMapUv),P.push(E.clearcoatMapUv),P.push(E.clearcoatNormalMapUv),P.push(E.clearcoatRoughnessMapUv),P.push(E.iridescenceMapUv),P.push(E.iridescenceThicknessMapUv),P.push(E.sheenColorMapUv),P.push(E.sheenRoughnessMapUv),P.push(E.specularMapUv),P.push(E.specularColorMapUv),P.push(E.specularIntensityMapUv),P.push(E.transmissionMapUv),P.push(E.thicknessMapUv),P.push(E.combine),P.push(E.fogExp2),P.push(E.sizeAttenuation),P.push(E.morphTargetsCount),P.push(E.morphAttributeCount),P.push(E.numDirLights),P.push(E.numPointLights),P.push(E.numSpotLights),P.push(E.numSpotLightMaps),P.push(E.numHemiLights),P.push(E.numRectAreaLights),P.push(E.numDirLightShadows),P.push(E.numPointLightShadows),P.push(E.numSpotLightShadows),P.push(E.numSpotLightShadowsWithMaps),P.push(E.numLightProbes),P.push(E.shadowMapType),P.push(E.toneMapping),P.push(E.numClippingPlanes),P.push(E.numClipIntersection),P.push(E.depthPacking)}function b(P,E){o.disableAll(),E.supportsVertexTextures&&o.enable(0),E.instancing&&o.enable(1),E.instancingColor&&o.enable(2),E.instancingMorph&&o.enable(3),E.matcap&&o.enable(4),E.envMap&&o.enable(5),E.normalMapObjectSpace&&o.enable(6),E.normalMapTangentSpace&&o.enable(7),E.clearcoat&&o.enable(8),E.iridescence&&o.enable(9),E.alphaTest&&o.enable(10),E.vertexColors&&o.enable(11),E.vertexAlphas&&o.enable(12),E.vertexUv1s&&o.enable(13),E.vertexUv2s&&o.enable(14),E.vertexUv3s&&o.enable(15),E.vertexTangents&&o.enable(16),E.anisotropy&&o.enable(17),E.alphaHash&&o.enable(18),E.batching&&o.enable(19),E.dispersion&&o.enable(20),E.batchingColor&&o.enable(21),P.push(o.mask),o.disableAll(),E.fog&&o.enable(0),E.useFog&&o.enable(1),E.flatShading&&o.enable(2),E.logarithmicDepthBuffer&&o.enable(3),E.skinning&&o.enable(4),E.morphTargets&&o.enable(5),E.morphNormals&&o.enable(6),E.morphColors&&o.enable(7),E.premultipliedAlpha&&o.enable(8),E.shadowMapEnabled&&o.enable(9),E.doubleSided&&o.enable(10),E.flipSided&&o.enable(11),E.useDepthPacking&&o.enable(12),E.dithering&&o.enable(13),E.transmission&&o.enable(14),E.sheen&&o.enable(15),E.opaque&&o.enable(16),E.pointsUvs&&o.enable(17),E.decodeVideoTexture&&o.enable(18),E.alphaToCoverage&&o.enable(19),P.push(o.mask)}function S(P){const E=g[P.type];let L;if(E){const B=zr[E];L=iC.clone(B.uniforms)}else L=P.uniforms;return L}function R(P,E){let L;for(let B=0,V=h.length;B0?i.push(x):m.transparent===!0?r.push(x):e.push(x)}function l(u,p,m,g,_,y){const x=a(u,p,m,g,_,y);m.transmission>0?i.unshift(x):m.transparent===!0?r.unshift(x):e.unshift(x)}function c(u,p){e.length>1&&e.sort(u||Qz),i.length>1&&i.sort(p||nS),r.length>1&&r.sort(p||nS)}function h(){for(let u=t,p=n.length;u=s.length?(a=new iS,s.push(a)):a=s[r],a}function e(){n=new WeakMap}return{get:t,dispose:e}}function eB(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new U,color:new Ht};break;case"SpotLight":e={position:new U,direction:new U,color:new Ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new U,color:new Ht,distance:0,decay:0};break;case"HemisphereLight":e={direction:new U,skyColor:new Ht,groundColor:new Ht};break;case"RectAreaLight":e={color:new Ht,position:new U,halfWidth:new U,halfHeight:new U};break}return n[t.id]=e,e}}}function nB(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let iB=0;function rB(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function sB(n){const t=new eB,e=nB(),i={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 c=0;c<9;c++)i.probe.push(new U);const r=new U,s=new de,a=new de;function o(c){let h=0,u=0,p=0;for(let P=0;P<9;P++)i.probe[P].set(0,0,0);let m=0,g=0,_=0,y=0,x=0,M=0,b=0,S=0,R=0,C=0,T=0;c.sort(rB);for(let P=0,E=c.length;P0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Yt.LTC_FLOAT_1,i.rectAreaLTC2=Yt.LTC_FLOAT_2):(i.rectAreaLTC1=Yt.LTC_HALF_1,i.rectAreaLTC2=Yt.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=u,i.ambient[2]=p;const N=i.hash;(N.directionalLength!==m||N.pointLength!==g||N.spotLength!==_||N.rectAreaLength!==y||N.hemiLength!==x||N.numDirectionalShadows!==M||N.numPointShadows!==b||N.numSpotShadows!==S||N.numSpotMaps!==R||N.numLightProbes!==T)&&(i.directional.length=m,i.spot.length=_,i.rectArea.length=y,i.point.length=g,i.hemi.length=x,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=S+R-C,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=C,i.numLightProbes=T,N.directionalLength=m,N.pointLength=g,N.spotLength=_,N.rectAreaLength=y,N.hemiLength=x,N.numDirectionalShadows=M,N.numPointShadows=b,N.numSpotShadows=S,N.numSpotMaps=R,N.numLightProbes=T,i.version=iB++)}function l(c,h){let u=0,p=0,m=0,g=0,_=0;const y=h.matrixWorldInverse;for(let x=0,M=c.length;x=a.length?(o=new rS(n),a.push(o)):o=a[s],o}function i(){t=new WeakMap}return{get:e,dispose:i}}class l1 extends Rn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=F2,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 c1 extends Rn{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}}const oB=`void main() { gl_Position = vec4( position, 1.0 ); }`,lB=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3815,7 +3815,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function cB(n,t,e){let i=new Lf;const r=new xt,s=new xt,a=new je,o=new l1({depthPacking:U2}),l=new c1,c={},h=e.maxTextureSize,u={[Gr]:wi,[wi]:Gr,[hi]:hi},p=new Xr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:oB,fragmentShader:lB}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new ve;g.setAttribute("position",new Pe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new vn(g,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=B0;let x=this.type;this.render=function(T,C,N){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const P=n.getRenderTarget(),E=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),B=n.state;B.setBlending(ea),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const V=x!==Ur&&this.type===Ur,j=x===Ur&&this.type!==Ur;for(let Y=0,q=T.length;Yh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/nt.x),r.x=s.x*nt.x,G.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/nt.y),r.y=s.y*nt.y,G.mapSize.y=s.y)),G.map===null||V===!0||j===!0){const $=this.type!==Ur?{minFilter:Ln,magFilter:Ln}:{};G.map!==null&&G.map.dispose(),G.map=new Wr(r.x,r.y,$),G.map.texture.name=at.name+".shadowMap",G.camera.updateProjectionMatrix()}n.setRenderTarget(G.map),n.clear();const K=G.getViewportCount();for(let $=0;$0||C.map&&C.alphaTest>0){const B=E.uuid,V=C.uuid;let j=c[B];j===void 0&&(j={},c[B]=j);let Y=j[V];Y===void 0&&(Y=E.clone(),j[V]=Y,C.addEventListener("dispose",R)),E=Y}if(E.visible=C.visible,E.wireframe=C.wireframe,P===Ur?E.side=C.shadowSide!==null?C.shadowSide:C.side:E.side=C.shadowSide!==null?C.shadowSide:u[C.side],E.alphaMap=C.alphaMap,E.alphaTest=C.alphaTest,E.map=C.map,E.clipShadows=C.clipShadows,E.clippingPlanes=C.clippingPlanes,E.clipIntersection=C.clipIntersection,E.displacementMap=C.displacementMap,E.displacementScale=C.displacementScale,E.displacementBias=C.displacementBias,E.wireframeLinewidth=C.wireframeLinewidth,E.linewidth=C.linewidth,N.isPointLight===!0&&E.isMeshDistanceMaterial===!0){const B=n.properties.get(E);B.light=N}return E}function S(T,C,N,P,E){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&E===Ur)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,T.matrixWorld);const V=t.update(T),j=T.material;if(Array.isArray(j)){const Y=V.groups;for(let q=0,at=Y.length;q=1):at.indexOf("OpenGL ES")!==-1&&(q=parseFloat(/^OpenGL ES (\d)/.exec(at)[1]),Y=q>=2);let G=null,nt={};const K=n.getParameter(n.SCISSOR_BOX),$=n.getParameter(n.VIEWPORT),ht=new je().fromArray(K),vt=new je().fromArray($);function Z(D,it,lt,ut){const Ct=new Uint8Array(4),oe=n.createTexture();n.bindTexture(D,oe),n.texParameteri(D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(D,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let le=0;let?(n.repeat.x=1,n.repeat.y=e/t,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=t/e,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function fB(n,t){const e=n.image&&n.image.width?n.image.width/n.image.height:1;return e>t?(n.repeat.x=t/e,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=e/t,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function dB(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function q_(n,t,e,i){const r=pB(i);switch(e){case Xv:return n*t;case $v:return n*t;case Yv:return n*t*2;case X0:return n*t/r.components*r.byteLength;case Cf:return n*t/r.components*r.byteLength;case Zv:return n*t*2/r.components*r.byteLength;case q0:return n*t*2/r.components*r.byteLength;case qv:return n*t*3/r.components*r.byteLength;case ui:return n*t*4/r.components*r.byteLength;case $0:return n*t*4/r.components*r.byteLength;case Mu:case wu:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case bu:case Su:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case jm:case qm:return Math.max(n,16)*Math.max(t,8)/4;case Wm:case Xm:return Math.max(n,8)*Math.max(t,8)/2;case $m:case Ym:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case Zm:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Km:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Jm:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case Qm:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case t0:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case e0:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case n0:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case i0:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case r0:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case s0:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case a0:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case o0:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case l0:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case c0:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case h0:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case Eu:case u0:case f0:return Math.ceil(n/4)*Math.ceil(t/4)*16;case Kv:case d0:return Math.ceil(n/4)*Math.ceil(t/4)*8;case p0:case m0:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function pB(n){switch(n){case Vr:case Vv:return{byteLength:1,components:1};case Wc:case Wv:case oh:return{byteLength:2,components:1};case W0:case j0:return{byteLength:2,components:4};case aa:case V0:case Ni:return{byteLength:4,components:1};case jv:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const mB={contain:uB,cover:fB,fill:dB,getByteLength:q_};function gB(n,t,e,i,r,s,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,h=new WeakMap;let u;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(z,O){return m?new OffscreenCanvas(z,O):Ju("canvas")}function _(z,O,ot){let At=1;const Et=zt(z);if((Et.width>ot||Et.height>ot)&&(At=ot/Math.max(Et.width,Et.height)),At<1)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap||typeof VideoFrame<"u"&&z instanceof VideoFrame){const Tt=Math.floor(At*Et.width),ne=Math.floor(At*Et.height);u===void 0&&(u=g(Tt,ne));const Ft=O?g(Tt,ne):u;return Ft.width=Tt,Ft.height=ne,Ft.getContext("2d").drawImage(z,0,0,Tt,ne),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Et.width+"x"+Et.height+") to ("+Tt+"x"+ne+")."),Ft}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Et.width+"x"+Et.height+")."),z;return z}function y(z){return z.generateMipmaps&&z.minFilter!==Ln&&z.minFilter!==mn}function x(z){n.generateMipmap(z)}function M(z,O,ot,At,Et=!1){if(z!==null){if(n[z]!==void 0)return n[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let Tt=O;if(O===n.RED&&(ot===n.FLOAT&&(Tt=n.R32F),ot===n.HALF_FLOAT&&(Tt=n.R16F),ot===n.UNSIGNED_BYTE&&(Tt=n.R8)),O===n.RED_INTEGER&&(ot===n.UNSIGNED_BYTE&&(Tt=n.R8UI),ot===n.UNSIGNED_SHORT&&(Tt=n.R16UI),ot===n.UNSIGNED_INT&&(Tt=n.R32UI),ot===n.BYTE&&(Tt=n.R8I),ot===n.SHORT&&(Tt=n.R16I),ot===n.INT&&(Tt=n.R32I)),O===n.RG&&(ot===n.FLOAT&&(Tt=n.RG32F),ot===n.HALF_FLOAT&&(Tt=n.RG16F),ot===n.UNSIGNED_BYTE&&(Tt=n.RG8)),O===n.RG_INTEGER&&(ot===n.UNSIGNED_BYTE&&(Tt=n.RG8UI),ot===n.UNSIGNED_SHORT&&(Tt=n.RG16UI),ot===n.UNSIGNED_INT&&(Tt=n.RG32UI),ot===n.BYTE&&(Tt=n.RG8I),ot===n.SHORT&&(Tt=n.RG16I),ot===n.INT&&(Tt=n.RG32I)),O===n.RGB&&ot===n.UNSIGNED_INT_5_9_9_9_REV&&(Tt=n.RGB9_E5),O===n.RGBA){const ne=Et?qu:Fe.getTransfer(At);ot===n.FLOAT&&(Tt=n.RGBA32F),ot===n.HALF_FLOAT&&(Tt=n.RGBA16F),ot===n.UNSIGNED_BYTE&&(Tt=ne===tn?n.SRGB8_ALPHA8:n.RGBA8),ot===n.UNSIGNED_SHORT_4_4_4_4&&(Tt=n.RGBA4),ot===n.UNSIGNED_SHORT_5_5_5_1&&(Tt=n.RGB5_A1)}return(Tt===n.R16F||Tt===n.R32F||Tt===n.RG16F||Tt===n.RG32F||Tt===n.RGBA16F||Tt===n.RGBA32F)&&t.get("EXT_color_buffer_float"),Tt}function b(z,O){let ot;return z?O===null||O===aa||O===Ko?ot=n.DEPTH24_STENCIL8:O===Ni?ot=n.DEPTH32F_STENCIL8:O===Wc&&(ot=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):O===null||O===aa||O===Ko?ot=n.DEPTH_COMPONENT24:O===Ni?ot=n.DEPTH_COMPONENT32F:O===Wc&&(ot=n.DEPTH_COMPONENT16),ot}function S(z,O){return y(z)===!0||z.isFramebufferTexture&&z.minFilter!==Ln&&z.minFilter!==mn?Math.log2(Math.max(O.width,O.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?O.mipmaps.length:1}function R(z){const O=z.target;O.removeEventListener("dispose",R),C(O),O.isVideoTexture&&h.delete(O)}function T(z){const O=z.target;O.removeEventListener("dispose",T),P(O)}function C(z){const O=i.get(z);if(O.__webglInit===void 0)return;const ot=z.source,At=p.get(ot);if(At){const Et=At[O.__cacheKey];Et.usedTimes--,Et.usedTimes===0&&N(z),Object.keys(At).length===0&&p.delete(ot)}i.remove(z)}function N(z){const O=i.get(z);n.deleteTexture(O.__webglTexture);const ot=z.source,At=p.get(ot);delete At[O.__cacheKey],a.memory.textures--}function P(z){const O=i.get(z);if(z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let At=0;At<6;At++){if(Array.isArray(O.__webglFramebuffer[At]))for(let Et=0;Et=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+r.maxTextures),E+=1,z}function V(z){const O=[];return O.push(z.wrapS),O.push(z.wrapT),O.push(z.wrapR||0),O.push(z.magFilter),O.push(z.minFilter),O.push(z.anisotropy),O.push(z.internalFormat),O.push(z.format),O.push(z.type),O.push(z.generateMipmaps),O.push(z.premultiplyAlpha),O.push(z.flipY),O.push(z.unpackAlignment),O.push(z.colorSpace),O.join()}function j(z,O){const ot=i.get(z);if(z.isVideoTexture&&kt(z),z.isRenderTargetTexture===!1&&z.version>0&&ot.__version!==z.version){const At=z.image;if(At===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(At.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{vt(ot,z,O);return}}e.bindTexture(n.TEXTURE_2D,ot.__webglTexture,n.TEXTURE0+O)}function Y(z,O){const ot=i.get(z);if(z.version>0&&ot.__version!==z.version){vt(ot,z,O);return}e.bindTexture(n.TEXTURE_2D_ARRAY,ot.__webglTexture,n.TEXTURE0+O)}function q(z,O){const ot=i.get(z);if(z.version>0&&ot.__version!==z.version){vt(ot,z,O);return}e.bindTexture(n.TEXTURE_3D,ot.__webglTexture,n.TEXTURE0+O)}function at(z,O){const ot=i.get(z);if(z.version>0&&ot.__version!==z.version){Z(ot,z,O);return}e.bindTexture(n.TEXTURE_CUBE_MAP,ot.__webglTexture,n.TEXTURE0+O)}const G={[Wa]:n.REPEAT,[Ki]:n.CLAMP_TO_EDGE,[Vc]:n.MIRRORED_REPEAT},nt={[Ln]:n.NEAREST,[G0]:n.NEAREST_MIPMAP_NEAREST,[Oo]:n.NEAREST_MIPMAP_LINEAR,[mn]:n.LINEAR,[Pc]:n.LINEAR_MIPMAP_NEAREST,[gr]:n.LINEAR_MIPMAP_LINEAR},K={[z2]:n.NEVER,[j2]:n.ALWAYS,[B2]:n.LESS,[t1]:n.LEQUAL,[H2]:n.EQUAL,[W2]:n.GEQUAL,[G2]:n.GREATER,[V2]:n.NOTEQUAL};function $(z,O){if(O.type===Ni&&t.has("OES_texture_float_linear")===!1&&(O.magFilter===mn||O.magFilter===Pc||O.magFilter===Oo||O.magFilter===gr||O.minFilter===mn||O.minFilter===Pc||O.minFilter===Oo||O.minFilter===gr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(z,n.TEXTURE_WRAP_S,G[O.wrapS]),n.texParameteri(z,n.TEXTURE_WRAP_T,G[O.wrapT]),(z===n.TEXTURE_3D||z===n.TEXTURE_2D_ARRAY)&&n.texParameteri(z,n.TEXTURE_WRAP_R,G[O.wrapR]),n.texParameteri(z,n.TEXTURE_MAG_FILTER,nt[O.magFilter]),n.texParameteri(z,n.TEXTURE_MIN_FILTER,nt[O.minFilter]),O.compareFunction&&(n.texParameteri(z,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(z,n.TEXTURE_COMPARE_FUNC,K[O.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(O.magFilter===Ln||O.minFilter!==Oo&&O.minFilter!==gr||O.type===Ni&&t.has("OES_texture_float_linear")===!1)return;if(O.anisotropy>1||i.get(O).__currentAnisotropy){const ot=t.get("EXT_texture_filter_anisotropic");n.texParameterf(z,ot.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,r.getMaxAnisotropy())),i.get(O).__currentAnisotropy=O.anisotropy}}}function ht(z,O){let ot=!1;z.__webglInit===void 0&&(z.__webglInit=!0,O.addEventListener("dispose",R));const At=O.source;let Et=p.get(At);Et===void 0&&(Et={},p.set(At,Et));const Tt=V(O);if(Tt!==z.__cacheKey){Et[Tt]===void 0&&(Et[Tt]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,ot=!0),Et[Tt].usedTimes++;const ne=Et[z.__cacheKey];ne!==void 0&&(Et[z.__cacheKey].usedTimes--,ne.usedTimes===0&&N(O)),z.__cacheKey=Tt,z.__webglTexture=Et[Tt].texture}return ot}function vt(z,O,ot){let At=n.TEXTURE_2D;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(At=n.TEXTURE_2D_ARRAY),O.isData3DTexture&&(At=n.TEXTURE_3D);const Et=ht(z,O),Tt=O.source;e.bindTexture(At,z.__webglTexture,n.TEXTURE0+ot);const ne=i.get(Tt);if(Tt.version!==ne.__version||Et===!0){e.activeTexture(n.TEXTURE0+ot);const Ft=Fe.getPrimaries(Fe.workingColorSpace),Wt=O.colorSpace===Ks?null:Fe.getPrimaries(O.colorSpace),ge=O.colorSpace===Ks||Ft===Wt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,O.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,O.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,ge);let Dt=_(O.image,!1,r.maxTextureSize);Dt=Rt(O,Dt);const $t=s.convert(O.format,O.colorSpace),It=s.convert(O.type);let Nt=M(O.internalFormat,$t,It,O.colorSpace,O.isVideoTexture);$(At,O);let qt;const W=O.mipmaps,gt=O.isVideoTexture!==!0,jt=ne.__version===void 0||Et===!0,D=Tt.dataReady,it=S(O,Dt);if(O.isDepthTexture)Nt=b(O.format===Jo,O.type),jt&&(gt?e.texStorage2D(n.TEXTURE_2D,1,Nt,Dt.width,Dt.height):e.texImage2D(n.TEXTURE_2D,0,Nt,Dt.width,Dt.height,0,$t,It,null));else if(O.isDataTexture)if(W.length>0){gt&&jt&&e.texStorage2D(n.TEXTURE_2D,it,Nt,W[0].width,W[0].height);for(let lt=0,ut=W.length;lt0){const Ct=q_(qt.width,qt.height,O.format,O.type);for(const oe of O.layerUpdates){const le=qt.data.subarray(oe*Ct/qt.data.BYTES_PER_ELEMENT,(oe+1)*Ct/qt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,lt,0,0,oe,qt.width,qt.height,1,$t,le,0,0)}O.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,lt,0,0,0,qt.width,qt.height,Dt.depth,$t,qt.data,0,0)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,lt,Nt,qt.width,qt.height,Dt.depth,0,qt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else gt?D&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,lt,0,0,0,qt.width,qt.height,Dt.depth,$t,It,qt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,lt,Nt,qt.width,qt.height,Dt.depth,0,$t,It,qt.data)}else{gt&&jt&&e.texStorage2D(n.TEXTURE_2D,it,Nt,W[0].width,W[0].height);for(let lt=0,ut=W.length;lt0){const lt=q_(Dt.width,Dt.height,O.format,O.type);for(const ut of O.layerUpdates){const Ct=Dt.data.subarray(ut*lt/Dt.data.BYTES_PER_ELEMENT,(ut+1)*lt/Dt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ut,Dt.width,Dt.height,1,$t,It,Ct)}O.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Dt.width,Dt.height,Dt.depth,$t,It,Dt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Nt,Dt.width,Dt.height,Dt.depth,0,$t,It,Dt.data);else if(O.isData3DTexture)gt?(jt&&e.texStorage3D(n.TEXTURE_3D,it,Nt,Dt.width,Dt.height,Dt.depth),D&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Dt.width,Dt.height,Dt.depth,$t,It,Dt.data)):e.texImage3D(n.TEXTURE_3D,0,Nt,Dt.width,Dt.height,Dt.depth,0,$t,It,Dt.data);else if(O.isFramebufferTexture){if(jt)if(gt)e.texStorage2D(n.TEXTURE_2D,it,Nt,Dt.width,Dt.height);else{let lt=Dt.width,ut=Dt.height;for(let Ct=0;Ct>=1,ut>>=1}}else if(W.length>0){if(gt&&jt){const lt=zt(W[0]);e.texStorage2D(n.TEXTURE_2D,it,Nt,lt.width,lt.height)}for(let lt=0,ut=W.length;lt0&&it++;const ut=zt($t[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,it,W,ut.width,ut.height)}for(let ut=0;ut<6;ut++)if(Dt){gt?D&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,$t[ut].width,$t[ut].height,Nt,qt,$t[ut].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,W,$t[ut].width,$t[ut].height,0,Nt,qt,$t[ut].data);for(let Ct=0;Ct>Tt),$t=Math.max(1,O.height>>Tt);Et===n.TEXTURE_3D||Et===n.TEXTURE_2D_ARRAY?e.texImage3D(Et,Tt,Wt,Dt,$t,O.depth,0,ne,Ft,null):e.texImage2D(Et,Tt,Wt,Dt,$t,0,ne,Ft,null)}e.bindFramebuffer(n.FRAMEBUFFER,z),dt(O)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,At,Et,i.get(ot).__webglTexture,0,mt(O)):(Et===n.TEXTURE_2D||Et>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Et<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,At,Et,i.get(ot).__webglTexture,Tt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function St(z,O,ot){if(n.bindRenderbuffer(n.RENDERBUFFER,z),O.depthBuffer){const At=O.depthTexture,Et=At&&At.isDepthTexture?At.type:null,Tt=b(O.stencilBuffer,Et),ne=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ft=mt(O);dt(O)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ft,Tt,O.width,O.height):ot?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ft,Tt,O.width,O.height):n.renderbufferStorage(n.RENDERBUFFER,Tt,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ne,n.RENDERBUFFER,z)}else{const At=O.textures;for(let Et=0;Et1;if(ne||(At.__webglTexture===void 0&&(At.__webglTexture=n.createTexture()),At.__version=O.version,a.memory.textures++),Tt){ot.__webglFramebuffer=[];for(let Ft=0;Ft<6;Ft++)if(O.mipmaps&&O.mipmaps.length>0){ot.__webglFramebuffer[Ft]=[];for(let Wt=0;Wt0){ot.__webglFramebuffer=[];for(let Ft=0;Ft0&&dt(z)===!1){ot.__webglMultisampledFramebuffer=n.createFramebuffer(),ot.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,ot.__webglMultisampledFramebuffer);for(let Ft=0;Ft0)for(let Wt=0;Wt0)for(let Wt=0;Wt0){if(dt(z)===!1){const O=z.textures,ot=z.width,At=z.height;let Et=n.COLOR_BUFFER_BIT;const Tt=z.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ne=i.get(z),Ft=O.length>1;if(Ft)for(let Wt=0;Wt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function kt(z){const O=a.render.frame;h.get(z)!==O&&(h.set(z,O),z.update())}function Rt(z,O){const ot=z.colorSpace,At=z.format,Et=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||ot!==Dn&&ot!==Ks&&(Fe.getTransfer(ot)===tn?(At!==ui||Et!==Vr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ot)),O}function zt(z){return typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement?(c.width=z.naturalWidth||z.width,c.height=z.naturalHeight||z.height):typeof VideoFrame<"u"&&z instanceof VideoFrame?(c.width=z.displayWidth,c.height=z.displayHeight):(c.width=z.width,c.height=z.height),c}this.allocateTextureUnit=B,this.resetTextureUnits=L,this.setTexture2D=j,this.setTexture2DArray=Y,this.setTexture3D=q,this.setTextureCube=at,this.rebindTextures=Xt,this.setupRenderTarget=Gt,this.updateRenderTargetMipmap=Qt,this.updateMultisampleRenderTarget=bt,this.setupDepthRenderbuffer=Ot,this.setupFrameBufferTexture=rt,this.useMultisampledRTT=dt}function uC(n,t){function e(i,r=Ks){let s;const a=Fe.getTransfer(r);if(i===Vr)return n.UNSIGNED_BYTE;if(i===W0)return n.UNSIGNED_SHORT_4_4_4_4;if(i===j0)return n.UNSIGNED_SHORT_5_5_5_1;if(i===jv)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Vv)return n.BYTE;if(i===Wv)return n.SHORT;if(i===Wc)return n.UNSIGNED_SHORT;if(i===V0)return n.INT;if(i===aa)return n.UNSIGNED_INT;if(i===Ni)return n.FLOAT;if(i===oh)return n.HALF_FLOAT;if(i===Xv)return n.ALPHA;if(i===qv)return n.RGB;if(i===ui)return n.RGBA;if(i===$v)return n.LUMINANCE;if(i===Yv)return n.LUMINANCE_ALPHA;if(i===jo)return n.DEPTH_COMPONENT;if(i===Jo)return n.DEPTH_STENCIL;if(i===X0)return n.RED;if(i===Cf)return n.RED_INTEGER;if(i===Zv)return n.RG;if(i===q0)return n.RG_INTEGER;if(i===$0)return n.RGBA_INTEGER;if(i===Mu||i===wu||i===bu||i===Su)if(a===tn)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Mu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===wu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===bu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Su)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Mu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===wu)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===bu)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Su)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Wm||i===jm||i===Xm||i===qm)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Wm)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===jm)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Xm)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===qm)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===$m||i===Ym||i===Zm)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(i===$m||i===Ym)return a===tn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Zm)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===Km||i===Jm||i===Qm||i===t0||i===e0||i===n0||i===i0||i===r0||i===s0||i===a0||i===o0||i===l0||i===c0||i===h0)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(i===Km)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Jm)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Qm)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===t0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===e0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===n0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===i0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===r0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===s0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===a0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===o0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===l0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===c0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===h0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Eu||i===u0||i===f0)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(i===Eu)return a===tn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===u0)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===f0)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Kv||i===d0||i===p0||i===m0)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(i===Eu)return s.COMPRESSED_RED_RGTC1_EXT;if(i===d0)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===p0)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===m0)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Ko?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:e}}class fC extends cn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Qs extends Ge{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yB={type:"move"};class mx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const 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}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const _ of t.hand.values()){const y=e.getJointPose(_,i),x=this._getHandJoint(c,_);y!==null&&(x.matrix.fromArray(y.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=y.radius),x.visible=y!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],p=h.position.distanceTo(u.position),m=.02,g=.005;c.inputState.pinching&&p>m+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&p<=m-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=e.getPose(t.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(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,this.dispatchEvent(yB)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new Qs;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}const xB=` +}`;function cB(n,t,e){let i=new Lf;const r=new xt,s=new xt,a=new je,o=new l1({depthPacking:U2}),l=new c1,c={},h=e.maxTextureSize,u={[Gr]:wi,[wi]:Gr,[hi]:hi},p=new Xr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:oB,fragmentShader:lB}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new ve;g.setAttribute("position",new Pe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new vn(g,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=B0;let x=this.type;this.render=function(C,T,N){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||C.length===0)return;const P=n.getRenderTarget(),E=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),B=n.state;B.setBlending(ea),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const V=x!==Ur&&this.type===Ur,j=x===Ur&&this.type!==Ur;for(let Y=0,q=C.length;Yh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/tt.x),r.x=s.x*tt.x,G.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/tt.y),r.y=s.y*tt.y,G.mapSize.y=s.y)),G.map===null||V===!0||j===!0){const $=this.type!==Ur?{minFilter:Ln,magFilter:Ln}:{};G.map!==null&&G.map.dispose(),G.map=new Wr(r.x,r.y,$),G.map.texture.name=at.name+".shadowMap",G.camera.updateProjectionMatrix()}n.setRenderTarget(G.map),n.clear();const K=G.getViewportCount();for(let $=0;$0||T.map&&T.alphaTest>0){const B=E.uuid,V=T.uuid;let j=c[B];j===void 0&&(j={},c[B]=j);let Y=j[V];Y===void 0&&(Y=E.clone(),j[V]=Y,T.addEventListener("dispose",R)),E=Y}if(E.visible=T.visible,E.wireframe=T.wireframe,P===Ur?E.side=T.shadowSide!==null?T.shadowSide:T.side:E.side=T.shadowSide!==null?T.shadowSide:u[T.side],E.alphaMap=T.alphaMap,E.alphaTest=T.alphaTest,E.map=T.map,E.clipShadows=T.clipShadows,E.clippingPlanes=T.clippingPlanes,E.clipIntersection=T.clipIntersection,E.displacementMap=T.displacementMap,E.displacementScale=T.displacementScale,E.displacementBias=T.displacementBias,E.wireframeLinewidth=T.wireframeLinewidth,E.linewidth=T.linewidth,N.isPointLight===!0&&E.isMeshDistanceMaterial===!0){const B=n.properties.get(E);B.light=N}return E}function S(C,T,N,P,E){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&E===Ur)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,C.matrixWorld);const V=t.update(C),j=C.material;if(Array.isArray(j)){const Y=V.groups;for(let q=0,at=Y.length;q=1):at.indexOf("OpenGL ES")!==-1&&(q=parseFloat(/^OpenGL ES (\d)/.exec(at)[1]),Y=q>=2);let G=null,tt={};const K=n.getParameter(n.SCISSOR_BOX),$=n.getParameter(n.VIEWPORT),ht=new je().fromArray(K),vt=new je().fromArray($);function Z(D,it,lt,ut){const Ct=new Uint8Array(4),oe=n.createTexture();n.bindTexture(D,oe),n.texParameteri(D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(D,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let le=0;let?(n.repeat.x=1,n.repeat.y=e/t,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=t/e,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function fB(n,t){const e=n.image&&n.image.width?n.image.width/n.image.height:1;return e>t?(n.repeat.x=t/e,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=e/t,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function dB(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function q_(n,t,e,i){const r=pB(i);switch(e){case Xv:return n*t;case $v:return n*t;case Yv:return n*t*2;case X0:return n*t/r.components*r.byteLength;case Cf:return n*t/r.components*r.byteLength;case Zv:return n*t*2/r.components*r.byteLength;case q0:return n*t*2/r.components*r.byteLength;case qv:return n*t*3/r.components*r.byteLength;case ui:return n*t*4/r.components*r.byteLength;case $0:return n*t*4/r.components*r.byteLength;case Mu:case wu:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case bu:case Su:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case jm:case qm:return Math.max(n,16)*Math.max(t,8)/4;case Wm:case Xm:return Math.max(n,8)*Math.max(t,8)/2;case $m:case Ym:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case Zm:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Km:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Jm:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case Qm:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case t0:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case e0:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case n0:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case i0:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case r0:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case s0:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case a0:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case o0:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case l0:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case c0:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case h0:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case Eu:case u0:case f0:return Math.ceil(n/4)*Math.ceil(t/4)*16;case Kv:case d0:return Math.ceil(n/4)*Math.ceil(t/4)*8;case p0:case m0:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function pB(n){switch(n){case Vr:case Vv:return{byteLength:1,components:1};case Wc:case Wv:case oh:return{byteLength:2,components:1};case W0:case j0:return{byteLength:2,components:4};case aa:case V0:case Ni:return{byteLength:4,components:1};case jv:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const mB={contain:uB,cover:fB,fill:dB,getByteLength:q_};function gB(n,t,e,i,r,s,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,h=new WeakMap;let u;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(z,O){return m?new OffscreenCanvas(z,O):Ju("canvas")}function _(z,O,ot){let At=1;const Et=zt(z);if((Et.width>ot||Et.height>ot)&&(At=ot/Math.max(Et.width,Et.height)),At<1)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap||typeof VideoFrame<"u"&&z instanceof VideoFrame){const Tt=Math.floor(At*Et.width),ne=Math.floor(At*Et.height);u===void 0&&(u=g(Tt,ne));const Ft=O?g(Tt,ne):u;return Ft.width=Tt,Ft.height=ne,Ft.getContext("2d").drawImage(z,0,0,Tt,ne),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Et.width+"x"+Et.height+") to ("+Tt+"x"+ne+")."),Ft}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Et.width+"x"+Et.height+")."),z;return z}function y(z){return z.generateMipmaps&&z.minFilter!==Ln&&z.minFilter!==mn}function x(z){n.generateMipmap(z)}function M(z,O,ot,At,Et=!1){if(z!==null){if(n[z]!==void 0)return n[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let Tt=O;if(O===n.RED&&(ot===n.FLOAT&&(Tt=n.R32F),ot===n.HALF_FLOAT&&(Tt=n.R16F),ot===n.UNSIGNED_BYTE&&(Tt=n.R8)),O===n.RED_INTEGER&&(ot===n.UNSIGNED_BYTE&&(Tt=n.R8UI),ot===n.UNSIGNED_SHORT&&(Tt=n.R16UI),ot===n.UNSIGNED_INT&&(Tt=n.R32UI),ot===n.BYTE&&(Tt=n.R8I),ot===n.SHORT&&(Tt=n.R16I),ot===n.INT&&(Tt=n.R32I)),O===n.RG&&(ot===n.FLOAT&&(Tt=n.RG32F),ot===n.HALF_FLOAT&&(Tt=n.RG16F),ot===n.UNSIGNED_BYTE&&(Tt=n.RG8)),O===n.RG_INTEGER&&(ot===n.UNSIGNED_BYTE&&(Tt=n.RG8UI),ot===n.UNSIGNED_SHORT&&(Tt=n.RG16UI),ot===n.UNSIGNED_INT&&(Tt=n.RG32UI),ot===n.BYTE&&(Tt=n.RG8I),ot===n.SHORT&&(Tt=n.RG16I),ot===n.INT&&(Tt=n.RG32I)),O===n.RGB&&ot===n.UNSIGNED_INT_5_9_9_9_REV&&(Tt=n.RGB9_E5),O===n.RGBA){const ne=Et?qu:Fe.getTransfer(At);ot===n.FLOAT&&(Tt=n.RGBA32F),ot===n.HALF_FLOAT&&(Tt=n.RGBA16F),ot===n.UNSIGNED_BYTE&&(Tt=ne===tn?n.SRGB8_ALPHA8:n.RGBA8),ot===n.UNSIGNED_SHORT_4_4_4_4&&(Tt=n.RGBA4),ot===n.UNSIGNED_SHORT_5_5_5_1&&(Tt=n.RGB5_A1)}return(Tt===n.R16F||Tt===n.R32F||Tt===n.RG16F||Tt===n.RG32F||Tt===n.RGBA16F||Tt===n.RGBA32F)&&t.get("EXT_color_buffer_float"),Tt}function b(z,O){let ot;return z?O===null||O===aa||O===Ko?ot=n.DEPTH24_STENCIL8:O===Ni?ot=n.DEPTH32F_STENCIL8:O===Wc&&(ot=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):O===null||O===aa||O===Ko?ot=n.DEPTH_COMPONENT24:O===Ni?ot=n.DEPTH_COMPONENT32F:O===Wc&&(ot=n.DEPTH_COMPONENT16),ot}function S(z,O){return y(z)===!0||z.isFramebufferTexture&&z.minFilter!==Ln&&z.minFilter!==mn?Math.log2(Math.max(O.width,O.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?O.mipmaps.length:1}function R(z){const O=z.target;O.removeEventListener("dispose",R),T(O),O.isVideoTexture&&h.delete(O)}function C(z){const O=z.target;O.removeEventListener("dispose",C),P(O)}function T(z){const O=i.get(z);if(O.__webglInit===void 0)return;const ot=z.source,At=p.get(ot);if(At){const Et=At[O.__cacheKey];Et.usedTimes--,Et.usedTimes===0&&N(z),Object.keys(At).length===0&&p.delete(ot)}i.remove(z)}function N(z){const O=i.get(z);n.deleteTexture(O.__webglTexture);const ot=z.source,At=p.get(ot);delete At[O.__cacheKey],a.memory.textures--}function P(z){const O=i.get(z);if(z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let At=0;At<6;At++){if(Array.isArray(O.__webglFramebuffer[At]))for(let Et=0;Et=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+r.maxTextures),E+=1,z}function V(z){const O=[];return O.push(z.wrapS),O.push(z.wrapT),O.push(z.wrapR||0),O.push(z.magFilter),O.push(z.minFilter),O.push(z.anisotropy),O.push(z.internalFormat),O.push(z.format),O.push(z.type),O.push(z.generateMipmaps),O.push(z.premultiplyAlpha),O.push(z.flipY),O.push(z.unpackAlignment),O.push(z.colorSpace),O.join()}function j(z,O){const ot=i.get(z);if(z.isVideoTexture&&kt(z),z.isRenderTargetTexture===!1&&z.version>0&&ot.__version!==z.version){const At=z.image;if(At===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(At.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{vt(ot,z,O);return}}e.bindTexture(n.TEXTURE_2D,ot.__webglTexture,n.TEXTURE0+O)}function Y(z,O){const ot=i.get(z);if(z.version>0&&ot.__version!==z.version){vt(ot,z,O);return}e.bindTexture(n.TEXTURE_2D_ARRAY,ot.__webglTexture,n.TEXTURE0+O)}function q(z,O){const ot=i.get(z);if(z.version>0&&ot.__version!==z.version){vt(ot,z,O);return}e.bindTexture(n.TEXTURE_3D,ot.__webglTexture,n.TEXTURE0+O)}function at(z,O){const ot=i.get(z);if(z.version>0&&ot.__version!==z.version){Z(ot,z,O);return}e.bindTexture(n.TEXTURE_CUBE_MAP,ot.__webglTexture,n.TEXTURE0+O)}const G={[Wa]:n.REPEAT,[Ki]:n.CLAMP_TO_EDGE,[Vc]:n.MIRRORED_REPEAT},tt={[Ln]:n.NEAREST,[G0]:n.NEAREST_MIPMAP_NEAREST,[Oo]:n.NEAREST_MIPMAP_LINEAR,[mn]:n.LINEAR,[Pc]:n.LINEAR_MIPMAP_NEAREST,[gr]:n.LINEAR_MIPMAP_LINEAR},K={[z2]:n.NEVER,[j2]:n.ALWAYS,[B2]:n.LESS,[t1]:n.LEQUAL,[H2]:n.EQUAL,[W2]:n.GEQUAL,[G2]:n.GREATER,[V2]:n.NOTEQUAL};function $(z,O){if(O.type===Ni&&t.has("OES_texture_float_linear")===!1&&(O.magFilter===mn||O.magFilter===Pc||O.magFilter===Oo||O.magFilter===gr||O.minFilter===mn||O.minFilter===Pc||O.minFilter===Oo||O.minFilter===gr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(z,n.TEXTURE_WRAP_S,G[O.wrapS]),n.texParameteri(z,n.TEXTURE_WRAP_T,G[O.wrapT]),(z===n.TEXTURE_3D||z===n.TEXTURE_2D_ARRAY)&&n.texParameteri(z,n.TEXTURE_WRAP_R,G[O.wrapR]),n.texParameteri(z,n.TEXTURE_MAG_FILTER,tt[O.magFilter]),n.texParameteri(z,n.TEXTURE_MIN_FILTER,tt[O.minFilter]),O.compareFunction&&(n.texParameteri(z,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(z,n.TEXTURE_COMPARE_FUNC,K[O.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(O.magFilter===Ln||O.minFilter!==Oo&&O.minFilter!==gr||O.type===Ni&&t.has("OES_texture_float_linear")===!1)return;if(O.anisotropy>1||i.get(O).__currentAnisotropy){const ot=t.get("EXT_texture_filter_anisotropic");n.texParameterf(z,ot.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,r.getMaxAnisotropy())),i.get(O).__currentAnisotropy=O.anisotropy}}}function ht(z,O){let ot=!1;z.__webglInit===void 0&&(z.__webglInit=!0,O.addEventListener("dispose",R));const At=O.source;let Et=p.get(At);Et===void 0&&(Et={},p.set(At,Et));const Tt=V(O);if(Tt!==z.__cacheKey){Et[Tt]===void 0&&(Et[Tt]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,ot=!0),Et[Tt].usedTimes++;const ne=Et[z.__cacheKey];ne!==void 0&&(Et[z.__cacheKey].usedTimes--,ne.usedTimes===0&&N(O)),z.__cacheKey=Tt,z.__webglTexture=Et[Tt].texture}return ot}function vt(z,O,ot){let At=n.TEXTURE_2D;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(At=n.TEXTURE_2D_ARRAY),O.isData3DTexture&&(At=n.TEXTURE_3D);const Et=ht(z,O),Tt=O.source;e.bindTexture(At,z.__webglTexture,n.TEXTURE0+ot);const ne=i.get(Tt);if(Tt.version!==ne.__version||Et===!0){e.activeTexture(n.TEXTURE0+ot);const Ft=Fe.getPrimaries(Fe.workingColorSpace),Wt=O.colorSpace===Ks?null:Fe.getPrimaries(O.colorSpace),ge=O.colorSpace===Ks||Ft===Wt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,O.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,O.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,ge);let Dt=_(O.image,!1,r.maxTextureSize);Dt=Rt(O,Dt);const $t=s.convert(O.format,O.colorSpace),It=s.convert(O.type);let Nt=M(O.internalFormat,$t,It,O.colorSpace,O.isVideoTexture);$(At,O);let qt;const W=O.mipmaps,gt=O.isVideoTexture!==!0,jt=ne.__version===void 0||Et===!0,D=Tt.dataReady,it=S(O,Dt);if(O.isDepthTexture)Nt=b(O.format===Jo,O.type),jt&&(gt?e.texStorage2D(n.TEXTURE_2D,1,Nt,Dt.width,Dt.height):e.texImage2D(n.TEXTURE_2D,0,Nt,Dt.width,Dt.height,0,$t,It,null));else if(O.isDataTexture)if(W.length>0){gt&&jt&&e.texStorage2D(n.TEXTURE_2D,it,Nt,W[0].width,W[0].height);for(let lt=0,ut=W.length;lt0){const Ct=q_(qt.width,qt.height,O.format,O.type);for(const oe of O.layerUpdates){const le=qt.data.subarray(oe*Ct/qt.data.BYTES_PER_ELEMENT,(oe+1)*Ct/qt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,lt,0,0,oe,qt.width,qt.height,1,$t,le,0,0)}O.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,lt,0,0,0,qt.width,qt.height,Dt.depth,$t,qt.data,0,0)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,lt,Nt,qt.width,qt.height,Dt.depth,0,qt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else gt?D&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,lt,0,0,0,qt.width,qt.height,Dt.depth,$t,It,qt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,lt,Nt,qt.width,qt.height,Dt.depth,0,$t,It,qt.data)}else{gt&&jt&&e.texStorage2D(n.TEXTURE_2D,it,Nt,W[0].width,W[0].height);for(let lt=0,ut=W.length;lt0){const lt=q_(Dt.width,Dt.height,O.format,O.type);for(const ut of O.layerUpdates){const Ct=Dt.data.subarray(ut*lt/Dt.data.BYTES_PER_ELEMENT,(ut+1)*lt/Dt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ut,Dt.width,Dt.height,1,$t,It,Ct)}O.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Dt.width,Dt.height,Dt.depth,$t,It,Dt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Nt,Dt.width,Dt.height,Dt.depth,0,$t,It,Dt.data);else if(O.isData3DTexture)gt?(jt&&e.texStorage3D(n.TEXTURE_3D,it,Nt,Dt.width,Dt.height,Dt.depth),D&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Dt.width,Dt.height,Dt.depth,$t,It,Dt.data)):e.texImage3D(n.TEXTURE_3D,0,Nt,Dt.width,Dt.height,Dt.depth,0,$t,It,Dt.data);else if(O.isFramebufferTexture){if(jt)if(gt)e.texStorage2D(n.TEXTURE_2D,it,Nt,Dt.width,Dt.height);else{let lt=Dt.width,ut=Dt.height;for(let Ct=0;Ct>=1,ut>>=1}}else if(W.length>0){if(gt&&jt){const lt=zt(W[0]);e.texStorage2D(n.TEXTURE_2D,it,Nt,lt.width,lt.height)}for(let lt=0,ut=W.length;lt0&&it++;const ut=zt($t[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,it,W,ut.width,ut.height)}for(let ut=0;ut<6;ut++)if(Dt){gt?D&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,$t[ut].width,$t[ut].height,Nt,qt,$t[ut].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,W,$t[ut].width,$t[ut].height,0,Nt,qt,$t[ut].data);for(let Ct=0;Ct>Tt),$t=Math.max(1,O.height>>Tt);Et===n.TEXTURE_3D||Et===n.TEXTURE_2D_ARRAY?e.texImage3D(Et,Tt,Wt,Dt,$t,O.depth,0,ne,Ft,null):e.texImage2D(Et,Tt,Wt,Dt,$t,0,ne,Ft,null)}e.bindFramebuffer(n.FRAMEBUFFER,z),dt(O)?o.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,At,Et,i.get(ot).__webglTexture,0,mt(O)):(Et===n.TEXTURE_2D||Et>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Et<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,At,Et,i.get(ot).__webglTexture,Tt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function St(z,O,ot){if(n.bindRenderbuffer(n.RENDERBUFFER,z),O.depthBuffer){const At=O.depthTexture,Et=At&&At.isDepthTexture?At.type:null,Tt=b(O.stencilBuffer,Et),ne=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ft=mt(O);dt(O)?o.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ft,Tt,O.width,O.height):ot?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ft,Tt,O.width,O.height):n.renderbufferStorage(n.RENDERBUFFER,Tt,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ne,n.RENDERBUFFER,z)}else{const At=O.textures;for(let Et=0;Et1;if(ne||(At.__webglTexture===void 0&&(At.__webglTexture=n.createTexture()),At.__version=O.version,a.memory.textures++),Tt){ot.__webglFramebuffer=[];for(let Ft=0;Ft<6;Ft++)if(O.mipmaps&&O.mipmaps.length>0){ot.__webglFramebuffer[Ft]=[];for(let Wt=0;Wt0){ot.__webglFramebuffer=[];for(let Ft=0;Ft0&&dt(z)===!1){ot.__webglMultisampledFramebuffer=n.createFramebuffer(),ot.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,ot.__webglMultisampledFramebuffer);for(let Ft=0;Ft0)for(let Wt=0;Wt0)for(let Wt=0;Wt0){if(dt(z)===!1){const O=z.textures,ot=z.width,At=z.height;let Et=n.COLOR_BUFFER_BIT;const Tt=z.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ne=i.get(z),Ft=O.length>1;if(Ft)for(let Wt=0;Wt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function kt(z){const O=a.render.frame;h.get(z)!==O&&(h.set(z,O),z.update())}function Rt(z,O){const ot=z.colorSpace,At=z.format,Et=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||ot!==Dn&&ot!==Ks&&(Fe.getTransfer(ot)===tn?(At!==ui||Et!==Vr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ot)),O}function zt(z){return typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement?(c.width=z.naturalWidth||z.width,c.height=z.naturalHeight||z.height):typeof VideoFrame<"u"&&z instanceof VideoFrame?(c.width=z.displayWidth,c.height=z.displayHeight):(c.width=z.width,c.height=z.height),c}this.allocateTextureUnit=B,this.resetTextureUnits=L,this.setTexture2D=j,this.setTexture2DArray=Y,this.setTexture3D=q,this.setTextureCube=at,this.rebindTextures=Xt,this.setupRenderTarget=Gt,this.updateRenderTargetMipmap=Qt,this.updateMultisampleRenderTarget=bt,this.setupDepthRenderbuffer=Ot,this.setupFrameBufferTexture=rt,this.useMultisampledRTT=dt}function uC(n,t){function e(i,r=Ks){let s;const a=Fe.getTransfer(r);if(i===Vr)return n.UNSIGNED_BYTE;if(i===W0)return n.UNSIGNED_SHORT_4_4_4_4;if(i===j0)return n.UNSIGNED_SHORT_5_5_5_1;if(i===jv)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===Vv)return n.BYTE;if(i===Wv)return n.SHORT;if(i===Wc)return n.UNSIGNED_SHORT;if(i===V0)return n.INT;if(i===aa)return n.UNSIGNED_INT;if(i===Ni)return n.FLOAT;if(i===oh)return n.HALF_FLOAT;if(i===Xv)return n.ALPHA;if(i===qv)return n.RGB;if(i===ui)return n.RGBA;if(i===$v)return n.LUMINANCE;if(i===Yv)return n.LUMINANCE_ALPHA;if(i===jo)return n.DEPTH_COMPONENT;if(i===Jo)return n.DEPTH_STENCIL;if(i===X0)return n.RED;if(i===Cf)return n.RED_INTEGER;if(i===Zv)return n.RG;if(i===q0)return n.RG_INTEGER;if(i===$0)return n.RGBA_INTEGER;if(i===Mu||i===wu||i===bu||i===Su)if(a===tn)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Mu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===wu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===bu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Su)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Mu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===wu)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===bu)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Su)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Wm||i===jm||i===Xm||i===qm)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Wm)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===jm)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Xm)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===qm)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===$m||i===Ym||i===Zm)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(i===$m||i===Ym)return a===tn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Zm)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===Km||i===Jm||i===Qm||i===t0||i===e0||i===n0||i===i0||i===r0||i===s0||i===a0||i===o0||i===l0||i===c0||i===h0)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(i===Km)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Jm)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Qm)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===t0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===e0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===n0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===i0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===r0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===s0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===a0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===o0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===l0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===c0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===h0)return a===tn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Eu||i===u0||i===f0)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(i===Eu)return a===tn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===u0)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===f0)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Kv||i===d0||i===p0||i===m0)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(i===Eu)return s.COMPRESSED_RED_RGTC1_EXT;if(i===d0)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===p0)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===m0)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Ko?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:e}}class fC extends cn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Qs extends Ge{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yB={type:"move"};class mx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const 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}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const _ of t.hand.values()){const y=e.getJointPose(_,i),x=this._getHandJoint(c,_);y!==null&&(x.matrix.fromArray(y.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=y.radius),x.visible=y!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],p=h.position.distanceTo(u.position),m=.02,g=.005;c.inputState.pinching&&p>m+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&p<=m-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=e.getPose(t.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(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,this.dispatchEvent(yB)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new Qs;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}const xB=` void main() { gl_Position = vec4( position, 1.0 ); @@ -3839,18 +3839,18 @@ void main() { } -}`;class vB{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){const r=new Mn,s=t.properties.get(r);s.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new Xr({vertexShader:xB,fragmentShader:_B,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new vn(new lh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class MB extends qr{constructor(t,e){super();const i=this;let r=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,p=null,m=null,g=null;const _=new vB,y=e.getContextAttributes();let x=null,M=null;const b=[],S=[],R=new xt;let T=null;const C=new cn;C.layers.enable(1),C.viewport=new je;const N=new cn;N.layers.enable(2),N.viewport=new je;const P=[C,N],E=new fC;E.layers.enable(1),E.layers.enable(2);let L=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let rt=b[Z];return rt===void 0&&(rt=new mx,b[Z]=rt),rt.getTargetRaySpace()},this.getControllerGrip=function(Z){let rt=b[Z];return rt===void 0&&(rt=new mx,b[Z]=rt),rt.getGripSpace()},this.getHand=function(Z){let rt=b[Z];return rt===void 0&&(rt=new mx,b[Z]=rt),rt.getHandSpace()};function V(Z){const rt=S.indexOf(Z.inputSource);if(rt===-1)return;const St=b[rt];St!==void 0&&(St.update(Z.inputSource,Z.frame,c||a),St.dispatchEvent({type:Z.type,data:Z.inputSource}))}function j(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",j),r.removeEventListener("inputsourceschange",Y);for(let Z=0;Z=0&&(S[_t]=null,b[_t].disconnect(St))}for(let rt=0;rt=S.length){S.push(St),_t=Xt;break}else if(S[Xt]===null){S[Xt]=St,_t=Xt;break}if(_t===-1)break}const Ot=b[_t];Ot&&Ot.connect(St)}}const q=new U,at=new U;function G(Z,rt,St){q.setFromMatrixPosition(rt.matrixWorld),at.setFromMatrixPosition(St.matrixWorld);const _t=q.distanceTo(at),Ot=rt.projectionMatrix.elements,Xt=St.projectionMatrix.elements,Gt=Ot[14]/(Ot[10]-1),Qt=Ot[14]/(Ot[10]+1),F=(Ot[9]+1)/Ot[5],wt=(Ot[9]-1)/Ot[5],bt=(Ot[8]-1)/Ot[0],mt=(Xt[8]+1)/Xt[0],dt=Gt*bt,kt=Gt*mt,Rt=_t/(-bt+mt),zt=Rt*-bt;rt.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(zt),Z.translateZ(Rt),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const z=Gt+Rt,O=Qt+Rt,ot=dt-zt,At=kt+(_t-zt),Et=F*Qt/O*z,Tt=wt*Qt/O*z;Z.projectionMatrix.makePerspective(ot,At,Et,Tt,z,O),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function nt(Z,rt){rt===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(rt.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(r===null)return;_.texture!==null&&(Z.near=_.depthNear,Z.far=_.depthFar),E.near=N.near=C.near=Z.near,E.far=N.far=C.far=Z.far,(L!==E.near||B!==E.far)&&(r.updateRenderState({depthNear:E.near,depthFar:E.far}),L=E.near,B=E.far,C.near=L,C.far=B,N.near=L,N.far=B,C.updateProjectionMatrix(),N.updateProjectionMatrix(),Z.updateProjectionMatrix());const rt=Z.parent,St=E.cameras;nt(E,rt);for(let _t=0;_t0&&(y.alphaTest.value=x.alphaTest);const M=t.get(x),b=M.envMap,S=M.envMapRotation;b&&(y.envMap.value=b,xo.copy(S),xo.x*=-1,xo.y*=-1,xo.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(xo.y*=-1,xo.z*=-1),y.envMapRotation.value.setFromMatrix4(wB.makeRotationFromEuler(xo)),y.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=x.reflectivity,y.ior.value=x.ior,y.refractionRatio.value=x.refractionRatio),x.lightMap&&(y.lightMap.value=x.lightMap,y.lightMapIntensity.value=x.lightMapIntensity,e(x.lightMap,y.lightMapTransform)),x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity,e(x.aoMap,y.aoMapTransform))}function a(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,x.map&&(y.map.value=x.map,e(x.map,y.mapTransform))}function o(y,x){y.dashSize.value=x.dashSize,y.totalSize.value=x.dashSize+x.gapSize,y.scale.value=x.scale}function l(y,x,M,b){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*M,y.scale.value=b*.5,x.map&&(y.map.value=x.map,e(x.map,y.uvTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,e(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function c(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.rotation.value=x.rotation,x.map&&(y.map.value=x.map,e(x.map,y.mapTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,e(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function h(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function u(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function p(y,x){y.metalness.value=x.metalness,x.metalnessMap&&(y.metalnessMap.value=x.metalnessMap,e(x.metalnessMap,y.metalnessMapTransform)),y.roughness.value=x.roughness,x.roughnessMap&&(y.roughnessMap.value=x.roughnessMap,e(x.roughnessMap,y.roughnessMapTransform)),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)}function m(y,x,M){y.ior.value=x.ior,x.sheen>0&&(y.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),y.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(y.sheenColorMap.value=x.sheenColorMap,e(x.sheenColorMap,y.sheenColorMapTransform)),x.sheenRoughnessMap&&(y.sheenRoughnessMap.value=x.sheenRoughnessMap,e(x.sheenRoughnessMap,y.sheenRoughnessMapTransform))),x.clearcoat>0&&(y.clearcoat.value=x.clearcoat,y.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(y.clearcoatMap.value=x.clearcoatMap,e(x.clearcoatMap,y.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,e(x.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(y.clearcoatNormalMap.value=x.clearcoatNormalMap,e(x.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===wi&&y.clearcoatNormalScale.value.negate())),x.dispersion>0&&(y.dispersion.value=x.dispersion),x.iridescence>0&&(y.iridescence.value=x.iridescence,y.iridescenceIOR.value=x.iridescenceIOR,y.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(y.iridescenceMap.value=x.iridescenceMap,e(x.iridescenceMap,y.iridescenceMapTransform)),x.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=x.iridescenceThicknessMap,e(x.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),x.transmission>0&&(y.transmission.value=x.transmission,y.transmissionSamplerMap.value=M.texture,y.transmissionSamplerSize.value.set(M.width,M.height),x.transmissionMap&&(y.transmissionMap.value=x.transmissionMap,e(x.transmissionMap,y.transmissionMapTransform)),y.thickness.value=x.thickness,x.thicknessMap&&(y.thicknessMap.value=x.thicknessMap,e(x.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=x.attenuationDistance,y.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(y.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(y.anisotropyMap.value=x.anisotropyMap,e(x.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=x.specularIntensity,y.specularColor.value.copy(x.specularColor),x.specularColorMap&&(y.specularColorMap.value=x.specularColorMap,e(x.specularColorMap,y.specularColorMapTransform)),x.specularIntensityMap&&(y.specularIntensityMap.value=x.specularIntensityMap,e(x.specularIntensityMap,y.specularIntensityMapTransform))}function g(y,x){x.matcap&&(y.matcap.value=x.matcap)}function _(y,x){const M=t.get(x).light;y.referencePosition.value.setFromMatrixPosition(M.matrixWorld),y.nearDistance.value=M.shadow.camera.near,y.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function SB(n,t,e,i){let r={},s={},a=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(M,b){const S=b.program;i.uniformBlockBinding(M,S)}function c(M,b){let S=r[M.id];S===void 0&&(g(M),S=h(M),r[M.id]=S,M.addEventListener("dispose",y));const R=b.program;i.updateUBOMapping(M,R);const T=t.render.frame;s[M.id]!==T&&(p(M),s[M.id]=T)}function h(M){const b=u();M.__bindingPointIndex=b;const S=n.createBuffer(),R=M.__size,T=M.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,S),S}function u(){for(let M=0;M0&&(S+=R-T),M.__size=S,M.__cache={},this}function _(M){const b={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(b.boundary=4,b.storage=4):M.isVector2?(b.boundary=8,b.storage=8):M.isVector3||M.isColor?(b.boundary=16,b.storage=12):M.isVector4?(b.boundary=16,b.storage=16):M.isMatrix3?(b.boundary=48,b.storage=48):M.isMatrix4?(b.boundary=64,b.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),b}function y(M){const b=M.target;b.removeEventListener("dispose",y);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),n.deleteBuffer(r[b.id]),delete r[b.id],delete s[b.id]}function x(){for(const M in r)n.deleteBuffer(r[M]);a=[],r={},s={}}return{bind:l,update:c,dispose:x}}class dC{constructor(t={}){const{canvas:e=Y2(),context:i=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1}=t;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=a;const m=new Uint32Array(4),g=new Int32Array(4);let _=null,y=null;const x=[],M=[];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._outputColorSpace=Tn,this.toneMapping=vs,this.toneMappingExposure=1;const b=this;let S=!1,R=0,T=0,C=null,N=-1,P=null;const E=new je,L=new je;let B=null;const V=new Ht(0);let j=0,Y=e.width,q=e.height,at=1,G=null,nt=null;const K=new je(0,0,Y,q),$=new je(0,0,Y,q);let ht=!1;const vt=new Lf;let Z=!1,rt=!1;const St=new de,_t=new U,Ot=new je,Xt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Gt=!1;function Qt(){return C===null?at:1}let F=i;function wt(k,tt){return e.getContext(k,tt)}try{const k={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${z0}`),e.addEventListener("webglcontextlost",lt,!1),e.addEventListener("webglcontextrestored",ut,!1),e.addEventListener("webglcontextcreationerror",Ct,!1),F===null){const tt="webgl2";if(F=wt(tt,k),F===null)throw wt(tt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw console.error("THREE.WebGLRenderer: "+k.message),k}let bt,mt,dt,kt,Rt,zt,z,O,ot,At,Et,Tt,ne,Ft,Wt,ge,Dt,$t,It,Nt,qt,W,gt,jt;function D(){bt=new Ik(F),bt.init(),W=new uC(F,bt),mt=new Ek(F,bt,t,W),dt=new hB(F),kt=new Nk(F),Rt=new Jz,zt=new gB(F,bt,dt,Rt,mt,W,kt),z=new Tk(b),O=new Pk(b),ot=new HO(F),gt=new bk(F,ot),At=new Lk(F,ot,kt,gt),Et=new Fk(F,At,ot,kt),It=new Ok(F,mt,zt),ge=new Ak(Rt),Tt=new Kz(b,z,O,bt,mt,gt,ge),ne=new bB(b,Rt),Ft=new tB,Wt=new aB(bt),$t=new wk(b,z,O,dt,Et,p,l),Dt=new cB(b,Et,mt),jt=new SB(F,kt,mt,dt),Nt=new Sk(F,bt,kt),qt=new Dk(F,bt,kt),kt.programs=Tt.programs,b.capabilities=mt,b.extensions=bt,b.properties=Rt,b.renderLists=Ft,b.shadowMap=Dt,b.state=dt,b.info=kt}D();const it=new MB(b,F);this.xr=it,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){const k=bt.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=bt.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return at},this.setPixelRatio=function(k){k!==void 0&&(at=k,this.setSize(Y,q,!1))},this.getSize=function(k){return k.set(Y,q)},this.setSize=function(k,tt,ft=!0){if(it.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=k,q=tt,e.width=Math.floor(k*at),e.height=Math.floor(tt*at),ft===!0&&(e.style.width=k+"px",e.style.height=tt+"px"),this.setViewport(0,0,k,tt)},this.getDrawingBufferSize=function(k){return k.set(Y*at,q*at).floor()},this.setDrawingBufferSize=function(k,tt,ft){Y=k,q=tt,at=ft,e.width=Math.floor(k*ft),e.height=Math.floor(tt*ft),this.setViewport(0,0,k,tt)},this.getCurrentViewport=function(k){return k.copy(E)},this.getViewport=function(k){return k.copy(K)},this.setViewport=function(k,tt,ft,pt){k.isVector4?K.set(k.x,k.y,k.z,k.w):K.set(k,tt,ft,pt),dt.viewport(E.copy(K).multiplyScalar(at).round())},this.getScissor=function(k){return k.copy($)},this.setScissor=function(k,tt,ft,pt){k.isVector4?$.set(k.x,k.y,k.z,k.w):$.set(k,tt,ft,pt),dt.scissor(L.copy($).multiplyScalar(at).round())},this.getScissorTest=function(){return ht},this.setScissorTest=function(k){dt.setScissorTest(ht=k)},this.setOpaqueSort=function(k){G=k},this.setTransparentSort=function(k){nt=k},this.getClearColor=function(k){return k.copy($t.getClearColor())},this.setClearColor=function(){$t.setClearColor.apply($t,arguments)},this.getClearAlpha=function(){return $t.getClearAlpha()},this.setClearAlpha=function(){$t.setClearAlpha.apply($t,arguments)},this.clear=function(k=!0,tt=!0,ft=!0){let pt=0;if(k){let st=!1;if(C!==null){const Bt=C.texture.format;st=Bt===$0||Bt===q0||Bt===Cf}if(st){const Bt=C.texture.type,ee=Bt===Vr||Bt===aa||Bt===Wc||Bt===Ko||Bt===W0||Bt===j0,se=$t.getClearColor(),re=$t.getClearAlpha(),pe=se.r,ye=se.g,fe=se.b;ee?(m[0]=pe,m[1]=ye,m[2]=fe,m[3]=re,F.clearBufferuiv(F.COLOR,0,m)):(g[0]=pe,g[1]=ye,g[2]=fe,g[3]=re,F.clearBufferiv(F.COLOR,0,g))}else pt|=F.COLOR_BUFFER_BIT}tt&&(pt|=F.DEPTH_BUFFER_BIT),ft&&(pt|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),F.clear(pt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",lt,!1),e.removeEventListener("webglcontextrestored",ut,!1),e.removeEventListener("webglcontextcreationerror",Ct,!1),Ft.dispose(),Wt.dispose(),Rt.dispose(),z.dispose(),O.dispose(),Et.dispose(),gt.dispose(),jt.dispose(),Tt.dispose(),it.dispose(),it.removeEventListener("sessionstart",$e),it.removeEventListener("sessionend",Kr),Pn.stop()};function lt(k){k.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const k=kt.autoReset,tt=Dt.enabled,ft=Dt.autoUpdate,pt=Dt.needsUpdate,st=Dt.type;D(),kt.autoReset=k,Dt.enabled=tt,Dt.autoUpdate=ft,Dt.needsUpdate=pt,Dt.type=st}function Ct(k){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",k.statusMessage)}function oe(k){const tt=k.target;tt.removeEventListener("dispose",oe),le(tt)}function le(k){Ne(k),Rt.remove(k)}function Ne(k){const tt=Rt.get(k).programs;tt!==void 0&&(tt.forEach(function(ft){Tt.releaseProgram(ft)}),k.isShaderMaterial&&Tt.releaseShaderCache(k))}this.renderBufferDirect=function(k,tt,ft,pt,st,Bt){tt===null&&(tt=Xt);const ee=st.isMesh&&st.matrixWorld.determinant()<0,se=Cg(k,tt,ft,pt,st);dt.setMaterial(pt,ee);let re=ft.index,pe=1;if(pt.wireframe===!0){if(re=At.getWireframeAttribute(ft),re===void 0)return;pe=2}const ye=ft.drawRange,fe=ft.attributes.position;let Ue=ye.start*pe,Ke=(ye.start+ye.count)*pe;Bt!==null&&(Ue=Math.max(Ue,Bt.start*pe),Ke=Math.min(Ke,(Bt.start+Bt.count)*pe)),re!==null?(Ue=Math.max(Ue,0),Ke=Math.min(Ke,re.count)):fe!=null&&(Ue=Math.max(Ue,0),Ke=Math.min(Ke,fe.count));const Xe=Ke-Ue;if(Xe<0||Xe===1/0)return;gt.setup(st,pt,se,ft,re);let un,ue=Nt;if(re!==null&&(un=ot.get(re),ue=qt,ue.setIndex(un)),st.isMesh)pt.wireframe===!0?(dt.setLineWidth(pt.wireframeLinewidth*Qt()),ue.setMode(F.LINES)):ue.setMode(F.TRIANGLES);else if(st.isLine){let Vt=pt.linewidth;Vt===void 0&&(Vt=1),dt.setLineWidth(Vt*Qt()),st.isLineSegments?ue.setMode(F.LINES):st.isLineLoop?ue.setMode(F.LINE_LOOP):ue.setMode(F.LINE_STRIP)}else st.isPoints?ue.setMode(F.POINTS):st.isSprite&&ue.setMode(F.TRIANGLES);if(st.isBatchedMesh)if(st._multiDrawInstances!==null)ue.renderMultiDrawInstances(st._multiDrawStarts,st._multiDrawCounts,st._multiDrawCount,st._multiDrawInstances);else if(bt.get("WEBGL_multi_draw"))ue.renderMultiDraw(st._multiDrawStarts,st._multiDrawCounts,st._multiDrawCount);else{const Vt=st._multiDrawStarts,Je=st._multiDrawCounts,xe=st._multiDrawCount,Qe=re?ot.get(re).bytesPerElement:1,Ei=Rt.get(pt).currentProgram.getUniforms();for(let wn=0;wn{function Bt(){if(pt.forEach(function(ee){Rt.get(ee).currentProgram.isReady()&&pt.delete(ee)}),pt.size===0){st(k);return}setTimeout(Bt,10)}bt.get("KHR_parallel_shader_compile")!==null?Bt():setTimeout(Bt,10)})};let Se=null;function qe(k){Se&&Se(k)}function $e(){Pn.stop()}function Kr(){Pn.start()}const Pn=new aC;Pn.setAnimationLoop(qe),typeof self<"u"&&Pn.setContext(self),this.setAnimationLoop=function(k){Se=k,it.setAnimationLoop(k),k===null?Pn.stop():Pn.start()},it.addEventListener("sessionstart",$e),it.addEventListener("sessionend",Kr),this.render=function(k,tt){if(tt!==void 0&&tt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),tt.parent===null&&tt.matrixWorldAutoUpdate===!0&&tt.updateMatrixWorld(),it.enabled===!0&&it.isPresenting===!0&&(it.cameraAutoUpdate===!0&&it.updateCamera(tt),tt=it.getCamera()),k.isScene===!0&&k.onBeforeRender(b,k,tt,C),y=Wt.get(k,M.length),y.init(tt),M.push(y),St.multiplyMatrices(tt.projectionMatrix,tt.matrixWorldInverse),vt.setFromProjectionMatrix(St),rt=this.localClippingEnabled,Z=ge.init(this.clippingPlanes,rt),_=Ft.get(k,x.length),_.init(),x.push(_),it.enabled===!0&&it.isPresenting===!0){const Bt=b.xr.getDepthSensingMesh();Bt!==null&&Er(Bt,tt,-1/0,b.sortObjects)}Er(k,tt,0,b.sortObjects),_.finish(),b.sortObjects===!0&&_.sort(G,nt),Gt=it.enabled===!1||it.isPresenting===!1||it.hasDepthSensing()===!1,Gt&&$t.addToRenderList(_,k),this.info.render.frame++,Z===!0&&ge.beginShadows();const ft=y.state.shadowsArray;Dt.render(ft,k,tt),Z===!0&&ge.endShadows(),this.info.autoReset===!0&&this.info.reset();const pt=_.opaque,st=_.transmissive;if(y.setupLights(),tt.isArrayCamera){const Bt=tt.cameras;if(st.length>0)for(let ee=0,se=Bt.length;ee0&&Cs(pt,st,k,tt),Gt&&$t.render(k),Jr(_,k,tt);C!==null&&(zt.updateMultisampleRenderTarget(C),zt.updateRenderTargetMipmap(C)),k.isScene===!0&&k.onAfterRender(b,k,tt),gt.resetDefaultState(),N=-1,P=null,M.pop(),M.length>0?(y=M[M.length-1],Z===!0&&ge.setGlobalState(b.clippingPlanes,y.state.camera)):y=null,x.pop(),x.length>0?_=x[x.length-1]:_=null};function Er(k,tt,ft,pt){if(k.visible===!1)return;if(k.layers.test(tt.layers)){if(k.isGroup)ft=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(tt);else if(k.isLight)y.pushLight(k),k.castShadow&&y.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||vt.intersectsSprite(k)){pt&&Ot.setFromMatrixPosition(k.matrixWorld).applyMatrix4(St);const ee=Et.update(k),se=k.material;se.visible&&_.push(k,ee,se,ft,Ot.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||vt.intersectsObject(k))){const ee=Et.update(k),se=k.material;if(pt&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),Ot.copy(k.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),Ot.copy(ee.boundingSphere.center)),Ot.applyMatrix4(k.matrixWorld).applyMatrix4(St)),Array.isArray(se)){const re=ee.groups;for(let pe=0,ye=re.length;pe0&&dl(st,tt,ft),Bt.length>0&&dl(Bt,tt,ft),ee.length>0&&dl(ee,tt,ft),dt.buffers.depth.setTest(!0),dt.buffers.depth.setMask(!0),dt.buffers.color.setMask(!0),dt.setPolygonOffset(!1)}function Cs(k,tt,ft,pt){if((ft.isScene===!0?ft.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[pt.id]===void 0&&(y.state.transmissionRenderTarget[pt.id]=new Wr(1,1,{generateMipmaps:!0,type:bt.has("EXT_color_buffer_half_float")||bt.has("EXT_color_buffer_float")?oh:Vr,minFilter:gr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Fe.workingColorSpace}));const Bt=y.state.transmissionRenderTarget[pt.id],ee=pt.viewport||E;Bt.setSize(ee.z,ee.w);const se=b.getRenderTarget();b.setRenderTarget(Bt),b.getClearColor(V),j=b.getClearAlpha(),j<1&&b.setClearColor(16777215,.5),b.clear(),Gt&&$t.render(ft);const re=b.toneMapping;b.toneMapping=vs;const pe=pt.viewport;if(pt.viewport!==void 0&&(pt.viewport=void 0),y.setupLightsView(pt),Z===!0&&ge.setGlobalState(b.clippingPlanes,pt),dl(k,ft,pt),zt.updateMultisampleRenderTarget(Bt),zt.updateRenderTargetMipmap(Bt),bt.has("WEBGL_multisampled_render_to_texture")===!1){let ye=!1;for(let fe=0,Ue=tt.length;fe0),fe=!!ft.morphAttributes.position,Ue=!!ft.morphAttributes.normal,Ke=!!ft.morphAttributes.color;let Xe=vs;pt.toneMapped&&(C===null||C.isXRRenderTarget===!0)&&(Xe=b.toneMapping);const un=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,ue=un!==void 0?un.length:0,Vt=Rt.get(pt),Je=y.state.lights;if(Z===!0&&(rt===!0||k!==P)){const jn=k===P&&pt.id===N;ge.setState(pt,k,jn)}let xe=!1;pt.version===Vt.__version?(Vt.needsLights&&Vt.lightsStateVersion!==Je.state.version||Vt.outputColorSpace!==se||st.isBatchedMesh&&Vt.batching===!1||!st.isBatchedMesh&&Vt.batching===!0||st.isBatchedMesh&&Vt.batchingColor===!0&&st.colorTexture===null||st.isBatchedMesh&&Vt.batchingColor===!1&&st.colorTexture!==null||st.isInstancedMesh&&Vt.instancing===!1||!st.isInstancedMesh&&Vt.instancing===!0||st.isSkinnedMesh&&Vt.skinning===!1||!st.isSkinnedMesh&&Vt.skinning===!0||st.isInstancedMesh&&Vt.instancingColor===!0&&st.instanceColor===null||st.isInstancedMesh&&Vt.instancingColor===!1&&st.instanceColor!==null||st.isInstancedMesh&&Vt.instancingMorph===!0&&st.morphTexture===null||st.isInstancedMesh&&Vt.instancingMorph===!1&&st.morphTexture!==null||Vt.envMap!==re||pt.fog===!0&&Vt.fog!==Bt||Vt.numClippingPlanes!==void 0&&(Vt.numClippingPlanes!==ge.numPlanes||Vt.numIntersection!==ge.numIntersection)||Vt.vertexAlphas!==pe||Vt.vertexTangents!==ye||Vt.morphTargets!==fe||Vt.morphNormals!==Ue||Vt.morphColors!==Ke||Vt.toneMapping!==Xe||Vt.morphTargetsCount!==ue)&&(xe=!0):(xe=!0,Vt.__version=pt.version);let Qe=Vt.currentProgram;xe===!0&&(Qe=pl(pt,tt,st));let Ei=!1,wn=!1,Un=!1;const en=Qe.getUniforms(),Ar=Vt.uniforms;if(dt.useProgram(Qe.program)&&(Ei=!0,wn=!0,Un=!0),pt.id!==N&&(N=pt.id,wn=!0),Ei||P!==k){en.setValue(F,"projectionMatrix",k.projectionMatrix),en.setValue(F,"viewMatrix",k.matrixWorldInverse);const jn=en.map.cameraPosition;jn!==void 0&&jn.setValue(F,_t.setFromMatrixPosition(k.matrixWorld)),mt.logarithmicDepthBuffer&&en.setValue(F,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(pt.isMeshPhongMaterial||pt.isMeshToonMaterial||pt.isMeshLambertMaterial||pt.isMeshBasicMaterial||pt.isMeshStandardMaterial||pt.isShaderMaterial)&&en.setValue(F,"isOrthographic",k.isOrthographicCamera===!0),P!==k&&(P=k,wn=!0,Un=!0)}if(st.isSkinnedMesh){en.setOptional(F,st,"bindMatrix"),en.setOptional(F,st,"bindMatrixInverse");const jn=st.skeleton;jn&&(jn.boneTexture===null&&jn.computeBoneTexture(),en.setValue(F,"boneTexture",jn.boneTexture,zt))}st.isBatchedMesh&&(en.setOptional(F,st,"batchingTexture"),en.setValue(F,"batchingTexture",st._matricesTexture,zt),en.setOptional(F,st,"batchingIdTexture"),en.setValue(F,"batchingIdTexture",st._indirectTexture,zt),en.setOptional(F,st,"batchingColorTexture"),st._colorsTexture!==null&&en.setValue(F,"batchingColorTexture",st._colorsTexture,zt));const ml=ft.morphAttributes;if((ml.position!==void 0||ml.normal!==void 0||ml.color!==void 0)&&It.update(st,ft,Qe),(wn||Vt.receiveShadow!==st.receiveShadow)&&(Vt.receiveShadow=st.receiveShadow,en.setValue(F,"receiveShadow",st.receiveShadow)),pt.isMeshGouraudMaterial&&pt.envMap!==null&&(Ar.envMap.value=re,Ar.flipEnvMap.value=re.isCubeTexture&&re.isRenderTargetTexture===!1?-1:1),pt.isMeshStandardMaterial&&pt.envMap===null&&tt.environment!==null&&(Ar.envMapIntensity.value=tt.environmentIntensity),wn&&(en.setValue(F,"toneMappingExposure",b.toneMappingExposure),Vt.needsLights&&Rg(Ar,Un),Bt&&pt.fog===!0&&ne.refreshFogUniforms(Ar,Bt),ne.refreshMaterialUniforms(Ar,pt,at,q,y.state.transmissionRenderTarget[k.id]),Pm.upload(F,ed(Vt),Ar,zt)),pt.isShaderMaterial&&pt.uniformsNeedUpdate===!0&&(Pm.upload(F,ed(Vt),Ar,zt),pt.uniformsNeedUpdate=!1),pt.isSpriteMaterial&&en.setValue(F,"center",st.center),en.setValue(F,"modelViewMatrix",st.modelViewMatrix),en.setValue(F,"normalMatrix",st.normalMatrix),en.setValue(F,"modelMatrix",st.matrixWorld),pt.isShaderMaterial||pt.isRawShaderMaterial){const jn=pt.uniformsGroups;for(let gl=0,zi=jn.length;gl0&&zt.useMultisampledRTT(k)===!1?st=Rt.get(k).__webglMultisampledFramebuffer:Array.isArray(ye)?st=ye[ft]:st=ye,E.copy(k.viewport),L.copy(k.scissor),B=k.scissorTest}else E.copy(K).multiplyScalar(at).floor(),L.copy($).multiplyScalar(at).floor(),B=ht;if(dt.bindFramebuffer(F.FRAMEBUFFER,st)&&pt&&dt.drawBuffers(k,st),dt.viewport(E),dt.scissor(L),dt.setScissorTest(B),Bt){const re=Rt.get(k.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+tt,re.__webglTexture,ft)}else if(ee){const re=Rt.get(k.texture),pe=tt||0;F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,re.__webglTexture,ft||0,pe)}N=-1},this.readRenderTargetPixels=function(k,tt,ft,pt,st,Bt,ee){if(!(k&&k.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let se=Rt.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ee!==void 0&&(se=se[ee]),se){dt.bindFramebuffer(F.FRAMEBUFFER,se);try{const re=k.texture,pe=re.format,ye=re.type;if(!mt.textureFormatReadable(pe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!mt.textureTypeReadable(ye)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}tt>=0&&tt<=k.width-pt&&ft>=0&&ft<=k.height-st&&F.readPixels(tt,ft,pt,st,W.convert(pe),W.convert(ye),Bt)}finally{const re=C!==null?Rt.get(C).__webglFramebuffer:null;dt.bindFramebuffer(F.FRAMEBUFFER,re)}}},this.readRenderTargetPixelsAsync=async function(k,tt,ft,pt,st,Bt,ee){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let se=Rt.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ee!==void 0&&(se=se[ee]),se){dt.bindFramebuffer(F.FRAMEBUFFER,se);try{const re=k.texture,pe=re.format,ye=re.type;if(!mt.textureFormatReadable(pe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!mt.textureTypeReadable(ye))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(tt>=0&&tt<=k.width-pt&&ft>=0&&ft<=k.height-st){const fe=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,fe),F.bufferData(F.PIXEL_PACK_BUFFER,Bt.byteLength,F.STREAM_READ),F.readPixels(tt,ft,pt,st,W.convert(pe),W.convert(ye),0),F.flush();const Ue=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);await fO(F,Ue,4);try{F.bindBuffer(F.PIXEL_PACK_BUFFER,fe),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,Bt)}finally{F.deleteBuffer(fe),F.deleteSync(Ue)}return Bt}}finally{const re=C!==null?Rt.get(C).__webglFramebuffer:null;dt.bindFramebuffer(F.FRAMEBUFFER,re)}}},this.copyFramebufferToTexture=function(k,tt=null,ft=0){k.isTexture!==!0&&(Ic("WebGLRenderer: copyFramebufferToTexture function signature has changed."),tt=arguments[0]||null,k=arguments[1]);const pt=Math.pow(2,-ft),st=Math.floor(k.image.width*pt),Bt=Math.floor(k.image.height*pt),ee=tt!==null?tt.x:0,se=tt!==null?tt.y:0;zt.setTexture2D(k,0),F.copyTexSubImage2D(F.TEXTURE_2D,ft,0,0,ee,se,st,Bt),dt.unbindTexture()},this.copyTextureToTexture=function(k,tt,ft=null,pt=null,st=0){k.isTexture!==!0&&(Ic("WebGLRenderer: copyTextureToTexture function signature has changed."),pt=arguments[0]||null,k=arguments[1],tt=arguments[2],st=arguments[3]||0,ft=null);let Bt,ee,se,re,pe,ye;ft!==null?(Bt=ft.max.x-ft.min.x,ee=ft.max.y-ft.min.y,se=ft.min.x,re=ft.min.y):(Bt=k.image.width,ee=k.image.height,se=0,re=0),pt!==null?(pe=pt.x,ye=pt.y):(pe=0,ye=0);const fe=W.convert(tt.format),Ue=W.convert(tt.type);zt.setTexture2D(tt,0),F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,tt.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,tt.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,tt.unpackAlignment);const Ke=F.getParameter(F.UNPACK_ROW_LENGTH),Xe=F.getParameter(F.UNPACK_IMAGE_HEIGHT),un=F.getParameter(F.UNPACK_SKIP_PIXELS),ue=F.getParameter(F.UNPACK_SKIP_ROWS),Vt=F.getParameter(F.UNPACK_SKIP_IMAGES),Je=k.isCompressedTexture?k.mipmaps[st]:k.image;F.pixelStorei(F.UNPACK_ROW_LENGTH,Je.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Je.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,se),F.pixelStorei(F.UNPACK_SKIP_ROWS,re),k.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,st,pe,ye,Bt,ee,fe,Ue,Je.data):k.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,st,pe,ye,Je.width,Je.height,fe,Je.data):F.texSubImage2D(F.TEXTURE_2D,st,pe,ye,Bt,ee,fe,Ue,Je),F.pixelStorei(F.UNPACK_ROW_LENGTH,Ke),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Xe),F.pixelStorei(F.UNPACK_SKIP_PIXELS,un),F.pixelStorei(F.UNPACK_SKIP_ROWS,ue),F.pixelStorei(F.UNPACK_SKIP_IMAGES,Vt),st===0&&tt.generateMipmaps&&F.generateMipmap(F.TEXTURE_2D),dt.unbindTexture()},this.copyTextureToTexture3D=function(k,tt,ft=null,pt=null,st=0){k.isTexture!==!0&&(Ic("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ft=arguments[0]||null,pt=arguments[1]||null,k=arguments[2],tt=arguments[3],st=arguments[4]||0);let Bt,ee,se,re,pe,ye,fe,Ue,Ke;const Xe=k.isCompressedTexture?k.mipmaps[st]:k.image;ft!==null?(Bt=ft.max.x-ft.min.x,ee=ft.max.y-ft.min.y,se=ft.max.z-ft.min.z,re=ft.min.x,pe=ft.min.y,ye=ft.min.z):(Bt=Xe.width,ee=Xe.height,se=Xe.depth,re=0,pe=0,ye=0),pt!==null?(fe=pt.x,Ue=pt.y,Ke=pt.z):(fe=0,Ue=0,Ke=0);const un=W.convert(tt.format),ue=W.convert(tt.type);let Vt;if(tt.isData3DTexture)zt.setTexture3D(tt,0),Vt=F.TEXTURE_3D;else if(tt.isDataArrayTexture||tt.isCompressedArrayTexture)zt.setTexture2DArray(tt,0),Vt=F.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,tt.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,tt.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,tt.unpackAlignment);const Je=F.getParameter(F.UNPACK_ROW_LENGTH),xe=F.getParameter(F.UNPACK_IMAGE_HEIGHT),Qe=F.getParameter(F.UNPACK_SKIP_PIXELS),Ei=F.getParameter(F.UNPACK_SKIP_ROWS),wn=F.getParameter(F.UNPACK_SKIP_IMAGES);F.pixelStorei(F.UNPACK_ROW_LENGTH,Xe.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Xe.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,re),F.pixelStorei(F.UNPACK_SKIP_ROWS,pe),F.pixelStorei(F.UNPACK_SKIP_IMAGES,ye),k.isDataTexture||k.isData3DTexture?F.texSubImage3D(Vt,st,fe,Ue,Ke,Bt,ee,se,un,ue,Xe.data):tt.isCompressedArrayTexture?F.compressedTexSubImage3D(Vt,st,fe,Ue,Ke,Bt,ee,se,un,Xe.data):F.texSubImage3D(Vt,st,fe,Ue,Ke,Bt,ee,se,un,ue,Xe),F.pixelStorei(F.UNPACK_ROW_LENGTH,Je),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,xe),F.pixelStorei(F.UNPACK_SKIP_PIXELS,Qe),F.pixelStorei(F.UNPACK_SKIP_ROWS,Ei),F.pixelStorei(F.UNPACK_SKIP_IMAGES,wn),st===0&&tt.generateMipmaps&&F.generateMipmap(Vt),dt.unbindTexture()},this.initRenderTarget=function(k){Rt.get(k).__webglFramebuffer===void 0&&zt.setupRenderTarget(k)},this.initTexture=function(k){k.isCubeTexture?zt.setTextureCube(k,0):k.isData3DTexture?zt.setTexture3D(k,0):k.isDataArrayTexture||k.isCompressedArrayTexture?zt.setTexture2DArray(k,0):zt.setTexture2D(k,0),dt.unbindTexture()},this.resetState=function(){R=0,T=0,C=null,dt.reset(),gt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Z0?"display-p3":"srgb",e.unpackColorSpace=Fe.workingColorSpace===Rf?"display-p3":"srgb"}}class Q0{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ht(t),this.density=e}clone(){return new Q0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class tg{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ht(t),this.near=e,this.far=i}clone(){return new tg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}let y0=class extends Ge{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 jr,this.environmentIntensity=1,this.environmentRotation=new jr,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(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),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};class Df{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Zu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=tr()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Ic("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.stride;rt.far||e.push({distance:l,point:Wh.clone(),uv:Na.getInterpolation(Wh,vp,Xh,Mp,sS,gx,aS,new xt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function wp(n,t,e,i,r,s){Kl.subVectors(n,e).addScalar(.5).multiply(i),r!==void 0?(jh.x=s*Kl.x-r*Kl.y,jh.y=r*Kl.x+s*Kl.y):jh.copy(Kl),n.copy(t),n.x+=jh.x,n.y+=jh.y,n.applyMatrix4(pC)}const bp=new U,oS=new U;class gC extends Ge{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let i=0,r=e.length;i0){let i,r;for(i=1,r=e.length;i0){bp.setFromMatrixPosition(this.matrixWorld);const r=t.ray.origin.distanceTo(bp);this.getObjectForDistance(r).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){bp.setFromMatrixPosition(t.matrixWorld),oS.setFromMatrixPosition(this.matrixWorld);const i=bp.distanceTo(oS)/t.zoom;e[0].object.visible=!0;let r,s;for(r=1,s=e.length;r=a)e[r-1].object.visible=!1,e[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];s.push(a),this.index++,a.start=t.start,a.count=t.count,a.z=e,a.index=i}reset(){this.list.length=0,this.index=0}}const Sa=new de,_x=new de,IB=new de,LB=new Ht(1,1,1),gS=new de,vx=new Lf,Ap=new fi,_o=new Zn,Yh=new U,yS=new U,DB=new U,Mx=new PB,si=new vn,Tp=[];function NB(n,t,e=0){const i=t.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==t.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);e.setIndex(new Pe(s,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in e.attributes){if(!t.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=t.getAttribute(i),s=e.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new fi);const t=this._geometryCount,e=this.boundingBox,i=this._drawInfo;e.makeEmpty();for(let r=0;r=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:t});const e=this._drawInfo.length-1,i=this._matricesTexture,r=i.image.data;IB.toArray(r,e*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(LB.toArray(s.image.data,e*4),s.needsUpdate=!0),e}addGeometry(t,e=-1,i=-1){if(this._initializeGeometry(t),this._validateGeometry(t),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const a=this._reservedRanges,o=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=a[a.length-1]),e===-1?r.vertexCount=t.getAttribute("position").count:r.vertexCount=e,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=t.getIndex(),h=c!==null;if(h&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._geometryCount;return this._geometryCount++,a.push(r),o.push({start:h?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new fi,sphereInitialized:!1,sphere:new Zn}),this.setGeometryAt(u,t),u}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),a=e.getIndex(),o=this._reservedRanges[t];if(r&&a.count>o.indexCount||e.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.vertexCount;for(const m in i.attributes){const g=e.getAttribute(m),_=i.getAttribute(m);NB(g,_,l);const y=g.itemSize;for(let x=g.count,M=c;x=this._geometryCount)return null;const i=this._bounds[t],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const a=s.index,o=s.attributes.position,l=this._drawRanges[t];for(let c=l.start,h=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[t],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(t,Ap),Ap.getCenter(r.center);const a=s.index,o=s.attributes.position,l=this._drawRanges[t];let c=0;for(let h=l.start,u=l.start+l.count;h=i.length||i[t].active===!1?this:(e.toArray(s,t*16),r.needsUpdate=!0,this)}getMatrixAt(t,e){const i=this._drawInfo,r=this._matricesTexture.image.data;return t>=i.length||i[t].active===!1?null:e.fromArray(r,t*16)}setColorAt(t,e){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return t>=s.length||s[t].active===!1?this:(e.toArray(r,t*4),i.needsUpdate=!0,this)}getColorAt(t,e){const i=this._colorsTexture.image.data,r=this._drawInfo;return t>=r.length||r[t].active===!1?null:e.fromArray(i,t*4)}setVisibleAt(t,e){const i=this._drawInfo;return t>=i.length||i[t].active===!1||i[t].visible===e?this:(i[t].visible=e,this._visibilityChanged=!0,this)}getVisibleAt(t){const e=this._drawInfo;return t>=e.length||e[t].active===!1?!1:e[t].visible}raycast(t,e){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,a=this.geometry;si.material=this.material,si.geometry.index=a.index,si.geometry.attributes=a.attributes,si.geometry.boundingBox===null&&(si.geometry.boundingBox=new fi),si.geometry.boundingSphere===null&&(si.geometry.boundingSphere=new Zn);for(let o=0,l=i.length;o({...e})),this._reservedRanges=t._reservedRanges.map(e=>({...e})),this._drawInfo=t._drawInfo.map(e=>({...e})),this._bounds=t._bounds.map(e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()})),this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(t,e,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._drawRanges,p=this.perObjectFrustumCulled,m=this._indirectTexture,g=m.image.data;p&&(gS.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),vx.setFromProjectionMatrix(gS,t.coordinateSystem));let _=0;if(this.sortObjects){_x.copy(this.matrixWorld).invert(),Yh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(_x),yS.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(_x);for(let M=0,b=l.length;M0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;si)return;wx.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(wx);if(!(lt.far))return{distance:l,point:_S.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const vS=new U,MS=new U;class $r extends oa{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[];for(let r=0,s=e.count;r0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,object:a})}}class OB extends Mn{constructor(t,e,i,r,s,a,o,l,c){super(t,e,i,r,s,a,o,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:mn,this.magFilter=s!==void 0?s:mn,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,t.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FB extends Mn{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=Ln,this.minFilter=Ln,this.generateMipmaps=!1,this.needsUpdate=!0}}class ig extends Mn{constructor(t,e,i,r,s,a,o,l,c,h,u,p){super(null,a,o,l,c,h,r,s,u,p),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class UB extends ig{constructor(t,e,i,r,s,a){super(t,e,i,s,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Ki,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class kB extends ig{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,sa),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class xC extends Mn{constructor(t,e,i,r,s,a,o,l,c){super(t,e,i,r,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Yr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,r=this.getPoint(0),s=0;e.push(0);for(let a=1;a<=t;a++)i=this.getPoint(a/t),s+=i.distanceTo(r),e.push(s),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let r=0;const s=i.length;let a;e?a=e:a=t*i[s-1];let o=0,l=s-1,c;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),c=i[r]-a,c<0)o=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===a)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(a-h)/p;return(r+m)/(s-1)}getTangent(t,e){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),o=this.getPoint(s),l=e||(a.isVector2?new xt:new U);return l.copy(o).sub(a).normalize(),l}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new U,r=[],s=[],a=[],o=new U,l=new de;for(let m=0;m<=t;m++){const g=m/t;r[m]=this.getTangentAt(g,new U)}s[0]=new U,a[0]=new U;let c=Number.MAX_VALUE;const h=Math.abs(r[0].x),u=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=c&&(c=h,i.set(1,0,0)),u<=c&&(c=u,i.set(0,1,0)),p<=c&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],o),a[0].crossVectors(r[0],s[0]);for(let m=1;m<=t;m++){if(s[m]=s[m-1].clone(),a[m]=a[m-1].clone(),o.crossVectors(r[m-1],r[m]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(pn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(o,g))}a[m].crossVectors(r[m],s[m])}if(e===!0){let m=Math.acos(pn(s[0].dot(s[t]),-1,1));m/=t,r[0].dot(o.crossVectors(s[0],s[t]))>0&&(m=-m);for(let g=1;g<=t;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],m*g)),a[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class rg extends Yr{constructor(t=0,e=0,i=1,r=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e=new xt){const i=e,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,h;this.closed||o>0?c=r[(o-1)%s]:(Lp.subVectors(r[0],r[1]).add(r[0]),c=Lp);const u=r[o%s],p=r[(o+1)%s];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return i.set(SS(o,l.x,c.x,h.x,u.x),SS(o,l.y,c.y,h.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const a=r[s]-i,o=this.curves[s],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,e)}s++}return null}getLength(){const 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;const t=[];let e=0;for(let i=0,r=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Ff extends ve{constructor(t=[new xt(0,-.5),new xt(.5,0),new xt(0,.5)],e=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=Math.floor(e),r=pn(r,0,Math.PI*2);const s=[],a=[],o=[],l=[],c=[],h=1/e,u=new U,p=new xt,m=new U,g=new U,_=new U;let y=0,x=0;for(let M=0;M<=t.length-1;M++)switch(M){case 0:y=t[M+1].x-t[M].x,x=t[M+1].y-t[M].y,m.x=x*1,m.y=-y,m.z=x*0,_.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case t.length-1:l.push(_.x,_.y,_.z);break;default:y=t[M+1].x-t[M].x,x=t[M+1].y-t[M].y,m.x=x*1,m.y=-y,m.z=x*0,g.copy(m),m.x+=_.x,m.y+=_.y,m.z+=_.z,m.normalize(),l.push(m.x,m.y,m.z),_.copy(g)}for(let M=0;M<=e;M++){const b=i+M*h*r,S=Math.sin(b),R=Math.cos(b);for(let T=0;T<=t.length-1;T++){u.x=t[T].x*S,u.y=t[T].y,u.z=t[T].x*R,a.push(u.x,u.y,u.z),p.x=M/e,p.y=T/(t.length-1),o.push(p.x,p.y);const C=l[3*T+0]*S,N=l[3*T+1],P=l[3*T+0]*R;c.push(C,N,P)}}for(let M=0;M0&&b(!0),e>0&&b(!1)),this.setIndex(h),this.setAttribute("position",new ae(u,3)),this.setAttribute("normal",new ae(p,3)),this.setAttribute("uv",new ae(m,2));function M(){const S=new U,R=new U;let T=0;const C=(e-t)/i;for(let N=0;N<=s;N++){const P=[],E=N/s,L=E*(e-t)+t;for(let B=0;B<=r;B++){const V=B/r,j=V*l+o,Y=Math.sin(j),q=Math.cos(j);R.x=L*Y,R.y=-E*i+y,R.z=L*q,u.push(R.x,R.y,R.z),S.set(Y,C,q).normalize(),p.push(S.x,S.y,S.z),m.push(V,1-E),P.push(g++)}_.push(P)}for(let N=0;N.9&&C<.1&&(b<.2&&(a[M+0]+=1),S<.2&&(a[M+2]+=1),R<.2&&(a[M+4]+=1))}}function p(M){s.push(M.x,M.y,M.z)}function m(M,b){const S=M*3;b.x=t[S+0],b.y=t[S+1],b.z=t[S+2]}function g(){const M=new U,b=new U,S=new U,R=new U,T=new xt,C=new xt,N=new xt;for(let P=0,E=0;P80*e){o=c=n[0],l=h=n[1];for(let g=e;gc&&(c=u),p>h&&(h=p);m=Math.max(c-o,h-l),m=m!==0?32767/m:0}return tf(s,a,e,o,l,m,0),a}};function EC(n,t,e,i,r){let s,a;if(r===l4(n,t,e,i)>0)for(s=t;s=t;s-=i)a=ES(s,n[s],n[s+1],a);return a&&cg(a,a.next)&&(nf(a),a=a.next),a}function tl(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(cg(e,e.next)||hn(e.prev,e,e.next)===0)){if(nf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function tf(n,t,e,i,r,s,a){if(!n)return;!a&&s&&n4(n,i,r,s);let o=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?$B(n,i,r,s):qB(n)){t.push(l.i/e|0),t.push(n.i/e|0),t.push(c.i/e|0),nf(n),n=c.next,o=c.next;continue}if(n=c,n===o){a?a===1?(n=YB(tl(n),t,e),tf(n,t,e,i,r,s,2)):a===2&&ZB(n,t,e,i,r,s):tf(tl(n),t,e,i,r,s,1);break}}}function qB(n){const t=n.prev,e=n,i=n.next;if(hn(t,e,i)>=0)return!1;const r=t.x,s=e.x,a=i.x,o=t.y,l=e.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,m=o>l?o>c?o:c:l>c?l:c;let g=i.next;for(;g!==t;){if(g.x>=h&&g.x<=p&&g.y>=u&&g.y<=m&&bc(r,o,s,l,a,c,g.x,g.y)&&hn(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function $B(n,t,e,i){const r=n.prev,s=n,a=n.next;if(hn(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,p=a.y,m=ol?o>c?o:c:l>c?l:c,y=h>u?h>p?h:p:u>p?u:p,x=Y_(m,g,t,e,i),M=Y_(_,y,t,e,i);let b=n.prevZ,S=n.nextZ;for(;b&&b.z>=x&&S&&S.z<=M;){if(b.x>=m&&b.x<=_&&b.y>=g&&b.y<=y&&b!==r&&b!==a&&bc(o,h,l,u,c,p,b.x,b.y)&&hn(b.prev,b,b.next)>=0||(b=b.prevZ,S.x>=m&&S.x<=_&&S.y>=g&&S.y<=y&&S!==r&&S!==a&&bc(o,h,l,u,c,p,S.x,S.y)&&hn(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;b&&b.z>=x;){if(b.x>=m&&b.x<=_&&b.y>=g&&b.y<=y&&b!==r&&b!==a&&bc(o,h,l,u,c,p,b.x,b.y)&&hn(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=M;){if(S.x>=m&&S.x<=_&&S.y>=g&&S.y<=y&&S!==r&&S!==a&&bc(o,h,l,u,c,p,S.x,S.y)&&hn(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function YB(n,t,e){let i=n;do{const r=i.prev,s=i.next.next;!cg(r,s)&&AC(r,i,i.next,s)&&ef(r,s)&&ef(s,r)&&(t.push(r.i/e|0),t.push(i.i/e|0),t.push(s.i/e|0),nf(i),nf(i.next),i=n=s),i=i.next}while(i!==n);return tl(i)}function ZB(n,t,e,i,r,s){let a=n;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&s4(a,o)){let l=TC(a,o);a=tl(a,a.next),l=tl(l,l.next),tf(a,t,e,i,r,s,0),tf(l,t,e,i,r,s,0);return}o=o.next}a=a.next}while(a!==n)}function KB(n,t,e,i){const r=[];let s,a,o,l,c;for(s=0,a=t.length;s=e.next.y&&e.next.y!==e.y){const p=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(p<=s&&p>i&&(i=p,r=e.x=e.x&&e.x>=l&&s!==e.x&&bc(ar.x||e.x===r.x&&e4(r,e)))&&(r=e,h=u)),e=e.next;while(e!==o);return r}function e4(n,t){return hn(n.prev,n,t.prev)<0&&hn(t.next,n,n.next)<0}function n4(n,t,e,i){let r=n;do r.z===0&&(r.z=Y_(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,i4(r)}function i4(n){let t,e,i,r,s,a,o,l,c=1;do{for(e=n,n=null,s=null,a=0;e;){for(a++,i=e,o=0,t=0;t0||l>0&&i;)o!==0&&(l===0||!i||e.z<=i.z)?(r=e,e=e.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;e=i}s.nextZ=null,c*=2}while(a>1);return n}function Y_(n,t,e,i,r){return n=(n-e)*r|0,t=(t-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function r4(n){let t=n,e=n;do(t.x=(n-a)*(s-o)&&(n-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(s-o)>=(r-a)*(i-o)}function s4(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!a4(n,t)&&(ef(n,t)&&ef(t,n)&&o4(n,t)&&(hn(n.prev,n,t.prev)||hn(n,t.prev,t))||cg(n,t)&&hn(n.prev,n,n.next)>0&&hn(t.prev,t,t.next)>0)}function hn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function cg(n,t){return n.x===t.x&&n.y===t.y}function AC(n,t,e,i){const r=Up(hn(n,t,e)),s=Up(hn(n,t,i)),a=Up(hn(e,i,n)),o=Up(hn(e,i,t));return!!(r!==s&&a!==o||r===0&&Fp(n,e,t)||s===0&&Fp(n,i,t)||a===0&&Fp(e,n,i)||o===0&&Fp(e,t,i))}function Fp(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Up(n){return n>0?1:n<0?-1:0}function a4(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&AC(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function ef(n,t){return hn(n.prev,n,n.next)<0?hn(n,t,n.next)>=0&&hn(n,n.prev,t)>=0:hn(n,t,n.prev)<0||hn(n,n.next,t)<0}function o4(n,t){let e=n,i=!1;const r=(n.x+t.x)/2,s=(n.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function TC(n,t){const e=new Z_(n.i,n.x,n.y),i=new Z_(t.i,t.x,t.y),r=n.next,s=t.prev;return n.next=t,t.prev=n,e.next=r,r.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function ES(n,t,e,i){const r=new Z_(n,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function nf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Z_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function l4(n,t,e,i){let r=0;for(let s=t,a=e-i;s2&&n[t-1].equals(n[0])&&n.pop()}function TS(n,t){for(let e=0;eNumber.EPSILON){const Et=Math.sqrt(ot),Tt=Math.sqrt(z*z+O*O),ne=wt.x-zt/Et,Ft=wt.y+Rt/Et,Wt=bt.x-O/Tt,ge=bt.y+z/Tt,Dt=((Wt-ne)*O-(ge-Ft)*z)/(Rt*O-zt*z);mt=ne+Rt*Dt-F.x,dt=Ft+zt*Dt-F.y;const $t=mt*mt+dt*dt;if($t<=2)return new xt(mt,dt);kt=Math.sqrt($t/2)}else{let Et=!1;Rt>Number.EPSILON?z>Number.EPSILON&&(Et=!0):Rt<-Number.EPSILON?z<-Number.EPSILON&&(Et=!0):Math.sign(zt)===Math.sign(O)&&(Et=!0),Et?(mt=-zt,dt=Rt,kt=Math.sqrt(ot)):(mt=Rt,dt=zt,kt=Math.sqrt(ot/2))}return new xt(mt/kt,dt/kt)}const nt=[];for(let F=0,wt=j.length,bt=wt-1,mt=F+1;F=0;F--){const wt=F/y,bt=m*Math.cos(wt*Math.PI/2),mt=g*Math.sin(wt*Math.PI/2)+_;for(let dt=0,kt=j.length;dt=0;){const mt=bt;let dt=bt-1;dt<0&&(dt=F.length-1);for(let kt=0,Rt=h+y*2;kt0)&&m.push(b,S,T),(x!==i-1||l0!=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 IC extends Rn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ht(16777215),this.specular=new Ht(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.combine=Tf,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 LC extends Rn{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ht(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(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 DC extends Rn{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(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 zf extends Rn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.combine=Tf,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 NC extends Rn{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ht(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.flatShading=t.flatShading,this.fog=t.fog,this}}class OC extends Kn{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 zo(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function FC(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function UC(n){function t(r,s){return n[r]-n[s]}const e=n.length,i=new Array(e);for(let r=0;r!==e;++r)i[r]=r;return i.sort(t),i}function K_(n,t,e){const i=n.length,r=new n.constructor(i);for(let s=0,a=0;a!==i;++s){const o=e[s]*t;for(let l=0;l!==t;++l)r[a++]=n[o+l]}return r}function v1(n,t,e,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let a=s[i];if(a!==void 0)if(Array.isArray(a))do a=s[i],a!==void 0&&(t.push(s.time),e.push.apply(e,a)),s=n[r++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[i],a!==void 0&&(t.push(s.time),a.toArray(e,e.length)),s=n[r++];while(s!==void 0);else do a=s[i],a!==void 0&&(t.push(s.time),e.push(a)),s=n[r++];while(s!==void 0)}function f4(n,t,e,i,r=30){const s=n.clone();s.name=t;const a=[];for(let l=0;l=i)){u.push(c.times[m]);for(let _=0;_s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l=o.times[g]){const x=g*u+h,M=x+u-h;_=o.values.slice(x,M)}else{const x=o.createInterpolant(),M=h,b=u-h;x.evaluate(s),_=x.resultBuffer.slice(M,b)}l==="quaternion"&&new Cn().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let x=0;x=s)){const o=e[1];t=s)break e}a=i,i=0;break n}break t}for(;i>>1;te;)--a;if(++a,s!==0||a!==r){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=i.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){const l=i[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(r!==void 0&&FC(r))for(let o=0,l=r.length;o!==l;++o){const c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Tm,s=t.length-1;let a=1;for(let o=1;o0){t[a]=t[s];for(let o=s*i,l=a*i,c=0;c!==i;++c)e[l+c]=e[o+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),i=this.constructor,r=new i(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}Zr.prototype.TimeBufferType=Float32Array;Zr.prototype.ValueBufferType=Float32Array;Zr.prototype.DefaultInterpolation=Xc;class cl extends Zr{constructor(t,e,i){super(t,e,i)}}cl.prototype.ValueTypeName="bool";cl.prototype.ValueBufferType=Array;cl.prototype.DefaultInterpolation=jc;cl.prototype.InterpolantFactoryMethodLinear=void 0;cl.prototype.InterpolantFactoryMethodSmooth=void 0;class w1 extends Zr{}w1.prototype.ValueTypeName="color";class el extends Zr{}el.prototype.ValueTypeName="number";class BC extends fh{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-e)/(r-e);let c=t*o;for(let h=c+o;c!==h;c+=4)Cn.slerpFlat(s,0,a,c-o,a,c,l);return s}}class nl extends Zr{InterpolantFactoryMethodLinear(t){return new BC(this.times,this.values,this.getValueSize(),t)}}nl.prototype.ValueTypeName="quaternion";nl.prototype.InterpolantFactoryMethodSmooth=void 0;class hl extends Zr{constructor(t,e,i){super(t,e,i)}}hl.prototype.ValueTypeName="string";hl.prototype.ValueBufferType=Array;hl.prototype.DefaultInterpolation=jc;hl.prototype.InterpolantFactoryMethodLinear=void 0;hl.prototype.InterpolantFactoryMethodSmooth=void 0;class il extends Zr{}il.prototype.ValueTypeName="vector";class Yc{constructor(t="",e=-1,i=[],r=Y0){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=tr(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,r=1/(t.fps||1);for(let a=0,o=i.length;a!==o;++a)e.push(g4(i[a]).scale(r));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let s=0,a=i.length;s!==a;++s)e.push(Zr.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(t,e,i,r){const s=e.length,a=[];for(let o=0;o1){const u=h[1];let p=r[u];p||(r[u]=p=[]),p.push(c)}}const a=[];for(const o in r)a.push(this.CreateFromMorphTargetSequence(o,r[o],e,i));return a}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(u,p,m,g,_){if(m.length!==0){const y=[],x=[];v1(m,y,x,g),y.length!==0&&_.push(new u(p,y,x))}},r=[],s=t.name||"default",a=t.fps||30,o=t.blendMode;let l=t.length||-1;const c=t.hierarchy||[];for(let u=0;u{e&&e(s),this.manager.itemEnd(t)},0),s;if(Bs[t]!==void 0){Bs[t].push({onLoad:e,onProgress:i,onError:r});return}Bs[t]=[],Bs[t].push({onLoad:e,onProgress:i,onError:r});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=Bs[t],u=c.body.getReader(),p=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=p?parseInt(p):0,g=m!==0;let _=0;const y=new ReadableStream({start(x){M();function M(){u.read().then(({done:b,value:S})=>{if(b)x.close();else{_+=S.byteLength;const R=new ProgressEvent("progress",{lengthComputable:g,loaded:_,total:m});for(let T=0,C=h.length;T{x.error(b)})}}});return new Response(y)}else throw new y4(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),p=u&&u[1]?u[1].toLowerCase():void 0,m=new TextDecoder(p);return c.arrayBuffer().then(g=>m.decode(g))}}}).then(c=>{ta.add(t,c);const h=Bs[t];delete Bs[t];for(let u=0,p=h.length;u{const h=Bs[t];if(h===void 0)throw this.manager.itemError(t),c;delete Bs[t];for(let u=0,p=h.length;u{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class x4 extends di{constructor(t){super(t)}load(t,e,i,r){const s=this,a=new nr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(s.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),s.manager.itemError(t)}},i,r)}parse(t){const e=[];for(let i=0;i0:r.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const s in t.uniforms){const a=t.uniforms[s];switch(r.uniforms[s]={},a.type){case"t":r.uniforms[s].value=i(a.value);break;case"c":r.uniforms[s].value=new Ht().setHex(a.value);break;case"v2":r.uniforms[s].value=new xt().fromArray(a.value);break;case"v3":r.uniforms[s].value=new U().fromArray(a.value);break;case"v4":r.uniforms[s].value=new je().fromArray(a.value);break;case"m3":r.uniforms[s].value=new Re().fromArray(a.value);break;case"m4":r.uniforms[s].value=new de().fromArray(a.value);break;default:r.uniforms[s].value=a.value}}if(t.defines!==void 0&&(r.defines=t.defines),t.vertexShader!==void 0&&(r.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(r.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(r.glslVersion=t.glslVersion),t.extensions!==void 0)for(const s in t.extensions)r.extensions[s]=t.extensions[s];if(t.lights!==void 0&&(r.lights=t.lights),t.clipping!==void 0&&(r.clipping=t.clipping),t.size!==void 0&&(r.size=t.size),t.sizeAttenuation!==void 0&&(r.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(r.map=i(t.map)),t.matcap!==void 0&&(r.matcap=i(t.matcap)),t.alphaMap!==void 0&&(r.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(r.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(r.bumpScale=t.bumpScale),t.normalMap!==void 0&&(r.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(r.normalMapType=t.normalMapType),t.normalScale!==void 0){let s=t.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new xt().fromArray(s)}return t.displacementMap!==void 0&&(r.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(r.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(r.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(r.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(r.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(r.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(r.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(r.specularMap=i(t.specularMap)),t.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(t.specularIntensityMap)),t.specularColorMap!==void 0&&(r.specularColorMap=i(t.specularColorMap)),t.envMap!==void 0&&(r.envMap=i(t.envMap)),t.envMapRotation!==void 0&&r.envMapRotation.fromArray(t.envMapRotation),t.envMapIntensity!==void 0&&(r.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(r.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(r.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(r.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(r.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(r.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(r.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(r.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(r.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new xt().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(r.iridescenceMap=i(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(r.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(r.thicknessMap=i(t.thicknessMap)),t.anisotropyMap!==void 0&&(r.anisotropyMap=i(t.anisotropyMap)),t.sheenColorMap!==void 0&&(r.sheenColorMap=i(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(t.sheenRoughnessMap)),r}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){const e={ShadowMaterial:RC,SpriteMaterial:eg,RawShaderMaterial:PC,ShaderMaterial:Xr,PointsMaterial:Of,MeshPhysicalMaterial:Sr,MeshStandardMaterial:uh,MeshPhongMaterial:IC,MeshToonMaterial:LC,MeshNormalMaterial:DC,MeshLambertMaterial:zf,MeshDepthMaterial:l1,MeshDistanceMaterial:c1,MeshBasicMaterial:Ji,MeshMatcapMaterial:NC,LineDashedMaterial:OC,LineBasicMaterial:Kn,Material:Rn};return new e[t]}}class Ua{static decodeText(t){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let i=0,r=t.length;i0){const l=new b1(e);s=new rf(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,h=t.length;c0){r=new rf(this.manager),r.setCrossOrigin(this.crossOrigin);for(let a=0,o=t.length;a{const y=new fi;y.min.fromArray(_.boxMin),y.max.fromArray(_.boxMax);const x=new Zn;return x.radius=_.sphereRadius,x.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:y,sphereInitialized:_.sphereInitialized,sphere:x}}),a._maxInstanceCount=t.maxInstanceCount,a._maxVertexCount=t.maxVertexCount,a._maxIndexCount=t.maxIndexCount,a._geometryInitialized=t.geometryInitialized,a._geometryCount=t.geometryCount,a._matricesTexture=c(t.matricesTexture.uuid),t.colorsTexture!==void 0&&(a._colorsTexture=c(t.colorsTexture.uuid));break;case"LOD":a=new gC;break;case"Line":a=new oa(o(t.geometry),l(t.material));break;case"LineLoop":a=new f1(o(t.geometry),l(t.material));break;case"LineSegments":a=new $r(o(t.geometry),l(t.material));break;case"PointCloud":case"Points":a=new d1(o(t.geometry),l(t.material));break;case"Sprite":a=new mC(l(t.material));break;case"Group":a=new Qs;break;case"Bone":a=new ng;break;default:a=new Ge}if(a.uuid=t.uuid,t.name!==void 0&&(a.name=t.name),t.matrix!==void 0?(a.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=t.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(t.position!==void 0&&a.position.fromArray(t.position),t.rotation!==void 0&&a.rotation.fromArray(t.rotation),t.quaternion!==void 0&&a.quaternion.fromArray(t.quaternion),t.scale!==void 0&&a.scale.fromArray(t.scale)),t.up!==void 0&&a.up.fromArray(t.up),t.castShadow!==void 0&&(a.castShadow=t.castShadow),t.receiveShadow!==void 0&&(a.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.intensity!==void 0&&(a.shadow.intensity=t.shadow.intensity),t.shadow.bias!==void 0&&(a.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(a.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(a.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(a.visible=t.visible),t.frustumCulled!==void 0&&(a.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(a.renderOrder=t.renderOrder),t.userData!==void 0&&(a.userData=t.userData),t.layers!==void 0&&(a.layers.mask=t.layers),t.children!==void 0){const p=t.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,a=ta.get(t);if(a!==void 0){if(s.manager.itemStart(t),a.then){a.then(c=>{e&&e(c),s.manager.itemEnd(t)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(t,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return ta.add(t,c),e&&e(c),s.manager.itemEnd(t),c}).catch(function(c){r&&r(c),ta.remove(t),s.manager.itemError(t),s.manager.itemEnd(t)});ta.add(t,l),s.manager.itemStart(t)}}let kp;class R1{static getContext(){return kp===void 0&&(kp=new(window.AudioContext||window.webkitAudioContext)),kp}static setContext(t){kp=t}}class T4 extends di{constructor(t){super(t)}load(t,e,i,r){const s=this,a=new nr(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(l){try{const c=l.slice(0);R1.getContext().decodeAudioData(c,function(u){e(u)}).catch(o)}catch(c){o(c)}},i,r);function o(l){r?r(l):console.error(l),s.manager.itemError(t)}}}const OS=new de,FS=new de,vo=new de;class C4{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new cn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new cn,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){const 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){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,vo.copy(t.projectionMatrix);const r=e.eyeSep/2,s=r*e.near/e.focus,a=e.near*Math.tan(Xo*e.fov*.5)/e.zoom;let o,l;FS.elements[12]=-r,OS.elements[12]=r,o=-a*e.aspect+s,l=a*e.aspect+s,vo.elements[0]=2*e.near/(l-o),vo.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(vo),o=-a*e.aspect-s,l=a*e.aspect-s,vo.elements[0]=2*e.near/(l-o),vo.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(vo)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(FS),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(OS)}}class P1{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=US(),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){const e=US();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function US(){return(typeof performance>"u"?Date:performance).now()}const Mo=new U,kS=new Cn,R4=new U,wo=new U;class P4 extends Ge{constructor(){super(),this.type="AudioListener",this.context=R1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new P1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(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 this.filter!==null?(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);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Mo,kS,R4),wo.set(0,0,-1).applyQuaternion(kS),e.positionX){const r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Mo.x,r),e.positionY.linearRampToValueAtTime(Mo.y,r),e.positionZ.linearRampToValueAtTime(Mo.z,r),e.forwardX.linearRampToValueAtTime(wo.x,r),e.forwardY.linearRampToValueAtTime(wo.y,r),e.forwardZ.linearRampToValueAtTime(wo.z,r),e.upX.linearRampToValueAtTime(i.x,r),e.upY.linearRampToValueAtTime(i.y,r),e.upZ.linearRampToValueAtTime(i.z,r)}else e.setPosition(Mo.x,Mo.y,Mo.z),e.setOrientation(wo.x,wo.y,wo.z,i.x,i.y,i.z)}}class ZC extends Ge{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(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+t;const 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(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),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,r,this._addIndex*e,1,e);for(let l=e,c=e+e;l!==c;++l)if(i[l]!==i[l+e]){o.setValue(i,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,r=i*this._origIndex;t.getValue(e,r);for(let s=i,a=r;s!==a;++s)e[s]=e[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let a=0;a!==s;++a)t[e+a]=t[i+a]}_slerp(t,e,i,r){Cn.slerpFlat(t,e,t,e,t,i,r)}_slerpAdditive(t,e,i,r,s){const a=this._workIndex*s;Cn.multiplyQuaternionsFlat(t,a,t,e,t,i),Cn.slerpFlat(t,e,t,e,t,a,r)}_lerp(t,e,i,r,s){const a=1-r;for(let o=0;o!==s;++o){const l=e+o;t[l]=t[l]*a+t[i+o]*r}}_lerpAdditive(t,e,i,r,s){for(let a=0;a!==s;++a){const o=e+a;t[o]=t[o]+t[i+a]*r}}}const I1="\\[\\]\\.:\\/",N4=new RegExp("["+I1+"]","g"),L1="[^"+I1+"]",O4="[^"+I1.replace("\\.","")+"]",F4=/((?:WC+[\/:])*)/.source.replace("WC",L1),U4=/(WCOD+)?/.source.replace("WCOD",O4),k4=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",L1),z4=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",L1),B4=new RegExp("^"+F4+U4+k4+z4+"$"),H4=["material","materials","bones","map"];class G4{constructor(t,e,i){const r=i||Oe.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class Oe{constructor(t,e,i){this.path=e,this.parsedPath=i||Oe.parseTrackName(e),this.node=Oe.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 Oe.Composite(t,e,i):new Oe(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(N4,"")}static parseTrackName(t){const e=B4.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);H4.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){const i=function(s){for(let a=0;a=s){const u=s++,p=t[u];e[p.uuid]=h,t[h]=p,e[c]=u,t[u]=l;for(let m=0,g=r;m!==g;++m){const _=i[m],y=_[u],x=_[h];_[h]=y,_[u]=x}}}this.nCachedObjects_=s}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,a=t.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],h=c.uuid,u=e[h];if(u!==void 0)if(delete e[h],u0&&(e[m.uuid]=u),t[u]=m,t.pop();for(let g=0,_=r;g!==_;++g){const y=i[g];y[u]=y[p],y.pop()}}}this.nCachedObjects_=s}subscribe_(t,e){const i=this._bindingsIndicesByPath;let r=i[t];const s=this._bindings;if(r!==void 0)return s[r];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);r=s.length,i[t]=r,a.push(t),o.push(e),s.push(u);for(let p=h,m=l.length;p!==m;++p){const g=l[p];u[p]=new Oe(g,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(i!==void 0){const r=this._paths,s=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=t[o];e[c]=i,a[i]=l,a.pop(),s[i]=s[o],s.pop(),r[i]=r[o],r.pop()}}}class JC{constructor(t,e,i=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=r;const s=e.tracks,a=s.length,o=new Array(a),l={endingStart:Fo,endingEnd:Fo};for(let c=0;c!==a;++c){const h=s[c].createInterpolant(null);o[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=D2,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&&this.timeScale!==0&&this._startTime===null&&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){if(t.fadeOut(e),this.fadeIn(e),i){const r=this._clip.duration,s=t._clip.duration,a=s/r,o=r/s;t.warp(1,a,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return t!==null&&(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){const r=this._mixer,s=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=s,l[1]=s+i,c[0]=t/a,c[1]=e/a,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(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,r){if(!this.enabled){this._updateWeight(t);return}const s=this._startTime;if(s!==null){const l=(t-s)*i;l<0||i===0?e=0:(this._startTime=null,e=i*l)}e*=this._updateTimeScale(t);const a=this._updateTime(e),o=this._updateWeight(t);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Jv:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulateAdditive(o);break;case Y0:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(r,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let r=this.time+t,s=this._loopCount;const a=i===N2;if(t===0)return s===-1?r:a&&(s&1)===1?e-r:r;if(i===L2){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else if(r<0)r=0;else{this.time=r;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(s===-1&&(t>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=e||r<0){const o=Math.floor(r/e);r-=e*o,s+=Math.abs(o);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(a&&(s&1)===1)return e-r}return r}_setEndings(t,e,i){const r=this._interpolantSettings;i?(r.endingStart=Uo,r.endingEnd=Uo):(t?r.endingStart=this.zeroSlopeAtStart?Uo:Fo:r.endingStart=Xu,e?r.endingEnd=this.zeroSlopeAtEnd?Uo:Fo:r.endingEnd=Xu)}_scheduleFading(t,e,i){const r=this._mixer,s=r.time;let a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,l[0]=e,o[1]=s+t,l[1]=i,this}}const W4=new Float32Array(1);class j4 extends qr{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,r=t._clip.tracks,s=r.length,a=t._propertyBindings,o=t._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){const p=r[u],m=p.name;let g=h[m];if(g!==void 0)++g.referenceCount,a[u]=g;else{if(g=a[u],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const _=e&&e._propertyBindings[u].binding.parsedPath;g=new KC(Oe.create(i,m,_),p.ValueTypeName,p.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),a[u]=g}o[u].resultBuffer=g.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const i=(t._localRoot||this._root).uuid,r=t._clip.uuid,s=this._actionsByClip[r];this._bindAction(t,s&&s.knownActions[0]),this._addInactiveAction(t,r,i)}const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const s=e[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const s=e[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const 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){const e=t._cacheIndex;return e!==null&&e=0;--i)t[i].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,r=this.time+=t,s=Math.sign(t),a=this._accuIndex^=1;for(let c=0;c!==i;++c)e[c]._update(r,t,s,a);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(a);return this}setTime(t){this.time=0;for(let e=0;e=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,GS).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)}}const VS=new U,zp=new U;class J4{constructor(t=new U,e=new U){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){VS.subVectors(t,this.start),zp.subVectors(this.end,this.start);const i=zp.dot(zp);let s=zp.dot(VS)/i;return e&&(s=pn(s,0,1)),s}closestPointToPoint(t,e,i){const r=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(r).add(this.start)}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)}}const WS=new U;class Q4 extends Ge{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new ve,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,l=32;a1)for(let u=0;u.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{YS.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(YS,e)}}setLength(t,e=t*.2,i=e*.2){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 f5 extends $r{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ve;r.setAttribute("position",new ae(e,3)),r.setAttribute("color",new ae(i,3));const s=new Kn({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(t,e,i){const r=new Ht,s=this.geometry.attributes.color.array;return r.set(t),r.toArray(s,0),r.toArray(s,3),r.set(e),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class d5{constructor(){this.type="ShapePath",this.color=new Ht,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Qu,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,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.currentPath.bezierCurveTo(t,e,i,r,s,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(x){const M=[];for(let b=0,S=x.length;bNumber.EPSILON){if(E<0&&(C=M[T],P=-P,N=M[R],E=-E),x.yN.y)continue;if(x.y===C.y){if(x.x===C.x)return!0}else{const L=E*(x.x-C.x)-P*(x.y-C.y);if(L===0)return!0;if(L<0)continue;S=!S}}else{if(x.y!==C.y)continue;if(N.x<=x.x&&x.x<=C.x||C.x<=x.x&&x.x<=N.x)return!0}}return S}const r=ws.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,l;const c=[];if(s.length===1)return o=s[0],l=new $o,l.curves=o.curves,c.push(l),c;let h=!r(s[0].getPoints());h=t?!h:h;const u=[],p=[];let m=[],g=0,_;p[g]=void 0,m[g]=[];for(let x=0,M=s.length;x1){let x=!1,M=0;for(let b=0,S=p.length;b0&&x===!1&&(m=u)}let y;for(let x=0,M=p.length;x{const{t}=sh(),e=3,[i,r]=Q.useState(0);return Q.useEffect(()=>{const s=Math.floor(Math.random()*e)+1;r(s)},[]),X.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%"},children:[X.jsx("p",{style:{margin:"20px"},children:t("loadingMessage.tip"+i.toString())}),X.jsx("div",{style:{width:"80%",maxWidth:"600px",margin:"0 auto"},children:X.jsx(BT,{value:n,width:"100%",hasStripe:!0})})]})};/** +}`;class vB{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){const r=new Mn,s=t.properties.get(r);s.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,i=new Xr({vertexShader:xB,fragmentShader:_B,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new vn(new lh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class MB extends qr{constructor(t,e){super();const i=this;let r=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,p=null,m=null,g=null;const _=new vB,y=e.getContextAttributes();let x=null,M=null;const b=[],S=[],R=new xt;let C=null;const T=new cn;T.layers.enable(1),T.viewport=new je;const N=new cn;N.layers.enable(2),N.viewport=new je;const P=[T,N],E=new fC;E.layers.enable(1),E.layers.enable(2);let L=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let rt=b[Z];return rt===void 0&&(rt=new mx,b[Z]=rt),rt.getTargetRaySpace()},this.getControllerGrip=function(Z){let rt=b[Z];return rt===void 0&&(rt=new mx,b[Z]=rt),rt.getGripSpace()},this.getHand=function(Z){let rt=b[Z];return rt===void 0&&(rt=new mx,b[Z]=rt),rt.getHandSpace()};function V(Z){const rt=S.indexOf(Z.inputSource);if(rt===-1)return;const St=b[rt];St!==void 0&&(St.update(Z.inputSource,Z.frame,c||a),St.dispatchEvent({type:Z.type,data:Z.inputSource}))}function j(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",j),r.removeEventListener("inputsourceschange",Y);for(let Z=0;Z=0&&(S[_t]=null,b[_t].disconnect(St))}for(let rt=0;rt=S.length){S.push(St),_t=Xt;break}else if(S[Xt]===null){S[Xt]=St,_t=Xt;break}if(_t===-1)break}const Ot=b[_t];Ot&&Ot.connect(St)}}const q=new U,at=new U;function G(Z,rt,St){q.setFromMatrixPosition(rt.matrixWorld),at.setFromMatrixPosition(St.matrixWorld);const _t=q.distanceTo(at),Ot=rt.projectionMatrix.elements,Xt=St.projectionMatrix.elements,Gt=Ot[14]/(Ot[10]-1),Qt=Ot[14]/(Ot[10]+1),F=(Ot[9]+1)/Ot[5],wt=(Ot[9]-1)/Ot[5],bt=(Ot[8]-1)/Ot[0],mt=(Xt[8]+1)/Xt[0],dt=Gt*bt,kt=Gt*mt,Rt=_t/(-bt+mt),zt=Rt*-bt;rt.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(zt),Z.translateZ(Rt),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const z=Gt+Rt,O=Qt+Rt,ot=dt-zt,At=kt+(_t-zt),Et=F*Qt/O*z,Tt=wt*Qt/O*z;Z.projectionMatrix.makePerspective(ot,At,Et,Tt,z,O),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function tt(Z,rt){rt===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(rt.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(r===null)return;_.texture!==null&&(Z.near=_.depthNear,Z.far=_.depthFar),E.near=N.near=T.near=Z.near,E.far=N.far=T.far=Z.far,(L!==E.near||B!==E.far)&&(r.updateRenderState({depthNear:E.near,depthFar:E.far}),L=E.near,B=E.far,T.near=L,T.far=B,N.near=L,N.far=B,T.updateProjectionMatrix(),N.updateProjectionMatrix(),Z.updateProjectionMatrix());const rt=Z.parent,St=E.cameras;tt(E,rt);for(let _t=0;_t0&&(y.alphaTest.value=x.alphaTest);const M=t.get(x),b=M.envMap,S=M.envMapRotation;b&&(y.envMap.value=b,xo.copy(S),xo.x*=-1,xo.y*=-1,xo.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(xo.y*=-1,xo.z*=-1),y.envMapRotation.value.setFromMatrix4(wB.makeRotationFromEuler(xo)),y.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=x.reflectivity,y.ior.value=x.ior,y.refractionRatio.value=x.refractionRatio),x.lightMap&&(y.lightMap.value=x.lightMap,y.lightMapIntensity.value=x.lightMapIntensity,e(x.lightMap,y.lightMapTransform)),x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity,e(x.aoMap,y.aoMapTransform))}function a(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,x.map&&(y.map.value=x.map,e(x.map,y.mapTransform))}function o(y,x){y.dashSize.value=x.dashSize,y.totalSize.value=x.dashSize+x.gapSize,y.scale.value=x.scale}function l(y,x,M,b){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*M,y.scale.value=b*.5,x.map&&(y.map.value=x.map,e(x.map,y.uvTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,e(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function c(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.rotation.value=x.rotation,x.map&&(y.map.value=x.map,e(x.map,y.mapTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,e(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function h(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function u(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function p(y,x){y.metalness.value=x.metalness,x.metalnessMap&&(y.metalnessMap.value=x.metalnessMap,e(x.metalnessMap,y.metalnessMapTransform)),y.roughness.value=x.roughness,x.roughnessMap&&(y.roughnessMap.value=x.roughnessMap,e(x.roughnessMap,y.roughnessMapTransform)),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)}function m(y,x,M){y.ior.value=x.ior,x.sheen>0&&(y.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),y.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(y.sheenColorMap.value=x.sheenColorMap,e(x.sheenColorMap,y.sheenColorMapTransform)),x.sheenRoughnessMap&&(y.sheenRoughnessMap.value=x.sheenRoughnessMap,e(x.sheenRoughnessMap,y.sheenRoughnessMapTransform))),x.clearcoat>0&&(y.clearcoat.value=x.clearcoat,y.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(y.clearcoatMap.value=x.clearcoatMap,e(x.clearcoatMap,y.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,e(x.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(y.clearcoatNormalMap.value=x.clearcoatNormalMap,e(x.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===wi&&y.clearcoatNormalScale.value.negate())),x.dispersion>0&&(y.dispersion.value=x.dispersion),x.iridescence>0&&(y.iridescence.value=x.iridescence,y.iridescenceIOR.value=x.iridescenceIOR,y.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(y.iridescenceMap.value=x.iridescenceMap,e(x.iridescenceMap,y.iridescenceMapTransform)),x.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=x.iridescenceThicknessMap,e(x.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),x.transmission>0&&(y.transmission.value=x.transmission,y.transmissionSamplerMap.value=M.texture,y.transmissionSamplerSize.value.set(M.width,M.height),x.transmissionMap&&(y.transmissionMap.value=x.transmissionMap,e(x.transmissionMap,y.transmissionMapTransform)),y.thickness.value=x.thickness,x.thicknessMap&&(y.thicknessMap.value=x.thicknessMap,e(x.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=x.attenuationDistance,y.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(y.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(y.anisotropyMap.value=x.anisotropyMap,e(x.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=x.specularIntensity,y.specularColor.value.copy(x.specularColor),x.specularColorMap&&(y.specularColorMap.value=x.specularColorMap,e(x.specularColorMap,y.specularColorMapTransform)),x.specularIntensityMap&&(y.specularIntensityMap.value=x.specularIntensityMap,e(x.specularIntensityMap,y.specularIntensityMapTransform))}function g(y,x){x.matcap&&(y.matcap.value=x.matcap)}function _(y,x){const M=t.get(x).light;y.referencePosition.value.setFromMatrixPosition(M.matrixWorld),y.nearDistance.value=M.shadow.camera.near,y.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function SB(n,t,e,i){let r={},s={},a=[];const o=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(M,b){const S=b.program;i.uniformBlockBinding(M,S)}function c(M,b){let S=r[M.id];S===void 0&&(g(M),S=h(M),r[M.id]=S,M.addEventListener("dispose",y));const R=b.program;i.updateUBOMapping(M,R);const C=t.render.frame;s[M.id]!==C&&(p(M),s[M.id]=C)}function h(M){const b=u();M.__bindingPointIndex=b;const S=n.createBuffer(),R=M.__size,C=M.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,R,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,S),S}function u(){for(let M=0;M0&&(S+=R-C),M.__size=S,M.__cache={},this}function _(M){const b={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(b.boundary=4,b.storage=4):M.isVector2?(b.boundary=8,b.storage=8):M.isVector3||M.isColor?(b.boundary=16,b.storage=12):M.isVector4?(b.boundary=16,b.storage=16):M.isMatrix3?(b.boundary=48,b.storage=48):M.isMatrix4?(b.boundary=64,b.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),b}function y(M){const b=M.target;b.removeEventListener("dispose",y);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),n.deleteBuffer(r[b.id]),delete r[b.id],delete s[b.id]}function x(){for(const M in r)n.deleteBuffer(r[M]);a=[],r={},s={}}return{bind:l,update:c,dispose:x}}class dC{constructor(t={}){const{canvas:e=Y2(),context:i=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1}=t;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=a;const m=new Uint32Array(4),g=new Int32Array(4);let _=null,y=null;const x=[],M=[];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._outputColorSpace=Tn,this.toneMapping=vs,this.toneMappingExposure=1;const b=this;let S=!1,R=0,C=0,T=null,N=-1,P=null;const E=new je,L=new je;let B=null;const V=new Ht(0);let j=0,Y=e.width,q=e.height,at=1,G=null,tt=null;const K=new je(0,0,Y,q),$=new je(0,0,Y,q);let ht=!1;const vt=new Lf;let Z=!1,rt=!1;const St=new de,_t=new U,Ot=new je,Xt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Gt=!1;function Qt(){return T===null?at:1}let F=i;function wt(k,et){return e.getContext(k,et)}try{const k={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${z0}`),e.addEventListener("webglcontextlost",lt,!1),e.addEventListener("webglcontextrestored",ut,!1),e.addEventListener("webglcontextcreationerror",Ct,!1),F===null){const et="webgl2";if(F=wt(et,k),F===null)throw wt(et)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw console.error("THREE.WebGLRenderer: "+k.message),k}let bt,mt,dt,kt,Rt,zt,z,O,ot,At,Et,Tt,ne,Ft,Wt,ge,Dt,$t,It,Nt,qt,W,gt,jt;function D(){bt=new Ik(F),bt.init(),W=new uC(F,bt),mt=new Ek(F,bt,t,W),dt=new hB(F),kt=new Nk(F),Rt=new Jz,zt=new gB(F,bt,dt,Rt,mt,W,kt),z=new Tk(b),O=new Pk(b),ot=new HO(F),gt=new bk(F,ot),At=new Lk(F,ot,kt,gt),Et=new Fk(F,At,ot,kt),It=new Ok(F,mt,zt),ge=new Ak(Rt),Tt=new Kz(b,z,O,bt,mt,gt,ge),ne=new bB(b,Rt),Ft=new tB,Wt=new aB(bt),$t=new wk(b,z,O,dt,Et,p,l),Dt=new cB(b,Et,mt),jt=new SB(F,kt,mt,dt),Nt=new Sk(F,bt,kt),qt=new Dk(F,bt,kt),kt.programs=Tt.programs,b.capabilities=mt,b.extensions=bt,b.properties=Rt,b.renderLists=Ft,b.shadowMap=Dt,b.state=dt,b.info=kt}D();const it=new MB(b,F);this.xr=it,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){const k=bt.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=bt.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return at},this.setPixelRatio=function(k){k!==void 0&&(at=k,this.setSize(Y,q,!1))},this.getSize=function(k){return k.set(Y,q)},this.setSize=function(k,et,ft=!0){if(it.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=k,q=et,e.width=Math.floor(k*at),e.height=Math.floor(et*at),ft===!0&&(e.style.width=k+"px",e.style.height=et+"px"),this.setViewport(0,0,k,et)},this.getDrawingBufferSize=function(k){return k.set(Y*at,q*at).floor()},this.setDrawingBufferSize=function(k,et,ft){Y=k,q=et,at=ft,e.width=Math.floor(k*ft),e.height=Math.floor(et*ft),this.setViewport(0,0,k,et)},this.getCurrentViewport=function(k){return k.copy(E)},this.getViewport=function(k){return k.copy(K)},this.setViewport=function(k,et,ft,pt){k.isVector4?K.set(k.x,k.y,k.z,k.w):K.set(k,et,ft,pt),dt.viewport(E.copy(K).multiplyScalar(at).round())},this.getScissor=function(k){return k.copy($)},this.setScissor=function(k,et,ft,pt){k.isVector4?$.set(k.x,k.y,k.z,k.w):$.set(k,et,ft,pt),dt.scissor(L.copy($).multiplyScalar(at).round())},this.getScissorTest=function(){return ht},this.setScissorTest=function(k){dt.setScissorTest(ht=k)},this.setOpaqueSort=function(k){G=k},this.setTransparentSort=function(k){tt=k},this.getClearColor=function(k){return k.copy($t.getClearColor())},this.setClearColor=function(){$t.setClearColor.apply($t,arguments)},this.getClearAlpha=function(){return $t.getClearAlpha()},this.setClearAlpha=function(){$t.setClearAlpha.apply($t,arguments)},this.clear=function(k=!0,et=!0,ft=!0){let pt=0;if(k){let st=!1;if(T!==null){const Bt=T.texture.format;st=Bt===$0||Bt===q0||Bt===Cf}if(st){const Bt=T.texture.type,ee=Bt===Vr||Bt===aa||Bt===Wc||Bt===Ko||Bt===W0||Bt===j0,se=$t.getClearColor(),re=$t.getClearAlpha(),pe=se.r,ye=se.g,fe=se.b;ee?(m[0]=pe,m[1]=ye,m[2]=fe,m[3]=re,F.clearBufferuiv(F.COLOR,0,m)):(g[0]=pe,g[1]=ye,g[2]=fe,g[3]=re,F.clearBufferiv(F.COLOR,0,g))}else pt|=F.COLOR_BUFFER_BIT}et&&(pt|=F.DEPTH_BUFFER_BIT),ft&&(pt|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),F.clear(pt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",lt,!1),e.removeEventListener("webglcontextrestored",ut,!1),e.removeEventListener("webglcontextcreationerror",Ct,!1),Ft.dispose(),Wt.dispose(),Rt.dispose(),z.dispose(),O.dispose(),Et.dispose(),gt.dispose(),jt.dispose(),Tt.dispose(),it.dispose(),it.removeEventListener("sessionstart",$e),it.removeEventListener("sessionend",Kr),Pn.stop()};function lt(k){k.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const k=kt.autoReset,et=Dt.enabled,ft=Dt.autoUpdate,pt=Dt.needsUpdate,st=Dt.type;D(),kt.autoReset=k,Dt.enabled=et,Dt.autoUpdate=ft,Dt.needsUpdate=pt,Dt.type=st}function Ct(k){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",k.statusMessage)}function oe(k){const et=k.target;et.removeEventListener("dispose",oe),le(et)}function le(k){Ne(k),Rt.remove(k)}function Ne(k){const et=Rt.get(k).programs;et!==void 0&&(et.forEach(function(ft){Tt.releaseProgram(ft)}),k.isShaderMaterial&&Tt.releaseShaderCache(k))}this.renderBufferDirect=function(k,et,ft,pt,st,Bt){et===null&&(et=Xt);const ee=st.isMesh&&st.matrixWorld.determinant()<0,se=Cg(k,et,ft,pt,st);dt.setMaterial(pt,ee);let re=ft.index,pe=1;if(pt.wireframe===!0){if(re=At.getWireframeAttribute(ft),re===void 0)return;pe=2}const ye=ft.drawRange,fe=ft.attributes.position;let Ue=ye.start*pe,Ke=(ye.start+ye.count)*pe;Bt!==null&&(Ue=Math.max(Ue,Bt.start*pe),Ke=Math.min(Ke,(Bt.start+Bt.count)*pe)),re!==null?(Ue=Math.max(Ue,0),Ke=Math.min(Ke,re.count)):fe!=null&&(Ue=Math.max(Ue,0),Ke=Math.min(Ke,fe.count));const Xe=Ke-Ue;if(Xe<0||Xe===1/0)return;gt.setup(st,pt,se,ft,re);let un,ue=Nt;if(re!==null&&(un=ot.get(re),ue=qt,ue.setIndex(un)),st.isMesh)pt.wireframe===!0?(dt.setLineWidth(pt.wireframeLinewidth*Qt()),ue.setMode(F.LINES)):ue.setMode(F.TRIANGLES);else if(st.isLine){let Vt=pt.linewidth;Vt===void 0&&(Vt=1),dt.setLineWidth(Vt*Qt()),st.isLineSegments?ue.setMode(F.LINES):st.isLineLoop?ue.setMode(F.LINE_LOOP):ue.setMode(F.LINE_STRIP)}else st.isPoints?ue.setMode(F.POINTS):st.isSprite&&ue.setMode(F.TRIANGLES);if(st.isBatchedMesh)if(st._multiDrawInstances!==null)ue.renderMultiDrawInstances(st._multiDrawStarts,st._multiDrawCounts,st._multiDrawCount,st._multiDrawInstances);else if(bt.get("WEBGL_multi_draw"))ue.renderMultiDraw(st._multiDrawStarts,st._multiDrawCounts,st._multiDrawCount);else{const Vt=st._multiDrawStarts,Je=st._multiDrawCounts,xe=st._multiDrawCount,Qe=re?ot.get(re).bytesPerElement:1,Ei=Rt.get(pt).currentProgram.getUniforms();for(let wn=0;wn{function Bt(){if(pt.forEach(function(ee){Rt.get(ee).currentProgram.isReady()&&pt.delete(ee)}),pt.size===0){st(k);return}setTimeout(Bt,10)}bt.get("KHR_parallel_shader_compile")!==null?Bt():setTimeout(Bt,10)})};let Se=null;function qe(k){Se&&Se(k)}function $e(){Pn.stop()}function Kr(){Pn.start()}const Pn=new aC;Pn.setAnimationLoop(qe),typeof self<"u"&&Pn.setContext(self),this.setAnimationLoop=function(k){Se=k,it.setAnimationLoop(k),k===null?Pn.stop():Pn.start()},it.addEventListener("sessionstart",$e),it.addEventListener("sessionend",Kr),this.render=function(k,et){if(et!==void 0&&et.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),et.parent===null&&et.matrixWorldAutoUpdate===!0&&et.updateMatrixWorld(),it.enabled===!0&&it.isPresenting===!0&&(it.cameraAutoUpdate===!0&&it.updateCamera(et),et=it.getCamera()),k.isScene===!0&&k.onBeforeRender(b,k,et,T),y=Wt.get(k,M.length),y.init(et),M.push(y),St.multiplyMatrices(et.projectionMatrix,et.matrixWorldInverse),vt.setFromProjectionMatrix(St),rt=this.localClippingEnabled,Z=ge.init(this.clippingPlanes,rt),_=Ft.get(k,x.length),_.init(),x.push(_),it.enabled===!0&&it.isPresenting===!0){const Bt=b.xr.getDepthSensingMesh();Bt!==null&&Er(Bt,et,-1/0,b.sortObjects)}Er(k,et,0,b.sortObjects),_.finish(),b.sortObjects===!0&&_.sort(G,tt),Gt=it.enabled===!1||it.isPresenting===!1||it.hasDepthSensing()===!1,Gt&&$t.addToRenderList(_,k),this.info.render.frame++,Z===!0&&ge.beginShadows();const ft=y.state.shadowsArray;Dt.render(ft,k,et),Z===!0&&ge.endShadows(),this.info.autoReset===!0&&this.info.reset();const pt=_.opaque,st=_.transmissive;if(y.setupLights(),et.isArrayCamera){const Bt=et.cameras;if(st.length>0)for(let ee=0,se=Bt.length;ee0&&Cs(pt,st,k,et),Gt&&$t.render(k),Jr(_,k,et);T!==null&&(zt.updateMultisampleRenderTarget(T),zt.updateRenderTargetMipmap(T)),k.isScene===!0&&k.onAfterRender(b,k,et),gt.resetDefaultState(),N=-1,P=null,M.pop(),M.length>0?(y=M[M.length-1],Z===!0&&ge.setGlobalState(b.clippingPlanes,y.state.camera)):y=null,x.pop(),x.length>0?_=x[x.length-1]:_=null};function Er(k,et,ft,pt){if(k.visible===!1)return;if(k.layers.test(et.layers)){if(k.isGroup)ft=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(et);else if(k.isLight)y.pushLight(k),k.castShadow&&y.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||vt.intersectsSprite(k)){pt&&Ot.setFromMatrixPosition(k.matrixWorld).applyMatrix4(St);const ee=Et.update(k),se=k.material;se.visible&&_.push(k,ee,se,ft,Ot.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||vt.intersectsObject(k))){const ee=Et.update(k),se=k.material;if(pt&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),Ot.copy(k.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),Ot.copy(ee.boundingSphere.center)),Ot.applyMatrix4(k.matrixWorld).applyMatrix4(St)),Array.isArray(se)){const re=ee.groups;for(let pe=0,ye=re.length;pe0&&dl(st,et,ft),Bt.length>0&&dl(Bt,et,ft),ee.length>0&&dl(ee,et,ft),dt.buffers.depth.setTest(!0),dt.buffers.depth.setMask(!0),dt.buffers.color.setMask(!0),dt.setPolygonOffset(!1)}function Cs(k,et,ft,pt){if((ft.isScene===!0?ft.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[pt.id]===void 0&&(y.state.transmissionRenderTarget[pt.id]=new Wr(1,1,{generateMipmaps:!0,type:bt.has("EXT_color_buffer_half_float")||bt.has("EXT_color_buffer_float")?oh:Vr,minFilter:gr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Fe.workingColorSpace}));const Bt=y.state.transmissionRenderTarget[pt.id],ee=pt.viewport||E;Bt.setSize(ee.z,ee.w);const se=b.getRenderTarget();b.setRenderTarget(Bt),b.getClearColor(V),j=b.getClearAlpha(),j<1&&b.setClearColor(16777215,.5),b.clear(),Gt&&$t.render(ft);const re=b.toneMapping;b.toneMapping=vs;const pe=pt.viewport;if(pt.viewport!==void 0&&(pt.viewport=void 0),y.setupLightsView(pt),Z===!0&&ge.setGlobalState(b.clippingPlanes,pt),dl(k,ft,pt),zt.updateMultisampleRenderTarget(Bt),zt.updateRenderTargetMipmap(Bt),bt.has("WEBGL_multisampled_render_to_texture")===!1){let ye=!1;for(let fe=0,Ue=et.length;fe0),fe=!!ft.morphAttributes.position,Ue=!!ft.morphAttributes.normal,Ke=!!ft.morphAttributes.color;let Xe=vs;pt.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Xe=b.toneMapping);const un=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,ue=un!==void 0?un.length:0,Vt=Rt.get(pt),Je=y.state.lights;if(Z===!0&&(rt===!0||k!==P)){const jn=k===P&&pt.id===N;ge.setState(pt,k,jn)}let xe=!1;pt.version===Vt.__version?(Vt.needsLights&&Vt.lightsStateVersion!==Je.state.version||Vt.outputColorSpace!==se||st.isBatchedMesh&&Vt.batching===!1||!st.isBatchedMesh&&Vt.batching===!0||st.isBatchedMesh&&Vt.batchingColor===!0&&st.colorTexture===null||st.isBatchedMesh&&Vt.batchingColor===!1&&st.colorTexture!==null||st.isInstancedMesh&&Vt.instancing===!1||!st.isInstancedMesh&&Vt.instancing===!0||st.isSkinnedMesh&&Vt.skinning===!1||!st.isSkinnedMesh&&Vt.skinning===!0||st.isInstancedMesh&&Vt.instancingColor===!0&&st.instanceColor===null||st.isInstancedMesh&&Vt.instancingColor===!1&&st.instanceColor!==null||st.isInstancedMesh&&Vt.instancingMorph===!0&&st.morphTexture===null||st.isInstancedMesh&&Vt.instancingMorph===!1&&st.morphTexture!==null||Vt.envMap!==re||pt.fog===!0&&Vt.fog!==Bt||Vt.numClippingPlanes!==void 0&&(Vt.numClippingPlanes!==ge.numPlanes||Vt.numIntersection!==ge.numIntersection)||Vt.vertexAlphas!==pe||Vt.vertexTangents!==ye||Vt.morphTargets!==fe||Vt.morphNormals!==Ue||Vt.morphColors!==Ke||Vt.toneMapping!==Xe||Vt.morphTargetsCount!==ue)&&(xe=!0):(xe=!0,Vt.__version=pt.version);let Qe=Vt.currentProgram;xe===!0&&(Qe=pl(pt,et,st));let Ei=!1,wn=!1,Un=!1;const en=Qe.getUniforms(),Ar=Vt.uniforms;if(dt.useProgram(Qe.program)&&(Ei=!0,wn=!0,Un=!0),pt.id!==N&&(N=pt.id,wn=!0),Ei||P!==k){en.setValue(F,"projectionMatrix",k.projectionMatrix),en.setValue(F,"viewMatrix",k.matrixWorldInverse);const jn=en.map.cameraPosition;jn!==void 0&&jn.setValue(F,_t.setFromMatrixPosition(k.matrixWorld)),mt.logarithmicDepthBuffer&&en.setValue(F,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(pt.isMeshPhongMaterial||pt.isMeshToonMaterial||pt.isMeshLambertMaterial||pt.isMeshBasicMaterial||pt.isMeshStandardMaterial||pt.isShaderMaterial)&&en.setValue(F,"isOrthographic",k.isOrthographicCamera===!0),P!==k&&(P=k,wn=!0,Un=!0)}if(st.isSkinnedMesh){en.setOptional(F,st,"bindMatrix"),en.setOptional(F,st,"bindMatrixInverse");const jn=st.skeleton;jn&&(jn.boneTexture===null&&jn.computeBoneTexture(),en.setValue(F,"boneTexture",jn.boneTexture,zt))}st.isBatchedMesh&&(en.setOptional(F,st,"batchingTexture"),en.setValue(F,"batchingTexture",st._matricesTexture,zt),en.setOptional(F,st,"batchingIdTexture"),en.setValue(F,"batchingIdTexture",st._indirectTexture,zt),en.setOptional(F,st,"batchingColorTexture"),st._colorsTexture!==null&&en.setValue(F,"batchingColorTexture",st._colorsTexture,zt));const ml=ft.morphAttributes;if((ml.position!==void 0||ml.normal!==void 0||ml.color!==void 0)&&It.update(st,ft,Qe),(wn||Vt.receiveShadow!==st.receiveShadow)&&(Vt.receiveShadow=st.receiveShadow,en.setValue(F,"receiveShadow",st.receiveShadow)),pt.isMeshGouraudMaterial&&pt.envMap!==null&&(Ar.envMap.value=re,Ar.flipEnvMap.value=re.isCubeTexture&&re.isRenderTargetTexture===!1?-1:1),pt.isMeshStandardMaterial&&pt.envMap===null&&et.environment!==null&&(Ar.envMapIntensity.value=et.environmentIntensity),wn&&(en.setValue(F,"toneMappingExposure",b.toneMappingExposure),Vt.needsLights&&Rg(Ar,Un),Bt&&pt.fog===!0&&ne.refreshFogUniforms(Ar,Bt),ne.refreshMaterialUniforms(Ar,pt,at,q,y.state.transmissionRenderTarget[k.id]),Pm.upload(F,ed(Vt),Ar,zt)),pt.isShaderMaterial&&pt.uniformsNeedUpdate===!0&&(Pm.upload(F,ed(Vt),Ar,zt),pt.uniformsNeedUpdate=!1),pt.isSpriteMaterial&&en.setValue(F,"center",st.center),en.setValue(F,"modelViewMatrix",st.modelViewMatrix),en.setValue(F,"normalMatrix",st.normalMatrix),en.setValue(F,"modelMatrix",st.matrixWorld),pt.isShaderMaterial||pt.isRawShaderMaterial){const jn=pt.uniformsGroups;for(let gl=0,zi=jn.length;gl0&&zt.useMultisampledRTT(k)===!1?st=Rt.get(k).__webglMultisampledFramebuffer:Array.isArray(ye)?st=ye[ft]:st=ye,E.copy(k.viewport),L.copy(k.scissor),B=k.scissorTest}else E.copy(K).multiplyScalar(at).floor(),L.copy($).multiplyScalar(at).floor(),B=ht;if(dt.bindFramebuffer(F.FRAMEBUFFER,st)&&pt&&dt.drawBuffers(k,st),dt.viewport(E),dt.scissor(L),dt.setScissorTest(B),Bt){const re=Rt.get(k.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+et,re.__webglTexture,ft)}else if(ee){const re=Rt.get(k.texture),pe=et||0;F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,re.__webglTexture,ft||0,pe)}N=-1},this.readRenderTargetPixels=function(k,et,ft,pt,st,Bt,ee){if(!(k&&k.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let se=Rt.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ee!==void 0&&(se=se[ee]),se){dt.bindFramebuffer(F.FRAMEBUFFER,se);try{const re=k.texture,pe=re.format,ye=re.type;if(!mt.textureFormatReadable(pe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!mt.textureTypeReadable(ye)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}et>=0&&et<=k.width-pt&&ft>=0&&ft<=k.height-st&&F.readPixels(et,ft,pt,st,W.convert(pe),W.convert(ye),Bt)}finally{const re=T!==null?Rt.get(T).__webglFramebuffer:null;dt.bindFramebuffer(F.FRAMEBUFFER,re)}}},this.readRenderTargetPixelsAsync=async function(k,et,ft,pt,st,Bt,ee){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let se=Rt.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ee!==void 0&&(se=se[ee]),se){dt.bindFramebuffer(F.FRAMEBUFFER,se);try{const re=k.texture,pe=re.format,ye=re.type;if(!mt.textureFormatReadable(pe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!mt.textureTypeReadable(ye))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(et>=0&&et<=k.width-pt&&ft>=0&&ft<=k.height-st){const fe=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,fe),F.bufferData(F.PIXEL_PACK_BUFFER,Bt.byteLength,F.STREAM_READ),F.readPixels(et,ft,pt,st,W.convert(pe),W.convert(ye),0),F.flush();const Ue=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);await fO(F,Ue,4);try{F.bindBuffer(F.PIXEL_PACK_BUFFER,fe),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,Bt)}finally{F.deleteBuffer(fe),F.deleteSync(Ue)}return Bt}}finally{const re=T!==null?Rt.get(T).__webglFramebuffer:null;dt.bindFramebuffer(F.FRAMEBUFFER,re)}}},this.copyFramebufferToTexture=function(k,et=null,ft=0){k.isTexture!==!0&&(Ic("WebGLRenderer: copyFramebufferToTexture function signature has changed."),et=arguments[0]||null,k=arguments[1]);const pt=Math.pow(2,-ft),st=Math.floor(k.image.width*pt),Bt=Math.floor(k.image.height*pt),ee=et!==null?et.x:0,se=et!==null?et.y:0;zt.setTexture2D(k,0),F.copyTexSubImage2D(F.TEXTURE_2D,ft,0,0,ee,se,st,Bt),dt.unbindTexture()},this.copyTextureToTexture=function(k,et,ft=null,pt=null,st=0){k.isTexture!==!0&&(Ic("WebGLRenderer: copyTextureToTexture function signature has changed."),pt=arguments[0]||null,k=arguments[1],et=arguments[2],st=arguments[3]||0,ft=null);let Bt,ee,se,re,pe,ye;ft!==null?(Bt=ft.max.x-ft.min.x,ee=ft.max.y-ft.min.y,se=ft.min.x,re=ft.min.y):(Bt=k.image.width,ee=k.image.height,se=0,re=0),pt!==null?(pe=pt.x,ye=pt.y):(pe=0,ye=0);const fe=W.convert(et.format),Ue=W.convert(et.type);zt.setTexture2D(et,0),F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,et.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,et.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,et.unpackAlignment);const Ke=F.getParameter(F.UNPACK_ROW_LENGTH),Xe=F.getParameter(F.UNPACK_IMAGE_HEIGHT),un=F.getParameter(F.UNPACK_SKIP_PIXELS),ue=F.getParameter(F.UNPACK_SKIP_ROWS),Vt=F.getParameter(F.UNPACK_SKIP_IMAGES),Je=k.isCompressedTexture?k.mipmaps[st]:k.image;F.pixelStorei(F.UNPACK_ROW_LENGTH,Je.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Je.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,se),F.pixelStorei(F.UNPACK_SKIP_ROWS,re),k.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,st,pe,ye,Bt,ee,fe,Ue,Je.data):k.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,st,pe,ye,Je.width,Je.height,fe,Je.data):F.texSubImage2D(F.TEXTURE_2D,st,pe,ye,Bt,ee,fe,Ue,Je),F.pixelStorei(F.UNPACK_ROW_LENGTH,Ke),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Xe),F.pixelStorei(F.UNPACK_SKIP_PIXELS,un),F.pixelStorei(F.UNPACK_SKIP_ROWS,ue),F.pixelStorei(F.UNPACK_SKIP_IMAGES,Vt),st===0&&et.generateMipmaps&&F.generateMipmap(F.TEXTURE_2D),dt.unbindTexture()},this.copyTextureToTexture3D=function(k,et,ft=null,pt=null,st=0){k.isTexture!==!0&&(Ic("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ft=arguments[0]||null,pt=arguments[1]||null,k=arguments[2],et=arguments[3],st=arguments[4]||0);let Bt,ee,se,re,pe,ye,fe,Ue,Ke;const Xe=k.isCompressedTexture?k.mipmaps[st]:k.image;ft!==null?(Bt=ft.max.x-ft.min.x,ee=ft.max.y-ft.min.y,se=ft.max.z-ft.min.z,re=ft.min.x,pe=ft.min.y,ye=ft.min.z):(Bt=Xe.width,ee=Xe.height,se=Xe.depth,re=0,pe=0,ye=0),pt!==null?(fe=pt.x,Ue=pt.y,Ke=pt.z):(fe=0,Ue=0,Ke=0);const un=W.convert(et.format),ue=W.convert(et.type);let Vt;if(et.isData3DTexture)zt.setTexture3D(et,0),Vt=F.TEXTURE_3D;else if(et.isDataArrayTexture||et.isCompressedArrayTexture)zt.setTexture2DArray(et,0),Vt=F.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,et.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,et.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,et.unpackAlignment);const Je=F.getParameter(F.UNPACK_ROW_LENGTH),xe=F.getParameter(F.UNPACK_IMAGE_HEIGHT),Qe=F.getParameter(F.UNPACK_SKIP_PIXELS),Ei=F.getParameter(F.UNPACK_SKIP_ROWS),wn=F.getParameter(F.UNPACK_SKIP_IMAGES);F.pixelStorei(F.UNPACK_ROW_LENGTH,Xe.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Xe.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,re),F.pixelStorei(F.UNPACK_SKIP_ROWS,pe),F.pixelStorei(F.UNPACK_SKIP_IMAGES,ye),k.isDataTexture||k.isData3DTexture?F.texSubImage3D(Vt,st,fe,Ue,Ke,Bt,ee,se,un,ue,Xe.data):et.isCompressedArrayTexture?F.compressedTexSubImage3D(Vt,st,fe,Ue,Ke,Bt,ee,se,un,Xe.data):F.texSubImage3D(Vt,st,fe,Ue,Ke,Bt,ee,se,un,ue,Xe),F.pixelStorei(F.UNPACK_ROW_LENGTH,Je),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,xe),F.pixelStorei(F.UNPACK_SKIP_PIXELS,Qe),F.pixelStorei(F.UNPACK_SKIP_ROWS,Ei),F.pixelStorei(F.UNPACK_SKIP_IMAGES,wn),st===0&&et.generateMipmaps&&F.generateMipmap(Vt),dt.unbindTexture()},this.initRenderTarget=function(k){Rt.get(k).__webglFramebuffer===void 0&&zt.setupRenderTarget(k)},this.initTexture=function(k){k.isCubeTexture?zt.setTextureCube(k,0):k.isData3DTexture?zt.setTexture3D(k,0):k.isDataArrayTexture||k.isCompressedArrayTexture?zt.setTexture2DArray(k,0):zt.setTexture2D(k,0),dt.unbindTexture()},this.resetState=function(){R=0,C=0,T=null,dt.reset(),gt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Z0?"display-p3":"srgb",e.unpackColorSpace=Fe.workingColorSpace===Rf?"display-p3":"srgb"}}class Q0{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ht(t),this.density=e}clone(){return new Q0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class tg{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ht(t),this.near=e,this.far=i}clone(){return new tg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}let y0=class extends Ge{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 jr,this.environmentIntensity=1,this.environmentRotation=new jr,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(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),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};class Df{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Zu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=tr()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Ic("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.stride;rt.far||e.push({distance:l,point:Wh.clone(),uv:Na.getInterpolation(Wh,vp,Xh,Mp,sS,gx,aS,new xt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function wp(n,t,e,i,r,s){Kl.subVectors(n,e).addScalar(.5).multiply(i),r!==void 0?(jh.x=s*Kl.x-r*Kl.y,jh.y=r*Kl.x+s*Kl.y):jh.copy(Kl),n.copy(t),n.x+=jh.x,n.y+=jh.y,n.applyMatrix4(pC)}const bp=new U,oS=new U;class gC extends Ge{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let i=0,r=e.length;i0){let i,r;for(i=1,r=e.length;i0){bp.setFromMatrixPosition(this.matrixWorld);const r=t.ray.origin.distanceTo(bp);this.getObjectForDistance(r).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){bp.setFromMatrixPosition(t.matrixWorld),oS.setFromMatrixPosition(this.matrixWorld);const i=bp.distanceTo(oS)/t.zoom;e[0].object.visible=!0;let r,s;for(r=1,s=e.length;r=a)e[r-1].object.visible=!1,e[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];s.push(a),this.index++,a.start=t.start,a.count=t.count,a.z=e,a.index=i}reset(){this.list.length=0,this.index=0}}const Sa=new de,_x=new de,IB=new de,LB=new Ht(1,1,1),gS=new de,vx=new Lf,Ap=new fi,_o=new Zn,Yh=new U,yS=new U,DB=new U,Mx=new PB,si=new vn,Tp=[];function NB(n,t,e=0){const i=t.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==t.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);e.setIndex(new Pe(s,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in e.attributes){if(!t.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=t.getAttribute(i),s=e.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new fi);const t=this._geometryCount,e=this.boundingBox,i=this._drawInfo;e.makeEmpty();for(let r=0;r=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:t});const e=this._drawInfo.length-1,i=this._matricesTexture,r=i.image.data;IB.toArray(r,e*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(LB.toArray(s.image.data,e*4),s.needsUpdate=!0),e}addGeometry(t,e=-1,i=-1){if(this._initializeGeometry(t),this._validateGeometry(t),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const a=this._reservedRanges,o=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=a[a.length-1]),e===-1?r.vertexCount=t.getAttribute("position").count:r.vertexCount=e,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=t.getIndex(),h=c!==null;if(h&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._geometryCount;return this._geometryCount++,a.push(r),o.push({start:h?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new fi,sphereInitialized:!1,sphere:new Zn}),this.setGeometryAt(u,t),u}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),a=e.getIndex(),o=this._reservedRanges[t];if(r&&a.count>o.indexCount||e.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.vertexCount;for(const m in i.attributes){const g=e.getAttribute(m),_=i.getAttribute(m);NB(g,_,l);const y=g.itemSize;for(let x=g.count,M=c;x=this._geometryCount)return null;const i=this._bounds[t],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const a=s.index,o=s.attributes.position,l=this._drawRanges[t];for(let c=l.start,h=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[t],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(t,Ap),Ap.getCenter(r.center);const a=s.index,o=s.attributes.position,l=this._drawRanges[t];let c=0;for(let h=l.start,u=l.start+l.count;h=i.length||i[t].active===!1?this:(e.toArray(s,t*16),r.needsUpdate=!0,this)}getMatrixAt(t,e){const i=this._drawInfo,r=this._matricesTexture.image.data;return t>=i.length||i[t].active===!1?null:e.fromArray(r,t*16)}setColorAt(t,e){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return t>=s.length||s[t].active===!1?this:(e.toArray(r,t*4),i.needsUpdate=!0,this)}getColorAt(t,e){const i=this._colorsTexture.image.data,r=this._drawInfo;return t>=r.length||r[t].active===!1?null:e.fromArray(i,t*4)}setVisibleAt(t,e){const i=this._drawInfo;return t>=i.length||i[t].active===!1||i[t].visible===e?this:(i[t].visible=e,this._visibilityChanged=!0,this)}getVisibleAt(t){const e=this._drawInfo;return t>=e.length||e[t].active===!1?!1:e[t].visible}raycast(t,e){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,a=this.geometry;si.material=this.material,si.geometry.index=a.index,si.geometry.attributes=a.attributes,si.geometry.boundingBox===null&&(si.geometry.boundingBox=new fi),si.geometry.boundingSphere===null&&(si.geometry.boundingSphere=new Zn);for(let o=0,l=i.length;o({...e})),this._reservedRanges=t._reservedRanges.map(e=>({...e})),this._drawInfo=t._drawInfo.map(e=>({...e})),this._bounds=t._bounds.map(e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()})),this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(t,e,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,h=this._multiDrawCounts,u=this._drawRanges,p=this.perObjectFrustumCulled,m=this._indirectTexture,g=m.image.data;p&&(gS.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),vx.setFromProjectionMatrix(gS,t.coordinateSystem));let _=0;if(this.sortObjects){_x.copy(this.matrixWorld).invert(),Yh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(_x),yS.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(_x);for(let M=0,b=l.length;M0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;si)return;wx.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(wx);if(!(lt.far))return{distance:l,point:_S.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const vS=new U,MS=new U;class $r extends oa{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[];for(let r=0,s=e.count;r0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,object:a})}}class OB extends Mn{constructor(t,e,i,r,s,a,o,l,c){super(t,e,i,r,s,a,o,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:mn,this.magFilter=s!==void 0?s:mn,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,t.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FB extends Mn{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=Ln,this.minFilter=Ln,this.generateMipmaps=!1,this.needsUpdate=!0}}class ig extends Mn{constructor(t,e,i,r,s,a,o,l,c,h,u,p){super(null,a,o,l,c,h,r,s,u,p),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class UB extends ig{constructor(t,e,i,r,s,a){super(t,e,i,s,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Ki,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class kB extends ig{constructor(t,e,i){super(void 0,t[0].width,t[0].height,e,i,sa),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class xC extends Mn{constructor(t,e,i,r,s,a,o,l,c){super(t,e,i,r,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Yr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,r=this.getPoint(0),s=0;e.push(0);for(let a=1;a<=t;a++)i=this.getPoint(a/t),s+=i.distanceTo(r),e.push(s),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let r=0;const s=i.length;let a;e?a=e:a=t*i[s-1];let o=0,l=s-1,c;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),c=i[r]-a,c<0)o=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===a)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(a-h)/p;return(r+m)/(s-1)}getTangent(t,e){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),o=this.getPoint(s),l=e||(a.isVector2?new xt:new U);return l.copy(o).sub(a).normalize(),l}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new U,r=[],s=[],a=[],o=new U,l=new de;for(let m=0;m<=t;m++){const g=m/t;r[m]=this.getTangentAt(g,new U)}s[0]=new U,a[0]=new U;let c=Number.MAX_VALUE;const h=Math.abs(r[0].x),u=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=c&&(c=h,i.set(1,0,0)),u<=c&&(c=u,i.set(0,1,0)),p<=c&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],o),a[0].crossVectors(r[0],s[0]);for(let m=1;m<=t;m++){if(s[m]=s[m-1].clone(),a[m]=a[m-1].clone(),o.crossVectors(r[m-1],r[m]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(pn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(o,g))}a[m].crossVectors(r[m],s[m])}if(e===!0){let m=Math.acos(pn(s[0].dot(s[t]),-1,1));m/=t,r[0].dot(o.crossVectors(s[0],s[t]))>0&&(m=-m);for(let g=1;g<=t;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],m*g)),a[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class rg extends Yr{constructor(t=0,e=0,i=1,r=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e=new xt){const i=e,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,h;this.closed||o>0?c=r[(o-1)%s]:(Lp.subVectors(r[0],r[1]).add(r[0]),c=Lp);const u=r[o%s],p=r[(o+1)%s];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return i.set(SS(o,l.x,c.x,h.x,u.x),SS(o,l.y,c.y,h.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const a=r[s]-i,o=this.curves[s],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,e)}s++}return null}getLength(){const 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;const t=[];let e=0;for(let i=0,r=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Ff extends ve{constructor(t=[new xt(0,-.5),new xt(.5,0),new xt(0,.5)],e=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=Math.floor(e),r=pn(r,0,Math.PI*2);const s=[],a=[],o=[],l=[],c=[],h=1/e,u=new U,p=new xt,m=new U,g=new U,_=new U;let y=0,x=0;for(let M=0;M<=t.length-1;M++)switch(M){case 0:y=t[M+1].x-t[M].x,x=t[M+1].y-t[M].y,m.x=x*1,m.y=-y,m.z=x*0,_.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case t.length-1:l.push(_.x,_.y,_.z);break;default:y=t[M+1].x-t[M].x,x=t[M+1].y-t[M].y,m.x=x*1,m.y=-y,m.z=x*0,g.copy(m),m.x+=_.x,m.y+=_.y,m.z+=_.z,m.normalize(),l.push(m.x,m.y,m.z),_.copy(g)}for(let M=0;M<=e;M++){const b=i+M*h*r,S=Math.sin(b),R=Math.cos(b);for(let C=0;C<=t.length-1;C++){u.x=t[C].x*S,u.y=t[C].y,u.z=t[C].x*R,a.push(u.x,u.y,u.z),p.x=M/e,p.y=C/(t.length-1),o.push(p.x,p.y);const T=l[3*C+0]*S,N=l[3*C+1],P=l[3*C+0]*R;c.push(T,N,P)}}for(let M=0;M0&&b(!0),e>0&&b(!1)),this.setIndex(h),this.setAttribute("position",new ae(u,3)),this.setAttribute("normal",new ae(p,3)),this.setAttribute("uv",new ae(m,2));function M(){const S=new U,R=new U;let C=0;const T=(e-t)/i;for(let N=0;N<=s;N++){const P=[],E=N/s,L=E*(e-t)+t;for(let B=0;B<=r;B++){const V=B/r,j=V*l+o,Y=Math.sin(j),q=Math.cos(j);R.x=L*Y,R.y=-E*i+y,R.z=L*q,u.push(R.x,R.y,R.z),S.set(Y,T,q).normalize(),p.push(S.x,S.y,S.z),m.push(V,1-E),P.push(g++)}_.push(P)}for(let N=0;N.9&&T<.1&&(b<.2&&(a[M+0]+=1),S<.2&&(a[M+2]+=1),R<.2&&(a[M+4]+=1))}}function p(M){s.push(M.x,M.y,M.z)}function m(M,b){const S=M*3;b.x=t[S+0],b.y=t[S+1],b.z=t[S+2]}function g(){const M=new U,b=new U,S=new U,R=new U,C=new xt,T=new xt,N=new xt;for(let P=0,E=0;P80*e){o=c=n[0],l=h=n[1];for(let g=e;gc&&(c=u),p>h&&(h=p);m=Math.max(c-o,h-l),m=m!==0?32767/m:0}return tf(s,a,e,o,l,m,0),a}};function EC(n,t,e,i,r){let s,a;if(r===l4(n,t,e,i)>0)for(s=t;s=t;s-=i)a=ES(s,n[s],n[s+1],a);return a&&cg(a,a.next)&&(nf(a),a=a.next),a}function tl(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(cg(e,e.next)||hn(e.prev,e,e.next)===0)){if(nf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function tf(n,t,e,i,r,s,a){if(!n)return;!a&&s&&n4(n,i,r,s);let o=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?$B(n,i,r,s):qB(n)){t.push(l.i/e|0),t.push(n.i/e|0),t.push(c.i/e|0),nf(n),n=c.next,o=c.next;continue}if(n=c,n===o){a?a===1?(n=YB(tl(n),t,e),tf(n,t,e,i,r,s,2)):a===2&&ZB(n,t,e,i,r,s):tf(tl(n),t,e,i,r,s,1);break}}}function qB(n){const t=n.prev,e=n,i=n.next;if(hn(t,e,i)>=0)return!1;const r=t.x,s=e.x,a=i.x,o=t.y,l=e.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,m=o>l?o>c?o:c:l>c?l:c;let g=i.next;for(;g!==t;){if(g.x>=h&&g.x<=p&&g.y>=u&&g.y<=m&&bc(r,o,s,l,a,c,g.x,g.y)&&hn(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function $B(n,t,e,i){const r=n.prev,s=n,a=n.next;if(hn(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,p=a.y,m=ol?o>c?o:c:l>c?l:c,y=h>u?h>p?h:p:u>p?u:p,x=Y_(m,g,t,e,i),M=Y_(_,y,t,e,i);let b=n.prevZ,S=n.nextZ;for(;b&&b.z>=x&&S&&S.z<=M;){if(b.x>=m&&b.x<=_&&b.y>=g&&b.y<=y&&b!==r&&b!==a&&bc(o,h,l,u,c,p,b.x,b.y)&&hn(b.prev,b,b.next)>=0||(b=b.prevZ,S.x>=m&&S.x<=_&&S.y>=g&&S.y<=y&&S!==r&&S!==a&&bc(o,h,l,u,c,p,S.x,S.y)&&hn(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;b&&b.z>=x;){if(b.x>=m&&b.x<=_&&b.y>=g&&b.y<=y&&b!==r&&b!==a&&bc(o,h,l,u,c,p,b.x,b.y)&&hn(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=M;){if(S.x>=m&&S.x<=_&&S.y>=g&&S.y<=y&&S!==r&&S!==a&&bc(o,h,l,u,c,p,S.x,S.y)&&hn(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function YB(n,t,e){let i=n;do{const r=i.prev,s=i.next.next;!cg(r,s)&&AC(r,i,i.next,s)&&ef(r,s)&&ef(s,r)&&(t.push(r.i/e|0),t.push(i.i/e|0),t.push(s.i/e|0),nf(i),nf(i.next),i=n=s),i=i.next}while(i!==n);return tl(i)}function ZB(n,t,e,i,r,s){let a=n;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&s4(a,o)){let l=TC(a,o);a=tl(a,a.next),l=tl(l,l.next),tf(a,t,e,i,r,s,0),tf(l,t,e,i,r,s,0);return}o=o.next}a=a.next}while(a!==n)}function KB(n,t,e,i){const r=[];let s,a,o,l,c;for(s=0,a=t.length;s=e.next.y&&e.next.y!==e.y){const p=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(p<=s&&p>i&&(i=p,r=e.x=e.x&&e.x>=l&&s!==e.x&&bc(ar.x||e.x===r.x&&e4(r,e)))&&(r=e,h=u)),e=e.next;while(e!==o);return r}function e4(n,t){return hn(n.prev,n,t.prev)<0&&hn(t.next,n,n.next)<0}function n4(n,t,e,i){let r=n;do r.z===0&&(r.z=Y_(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,i4(r)}function i4(n){let t,e,i,r,s,a,o,l,c=1;do{for(e=n,n=null,s=null,a=0;e;){for(a++,i=e,o=0,t=0;t0||l>0&&i;)o!==0&&(l===0||!i||e.z<=i.z)?(r=e,e=e.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;e=i}s.nextZ=null,c*=2}while(a>1);return n}function Y_(n,t,e,i,r){return n=(n-e)*r|0,t=(t-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function r4(n){let t=n,e=n;do(t.x=(n-a)*(s-o)&&(n-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(s-o)>=(r-a)*(i-o)}function s4(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!a4(n,t)&&(ef(n,t)&&ef(t,n)&&o4(n,t)&&(hn(n.prev,n,t.prev)||hn(n,t.prev,t))||cg(n,t)&&hn(n.prev,n,n.next)>0&&hn(t.prev,t,t.next)>0)}function hn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function cg(n,t){return n.x===t.x&&n.y===t.y}function AC(n,t,e,i){const r=Up(hn(n,t,e)),s=Up(hn(n,t,i)),a=Up(hn(e,i,n)),o=Up(hn(e,i,t));return!!(r!==s&&a!==o||r===0&&Fp(n,e,t)||s===0&&Fp(n,i,t)||a===0&&Fp(e,n,i)||o===0&&Fp(e,t,i))}function Fp(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Up(n){return n>0?1:n<0?-1:0}function a4(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&AC(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function ef(n,t){return hn(n.prev,n,n.next)<0?hn(n,t,n.next)>=0&&hn(n,n.prev,t)>=0:hn(n,t,n.prev)<0||hn(n,n.next,t)<0}function o4(n,t){let e=n,i=!1;const r=(n.x+t.x)/2,s=(n.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function TC(n,t){const e=new Z_(n.i,n.x,n.y),i=new Z_(t.i,t.x,t.y),r=n.next,s=t.prev;return n.next=t,t.prev=n,e.next=r,r.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function ES(n,t,e,i){const r=new Z_(n,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function nf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Z_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function l4(n,t,e,i){let r=0;for(let s=t,a=e-i;s2&&n[t-1].equals(n[0])&&n.pop()}function TS(n,t){for(let e=0;eNumber.EPSILON){const Et=Math.sqrt(ot),Tt=Math.sqrt(z*z+O*O),ne=wt.x-zt/Et,Ft=wt.y+Rt/Et,Wt=bt.x-O/Tt,ge=bt.y+z/Tt,Dt=((Wt-ne)*O-(ge-Ft)*z)/(Rt*O-zt*z);mt=ne+Rt*Dt-F.x,dt=Ft+zt*Dt-F.y;const $t=mt*mt+dt*dt;if($t<=2)return new xt(mt,dt);kt=Math.sqrt($t/2)}else{let Et=!1;Rt>Number.EPSILON?z>Number.EPSILON&&(Et=!0):Rt<-Number.EPSILON?z<-Number.EPSILON&&(Et=!0):Math.sign(zt)===Math.sign(O)&&(Et=!0),Et?(mt=-zt,dt=Rt,kt=Math.sqrt(ot)):(mt=Rt,dt=zt,kt=Math.sqrt(ot/2))}return new xt(mt/kt,dt/kt)}const tt=[];for(let F=0,wt=j.length,bt=wt-1,mt=F+1;F=0;F--){const wt=F/y,bt=m*Math.cos(wt*Math.PI/2),mt=g*Math.sin(wt*Math.PI/2)+_;for(let dt=0,kt=j.length;dt=0;){const mt=bt;let dt=bt-1;dt<0&&(dt=F.length-1);for(let kt=0,Rt=h+y*2;kt0)&&m.push(b,S,C),(x!==i-1||l0!=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 IC extends Rn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ht(16777215),this.specular=new Ht(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.combine=Tf,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 LC extends Rn{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ht(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(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 DC extends Rn{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(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 zf extends Rn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.combine=Tf,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 NC extends Rn{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ht(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ya,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.flatShading=t.flatShading,this.fog=t.fog,this}}class OC extends Kn{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 zo(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function FC(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function UC(n){function t(r,s){return n[r]-n[s]}const e=n.length,i=new Array(e);for(let r=0;r!==e;++r)i[r]=r;return i.sort(t),i}function K_(n,t,e){const i=n.length,r=new n.constructor(i);for(let s=0,a=0;a!==i;++s){const o=e[s]*t;for(let l=0;l!==t;++l)r[a++]=n[o+l]}return r}function v1(n,t,e,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let a=s[i];if(a!==void 0)if(Array.isArray(a))do a=s[i],a!==void 0&&(t.push(s.time),e.push.apply(e,a)),s=n[r++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[i],a!==void 0&&(t.push(s.time),a.toArray(e,e.length)),s=n[r++];while(s!==void 0);else do a=s[i],a!==void 0&&(t.push(s.time),e.push(a)),s=n[r++];while(s!==void 0)}function f4(n,t,e,i,r=30){const s=n.clone();s.name=t;const a=[];for(let l=0;l=i)){u.push(c.times[m]);for(let _=0;_s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l=o.times[g]){const x=g*u+h,M=x+u-h;_=o.values.slice(x,M)}else{const x=o.createInterpolant(),M=h,b=u-h;x.evaluate(s),_=x.resultBuffer.slice(M,b)}l==="quaternion"&&new Cn().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let x=0;x=s)){const o=e[1];t=s)break e}a=i,i=0;break n}break t}for(;i>>1;te;)--a;if(++a,s!==0||a!==r){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=i.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==s;o++){const l=i[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(r!==void 0&&FC(r))for(let o=0,l=r.length;o!==l;++o){const c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Tm,s=t.length-1;let a=1;for(let o=1;o0){t[a]=t[s];for(let o=s*i,l=a*i,c=0;c!==i;++c)e[l+c]=e[o+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),i=this.constructor,r=new i(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}Zr.prototype.TimeBufferType=Float32Array;Zr.prototype.ValueBufferType=Float32Array;Zr.prototype.DefaultInterpolation=Xc;class cl extends Zr{constructor(t,e,i){super(t,e,i)}}cl.prototype.ValueTypeName="bool";cl.prototype.ValueBufferType=Array;cl.prototype.DefaultInterpolation=jc;cl.prototype.InterpolantFactoryMethodLinear=void 0;cl.prototype.InterpolantFactoryMethodSmooth=void 0;class w1 extends Zr{}w1.prototype.ValueTypeName="color";class el extends Zr{}el.prototype.ValueTypeName="number";class BC extends fh{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(i-e)/(r-e);let c=t*o;for(let h=c+o;c!==h;c+=4)Cn.slerpFlat(s,0,a,c-o,a,c,l);return s}}class nl extends Zr{InterpolantFactoryMethodLinear(t){return new BC(this.times,this.values,this.getValueSize(),t)}}nl.prototype.ValueTypeName="quaternion";nl.prototype.InterpolantFactoryMethodSmooth=void 0;class hl extends Zr{constructor(t,e,i){super(t,e,i)}}hl.prototype.ValueTypeName="string";hl.prototype.ValueBufferType=Array;hl.prototype.DefaultInterpolation=jc;hl.prototype.InterpolantFactoryMethodLinear=void 0;hl.prototype.InterpolantFactoryMethodSmooth=void 0;class il extends Zr{}il.prototype.ValueTypeName="vector";class Yc{constructor(t="",e=-1,i=[],r=Y0){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=tr(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,r=1/(t.fps||1);for(let a=0,o=i.length;a!==o;++a)e.push(g4(i[a]).scale(r));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let s=0,a=i.length;s!==a;++s)e.push(Zr.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(t,e,i,r){const s=e.length,a=[];for(let o=0;o1){const u=h[1];let p=r[u];p||(r[u]=p=[]),p.push(c)}}const a=[];for(const o in r)a.push(this.CreateFromMorphTargetSequence(o,r[o],e,i));return a}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(u,p,m,g,_){if(m.length!==0){const y=[],x=[];v1(m,y,x,g),y.length!==0&&_.push(new u(p,y,x))}},r=[],s=t.name||"default",a=t.fps||30,o=t.blendMode;let l=t.length||-1;const c=t.hierarchy||[];for(let u=0;u{e&&e(s),this.manager.itemEnd(t)},0),s;if(Bs[t]!==void 0){Bs[t].push({onLoad:e,onProgress:i,onError:r});return}Bs[t]=[],Bs[t].push({onLoad:e,onProgress:i,onError:r});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=Bs[t],u=c.body.getReader(),p=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=p?parseInt(p):0,g=m!==0;let _=0;const y=new ReadableStream({start(x){M();function M(){u.read().then(({done:b,value:S})=>{if(b)x.close();else{_+=S.byteLength;const R=new ProgressEvent("progress",{lengthComputable:g,loaded:_,total:m});for(let C=0,T=h.length;C{x.error(b)})}}});return new Response(y)}else throw new y4(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),p=u&&u[1]?u[1].toLowerCase():void 0,m=new TextDecoder(p);return c.arrayBuffer().then(g=>m.decode(g))}}}).then(c=>{ta.add(t,c);const h=Bs[t];delete Bs[t];for(let u=0,p=h.length;u{const h=Bs[t];if(h===void 0)throw this.manager.itemError(t),c;delete Bs[t];for(let u=0,p=h.length;u{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class x4 extends di{constructor(t){super(t)}load(t,e,i,r){const s=this,a=new nr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(s.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),s.manager.itemError(t)}},i,r)}parse(t){const e=[];for(let i=0;i0:r.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const s in t.uniforms){const a=t.uniforms[s];switch(r.uniforms[s]={},a.type){case"t":r.uniforms[s].value=i(a.value);break;case"c":r.uniforms[s].value=new Ht().setHex(a.value);break;case"v2":r.uniforms[s].value=new xt().fromArray(a.value);break;case"v3":r.uniforms[s].value=new U().fromArray(a.value);break;case"v4":r.uniforms[s].value=new je().fromArray(a.value);break;case"m3":r.uniforms[s].value=new Re().fromArray(a.value);break;case"m4":r.uniforms[s].value=new de().fromArray(a.value);break;default:r.uniforms[s].value=a.value}}if(t.defines!==void 0&&(r.defines=t.defines),t.vertexShader!==void 0&&(r.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(r.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(r.glslVersion=t.glslVersion),t.extensions!==void 0)for(const s in t.extensions)r.extensions[s]=t.extensions[s];if(t.lights!==void 0&&(r.lights=t.lights),t.clipping!==void 0&&(r.clipping=t.clipping),t.size!==void 0&&(r.size=t.size),t.sizeAttenuation!==void 0&&(r.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(r.map=i(t.map)),t.matcap!==void 0&&(r.matcap=i(t.matcap)),t.alphaMap!==void 0&&(r.alphaMap=i(t.alphaMap)),t.bumpMap!==void 0&&(r.bumpMap=i(t.bumpMap)),t.bumpScale!==void 0&&(r.bumpScale=t.bumpScale),t.normalMap!==void 0&&(r.normalMap=i(t.normalMap)),t.normalMapType!==void 0&&(r.normalMapType=t.normalMapType),t.normalScale!==void 0){let s=t.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new xt().fromArray(s)}return t.displacementMap!==void 0&&(r.displacementMap=i(t.displacementMap)),t.displacementScale!==void 0&&(r.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(r.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(r.roughnessMap=i(t.roughnessMap)),t.metalnessMap!==void 0&&(r.metalnessMap=i(t.metalnessMap)),t.emissiveMap!==void 0&&(r.emissiveMap=i(t.emissiveMap)),t.emissiveIntensity!==void 0&&(r.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(r.specularMap=i(t.specularMap)),t.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(t.specularIntensityMap)),t.specularColorMap!==void 0&&(r.specularColorMap=i(t.specularColorMap)),t.envMap!==void 0&&(r.envMap=i(t.envMap)),t.envMapRotation!==void 0&&r.envMapRotation.fromArray(t.envMapRotation),t.envMapIntensity!==void 0&&(r.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(r.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(r.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(r.lightMap=i(t.lightMap)),t.lightMapIntensity!==void 0&&(r.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(r.aoMap=i(t.aoMap)),t.aoMapIntensity!==void 0&&(r.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(r.gradientMap=i(t.gradientMap)),t.clearcoatMap!==void 0&&(r.clearcoatMap=i(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new xt().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(r.iridescenceMap=i(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(r.transmissionMap=i(t.transmissionMap)),t.thicknessMap!==void 0&&(r.thicknessMap=i(t.thicknessMap)),t.anisotropyMap!==void 0&&(r.anisotropyMap=i(t.anisotropyMap)),t.sheenColorMap!==void 0&&(r.sheenColorMap=i(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(t.sheenRoughnessMap)),r}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){const e={ShadowMaterial:RC,SpriteMaterial:eg,RawShaderMaterial:PC,ShaderMaterial:Xr,PointsMaterial:Of,MeshPhysicalMaterial:Sr,MeshStandardMaterial:uh,MeshPhongMaterial:IC,MeshToonMaterial:LC,MeshNormalMaterial:DC,MeshLambertMaterial:zf,MeshDepthMaterial:l1,MeshDistanceMaterial:c1,MeshBasicMaterial:Ji,MeshMatcapMaterial:NC,LineDashedMaterial:OC,LineBasicMaterial:Kn,Material:Rn};return new e[t]}}class Ua{static decodeText(t){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let i=0,r=t.length;i0){const l=new b1(e);s=new rf(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,h=t.length;c0){r=new rf(this.manager),r.setCrossOrigin(this.crossOrigin);for(let a=0,o=t.length;a{const y=new fi;y.min.fromArray(_.boxMin),y.max.fromArray(_.boxMax);const x=new Zn;return x.radius=_.sphereRadius,x.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:y,sphereInitialized:_.sphereInitialized,sphere:x}}),a._maxInstanceCount=t.maxInstanceCount,a._maxVertexCount=t.maxVertexCount,a._maxIndexCount=t.maxIndexCount,a._geometryInitialized=t.geometryInitialized,a._geometryCount=t.geometryCount,a._matricesTexture=c(t.matricesTexture.uuid),t.colorsTexture!==void 0&&(a._colorsTexture=c(t.colorsTexture.uuid));break;case"LOD":a=new gC;break;case"Line":a=new oa(o(t.geometry),l(t.material));break;case"LineLoop":a=new f1(o(t.geometry),l(t.material));break;case"LineSegments":a=new $r(o(t.geometry),l(t.material));break;case"PointCloud":case"Points":a=new d1(o(t.geometry),l(t.material));break;case"Sprite":a=new mC(l(t.material));break;case"Group":a=new Qs;break;case"Bone":a=new ng;break;default:a=new Ge}if(a.uuid=t.uuid,t.name!==void 0&&(a.name=t.name),t.matrix!==void 0?(a.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=t.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(t.position!==void 0&&a.position.fromArray(t.position),t.rotation!==void 0&&a.rotation.fromArray(t.rotation),t.quaternion!==void 0&&a.quaternion.fromArray(t.quaternion),t.scale!==void 0&&a.scale.fromArray(t.scale)),t.up!==void 0&&a.up.fromArray(t.up),t.castShadow!==void 0&&(a.castShadow=t.castShadow),t.receiveShadow!==void 0&&(a.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.intensity!==void 0&&(a.shadow.intensity=t.shadow.intensity),t.shadow.bias!==void 0&&(a.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(a.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(a.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(a.visible=t.visible),t.frustumCulled!==void 0&&(a.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(a.renderOrder=t.renderOrder),t.userData!==void 0&&(a.userData=t.userData),t.layers!==void 0&&(a.layers.mask=t.layers),t.children!==void 0){const p=t.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,a=ta.get(t);if(a!==void 0){if(s.manager.itemStart(t),a.then){a.then(c=>{e&&e(c),s.manager.itemEnd(t)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(t,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return ta.add(t,c),e&&e(c),s.manager.itemEnd(t),c}).catch(function(c){r&&r(c),ta.remove(t),s.manager.itemError(t),s.manager.itemEnd(t)});ta.add(t,l),s.manager.itemStart(t)}}let kp;class R1{static getContext(){return kp===void 0&&(kp=new(window.AudioContext||window.webkitAudioContext)),kp}static setContext(t){kp=t}}class T4 extends di{constructor(t){super(t)}load(t,e,i,r){const s=this,a=new nr(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(l){try{const c=l.slice(0);R1.getContext().decodeAudioData(c,function(u){e(u)}).catch(o)}catch(c){o(c)}},i,r);function o(l){r?r(l):console.error(l),s.manager.itemError(t)}}}const OS=new de,FS=new de,vo=new de;class C4{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new cn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new cn,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){const 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){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,vo.copy(t.projectionMatrix);const r=e.eyeSep/2,s=r*e.near/e.focus,a=e.near*Math.tan(Xo*e.fov*.5)/e.zoom;let o,l;FS.elements[12]=-r,OS.elements[12]=r,o=-a*e.aspect+s,l=a*e.aspect+s,vo.elements[0]=2*e.near/(l-o),vo.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(vo),o=-a*e.aspect-s,l=a*e.aspect-s,vo.elements[0]=2*e.near/(l-o),vo.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(vo)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(FS),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(OS)}}class P1{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=US(),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){const e=US();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function US(){return(typeof performance>"u"?Date:performance).now()}const Mo=new U,kS=new Cn,R4=new U,wo=new U;class P4 extends Ge{constructor(){super(),this.type="AudioListener",this.context=R1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new P1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(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 this.filter!==null?(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);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Mo,kS,R4),wo.set(0,0,-1).applyQuaternion(kS),e.positionX){const r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Mo.x,r),e.positionY.linearRampToValueAtTime(Mo.y,r),e.positionZ.linearRampToValueAtTime(Mo.z,r),e.forwardX.linearRampToValueAtTime(wo.x,r),e.forwardY.linearRampToValueAtTime(wo.y,r),e.forwardZ.linearRampToValueAtTime(wo.z,r),e.upX.linearRampToValueAtTime(i.x,r),e.upY.linearRampToValueAtTime(i.y,r),e.upZ.linearRampToValueAtTime(i.z,r)}else e.setPosition(Mo.x,Mo.y,Mo.z),e.setOrientation(wo.x,wo.y,wo.z,i.x,i.y,i.z)}}class ZC extends Ge{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(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+t;const 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(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),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,r,this._addIndex*e,1,e);for(let l=e,c=e+e;l!==c;++l)if(i[l]!==i[l+e]){o.setValue(i,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,r=i*this._origIndex;t.getValue(e,r);for(let s=i,a=r;s!==a;++s)e[s]=e[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let a=0;a!==s;++a)t[e+a]=t[i+a]}_slerp(t,e,i,r){Cn.slerpFlat(t,e,t,e,t,i,r)}_slerpAdditive(t,e,i,r,s){const a=this._workIndex*s;Cn.multiplyQuaternionsFlat(t,a,t,e,t,i),Cn.slerpFlat(t,e,t,e,t,a,r)}_lerp(t,e,i,r,s){const a=1-r;for(let o=0;o!==s;++o){const l=e+o;t[l]=t[l]*a+t[i+o]*r}}_lerpAdditive(t,e,i,r,s){for(let a=0;a!==s;++a){const o=e+a;t[o]=t[o]+t[i+a]*r}}}const I1="\\[\\]\\.:\\/",N4=new RegExp("["+I1+"]","g"),L1="[^"+I1+"]",O4="[^"+I1.replace("\\.","")+"]",F4=/((?:WC+[\/:])*)/.source.replace("WC",L1),U4=/(WCOD+)?/.source.replace("WCOD",O4),k4=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",L1),z4=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",L1),B4=new RegExp("^"+F4+U4+k4+z4+"$"),H4=["material","materials","bones","map"];class G4{constructor(t,e,i){const r=i||Oe.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class Oe{constructor(t,e,i){this.path=e,this.parsedPath=i||Oe.parseTrackName(e),this.node=Oe.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 Oe.Composite(t,e,i):new Oe(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(N4,"")}static parseTrackName(t){const e=B4.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);H4.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){const i=function(s){for(let a=0;a=s){const u=s++,p=t[u];e[p.uuid]=h,t[h]=p,e[c]=u,t[u]=l;for(let m=0,g=r;m!==g;++m){const _=i[m],y=_[u],x=_[h];_[h]=y,_[u]=x}}}this.nCachedObjects_=s}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,a=t.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],h=c.uuid,u=e[h];if(u!==void 0)if(delete e[h],u0&&(e[m.uuid]=u),t[u]=m,t.pop();for(let g=0,_=r;g!==_;++g){const y=i[g];y[u]=y[p],y.pop()}}}this.nCachedObjects_=s}subscribe_(t,e){const i=this._bindingsIndicesByPath;let r=i[t];const s=this._bindings;if(r!==void 0)return s[r];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);r=s.length,i[t]=r,a.push(t),o.push(e),s.push(u);for(let p=h,m=l.length;p!==m;++p){const g=l[p];u[p]=new Oe(g,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(i!==void 0){const r=this._paths,s=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=t[o];e[c]=i,a[i]=l,a.pop(),s[i]=s[o],s.pop(),r[i]=r[o],r.pop()}}}class JC{constructor(t,e,i=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=r;const s=e.tracks,a=s.length,o=new Array(a),l={endingStart:Fo,endingEnd:Fo};for(let c=0;c!==a;++c){const h=s[c].createInterpolant(null);o[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=D2,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&&this.timeScale!==0&&this._startTime===null&&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){if(t.fadeOut(e),this.fadeIn(e),i){const r=this._clip.duration,s=t._clip.duration,a=s/r,o=r/s;t.warp(1,a,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return t!==null&&(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){const r=this._mixer,s=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=s,l[1]=s+i,c[0]=t/a,c[1]=e/a,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(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,r){if(!this.enabled){this._updateWeight(t);return}const s=this._startTime;if(s!==null){const l=(t-s)*i;l<0||i===0?e=0:(this._startTime=null,e=i*l)}e*=this._updateTimeScale(t);const a=this._updateTime(e),o=this._updateWeight(t);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Jv:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulateAdditive(o);break;case Y0:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(r,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let r=this.time+t,s=this._loopCount;const a=i===N2;if(t===0)return s===-1?r:a&&(s&1)===1?e-r:r;if(i===L2){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else if(r<0)r=0;else{this.time=r;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(s===-1&&(t>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=e||r<0){const o=Math.floor(r/e);r-=e*o,s+=Math.abs(o);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){const c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(a&&(s&1)===1)return e-r}return r}_setEndings(t,e,i){const r=this._interpolantSettings;i?(r.endingStart=Uo,r.endingEnd=Uo):(t?r.endingStart=this.zeroSlopeAtStart?Uo:Fo:r.endingStart=Xu,e?r.endingEnd=this.zeroSlopeAtEnd?Uo:Fo:r.endingEnd=Xu)}_scheduleFading(t,e,i){const r=this._mixer,s=r.time;let a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,l[0]=e,o[1]=s+t,l[1]=i,this}}const W4=new Float32Array(1);class j4 extends qr{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,r=t._clip.tracks,s=r.length,a=t._propertyBindings,o=t._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){const p=r[u],m=p.name;let g=h[m];if(g!==void 0)++g.referenceCount,a[u]=g;else{if(g=a[u],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const _=e&&e._propertyBindings[u].binding.parsedPath;g=new KC(Oe.create(i,m,_),p.ValueTypeName,p.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),a[u]=g}o[u].resultBuffer=g.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const i=(t._localRoot||this._root).uuid,r=t._clip.uuid,s=this._actionsByClip[r];this._bindAction(t,s&&s.knownActions[0]),this._addInactiveAction(t,r,i)}const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const s=e[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let i=0,r=e.length;i!==r;++i){const s=e[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const 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){const e=t._cacheIndex;return e!==null&&e=0;--i)t[i].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,r=this.time+=t,s=Math.sign(t),a=this._accuIndex^=1;for(let c=0;c!==i;++c)e[c]._update(r,t,s,a);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(a);return this}setTime(t){this.time=0;for(let e=0;e=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,GS).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)}}const VS=new U,zp=new U;class J4{constructor(t=new U,e=new U){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){VS.subVectors(t,this.start),zp.subVectors(this.end,this.start);const i=zp.dot(zp);let s=zp.dot(VS)/i;return e&&(s=pn(s,0,1)),s}closestPointToPoint(t,e,i){const r=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(r).add(this.start)}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)}}const WS=new U;class Q4 extends Ge{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new ve,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,l=32;a1)for(let u=0;u.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{YS.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(YS,e)}}setLength(t,e=t*.2,i=e*.2){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 f5 extends $r{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ve;r.setAttribute("position",new ae(e,3)),r.setAttribute("color",new ae(i,3));const s=new Kn({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(t,e,i){const r=new Ht,s=this.geometry.attributes.color.array;return r.set(t),r.toArray(s,0),r.toArray(s,3),r.set(e),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class d5{constructor(){this.type="ShapePath",this.color=new Ht,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Qu,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,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.currentPath.bezierCurveTo(t,e,i,r,s,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(x){const M=[];for(let b=0,S=x.length;bNumber.EPSILON){if(E<0&&(T=M[C],P=-P,N=M[R],E=-E),x.yN.y)continue;if(x.y===T.y){if(x.x===T.x)return!0}else{const L=E*(x.x-T.x)-P*(x.y-T.y);if(L===0)return!0;if(L<0)continue;S=!S}}else{if(x.y!==T.y)continue;if(N.x<=x.x&&x.x<=T.x||T.x<=x.x&&x.x<=N.x)return!0}}return S}const r=ws.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,l;const c=[];if(s.length===1)return o=s[0],l=new $o,l.curves=o.curves,c.push(l),c;let h=!r(s[0].getPoints());h=t?!h:h;const u=[],p=[];let m=[],g=0,_;p[g]=void 0,m[g]=[];for(let x=0,M=s.length;x1){let x=!1,M=0;for(let b=0,S=p.length;b0&&x===!1&&(m=u)}let y;for(let x=0,M=p.length;x{const{t}=sh(),e=3,[i,r]=Q.useState(0);return Q.useEffect(()=>{const s=Math.floor(Math.random()*e)+1;r(s)},[]),X.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%"},children:[X.jsx("p",{style:{margin:"20px"},children:t("loadingMessage.tip"+i.toString())}),X.jsx("div",{style:{width:"80%",maxWidth:"600px",margin:"0 auto"},children:X.jsx(BT,{value:n,width:"100%",hasStripe:!0})})]})};/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const tR="161",Q_=0,x5=1,_5=2,ZS=1,KS=100,JS=204,QS=205,tE=3,v5=0,eR=300,eE=1e3,jp=1001,nE=1002,iE=1003,M5=1006,w5=1008,b5=1009,S5=1014,E5=1015,A5=1020,T5=1023,Ix=1026,rE=1027,C5=3e3,Lx=3001,R5=0,Im="",kr="srgb",O1="srgb-linear",P5="display-p3",nR="display-p3-linear",tv="linear",sE="srgb",aE="rec709",oE="p3",Ql=7680,lE=519,I5=515,cE=35044,Xp=2e3,hE=2001;class vg{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,a=r.length;s>8&255]+ai[n>>16&255]+ai[n>>24&255]+"-"+ai[t&255]+ai[t>>8&255]+"-"+ai[t>>16&15|64]+ai[t>>24&255]+"-"+ai[e&63|128]+ai[e>>8&255]+"-"+ai[e>>16&255]+ai[e>>24&255]+ai[i&255]+ai[i>>8&255]+ai[i>>16&255]+ai[i>>24&255]).toLowerCase()}function Li(n,t,e){return Math.max(t,Math.min(e,n))}function L5(n,t){return(n%t+t)%t}function Dx(n,t,e){return(1-e)*n+e*t}function Jh(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ri(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class bi{constructor(t=0,e=0){bi.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 new 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 new 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){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Li(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const 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){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class to{constructor(t,e,i,r,s,a,o,l,c){to.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c)}set(t,e,i,r,s,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=r,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const 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){const 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){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],u=i[7],p=i[2],m=i[5],g=i[8],_=r[0],y=r[3],x=r[6],M=r[1],b=r[4],S=r[7],R=r[2],T=r[5],C=r[8];return s[0]=a*_+o*M+l*R,s[3]=a*y+o*b+l*T,s[6]=a*x+o*S+l*C,s[1]=c*_+h*M+u*R,s[4]=c*y+h*b+u*T,s[7]=c*x+h*S+u*C,s[2]=p*_+m*M+g*R,s[5]=p*y+m*b+g*T,s[8]=p*x+m*S+g*C,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-i*s*h+i*o*l+r*s*c-r*a*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,p=o*l-h*s,m=c*s-a*l,g=e*u+i*p+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(r*c-h*i)*_,t[2]=(o*i-r*a)*_,t[3]=p*_,t[4]=(h*e-r*l)*_,t[5]=(r*s-o*e)*_,t[6]=m*_,t[7]=(i*l-c*e)*_,t[8]=(a*e-i*s)*_,this}transpose(){let t;const 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){const 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,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-r*c,r*l,-r*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Nx.makeScale(t,e)),this}rotate(t){return this.premultiply(Nx.makeRotation(-t)),this}translate(t,e){return this.premultiply(Nx.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){const 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){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])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){const 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)}}const Nx=new to;function D5(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function uE(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const fE={};function Lm(n){n in fE||(fE[n]=!0,console.warn(n))}const dE=new to().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),pE=new to().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),qp={[O1]:{transfer:tv,primaries:aE,toReference:n=>n,fromReference:n=>n},[kr]:{transfer:sE,primaries:aE,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[nR]:{transfer:tv,primaries:oE,toReference:n=>n.applyMatrix3(pE),fromReference:n=>n.applyMatrix3(dE)},[P5]:{transfer:sE,primaries:oE,toReference:n=>n.convertSRGBToLinear().applyMatrix3(pE),fromReference:n=>n.applyMatrix3(dE).convertLinearToSRGB()}},N5=new Set([O1,nR]),Dr={enabled:!0,_workingColorSpace:O1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!N5.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;const i=qp[t].toReference,r=qp[e].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return qp[n].primaries},getTransfer:function(n){return n===Im?tv:qp[n].transfer}};function Dc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ox(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let tc;class O5{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{tc===void 0&&(tc=uE("canvas")),tc.width=t.width,tc.height=t.height;const i=tc.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=tc}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=uE("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==eR)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case eE:t.x=t.x-Math.floor(t.x);break;case jp:t.x=t.x<0?0:1;break;case nE:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case eE:t.y=t.y-Math.floor(t.y);break;case jp:t.y=t.y<0?0:1;break;case nE:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Lm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===kr?Lx:C5}set encoding(t){Lm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===Lx?kr:Im}}ka.DEFAULT_IMAGE=null;ka.DEFAULT_MAPPING=eR;ka.DEFAULT_ANISOTROPY=1;class Hf{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,a,o){let l=i[r+0],c=i[r+1],h=i[r+2],u=i[r+3];const p=s[a+0],m=s[a+1],g=s[a+2],_=s[a+3];if(o===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u;return}if(o===1){t[e+0]=p,t[e+1]=m,t[e+2]=g,t[e+3]=_;return}if(u!==_||l!==p||c!==m||h!==g){let y=1-o;const x=l*p+c*m+h*g+u*_,M=x>=0?1:-1,b=1-x*x;if(b>Number.EPSILON){const R=Math.sqrt(b),T=Math.atan2(R,x*M);y=Math.sin(y*T)/R,o=Math.sin(o*T)/R}const S=o*M;if(l=l*y+p*S,c=c*y+m*S,h=h*y+g*S,u=u*y+_*S,y===1-o){const R=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=R,c*=R,h*=R,u*=R}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],h=i[r+3],u=s[a],p=s[a+1],m=s[a+2],g=s[a+3];return t[e]=o*g+h*u+l*m-c*p,t[e+1]=l*g+h*p+c*u-o*m,t[e+2]=c*g+h*m+o*p-l*u,t[e+3]=h*g-o*u-l*p-c*m,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,r){return this._x=t,this._y=e,this._z=i,this._w=r,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){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(r/2),u=o(s/2),p=l(i/2),m=l(r/2),g=l(s/2);switch(a){case"XYZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"YXZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"ZXY":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"ZYX":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"YZX":this._x=p*h*u+c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u-p*m*g;break;case"XZY":this._x=p*h*u-c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],p=i+o+u;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(i>o&&i>u){const m=2*Math.sqrt(1+i-o-u);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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(Li(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,r),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 t===0?(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){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-i*c,this._z=s*h+a*c+i*l-r*o,this._w=a*h-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+i*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*i+e*this._x,this._y=m*r+e*this._y,this._z=m*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,p=Math.sin(e*h)/c;return this._w=a*u+this._w*p,this._x=i*u+this._x*p,this._y=r*u+this._y*p,this._z=s*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(e*Math.cos(r),i*Math.sin(s),i*Math.cos(s),e*Math.sin(r))}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 Pt{constructor(t=0,e=0,i=0){Pt.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(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 new 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 new 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(mE.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(mE.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*r-o*i),h=2*(o*e-s*r),u=2*(s*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-s*u,this.z=r+l*u+s*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ux.copy(this).projectOnVector(t),this.sub(Ux)}reflect(t){return this.sub(Ux.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Li(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}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){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*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){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}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(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ux=new Pt,mE=new Hf;class Gf{constructor(t=new Pt(1/0,1/0,1/0),e=new Pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Nr),Nr.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(Qh),Yp.subVectors(this.max,Qh),ec.subVectors(t.a,Qh),nc.subVectors(t.b,Qh),ic.subVectors(t.c,Qh),Aa.subVectors(nc,ec),Ta.subVectors(ic,nc),Eo.subVectors(ec,ic);let e=[0,-Aa.z,Aa.y,0,-Ta.z,Ta.y,0,-Eo.z,Eo.y,Aa.z,0,-Aa.x,Ta.z,0,-Ta.x,Eo.z,0,-Eo.x,-Aa.y,Aa.x,0,-Ta.y,Ta.x,0,-Eo.y,Eo.x,0];return!kx(e,ec,nc,ic,Yp)||(e=[1,0,0,0,1,0,0,0,1],!kx(e,ec,nc,ic,Yp))?!1:(Zp.crossVectors(Aa,Ta),e=[Zp.x,Zp.y,Zp.z],kx(e,ec,nc,ic,Yp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Nr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Nr).length()*.5),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()?this:(Hs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Hs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Hs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Hs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Hs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Hs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Hs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Hs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Hs),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)}}const Hs=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Nr=new Pt,$p=new Gf,ec=new Pt,nc=new Pt,ic=new Pt,Aa=new Pt,Ta=new Pt,Eo=new Pt,Qh=new Pt,Yp=new Pt,Zp=new Pt,Ao=new Pt;function kx(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Ao.fromArray(n,s);const o=r.x*Math.abs(Ao.x)+r.y*Math.abs(Ao.y)+r.z*Math.abs(Ao.z),l=t.dot(Ao),c=e.dot(Ao),h=i.dot(Ao);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const z5=new Gf,tu=new Pt,zx=new Pt;class iR{constructor(t=new Pt,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){const i=this.center;e!==void 0?i.copy(e):z5.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(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;tu.subVectors(t,this.center);const e=tu.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(tu,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(zx.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(tu.copy(t.center).add(zx)),this.expandByPoint(tu.copy(t.center).sub(zx))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Gs=new Pt,Bx=new Pt,Kp=new Pt,Ca=new Pt,Hx=new Pt,Jp=new Pt,Gx=new Pt;class B5{constructor(t=new Pt,e=new Pt(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,Gs)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const 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){const e=Gs.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Gs.copy(this.origin).addScaledVector(this.direction,e),Gs.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){Bx.copy(t).add(e).multiplyScalar(.5),Kp.copy(e).sub(t).normalize(),Ca.copy(this.origin).sub(Bx);const s=t.distanceTo(e)*.5,a=-this.direction.dot(Kp),o=Ca.dot(this.direction),l=-Ca.dot(Kp),c=Ca.lengthSq(),h=Math.abs(1-a*a);let u,p,m,g;if(h>0)if(u=a*l-o,p=a*o-l,g=s*h,u>=0)if(p>=-g)if(p<=g){const _=1/h;u*=_,p*=_,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*s+o)),p=u>0?-s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(u=Math.max(0,-(a*s+o)),p=u>0?s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c);else p=a>0?-s:s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Bx).addScaledVector(Kp,p),m}intersectSphere(t,e){Gs.subVectors(t.center,this.origin);const i=Gs.dot(this.direction),r=Gs.dot(Gs)-i*i,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,p=this.origin;return c>=0?(i=(t.min.x-p.x)*c,r=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,r=(t.min.x-p.x)*c),h>=0?(s=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(s=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a=0?(o=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(o=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),i>l||o>r)||((o>i||i!==i)&&(i=o),(l=0?i:r,e)}intersectsBox(t){return this.intersectBox(t,Gs)!==null}intersectTriangle(t,e,i,r,s){Hx.subVectors(e,t),Jp.subVectors(i,t),Gx.crossVectors(Hx,Jp);let a=this.direction.dot(Gx),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ca.subVectors(this.origin,t);const l=o*this.direction.dot(Jp.crossVectors(Ca,Jp));if(l<0)return null;const c=o*this.direction.dot(Hx.cross(Ca));if(c<0||l+c>a)return null;const h=-o*Ca.dot(Gx);return h<0?null:this.at(h/a,s)}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 Br{constructor(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){Br.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y)}set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){const x=this.elements;return x[0]=t,x[4]=e,x[8]=i,x[12]=r,x[1]=s,x[5]=a,x[9]=o,x[13]=l,x[2]=c,x[6]=h,x[10]=u,x[14]=p,x[3]=m,x[7]=g,x[11]=_,x[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 Br().fromArray(this.elements)}copy(t){const 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){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const 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 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){const e=this.elements,i=t.elements,r=1/rc.setFromMatrixColumn(t,0).length(),s=1/rc.setFromMatrixColumn(t,1).length(),a=1/rc.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-_*c,e[9]=-o*l,e[2]=_-p*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p+_*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=_+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p-_*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=_-p*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+_,e[1]=l*u,e[5]=_*c+p,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=_-p*u,e[8]=g*u+m,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*u+g,e[10]=p-_*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+_,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=_*u+p}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(H5,t,G5)}lookAt(t,e,i){const r=this.elements;return Xi.subVectors(t,e),Xi.lengthSq()===0&&(Xi.z=1),Xi.normalize(),Ra.crossVectors(i,Xi),Ra.lengthSq()===0&&(Math.abs(i.z)===1?Xi.x+=1e-4:Xi.z+=1e-4,Xi.normalize(),Ra.crossVectors(i,Xi)),Ra.normalize(),Qp.crossVectors(Xi,Ra),r[0]=Ra.x,r[4]=Qp.x,r[8]=Xi.x,r[1]=Ra.y,r[5]=Qp.y,r[9]=Xi.y,r[2]=Ra.z,r[6]=Qp.z,r[10]=Xi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],u=i[5],p=i[9],m=i[13],g=i[2],_=i[6],y=i[10],x=i[14],M=i[3],b=i[7],S=i[11],R=i[15],T=r[0],C=r[4],N=r[8],P=r[12],E=r[1],L=r[5],B=r[9],V=r[13],j=r[2],Y=r[6],q=r[10],at=r[14],G=r[3],nt=r[7],K=r[11],$=r[15];return s[0]=a*T+o*E+l*j+c*G,s[4]=a*C+o*L+l*Y+c*nt,s[8]=a*N+o*B+l*q+c*K,s[12]=a*P+o*V+l*at+c*$,s[1]=h*T+u*E+p*j+m*G,s[5]=h*C+u*L+p*Y+m*nt,s[9]=h*N+u*B+p*q+m*K,s[13]=h*P+u*V+p*at+m*$,s[2]=g*T+_*E+y*j+x*G,s[6]=g*C+_*L+y*Y+x*nt,s[10]=g*N+_*B+y*q+x*K,s[14]=g*P+_*V+y*at+x*$,s[3]=M*T+b*E+S*j+R*G,s[7]=M*C+b*L+S*Y+R*nt,s[11]=M*N+b*B+S*q+R*K,s[15]=M*P+b*V+S*at+R*$,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],p=t[10],m=t[14],g=t[3],_=t[7],y=t[11],x=t[15];return g*(+s*l*u-r*c*u-s*o*p+i*c*p+r*o*m-i*l*m)+_*(+e*l*m-e*c*p+s*a*p-r*a*m+r*c*h-s*l*h)+y*(+e*c*u-e*o*m-s*a*u+i*a*m+s*o*h-i*c*h)+x*(-r*o*h-e*l*u+e*o*p+r*a*u-i*a*p+i*l*h)}transpose(){const t=this.elements;let e;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(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],p=t[10],m=t[11],g=t[12],_=t[13],y=t[14],x=t[15],M=u*y*c-_*p*c+_*l*m-o*y*m-u*l*x+o*p*x,b=g*p*c-h*y*c-g*l*m+a*y*m+h*l*x-a*p*x,S=h*_*c-g*u*c+g*o*m-a*_*m-h*o*x+a*u*x,R=g*u*l-h*_*l-g*o*p+a*_*p+h*o*y-a*u*y,T=e*M+i*b+r*S+s*R;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/T;return t[0]=M*C,t[1]=(_*p*s-u*y*s-_*r*m+i*y*m+u*r*x-i*p*x)*C,t[2]=(o*y*s-_*l*s+_*r*c-i*y*c-o*r*x+i*l*x)*C,t[3]=(u*l*s-o*p*s-u*r*c+i*p*c+o*r*m-i*l*m)*C,t[4]=b*C,t[5]=(h*y*s-g*p*s+g*r*m-e*y*m-h*r*x+e*p*x)*C,t[6]=(g*l*s-a*y*s-g*r*c+e*y*c+a*r*x-e*l*x)*C,t[7]=(a*p*s-h*l*s+h*r*c-e*p*c-a*r*m+e*l*m)*C,t[8]=S*C,t[9]=(g*u*s-h*_*s-g*i*m+e*_*m+h*i*x-e*u*x)*C,t[10]=(a*_*s-g*o*s+g*i*c-e*_*c-a*i*x+e*o*x)*C,t[11]=(h*o*s-a*u*s-h*i*c+e*u*c+a*i*m-e*o*m)*C,t[12]=R*C,t[13]=(h*_*r-g*u*r+g*i*p-e*_*p-h*i*y+e*u*y)*C,t[14]=(g*o*r-a*_*r-g*i*l+e*_*l+a*i*y-e*o*y)*C,t[15]=(a*u*r-h*o*r+h*i*l-e*u*l-a*i*p+e*o*p)*C,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}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){const 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){const 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){const 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){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,l=t.z,c=s*a,h=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+i,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+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,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,h=a+a,u=o+o,p=s*c,m=s*h,g=s*u,_=a*h,y=a*u,x=o*u,M=l*c,b=l*h,S=l*u,R=i.x,T=i.y,C=i.z;return r[0]=(1-(_+x))*R,r[1]=(m+S)*R,r[2]=(g-b)*R,r[3]=0,r[4]=(m-S)*T,r[5]=(1-(p+x))*T,r[6]=(y+M)*T,r[7]=0,r[8]=(g+b)*C,r[9]=(y-M)*C,r[10]=(1-(p+_))*C,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=rc.set(r[0],r[1],r[2]).length();const a=rc.set(r[4],r[5],r[6]).length(),o=rc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],Or.copy(this);const c=1/s,h=1/a,u=1/o;return Or.elements[0]*=c,Or.elements[1]*=c,Or.elements[2]*=c,Or.elements[4]*=h,Or.elements[5]*=h,Or.elements[6]*=h,Or.elements[8]*=u,Or.elements[9]*=u,Or.elements[10]*=u,e.setFromRotationMatrix(Or),i.x=s,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,a,o=Xp){const l=this.elements,c=2*s/(e-t),h=2*s/(i-r),u=(e+t)/(e-t),p=(i+r)/(i-r);let m,g;if(o===Xp)m=-(a+s)/(a-s),g=-2*a*s/(a-s);else if(o===hE)m=-a/(a-s),g=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=Xp){const l=this.elements,c=1/(e-t),h=1/(i-r),u=1/(a-s),p=(e+t)*c,m=(i+r)*h;let g,_;if(o===Xp)g=(a+s)*u,_=-2*u;else if(o===hE)g=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=_,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])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){const 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}}const rc=new Pt,Or=new Br,H5=new Pt(0,0,0),G5=new Pt(1,1,1),Ra=new Pt,Qp=new Pt,Xi=new Pt,gE=new Br,yE=new Hf;class Mg{constructor(t=0,e=0,i=0,r=Mg.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}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,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,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){const r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],u=r[2],p=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(Li(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Li(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(Li(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Li(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Li(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Li(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return gE.makeRotationFromQuaternion(t),this.setFromRotationMatrix(gE,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return yE.setFromEuler(this),this.setFromQuaternion(yE,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],t[3]!==void 0&&(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}}Mg.DEFAULT_ORDER="XYZ";class V5{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){r.children=[];for(let o=0;o0){r.animations=[];for(let o=0;o0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),h.length>0&&(i.images=h),u.length>0&&(i.shapes=u),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=r,i;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}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)),e===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){Fr.subVectors(r,e),Ws.subVectors(i,e),Vx.subVectors(t,e);const a=Fr.dot(Fr),o=Fr.dot(Ws),l=Fr.dot(Vx),c=Ws.dot(Ws),h=Ws.dot(Vx),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return s.set(1-m-g,g,m)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,js)===null?!1:js.x>=0&&js.y>=0&&js.x+js.y<=1}static getInterpolation(t,e,i,r,s,a,o,l){return this.getBarycoord(t,e,i,r,js)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,js.x),l.addScaledVector(a,js.y),l.addScaledVector(o,js.z),l)}static isFrontFacing(t,e,i,r){return Fr.subVectors(i,e),Ws.subVectors(t,e),Fr.cross(Ws).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),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 Fr.subVectors(this.c,this.b),Ws.subVectors(this.a,this.b),Fr.cross(Ws).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ps.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ps.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return ps.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return ps.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ps.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let a,o;ac.subVectors(r,i),oc.subVectors(s,i),Wx.subVectors(t,i);const l=ac.dot(Wx),c=oc.dot(Wx);if(l<=0&&c<=0)return e.copy(i);jx.subVectors(t,r);const h=ac.dot(jx),u=oc.dot(jx);if(h>=0&&u<=h)return e.copy(r);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(ac,a);Xx.subVectors(t,s);const m=ac.dot(Xx),g=oc.dot(Xx);if(g>=0&&m<=g)return e.copy(s);const _=m*c-l*g;if(_<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(oc,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return wE.subVectors(s,r),o=(u-h)/(u-h+(m-g)),e.copy(r).addScaledVector(wE,o);const x=1/(y+_+p);return a=_*x,o=p*x,e.copy(i).addScaledVector(ac,a).addScaledVector(oc,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const rR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pa={h:0,s:0,l:0},em={h:0,s:0,l:0};function qx(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Zc{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){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=kr){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Dr.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=Dr.workingColorSpace){return this.r=t,this.g=e,this.b=i,Dr.toWorkingColorSpace(this,r),this}setHSL(t,e,i,r=Dr.workingColorSpace){if(t=L5(t,1),e=Li(e,0,1),i=Li(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=qx(a,s,t+1/3),this.g=qx(a,s,t),this.b=qx(a,s,t-1/3)}return Dr.toWorkingColorSpace(this,r),this}setStyle(t,e=kr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=kr){const i=rR[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.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=Dc(t.r),this.g=Dc(t.g),this.b=Dc(t.b),this}copyLinearToSRGB(t){return this.r=Ox(t.r),this.g=Ox(t.g),this.b=Ox(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=kr){return Dr.fromWorkingColorSpace(oi.copy(this),t),Math.round(Li(oi.r*255,0,255))*65536+Math.round(Li(oi.g*255,0,255))*256+Math.round(Li(oi.b*255,0,255))}getHexString(t=kr){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Dr.workingColorSpace){Dr.fromWorkingColorSpace(oi.copy(this),e);const i=oi.r,r=oi.g,s=oi.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case i:l=(r-s)/u+(r0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(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),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ZS&&(i.blending=this.blending),this.side!==Q_&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==JS&&(i.blendSrc=this.blendSrc),this.blendDst!==QS&&(i.blendDst=this.blendDst),this.blendEquation!==KS&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==tE&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==lE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ql&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ql&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ql&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}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;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++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.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Z5 extends sR{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Zc(16777215),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.combine=v5,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.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}}const An=new Pt,nm=new bi;class ia{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=cE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=E5,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Lm("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.itemSize;r0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),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;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],u=s[c];for(let p=0,m=u.length;p0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s(t.far-t.near)**2))&&(bE.copy(s).invert(),To.copy(t.ray).applyMatrix4(bE),!(i.boundingBox!==null&&To.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,To)))}_computeIntersections(t,e,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,p=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,_=p.length;g<_;g++){const y=p[g],x=a[y.materialIndex],M=Math.max(y.start,m.start),b=Math.min(o.count,Math.min(y.start+y.count,m.start+m.count));for(let S=M,R=b;Se.far?null:{distance:c,point:cm.clone(),object:n}}function hm(n,t,e,i,r,s,a,o,l,c){n.getVertexPosition(o,cc),n.getVertexPosition(l,hc),n.getVertexPosition(c,uc);const h=e6(n,t,e,i,cc,hc,uc,lm);if(h){r&&(sm.fromBufferAttribute(r,o),am.fromBufferAttribute(r,l),om.fromBufferAttribute(r,c),h.uv=ps.getInterpolation(lm,cc,hc,uc,sm,am,om,new bi)),s&&(sm.fromBufferAttribute(s,o),am.fromBufferAttribute(s,l),om.fromBufferAttribute(s,c),h.uv1=ps.getInterpolation(lm,cc,hc,uc,sm,am,om,new bi),h.uv2=h.uv1),a&&(EE.fromBufferAttribute(a,o),AE.fromBufferAttribute(a,l),TE.fromBufferAttribute(a,c),h.normal=ps.getInterpolation(lm,cc,hc,uc,EE,AE,TE,new Pt),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new Pt,materialIndex:0};ps.getNormal(cc,hc,uc,u.normal),h.face=u}return h}class n6 extends ka{constructor(t,e,i,r,s,a,o,l,c,h){if(h=h!==void 0?h:Ix,h!==Ix&&h!==rE)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Ix&&(i=S5),i===void 0&&h===rE&&(i=A5),super(null,r,s,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:iE,this.minFilter=l!==void 0?l:iE,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}const i6=new n6(1,1);i6.compareFunction=I5;class r6 extends sR{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Zc(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Zc(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=R5,this.normalScale=new bi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,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.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,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}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:tR}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=tR);function CE(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),r=new Set(Object.keys(n[0].morphAttributes)),s={},a={},o=n[0].morphTargetsRelative,l=new Vf;let c=0;for(let h=0;hs6(n,t,e)}function dh(n,t){return Jn(aR(n,t).get)}const{apply:s6,construct:hY,defineProperty:uY,get:fY,getOwnPropertyDescriptor:aR,getPrototypeOf:F1,has:dY,ownKeys:a6,set:pY,setPrototypeOf:mY}=Reflect,{iterator:Wf,species:gY,toStringTag:o6,for:yY}=Symbol,l6=Object,{create:U1,defineProperty:c6,freeze:xY,is:_Y}=l6,h6=Array,u6=h6.prototype,oR=u6[Wf],f6=Jn(oR),lR=ArrayBuffer,d6=lR.prototype;dh(d6,"byteLength");const PE=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;PE&&dh(PE.prototype,"byteLength");const cR=F1(Uint8Array);cR.from;const Si=cR.prototype;Si[Wf];Jn(Si.keys);Jn(Si.values);Jn(Si.entries);Jn(Si.set);Jn(Si.reverse);Jn(Si.fill);Jn(Si.copyWithin);Jn(Si.sort);Jn(Si.slice);Jn(Si.subarray);dh(Si,"buffer");dh(Si,"byteOffset");dh(Si,"length");dh(Si,o6);const p6=Uint8Array,hR=Uint16Array,k1=Uint32Array,m6=Float32Array,af=F1([][Wf]()),uR=Jn(af.next),g6=Jn(function*(){}().next),y6=F1(af),x6=DataView.prototype,_6=Jn(x6.getUint16),z1=WeakMap,fR=z1.prototype,dR=Jn(fR.get),v6=Jn(fR.set),pR=new z1,M6=U1(null,{next:{value:function(){const t=dR(pR,this);return uR(t)}},[Wf]:{value:function(){return this}}});function w6(n){if(n[Wf]===oR&&af.next===uR)return n;const t=U1(M6);return v6(pR,t,f6(n)),t}const b6=new z1,S6=U1(y6,{next:{value:function(){const t=dR(b6,this);return g6(t)},writable:!0,configurable:!0}});for(const n of a6(af))n!=="next"&&c6(S6,n,aR(af,n));const mR=new lR(4),E6=new m6(mR),A6=new k1(mR),os=new hR(512),ls=new p6(512);for(let n=0;n<256;++n){const t=n-127;t<-24?(os[n]=0,os[n|256]=32768,ls[n]=24,ls[n|256]=24):t<-14?(os[n]=1024>>-t-14,os[n|256]=1024>>-t-14|32768,ls[n]=-t-1,ls[n|256]=-t-1):t<=15?(os[n]=t+15<<10,os[n|256]=t+15<<10|32768,ls[n]=13,ls[n|256]=13):t<128?(os[n]=31744,os[n|256]=64512,ls[n]=24,ls[n|256]=24):(os[n]=31744,os[n|256]=64512,ls[n]=13,ls[n|256]=13)}const B1=new k1(2048);for(let n=1;n<1024;++n){let t=n<<13,e=0;for(;!(t&8388608);)t<<=1,e-=8388608;t&=-8388609,e+=947912704,B1[n]=t|e}for(let n=1024;n<2048;++n)B1[n]=939524096+(n-1024<<13);const ph=new k1(64);for(let n=1;n<31;++n)ph[n]=n<<23;ph[31]=1199570944;ph[32]=2147483648;for(let n=33;n<63;++n)ph[n]=2147483648+(n-32<<23);ph[63]=3347054592;const gR=new hR(64);for(let n=1;n<64;++n)n!==32&&(gR[n]=1024);function T6(n){const t=n>>10;return A6[0]=B1[gR[t]+(n&1023)]+ph[t],E6[0]}function yR(n,t,...e){return T6(_6(n,t,...w6(e)))}var H1={exports:{}};function xR(n,t,e){const i=e&&e.debug||!1;i&&console.log("[xml-utils] getting "+t+" in "+n);const r=typeof n=="object"?n.outer:n,s=r.slice(0,r.indexOf(">")+1),a=['"',"'"];for(let o=0;o>8&255]+ai[n>>16&255]+ai[n>>24&255]+"-"+ai[t&255]+ai[t>>8&255]+"-"+ai[t>>16&15|64]+ai[t>>24&255]+"-"+ai[e&63|128]+ai[e>>8&255]+"-"+ai[e>>16&255]+ai[e>>24&255]+ai[i&255]+ai[i>>8&255]+ai[i>>16&255]+ai[i>>24&255]).toLowerCase()}function Li(n,t,e){return Math.max(t,Math.min(e,n))}function L5(n,t){return(n%t+t)%t}function Dx(n,t,e){return(1-e)*n+e*t}function Jh(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ri(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class bi{constructor(t=0,e=0){bi.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 new 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 new 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){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Li(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const 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){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class to{constructor(t,e,i,r,s,a,o,l,c){to.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c)}set(t,e,i,r,s,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=r,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=i,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const 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){const 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){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],h=i[4],u=i[7],p=i[2],m=i[5],g=i[8],_=r[0],y=r[3],x=r[6],M=r[1],b=r[4],S=r[7],R=r[2],C=r[5],T=r[8];return s[0]=a*_+o*M+l*R,s[3]=a*y+o*b+l*C,s[6]=a*x+o*S+l*T,s[1]=c*_+h*M+u*R,s[4]=c*y+h*b+u*C,s[7]=c*x+h*S+u*T,s[2]=p*_+m*M+g*R,s[5]=p*y+m*b+g*C,s[8]=p*x+m*S+g*T,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-i*s*h+i*o*l+r*s*c-r*a*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,p=o*l-h*s,m=c*s-a*l,g=e*u+i*p+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(r*c-h*i)*_,t[2]=(o*i-r*a)*_,t[3]=p*_,t[4]=(h*e-r*l)*_,t[5]=(r*s-o*e)*_,t[6]=m*_,t[7]=(i*l-c*e)*_,t[8]=(a*e-i*s)*_,this}transpose(){let t;const 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){const 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,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+t,-r*c,r*l,-r*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Nx.makeScale(t,e)),this}rotate(t){return this.premultiply(Nx.makeRotation(-t)),this}translate(t,e){return this.premultiply(Nx.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){const 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){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])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){const 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)}}const Nx=new to;function D5(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function uE(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const fE={};function Lm(n){n in fE||(fE[n]=!0,console.warn(n))}const dE=new to().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),pE=new to().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),qp={[O1]:{transfer:tv,primaries:aE,toReference:n=>n,fromReference:n=>n},[kr]:{transfer:sE,primaries:aE,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[nR]:{transfer:tv,primaries:oE,toReference:n=>n.applyMatrix3(pE),fromReference:n=>n.applyMatrix3(dE)},[P5]:{transfer:sE,primaries:oE,toReference:n=>n.convertSRGBToLinear().applyMatrix3(pE),fromReference:n=>n.applyMatrix3(dE).convertLinearToSRGB()}},N5=new Set([O1,nR]),Dr={enabled:!0,_workingColorSpace:O1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!N5.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;const i=qp[t].toReference,r=qp[e].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this._workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this._workingColorSpace)},getPrimaries:function(n){return qp[n].primaries},getTransfer:function(n){return n===Im?tv:qp[n].transfer}};function Dc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ox(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let tc;class O5{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{tc===void 0&&(tc=uE("canvas")),tc.width=t.width,tc.height=t.height;const i=tc.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=tc}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=uE("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==eR)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case eE:t.x=t.x-Math.floor(t.x);break;case jp:t.x=t.x<0?0:1;break;case nE:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case eE:t.y=t.y-Math.floor(t.y);break;case jp:t.y=t.y<0?0:1;break;case nE:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Lm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===kr?Lx:C5}set encoding(t){Lm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===Lx?kr:Im}}ka.DEFAULT_IMAGE=null;ka.DEFAULT_MAPPING=eR;ka.DEFAULT_ANISOTROPY=1;class Hf{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,a,o){let l=i[r+0],c=i[r+1],h=i[r+2],u=i[r+3];const p=s[a+0],m=s[a+1],g=s[a+2],_=s[a+3];if(o===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u;return}if(o===1){t[e+0]=p,t[e+1]=m,t[e+2]=g,t[e+3]=_;return}if(u!==_||l!==p||c!==m||h!==g){let y=1-o;const x=l*p+c*m+h*g+u*_,M=x>=0?1:-1,b=1-x*x;if(b>Number.EPSILON){const R=Math.sqrt(b),C=Math.atan2(R,x*M);y=Math.sin(y*C)/R,o=Math.sin(o*C)/R}const S=o*M;if(l=l*y+p*S,c=c*y+m*S,h=h*y+g*S,u=u*y+_*S,y===1-o){const R=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=R,c*=R,h*=R,u*=R}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],h=i[r+3],u=s[a],p=s[a+1],m=s[a+2],g=s[a+3];return t[e]=o*g+h*u+l*m-c*p,t[e+1]=l*g+h*p+c*u-o*m,t[e+2]=c*g+h*m+o*p-l*u,t[e+3]=h*g-o*u-l*p-c*m,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,r){return this._x=t,this._y=e,this._z=i,this._w=r,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){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(i/2),h=o(r/2),u=o(s/2),p=l(i/2),m=l(r/2),g=l(s/2);switch(a){case"XYZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"YXZ":this._x=p*h*u+c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"ZXY":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u-p*m*g;break;case"ZYX":this._x=p*h*u-c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u+p*m*g;break;case"YZX":this._x=p*h*u+c*m*g,this._y=c*m*u+p*h*g,this._z=c*h*g-p*m*u,this._w=c*h*u-p*m*g;break;case"XZY":this._x=p*h*u-c*m*g,this._y=c*m*u-p*h*g,this._z=c*h*g+p*m*u,this._w=c*h*u+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],p=i+o+u;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(i>o&&i>u){const m=2*Math.sqrt(1+i-o-u);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-i-u);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+u-i-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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(Li(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,r),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 t===0?(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){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-i*c,this._z=s*h+a*c+i*l-r*o,this._w=a*h-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+i*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*i+e*this._x,this._y=m*r+e*this._y,this._z=m*s+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,p=Math.sin(e*h)/c;return this._w=a*u+this._w*p,this._x=i*u+this._x*p,this._y=r*u+this._y*p,this._z=s*u+this._z*p,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(e*Math.cos(r),i*Math.sin(s),i*Math.cos(s),e*Math.sin(r))}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 Pt{constructor(t=0,e=0,i=0){Pt.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(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 new 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 new 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(mE.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(mE.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*r-o*i),h=2*(o*e-s*r),u=2*(s*i-a*e);return this.x=e+l*c+a*u-o*h,this.y=i+l*h+o*c-s*u,this.z=r+l*u+s*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ux.copy(this).projectOnVector(t),this.sub(Ux)}reflect(t){return this.sub(Ux.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Li(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}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){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*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){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}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(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ux=new Pt,mE=new Hf;class Gf{constructor(t=new Pt(1/0,1/0,1/0),e=new Pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Nr),Nr.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(Qh),Yp.subVectors(this.max,Qh),ec.subVectors(t.a,Qh),nc.subVectors(t.b,Qh),ic.subVectors(t.c,Qh),Aa.subVectors(nc,ec),Ta.subVectors(ic,nc),Eo.subVectors(ec,ic);let e=[0,-Aa.z,Aa.y,0,-Ta.z,Ta.y,0,-Eo.z,Eo.y,Aa.z,0,-Aa.x,Ta.z,0,-Ta.x,Eo.z,0,-Eo.x,-Aa.y,Aa.x,0,-Ta.y,Ta.x,0,-Eo.y,Eo.x,0];return!kx(e,ec,nc,ic,Yp)||(e=[1,0,0,0,1,0,0,0,1],!kx(e,ec,nc,ic,Yp))?!1:(Zp.crossVectors(Aa,Ta),e=[Zp.x,Zp.y,Zp.z],kx(e,ec,nc,ic,Yp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Nr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Nr).length()*.5),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()?this:(Hs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Hs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Hs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Hs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Hs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Hs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Hs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Hs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Hs),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)}}const Hs=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Nr=new Pt,$p=new Gf,ec=new Pt,nc=new Pt,ic=new Pt,Aa=new Pt,Ta=new Pt,Eo=new Pt,Qh=new Pt,Yp=new Pt,Zp=new Pt,Ao=new Pt;function kx(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Ao.fromArray(n,s);const o=r.x*Math.abs(Ao.x)+r.y*Math.abs(Ao.y)+r.z*Math.abs(Ao.z),l=t.dot(Ao),c=e.dot(Ao),h=i.dot(Ao);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const z5=new Gf,tu=new Pt,zx=new Pt;class iR{constructor(t=new Pt,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){const i=this.center;e!==void 0?i.copy(e):z5.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(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;tu.subVectors(t,this.center);const e=tu.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(tu,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(zx.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(tu.copy(t.center).add(zx)),this.expandByPoint(tu.copy(t.center).sub(zx))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Gs=new Pt,Bx=new Pt,Kp=new Pt,Ca=new Pt,Hx=new Pt,Jp=new Pt,Gx=new Pt;class B5{constructor(t=new Pt,e=new Pt(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,Gs)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const 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){const e=Gs.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Gs.copy(this.origin).addScaledVector(this.direction,e),Gs.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){Bx.copy(t).add(e).multiplyScalar(.5),Kp.copy(e).sub(t).normalize(),Ca.copy(this.origin).sub(Bx);const s=t.distanceTo(e)*.5,a=-this.direction.dot(Kp),o=Ca.dot(this.direction),l=-Ca.dot(Kp),c=Ca.lengthSq(),h=Math.abs(1-a*a);let u,p,m,g;if(h>0)if(u=a*l-o,p=a*o-l,g=s*h,u>=0)if(p>=-g)if(p<=g){const _=1/h;u*=_,p*=_,m=u*(u+a*p+2*o)+p*(a*u+p+2*l)+c}else p=s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p=-s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;else p<=-g?(u=Math.max(0,-(-a*s+o)),p=u>0?-s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c):p<=g?(u=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(u=Math.max(0,-(a*s+o)),p=u>0?s:Math.min(Math.max(-s,-l),s),m=-u*u+p*(p+2*l)+c);else p=a>0?-s:s,u=Math.max(0,-(a*p+o)),m=-u*u+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Bx).addScaledVector(Kp,p),m}intersectSphere(t,e){Gs.subVectors(t.center,this.origin);const i=Gs.dot(this.direction),r=Gs.dot(Gs)-i*i,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,p=this.origin;return c>=0?(i=(t.min.x-p.x)*c,r=(t.max.x-p.x)*c):(i=(t.max.x-p.x)*c,r=(t.min.x-p.x)*c),h>=0?(s=(t.min.y-p.y)*h,a=(t.max.y-p.y)*h):(s=(t.max.y-p.y)*h,a=(t.min.y-p.y)*h),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a=0?(o=(t.min.z-p.z)*u,l=(t.max.z-p.z)*u):(o=(t.max.z-p.z)*u,l=(t.min.z-p.z)*u),i>l||o>r)||((o>i||i!==i)&&(i=o),(l=0?i:r,e)}intersectsBox(t){return this.intersectBox(t,Gs)!==null}intersectTriangle(t,e,i,r,s){Hx.subVectors(e,t),Jp.subVectors(i,t),Gx.crossVectors(Hx,Jp);let a=this.direction.dot(Gx),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ca.subVectors(this.origin,t);const l=o*this.direction.dot(Jp.crossVectors(Ca,Jp));if(l<0)return null;const c=o*this.direction.dot(Hx.cross(Ca));if(c<0||l+c>a)return null;const h=-o*Ca.dot(Gx);return h<0?null:this.at(h/a,s)}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 Br{constructor(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){Br.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y)}set(t,e,i,r,s,a,o,l,c,h,u,p,m,g,_,y){const x=this.elements;return x[0]=t,x[4]=e,x[8]=i,x[12]=r,x[1]=s,x[5]=a,x[9]=o,x[13]=l,x[2]=c,x[6]=h,x[10]=u,x[14]=p,x[3]=m,x[7]=g,x[11]=_,x[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 Br().fromArray(this.elements)}copy(t){const 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){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const 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 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){const e=this.elements,i=t.elements,r=1/rc.setFromMatrixColumn(t,0).length(),s=1/rc.setFromMatrixColumn(t,1).length(),a=1/rc.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(t.order==="XYZ"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=m+g*c,e[5]=p-_*c,e[9]=-o*l,e[2]=_-p*c,e[6]=g+m*c,e[10]=a*l}else if(t.order==="YXZ"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p+_*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=_+p*o,e[10]=a*l}else if(t.order==="ZXY"){const p=l*h,m=l*u,g=c*h,_=c*u;e[0]=p-_*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=_-p*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const p=a*h,m=a*u,g=o*h,_=o*u;e[0]=l*h,e[4]=g*c-m,e[8]=p*c+_,e[1]=l*u,e[5]=_*c+p,e[9]=m*c-g,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=_-p*u,e[8]=g*u+m,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=m*u+g,e[10]=p-_*u}else if(t.order==="XZY"){const p=a*l,m=a*c,g=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=p*u+_,e[5]=a*h,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*h,e[10]=_*u+p}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(H5,t,G5)}lookAt(t,e,i){const r=this.elements;return Xi.subVectors(t,e),Xi.lengthSq()===0&&(Xi.z=1),Xi.normalize(),Ra.crossVectors(i,Xi),Ra.lengthSq()===0&&(Math.abs(i.z)===1?Xi.x+=1e-4:Xi.z+=1e-4,Xi.normalize(),Ra.crossVectors(i,Xi)),Ra.normalize(),Qp.crossVectors(Xi,Ra),r[0]=Ra.x,r[4]=Qp.x,r[8]=Xi.x,r[1]=Ra.y,r[5]=Qp.y,r[9]=Xi.y,r[2]=Ra.z,r[6]=Qp.z,r[10]=Xi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],h=i[1],u=i[5],p=i[9],m=i[13],g=i[2],_=i[6],y=i[10],x=i[14],M=i[3],b=i[7],S=i[11],R=i[15],C=r[0],T=r[4],N=r[8],P=r[12],E=r[1],L=r[5],B=r[9],V=r[13],j=r[2],Y=r[6],q=r[10],at=r[14],G=r[3],tt=r[7],K=r[11],$=r[15];return s[0]=a*C+o*E+l*j+c*G,s[4]=a*T+o*L+l*Y+c*tt,s[8]=a*N+o*B+l*q+c*K,s[12]=a*P+o*V+l*at+c*$,s[1]=h*C+u*E+p*j+m*G,s[5]=h*T+u*L+p*Y+m*tt,s[9]=h*N+u*B+p*q+m*K,s[13]=h*P+u*V+p*at+m*$,s[2]=g*C+_*E+y*j+x*G,s[6]=g*T+_*L+y*Y+x*tt,s[10]=g*N+_*B+y*q+x*K,s[14]=g*P+_*V+y*at+x*$,s[3]=M*C+b*E+S*j+R*G,s[7]=M*T+b*L+S*Y+R*tt,s[11]=M*N+b*B+S*q+R*K,s[15]=M*P+b*V+S*at+R*$,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],p=t[10],m=t[14],g=t[3],_=t[7],y=t[11],x=t[15];return g*(+s*l*u-r*c*u-s*o*p+i*c*p+r*o*m-i*l*m)+_*(+e*l*m-e*c*p+s*a*p-r*a*m+r*c*h-s*l*h)+y*(+e*c*u-e*o*m-s*a*u+i*a*m+s*o*h-i*c*h)+x*(-r*o*h-e*l*u+e*o*p+r*a*u-i*a*p+i*l*h)}transpose(){const t=this.elements;let e;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(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],p=t[10],m=t[11],g=t[12],_=t[13],y=t[14],x=t[15],M=u*y*c-_*p*c+_*l*m-o*y*m-u*l*x+o*p*x,b=g*p*c-h*y*c-g*l*m+a*y*m+h*l*x-a*p*x,S=h*_*c-g*u*c+g*o*m-a*_*m-h*o*x+a*u*x,R=g*u*l-h*_*l-g*o*p+a*_*p+h*o*y-a*u*y,C=e*M+i*b+r*S+s*R;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return t[0]=M*T,t[1]=(_*p*s-u*y*s-_*r*m+i*y*m+u*r*x-i*p*x)*T,t[2]=(o*y*s-_*l*s+_*r*c-i*y*c-o*r*x+i*l*x)*T,t[3]=(u*l*s-o*p*s-u*r*c+i*p*c+o*r*m-i*l*m)*T,t[4]=b*T,t[5]=(h*y*s-g*p*s+g*r*m-e*y*m-h*r*x+e*p*x)*T,t[6]=(g*l*s-a*y*s-g*r*c+e*y*c+a*r*x-e*l*x)*T,t[7]=(a*p*s-h*l*s+h*r*c-e*p*c-a*r*m+e*l*m)*T,t[8]=S*T,t[9]=(g*u*s-h*_*s-g*i*m+e*_*m+h*i*x-e*u*x)*T,t[10]=(a*_*s-g*o*s+g*i*c-e*_*c-a*i*x+e*o*x)*T,t[11]=(h*o*s-a*u*s-h*i*c+e*u*c+a*i*m-e*o*m)*T,t[12]=R*T,t[13]=(h*_*r-g*u*r+g*i*p-e*_*p-h*i*y+e*u*y)*T,t[14]=(g*o*r-a*_*r-g*i*l+e*_*l+a*i*y-e*o*y)*T,t[15]=(a*u*r-h*o*r+h*i*l-e*u*l-a*i*p+e*o*p)*T,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}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){const 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){const 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){const 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){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,l=t.z,c=s*a,h=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+i,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+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,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,c=s+s,h=a+a,u=o+o,p=s*c,m=s*h,g=s*u,_=a*h,y=a*u,x=o*u,M=l*c,b=l*h,S=l*u,R=i.x,C=i.y,T=i.z;return r[0]=(1-(_+x))*R,r[1]=(m+S)*R,r[2]=(g-b)*R,r[3]=0,r[4]=(m-S)*C,r[5]=(1-(p+x))*C,r[6]=(y+M)*C,r[7]=0,r[8]=(g+b)*T,r[9]=(y-M)*T,r[10]=(1-(p+_))*T,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=rc.set(r[0],r[1],r[2]).length();const a=rc.set(r[4],r[5],r[6]).length(),o=rc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],Or.copy(this);const c=1/s,h=1/a,u=1/o;return Or.elements[0]*=c,Or.elements[1]*=c,Or.elements[2]*=c,Or.elements[4]*=h,Or.elements[5]*=h,Or.elements[6]*=h,Or.elements[8]*=u,Or.elements[9]*=u,Or.elements[10]*=u,e.setFromRotationMatrix(Or),i.x=s,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,a,o=Xp){const l=this.elements,c=2*s/(e-t),h=2*s/(i-r),u=(e+t)/(e-t),p=(i+r)/(i-r);let m,g;if(o===Xp)m=-(a+s)/(a-s),g=-2*a*s/(a-s);else if(o===hE)m=-a/(a-s),g=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=g,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=Xp){const l=this.elements,c=1/(e-t),h=1/(i-r),u=1/(a-s),p=(e+t)*c,m=(i+r)*h;let g,_;if(o===Xp)g=(a+s)*u,_=-2*u;else if(o===hE)g=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=_,l[14]=-g,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])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){const 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}}const rc=new Pt,Or=new Br,H5=new Pt(0,0,0),G5=new Pt(1,1,1),Ra=new Pt,Qp=new Pt,Xi=new Pt,gE=new Br,yE=new Hf;class Mg{constructor(t=0,e=0,i=0,r=Mg.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}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,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,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){const r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],u=r[2],p=r[6],m=r[10];switch(e){case"XYZ":this._y=Math.asin(Li(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Li(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(Li(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Li(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Li(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-Li(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return gE.makeRotationFromQuaternion(t),this.setFromRotationMatrix(gE,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return yE.setFromEuler(this),this.setFromQuaternion(yE,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],t[3]!==void 0&&(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}}Mg.DEFAULT_ORDER="XYZ";class V5{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c0){r.children=[];for(let o=0;o0){r.animations=[];for(let o=0;o0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),h.length>0&&(i.images=h),u.length>0&&(i.shapes=u),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=r,i;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}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)),e===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){Fr.subVectors(r,e),Ws.subVectors(i,e),Vx.subVectors(t,e);const a=Fr.dot(Fr),o=Fr.dot(Ws),l=Fr.dot(Vx),c=Ws.dot(Ws),h=Ws.dot(Vx),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const p=1/u,m=(c*l-o*h)*p,g=(a*h-o*l)*p;return s.set(1-m-g,g,m)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,js)===null?!1:js.x>=0&&js.y>=0&&js.x+js.y<=1}static getInterpolation(t,e,i,r,s,a,o,l){return this.getBarycoord(t,e,i,r,js)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,js.x),l.addScaledVector(a,js.y),l.addScaledVector(o,js.z),l)}static isFrontFacing(t,e,i,r){return Fr.subVectors(i,e),Ws.subVectors(t,e),Fr.cross(Ws).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),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 Fr.subVectors(this.c,this.b),Ws.subVectors(this.a,this.b),Fr.cross(Ws).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ps.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ps.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return ps.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return ps.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ps.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let a,o;ac.subVectors(r,i),oc.subVectors(s,i),Wx.subVectors(t,i);const l=ac.dot(Wx),c=oc.dot(Wx);if(l<=0&&c<=0)return e.copy(i);jx.subVectors(t,r);const h=ac.dot(jx),u=oc.dot(jx);if(h>=0&&u<=h)return e.copy(r);const p=l*u-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(ac,a);Xx.subVectors(t,s);const m=ac.dot(Xx),g=oc.dot(Xx);if(g>=0&&m<=g)return e.copy(s);const _=m*c-l*g;if(_<=0&&c>=0&&g<=0)return o=c/(c-g),e.copy(i).addScaledVector(oc,o);const y=h*g-m*u;if(y<=0&&u-h>=0&&m-g>=0)return wE.subVectors(s,r),o=(u-h)/(u-h+(m-g)),e.copy(r).addScaledVector(wE,o);const x=1/(y+_+p);return a=_*x,o=p*x,e.copy(i).addScaledVector(ac,a).addScaledVector(oc,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const rR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pa={h:0,s:0,l:0},em={h:0,s:0,l:0};function qx(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Zc{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){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=kr){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Dr.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=Dr.workingColorSpace){return this.r=t,this.g=e,this.b=i,Dr.toWorkingColorSpace(this,r),this}setHSL(t,e,i,r=Dr.workingColorSpace){if(t=L5(t,1),e=Li(e,0,1),i=Li(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=qx(a,s,t+1/3),this.g=qx(a,s,t),this.b=qx(a,s,t-1/3)}return Dr.toWorkingColorSpace(this,r),this}setStyle(t,e=kr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=kr){const i=rR[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.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=Dc(t.r),this.g=Dc(t.g),this.b=Dc(t.b),this}copyLinearToSRGB(t){return this.r=Ox(t.r),this.g=Ox(t.g),this.b=Ox(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=kr){return Dr.fromWorkingColorSpace(oi.copy(this),t),Math.round(Li(oi.r*255,0,255))*65536+Math.round(Li(oi.g*255,0,255))*256+Math.round(Li(oi.b*255,0,255))}getHexString(t=kr){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Dr.workingColorSpace){Dr.fromWorkingColorSpace(oi.copy(this),e);const i=oi.r,r=oi.g,s=oi.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case i:l=(r-s)/u+(r0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(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),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==ZS&&(i.blending=this.blending),this.side!==Q_&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==JS&&(i.blendSrc=this.blendSrc),this.blendDst!==QS&&(i.blendDst=this.blendDst),this.blendEquation!==KS&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==tE&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==lE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ql&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ql&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ql&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}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;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++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.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Z5 extends sR{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Zc(16777215),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.combine=v5,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.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}}const An=new Pt,nm=new bi;class ia{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=cE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=E5,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Lm("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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 r=0,s=this.itemSize;r0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,p=c.length;u0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),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;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(e))}const s=t.morphAttributes;for(const c in s){const h=[],u=s[c];for(let p=0,m=u.length;p0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s(t.far-t.near)**2))&&(bE.copy(s).invert(),To.copy(t.ray).applyMatrix4(bE),!(i.boundingBox!==null&&To.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,To)))}_computeIntersections(t,e,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,p=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,_=p.length;g<_;g++){const y=p[g],x=a[y.materialIndex],M=Math.max(y.start,m.start),b=Math.min(o.count,Math.min(y.start+y.count,m.start+m.count));for(let S=M,R=b;Se.far?null:{distance:c,point:cm.clone(),object:n}}function hm(n,t,e,i,r,s,a,o,l,c){n.getVertexPosition(o,cc),n.getVertexPosition(l,hc),n.getVertexPosition(c,uc);const h=e6(n,t,e,i,cc,hc,uc,lm);if(h){r&&(sm.fromBufferAttribute(r,o),am.fromBufferAttribute(r,l),om.fromBufferAttribute(r,c),h.uv=ps.getInterpolation(lm,cc,hc,uc,sm,am,om,new bi)),s&&(sm.fromBufferAttribute(s,o),am.fromBufferAttribute(s,l),om.fromBufferAttribute(s,c),h.uv1=ps.getInterpolation(lm,cc,hc,uc,sm,am,om,new bi),h.uv2=h.uv1),a&&(EE.fromBufferAttribute(a,o),AE.fromBufferAttribute(a,l),TE.fromBufferAttribute(a,c),h.normal=ps.getInterpolation(lm,cc,hc,uc,EE,AE,TE,new Pt),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new Pt,materialIndex:0};ps.getNormal(cc,hc,uc,u.normal),h.face=u}return h}class n6 extends ka{constructor(t,e,i,r,s,a,o,l,c,h){if(h=h!==void 0?h:Ix,h!==Ix&&h!==rE)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Ix&&(i=S5),i===void 0&&h===rE&&(i=A5),super(null,r,s,a,o,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:iE,this.minFilter=l!==void 0?l:iE,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}const i6=new n6(1,1);i6.compareFunction=I5;class r6 extends sR{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Zc(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Zc(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=R5,this.normalScale=new bi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,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.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,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}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:tR}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=tR);function CE(n,t=!1){const e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),r=new Set(Object.keys(n[0].morphAttributes)),s={},a={},o=n[0].morphTargetsRelative,l=new Vf;let c=0;for(let h=0;hs6(n,t,e)}function dh(n,t){return Jn(aR(n,t).get)}const{apply:s6,construct:uY,defineProperty:fY,get:dY,getOwnPropertyDescriptor:aR,getPrototypeOf:F1,has:pY,ownKeys:a6,set:mY,setPrototypeOf:gY}=Reflect,{iterator:Wf,species:yY,toStringTag:o6,for:xY}=Symbol,l6=Object,{create:U1,defineProperty:c6,freeze:_Y,is:vY}=l6,h6=Array,u6=h6.prototype,oR=u6[Wf],f6=Jn(oR),lR=ArrayBuffer,d6=lR.prototype;dh(d6,"byteLength");const PE=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;PE&&dh(PE.prototype,"byteLength");const cR=F1(Uint8Array);cR.from;const Si=cR.prototype;Si[Wf];Jn(Si.keys);Jn(Si.values);Jn(Si.entries);Jn(Si.set);Jn(Si.reverse);Jn(Si.fill);Jn(Si.copyWithin);Jn(Si.sort);Jn(Si.slice);Jn(Si.subarray);dh(Si,"buffer");dh(Si,"byteOffset");dh(Si,"length");dh(Si,o6);const p6=Uint8Array,hR=Uint16Array,k1=Uint32Array,m6=Float32Array,af=F1([][Wf]()),uR=Jn(af.next),g6=Jn(function*(){}().next),y6=F1(af),x6=DataView.prototype,_6=Jn(x6.getUint16),z1=WeakMap,fR=z1.prototype,dR=Jn(fR.get),v6=Jn(fR.set),pR=new z1,M6=U1(null,{next:{value:function(){const t=dR(pR,this);return uR(t)}},[Wf]:{value:function(){return this}}});function w6(n){if(n[Wf]===oR&&af.next===uR)return n;const t=U1(M6);return v6(pR,t,f6(n)),t}const b6=new z1,S6=U1(y6,{next:{value:function(){const t=dR(b6,this);return g6(t)},writable:!0,configurable:!0}});for(const n of a6(af))n!=="next"&&c6(S6,n,aR(af,n));const mR=new lR(4),E6=new m6(mR),A6=new k1(mR),os=new hR(512),ls=new p6(512);for(let n=0;n<256;++n){const t=n-127;t<-24?(os[n]=0,os[n|256]=32768,ls[n]=24,ls[n|256]=24):t<-14?(os[n]=1024>>-t-14,os[n|256]=1024>>-t-14|32768,ls[n]=-t-1,ls[n|256]=-t-1):t<=15?(os[n]=t+15<<10,os[n|256]=t+15<<10|32768,ls[n]=13,ls[n|256]=13):t<128?(os[n]=31744,os[n|256]=64512,ls[n]=24,ls[n|256]=24):(os[n]=31744,os[n|256]=64512,ls[n]=13,ls[n|256]=13)}const B1=new k1(2048);for(let n=1;n<1024;++n){let t=n<<13,e=0;for(;!(t&8388608);)t<<=1,e-=8388608;t&=-8388609,e+=947912704,B1[n]=t|e}for(let n=1024;n<2048;++n)B1[n]=939524096+(n-1024<<13);const ph=new k1(64);for(let n=1;n<31;++n)ph[n]=n<<23;ph[31]=1199570944;ph[32]=2147483648;for(let n=33;n<63;++n)ph[n]=2147483648+(n-32<<23);ph[63]=3347054592;const gR=new hR(64);for(let n=1;n<64;++n)n!==32&&(gR[n]=1024);function T6(n){const t=n>>10;return A6[0]=B1[gR[t]+(n&1023)]+ph[t],E6[0]}function yR(n,t,...e){return T6(_6(n,t,...w6(e)))}var H1={exports:{}};function xR(n,t,e){const i=e&&e.debug||!1;i&&console.log("[xml-utils] getting "+t+" in "+n);const r=typeof n=="object"?n.outer:n,s=r.slice(0,r.indexOf(">")+1),a=['"',"'"];for(let o=0;o/]`,s);if(i&&console.log("[xml-utils] start:",a),a===-1)return;const o=n.slice(a+t.length);let l=Kx(o,"^[^<]*[ /]>",0);const c=l!==-1&&o[l-1]==="/";if(i&&console.log("[xml-utils] selfClosing:",c),c===!1)if(r){let m=0,g=1,_=0;for(;(l=Kx(o,"[ /]"+t+">",m))!==-1;){const y=o.substring(m,l+1);if(g+=IE(y,"<"+t+`[ - >]`),_+=IE(y,""),_>=g)break;m=l}}else l=Kx(o,"[ /]"+t+">",0);const h=a+t.length+l+1;if(i&&console.log("[xml-utils] end:",h),h===-1)return;const u=n.slice(a,h);let p;return c?p=null:p=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:p,outer:u,start:a,end:h}}V1.exports=wR;V1.exports.default=wR;var D6=V1.exports;const N6=D6;function bR(n,t,e){const i=[],r=e&&e.debug||!1,s=e&&typeof e.nested=="boolean"?e.nested:!0;let a=e&&e.startIndex||0,o;for(;o=N6(n,t,{debug:r,startIndex:a});)s?a=o.start+1+t.length:a=o.end,i.push(o);return r&&console.log("findTagsByName found",i.length,"tags"),i}G1.exports=bR;G1.exports.default=bR;var O6=G1.exports;const F6=vf(O6),Ru={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},us={};for(const n in Ru)Ru.hasOwnProperty(n)&&(us[Ru[n]]=parseInt(n,10));const U6=[us.BitsPerSample,us.ExtraSamples,us.SampleFormat,us.StripByteCounts,us.StripOffsets,us.StripRowCounts,us.TileByteCounts,us.TileOffsets,us.SubIFDs],Jx={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Te={};for(const n in Jx)Jx.hasOwnProperty(n)&&(Te[Jx[n]]=parseInt(n,10));const $i={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},k6={Unspecified:0,Assocalpha:1,Unassalpha:2},vY={Version:0,AddCompression:1},MY={None:0,Deflate:1,Zstandard:2},z6={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function B6(n,t){const{width:e,height:i}=n,r=new Uint8Array(e*i*3);let s;for(let a=0,o=0;a>24,l=n[r+2]<<24>>24;let c=(a+16)/116,h=o/500+c,u=c-l/200,p,m,g;h=j6*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),c=X6*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=q6*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),p=h*3.2406+c*-1.5372+u*-.4986,m=h*-.9689+c*1.8758+u*.0415,g=h*.0557+c*-.204+u*1.057,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,m=m>.0031308?1.055*m**(1/2.4)-.055:12.92*m,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,i[s]=Math.max(0,Math.min(1,p))*255,i[s+1]=Math.max(0,Math.min(1,m))*255,i[s+2]=Math.max(0,Math.min(1,g))*255}return i}const SR=new Map;function eo(n,t){Array.isArray(n)||(n=[n]),n.forEach(e=>SR.set(e,t))}async function Y6(n){const t=SR.get(n.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const e=await t();return new e(n)}eo([void 0,1],()=>ll(()=>import("./raw-Dt1HMqYc.js"),__vite__mapDeps([0,1])).then(n=>n.default));eo(5,()=>ll(()=>import("./lzw-DpvbRwG5.js"),__vite__mapDeps([2,1])).then(n=>n.default));eo(6,()=>{throw new Error("old style JPEG compression is not supported.")});eo(7,()=>ll(()=>import("./jpeg-CdeCw_eT.js"),__vite__mapDeps([3,1])).then(n=>n.default));eo([8,32946],()=>ll(()=>import("./deflate-C_ni00X0.js"),__vite__mapDeps([4,1,5,6,7,8,9,10])).then(n=>n.default));eo(32773,()=>ll(()=>import("./packbits-DQnG8s9w.js"),__vite__mapDeps([11,1])).then(n=>n.default));eo(34887,()=>ll(()=>import("./lerc-D-WbCUY3.js"),__vite__mapDeps([12,5,6,1,7,8,9,10])).then(async n=>(await n.zstd.init(),n)).then(n=>n.default));eo(50001,()=>ll(()=>import("./webimage-BcnuJlio.js"),__vite__mapDeps([13,1])).then(n=>n.default));function wg(n,t,e,i=1){return new(Object.getPrototypeOf(n)).constructor(t*e*i)}function Z6(n,t,e,i,r){const s=t/i,a=e/r;return n.map(o=>{const l=wg(o,i,r);for(let c=0;c{const l=wg(o,i,r);for(let c=0;c>8-r-T&u;else if(T+r<=16)h[S]=o.getUint16(R)>>16-r-T&u;else if(T+r<=24){const C=o.getUint16(R)<<8|o.getUint8(R+2);h[S]=C>>24-r-T&u}else h[S]=o.getUint32(R)>>32-r-T&u}}}}return h.buffer}class s8{constructor(t,e,i,r,s,a){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=r,this.tiles=s?{}:null,this.isTiled=!t.StripOffsets;const o=t.PlanarConfiguration;if(this.planarConfiguration=typeof o>"u"?1:o,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=a}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(r,s){return yR(this,r,s)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){const i=this.getSampleFormat(t),r=this.getBitsPerSample(t);return nv(i,r,e)}async getTileOrStrip(t,e,i,r,s){const a=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:c}=this;this.planarConfiguration===1?l=e*a+t:this.planarConfiguration===2&&(l=i*a*o+e*a+t);let h,u;this.isTiled?(h=this.fileDirectory.TileOffsets[l],u=this.fileDirectory.TileByteCounts[l]):(h=this.fileDirectory.StripOffsets[l],u=this.fileDirectory.StripByteCounts[l]);const p=(await this.source.fetch([{offset:h,length:u}],s))[0];let m;return c===null||!c[l]?(m=(async()=>{let g=await r.decode(this.fileDirectory,p);const _=this.getSampleFormat(),y=this.getBitsPerSample();return i8(_,y)&&(g=r8(g,_,this.planarConfiguration,this.getSamplesPerPixel(),y,this.getTileWidth(),this.getBlockHeight(e))),g})(),c!==null&&(c[l]=m)):m=c[l],{x:t,y:e,sample:i,data:await m}}async _readRaster(t,e,i,r,s,a,o,l,c){const h=this.getTileWidth(),u=this.getTileHeight(),p=this.getWidth(),m=this.getHeight(),g=Math.max(Math.floor(t[0]/h),0),_=Math.min(Math.ceil(t[2]/h),Math.ceil(p/h)),y=Math.max(Math.floor(t[1]/u),0),x=Math.min(Math.ceil(t[3]/u),Math.ceil(m/u)),M=t[2]-t[0];let b=this.getBytesPerPixel();const S=[],R=[];for(let N=0;N{const q=Y.data,at=new DataView(q),G=this.getBlockHeight(Y.y),nt=Y.y*u,K=Y.x*h,$=nt+G,ht=(Y.x+1)*h,vt=R[B],Z=Math.min(G,G-($-t[3]),m-nt),rt=Math.min(h,h-(ht-t[2]),p-K);for(let St=Math.max(0,t[1]-nt);Sth[2]||h[1]>h[3])throw new Error("Invalid subsets");const u=h[2]-h[0],p=h[3]-h[1],m=u*p,g=this.getSamplesPerPixel();if(!e||!e.length)for(let M=0;M=g)return Promise.reject(new RangeError(`Invalid sample index '${e[M]}'.`));let _;if(i){const M=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,b=Math.max.apply(null,this.fileDirectory.BitsPerSample);_=nv(M,b,m*e.length),l&&_.fill(l)}else{_=[];for(let M=0;Mc[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===$i.RGB){let x=[0,1,2];if(this.fileDirectory.ExtraSamples!==k6.Unspecified&&o){x=[];for(let M=0;MZx(s,"sample")===void 0):r=r.filter(s=>Number(Zx(s,"sample"))===t);for(let s=0;s[o+r*y+s*x,u+l*y+c*x]),g=m.map(y=>y[0]),_=m.map(y=>y[1]);return[Math.min(...g),Math.min(..._),Math.max(...g),Math.max(..._)]}else{const r=this.getOrigin(),s=this.getResolution(),a=r[0],o=r[1],l=a+s[0]*i,c=o+s[1]*e;return[Math.min(a,l),Math.min(o,c),Math.max(a,l),Math.max(o,c)]}}}class a8{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),r=this.getUint32(t+4,e);let s;if(e){if(s=i+2**32*r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*i+r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(t,e){let i=0;const r=(this._dataView.getUint8(t+(e?7:0))&128)>0;let s=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(t+(e?a:7-a));r&&(s?o!==0&&(o=~(o-1)&255,s=!1):o=~o&255),i+=o*256**a}return r&&(i=-i),i}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return yR(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class o8{constructor(t,e,i,r){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),i=this.readUint32(t+4);let r;if(this._littleEndian){if(r=e+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*e+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(t){let e=0;const i=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let r=!0;for(let s=0;s<8;s++){let a=this._dataView.getUint8(t+(this._littleEndian?s:7-s));i&&(r?a!==0&&(a=~(a-1)&255,r=!1):a=~a&255),e+=a*256**s}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const LE=`\r + >]`),_+=IE(y,""),_>=g)break;m=l}}else l=Kx(o,"[ /]"+t+">",0);const h=a+t.length+l+1;if(i&&console.log("[xml-utils] end:",h),h===-1)return;const u=n.slice(a,h);let p;return c?p=null:p=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:p,outer:u,start:a,end:h}}V1.exports=wR;V1.exports.default=wR;var D6=V1.exports;const N6=D6;function bR(n,t,e){const i=[],r=e&&e.debug||!1,s=e&&typeof e.nested=="boolean"?e.nested:!0;let a=e&&e.startIndex||0,o;for(;o=N6(n,t,{debug:r,startIndex:a});)s?a=o.start+1+t.length:a=o.end,i.push(o);return r&&console.log("findTagsByName found",i.length,"tags"),i}G1.exports=bR;G1.exports.default=bR;var O6=G1.exports;const F6=vf(O6),Ru={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},us={};for(const n in Ru)Ru.hasOwnProperty(n)&&(us[Ru[n]]=parseInt(n,10));const U6=[us.BitsPerSample,us.ExtraSamples,us.SampleFormat,us.StripByteCounts,us.StripOffsets,us.StripRowCounts,us.TileByteCounts,us.TileOffsets,us.SubIFDs],Jx={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Te={};for(const n in Jx)Jx.hasOwnProperty(n)&&(Te[Jx[n]]=parseInt(n,10));const $i={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},k6={Unspecified:0,Assocalpha:1,Unassalpha:2},MY={Version:0,AddCompression:1},wY={None:0,Deflate:1,Zstandard:2},z6={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function B6(n,t){const{width:e,height:i}=n,r=new Uint8Array(e*i*3);let s;for(let a=0,o=0;a>24,l=n[r+2]<<24>>24;let c=(a+16)/116,h=o/500+c,u=c-l/200,p,m,g;h=j6*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),c=X6*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=q6*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),p=h*3.2406+c*-1.5372+u*-.4986,m=h*-.9689+c*1.8758+u*.0415,g=h*.0557+c*-.204+u*1.057,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,m=m>.0031308?1.055*m**(1/2.4)-.055:12.92*m,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,i[s]=Math.max(0,Math.min(1,p))*255,i[s+1]=Math.max(0,Math.min(1,m))*255,i[s+2]=Math.max(0,Math.min(1,g))*255}return i}const SR=new Map;function eo(n,t){Array.isArray(n)||(n=[n]),n.forEach(e=>SR.set(e,t))}async function Y6(n){const t=SR.get(n.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const e=await t();return new e(n)}eo([void 0,1],()=>ll(()=>import("./raw-Dt1HMqYc.js"),__vite__mapDeps([0,1])).then(n=>n.default));eo(5,()=>ll(()=>import("./lzw-DpvbRwG5.js"),__vite__mapDeps([2,1])).then(n=>n.default));eo(6,()=>{throw new Error("old style JPEG compression is not supported.")});eo(7,()=>ll(()=>import("./jpeg-CdeCw_eT.js"),__vite__mapDeps([3,1])).then(n=>n.default));eo([8,32946],()=>ll(()=>import("./deflate-B1g-JsHt.js"),__vite__mapDeps([4,1,5,6,7,8,9,10])).then(n=>n.default));eo(32773,()=>ll(()=>import("./packbits-DQnG8s9w.js"),__vite__mapDeps([11,1])).then(n=>n.default));eo(34887,()=>ll(()=>import("./lerc-DxCAHPKn.js"),__vite__mapDeps([12,5,6,1,7,8,9,10])).then(async n=>(await n.zstd.init(),n)).then(n=>n.default));eo(50001,()=>ll(()=>import("./webimage-BcnuJlio.js"),__vite__mapDeps([13,1])).then(n=>n.default));function wg(n,t,e,i=1){return new(Object.getPrototypeOf(n)).constructor(t*e*i)}function Z6(n,t,e,i,r){const s=t/i,a=e/r;return n.map(o=>{const l=wg(o,i,r);for(let c=0;c{const l=wg(o,i,r);for(let c=0;c>8-r-C&u;else if(C+r<=16)h[S]=o.getUint16(R)>>16-r-C&u;else if(C+r<=24){const T=o.getUint16(R)<<8|o.getUint8(R+2);h[S]=T>>24-r-C&u}else h[S]=o.getUint32(R)>>32-r-C&u}}}}return h.buffer}class s8{constructor(t,e,i,r,s,a){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=r,this.tiles=s?{}:null,this.isTiled=!t.StripOffsets;const o=t.PlanarConfiguration;if(this.planarConfiguration=typeof o>"u"?1:o,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=a}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(r,s){return yR(this,r,s)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){const i=this.getSampleFormat(t),r=this.getBitsPerSample(t);return nv(i,r,e)}async getTileOrStrip(t,e,i,r,s){const a=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:c}=this;this.planarConfiguration===1?l=e*a+t:this.planarConfiguration===2&&(l=i*a*o+e*a+t);let h,u;this.isTiled?(h=this.fileDirectory.TileOffsets[l],u=this.fileDirectory.TileByteCounts[l]):(h=this.fileDirectory.StripOffsets[l],u=this.fileDirectory.StripByteCounts[l]);const p=(await this.source.fetch([{offset:h,length:u}],s))[0];let m;return c===null||!c[l]?(m=(async()=>{let g=await r.decode(this.fileDirectory,p);const _=this.getSampleFormat(),y=this.getBitsPerSample();return i8(_,y)&&(g=r8(g,_,this.planarConfiguration,this.getSamplesPerPixel(),y,this.getTileWidth(),this.getBlockHeight(e))),g})(),c!==null&&(c[l]=m)):m=c[l],{x:t,y:e,sample:i,data:await m}}async _readRaster(t,e,i,r,s,a,o,l,c){const h=this.getTileWidth(),u=this.getTileHeight(),p=this.getWidth(),m=this.getHeight(),g=Math.max(Math.floor(t[0]/h),0),_=Math.min(Math.ceil(t[2]/h),Math.ceil(p/h)),y=Math.max(Math.floor(t[1]/u),0),x=Math.min(Math.ceil(t[3]/u),Math.ceil(m/u)),M=t[2]-t[0];let b=this.getBytesPerPixel();const S=[],R=[];for(let N=0;N{const q=Y.data,at=new DataView(q),G=this.getBlockHeight(Y.y),tt=Y.y*u,K=Y.x*h,$=tt+G,ht=(Y.x+1)*h,vt=R[B],Z=Math.min(G,G-($-t[3]),m-tt),rt=Math.min(h,h-(ht-t[2]),p-K);for(let St=Math.max(0,t[1]-tt);Sth[2]||h[1]>h[3])throw new Error("Invalid subsets");const u=h[2]-h[0],p=h[3]-h[1],m=u*p,g=this.getSamplesPerPixel();if(!e||!e.length)for(let M=0;M=g)return Promise.reject(new RangeError(`Invalid sample index '${e[M]}'.`));let _;if(i){const M=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,b=Math.max.apply(null,this.fileDirectory.BitsPerSample);_=nv(M,b,m*e.length),l&&_.fill(l)}else{_=[];for(let M=0;Mc[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===$i.RGB){let x=[0,1,2];if(this.fileDirectory.ExtraSamples!==k6.Unspecified&&o){x=[];for(let M=0;MZx(s,"sample")===void 0):r=r.filter(s=>Number(Zx(s,"sample"))===t);for(let s=0;s[o+r*y+s*x,u+l*y+c*x]),g=m.map(y=>y[0]),_=m.map(y=>y[1]);return[Math.min(...g),Math.min(..._),Math.max(...g),Math.max(..._)]}else{const r=this.getOrigin(),s=this.getResolution(),a=r[0],o=r[1],l=a+s[0]*i,c=o+s[1]*e;return[Math.min(a,l),Math.min(o,c),Math.max(a,l),Math.max(o,c)]}}}class a8{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),r=this.getUint32(t+4,e);let s;if(e){if(s=i+2**32*r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*i+r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(t,e){let i=0;const r=(this._dataView.getUint8(t+(e?7:0))&128)>0;let s=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(t+(e?a:7-a));r&&(s?o!==0&&(o=~(o-1)&255,s=!1):o=~o&255),i+=o*256**a}return r&&(i=-i),i}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return yR(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class o8{constructor(t,e,i,r){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),i=this.readUint32(t+4);let r;if(this._littleEndian){if(r=e+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*e+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(t){let e=0;const i=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let r=!0;for(let s=0;s<8;s++){let a=this._dataView.getUint8(t+(this._littleEndian?s:7-s));i&&(r?a!==0&&(a=~(a-1)&255,r=!1):a=~a&255),e+=a*256**s}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const LE=`\r \r `;function ER(n){if(typeof Object.fromEntries<"u")return Object.fromEntries(n);const t={};for(const[e,i]of n)t[e.toLowerCase()]=i;return t}function l8(n){const t=n.split(`\r `).map(e=>{const i=e.split(":").map(r=>r.trim());return i[0]=i[0].toLowerCase(),i});return ER(t)}function c8(n){const[t,...e]=n.split(";").map(r=>r.trim()),i=e.map(r=>r.split("="));return{type:t,params:ER(i)}}function iv(n){let t,e,i;return n&&([,t,e,i]=n.match(/bytes (\d+)-(\d+)\/(\d+)/),t=parseInt(t,10),e=parseInt(e,10),i=parseInt(i,10)),{start:t,end:e,total:i}}function h8(n,t){let e=null;const i=new TextDecoder("ascii"),r=[],s=`--${t}`,a=`${s}--`;for(let o=0;o<10;++o)i.decode(new Uint8Array(n,o,s.length))===s&&(e=o);if(e===null)throw new Error("Could not find initial boundary");for(;ethis.fetchSlice(i,e)))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}class u8 extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(const[e,i]of t)this.onEviction(e,i.value)}_deleteIfExpired(t,e){return typeof e.expiry=="number"&&e.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,e.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,e){if(this._deleteIfExpired(t,e)===!1)return e.value}_getItemValue(t,e){return e.expiry?this._getOrDeleteIfExpired(t,e):e.value}_peek(t,e){const i=e.get(t);return this._getItemValue(t,i)}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,e){this.oldCache.delete(t),this._set(t,e)}*_entriesAscending(){for(const t of this.oldCache){const[e,i]=t;this.cache.has(e)||this._deleteIfExpired(e,i)===!1&&(yield t)}for(const t of this.cache){const[e,i]=t;this._deleteIfExpired(e,i)===!1&&(yield t)}}get(t){if(this.cache.has(t)){const e=this.cache.get(t);return this._getItemValue(t,e)}if(this.oldCache.has(t)){const e=this.oldCache.get(t);if(this._deleteIfExpired(t,e)===!1)return this._moveToRecent(t,e),e.value}}set(t,e,{maxAge:i=this.maxAge}={}){const r=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:r}):this._set(t,{value:e,expiry:r}),this}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");const e=[...this._entriesAscending()],i=e.length-t;i<0?(this.cache=new Map(e),this.oldCache=new Map,this._size=e.length):(i>0&&this._emitEvictions(e.slice(0,i)),this.oldCache=new Map(e.slice(i)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache){const[e,i]=t;this._deleteIfExpired(e,i)===!1&&(yield[e,i.value])}for(const t of this.oldCache){const[e,i]=t;this.cache.has(e)||this._deleteIfExpired(e,i)===!1&&(yield[e,i.value])}}*entriesDescending(){let t=[...this.cache];for(let e=t.length-1;e>=0;--e){const i=t[e],[r,s]=i;this._deleteIfExpired(r,s)===!1&&(yield[r,s.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const i=t[e],[r,s]=i;this.cache.has(r)||this._deleteIfExpired(r,s)===!1&&(yield[r,s.value])}}*entriesAscending(){for(const[t,e]of this._entriesAscending())yield[t,e.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,e=this){for(const[i,r]of this.entriesAscending())t.call(e,r,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function f8(n){return new Promise(t=>setTimeout(t,n))}function d8(n,t){const e=Array.isArray(n)?n:Array.from(n),i=Array.isArray(t)?t:Array.from(t);return e.map((r,s)=>[r,i[s]])}class Kc extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Kc),this.name="AbortError"}}class p8 extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const m8=p8;let g8=class{constructor(t,e,i=null){this.offset=t,this.length=e,this.data=i}get top(){return this.offset+this.length}};class DE{constructor(t,e,i){this.offset=t,this.length=e,this.blockIds=i}}class y8 extends AR{constructor(t,{blockSize:e=65536,cacheSize:i=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new u8({maxSize:i,onEviction:(r,s)=>{this.evictedBlocks.set(r,s)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(t,e){const i=[],r=[],s=[];this.evictedBlocks.clear();for(const{offset:p,length:m}of t){let g=p+m;const{fileSize:_}=this;_!==null&&(g=Math.min(g,_));const y=Math.floor(p/this.blockSize)*this.blockSize;for(let x=y;xthis.abortedBlockIds.has(p)||!this.blockCache.has(p));if(l.forEach(p=>this.blockIdsToFetch.add(p)),l.length>0&&e&&!e.aborted){this.fetchBlocks(null);for(const p of l){const m=this.blockRequests.get(p);if(!m)throw new Error(`Block ${p} is not in the block requests`);o.push(m)}await Promise.allSettled(o)}if(e&&e.aborted)throw new Kc("Request was aborted");const c=s.map(p=>this.blockCache.get(p)||this.evictedBlocks.get(p)),h=c.filter(p=>!p);if(h.length)throw new m8(h,"Request failed");const u=new Map(d8(s,c));return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(e,t);for(let r=0;r{try{const o=(await i)[r],l=a*this.blockSize,c=l-o.offset,h=Math.min(c+this.blockSize,o.data.byteLength),u=o.data.slice(c,h),p=new g8(l,u.byteLength,u,a);this.blockCache.set(a,p),this.abortedBlockIds.delete(a)}catch(o){if(o.name==="AbortError")o.signal=t,this.blockCache.delete(a),this.abortedBlockIds.add(a);else throw o}finally{this.blockRequests.delete(a)}})())}this.blockIdsToFetch.clear()}}groupBlocks(t){const e=Array.from(t).sort((a,o)=>a-o);if(e.length===0)return[];let i=[],r=null;const s=[];for(const a of e)r===null||r+1===a?(i.push(a),r=a):(s.push(new DE(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[a],r=a);return s.push(new DE(i[0]*this.blockSize,i.length*this.blockSize,i)),s}readSliceData(t,e){return t.map(i=>{let r=i.offset+i.length;this.fileSize!==null&&(r=Math.min(this.fileSize,r));const s=Math.floor(i.offset/this.blockSize),a=Math.floor(r/this.blockSize),o=new ArrayBuffer(i.length),l=new Uint8Array(o);for(let c=s;c<=a;++c){const h=e.get(c),u=h.offset-i.offset,p=h.top-r;let m=0,g=0,_;u<0?m=-u:u>0&&(g=u),p<0?_=h.length-m:_=r-h.offset-m;const y=new Uint8Array(h.data,m,_);l.set(y,g)}return o})}}class q1{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class $1{constructor(t){this.url=t}async request({headers:t,signal:e}={}){throw new Error("request is not implemented")}}class x8 extends q1{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class _8 extends $1{constructor(t,e){super(t),this.credentials=e}async request({headers:t,signal:e}={}){const i=await fetch(this.url,{headers:t,credentials:this.credentials,signal:e});return new x8(i)}}class v8 extends q1{constructor(t,e){super(),this.xhr=t,this.data=e}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class M8 extends $1{constructRequest(t,e){return new Promise((i,r)=>{const s=new XMLHttpRequest;s.open("GET",this.url),s.responseType="arraybuffer";for(const[a,o]of Object.entries(t))s.setRequestHeader(a,o);s.onload=()=>{const a=s.response;i(new v8(s,a))},s.onerror=r,s.onabort=()=>r(new Kc("Request aborted")),s.send(),e&&(e.aborted&&s.abort(),e.addEventListener("abort",()=>s.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}const Qx={};class w8 extends q1{constructor(t,e){super(),this.response=t,this.dataPromise=e}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class b8 extends $1{constructor(t){super(t),this.parsedUrl=Qx.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",Qx)}constructRequest(t,e){return new Promise((i,r)=>{const s=this.httpApi.get({...this.parsedUrl,headers:t},a=>{const o=new Promise(l=>{const c=[];a.on("data",h=>{c.push(h)}),a.on("end",()=>{const h=Buffer.concat(c).buffer;l(h)}),a.on("error",r)});i(new w8(a,o))});s.on("error",r),e&&(e.aborted&&s.destroy(new Kc("Request aborted")),e.addEventListener("abort",()=>s.destroy(new Kc("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class Y1 extends AR{constructor(t,e,i,r){super(),this.client=t,this.headers=e,this.maxRanges=i,this.allowFullFile=r,this._fileSize=null}async fetch(t,e){return this.maxRanges>=t.length?this.fetchSlices(t,e):(this.maxRanges>0&&t.length>1,Promise.all(t.map(i=>this.fetchSlice(i,e))))}async fetchSlices(t,e){const i=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map(({offset:r,length:s})=>`${r}-${r+s}`).join(",")}`},signal:e});if(i.ok)if(i.status===206){const{type:r,params:s}=c8(i.getHeader("content-type"));if(r==="multipart/byteranges"){const u=h8(await i.getData(),s.boundary);return this._fileSize=u[0].fileSize||null,u}const a=await i.getData(),{start:o,end:l,total:c}=iv(i.getHeader("content-range"));this._fileSize=c||null;const h=[{data:a,offset:o,length:l-o}];if(t.length>1){const u=await Promise.all(t.slice(1).map(p=>this.fetchSlice(p,e)));return h.concat(u)}return h}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const r=await i.getData();return this._fileSize=r.byteLength,[{data:r,offset:0,length:r.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:i,length:r}=t,s=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+r}`},signal:e});if(s.ok)if(s.status===206){const a=await s.getData(),{total:o}=iv(s.getHeader("content-range"));return this._fileSize=o||null,{data:a,offset:i,length:r}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const a=await s.getData();return this._fileSize=a.byteLength,{data:a,offset:0,length:a.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function Z1(n,{blockSize:t,cacheSize:e}){return t===null?n:new y8(n,{blockSize:t,cacheSize:e})}function S8(n,{headers:t={},credentials:e,maxRanges:i=0,allowFullFile:r=!1,...s}={}){const a=new _8(n,e),o=new Y1(a,t,i,r);return Z1(o,s)}function E8(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...r}={}){const s=new M8(n),a=new Y1(s,t,e,i);return Z1(a,r)}function A8(n,{headers:t={},maxRanges:e=0,allowFullFile:i=!1,...r}={}){const s=new b8(n),a=new Y1(s,t,e,i);return Z1(a,r)}function T8(n,{forceXHR:t=!1,...e}={}){return typeof fetch=="function"&&!t?S8(n,e):typeof XMLHttpRequest<"u"?E8(n,e):A8(n,e)}function rv(n){switch(n){case Te.BYTE:case Te.ASCII:case Te.SBYTE:case Te.UNDEFINED:return 1;case Te.SHORT:case Te.SSHORT:return 2;case Te.LONG:case Te.SLONG:case Te.FLOAT:case Te.IFD:return 4;case Te.RATIONAL:case Te.SRATIONAL:case Te.DOUBLE:case Te.LONG8:case Te.SLONG8:case Te.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${n}`)}}function C8(n){const t=n.GeoKeyDirectory;if(!t)return null;const e={};for(let i=4;i<=t[3]*4;i+=4){const r=z6[t[i]],s=t[i+1]?Ru[t[i+1]]:null,a=t[i+2],o=t[i+3];let l=null;if(!s)l=o;else{if(l=n[s],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${r}'.`);typeof l=="string"?l=l.substring(o,o+a-1):l.subarray&&(l=l.subarray(o,o+a),a===1&&(l=l[0]))}e[r]=l}return e}function fc(n,t,e,i){let r=null,s=null;const a=rv(t);switch(t){case Te.BYTE:case Te.ASCII:case Te.UNDEFINED:r=new Uint8Array(e),s=n.readUint8;break;case Te.SBYTE:r=new Int8Array(e),s=n.readInt8;break;case Te.SHORT:r=new Uint16Array(e),s=n.readUint16;break;case Te.SSHORT:r=new Int16Array(e),s=n.readInt16;break;case Te.LONG:case Te.IFD:r=new Uint32Array(e),s=n.readUint32;break;case Te.SLONG:r=new Int32Array(e),s=n.readInt32;break;case Te.LONG8:case Te.IFD8:r=new Array(e),s=n.readUint64;break;case Te.SLONG8:r=new Array(e),s=n.readInt64;break;case Te.RATIONAL:r=new Uint32Array(e*2),s=n.readUint32;break;case Te.SRATIONAL:r=new Int32Array(e*2),s=n.readInt32;break;case Te.FLOAT:r=new Float32Array(e),s=n.readFloat32;break;case Te.DOUBLE:r=new Float64Array(e),s=n.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t===Te.RATIONAL||t===Te.SRATIONAL)for(let o=0;og.getWidth()-_.getWidth());for(let g=0;gy||a&&a>x)break}}let p=e;if(o){const[m,g]=l.getOrigin(),[_,y]=c.getResolution(l);p=[Math.round((o[0]-m)/_),Math.round((o[1]-g)/y),Math.round((o[2]-m)/_),Math.round((o[3]-g)/y)],p=[Math.min(p[0],p[2]),Math.min(p[1],p[3]),Math.max(p[0],p[2]),Math.max(p[1],p[3])]}return c.readRasters({...t,window:p})}}class K1 extends P8{constructor(t,e,i,r,s={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=i,this.firstIFDOffset=r,this.cache=s.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const i=this.bigTiff?4048:1024;return new o8((await this.source.fetch([{offset:t,length:typeof e<"u"?e:i}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(t);const s=this.bigTiff?r.readUint64(t):r.readUint16(t),a=s*e+(this.bigTiff?16:6);r.covers(t,a)||(r=await this.getSlice(t,a));const o={};let l=t+(this.bigTiff?8:2);for(let u=0;u{const e=await this.ifdRequests[t-1];if(e.nextIFDByteOffset===0)throw new um(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new s8(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(i){if(i instanceof um)e=!1;else throw i}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e="GDAL_STRUCTURAL_METADATA_SIZE=",i=e.length+100;let r=await this.getSlice(t,i);if(e===fc(r,Te.ASCII,e.length,t)){const a=fc(r,Te.ASCII,i,t).split(` `)[0],o=Number(a.split("=")[1].split(" ")[0])+a.length;o>i&&(r=await this.getSlice(t,o));const l=fc(r,Te.ASCII,o,t);this.ghostValues={},l.split(` -`).filter(c=>c.length>0).map(c=>c.split("=")).forEach(([c,h])=>{this.ghostValues[c]=h})}return this.ghostValues}static async fromSource(t,e,i){const r=(await t.fetch([{offset:0,length:1024}],i))[0],s=new a8(r),a=s.getUint16(0,0);let o;if(a===18761)o=!0;else if(a===19789)o=!1;else throw new TypeError("Invalid byte order value.");const l=s.getUint16(2,o);let c;if(l===42)c=!1;else if(l===43){if(c=!0,s.getUint16(4,o)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const h=c?s.getUint64(8,o):s.getUint32(4,o);return new K1(t,o,c,h,e)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function J1(n,t={},e){return K1.fromSource(T8(n,t),e)}var TR={exports:{}};(function(n,t){(function(){var e=Math.PI,i=Math.sin,r=Math.cos,s=Math.tan,a=Math.asin,o=Math.atan2,l=Math.acos,c=e/180,h=1e3*60*60*24,u=2440588,p=2451545;function m($){return $.valueOf()/h-.5+u}function g($){return new Date(($+.5-u)*h)}function _($){return m($)-p}var y=c*23.4397;function x($,ht){return o(i($)*r(y)-s(ht)*i(y),r($))}function M($,ht){return a(i(ht)*r(y)+r(ht)*i(y)*i($))}function b($,ht,vt){return o(i($),r($)*i(ht)-s(vt)*r(ht))}function S($,ht,vt){return a(i(ht)*i(vt)+r(ht)*r(vt)*r($))}function R($,ht){return c*(280.16+360.9856235*$)-ht}function T($){return $<0&&($=0),2967e-7/Math.tan($+.00312536/($+.08901179))}function C($){return c*(357.5291+.98560028*$)}function N($){var ht=c*(1.9148*i($)+.02*i(2*$)+3e-4*i(3*$)),vt=c*102.9372;return $+ht+vt+e}function P($){var ht=C($),vt=N(ht);return{dec:M(vt,0),ra:x(vt,0)}}var E={};E.getPosition=function($,ht,vt){var Z=c*-vt,rt=c*ht,St=_($),_t=P(St),Ot=R(St,Z)-_t.ra;return{azimuth:b(Ot,rt,_t.dec),altitude:S(Ot,rt,_t.dec)}};var L=E.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];E.addTime=function($,ht,vt){L.push([$,ht,vt])};var B=9e-4;function V($,ht){return Math.round($-B-ht/(2*e))}function j($,ht,vt){return B+($+ht)/(2*e)+vt}function Y($,ht,vt){return p+$+.0053*i(ht)-.0069*i(2*vt)}function q($,ht,vt){return l((i($)-i(ht)*i(vt))/(r(ht)*r(vt)))}function at($){return-2.076*Math.sqrt($)/60}function G($,ht,vt,Z,rt,St,_t){var Ot=q($,vt,Z),Xt=j(Ot,ht,rt);return Y(Xt,St,_t)}E.getTimes=function($,ht,vt,Z){Z=Z||0;var rt=c*-vt,St=c*ht,_t=at(Z),Ot=_($),Xt=V(Ot,rt),Gt=j(0,rt,Xt),Qt=C(Gt),F=N(Qt),wt=M(F,0),bt=Y(Gt,Qt,F),mt,dt,kt,Rt,zt,z,O={solarNoon:g(bt),nadir:g(bt-.5)};for(mt=0,dt=L.length;mt=0&&(z=Math.sqrt(dt)/(Math.abs(F)*2),Rt=bt-z,zt=bt+z,Math.abs(Rt)<=1&&kt++,Math.abs(zt)<=1&&kt++,Rt<-1&&(Rt=zt)),kt===1?_t<0?Gt=O+Rt:Qt=O+Rt:kt===2&&(Gt=O+(mt<0?zt:Rt),Qt=O+(mt<0?Rt:zt)),!(Gt&&Qt));O+=2)_t=Xt;var ot={};return Gt&&(ot.rise=K(rt,Gt)),Qt&&(ot.set=K(rt,Qt)),!Gt&&!Qt&&(ot[mt>0?"alwaysUp":"alwaysDown"]=!0),ot},n.exports=E})()})(TR);var I8=TR.exports;const L8=vf(I8);var D8=Object.defineProperty,N8=(n,t)=>{for(var e in t)D8(n,e,{get:t[e],enumerable:!0})},Q1={};N8(Q1,{interpolateThreeColors:()=>F8,interpolateTwoColors:()=>O8,viridis:()=>CR});function CR(n){n=Math.min(Math.max(n,0),1);const t=[.2777273272234177,.005407344544966578,.3340998053353061],e=[.1050930431085774,1.404613529898575,1.384590162594685],i=[-.3308618287255563,.214847559468213,.09509516302823659],r=[-4.634230498983486,-5.799100973351585,-19.33244095627987],s=[6.228269936347081,14.17993336680509,56.69055260068105],a=[4.776384997670288,-13.74514537774601,-65.35303263337234],o=[-5.435455855934631,4.645852612178535,26.3124352495832];return[t[0]+n*(e[0]+n*(i[0]+n*(r[0]+n*(s[0]+n*(a[0]+n*o[0]))))),t[1]+n*(e[1]+n*(i[1]+n*(r[1]+n*(s[1]+n*(a[1]+n*o[1]))))),t[2]+n*(e[2]+n*(i[2]+n*(r[2]+n*(s[2]+n*(a[2]+n*o[2])))))]}function O8(n){const{c0:t,c1:e}=n;return i=>{i=Math.min(Math.max(i,0),1);const r=t[0]*(1-i)+e[0]*i,s=t[1]*(1-i)+e[1]*i,a=t[2]*(1-i)+e[2]*i;return[r,s,a]}}function F8(n){const{c0:t,c1:e,c2:i}=n;return r=>{r=Math.max(0,Math.min(1,r));function s(c,h,u,p){return(1-c)*(1-c)*h+2*(1-c)*c*u+c*c*p}const a=s(r,t[0],e[0],i[0]),o=s(r,t[1],e[1],i[1]),l=s(r,t[2],e[2],i[2]);return[a,o,l]}}function U8(n){let t=n.map(e=>({...e}));for(let e=0;e({radius:1,azimuth:s*(2*Math.PI/e),altitude:-1/0}));for(let r of n){const{azimuth:s,altitude:a}=k8(t,r),o=Math.round(s/(2*Math.PI/e))%e;a>i[o].altitude&&(i[o].altitude=a)}return U8(i),i}function B8(n,t,e){let i=[],r=0;for(;rMath.abs(s.azimuth-i)=0;i--){const r=n[i],s=e(r.vector.spherical.azimuth);s&&r.vector.spherical.altitudeh||m>u)throw new Error("Given coordinates are outside the bounding box.");const g=await c.readRasters({window:[p,m,p+1,m+1]});let _;return typeof g[0]=="number"?_=g[0]:_=g[0][0],_!=0||(_=(async(x,M,b,S,R)=>{let T;for(let C=1;C=0&&P=0&&Ec.length>0).map(c=>c.split("=")).forEach(([c,h])=>{this.ghostValues[c]=h})}return this.ghostValues}static async fromSource(t,e,i){const r=(await t.fetch([{offset:0,length:1024}],i))[0],s=new a8(r),a=s.getUint16(0,0);let o;if(a===18761)o=!0;else if(a===19789)o=!1;else throw new TypeError("Invalid byte order value.");const l=s.getUint16(2,o);let c;if(l===42)c=!1;else if(l===43){if(c=!0,s.getUint16(4,o)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const h=c?s.getUint64(8,o):s.getUint32(4,o);return new K1(t,o,c,h,e)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function J1(n,t={},e){return K1.fromSource(T8(n,t),e)}var TR={exports:{}};(function(n,t){(function(){var e=Math.PI,i=Math.sin,r=Math.cos,s=Math.tan,a=Math.asin,o=Math.atan2,l=Math.acos,c=e/180,h=1e3*60*60*24,u=2440588,p=2451545;function m($){return $.valueOf()/h-.5+u}function g($){return new Date(($+.5-u)*h)}function _($){return m($)-p}var y=c*23.4397;function x($,ht){return o(i($)*r(y)-s(ht)*i(y),r($))}function M($,ht){return a(i(ht)*r(y)+r(ht)*i(y)*i($))}function b($,ht,vt){return o(i($),r($)*i(ht)-s(vt)*r(ht))}function S($,ht,vt){return a(i(ht)*i(vt)+r(ht)*r(vt)*r($))}function R($,ht){return c*(280.16+360.9856235*$)-ht}function C($){return $<0&&($=0),2967e-7/Math.tan($+.00312536/($+.08901179))}function T($){return c*(357.5291+.98560028*$)}function N($){var ht=c*(1.9148*i($)+.02*i(2*$)+3e-4*i(3*$)),vt=c*102.9372;return $+ht+vt+e}function P($){var ht=T($),vt=N(ht);return{dec:M(vt,0),ra:x(vt,0)}}var E={};E.getPosition=function($,ht,vt){var Z=c*-vt,rt=c*ht,St=_($),_t=P(St),Ot=R(St,Z)-_t.ra;return{azimuth:b(Ot,rt,_t.dec),altitude:S(Ot,rt,_t.dec)}};var L=E.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];E.addTime=function($,ht,vt){L.push([$,ht,vt])};var B=9e-4;function V($,ht){return Math.round($-B-ht/(2*e))}function j($,ht,vt){return B+($+ht)/(2*e)+vt}function Y($,ht,vt){return p+$+.0053*i(ht)-.0069*i(2*vt)}function q($,ht,vt){return l((i($)-i(ht)*i(vt))/(r(ht)*r(vt)))}function at($){return-2.076*Math.sqrt($)/60}function G($,ht,vt,Z,rt,St,_t){var Ot=q($,vt,Z),Xt=j(Ot,ht,rt);return Y(Xt,St,_t)}E.getTimes=function($,ht,vt,Z){Z=Z||0;var rt=c*-vt,St=c*ht,_t=at(Z),Ot=_($),Xt=V(Ot,rt),Gt=j(0,rt,Xt),Qt=T(Gt),F=N(Qt),wt=M(F,0),bt=Y(Gt,Qt,F),mt,dt,kt,Rt,zt,z,O={solarNoon:g(bt),nadir:g(bt-.5)};for(mt=0,dt=L.length;mt=0&&(z=Math.sqrt(dt)/(Math.abs(F)*2),Rt=bt-z,zt=bt+z,Math.abs(Rt)<=1&&kt++,Math.abs(zt)<=1&&kt++,Rt<-1&&(Rt=zt)),kt===1?_t<0?Gt=O+Rt:Qt=O+Rt:kt===2&&(Gt=O+(mt<0?zt:Rt),Qt=O+(mt<0?Rt:zt)),!(Gt&&Qt));O+=2)_t=Xt;var ot={};return Gt&&(ot.rise=K(rt,Gt)),Qt&&(ot.set=K(rt,Qt)),!Gt&&!Qt&&(ot[mt>0?"alwaysUp":"alwaysDown"]=!0),ot},n.exports=E})()})(TR);var I8=TR.exports;const L8=vf(I8);var D8=Object.defineProperty,N8=(n,t)=>{for(var e in t)D8(n,e,{get:t[e],enumerable:!0})},Q1={};N8(Q1,{interpolateThreeColors:()=>F8,interpolateTwoColors:()=>O8,viridis:()=>CR});function CR(n){n=Math.min(Math.max(n,0),1);const t=[.2777273272234177,.005407344544966578,.3340998053353061],e=[.1050930431085774,1.404613529898575,1.384590162594685],i=[-.3308618287255563,.214847559468213,.09509516302823659],r=[-4.634230498983486,-5.799100973351585,-19.33244095627987],s=[6.228269936347081,14.17993336680509,56.69055260068105],a=[4.776384997670288,-13.74514537774601,-65.35303263337234],o=[-5.435455855934631,4.645852612178535,26.3124352495832];return[t[0]+n*(e[0]+n*(i[0]+n*(r[0]+n*(s[0]+n*(a[0]+n*o[0]))))),t[1]+n*(e[1]+n*(i[1]+n*(r[1]+n*(s[1]+n*(a[1]+n*o[1]))))),t[2]+n*(e[2]+n*(i[2]+n*(r[2]+n*(s[2]+n*(a[2]+n*o[2])))))]}function O8(n){const{c0:t,c1:e}=n;return i=>{i=Math.min(Math.max(i,0),1);const r=t[0]*(1-i)+e[0]*i,s=t[1]*(1-i)+e[1]*i,a=t[2]*(1-i)+e[2]*i;return[r,s,a]}}function F8(n){const{c0:t,c1:e,c2:i}=n;return r=>{r=Math.max(0,Math.min(1,r));function s(c,h,u,p){return(1-c)*(1-c)*h+2*(1-c)*c*u+c*c*p}const a=s(r,t[0],e[0],i[0]),o=s(r,t[1],e[1],i[1]),l=s(r,t[2],e[2],i[2]);return[a,o,l]}}function U8(n){let t=n.map(e=>({...e}));for(let e=0;e({radius:1,azimuth:s*(2*Math.PI/e),altitude:-1/0}));for(let r of n){const{azimuth:s,altitude:a}=k8(t,r),o=Math.round(s/(2*Math.PI/e))%e;a>i[o].altitude&&(i[o].altitude=a)}return U8(i),i}function B8(n,t,e){let i=[],r=0;for(;rMath.abs(s.azimuth-i)=0;i--){const r=n[i],s=e(r.vector.spherical.azimuth);s&&r.vector.spherical.altitudeh||m>u)throw new Error("Given coordinates are outside the bounding box.");const g=await c.readRasters({window:[p,m,p+1,m+1]});let _;return typeof g[0]=="number"?_=g[0]:_=g[0][0],_!=0||(_=(async(x,M,b,S,R)=>{let C;for(let T=1;T=0&&P=0&&E{const r=s=>{e(s),s=s+1,s==t?i():setTimeout(()=>r(s),0)};setTimeout(()=>r(0),0)})}function K8(n,t){for(var e=0;e 1.0 || v < 0.0 || u + v > 1.0 || t <= 0.0) ? INFINITY : t; + return (u < 0.0 || u > 1.0 || v < 0.0 || u + v > 1.0 || t <= 0.01) ? INFINITY : t; } @@ -3939,11 +3939,11 @@ void main() { precision highp float; void main() { } - `,u=FE(l,l.VERTEX_SHADER,c),p=FE(l,l.FRAGMENT_SHADER,h),m=J8(l,u,p,["outColor"]),g=l.createVertexArray();l.bindVertexArray(g);var _=l.getParameter(l.MAX_TEXTURE_SIZE),y=Math.min(3*s,Math.floor(_/9)*9),x=Math.ceil(3*s/y);console.log("Max Texture Size",_,y,x);const M=RR(l,o*16),b=Q8(l,M);l.useProgram(m);var S=l.createTexture();l.bindTexture(l.TEXTURE_2D,S);var R;if(x==1)R=e;else{R=new Float32Array(y*x*3);for(var T=0;T<3*s;T++)for(var C=3*T%y,N=Math.floor(3*T/y),P=N*y+C,E=0;E<3;E++)R[P+E]=e[3*T+E]}l.texImage2D(l.TEXTURE_2D,0,l.RGB32F,y,x,0,l.RGB,l.FLOAT,R),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,null);var L=l.getUniformLocation(m,"u_triangles");l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,S),l.uniform1i(L,0);var B=l.getUniformLocation(m,"textureWidth");l.uniform1i(B,y);const V=l.getAttribLocation(m,"a_position"),j=l.getAttribLocation(m,"a_normal"),Y=UE(l,n,V),q=UE(l,t,j);for(var at=null,G=null,T=0;T(ht+1)%4===0)):(at=OE(l,M,o),Z8(G,at.filter(($,ht)=>(ht+1)%4===0)))}return l.deleteTexture(S),l.deleteShader(u),l.deleteShader(p),l.deleteProgram(m),l.deleteBuffer(Y),l.deleteBuffer(q),l.deleteTransformFeedback(b),l.deleteBuffer(M),G}function OE(n,t,e){let i=new Float32Array(e*4);return n.bindBuffer(n.ARRAY_BUFFER,t),n.getBufferSubData(n.ARRAY_BUFFER,0,i),n.bindBuffer(n.ARRAY_BUFFER,null),i}function FE(n,t,e){const i=n.createShader(t);return i===null?null:(n.shaderSource(i,e),n.compileShader(i),n.getShaderParameter(i,n.COMPILE_STATUS)?i:(console.error(n.getShaderInfoLog(i)),n.deleteShader(i),null))}function J8(n,t,e,i){const r=n.createProgram();if(r===null||t===null||e===null)throw new Error("abortSimulation");if(n.attachShader(r,t),n.attachShader(r,e),n.transformFeedbackVaryings(r,i,n.SEPARATE_ATTRIBS),n.linkProgram(r),n.getProgramParameter(r,n.LINK_STATUS))return r;throw console.error(n.getProgramInfoLog(r)),n.deleteProgram(r),new Error("Program compilation error.")}function RR(n,t){const e=n.createBuffer();return n.bindBuffer(n.ARRAY_BUFFER,e),n.bufferData(n.ARRAY_BUFFER,t,n.DYNAMIC_DRAW),e}function Q8(n,t){const e=n.createTransformFeedback();return n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,e),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,t),e}function UE(n,t,e){const i=RR(n,t);return n.enableVertexAttribArray(e),n.vertexAttribPointer(e,3,n.FLOAT,!1,0,0),i}function tH(n,t,e,i){n.enable(n.RASTERIZER_DISCARD),n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,t),n.beginTransformFeedback(n.POINTS),n.drawArrays(e,0,i),n.endTransformFeedback(),n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,null),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,null),n.disable(n.RASTERIZER_DISCARD)}var PR=class{constructor(n,t){if(n===void 0||t===void 0)throw new Error("Latitude and Longitude must be defined");this.simulationGeometries=[],this.shadingGeometries=[],this.elevationRaster=[],this.elevationRasterMidpoint={x:0,y:0,z:0},this.latitude=n,this.longitude=t,this.elevationAzimuthDivisions=60,this.colorMap=CR}addSimulationGeometry(n){this.simulationGeometries.push(n),this.shadingGeometries.push(n)}addShadingGeometry(n){this.shadingGeometries.push(n)}addElevationRaster(n,t,e){this.elevationAzimuthDivisions=e,this.elevationRaster=n,this.elevationRasterMidpoint=t}addColorMap(n){this.colorMap=n}refineMesh(n,t){const e=n.attributes.position.array.slice();let i=[],r=[];for(let l=0;lc[p%3]))}let s=new Vf;const a=new Float32Array(r),o=new Float32Array(i);return s.setAttribute("position",new ia(o,3)),s.setAttribute("normal",new ia(a,3)),s.attributes.position.needsUpdate=!0,s.attributes.normal.needsUpdate=!0,s}async calculate(n={}){const{numberSimulations:t=80,diffuseIrradianceURL:e,pvCellEfficiency:i=.2,maxYieldPerSquareMeter:r=1400*.2,progressCallback:s=(S,R)=>console.log(`Progress: ${S}/${R}%`),urlDirectIrrandianceTIF:a,urlDiffuseIrrandianceTIF:o}=n;if(o===void 0||a===void 0)throw new Error("A URL for the geotif files for Diffuse and Direct Irradiance is undefined.");console.log("Simulation package was called to calculate");let l=CE(this.simulationGeometries),c=CE(this.shadingGeometries);l=this.refineMesh(l,1),console.log("Number of simulation triangles:",l.attributes.position.count/3),console.log("Number of shading triangles:",c.attributes.position.count/3);const h=c.attributes.position.array,u=l.attributes.position.array,p=l.attributes.normal.array;let m=0,g=[];for(let S=0;S0&&console.log(`${m}/${g.length} midpoints are nan`);const _=new Float32Array(g.slice());let y=0;for(let S=0;S0&&console.log(`${y}/${h.length} mesh coordinates are nan`),console.log("Calling this.rayTrace");const x=await this.rayTrace(_,p,h,t,void 0,s);let M=new Float32Array;typeof e=="string"&&(M=await this.rayTrace(_,p,h,0,e,s)),console.log("directIntensities",x),console.log("diffuseIntensities",M);const b=await j8(x,M,i,this.latitude,this.longitude,a,o);return console.log("finalIntensities",b),this.createMesh(l,b,r)}createMesh(n,t,e){const i=n.attributes.position.array.length/9;for(var r=new Float32Array(i*9),s=0;s0)a=B8(i,this.latitude,this.longitude);else throw new Error("No irradiance found for the simulation. Either give a valid URL for diffuse radiation or a numberSimulation > 0.")}this.elevationRaster.length>0&&(o=z8(this.elevationRaster,this.elevationRasterMidpoint,this.elevationAzimuthDivisions),W8(a,o)),t=t.filter((c,h)=>h%9<3);let l=K8(n,t,e,a,s);if(l===null)throw new Error("Error occured when running the Raytracing in WebGL.");for(let c=0;c=this.text.length)return;n=this.text[this.place++]}switch(this.state){case lf:return this.neutral(n);case LR:return this.keyword(n);case M0:return this.quoted(n);case NR:return this.afterquote(n);case DR:return this.number(n);case tM:return}};la.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=M0;return}if(bg.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)};la.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=lf;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=lf,this.currentObject=this.stack.pop(),this.currentObject||(this.state=tM);return}};la.prototype.number=function(n){if(OR.test(n)){this.word+=n;return}if(bg.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)};la.prototype.quoted=function(n){if(n==='"'){this.state=NR;return}this.word+=n};la.prototype.keyword=function(n){if(hH.test(n)){this.word+=n;return}if(n==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=lf;return}if(bg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)};la.prototype.neutral=function(n){if(cH.test(n)){this.word=n,this.state=LR;return}if(n==='"'){this.word="",this.state=M0;return}if(OR.test(n)){this.word=n,this.state=DR;return}if(bg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)};la.prototype.output=function(){for(;this.place0?90:-90),n.lat_ts=n.lat1):!n.lat_ts&&n.lat0&&n.projName==="Polar_Stereographic"&&(n.lat_ts=n.lat0,n.lat0=cs(n.lat0>0?90:-90))}function FR(n){var t=uH(n),e=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",e]);var r={};return Sc(t,r),pH(r),r}function xi(n){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?xi[n]=av(arguments[1]):xi[n]=FR(arguments[1]):xi[n]=e}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(i){Array.isArray(i)?xi.apply(t,i):xi(i)});if(typeof n=="string"){if(n in xi)return xi[n]}else"EPSG"in n?xi["EPSG:"+n.EPSG]=n:"ESRI"in n?xi["ESRI:"+n.ESRI]=n:"IAU2000"in n?xi["IAU2000:"+n.IAU2000]=n:console.log(n);return}}eH(xi);function mH(n){return typeof n=="string"}function gH(n){return n in xi}var yH=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function xH(n){return yH.some(function(t){return n.indexOf(t)>-1})}var _H=["3857","900913","3785","102113"];function vH(n){var t=Xa(n,"authority");if(t){var e=Xa(t,"epsg");return e&&_H.indexOf(e)>-1}}function MH(n){var t=Xa(n,"extension");if(t)return Xa(t,"proj4")}function wH(n){return n[0]==="+"}function bH(n){if(mH(n)){if(gH(n))return xi[n];if(xH(n)){var t=FR(n);if(vH(t))return xi["EPSG:3857"];var e=MH(t);return e?av(e):t}if(wH(n))return av(n)}else return n}function WE(n,t){n=n||{};var e,i;if(!t)return n;for(i in t)e=t[i],e!==void 0&&(n[i]=e);return n}function Ts(n,t,e){var i=n*t;return e/Math.sqrt(1-i*i)}function jf(n){return n<0?-1:1}function Jt(n){return Math.abs(n)<=xn?n:n-jf(n)*of}function Hr(n,t,e){var i=n*e,r=.5*n;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(Lt-t))/i}function cf(n,t){for(var e=.5*n,i,r,s=Lt-2*Math.atan(t),a=0;a<=15;a++)if(i=n*Math.sin(s),r=Lt-2*Math.atan(t*Math.pow((1-i)/(1+i),e))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}function SH(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Ts(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function EH(n){var t=n.x,e=n.y;if(e*xs>90&&e*xs<-90&&t*xs>180&&t*xs<-180)return null;var i,r;if(Math.abs(Math.abs(e)-Lt)<=Zt)return null;if(this.sphere)i=this.x0+this.a*this.k0*Jt(t-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(Ve+.5*e));else{var s=Math.sin(e),a=Hr(this.e,e,s);i=this.x0+this.a*this.k0*Jt(t-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return n.x=i,n.y=r,n}function AH(n){var t=n.x-this.x0,e=n.y-this.y0,i,r;if(this.sphere)r=Lt-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(r=cf(this.e,s),r===-9999)return null}return i=Jt(this.long0+t/(this.a*this.k0)),n.x=i,n.y=r,n}var TH=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const CH={init:SH,forward:EH,inverse:AH,names:TH};function RH(){}function jE(n){return n}var PH=["longlat","identity"];const IH={init:RH,forward:jE,inverse:jE,names:PH};var LH=[CH,IH],Dm={},w0=[];function UR(n,t){var e=w0.length;return n.names?(w0[e]=n,n.names.forEach(function(i){Dm[i.toLowerCase()]=e}),this):(console.log(t),!0)}function DH(n){if(!n)return!1;var t=n.toLowerCase();if(typeof Dm[t]<"u"&&w0[Dm[t]])return w0[Dm[t]]}function NH(){LH.forEach(UR)}const OH={start:NH,add:UR,get:DH};var Me={};Me.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Me.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Me.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Me.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Me.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Me.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Me.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Me.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Me.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Me.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Me.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Me.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Me.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Me.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Me.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Me.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Me.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Me.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Me.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Me.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Me.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Me.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Me.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Me.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Me.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Me.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Me.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Me.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Me.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Me.hough={a:6378270,rf:297,ellipseName:"Hough"};Me.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Me.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Me.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Me.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Me.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Me.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Me.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Me.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Me.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Me.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Me.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Me.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var FH=Me.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Me.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function UH(n,t,e,i){var r=n*n,s=t*t,a=(r-s)/r,o=0;i?(n*=1-a*(rH+a*(sH+a*aH)),r=n*n,a=0):o=Math.sqrt(a);var l=(r-s)/s;return{es:a,e:o,ep2:l}}function kH(n,t,e,i,r){if(!n){var s=Xa(Me,i);s||(s=FH),n=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*n),(e===0||Math.abs(n-t)3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=sl,o.datum_params[3]*=Pu,o.datum_params[4]*=Pu,o.datum_params[5]*=Pu,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Oc,o.grids=a),o.a=e,o.b=i,o.es=r,o.ep2=s,o}var kR={};function BH(n,t){var e=new DataView(t),i=VH(e),r=WH(e,i),s=jH(e,r,i),a={header:r,subgrids:s};return kR[n]=a,a}function HH(n){if(n===void 0)return null;var t=n.split(",");return t.map(GH)}function GH(n){if(n.length===0)return null;var t=n[0]==="@";return t&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:n,mandatory:!t,grid:kR[n]||null,isNull:!1}}function Ec(n){return n/3600*Math.PI/180}function VH(n){var t=n.getInt32(8,!1);return t===11?!1:(t=n.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function WH(n,t){return{nFields:n.getInt32(8,t),nSubgridFields:n.getInt32(24,t),nSubgrids:n.getInt32(40,t),shiftType:ov(n,56,64).trim(),fromSemiMajorAxis:n.getFloat64(120,t),fromSemiMinorAxis:n.getFloat64(136,t),toSemiMajorAxis:n.getFloat64(152,t),toSemiMinorAxis:n.getFloat64(168,t)}}function ov(n,t,e){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(t,e)))}function jH(n,t,e){for(var i=176,r=[],s=0;s5e-11?!1:n.datum_type===rl?n.datum_params[0]===t.datum_params[0]&&n.datum_params[1]===t.datum_params[1]&&n.datum_params[2]===t.datum_params[2]:n.datum_type===sl?n.datum_params[0]===t.datum_params[0]&&n.datum_params[1]===t.datum_params[1]&&n.datum_params[2]===t.datum_params[2]&&n.datum_params[3]===t.datum_params[3]&&n.datum_params[4]===t.datum_params[4]&&n.datum_params[5]===t.datum_params[5]&&n.datum_params[6]===t.datum_params[6]:!0}function zR(n,t,e){var i=n.x,r=n.y,s=n.z?n.z:0,a,o,l,c;if(r<-Lt&&r>-1.001*Lt)r=-Lt;else if(r>Lt&&r<1.001*Lt)r=Lt;else{if(r<-Lt)return{x:-1/0,y:-1/0,z:n.z};if(r>Lt)return{x:1/0,y:1/0,z:n.z}}return i>Math.PI&&(i-=2*Math.PI),o=Math.sin(r),c=Math.cos(r),l=o*o,a=e/Math.sqrt(1-t*l),{x:(a+s)*c*Math.cos(i),y:(a+s)*c*Math.sin(i),z:(a*(1-t)+s)*o}}function BR(n,t,e,i){var r=1e-12,s=r*r,a=30,o,l,c,h,u,p,m,g,_,y,x,M,b,S=n.x,R=n.y,T=n.z?n.z:0,C,N,P;if(o=Math.sqrt(S*S+R*R),l=Math.sqrt(S*S+R*R+T*T),o/es&&bi.y||m>i.x||yo&&Math.abs(l.y)>o);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=Jt(s.x+e.ll[0]),i.y=s.y+e.ll[1]}else isNaN(s.x)||(i.x=n.x+s.x,i.y=n.y+s.y);return i}function qE(n,t){var e={x:n.x/t.del[0],y:n.y/t.del[1]},i={x:Math.floor(e.x),y:Math.floor(e.y)},r={x:e.x-1*i.x,y:e.y-1*i.y},s={x:Number.NaN,y:Number.NaN},a;if(i.x<0||i.x>=t.lim[0]||i.y<0||i.y>=t.lim[1])return s;a=i.y*t.lim[0]+i.x;var o={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var l={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var c={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var h={x:t.cvs[a][0],y:t.cvs[a][1]},u=r.x*r.y,p=r.x*(1-r.y),m=(1-r.x)*(1-r.y),g=(1-r.x)*r.y;return s.x=m*o.x+p*l.x+g*h.x+u*c.x,s.y=m*o.y+p*l.y+g*h.y+u*c.y,s}function $E(n,t,e){var i=e.x,r=e.y,s=e.z||0,a,o,l,c={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(a=i,"ew".indexOf(n.axis[l])!==-1?o="x":o="y"):l===1?(a=r,"ns".indexOf(n.axis[l])!==-1?o="y":o="x"):(a=s,o="z"),n.axis[l]){case"e":c[o]=a;break;case"w":c[o]=-a;break;case"n":c[o]=a;break;case"s":c[o]=-a;break;case"u":e[o]!==void 0&&(c.z=a);break;case"d":e[o]!==void 0&&(c.z=-a);break;default:return null}return c}function HR(n){var t={x:n[0],y:n[1]};return n.length>2&&(t.z=n[2]),n.length>3&&(t.m=n[3]),t}function tG(n){YE(n.x),YE(n.y)}function YE(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function eG(n,t){return(n.datum.datum_type===rl||n.datum.datum_type===sl||n.datum.datum_type===Oc)&&t.datumCode!=="WGS84"||(t.datum.datum_type===rl||t.datum.datum_type===sl||t.datum.datum_type===Oc)&&n.datumCode!=="WGS84"}function b0(n,t,e,i){var r;Array.isArray(e)?e=HR(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var s=e.z!==void 0;if(tG(e),n.datum&&t.datum&&eG(n,t)&&(r=new bs("WGS84"),e=b0(n,r,e,i),n=r),i&&n.axis!=="enu"&&(e=$E(n,!1,e)),n.projName==="longlat")e={x:e.x*$n,y:e.y*$n,z:e.z||0};else if(n.to_meter&&(e={x:e.x*n.to_meter,y:e.y*n.to_meter,z:e.z||0}),e=n.inverse(e),!e)return;if(n.from_greenwich&&(e.x+=n.from_greenwich),e=JH(n.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*xs,y:e.y*xs,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),i&&t.axis!=="enu"?$E(t,!0,e):(e&&!s&&delete e.z,e)}var ZE=bs("WGS84");function t_(n,t,e,i){var r,s,a;return Array.isArray(e)?(r=b0(n,t,e,i)||{x:NaN,y:NaN},e.length>2?typeof n.name<"u"&&n.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof r.z=="number"?[r.x,r.y,r.z].concat(e.splice(3)):[r.x,r.y,e[2]].concat(e.splice(3)):[r.x,r.y].concat(e.splice(2)):[r.x,r.y]):(s=b0(n,t,e,i),a=Object.keys(e),a.length===2||a.forEach(function(o){if(typeof n.name<"u"&&n.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;s[o]=e[o]}),s)}function KE(n){return n instanceof bs?n:n.oProj?n.oProj:bs(n)}function Mr(n,t,e){n=KE(n);var i=!1,r;return typeof t>"u"?(t=n,n=ZE,i=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=n,n=ZE,i=!0),t=KE(t),e?t_(n,t,e):(r={forward:function(s,a){return t_(n,t,s,a)},inverse:function(s,a){return t_(t,n,s,a)}},i&&(r.oProj=t),r)}var JE=6,GR="AJSAJS",VR="AFAFAF",Ac=65,Ii=73,dr=79,uu=86,fu=90;const nG={forward:WR,inverse:iG,toPoint:jR};function WR(n,t){return t=t||5,aG(rG({lat:n[1],lon:n[0]}),t)}function iG(n){var t=eM(qR(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function jR(n){var t=eM(qR(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function e_(n){return n*(Math.PI/180)}function QE(n){return 180*(n/Math.PI)}function rG(n){var t=n.lat,e=n.lon,i=6378137,r=.00669438,s=.9996,a,o,l,c,h,u,p,m=e_(t),g=e_(e),_,y;y=Math.floor((e+180)/6)+1,e===180&&(y=60),t>=56&&t<64&&e>=3&&e<12&&(y=32),t>=72&&t<84&&(e>=0&&e<9?y=31:e>=9&&e<21?y=33:e>=21&&e<33?y=35:e>=33&&e<42&&(y=37)),a=(y-1)*6-180+3,_=e_(a),o=r/(1-r),l=i/Math.sqrt(1-r*Math.sin(m)*Math.sin(m)),c=Math.tan(m)*Math.tan(m),h=o*Math.cos(m)*Math.cos(m),u=Math.cos(m)*(g-_),p=i*((1-r/4-3*r*r/64-5*r*r*r/256)*m-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*m)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*m)-35*r*r*r/3072*Math.sin(6*m));var x=s*l*(u+(1-c+h)*u*u*u/6+(5-18*c+c*c+72*h-58*o)*u*u*u*u*u/120)+5e5,M=s*(p+l*Math.tan(m)*(u*u/2+(5-c+9*h+4*h*h)*u*u*u*u/24+(61-58*c+c*c+600*h-330*o)*u*u*u*u*u*u/720));return t<0&&(M+=1e7),{northing:Math.round(M),easting:Math.round(x),zoneNumber:y,zoneLetter:sG(t)}}function eM(n){var t=n.northing,e=n.easting,i=n.zoneLetter,r=n.zoneNumber;if(r<0||r>60)return null;var s=.9996,a=6378137,o=.00669438,l,c=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),h,u,p,m,g,_,y,x,M,b=e-5e5,S=t;i<"N"&&(S-=1e7),y=(r-1)*6-180+3,l=o/(1-o),_=S/s,x=_/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),M=x+(3*c/2-27*c*c*c/32)*Math.sin(2*x)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*x)+151*c*c*c/96*Math.sin(6*x),h=a/Math.sqrt(1-o*Math.sin(M)*Math.sin(M)),u=Math.tan(M)*Math.tan(M),p=l*Math.cos(M)*Math.cos(M),m=a*(1-o)/Math.pow(1-o*Math.sin(M)*Math.sin(M),1.5),g=b/(h*s);var R=M-h*Math.tan(M)/m*(g*g/2-(5+3*u+10*p-4*p*p-9*l)*g*g*g*g/24+(61+90*u+298*p+45*u*u-252*l-3*p*p)*g*g*g*g*g*g/720);R=QE(R);var T=(g-(1+2*u+p)*g*g*g/6+(5-2*p+28*u-3*p*p+8*l+24*u*u)*g*g*g*g*g/120)/Math.cos(M);T=y+QE(T);var C;if(n.accuracy){var N=eM({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});C={top:N.lat,right:N.lon,bottom:R,left:T}}else C={lat:R,lon:T};return C}function sG(n){var t="Z";return 84>=n&&n>=72?t="X":72>n&&n>=64?t="W":64>n&&n>=56?t="V":56>n&&n>=48?t="U":48>n&&n>=40?t="T":40>n&&n>=32?t="S":32>n&&n>=24?t="R":24>n&&n>=16?t="Q":16>n&&n>=8?t="P":8>n&&n>=0?t="N":0>n&&n>=-8?t="M":-8>n&&n>=-16?t="L":-16>n&&n>=-24?t="K":-24>n&&n>=-32?t="J":-32>n&&n>=-40?t="H":-40>n&&n>=-48?t="G":-48>n&&n>=-56?t="F":-56>n&&n>=-64?t="E":-64>n&&n>=-72?t="D":-72>n&&n>=-80&&(t="C"),t}function aG(n,t){var e="00000"+n.easting,i="00000"+n.northing;return n.zoneNumber+n.zoneLetter+oG(n.easting,n.northing,n.zoneNumber)+e.substr(e.length-5,t)+i.substr(i.length-5,t)}function oG(n,t,e){var i=XR(e),r=Math.floor(n/1e5),s=Math.floor(t/1e5)%20;return lG(r,s,i)}function XR(n){var t=n%JE;return t===0&&(t=JE),t}function lG(n,t,e){var i=e-1,r=GR.charCodeAt(i),s=VR.charCodeAt(i),a=r+n-1,o=s+t,l=!1;a>fu&&(a=a-fu+Ac-1,l=!0),(a===Ii||rIi||(a>Ii||rdr||(a>dr||rfu&&(a=a-fu+Ac-1),o>uu?(o=o-uu+Ac-1,l=!0):l=!1,(o===Ii||sIi||(o>Ii||sdr||(o>dr||suu&&(o=o-uu+Ac-1);var c=String.fromCharCode(a)+String.fromCharCode(o);return c}function qR(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var t=n.length,e=null,i="",r,s=0;!/[A-Z]/.test(r=n.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+n;i+=r,s++}var a=parseInt(i,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+n;var o=n.charAt(s++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+n;e=n.substring(s,s+=2);for(var l=XR(a),c=cG(e.charAt(0),l),h=hG(e.charAt(1),l);h{if(!i[tt].isShadedByElevation){r(tt,i.length);let K=l.getUniformLocation(m,"u_sun_direction");l.uniform3fv(K,[i[tt].vector.cartesian.x,i[tt].vector.cartesian.y,i[tt].vector.cartesian.z]),eH(l,b,l.POINTS,o),G==null?(at=OE(l,M,o),G=at.filter(($,ht)=>(ht+1)%4===0)):(at=OE(l,M,o),K8(G,at.filter(($,ht)=>(ht+1)%4===0)))}}),l.deleteTexture(S),l.deleteShader(u),l.deleteShader(p),l.deleteProgram(m),l.deleteBuffer(Y),l.deleteBuffer(q),l.deleteTransformFeedback(b),l.deleteBuffer(M),G}function OE(n,t,e){let i=new Float32Array(e*4);return n.bindBuffer(n.ARRAY_BUFFER,t),n.getBufferSubData(n.ARRAY_BUFFER,0,i),n.bindBuffer(n.ARRAY_BUFFER,null),i}function FE(n,t,e){const i=n.createShader(t);return i===null?null:(n.shaderSource(i,e),n.compileShader(i),n.getShaderParameter(i,n.COMPILE_STATUS)?i:(console.error(n.getShaderInfoLog(i)),n.deleteShader(i),null))}function Q8(n,t,e,i){const r=n.createProgram();if(r===null||t===null||e===null)throw new Error("abortSimulation");if(n.attachShader(r,t),n.attachShader(r,e),n.transformFeedbackVaryings(r,i,n.SEPARATE_ATTRIBS),n.linkProgram(r),n.getProgramParameter(r,n.LINK_STATUS))return r;throw console.error(n.getProgramInfoLog(r)),n.deleteProgram(r),new Error("Program compilation error.")}function RR(n,t){const e=n.createBuffer();return n.bindBuffer(n.ARRAY_BUFFER,e),n.bufferData(n.ARRAY_BUFFER,t,n.DYNAMIC_DRAW),e}function tH(n,t){const e=n.createTransformFeedback();return n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,e),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,t),e}function UE(n,t,e){const i=RR(n,t);return n.enableVertexAttribArray(e),n.vertexAttribPointer(e,3,n.FLOAT,!1,0,0),i}function eH(n,t,e,i){n.enable(n.RASTERIZER_DISCARD),n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,t),n.beginTransformFeedback(n.POINTS),n.drawArrays(e,0,i),n.endTransformFeedback(),n.bindTransformFeedback(n.TRANSFORM_FEEDBACK,null),n.bindBufferBase(n.TRANSFORM_FEEDBACK_BUFFER,0,null),n.disable(n.RASTERIZER_DISCARD)}var PR=class{constructor(n,t){if(n===void 0||t===void 0)throw new Error("Latitude and Longitude must be defined");this.simulationGeometries=[],this.shadingGeometries=[],this.elevationRaster=[],this.elevationRasterMidpoint={x:0,y:0,z:0},this.latitude=n,this.longitude=t,this.elevationAzimuthDivisions=60,this.colorMap=CR}addSimulationGeometry(n){n=n.toNonIndexed(),this.simulationGeometries.push(n),this.shadingGeometries.push(n)}addShadingGeometry(n){n=n.toNonIndexed(),this.shadingGeometries.push(n)}addElevationRaster(n,t,e){this.elevationAzimuthDivisions=e,this.elevationRaster=n,this.elevationRasterMidpoint=t}addColorMap(n){this.colorMap=n}refineMesh(n,t){const e=n.attributes.position.array.slice();let i=[],r=[];for(let l=0;lc[p%3]))}let s=new Vf;const a=new Float32Array(r),o=new Float32Array(i);return s.setAttribute("position",new ia(o,3)),s.setAttribute("normal",new ia(a,3)),s.attributes.position.needsUpdate=!0,s.attributes.normal.needsUpdate=!0,s}async calculate(n={}){const{numberSimulations:t=80,diffuseIrradianceURL:e,pvCellEfficiency:i=.2,maxYieldPerSquareMeter:r=1400*.2,progressCallback:s=(C,T)=>console.log(`Progress: ${C}/${T}%`),urlDirectIrrandianceTIF:a,urlDiffuseIrrandianceTIF:o}=n;if(o===void 0||a===void 0)throw new Error("A URL for the geotif files for Diffuse and Direct Irradiance is undefined.");console.log("Simulation package was called to calculate");let l=CE(this.simulationGeometries),c=CE(this.shadingGeometries);l=this.refineMesh(l,1),console.log("Number of simulation triangles:",l.attributes.position.count/3),console.log("Number of shading triangles:",c.attributes.position.count/3);const h=c.attributes.position.array,u=l.attributes.position.array,p=l.attributes.normal.array;let m=0,g=[];for(let C=0;C0&&console.log(`${m}/${g.length} midpoints are nan`);const _=new Float32Array(g.slice());let y=0;for(let C=0;C0&&console.log(`${y}/${h.length} mesh coordinates are nan`),console.log("Calling this.rayTrace");const x=typeof e=="string",M=x?2:1,b=await this.rayTrace(_,p,h,t,void 0,(C,T)=>s(C,T*M));let S=new Float32Array;x&&(S=await this.rayTrace(_,p,h,0,e,(C,T)=>s(C+T,T*M))),console.log("directIntensities",b),console.log("diffuseIntensities",S);const R=await j8(b,S,i,this.latitude,this.longitude,a,o);return console.log("finalIntensities",R),this.createMesh(l,R,r)}createMesh(n,t,e){const i=n.attributes.position.array.length/9;for(var r=new Float32Array(i*9),s=0;s0)a=B8(i,this.latitude,this.longitude);else throw new Error("No irradiance found for the simulation. Either give a valid URL for diffuse radiation or a numberSimulation > 0.")}this.elevationRaster.length>0&&(o=z8(this.elevationRaster,this.elevationRasterMidpoint,this.elevationAzimuthDivisions),W8(a,o)),t=t.filter((c,h)=>h%9<3);let l=await J8(n,t,e,a,s);if(l===null)throw new Error("Error occured when running the Raytracing in WebGL.");for(let c=0;c=this.text.length)return;n=this.text[this.place++]}switch(this.state){case lf:return this.neutral(n);case LR:return this.keyword(n);case M0:return this.quoted(n);case NR:return this.afterquote(n);case DR:return this.number(n);case tM:return}};la.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=M0;return}if(bg.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)};la.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=lf;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=lf,this.currentObject=this.stack.pop(),this.currentObject||(this.state=tM);return}};la.prototype.number=function(n){if(OR.test(n)){this.word+=n;return}if(bg.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)};la.prototype.quoted=function(n){if(n==='"'){this.state=NR;return}this.word+=n};la.prototype.keyword=function(n){if(uH.test(n)){this.word+=n;return}if(n==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=lf;return}if(bg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)};la.prototype.neutral=function(n){if(hH.test(n)){this.word=n,this.state=LR;return}if(n==='"'){this.word="",this.state=M0;return}if(OR.test(n)){this.word=n,this.state=DR;return}if(bg.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)};la.prototype.output=function(){for(;this.place0?90:-90),n.lat_ts=n.lat1):!n.lat_ts&&n.lat0&&n.projName==="Polar_Stereographic"&&(n.lat_ts=n.lat0,n.lat0=cs(n.lat0>0?90:-90))}function FR(n){var t=fH(n),e=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",e]);var r={};return Sc(t,r),mH(r),r}function xi(n){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?xi[n]=av(arguments[1]):xi[n]=FR(arguments[1]):xi[n]=e}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(i){Array.isArray(i)?xi.apply(t,i):xi(i)});if(typeof n=="string"){if(n in xi)return xi[n]}else"EPSG"in n?xi["EPSG:"+n.EPSG]=n:"ESRI"in n?xi["ESRI:"+n.ESRI]=n:"IAU2000"in n?xi["IAU2000:"+n.IAU2000]=n:console.log(n);return}}nH(xi);function gH(n){return typeof n=="string"}function yH(n){return n in xi}var xH=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _H(n){return xH.some(function(t){return n.indexOf(t)>-1})}var vH=["3857","900913","3785","102113"];function MH(n){var t=Xa(n,"authority");if(t){var e=Xa(t,"epsg");return e&&vH.indexOf(e)>-1}}function wH(n){var t=Xa(n,"extension");if(t)return Xa(t,"proj4")}function bH(n){return n[0]==="+"}function SH(n){if(gH(n)){if(yH(n))return xi[n];if(_H(n)){var t=FR(n);if(MH(t))return xi["EPSG:3857"];var e=wH(t);return e?av(e):t}if(bH(n))return av(n)}else return n}function WE(n,t){n=n||{};var e,i;if(!t)return n;for(i in t)e=t[i],e!==void 0&&(n[i]=e);return n}function Ts(n,t,e){var i=n*t;return e/Math.sqrt(1-i*i)}function jf(n){return n<0?-1:1}function Jt(n){return Math.abs(n)<=xn?n:n-jf(n)*of}function Hr(n,t,e){var i=n*e,r=.5*n;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(Lt-t))/i}function cf(n,t){for(var e=.5*n,i,r,s=Lt-2*Math.atan(t),a=0;a<=15;a++)if(i=n*Math.sin(s),r=Lt-2*Math.atan(t*Math.pow((1-i)/(1+i),e))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}function EH(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Ts(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function AH(n){var t=n.x,e=n.y;if(e*xs>90&&e*xs<-90&&t*xs>180&&t*xs<-180)return null;var i,r;if(Math.abs(Math.abs(e)-Lt)<=Zt)return null;if(this.sphere)i=this.x0+this.a*this.k0*Jt(t-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(Ve+.5*e));else{var s=Math.sin(e),a=Hr(this.e,e,s);i=this.x0+this.a*this.k0*Jt(t-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return n.x=i,n.y=r,n}function TH(n){var t=n.x-this.x0,e=n.y-this.y0,i,r;if(this.sphere)r=Lt-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(r=cf(this.e,s),r===-9999)return null}return i=Jt(this.long0+t/(this.a*this.k0)),n.x=i,n.y=r,n}var CH=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const RH={init:EH,forward:AH,inverse:TH,names:CH};function PH(){}function jE(n){return n}var IH=["longlat","identity"];const LH={init:PH,forward:jE,inverse:jE,names:IH};var DH=[RH,LH],Dm={},w0=[];function UR(n,t){var e=w0.length;return n.names?(w0[e]=n,n.names.forEach(function(i){Dm[i.toLowerCase()]=e}),this):(console.log(t),!0)}function NH(n){if(!n)return!1;var t=n.toLowerCase();if(typeof Dm[t]<"u"&&w0[Dm[t]])return w0[Dm[t]]}function OH(){DH.forEach(UR)}const FH={start:OH,add:UR,get:NH};var Me={};Me.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Me.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Me.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Me.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Me.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Me.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Me.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Me.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Me.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Me.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Me.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Me.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Me.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Me.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Me.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Me.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Me.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Me.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Me.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Me.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Me.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Me.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Me.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Me.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Me.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Me.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Me.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Me.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Me.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Me.hough={a:6378270,rf:297,ellipseName:"Hough"};Me.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Me.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Me.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Me.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Me.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Me.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Me.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Me.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Me.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Me.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Me.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Me.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var UH=Me.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Me.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function kH(n,t,e,i){var r=n*n,s=t*t,a=(r-s)/r,o=0;i?(n*=1-a*(sH+a*(aH+a*oH)),r=n*n,a=0):o=Math.sqrt(a);var l=(r-s)/s;return{es:a,e:o,ep2:l}}function zH(n,t,e,i,r){if(!n){var s=Xa(Me,i);s||(s=UH),n=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*n),(e===0||Math.abs(n-t)3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=sl,o.datum_params[3]*=Pu,o.datum_params[4]*=Pu,o.datum_params[5]*=Pu,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Oc,o.grids=a),o.a=e,o.b=i,o.es=r,o.ep2=s,o}var kR={};function HH(n,t){var e=new DataView(t),i=WH(e),r=jH(e,i),s=XH(e,r,i),a={header:r,subgrids:s};return kR[n]=a,a}function GH(n){if(n===void 0)return null;var t=n.split(",");return t.map(VH)}function VH(n){if(n.length===0)return null;var t=n[0]==="@";return t&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:n,mandatory:!t,grid:kR[n]||null,isNull:!1}}function Ec(n){return n/3600*Math.PI/180}function WH(n){var t=n.getInt32(8,!1);return t===11?!1:(t=n.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function jH(n,t){return{nFields:n.getInt32(8,t),nSubgridFields:n.getInt32(24,t),nSubgrids:n.getInt32(40,t),shiftType:ov(n,56,64).trim(),fromSemiMajorAxis:n.getFloat64(120,t),fromSemiMinorAxis:n.getFloat64(136,t),toSemiMajorAxis:n.getFloat64(152,t),toSemiMinorAxis:n.getFloat64(168,t)}}function ov(n,t,e){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(t,e)))}function XH(n,t,e){for(var i=176,r=[],s=0;s5e-11?!1:n.datum_type===rl?n.datum_params[0]===t.datum_params[0]&&n.datum_params[1]===t.datum_params[1]&&n.datum_params[2]===t.datum_params[2]:n.datum_type===sl?n.datum_params[0]===t.datum_params[0]&&n.datum_params[1]===t.datum_params[1]&&n.datum_params[2]===t.datum_params[2]&&n.datum_params[3]===t.datum_params[3]&&n.datum_params[4]===t.datum_params[4]&&n.datum_params[5]===t.datum_params[5]&&n.datum_params[6]===t.datum_params[6]:!0}function zR(n,t,e){var i=n.x,r=n.y,s=n.z?n.z:0,a,o,l,c;if(r<-Lt&&r>-1.001*Lt)r=-Lt;else if(r>Lt&&r<1.001*Lt)r=Lt;else{if(r<-Lt)return{x:-1/0,y:-1/0,z:n.z};if(r>Lt)return{x:1/0,y:1/0,z:n.z}}return i>Math.PI&&(i-=2*Math.PI),o=Math.sin(r),c=Math.cos(r),l=o*o,a=e/Math.sqrt(1-t*l),{x:(a+s)*c*Math.cos(i),y:(a+s)*c*Math.sin(i),z:(a*(1-t)+s)*o}}function BR(n,t,e,i){var r=1e-12,s=r*r,a=30,o,l,c,h,u,p,m,g,_,y,x,M,b,S=n.x,R=n.y,C=n.z?n.z:0,T,N,P;if(o=Math.sqrt(S*S+R*R),l=Math.sqrt(S*S+R*R+C*C),o/es&&bi.y||m>i.x||yo&&Math.abs(l.y)>o);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=Jt(s.x+e.ll[0]),i.y=s.y+e.ll[1]}else isNaN(s.x)||(i.x=n.x+s.x,i.y=n.y+s.y);return i}function qE(n,t){var e={x:n.x/t.del[0],y:n.y/t.del[1]},i={x:Math.floor(e.x),y:Math.floor(e.y)},r={x:e.x-1*i.x,y:e.y-1*i.y},s={x:Number.NaN,y:Number.NaN},a;if(i.x<0||i.x>=t.lim[0]||i.y<0||i.y>=t.lim[1])return s;a=i.y*t.lim[0]+i.x;var o={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var l={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var c={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var h={x:t.cvs[a][0],y:t.cvs[a][1]},u=r.x*r.y,p=r.x*(1-r.y),m=(1-r.x)*(1-r.y),g=(1-r.x)*r.y;return s.x=m*o.x+p*l.x+g*h.x+u*c.x,s.y=m*o.y+p*l.y+g*h.y+u*c.y,s}function $E(n,t,e){var i=e.x,r=e.y,s=e.z||0,a,o,l,c={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(a=i,"ew".indexOf(n.axis[l])!==-1?o="x":o="y"):l===1?(a=r,"ns".indexOf(n.axis[l])!==-1?o="y":o="x"):(a=s,o="z"),n.axis[l]){case"e":c[o]=a;break;case"w":c[o]=-a;break;case"n":c[o]=a;break;case"s":c[o]=-a;break;case"u":e[o]!==void 0&&(c.z=a);break;case"d":e[o]!==void 0&&(c.z=-a);break;default:return null}return c}function HR(n){var t={x:n[0],y:n[1]};return n.length>2&&(t.z=n[2]),n.length>3&&(t.m=n[3]),t}function eG(n){YE(n.x),YE(n.y)}function YE(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function nG(n,t){return(n.datum.datum_type===rl||n.datum.datum_type===sl||n.datum.datum_type===Oc)&&t.datumCode!=="WGS84"||(t.datum.datum_type===rl||t.datum.datum_type===sl||t.datum.datum_type===Oc)&&n.datumCode!=="WGS84"}function b0(n,t,e,i){var r;Array.isArray(e)?e=HR(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var s=e.z!==void 0;if(eG(e),n.datum&&t.datum&&nG(n,t)&&(r=new bs("WGS84"),e=b0(n,r,e,i),n=r),i&&n.axis!=="enu"&&(e=$E(n,!1,e)),n.projName==="longlat")e={x:e.x*$n,y:e.y*$n,z:e.z||0};else if(n.to_meter&&(e={x:e.x*n.to_meter,y:e.y*n.to_meter,z:e.z||0}),e=n.inverse(e),!e)return;if(n.from_greenwich&&(e.x+=n.from_greenwich),e=QH(n.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*xs,y:e.y*xs,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),i&&t.axis!=="enu"?$E(t,!0,e):(e&&!s&&delete e.z,e)}var ZE=bs("WGS84");function t_(n,t,e,i){var r,s,a;return Array.isArray(e)?(r=b0(n,t,e,i)||{x:NaN,y:NaN},e.length>2?typeof n.name<"u"&&n.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof r.z=="number"?[r.x,r.y,r.z].concat(e.splice(3)):[r.x,r.y,e[2]].concat(e.splice(3)):[r.x,r.y].concat(e.splice(2)):[r.x,r.y]):(s=b0(n,t,e,i),a=Object.keys(e),a.length===2||a.forEach(function(o){if(typeof n.name<"u"&&n.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;s[o]=e[o]}),s)}function KE(n){return n instanceof bs?n:n.oProj?n.oProj:bs(n)}function Mr(n,t,e){n=KE(n);var i=!1,r;return typeof t>"u"?(t=n,n=ZE,i=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=n,n=ZE,i=!0),t=KE(t),e?t_(n,t,e):(r={forward:function(s,a){return t_(n,t,s,a)},inverse:function(s,a){return t_(t,n,s,a)}},i&&(r.oProj=t),r)}var JE=6,GR="AJSAJS",VR="AFAFAF",Ac=65,Ii=73,dr=79,uu=86,fu=90;const iG={forward:WR,inverse:rG,toPoint:jR};function WR(n,t){return t=t||5,oG(sG({lat:n[1],lon:n[0]}),t)}function rG(n){var t=eM(qR(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function jR(n){var t=eM(qR(n.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function e_(n){return n*(Math.PI/180)}function QE(n){return 180*(n/Math.PI)}function sG(n){var t=n.lat,e=n.lon,i=6378137,r=.00669438,s=.9996,a,o,l,c,h,u,p,m=e_(t),g=e_(e),_,y;y=Math.floor((e+180)/6)+1,e===180&&(y=60),t>=56&&t<64&&e>=3&&e<12&&(y=32),t>=72&&t<84&&(e>=0&&e<9?y=31:e>=9&&e<21?y=33:e>=21&&e<33?y=35:e>=33&&e<42&&(y=37)),a=(y-1)*6-180+3,_=e_(a),o=r/(1-r),l=i/Math.sqrt(1-r*Math.sin(m)*Math.sin(m)),c=Math.tan(m)*Math.tan(m),h=o*Math.cos(m)*Math.cos(m),u=Math.cos(m)*(g-_),p=i*((1-r/4-3*r*r/64-5*r*r*r/256)*m-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*m)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*m)-35*r*r*r/3072*Math.sin(6*m));var x=s*l*(u+(1-c+h)*u*u*u/6+(5-18*c+c*c+72*h-58*o)*u*u*u*u*u/120)+5e5,M=s*(p+l*Math.tan(m)*(u*u/2+(5-c+9*h+4*h*h)*u*u*u*u/24+(61-58*c+c*c+600*h-330*o)*u*u*u*u*u*u/720));return t<0&&(M+=1e7),{northing:Math.round(M),easting:Math.round(x),zoneNumber:y,zoneLetter:aG(t)}}function eM(n){var t=n.northing,e=n.easting,i=n.zoneLetter,r=n.zoneNumber;if(r<0||r>60)return null;var s=.9996,a=6378137,o=.00669438,l,c=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),h,u,p,m,g,_,y,x,M,b=e-5e5,S=t;i<"N"&&(S-=1e7),y=(r-1)*6-180+3,l=o/(1-o),_=S/s,x=_/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),M=x+(3*c/2-27*c*c*c/32)*Math.sin(2*x)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*x)+151*c*c*c/96*Math.sin(6*x),h=a/Math.sqrt(1-o*Math.sin(M)*Math.sin(M)),u=Math.tan(M)*Math.tan(M),p=l*Math.cos(M)*Math.cos(M),m=a*(1-o)/Math.pow(1-o*Math.sin(M)*Math.sin(M),1.5),g=b/(h*s);var R=M-h*Math.tan(M)/m*(g*g/2-(5+3*u+10*p-4*p*p-9*l)*g*g*g*g/24+(61+90*u+298*p+45*u*u-252*l-3*p*p)*g*g*g*g*g*g/720);R=QE(R);var C=(g-(1+2*u+p)*g*g*g/6+(5-2*p+28*u-3*p*p+8*l+24*u*u)*g*g*g*g*g/120)/Math.cos(M);C=y+QE(C);var T;if(n.accuracy){var N=eM({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});T={top:N.lat,right:N.lon,bottom:R,left:C}}else T={lat:R,lon:C};return T}function aG(n){var t="Z";return 84>=n&&n>=72?t="X":72>n&&n>=64?t="W":64>n&&n>=56?t="V":56>n&&n>=48?t="U":48>n&&n>=40?t="T":40>n&&n>=32?t="S":32>n&&n>=24?t="R":24>n&&n>=16?t="Q":16>n&&n>=8?t="P":8>n&&n>=0?t="N":0>n&&n>=-8?t="M":-8>n&&n>=-16?t="L":-16>n&&n>=-24?t="K":-24>n&&n>=-32?t="J":-32>n&&n>=-40?t="H":-40>n&&n>=-48?t="G":-48>n&&n>=-56?t="F":-56>n&&n>=-64?t="E":-64>n&&n>=-72?t="D":-72>n&&n>=-80&&(t="C"),t}function oG(n,t){var e="00000"+n.easting,i="00000"+n.northing;return n.zoneNumber+n.zoneLetter+lG(n.easting,n.northing,n.zoneNumber)+e.substr(e.length-5,t)+i.substr(i.length-5,t)}function lG(n,t,e){var i=XR(e),r=Math.floor(n/1e5),s=Math.floor(t/1e5)%20;return cG(r,s,i)}function XR(n){var t=n%JE;return t===0&&(t=JE),t}function cG(n,t,e){var i=e-1,r=GR.charCodeAt(i),s=VR.charCodeAt(i),a=r+n-1,o=s+t,l=!1;a>fu&&(a=a-fu+Ac-1,l=!0),(a===Ii||rIi||(a>Ii||rdr||(a>dr||rfu&&(a=a-fu+Ac-1),o>uu?(o=o-uu+Ac-1,l=!0):l=!1,(o===Ii||sIi||(o>Ii||sdr||(o>dr||suu&&(o=o-uu+Ac-1);var c=String.fromCharCode(a)+String.fromCharCode(o);return c}function qR(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var t=n.length,e=null,i="",r,s=0;!/[A-Z]/.test(r=n.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+n;i+=r,s++}var a=parseInt(i,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+n;var o=n.charAt(s++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+n;e=n.substring(s,s+=2);for(var l=XR(a),c=hG(e.charAt(0),l),h=uG(e.charAt(1),l);h0&&(_=1e5/Math.pow(10,p),y=n.substring(s,s+p),m=parseFloat(y)*_,x=n.substring(s+p),g=parseFloat(x)*_),M=m+c,b=g+h,{easting:M,northing:b,zoneLetter:o,zoneNumber:a,accuracy:_}}function cG(n,t){for(var e=GR.charCodeAt(t-1),i=1e5,r=!1;e!==n.charCodeAt(0);){if(e++,e===Ii&&e++,e===dr&&e++,e>fu){if(r)throw"Bad character: "+n;e=Ac,r=!0}i+=1e5}return i}function hG(n,t){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var e=VR.charCodeAt(t-1),i=0,r=!1;e!==n.charCodeAt(0);){if(e++,e===Ii&&e++,e===dr&&e++,e>uu){if(r)throw"Bad character: "+n;e=Ac,r=!0}i+=1e5}return i}function uG(n){var t;switch(n){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+n}function Jc(n,t,e){if(!(this instanceof Jc))return new Jc(n,t,e);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof t>"u"){var i=n.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=n,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Jc.fromMGRS=function(n){return new Jc(jR(n))};Jc.prototype.toMGRS=function(n){return WR([this.x,this.y],n)};var fG=1,dG=.25,tA=.046875,eA=.01953125,nA=.01068115234375,pG=.75,mG=.46875,gG=.013020833333333334,yG=.007120768229166667,xG=.3645833333333333,_G=.005696614583333333,vG=.3076171875;function nM(n){var t=[];t[0]=fG-n*(dG+n*(tA+n*(eA+n*nA))),t[1]=n*(pG-n*(tA+n*(eA+n*nA)));var e=n*n;return t[2]=e*(mG-n*(gG+n*yG)),e*=n,t[3]=e*(xG-n*_G),t[4]=e*n*vG,t}function mh(n,t,e,i){return e*=t,t*=t,i[0]*n-e*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var MG=20;function iM(n,t,e){for(var i=1/(1-t),r=n,s=MG;s;--s){var a=Math.sin(r),o=1-t*a*a;if(o=(mh(r,a,Math.cos(r),e)-n)*(o*Math.sqrt(o))*i,r-=o,Math.abs(o)Zt?Math.tan(e):0,_=Math.pow(g,2),y=Math.pow(_,2);r=1-this.es*Math.pow(o,2),h=h/Math.sqrt(r);var x=mh(e,o,l,this.en);s=this.a*(this.k0*h*(1+u/6*(1-_+p+u/20*(5-18*_+y+14*p-58*_*p+u/42*(61+179*y-y*_-479*_)))))+this.x0,a=this.a*(this.k0*(x-this.ml0+o*i*h/2*(1+u/12*(5-_+9*p+4*m+u/30*(61+y-58*_+270*p-330*_*p+u/56*(1385+543*y-y*_-3111*_))))))+this.y0}else{var c=l*Math.sin(i);if(Math.abs(Math.abs(c)-1)=1){if(c-1>Zt)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return n.x=s,n.y=a,n}function SG(n){var t,e,i,r,s=(n.x-this.x0)*(1/this.a),a=(n.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,e=iM(t,this.es,this.en),Math.abs(e)Zt?Math.tan(e):0,g=this.ep2*Math.pow(p,2),_=Math.pow(g,2),y=Math.pow(m,2),x=Math.pow(y,2);t=1-this.es*Math.pow(u,2);var M=s*Math.sqrt(t)/this.k0,b=Math.pow(M,2);t=t*m,i=e-t*b/(1-this.es)*.5*(1-b/12*(5+3*y-9*g*y+g-4*_-b/30*(61+90*y-252*g*y+45*x+46*g-b/56*(1385+3633*y+4095*x+1574*x*y)))),r=Jt(this.long0+M*(1-b/6*(1+2*y+g-b/20*(5+28*y+24*x+8*g*y+6*g-b/42*(61+662*y+1320*x+720*x*y))))/p)}else i=Lt*jf(a),r=0;else{var o=Math.exp(s/this.k0),l=.5*(o-1/o),c=this.lat0+a/this.k0,h=Math.cos(c);t=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(t),a<0&&(i=-i),l===0&&h===0?r=0:r=Jt(Math.atan2(l,h)+this.long0)}return n.x=r,n.y=i,n}var EG=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Nm={init:wG,forward:bG,inverse:SG,names:EG};function $R(n){var t=Math.exp(n);return t=(t-1/t)/2,t}function Di(n,t){n=Math.abs(n),t=Math.abs(t);var e=Math.max(n,t),i=Math.min(n,t)/(e||1);return e*Math.sqrt(1+Math.pow(i,2))}function AG(n){var t=1+n,e=t-1;return e===0?n:n*Math.log(t)/e}function TG(n){var t=Math.abs(n);return t=AG(t*(1+t/(Di(1,t)+1))),n<0?-t:t}function rM(n,t){for(var e=2*Math.cos(2*t),i=n.length-1,r=n[i],s=0,a;--i>=0;)a=-s+e*r+n[i],s=r,r=a;return t+a*Math.sin(2*t)}function CG(n,t){for(var e=2*Math.cos(t),i=n.length-1,r=n[i],s=0,a;--i>=0;)a=-s+e*r+n[i],s=r,r=a;return Math.sin(t)*a}function RG(n){var t=Math.exp(n);return t=(t+1/t)/2,t}function YR(n,t,e){for(var i=Math.sin(t),r=Math.cos(t),s=$R(e),a=RG(e),o=2*r*a,l=-2*i*s,c=n.length-1,h=n[c],u=0,p=0,m=0,g,_;--c>=0;)g=p,_=u,p=h,u=m,h=-g+o*p-l*u+n[c],m=-_+l*p+o*u;return o=i*a,l=r*s,[o*h-l*m,o*m+l*h]}function PG(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Nm.init.apply(this),this.forward=Nm.forward,this.inverse=Nm.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),t=n/(2-n),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var i=rM(this.cbg,this.lat0);this.Zb=-this.Qn*(i+CG(this.gtu,2*i))}function IG(n){var t=Jt(n.x-this.long0),e=n.y;e=rM(this.cbg,e);var i=Math.sin(e),r=Math.cos(e),s=Math.sin(t),a=Math.cos(t);e=Math.atan2(i,a*r),t=Math.atan2(s*r,Di(i,r*a)),t=TG(Math.tan(t));var o=YR(this.gtu,2*e,2*t);e=e+o[0],t=t+o[1];var l,c;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,c=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,c=1/0),n.x=l,n.y=c,n}function LG(n){var t=(n.x-this.x0)*(1/this.a),e=(n.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var i,r;if(Math.abs(t)<=2.623395162778){var s=YR(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan($R(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),c=Math.cos(t);e=Math.atan2(a*c,Di(l,c*o)),t=Math.atan2(l,c*o),i=Jt(t+this.long0),r=rM(this.cgb,e)}else i=1/0,r=1/0;return n.x=i,n.y=r,n}var DG=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Om={init:PG,forward:IG,inverse:LG,names:DG};function NG(n,t){if(n===void 0){if(n=Math.floor((Jt(t)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var OG="etmerc";function FG(){var n=NG(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*$n,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Om.init.apply(this),this.forward=Om.forward,this.inverse=Om.inverse}var UG=["Universal Transverse Mercator System","utm"];const kG={init:FG,names:UG,dependsOn:OG};function sM(n,t){return Math.pow((1-n)/(1+n),t)}var zG=20;function BG(){var n=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Ve)/(Math.pow(Math.tan(.5*this.lat0+Ve),this.C)*sM(this.e*n,this.ratexp))}function HG(n){var t=n.x,e=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Ve),this.C)*sM(this.e*Math.sin(e),this.ratexp))-Lt,n.x=this.C*t,n}function GG(n){for(var t=1e-14,e=n.x/this.C,i=n.y,r=Math.pow(Math.tan(.5*i+Ve)/this.K,1/this.C),s=zG;s>0&&(i=2*Math.atan(r*sM(this.e*Math.sin(n.y),-.5*this.e))-Lt,!(Math.abs(i-n.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Zt&&Math.abs(Math.cos(this.lat_ts))>Zt&&(this.k0=.5*this.cons*Ts(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Hr(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ts(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Lt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function KG(n){var t=n.x,e=n.y,i=Math.sin(e),r=Math.cos(e),s,a,o,l,c,h,u=Jt(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Zt&&Math.abs(e+this.lat0)<=Zt?(n.x=NaN,n.y=NaN,n):this.sphere?(s=2*this.k0/(1+this.sinlat0*i+this.coslat0*r*Math.cos(u)),n.x=this.a*s*r*Math.sin(u)+this.x0,n.y=this.a*s*(this.coslat0*i-this.sinlat0*r*Math.cos(u))+this.y0,n):(a=2*Math.atan(this.ssfn_(e,i,this.e))-Lt,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=Zt?(c=Hr(this.e,e*this.con,this.con*i),h=2*this.a*this.k0*c/this.cons,n.x=this.x0+h*Math.sin(t-this.long0),n.y=this.y0-this.con*h*Math.cos(t-this.long0),n):(Math.abs(this.sinlat0)0?t=Jt(this.long0+Math.atan2(n.x,-1*n.y)):t=Jt(this.long0+Math.atan2(n.x,n.y)):t=Jt(this.long0+Math.atan2(n.x*Math.sin(o),a*this.coslat0*Math.cos(o)-n.y*this.sinlat0*Math.sin(o))),n.x=t,n.y=e,n)}else if(Math.abs(this.coslat0)<=Zt){if(a<=Zt)return e=this.lat0,t=this.long0,n.x=t,n.y=e,n;n.x*=this.con,n.y*=this.con,i=a*this.cons/(2*this.a*this.k0),e=this.con*cf(this.e,i),t=this.con*Jt(this.con*this.long0+Math.atan2(n.x,-1*n.y))}else r=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=Zt?s=this.X0:(s=Math.asin(Math.cos(r)*this.sinX0+n.y*Math.sin(r)*this.cosX0/a),t=Jt(this.long0+Math.atan2(n.x*Math.sin(r),a*this.cosX0*Math.cos(r)-n.y*this.sinX0*Math.sin(r)))),e=-1*cf(this.e,Math.tan(.5*(Lt+s)));return n.x=t,n.y=e,n}var QG=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const tV={init:ZG,forward:KG,inverse:JG,names:QG,ssfn_:YG};function eV(){var n=this.lat0;this.lambda0=this.long0;var t=Math.sin(n),e=this.a,i=this.rf,r=1/i,s=2*r-Math.pow(r,2),a=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*l+this.alpha*a/2*c}function nV(n){var t=Math.log(Math.tan(Math.PI/4-n.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),i=-this.alpha*(t+e)+this.K,r=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(n.x-this.lambda0),a=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),o=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return n.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,n.x=this.R*a+this.x0,n}function iV(n){for(var t=n.x-this.x0,e=n.y-this.y0,i=t/this.R,r=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),o=this.lambda0+a/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=o,n.y=c,n}var rV=["somerc"];const sV={init:eV,forward:nV,inverse:iV,names:rV};var xc=1e-7;function aV(n){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof n.PROJECTION=="object"?Object.keys(n.PROJECTION)[0]:n.PROJECTION;return"no_uoff"in n||"no_off"in n||t.indexOf(e)!==-1}function oV(){var n,t,e,i,r,s,a,o,l,c,h=0,u,p=0,m=0,g=0,_=0,y=0,x=0;this.no_off=aV(this),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),M&&(x=this.alpha),b&&(h=this.rectified_grid_angle*$n),M||b)p=this.longc;else if(m=this.long1,_=this.lat1,g=this.long2,y=this.lat2,Math.abs(_-y)<=xc||(n=Math.abs(_))<=xc||Math.abs(n-Lt)<=xc||Math.abs(Math.abs(this.lat0)-Lt)<=xc||Math.abs(Math.abs(y)-Lt)<=xc)throw new Error;var S=1-this.es;t=Math.sqrt(S),Math.abs(this.lat0)>Zt?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),n=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*t/n,i=this.B*t/(e*Math.sqrt(n)),r=i*i-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=i,this.E*=Math.pow(Hr(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=r=1),M||b?(M?(u=Math.asin(Math.sin(x)/i),b||(h=x)):(u=h,x=Math.asin(i*Math.sin(u))),this.lam0=p-Math.asin(.5*(r-1/r)*Math.tan(u))/this.B):(s=Math.pow(Hr(this.e,_,Math.sin(_)),this.B),a=Math.pow(Hr(this.e,y,Math.sin(y)),this.B),r=this.E/s,l=(a-s)/(a+s),c=this.E*this.E,c=(c-a*s)/(c+a*s),n=m-g,n<-Math.pi?g-=of:n>Math.pi&&(g+=of),this.lam0=Jt(.5*(m+g)-Math.atan(c*Math.tan(.5*this.B*(m-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Jt(m-this.lam0))/(r-1/r)),h=x=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Ve-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ve+r))}function lV(n){var t={},e,i,r,s,a,o,l,c;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-Lt)>Zt){if(a=this.E/Math.pow(Hr(this.e,n.y,Math.sin(n.y)),this.B),o=1/a,e=.5*(a-o),i=.5*(a+o),s=Math.sin(this.B*n.x),r=(e*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(r)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(t.x=l,t.y=c):(l-=this.u_0,t.x=c*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-c*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function cV(n){var t,e,i,r,s,a,o,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(e=n.y,t=n.x):(e=n.x*this.cosrot-n.y*this.sinrot,t=n.y*this.cosrot+n.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*e),r=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(this.BrA*t),o=(a*this.cosgam+r*this.singam)/s,Math.abs(Math.abs(o)-1)Zt?this.ns=Math.log(i/o)/Math.log(r/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function dV(n){var t=n.x,e=n.y;Math.abs(2*Math.abs(e)-Math.PI)<=Zt&&(e=jf(e)*(Lt-2*Zt));var i=Math.abs(Math.abs(e)-Lt),r,s;if(i>Zt)r=Hr(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(r,this.ns);else{if(i=e*this.ns,i<=0)return null;s=0}var a=this.ns*Jt(t-this.long0);return n.x=this.k0*(s*Math.sin(a))+this.x0,n.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,n}function pV(n){var t,e,i,r,s,a=(n.x-this.x0)/this.k0,o=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),e=1):(t=-Math.sqrt(a*a+o*o),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*a,e*o)),t!==0||this.ns>0){if(e=1/this.ns,i=Math.pow(t/(this.a*this.f0),e),r=cf(this.e,i),r===-9999)return null}else r=-Lt;return s=Jt(l/this.ns+this.long0),n.x=s,n.y=r,n}var mV=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const gV={init:fV,forward:dV,inverse:pV,names:mV};function yV(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function xV(n){var t,e,i,r,s,a,o,l=n.x,c=n.y,h=Jt(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),i=-h*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(i)),s=Math.asin(Math.cos(e)*Math.sin(i)/Math.cos(r)),a=this.n*s,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),n.y=o*Math.cos(a)/1,n.x=o*Math.sin(a)/1,this.czech||(n.y*=-1,n.x*=-1),n}function _V(n){var t,e,i,r,s,a,o,l,c=n.x;n.x=n.y,n.y=c,this.czech||(n.y*=-1,n.x*=-1),a=Math.sqrt(n.x*n.x+n.y*n.y),s=Math.atan2(n.y,n.x),r=s/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),e=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(t)),n.x=this.long0-e/this.alfa,o=t,l=0;var h=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-n.y)<1e-10&&(l=1),o=n.y,h+=1;while(l===0&&h<15);return h>=15?null:n}var vV=["Krovak","krovak"];const MV={init:yV,forward:xV,inverse:_V,names:vV};function vi(n,t,e,i,r){return n*r-t*Math.sin(2*r)+e*Math.sin(4*r)-i*Math.sin(6*r)}function Xf(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function qf(n){return .375*n*(1+.25*n*(1+.46875*n))}function $f(n){return .05859375*n*n*(1+.75*n)}function Yf(n){return n*n*n*(35/3072)}function Qc(n,t,e){var i=t*e;return n/Math.sqrt(1-i*i)}function no(n){return Math.abs(n)1e-7?(e=n*t,(1-n*n)*(t/(1-e*e)-.5/n*Math.log((1-e)/(1+e)))):2*t}var TV=1,CV=2,RV=3,PV=4;function IV(){var n=Math.abs(this.lat0);if(Math.abs(n-Lt)0){var t;switch(this.qp=za(this.e,1),this.mmf=.5/(1-this.es),this.apa=BV(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=za(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function LV(n){var t,e,i,r,s,a,o,l,c,h,u=n.x,p=n.y;if(u=Jt(u-this.long0),this.sphere){if(s=Math.sin(p),h=Math.cos(p),i=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+h*i:1+this.sinph0*s+this.cosph0*h*i,e<=Zt)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(u),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(p+this.lat0)=0?(t=(c=Math.sqrt(a))*r,e=i*(this.mode===this.S_POLE?c:-c)):t=e=0;break}}return n.x=this.a*t+this.x0,n.y=this.a*e+this.y0,n}function DV(n){n.x-=this.x0,n.y-=this.y0;var t=n.x/this.a,e=n.y/this.a,i,r,s,a,o,l,c;if(this.sphere){var h=0,u,p=0;if(u=Math.sqrt(t*t+e*e),r=u*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(r),h=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(u)<=Zt?0:Math.asin(e*p/u),t*=p,e=h*u;break;case this.OBLIQ:r=Math.abs(u)<=Zt?this.lat0:Math.asin(h*this.sinph0+e*p*this.cosph0/u),t*=p*this.cosph0,e=(h-Math.sin(r)*this.sinph0)*u;break;case this.N_POLE:e=-e,r=Lt-r;break;case this.S_POLE:r-=Lt;break}i=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l1&&(n=n>1?1:-1),Math.asin(n)}function WV(){Math.abs(this.lat1+this.lat2)Zt?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function jV(n){var t=n.x,e=n.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var i=za(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*Jt(t-this.long0),a=r*Math.sin(s)+this.x0,o=this.rh-r*Math.cos(s)+this.y0;return n.x=a,n.y=o,n}function XV(n){var t,e,i,r,s,a;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),i=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),i=-1),r=0,t!==0&&(r=Math.atan2(i*n.x,i*n.y)),i=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-i*i)/(2*this.ns0)):(e=(this.c-i*i)/this.ns0,a=this.phi1z(this.e3,e)),s=Jt(r/this.ns0+this.long0),n.x=s,n.y=a,n}function qV(n,t){var e,i,r,s,a,o=qa(.5*t);if(n0||Math.abs(a)<=Zt?(o=this.x0+this.a*s*e*Math.sin(i)/a,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*r)/a):(o=this.x0+this.infinity_dist*e*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*r)),n.x=o,n.y=l,n}function JV(n){var t,e,i,r,s,a;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(t=Math.sqrt(n.x*n.x+n.y*n.y))?(r=Math.atan2(t,this.rc),e=Math.sin(r),i=Math.cos(r),a=qa(i*this.sin_p14+n.y*e*this.cos_p14/t),s=Math.atan2(n.x*e,t*this.cos_p14*i-n.y*this.sin_p14*e),s=Jt(this.long0+s)):(a=this.phic0,s=0),n.x=s,n.y=a,n}var QV=["gnom"];const t9={init:ZV,forward:KV,inverse:JV,names:QV};function e9(n,t){var e=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*Lt:Lt;for(var i=Math.asin(.5*t),r,s,a,o,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),o=n*s,r=Math.pow(1-o*o,2)/(2*a)*(t/(1-n*n)-s/(1-o*o)+.5/n*Math.log((1-o)/(1+o))),i+=r,Math.abs(r)<=1e-10)return i;return NaN}function n9(){this.sphere||(this.k0=Ts(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function i9(n){var t=n.x,e=n.y,i,r,s=Jt(t-this.long0);if(this.sphere)i=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=za(this.e,Math.sin(e));i=this.x0+this.a*this.k0*s,r=this.y0+this.a*a*.5/this.k0}return n.x=i,n.y=r,n}function r9(n){n.x-=this.x0,n.y-=this.y0;var t,e;return this.sphere?(t=Jt(this.long0+n.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(e=e9(this.e,2*n.y*this.k0/this.a),t=Jt(this.long0+n.x/(this.a*this.k0))),n.x=t,n.y=e,n}var s9=["cea"];const a9={init:n9,forward:i9,inverse:r9,names:s9};function o9(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function l9(n){var t=n.x,e=n.y,i=Jt(t-this.long0),r=no(e-this.lat0);return n.x=this.x0+this.a*i*this.rc,n.y=this.y0+this.a*r,n}function c9(n){var t=n.x,e=n.y;return n.x=Jt(this.long0+(t-this.x0)/(this.a*this.rc)),n.y=no(this.lat0+(e-this.y0)/this.a),n}var h9=["Equirectangular","Equidistant_Cylindrical","eqc"];const u9={init:o9,forward:l9,inverse:c9,names:h9};var iA=20;function f9(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Xf(this.es),this.e1=qf(this.es),this.e2=$f(this.es),this.e3=Yf(this.es),this.ml0=this.a*vi(this.e0,this.e1,this.e2,this.e3,this.lat0)}function d9(n){var t=n.x,e=n.y,i,r,s,a=Jt(t-this.long0);if(s=a*Math.sin(e),this.sphere)Math.abs(e)<=Zt?(i=this.a*a,r=-1*this.a*this.lat0):(i=this.a*Math.sin(s)/Math.tan(e),r=this.a*(no(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=Zt)i=this.a*a,r=-1*this.ml0;else{var o=Qc(this.a,this.e,Math.sin(e))/Math.tan(e);i=o*Math.sin(s),r=this.a*vi(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(s))}return n.x=i+this.x0,n.y=r+this.y0,n}function p9(n){var t,e,i,r,s,a,o,l,c;if(i=n.x-this.x0,r=n.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=Zt)t=Jt(i/this.a+this.long0),e=0;else{a=this.lat0+r/this.a,o=i*i/this.a/this.a+a*a,l=a;var h;for(s=iA;s;--s)if(h=Math.tan(l),c=-1*(a*(l*h+1)-l-.5*(l*l+o)*h)/((l-a)/h-1),l+=c,Math.abs(c)<=Zt){e=l;break}t=Jt(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(r+this.ml0)<=Zt)e=0,t=Jt(this.long0+i/this.a);else{a=(this.ml0+r)/this.a,o=i*i/this.a/this.a+a*a,l=a;var u,p,m,g,_;for(s=iA;s;--s)if(_=this.e*Math.sin(l),u=Math.sqrt(1-_*_)*Math.tan(l),p=this.a*vi(this.e0,this.e1,this.e2,this.e3,l),m=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),g=p/this.a,c=(a*(u*g+1)-g-.5*u*(g*g+o))/(this.es*Math.sin(2*l)*(g*g+o-2*a*g)/(4*u)+(a-g)*(u*m-2/Math.sin(2*l))-m),l-=c,Math.abs(c)<=Zt){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=Jt(this.long0+Math.asin(i*u/this.a)/Math.sin(e))}return n.x=t,n.y=e,n}var m9=["Polyconic","poly"];const g9={init:f9,forward:d9,inverse:p9,names:m9};function y9(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function x9(n){var t,e=n.x,i=n.y,r=i-this.lat0,s=e-this.long0,a=r/Pu*1e-5,o=s,l=1,c=0;for(t=1;t<=10;t++)l=l*a,c=c+this.A[t]*l;var h=c,u=o,p=1,m=0,g,_,y=0,x=0;for(t=1;t<=6;t++)g=p*h-m*u,_=m*h+p*u,p=g,m=_,y=y+this.B_re[t]*p-this.B_im[t]*m,x=x+this.B_im[t]*p+this.B_re[t]*m;return n.x=x*this.a+this.x0,n.y=y*this.a+this.y0,n}function _9(n){var t,e=n.x,i=n.y,r=e-this.x0,s=i-this.y0,a=s/this.a,o=r/this.a,l=1,c=0,h,u,p=0,m=0;for(t=1;t<=6;t++)h=l*a-c*o,u=c*a+l*o,l=h,c=u,p=p+this.C_re[t]*l-this.C_im[t]*c,m=m+this.C_im[t]*l+this.C_re[t]*c;for(var g=0;g.999999999999&&(e=.999999999999),t=Math.asin(e);var i=Jt(this.long0+n.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var r=Math.asin(e);return n.x=i,n.y=r,n}var F9=["Mollweide","moll"];const U9={init:D9,forward:N9,inverse:O9,names:F9};function k9(){Math.abs(this.lat1+this.lat2)=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),t=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*n.x,t*n.y)),this.sphere)return r=Jt(this.long0+s/this.ns),i=no(this.g-e/this.a),n.x=r,n.y=i,n;var a=this.g-e/this.a;return i=S0(a,this.e0,this.e1,this.e2,this.e3),r=Jt(this.long0+s/this.ns),n.x=r,n.y=i,n}var H9=["Equidistant_Conic","eqdc"];const G9={init:k9,forward:z9,inverse:B9,names:H9};function V9(){this.R=this.a}function W9(n){var t=n.x,e=n.y,i=Jt(t-this.long0),r,s;Math.abs(e)<=Zt&&(r=this.x0+this.R*i,s=this.y0);var a=qa(2*Math.abs(e/Math.PI));(Math.abs(i)<=Zt||Math.abs(Math.abs(e)-Lt)<=Zt)&&(r=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*a):s=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/i-i/Math.PI),l=o*o,c=Math.sin(a),h=Math.cos(a),u=h/(c+h-1),p=u*u,m=u*(2/c-1),g=m*m,_=Math.PI*this.R*(o*(u-g)+Math.sqrt(l*(u-g)*(u-g)-(g+l)*(p-g)))/(g+l);i<0&&(_=-_),r=this.x0+_;var y=l+u;return _=Math.PI*this.R*(m*y-o*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),e>=0?s=this.y0+_:s=this.y0-_,n.x=r,n.y=s,n}function j9(n){var t,e,i,r,s,a,o,l,c,h,u,p,m;return n.x-=this.x0,n.y-=this.y0,u=Math.PI*this.R,i=n.x/u,r=n.y/u,s=i*i+r*r,a=-Math.abs(r)*(1+s),o=a-2*r*r+i*i,l=-2*a+1+2*r*r+s*s,m=r*r/l+(2*o*o*o/l/l/l-9*a*o/l/l)/27,c=(a-o*o/3/l)/l,h=2*Math.sqrt(-c/3),u=3*m/c/h,Math.abs(u)>1&&(u>=0?u=1:u=-1),p=Math.acos(u)/3,n.y>=0?e=(-h*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI:e=-(-h*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI,Math.abs(i)2*Lt*this.a?void 0:(e=t/this.a,i=Math.sin(e),r=Math.cos(e),s=this.long0,Math.abs(t)<=Zt?a=this.lat0:(a=qa(r*this.sin_p12+n.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-Lt,Math.abs(o)<=Zt?this.lat0>=0?s=Jt(this.long0+Math.atan2(n.x,-n.y)):s=Jt(this.long0-Math.atan2(-n.x,n.y)):s=Jt(this.long0+Math.atan2(n.x*i,t*this.cos_p12*r-n.y*this.sin_p12*i))),n.x=s,n.y=a,n)):(l=Xf(this.es),c=qf(this.es),h=$f(this.es),u=Yf(this.es),Math.abs(this.sin_p12-1)<=Zt?(p=this.a*vi(l,c,h,u,Lt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=p-t,a=S0(m/this.a,l,c,h,u),s=Jt(this.long0+Math.atan2(n.x,-1*n.y)),n.x=s,n.y=a,n):Math.abs(this.sin_p12+1)<=Zt?(p=this.a*vi(l,c,h,u,Lt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=t-p,a=S0(m/this.a,l,c,h,u),s=Jt(this.long0+Math.atan2(n.x,n.y)),n.x=s,n.y=a,n):(t=Math.sqrt(n.x*n.x+n.y*n.y),y=Math.atan2(n.x,n.y),g=Qc(this.a,this.e,this.sin_p12),x=Math.cos(y),M=this.e*this.cos_p12*x,b=-M*M/(1-this.es),S=3*this.es*(1-b)*this.sin_p12*this.cos_p12*x/(1-this.es),R=t/g,T=R-b*(1+b)*Math.pow(R,3)/6-S*(1+3*b)*Math.pow(R,4)/24,C=1-b*T*T/2-R*T*T*T/6,_=Math.asin(this.sin_p12*Math.cos(T)+this.cos_p12*Math.sin(T)*x),s=Jt(this.long0+Math.asin(Math.sin(y)*Math.sin(T)/Math.cos(_))),N=Math.sin(_),a=Math.atan2((N-this.es*C*this.sin_p12)*Math.tan(_),N*(1-this.es)),n.x=s,n.y=a,n))}var K9=["Azimuthal_Equidistant","aeqd"];const J9={init:$9,forward:Y9,inverse:Z9,names:K9};function Q9(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function t7(n){var t,e,i,r,s,a,o,l,c=n.x,h=n.y;return i=Jt(c-this.long0),t=Math.sin(h),e=Math.cos(h),r=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*r,s=1,(a>0||Math.abs(a)<=Zt)&&(o=this.a*s*e*Math.sin(i),l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*r)),n.x=o,n.y=l,n}function e7(n){var t,e,i,r,s,a,o;return n.x-=this.x0,n.y-=this.y0,t=Math.sqrt(n.x*n.x+n.y*n.y),e=qa(t/this.a),i=Math.sin(e),r=Math.cos(e),a=this.long0,Math.abs(t)<=Zt?(o=this.lat0,n.x=a,n.y=o,n):(o=qa(r*this.sin_p14+n.y*i*this.cos_p14/t),s=Math.abs(this.lat0)-Lt,Math.abs(s)<=Zt?(this.lat0>=0?a=Jt(this.long0+Math.atan2(n.x,-n.y)):a=Jt(this.long0-Math.atan2(-n.x,n.y)),n.x=a,n.y=o,n):(a=Jt(this.long0+Math.atan2(n.x*i,t*this.cos_p14*r-n.y*this.sin_p14*i)),n.x=a,n.y=o,n))}var n7=["ortho"];const i7={init:Q9,forward:t7,inverse:e7,names:n7};var ln={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},We={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function r7(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Lt-Ve/2?this.face=ln.TOP:this.lat0<=-(Lt-Ve/2)?this.face=ln.BOTTOM:Math.abs(this.long0)<=Ve?this.face=ln.FRONT:Math.abs(this.long0)<=Lt+Ve?this.face=this.long0>0?ln.RIGHT:ln.LEFT:this.face=ln.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function s7(n){var t={x:0,y:0},e,i,r,s,a,o,l={value:0};if(n.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):e=n.y,i=n.x,this.face===ln.TOP)s=Lt-e,i>=Ve&&i<=Lt+Ve?(l.value=We.AREA_0,r=i-Lt):i>Lt+Ve||i<=-(Lt+Ve)?(l.value=We.AREA_1,r=i>0?i-xn:i+xn):i>-(Lt+Ve)&&i<=-Ve?(l.value=We.AREA_2,r=i+Lt):(l.value=We.AREA_3,r=i);else if(this.face===ln.BOTTOM)s=Lt+e,i>=Ve&&i<=Lt+Ve?(l.value=We.AREA_0,r=-i+Lt):i=-Ve?(l.value=We.AREA_1,r=-i):i<-Ve&&i>=-(Lt+Ve)?(l.value=We.AREA_2,r=-i-Lt):(l.value=We.AREA_3,r=i>0?-i+xn:-i-xn);else{var c,h,u,p,m,g,_;this.face===ln.RIGHT?i=Fc(i,+Lt):this.face===ln.BACK?i=Fc(i,+xn):this.face===ln.LEFT&&(i=Fc(i,-Lt)),p=Math.sin(e),m=Math.cos(e),g=Math.sin(i),_=Math.cos(i),c=m*_,h=m*g,u=p,this.face===ln.FRONT?(s=Math.acos(c),r=dm(s,u,h,l)):this.face===ln.RIGHT?(s=Math.acos(h),r=dm(s,u,-c,l)):this.face===ln.BACK?(s=Math.acos(-c),r=dm(s,u,-h,l)):this.face===ln.LEFT?(s=Math.acos(-h),r=dm(s,u,c,l)):(s=r=0,l.value=We.AREA_0)}return o=Math.atan(12/xn*(r+Math.acos(Math.sin(r)*Math.cos(Ve))-Lt)),a=Math.sqrt((1-Math.cos(s))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===We.AREA_1?o+=Lt:l.value===We.AREA_2?o+=xn:l.value===We.AREA_3&&(o+=1.5*xn),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,n.x=t.x,n.y=t.y,n}function a7(n){var t={lam:0,phi:0},e,i,r,s,a,o,l,c,h,u={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,i=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),e=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?u.value=We.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(u.value=We.AREA_1,e-=Lt):n.x<0&&-n.x>=Math.abs(n.y)?(u.value=We.AREA_2,e=e<0?e+xn:e-xn):(u.value=We.AREA_3,e+=Lt),h=xn/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),r=Math.cos(e),s=Math.tan(i),l=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===ln.TOP)c=Math.acos(l),t.phi=Lt-c,u.value===We.AREA_0?t.lam=o+Lt:u.value===We.AREA_1?t.lam=o<0?o+xn:o-xn:u.value===We.AREA_2?t.lam=o-Lt:t.lam=o;else if(this.face===ln.BOTTOM)c=Math.acos(l),t.phi=c-Lt,u.value===We.AREA_0?t.lam=-o+Lt:u.value===We.AREA_1?t.lam=-o:u.value===We.AREA_2?t.lam=-o-Lt:t.lam=o<0?-o-xn:-o+xn;else{var p,m,g;p=l,h=p*p,h>=1?g=0:g=Math.sqrt(1-h)*Math.sin(o),h+=g*g,h>=1?m=0:m=Math.sqrt(1-h),u.value===We.AREA_1?(h=m,m=-g,g=h):u.value===We.AREA_2?(m=-m,g=-g):u.value===We.AREA_3&&(h=m,m=g,g=-h),this.face===ln.RIGHT?(h=p,p=-m,m=h):this.face===ln.BACK?(p=-p,m=-m):this.face===ln.LEFT&&(h=p,p=m,m=-h),t.phi=Math.acos(-g)-Lt,t.lam=Math.atan2(m,p),this.face===ln.RIGHT?t.lam=Fc(t.lam,-Lt):this.face===ln.BACK?t.lam=Fc(t.lam,-xn):this.face===ln.LEFT&&(t.lam=Fc(t.lam,+Lt))}if(this.es!==0){var _,y,x;_=t.phi<0?1:0,y=Math.tan(t.phi),x=this.b/Math.sqrt(y*y+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-x*x)/(this.one_minus_f*x)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,n.x=t.lam,n.y=t.phi,n}function dm(n,t,e,i){var r;return nVe&&r<=Lt+Ve?(i.value=We.AREA_1,r-=Lt):r>Lt+Ve||r<=-(Lt+Ve)?(i.value=We.AREA_2,r=r>=0?r-xn:r+xn):(i.value=We.AREA_3,r+=Lt)),r}function Fc(n,t){var e=n+t;return e<-xn?e+=of:e>+xn&&(e-=of),e}var o7=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const l7={init:r7,forward:s7,inverse:a7,names:o7};var lv=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],du=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ZR=.8487,KR=1.3523,JR=xs/5,c7=1/JR,Tc=18,E0=function(n,t){return n[0]+t*(n[1]+t*(n[2]+t*n[3]))},h7=function(n,t){return n[1]+t*(2*n[2]+t*3*n[3])};function u7(n,t,e,i){for(var r=t;i;--i){var s=n(r);if(r-=s,Math.abs(s)=Tc&&(i=Tc-1),e=xs*(e-c7*i);var r={x:E0(lv[i],e)*t,y:E0(du[i],e)};return n.y<0&&(r.y=-r.y),r.x=r.x*this.a*ZR+this.x0,r.y=r.y*this.a*KR+this.y0,r}function p7(n){var t={x:(n.x-this.x0)/(this.a*ZR),y:Math.abs(n.y-this.y0)/(this.a*KR)};if(t.y>=1)t.x/=lv[Tc][0],t.y=n.y<0?-Lt:Lt;else{var e=Math.floor(t.y*Tc);for(e<0?e=0:e>=Tc&&(e=Tc-1);;)if(du[e][0]>t.y)--e;else if(du[e+1][0]<=t.y)++e;else break;var i=du[e],r=5*(t.y-i[0])/(du[e+1][0]-i[0]);r=u7(function(s){return(E0(i,s)-t.y)/h7(i,s)},r,Zt,100),t.x/=E0(lv[e],r),t.y=(5*e+r)*$n,n.y<0&&(t.y=-t.y)}return t.x=Jt(t.x+this.long0),t}var m7=["Robinson","robin"];const g7={init:f7,forward:d7,inverse:p7,names:m7};function y7(){this.name="geocent"}function x7(n){var t=zR(n,this.es,this.a);return t}function _7(n){var t=BR(n,this.es,this.a,this.b);return t}var v7=["Geocentric","geocentric","geocent","Geocent"];const M7={init:y7,forward:x7,inverse:_7,names:v7};var ci={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},iu={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function w7(){if(Object.keys(iu).forEach((function(e){if(typeof this[e]>"u")this[e]=iu[e].def;else{if(iu[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);iu[e].num&&(this[e]=parseFloat(this[e]))}iu[e].degrees&&(this[e]=this[e]*$n)}).bind(this)),Math.abs(Math.abs(this.lat0)-Lt)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(n),this.sw=Math.sin(n)}function b7(n){n.x-=this.long0;var t=Math.sin(n.y),e=Math.cos(n.y),i=Math.cos(n.x),r,s;switch(this.mode){case ci.OBLIQ:s=this.sinph0*t+this.cosph0*e*i;break;case ci.EQUIT:s=e*i;break;case ci.S_POLE:s=-t;break;case ci.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),r=s*e*Math.sin(n.x),this.mode){case ci.OBLIQ:s*=this.cosph0*t-this.sinph0*e*i;break;case ci.EQUIT:s*=t;break;case ci.N_POLE:s*=-(e*i);break;case ci.S_POLE:s*=e*i;break}var a,o;return a=s*this.cg+r*this.sg,o=1/(a*this.sw*this.h1+this.cw),r=(r*this.cg-s*this.sg)*this.cw*o,s=a*o,n.x=r*this.a,n.y=s*this.a,n}function S7(n){n.x/=this.a,n.y/=this.a;var t={x:n.x,y:n.y},e,i,r;r=1/(this.pn1-n.y*this.sw),e=this.pn1*n.x*r,i=this.pn1*n.y*this.cw*r,n.x=e*this.cg+i*this.sg,n.y=i*this.cg-e*this.sg;var s=Di(n.x,n.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,t=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function C7(n){var t=n.x,e=n.y,i,r,s,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/Di(this.radius_p*Math.cos(e),Math.sin(e));if(r=o*Math.cos(t)*Math.cos(e),s=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-r)*r-s*s-a*a*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;i=this.radius_g-r,this.flip_axis?(n.x=this.radius_g_1*Math.atan(s/Di(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(s/i),n.y=this.radius_g_1*Math.atan(a/Di(s,i)))}else this.shape==="sphere"&&(i=Math.cos(e),r=Math.cos(t)*i,s=Math.sin(t)*i,a=Math.sin(e),i=this.radius_g-r,this.flip_axis?(n.x=this.radius_g_1*Math.atan(s/Di(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(s/i),n.y=this.radius_g_1*Math.atan(a/Di(s,i))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function R7(n){var t=-1,e=0,i=0,r,s,a,o;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),e=Math.tan(n.x/this.radius_g_1)*Di(1,i)):(e=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Di(1,e));var l=i/this.radius_p;if(r=e*e+l*l+t*t,s=2*this.radius_g*t,a=s*s-4*r*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-s-Math.sqrt(a))/(2*r),t=this.radius_g+o*t,e*=o,i*=o,n.x=Math.atan2(e,t),n.y=Math.atan(i*Math.cos(n.x)/t),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),e=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+i*i)):(e=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+e*e)),r=e*e+i*i+t*t,s=2*this.radius_g*t,a=s*s-4*r*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-s-Math.sqrt(a))/(2*r),t=this.radius_g+o*t,e*=o,i*=o,n.x=Math.atan2(e,t),n.y=Math.atan(i*Math.cos(n.x)/t)}return n.x=n.x+this.long0,n}var P7=["Geostationary Satellite View","Geostationary_Satellite","geos"];const I7={init:T7,forward:C7,inverse:R7,names:P7};var Iu=1.340264,Lu=-.081106,Du=893e-6,Nu=.003796,A0=Math.sqrt(3)/2;function L7(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function D7(n){var t=Jt(n.x-this.long0),e=n.y,i=Math.asin(A0*Math.sin(e)),r=i*i,s=r*r*r;return n.x=t*Math.cos(i)/(A0*(Iu+3*Lu*r+s*(7*Du+9*Nu*r))),n.y=i*(Iu+Lu*r+s*(Du+Nu*r)),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function N7(n){n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a;var t=1e-9,e=12,i=n.y,r,s,a,o,l,c;for(c=0;c=Lt?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=H7,this.forward=B7)}function k7(n){var t=Jt(n.x-(this.long0||0)),e=n.y,i,r,s;return i=this.am1+this.m1-mh(e,r=Math.sin(e),s=Math.cos(e),this.en),r=s*t/(i*Math.sqrt(1-this.es*r*r)),n.x=i*Math.sin(r),n.y=this.am1-i*Math.cos(r),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function z7(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i,r;if(e=Di(n.x,n.y=this.am1-n.y),r=iM(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(r))hf?(n.x=r*Math.sin(i=t*Math.cos(e)/r),n.y=this.cphi1-r*Math.cos(i)):n.x=n.y=0,n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function H7(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i=Di(n.x,n.y=this.cphi1-n.y);if(e=this.cphi1+this.phi1-i,Math.abs(e)>Lt)throw new Error;return Math.abs(Math.abs(e)-Lt)<=hf?t=0:t=i*Math.atan2(n.x,n.y)/Math.cos(e),n.x=Jt(t+(this.long0||0)),n.y=no(e),n}var G7=["bonne","Bonne (Werner lat_1=90)"];const V7={init:U7,names:G7};function W7(n){n.Proj.projections.add(Nm),n.Proj.projections.add(Om),n.Proj.projections.add(kG),n.Proj.projections.add($G),n.Proj.projections.add(tV),n.Proj.projections.add(sV),n.Proj.projections.add(uV),n.Proj.projections.add(gV),n.Proj.projections.add(MV),n.Proj.projections.add(AV),n.Proj.projections.add(VV),n.Proj.projections.add(YV),n.Proj.projections.add(t9),n.Proj.projections.add(a9),n.Proj.projections.add(u9),n.Proj.projections.add(g9),n.Proj.projections.add(M9),n.Proj.projections.add(A9),n.Proj.projections.add(L9),n.Proj.projections.add(U9),n.Proj.projections.add(G9),n.Proj.projections.add(q9),n.Proj.projections.add(J9),n.Proj.projections.add(i7),n.Proj.projections.add(l7),n.Proj.projections.add(g7),n.Proj.projections.add(M7),n.Proj.projections.add(A7),n.Proj.projections.add(I7),n.Proj.projections.add(F7),n.Proj.projections.add(V7)}Mr.defaultDatum="WGS84";Mr.Proj=bs;Mr.WGS84=new Mr.Proj("WGS84");Mr.Point=Jc;Mr.toPoint=HR;Mr.defs=xi;Mr.nadgrid=BH;Mr.transform=b0;Mr.mgrs=nG;Mr.version="__VERSION__";W7(Mr);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const j7=4,rA=0,sA=1,X7=2;function gh(n){let t=n.length;for(;--t>=0;)n[t]=0}const q7=0,QR=1,$7=2,Y7=3,Z7=258,oM=29,Zf=256,uf=Zf+1+oM,Uc=30,lM=19,t3=2*uf+1,Bo=15,n_=16,K7=7,cM=256,e3=16,n3=17,i3=18,cv=new Uint8Array([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]),Fm=new Uint8Array([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]),J7=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),r3=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Q7=512,Ys=new Array((uf+2)*2);gh(Ys);const Ou=new Array(Uc*2);gh(Ou);const ff=new Array(Q7);gh(ff);const df=new Array(Z7-Y7+1);gh(df);const hM=new Array(oM);gh(hM);const T0=new Array(Uc);gh(T0);function i_(n,t,e,i,r){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let s3,a3,o3;function r_(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const l3=n=>n<256?ff[n]:ff[256+(n>>>7)],pf=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},Oi=(n,t,e)=>{n.bi_valid>n_-e?(n.bi_buf|=t<>n_-n.bi_valid,n.bi_valid+=e-n_):(n.bi_buf|=t<{Oi(n,e[t*2],e[t*2+1])},c3=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},tW=n=>{n.bi_valid===16?(pf(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},eW=(n,t)=>{const e=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,h,u,p,m,g,_=0;for(p=0;p<=Bo;p++)n.bl_count[p]=0;for(e[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;cl&&(p=l,_++),e[h*2+1]=p,!(h>i)&&(n.bl_count[p]++,m=0,h>=o&&(m=a[h-o]),g=e[h*2],n.opt_len+=g*(p+m),s&&(n.static_len+=g*(r[h*2+1]+m)));if(_!==0){do{for(p=l-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[l]--,_-=2}while(_>0);for(p=l;p!==0;p--)for(h=n.bl_count[p];h!==0;)u=n.heap[--c],!(u>i)&&(e[u*2+1]!==p&&(n.opt_len+=(p-e[u*2+1])*e[u*2],e[u*2+1]=p),h--)}},h3=(n,t,e)=>{const i=new Array(Bo+1);let r=0,s,a;for(s=1;s<=Bo;s++)r=r+e[s-1]<<1,i[s]=r;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=c3(i[o]++,o))}},nW=()=>{let n,t,e,i,r;const s=new Array(Bo+1);for(e=0,i=0;i>=7;i{let t;for(t=0;t{n.bi_valid>8?pf(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},aA=(n,t,e,i)=>{const r=t*2,s=e*2;return n[r]{const i=n.heap[e];let r=e<<1;for(;r<=n.heap_len&&(r{let i,r,s=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+s++]&255,i+=(n.pending_buf[n.sym_buf+s++]&255)<<8,r=n.pending_buf[n.sym_buf+s++],i===0?ms(n,r,t):(a=df[r],ms(n,a+Zf+1,t),o=cv[a],o!==0&&(r-=hM[a],Oi(n,r,o)),i--,a=l3(i),ms(n,a,e),o=Fm[a],o!==0&&(i-=T0[a],Oi(n,i,o)));while(s{const e=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,l=-1,c;for(n.heap_len=0,n.heap_max=t3,a=0;a>1;a>=1;a--)s_(n,e,a);c=s;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],s_(n,e,1),o=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=o,e[c*2]=e[a*2]+e[o*2],n.depth[c]=(n.depth[a]>=n.depth[o]?n.depth[a]:n.depth[o])+1,e[a*2+1]=e[o*2+1]=c,n.heap[1]=c++,s_(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],eW(n,t),h3(e,l,n.bl_count)},lA=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(e+1)*2+1]=65535,i=0;i<=e;i++)s=a,a=t[(i+1)*2+1],!(++o{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=e;i++)if(s=a,a=t[(i+1)*2+1],!(++o{let t;for(lA(n,n.dyn_ltree,n.l_desc.max_code),lA(n,n.dyn_dtree,n.d_desc.max_code),hv(n,n.bl_desc),t=lM-1;t>=3&&n.bl_tree[r3[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},rW=(n,t,e,i)=>{let r;for(Oi(n,t-257,5),Oi(n,e-1,5),Oi(n,i-4,4),r=0;r{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return rA;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return sA;for(e=32;e{hA||(nW(),hA=!0),n.l_desc=new r_(n.dyn_ltree,s3),n.d_desc=new r_(n.dyn_dtree,a3),n.bl_desc=new r_(n.bl_tree,o3),n.bi_buf=0,n.bi_valid=0,u3(n)},d3=(n,t,e,i)=>{Oi(n,(q7<<1)+(i?1:0),3),f3(n),pf(n,e),pf(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},oW=n=>{Oi(n,QR<<1,3),ms(n,cM,Ys),tW(n)},lW=(n,t,e,i)=>{let r,s,a=0;n.level>0?(n.strm.data_type===X7&&(n.strm.data_type=sW(n)),hv(n,n.l_desc),hv(n,n.d_desc),a=iW(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=e+5,e+4<=r&&t!==-1?d3(n,t,e,i):n.strategy===j7||s===r?(Oi(n,(QR<<1)+(i?1:0),3),oA(n,Ys,Ou)):(Oi(n,($7<<1)+(i?1:0),3),rW(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),oA(n,n.dyn_ltree,n.dyn_dtree)),u3(n),i&&f3(n)},cW=(n,t,e)=>(n.pending_buf[n.sym_buf+n.sym_next++]=t,n.pending_buf[n.sym_buf+n.sym_next++]=t>>8,n.pending_buf[n.sym_buf+n.sym_next++]=e,t===0?n.dyn_ltree[e*2]++:(n.matches++,t--,n.dyn_ltree[(df[e]+Zf+1)*2]++,n.dyn_dtree[l3(t)*2]++),n.sym_next===n.sym_end);var hW=aW,uW=d3,fW=lW,dW=cW,pW=oW,mW={_tr_init:hW,_tr_stored_block:uW,_tr_flush_block:fW,_tr_tally:dW,_tr_align:pW};const gW=(n,t,e,i)=>{let r=n&65535|0,s=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[i++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};var mf=gW;const yW=()=>{let n,t=[];for(var e=0;e<256;e++){n=e;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n}return t},xW=new Uint32Array(yW()),_W=(n,t,e,i)=>{const r=xW,s=i+e;n^=-1;for(let a=i;a>>8^r[(n^t[a])&255];return n^-1};var Vn=_W,th={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Kf={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:vW,_tr_stored_block:uv,_tr_flush_block:MW,_tr_tally:Ba,_tr_align:wW}=mW,{Z_NO_FLUSH:Ha,Z_PARTIAL_FLUSH:bW,Z_FULL_FLUSH:SW,Z_FINISH:mr,Z_BLOCK:uA,Z_OK:qn,Z_STREAM_END:fA,Z_STREAM_ERROR:Ss,Z_DATA_ERROR:EW,Z_BUF_ERROR:a_,Z_DEFAULT_COMPRESSION:AW,Z_FILTERED:TW,Z_HUFFMAN_ONLY:pm,Z_RLE:CW,Z_FIXED:RW,Z_DEFAULT_STRATEGY:PW,Z_UNKNOWN:IW,Z_DEFLATED:Sg}=Kf,LW=9,DW=15,NW=8,OW=29,FW=256,fv=FW+1+OW,UW=30,kW=19,zW=2*fv+1,BW=15,De=3,Oa=258,Es=Oa+De+1,HW=32,eh=42,uM=57,dv=69,pv=73,mv=91,gv=103,Ho=113,pu=666,Mi=1,yh=2,al=3,xh=4,GW=3,Go=(n,t)=>(n.msg=th[t],t),dA=n=>n*2-(n>4?9:0),Da=n=>{let t=n.length;for(;--t>=0;)n[t]=0},VW=n=>{let t,e,i,r=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=r?e-r:0;while(--t);t=r,i=t;do e=n.prev[--i],n.prev[i]=e>=r?e-r:0;while(--t)};let WW=(n,t,e)=>(t<{const t=n.state;let e=t.pending;e>n.avail_out&&(e=n.avail_out),e!==0&&(n.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),n.next_out),n.next_out+=e,t.pending_out+=e,n.total_out+=e,n.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},Qi=(n,t)=>{MW(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,Yi(n.strm)},He=(n,t)=>{n.pending_buf[n.pending++]=t},ru=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},yv=(n,t,e,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,t.set(n.input.subarray(n.next_in,n.next_in+r),e),n.state.wrap===1?n.adler=mf(n.adler,t,r,e):n.state.wrap===2&&(n.adler=Vn(n.adler,t,r,e)),n.next_in+=r,n.total_in+=r,r)},p3=(n,t)=>{let e=n.max_chain_length,i=n.strstart,r,s,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Es?n.strstart-(n.w_size-Es):0,c=n.window,h=n.w_mask,u=n.prev,p=n.strstart+Oa;let m=c[i+a-1],g=c[i+a];n.prev_length>=n.good_match&&(e>>=2),o>n.lookahead&&(o=n.lookahead);do if(r=t,!(c[r+a]!==g||c[r+a-1]!==m||c[r]!==c[i]||c[++r]!==c[i+1])){i+=2,r++;do;while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&ia){if(n.match_start=t,a=s,s>=o)break;m=c[i+a-1],g=c[i+a]}}while((t=u[t&h])>l&&--e!==0);return a<=n.lookahead?a:n.lookahead},nh=n=>{const t=n.w_size;let e,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-Es)&&(n.window.set(n.window.subarray(t,t+t-i),0),n.match_start-=t,n.strstart-=t,n.block_start-=t,n.insert>n.strstart&&(n.insert=n.strstart),VW(n),i+=t),n.strm.avail_in===0)break;if(e=yv(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=De)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=Ga(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=Ga(n,n.ins_h,n.window[r+De-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert{let e=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,s,a=0,o=n.strm.avail_in;do{if(i=65535,s=n.bi_valid+42>>3,n.strm.avail_outr+n.strm.avail_in&&(i=r+n.strm.avail_in),i>s&&(i=s),i>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,Yi(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(yv(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(a===0);return o-=n.strm.avail_in,o&&(o>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=o&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-o,n.strm.next_in),n.strstart),n.strstart+=o,n.insert+=o>n.w_size-n.insert?n.w_size-n.insert:o),n.block_start=n.strstart),n.high_waters&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,s+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),s>n.strm.avail_in&&(s=n.strm.avail_in),s&&(yv(n.strm,n.window,n.strstart,s),n.strstart+=s,n.insert+=s>n.w_size-n.insert?n.w_size-n.insert:s),n.high_water>3,s=n.pending_buf_size-s>65535?65535:n.pending_buf_size-s,e=s>n.w_size?n.w_size:s,r=n.strstart-n.block_start,(r>=e||(r||t===mr)&&t!==Ha&&n.strm.avail_in===0&&r<=s)&&(i=r>s?s:r,a=t===mr&&n.strm.avail_in===0&&i===r?1:0,uv(n,n.block_start,i,a),n.block_start+=i,Yi(n.strm)),a?al:Mi)},o_=(n,t)=>{let e,i;for(;;){if(n.lookahead=De&&(n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),e!==0&&n.strstart-e<=n.w_size-Es&&(n.match_length=p3(n,e)),n.match_length>=De)if(i=Ba(n,n.strstart-n.match_start,n.match_length-De),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=De){n.match_length--;do n.strstart++,n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+1]);else i=Ba(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(Qi(n,!1),n.strm.avail_out===0))return Mi}return n.insert=n.strstart{let e,i,r;for(;;){if(n.lookahead=De&&(n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=De-1,e!==0&&n.prev_length4096)&&(n.match_length=De-1)),n.prev_length>=De&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-De,i=Ba(n,n.strstart-1-n.prev_match,n.prev_length-De),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=De-1,n.strstart++,i&&(Qi(n,!1),n.strm.avail_out===0))return Mi}else if(n.match_available){if(i=Ba(n,0,n.window[n.strstart-1]),i&&Qi(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return Mi}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=Ba(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart{let e,i,r,s;const a=n.window;for(;;){if(n.lookahead<=Oa){if(nh(n),n.lookahead<=Oa&&t===Ha)return Mi;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=De&&n.strstart>0&&(r=n.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){s=n.strstart+Oa;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&rn.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=De?(e=Ba(n,1,n.match_length-De),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=Ba(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(Qi(n,!1),n.strm.avail_out===0))return Mi}return n.insert=0,t===mr?(Qi(n,!0),n.strm.avail_out===0?al:xh):n.sym_next&&(Qi(n,!1),n.strm.avail_out===0)?Mi:yh},XW=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(nh(n),n.lookahead===0)){if(t===Ha)return Mi;break}if(n.match_length=0,e=Ba(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(Qi(n,!1),n.strm.avail_out===0))return Mi}return n.insert=0,t===mr?(Qi(n,!0),n.strm.avail_out===0?al:xh):n.sym_next&&(Qi(n,!1),n.strm.avail_out===0)?Mi:yh};function hs(n,t,e,i,r){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=r}const mu=[new hs(0,0,0,0,m3),new hs(4,4,8,4,o_),new hs(4,5,16,8,o_),new hs(4,6,32,32,o_),new hs(4,4,16,16,dc),new hs(8,16,32,32,dc),new hs(8,16,128,128,dc),new hs(8,32,128,256,dc),new hs(32,128,258,1024,dc),new hs(32,258,258,4096,dc)],qW=n=>{n.window_size=2*n.w_size,Da(n.head),n.max_lazy_match=mu[n.level].max_lazy,n.good_match=mu[n.level].good_length,n.nice_match=mu[n.level].nice_length,n.max_chain_length=mu[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=De-1,n.match_available=0,n.ins_h=0};function $W(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Sg,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(zW*2),this.dyn_dtree=new Uint16Array((2*UW+1)*2),this.bl_tree=new Uint16Array((2*kW+1)*2),Da(this.dyn_ltree),Da(this.dyn_dtree),Da(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(BW+1),this.heap=new Uint16Array(2*fv+1),Da(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*fv+1),Da(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Jf=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==eh&&t.status!==uM&&t.status!==dv&&t.status!==pv&&t.status!==mv&&t.status!==gv&&t.status!==Ho&&t.status!==pu?1:0},g3=n=>{if(Jf(n))return Go(n,Ss);n.total_in=n.total_out=0,n.data_type=IW;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?uM:t.wrap?eh:Ho,n.adler=t.wrap===2?0:1,t.last_flush=-2,vW(t),qn},y3=n=>{const t=g3(n);return t===qn&&qW(n.state),t},YW=(n,t)=>Jf(n)||n.state.wrap!==2?Ss:(n.state.gzhead=t,qn),x3=(n,t,e,i,r,s)=>{if(!n)return Ss;let a=1;if(t===AW&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>LW||e!==Sg||i<8||i>15||t<0||t>9||s<0||s>RW||i===8&&a!==1)return Go(n,Ss);i===8&&(i=9);const o=new $W;return n.state=o,o.strm=n,o.status=eh,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<x3(n,t,Sg,DW,NW,PW),KW=(n,t)=>{if(Jf(n)||t>uA||t<0)return n?Go(n,Ss):Ss;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===pu&&t!==mr)return Go(n,n.avail_out===0?a_:Ss);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(Yi(n),n.avail_out===0)return e.last_flush=-1,qn}else if(n.avail_in===0&&dA(t)<=dA(i)&&t!==mr)return Go(n,a_);if(e.status===pu&&n.avail_in!==0)return Go(n,a_);if(e.status===eh&&e.wrap===0&&(e.status=Ho),e.status===eh){let r=Sg+(e.w_bits-8<<4)<<8,s=-1;if(e.strategy>=pm||e.level<2?s=0:e.level<6?s=1:e.level===6?s=2:s=3,r|=s<<6,e.strstart!==0&&(r|=HW),r+=31-r%31,ru(e,r),e.strstart!==0&&(ru(e,n.adler>>>16),ru(e,n.adler&65535)),n.adler=1,e.status=Ho,Yi(n),e.pending!==0)return e.last_flush=-1,qn}if(e.status===uM){if(n.adler=0,He(e,31),He(e,139),He(e,8),e.gzhead)He(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),He(e,e.gzhead.time&255),He(e,e.gzhead.time>>8&255),He(e,e.gzhead.time>>16&255),He(e,e.gzhead.time>>24&255),He(e,e.level===9?2:e.strategy>=pm||e.level<2?4:0),He(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(He(e,e.gzhead.extra.length&255),He(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=Vn(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=dv;else if(He(e,0),He(e,0),He(e,0),He(e,0),He(e,0),He(e,e.level===9?2:e.strategy>=pm||e.level<2?4:0),He(e,GW),e.status=Ho,Yi(n),e.pending!==0)return e.last_flush=-1,qn}if(e.status===dv){if(e.gzhead.extra){let r=e.pending,s=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+s>e.pending_buf_size;){let o=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=o,Yi(n),e.pending!==0)return e.last_flush=-1,qn;r=0,s-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending+=s,e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=pv}if(e.status===pv){if(e.gzhead.name){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),Yi(n),e.pending!==0)return e.last_flush=-1,qn;r=0}e.gzindexr&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=mv}if(e.status===mv){if(e.gzhead.comment){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),Yi(n),e.pending!==0)return e.last_flush=-1,qn;r=0}e.gzindexr&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r))}e.status=gv}if(e.status===gv){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(Yi(n),e.pending!==0))return e.last_flush=-1,qn;He(e,n.adler&255),He(e,n.adler>>8&255),n.adler=0}if(e.status=Ho,Yi(n),e.pending!==0)return e.last_flush=-1,qn}if(n.avail_in!==0||e.lookahead!==0||t!==Ha&&e.status!==pu){let r=e.level===0?m3(e,t):e.strategy===pm?XW(e,t):e.strategy===CW?jW(e,t):mu[e.level].func(e,t);if((r===al||r===xh)&&(e.status=pu),r===Mi||r===al)return n.avail_out===0&&(e.last_flush=-1),qn;if(r===yh&&(t===bW?wW(e):t!==uA&&(uv(e,0,0,!1),t===SW&&(Da(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),Yi(n),n.avail_out===0))return e.last_flush=-1,qn}return t!==mr?qn:e.wrap<=0?fA:(e.wrap===2?(He(e,n.adler&255),He(e,n.adler>>8&255),He(e,n.adler>>16&255),He(e,n.adler>>24&255),He(e,n.total_in&255),He(e,n.total_in>>8&255),He(e,n.total_in>>16&255),He(e,n.total_in>>24&255)):(ru(e,n.adler>>>16),ru(e,n.adler&65535)),Yi(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?qn:fA)},JW=n=>{if(Jf(n))return Ss;const t=n.state.status;return n.state=null,t===Ho?Go(n,EW):qn},QW=(n,t)=>{let e=t.length;if(Jf(n))return Ss;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==eh||i.lookahead)return Ss;if(r===1&&(n.adler=mf(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){r===0&&(Da(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(t.subarray(e-i.w_size,e),0),t=l,e=i.w_size}const s=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,nh(i);i.lookahead>=De;){let l=i.strstart,c=i.lookahead-(De-1);do i.ins_h=Ga(i,i.ins_h,i.window[l+De-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--c);i.strstart=l,i.lookahead=De-1,nh(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=De-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=s,i.wrap=r,qn};var tj=ZW,ej=x3,nj=y3,ij=g3,rj=YW,sj=KW,aj=JW,oj=QW,lj="pako deflate (from Nodeca project)",Fu={deflateInit:tj,deflateInit2:ej,deflateReset:nj,deflateResetKeep:ij,deflateSetHeader:rj,deflate:sj,deflateEnd:aj,deflateSetDictionary:oj,deflateInfo:lj};const cj=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var hj=function(n){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const i in e)cj(e,i)&&(n[i]=e[i])}}return n},uj=n=>{let t=0;for(let i=0,r=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;gf[254]=gf[254]=1;var fj=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,r,s,a=n.length,o=0;for(r=0;r>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};const dj=(n,t)=>{if(t<65534&&n.subarray&&_3)return String.fromCharCode.apply(null,n.length===t?n:n.subarray(0,t));let e="";for(let i=0;i{const e=t||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,t));let i,r;const s=new Array(e*2);for(r=0,i=0;i4){s[r++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return dj(s,r)},mj=(n,t)=>{t=t||n.length,t>n.length&&(t=n.length);let e=t-1;for(;e>=0&&(n[e]&192)===128;)e--;return e<0||e===0?t:e+gf[n[e]]>t?e:t},yf={string2buf:fj,buf2string:pj,utf8border:mj};function gj(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var v3=gj;const M3=Object.prototype.toString,{Z_NO_FLUSH:yj,Z_SYNC_FLUSH:xj,Z_FULL_FLUSH:_j,Z_FINISH:vj,Z_OK:C0,Z_STREAM_END:Mj,Z_DEFAULT_COMPRESSION:wj,Z_DEFAULT_STRATEGY:bj,Z_DEFLATED:Sj}=Kf;function fM(n){this.options=Eg.assign({level:wj,method:Sj,chunkSize:16384,windowBits:15,memLevel:8,strategy:bj},n||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v3,this.strm.avail_out=0;let e=Fu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==C0)throw new Error(th[e]);if(t.header&&Fu.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=yf.string2buf(t.dictionary):M3.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=Fu.deflateSetDictionary(this.strm,i),e!==C0)throw new Error(th[e]);this._dict_set=!0}}fM.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?vj:yj,typeof n=="string"?e.input=yf.string2buf(n):M3.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(s===xj||s===_j)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=Fu.deflate(e,s),r===Mj)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=Fu.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===C0;if(e.avail_out===0){this.onData(e.output);continue}if(s>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};fM.prototype.onData=function(n){this.chunks.push(n)};fM.prototype.onEnd=function(n){n===C0&&(this.result=Eg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const mm=16209,Ej=16191;var Aj=function(t,e){let i,r,s,a,o,l,c,h,u,p,m,g,_,y,x,M,b,S,R,T,C,N,P,E;const L=t.state;i=t.next_in,P=t.input,r=i+(t.avail_in-5),s=t.next_out,E=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),l=L.dmax,c=L.wsize,h=L.whave,u=L.wnext,p=L.window,m=L.hold,g=L.bits,_=L.lencode,y=L.distcode,x=(1<>>24,m>>>=S,g-=S,S=b>>>16&255,S===0)E[s++]=b&65535;else if(S&16){R=b&65535,S&=15,S&&(g>>=S,g-=S),g<15&&(m+=P[i++]<>>24,m>>>=S,g-=S,S=b>>>16&255,S&16){if(T=b&65535,S&=15,gl){t.msg="invalid distance too far back",L.mode=mm;break t}if(m>>>=S,g-=S,S=s-a,T>S){if(S=T-S,S>h&&L.sane){t.msg="invalid distance too far back",L.mode=mm;break t}if(C=0,N=p,u===0){if(C+=c-S,S2;)E[s++]=N[C++],E[s++]=N[C++],E[s++]=N[C++],R-=3;R&&(E[s++]=N[C++],R>1&&(E[s++]=N[C++]))}else{C=s-T;do E[s++]=E[C++],E[s++]=E[C++],E[s++]=E[C++],R-=3;while(R>2);R&&(E[s++]=E[C++],R>1&&(E[s++]=E[C++]))}}else if(S&64){t.msg="invalid distance code",L.mode=mm;break t}else{b=y[(b&65535)+(m&(1<>3,i-=R,g-=R<<3,m&=(1<{const l=o.bits;let c=0,h=0,u=0,p=0,m=0,g=0,_=0,y=0,x=0,M=0,b,S,R,T,C,N=null,P;const E=new Uint16Array(pc+1),L=new Uint16Array(pc+1);let B=null,V,j,Y;for(c=0;c<=pc;c++)E[c]=0;for(h=0;h=1&&E[p]===0;p--);if(m>p&&(m=p),p===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(u=1;u0&&(n===gA||p!==1))return-1;for(L[1]=0,c=1;cpA||n===yA&&x>mA)return 1;for(;;){V=c-_,a[h]+1=P?(j=B[a[h]-P],Y=N[a[h]-P]):(j=96,Y=0),b=1<>_)+S]=V<<24|j<<16|Y|0;while(S!==0);for(b=1<>=1;if(b!==0?(M&=b-1,M+=b):M=0,h++,--E[c]===0){if(c===p)break;c=t[e+a[h]]}if(c>m&&(M&T)!==R){for(_===0&&(_=m),C+=u,g=c-_,y=1<pA||n===yA&&x>mA)return 1;R=M&T,r[R]=m<<24|g<<16|C-s|0}}return M!==0&&(r[C+M]=c-_<<24|64<<16|0),o.bits=m,0};var Uu=Ij;const Lj=0,w3=1,b3=2,{Z_FINISH:xA,Z_BLOCK:Dj,Z_TREES:gm,Z_OK:ol,Z_STREAM_END:Nj,Z_NEED_DICT:Oj,Z_STREAM_ERROR:wr,Z_DATA_ERROR:S3,Z_MEM_ERROR:E3,Z_BUF_ERROR:Fj,Z_DEFLATED:_A}=Kf,Ag=16180,vA=16181,MA=16182,wA=16183,bA=16184,SA=16185,EA=16186,AA=16187,TA=16188,CA=16189,R0=16190,Xs=16191,c_=16192,RA=16193,h_=16194,PA=16195,IA=16196,LA=16197,DA=16198,ym=16199,xm=16200,NA=16201,OA=16202,FA=16203,UA=16204,kA=16205,u_=16206,zA=16207,BA=16208,an=16209,A3=16210,T3=16211,Uj=852,kj=592,zj=15,Bj=zj,HA=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function Hj(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ul=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.modeT3?1:0},C3=n=>{if(ul(n))return wr;const t=n.state;return n.total_in=n.total_out=t.total=0,n.msg="",t.wrap&&(n.adler=t.wrap&1),t.mode=Ag,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Uj),t.distcode=t.distdyn=new Int32Array(kj),t.sane=1,t.back=-1,ol},R3=n=>{if(ul(n))return wr;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,C3(n)},P3=(n,t)=>{let e;if(ul(n))return wr;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?wr:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,R3(n))},I3=(n,t)=>{if(!n)return wr;const e=new Hj;n.state=e,e.strm=n,e.window=null,e.mode=Ag;const i=P3(n,t);return i!==ol&&(n.state=null),i},Gj=n=>I3(n,Bj);let GA=!0,f_,d_;const Vj=n=>{if(GA){f_=new Int32Array(512),d_=new Int32Array(32);let t=0;for(;t<144;)n.lens[t++]=8;for(;t<256;)n.lens[t++]=9;for(;t<280;)n.lens[t++]=7;for(;t<288;)n.lens[t++]=8;for(Uu(w3,n.lens,0,288,f_,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Uu(b3,n.lens,0,32,d_,0,n.work,{bits:5}),GA=!1}n.lencode=f_,n.lenbits=9,n.distcode=d_,n.distbits=5},L3=(n,t,e,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(e-s.wsize,e),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(t.subarray(e-i,e-i+r),s.wnext),i-=r,i?(s.window.set(t.subarray(e-i,e),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave{let e,i,r,s,a,o,l,c,h,u,p,m,g,_,y=0,x,M,b,S,R,T,C,N;const P=new Uint8Array(4);let E,L;const B=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ul(n)||!n.output||!n.input&&n.avail_in!==0)return wr;e=n.state,e.mode===Xs&&(e.mode=c_),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,u=o,p=l,N=ol;t:for(;;)switch(e.mode){case Ag:if(e.wrap===0){e.mode=c_;break}for(;h<16;){if(o===0)break t;o--,c+=i[s++]<>>8&255,e.check=Vn(e.check,P,2,0),c=0,h=0,e.mode=vA;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",e.mode=an;break}if((c&15)!==_A){n.msg="unknown compression method",e.mode=an;break}if(c>>>=4,h-=4,C=(c&15)+8,e.wbits===0&&(e.wbits=C),C>15||C>e.wbits){n.msg="invalid window size",e.mode=an;break}e.dmax=1<>8&1),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Vn(e.check,P,2,0)),c=0,h=0,e.mode=MA;case MA:for(;h<32;){if(o===0)break t;o--,c+=i[s++]<>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,e.check=Vn(e.check,P,4,0)),c=0,h=0,e.mode=wA;case wA:for(;h<16;){if(o===0)break t;o--,c+=i[s++]<>8),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Vn(e.check,P,2,0)),c=0,h=0,e.mode=bA;case bA:if(e.flags&1024){for(;h<16;){if(o===0)break t;o--,c+=i[s++]<>>8&255,e.check=Vn(e.check,P,2,0)),c=0,h=0}else e.head&&(e.head.extra=null);e.mode=SA;case SA:if(e.flags&1024&&(m=e.length,m>o&&(m=o),m&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(s,s+m),C)),e.flags&512&&e.wrap&4&&(e.check=Vn(e.check,i,m,s)),o-=m,s+=m,e.length-=m),e.length))break t;e.length=0,e.mode=EA;case EA:if(e.flags&2048){if(o===0)break t;m=0;do C=i[s+m++],e.head&&C&&e.length<65536&&(e.head.name+=String.fromCharCode(C));while(C&&m>9&1,e.head.done=!0),n.adler=e.check=0,e.mode=Xs;break;case CA:for(;h<32;){if(o===0)break t;o--,c+=i[s++]<>>=h&7,h-=h&7,e.mode=u_;break}for(;h<3;){if(o===0)break t;o--,c+=i[s++]<>>=1,h-=1,c&3){case 0:e.mode=RA;break;case 1:if(Vj(e),e.mode=ym,t===gm){c>>>=2,h-=2;break t}break;case 2:e.mode=IA;break;case 3:n.msg="invalid block type",e.mode=an}c>>>=2,h-=2;break;case RA:for(c>>>=h&7,h-=h&7;h<32;){if(o===0)break t;o--,c+=i[s++]<>>16^65535)){n.msg="invalid stored block lengths",e.mode=an;break}if(e.length=c&65535,c=0,h=0,e.mode=h_,t===gm)break t;case h_:e.mode=PA;case PA:if(m=e.length,m){if(m>o&&(m=o),m>l&&(m=l),m===0)break t;r.set(i.subarray(s,s+m),a),o-=m,s+=m,l-=m,a+=m,e.length-=m;break}e.mode=Xs;break;case IA:for(;h<14;){if(o===0)break t;o--,c+=i[s++]<>>=5,h-=5,e.ndist=(c&31)+1,c>>>=5,h-=5,e.ncode=(c&15)+4,c>>>=4,h-=4,e.nlen>286||e.ndist>30){n.msg="too many length or distance symbols",e.mode=an;break}e.have=0,e.mode=LA;case LA:for(;e.have>>=3,h-=3}for(;e.have<19;)e.lens[B[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,E={bits:e.lenbits},N=Uu(Lj,e.lens,0,19,e.lencode,0,e.work,E),e.lenbits=E.bits,N){n.msg="invalid code lengths set",e.mode=an;break}e.have=0,e.mode=DA;case DA:for(;e.have>>24,M=y>>>16&255,b=y&65535,!(x<=h);){if(o===0)break t;o--,c+=i[s++]<>>=x,h-=x,e.lens[e.have++]=b;else{if(b===16){for(L=x+2;h>>=x,h-=x,e.have===0){n.msg="invalid bit length repeat",e.mode=an;break}C=e.lens[e.have-1],m=3+(c&3),c>>>=2,h-=2}else if(b===17){for(L=x+3;h>>=x,h-=x,C=0,m=3+(c&7),c>>>=3,h-=3}else{for(L=x+7;h>>=x,h-=x,C=0,m=11+(c&127),c>>>=7,h-=7}if(e.have+m>e.nlen+e.ndist){n.msg="invalid bit length repeat",e.mode=an;break}for(;m--;)e.lens[e.have++]=C}}if(e.mode===an)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=an;break}if(e.lenbits=9,E={bits:e.lenbits},N=Uu(w3,e.lens,0,e.nlen,e.lencode,0,e.work,E),e.lenbits=E.bits,N){n.msg="invalid literal/lengths set",e.mode=an;break}if(e.distbits=6,e.distcode=e.distdyn,E={bits:e.distbits},N=Uu(b3,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,E),e.distbits=E.bits,N){n.msg="invalid distances set",e.mode=an;break}if(e.mode=ym,t===gm)break t;case ym:e.mode=xm;case xm:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=h,Aj(n,p),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,e.mode===Xs&&(e.back=-1);break}for(e.back=0;y=e.lencode[c&(1<>>24,M=y>>>16&255,b=y&65535,!(x<=h);){if(o===0)break t;o--,c+=i[s++]<>S)],x=y>>>24,M=y>>>16&255,b=y&65535,!(S+x<=h);){if(o===0)break t;o--,c+=i[s++]<>>=S,h-=S,e.back+=S}if(c>>>=x,h-=x,e.back+=x,e.length=b,M===0){e.mode=kA;break}if(M&32){e.back=-1,e.mode=Xs;break}if(M&64){n.msg="invalid literal/length code",e.mode=an;break}e.extra=M&15,e.mode=NA;case NA:if(e.extra){for(L=e.extra;h>>=e.extra,h-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=OA;case OA:for(;y=e.distcode[c&(1<>>24,M=y>>>16&255,b=y&65535,!(x<=h);){if(o===0)break t;o--,c+=i[s++]<>S)],x=y>>>24,M=y>>>16&255,b=y&65535,!(S+x<=h);){if(o===0)break t;o--,c+=i[s++]<>>=S,h-=S,e.back+=S}if(c>>>=x,h-=x,e.back+=x,M&64){n.msg="invalid distance code",e.mode=an;break}e.offset=b,e.extra=M&15,e.mode=FA;case FA:if(e.extra){for(L=e.extra;h>>=e.extra,h-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){n.msg="invalid distance too far back",e.mode=an;break}e.mode=UA;case UA:if(l===0)break t;if(m=p-l,e.offset>m){if(m=e.offset-m,m>e.whave&&e.sane){n.msg="invalid distance too far back",e.mode=an;break}m>e.wnext?(m-=e.wnext,g=e.wsize-m):g=e.wnext-m,m>e.length&&(m=e.length),_=e.window}else _=r,g=a-e.offset,m=e.length;m>l&&(m=l),l-=m,e.length-=m;do r[a++]=_[g++];while(--m);e.length===0&&(e.mode=xm);break;case kA:if(l===0)break t;r[a++]=e.length,l--,e.mode=xm;break;case u_:if(e.wrap){for(;h<32;){if(o===0)break t;o--,c|=i[s++]<{if(ul(n))return wr;let t=n.state;return t.window&&(t.window=null),n.state=null,ol},Xj=(n,t)=>{if(ul(n))return wr;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,ol):wr},qj=(n,t)=>{const e=t.length;let i,r,s;return ul(n)||(i=n.state,i.wrap!==0&&i.mode!==R0)?wr:i.mode===R0&&(r=1,r=mf(r,t,e,0),r!==i.check)?S3:(s=L3(n,t,e,e),s?(i.mode=A3,E3):(i.havedict=1,ol))};var $j=R3,Yj=P3,Zj=C3,Kj=Gj,Jj=I3,Qj=Wj,tX=jj,eX=Xj,nX=qj,iX="pako inflate (from Nodeca project)",Zs={inflateReset:$j,inflateReset2:Yj,inflateResetKeep:Zj,inflateInit:Kj,inflateInit2:Jj,inflate:Qj,inflateEnd:tX,inflateGetHeader:eX,inflateSetDictionary:nX,inflateInfo:iX};function rX(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var sX=rX;const D3=Object.prototype.toString,{Z_NO_FLUSH:aX,Z_FINISH:oX,Z_OK:xf,Z_STREAM_END:p_,Z_NEED_DICT:m_,Z_STREAM_ERROR:lX,Z_DATA_ERROR:VA,Z_MEM_ERROR:cX}=Kf;function Qf(n){this.options=Eg.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(n&&n.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v3,this.strm.avail_out=0;let e=Zs.inflateInit2(this.strm,t.windowBits);if(e!==xf)throw new Error(th[e]);if(this.header=new sX,Zs.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=yf.string2buf(t.dictionary):D3.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=Zs.inflateSetDictionary(this.strm,t.dictionary),e!==xf)))throw new Error(th[e])}Qf.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?oX:aX,D3.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),s=Zs.inflate(e,a),s===m_&&r&&(s=Zs.inflateSetDictionary(e,r),s===xf?s=Zs.inflate(e,a):s===VA&&(s=m_));e.avail_in>0&&s===p_&&e.state.wrap>0&&n[e.next_in]!==0;)Zs.inflateReset(e),s=Zs.inflate(e,a);switch(s){case lX:case VA:case m_:case cX:return this.onEnd(s),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||s===p_))if(this.options.to==="string"){let l=yf.utf8border(e.output,e.next_out),c=e.next_out-l,h=yf.buf2string(e.output,l);e.next_out=c,e.avail_out=i-c,c&&e.output.set(e.output.subarray(l,l+c),0),this.onData(h)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(s===xf&&o===0)){if(s===p_)return s=Zs.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};Qf.prototype.onData=function(n){this.chunks.push(n)};Qf.prototype.onEnd=function(n){n===xf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Eg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function dM(n,t){const e=new Qf(t);if(e.push(n),e.err)throw e.msg||th[e.err];return e.result}function hX(n,t){return t=t||{},t.raw=!0,dM(n,t)}var uX=Qf,fX=dM,dX=hX,pX=dM,mX=Kf,gX={Inflate:uX,inflate:fX,inflateRaw:dX,ungzip:pX,constants:mX};const{Inflate:bY,inflate:yX,inflateRaw:SY,ungzip:EY}=gX;var AY=yX;const g_=new WeakMap;class xX extends di{constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,i,r){const s=new nr(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,a=>{this.parse(a,e,r)},i,r)}parse(t,e,i=()=>{}){this.decodeDracoFile(t,e,null,null,Tn,i).catch(i)}decodeDracoFile(t,e,i,r,s=Dn,a=()=>{}){const o={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:s};return this.decodeGeometry(t,o).then(e).catch(a)}decodeGeometry(t,e){const i=JSON.stringify(e);if(g_.has(t)){const l=g_.get(t);if(l.key===i)return l.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,a=t.byteLength,o=this._getWorker(s,a).then(l=>(r=l,new Promise((c,h)=>{r._callbacks[s]={resolve:c,reject:h},r.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),g_.set(t,{key:i,promise:o}),o}_createGeometry(t){const e=new ve;t.index&&e.setIndex(new Pe(t.index.array,1));for(let i=0;i{i.load(t,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then(i=>{const r=i[0];t||(this.decoderConfig.wasmBinary=i[1]);const s=_X.toString(),a=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[t]=e,i._taskLoad+=e,i})}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t{const u=h.draco,p=new u.Decoder;try{const m=e(u,p,new Int8Array(l),c),g=m.attributes.map(_=>_.array.buffer);m.index&&g.push(m.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:m},g)}catch(m){console.error(m),self.postMessage({type:"error",id:o.id,error:m.message})}finally{u.destroy(p)}});break}};function e(a,o,l,c){const h=c.attributeIDs,u=c.attributeTypes;let p,m;const g=o.GetEncodedGeometryType(l);if(g===a.TRIANGULAR_MESH)p=new a.Mesh,m=o.DecodeArrayToMesh(l,l.byteLength,p);else if(g===a.POINT_CLOUD)p=new a.PointCloud,m=o.DecodeArrayToPointCloud(l,l.byteLength,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const _={index:null,attributes:[]};for(const y in h){const x=self[u[y]];let M,b;if(c.useUniqueIDs)b=h[y],M=o.GetAttributeByUniqueId(p,b);else{if(b=o.GetAttributeId(p,a[h[y]]),b===-1)continue;M=o.GetAttribute(p,b)}const S=r(a,o,p,y,x,M);y==="color"&&(S.vertexColorSpace=c.vertexColorSpace),_.attributes.push(S)}return g===a.TRIANGULAR_MESH&&(_.index=i(a,o,p)),a.destroy(p),_}function i(a,o,l){const h=l.num_faces()*3,u=h*4,p=a._malloc(u);o.GetTrianglesUInt32Array(l,u,p);const m=new Uint32Array(a.HEAPF32.buffer,p,h).slice();return a._free(p),{array:m,itemSize:1}}function r(a,o,l,c,h,u){const p=u.num_components(),g=l.num_points()*p,_=g*h.BYTES_PER_ELEMENT,y=s(a,h),x=a._malloc(_);o.GetAttributeDataArrayForAllPoints(l,u,y,_,x);const M=new h(a.HEAPF32.buffer,x,g).slice();return a._free(x),{name:c,array:M,itemSize:p}}function s(a,o){switch(o){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class vX extends di{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new EX(e)}),this.register(function(e){return new AX(e)}),this.register(function(e){return new OX(e)}),this.register(function(e){return new FX(e)}),this.register(function(e){return new UX(e)}),this.register(function(e){return new CX(e)}),this.register(function(e){return new RX(e)}),this.register(function(e){return new PX(e)}),this.register(function(e){return new IX(e)}),this.register(function(e){return new SX(e)}),this.register(function(e){return new LX(e)}),this.register(function(e){return new TX(e)}),this.register(function(e){return new NX(e)}),this.register(function(e){return new DX(e)}),this.register(function(e){return new wX(e)}),this.register(function(e){return new kX(e)}),this.register(function(e){return new zX(e)})}load(t,e,i,r){const s=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Ua.extractUrlBase(t);a=Ua.resolveURL(c,this.path)}else a=Ua.extractUrlBase(t);this.manager.itemStart(t);const o=function(c){r?r(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},l=new nr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(t,function(c){try{s.parse(c,a,function(h){e(h),s.manager.itemEnd(t)},o)}catch(h){o(h)}},i,o)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,r){let s;const a={},o={},l=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(l.decode(new Uint8Array(t,0,4))===N3){try{a[Le.KHR_BINARY_GLTF]=new BX(t)}catch(u){r&&r(u);return}s=JSON.parse(a[Le.KHR_BINARY_GLTF].content)}else s=JSON.parse(l.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new QX(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(a),c.setPlugins(o),c.parse(i,r)}parseAsync(t,e){const i=this;return new Promise(function(r,s){i.parse(t,e,r,s)})}}function MX(){let n={};return{get:function(t){return n[t]},add:function(t,e){n[t]=e},remove:function(t){delete n[t]},removeAll:function(){n={}}}}const Le={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class wX{constructor(t){this.parser=t,this.name=Le.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,r=e.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,a)}}class FX{constructor(t){this.parser=t,this.name=Le.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,r=i.json,s=r.textures[t];if(!s.extensions||!s.extensions[e])return null;const a=s.extensions[e],o=r.images[a.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,a.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class UX{constructor(t){this.parser=t,this.name=Le.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,r=i.json,s=r.textures[t];if(!s.extensions||!s.extensions[e])return null;const a=s.extensions[e],o=r.images[a.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,a.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class kX{constructor(t){this.name=Le.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(o){const l=r.byteOffset||0,c=r.byteLength||0,h=r.count,u=r.byteStride,p=new Uint8Array(o,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,p,r.mode,r.filter).then(function(m){return m.buffer}):a.ready.then(function(){const m=new ArrayBuffer(h*u);return a.decodeGltfBuffer(new Uint8Array(m),h,u,p,r.mode,r.filter),m})})}else return null}}class zX{constructor(t){this.name=Le.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=e.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==pr.TRIANGLES&&c.mode!==pr.TRIANGLE_STRIP&&c.mode!==pr.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=i.extensions[this.name].attributes,o=[],l={};for(const c in a)o.push(this.parser.getDependency("accessor",a[c]).then(h=>(l[c]=h,l[c])));return o.length<1?null:(o.push(this.parser.createNodeMesh(t)),Promise.all(o).then(c=>{const h=c.pop(),u=h.isGroup?h.children:[h],p=c[0].count,m=[];for(const g of u){const _=new de,y=new U,x=new Cn,M=new U(1,1,1),b=new u1(g.geometry,g.material,p);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const JX=new de;class QX{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new MX,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=-1,s=!1,a=-1;if(typeof navigator<"u"){const o=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(o)===!0;const l=o.match(/Version\/(\d+)/);r=i&&l?parseInt(l[1],10):-1,s=o.indexOf("Firefox")>-1,a=s?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&r<17||s&&a<98?this.textureLoader=new S1(this.options.manager):this.textureLoader=new YC(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new nr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(a){const o={scene:a[0][r.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:r.asset,parser:i,userData:{}};return Co(s,o,r),qs(o,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();t(o)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=e.length;r{const l=this.associations.get(a);l!=null&&this.associations.set(o,l);for(const[c,h]of a.children.entries())s(h,o.children[c])};return s(i,r),r.name+="_instance_"+t.uses[e]++,r}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i=2&&y.setY(P,T[C*l+1]),l>=3&&y.setZ(P,T[C*l+2]),l>=4&&y.setW(P,T[C*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,a=e.images[s];let o=this.textureLoader;if(a.uri){const l=i.manager.getHandler(a.uri);l!==null&&(o=l)}return this.loadTextureImage(t,s,o)}loadTextureImage(t,e,i){const r=this,s=this.json,a=s.textures[t],o=s.images[e],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(e,i).then(function(h){h.flipY=!1,h.name=a.name||o.name||"",h.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(h.name=o.uri);const p=(s.samplers||{})[a.sampler]||{};return h.magFilter=jA[p.magFilter]||mn,h.minFilter=jA[p.minFilter]||gr,h.wrapS=XA[p.wrapS]||Wa,h.wrapT=XA[p.wrapT]||Wa,r.associations.set(h,{textures:t}),h}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(t,e){const i=this,r=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());const a=r.images[t],o=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=i.getDependency("bufferView",a.bufferView).then(function(u){c=!0;const p=new Blob([u],{type:a.mimeType});return l=o.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const h=Promise.resolve(l).then(function(u){return new Promise(function(p,m){let g=p;e.isImageBitmapLoader===!0&&(g=function(_){const y=new Mn(_);y.needsUpdate=!0,p(y)}),e.load(Ua.resolveURL(u,s.path),g,void 0,m)})}).then(function(u){return c===!0&&o.revokeObjectURL(l),qs(u,a),u.userData.mimeType=a.mimeType||KX(a.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),u});return this.sourceCache[t]=h,h}assignTexture(t,e,i,r){const s=this;return this.getDependency("texture",i.index).then(function(a){if(!a)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(a=a.clone(),a.channel=i.texCoord),s.extensions[Le.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[Le.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=s.associations.get(a);a=s.extensions[Le.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),s.associations.set(a,l)}}return r!==void 0&&(a.colorSpace=r),t[e]=a,a})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const r=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,a=e.attributes.normal===void 0;if(t.isPoints){const o="PointsMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new Of,Rn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(o,l)),i=l}else if(t.isLine){const o="LineBasicMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new Kn,Rn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(o,l)),i=l}if(r||s||a){let o="ClonedMaterial:"+i.uuid+":";r&&(o+="derivative-tangents:"),s&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=i.clone(),s&&(l.vertexColors=!0),a&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(i))),i=l}t.material=i}getMaterialType(){return uh}loadMaterial(t){const e=this,i=this.json,r=this.extensions,s=i.materials[t];let a;const o={},l=s.extensions||{},c=[];if(l[Le.KHR_MATERIALS_UNLIT]){const u=r[Le.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),c.push(u.extendParams(o,s,e))}else{const u=s.pbrMetallicRoughness||{};if(o.color=new Ht(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const p=u.baseColorFactor;o.color.setRGB(p[0],p[1],p[2],Dn),o.opacity=p[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(o,"map",u.baseColorTexture,Tn)),o.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,o.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),c.push(e.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(t,o)})))}s.doubleSided===!0&&(o.side=hi);const h=s.alphaMode||x_.OPAQUE;if(h===x_.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===x_.MASK&&(o.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&a!==Ji&&(c.push(e.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new xt(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;o.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&a!==Ji&&(c.push(e.assignTexture(o,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&a!==Ji){const u=s.emissiveFactor;o.emissive=new Ht().setRGB(u[0],u[1],u[2],Dn)}return s.emissiveTexture!==void 0&&a!==Ji&&c.push(e.assignTexture(o,"emissiveMap",s.emissiveTexture,Tn)),Promise.all(c).then(function(){const u=new a(o);return s.name&&(u.name=s.name),qs(u,s),e.associations.set(u,{materials:t}),s.extensions&&Co(r,u,s),u})}createUniqueName(t){const e=Oe.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,r=this.primitiveCache;function s(o){return i[Le.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,e).then(function(l){return qA(l,o,e)})}const a=[];for(let o=0,l=t.length;o0&&YX(x,s),x.name=e.createUniqueName(s.name||"mesh_"+t),qs(x,s),y.extensions&&Co(r,x,y),e.assignFinalMaterial(x),u.push(x)}for(let m=0,g=u.length;m1?h=new Qs:c.length===1?h=c[0]:h=new Ge,h!==c[0])for(let u=0,p=c.length;u{const u=new Map;for(const[p,m]of r.associations)(p instanceof Rn||p instanceof Mn)&&u.set(p,m);return h.traverse(p=>{const m=r.associations.get(p);m!=null&&u.set(p,m)}),u};return r.associations=c(s),s})}_createAnimationTracks(t,e,i,r,s){const a=[],o=t.name?t.name:t.uuid,l=[];Ia[s.path]===Ia.weights?t.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(o);let c;switch(Ia[s.path]){case Ia.weights:c=el;break;case Ia.rotation:c=nl;break;case Ia.position:case Ia.scale:c=il;break;default:switch(i.itemSize){case 1:c=el;break;case 2:case 3:default:c=il;break}break}const h=r.interpolation!==void 0?XX[r.interpolation]:Xc,u=this._getArrayFromAccessor(i);for(let p=0,m=l.length;prq(r));return(await Promise.all(e)).flat()}async function rq(n){const{tile:t,center:e}=n,i=`https://maps.heidler.info/germany-draco/15-${t.x}-${t.y}.glb`;try{const r=await U3.loadAsync(i);let s=[];for(let l of r.scenes)for(let c of l.children){let h=c.geometry;const u=new de;u.makeScale(1/8192,1/8192,1);const p=new de;p.makeTranslation(t.x-e.x,t.y-e.y,0);const m=new de;m.makeScale($A(),-$A(),1);const g=m;g.multiply(p),g.multiply(u),h.applyMatrix4(g),h=h.toNonIndexed();let _={};const y=h.attributes.position.array,x=h.attributes.normal.array,M=h.attributes._feature_id_0.array;for(let b=0;bp.name=`simulation-${m}`),h.forEach((p,m)=>p.name=`surrounding-${m}`),u.forEach((p,m)=>p.name=`background-${m}`),{simulation:c,surrounding:h,background:u}}function aq(n){return!n||!n.bbox||!n.data?(console.error("Invalid heightmap data, missing bbox or data"),null):{...n,data:new Float32Array(n.data)}}function oq(n,t,e,i){if(console.log("Processing vegetation data..."),!n||!n.data)return console.error("Invalid vegetation raster data"),{surrounding:[],background:[]};console.log("Vegetation raster dimensions:",n.width,"x",n.height),console.log("Vegetation raster bbox:",n.bbox);const r={surrounding:[],background:[]};n.bbox;const[s,a]=Bm,o=e*e,l=i*i,c=t.x||0,h=t.y||0;for(let u=0;u0){const g=n.bbox[0]+(n.bbox[2]-n.bbox[0])*(p/n.width),_=n.bbox[3]+(n.bbox[1]-n.bbox[3])*(u/n.height),y=(g-s)*P0(),x=(_-a)*P0();p%100+u%100==0&&console.log(y,x);const M=(y-c)*(y-c)+(x-h)*(x-h);if(M<=l){const b=lq(y,x,m);M<=o?r.surrounding.push(b):r.background.push(b)}}}return console.log("Vegetation processing complete."),console.log("Surrounding geometries:",r.surrounding.length),console.log("Background geometries:",r.background.length),r}function lq(n,t,e){const s=new Ka(1,1,20).toNonIndexed().deleteAttribute("uv");return s.translate(n,t,e-10),s}const z3=[0,0,.2],B3=[1,.2,.1],H3=[1,1,.1];async function cq(n){if(window.setAttribution)for(let t of Object.values(window.setAttribution))t(!1);if(typeof n<"u"&&n!=null){let s=function(l,c){return window.setSimulationProgress(l*100/c)};const t=await iq(n);let e=k3(t,new U(0,0,0),80);if(window.setGeometries(e),e.simulation.length==0)return window.setFrontendState("ErrorAdress"),{simulationMesh:void 0};const i=new PR(parseFloat(n.lat),parseFloat(n.lon));if(e.simulation.forEach(l=>{i.addSimulationGeometry(l),i.addShadingGeometry(l)}),e.surrounding.forEach(l=>{i.addShadingGeometry(l)}),i.addColorMap(Q1.interpolateThreeColors({c0:z3,c1:B3,c2:H3})),eq()=="BY"){const[l,c]=Bm;console.log("coordinatesWebMercator:"+Bm);const h=200,u=[l-h,c-h,l+h,c+h];console.log("Starting vegetation processing..."),console.log(`Bounding box for vegetation data: [${u.join(", ")}]`);try{console.log("Downloading vegetation heightmap data...");const p=await sq(u);if(!p)throw new Error("Failed to download vegetation heightmap data");console.log("Vegetation Heightmap Data downloaded successfully"),console.log(`Data dimensions: ${p.width}x${p.height}`),console.log(`Data bounding box: [${p.bbox.join(", ")}]`),console.log("Processing vegetation raster data...");const m=aq(p);if(!m)throw new Error("Failed to process vegetation raster data");console.log("Vegetation Raster processed successfully"),console.log("Processing vegetation geometries...");const g=oq(m,new U(0,0,0),30,80);console.log("Vegetation Geometries processed successfully"),console.log(`Number of surrounding geometries: ${g.surrounding.length}`),console.log(`Number of background geometries: ${g.background.length}`),window.setVegetationGeometries(g),console.log("Adding vegetation geometries to the scene..."),g.surrounding.forEach(_=>{i.addShadingGeometry(_)}),console.log("Vegetation geometries added to the scene")}catch(p){console.error("Error in vegetation processing:",p),console.error("Error stack:",p.stack)}console.log("Vegetation processing completed")}let r=window.numSimulations||80;const a=await i.calculate({numberSimulations:r,pvCellEfficiency:.138,maxYieldPerSquareMeter:1400*.138,diffuseIrradianceURL:"https://www.openpv.de/data/irradiance/",urlDirectIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_direct_radiation.tif",urlDiffuseIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_diffuse_radiation.tif",progressCallback:s});let o=new U;return a.geometry.computeBoundingBox(),a.geometry.boundingBox.getCenter(o),a.middle=o,{simulationMesh:a}}}async function hq(n){let t=IR(n.selectedMesh.map(m=>m.geometry));t.computeBoundingBox(),t.computeBoundingSphere();let e=new U;t.boundingBox.getCenter(e),console.log(n.geometries);const i=t.boundingSphere.radius+80,r=[...n.geometries.surrounding,...n.geometries.background,...n.geometries.simulation],s=k3(r,e,i),a=new PR(parseFloat(n.geoLocation.lat),parseFloat(n.geoLocation.lon));a.addColorMap(Q1.interpolateThreeColors({c0:z3,c1:B3,c2:H3})),a.addSimulationGeometry(t),s.surrounding.forEach(m=>{a.addShadingGeometry(m)});let o=window.numSimulations||80,l=await a.calculate({numberSimulations:o,pvCellEfficiency:.138,maxYieldPerSquareMeter:1400*.138,diffuseIrradianceURL:"https://www.openpv.de/data/irradiance/",urlDirectIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_direct_radiation.tif",urlDiffuseIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_diffuse_radiation.tif",progressCallback:(m,g)=>console.log("Simulation Progress is ",m)});const c=new zf({vertexColors:!0,side:hi});l.material=c,l.name="simulationMesh",n.setSimulationMeshes([...n.simulationMeshes,l]);const h=n.selectedMesh.map(m=>m.geometry.name),u=n.geometries.surrounding.filter(m=>!h.includes(m.name)),p=n.geometries.background.filter(m=>!h.includes(m.name));window.setGeometries({surrounding:u,background:p,simulation:n.geometries.simulation}),n.setSelectedMesh([])}function uq({pvSystems:n}){const{isOpen:t,onOpen:e,onClose:i}=zm({defaultIsOpen:!1}),{isOpen:r,onToggle:s}=zm({defaultIsOpen:!1}),{t:a}=sh(),[o,l]=Q.useState(3e3),[c,h]=Q.useState(0),[u,p]=Q.useState(25),[m,g]=Q.useState(0),[_,y]=Q.useState(0);let x;n.length>0&&(x=Math.round(n.reduce((S,R)=>S+R.annualYield,0)));async function M(){async function S({pvProduction:R,consumptionHousehold:T,storageCapacity:C,electricityPrice:N,setSelfConsumption:P,setAnnualSavings:E}){const B=await(await fetch("https://www.openpv.de/data/savings_calculation/cons_prod.json")).json(),V=B.Consumption,j=B.Production,Y={};let q=0;for(const G in V){const nt=V[G]*T/1e3,K=j[G]*R/1e3;let $=0,ht=0;if(K>nt){$=nt,ht=K-nt;const vt=C-q,Z=Math.min(ht,vt);q+=Z}else{const vt=nt-K,Z=Math.min(vt,q);q-=Z,$=K+Z}Y[G]=$}let at=Object.values(Y).reduce((G,nt)=>G+nt,0);P(Math.round(at)),E(Math.round(at*N/100))}await S({pvProduction:x,consumptionHousehold:parseFloat(o),storageCapacity:c,electricityPrice:u,setSelfConsumption:g,setAnnualSavings:y})}const b=N0.useRef(null);return X.jsxs(X.Fragment,{children:[n.length>0&&X.jsx($s,{onClick:e,className:"button-high-prio",children:a("savingsCalculation.button")}),X.jsxs(Rv,{isOpen:t,onClose:i,size:"xl",children:[X.jsx(Pv,{}),X.jsxs(vT,{children:[X.jsx(Iv,{children:a("savingsCalculation.button")}),X.jsx(Lv,{}),X.jsx(Dv,{children:X.jsxs(X.Fragment,{children:[X.jsxs(Fy,{children:[X.jsxs(yu,{children:[a("savingsCalculation.consumptionTitle"),X.jsx(Af,{label:a("savingsCalculation.consumptionHelperInfo"),children:X.jsx(Lo,{color:"teal",fontSize:"xs",children:a("savingsCalculation.consumptionHelperLabel")})})]}),X.jsx(Uy,{ref:b,value:o,onChange:S=>l(S.target.value)})]}),X.jsx("br",{}),X.jsxs(Fy,{children:[X.jsx(yu,{children:a("savingsCalculation.storageTitle")}),X.jsx(Uy,{ref:b,value:c,onChange:S=>h(S.target.value)})]}),X.jsx("br",{}),X.jsxs(Fy,{children:[X.jsx(yu,{children:a("savingsCalculation.electricityPriceTitle")}),X.jsx(Uy,{ref:b,placeholder:a("savingsCalculation.electricityPricePlaceholder"),value:u,onChange:S=>p(S.target.value)})]}),X.jsx(AT,{in:r,animateOpacity:!0,children:X.jsxs(zu,{p:"40px",color:"white",mt:"4",bg:"teal",rounded:"md",shadow:"md",children:[X.jsx(Lo,{children:a("savingsCalculation.disclaimer")}),X.jsxs(MT,{children:[X.jsxs(No,{children:[a("savingsCalculation.results.production"),X.jsxs(Lo,{as:"b",color:"white",children:[x," kWh"]})]}),X.jsxs(No,{children:[a("savingsCalculation.results.consumption"),X.jsxs(Lo,{as:"b",color:"white",children:[m," kWh"]})]}),X.jsxs(No,{children:[a("savingsCalculation.results.savings"),X.jsxs(Lo,{as:"b",color:"white",children:[_,"€"]})]})]})]})}),X.jsx("br",{})]})}),X.jsx(MI,{children:X.jsx($s,{mr:3,onClick:()=>{M(),r||s()},children:a("savingsCalculation.calculate")})})]})]})]})}function fq({buttonLabel:n,onClick:t,hoverText:e,className:i}){return X.jsx(Af,{label:e,children:X.jsx($s,{onClick:t,className:i,children:n})})}function dq({label:n}){return X.jsx(Af,{label:n,children:X.jsx(iI,{as:"InfoOutlineIcon",margin:"5px"})})}const pq=({sliderProps:n,label:t,hoverHelpLabel:e,sliderValue:i,setSliderValue:r})=>{const[s,a]=N0.useState(!1);return X.jsxs(X.Fragment,{children:[t,e&&X.jsx(dq,{label:e}),X.jsxs(WT,{id:"slider",defaultValue:i,min:n.min,max:n.max,colorScheme:"teal",onChange:r,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[X.jsx(XT,{children:X.jsx(qT,{})}),X.jsx(Af,{hasArrow:!0,bg:"teal.500",color:"white",placement:"top",isOpen:s,label:`${i}`,children:X.jsx(jT,{})})]})]})};var G3={exports:{}},fl={};/** +northing meters`+n;var p=u/2,m=0,g=0,_,y,x,M,b;return p>0&&(_=1e5/Math.pow(10,p),y=n.substring(s,s+p),m=parseFloat(y)*_,x=n.substring(s+p),g=parseFloat(x)*_),M=m+c,b=g+h,{easting:M,northing:b,zoneLetter:o,zoneNumber:a,accuracy:_}}function hG(n,t){for(var e=GR.charCodeAt(t-1),i=1e5,r=!1;e!==n.charCodeAt(0);){if(e++,e===Ii&&e++,e===dr&&e++,e>fu){if(r)throw"Bad character: "+n;e=Ac,r=!0}i+=1e5}return i}function uG(n,t){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var e=VR.charCodeAt(t-1),i=0,r=!1;e!==n.charCodeAt(0);){if(e++,e===Ii&&e++,e===dr&&e++,e>uu){if(r)throw"Bad character: "+n;e=Ac,r=!0}i+=1e5}return i}function fG(n){var t;switch(n){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+n}function Jc(n,t,e){if(!(this instanceof Jc))return new Jc(n,t,e);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof t>"u"){var i=n.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=n,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Jc.fromMGRS=function(n){return new Jc(jR(n))};Jc.prototype.toMGRS=function(n){return WR([this.x,this.y],n)};var dG=1,pG=.25,tA=.046875,eA=.01953125,nA=.01068115234375,mG=.75,gG=.46875,yG=.013020833333333334,xG=.007120768229166667,_G=.3645833333333333,vG=.005696614583333333,MG=.3076171875;function nM(n){var t=[];t[0]=dG-n*(pG+n*(tA+n*(eA+n*nA))),t[1]=n*(mG-n*(tA+n*(eA+n*nA)));var e=n*n;return t[2]=e*(gG-n*(yG+n*xG)),e*=n,t[3]=e*(_G-n*vG),t[4]=e*n*MG,t}function mh(n,t,e,i){return e*=t,t*=t,i[0]*n-e*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var wG=20;function iM(n,t,e){for(var i=1/(1-t),r=n,s=wG;s;--s){var a=Math.sin(r),o=1-t*a*a;if(o=(mh(r,a,Math.cos(r),e)-n)*(o*Math.sqrt(o))*i,r-=o,Math.abs(o)Zt?Math.tan(e):0,_=Math.pow(g,2),y=Math.pow(_,2);r=1-this.es*Math.pow(o,2),h=h/Math.sqrt(r);var x=mh(e,o,l,this.en);s=this.a*(this.k0*h*(1+u/6*(1-_+p+u/20*(5-18*_+y+14*p-58*_*p+u/42*(61+179*y-y*_-479*_)))))+this.x0,a=this.a*(this.k0*(x-this.ml0+o*i*h/2*(1+u/12*(5-_+9*p+4*m+u/30*(61+y-58*_+270*p-330*_*p+u/56*(1385+543*y-y*_-3111*_))))))+this.y0}else{var c=l*Math.sin(i);if(Math.abs(Math.abs(c)-1)=1){if(c-1>Zt)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return n.x=s,n.y=a,n}function EG(n){var t,e,i,r,s=(n.x-this.x0)*(1/this.a),a=(n.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,e=iM(t,this.es,this.en),Math.abs(e)Zt?Math.tan(e):0,g=this.ep2*Math.pow(p,2),_=Math.pow(g,2),y=Math.pow(m,2),x=Math.pow(y,2);t=1-this.es*Math.pow(u,2);var M=s*Math.sqrt(t)/this.k0,b=Math.pow(M,2);t=t*m,i=e-t*b/(1-this.es)*.5*(1-b/12*(5+3*y-9*g*y+g-4*_-b/30*(61+90*y-252*g*y+45*x+46*g-b/56*(1385+3633*y+4095*x+1574*x*y)))),r=Jt(this.long0+M*(1-b/6*(1+2*y+g-b/20*(5+28*y+24*x+8*g*y+6*g-b/42*(61+662*y+1320*x+720*x*y))))/p)}else i=Lt*jf(a),r=0;else{var o=Math.exp(s/this.k0),l=.5*(o-1/o),c=this.lat0+a/this.k0,h=Math.cos(c);t=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(t),a<0&&(i=-i),l===0&&h===0?r=0:r=Jt(Math.atan2(l,h)+this.long0)}return n.x=r,n.y=i,n}var AG=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Nm={init:bG,forward:SG,inverse:EG,names:AG};function $R(n){var t=Math.exp(n);return t=(t-1/t)/2,t}function Di(n,t){n=Math.abs(n),t=Math.abs(t);var e=Math.max(n,t),i=Math.min(n,t)/(e||1);return e*Math.sqrt(1+Math.pow(i,2))}function TG(n){var t=1+n,e=t-1;return e===0?n:n*Math.log(t)/e}function CG(n){var t=Math.abs(n);return t=TG(t*(1+t/(Di(1,t)+1))),n<0?-t:t}function rM(n,t){for(var e=2*Math.cos(2*t),i=n.length-1,r=n[i],s=0,a;--i>=0;)a=-s+e*r+n[i],s=r,r=a;return t+a*Math.sin(2*t)}function RG(n,t){for(var e=2*Math.cos(t),i=n.length-1,r=n[i],s=0,a;--i>=0;)a=-s+e*r+n[i],s=r,r=a;return Math.sin(t)*a}function PG(n){var t=Math.exp(n);return t=(t+1/t)/2,t}function YR(n,t,e){for(var i=Math.sin(t),r=Math.cos(t),s=$R(e),a=PG(e),o=2*r*a,l=-2*i*s,c=n.length-1,h=n[c],u=0,p=0,m=0,g,_;--c>=0;)g=p,_=u,p=h,u=m,h=-g+o*p-l*u+n[c],m=-_+l*p+o*u;return o=i*a,l=r*s,[o*h-l*m,o*m+l*h]}function IG(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Nm.init.apply(this),this.forward=Nm.forward,this.inverse=Nm.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),t=n/(2-n),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var i=rM(this.cbg,this.lat0);this.Zb=-this.Qn*(i+RG(this.gtu,2*i))}function LG(n){var t=Jt(n.x-this.long0),e=n.y;e=rM(this.cbg,e);var i=Math.sin(e),r=Math.cos(e),s=Math.sin(t),a=Math.cos(t);e=Math.atan2(i,a*r),t=Math.atan2(s*r,Di(i,r*a)),t=CG(Math.tan(t));var o=YR(this.gtu,2*e,2*t);e=e+o[0],t=t+o[1];var l,c;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,c=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,c=1/0),n.x=l,n.y=c,n}function DG(n){var t=(n.x-this.x0)*(1/this.a),e=(n.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var i,r;if(Math.abs(t)<=2.623395162778){var s=YR(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan($R(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),c=Math.cos(t);e=Math.atan2(a*c,Di(l,c*o)),t=Math.atan2(l,c*o),i=Jt(t+this.long0),r=rM(this.cgb,e)}else i=1/0,r=1/0;return n.x=i,n.y=r,n}var NG=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Om={init:IG,forward:LG,inverse:DG,names:NG};function OG(n,t){if(n===void 0){if(n=Math.floor((Jt(t)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var FG="etmerc";function UG(){var n=OG(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*$n,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Om.init.apply(this),this.forward=Om.forward,this.inverse=Om.inverse}var kG=["Universal Transverse Mercator System","utm"];const zG={init:UG,names:kG,dependsOn:FG};function sM(n,t){return Math.pow((1-n)/(1+n),t)}var BG=20;function HG(){var n=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Ve)/(Math.pow(Math.tan(.5*this.lat0+Ve),this.C)*sM(this.e*n,this.ratexp))}function GG(n){var t=n.x,e=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Ve),this.C)*sM(this.e*Math.sin(e),this.ratexp))-Lt,n.x=this.C*t,n}function VG(n){for(var t=1e-14,e=n.x/this.C,i=n.y,r=Math.pow(Math.tan(.5*i+Ve)/this.K,1/this.C),s=BG;s>0&&(i=2*Math.atan(r*sM(this.e*Math.sin(n.y),-.5*this.e))-Lt,!(Math.abs(i-n.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Zt&&Math.abs(Math.cos(this.lat_ts))>Zt&&(this.k0=.5*this.cons*Ts(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Hr(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ts(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Lt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function JG(n){var t=n.x,e=n.y,i=Math.sin(e),r=Math.cos(e),s,a,o,l,c,h,u=Jt(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Zt&&Math.abs(e+this.lat0)<=Zt?(n.x=NaN,n.y=NaN,n):this.sphere?(s=2*this.k0/(1+this.sinlat0*i+this.coslat0*r*Math.cos(u)),n.x=this.a*s*r*Math.sin(u)+this.x0,n.y=this.a*s*(this.coslat0*i-this.sinlat0*r*Math.cos(u))+this.y0,n):(a=2*Math.atan(this.ssfn_(e,i,this.e))-Lt,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=Zt?(c=Hr(this.e,e*this.con,this.con*i),h=2*this.a*this.k0*c/this.cons,n.x=this.x0+h*Math.sin(t-this.long0),n.y=this.y0-this.con*h*Math.cos(t-this.long0),n):(Math.abs(this.sinlat0)0?t=Jt(this.long0+Math.atan2(n.x,-1*n.y)):t=Jt(this.long0+Math.atan2(n.x,n.y)):t=Jt(this.long0+Math.atan2(n.x*Math.sin(o),a*this.coslat0*Math.cos(o)-n.y*this.sinlat0*Math.sin(o))),n.x=t,n.y=e,n)}else if(Math.abs(this.coslat0)<=Zt){if(a<=Zt)return e=this.lat0,t=this.long0,n.x=t,n.y=e,n;n.x*=this.con,n.y*=this.con,i=a*this.cons/(2*this.a*this.k0),e=this.con*cf(this.e,i),t=this.con*Jt(this.con*this.long0+Math.atan2(n.x,-1*n.y))}else r=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=Zt?s=this.X0:(s=Math.asin(Math.cos(r)*this.sinX0+n.y*Math.sin(r)*this.cosX0/a),t=Jt(this.long0+Math.atan2(n.x*Math.sin(r),a*this.cosX0*Math.cos(r)-n.y*this.sinX0*Math.sin(r)))),e=-1*cf(this.e,Math.tan(.5*(Lt+s)));return n.x=t,n.y=e,n}var tV=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const eV={init:KG,forward:JG,inverse:QG,names:tV,ssfn_:ZG};function nV(){var n=this.lat0;this.lambda0=this.long0;var t=Math.sin(n),e=this.a,i=this.rf,r=1/i,s=2*r-Math.pow(r,2),a=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),c=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*l+this.alpha*a/2*c}function iV(n){var t=Math.log(Math.tan(Math.PI/4-n.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),i=-this.alpha*(t+e)+this.K,r=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(n.x-this.lambda0),a=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),o=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return n.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,n.x=this.R*a+this.x0,n}function rV(n){for(var t=n.x-this.x0,e=n.y-this.y0,i=t/this.R,r=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),o=this.lambda0+a/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=o,n.y=c,n}var sV=["somerc"];const aV={init:nV,forward:iV,inverse:rV,names:sV};var xc=1e-7;function oV(n){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof n.PROJECTION=="object"?Object.keys(n.PROJECTION)[0]:n.PROJECTION;return"no_uoff"in n||"no_off"in n||t.indexOf(e)!==-1}function lV(){var n,t,e,i,r,s,a,o,l,c,h=0,u,p=0,m=0,g=0,_=0,y=0,x=0;this.no_off=oV(this),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),M&&(x=this.alpha),b&&(h=this.rectified_grid_angle*$n),M||b)p=this.longc;else if(m=this.long1,_=this.lat1,g=this.long2,y=this.lat2,Math.abs(_-y)<=xc||(n=Math.abs(_))<=xc||Math.abs(n-Lt)<=xc||Math.abs(Math.abs(this.lat0)-Lt)<=xc||Math.abs(Math.abs(y)-Lt)<=xc)throw new Error;var S=1-this.es;t=Math.sqrt(S),Math.abs(this.lat0)>Zt?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),n=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*t/n,i=this.B*t/(e*Math.sqrt(n)),r=i*i-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=i,this.E*=Math.pow(Hr(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=r=1),M||b?(M?(u=Math.asin(Math.sin(x)/i),b||(h=x)):(u=h,x=Math.asin(i*Math.sin(u))),this.lam0=p-Math.asin(.5*(r-1/r)*Math.tan(u))/this.B):(s=Math.pow(Hr(this.e,_,Math.sin(_)),this.B),a=Math.pow(Hr(this.e,y,Math.sin(y)),this.B),r=this.E/s,l=(a-s)/(a+s),c=this.E*this.E,c=(c-a*s)/(c+a*s),n=m-g,n<-Math.pi?g-=of:n>Math.pi&&(g+=of),this.lam0=Jt(.5*(m+g)-Math.atan(c*Math.tan(.5*this.B*(m-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Jt(m-this.lam0))/(r-1/r)),h=x=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Ve-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ve+r))}function cV(n){var t={},e,i,r,s,a,o,l,c;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-Lt)>Zt){if(a=this.E/Math.pow(Hr(this.e,n.y,Math.sin(n.y)),this.B),o=1/a,e=.5*(a-o),i=.5*(a+o),s=Math.sin(this.B*n.x),r=(e*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(r)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(t.x=l,t.y=c):(l-=this.u_0,t.x=c*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-c*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function hV(n){var t,e,i,r,s,a,o,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(e=n.y,t=n.x):(e=n.x*this.cosrot-n.y*this.sinrot,t=n.y*this.cosrot+n.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*e),r=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(this.BrA*t),o=(a*this.cosgam+r*this.singam)/s,Math.abs(Math.abs(o)-1)Zt?this.ns=Math.log(i/o)/Math.log(r/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function pV(n){var t=n.x,e=n.y;Math.abs(2*Math.abs(e)-Math.PI)<=Zt&&(e=jf(e)*(Lt-2*Zt));var i=Math.abs(Math.abs(e)-Lt),r,s;if(i>Zt)r=Hr(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(r,this.ns);else{if(i=e*this.ns,i<=0)return null;s=0}var a=this.ns*Jt(t-this.long0);return n.x=this.k0*(s*Math.sin(a))+this.x0,n.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,n}function mV(n){var t,e,i,r,s,a=(n.x-this.x0)/this.k0,o=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),e=1):(t=-Math.sqrt(a*a+o*o),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*a,e*o)),t!==0||this.ns>0){if(e=1/this.ns,i=Math.pow(t/(this.a*this.f0),e),r=cf(this.e,i),r===-9999)return null}else r=-Lt;return s=Jt(l/this.ns+this.long0),n.x=s,n.y=r,n}var gV=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const yV={init:dV,forward:pV,inverse:mV,names:gV};function xV(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function _V(n){var t,e,i,r,s,a,o,l=n.x,c=n.y,h=Jt(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),i=-h*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(i)),s=Math.asin(Math.cos(e)*Math.sin(i)/Math.cos(r)),a=this.n*s,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),n.y=o*Math.cos(a)/1,n.x=o*Math.sin(a)/1,this.czech||(n.y*=-1,n.x*=-1),n}function vV(n){var t,e,i,r,s,a,o,l,c=n.x;n.x=n.y,n.y=c,this.czech||(n.y*=-1,n.x*=-1),a=Math.sqrt(n.x*n.x+n.y*n.y),s=Math.atan2(n.y,n.x),r=s/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),e=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(t)),n.x=this.long0-e/this.alfa,o=t,l=0;var h=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-n.y)<1e-10&&(l=1),o=n.y,h+=1;while(l===0&&h<15);return h>=15?null:n}var MV=["Krovak","krovak"];const wV={init:xV,forward:_V,inverse:vV,names:MV};function vi(n,t,e,i,r){return n*r-t*Math.sin(2*r)+e*Math.sin(4*r)-i*Math.sin(6*r)}function Xf(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function qf(n){return .375*n*(1+.25*n*(1+.46875*n))}function $f(n){return .05859375*n*n*(1+.75*n)}function Yf(n){return n*n*n*(35/3072)}function Qc(n,t,e){var i=t*e;return n/Math.sqrt(1-i*i)}function no(n){return Math.abs(n)1e-7?(e=n*t,(1-n*n)*(t/(1-e*e)-.5/n*Math.log((1-e)/(1+e)))):2*t}var CV=1,RV=2,PV=3,IV=4;function LV(){var n=Math.abs(this.lat0);if(Math.abs(n-Lt)0){var t;switch(this.qp=za(this.e,1),this.mmf=.5/(1-this.es),this.apa=HV(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=za(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function DV(n){var t,e,i,r,s,a,o,l,c,h,u=n.x,p=n.y;if(u=Jt(u-this.long0),this.sphere){if(s=Math.sin(p),h=Math.cos(p),i=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+h*i:1+this.sinph0*s+this.cosph0*h*i,e<=Zt)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(u),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(p+this.lat0)=0?(t=(c=Math.sqrt(a))*r,e=i*(this.mode===this.S_POLE?c:-c)):t=e=0;break}}return n.x=this.a*t+this.x0,n.y=this.a*e+this.y0,n}function NV(n){n.x-=this.x0,n.y-=this.y0;var t=n.x/this.a,e=n.y/this.a,i,r,s,a,o,l,c;if(this.sphere){var h=0,u,p=0;if(u=Math.sqrt(t*t+e*e),r=u*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(r),h=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(u)<=Zt?0:Math.asin(e*p/u),t*=p,e=h*u;break;case this.OBLIQ:r=Math.abs(u)<=Zt?this.lat0:Math.asin(h*this.sinph0+e*p*this.cosph0/u),t*=p*this.cosph0,e=(h-Math.sin(r)*this.sinph0)*u;break;case this.N_POLE:e=-e,r=Lt-r;break;case this.S_POLE:r-=Lt;break}i=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l1&&(n=n>1?1:-1),Math.asin(n)}function jV(){Math.abs(this.lat1+this.lat2)Zt?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function XV(n){var t=n.x,e=n.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var i=za(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*Jt(t-this.long0),a=r*Math.sin(s)+this.x0,o=this.rh-r*Math.cos(s)+this.y0;return n.x=a,n.y=o,n}function qV(n){var t,e,i,r,s,a;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),i=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),i=-1),r=0,t!==0&&(r=Math.atan2(i*n.x,i*n.y)),i=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-i*i)/(2*this.ns0)):(e=(this.c-i*i)/this.ns0,a=this.phi1z(this.e3,e)),s=Jt(r/this.ns0+this.long0),n.x=s,n.y=a,n}function $V(n,t){var e,i,r,s,a,o=qa(.5*t);if(n0||Math.abs(a)<=Zt?(o=this.x0+this.a*s*e*Math.sin(i)/a,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*r)/a):(o=this.x0+this.infinity_dist*e*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*r)),n.x=o,n.y=l,n}function QV(n){var t,e,i,r,s,a;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(t=Math.sqrt(n.x*n.x+n.y*n.y))?(r=Math.atan2(t,this.rc),e=Math.sin(r),i=Math.cos(r),a=qa(i*this.sin_p14+n.y*e*this.cos_p14/t),s=Math.atan2(n.x*e,t*this.cos_p14*i-n.y*this.sin_p14*e),s=Jt(this.long0+s)):(a=this.phic0,s=0),n.x=s,n.y=a,n}var t9=["gnom"];const e9={init:KV,forward:JV,inverse:QV,names:t9};function n9(n,t){var e=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*Lt:Lt;for(var i=Math.asin(.5*t),r,s,a,o,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),o=n*s,r=Math.pow(1-o*o,2)/(2*a)*(t/(1-n*n)-s/(1-o*o)+.5/n*Math.log((1-o)/(1+o))),i+=r,Math.abs(r)<=1e-10)return i;return NaN}function i9(){this.sphere||(this.k0=Ts(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function r9(n){var t=n.x,e=n.y,i,r,s=Jt(t-this.long0);if(this.sphere)i=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=za(this.e,Math.sin(e));i=this.x0+this.a*this.k0*s,r=this.y0+this.a*a*.5/this.k0}return n.x=i,n.y=r,n}function s9(n){n.x-=this.x0,n.y-=this.y0;var t,e;return this.sphere?(t=Jt(this.long0+n.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(e=n9(this.e,2*n.y*this.k0/this.a),t=Jt(this.long0+n.x/(this.a*this.k0))),n.x=t,n.y=e,n}var a9=["cea"];const o9={init:i9,forward:r9,inverse:s9,names:a9};function l9(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function c9(n){var t=n.x,e=n.y,i=Jt(t-this.long0),r=no(e-this.lat0);return n.x=this.x0+this.a*i*this.rc,n.y=this.y0+this.a*r,n}function h9(n){var t=n.x,e=n.y;return n.x=Jt(this.long0+(t-this.x0)/(this.a*this.rc)),n.y=no(this.lat0+(e-this.y0)/this.a),n}var u9=["Equirectangular","Equidistant_Cylindrical","eqc"];const f9={init:l9,forward:c9,inverse:h9,names:u9};var iA=20;function d9(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Xf(this.es),this.e1=qf(this.es),this.e2=$f(this.es),this.e3=Yf(this.es),this.ml0=this.a*vi(this.e0,this.e1,this.e2,this.e3,this.lat0)}function p9(n){var t=n.x,e=n.y,i,r,s,a=Jt(t-this.long0);if(s=a*Math.sin(e),this.sphere)Math.abs(e)<=Zt?(i=this.a*a,r=-1*this.a*this.lat0):(i=this.a*Math.sin(s)/Math.tan(e),r=this.a*(no(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=Zt)i=this.a*a,r=-1*this.ml0;else{var o=Qc(this.a,this.e,Math.sin(e))/Math.tan(e);i=o*Math.sin(s),r=this.a*vi(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(s))}return n.x=i+this.x0,n.y=r+this.y0,n}function m9(n){var t,e,i,r,s,a,o,l,c;if(i=n.x-this.x0,r=n.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=Zt)t=Jt(i/this.a+this.long0),e=0;else{a=this.lat0+r/this.a,o=i*i/this.a/this.a+a*a,l=a;var h;for(s=iA;s;--s)if(h=Math.tan(l),c=-1*(a*(l*h+1)-l-.5*(l*l+o)*h)/((l-a)/h-1),l+=c,Math.abs(c)<=Zt){e=l;break}t=Jt(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(r+this.ml0)<=Zt)e=0,t=Jt(this.long0+i/this.a);else{a=(this.ml0+r)/this.a,o=i*i/this.a/this.a+a*a,l=a;var u,p,m,g,_;for(s=iA;s;--s)if(_=this.e*Math.sin(l),u=Math.sqrt(1-_*_)*Math.tan(l),p=this.a*vi(this.e0,this.e1,this.e2,this.e3,l),m=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),g=p/this.a,c=(a*(u*g+1)-g-.5*u*(g*g+o))/(this.es*Math.sin(2*l)*(g*g+o-2*a*g)/(4*u)+(a-g)*(u*m-2/Math.sin(2*l))-m),l-=c,Math.abs(c)<=Zt){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=Jt(this.long0+Math.asin(i*u/this.a)/Math.sin(e))}return n.x=t,n.y=e,n}var g9=["Polyconic","poly"];const y9={init:d9,forward:p9,inverse:m9,names:g9};function x9(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function _9(n){var t,e=n.x,i=n.y,r=i-this.lat0,s=e-this.long0,a=r/Pu*1e-5,o=s,l=1,c=0;for(t=1;t<=10;t++)l=l*a,c=c+this.A[t]*l;var h=c,u=o,p=1,m=0,g,_,y=0,x=0;for(t=1;t<=6;t++)g=p*h-m*u,_=m*h+p*u,p=g,m=_,y=y+this.B_re[t]*p-this.B_im[t]*m,x=x+this.B_im[t]*p+this.B_re[t]*m;return n.x=x*this.a+this.x0,n.y=y*this.a+this.y0,n}function v9(n){var t,e=n.x,i=n.y,r=e-this.x0,s=i-this.y0,a=s/this.a,o=r/this.a,l=1,c=0,h,u,p=0,m=0;for(t=1;t<=6;t++)h=l*a-c*o,u=c*a+l*o,l=h,c=u,p=p+this.C_re[t]*l-this.C_im[t]*c,m=m+this.C_im[t]*l+this.C_re[t]*c;for(var g=0;g.999999999999&&(e=.999999999999),t=Math.asin(e);var i=Jt(this.long0+n.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var r=Math.asin(e);return n.x=i,n.y=r,n}var U9=["Mollweide","moll"];const k9={init:N9,forward:O9,inverse:F9,names:U9};function z9(){Math.abs(this.lat1+this.lat2)=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),t=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*n.x,t*n.y)),this.sphere)return r=Jt(this.long0+s/this.ns),i=no(this.g-e/this.a),n.x=r,n.y=i,n;var a=this.g-e/this.a;return i=S0(a,this.e0,this.e1,this.e2,this.e3),r=Jt(this.long0+s/this.ns),n.x=r,n.y=i,n}var G9=["Equidistant_Conic","eqdc"];const V9={init:z9,forward:B9,inverse:H9,names:G9};function W9(){this.R=this.a}function j9(n){var t=n.x,e=n.y,i=Jt(t-this.long0),r,s;Math.abs(e)<=Zt&&(r=this.x0+this.R*i,s=this.y0);var a=qa(2*Math.abs(e/Math.PI));(Math.abs(i)<=Zt||Math.abs(Math.abs(e)-Lt)<=Zt)&&(r=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*a):s=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/i-i/Math.PI),l=o*o,c=Math.sin(a),h=Math.cos(a),u=h/(c+h-1),p=u*u,m=u*(2/c-1),g=m*m,_=Math.PI*this.R*(o*(u-g)+Math.sqrt(l*(u-g)*(u-g)-(g+l)*(p-g)))/(g+l);i<0&&(_=-_),r=this.x0+_;var y=l+u;return _=Math.PI*this.R*(m*y-o*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),e>=0?s=this.y0+_:s=this.y0-_,n.x=r,n.y=s,n}function X9(n){var t,e,i,r,s,a,o,l,c,h,u,p,m;return n.x-=this.x0,n.y-=this.y0,u=Math.PI*this.R,i=n.x/u,r=n.y/u,s=i*i+r*r,a=-Math.abs(r)*(1+s),o=a-2*r*r+i*i,l=-2*a+1+2*r*r+s*s,m=r*r/l+(2*o*o*o/l/l/l-9*a*o/l/l)/27,c=(a-o*o/3/l)/l,h=2*Math.sqrt(-c/3),u=3*m/c/h,Math.abs(u)>1&&(u>=0?u=1:u=-1),p=Math.acos(u)/3,n.y>=0?e=(-h*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI:e=-(-h*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI,Math.abs(i)2*Lt*this.a?void 0:(e=t/this.a,i=Math.sin(e),r=Math.cos(e),s=this.long0,Math.abs(t)<=Zt?a=this.lat0:(a=qa(r*this.sin_p12+n.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-Lt,Math.abs(o)<=Zt?this.lat0>=0?s=Jt(this.long0+Math.atan2(n.x,-n.y)):s=Jt(this.long0-Math.atan2(-n.x,n.y)):s=Jt(this.long0+Math.atan2(n.x*i,t*this.cos_p12*r-n.y*this.sin_p12*i))),n.x=s,n.y=a,n)):(l=Xf(this.es),c=qf(this.es),h=$f(this.es),u=Yf(this.es),Math.abs(this.sin_p12-1)<=Zt?(p=this.a*vi(l,c,h,u,Lt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=p-t,a=S0(m/this.a,l,c,h,u),s=Jt(this.long0+Math.atan2(n.x,-1*n.y)),n.x=s,n.y=a,n):Math.abs(this.sin_p12+1)<=Zt?(p=this.a*vi(l,c,h,u,Lt),t=Math.sqrt(n.x*n.x+n.y*n.y),m=t-p,a=S0(m/this.a,l,c,h,u),s=Jt(this.long0+Math.atan2(n.x,n.y)),n.x=s,n.y=a,n):(t=Math.sqrt(n.x*n.x+n.y*n.y),y=Math.atan2(n.x,n.y),g=Qc(this.a,this.e,this.sin_p12),x=Math.cos(y),M=this.e*this.cos_p12*x,b=-M*M/(1-this.es),S=3*this.es*(1-b)*this.sin_p12*this.cos_p12*x/(1-this.es),R=t/g,C=R-b*(1+b)*Math.pow(R,3)/6-S*(1+3*b)*Math.pow(R,4)/24,T=1-b*C*C/2-R*C*C*C/6,_=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*x),s=Jt(this.long0+Math.asin(Math.sin(y)*Math.sin(C)/Math.cos(_))),N=Math.sin(_),a=Math.atan2((N-this.es*T*this.sin_p12)*Math.tan(_),N*(1-this.es)),n.x=s,n.y=a,n))}var J9=["Azimuthal_Equidistant","aeqd"];const Q9={init:Y9,forward:Z9,inverse:K9,names:J9};function t7(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function e7(n){var t,e,i,r,s,a,o,l,c=n.x,h=n.y;return i=Jt(c-this.long0),t=Math.sin(h),e=Math.cos(h),r=Math.cos(i),a=this.sin_p14*t+this.cos_p14*e*r,s=1,(a>0||Math.abs(a)<=Zt)&&(o=this.a*s*e*Math.sin(i),l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*r)),n.x=o,n.y=l,n}function n7(n){var t,e,i,r,s,a,o;return n.x-=this.x0,n.y-=this.y0,t=Math.sqrt(n.x*n.x+n.y*n.y),e=qa(t/this.a),i=Math.sin(e),r=Math.cos(e),a=this.long0,Math.abs(t)<=Zt?(o=this.lat0,n.x=a,n.y=o,n):(o=qa(r*this.sin_p14+n.y*i*this.cos_p14/t),s=Math.abs(this.lat0)-Lt,Math.abs(s)<=Zt?(this.lat0>=0?a=Jt(this.long0+Math.atan2(n.x,-n.y)):a=Jt(this.long0-Math.atan2(-n.x,n.y)),n.x=a,n.y=o,n):(a=Jt(this.long0+Math.atan2(n.x*i,t*this.cos_p14*r-n.y*this.sin_p14*i)),n.x=a,n.y=o,n))}var i7=["ortho"];const r7={init:t7,forward:e7,inverse:n7,names:i7};var ln={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},We={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function s7(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Lt-Ve/2?this.face=ln.TOP:this.lat0<=-(Lt-Ve/2)?this.face=ln.BOTTOM:Math.abs(this.long0)<=Ve?this.face=ln.FRONT:Math.abs(this.long0)<=Lt+Ve?this.face=this.long0>0?ln.RIGHT:ln.LEFT:this.face=ln.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function a7(n){var t={x:0,y:0},e,i,r,s,a,o,l={value:0};if(n.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):e=n.y,i=n.x,this.face===ln.TOP)s=Lt-e,i>=Ve&&i<=Lt+Ve?(l.value=We.AREA_0,r=i-Lt):i>Lt+Ve||i<=-(Lt+Ve)?(l.value=We.AREA_1,r=i>0?i-xn:i+xn):i>-(Lt+Ve)&&i<=-Ve?(l.value=We.AREA_2,r=i+Lt):(l.value=We.AREA_3,r=i);else if(this.face===ln.BOTTOM)s=Lt+e,i>=Ve&&i<=Lt+Ve?(l.value=We.AREA_0,r=-i+Lt):i=-Ve?(l.value=We.AREA_1,r=-i):i<-Ve&&i>=-(Lt+Ve)?(l.value=We.AREA_2,r=-i-Lt):(l.value=We.AREA_3,r=i>0?-i+xn:-i-xn);else{var c,h,u,p,m,g,_;this.face===ln.RIGHT?i=Fc(i,+Lt):this.face===ln.BACK?i=Fc(i,+xn):this.face===ln.LEFT&&(i=Fc(i,-Lt)),p=Math.sin(e),m=Math.cos(e),g=Math.sin(i),_=Math.cos(i),c=m*_,h=m*g,u=p,this.face===ln.FRONT?(s=Math.acos(c),r=dm(s,u,h,l)):this.face===ln.RIGHT?(s=Math.acos(h),r=dm(s,u,-c,l)):this.face===ln.BACK?(s=Math.acos(-c),r=dm(s,u,-h,l)):this.face===ln.LEFT?(s=Math.acos(-h),r=dm(s,u,c,l)):(s=r=0,l.value=We.AREA_0)}return o=Math.atan(12/xn*(r+Math.acos(Math.sin(r)*Math.cos(Ve))-Lt)),a=Math.sqrt((1-Math.cos(s))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===We.AREA_1?o+=Lt:l.value===We.AREA_2?o+=xn:l.value===We.AREA_3&&(o+=1.5*xn),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,n.x=t.x,n.y=t.y,n}function o7(n){var t={lam:0,phi:0},e,i,r,s,a,o,l,c,h,u={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,i=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),e=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?u.value=We.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(u.value=We.AREA_1,e-=Lt):n.x<0&&-n.x>=Math.abs(n.y)?(u.value=We.AREA_2,e=e<0?e+xn:e-xn):(u.value=We.AREA_3,e+=Lt),h=xn/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),r=Math.cos(e),s=Math.tan(i),l=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===ln.TOP)c=Math.acos(l),t.phi=Lt-c,u.value===We.AREA_0?t.lam=o+Lt:u.value===We.AREA_1?t.lam=o<0?o+xn:o-xn:u.value===We.AREA_2?t.lam=o-Lt:t.lam=o;else if(this.face===ln.BOTTOM)c=Math.acos(l),t.phi=c-Lt,u.value===We.AREA_0?t.lam=-o+Lt:u.value===We.AREA_1?t.lam=-o:u.value===We.AREA_2?t.lam=-o-Lt:t.lam=o<0?-o-xn:-o+xn;else{var p,m,g;p=l,h=p*p,h>=1?g=0:g=Math.sqrt(1-h)*Math.sin(o),h+=g*g,h>=1?m=0:m=Math.sqrt(1-h),u.value===We.AREA_1?(h=m,m=-g,g=h):u.value===We.AREA_2?(m=-m,g=-g):u.value===We.AREA_3&&(h=m,m=g,g=-h),this.face===ln.RIGHT?(h=p,p=-m,m=h):this.face===ln.BACK?(p=-p,m=-m):this.face===ln.LEFT&&(h=p,p=m,m=-h),t.phi=Math.acos(-g)-Lt,t.lam=Math.atan2(m,p),this.face===ln.RIGHT?t.lam=Fc(t.lam,-Lt):this.face===ln.BACK?t.lam=Fc(t.lam,-xn):this.face===ln.LEFT&&(t.lam=Fc(t.lam,+Lt))}if(this.es!==0){var _,y,x;_=t.phi<0?1:0,y=Math.tan(t.phi),x=this.b/Math.sqrt(y*y+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-x*x)/(this.one_minus_f*x)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,n.x=t.lam,n.y=t.phi,n}function dm(n,t,e,i){var r;return nVe&&r<=Lt+Ve?(i.value=We.AREA_1,r-=Lt):r>Lt+Ve||r<=-(Lt+Ve)?(i.value=We.AREA_2,r=r>=0?r-xn:r+xn):(i.value=We.AREA_3,r+=Lt)),r}function Fc(n,t){var e=n+t;return e<-xn?e+=of:e>+xn&&(e-=of),e}var l7=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const c7={init:s7,forward:a7,inverse:o7,names:l7};var lv=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],du=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ZR=.8487,KR=1.3523,JR=xs/5,h7=1/JR,Tc=18,E0=function(n,t){return n[0]+t*(n[1]+t*(n[2]+t*n[3]))},u7=function(n,t){return n[1]+t*(2*n[2]+t*3*n[3])};function f7(n,t,e,i){for(var r=t;i;--i){var s=n(r);if(r-=s,Math.abs(s)=Tc&&(i=Tc-1),e=xs*(e-h7*i);var r={x:E0(lv[i],e)*t,y:E0(du[i],e)};return n.y<0&&(r.y=-r.y),r.x=r.x*this.a*ZR+this.x0,r.y=r.y*this.a*KR+this.y0,r}function m7(n){var t={x:(n.x-this.x0)/(this.a*ZR),y:Math.abs(n.y-this.y0)/(this.a*KR)};if(t.y>=1)t.x/=lv[Tc][0],t.y=n.y<0?-Lt:Lt;else{var e=Math.floor(t.y*Tc);for(e<0?e=0:e>=Tc&&(e=Tc-1);;)if(du[e][0]>t.y)--e;else if(du[e+1][0]<=t.y)++e;else break;var i=du[e],r=5*(t.y-i[0])/(du[e+1][0]-i[0]);r=f7(function(s){return(E0(i,s)-t.y)/u7(i,s)},r,Zt,100),t.x/=E0(lv[e],r),t.y=(5*e+r)*$n,n.y<0&&(t.y=-t.y)}return t.x=Jt(t.x+this.long0),t}var g7=["Robinson","robin"];const y7={init:d7,forward:p7,inverse:m7,names:g7};function x7(){this.name="geocent"}function _7(n){var t=zR(n,this.es,this.a);return t}function v7(n){var t=BR(n,this.es,this.a,this.b);return t}var M7=["Geocentric","geocentric","geocent","Geocent"];const w7={init:x7,forward:_7,inverse:v7,names:M7};var ci={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},iu={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function b7(){if(Object.keys(iu).forEach((function(e){if(typeof this[e]>"u")this[e]=iu[e].def;else{if(iu[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);iu[e].num&&(this[e]=parseFloat(this[e]))}iu[e].degrees&&(this[e]=this[e]*$n)}).bind(this)),Math.abs(Math.abs(this.lat0)-Lt)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(n),this.sw=Math.sin(n)}function S7(n){n.x-=this.long0;var t=Math.sin(n.y),e=Math.cos(n.y),i=Math.cos(n.x),r,s;switch(this.mode){case ci.OBLIQ:s=this.sinph0*t+this.cosph0*e*i;break;case ci.EQUIT:s=e*i;break;case ci.S_POLE:s=-t;break;case ci.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),r=s*e*Math.sin(n.x),this.mode){case ci.OBLIQ:s*=this.cosph0*t-this.sinph0*e*i;break;case ci.EQUIT:s*=t;break;case ci.N_POLE:s*=-(e*i);break;case ci.S_POLE:s*=e*i;break}var a,o;return a=s*this.cg+r*this.sg,o=1/(a*this.sw*this.h1+this.cw),r=(r*this.cg-s*this.sg)*this.cw*o,s=a*o,n.x=r*this.a,n.y=s*this.a,n}function E7(n){n.x/=this.a,n.y/=this.a;var t={x:n.x,y:n.y},e,i,r;r=1/(this.pn1-n.y*this.sw),e=this.pn1*n.x*r,i=this.pn1*n.y*this.cw*r,n.x=e*this.cg+i*this.sg,n.y=i*this.cg-e*this.sg;var s=Di(n.x,n.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,t=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function R7(n){var t=n.x,e=n.y,i,r,s,a;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var o=this.radius_p/Di(this.radius_p*Math.cos(e),Math.sin(e));if(r=o*Math.cos(t)*Math.cos(e),s=o*Math.sin(t)*Math.cos(e),a=o*Math.sin(e),(this.radius_g-r)*r-s*s-a*a*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;i=this.radius_g-r,this.flip_axis?(n.x=this.radius_g_1*Math.atan(s/Di(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(s/i),n.y=this.radius_g_1*Math.atan(a/Di(s,i)))}else this.shape==="sphere"&&(i=Math.cos(e),r=Math.cos(t)*i,s=Math.sin(t)*i,a=Math.sin(e),i=this.radius_g-r,this.flip_axis?(n.x=this.radius_g_1*Math.atan(s/Di(a,i)),n.y=this.radius_g_1*Math.atan(a/i)):(n.x=this.radius_g_1*Math.atan(s/i),n.y=this.radius_g_1*Math.atan(a/Di(s,i))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function P7(n){var t=-1,e=0,i=0,r,s,a,o;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),e=Math.tan(n.x/this.radius_g_1)*Di(1,i)):(e=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Di(1,e));var l=i/this.radius_p;if(r=e*e+l*l+t*t,s=2*this.radius_g*t,a=s*s-4*r*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-s-Math.sqrt(a))/(2*r),t=this.radius_g+o*t,e*=o,i*=o,n.x=Math.atan2(e,t),n.y=Math.atan(i*Math.cos(n.x)/t),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),e=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+i*i)):(e=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+e*e)),r=e*e+i*i+t*t,s=2*this.radius_g*t,a=s*s-4*r*this.C,a<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-s-Math.sqrt(a))/(2*r),t=this.radius_g+o*t,e*=o,i*=o,n.x=Math.atan2(e,t),n.y=Math.atan(i*Math.cos(n.x)/t)}return n.x=n.x+this.long0,n}var I7=["Geostationary Satellite View","Geostationary_Satellite","geos"];const L7={init:C7,forward:R7,inverse:P7,names:I7};var Iu=1.340264,Lu=-.081106,Du=893e-6,Nu=.003796,A0=Math.sqrt(3)/2;function D7(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function N7(n){var t=Jt(n.x-this.long0),e=n.y,i=Math.asin(A0*Math.sin(e)),r=i*i,s=r*r*r;return n.x=t*Math.cos(i)/(A0*(Iu+3*Lu*r+s*(7*Du+9*Nu*r))),n.y=i*(Iu+Lu*r+s*(Du+Nu*r)),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function O7(n){n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a;var t=1e-9,e=12,i=n.y,r,s,a,o,l,c;for(c=0;c=Lt?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=G7,this.forward=H7)}function z7(n){var t=Jt(n.x-(this.long0||0)),e=n.y,i,r,s;return i=this.am1+this.m1-mh(e,r=Math.sin(e),s=Math.cos(e),this.en),r=s*t/(i*Math.sqrt(1-this.es*r*r)),n.x=i*Math.sin(r),n.y=this.am1-i*Math.cos(r),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function B7(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i,r;if(e=Di(n.x,n.y=this.am1-n.y),r=iM(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(r))hf?(n.x=r*Math.sin(i=t*Math.cos(e)/r),n.y=this.cphi1-r*Math.cos(i)):n.x=n.y=0,n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function G7(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var t,e,i=Di(n.x,n.y=this.cphi1-n.y);if(e=this.cphi1+this.phi1-i,Math.abs(e)>Lt)throw new Error;return Math.abs(Math.abs(e)-Lt)<=hf?t=0:t=i*Math.atan2(n.x,n.y)/Math.cos(e),n.x=Jt(t+(this.long0||0)),n.y=no(e),n}var V7=["bonne","Bonne (Werner lat_1=90)"];const W7={init:k7,names:V7};function j7(n){n.Proj.projections.add(Nm),n.Proj.projections.add(Om),n.Proj.projections.add(zG),n.Proj.projections.add(YG),n.Proj.projections.add(eV),n.Proj.projections.add(aV),n.Proj.projections.add(fV),n.Proj.projections.add(yV),n.Proj.projections.add(wV),n.Proj.projections.add(TV),n.Proj.projections.add(WV),n.Proj.projections.add(ZV),n.Proj.projections.add(e9),n.Proj.projections.add(o9),n.Proj.projections.add(f9),n.Proj.projections.add(y9),n.Proj.projections.add(w9),n.Proj.projections.add(T9),n.Proj.projections.add(D9),n.Proj.projections.add(k9),n.Proj.projections.add(V9),n.Proj.projections.add($9),n.Proj.projections.add(Q9),n.Proj.projections.add(r7),n.Proj.projections.add(c7),n.Proj.projections.add(y7),n.Proj.projections.add(w7),n.Proj.projections.add(T7),n.Proj.projections.add(L7),n.Proj.projections.add(U7),n.Proj.projections.add(W7)}Mr.defaultDatum="WGS84";Mr.Proj=bs;Mr.WGS84=new Mr.Proj("WGS84");Mr.Point=Jc;Mr.toPoint=HR;Mr.defs=xi;Mr.nadgrid=HH;Mr.transform=b0;Mr.mgrs=iG;Mr.version="__VERSION__";j7(Mr);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const X7=4,rA=0,sA=1,q7=2;function gh(n){let t=n.length;for(;--t>=0;)n[t]=0}const $7=0,QR=1,Y7=2,Z7=3,K7=258,oM=29,Zf=256,uf=Zf+1+oM,Uc=30,lM=19,t3=2*uf+1,Bo=15,n_=16,J7=7,cM=256,e3=16,n3=17,i3=18,cv=new Uint8Array([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]),Fm=new Uint8Array([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]),Q7=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),r3=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tW=512,Ys=new Array((uf+2)*2);gh(Ys);const Ou=new Array(Uc*2);gh(Ou);const ff=new Array(tW);gh(ff);const df=new Array(K7-Z7+1);gh(df);const hM=new Array(oM);gh(hM);const T0=new Array(Uc);gh(T0);function i_(n,t,e,i,r){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let s3,a3,o3;function r_(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const l3=n=>n<256?ff[n]:ff[256+(n>>>7)],pf=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},Oi=(n,t,e)=>{n.bi_valid>n_-e?(n.bi_buf|=t<>n_-n.bi_valid,n.bi_valid+=e-n_):(n.bi_buf|=t<{Oi(n,e[t*2],e[t*2+1])},c3=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},eW=n=>{n.bi_valid===16?(pf(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},nW=(n,t)=>{const e=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,h,u,p,m,g,_=0;for(p=0;p<=Bo;p++)n.bl_count[p]=0;for(e[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;cl&&(p=l,_++),e[h*2+1]=p,!(h>i)&&(n.bl_count[p]++,m=0,h>=o&&(m=a[h-o]),g=e[h*2],n.opt_len+=g*(p+m),s&&(n.static_len+=g*(r[h*2+1]+m)));if(_!==0){do{for(p=l-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[l]--,_-=2}while(_>0);for(p=l;p!==0;p--)for(h=n.bl_count[p];h!==0;)u=n.heap[--c],!(u>i)&&(e[u*2+1]!==p&&(n.opt_len+=(p-e[u*2+1])*e[u*2],e[u*2+1]=p),h--)}},h3=(n,t,e)=>{const i=new Array(Bo+1);let r=0,s,a;for(s=1;s<=Bo;s++)r=r+e[s-1]<<1,i[s]=r;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=c3(i[o]++,o))}},iW=()=>{let n,t,e,i,r;const s=new Array(Bo+1);for(e=0,i=0;i>=7;i{let t;for(t=0;t{n.bi_valid>8?pf(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},aA=(n,t,e,i)=>{const r=t*2,s=e*2;return n[r]{const i=n.heap[e];let r=e<<1;for(;r<=n.heap_len&&(r{let i,r,s=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+s++]&255,i+=(n.pending_buf[n.sym_buf+s++]&255)<<8,r=n.pending_buf[n.sym_buf+s++],i===0?ms(n,r,t):(a=df[r],ms(n,a+Zf+1,t),o=cv[a],o!==0&&(r-=hM[a],Oi(n,r,o)),i--,a=l3(i),ms(n,a,e),o=Fm[a],o!==0&&(i-=T0[a],Oi(n,i,o)));while(s{const e=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,l=-1,c;for(n.heap_len=0,n.heap_max=t3,a=0;a>1;a>=1;a--)s_(n,e,a);c=s;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],s_(n,e,1),o=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=o,e[c*2]=e[a*2]+e[o*2],n.depth[c]=(n.depth[a]>=n.depth[o]?n.depth[a]:n.depth[o])+1,e[a*2+1]=e[o*2+1]=c,n.heap[1]=c++,s_(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],nW(n,t),h3(e,l,n.bl_count)},lA=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(e+1)*2+1]=65535,i=0;i<=e;i++)s=a,a=t[(i+1)*2+1],!(++o{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=e;i++)if(s=a,a=t[(i+1)*2+1],!(++o{let t;for(lA(n,n.dyn_ltree,n.l_desc.max_code),lA(n,n.dyn_dtree,n.d_desc.max_code),hv(n,n.bl_desc),t=lM-1;t>=3&&n.bl_tree[r3[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},sW=(n,t,e,i)=>{let r;for(Oi(n,t-257,5),Oi(n,e-1,5),Oi(n,i-4,4),r=0;r{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return rA;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return sA;for(e=32;e{hA||(iW(),hA=!0),n.l_desc=new r_(n.dyn_ltree,s3),n.d_desc=new r_(n.dyn_dtree,a3),n.bl_desc=new r_(n.bl_tree,o3),n.bi_buf=0,n.bi_valid=0,u3(n)},d3=(n,t,e,i)=>{Oi(n,($7<<1)+(i?1:0),3),f3(n),pf(n,e),pf(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},lW=n=>{Oi(n,QR<<1,3),ms(n,cM,Ys),eW(n)},cW=(n,t,e,i)=>{let r,s,a=0;n.level>0?(n.strm.data_type===q7&&(n.strm.data_type=aW(n)),hv(n,n.l_desc),hv(n,n.d_desc),a=rW(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=e+5,e+4<=r&&t!==-1?d3(n,t,e,i):n.strategy===X7||s===r?(Oi(n,(QR<<1)+(i?1:0),3),oA(n,Ys,Ou)):(Oi(n,(Y7<<1)+(i?1:0),3),sW(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),oA(n,n.dyn_ltree,n.dyn_dtree)),u3(n),i&&f3(n)},hW=(n,t,e)=>(n.pending_buf[n.sym_buf+n.sym_next++]=t,n.pending_buf[n.sym_buf+n.sym_next++]=t>>8,n.pending_buf[n.sym_buf+n.sym_next++]=e,t===0?n.dyn_ltree[e*2]++:(n.matches++,t--,n.dyn_ltree[(df[e]+Zf+1)*2]++,n.dyn_dtree[l3(t)*2]++),n.sym_next===n.sym_end);var uW=oW,fW=d3,dW=cW,pW=hW,mW=lW,gW={_tr_init:uW,_tr_stored_block:fW,_tr_flush_block:dW,_tr_tally:pW,_tr_align:mW};const yW=(n,t,e,i)=>{let r=n&65535|0,s=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[i++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};var mf=yW;const xW=()=>{let n,t=[];for(var e=0;e<256;e++){n=e;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n}return t},_W=new Uint32Array(xW()),vW=(n,t,e,i)=>{const r=_W,s=i+e;n^=-1;for(let a=i;a>>8^r[(n^t[a])&255];return n^-1};var Vn=vW,th={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Kf={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:MW,_tr_stored_block:uv,_tr_flush_block:wW,_tr_tally:Ba,_tr_align:bW}=gW,{Z_NO_FLUSH:Ha,Z_PARTIAL_FLUSH:SW,Z_FULL_FLUSH:EW,Z_FINISH:mr,Z_BLOCK:uA,Z_OK:qn,Z_STREAM_END:fA,Z_STREAM_ERROR:Ss,Z_DATA_ERROR:AW,Z_BUF_ERROR:a_,Z_DEFAULT_COMPRESSION:TW,Z_FILTERED:CW,Z_HUFFMAN_ONLY:pm,Z_RLE:RW,Z_FIXED:PW,Z_DEFAULT_STRATEGY:IW,Z_UNKNOWN:LW,Z_DEFLATED:Sg}=Kf,DW=9,NW=15,OW=8,FW=29,UW=256,fv=UW+1+FW,kW=30,zW=19,BW=2*fv+1,HW=15,De=3,Oa=258,Es=Oa+De+1,GW=32,eh=42,uM=57,dv=69,pv=73,mv=91,gv=103,Ho=113,pu=666,Mi=1,yh=2,al=3,xh=4,VW=3,Go=(n,t)=>(n.msg=th[t],t),dA=n=>n*2-(n>4?9:0),Da=n=>{let t=n.length;for(;--t>=0;)n[t]=0},WW=n=>{let t,e,i,r=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=r?e-r:0;while(--t);t=r,i=t;do e=n.prev[--i],n.prev[i]=e>=r?e-r:0;while(--t)};let jW=(n,t,e)=>(t<{const t=n.state;let e=t.pending;e>n.avail_out&&(e=n.avail_out),e!==0&&(n.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),n.next_out),n.next_out+=e,t.pending_out+=e,n.total_out+=e,n.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},Qi=(n,t)=>{wW(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,Yi(n.strm)},He=(n,t)=>{n.pending_buf[n.pending++]=t},ru=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},yv=(n,t,e,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,t.set(n.input.subarray(n.next_in,n.next_in+r),e),n.state.wrap===1?n.adler=mf(n.adler,t,r,e):n.state.wrap===2&&(n.adler=Vn(n.adler,t,r,e)),n.next_in+=r,n.total_in+=r,r)},p3=(n,t)=>{let e=n.max_chain_length,i=n.strstart,r,s,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Es?n.strstart-(n.w_size-Es):0,c=n.window,h=n.w_mask,u=n.prev,p=n.strstart+Oa;let m=c[i+a-1],g=c[i+a];n.prev_length>=n.good_match&&(e>>=2),o>n.lookahead&&(o=n.lookahead);do if(r=t,!(c[r+a]!==g||c[r+a-1]!==m||c[r]!==c[i]||c[++r]!==c[i+1])){i+=2,r++;do;while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&ia){if(n.match_start=t,a=s,s>=o)break;m=c[i+a-1],g=c[i+a]}}while((t=u[t&h])>l&&--e!==0);return a<=n.lookahead?a:n.lookahead},nh=n=>{const t=n.w_size;let e,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-Es)&&(n.window.set(n.window.subarray(t,t+t-i),0),n.match_start-=t,n.strstart-=t,n.block_start-=t,n.insert>n.strstart&&(n.insert=n.strstart),WW(n),i+=t),n.strm.avail_in===0)break;if(e=yv(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=De)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=Ga(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=Ga(n,n.ins_h,n.window[r+De-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert{let e=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,s,a=0,o=n.strm.avail_in;do{if(i=65535,s=n.bi_valid+42>>3,n.strm.avail_outr+n.strm.avail_in&&(i=r+n.strm.avail_in),i>s&&(i=s),i>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,Yi(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(yv(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(a===0);return o-=n.strm.avail_in,o&&(o>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=o&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-o,n.strm.next_in),n.strstart),n.strstart+=o,n.insert+=o>n.w_size-n.insert?n.w_size-n.insert:o),n.block_start=n.strstart),n.high_waters&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,s+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),s>n.strm.avail_in&&(s=n.strm.avail_in),s&&(yv(n.strm,n.window,n.strstart,s),n.strstart+=s,n.insert+=s>n.w_size-n.insert?n.w_size-n.insert:s),n.high_water>3,s=n.pending_buf_size-s>65535?65535:n.pending_buf_size-s,e=s>n.w_size?n.w_size:s,r=n.strstart-n.block_start,(r>=e||(r||t===mr)&&t!==Ha&&n.strm.avail_in===0&&r<=s)&&(i=r>s?s:r,a=t===mr&&n.strm.avail_in===0&&i===r?1:0,uv(n,n.block_start,i,a),n.block_start+=i,Yi(n.strm)),a?al:Mi)},o_=(n,t)=>{let e,i;for(;;){if(n.lookahead=De&&(n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),e!==0&&n.strstart-e<=n.w_size-Es&&(n.match_length=p3(n,e)),n.match_length>=De)if(i=Ba(n,n.strstart-n.match_start,n.match_length-De),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=De){n.match_length--;do n.strstart++,n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+1]);else i=Ba(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(Qi(n,!1),n.strm.avail_out===0))return Mi}return n.insert=n.strstart{let e,i,r;for(;;){if(n.lookahead=De&&(n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=De-1,e!==0&&n.prev_length4096)&&(n.match_length=De-1)),n.prev_length>=De&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-De,i=Ba(n,n.strstart-1-n.prev_match,n.prev_length-De),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=Ga(n,n.ins_h,n.window[n.strstart+De-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=De-1,n.strstart++,i&&(Qi(n,!1),n.strm.avail_out===0))return Mi}else if(n.match_available){if(i=Ba(n,0,n.window[n.strstart-1]),i&&Qi(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return Mi}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=Ba(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart{let e,i,r,s;const a=n.window;for(;;){if(n.lookahead<=Oa){if(nh(n),n.lookahead<=Oa&&t===Ha)return Mi;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=De&&n.strstart>0&&(r=n.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){s=n.strstart+Oa;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&rn.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=De?(e=Ba(n,1,n.match_length-De),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=Ba(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(Qi(n,!1),n.strm.avail_out===0))return Mi}return n.insert=0,t===mr?(Qi(n,!0),n.strm.avail_out===0?al:xh):n.sym_next&&(Qi(n,!1),n.strm.avail_out===0)?Mi:yh},qW=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(nh(n),n.lookahead===0)){if(t===Ha)return Mi;break}if(n.match_length=0,e=Ba(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(Qi(n,!1),n.strm.avail_out===0))return Mi}return n.insert=0,t===mr?(Qi(n,!0),n.strm.avail_out===0?al:xh):n.sym_next&&(Qi(n,!1),n.strm.avail_out===0)?Mi:yh};function hs(n,t,e,i,r){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=r}const mu=[new hs(0,0,0,0,m3),new hs(4,4,8,4,o_),new hs(4,5,16,8,o_),new hs(4,6,32,32,o_),new hs(4,4,16,16,dc),new hs(8,16,32,32,dc),new hs(8,16,128,128,dc),new hs(8,32,128,256,dc),new hs(32,128,258,1024,dc),new hs(32,258,258,4096,dc)],$W=n=>{n.window_size=2*n.w_size,Da(n.head),n.max_lazy_match=mu[n.level].max_lazy,n.good_match=mu[n.level].good_length,n.nice_match=mu[n.level].nice_length,n.max_chain_length=mu[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=De-1,n.match_available=0,n.ins_h=0};function YW(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Sg,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(BW*2),this.dyn_dtree=new Uint16Array((2*kW+1)*2),this.bl_tree=new Uint16Array((2*zW+1)*2),Da(this.dyn_ltree),Da(this.dyn_dtree),Da(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(HW+1),this.heap=new Uint16Array(2*fv+1),Da(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*fv+1),Da(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Jf=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==eh&&t.status!==uM&&t.status!==dv&&t.status!==pv&&t.status!==mv&&t.status!==gv&&t.status!==Ho&&t.status!==pu?1:0},g3=n=>{if(Jf(n))return Go(n,Ss);n.total_in=n.total_out=0,n.data_type=LW;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?uM:t.wrap?eh:Ho,n.adler=t.wrap===2?0:1,t.last_flush=-2,MW(t),qn},y3=n=>{const t=g3(n);return t===qn&&$W(n.state),t},ZW=(n,t)=>Jf(n)||n.state.wrap!==2?Ss:(n.state.gzhead=t,qn),x3=(n,t,e,i,r,s)=>{if(!n)return Ss;let a=1;if(t===TW&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>DW||e!==Sg||i<8||i>15||t<0||t>9||s<0||s>PW||i===8&&a!==1)return Go(n,Ss);i===8&&(i=9);const o=new YW;return n.state=o,o.strm=n,o.status=eh,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<x3(n,t,Sg,NW,OW,IW),JW=(n,t)=>{if(Jf(n)||t>uA||t<0)return n?Go(n,Ss):Ss;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===pu&&t!==mr)return Go(n,n.avail_out===0?a_:Ss);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(Yi(n),n.avail_out===0)return e.last_flush=-1,qn}else if(n.avail_in===0&&dA(t)<=dA(i)&&t!==mr)return Go(n,a_);if(e.status===pu&&n.avail_in!==0)return Go(n,a_);if(e.status===eh&&e.wrap===0&&(e.status=Ho),e.status===eh){let r=Sg+(e.w_bits-8<<4)<<8,s=-1;if(e.strategy>=pm||e.level<2?s=0:e.level<6?s=1:e.level===6?s=2:s=3,r|=s<<6,e.strstart!==0&&(r|=GW),r+=31-r%31,ru(e,r),e.strstart!==0&&(ru(e,n.adler>>>16),ru(e,n.adler&65535)),n.adler=1,e.status=Ho,Yi(n),e.pending!==0)return e.last_flush=-1,qn}if(e.status===uM){if(n.adler=0,He(e,31),He(e,139),He(e,8),e.gzhead)He(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),He(e,e.gzhead.time&255),He(e,e.gzhead.time>>8&255),He(e,e.gzhead.time>>16&255),He(e,e.gzhead.time>>24&255),He(e,e.level===9?2:e.strategy>=pm||e.level<2?4:0),He(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(He(e,e.gzhead.extra.length&255),He(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=Vn(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=dv;else if(He(e,0),He(e,0),He(e,0),He(e,0),He(e,0),He(e,e.level===9?2:e.strategy>=pm||e.level<2?4:0),He(e,VW),e.status=Ho,Yi(n),e.pending!==0)return e.last_flush=-1,qn}if(e.status===dv){if(e.gzhead.extra){let r=e.pending,s=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+s>e.pending_buf_size;){let o=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=o,Yi(n),e.pending!==0)return e.last_flush=-1,qn;r=0,s-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending+=s,e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=pv}if(e.status===pv){if(e.gzhead.name){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),Yi(n),e.pending!==0)return e.last_flush=-1,qn;r=0}e.gzindexr&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=mv}if(e.status===mv){if(e.gzhead.comment){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r)),Yi(n),e.pending!==0)return e.last_flush=-1,qn;r=0}e.gzindexr&&(n.adler=Vn(n.adler,e.pending_buf,e.pending-r,r))}e.status=gv}if(e.status===gv){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(Yi(n),e.pending!==0))return e.last_flush=-1,qn;He(e,n.adler&255),He(e,n.adler>>8&255),n.adler=0}if(e.status=Ho,Yi(n),e.pending!==0)return e.last_flush=-1,qn}if(n.avail_in!==0||e.lookahead!==0||t!==Ha&&e.status!==pu){let r=e.level===0?m3(e,t):e.strategy===pm?qW(e,t):e.strategy===RW?XW(e,t):mu[e.level].func(e,t);if((r===al||r===xh)&&(e.status=pu),r===Mi||r===al)return n.avail_out===0&&(e.last_flush=-1),qn;if(r===yh&&(t===SW?bW(e):t!==uA&&(uv(e,0,0,!1),t===EW&&(Da(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),Yi(n),n.avail_out===0))return e.last_flush=-1,qn}return t!==mr?qn:e.wrap<=0?fA:(e.wrap===2?(He(e,n.adler&255),He(e,n.adler>>8&255),He(e,n.adler>>16&255),He(e,n.adler>>24&255),He(e,n.total_in&255),He(e,n.total_in>>8&255),He(e,n.total_in>>16&255),He(e,n.total_in>>24&255)):(ru(e,n.adler>>>16),ru(e,n.adler&65535)),Yi(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?qn:fA)},QW=n=>{if(Jf(n))return Ss;const t=n.state.status;return n.state=null,t===Ho?Go(n,AW):qn},tj=(n,t)=>{let e=t.length;if(Jf(n))return Ss;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==eh||i.lookahead)return Ss;if(r===1&&(n.adler=mf(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){r===0&&(Da(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(t.subarray(e-i.w_size,e),0),t=l,e=i.w_size}const s=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,nh(i);i.lookahead>=De;){let l=i.strstart,c=i.lookahead-(De-1);do i.ins_h=Ga(i,i.ins_h,i.window[l+De-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--c);i.strstart=l,i.lookahead=De-1,nh(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=De-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=s,i.wrap=r,qn};var ej=KW,nj=x3,ij=y3,rj=g3,sj=ZW,aj=JW,oj=QW,lj=tj,cj="pako deflate (from Nodeca project)",Fu={deflateInit:ej,deflateInit2:nj,deflateReset:ij,deflateResetKeep:rj,deflateSetHeader:sj,deflate:aj,deflateEnd:oj,deflateSetDictionary:lj,deflateInfo:cj};const hj=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var uj=function(n){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const i in e)hj(e,i)&&(n[i]=e[i])}}return n},fj=n=>{let t=0;for(let i=0,r=n.length;i=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;gf[254]=gf[254]=1;var dj=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,r,s,a=n.length,o=0;for(r=0;r>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};const pj=(n,t)=>{if(t<65534&&n.subarray&&_3)return String.fromCharCode.apply(null,n.length===t?n:n.subarray(0,t));let e="";for(let i=0;i{const e=t||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,t));let i,r;const s=new Array(e*2);for(r=0,i=0;i4){s[r++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return pj(s,r)},gj=(n,t)=>{t=t||n.length,t>n.length&&(t=n.length);let e=t-1;for(;e>=0&&(n[e]&192)===128;)e--;return e<0||e===0?t:e+gf[n[e]]>t?e:t},yf={string2buf:dj,buf2string:mj,utf8border:gj};function yj(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var v3=yj;const M3=Object.prototype.toString,{Z_NO_FLUSH:xj,Z_SYNC_FLUSH:_j,Z_FULL_FLUSH:vj,Z_FINISH:Mj,Z_OK:C0,Z_STREAM_END:wj,Z_DEFAULT_COMPRESSION:bj,Z_DEFAULT_STRATEGY:Sj,Z_DEFLATED:Ej}=Kf;function fM(n){this.options=Eg.assign({level:bj,method:Ej,chunkSize:16384,windowBits:15,memLevel:8,strategy:Sj},n||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v3,this.strm.avail_out=0;let e=Fu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==C0)throw new Error(th[e]);if(t.header&&Fu.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=yf.string2buf(t.dictionary):M3.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=Fu.deflateSetDictionary(this.strm,i),e!==C0)throw new Error(th[e]);this._dict_set=!0}}fM.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Mj:xj,typeof n=="string"?e.input=yf.string2buf(n):M3.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(s===_j||s===vj)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=Fu.deflate(e,s),r===wj)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=Fu.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===C0;if(e.avail_out===0){this.onData(e.output);continue}if(s>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};fM.prototype.onData=function(n){this.chunks.push(n)};fM.prototype.onEnd=function(n){n===C0&&(this.result=Eg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const mm=16209,Aj=16191;var Tj=function(t,e){let i,r,s,a,o,l,c,h,u,p,m,g,_,y,x,M,b,S,R,C,T,N,P,E;const L=t.state;i=t.next_in,P=t.input,r=i+(t.avail_in-5),s=t.next_out,E=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),l=L.dmax,c=L.wsize,h=L.whave,u=L.wnext,p=L.window,m=L.hold,g=L.bits,_=L.lencode,y=L.distcode,x=(1<>>24,m>>>=S,g-=S,S=b>>>16&255,S===0)E[s++]=b&65535;else if(S&16){R=b&65535,S&=15,S&&(g>>=S,g-=S),g<15&&(m+=P[i++]<>>24,m>>>=S,g-=S,S=b>>>16&255,S&16){if(C=b&65535,S&=15,gl){t.msg="invalid distance too far back",L.mode=mm;break t}if(m>>>=S,g-=S,S=s-a,C>S){if(S=C-S,S>h&&L.sane){t.msg="invalid distance too far back",L.mode=mm;break t}if(T=0,N=p,u===0){if(T+=c-S,S2;)E[s++]=N[T++],E[s++]=N[T++],E[s++]=N[T++],R-=3;R&&(E[s++]=N[T++],R>1&&(E[s++]=N[T++]))}else{T=s-C;do E[s++]=E[T++],E[s++]=E[T++],E[s++]=E[T++],R-=3;while(R>2);R&&(E[s++]=E[T++],R>1&&(E[s++]=E[T++]))}}else if(S&64){t.msg="invalid distance code",L.mode=mm;break t}else{b=y[(b&65535)+(m&(1<>3,i-=R,g-=R<<3,m&=(1<{const l=o.bits;let c=0,h=0,u=0,p=0,m=0,g=0,_=0,y=0,x=0,M=0,b,S,R,C,T,N=null,P;const E=new Uint16Array(pc+1),L=new Uint16Array(pc+1);let B=null,V,j,Y;for(c=0;c<=pc;c++)E[c]=0;for(h=0;h=1&&E[p]===0;p--);if(m>p&&(m=p),p===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(u=1;u0&&(n===gA||p!==1))return-1;for(L[1]=0,c=1;cpA||n===yA&&x>mA)return 1;for(;;){V=c-_,a[h]+1=P?(j=B[a[h]-P],Y=N[a[h]-P]):(j=96,Y=0),b=1<>_)+S]=V<<24|j<<16|Y|0;while(S!==0);for(b=1<>=1;if(b!==0?(M&=b-1,M+=b):M=0,h++,--E[c]===0){if(c===p)break;c=t[e+a[h]]}if(c>m&&(M&C)!==R){for(_===0&&(_=m),T+=u,g=c-_,y=1<pA||n===yA&&x>mA)return 1;R=M&C,r[R]=m<<24|g<<16|T-s|0}}return M!==0&&(r[T+M]=c-_<<24|64<<16|0),o.bits=m,0};var Uu=Lj;const Dj=0,w3=1,b3=2,{Z_FINISH:xA,Z_BLOCK:Nj,Z_TREES:gm,Z_OK:ol,Z_STREAM_END:Oj,Z_NEED_DICT:Fj,Z_STREAM_ERROR:wr,Z_DATA_ERROR:S3,Z_MEM_ERROR:E3,Z_BUF_ERROR:Uj,Z_DEFLATED:_A}=Kf,Ag=16180,vA=16181,MA=16182,wA=16183,bA=16184,SA=16185,EA=16186,AA=16187,TA=16188,CA=16189,R0=16190,Xs=16191,c_=16192,RA=16193,h_=16194,PA=16195,IA=16196,LA=16197,DA=16198,ym=16199,xm=16200,NA=16201,OA=16202,FA=16203,UA=16204,kA=16205,u_=16206,zA=16207,BA=16208,an=16209,A3=16210,T3=16211,kj=852,zj=592,Bj=15,Hj=Bj,HA=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function Gj(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ul=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.modeT3?1:0},C3=n=>{if(ul(n))return wr;const t=n.state;return n.total_in=n.total_out=t.total=0,n.msg="",t.wrap&&(n.adler=t.wrap&1),t.mode=Ag,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(kj),t.distcode=t.distdyn=new Int32Array(zj),t.sane=1,t.back=-1,ol},R3=n=>{if(ul(n))return wr;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,C3(n)},P3=(n,t)=>{let e;if(ul(n))return wr;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?wr:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,R3(n))},I3=(n,t)=>{if(!n)return wr;const e=new Gj;n.state=e,e.strm=n,e.window=null,e.mode=Ag;const i=P3(n,t);return i!==ol&&(n.state=null),i},Vj=n=>I3(n,Hj);let GA=!0,f_,d_;const Wj=n=>{if(GA){f_=new Int32Array(512),d_=new Int32Array(32);let t=0;for(;t<144;)n.lens[t++]=8;for(;t<256;)n.lens[t++]=9;for(;t<280;)n.lens[t++]=7;for(;t<288;)n.lens[t++]=8;for(Uu(w3,n.lens,0,288,f_,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Uu(b3,n.lens,0,32,d_,0,n.work,{bits:5}),GA=!1}n.lencode=f_,n.lenbits=9,n.distcode=d_,n.distbits=5},L3=(n,t,e,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(e-s.wsize,e),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(t.subarray(e-i,e-i+r),s.wnext),i-=r,i?(s.window.set(t.subarray(e-i,e),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave{let e,i,r,s,a,o,l,c,h,u,p,m,g,_,y=0,x,M,b,S,R,C,T,N;const P=new Uint8Array(4);let E,L;const B=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ul(n)||!n.output||!n.input&&n.avail_in!==0)return wr;e=n.state,e.mode===Xs&&(e.mode=c_),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,u=o,p=l,N=ol;t:for(;;)switch(e.mode){case Ag:if(e.wrap===0){e.mode=c_;break}for(;h<16;){if(o===0)break t;o--,c+=i[s++]<>>8&255,e.check=Vn(e.check,P,2,0),c=0,h=0,e.mode=vA;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",e.mode=an;break}if((c&15)!==_A){n.msg="unknown compression method",e.mode=an;break}if(c>>>=4,h-=4,T=(c&15)+8,e.wbits===0&&(e.wbits=T),T>15||T>e.wbits){n.msg="invalid window size",e.mode=an;break}e.dmax=1<>8&1),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Vn(e.check,P,2,0)),c=0,h=0,e.mode=MA;case MA:for(;h<32;){if(o===0)break t;o--,c+=i[s++]<>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,e.check=Vn(e.check,P,4,0)),c=0,h=0,e.mode=wA;case wA:for(;h<16;){if(o===0)break t;o--,c+=i[s++]<>8),e.flags&512&&e.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,e.check=Vn(e.check,P,2,0)),c=0,h=0,e.mode=bA;case bA:if(e.flags&1024){for(;h<16;){if(o===0)break t;o--,c+=i[s++]<>>8&255,e.check=Vn(e.check,P,2,0)),c=0,h=0}else e.head&&(e.head.extra=null);e.mode=SA;case SA:if(e.flags&1024&&(m=e.length,m>o&&(m=o),m&&(e.head&&(T=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(s,s+m),T)),e.flags&512&&e.wrap&4&&(e.check=Vn(e.check,i,m,s)),o-=m,s+=m,e.length-=m),e.length))break t;e.length=0,e.mode=EA;case EA:if(e.flags&2048){if(o===0)break t;m=0;do T=i[s+m++],e.head&&T&&e.length<65536&&(e.head.name+=String.fromCharCode(T));while(T&&m>9&1,e.head.done=!0),n.adler=e.check=0,e.mode=Xs;break;case CA:for(;h<32;){if(o===0)break t;o--,c+=i[s++]<>>=h&7,h-=h&7,e.mode=u_;break}for(;h<3;){if(o===0)break t;o--,c+=i[s++]<>>=1,h-=1,c&3){case 0:e.mode=RA;break;case 1:if(Wj(e),e.mode=ym,t===gm){c>>>=2,h-=2;break t}break;case 2:e.mode=IA;break;case 3:n.msg="invalid block type",e.mode=an}c>>>=2,h-=2;break;case RA:for(c>>>=h&7,h-=h&7;h<32;){if(o===0)break t;o--,c+=i[s++]<>>16^65535)){n.msg="invalid stored block lengths",e.mode=an;break}if(e.length=c&65535,c=0,h=0,e.mode=h_,t===gm)break t;case h_:e.mode=PA;case PA:if(m=e.length,m){if(m>o&&(m=o),m>l&&(m=l),m===0)break t;r.set(i.subarray(s,s+m),a),o-=m,s+=m,l-=m,a+=m,e.length-=m;break}e.mode=Xs;break;case IA:for(;h<14;){if(o===0)break t;o--,c+=i[s++]<>>=5,h-=5,e.ndist=(c&31)+1,c>>>=5,h-=5,e.ncode=(c&15)+4,c>>>=4,h-=4,e.nlen>286||e.ndist>30){n.msg="too many length or distance symbols",e.mode=an;break}e.have=0,e.mode=LA;case LA:for(;e.have>>=3,h-=3}for(;e.have<19;)e.lens[B[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,E={bits:e.lenbits},N=Uu(Dj,e.lens,0,19,e.lencode,0,e.work,E),e.lenbits=E.bits,N){n.msg="invalid code lengths set",e.mode=an;break}e.have=0,e.mode=DA;case DA:for(;e.have>>24,M=y>>>16&255,b=y&65535,!(x<=h);){if(o===0)break t;o--,c+=i[s++]<>>=x,h-=x,e.lens[e.have++]=b;else{if(b===16){for(L=x+2;h>>=x,h-=x,e.have===0){n.msg="invalid bit length repeat",e.mode=an;break}T=e.lens[e.have-1],m=3+(c&3),c>>>=2,h-=2}else if(b===17){for(L=x+3;h>>=x,h-=x,T=0,m=3+(c&7),c>>>=3,h-=3}else{for(L=x+7;h>>=x,h-=x,T=0,m=11+(c&127),c>>>=7,h-=7}if(e.have+m>e.nlen+e.ndist){n.msg="invalid bit length repeat",e.mode=an;break}for(;m--;)e.lens[e.have++]=T}}if(e.mode===an)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=an;break}if(e.lenbits=9,E={bits:e.lenbits},N=Uu(w3,e.lens,0,e.nlen,e.lencode,0,e.work,E),e.lenbits=E.bits,N){n.msg="invalid literal/lengths set",e.mode=an;break}if(e.distbits=6,e.distcode=e.distdyn,E={bits:e.distbits},N=Uu(b3,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,E),e.distbits=E.bits,N){n.msg="invalid distances set",e.mode=an;break}if(e.mode=ym,t===gm)break t;case ym:e.mode=xm;case xm:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=h,Tj(n,p),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,h=e.bits,e.mode===Xs&&(e.back=-1);break}for(e.back=0;y=e.lencode[c&(1<>>24,M=y>>>16&255,b=y&65535,!(x<=h);){if(o===0)break t;o--,c+=i[s++]<>S)],x=y>>>24,M=y>>>16&255,b=y&65535,!(S+x<=h);){if(o===0)break t;o--,c+=i[s++]<>>=S,h-=S,e.back+=S}if(c>>>=x,h-=x,e.back+=x,e.length=b,M===0){e.mode=kA;break}if(M&32){e.back=-1,e.mode=Xs;break}if(M&64){n.msg="invalid literal/length code",e.mode=an;break}e.extra=M&15,e.mode=NA;case NA:if(e.extra){for(L=e.extra;h>>=e.extra,h-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=OA;case OA:for(;y=e.distcode[c&(1<>>24,M=y>>>16&255,b=y&65535,!(x<=h);){if(o===0)break t;o--,c+=i[s++]<>S)],x=y>>>24,M=y>>>16&255,b=y&65535,!(S+x<=h);){if(o===0)break t;o--,c+=i[s++]<>>=S,h-=S,e.back+=S}if(c>>>=x,h-=x,e.back+=x,M&64){n.msg="invalid distance code",e.mode=an;break}e.offset=b,e.extra=M&15,e.mode=FA;case FA:if(e.extra){for(L=e.extra;h>>=e.extra,h-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){n.msg="invalid distance too far back",e.mode=an;break}e.mode=UA;case UA:if(l===0)break t;if(m=p-l,e.offset>m){if(m=e.offset-m,m>e.whave&&e.sane){n.msg="invalid distance too far back",e.mode=an;break}m>e.wnext?(m-=e.wnext,g=e.wsize-m):g=e.wnext-m,m>e.length&&(m=e.length),_=e.window}else _=r,g=a-e.offset,m=e.length;m>l&&(m=l),l-=m,e.length-=m;do r[a++]=_[g++];while(--m);e.length===0&&(e.mode=xm);break;case kA:if(l===0)break t;r[a++]=e.length,l--,e.mode=xm;break;case u_:if(e.wrap){for(;h<32;){if(o===0)break t;o--,c|=i[s++]<{if(ul(n))return wr;let t=n.state;return t.window&&(t.window=null),n.state=null,ol},qj=(n,t)=>{if(ul(n))return wr;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,ol):wr},$j=(n,t)=>{const e=t.length;let i,r,s;return ul(n)||(i=n.state,i.wrap!==0&&i.mode!==R0)?wr:i.mode===R0&&(r=1,r=mf(r,t,e,0),r!==i.check)?S3:(s=L3(n,t,e,e),s?(i.mode=A3,E3):(i.havedict=1,ol))};var Yj=R3,Zj=P3,Kj=C3,Jj=Vj,Qj=I3,tX=jj,eX=Xj,nX=qj,iX=$j,rX="pako inflate (from Nodeca project)",Zs={inflateReset:Yj,inflateReset2:Zj,inflateResetKeep:Kj,inflateInit:Jj,inflateInit2:Qj,inflate:tX,inflateEnd:eX,inflateGetHeader:nX,inflateSetDictionary:iX,inflateInfo:rX};function sX(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var aX=sX;const D3=Object.prototype.toString,{Z_NO_FLUSH:oX,Z_FINISH:lX,Z_OK:xf,Z_STREAM_END:p_,Z_NEED_DICT:m_,Z_STREAM_ERROR:cX,Z_DATA_ERROR:VA,Z_MEM_ERROR:hX}=Kf;function Qf(n){this.options=Eg.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(n&&n.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v3,this.strm.avail_out=0;let e=Zs.inflateInit2(this.strm,t.windowBits);if(e!==xf)throw new Error(th[e]);if(this.header=new aX,Zs.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=yf.string2buf(t.dictionary):D3.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=Zs.inflateSetDictionary(this.strm,t.dictionary),e!==xf)))throw new Error(th[e])}Qf.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?lX:oX,D3.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),s=Zs.inflate(e,a),s===m_&&r&&(s=Zs.inflateSetDictionary(e,r),s===xf?s=Zs.inflate(e,a):s===VA&&(s=m_));e.avail_in>0&&s===p_&&e.state.wrap>0&&n[e.next_in]!==0;)Zs.inflateReset(e),s=Zs.inflate(e,a);switch(s){case cX:case VA:case m_:case hX:return this.onEnd(s),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||s===p_))if(this.options.to==="string"){let l=yf.utf8border(e.output,e.next_out),c=e.next_out-l,h=yf.buf2string(e.output,l);e.next_out=c,e.avail_out=i-c,c&&e.output.set(e.output.subarray(l,l+c),0),this.onData(h)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(s===xf&&o===0)){if(s===p_)return s=Zs.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};Qf.prototype.onData=function(n){this.chunks.push(n)};Qf.prototype.onEnd=function(n){n===xf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Eg.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function dM(n,t){const e=new Qf(t);if(e.push(n),e.err)throw e.msg||th[e.err];return e.result}function uX(n,t){return t=t||{},t.raw=!0,dM(n,t)}var fX=Qf,dX=dM,pX=uX,mX=dM,gX=Kf,yX={Inflate:fX,inflate:dX,inflateRaw:pX,ungzip:mX,constants:gX};const{Inflate:SY,inflate:xX,inflateRaw:EY,ungzip:AY}=yX;var TY=xX;const g_=new WeakMap;class _X extends di{constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,i,r){const s=new nr(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,a=>{this.parse(a,e,r)},i,r)}parse(t,e,i=()=>{}){this.decodeDracoFile(t,e,null,null,Tn,i).catch(i)}decodeDracoFile(t,e,i,r,s=Dn,a=()=>{}){const o={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:s};return this.decodeGeometry(t,o).then(e).catch(a)}decodeGeometry(t,e){const i=JSON.stringify(e);if(g_.has(t)){const l=g_.get(t);if(l.key===i)return l.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,a=t.byteLength,o=this._getWorker(s,a).then(l=>(r=l,new Promise((c,h)=>{r._callbacks[s]={resolve:c,reject:h},r.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),g_.set(t,{key:i,promise:o}),o}_createGeometry(t){const e=new ve;t.index&&e.setIndex(new Pe(t.index.array,1));for(let i=0;i{i.load(t,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then(i=>{const r=i[0];t||(this.decoderConfig.wasmBinary=i[1]);const s=vX.toString(),a=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[t]=e,i._taskLoad+=e,i})}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t{const u=h.draco,p=new u.Decoder;try{const m=e(u,p,new Int8Array(l),c),g=m.attributes.map(_=>_.array.buffer);m.index&&g.push(m.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:m},g)}catch(m){console.error(m),self.postMessage({type:"error",id:o.id,error:m.message})}finally{u.destroy(p)}});break}};function e(a,o,l,c){const h=c.attributeIDs,u=c.attributeTypes;let p,m;const g=o.GetEncodedGeometryType(l);if(g===a.TRIANGULAR_MESH)p=new a.Mesh,m=o.DecodeArrayToMesh(l,l.byteLength,p);else if(g===a.POINT_CLOUD)p=new a.PointCloud,m=o.DecodeArrayToPointCloud(l,l.byteLength,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const _={index:null,attributes:[]};for(const y in h){const x=self[u[y]];let M,b;if(c.useUniqueIDs)b=h[y],M=o.GetAttributeByUniqueId(p,b);else{if(b=o.GetAttributeId(p,a[h[y]]),b===-1)continue;M=o.GetAttribute(p,b)}const S=r(a,o,p,y,x,M);y==="color"&&(S.vertexColorSpace=c.vertexColorSpace),_.attributes.push(S)}return g===a.TRIANGULAR_MESH&&(_.index=i(a,o,p)),a.destroy(p),_}function i(a,o,l){const h=l.num_faces()*3,u=h*4,p=a._malloc(u);o.GetTrianglesUInt32Array(l,u,p);const m=new Uint32Array(a.HEAPF32.buffer,p,h).slice();return a._free(p),{array:m,itemSize:1}}function r(a,o,l,c,h,u){const p=u.num_components(),g=l.num_points()*p,_=g*h.BYTES_PER_ELEMENT,y=s(a,h),x=a._malloc(_);o.GetAttributeDataArrayForAllPoints(l,u,y,_,x);const M=new h(a.HEAPF32.buffer,x,g).slice();return a._free(x),{name:c,array:M,itemSize:p}}function s(a,o){switch(o){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class MX extends di{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new AX(e)}),this.register(function(e){return new TX(e)}),this.register(function(e){return new FX(e)}),this.register(function(e){return new UX(e)}),this.register(function(e){return new kX(e)}),this.register(function(e){return new RX(e)}),this.register(function(e){return new PX(e)}),this.register(function(e){return new IX(e)}),this.register(function(e){return new LX(e)}),this.register(function(e){return new EX(e)}),this.register(function(e){return new DX(e)}),this.register(function(e){return new CX(e)}),this.register(function(e){return new OX(e)}),this.register(function(e){return new NX(e)}),this.register(function(e){return new bX(e)}),this.register(function(e){return new zX(e)}),this.register(function(e){return new BX(e)})}load(t,e,i,r){const s=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Ua.extractUrlBase(t);a=Ua.resolveURL(c,this.path)}else a=Ua.extractUrlBase(t);this.manager.itemStart(t);const o=function(c){r?r(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},l=new nr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(t,function(c){try{s.parse(c,a,function(h){e(h),s.manager.itemEnd(t)},o)}catch(h){o(h)}},i,o)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,r){let s;const a={},o={},l=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(l.decode(new Uint8Array(t,0,4))===N3){try{a[Le.KHR_BINARY_GLTF]=new HX(t)}catch(u){r&&r(u);return}s=JSON.parse(a[Le.KHR_BINARY_GLTF].content)}else s=JSON.parse(l.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new tq(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(a),c.setPlugins(o),c.parse(i,r)}parseAsync(t,e){const i=this;return new Promise(function(r,s){i.parse(t,e,r,s)})}}function wX(){let n={};return{get:function(t){return n[t]},add:function(t,e){n[t]=e},remove:function(t){delete n[t]},removeAll:function(){n={}}}}const Le={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class bX{constructor(t){this.parser=t,this.name=Le.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,r=e.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,a)}}class UX{constructor(t){this.parser=t,this.name=Le.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,r=i.json,s=r.textures[t];if(!s.extensions||!s.extensions[e])return null;const a=s.extensions[e],o=r.images[a.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,a.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class kX{constructor(t){this.parser=t,this.name=Le.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,r=i.json,s=r.textures[t];if(!s.extensions||!s.extensions[e])return null;const a=s.extensions[e],o=r.images[a.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,a.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class zX{constructor(t){this.name=Le.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(o){const l=r.byteOffset||0,c=r.byteLength||0,h=r.count,u=r.byteStride,p=new Uint8Array(o,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,p,r.mode,r.filter).then(function(m){return m.buffer}):a.ready.then(function(){const m=new ArrayBuffer(h*u);return a.decodeGltfBuffer(new Uint8Array(m),h,u,p,r.mode,r.filter),m})})}else return null}}class BX{constructor(t){this.name=Le.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=e.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==pr.TRIANGLES&&c.mode!==pr.TRIANGLE_STRIP&&c.mode!==pr.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=i.extensions[this.name].attributes,o=[],l={};for(const c in a)o.push(this.parser.getDependency("accessor",a[c]).then(h=>(l[c]=h,l[c])));return o.length<1?null:(o.push(this.parser.createNodeMesh(t)),Promise.all(o).then(c=>{const h=c.pop(),u=h.isGroup?h.children:[h],p=c[0].count,m=[];for(const g of u){const _=new de,y=new U,x=new Cn,M=new U(1,1,1),b=new u1(g.geometry,g.material,p);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const QX=new de;class tq{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new wX,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=-1,s=!1,a=-1;if(typeof navigator<"u"){const o=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(o)===!0;const l=o.match(/Version\/(\d+)/);r=i&&l?parseInt(l[1],10):-1,s=o.indexOf("Firefox")>-1,a=s?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&r<17||s&&a<98?this.textureLoader=new S1(this.options.manager):this.textureLoader=new YC(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new nr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(a){const o={scene:a[0][r.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:r.asset,parser:i,userData:{}};return Co(s,o,r),qs(o,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();t(o)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=e.length;r{const l=this.associations.get(a);l!=null&&this.associations.set(o,l);for(const[c,h]of a.children.entries())s(h,o.children[c])};return s(i,r),r.name+="_instance_"+t.uses[e]++,r}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i=2&&y.setY(P,C[T*l+1]),l>=3&&y.setZ(P,C[T*l+2]),l>=4&&y.setW(P,C[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,a=e.images[s];let o=this.textureLoader;if(a.uri){const l=i.manager.getHandler(a.uri);l!==null&&(o=l)}return this.loadTextureImage(t,s,o)}loadTextureImage(t,e,i){const r=this,s=this.json,a=s.textures[t],o=s.images[e],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(e,i).then(function(h){h.flipY=!1,h.name=a.name||o.name||"",h.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(h.name=o.uri);const p=(s.samplers||{})[a.sampler]||{};return h.magFilter=jA[p.magFilter]||mn,h.minFilter=jA[p.minFilter]||gr,h.wrapS=XA[p.wrapS]||Wa,h.wrapT=XA[p.wrapT]||Wa,r.associations.set(h,{textures:t}),h}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(t,e){const i=this,r=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());const a=r.images[t],o=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=i.getDependency("bufferView",a.bufferView).then(function(u){c=!0;const p=new Blob([u],{type:a.mimeType});return l=o.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const h=Promise.resolve(l).then(function(u){return new Promise(function(p,m){let g=p;e.isImageBitmapLoader===!0&&(g=function(_){const y=new Mn(_);y.needsUpdate=!0,p(y)}),e.load(Ua.resolveURL(u,s.path),g,void 0,m)})}).then(function(u){return c===!0&&o.revokeObjectURL(l),qs(u,a),u.userData.mimeType=a.mimeType||JX(a.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),u});return this.sourceCache[t]=h,h}assignTexture(t,e,i,r){const s=this;return this.getDependency("texture",i.index).then(function(a){if(!a)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(a=a.clone(),a.channel=i.texCoord),s.extensions[Le.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[Le.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=s.associations.get(a);a=s.extensions[Le.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),s.associations.set(a,l)}}return r!==void 0&&(a.colorSpace=r),t[e]=a,a})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const r=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,a=e.attributes.normal===void 0;if(t.isPoints){const o="PointsMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new Of,Rn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(o,l)),i=l}else if(t.isLine){const o="LineBasicMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new Kn,Rn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(o,l)),i=l}if(r||s||a){let o="ClonedMaterial:"+i.uuid+":";r&&(o+="derivative-tangents:"),s&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=i.clone(),s&&(l.vertexColors=!0),a&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(i))),i=l}t.material=i}getMaterialType(){return uh}loadMaterial(t){const e=this,i=this.json,r=this.extensions,s=i.materials[t];let a;const o={},l=s.extensions||{},c=[];if(l[Le.KHR_MATERIALS_UNLIT]){const u=r[Le.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),c.push(u.extendParams(o,s,e))}else{const u=s.pbrMetallicRoughness||{};if(o.color=new Ht(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const p=u.baseColorFactor;o.color.setRGB(p[0],p[1],p[2],Dn),o.opacity=p[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(o,"map",u.baseColorTexture,Tn)),o.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,o.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),c.push(e.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(t,o)})))}s.doubleSided===!0&&(o.side=hi);const h=s.alphaMode||x_.OPAQUE;if(h===x_.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===x_.MASK&&(o.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&a!==Ji&&(c.push(e.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new xt(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;o.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&a!==Ji&&(c.push(e.assignTexture(o,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&a!==Ji){const u=s.emissiveFactor;o.emissive=new Ht().setRGB(u[0],u[1],u[2],Dn)}return s.emissiveTexture!==void 0&&a!==Ji&&c.push(e.assignTexture(o,"emissiveMap",s.emissiveTexture,Tn)),Promise.all(c).then(function(){const u=new a(o);return s.name&&(u.name=s.name),qs(u,s),e.associations.set(u,{materials:t}),s.extensions&&Co(r,u,s),u})}createUniqueName(t){const e=Oe.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,r=this.primitiveCache;function s(o){return i[Le.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,e).then(function(l){return qA(l,o,e)})}const a=[];for(let o=0,l=t.length;o0&&ZX(x,s),x.name=e.createUniqueName(s.name||"mesh_"+t),qs(x,s),y.extensions&&Co(r,x,y),e.assignFinalMaterial(x),u.push(x)}for(let m=0,g=u.length;m1?h=new Qs:c.length===1?h=c[0]:h=new Ge,h!==c[0])for(let u=0,p=c.length;u{const u=new Map;for(const[p,m]of r.associations)(p instanceof Rn||p instanceof Mn)&&u.set(p,m);return h.traverse(p=>{const m=r.associations.get(p);m!=null&&u.set(p,m)}),u};return r.associations=c(s),s})}_createAnimationTracks(t,e,i,r,s){const a=[],o=t.name?t.name:t.uuid,l=[];Ia[s.path]===Ia.weights?t.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(o);let c;switch(Ia[s.path]){case Ia.weights:c=el;break;case Ia.rotation:c=nl;break;case Ia.position:case Ia.scale:c=il;break;default:switch(i.itemSize){case 1:c=el;break;case 2:case 3:default:c=il;break}break}const h=r.interpolation!==void 0?qX[r.interpolation]:Xc,u=this._getArrayFromAccessor(i);for(let p=0,m=l.length;psq(r));return(await Promise.all(e)).flat()}async function sq(n){const{tile:t,center:e}=n,i=`https://maps.heidler.info/germany-draco/15-${t.x}-${t.y}.glb`;try{const r=await U3.loadAsync(i);let s=[];for(let l of r.scenes)for(let c of l.children){let h=c.geometry;const u=new de;u.makeScale(1/8192,1/8192,1);const p=new de;p.makeTranslation(t.x-e.x,t.y-e.y,0);const m=new de;m.makeScale($A(),-$A(),1);const g=m;g.multiply(p),g.multiply(u),h.applyMatrix4(g),h=h.toNonIndexed();let _={};const y=h.attributes.position.array,x=h.attributes.normal.array,M=h.attributes._feature_id_0.array;for(let b=0;bp.name=`simulation-${m}`),h.forEach((p,m)=>p.name=`surrounding-${m}`),u.forEach((p,m)=>p.name=`background-${m}`),{simulation:c,surrounding:h,background:u}}function oq(n){return!n||!n.bbox||!n.data?(console.error("Invalid heightmap data, missing bbox or data"),null):{...n,data:new Float32Array(n.data)}}function lq(n,t,e,i){if(console.log("Processing vegetation data..."),!n||!n.data)return console.error("Invalid vegetation raster data"),{surrounding:[],background:[]};console.log("Vegetation raster dimensions:",n.width,"x",n.height),console.log("Vegetation raster bbox:",n.bbox);const r={surrounding:[],background:[]};n.bbox;const[s,a]=Bm,o=e*e,l=i*i,c=t.x||0,h=t.y||0;for(let u=0;u0){const g=n.bbox[0]+(n.bbox[2]-n.bbox[0])*(p/n.width),_=n.bbox[3]+(n.bbox[1]-n.bbox[3])*(u/n.height),y=(g-s)*P0(),x=(_-a)*P0();p%100+u%100==0&&console.log(y,x);const M=(y-c)*(y-c)+(x-h)*(x-h);if(M<=l){const b=cq(y,x,m);M<=o?r.surrounding.push(b):r.background.push(b)}}}return console.log("Vegetation processing complete."),console.log("Surrounding geometries:",r.surrounding.length),console.log("Background geometries:",r.background.length),r}function cq(n,t,e){const s=new Ka(1,1,20).toNonIndexed().deleteAttribute("uv");return s.translate(n,t,e-10),s}const z3=[0,0,.2],B3=[1,.2,.1],H3=[1,1,.1];async function hq(n){if(window.setAttribution)for(let t of Object.values(window.setAttribution))t(!1);if(typeof n<"u"&&n!=null){let s=function(l,c){return window.setSimulationProgress(l*100/c)};const t=await rq(n);let e=k3(t,new U(0,0,0),80);if(window.setGeometries(e),e.simulation.length==0)return window.setFrontendState("ErrorAdress"),{simulationMesh:void 0};const i=new PR(parseFloat(n.lat),parseFloat(n.lon));if(e.simulation.forEach(l=>{i.addSimulationGeometry(l),i.addShadingGeometry(l)}),e.surrounding.forEach(l=>{i.addShadingGeometry(l)}),i.addColorMap(Q1.interpolateThreeColors({c0:z3,c1:B3,c2:H3})),nq()=="BY"){const[l,c]=Bm;console.log("coordinatesWebMercator:"+Bm);const h=200,u=[l-h,c-h,l+h,c+h];console.log("Starting vegetation processing..."),console.log(`Bounding box for vegetation data: [${u.join(", ")}]`);try{console.log("Downloading vegetation heightmap data...");const p=await aq(u);if(!p)throw new Error("Failed to download vegetation heightmap data");console.log("Vegetation Heightmap Data downloaded successfully"),console.log(`Data dimensions: ${p.width}x${p.height}`),console.log(`Data bounding box: [${p.bbox.join(", ")}]`),console.log("Processing vegetation raster data...");const m=oq(p);if(!m)throw new Error("Failed to process vegetation raster data");console.log("Vegetation Raster processed successfully"),console.log("Processing vegetation geometries...");const g=lq(m,new U(0,0,0),30,80);console.log("Vegetation Geometries processed successfully"),console.log(`Number of surrounding geometries: ${g.surrounding.length}`),console.log(`Number of background geometries: ${g.background.length}`),window.setVegetationGeometries(g),console.log("Adding vegetation geometries to the scene..."),g.surrounding.forEach(_=>{i.addShadingGeometry(_)}),console.log("Vegetation geometries added to the scene")}catch(p){console.error("Error in vegetation processing:",p),console.error("Error stack:",p.stack)}console.log("Vegetation processing completed")}let r=window.numSimulations||80;const a=await i.calculate({numberSimulations:r,pvCellEfficiency:.138,maxYieldPerSquareMeter:1400*.138,diffuseIrradianceURL:"https://www.openpv.de/data/irradiance/",urlDirectIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_direct_radiation.tif",urlDiffuseIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_diffuse_radiation.tif",progressCallback:s});let o=new U;return a.geometry.computeBoundingBox(),a.geometry.boundingBox.getCenter(o),a.middle=o,{simulationMesh:a}}}async function uq(n){let t=IR(n.selectedMesh.map(m=>m.geometry));t.computeBoundingBox(),t.computeBoundingSphere();let e=new U;t.boundingBox.getCenter(e),console.log(n.geometries);const i=t.boundingSphere.radius+80,r=[...n.geometries.surrounding,...n.geometries.background,...n.geometries.simulation],s=k3(r,e,i),a=new PR(parseFloat(n.geoLocation.lat),parseFloat(n.geoLocation.lon));a.addColorMap(Q1.interpolateThreeColors({c0:z3,c1:B3,c2:H3})),a.addSimulationGeometry(t),s.surrounding.forEach(m=>{a.addShadingGeometry(m)});let o=window.numSimulations||80,l=await a.calculate({numberSimulations:o,pvCellEfficiency:.138,maxYieldPerSquareMeter:1400*.138,diffuseIrradianceURL:"https://www.openpv.de/data/irradiance/",urlDirectIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_direct_radiation.tif",urlDiffuseIrrandianceTIF:"https://www.openpv.de/data/irradiance/geotiff/average_diffuse_radiation.tif",progressCallback:(m,g)=>console.log("Simulation Progress is ",m)});const c=new zf({vertexColors:!0,side:hi});l.material=c,l.name="simulationMesh",n.setSimulationMeshes([...n.simulationMeshes,l]);const h=n.selectedMesh.map(m=>m.geometry.name),u=n.geometries.surrounding.filter(m=>!h.includes(m.name)),p=n.geometries.background.filter(m=>!h.includes(m.name));window.setGeometries({surrounding:u,background:p,simulation:n.geometries.simulation}),n.setSelectedMesh([])}function fq({pvSystems:n}){const{isOpen:t,onOpen:e,onClose:i}=zm({defaultIsOpen:!1}),{isOpen:r,onToggle:s}=zm({defaultIsOpen:!1}),{t:a}=sh(),[o,l]=Q.useState(3e3),[c,h]=Q.useState(0),[u,p]=Q.useState(25),[m,g]=Q.useState(0),[_,y]=Q.useState(0);let x;n.length>0&&(x=Math.round(n.reduce((S,R)=>S+R.annualYield,0)));async function M(){async function S({pvProduction:R,consumptionHousehold:C,storageCapacity:T,electricityPrice:N,setSelfConsumption:P,setAnnualSavings:E}){const B=await(await fetch("https://www.openpv.de/data/savings_calculation/cons_prod.json")).json(),V=B.Consumption,j=B.Production,Y={};let q=0;for(const G in V){const tt=V[G]*C/1e3,K=j[G]*R/1e3;let $=0,ht=0;if(K>tt){$=tt,ht=K-tt;const vt=T-q,Z=Math.min(ht,vt);q+=Z}else{const vt=tt-K,Z=Math.min(vt,q);q-=Z,$=K+Z}Y[G]=$}let at=Object.values(Y).reduce((G,tt)=>G+tt,0);P(Math.round(at)),E(Math.round(at*N/100))}await S({pvProduction:x,consumptionHousehold:parseFloat(o),storageCapacity:c,electricityPrice:u,setSelfConsumption:g,setAnnualSavings:y})}const b=N0.useRef(null);return X.jsxs(X.Fragment,{children:[n.length>0&&X.jsx($s,{onClick:e,className:"button-high-prio",children:a("savingsCalculation.button")}),X.jsxs(Rv,{isOpen:t,onClose:i,size:"xl",children:[X.jsx(Pv,{}),X.jsxs(vT,{children:[X.jsx(Iv,{children:a("savingsCalculation.button")}),X.jsx(Lv,{}),X.jsx(Dv,{children:X.jsxs(X.Fragment,{children:[X.jsxs(Fy,{children:[X.jsxs(yu,{children:[a("savingsCalculation.consumptionTitle"),X.jsx(Af,{label:a("savingsCalculation.consumptionHelperInfo"),children:X.jsx(Lo,{color:"teal",fontSize:"xs",children:a("savingsCalculation.consumptionHelperLabel")})})]}),X.jsx(Uy,{ref:b,value:o,onChange:S=>l(S.target.value)})]}),X.jsx("br",{}),X.jsxs(Fy,{children:[X.jsx(yu,{children:a("savingsCalculation.storageTitle")}),X.jsx(Uy,{ref:b,value:c,onChange:S=>h(S.target.value)})]}),X.jsx("br",{}),X.jsxs(Fy,{children:[X.jsx(yu,{children:a("savingsCalculation.electricityPriceTitle")}),X.jsx(Uy,{ref:b,placeholder:a("savingsCalculation.electricityPricePlaceholder"),value:u,onChange:S=>p(S.target.value)})]}),X.jsx(AT,{in:r,animateOpacity:!0,children:X.jsxs(zu,{p:"40px",color:"white",mt:"4",bg:"teal",rounded:"md",shadow:"md",children:[X.jsx(Lo,{children:a("savingsCalculation.disclaimer")}),X.jsxs(MT,{children:[X.jsxs(No,{children:[a("savingsCalculation.results.production"),X.jsxs(Lo,{as:"b",color:"white",children:[x," kWh"]})]}),X.jsxs(No,{children:[a("savingsCalculation.results.consumption"),X.jsxs(Lo,{as:"b",color:"white",children:[m," kWh"]})]}),X.jsxs(No,{children:[a("savingsCalculation.results.savings"),X.jsxs(Lo,{as:"b",color:"white",children:[_,"€"]})]})]})]})}),X.jsx("br",{})]})}),X.jsx(MI,{children:X.jsx($s,{mr:3,onClick:()=>{M(),r||s()},children:a("savingsCalculation.calculate")})})]})]})]})}function dq({buttonLabel:n,onClick:t,hoverText:e,className:i}){return X.jsx(Af,{label:e,children:X.jsx($s,{onClick:t,className:i,children:n})})}function pq({label:n}){return X.jsx(Af,{label:n,children:X.jsx(iI,{as:"InfoOutlineIcon",margin:"5px"})})}const mq=({sliderProps:n,label:t,hoverHelpLabel:e,sliderValue:i,setSliderValue:r})=>{const[s,a]=N0.useState(!1);return X.jsxs(X.Fragment,{children:[t,e&&X.jsx(pq,{label:e}),X.jsxs(WT,{id:"slider",defaultValue:i,min:n.min,max:n.max,colorScheme:"teal",onChange:r,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[X.jsx(XT,{children:X.jsx(qT,{})}),X.jsx(Af,{hasArrow:!0,bg:"teal.500",color:"white",placement:"top",isOpen:s,label:`${i}`,children:X.jsx(jT,{})})]})]})};var G3={exports:{}},fl={};/** * @license React * react-reconciler-constants.production.min.js * @@ -3951,7 +3951,7 @@ northing meters`+n;var p=u/2,m=0,g=0,_,y,x,M,b;return p>0&&(_=1e5/Math.pow(10,p) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */fl.ConcurrentRoot=1;fl.ContinuousEventPriority=4;fl.DefaultEventPriority=16;fl.DiscreteEventPriority=1;fl.IdleEventPriority=536870912;fl.LegacyRoot=0;G3.exports=fl;var Cc=G3.exports;function mq(n){let t;const e=new Set,i=(c,h)=>{const u=typeof c=="function"?c(t):c;if(u!==t){const p=t;t=h?u:Object.assign({},t,u),e.forEach(m=>m(t,p))}},r=()=>t,s=(c,h=r,u=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(t);function m(){const g=h(t);if(!u(p,g)){const _=p;c(p=g,_)}}return e.add(m),()=>e.delete(m)},l={setState:i,getState:r,subscribe:(c,h,u)=>h||u?s(c,h,u):(e.add(c),()=>e.delete(c)),destroy:()=>e.clear()};return t=n(i,r,l),l}const gq=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),YA=gq?Q.useEffect:Q.useLayoutEffect;function yq(n){const t=typeof n=="function"?mq(n):n,e=(i=t.getState,r=Object.is)=>{const[,s]=Q.useReducer(y=>y+1,0),a=t.getState(),o=Q.useRef(a),l=Q.useRef(i),c=Q.useRef(r),h=Q.useRef(!1),u=Q.useRef();u.current===void 0&&(u.current=i(a));let p,m=!1;(o.current!==a||l.current!==i||c.current!==r||h.current)&&(p=i(a),m=!r(u.current,p)),YA(()=>{m&&(u.current=p),o.current=a,l.current=i,c.current=r,h.current=!1});const g=Q.useRef(a);YA(()=>{const y=()=>{try{const M=t.getState(),b=l.current(M);c.current(u.current,b)||(o.current=M,u.current=b,s())}catch{h.current=!0,s()}},x=t.subscribe(y);return t.getState()!==g.current&&y(),x},[]);const _=m?p:u.current;return Q.useDebugValue(_),_};return Object.assign(e,t),e[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[e,t];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},e}var V3={exports:{}},W3={exports:{}},j3={};/** + */fl.ConcurrentRoot=1;fl.ContinuousEventPriority=4;fl.DefaultEventPriority=16;fl.DiscreteEventPriority=1;fl.IdleEventPriority=536870912;fl.LegacyRoot=0;G3.exports=fl;var Cc=G3.exports;function gq(n){let t;const e=new Set,i=(c,h)=>{const u=typeof c=="function"?c(t):c;if(u!==t){const p=t;t=h?u:Object.assign({},t,u),e.forEach(m=>m(t,p))}},r=()=>t,s=(c,h=r,u=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(t);function m(){const g=h(t);if(!u(p,g)){const _=p;c(p=g,_)}}return e.add(m),()=>e.delete(m)},l={setState:i,getState:r,subscribe:(c,h,u)=>h||u?s(c,h,u):(e.add(c),()=>e.delete(c)),destroy:()=>e.clear()};return t=n(i,r,l),l}const yq=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),YA=yq?Q.useEffect:Q.useLayoutEffect;function xq(n){const t=typeof n=="function"?gq(n):n,e=(i=t.getState,r=Object.is)=>{const[,s]=Q.useReducer(y=>y+1,0),a=t.getState(),o=Q.useRef(a),l=Q.useRef(i),c=Q.useRef(r),h=Q.useRef(!1),u=Q.useRef();u.current===void 0&&(u.current=i(a));let p,m=!1;(o.current!==a||l.current!==i||c.current!==r||h.current)&&(p=i(a),m=!r(u.current,p)),YA(()=>{m&&(u.current=p),o.current=a,l.current=i,c.current=r,h.current=!1});const g=Q.useRef(a);YA(()=>{const y=()=>{try{const M=t.getState(),b=l.current(M);c.current(u.current,b)||(o.current=M,u.current=b,s())}catch{h.current=!0,s()}},x=t.subscribe(y);return t.getState()!==g.current&&y(),x},[]);const _=m?p:u.current;return Q.useDebugValue(_),_};return Object.assign(e,t),e[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[e,t];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},e}var V3={exports:{}},W3={exports:{}},j3={};/** * @license React * scheduler.production.min.js * @@ -3959,7 +3959,7 @@ northing meters`+n;var p=u/2,m=0,g=0,_,y,x,M,b;return p>0&&(_=1e5/Math.pow(10,p) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function t(G,nt){var K=G.length;G.push(nt);t:for(;0>>1,ht=G[$];if(0>>1;$r(rt,K))Str(_t,rt)?(G[$]=_t,G[St]=K,$=St):(G[$]=rt,G[Z]=K,$=Z);else if(Str(_t,K))G[$]=_t,G[St]=K,$=St;else break t}}return nt}function r(G,nt){var K=G.sortIndex-nt.sortIndex;return K!==0?K:G.id-nt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();n.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,u=null,p=3,m=!1,g=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(G){for(var nt=e(c);nt!==null;){if(nt.callback===null)i(c);else if(nt.startTime<=G)i(c),nt.sortIndex=nt.expirationTime,t(l,nt);else break;nt=e(c)}}function S(G){if(_=!1,b(G),!g)if(e(l)!==null)g=!0,q(R);else{var nt=e(c);nt!==null&&at(S,nt.startTime-G)}}function R(G,nt){g=!1,_&&(_=!1,x(N),N=-1),m=!0;var K=p;try{for(b(nt),u=e(l);u!==null&&(!(u.expirationTime>nt)||G&&!L());){var $=u.callback;if(typeof $=="function"){u.callback=null,p=u.priorityLevel;var ht=$(u.expirationTime<=nt);nt=n.unstable_now(),typeof ht=="function"?u.callback=ht:u===e(l)&&i(l),b(nt)}else i(l);u=e(l)}if(u!==null)var vt=!0;else{var Z=e(c);Z!==null&&at(S,Z.startTime-nt),vt=!1}return vt}finally{u=null,p=K,m=!1}}var T=!1,C=null,N=-1,P=5,E=-1;function L(){return!(n.unstable_now()-EG||125$?(G.sortIndex=K,t(c,G),e(l)===null&&G===e(c)&&(_?(x(N),N=-1):_=!0,at(S,K-$))):(G.sortIndex=ht,t(l,G),g||m||(g=!0,q(R))),G},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(G){var nt=p;return function(){var K=p;p=nt;try{return G.apply(this,arguments)}finally{p=K}}}})(j3);W3.exports=j3;var vv=W3.exports;/** + */(function(n){function t(G,tt){var K=G.length;G.push(tt);t:for(;0>>1,ht=G[$];if(0>>1;$r(rt,K))Str(_t,rt)?(G[$]=_t,G[St]=K,$=St):(G[$]=rt,G[Z]=K,$=Z);else if(Str(_t,K))G[$]=_t,G[St]=K,$=St;else break t}}return tt}function r(G,tt){var K=G.sortIndex-tt.sortIndex;return K!==0?K:G.id-tt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();n.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,u=null,p=3,m=!1,g=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(G){for(var tt=e(c);tt!==null;){if(tt.callback===null)i(c);else if(tt.startTime<=G)i(c),tt.sortIndex=tt.expirationTime,t(l,tt);else break;tt=e(c)}}function S(G){if(_=!1,b(G),!g)if(e(l)!==null)g=!0,q(R);else{var tt=e(c);tt!==null&&at(S,tt.startTime-G)}}function R(G,tt){g=!1,_&&(_=!1,x(N),N=-1),m=!0;var K=p;try{for(b(tt),u=e(l);u!==null&&(!(u.expirationTime>tt)||G&&!L());){var $=u.callback;if(typeof $=="function"){u.callback=null,p=u.priorityLevel;var ht=$(u.expirationTime<=tt);tt=n.unstable_now(),typeof ht=="function"?u.callback=ht:u===e(l)&&i(l),b(tt)}else i(l);u=e(l)}if(u!==null)var vt=!0;else{var Z=e(c);Z!==null&&at(S,Z.startTime-tt),vt=!1}return vt}finally{u=null,p=K,m=!1}}var C=!1,T=null,N=-1,P=5,E=-1;function L(){return!(n.unstable_now()-EG||125$?(G.sortIndex=K,t(c,G),e(l)===null&&G===e(c)&&(_?(x(N),N=-1):_=!0,at(S,K-$))):(G.sortIndex=ht,t(l,G),g||m||(g=!0,q(R))),G},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(G){var tt=p;return function(){var K=p;p=tt;try{return G.apply(this,arguments)}finally{p=K}}}})(j3);W3.exports=j3;var vv=W3.exports;/** * @license React * react-reconciler.production.min.js * @@ -3967,16 +3967,16 @@ northing meters`+n;var p=u/2,m=0,g=0,_,y,x,M,b;return p>0&&(_=1e5/Math.pow(10,p) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xq=function(t){var e={},i=Q,r=vv,s=Object.assign;function a(f){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+f,v=1;vJ||A[H]!==I[J]){var Mt=` -`+A[H].replace(" at new "," at ");return f.displayName&&Mt.includes("")&&(Mt=Mt.replace("",f.displayName)),Mt}while(1<=H&&0<=J);break}}}finally{ye=!1,Error.prepareStackTrace=v}return(f=f?f.displayName||f.name:"")?pe(f):""}var Ue=Object.prototype.hasOwnProperty,Ke=[],Xe=-1;function un(f){return{current:f}}function ue(f){0>Xe||(f.current=Ke[Xe],Ke[Xe]=null,Xe--)}function Vt(f,d){Xe++,Ke[Xe]=f.current,f.current=d}var Je={},xe=un(Je),Qe=un(!1),Ei=Je;function wn(f,d){var v=f.type.contextTypes;if(!v)return Je;var w=f.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===d)return w.__reactInternalMemoizedMaskedChildContext;var A={},I;for(I in v)A[I]=d[I];return w&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=d,f.__reactInternalMemoizedMaskedChildContext=A),A}function Un(f){return f=f.childContextTypes,f!=null}function en(){ue(Qe),ue(xe)}function Ar(f,d,v){if(xe.current!==Je)throw Error(a(168));Vt(xe,d),Vt(Qe,v)}function ml(f,d,v){var w=f.stateNode;if(d=d.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var A in w)if(!(A in d))throw Error(a(108,N(f)||"Unknown",A));return s({},v,w)}function jn(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||Je,Ei=xe.current,Vt(xe,f),Vt(Qe,Qe.current),!0}function gl(f,d,v){var w=f.stateNode;if(!w)throw Error(a(169));v?(f=ml(f,d,Ei),w.__reactInternalMemoizedMergedChildContext=f,ue(Qe),ue(xe),Vt(xe,f)):ue(Qe),Vt(Qe,v)}var zi=Math.clz32?Math.clz32:cP,id=Math.log,lP=Math.LN2;function cP(f){return f>>>=0,f===0?32:31-(id(f)/lP|0)|0}var rd=64,sd=4194304;function _h(f){switch(f&-f){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function ad(f,d){var v=f.pendingLanes;if(v===0)return 0;var w=0,A=f.suspendedLanes,I=f.pingedLanes,H=v&268435455;if(H!==0){var J=H&~A;J!==0?w=_h(J):(I&=H,I!==0&&(w=_h(I)))}else H=v&~A,H!==0?w=_h(H):I!==0&&(w=_h(I));if(w===0)return 0;if(d!==0&&d!==w&&!(d&A)&&(A=w&-w,I=d&-d,A>=I||A===16&&(I&4194240)!==0))return d;if(w&4&&(w|=v&16),d=f.entangledLanes,d!==0)for(f=f.entanglements,d&=w;0v;v++)d.push(f);return d}function vh(f,d,v){f.pendingLanes|=d,d!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,d=31-zi(d),f[d]=v}function fP(f,d){var v=f.pendingLanes&~d;f.pendingLanes=d,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=d,f.mutableReadLanes&=d,f.entangledLanes&=d,d=f.entanglements;var w=f.eventTimes;for(f=f.expirationTimes;0>=H,A-=H,Is=1<<32-zi(d)+A|v<ze?(Bn=be,be=null):Bn=be.sibling;var Be=me(ct,be,yt[ze],te);if(Be===null){be===null&&(be=Bn);break}f&&be&&Be.alternate===null&&d(ct,be),et=I(Be,et,ze),Ce===null?ce=Be:Ce.sibling=Be,Ce=Be,be=Bn}if(ze===yt.length)return v(ct,be),rn&&ro(ct,ze),ce;if(be===null){for(;zeze?(Bn=be,be=null):Bn=be.sibling;var ya=me(ct,be,Be.value,te);if(ya===null){be===null&&(be=Bn);break}f&&be&&ya.alternate===null&&d(ct,be),et=I(ya,et,ze),Ce===null?ce=ya:Ce.sibling=ya,Ce=ya,be=Bn}if(Be.done)return v(ct,be),rn&&ro(ct,ze),ce;if(be===null){for(;!Be.done;ze++,Be=yt.next())Be=we(ct,Be.value,te),Be!==null&&(et=I(Be,et,ze),Ce===null?ce=Be:Ce.sibling=Be,Ce=Be);return rn&&ro(ct,ze),ce}for(be=w(ct,be);!Be.done;ze++,Be=yt.next())Be=Ze(be,ct,ze,Be.value,te),Be!==null&&(f&&Be.alternate!==null&&be.delete(Be.key===null?ze:Be.key),et=I(Be,et,ze),Ce===null?ce=Be:Ce.sibling=Be,Ce=Be);return f&&be.forEach(function(KP){return d(ct,KP)}),rn&&ro(ct,ze),ce}function hr(ct,et,yt,te){if(typeof yt=="object"&&yt!==null&&yt.type===h&&yt.key===null&&(yt=yt.props.children),typeof yt=="object"&&yt!==null){switch(yt.$$typeof){case l:t:{for(var ce=yt.key,Ce=et;Ce!==null;){if(Ce.key===ce){if(ce=yt.type,ce===h){if(Ce.tag===7){v(ct,Ce.sibling),et=A(Ce,yt.props.children),et.return=ct,ct=et;break t}}else if(Ce.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===b&&DM(ce)===Ce.type){v(ct,Ce.sibling),et=A(Ce,yt.props),et.ref=bh(ct,Ce,yt),et.return=ct,ct=et;break t}v(ct,Ce);break}else d(ct,Ce);Ce=Ce.sibling}yt.type===h?(et=uo(yt.props.children,ct.mode,te,yt.key),et.return=ct,ct=et):(te=$d(yt.type,yt.key,yt.props,null,ct.mode,te),te.ref=bh(ct,et,yt),te.return=ct,ct=te)}return H(ct);case c:t:{for(Ce=yt.key;et!==null;){if(et.key===Ce)if(et.tag===4&&et.stateNode.containerInfo===yt.containerInfo&&et.stateNode.implementation===yt.implementation){v(ct,et.sibling),et=A(et,yt.children||[]),et.return=ct,ct=et;break t}else{v(ct,et);break}else d(ct,et);et=et.sibling}et=Dy(yt,ct.mode,te),et.return=ct,ct=et}return H(ct);case b:return Ce=yt._init,hr(ct,et,Ce(yt._payload),te)}if(Y(yt))return he(ct,et,yt,te);if(T(yt))return ni(ct,et,yt,te);yd(ct,yt)}return typeof yt=="string"&&yt!==""||typeof yt=="number"?(yt=""+yt,et!==null&&et.tag===6?(v(ct,et.sibling),et=A(et,yt),et.return=ct,ct=et):(v(ct,et),et=Ly(yt,ct.mode,te),et.return=ct,ct=et),H(ct)):v(ct,et)}return hr}var wl=NM(!0),OM=NM(!1),Sh={},ar=un(Sh),Eh=un(Sh),bl=un(Sh);function is(f){if(f===Sh)throw Error(a(174));return f}function Zg(f,d){Vt(bl,d),Vt(Eh,f),Vt(ar,Sh),f=at(d),ue(ar),Vt(ar,f)}function Sl(){ue(ar),ue(Eh),ue(bl)}function FM(f){var d=is(bl.current),v=is(ar.current);d=G(v,f.type,d),v!==d&&(Vt(Eh,f),Vt(ar,d))}function Kg(f){Eh.current===f&&(ue(ar),ue(Eh))}var on=un(0);function xd(f){for(var d=f;d!==null;){if(d.tag===13){var v=d.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Jr(v)||Cs(v)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===f)break;for(;d.sibling===null;){if(d.return===null||d.return===f)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Jg=[];function Qg(){for(var f=0;fv?v:4,f(!0);var w=or.transition;or.transition={};try{f(!1),d()}finally{ke=v,or.transition=w}}function ZM(){return rs().memoizedState}function SP(f,d,v){var w=pa(f);v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},KM(f)?JM(d,v):(QM(f,d,v),v=mi(),f=lr(f,w,v),f!==null&&tw(f,d,w))}function EP(f,d,v){var w=pa(f),A={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(KM(f))JM(d,A);else{QM(f,d,A);var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=d.lastRenderedReducer,I!==null))try{var H=d.lastRenderedState,J=I(H,v);if(A.hasEagerState=!0,A.eagerState=J,ts(J,H))return}catch{}finally{}v=mi(),f=lr(f,w,v),f!==null&&tw(f,d,w)}}function KM(f){var d=f.alternate;return f===fn||d!==null&&d===fn}function JM(f,d){Ah=vd=!0;var v=f.pending;v===null?d.next=d:(d.next=v.next,v.next=d),f.pending=d}function QM(f,d,v){bn!==null&&f.mode&1&&!(Ie&2)?(f=d.interleaved,f===null?(v.next=v,ns===null?ns=[d]:ns.push(d)):(v.next=f.next,f.next=v),d.interleaved=v):(f=d.pending,f===null?v.next=v:(v.next=f.next,f.next=v),d.pending=v)}function tw(f,d,v){if(v&4194240){var w=d.lanes;w&=f.pendingLanes,v|=w,d.lanes=v,Dg(f,v)}}var Ed={readContext:ir,useCallback:ti,useContext:ti,useEffect:ti,useImperativeHandle:ti,useInsertionEffect:ti,useLayoutEffect:ti,useMemo:ti,useReducer:ti,useRef:ti,useState:ti,useDebugValue:ti,useDeferredValue:ti,useTransition:ti,useMutableSource:ti,useSyncExternalStore:ti,useId:ti,unstable_isNewReconciler:!1},AP={readContext:ir,useCallback:function(f,d){return Ds().memoizedState=[f,d===void 0?null:d],f},useContext:ir,useEffect:ry,useImperativeHandle:function(f,d,v){return v=v!=null?v.concat([f]):null,bd(4194308,4,XM.bind(null,d,f),v)},useLayoutEffect:function(f,d){return bd(4194308,4,f,d)},useInsertionEffect:function(f,d){return bd(4,2,f,d)},useMemo:function(f,d){var v=Ds();return d=d===void 0?null:d,f=f(),v.memoizedState=[f,d],f},useReducer:function(f,d,v){var w=Ds();return d=v!==void 0?v(d):d,w.memoizedState=w.baseState=d,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:d},w.queue=f,f=f.dispatch=SP.bind(null,fn,f),[w.memoizedState,f]},useRef:function(f){var d=Ds();return f={current:f},d.memoizedState=f},useState:iy,useDebugValue:sy,useDeferredValue:function(f){var d=iy(f),v=d[0],w=d[1];return ry(function(){var A=or.transition;or.transition={};try{w(f)}finally{or.transition=A}},[f]),v},useTransition:function(){var f=iy(!1),d=f[0];return f=bP.bind(null,f[1]),Ds().memoizedState=f,[d,f]},useMutableSource:function(){},useSyncExternalStore:function(f,d,v){var w=fn,A=Ds();if(rn){if(v===void 0)throw Error(a(407));v=v()}else{if(v=d(),bn===null)throw Error(a(349));El&30||zM(w,d,v)}A.memoizedState=v;var I={value:v,getSnapshot:d};return A.queue=I,ry(HM.bind(null,w,I,f),[f]),w.flags|=2048,Ch(9,BM.bind(null,w,I,v,d),void 0,null),v},useId:function(){var f=Ds(),d=bn.identifierPrefix;if(rn){var v=Ls,w=Is;v=(w&~(1<<32-zi(w)-1)).toString(32)+v,d=":"+d+"R"+v,v=Th++,0")&&(Mt=Mt.replace("",f.displayName)),Mt}while(1<=H&&0<=J);break}}}finally{ye=!1,Error.prepareStackTrace=v}return(f=f?f.displayName||f.name:"")?pe(f):""}var Ue=Object.prototype.hasOwnProperty,Ke=[],Xe=-1;function un(f){return{current:f}}function ue(f){0>Xe||(f.current=Ke[Xe],Ke[Xe]=null,Xe--)}function Vt(f,d){Xe++,Ke[Xe]=f.current,f.current=d}var Je={},xe=un(Je),Qe=un(!1),Ei=Je;function wn(f,d){var v=f.type.contextTypes;if(!v)return Je;var w=f.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===d)return w.__reactInternalMemoizedMaskedChildContext;var A={},I;for(I in v)A[I]=d[I];return w&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=d,f.__reactInternalMemoizedMaskedChildContext=A),A}function Un(f){return f=f.childContextTypes,f!=null}function en(){ue(Qe),ue(xe)}function Ar(f,d,v){if(xe.current!==Je)throw Error(a(168));Vt(xe,d),Vt(Qe,v)}function ml(f,d,v){var w=f.stateNode;if(d=d.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var A in w)if(!(A in d))throw Error(a(108,N(f)||"Unknown",A));return s({},v,w)}function jn(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||Je,Ei=xe.current,Vt(xe,f),Vt(Qe,Qe.current),!0}function gl(f,d,v){var w=f.stateNode;if(!w)throw Error(a(169));v?(f=ml(f,d,Ei),w.__reactInternalMemoizedMergedChildContext=f,ue(Qe),ue(xe),Vt(xe,f)):ue(Qe),Vt(Qe,v)}var zi=Math.clz32?Math.clz32:cP,id=Math.log,lP=Math.LN2;function cP(f){return f>>>=0,f===0?32:31-(id(f)/lP|0)|0}var rd=64,sd=4194304;function _h(f){switch(f&-f){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function ad(f,d){var v=f.pendingLanes;if(v===0)return 0;var w=0,A=f.suspendedLanes,I=f.pingedLanes,H=v&268435455;if(H!==0){var J=H&~A;J!==0?w=_h(J):(I&=H,I!==0&&(w=_h(I)))}else H=v&~A,H!==0?w=_h(H):I!==0&&(w=_h(I));if(w===0)return 0;if(d!==0&&d!==w&&!(d&A)&&(A=w&-w,I=d&-d,A>=I||A===16&&(I&4194240)!==0))return d;if(w&4&&(w|=v&16),d=f.entangledLanes,d!==0)for(f=f.entanglements,d&=w;0v;v++)d.push(f);return d}function vh(f,d,v){f.pendingLanes|=d,d!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,d=31-zi(d),f[d]=v}function fP(f,d){var v=f.pendingLanes&~d;f.pendingLanes=d,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=d,f.mutableReadLanes&=d,f.entangledLanes&=d,d=f.entanglements;var w=f.eventTimes;for(f=f.expirationTimes;0>=H,A-=H,Is=1<<32-zi(d)+A|v<ze?(Bn=be,be=null):Bn=be.sibling;var Be=me(ct,be,yt[ze],te);if(Be===null){be===null&&(be=Bn);break}f&&be&&Be.alternate===null&&d(ct,be),nt=I(Be,nt,ze),Ce===null?ce=Be:Ce.sibling=Be,Ce=Be,be=Bn}if(ze===yt.length)return v(ct,be),rn&&ro(ct,ze),ce;if(be===null){for(;zeze?(Bn=be,be=null):Bn=be.sibling;var ya=me(ct,be,Be.value,te);if(ya===null){be===null&&(be=Bn);break}f&&be&&ya.alternate===null&&d(ct,be),nt=I(ya,nt,ze),Ce===null?ce=ya:Ce.sibling=ya,Ce=ya,be=Bn}if(Be.done)return v(ct,be),rn&&ro(ct,ze),ce;if(be===null){for(;!Be.done;ze++,Be=yt.next())Be=we(ct,Be.value,te),Be!==null&&(nt=I(Be,nt,ze),Ce===null?ce=Be:Ce.sibling=Be,Ce=Be);return rn&&ro(ct,ze),ce}for(be=w(ct,be);!Be.done;ze++,Be=yt.next())Be=Ze(be,ct,ze,Be.value,te),Be!==null&&(f&&Be.alternate!==null&&be.delete(Be.key===null?ze:Be.key),nt=I(Be,nt,ze),Ce===null?ce=Be:Ce.sibling=Be,Ce=Be);return f&&be.forEach(function(KP){return d(ct,KP)}),rn&&ro(ct,ze),ce}function hr(ct,nt,yt,te){if(typeof yt=="object"&&yt!==null&&yt.type===h&&yt.key===null&&(yt=yt.props.children),typeof yt=="object"&&yt!==null){switch(yt.$$typeof){case l:t:{for(var ce=yt.key,Ce=nt;Ce!==null;){if(Ce.key===ce){if(ce=yt.type,ce===h){if(Ce.tag===7){v(ct,Ce.sibling),nt=A(Ce,yt.props.children),nt.return=ct,ct=nt;break t}}else if(Ce.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===b&&DM(ce)===Ce.type){v(ct,Ce.sibling),nt=A(Ce,yt.props),nt.ref=bh(ct,Ce,yt),nt.return=ct,ct=nt;break t}v(ct,Ce);break}else d(ct,Ce);Ce=Ce.sibling}yt.type===h?(nt=uo(yt.props.children,ct.mode,te,yt.key),nt.return=ct,ct=nt):(te=$d(yt.type,yt.key,yt.props,null,ct.mode,te),te.ref=bh(ct,nt,yt),te.return=ct,ct=te)}return H(ct);case c:t:{for(Ce=yt.key;nt!==null;){if(nt.key===Ce)if(nt.tag===4&&nt.stateNode.containerInfo===yt.containerInfo&&nt.stateNode.implementation===yt.implementation){v(ct,nt.sibling),nt=A(nt,yt.children||[]),nt.return=ct,ct=nt;break t}else{v(ct,nt);break}else d(ct,nt);nt=nt.sibling}nt=Dy(yt,ct.mode,te),nt.return=ct,ct=nt}return H(ct);case b:return Ce=yt._init,hr(ct,nt,Ce(yt._payload),te)}if(Y(yt))return he(ct,nt,yt,te);if(C(yt))return ni(ct,nt,yt,te);yd(ct,yt)}return typeof yt=="string"&&yt!==""||typeof yt=="number"?(yt=""+yt,nt!==null&&nt.tag===6?(v(ct,nt.sibling),nt=A(nt,yt),nt.return=ct,ct=nt):(v(ct,nt),nt=Ly(yt,ct.mode,te),nt.return=ct,ct=nt),H(ct)):v(ct,nt)}return hr}var wl=NM(!0),OM=NM(!1),Sh={},ar=un(Sh),Eh=un(Sh),bl=un(Sh);function is(f){if(f===Sh)throw Error(a(174));return f}function Zg(f,d){Vt(bl,d),Vt(Eh,f),Vt(ar,Sh),f=at(d),ue(ar),Vt(ar,f)}function Sl(){ue(ar),ue(Eh),ue(bl)}function FM(f){var d=is(bl.current),v=is(ar.current);d=G(v,f.type,d),v!==d&&(Vt(Eh,f),Vt(ar,d))}function Kg(f){Eh.current===f&&(ue(ar),ue(Eh))}var on=un(0);function xd(f){for(var d=f;d!==null;){if(d.tag===13){var v=d.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Jr(v)||Cs(v)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===f)break;for(;d.sibling===null;){if(d.return===null||d.return===f)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Jg=[];function Qg(){for(var f=0;fv?v:4,f(!0);var w=or.transition;or.transition={};try{f(!1),d()}finally{ke=v,or.transition=w}}function ZM(){return rs().memoizedState}function SP(f,d,v){var w=pa(f);v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},KM(f)?JM(d,v):(QM(f,d,v),v=mi(),f=lr(f,w,v),f!==null&&tw(f,d,w))}function EP(f,d,v){var w=pa(f),A={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(KM(f))JM(d,A);else{QM(f,d,A);var I=f.alternate;if(f.lanes===0&&(I===null||I.lanes===0)&&(I=d.lastRenderedReducer,I!==null))try{var H=d.lastRenderedState,J=I(H,v);if(A.hasEagerState=!0,A.eagerState=J,ts(J,H))return}catch{}finally{}v=mi(),f=lr(f,w,v),f!==null&&tw(f,d,w)}}function KM(f){var d=f.alternate;return f===fn||d!==null&&d===fn}function JM(f,d){Ah=vd=!0;var v=f.pending;v===null?d.next=d:(d.next=v.next,v.next=d),f.pending=d}function QM(f,d,v){bn!==null&&f.mode&1&&!(Ie&2)?(f=d.interleaved,f===null?(v.next=v,ns===null?ns=[d]:ns.push(d)):(v.next=f.next,f.next=v),d.interleaved=v):(f=d.pending,f===null?v.next=v:(v.next=f.next,f.next=v),d.pending=v)}function tw(f,d,v){if(v&4194240){var w=d.lanes;w&=f.pendingLanes,v|=w,d.lanes=v,Dg(f,v)}}var Ed={readContext:ir,useCallback:ti,useContext:ti,useEffect:ti,useImperativeHandle:ti,useInsertionEffect:ti,useLayoutEffect:ti,useMemo:ti,useReducer:ti,useRef:ti,useState:ti,useDebugValue:ti,useDeferredValue:ti,useTransition:ti,useMutableSource:ti,useSyncExternalStore:ti,useId:ti,unstable_isNewReconciler:!1},AP={readContext:ir,useCallback:function(f,d){return Ds().memoizedState=[f,d===void 0?null:d],f},useContext:ir,useEffect:ry,useImperativeHandle:function(f,d,v){return v=v!=null?v.concat([f]):null,bd(4194308,4,XM.bind(null,d,f),v)},useLayoutEffect:function(f,d){return bd(4194308,4,f,d)},useInsertionEffect:function(f,d){return bd(4,2,f,d)},useMemo:function(f,d){var v=Ds();return d=d===void 0?null:d,f=f(),v.memoizedState=[f,d],f},useReducer:function(f,d,v){var w=Ds();return d=v!==void 0?v(d):d,w.memoizedState=w.baseState=d,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:d},w.queue=f,f=f.dispatch=SP.bind(null,fn,f),[w.memoizedState,f]},useRef:function(f){var d=Ds();return f={current:f},d.memoizedState=f},useState:iy,useDebugValue:sy,useDeferredValue:function(f){var d=iy(f),v=d[0],w=d[1];return ry(function(){var A=or.transition;or.transition={};try{w(f)}finally{or.transition=A}},[f]),v},useTransition:function(){var f=iy(!1),d=f[0];return f=bP.bind(null,f[1]),Ds().memoizedState=f,[d,f]},useMutableSource:function(){},useSyncExternalStore:function(f,d,v){var w=fn,A=Ds();if(rn){if(v===void 0)throw Error(a(407));v=v()}else{if(v=d(),bn===null)throw Error(a(349));El&30||zM(w,d,v)}A.memoizedState=v;var I={value:v,getSnapshot:d};return A.queue=I,ry(HM.bind(null,w,I,f),[f]),w.flags|=2048,Ch(9,BM.bind(null,w,I,v,d),void 0,null),v},useId:function(){var f=Ds(),d=bn.identifierPrefix;if(rn){var v=Ls,w=Is;v=(w&~(1<<32-zi(w)-1)).toString(32)+v,d=":"+d+"R"+v,v=Th++,0Sy&&(d.flags|=128,w=!0,Lh(A,!1),d.lanes=4194304)}else{if(!w)if(f=xd(I),f!==null){if(d.flags|=128,w=!0,f=f.updateQueue,f!==null&&(d.updateQueue=f,d.flags|=4),Lh(A,!0),A.tail===null&&A.tailMode==="hidden"&&!I.alternate&&!rn)return ei(d),null}else 2*kn()-A.renderingStartTime>Sy&&v!==1073741824&&(d.flags|=128,w=!0,Lh(A,!1),d.lanes=4194304);A.isBackwards?(I.sibling=d.child,d.child=I):(f=A.last,f!==null?f.sibling=I:d.child=I,A.last=I)}return A.tail!==null?(d=A.tail,A.rendering=d,A.tail=d.sibling,A.renderingStartTime=kn(),d.sibling=null,f=on.current,Vt(on,w?f&1|2:f&1),d):(ei(d),null);case 22:case 23:return Ry(),w=d.memoizedState!==null,f!==null&&f.memoizedState!==null!==w&&(d.flags|=8192),w&&d.mode&1?Vi&1073741824&&(ei(d),Qt&&d.subtreeFlags&6&&(d.flags|=8192)):ei(d),null;case 24:return null;case 25:return null}throw Error(a(156,d.tag))}var IP=o.ReactCurrentOwner,Gi=!1;function pi(f,d,v,w){d.child=f===null?OM(d,null,v,w):wl(d,f.child,v,w)}function lw(f,d,v,w,A){v=v.render;var I=d.ref;return xl(d,A),w=ey(f,d,v,w,I,A),v=ny(),f!==null&&!Gi?(d.updateQueue=f.updateQueue,d.flags&=-2053,f.lanes&=~A,Ns(f,d,A)):(rn&&v&&jg(d),d.flags|=1,pi(f,d,w,A),d.child)}function cw(f,d,v,w,A){if(f===null){var I=v.type;return typeof I=="function"&&!Iy(I)&&I.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(d.tag=15,d.type=I,hw(f,d,I,w,A)):(f=$d(v.type,null,w,d,d.mode,A),f.ref=d.ref,f.return=d,d.child=f)}if(I=f.child,!(f.lanes&A)){var H=I.memoizedProps;if(v=v.compare,v=v!==null?v:cd,v(H,w)&&f.ref===d.ref)return Ns(f,d,A)}return d.flags|=1,f=ga(I,w),f.ref=d.ref,f.return=d,d.child=f}function hw(f,d,v,w,A){if(f!==null&&cd(f.memoizedProps,w)&&f.ref===d.ref)if(Gi=!1,(f.lanes&A)!==0)f.flags&131072&&(Gi=!0);else return d.lanes=f.lanes,Ns(f,d,A);return ly(f,d,v,w,A)}function uw(f,d,v){var w=d.pendingProps,A=w.children,I=f!==null?f.memoizedState:null;if(w.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},Vt(Al,Vi),Vi|=v;else if(v&1073741824)d.memoizedState={baseLanes:0,cachePool:null},w=I!==null?I.baseLanes:v,Vt(Al,Vi),Vi|=w;else return f=I!==null?I.baseLanes|v:v,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:f,cachePool:null},d.updateQueue=null,Vt(Al,Vi),Vi|=f,null;else I!==null?(w=I.baseLanes|v,d.memoizedState=null):w=v,Vt(Al,Vi),Vi|=w;return pi(f,d,A,v),d.child}function fw(f,d){var v=d.ref;(f===null&&v!==null||f!==null&&f.ref!==v)&&(d.flags|=512,d.flags|=2097152)}function ly(f,d,v,w,A){var I=Un(v)?Ei:xe.current;return I=wn(d,I),xl(d,A),v=ey(f,d,v,w,I,A),w=ny(),f!==null&&!Gi?(d.updateQueue=f.updateQueue,d.flags&=-2053,f.lanes&=~A,Ns(f,d,A)):(rn&&w&&jg(d),d.flags|=1,pi(f,d,v,A),d.child)}function dw(f,d,v,w,A){if(Un(v)){var I=!0;jn(d)}else I=!1;if(xl(d,A),d.stateNode===null)f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),TM(d,v,w),Wg(d,v,w,A),w=!0;else if(f===null){var H=d.stateNode,J=d.memoizedProps;H.props=J;var Mt=H.context,Ut=v.contextType;typeof Ut=="object"&&Ut!==null?Ut=ir(Ut):(Ut=Un(v)?Ei:xe.current,Ut=wn(d,Ut));var ie=v.getDerivedStateFromProps,we=typeof ie=="function"||typeof H.getSnapshotBeforeUpdate=="function";we||typeof H.UNSAFE_componentWillReceiveProps!="function"&&typeof H.componentWillReceiveProps!="function"||(J!==w||Mt!==Ut)&&CM(d,H,w,Ut),ha=!1;var me=d.memoizedState;H.state=me,dd(d,w,H,A),Mt=d.memoizedState,J!==w||me!==Mt||Qe.current||ha?(typeof ie=="function"&&(Vg(d,v,ie,w),Mt=d.memoizedState),(J=ha||AM(d,v,J,w,me,Mt,Ut))?(we||typeof H.UNSAFE_componentWillMount!="function"&&typeof H.componentWillMount!="function"||(typeof H.componentWillMount=="function"&&H.componentWillMount(),typeof H.UNSAFE_componentWillMount=="function"&&H.UNSAFE_componentWillMount()),typeof H.componentDidMount=="function"&&(d.flags|=4194308)):(typeof H.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=w,d.memoizedState=Mt),H.props=w,H.state=Mt,H.context=Ut,w=J):(typeof H.componentDidMount=="function"&&(d.flags|=4194308),w=!1)}else{H=d.stateNode,wM(f,d),J=d.memoizedProps,Ut=d.type===d.elementType?J:Tr(d.type,J),H.props=Ut,we=d.pendingProps,me=H.context,Mt=v.contextType,typeof Mt=="object"&&Mt!==null?Mt=ir(Mt):(Mt=Un(v)?Ei:xe.current,Mt=wn(d,Mt));var Ze=v.getDerivedStateFromProps;(ie=typeof Ze=="function"||typeof H.getSnapshotBeforeUpdate=="function")||typeof H.UNSAFE_componentWillReceiveProps!="function"&&typeof H.componentWillReceiveProps!="function"||(J!==we||me!==Mt)&&CM(d,H,w,Mt),ha=!1,me=d.memoizedState,H.state=me,dd(d,w,H,A);var he=d.memoizedState;J!==we||me!==he||Qe.current||ha?(typeof Ze=="function"&&(Vg(d,v,Ze,w),he=d.memoizedState),(Ut=ha||AM(d,v,Ut,w,me,he,Mt)||!1)?(ie||typeof H.UNSAFE_componentWillUpdate!="function"&&typeof H.componentWillUpdate!="function"||(typeof H.componentWillUpdate=="function"&&H.componentWillUpdate(w,he,Mt),typeof H.UNSAFE_componentWillUpdate=="function"&&H.UNSAFE_componentWillUpdate(w,he,Mt)),typeof H.componentDidUpdate=="function"&&(d.flags|=4),typeof H.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof H.componentDidUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=4),typeof H.getSnapshotBeforeUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=1024),d.memoizedProps=w,d.memoizedState=he),H.props=w,H.state=he,H.context=Mt,w=Ut):(typeof H.componentDidUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=4),typeof H.getSnapshotBeforeUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=1024),w=!1)}return cy(f,d,v,w,I,A)}function cy(f,d,v,w,A,I){fw(f,d);var H=(d.flags&128)!==0;if(!w&&!H)return A&&gl(d,v,!1),Ns(f,d,I);w=d.stateNode,IP.current=d;var J=H&&typeof v.getDerivedStateFromError!="function"?null:w.render();return d.flags|=1,f!==null&&H?(d.child=wl(d,f.child,null,I),d.child=wl(d,null,J,I)):pi(f,d,J,I),d.memoizedState=w.state,A&&gl(d,v,!0),d.child}function pw(f){var d=f.stateNode;d.pendingContext?Ar(f,d.pendingContext,d.pendingContext!==d.context):d.context&&Ar(f,d.context,!1),Zg(f,d.containerInfo)}function mw(f,d,v,w,A){return Ml(),Yg(A),d.flags|=256,pi(f,d,v,w),d.child}var Cd={dehydrated:null,treeContext:null,retryLane:0};function Rd(f){return{baseLanes:f,cachePool:null}}function gw(f,d,v){var w=d.pendingProps,A=on.current,I=!1,H=(d.flags&128)!==0,J;if((J=H)||(J=f!==null&&f.memoizedState===null?!1:(A&2)!==0),J?(I=!0,d.flags&=-129):(f===null||f.memoizedState!==null)&&(A|=1),Vt(on,A&1),f===null)return $g(d),f=d.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?(d.mode&1?Cs(f)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(A=w.children,f=w.fallback,I?(w=d.mode,I=d.child,A={mode:"hidden",children:A},!(w&1)&&I!==null?(I.childLanes=0,I.pendingProps=A):I=Yd(A,w,0,null),f=uo(f,w,v,null),I.return=d,f.return=d,I.sibling=f,d.child=I,d.child.memoizedState=Rd(v),d.memoizedState=Cd,f):hy(d,A));if(A=f.memoizedState,A!==null){if(J=A.dehydrated,J!==null){if(H)return d.flags&256?(d.flags&=-257,Pd(f,d,v,Error(a(422)))):d.memoizedState!==null?(d.child=f.child,d.flags|=128,null):(I=w.fallback,A=d.mode,w=Yd({mode:"visible",children:w.children},A,0,null),I=uo(I,A,v,null),I.flags|=2,w.return=d,I.return=d,w.sibling=I,d.child=w,d.mode&1&&wl(d,f.child,null,v),d.child.memoizedState=Rd(v),d.memoizedState=Cd,I);if(!(d.mode&1))d=Pd(f,d,v,null);else if(Cs(J))d=Pd(f,d,v,Error(a(419)));else if(w=(v&f.childLanes)!==0,Gi||w){if(w=bn,w!==null){switch(v&-v){case 4:I=2;break;case 16:I=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:I=32;break;case 536870912:I=268435456;break;default:I=0}w=I&(w.suspendedLanes|v)?0:I,w!==0&&w!==A.retryLane&&(A.retryLane=w,lr(f,w,-1))}Py(),d=Pd(f,d,v,Error(a(421)))}else Jr(J)?(d.flags|=128,d.child=f.child,d=WP.bind(null,f),dl(J,d),d=null):(v=A.treeContext,wt&&(Hi=nd(J),Bi=d,rn=!0,Cr=null,Mh=!1,v!==null&&(rr[sr++]=Is,rr[sr++]=Ls,rr[sr++]=io,Is=v.id,Ls=v.overflow,io=d)),d=hy(d,d.pendingProps.children),d.flags|=4096);return d}return I?(w=xw(f,d,w.children,w.fallback,v),I=d.child,A=f.child.memoizedState,I.memoizedState=A===null?Rd(v):{baseLanes:A.baseLanes|v,cachePool:null},I.childLanes=f.childLanes&~v,d.memoizedState=Cd,w):(v=yw(f,d,w.children,v),d.memoizedState=null,v)}return I?(w=xw(f,d,w.children,w.fallback,v),I=d.child,A=f.child.memoizedState,I.memoizedState=A===null?Rd(v):{baseLanes:A.baseLanes|v,cachePool:null},I.childLanes=f.childLanes&~v,d.memoizedState=Cd,w):(v=yw(f,d,w.children,v),d.memoizedState=null,v)}function hy(f,d){return d=Yd({mode:"visible",children:d},f.mode,0,null),d.return=f,f.child=d}function yw(f,d,v,w){var A=f.child;return f=A.sibling,v=ga(A,{mode:"visible",children:v}),!(d.mode&1)&&(v.lanes=w),v.return=d,v.sibling=null,f!==null&&(w=d.deletions,w===null?(d.deletions=[f],d.flags|=16):w.push(f)),d.child=v}function xw(f,d,v,w,A){var I=d.mode;f=f.child;var H=f.sibling,J={mode:"hidden",children:v};return!(I&1)&&d.child!==f?(v=d.child,v.childLanes=0,v.pendingProps=J,d.deletions=null):(v=ga(f,J),v.subtreeFlags=f.subtreeFlags&14680064),H!==null?w=ga(H,w):(w=uo(w,I,A,null),w.flags|=2),w.return=d,v.return=d,v.sibling=w,d.child=v,w}function Pd(f,d,v,w){return w!==null&&Yg(w),wl(d,f.child,null,v),f=hy(d,d.pendingProps.children),f.flags|=2,d.memoizedState=null,f}function _w(f,d,v){f.lanes|=d;var w=f.alternate;w!==null&&(w.lanes|=d),Hg(f.return,d,v)}function uy(f,d,v,w,A){var I=f.memoizedState;I===null?f.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:A}:(I.isBackwards=d,I.rendering=null,I.renderingStartTime=0,I.last=w,I.tail=v,I.tailMode=A)}function vw(f,d,v){var w=d.pendingProps,A=w.revealOrder,I=w.tail;if(pi(f,d,w.children,v),w=on.current,w&2)w=w&1|2,d.flags|=128;else{if(f!==null&&f.flags&128)t:for(f=d.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&_w(f,v,d);else if(f.tag===19)_w(f,v,d);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break t;for(;f.sibling===null;){if(f.return===null||f.return===d)break t;f=f.return}f.sibling.return=f.return,f=f.sibling}w&=1}if(Vt(on,w),!(d.mode&1))d.memoizedState=null;else switch(A){case"forwards":for(v=d.child,A=null;v!==null;)f=v.alternate,f!==null&&xd(f)===null&&(A=v),v=v.sibling;v=A,v===null?(A=d.child,d.child=null):(A=v.sibling,v.sibling=null),uy(d,!1,A,v,I);break;case"backwards":for(v=null,A=d.child,d.child=null;A!==null;){if(f=A.alternate,f!==null&&xd(f)===null){d.child=A;break}f=A.sibling,A.sibling=v,v=A,A=f}uy(d,!0,v,null,I);break;case"together":uy(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Ns(f,d,v){if(f!==null&&(d.dependencies=f.dependencies),Tl|=d.lanes,!(v&d.childLanes))return null;if(f!==null&&d.child!==f.child)throw Error(a(153));if(d.child!==null){for(f=d.child,v=ga(f,f.pendingProps),d.child=v,v.return=d;f.sibling!==null;)f=f.sibling,v=v.sibling=ga(f,f.pendingProps),v.return=d;v.sibling=null}return d.child}function LP(f,d,v){switch(d.tag){case 3:pw(d),Ml();break;case 5:FM(d);break;case 1:Un(d.type)&&jn(d);break;case 4:Zg(d,d.stateNode.containerInfo);break;case 10:MM(d,d.type._context,d.memoizedProps.value);break;case 13:var w=d.memoizedState;if(w!==null)return w.dehydrated!==null?(Vt(on,on.current&1),d.flags|=128,null):v&d.child.childLanes?gw(f,d,v):(Vt(on,on.current&1),f=Ns(f,d,v),f!==null?f.sibling:null);Vt(on,on.current&1);break;case 19:if(w=(v&d.childLanes)!==0,f.flags&128){if(w)return vw(f,d,v);d.flags|=128}var A=d.memoizedState;if(A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Vt(on,on.current),w)break;return null;case 22:case 23:return d.lanes=0,uw(f,d,v)}return Ns(f,d,v)}function DP(f,d){switch(Xg(d),d.tag){case 1:return Un(d.type)&&en(),f=d.flags,f&65536?(d.flags=f&-65537|128,d):null;case 3:return Sl(),ue(Qe),ue(xe),Qg(),f=d.flags,f&65536&&!(f&128)?(d.flags=f&-65537|128,d):null;case 5:return Kg(d),null;case 13:if(ue(on),f=d.memoizedState,f!==null&&f.dehydrated!==null){if(d.alternate===null)throw Error(a(340));Ml()}return f=d.flags,f&65536?(d.flags=f&-65537|128,d):null;case 19:return ue(on),null;case 4:return Sl(),null;case 10:return Bg(d.type._context),null;case 22:case 23:return Ry(),null;case 24:return null;default:return null}}var Id=!1,ao=!1,NP=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Ld(f,d){var v=f.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){Ci(f,d,w)}else v.current=null}function fy(f,d,v){try{v()}catch(w){Ci(f,d,w)}}var Mw=!1;function OP(f,d){for(nt(f.containerInfo),Kt=d;Kt!==null;)if(f=Kt,d=f.child,(f.subtreeFlags&1028)!==0&&d!==null)d.return=f,Kt=d;else for(;Kt!==null;){f=Kt;try{var v=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,A=v.memoizedState,I=f.stateNode,H=I.getSnapshotBeforeUpdate(f.elementType===f.type?w:Tr(f.type,w),A);I.__reactInternalSnapshotBeforeUpdate=H}break;case 3:Qt&&Ct(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(J){Ci(f,f.return,J)}if(d=f.sibling,d!==null){d.return=f.return,Kt=d;break}Kt=f.return}return v=Mw,Mw=!1,v}function oo(f,d,v){var w=d.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&f)===f){var I=A.destroy;A.destroy=void 0,I!==void 0&&fy(d,v,I)}A=A.next}while(A!==w)}}function Dh(f,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var v=d=d.next;do{if((v.tag&f)===f){var w=v.create;v.destroy=w()}v=v.next}while(v!==d)}}function dy(f){var d=f.ref;if(d!==null){var v=f.stateNode;switch(f.tag){case 5:f=q(v);break;default:f=v}typeof d=="function"?d(f):d.current=f}}function ww(f,d,v){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(od,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(f=d.updateQueue,f!==null&&(f=f.lastEffect,f!==null)){var w=f=f.next;do{var A=w,I=A.destroy;A=A.tag,I!==void 0&&(A&2||A&4)&&fy(d,v,I),w=w.next}while(w!==f)}break;case 1:if(Ld(d,v),f=d.stateNode,typeof f.componentWillUnmount=="function")try{f.props=d.memoizedProps,f.state=d.memoizedState,f.componentWillUnmount()}catch(H){Ci(d,v,H)}break;case 5:Ld(d,v);break;case 4:Qt?Cw(f,d,v):F&&F&&(d=d.stateNode.containerInfo,v=le(d),Se(d,v))}}function bw(f,d,v){for(var w=d;;)if(ww(f,w,v),w.child===null||Qt&&w.tag===4){if(w===d)break;for(;w.sibling===null;){if(w.return===null||w.return===d)return;w=w.return}w.sibling.return=w.return,w=w.sibling}else w.child.return=w,w=w.child}function Sw(f){var d=f.alternate;d!==null&&(f.alternate=null,Sw(d)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(d=f.stateNode,d!==null&&kt(d)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Ew(f){return f.tag===5||f.tag===3||f.tag===4}function Aw(f){t:for(;;){for(;f.sibling===null;){if(f.return===null||Ew(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue t;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Tw(f){if(Qt){t:{for(var d=f.return;d!==null;){if(Ew(d))break t;d=d.return}throw Error(a(160))}var v=d;switch(v.tag){case 5:d=v.stateNode,v.flags&32&&(jt(d),v.flags&=-33),v=Aw(f),my(f,v,d);break;case 3:case 4:d=v.stateNode.containerInfo,v=Aw(f),py(f,v,d);break;default:throw Error(a(161))}}}function py(f,d,v){var w=f.tag;if(w===5||w===6)f=f.stateNode,d?qt(v,f,d):ge(v,f);else if(w!==4&&(f=f.child,f!==null))for(py(f,d,v),f=f.sibling;f!==null;)py(f,d,v),f=f.sibling}function my(f,d,v){var w=f.tag;if(w===5||w===6)f=f.stateNode,d?Nt(v,f,d):Wt(v,f);else if(w!==4&&(f=f.child,f!==null))for(my(f,d,v),f=f.sibling;f!==null;)my(f,d,v),f=f.sibling}function Cw(f,d,v){for(var w=d,A=!1,I,H;;){if(!A){A=w.return;t:for(;;){if(A===null)throw Error(a(160));switch(I=A.stateNode,A.tag){case 5:H=!1;break t;case 3:I=I.containerInfo,H=!0;break t;case 4:I=I.containerInfo,H=!0;break t}A=A.return}A=!0}if(w.tag===5||w.tag===6)bw(f,w,v),H?gt(I,w.stateNode):W(I,w.stateNode);else if(w.tag===18)H?st(I,w.stateNode):pt(I,w.stateNode);else if(w.tag===4){if(w.child!==null){I=w.stateNode.containerInfo,H=!0,w.child.return=w,w=w.child;continue}}else if(ww(f,w,v),w.child!==null){w.child.return=w,w=w.child;continue}if(w===d)break;for(;w.sibling===null;){if(w.return===null||w.return===d)return;w=w.return,w.tag===4&&(A=!1)}w.sibling.return=w.return,w=w.sibling}}function gy(f,d){if(Qt){switch(d.tag){case 0:case 11:case 14:case 15:oo(3,d,d.return),Dh(3,d),oo(5,d,d.return);return;case 1:return;case 5:var v=d.stateNode;if(v!=null){var w=d.memoizedProps;f=f!==null?f.memoizedProps:w;var A=d.type,I=d.updateQueue;d.updateQueue=null,I!==null&&It(v,I,A,f,w,d)}return;case 6:if(d.stateNode===null)throw Error(a(162));v=d.memoizedProps,Dt(d.stateNode,f!==null?f.memoizedProps:v,v);return;case 3:wt&&f!==null&&f.memoizedState.isDehydrated&&tt(d.stateNode.containerInfo);return;case 12:return;case 13:Dd(d);return;case 19:Dd(d);return;case 17:return}throw Error(a(163))}switch(d.tag){case 0:case 11:case 14:case 15:oo(3,d,d.return),Dh(3,d),oo(5,d,d.return);return;case 12:return;case 13:Dd(d);return;case 19:Dd(d);return;case 3:wt&&f!==null&&f.memoizedState.isDehydrated&&tt(d.stateNode.containerInfo);break;case 22:case 23:return}t:if(F){switch(d.tag){case 1:case 5:case 6:break t;case 3:case 4:d=d.stateNode,Se(d.containerInfo,d.pendingChildren);break t}throw Error(a(163))}}function Dd(f){var d=f.updateQueue;if(d!==null){f.updateQueue=null;var v=f.stateNode;v===null&&(v=f.stateNode=new NP),d.forEach(function(w){var A=jP.bind(null,f,w);v.has(w)||(v.add(w),w.then(A,A))})}}function FP(f,d){for(Kt=d;Kt!==null;){d=Kt;var v=d.deletions;if(v!==null)for(var w=0;w";case Od:return":has("+(_y(f)||"")+")";case Fd:return'[role="'+f.value+'"]';case kd:return'"'+f.value+'"';case Ud:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Dw(f,d){var v=[];f=[f,0];for(var w=0;wA&&(A=H),w&=~I}if(w=A,w=kn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*kP(w/1960))-w,10f?16:f,da===null)var w=!1;else{if(f=da,da=null,Vd=0,Ie&6)throw Error(a(331));var A=Ie;for(Ie|=4,Kt=f.current;Kt!==null;){var I=Kt,H=I.child;if(Kt.flags&16){var J=I.deletions;if(J!==null){for(var Mt=0;Mtkn()-by?lo(f,0):wy|=v),Ti(f,d)}function Gw(f,d){d===0&&(f.mode&1?(d=sd,sd<<=1,!(sd&130023424)&&(sd=4194304)):d=1);var v=mi();f=Xd(f,d),f!==null&&(vh(f,d,v),Ti(f,v))}function WP(f){var d=f.memoizedState,v=0;d!==null&&(v=d.retryLane),Gw(f,v)}function jP(f,d){var v=0;switch(f.tag){case 13:var w=f.stateNode,A=f.memoizedState;A!==null&&(v=A.retryLane);break;case 19:w=f.stateNode;break;default:throw Error(a(314))}w!==null&&w.delete(d),Gw(f,v)}var Vw;Vw=function(f,d,v){if(f!==null)if(f.memoizedProps!==d.pendingProps||Qe.current)Gi=!0;else{if(!(f.lanes&v)&&!(d.flags&128))return Gi=!1,LP(f,d,v);Gi=!!(f.flags&131072)}else Gi=!1,rn&&d.flags&1048576&&RM(d,gd,d.index);switch(d.lanes=0,d.tag){case 2:var w=d.type;f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),f=d.pendingProps;var A=wn(d,xe.current);xl(d,v),A=ey(null,d,w,f,A,v);var I=ny();return d.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Un(w)?(I=!0,jn(d)):I=!1,d.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,Gg(d),A.updater=pd,d.stateNode=A,A._reactInternals=d,Wg(d,w,f,v),d=cy(null,d,w,!0,I,v)):(d.tag=0,rn&&I&&jg(d),pi(null,d,A,v),d=d.child),d;case 16:w=d.elementType;t:{switch(f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),f=d.pendingProps,A=w._init,w=A(w._payload),d.type=w,A=d.tag=qP(w),f=Tr(w,f),A){case 0:d=ly(null,d,w,f,v);break t;case 1:d=dw(null,d,w,f,v);break t;case 11:d=lw(null,d,w,f,v);break t;case 14:d=cw(null,d,w,Tr(w.type,f),v);break t}throw Error(a(306,w,""))}return d;case 0:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),ly(f,d,w,A,v);case 1:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),dw(f,d,w,A,v);case 3:t:{if(pw(d),f===null)throw Error(a(387));w=d.pendingProps,I=d.memoizedState,A=I.element,wM(f,d),dd(d,w,null,v);var H=d.memoizedState;if(w=H.element,wt&&I.isDehydrated)if(I={element:w,isDehydrated:!1,cache:H.cache,transitions:H.transitions},d.updateQueue.baseState=I,d.memoizedState=I,d.flags&256){A=Error(a(423)),d=mw(f,d,w,v,A);break t}else if(w!==A){A=Error(a(424)),d=mw(f,d,w,v,A);break t}else for(wt&&(Hi=ed(d.stateNode.containerInfo),Bi=d,rn=!0,Cr=null,Mh=!1),v=OM(d,null,w,v),d.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Ml(),w===A){d=Ns(f,d,v);break t}pi(f,d,w,v)}d=d.child}return d;case 5:return FM(d),f===null&&$g(d),w=d.type,A=d.pendingProps,I=f!==null?f.memoizedProps:null,H=A.children,rt(w,A)?H=null:I!==null&&rt(w,I)&&(d.flags|=32),fw(f,d),pi(f,d,H,v),d.child;case 6:return f===null&&$g(d),null;case 13:return gw(f,d,v);case 4:return Zg(d,d.stateNode.containerInfo),w=d.pendingProps,f===null?d.child=wl(d,null,w,v):pi(f,d,w,v),d.child;case 11:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),lw(f,d,w,A,v);case 7:return pi(f,d,d.pendingProps,v),d.child;case 8:return pi(f,d,d.pendingProps.children,v),d.child;case 12:return pi(f,d,d.pendingProps.children,v),d.child;case 10:t:{if(w=d.type._context,A=d.pendingProps,I=d.memoizedProps,H=A.value,MM(d,w,H),I!==null)if(ts(I.value,H)){if(I.children===A.children&&!Qe.current){d=Ns(f,d,v);break t}}else for(I=d.child,I!==null&&(I.return=d);I!==null;){var J=I.dependencies;if(J!==null){H=I.child;for(var Mt=J.firstContext;Mt!==null;){if(Mt.context===w){if(I.tag===1){Mt=Ps(-1,v&-v),Mt.tag=2;var Ut=I.updateQueue;if(Ut!==null){Ut=Ut.shared;var ie=Ut.pending;ie===null?Mt.next=Mt:(Mt.next=ie.next,ie.next=Mt),Ut.pending=Mt}}I.lanes|=v,Mt=I.alternate,Mt!==null&&(Mt.lanes|=v),Hg(I.return,v,d),J.lanes|=v;break}Mt=Mt.next}}else if(I.tag===10)H=I.type===d.type?null:I.child;else if(I.tag===18){if(H=I.return,H===null)throw Error(a(341));H.lanes|=v,J=H.alternate,J!==null&&(J.lanes|=v),Hg(H,v,d),H=I.sibling}else H=I.child;if(H!==null)H.return=I;else for(H=I;H!==null;){if(H===d){H=null;break}if(I=H.sibling,I!==null){I.return=H.return,H=I;break}H=H.return}I=H}pi(f,d,A.children,v),d=d.child}return d;case 9:return A=d.type,w=d.pendingProps.children,xl(d,v),A=ir(A),w=w(A),d.flags|=1,pi(f,d,w,v),d.child;case 14:return w=d.type,A=Tr(w,d.pendingProps),A=Tr(w.type,A),cw(f,d,w,A,v);case 15:return hw(f,d,d.type,d.pendingProps,v);case 17:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,Un(w)?(f=!0,jn(d)):f=!1,xl(d,v),TM(d,w,A),Wg(d,w,A,v),cy(null,d,w,!0,f,v);case 19:return vw(f,d,v);case 22:return uw(f,d,v)}throw Error(a(156,d.tag))};function Ww(f,d){return Ng(f,d)}function XP(f,d,v,w){this.tag=f,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cr(f,d,v,w){return new XP(f,d,v,w)}function Iy(f){return f=f.prototype,!(!f||!f.isReactComponent)}function qP(f){if(typeof f=="function")return Iy(f)?1:0;if(f!=null){if(f=f.$$typeof,f===_)return 11;if(f===M)return 14}return 2}function ga(f,d){var v=f.alternate;return v===null?(v=cr(f.tag,d,f.key,f.mode),v.elementType=f.elementType,v.type=f.type,v.stateNode=f.stateNode,v.alternate=f,f.alternate=v):(v.pendingProps=d,v.type=f.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=f.flags&14680064,v.childLanes=f.childLanes,v.lanes=f.lanes,v.child=f.child,v.memoizedProps=f.memoizedProps,v.memoizedState=f.memoizedState,v.updateQueue=f.updateQueue,d=f.dependencies,v.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},v.sibling=f.sibling,v.index=f.index,v.ref=f.ref,v}function $d(f,d,v,w,A,I){var H=2;if(w=f,typeof f=="function")Iy(f)&&(H=1);else if(typeof f=="string")H=5;else t:switch(f){case h:return uo(v.children,A,I,d);case u:H=8,A|=8;break;case p:return f=cr(12,v,d,A|2),f.elementType=p,f.lanes=I,f;case y:return f=cr(13,v,d,A),f.elementType=y,f.lanes=I,f;case x:return f=cr(19,v,d,A),f.elementType=x,f.lanes=I,f;case S:return Yd(v,A,I,d);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case m:H=10;break t;case g:H=9;break t;case _:H=11;break t;case M:H=14;break t;case b:H=16,w=null;break t}throw Error(a(130,f==null?f:typeof f,""))}return d=cr(H,v,d,A),d.elementType=f,d.type=w,d.lanes=I,d}function uo(f,d,v,w){return f=cr(7,f,w,d),f.lanes=v,f}function Yd(f,d,v,w){return f=cr(22,f,w,d),f.elementType=S,f.lanes=v,f.stateNode={},f}function Ly(f,d,v){return f=cr(6,f,null,d),f.lanes=v,f}function Dy(f,d,v){return d=cr(4,f.children!==null?f.children:[],f.key,d),d.lanes=v,d.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},d}function $P(f,d,v,w,A){this.tag=d,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Xt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lg(0),this.expirationTimes=Lg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lg(0),this.identifierPrefix=w,this.onRecoverableError=A,wt&&(this.mutableSourceEagerHydrationData=null)}function jw(f,d,v,w,A,I,H,J,Mt){return f=new $P(f,d,v,J,Mt),d===1?(d=1,I===!0&&(d|=8)):d=0,I=cr(3,null,null,d),f.current=I,I.stateNode=f,I.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null},Gg(I),f}function Xw(f){if(!f)return Je;f=f._reactInternals;t:{if(P(f)!==f||f.tag!==1)throw Error(a(170));var d=f;do{switch(d.tag){case 3:d=d.stateNode.context;break t;case 1:if(Un(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break t}}d=d.return}while(d!==null);throw Error(a(171))}if(f.tag===1){var v=f.type;if(Un(v))return ml(f,v,d)}return d}function qw(f){var d=f._reactInternals;if(d===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=B(d),f===null?null:f.stateNode}function $w(f,d){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var v=f.retryLane;f.retryLane=v!==0&&v=Ut&&I>=we&&A<=ie&&H<=me){f.splice(d,1);break}else if(w!==Ut||v.width!==Mt.width||meH){if(!(I!==we||v.height!==Mt.height||ieA)){Ut>w&&(Mt.width+=Ut-w,Mt.x=w),ieI&&(Mt.height+=we-I,Mt.y=I),mev&&(v=H)),HSy&&(d.flags|=128,w=!0,Lh(A,!1),d.lanes=4194304)}else{if(!w)if(f=xd(I),f!==null){if(d.flags|=128,w=!0,f=f.updateQueue,f!==null&&(d.updateQueue=f,d.flags|=4),Lh(A,!0),A.tail===null&&A.tailMode==="hidden"&&!I.alternate&&!rn)return ei(d),null}else 2*kn()-A.renderingStartTime>Sy&&v!==1073741824&&(d.flags|=128,w=!0,Lh(A,!1),d.lanes=4194304);A.isBackwards?(I.sibling=d.child,d.child=I):(f=A.last,f!==null?f.sibling=I:d.child=I,A.last=I)}return A.tail!==null?(d=A.tail,A.rendering=d,A.tail=d.sibling,A.renderingStartTime=kn(),d.sibling=null,f=on.current,Vt(on,w?f&1|2:f&1),d):(ei(d),null);case 22:case 23:return Ry(),w=d.memoizedState!==null,f!==null&&f.memoizedState!==null!==w&&(d.flags|=8192),w&&d.mode&1?Vi&1073741824&&(ei(d),Qt&&d.subtreeFlags&6&&(d.flags|=8192)):ei(d),null;case 24:return null;case 25:return null}throw Error(a(156,d.tag))}var IP=o.ReactCurrentOwner,Gi=!1;function pi(f,d,v,w){d.child=f===null?OM(d,null,v,w):wl(d,f.child,v,w)}function lw(f,d,v,w,A){v=v.render;var I=d.ref;return xl(d,A),w=ey(f,d,v,w,I,A),v=ny(),f!==null&&!Gi?(d.updateQueue=f.updateQueue,d.flags&=-2053,f.lanes&=~A,Ns(f,d,A)):(rn&&v&&jg(d),d.flags|=1,pi(f,d,w,A),d.child)}function cw(f,d,v,w,A){if(f===null){var I=v.type;return typeof I=="function"&&!Iy(I)&&I.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(d.tag=15,d.type=I,hw(f,d,I,w,A)):(f=$d(v.type,null,w,d,d.mode,A),f.ref=d.ref,f.return=d,d.child=f)}if(I=f.child,!(f.lanes&A)){var H=I.memoizedProps;if(v=v.compare,v=v!==null?v:cd,v(H,w)&&f.ref===d.ref)return Ns(f,d,A)}return d.flags|=1,f=ga(I,w),f.ref=d.ref,f.return=d,d.child=f}function hw(f,d,v,w,A){if(f!==null&&cd(f.memoizedProps,w)&&f.ref===d.ref)if(Gi=!1,(f.lanes&A)!==0)f.flags&131072&&(Gi=!0);else return d.lanes=f.lanes,Ns(f,d,A);return ly(f,d,v,w,A)}function uw(f,d,v){var w=d.pendingProps,A=w.children,I=f!==null?f.memoizedState:null;if(w.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},Vt(Al,Vi),Vi|=v;else if(v&1073741824)d.memoizedState={baseLanes:0,cachePool:null},w=I!==null?I.baseLanes:v,Vt(Al,Vi),Vi|=w;else return f=I!==null?I.baseLanes|v:v,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:f,cachePool:null},d.updateQueue=null,Vt(Al,Vi),Vi|=f,null;else I!==null?(w=I.baseLanes|v,d.memoizedState=null):w=v,Vt(Al,Vi),Vi|=w;return pi(f,d,A,v),d.child}function fw(f,d){var v=d.ref;(f===null&&v!==null||f!==null&&f.ref!==v)&&(d.flags|=512,d.flags|=2097152)}function ly(f,d,v,w,A){var I=Un(v)?Ei:xe.current;return I=wn(d,I),xl(d,A),v=ey(f,d,v,w,I,A),w=ny(),f!==null&&!Gi?(d.updateQueue=f.updateQueue,d.flags&=-2053,f.lanes&=~A,Ns(f,d,A)):(rn&&w&&jg(d),d.flags|=1,pi(f,d,v,A),d.child)}function dw(f,d,v,w,A){if(Un(v)){var I=!0;jn(d)}else I=!1;if(xl(d,A),d.stateNode===null)f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),TM(d,v,w),Wg(d,v,w,A),w=!0;else if(f===null){var H=d.stateNode,J=d.memoizedProps;H.props=J;var Mt=H.context,Ut=v.contextType;typeof Ut=="object"&&Ut!==null?Ut=ir(Ut):(Ut=Un(v)?Ei:xe.current,Ut=wn(d,Ut));var ie=v.getDerivedStateFromProps,we=typeof ie=="function"||typeof H.getSnapshotBeforeUpdate=="function";we||typeof H.UNSAFE_componentWillReceiveProps!="function"&&typeof H.componentWillReceiveProps!="function"||(J!==w||Mt!==Ut)&&CM(d,H,w,Ut),ha=!1;var me=d.memoizedState;H.state=me,dd(d,w,H,A),Mt=d.memoizedState,J!==w||me!==Mt||Qe.current||ha?(typeof ie=="function"&&(Vg(d,v,ie,w),Mt=d.memoizedState),(J=ha||AM(d,v,J,w,me,Mt,Ut))?(we||typeof H.UNSAFE_componentWillMount!="function"&&typeof H.componentWillMount!="function"||(typeof H.componentWillMount=="function"&&H.componentWillMount(),typeof H.UNSAFE_componentWillMount=="function"&&H.UNSAFE_componentWillMount()),typeof H.componentDidMount=="function"&&(d.flags|=4194308)):(typeof H.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=w,d.memoizedState=Mt),H.props=w,H.state=Mt,H.context=Ut,w=J):(typeof H.componentDidMount=="function"&&(d.flags|=4194308),w=!1)}else{H=d.stateNode,wM(f,d),J=d.memoizedProps,Ut=d.type===d.elementType?J:Tr(d.type,J),H.props=Ut,we=d.pendingProps,me=H.context,Mt=v.contextType,typeof Mt=="object"&&Mt!==null?Mt=ir(Mt):(Mt=Un(v)?Ei:xe.current,Mt=wn(d,Mt));var Ze=v.getDerivedStateFromProps;(ie=typeof Ze=="function"||typeof H.getSnapshotBeforeUpdate=="function")||typeof H.UNSAFE_componentWillReceiveProps!="function"&&typeof H.componentWillReceiveProps!="function"||(J!==we||me!==Mt)&&CM(d,H,w,Mt),ha=!1,me=d.memoizedState,H.state=me,dd(d,w,H,A);var he=d.memoizedState;J!==we||me!==he||Qe.current||ha?(typeof Ze=="function"&&(Vg(d,v,Ze,w),he=d.memoizedState),(Ut=ha||AM(d,v,Ut,w,me,he,Mt)||!1)?(ie||typeof H.UNSAFE_componentWillUpdate!="function"&&typeof H.componentWillUpdate!="function"||(typeof H.componentWillUpdate=="function"&&H.componentWillUpdate(w,he,Mt),typeof H.UNSAFE_componentWillUpdate=="function"&&H.UNSAFE_componentWillUpdate(w,he,Mt)),typeof H.componentDidUpdate=="function"&&(d.flags|=4),typeof H.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof H.componentDidUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=4),typeof H.getSnapshotBeforeUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=1024),d.memoizedProps=w,d.memoizedState=he),H.props=w,H.state=he,H.context=Mt,w=Ut):(typeof H.componentDidUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=4),typeof H.getSnapshotBeforeUpdate!="function"||J===f.memoizedProps&&me===f.memoizedState||(d.flags|=1024),w=!1)}return cy(f,d,v,w,I,A)}function cy(f,d,v,w,A,I){fw(f,d);var H=(d.flags&128)!==0;if(!w&&!H)return A&&gl(d,v,!1),Ns(f,d,I);w=d.stateNode,IP.current=d;var J=H&&typeof v.getDerivedStateFromError!="function"?null:w.render();return d.flags|=1,f!==null&&H?(d.child=wl(d,f.child,null,I),d.child=wl(d,null,J,I)):pi(f,d,J,I),d.memoizedState=w.state,A&&gl(d,v,!0),d.child}function pw(f){var d=f.stateNode;d.pendingContext?Ar(f,d.pendingContext,d.pendingContext!==d.context):d.context&&Ar(f,d.context,!1),Zg(f,d.containerInfo)}function mw(f,d,v,w,A){return Ml(),Yg(A),d.flags|=256,pi(f,d,v,w),d.child}var Cd={dehydrated:null,treeContext:null,retryLane:0};function Rd(f){return{baseLanes:f,cachePool:null}}function gw(f,d,v){var w=d.pendingProps,A=on.current,I=!1,H=(d.flags&128)!==0,J;if((J=H)||(J=f!==null&&f.memoizedState===null?!1:(A&2)!==0),J?(I=!0,d.flags&=-129):(f===null||f.memoizedState!==null)&&(A|=1),Vt(on,A&1),f===null)return $g(d),f=d.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?(d.mode&1?Cs(f)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(A=w.children,f=w.fallback,I?(w=d.mode,I=d.child,A={mode:"hidden",children:A},!(w&1)&&I!==null?(I.childLanes=0,I.pendingProps=A):I=Yd(A,w,0,null),f=uo(f,w,v,null),I.return=d,f.return=d,I.sibling=f,d.child=I,d.child.memoizedState=Rd(v),d.memoizedState=Cd,f):hy(d,A));if(A=f.memoizedState,A!==null){if(J=A.dehydrated,J!==null){if(H)return d.flags&256?(d.flags&=-257,Pd(f,d,v,Error(a(422)))):d.memoizedState!==null?(d.child=f.child,d.flags|=128,null):(I=w.fallback,A=d.mode,w=Yd({mode:"visible",children:w.children},A,0,null),I=uo(I,A,v,null),I.flags|=2,w.return=d,I.return=d,w.sibling=I,d.child=w,d.mode&1&&wl(d,f.child,null,v),d.child.memoizedState=Rd(v),d.memoizedState=Cd,I);if(!(d.mode&1))d=Pd(f,d,v,null);else if(Cs(J))d=Pd(f,d,v,Error(a(419)));else if(w=(v&f.childLanes)!==0,Gi||w){if(w=bn,w!==null){switch(v&-v){case 4:I=2;break;case 16:I=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:I=32;break;case 536870912:I=268435456;break;default:I=0}w=I&(w.suspendedLanes|v)?0:I,w!==0&&w!==A.retryLane&&(A.retryLane=w,lr(f,w,-1))}Py(),d=Pd(f,d,v,Error(a(421)))}else Jr(J)?(d.flags|=128,d.child=f.child,d=WP.bind(null,f),dl(J,d),d=null):(v=A.treeContext,wt&&(Hi=nd(J),Bi=d,rn=!0,Cr=null,Mh=!1,v!==null&&(rr[sr++]=Is,rr[sr++]=Ls,rr[sr++]=io,Is=v.id,Ls=v.overflow,io=d)),d=hy(d,d.pendingProps.children),d.flags|=4096);return d}return I?(w=xw(f,d,w.children,w.fallback,v),I=d.child,A=f.child.memoizedState,I.memoizedState=A===null?Rd(v):{baseLanes:A.baseLanes|v,cachePool:null},I.childLanes=f.childLanes&~v,d.memoizedState=Cd,w):(v=yw(f,d,w.children,v),d.memoizedState=null,v)}return I?(w=xw(f,d,w.children,w.fallback,v),I=d.child,A=f.child.memoizedState,I.memoizedState=A===null?Rd(v):{baseLanes:A.baseLanes|v,cachePool:null},I.childLanes=f.childLanes&~v,d.memoizedState=Cd,w):(v=yw(f,d,w.children,v),d.memoizedState=null,v)}function hy(f,d){return d=Yd({mode:"visible",children:d},f.mode,0,null),d.return=f,f.child=d}function yw(f,d,v,w){var A=f.child;return f=A.sibling,v=ga(A,{mode:"visible",children:v}),!(d.mode&1)&&(v.lanes=w),v.return=d,v.sibling=null,f!==null&&(w=d.deletions,w===null?(d.deletions=[f],d.flags|=16):w.push(f)),d.child=v}function xw(f,d,v,w,A){var I=d.mode;f=f.child;var H=f.sibling,J={mode:"hidden",children:v};return!(I&1)&&d.child!==f?(v=d.child,v.childLanes=0,v.pendingProps=J,d.deletions=null):(v=ga(f,J),v.subtreeFlags=f.subtreeFlags&14680064),H!==null?w=ga(H,w):(w=uo(w,I,A,null),w.flags|=2),w.return=d,v.return=d,v.sibling=w,d.child=v,w}function Pd(f,d,v,w){return w!==null&&Yg(w),wl(d,f.child,null,v),f=hy(d,d.pendingProps.children),f.flags|=2,d.memoizedState=null,f}function _w(f,d,v){f.lanes|=d;var w=f.alternate;w!==null&&(w.lanes|=d),Hg(f.return,d,v)}function uy(f,d,v,w,A){var I=f.memoizedState;I===null?f.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:A}:(I.isBackwards=d,I.rendering=null,I.renderingStartTime=0,I.last=w,I.tail=v,I.tailMode=A)}function vw(f,d,v){var w=d.pendingProps,A=w.revealOrder,I=w.tail;if(pi(f,d,w.children,v),w=on.current,w&2)w=w&1|2,d.flags|=128;else{if(f!==null&&f.flags&128)t:for(f=d.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&_w(f,v,d);else if(f.tag===19)_w(f,v,d);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break t;for(;f.sibling===null;){if(f.return===null||f.return===d)break t;f=f.return}f.sibling.return=f.return,f=f.sibling}w&=1}if(Vt(on,w),!(d.mode&1))d.memoizedState=null;else switch(A){case"forwards":for(v=d.child,A=null;v!==null;)f=v.alternate,f!==null&&xd(f)===null&&(A=v),v=v.sibling;v=A,v===null?(A=d.child,d.child=null):(A=v.sibling,v.sibling=null),uy(d,!1,A,v,I);break;case"backwards":for(v=null,A=d.child,d.child=null;A!==null;){if(f=A.alternate,f!==null&&xd(f)===null){d.child=A;break}f=A.sibling,A.sibling=v,v=A,A=f}uy(d,!0,v,null,I);break;case"together":uy(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Ns(f,d,v){if(f!==null&&(d.dependencies=f.dependencies),Tl|=d.lanes,!(v&d.childLanes))return null;if(f!==null&&d.child!==f.child)throw Error(a(153));if(d.child!==null){for(f=d.child,v=ga(f,f.pendingProps),d.child=v,v.return=d;f.sibling!==null;)f=f.sibling,v=v.sibling=ga(f,f.pendingProps),v.return=d;v.sibling=null}return d.child}function LP(f,d,v){switch(d.tag){case 3:pw(d),Ml();break;case 5:FM(d);break;case 1:Un(d.type)&&jn(d);break;case 4:Zg(d,d.stateNode.containerInfo);break;case 10:MM(d,d.type._context,d.memoizedProps.value);break;case 13:var w=d.memoizedState;if(w!==null)return w.dehydrated!==null?(Vt(on,on.current&1),d.flags|=128,null):v&d.child.childLanes?gw(f,d,v):(Vt(on,on.current&1),f=Ns(f,d,v),f!==null?f.sibling:null);Vt(on,on.current&1);break;case 19:if(w=(v&d.childLanes)!==0,f.flags&128){if(w)return vw(f,d,v);d.flags|=128}var A=d.memoizedState;if(A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Vt(on,on.current),w)break;return null;case 22:case 23:return d.lanes=0,uw(f,d,v)}return Ns(f,d,v)}function DP(f,d){switch(Xg(d),d.tag){case 1:return Un(d.type)&&en(),f=d.flags,f&65536?(d.flags=f&-65537|128,d):null;case 3:return Sl(),ue(Qe),ue(xe),Qg(),f=d.flags,f&65536&&!(f&128)?(d.flags=f&-65537|128,d):null;case 5:return Kg(d),null;case 13:if(ue(on),f=d.memoizedState,f!==null&&f.dehydrated!==null){if(d.alternate===null)throw Error(a(340));Ml()}return f=d.flags,f&65536?(d.flags=f&-65537|128,d):null;case 19:return ue(on),null;case 4:return Sl(),null;case 10:return Bg(d.type._context),null;case 22:case 23:return Ry(),null;case 24:return null;default:return null}}var Id=!1,ao=!1,NP=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Ld(f,d){var v=f.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){Ci(f,d,w)}else v.current=null}function fy(f,d,v){try{v()}catch(w){Ci(f,d,w)}}var Mw=!1;function OP(f,d){for(tt(f.containerInfo),Kt=d;Kt!==null;)if(f=Kt,d=f.child,(f.subtreeFlags&1028)!==0&&d!==null)d.return=f,Kt=d;else for(;Kt!==null;){f=Kt;try{var v=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,A=v.memoizedState,I=f.stateNode,H=I.getSnapshotBeforeUpdate(f.elementType===f.type?w:Tr(f.type,w),A);I.__reactInternalSnapshotBeforeUpdate=H}break;case 3:Qt&&Ct(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(J){Ci(f,f.return,J)}if(d=f.sibling,d!==null){d.return=f.return,Kt=d;break}Kt=f.return}return v=Mw,Mw=!1,v}function oo(f,d,v){var w=d.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&f)===f){var I=A.destroy;A.destroy=void 0,I!==void 0&&fy(d,v,I)}A=A.next}while(A!==w)}}function Dh(f,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var v=d=d.next;do{if((v.tag&f)===f){var w=v.create;v.destroy=w()}v=v.next}while(v!==d)}}function dy(f){var d=f.ref;if(d!==null){var v=f.stateNode;switch(f.tag){case 5:f=q(v);break;default:f=v}typeof d=="function"?d(f):d.current=f}}function ww(f,d,v){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(od,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(f=d.updateQueue,f!==null&&(f=f.lastEffect,f!==null)){var w=f=f.next;do{var A=w,I=A.destroy;A=A.tag,I!==void 0&&(A&2||A&4)&&fy(d,v,I),w=w.next}while(w!==f)}break;case 1:if(Ld(d,v),f=d.stateNode,typeof f.componentWillUnmount=="function")try{f.props=d.memoizedProps,f.state=d.memoizedState,f.componentWillUnmount()}catch(H){Ci(d,v,H)}break;case 5:Ld(d,v);break;case 4:Qt?Cw(f,d,v):F&&F&&(d=d.stateNode.containerInfo,v=le(d),Se(d,v))}}function bw(f,d,v){for(var w=d;;)if(ww(f,w,v),w.child===null||Qt&&w.tag===4){if(w===d)break;for(;w.sibling===null;){if(w.return===null||w.return===d)return;w=w.return}w.sibling.return=w.return,w=w.sibling}else w.child.return=w,w=w.child}function Sw(f){var d=f.alternate;d!==null&&(f.alternate=null,Sw(d)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(d=f.stateNode,d!==null&&kt(d)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Ew(f){return f.tag===5||f.tag===3||f.tag===4}function Aw(f){t:for(;;){for(;f.sibling===null;){if(f.return===null||Ew(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue t;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Tw(f){if(Qt){t:{for(var d=f.return;d!==null;){if(Ew(d))break t;d=d.return}throw Error(a(160))}var v=d;switch(v.tag){case 5:d=v.stateNode,v.flags&32&&(jt(d),v.flags&=-33),v=Aw(f),my(f,v,d);break;case 3:case 4:d=v.stateNode.containerInfo,v=Aw(f),py(f,v,d);break;default:throw Error(a(161))}}}function py(f,d,v){var w=f.tag;if(w===5||w===6)f=f.stateNode,d?qt(v,f,d):ge(v,f);else if(w!==4&&(f=f.child,f!==null))for(py(f,d,v),f=f.sibling;f!==null;)py(f,d,v),f=f.sibling}function my(f,d,v){var w=f.tag;if(w===5||w===6)f=f.stateNode,d?Nt(v,f,d):Wt(v,f);else if(w!==4&&(f=f.child,f!==null))for(my(f,d,v),f=f.sibling;f!==null;)my(f,d,v),f=f.sibling}function Cw(f,d,v){for(var w=d,A=!1,I,H;;){if(!A){A=w.return;t:for(;;){if(A===null)throw Error(a(160));switch(I=A.stateNode,A.tag){case 5:H=!1;break t;case 3:I=I.containerInfo,H=!0;break t;case 4:I=I.containerInfo,H=!0;break t}A=A.return}A=!0}if(w.tag===5||w.tag===6)bw(f,w,v),H?gt(I,w.stateNode):W(I,w.stateNode);else if(w.tag===18)H?st(I,w.stateNode):pt(I,w.stateNode);else if(w.tag===4){if(w.child!==null){I=w.stateNode.containerInfo,H=!0,w.child.return=w,w=w.child;continue}}else if(ww(f,w,v),w.child!==null){w.child.return=w,w=w.child;continue}if(w===d)break;for(;w.sibling===null;){if(w.return===null||w.return===d)return;w=w.return,w.tag===4&&(A=!1)}w.sibling.return=w.return,w=w.sibling}}function gy(f,d){if(Qt){switch(d.tag){case 0:case 11:case 14:case 15:oo(3,d,d.return),Dh(3,d),oo(5,d,d.return);return;case 1:return;case 5:var v=d.stateNode;if(v!=null){var w=d.memoizedProps;f=f!==null?f.memoizedProps:w;var A=d.type,I=d.updateQueue;d.updateQueue=null,I!==null&&It(v,I,A,f,w,d)}return;case 6:if(d.stateNode===null)throw Error(a(162));v=d.memoizedProps,Dt(d.stateNode,f!==null?f.memoizedProps:v,v);return;case 3:wt&&f!==null&&f.memoizedState.isDehydrated&&et(d.stateNode.containerInfo);return;case 12:return;case 13:Dd(d);return;case 19:Dd(d);return;case 17:return}throw Error(a(163))}switch(d.tag){case 0:case 11:case 14:case 15:oo(3,d,d.return),Dh(3,d),oo(5,d,d.return);return;case 12:return;case 13:Dd(d);return;case 19:Dd(d);return;case 3:wt&&f!==null&&f.memoizedState.isDehydrated&&et(d.stateNode.containerInfo);break;case 22:case 23:return}t:if(F){switch(d.tag){case 1:case 5:case 6:break t;case 3:case 4:d=d.stateNode,Se(d.containerInfo,d.pendingChildren);break t}throw Error(a(163))}}function Dd(f){var d=f.updateQueue;if(d!==null){f.updateQueue=null;var v=f.stateNode;v===null&&(v=f.stateNode=new NP),d.forEach(function(w){var A=jP.bind(null,f,w);v.has(w)||(v.add(w),w.then(A,A))})}}function FP(f,d){for(Kt=d;Kt!==null;){d=Kt;var v=d.deletions;if(v!==null)for(var w=0;w";case Od:return":has("+(_y(f)||"")+")";case Fd:return'[role="'+f.value+'"]';case kd:return'"'+f.value+'"';case Ud:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Dw(f,d){var v=[];f=[f,0];for(var w=0;wA&&(A=H),w&=~I}if(w=A,w=kn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*kP(w/1960))-w,10f?16:f,da===null)var w=!1;else{if(f=da,da=null,Vd=0,Ie&6)throw Error(a(331));var A=Ie;for(Ie|=4,Kt=f.current;Kt!==null;){var I=Kt,H=I.child;if(Kt.flags&16){var J=I.deletions;if(J!==null){for(var Mt=0;Mtkn()-by?lo(f,0):wy|=v),Ti(f,d)}function Gw(f,d){d===0&&(f.mode&1?(d=sd,sd<<=1,!(sd&130023424)&&(sd=4194304)):d=1);var v=mi();f=Xd(f,d),f!==null&&(vh(f,d,v),Ti(f,v))}function WP(f){var d=f.memoizedState,v=0;d!==null&&(v=d.retryLane),Gw(f,v)}function jP(f,d){var v=0;switch(f.tag){case 13:var w=f.stateNode,A=f.memoizedState;A!==null&&(v=A.retryLane);break;case 19:w=f.stateNode;break;default:throw Error(a(314))}w!==null&&w.delete(d),Gw(f,v)}var Vw;Vw=function(f,d,v){if(f!==null)if(f.memoizedProps!==d.pendingProps||Qe.current)Gi=!0;else{if(!(f.lanes&v)&&!(d.flags&128))return Gi=!1,LP(f,d,v);Gi=!!(f.flags&131072)}else Gi=!1,rn&&d.flags&1048576&&RM(d,gd,d.index);switch(d.lanes=0,d.tag){case 2:var w=d.type;f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),f=d.pendingProps;var A=wn(d,xe.current);xl(d,v),A=ey(null,d,w,f,A,v);var I=ny();return d.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Un(w)?(I=!0,jn(d)):I=!1,d.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,Gg(d),A.updater=pd,d.stateNode=A,A._reactInternals=d,Wg(d,w,f,v),d=cy(null,d,w,!0,I,v)):(d.tag=0,rn&&I&&jg(d),pi(null,d,A,v),d=d.child),d;case 16:w=d.elementType;t:{switch(f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),f=d.pendingProps,A=w._init,w=A(w._payload),d.type=w,A=d.tag=qP(w),f=Tr(w,f),A){case 0:d=ly(null,d,w,f,v);break t;case 1:d=dw(null,d,w,f,v);break t;case 11:d=lw(null,d,w,f,v);break t;case 14:d=cw(null,d,w,Tr(w.type,f),v);break t}throw Error(a(306,w,""))}return d;case 0:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),ly(f,d,w,A,v);case 1:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),dw(f,d,w,A,v);case 3:t:{if(pw(d),f===null)throw Error(a(387));w=d.pendingProps,I=d.memoizedState,A=I.element,wM(f,d),dd(d,w,null,v);var H=d.memoizedState;if(w=H.element,wt&&I.isDehydrated)if(I={element:w,isDehydrated:!1,cache:H.cache,transitions:H.transitions},d.updateQueue.baseState=I,d.memoizedState=I,d.flags&256){A=Error(a(423)),d=mw(f,d,w,v,A);break t}else if(w!==A){A=Error(a(424)),d=mw(f,d,w,v,A);break t}else for(wt&&(Hi=ed(d.stateNode.containerInfo),Bi=d,rn=!0,Cr=null,Mh=!1),v=OM(d,null,w,v),d.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Ml(),w===A){d=Ns(f,d,v);break t}pi(f,d,w,v)}d=d.child}return d;case 5:return FM(d),f===null&&$g(d),w=d.type,A=d.pendingProps,I=f!==null?f.memoizedProps:null,H=A.children,rt(w,A)?H=null:I!==null&&rt(w,I)&&(d.flags|=32),fw(f,d),pi(f,d,H,v),d.child;case 6:return f===null&&$g(d),null;case 13:return gw(f,d,v);case 4:return Zg(d,d.stateNode.containerInfo),w=d.pendingProps,f===null?d.child=wl(d,null,w,v):pi(f,d,w,v),d.child;case 11:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),lw(f,d,w,A,v);case 7:return pi(f,d,d.pendingProps,v),d.child;case 8:return pi(f,d,d.pendingProps.children,v),d.child;case 12:return pi(f,d,d.pendingProps.children,v),d.child;case 10:t:{if(w=d.type._context,A=d.pendingProps,I=d.memoizedProps,H=A.value,MM(d,w,H),I!==null)if(ts(I.value,H)){if(I.children===A.children&&!Qe.current){d=Ns(f,d,v);break t}}else for(I=d.child,I!==null&&(I.return=d);I!==null;){var J=I.dependencies;if(J!==null){H=I.child;for(var Mt=J.firstContext;Mt!==null;){if(Mt.context===w){if(I.tag===1){Mt=Ps(-1,v&-v),Mt.tag=2;var Ut=I.updateQueue;if(Ut!==null){Ut=Ut.shared;var ie=Ut.pending;ie===null?Mt.next=Mt:(Mt.next=ie.next,ie.next=Mt),Ut.pending=Mt}}I.lanes|=v,Mt=I.alternate,Mt!==null&&(Mt.lanes|=v),Hg(I.return,v,d),J.lanes|=v;break}Mt=Mt.next}}else if(I.tag===10)H=I.type===d.type?null:I.child;else if(I.tag===18){if(H=I.return,H===null)throw Error(a(341));H.lanes|=v,J=H.alternate,J!==null&&(J.lanes|=v),Hg(H,v,d),H=I.sibling}else H=I.child;if(H!==null)H.return=I;else for(H=I;H!==null;){if(H===d){H=null;break}if(I=H.sibling,I!==null){I.return=H.return,H=I;break}H=H.return}I=H}pi(f,d,A.children,v),d=d.child}return d;case 9:return A=d.type,w=d.pendingProps.children,xl(d,v),A=ir(A),w=w(A),d.flags|=1,pi(f,d,w,v),d.child;case 14:return w=d.type,A=Tr(w,d.pendingProps),A=Tr(w.type,A),cw(f,d,w,A,v);case 15:return hw(f,d,d.type,d.pendingProps,v);case 17:return w=d.type,A=d.pendingProps,A=d.elementType===w?A:Tr(w,A),f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,Un(w)?(f=!0,jn(d)):f=!1,xl(d,v),TM(d,w,A),Wg(d,w,A,v),cy(null,d,w,!0,f,v);case 19:return vw(f,d,v);case 22:return uw(f,d,v)}throw Error(a(156,d.tag))};function Ww(f,d){return Ng(f,d)}function XP(f,d,v,w){this.tag=f,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cr(f,d,v,w){return new XP(f,d,v,w)}function Iy(f){return f=f.prototype,!(!f||!f.isReactComponent)}function qP(f){if(typeof f=="function")return Iy(f)?1:0;if(f!=null){if(f=f.$$typeof,f===_)return 11;if(f===M)return 14}return 2}function ga(f,d){var v=f.alternate;return v===null?(v=cr(f.tag,d,f.key,f.mode),v.elementType=f.elementType,v.type=f.type,v.stateNode=f.stateNode,v.alternate=f,f.alternate=v):(v.pendingProps=d,v.type=f.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=f.flags&14680064,v.childLanes=f.childLanes,v.lanes=f.lanes,v.child=f.child,v.memoizedProps=f.memoizedProps,v.memoizedState=f.memoizedState,v.updateQueue=f.updateQueue,d=f.dependencies,v.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},v.sibling=f.sibling,v.index=f.index,v.ref=f.ref,v}function $d(f,d,v,w,A,I){var H=2;if(w=f,typeof f=="function")Iy(f)&&(H=1);else if(typeof f=="string")H=5;else t:switch(f){case h:return uo(v.children,A,I,d);case u:H=8,A|=8;break;case p:return f=cr(12,v,d,A|2),f.elementType=p,f.lanes=I,f;case y:return f=cr(13,v,d,A),f.elementType=y,f.lanes=I,f;case x:return f=cr(19,v,d,A),f.elementType=x,f.lanes=I,f;case S:return Yd(v,A,I,d);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case m:H=10;break t;case g:H=9;break t;case _:H=11;break t;case M:H=14;break t;case b:H=16,w=null;break t}throw Error(a(130,f==null?f:typeof f,""))}return d=cr(H,v,d,A),d.elementType=f,d.type=w,d.lanes=I,d}function uo(f,d,v,w){return f=cr(7,f,w,d),f.lanes=v,f}function Yd(f,d,v,w){return f=cr(22,f,w,d),f.elementType=S,f.lanes=v,f.stateNode={},f}function Ly(f,d,v){return f=cr(6,f,null,d),f.lanes=v,f}function Dy(f,d,v){return d=cr(4,f.children!==null?f.children:[],f.key,d),d.lanes=v,d.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},d}function $P(f,d,v,w,A){this.tag=d,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Xt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lg(0),this.expirationTimes=Lg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lg(0),this.identifierPrefix=w,this.onRecoverableError=A,wt&&(this.mutableSourceEagerHydrationData=null)}function jw(f,d,v,w,A,I,H,J,Mt){return f=new $P(f,d,v,J,Mt),d===1?(d=1,I===!0&&(d|=8)):d=0,I=cr(3,null,null,d),f.current=I,I.stateNode=f,I.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null},Gg(I),f}function Xw(f){if(!f)return Je;f=f._reactInternals;t:{if(P(f)!==f||f.tag!==1)throw Error(a(170));var d=f;do{switch(d.tag){case 3:d=d.stateNode.context;break t;case 1:if(Un(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break t}}d=d.return}while(d!==null);throw Error(a(171))}if(f.tag===1){var v=f.type;if(Un(v))return ml(f,v,d)}return d}function qw(f){var d=f._reactInternals;if(d===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=B(d),f===null?null:f.stateNode}function $w(f,d){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var v=f.retryLane;f.retryLane=v!==0&&v=Ut&&I>=we&&A<=ie&&H<=me){f.splice(d,1);break}else if(w!==Ut||v.width!==Mt.width||meH){if(!(I!==we||v.height!==Mt.height||ieA)){Ut>w&&(Mt.width+=Ut-w,Mt.x=w),ieI&&(Mt.height+=we-I,Mt.y=I),mev&&(v=H)),H ")+` No matching component was found for: - `)+f.join(" > ")}return null},e.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return q(f.child.stateNode);default:return f.child.stateNode}},e.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:YP,findFiberByHostInstance:f.findFiberByHostInstance||ZP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)f=!0;else{try{od=d.inject(f),Qr=d}catch{}f=!!d.checkDCE}}return f},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(f,d,v,w){if(!z)throw Error(a(363));f=vy(f,d);var A=Ft(f,v,w).disconnect;return{disconnect:function(){A()}}},e.registerMutableSourceForHydration=function(f,d){var v=d._getVersion;v=v(d._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[d,v]:f.mutableSourceEagerHydrationData.push(d,v)},e.runWithPriority=function(f,d){var v=ke;try{return ke=f,d()}finally{ke=v}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(f,d,v,w){var A=d.current,I=mi(),H=pa(A);return v=Xw(v),d.context===null?d.context=v:d.pendingContext=v,d=Ps(I,H),d.payload={element:f},w=w===void 0?null:w,w!==null&&(d.callback=w),ua(A,d),f=lr(A,H,I),f!==null&&fd(f,A,H),H},e};V3.exports=xq;var _q=V3.exports;const vq=vf(_q),mM={},Mq=n=>void Object.assign(mM,n);function wq(n,t){function e(h,{args:u=[],attach:p,...m},g){let _=`${h[0].toUpperCase()}${h.slice(1)}`,y;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const x=m.object;y=_c(x,{type:h,root:g,attach:p,primitive:!0})}else{const x=mM[_];if(!x)throw new Error(`R3F: ${_} 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(!Array.isArray(u))throw new Error("R3F: The args prop must be an array!");y=_c(new x(...u),{type:h,root:g,attach:p,memoizedProps:{args:u}})}return y.__r3f.attach===void 0&&(y instanceof ve?y.__r3f.attach="geometry":y instanceof Rn&&(y.__r3f.attach="material")),_!=="inject"&&w_(y,m),y}function i(h,u){let p=!1;if(u){var m,g;(m=u.__r3f)!=null&&m.attach?M_(h,u,u.__r3f.attach):u.isObject3D&&h.isObject3D&&(h.add(u),p=!0),p||(g=h.__r3f)==null||g.objects.push(u),u.__r3f||_c(u,{}),u.__r3f.parent=h,wv(u),vc(u)}}function r(h,u,p){let m=!1;if(u){var g,_;if((g=u.__r3f)!=null&&g.attach)M_(h,u,u.__r3f.attach);else if(u.isObject3D&&h.isObject3D){u.parent=h,u.dispatchEvent({type:"added"}),h.dispatchEvent({type:"childadded",child:u});const y=h.children.filter(M=>M!==u),x=y.indexOf(p);h.children=[...y.slice(0,x),u,...y.slice(x)],m=!0}m||(_=h.__r3f)==null||_.objects.push(u),u.__r3f||_c(u,{}),u.__r3f.parent=h,wv(u),vc(u)}}function s(h,u,p=!1){h&&[...h].forEach(m=>a(u,m,p))}function a(h,u,p){if(u){var m,g,_;if(u.__r3f&&(u.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(S=>S!==u)),(g=u.__r3f)!=null&&g.attach)tT(h,u,u.__r3f.attach);else if(u.isObject3D&&h.isObject3D){var y;h.remove(u),(y=u.__r3f)!=null&&y.root&&Pq(Um(u),u)}const M=(_=u.__r3f)==null?void 0:_.primitive,b=!M&&(p===void 0?u.dispose!==null:p);if(!M){var x;s((x=u.__r3f)==null?void 0:x.objects,u,b),s(u.children,u,b)}if(delete u.__r3f,b&&u.dispose&&u.type!=="Scene"){const S=()=>{try{u.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?vv.unstable_scheduleCallback(vv.unstable_IdlePriority,S):S()}vc(h)}}function o(h,u,p,m){var g;const _=(g=h.__r3f)==null?void 0:g.parent;if(!_)return;const y=e(u,p,h.__r3f.root);if(h.children){for(const x of h.children)x.__r3f&&i(y,x);h.children=h.children.filter(x=>!x.__r3f)}h.__r3f.objects.forEach(x=>i(y,x)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||a(_,h),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(_,y),y.raycast&&y.__r3f.eventCount&&Um(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(x=>{x!==null&&(x.stateNode=y,x.ref&&(typeof x.ref=="function"?x.ref(y):x.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:vq({createInstance:e,removeChild:a,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,u)=>{if(!u)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,u))},removeChildFromContainer:(h,u)=>{u&&a(h.getState().scene,u)},insertInContainerBefore:(h,u,p)=>{if(!u||!p)return;const m=h.getState().scene;m.__r3f&&r(m,u,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var u;return!!((u=h==null?void 0:h.__r3f)!=null?u:{}).handlers},prepareUpdate(h,u,p,m){var g;if(((g=h==null?void 0:h.__r3f)!=null?g:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:y=[],children:x,...M}=m,{args:b=[],children:S,...R}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((C,N)=>C!==b[N]))return[!0];const T=J3(h,M,R,!0);return T.changes.length?[!1,T]:null}},commitUpdate(h,[u,p],m,g,_,y){u?o(h,m,_,y):w_(h,p)},commitMount(h,u,p,m){var g;const _=(g=h.__r3f)!=null?g:{};h.raycast&&_.handlers&&_.eventCount&&Um(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>_c(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var u;const{attach:p,parent:m}=(u=h.__r3f)!=null?u:{};p&&m&&tT(m,h,p),h.isObject3D&&(h.visible=!1),vc(h)},unhideInstance(h,u){var p;const{attach:m,parent:g}=(p=h.__r3f)!=null?p:{};m&&g&&M_(g,h,m),(h.isObject3D&&u.visible==null||u.visible)&&(h.visible=!0),vc(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>t?t():Cc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&nn.fun(performance.now)?performance.now:nn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:nn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:nn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:w_}}var ZA,KA;const v_=n=>"colorSpace"in n||"outputColorSpace"in n,X3=()=>{var n;return(n=mM.ColorManagement)!=null?n:null},q3=n=>n&&n.isOrthographicCamera,bq=n=>n&&n.hasOwnProperty("current"),td=typeof window<"u"&&((ZA=window.document)!=null&&ZA.createElement||((KA=window.navigator)==null?void 0:KA.product)==="ReactNative")?Q.useLayoutEffect:Q.useEffect;function $3(n){const t=Q.useRef(n);return td(()=>void(t.current=n),[n]),t}function Sq({set:n}){return td(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class Y3 extends Q.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}}Y3.getDerivedStateFromError=()=>({error:!0});const Z3="__default",JA=new Map,Eq=n=>n&&!!n.memoized&&!!n.changes;function K3(n){var t;const e=typeof window<"u"?(t=window.devicePixelRatio)!=null?t:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const au=n=>{var t;return(t=n.__r3f)==null?void 0:t.root.getState()};function Um(n){let t=n.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const nn={obj:n=>n===Object(n)&&!nn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,t,{arrays:e="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof t||!!n!=!!t)return!1;if(nn.str(n)||nn.num(n)||nn.boo(n))return n===t;const s=nn.obj(n);if(s&&i==="reference")return n===t;const a=nn.arr(n);if(a&&e==="reference")return n===t;if((a||s)&&n===t)return!0;let o;for(o in n)if(!(o in t))return!1;if(s&&e==="shallow"&&i==="shallow"){for(o in r?t:n)if(!nn.equ(n[o],t[o],{strict:r,objects:"reference"}))return!1}else for(o in r?t:n)if(n[o]!==t[o])return!1;if(nn.und(o)){if(a&&n.length===0&&t.length===0||s&&Object.keys(n).length===0&&Object.keys(t).length===0)return!0;if(n!==t)return!1}return!0}};function Aq(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const t in n)t.dispose==null||t.dispose(),delete n[t]}function _c(n,t){const e=n;return e.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},n}function Mv(n,t){let e=n;if(t.includes("-")){const i=t.split("-"),r=i.pop();return e=i.reduce((s,a)=>s[a],n),{target:e,key:r}}else return{target:e,key:t}}const QA=/-\d+$/;function M_(n,t,e){if(nn.str(e)){if(QA.test(e)){const s=e.replace(QA,""),{target:a,key:o}=Mv(n,s);Array.isArray(a[o])||(a[o]=[])}const{target:i,key:r}=Mv(n,e);t.__r3f.previousAttach=i[r],i[r]=t}else t.__r3f.previousAttach=e(n,t)}function tT(n,t,e){var i,r;if(nn.str(e)){const{target:s,key:a}=Mv(n,e),o=t.__r3f.previousAttach;o===void 0?delete s[a]:s[a]=o}else(i=t.__r3f)==null||i.previousAttach==null||i.previousAttach(n,t);(r=t.__r3f)==null||delete r.previousAttach}function J3(n,{children:t,key:e,ref:i,...r},{children:s,key:a,ref:o,...l}={},c=!1){const h=n.__r3f,u=Object.entries(r),p=[];if(c){const g=Object.keys(l);for(let _=0;_{var y;if((y=n.__r3f)!=null&&y.primitive&&g==="object"||nn.equ(_,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return p.push([g,_,!0,[]]);let x=[];g.includes("-")&&(x=g.split("-")),p.push([g,_,!1,x]);for(const M in r){const b=r[M];M.startsWith(`${g}-`)&&p.push([M,b,!1,M.split("-")])}});const m={...r};return h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.args&&(m.args=h.memoizedProps.args),h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.attach&&(m.attach=h.memoizedProps.attach),{memoized:m,changes:p}}const Tq=typeof process<"u"&&!1;function w_(n,t){var e;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:a,changes:o}=Eq(t)?t:J3(n,t),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=a);for(let h=0;hx[M],n),!(y&&y.set))){const[x,...M]=g.reverse();_=M.reverse().reduce((b,S)=>b[S],n),u=x}if(p===Z3+"remove")if(_.constructor){let x=JA.get(_.constructor);x||(x=new _.constructor,JA.set(_.constructor,x)),p=x[u]}else p=0;if(m&&i)p?i.handlers[u]=p:delete i.handlers[u],i.eventCount=Object.keys(i.handlers).length;else if(y&&y.set&&(y.copy||y instanceof qo)){if(Array.isArray(p))y.fromArray?y.fromArray(p):y.set(...p);else if(y.copy&&p&&p.constructor&&(Tq?y.constructor.name===p.constructor.name:y.constructor===p.constructor))y.copy(p);else if(p!==void 0){const x=y instanceof Ht;!x&&y.setScalar?y.setScalar(p):y instanceof qo&&p instanceof qo?y.mask=p.mask:y.set(p),!X3()&&s&&!s.linear&&x&&y.convertSRGBToLinear()}}else if(_[u]=p,_[u]instanceof Mn&&_[u].format===ui&&_[u].type===Vr&&s){const x=_[u];v_(x)&&v_(s.gl)?x.colorSpace=s.gl.outputColorSpace:x.encoding=s.gl.outputEncoding}vc(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const h=Um(n).getState().internal,u=h.interaction.indexOf(n);u>-1&&h.interaction.splice(u,1),i.eventCount&&h.interaction.push(n)}return!(o.length===1&&o[0][0]==="onUpdate")&&o.length&&(e=n.__r3f)!=null&&e.parent&&wv(n),n}function vc(n){var t,e;const i=(t=n.__r3f)==null||(e=t.root)==null||e.getState==null?void 0:e.getState();i&&i.internal.frames===0&&i.invalidate()}function wv(n){n.onUpdate==null||n.onUpdate(n)}function Cq(n,t){n.manual||(q3(n)?(n.left=t.width/-2,n.right=t.width/2,n.top=t.height/2,n.bottom=t.height/-2):n.aspect=t.width/t.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function _m(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function Rq(){var n;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Cc.DefaultEventPriority;switch((n=t.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Cc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Cc.ContinuousEventPriority;default:return Cc.DefaultEventPriority}}function Q3(n,t,e,i){const r=e.get(t);r&&(e.delete(t),e.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function Pq(n,t){const{internal:e}=n.getState();e.interaction=e.interaction.filter(i=>i!==t),e.initialHits=e.initialHits.filter(i=>i!==t),e.hovered.forEach((i,r)=>{(i.eventObject===t||i.object===t)&&e.hovered.delete(r)}),e.capturedMap.forEach((i,r)=>{Q3(e.capturedMap,t,i,r)})}function Iq(n){function t(l){const{internal:c}=n.getState(),h=l.offsetX-c.initialClick[0],u=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(h*h+u*u))}function e(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(h=>{var u;return(u=c.__r3f)==null?void 0:u.handlers["onPointer"+h]}))}function i(l,c){const h=n.getState(),u=new Set,p=[],m=c?c(h.internal.interaction):h.internal.interaction;for(let x=0;x{const b=au(x.object),S=au(M.object);return!b||!S?x.distance-M.distance:S.events.priority-b.events.priority||x.distance-M.distance}).filter(x=>{const M=_m(x);return u.has(M)?!1:(u.add(M),!0)});h.events.filter&&(_=h.events.filter(_,h));for(const x of _){let M=x.object;for(;M;){var y;(y=M.__r3f)!=null&&y.eventCount&&p.push({...x,eventObject:M}),M=M.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let x of h.internal.capturedMap.get(l.pointerId).values())u.has(_m(x.intersection))||p.push(x.intersection);return p}function r(l,c,h,u){const p=n.getState();if(l.length){const m={stopped:!1};for(const g of l){const _=au(g.object)||p,{raycaster:y,pointer:x,camera:M,internal:b}=_,S=new U(x.x,x.y,0).unproject(M),R=E=>{var L,B;return(L=(B=b.capturedMap.get(E))==null?void 0:B.has(g.eventObject))!=null?L:!1},T=E=>{const L={intersection:g,target:c.target};b.capturedMap.has(E)?b.capturedMap.get(E).set(g.eventObject,L):b.capturedMap.set(E,new Map([[g.eventObject,L]])),c.target.setPointerCapture(E)},C=E=>{const L=b.capturedMap.get(E);L&&Q3(b.capturedMap,g.eventObject,L,E)};let N={};for(let E in c){let L=c[E];typeof L!="function"&&(N[E]=L)}let P={...g,...N,pointer:x,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:S,ray:y.ray,camera:M,stopPropagation(){const E="pointerId"in c&&b.capturedMap.get(c.pointerId);if((!E||E.has(g.eventObject))&&(P.stopped=m.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(L=>L.eventObject===g.eventObject))){const L=l.slice(0,l.indexOf(g));s([...L,g])}},target:{hasPointerCapture:R,setPointerCapture:T,releasePointerCapture:C},currentTarget:{hasPointerCapture:R,setPointerCapture:T,releasePointerCapture:C},nativeEvent:c};if(u(P),m.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const h of c.hovered.values())if(!l.length||!l.find(u=>u.object===h.object&&u.index===h.index&&u.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(c.hovered.delete(_m(h)),p!=null&&p.eventCount){const g={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(g),m.onPointerLeave==null||m.onPointerLeave(g)}}}function a(l,c){for(let h=0;hs([]);case"onLostPointerCapture":return c=>{const{internal:h}=n.getState();"pointerId"in c&&h.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(c.pointerId)&&(h.capturedMap.delete(c.pointerId),s([]))})}}return function(h){const{onPointerMissed:u,internal:p}=n.getState();p.lastEvent.current=h;const m=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(h,m?e:void 0),x=g?t(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=y.map(b=>b.eventObject)),g&&!y.length&&x<=2&&(a(h,p.interaction),u&&u(h)),m&&s(y);function M(b){const S=b.eventObject,R=S.__r3f,T=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const C=_m(b),N=p.hovered.get(C);N?N.stopped&&b.stopPropagation():(p.hovered.set(C,b),T.onPointerOver==null||T.onPointerOver(b),T.onPointerEnter==null||T.onPointerEnter(b))}T.onPointerMove==null||T.onPointerMove(b)}else{const C=T[l];C?(!g||p.initialHits.includes(S))&&(a(h,p.interaction.filter(N=>!p.initialHits.includes(N))),C(b)):g&&p.initialHits.includes(S)&&a(h,p.interaction.filter(N=>!p.initialHits.includes(N)))}}r(y,h,x,M)}}return{handlePointer:o}}const tP=n=>!!(n!=null&&n.render),eP=Q.createContext(null),Lq=(n,t)=>{const e=yq((o,l)=>{const c=new U,h=new U,u=new U;function p(x=l().camera,M=h,b=l().size){const{width:S,height:R,top:T,left:C}=b,N=S/R;M instanceof U?u.copy(M):u.set(...M);const P=x.getWorldPosition(c).distanceTo(u);if(q3(x))return{width:S/x.zoom,height:R/x.zoom,top:T,left:C,factor:1,distance:P,aspect:N};{const E=x.fov*Math.PI/180,L=2*Math.tan(E/2)*P,B=L*(S/R);return{width:B,height:L,top:T,left:C,factor:S/B,distance:P,aspect:N}}}let m;const g=x=>o(M=>({performance:{...M.performance,current:x}})),_=new xt;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(x=1)=>n(l(),x),advance:(x,M)=>t(x,M,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new P1,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const x=l();m&&clearTimeout(m),x.performance.current!==x.performance.min&&g(x.performance.min),m=setTimeout(()=>g(l().performance.max),x.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:x=>o(M=>({...M,events:{...M.events,...x}})),setSize:(x,M,b,S,R)=>{const T=l().camera,C={width:x,height:M,top:S||0,left:R||0,updateStyle:b};o(N=>({size:C,viewport:{...N.viewport,...p(T,h,C)}}))},setDpr:x=>o(M=>{const b=K3(x);return{viewport:{...M.viewport,dpr:b,initialDpr:M.viewport.initialDpr||b}}}),setFrameloop:(x="always")=>{const M=l().clock;M.stop(),M.elapsedTime=0,x!=="never"&&(M.start(),M.elapsedTime=0),o(()=>({frameloop:x}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Q.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(x,M,b)=>{const S=l().internal;return S.priority=S.priority+(M>0?1:0),S.subscribers.push({ref:x,priority:M,store:b}),S.subscribers=S.subscribers.sort((R,T)=>R.priority-T.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(M>0?1:0),R.subscribers=R.subscribers.filter(T=>T.ref!==x))}}}}}),i=e.getState();let r=i.size,s=i.viewport.dpr,a=i.camera;return e.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:h,set:u}=e.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var p;r=l,s=c.dpr,Cq(o,l),h.setPixelRatio(c.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}o!==a&&(a=o,u(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(o)}})))}),e.subscribe(o=>n(o)),e};let vm,Dq=new Set,Nq=new Set,Oq=new Set;function b_(n,t){if(n.size)for(const{callback:e}of n.values())e(t)}function ou(n,t){switch(n){case"before":return b_(Dq,t);case"after":return b_(Nq,t);case"tail":return b_(Oq,t)}}let S_,E_;function A_(n,t,e){let i=t.clock.getDelta();for(t.frameloop==="never"&&typeof n=="number"&&(i=n-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=n),S_=t.internal.subscribers,vm=0;vm0)&&!((h=s.gl.xr)!=null&&h.isPresenting)&&(i+=A_(c,s))}if(e=!1,ou("after",c),i===0)return ou("tail",c),t=!1,cancelAnimationFrame(r)}function o(c,h=1){var u;if(!c)return n.forEach(p=>o(p.store.getState(),h));(u=c.gl.xr)!=null&&u.isPresenting||!c.internal.active||c.frameloop==="never"||(h>1?c.internal.frames=Math.min(60,c.internal.frames+h):e?c.internal.frames=2:c.internal.frames=1,t||(t=!0,requestAnimationFrame(a)))}function l(c,h=!0,u,p){if(h&&ou("before",c),u)A_(c,u,p);else for(const m of n.values())A_(c,m.store.getState());h&&ou("after",c)}return{loop:a,invalidate:o,advance:l}}function nP(){const n=Q.useContext(eP);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function fs(n=e=>e,t){return nP()(n,t)}function Tg(n,t=0){const e=nP(),i=e.getState().internal.subscribe,r=$3(n);return td(()=>i(r,t,e),[t,i,e]),null}const ih=new Map,{invalidate:eT,advance:nT}=Fq(ih),{reconciler:I0,applyProps:mc}=wq(ih,Rq),gc={objects:"shallow",strict:!1},Uq=(n,t)=>{const e=typeof n=="function"?n(t):n;return tP(e)?e:new dC({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...n})};function kq(n,t){const e=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(t){const{width:i,height:r,top:s,left:a,updateStyle:o=e}=t;return{width:i,height:r,top:s,left:a,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:a}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:a,updateStyle:e}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:e};return{width:0,height:0,top:0,left:0}}function zq(n){const t=ih.get(n),e=t==null?void 0:t.fiber,i=t==null?void 0:t.store;t&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||Lq(eT,nT),a=e||I0.createContainer(s,Cc.ConcurrentRoot,null,!1,null,"",r,null);t||ih.set(n,{fiber:a,store:s});let o,l=!1,c;return{configure(h={}){let{gl:u,size:p,scene:m,events:g,onCreated:_,shadows:y=!1,linear:x=!1,flat:M=!1,legacy:b=!1,orthographic:S=!1,frameloop:R="always",dpr:T=[1,2],performance:C,raycaster:N,camera:P,onPointerMissed:E}=h,L=s.getState(),B=L.gl;L.gl||L.set({gl:B=Uq(u,n)});let V=L.raycaster;V||L.set({raycaster:V=new _g});const{params:j,...Y}=N||{};if(nn.equ(Y,V,gc)||mc(V,{...Y}),nn.equ(j,V.params,gc)||mc(V,{params:{...V.params,...j}}),!L.camera||L.camera===c&&!nn.equ(c,P,gc)){c=P;const K=P instanceof Pf,$=K?P:S?new ys(0,0,0,0,.1,1e3):new cn(75,0,.1,1e3);K||($.position.z=5,P&&(mc($,P),("aspect"in P||"left"in P||"right"in P||"bottom"in P||"top"in P)&&($.manual=!0,$.updateProjectionMatrix())),!L.camera&&!(P!=null&&P.rotation)&&$.lookAt(0,0,0)),L.set({camera:$}),V.camera=$}if(!L.scene){let K;m instanceof y0?K=m:(K=new y0,m&&mc(K,m)),L.set({scene:_c(K)})}if(!L.xr){var q;const K=(vt,Z)=>{const rt=s.getState();rt.frameloop!=="never"&&nT(vt,!0,rt,Z)},$=()=>{const vt=s.getState();vt.gl.xr.enabled=vt.gl.xr.isPresenting,vt.gl.xr.setAnimationLoop(vt.gl.xr.isPresenting?K:null),vt.gl.xr.isPresenting||eT(vt)},ht={connect(){const vt=s.getState().gl;vt.xr.addEventListener("sessionstart",$),vt.xr.addEventListener("sessionend",$)},disconnect(){const vt=s.getState().gl;vt.xr.removeEventListener("sessionstart",$),vt.xr.removeEventListener("sessionend",$)}};typeof((q=B.xr)==null?void 0:q.addEventListener)=="function"&&ht.connect(),L.set({xr:ht})}if(B.shadowMap){const K=B.shadowMap.enabled,$=B.shadowMap.type;if(B.shadowMap.enabled=!!y,nn.boo(y))B.shadowMap.type=vu;else if(nn.str(y)){var at;const ht={basic:KT,percentage:B0,soft:vu,variance:Ur};B.shadowMap.type=(at=ht[y])!=null?at:vu}else nn.obj(y)&&Object.assign(B.shadowMap,y);(K!==B.shadowMap.enabled||$!==B.shadowMap.type)&&(B.shadowMap.needsUpdate=!0)}const G=X3();G&&("enabled"in G?G.enabled=!b:"legacyMode"in G&&(G.legacyMode=b)),l||mc(B,{outputEncoding:x?3e3:3001,toneMapping:M?vs:Gv}),L.legacy!==b&&L.set(()=>({legacy:b})),L.linear!==x&&L.set(()=>({linear:x})),L.flat!==M&&L.set(()=>({flat:M})),u&&!nn.fun(u)&&!tP(u)&&!nn.equ(u,B,gc)&&mc(B,u),g&&!L.events.handlers&&L.set({events:g(s)});const nt=kq(n,p);return nn.equ(nt,L.size,gc)||L.setSize(nt.width,nt.height,nt.updateStyle,nt.top,nt.left),T&&L.viewport.dpr!==K3(T)&&L.setDpr(T),L.frameloop!==R&&L.setFrameloop(R),L.onPointerMissed||L.set({onPointerMissed:E}),C&&!nn.equ(C,L.performance,gc)&&L.set(K=>({performance:{...K.performance,...C}})),o=_,l=!0,this},render(h){return l||this.configure(),I0.updateContainer(X.jsx(Bq,{store:s,children:h,onCreated:o,rootElement:n}),a,null,()=>{}),s},unmount(){iP(n)}}}function Bq({store:n,children:t,onCreated:e,rootElement:i}){return td(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),e&&e(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),X.jsx(eP.Provider,{value:n,children:t})}function iP(n,t){const e=ih.get(n),i=e==null?void 0:e.fiber;if(i){const r=e==null?void 0:e.store.getState();r&&(r.internal.active=!1),I0.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,a,o,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),Aq(r),ih.delete(n)}catch{}},500)})}}I0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Q.version});const T_={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 Hq(n){const{handlePointer:t}=Iq(n);return{priority:1,enabled:!0,compute(e,i,r){i.pointer.set(e.offsetX/i.size.width*2-1,-(e.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(T_).reduce((e,i)=>({...e,[i]:t(i)}),{}),update:()=>{var e;const{events:i,internal:r}=n.getState();(e=r.lastEvent)!=null&&e.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:e=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(a=>({events:{...a.events,connected:e}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([a,o])=>{const[l,c]=T_[a];e.addEventListener(l,o,{passive:c})})},disconnect:()=>{const{set:e,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,a])=>{if(i&&i.connected instanceof HTMLElement){const[o]=T_[s];i.connected.removeEventListener(o,a)}}),e(s=>({events:{...s.events,connected:void 0}}))}}}}function bv(n,t,e){var i,r,s,a,o;t==null&&(t=100);function l(){var h=Date.now()-a;h=0?i=setTimeout(l,t-h):(i=null,e||(o=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,a=Date.now();var h=e&&!i;return i||(i=setTimeout(l,t)),h&&(o=n.apply(s,r),s=r=null),o};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(o=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}bv.debounce=bv;var Gq=bv;const iT=vf(Gq);var Vq=Object.defineProperty,Wq=Object.defineProperties,jq=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,Xq=Object.prototype.hasOwnProperty,qq=Object.prototype.propertyIsEnumerable,sT=(n,t,e)=>t in n?Vq(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,aT=(n,t)=>{for(var e in t||(t={}))Xq.call(t,e)&&sT(n,e,t[e]);if(rT)for(var e of rT(t))qq.call(t,e)&&sT(n,e,t[e]);return n},$q=(n,t)=>Wq(n,jq(t)),oT,lT;typeof window<"u"&&((oT=window.document)!=null&&oT.createElement||((lT=window.navigator)==null?void 0:lT.product)==="ReactNative")?Q.useLayoutEffect:Q.useEffect;function rP(n,t,e){if(!n)return;if(e(n)===!0)return n;let i=n.child;for(;i;){const r=rP(i,t,e);if(r)return r;i=i.sibling}}function sP(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const cT=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=cT;return}return cT.apply(this,arguments)};const gM=sP(Q.createContext(null));class aP extends Q.Component{render(){return Q.createElement(gM.Provider,{value:this._reactInternals},this.props.children)}}function Yq(){const n=Q.useContext(gM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const t=Q.useId();return Q.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=rP(i,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===t)return!0;a=a.next}});if(r)return r}},[n,t])}function Zq(){const n=Yq(),[t]=Q.useState(()=>new Map);t.clear();let e=n;for(;e;){if(e.type&&typeof e.type=="object"){const r=e.type._context===void 0&&e.type.Provider===e.type?e.type:e.type._context;r&&r!==gM&&!t.has(r)&&t.set(r,Q.useContext(sP(r)))}e=e.return}return t}function Kq(){const n=Zq();return Q.useMemo(()=>Array.from(n.keys()).reduce((t,e)=>i=>Q.createElement(t,null,Q.createElement(e.Provider,$q(aT({},i),{value:n.get(e)}))),t=>Q.createElement(aP,aT({},t))),[n])}function Jq({debounce:n,scroll:t,polyfill:e,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=e||typeof window<"u"&&window.ResizeObserver,[s,a]=Q.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const o=Q.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,h=Q.useRef(!1);Q.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[u,p,m]=Q.useMemo(()=>{const x=()=>{if(!o.current.element)return;const{left:M,top:b,width:S,height:R,bottom:T,right:C,x:N,y:P}=o.current.element.getBoundingClientRect(),E={left:M,top:b,width:S,height:R,bottom:T,right:C,x:N,y:P};o.current.element instanceof HTMLElement&&i&&(E.height=o.current.element.offsetHeight,E.width=o.current.element.offsetWidth),Object.freeze(E),h.current&&!n$(o.current.lastBounds,E)&&a(o.current.lastBounds=E)};return[x,c?iT(x,c):x,l?iT(x,l):x]},[a,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(x=>x.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null)}function _(){o.current.element&&(o.current.resizeObserver=new r(m),o.current.resizeObserver.observe(o.current.element),t&&o.current.scrollContainers&&o.current.scrollContainers.forEach(x=>x.addEventListener("scroll",m,{capture:!0,passive:!0})))}const y=x=>{!x||x===o.current.element||(g(),o.current.element=x,o.current.scrollContainers=oP(x),_())};return t$(m,!!t),Qq(p),Q.useEffect(()=>{g(),_()},[t,m,p]),Q.useEffect(()=>g,[]),[y,s,u]}function Qq(n){Q.useEffect(()=>{const t=n;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[n])}function t$(n,t){Q.useEffect(()=>{if(t){const e=n;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)}},[n,t])}function oP(n){const t=[];if(!n||n===document.body)return t;const{overflow:e,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[e,i,r].some(s=>s==="auto"||s==="scroll")&&t.push(n),[...t,...oP(n.parentElement)]}const e$=["x","y","top","bottom","left","right","width","height"],n$=(n,t)=>e$.every(e=>n[e]===t[e]),i$=Q.forwardRef(function({children:t,fallback:e,resize:i,style:r,gl:s,events:a=Hq,eventSource:o,eventPrefix:l,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:_,performance:y,raycaster:x,camera:M,scene:b,onPointerMissed:S,onCreated:R,...T},C){Q.useMemo(()=>Mq(m5),[]);const N=Kq(),[P,E]=Jq({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=Q.useRef(null),B=Q.useRef(null);Q.useImperativeHandle(C,()=>L.current);const V=$3(S),[j,Y]=Q.useState(!1),[q,at]=Q.useState(!1);if(j)throw j;if(q)throw q;const G=Q.useRef(null);td(()=>{const K=L.current;E.width>0&&E.height>0&&K&&(G.current||(G.current=zq(K)),G.current.configure({gl:s,events:a,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:_,performance:y,raycaster:x,camera:M,scene:b,size:E,onPointerMissed:(...$)=>V.current==null?void 0:V.current(...$),onCreated:$=>{$.events.connect==null||$.events.connect(o?bq(o)?o.current:o:B.current),l&&$.setEvents({compute:(ht,vt)=>{const Z=ht[l+"X"],rt=ht[l+"Y"];vt.pointer.set(Z/vt.size.width*2-1,-(rt/vt.size.height)*2+1),vt.raycaster.setFromCamera(vt.pointer,vt.camera)}}),R==null||R($)}}),G.current.render(X.jsx(N,{children:X.jsx(Y3,{set:at,children:X.jsx(Q.Suspense,{fallback:X.jsx(Sq,{set:Y}),children:t})})})))}),Q.useEffect(()=>{const K=L.current;if(K)return()=>iP(K)},[]);const nt=o?"none":"auto";return X.jsx("div",{ref:B,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:nt,...r},...T,children:X.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:X.jsx("canvas",{ref:L,style:{display:"block"},children:e})})})}),r$=Q.forwardRef(function(t,e){return X.jsx(aP,{children:X.jsx(i$,{...t,ref:e})})}),s$=({text:n,position:t})=>{const e=Q.useRef();return Q.useEffect(()=>{const i=document.createElement("canvas"),r=i.getContext("2d"),s=7;i.width=128*s,i.height=128,r.font="55px Arial",r.fillStyle="rgba(0, 0, 0, 0.3)",r.fillRect(0,0,i.width,i.height);const a=n.split(` -`);r.font="55px Arial",r.fillStyle="white",a.forEach((c,h)=>{r.fillText(c,10,60+h*60)});const o=new xC(i),l=new eg({map:o,depthTest:!1});e.current.material=l,e.current.position.copy(t),e.current.scale.set(s,1,1),e.current.renderOrder=999},[n,t]),X.jsx("sprite",{ref:e})},a$=({pvSystems:n})=>X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx(l$,{geometry:t.geometry,annualYield:t.annualYield,area:t.area},e))});function o$({setPVSystems:n,pvPoints:t,setPVPoints:e,simulationMeshes:i}){const r=t.map(C=>C.point);if(t.length<3){console.log("Not enough points to create a polygon");return}const s=new ve,a=[];r.forEach(C=>{a.push(C.x,C.y,C.z)});const o=[],l=[],c=.1;for(let C=1;C({x:Y.point.x+Y.normal.x*c,y:Y.point.y+Y.normal.y*c,z:Y.point.z+Y.normal.z*c}),B=L(N),V=L(P),j=L(E);o.push({a:N.point,b:P.point,c:E.point}),l.push(B.x,B.y,B.z,V.x,V.y,V.z,j.x,j.y,j.z)}s.setAttribute("position",new ae(l,3));let h=[];const u=.8;o.forEach(C=>{h=h.concat(gu(C,u))});const p=[];i.forEach(C=>{const N=C.geometry.clone();N.applyMatrix4(C.matrixWorld),p.push(N)});const m=IR(p,!0),g=10,_=f$(m,r,g),y=[],x=[],M=[];h.forEach(C=>{y.push(C.a.x,C.a.y,C.a.z),y.push(C.b.x,C.b.y,C.b.z),y.push(C.c.x,C.c.y,C.c.z)});for(let C=0;C[...C,T]),e([])}const l$=({geometry:n,annualYield:t,area:e})=>{const i=Q.useRef(),r=c$(n.attributes.position.array);return Tg(({camera:s})=>{i.current&&i.current.quaternion.copy(s.quaternion)}),X.jsxs(X.Fragment,{children:[X.jsx("mesh",{geometry:n,material:new uh({color:"#2b2c40",transparent:!0,opacity:.5,metalness:1,side:hi})}),X.jsx(s$,{text:`Jahresertrag: ${Math.round(t).toLocaleString("de")} kWh pro Jahr -Fläche: ${e.toPrecision(3)}m²`,position:r})]})},c$=n=>{const t=n.length/3,e=n.reduce((i,r,s)=>(i[s%3]+=r,i),[0,0,0]);return new U(e[0]/t,e[1]/t,e[2]/t)};function gu(n,t){const e=(l,c)=>Math.sqrt((c.x-l.x)**2+(c.y-l.y)**2+(c.z-l.z)**2),i=(l,c)=>({x:(l.x+c.x)/2,y:(l.y+c.y)/2,z:(l.z+c.z)/2});if(e(n.a,n.b),e(n.b,n.c),e(n.c,n.a),yM(n){t+=yM(e)}),t}function yM(n){const{a:t,b:e,c:i}=n,r=new U().subVectors(e,t),s=new U().subVectors(i,t);return .5*new U().crossVectors(r,s).length()}function u$(n,t,e){let i=null,r=1/0;return t.forEach(s=>{const[a,o,l]=s.vertices,c=n.distanceTo(a)+n.distanceTo(o)+n.distanceTo(l);c=e&&console.error(`Error: Trying to create a polygon with a distance longer than the threshold (${r})`),i}function f$(n,t,e){const i=[];if(!n.isBufferGeometry)return;const r=n.attributes.position.array,s=n.attributes.color?n.attributes.color.array:null,a=n.attributes.intensities?n.attributes.intensities.array:null;for(let o=0;o{const b=Math.min(M.distanceTo(l),M.distanceTo(c),M.distanceTo(h));b{o$({setPVSystems:c,pvPoints:h,setPVPoints:u,simulationMeshes:p}),t("Results")},C=()=>{t("Results")};return X.jsxs(X.Fragment,{children:[X.jsxs(_$,{children:[n=="Results"&&X.jsx(X.Fragment,{children:X.jsx($s,{ref:R,colorScheme:"teal",onClick:_,variant:"link",zIndex:100,children:S("button.options")})}),X.jsx($s,{onClick:M,colorScheme:"teal",variant:"link",children:S("mapControlHelp.button")}),X.jsx(w$,{isOpen:x,onClose:b}),X.jsx(M$,{isOpen:g,onClose:y,showTerrain:e,setShowTerrain:i})]}),X.jsxs(v$,{children:[n=="Results"&&X.jsx(fq,{buttonLabel:S("button.drawPVSystem"),onClick:()=>{t("DrawPV"),y()},className:l.length==0?"button-high-prio":"",hoverText:S("button.drawPVSystemHover")}),X.jsx(uq,{pvSystems:l}),r.length>0&&X.jsx($s,{className:"button-high-prio",onClick:async()=>await hq({selectedMesh:r,setSelectedMesh:s,simulationMeshes:p,setSimulationMeshes:m,geometries:a,geoLocation:o}),children:S("button.simulateBuilding")}),n=="DrawPV"&&X.jsxs(X.Fragment,{children:[h.length>0&&X.jsxs(X.Fragment,{children:[X.jsx($s,{className:"button-high-prio",onClick:T,children:S("button.createPVSystem")}),X.jsx($s,{onClick:()=>{u(h.slice(0,-1))},children:S("button.deleteLastPoint")})]}),X.jsx($s,{onClick:C,children:S("button.cancel")})]})]})]})}const _$=({children:n})=>X.jsx(X.Fragment,{children:X.jsx(zu,{display:"flex",flexDirection:"row",justifyContent:"flex-start",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:X.jsx(zu,{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"20px",padding:"10px",height:"fit-content",maxHeight:"100%",flexWrap:"nowrap",minWidth:0,minHeight:0,overflow:"hidden",children:n})})}),v$=({children:n})=>X.jsx(X.Fragment,{children:X.jsx(zu,{display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:X.jsx(zu,{display:"flex",flexDirection:"row",gap:"20px",padding:"10px",width:"fit-content",maxWidth:"100%",flexWrap:"wrap",minWidth:0,minHeight:0,overflow:"hidden",marginLeft:"auto",children:n})})}),M$=({isOpen:n,onClose:t,showTerrain:e,setShowTerrain:i})=>{const{t:r}=sh(),[s,a]=N0.useState(window.numSimulations);return X.jsx(SI,{spacing:"24px",children:X.jsxs(TD,{isOpen:n,placement:"left",onClose:t,size:"xs",children:[X.jsx(Pv,{}),X.jsxs(zT,{height:"100%",children:[X.jsx(Lv,{}),X.jsx(Iv,{children:r("button.options")}),X.jsx(Dv,{children:X.jsxs(X.Fragment,{children:[X.jsx(Lo,{as:"b",children:r("sidebar.header")}),X.jsx(Lo,{children:r("sidebar.mainText")}),X.jsxs(yu,{children:[r("button.showMap"),X.jsx($T,{isChecked:e,onChange:()=>i(o=>!o),colorScheme:"teal",margin:"5px"})]}),X.jsx(pq,{sliderProps:{min:1,max:200},label:r("sidebar.numberSimulations"),hoverHelpLabel:r("sidebar.numberSimulationsHover"),sliderValue:s,setSliderValue:o=>{a(o),window.numSimulations=o}})]})})]})]})})},w$=({isOpen:n,onClose:t})=>{const{t:e}=sh(),i=window.isTouchDevice?"touch.":"";return X.jsxs(Rv,{isOpen:n,onClose:t,children:[X.jsx(Pv,{}),X.jsxs(vT,{children:[X.jsx(Iv,{children:e("mapControlHelp.title")}),X.jsx(Lv,{}),X.jsx(Dv,{children:X.jsxs(MT,{children:[X.jsx(No,{children:e(`mapControlHelp.${i}leftMouse`)}),X.jsx(No,{children:e(`mapControlHelp.${i}rightMouse`)}),X.jsx(No,{children:e(`mapControlHelp.${i}wheel`)}),X.jsx(No,{children:e(`mapControlHelp.${i}doubleClick`)})]})})]})]})};var b$=Object.defineProperty,S$=(n,t,e)=>t in n?b$(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,_e=(n,t,e)=>(S$(n,typeof t!="symbol"?t+"":t,e),e);const Mm=new Za,hT=new ds,E$=Math.cos(70*(Math.PI/180)),uT=(n,t)=>(n%t+t)%t;let A$=class extends qr{constructor(t,e){super(),_e(this,"object"),_e(this,"domElement"),_e(this,"enabled",!0),_e(this,"target",new U),_e(this,"minDistance",0),_e(this,"maxDistance",1/0),_e(this,"minZoom",0),_e(this,"maxZoom",1/0),_e(this,"minPolarAngle",0),_e(this,"maxPolarAngle",Math.PI),_e(this,"minAzimuthAngle",-1/0),_e(this,"maxAzimuthAngle",1/0),_e(this,"enableDamping",!1),_e(this,"dampingFactor",.05),_e(this,"enableZoom",!0),_e(this,"zoomSpeed",1),_e(this,"enableRotate",!0),_e(this,"rotateSpeed",1),_e(this,"enablePan",!0),_e(this,"panSpeed",1),_e(this,"screenSpacePanning",!0),_e(this,"keyPanSpeed",7),_e(this,"zoomToCursor",!1),_e(this,"autoRotate",!1),_e(this,"autoRotateSpeed",2),_e(this,"reverseOrbit",!1),_e(this,"reverseHorizontalOrbit",!1),_e(this,"reverseVerticalOrbit",!1),_e(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),_e(this,"mouseButtons",{LEFT:Wn.ROTATE,MIDDLE:Wn.DOLLY,RIGHT:Wn.PAN}),_e(this,"touches",{ONE:Zi.ROTATE,TWO:Zi.DOLLY_PAN}),_e(this,"target0"),_e(this,"position0"),_e(this,"zoom0"),_e(this,"_domElementKeyEvents",null),_e(this,"getPolarAngle"),_e(this,"getAzimuthalAngle"),_e(this,"setPolarAngle"),_e(this,"setAzimuthalAngle"),_e(this,"getDistance"),_e(this,"listenToKeyEvents"),_e(this,"stopListenToKeyEvents"),_e(this,"saveState"),_e(this,"reset"),_e(this,"update"),_e(this,"connect"),_e(this,"dispose"),this.object=t,this.domElement=e,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=W=>{let gt=uT(W,2*Math.PI),jt=h.phi;jt<0&&(jt+=2*Math.PI),gt<0&&(gt+=2*Math.PI);let D=Math.abs(gt-jt);2*Math.PI-D{let gt=uT(W,2*Math.PI),jt=h.theta;jt<0&&(jt+=2*Math.PI),gt<0&&(gt+=2*Math.PI);let D=Math.abs(gt-jt);2*Math.PI-Di.object.position.distanceTo(i.target),this.listenToKeyEvents=W=>{W.addEventListener("keydown",Ft),this._domElementKeyEvents=W},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ft),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=o.NONE},this.update=(()=>{const W=new U,gt=new U(0,1,0),jt=new Cn().setFromUnitVectors(t.up,gt),D=jt.clone().invert(),it=new U,lt=new Cn,ut=2*Math.PI;return function(){const oe=i.object.position;jt.setFromUnitVectors(t.up,gt),D.copy(jt).invert(),W.copy(oe).sub(i.target),W.applyQuaternion(jt),h.setFromVector3(W),i.autoRotate&&l===o.NONE&&j(B()),i.enableDamping?(h.theta+=u.theta*i.dampingFactor,h.phi+=u.phi*i.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);let le=i.minAzimuthAngle,Ne=i.maxAzimuthAngle;isFinite(le)&&isFinite(Ne)&&(le<-Math.PI?le+=ut:le>Math.PI&&(le-=ut),Ne<-Math.PI?Ne+=ut:Ne>Math.PI&&(Ne-=ut),le<=Ne?h.theta=Math.max(le,Math.min(Ne,h.theta)):h.theta=h.theta>(le+Ne)/2?Math.max(le,h.theta):Math.min(Ne,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&P||i.object.isOrthographicCamera?h.radius=ht(h.radius):h.radius=ht(h.radius*p),W.setFromSpherical(h),W.applyQuaternion(D),oe.copy(i.target).add(W),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(u.theta*=1-i.dampingFactor,u.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(u.set(0,0,0),m.set(0,0,0));let Ye=!1;if(i.zoomToCursor&&P){let Se=null;if(i.object instanceof cn&&i.object.isPerspectiveCamera){const qe=W.length();Se=ht(qe*p);const $e=qe-Se;i.object.position.addScaledVector(C,$e),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const qe=new U(N.x,N.y,0);qe.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Ye=!0;const $e=new U(N.x,N.y,0);$e.unproject(i.object),i.object.position.sub($e).add(qe),i.object.updateMatrixWorld(),Se=W.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Se!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Se).add(i.object.position):(Mm.origin.copy(i.object.position),Mm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Mm.direction))c||8*(1-lt.dot(i.object.quaternion))>c?(i.dispatchEvent(r),it.copy(i.object.position),lt.copy(i.object.quaternion),Ye=!1,!0):!1}})(),this.connect=W=>{i.domElement=W,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Dt),i.domElement.addEventListener("pointerdown",O),i.domElement.addEventListener("pointercancel",At),i.domElement.addEventListener("wheel",ne)},this.dispose=()=>{var W,gt,jt,D,it,lt;i.domElement&&(i.domElement.style.touchAction="auto"),(W=i.domElement)==null||W.removeEventListener("contextmenu",Dt),(gt=i.domElement)==null||gt.removeEventListener("pointerdown",O),(jt=i.domElement)==null||jt.removeEventListener("pointercancel",At),(D=i.domElement)==null||D.removeEventListener("wheel",ne),(it=i.domElement)==null||it.ownerDocument.removeEventListener("pointermove",ot),(lt=i.domElement)==null||lt.ownerDocument.removeEventListener("pointerup",At),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",Ft)};const i=this,r={type:"change"},s={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const c=1e-6,h=new sf,u=new sf;let p=1;const m=new U,g=new xt,_=new xt,y=new xt,x=new xt,M=new xt,b=new xt,S=new xt,R=new xt,T=new xt,C=new U,N=new xt;let P=!1;const E=[],L={};function B(){return 2*Math.PI/60/60*i.autoRotateSpeed}function V(){return Math.pow(.95,i.zoomSpeed)}function j(W){i.reverseOrbit||i.reverseHorizontalOrbit?u.theta+=W:u.theta-=W}function Y(W){i.reverseOrbit||i.reverseVerticalOrbit?u.phi+=W:u.phi-=W}const q=(()=>{const W=new U;return function(jt,D){W.setFromMatrixColumn(D,0),W.multiplyScalar(-jt),m.add(W)}})(),at=(()=>{const W=new U;return function(jt,D){i.screenSpacePanning===!0?W.setFromMatrixColumn(D,1):(W.setFromMatrixColumn(D,0),W.crossVectors(i.object.up,W)),W.multiplyScalar(jt),m.add(W)}})(),G=(()=>{const W=new U;return function(jt,D){const it=i.domElement;if(it&&i.object instanceof cn&&i.object.isPerspectiveCamera){const lt=i.object.position;W.copy(lt).sub(i.target);let ut=W.length();ut*=Math.tan(i.object.fov/2*Math.PI/180),q(2*jt*ut/it.clientHeight,i.object.matrix),at(2*D*ut/it.clientHeight,i.object.matrix)}else it&&i.object instanceof ys&&i.object.isOrthographicCamera?(q(jt*(i.object.right-i.object.left)/i.object.zoom/it.clientWidth,i.object.matrix),at(D*(i.object.top-i.object.bottom)/i.object.zoom/it.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function nt(W){i.object instanceof cn&&i.object.isPerspectiveCamera||i.object instanceof ys&&i.object.isOrthographicCamera?p/=W:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function K(W){i.object instanceof cn&&i.object.isPerspectiveCamera||i.object instanceof ys&&i.object.isOrthographicCamera?p*=W:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function $(W){if(!i.zoomToCursor||!i.domElement)return;P=!0;const gt=i.domElement.getBoundingClientRect(),jt=W.clientX-gt.left,D=W.clientY-gt.top,it=gt.width,lt=gt.height;N.x=jt/it*2-1,N.y=-(D/lt)*2+1,C.set(N.x,N.y,1).unproject(i.object).sub(i.object.position).normalize()}function ht(W){return Math.max(i.minDistance,Math.min(i.maxDistance,W))}function vt(W){g.set(W.clientX,W.clientY)}function Z(W){$(W),S.set(W.clientX,W.clientY)}function rt(W){x.set(W.clientX,W.clientY)}function St(W){_.set(W.clientX,W.clientY),y.subVectors(_,g).multiplyScalar(i.rotateSpeed);const gt=i.domElement;gt&&(j(2*Math.PI*y.x/gt.clientHeight),Y(2*Math.PI*y.y/gt.clientHeight)),g.copy(_),i.update()}function _t(W){R.set(W.clientX,W.clientY),T.subVectors(R,S),T.y>0?nt(V()):T.y<0&&K(V()),S.copy(R),i.update()}function Ot(W){M.set(W.clientX,W.clientY),b.subVectors(M,x).multiplyScalar(i.panSpeed),G(b.x,b.y),x.copy(M),i.update()}function Xt(W){$(W),W.deltaY<0?K(V()):W.deltaY>0&&nt(V()),i.update()}function Gt(W){let gt=!1;switch(W.code){case i.keys.UP:G(0,i.keyPanSpeed),gt=!0;break;case i.keys.BOTTOM:G(0,-i.keyPanSpeed),gt=!0;break;case i.keys.LEFT:G(i.keyPanSpeed,0),gt=!0;break;case i.keys.RIGHT:G(-i.keyPanSpeed,0),gt=!0;break}gt&&(W.preventDefault(),i.update())}function Qt(){if(E.length==1)g.set(E[0].pageX,E[0].pageY);else{const W=.5*(E[0].pageX+E[1].pageX),gt=.5*(E[0].pageY+E[1].pageY);g.set(W,gt)}}function F(){if(E.length==1)x.set(E[0].pageX,E[0].pageY);else{const W=.5*(E[0].pageX+E[1].pageX),gt=.5*(E[0].pageY+E[1].pageY);x.set(W,gt)}}function wt(){const W=E[0].pageX-E[1].pageX,gt=E[0].pageY-E[1].pageY,jt=Math.sqrt(W*W+gt*gt);S.set(0,jt)}function bt(){i.enableZoom&&wt(),i.enablePan&&F()}function mt(){i.enableZoom&&wt(),i.enableRotate&&Qt()}function dt(W){if(E.length==1)_.set(W.pageX,W.pageY);else{const jt=qt(W),D=.5*(W.pageX+jt.x),it=.5*(W.pageY+jt.y);_.set(D,it)}y.subVectors(_,g).multiplyScalar(i.rotateSpeed);const gt=i.domElement;gt&&(j(2*Math.PI*y.x/gt.clientHeight),Y(2*Math.PI*y.y/gt.clientHeight)),g.copy(_)}function kt(W){if(E.length==1)M.set(W.pageX,W.pageY);else{const gt=qt(W),jt=.5*(W.pageX+gt.x),D=.5*(W.pageY+gt.y);M.set(jt,D)}b.subVectors(M,x).multiplyScalar(i.panSpeed),G(b.x,b.y),x.copy(M)}function Rt(W){const gt=qt(W),jt=W.pageX-gt.x,D=W.pageY-gt.y,it=Math.sqrt(jt*jt+D*D);R.set(0,it),T.set(0,Math.pow(R.y/S.y,i.zoomSpeed)),nt(T.y),S.copy(R)}function zt(W){i.enableZoom&&Rt(W),i.enablePan&&kt(W)}function z(W){i.enableZoom&&Rt(W),i.enableRotate&&dt(W)}function O(W){var gt,jt;i.enabled!==!1&&(E.length===0&&((gt=i.domElement)==null||gt.ownerDocument.addEventListener("pointermove",ot),(jt=i.domElement)==null||jt.ownerDocument.addEventListener("pointerup",At)),$t(W),W.pointerType==="touch"?Wt(W):Et(W))}function ot(W){i.enabled!==!1&&(W.pointerType==="touch"?ge(W):Tt(W))}function At(W){var gt,jt,D;It(W),E.length===0&&((gt=i.domElement)==null||gt.releasePointerCapture(W.pointerId),(jt=i.domElement)==null||jt.ownerDocument.removeEventListener("pointermove",ot),(D=i.domElement)==null||D.ownerDocument.removeEventListener("pointerup",At)),i.dispatchEvent(a),l=o.NONE}function Et(W){let gt;switch(W.button){case 0:gt=i.mouseButtons.LEFT;break;case 1:gt=i.mouseButtons.MIDDLE;break;case 2:gt=i.mouseButtons.RIGHT;break;default:gt=-1}switch(gt){case Wn.DOLLY:if(i.enableZoom===!1)return;Z(W),l=o.DOLLY;break;case Wn.ROTATE:if(W.ctrlKey||W.metaKey||W.shiftKey){if(i.enablePan===!1)return;rt(W),l=o.PAN}else{if(i.enableRotate===!1)return;vt(W),l=o.ROTATE}break;case Wn.PAN:if(W.ctrlKey||W.metaKey||W.shiftKey){if(i.enableRotate===!1)return;vt(W),l=o.ROTATE}else{if(i.enablePan===!1)return;rt(W),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(s)}function Tt(W){if(i.enabled!==!1)switch(l){case o.ROTATE:if(i.enableRotate===!1)return;St(W);break;case o.DOLLY:if(i.enableZoom===!1)return;_t(W);break;case o.PAN:if(i.enablePan===!1)return;Ot(W);break}}function ne(W){i.enabled===!1||i.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(W.preventDefault(),i.dispatchEvent(s),Xt(W),i.dispatchEvent(a))}function Ft(W){i.enabled===!1||i.enablePan===!1||Gt(W)}function Wt(W){switch(Nt(W),E.length){case 1:switch(i.touches.ONE){case Zi.ROTATE:if(i.enableRotate===!1)return;Qt(),l=o.TOUCH_ROTATE;break;case Zi.PAN:if(i.enablePan===!1)return;F(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(i.touches.TWO){case Zi.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;bt(),l=o.TOUCH_DOLLY_PAN;break;case Zi.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;mt(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(s)}function ge(W){switch(Nt(W),l){case o.TOUCH_ROTATE:if(i.enableRotate===!1)return;dt(W),i.update();break;case o.TOUCH_PAN:if(i.enablePan===!1)return;kt(W),i.update();break;case o.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;zt(W),i.update();break;case o.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;z(W),i.update();break;default:l=o.NONE}}function Dt(W){i.enabled!==!1&&W.preventDefault()}function $t(W){E.push(W)}function It(W){delete L[W.pointerId];for(let gt=0;gt{const u=fs(T=>T.invalidate),p=fs(T=>T.camera),m=fs(T=>T.gl),g=fs(T=>T.events),_=fs(T=>T.setEvents),y=fs(T=>T.set),x=fs(T=>T.get),M=fs(T=>T.performance),b=t||p,S=i||g.connected||m.domElement,R=Q.useMemo(()=>new A$(b),[b]);return Tg(()=>{R.enabled&&R.update()},-1),Q.useEffect(()=>(s&&R.connect(s===!0?S:s),R.connect(S),()=>void R.dispose()),[s,S,e,R,u]),Q.useEffect(()=>{const T=P=>{u(),e&&M.regress(),a&&a(P)},C=P=>{o&&o(P)},N=P=>{l&&l(P)};return R.addEventListener("change",T),R.addEventListener("start",C),R.addEventListener("end",N),()=>{R.removeEventListener("start",C),R.removeEventListener("end",N),R.removeEventListener("change",T)}},[a,o,l,R,u,_]),Q.useEffect(()=>{if(n){const T=x().controls;return y({controls:R}),()=>y({controls:T})}},[n,R]),Q.createElement("primitive",rI({ref:h,object:R,enableDamping:r},c))});function C$(n){const t=Q.useRef(),e=Q.useRef(new _g),i=Q.useRef(new xt),{gl:r,camera:s,scene:a}=fs();let o=0;const l=u=>{u.preventDefault();const p=u.type.startsWith("touch"),m=p?u.touches[0].clientX:u.clientX,g=p?u.touches[0].clientY:u.clientY,_=u.target.getBoundingClientRect();i.current.x=(m-_.left)/_.width*2-1,i.current.y=-(g-_.top)/_.height*2+1,e.current.setFromCamera(i.current,s);const y=e.current.intersectObjects(a.children,!0);if(y.length>0){const x=y[0].object;if(console.log("Intersected Mesh",x),!x)return;if(x.geometry.name&&(x.geometry.name.includes("surrounding")||x.geometry.name.includes("background"))){const M=n.selectedMesh.findIndex(b=>b.geometry.name===x.geometry.name);M>-1?n.setSelectedMesh([...n.selectedMesh.slice(0,M),...n.selectedMesh.slice(M+1)]):n.setSelectedMesh([...n.selectedMesh,{geometry:x.geometry,material:x.material}])}}else console.log("No children in the intersected mesh.")},c=u=>{l(u)},h=u=>{const p=new Date().getTime(),m=p-o;m<300&&m>0&&l(u),o=p};return Q.useEffect(()=>{const u=r.domElement;return u.addEventListener("dblclick",c),u.addEventListener("touchstart",h),()=>{u.removeEventListener("dblclick",c),u.removeEventListener("touchstart",h)}},[s,a]),Tg(()=>{t.current&&t.current.update()}),X.jsx(T$,{ref:t,args:[s,r.domElement],target:n.middle,mouseButtons:{LEFT:Wn.PAN,MIDDLE:Wn.DOLLY,RIGHT:Wn.ROTATE},screenSpacePanning:!1,dampingFactor:1,maxPolarAngle:Math.PI/2})}const fT={type:"change"},C_={type:"start"},dT={type:"end"},wm=new Za,pT=new ds,R$=Math.cos(70*n1.DEG2RAD);class P$ extends qr{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new U,this.cursor=new U,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Wn.ROTATE,MIDDLE:Wn.DOLLY,RIGHT:Wn.PAN},this.touches={ONE:Zi.ROTATE,TWO:Zi.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(D){D.addEventListener("keydown",Wt),this._domElementKeyEvents=D},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Wt),this._domElementKeyEvents=null},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(fT),i.update(),s=r.NONE},this.update=function(){const D=new U,it=new Cn().setFromUnitVectors(t.up,new U(0,1,0)),lt=it.clone().invert(),ut=new U,Ct=new Cn,oe=new U,le=2*Math.PI;return function(Ye=null){const Se=i.object.position;D.copy(Se).sub(i.target),D.applyQuaternion(it),o.setFromVector3(D),i.autoRotate&&s===r.NONE&&B(E(Ye)),i.enableDamping?(o.theta+=l.theta*i.dampingFactor,o.phi+=l.phi*i.dampingFactor):(o.theta+=l.theta,o.phi+=l.phi);let qe=i.minAzimuthAngle,$e=i.maxAzimuthAngle;isFinite(qe)&&isFinite($e)&&(qe<-Math.PI?qe+=le:qe>Math.PI&&(qe-=le),$e<-Math.PI?$e+=le:$e>Math.PI&&($e-=le),qe<=$e?o.theta=Math.max(qe,Math.min($e,o.theta)):o.theta=o.theta>(qe+$e)/2?Math.max(qe,o.theta):Math.min($e,o.theta)),o.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,o.phi)),o.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(h,i.dampingFactor):i.target.add(h),i.target.sub(i.cursor),i.target.clampLength(i.minTargetRadius,i.maxTargetRadius),i.target.add(i.cursor);let Kr=!1;if(i.zoomToCursor&&T||i.object.isOrthographicCamera)o.radius=K(o.radius);else{const Pn=o.radius;o.radius=K(o.radius*c),Kr=Pn!=o.radius}if(D.setFromSpherical(o),D.applyQuaternion(lt),Se.copy(i.target).add(D),i.object.lookAt(i.target),i.enableDamping===!0?(l.theta*=1-i.dampingFactor,l.phi*=1-i.dampingFactor,h.multiplyScalar(1-i.dampingFactor)):(l.set(0,0,0),h.set(0,0,0)),i.zoomToCursor&&T){let Pn=null;if(i.object.isPerspectiveCamera){const Er=D.length();Pn=K(Er*c);const Jr=Er-Pn;i.object.position.addScaledVector(S,Jr),i.object.updateMatrixWorld(),Kr=!!Jr}else if(i.object.isOrthographicCamera){const Er=new U(R.x,R.y,0);Er.unproject(i.object);const Jr=i.object.zoom;i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),Kr=Jr!==i.object.zoom;const Cs=new U(R.x,R.y,0);Cs.unproject(i.object),i.object.position.sub(Cs).add(Er),i.object.updateMatrixWorld(),Pn=D.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Pn!==null&&(this.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Pn).add(i.object.position):(wm.origin.copy(i.object.position),wm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(wm.direction))a||8*(1-Ct.dot(i.object.quaternion))>a||oe.distanceToSquared(i.target)>a?(i.dispatchEvent(fT),ut.copy(i.object.position),Ct.copy(i.object.quaternion),oe.copy(i.target),!0):!1}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",$t),i.domElement.removeEventListener("pointerdown",zt),i.domElement.removeEventListener("pointercancel",O),i.domElement.removeEventListener("wheel",Et),i.domElement.removeEventListener("pointermove",z),i.domElement.removeEventListener("pointerup",O),i.domElement.getRootNode().removeEventListener("keydown",ne,{capture:!0}),i._domElementKeyEvents!==null&&(i._domElementKeyEvents.removeEventListener("keydown",Wt),i._domElementKeyEvents=null)};const i=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=r.NONE;const a=1e-6,o=new sf,l=new sf;let c=1;const h=new U,u=new xt,p=new xt,m=new xt,g=new xt,_=new xt,y=new xt,x=new xt,M=new xt,b=new xt,S=new U,R=new xt;let T=!1;const C=[],N={};let P=!1;function E(D){return D!==null?2*Math.PI/60*i.autoRotateSpeed*D:2*Math.PI/60/60*i.autoRotateSpeed}function L(D){const it=Math.abs(D*.01);return Math.pow(.95,i.zoomSpeed*it)}function B(D){l.theta-=D}function V(D){l.phi-=D}const j=function(){const D=new U;return function(lt,ut){D.setFromMatrixColumn(ut,0),D.multiplyScalar(-lt),h.add(D)}}(),Y=function(){const D=new U;return function(lt,ut){i.screenSpacePanning===!0?D.setFromMatrixColumn(ut,1):(D.setFromMatrixColumn(ut,0),D.crossVectors(i.object.up,D)),D.multiplyScalar(lt),h.add(D)}}(),q=function(){const D=new U;return function(lt,ut){const Ct=i.domElement;if(i.object.isPerspectiveCamera){const oe=i.object.position;D.copy(oe).sub(i.target);let le=D.length();le*=Math.tan(i.object.fov/2*Math.PI/180),j(2*lt*le/Ct.clientHeight,i.object.matrix),Y(2*ut*le/Ct.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(j(lt*(i.object.right-i.object.left)/i.object.zoom/Ct.clientWidth,i.object.matrix),Y(ut*(i.object.top-i.object.bottom)/i.object.zoom/Ct.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function at(D){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c/=D:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function G(D){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c*=D:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function nt(D,it){if(!i.zoomToCursor)return;T=!0;const lt=i.domElement.getBoundingClientRect(),ut=D-lt.left,Ct=it-lt.top,oe=lt.width,le=lt.height;R.x=ut/oe*2-1,R.y=-(Ct/le)*2+1,S.set(R.x,R.y,1).unproject(i.object).sub(i.object.position).normalize()}function K(D){return Math.max(i.minDistance,Math.min(i.maxDistance,D))}function $(D){u.set(D.clientX,D.clientY)}function ht(D){nt(D.clientX,D.clientX),x.set(D.clientX,D.clientY)}function vt(D){g.set(D.clientX,D.clientY)}function Z(D){p.set(D.clientX,D.clientY),m.subVectors(p,u).multiplyScalar(i.rotateSpeed);const it=i.domElement;B(2*Math.PI*m.x/it.clientHeight),V(2*Math.PI*m.y/it.clientHeight),u.copy(p),i.update()}function rt(D){M.set(D.clientX,D.clientY),b.subVectors(M,x),b.y>0?at(L(b.y)):b.y<0&&G(L(b.y)),x.copy(M),i.update()}function St(D){_.set(D.clientX,D.clientY),y.subVectors(_,g).multiplyScalar(i.panSpeed),q(y.x,y.y),g.copy(_),i.update()}function _t(D){nt(D.clientX,D.clientY),D.deltaY<0?G(L(D.deltaY)):D.deltaY>0&&at(L(D.deltaY)),i.update()}function Ot(D){let it=!1;switch(D.code){case i.keys.UP:D.ctrlKey||D.metaKey||D.shiftKey?V(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(0,i.keyPanSpeed),it=!0;break;case i.keys.BOTTOM:D.ctrlKey||D.metaKey||D.shiftKey?V(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(0,-i.keyPanSpeed),it=!0;break;case i.keys.LEFT:D.ctrlKey||D.metaKey||D.shiftKey?B(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(i.keyPanSpeed,0),it=!0;break;case i.keys.RIGHT:D.ctrlKey||D.metaKey||D.shiftKey?B(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(-i.keyPanSpeed,0),it=!0;break}it&&(D.preventDefault(),i.update())}function Xt(D){if(C.length===1)u.set(D.pageX,D.pageY);else{const it=gt(D),lt=.5*(D.pageX+it.x),ut=.5*(D.pageY+it.y);u.set(lt,ut)}}function Gt(D){if(C.length===1)g.set(D.pageX,D.pageY);else{const it=gt(D),lt=.5*(D.pageX+it.x),ut=.5*(D.pageY+it.y);g.set(lt,ut)}}function Qt(D){const it=gt(D),lt=D.pageX-it.x,ut=D.pageY-it.y,Ct=Math.sqrt(lt*lt+ut*ut);x.set(0,Ct)}function F(D){i.enableZoom&&Qt(D),i.enablePan&&Gt(D)}function wt(D){i.enableZoom&&Qt(D),i.enableRotate&&Xt(D)}function bt(D){if(C.length==1)p.set(D.pageX,D.pageY);else{const lt=gt(D),ut=.5*(D.pageX+lt.x),Ct=.5*(D.pageY+lt.y);p.set(ut,Ct)}m.subVectors(p,u).multiplyScalar(i.rotateSpeed);const it=i.domElement;B(2*Math.PI*m.x/it.clientHeight),V(2*Math.PI*m.y/it.clientHeight),u.copy(p)}function mt(D){if(C.length===1)_.set(D.pageX,D.pageY);else{const it=gt(D),lt=.5*(D.pageX+it.x),ut=.5*(D.pageY+it.y);_.set(lt,ut)}y.subVectors(_,g).multiplyScalar(i.panSpeed),q(y.x,y.y),g.copy(_)}function dt(D){const it=gt(D),lt=D.pageX-it.x,ut=D.pageY-it.y,Ct=Math.sqrt(lt*lt+ut*ut);M.set(0,Ct),b.set(0,Math.pow(M.y/x.y,i.zoomSpeed)),at(b.y),x.copy(M);const oe=(D.pageX+it.x)*.5,le=(D.pageY+it.y)*.5;nt(oe,le)}function kt(D){i.enableZoom&&dt(D),i.enablePan&&mt(D)}function Rt(D){i.enableZoom&&dt(D),i.enableRotate&&bt(D)}function zt(D){i.enabled!==!1&&(C.length===0&&(i.domElement.setPointerCapture(D.pointerId),i.domElement.addEventListener("pointermove",z),i.domElement.addEventListener("pointerup",O)),!qt(D)&&(It(D),D.pointerType==="touch"?ge(D):ot(D)))}function z(D){i.enabled!==!1&&(D.pointerType==="touch"?Dt(D):At(D))}function O(D){switch(Nt(D),C.length){case 0:i.domElement.releasePointerCapture(D.pointerId),i.domElement.removeEventListener("pointermove",z),i.domElement.removeEventListener("pointerup",O),i.dispatchEvent(dT),s=r.NONE;break;case 1:const it=C[0],lt=N[it];ge({pointerId:it,pageX:lt.x,pageY:lt.y});break}}function ot(D){let it;switch(D.button){case 0:it=i.mouseButtons.LEFT;break;case 1:it=i.mouseButtons.MIDDLE;break;case 2:it=i.mouseButtons.RIGHT;break;default:it=-1}switch(it){case Wn.DOLLY:if(i.enableZoom===!1)return;ht(D),s=r.DOLLY;break;case Wn.ROTATE:if(D.ctrlKey||D.metaKey||D.shiftKey){if(i.enablePan===!1)return;vt(D),s=r.PAN}else{if(i.enableRotate===!1)return;$(D),s=r.ROTATE}break;case Wn.PAN:if(D.ctrlKey||D.metaKey||D.shiftKey){if(i.enableRotate===!1)return;$(D),s=r.ROTATE}else{if(i.enablePan===!1)return;vt(D),s=r.PAN}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(C_)}function At(D){switch(s){case r.ROTATE:if(i.enableRotate===!1)return;Z(D);break;case r.DOLLY:if(i.enableZoom===!1)return;rt(D);break;case r.PAN:if(i.enablePan===!1)return;St(D);break}}function Et(D){i.enabled===!1||i.enableZoom===!1||s!==r.NONE||(D.preventDefault(),i.dispatchEvent(C_),_t(Tt(D)),i.dispatchEvent(dT))}function Tt(D){const it=D.deltaMode,lt={clientX:D.clientX,clientY:D.clientY,deltaY:D.deltaY};switch(it){case 1:lt.deltaY*=16;break;case 2:lt.deltaY*=100;break}return D.ctrlKey&&!P&&(lt.deltaY*=10),lt}function ne(D){D.key==="Control"&&(P=!0,i.domElement.getRootNode().addEventListener("keyup",Ft,{passive:!0,capture:!0}))}function Ft(D){D.key==="Control"&&(P=!1,i.domElement.getRootNode().removeEventListener("keyup",Ft,{passive:!0,capture:!0}))}function Wt(D){i.enabled===!1||i.enablePan===!1||Ot(D)}function ge(D){switch(W(D),C.length){case 1:switch(i.touches.ONE){case Zi.ROTATE:if(i.enableRotate===!1)return;Xt(D),s=r.TOUCH_ROTATE;break;case Zi.PAN:if(i.enablePan===!1)return;Gt(D),s=r.TOUCH_PAN;break;default:s=r.NONE}break;case 2:switch(i.touches.TWO){case Zi.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;F(D),s=r.TOUCH_DOLLY_PAN;break;case Zi.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;wt(D),s=r.TOUCH_DOLLY_ROTATE;break;default:s=r.NONE}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(C_)}function Dt(D){switch(W(D),s){case r.TOUCH_ROTATE:if(i.enableRotate===!1)return;bt(D),i.update();break;case r.TOUCH_PAN:if(i.enablePan===!1)return;mt(D),i.update();break;case r.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;kt(D),i.update();break;case r.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Rt(D),i.update();break;default:s=r.NONE}}function $t(D){i.enabled!==!1&&D.preventDefault()}function It(D){C.push(D.pointerId)}function Nt(D){delete N[D.pointerId];for(let it=0;it{const{camera:e,gl:i,scene:r}=fs(),s=Q.useRef(new _g),a=Q.useRef(new xt),o=Q.useRef();Q.useEffect(()=>(o.current=new P$(e,i.domElement),o.current.target=n,o.current.mouseButtons={MIDDLE:Wn.DOLLY,RIGHT:Wn.ROTATE},o.current.screenSpacePanning=!1,o.current.maxPolarAngle=Math.PI/2,o.current.update(),()=>{o.current.dispose()}),[e,i,n]);const l=c=>{if(c.button!==0)return;const h=c.target.getBoundingClientRect();a.current.x=(c.clientX-h.left)/h.width*2-1,a.current.y=-(c.clientY-h.top)/h.height*2+1,s.current.setFromCamera(a.current,e);const u=s.current.intersectObjects(r.children,!0);if(u.length>0){const p=u[0],m=p.point;if(!p.face){console.log("Intersaction.face was null.");return}const g=p.face.normal.clone().transformDirection(p.object.matrixWorld);t(_=>[..._,{point:m,normal:g}])}};return Q.useEffect(()=>(i.domElement.addEventListener("pointerdown",l),()=>{i.domElement.removeEventListener("pointerdown",l)}),[i]),Tg(()=>{o.current&&o.current.update()}),null};function L$({meshes:n}){return X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx("mesh",{geometry:t.geometry,material:new zf({color:"#2b2c40",transparent:!1})},e))})}const D$=({meshes:n})=>X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx("mesh",{geometry:t.geometry,children:X.jsx("meshLambertMaterial",{vertexColors:!0,side:hi})},e))}),mT=({geometries:n})=>X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx("mesh",{geometry:t,children:X.jsx("meshLambertMaterial",{vertexColors:!1,color:11245952,side:hi})},e))}),gT=["#27AD6B","#2DBE76","#33CC80"],yT=({geometries:n})=>{const t=Q.useMemo(()=>n.map(()=>gT[Math.floor(Math.random()*gT.length)]),[n]);return X.jsx(X.Fragment,{children:n.map((e,i)=>X.jsx("mesh",{geometry:e,children:X.jsx("meshLambertMaterial",{vertexColors:!1,color:t[i],side:hi})},i))})},N$=({points:n})=>{const t=Q.useMemo(()=>{const e=n.map((o,l)=>{const c=new ve().setFromPoints([o.point]),h=new Of({color:"#333333",size:10,sizeAttenuation:!1});return X.jsx("points",{geometry:c,material:h},`point-${l}`)}),i=new ve,r=[];for(let o=0;o{const t=n.zoom,e=n.x,i=n.y,r=n.divisions,s=`https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_farbe/default/GLOBAL_WEBMERCATOR/${t}/${i}/${e}.png`;let[a,o]=Q.useState(null),[l,c]=Q.useState(null),[h,u]=Q.useState(!1),p=X.jsx(X.Fragment,{children:h&&X.jsx("mesh",{geometry:a,material:l})});return Q.useEffect(()=>{async function m(){const g=new S1().loadAsync(s),[_,y,x,M]=bI(e,i,t);let b=[],S=[],R=[],T=0;const C=r+1;for(let j=0;j<=r;j++)for(let Y=0;Y<=r;Y++){const q=_+Y/r*(x-_),at=y+j/r*(M-y);b.push(Sv.toPoint3D(q,at)),S=S.concat([Y/r,1-j/r]),Y>0&&j>0&&(R=R.concat([T-C-1,T-1,T-C,T-C,T-1,T])),T+=1}b=await Promise.all(b);const N=new Float32Array(b.flatMap(j=>j.point)),P=new Float32Array(b.flatMap(j=>j.normal)),E=new Float32Array(S),L=new Uint32Array(R),B=new ve;B.setAttribute("position",new Pe(N,3)),B.setAttribute("normal",new Pe(P,3)),B.setAttribute("uv",new Pe(E,2)),B.setIndex(new Pe(L,1)),o(B);const V=await g;V.colorSpace=Tn,c(new zf({flatShading:!1,map:await g,side:Gr})),u(!0)}m()},[]),p},F$=({visible:n})=>{const[t,e]=wI,[i,r]=Q.useState([]),s=Math.floor(t*16),a=Math.floor(e*16);let o=[];for(let l=-11;l<=11;l++)for(let c=-11;c<=11;c++)o.push({dx:l,dy:c,divisions:2});return o.sort((l,c)=>l.dx*l.dx+l.dy*l.dy-(c.dx*c.dx+c.dy*c.dy)),Q.useEffect(()=>{let l=[];const c=h=>{if(hc(h+1),0)}};return c(0),()=>{r([])}},[s,a]),X.jsx("group",{visible:n,children:i})},U$=({geometries:n,simulationMeshes:t,showTerrain:e,frontendState:i,pvSystems:r,selectedMesh:s,setSelectedMesh:a,pvPoints:o,setPVPoints:l,vegetationGeometries:c})=>{window.setPVPoints=l;const h=[t[0].middle.x,t[0].middle.y-40,t[0].middle.z+80],u=Q.useRef();return X.jsxs(r$,{camera:{fov:45,near:1,far:2e4,position:h,up:[0,0,1],ref:u},children:[X.jsx("ambientLight",{intensity:2}),X.jsx("directionalLight",{intensity:1,position:[0,-1,-2]}),X.jsx("directionalLight",{intensity:.5,position:[1,0,-2]}),X.jsx("directionalLight",{intensity:.5,position:[-1,0,-2]}),n.surrounding.length>0&&X.jsx(mT,{geometries:n.surrounding}),n.background.length>0&&X.jsx(mT,{geometries:n.background}),t.length>0&&X.jsx(D$,{meshes:t}),s&&X.jsx(L$,{meshes:s}),t.length>0&&i=="Results"&&X.jsx(C$,{middle:t[0].middle,selectedMesh:s,setSelectedMesh:a}),i=="DrawPV"&&X.jsx(I$,{middle:t[0].middle,setPVPoints:l}),i=="DrawPV"&&X.jsx(N$,{points:o}),r.length>0&&X.jsx(a$,{pvSystems:r}),c&&X.jsxs(X.Fragment,{children:[c.background&&c.background.length>0&&X.jsx(yT,{geometries:c.background}),c.surrounding&&c.surrounding.length>0&&X.jsx(yT,{geometries:c.surrounding})]}),t.length>0&&X.jsx(F$,{visible:e})]})};function k$(){const n=sI(),[t,e]=Q.useState("Loading"),[i,r]=Q.useState(!0),[s,a]=Q.useState(0),[o,l]=Q.useState([]),[c,h]=Q.useState([]),[u,p]=Q.useState(!1);window.setFederalState=p;const[m,g]=Q.useState({simulation:[],surrounding:[],background:[]}),[_,y]=Q.useState([]),[x,M]=Q.useState([]);window.setGeometries=g,window.setFrontendState=e,window.setSimulationProgress=a;const[b,S]=Q.useState([]);window.setVegetationGeometries=S;const R=async()=>{const{simulationMesh:T}=await cq(n);T&&(M([...x,T]),e("Results"))};return Q.useEffect(()=>{R()},[]),X.jsx(aI,{description:"Berechne das Potential deiner Solaranlage.",children:X.jsxs("div",{className:"content",children:[(t=="Results"||t=="DrawPV")&&X.jsx(x$,{frontendState:t,setFrontendState:e,showTerrain:i,setShowTerrain:r,selectedMesh:_,setSelectedMesh:y,geometries:m,geoLocation:n,setPVSystems:l,pvSystems:o,pvPoints:c,setPVPoints:h,simulationMeshes:x,setSimulationMeshes:M}),t=="ErrorAdress"&&X.jsx(g5,{}),(t=="Results"||t=="DrawPV")&&X.jsx(U$,{geometries:m,simulationMeshes:x,showTerrain:i,frontendState:t,pvSystems:o,setPVSystems:l,selectedMesh:_,setSelectedMesh:y,pvPoints:c,setPVPoints:h,vegetationGeometries:b}),t=="Loading"&&X.jsx(y5,{progress:s}),X.jsx(gI,{federalState:u,frontendState:t})]})})}const CY=Object.freeze(Object.defineProperty({__proto__:null,default:k$},Symbol.toStringTag,{value:"Module"}));export{vY as L,CY as S,MY as a,AY as i}; + `)+f.join(" > ")}return null},e.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return q(f.child.stateNode);default:return f.child.stateNode}},e.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:YP,findFiberByHostInstance:f.findFiberByHostInstance||ZP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)f=!0;else{try{od=d.inject(f),Qr=d}catch{}f=!!d.checkDCE}}return f},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(f,d,v,w){if(!z)throw Error(a(363));f=vy(f,d);var A=Ft(f,v,w).disconnect;return{disconnect:function(){A()}}},e.registerMutableSourceForHydration=function(f,d){var v=d._getVersion;v=v(d._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[d,v]:f.mutableSourceEagerHydrationData.push(d,v)},e.runWithPriority=function(f,d){var v=ke;try{return ke=f,d()}finally{ke=v}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(f,d,v,w){var A=d.current,I=mi(),H=pa(A);return v=Xw(v),d.context===null?d.context=v:d.pendingContext=v,d=Ps(I,H),d.payload={element:f},w=w===void 0?null:w,w!==null&&(d.callback=w),ua(A,d),f=lr(A,H,I),f!==null&&fd(f,A,H),H},e};V3.exports=_q;var vq=V3.exports;const Mq=vf(vq),mM={},wq=n=>void Object.assign(mM,n);function bq(n,t){function e(h,{args:u=[],attach:p,...m},g){let _=`${h[0].toUpperCase()}${h.slice(1)}`,y;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const x=m.object;y=_c(x,{type:h,root:g,attach:p,primitive:!0})}else{const x=mM[_];if(!x)throw new Error(`R3F: ${_} 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(!Array.isArray(u))throw new Error("R3F: The args prop must be an array!");y=_c(new x(...u),{type:h,root:g,attach:p,memoizedProps:{args:u}})}return y.__r3f.attach===void 0&&(y instanceof ve?y.__r3f.attach="geometry":y instanceof Rn&&(y.__r3f.attach="material")),_!=="inject"&&w_(y,m),y}function i(h,u){let p=!1;if(u){var m,g;(m=u.__r3f)!=null&&m.attach?M_(h,u,u.__r3f.attach):u.isObject3D&&h.isObject3D&&(h.add(u),p=!0),p||(g=h.__r3f)==null||g.objects.push(u),u.__r3f||_c(u,{}),u.__r3f.parent=h,wv(u),vc(u)}}function r(h,u,p){let m=!1;if(u){var g,_;if((g=u.__r3f)!=null&&g.attach)M_(h,u,u.__r3f.attach);else if(u.isObject3D&&h.isObject3D){u.parent=h,u.dispatchEvent({type:"added"}),h.dispatchEvent({type:"childadded",child:u});const y=h.children.filter(M=>M!==u),x=y.indexOf(p);h.children=[...y.slice(0,x),u,...y.slice(x)],m=!0}m||(_=h.__r3f)==null||_.objects.push(u),u.__r3f||_c(u,{}),u.__r3f.parent=h,wv(u),vc(u)}}function s(h,u,p=!1){h&&[...h].forEach(m=>a(u,m,p))}function a(h,u,p){if(u){var m,g,_;if(u.__r3f&&(u.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(S=>S!==u)),(g=u.__r3f)!=null&&g.attach)tT(h,u,u.__r3f.attach);else if(u.isObject3D&&h.isObject3D){var y;h.remove(u),(y=u.__r3f)!=null&&y.root&&Iq(Um(u),u)}const M=(_=u.__r3f)==null?void 0:_.primitive,b=!M&&(p===void 0?u.dispose!==null:p);if(!M){var x;s((x=u.__r3f)==null?void 0:x.objects,u,b),s(u.children,u,b)}if(delete u.__r3f,b&&u.dispose&&u.type!=="Scene"){const S=()=>{try{u.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?vv.unstable_scheduleCallback(vv.unstable_IdlePriority,S):S()}vc(h)}}function o(h,u,p,m){var g;const _=(g=h.__r3f)==null?void 0:g.parent;if(!_)return;const y=e(u,p,h.__r3f.root);if(h.children){for(const x of h.children)x.__r3f&&i(y,x);h.children=h.children.filter(x=>!x.__r3f)}h.__r3f.objects.forEach(x=>i(y,x)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||a(_,h),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(_,y),y.raycast&&y.__r3f.eventCount&&Um(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(x=>{x!==null&&(x.stateNode=y,x.ref&&(typeof x.ref=="function"?x.ref(y):x.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:Mq({createInstance:e,removeChild:a,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,u)=>{if(!u)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,u))},removeChildFromContainer:(h,u)=>{u&&a(h.getState().scene,u)},insertInContainerBefore:(h,u,p)=>{if(!u||!p)return;const m=h.getState().scene;m.__r3f&&r(m,u,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var u;return!!((u=h==null?void 0:h.__r3f)!=null?u:{}).handlers},prepareUpdate(h,u,p,m){var g;if(((g=h==null?void 0:h.__r3f)!=null?g:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:y=[],children:x,...M}=m,{args:b=[],children:S,...R}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((T,N)=>T!==b[N]))return[!0];const C=J3(h,M,R,!0);return C.changes.length?[!1,C]:null}},commitUpdate(h,[u,p],m,g,_,y){u?o(h,m,_,y):w_(h,p)},commitMount(h,u,p,m){var g;const _=(g=h.__r3f)!=null?g:{};h.raycast&&_.handlers&&_.eventCount&&Um(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>_c(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var u;const{attach:p,parent:m}=(u=h.__r3f)!=null?u:{};p&&m&&tT(m,h,p),h.isObject3D&&(h.visible=!1),vc(h)},unhideInstance(h,u){var p;const{attach:m,parent:g}=(p=h.__r3f)!=null?p:{};m&&g&&M_(g,h,m),(h.isObject3D&&u.visible==null||u.visible)&&(h.visible=!0),vc(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>t?t():Cc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&nn.fun(performance.now)?performance.now:nn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:nn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:nn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:w_}}var ZA,KA;const v_=n=>"colorSpace"in n||"outputColorSpace"in n,X3=()=>{var n;return(n=mM.ColorManagement)!=null?n:null},q3=n=>n&&n.isOrthographicCamera,Sq=n=>n&&n.hasOwnProperty("current"),td=typeof window<"u"&&((ZA=window.document)!=null&&ZA.createElement||((KA=window.navigator)==null?void 0:KA.product)==="ReactNative")?Q.useLayoutEffect:Q.useEffect;function $3(n){const t=Q.useRef(n);return td(()=>void(t.current=n),[n]),t}function Eq({set:n}){return td(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class Y3 extends Q.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}}Y3.getDerivedStateFromError=()=>({error:!0});const Z3="__default",JA=new Map,Aq=n=>n&&!!n.memoized&&!!n.changes;function K3(n){var t;const e=typeof window<"u"?(t=window.devicePixelRatio)!=null?t:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const au=n=>{var t;return(t=n.__r3f)==null?void 0:t.root.getState()};function Um(n){let t=n.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const nn={obj:n=>n===Object(n)&&!nn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,t,{arrays:e="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof t||!!n!=!!t)return!1;if(nn.str(n)||nn.num(n)||nn.boo(n))return n===t;const s=nn.obj(n);if(s&&i==="reference")return n===t;const a=nn.arr(n);if(a&&e==="reference")return n===t;if((a||s)&&n===t)return!0;let o;for(o in n)if(!(o in t))return!1;if(s&&e==="shallow"&&i==="shallow"){for(o in r?t:n)if(!nn.equ(n[o],t[o],{strict:r,objects:"reference"}))return!1}else for(o in r?t:n)if(n[o]!==t[o])return!1;if(nn.und(o)){if(a&&n.length===0&&t.length===0||s&&Object.keys(n).length===0&&Object.keys(t).length===0)return!0;if(n!==t)return!1}return!0}};function Tq(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const t in n)t.dispose==null||t.dispose(),delete n[t]}function _c(n,t){const e=n;return e.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},n}function Mv(n,t){let e=n;if(t.includes("-")){const i=t.split("-"),r=i.pop();return e=i.reduce((s,a)=>s[a],n),{target:e,key:r}}else return{target:e,key:t}}const QA=/-\d+$/;function M_(n,t,e){if(nn.str(e)){if(QA.test(e)){const s=e.replace(QA,""),{target:a,key:o}=Mv(n,s);Array.isArray(a[o])||(a[o]=[])}const{target:i,key:r}=Mv(n,e);t.__r3f.previousAttach=i[r],i[r]=t}else t.__r3f.previousAttach=e(n,t)}function tT(n,t,e){var i,r;if(nn.str(e)){const{target:s,key:a}=Mv(n,e),o=t.__r3f.previousAttach;o===void 0?delete s[a]:s[a]=o}else(i=t.__r3f)==null||i.previousAttach==null||i.previousAttach(n,t);(r=t.__r3f)==null||delete r.previousAttach}function J3(n,{children:t,key:e,ref:i,...r},{children:s,key:a,ref:o,...l}={},c=!1){const h=n.__r3f,u=Object.entries(r),p=[];if(c){const g=Object.keys(l);for(let _=0;_{var y;if((y=n.__r3f)!=null&&y.primitive&&g==="object"||nn.equ(_,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return p.push([g,_,!0,[]]);let x=[];g.includes("-")&&(x=g.split("-")),p.push([g,_,!1,x]);for(const M in r){const b=r[M];M.startsWith(`${g}-`)&&p.push([M,b,!1,M.split("-")])}});const m={...r};return h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.args&&(m.args=h.memoizedProps.args),h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.attach&&(m.attach=h.memoizedProps.attach),{memoized:m,changes:p}}const Cq=typeof process<"u"&&!1;function w_(n,t){var e;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:a,changes:o}=Aq(t)?t:J3(n,t),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=a);for(let h=0;hx[M],n),!(y&&y.set))){const[x,...M]=g.reverse();_=M.reverse().reduce((b,S)=>b[S],n),u=x}if(p===Z3+"remove")if(_.constructor){let x=JA.get(_.constructor);x||(x=new _.constructor,JA.set(_.constructor,x)),p=x[u]}else p=0;if(m&&i)p?i.handlers[u]=p:delete i.handlers[u],i.eventCount=Object.keys(i.handlers).length;else if(y&&y.set&&(y.copy||y instanceof qo)){if(Array.isArray(p))y.fromArray?y.fromArray(p):y.set(...p);else if(y.copy&&p&&p.constructor&&(Cq?y.constructor.name===p.constructor.name:y.constructor===p.constructor))y.copy(p);else if(p!==void 0){const x=y instanceof Ht;!x&&y.setScalar?y.setScalar(p):y instanceof qo&&p instanceof qo?y.mask=p.mask:y.set(p),!X3()&&s&&!s.linear&&x&&y.convertSRGBToLinear()}}else if(_[u]=p,_[u]instanceof Mn&&_[u].format===ui&&_[u].type===Vr&&s){const x=_[u];v_(x)&&v_(s.gl)?x.colorSpace=s.gl.outputColorSpace:x.encoding=s.gl.outputEncoding}vc(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const h=Um(n).getState().internal,u=h.interaction.indexOf(n);u>-1&&h.interaction.splice(u,1),i.eventCount&&h.interaction.push(n)}return!(o.length===1&&o[0][0]==="onUpdate")&&o.length&&(e=n.__r3f)!=null&&e.parent&&wv(n),n}function vc(n){var t,e;const i=(t=n.__r3f)==null||(e=t.root)==null||e.getState==null?void 0:e.getState();i&&i.internal.frames===0&&i.invalidate()}function wv(n){n.onUpdate==null||n.onUpdate(n)}function Rq(n,t){n.manual||(q3(n)?(n.left=t.width/-2,n.right=t.width/2,n.top=t.height/2,n.bottom=t.height/-2):n.aspect=t.width/t.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function _m(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function Pq(){var n;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Cc.DefaultEventPriority;switch((n=t.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Cc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Cc.ContinuousEventPriority;default:return Cc.DefaultEventPriority}}function Q3(n,t,e,i){const r=e.get(t);r&&(e.delete(t),e.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function Iq(n,t){const{internal:e}=n.getState();e.interaction=e.interaction.filter(i=>i!==t),e.initialHits=e.initialHits.filter(i=>i!==t),e.hovered.forEach((i,r)=>{(i.eventObject===t||i.object===t)&&e.hovered.delete(r)}),e.capturedMap.forEach((i,r)=>{Q3(e.capturedMap,t,i,r)})}function Lq(n){function t(l){const{internal:c}=n.getState(),h=l.offsetX-c.initialClick[0],u=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(h*h+u*u))}function e(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(h=>{var u;return(u=c.__r3f)==null?void 0:u.handlers["onPointer"+h]}))}function i(l,c){const h=n.getState(),u=new Set,p=[],m=c?c(h.internal.interaction):h.internal.interaction;for(let x=0;x{const b=au(x.object),S=au(M.object);return!b||!S?x.distance-M.distance:S.events.priority-b.events.priority||x.distance-M.distance}).filter(x=>{const M=_m(x);return u.has(M)?!1:(u.add(M),!0)});h.events.filter&&(_=h.events.filter(_,h));for(const x of _){let M=x.object;for(;M;){var y;(y=M.__r3f)!=null&&y.eventCount&&p.push({...x,eventObject:M}),M=M.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let x of h.internal.capturedMap.get(l.pointerId).values())u.has(_m(x.intersection))||p.push(x.intersection);return p}function r(l,c,h,u){const p=n.getState();if(l.length){const m={stopped:!1};for(const g of l){const _=au(g.object)||p,{raycaster:y,pointer:x,camera:M,internal:b}=_,S=new U(x.x,x.y,0).unproject(M),R=E=>{var L,B;return(L=(B=b.capturedMap.get(E))==null?void 0:B.has(g.eventObject))!=null?L:!1},C=E=>{const L={intersection:g,target:c.target};b.capturedMap.has(E)?b.capturedMap.get(E).set(g.eventObject,L):b.capturedMap.set(E,new Map([[g.eventObject,L]])),c.target.setPointerCapture(E)},T=E=>{const L=b.capturedMap.get(E);L&&Q3(b.capturedMap,g.eventObject,L,E)};let N={};for(let E in c){let L=c[E];typeof L!="function"&&(N[E]=L)}let P={...g,...N,pointer:x,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:S,ray:y.ray,camera:M,stopPropagation(){const E="pointerId"in c&&b.capturedMap.get(c.pointerId);if((!E||E.has(g.eventObject))&&(P.stopped=m.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(L=>L.eventObject===g.eventObject))){const L=l.slice(0,l.indexOf(g));s([...L,g])}},target:{hasPointerCapture:R,setPointerCapture:C,releasePointerCapture:T},currentTarget:{hasPointerCapture:R,setPointerCapture:C,releasePointerCapture:T},nativeEvent:c};if(u(P),m.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const h of c.hovered.values())if(!l.length||!l.find(u=>u.object===h.object&&u.index===h.index&&u.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(c.hovered.delete(_m(h)),p!=null&&p.eventCount){const g={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(g),m.onPointerLeave==null||m.onPointerLeave(g)}}}function a(l,c){for(let h=0;hs([]);case"onLostPointerCapture":return c=>{const{internal:h}=n.getState();"pointerId"in c&&h.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(c.pointerId)&&(h.capturedMap.delete(c.pointerId),s([]))})}}return function(h){const{onPointerMissed:u,internal:p}=n.getState();p.lastEvent.current=h;const m=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(h,m?e:void 0),x=g?t(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=y.map(b=>b.eventObject)),g&&!y.length&&x<=2&&(a(h,p.interaction),u&&u(h)),m&&s(y);function M(b){const S=b.eventObject,R=S.__r3f,C=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(m){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const T=_m(b),N=p.hovered.get(T);N?N.stopped&&b.stopPropagation():(p.hovered.set(T,b),C.onPointerOver==null||C.onPointerOver(b),C.onPointerEnter==null||C.onPointerEnter(b))}C.onPointerMove==null||C.onPointerMove(b)}else{const T=C[l];T?(!g||p.initialHits.includes(S))&&(a(h,p.interaction.filter(N=>!p.initialHits.includes(N))),T(b)):g&&p.initialHits.includes(S)&&a(h,p.interaction.filter(N=>!p.initialHits.includes(N)))}}r(y,h,x,M)}}return{handlePointer:o}}const tP=n=>!!(n!=null&&n.render),eP=Q.createContext(null),Dq=(n,t)=>{const e=xq((o,l)=>{const c=new U,h=new U,u=new U;function p(x=l().camera,M=h,b=l().size){const{width:S,height:R,top:C,left:T}=b,N=S/R;M instanceof U?u.copy(M):u.set(...M);const P=x.getWorldPosition(c).distanceTo(u);if(q3(x))return{width:S/x.zoom,height:R/x.zoom,top:C,left:T,factor:1,distance:P,aspect:N};{const E=x.fov*Math.PI/180,L=2*Math.tan(E/2)*P,B=L*(S/R);return{width:B,height:L,top:C,left:T,factor:S/B,distance:P,aspect:N}}}let m;const g=x=>o(M=>({performance:{...M.performance,current:x}})),_=new xt;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(x=1)=>n(l(),x),advance:(x,M)=>t(x,M,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new P1,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const x=l();m&&clearTimeout(m),x.performance.current!==x.performance.min&&g(x.performance.min),m=setTimeout(()=>g(l().performance.max),x.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:x=>o(M=>({...M,events:{...M.events,...x}})),setSize:(x,M,b,S,R)=>{const C=l().camera,T={width:x,height:M,top:S||0,left:R||0,updateStyle:b};o(N=>({size:T,viewport:{...N.viewport,...p(C,h,T)}}))},setDpr:x=>o(M=>{const b=K3(x);return{viewport:{...M.viewport,dpr:b,initialDpr:M.viewport.initialDpr||b}}}),setFrameloop:(x="always")=>{const M=l().clock;M.stop(),M.elapsedTime=0,x!=="never"&&(M.start(),M.elapsedTime=0),o(()=>({frameloop:x}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Q.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(x,M,b)=>{const S=l().internal;return S.priority=S.priority+(M>0?1:0),S.subscribers.push({ref:x,priority:M,store:b}),S.subscribers=S.subscribers.sort((R,C)=>R.priority-C.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(M>0?1:0),R.subscribers=R.subscribers.filter(C=>C.ref!==x))}}}}}),i=e.getState();let r=i.size,s=i.viewport.dpr,a=i.camera;return e.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:h,set:u}=e.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var p;r=l,s=c.dpr,Rq(o,l),h.setPixelRatio(c.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}o!==a&&(a=o,u(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(o)}})))}),e.subscribe(o=>n(o)),e};let vm,Nq=new Set,Oq=new Set,Fq=new Set;function b_(n,t){if(n.size)for(const{callback:e}of n.values())e(t)}function ou(n,t){switch(n){case"before":return b_(Nq,t);case"after":return b_(Oq,t);case"tail":return b_(Fq,t)}}let S_,E_;function A_(n,t,e){let i=t.clock.getDelta();for(t.frameloop==="never"&&typeof n=="number"&&(i=n-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=n),S_=t.internal.subscribers,vm=0;vm0)&&!((h=s.gl.xr)!=null&&h.isPresenting)&&(i+=A_(c,s))}if(e=!1,ou("after",c),i===0)return ou("tail",c),t=!1,cancelAnimationFrame(r)}function o(c,h=1){var u;if(!c)return n.forEach(p=>o(p.store.getState(),h));(u=c.gl.xr)!=null&&u.isPresenting||!c.internal.active||c.frameloop==="never"||(h>1?c.internal.frames=Math.min(60,c.internal.frames+h):e?c.internal.frames=2:c.internal.frames=1,t||(t=!0,requestAnimationFrame(a)))}function l(c,h=!0,u,p){if(h&&ou("before",c),u)A_(c,u,p);else for(const m of n.values())A_(c,m.store.getState());h&&ou("after",c)}return{loop:a,invalidate:o,advance:l}}function nP(){const n=Q.useContext(eP);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function fs(n=e=>e,t){return nP()(n,t)}function Tg(n,t=0){const e=nP(),i=e.getState().internal.subscribe,r=$3(n);return td(()=>i(r,t,e),[t,i,e]),null}const ih=new Map,{invalidate:eT,advance:nT}=Uq(ih),{reconciler:I0,applyProps:mc}=bq(ih,Pq),gc={objects:"shallow",strict:!1},kq=(n,t)=>{const e=typeof n=="function"?n(t):n;return tP(e)?e:new dC({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...n})};function zq(n,t){const e=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(t){const{width:i,height:r,top:s,left:a,updateStyle:o=e}=t;return{width:i,height:r,top:s,left:a,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:a}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:a,updateStyle:e}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:e};return{width:0,height:0,top:0,left:0}}function Bq(n){const t=ih.get(n),e=t==null?void 0:t.fiber,i=t==null?void 0:t.store;t&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||Dq(eT,nT),a=e||I0.createContainer(s,Cc.ConcurrentRoot,null,!1,null,"",r,null);t||ih.set(n,{fiber:a,store:s});let o,l=!1,c;return{configure(h={}){let{gl:u,size:p,scene:m,events:g,onCreated:_,shadows:y=!1,linear:x=!1,flat:M=!1,legacy:b=!1,orthographic:S=!1,frameloop:R="always",dpr:C=[1,2],performance:T,raycaster:N,camera:P,onPointerMissed:E}=h,L=s.getState(),B=L.gl;L.gl||L.set({gl:B=kq(u,n)});let V=L.raycaster;V||L.set({raycaster:V=new _g});const{params:j,...Y}=N||{};if(nn.equ(Y,V,gc)||mc(V,{...Y}),nn.equ(j,V.params,gc)||mc(V,{params:{...V.params,...j}}),!L.camera||L.camera===c&&!nn.equ(c,P,gc)){c=P;const K=P instanceof Pf,$=K?P:S?new ys(0,0,0,0,.1,1e3):new cn(75,0,.1,1e3);K||($.position.z=5,P&&(mc($,P),("aspect"in P||"left"in P||"right"in P||"bottom"in P||"top"in P)&&($.manual=!0,$.updateProjectionMatrix())),!L.camera&&!(P!=null&&P.rotation)&&$.lookAt(0,0,0)),L.set({camera:$}),V.camera=$}if(!L.scene){let K;m instanceof y0?K=m:(K=new y0,m&&mc(K,m)),L.set({scene:_c(K)})}if(!L.xr){var q;const K=(vt,Z)=>{const rt=s.getState();rt.frameloop!=="never"&&nT(vt,!0,rt,Z)},$=()=>{const vt=s.getState();vt.gl.xr.enabled=vt.gl.xr.isPresenting,vt.gl.xr.setAnimationLoop(vt.gl.xr.isPresenting?K:null),vt.gl.xr.isPresenting||eT(vt)},ht={connect(){const vt=s.getState().gl;vt.xr.addEventListener("sessionstart",$),vt.xr.addEventListener("sessionend",$)},disconnect(){const vt=s.getState().gl;vt.xr.removeEventListener("sessionstart",$),vt.xr.removeEventListener("sessionend",$)}};typeof((q=B.xr)==null?void 0:q.addEventListener)=="function"&&ht.connect(),L.set({xr:ht})}if(B.shadowMap){const K=B.shadowMap.enabled,$=B.shadowMap.type;if(B.shadowMap.enabled=!!y,nn.boo(y))B.shadowMap.type=vu;else if(nn.str(y)){var at;const ht={basic:KT,percentage:B0,soft:vu,variance:Ur};B.shadowMap.type=(at=ht[y])!=null?at:vu}else nn.obj(y)&&Object.assign(B.shadowMap,y);(K!==B.shadowMap.enabled||$!==B.shadowMap.type)&&(B.shadowMap.needsUpdate=!0)}const G=X3();G&&("enabled"in G?G.enabled=!b:"legacyMode"in G&&(G.legacyMode=b)),l||mc(B,{outputEncoding:x?3e3:3001,toneMapping:M?vs:Gv}),L.legacy!==b&&L.set(()=>({legacy:b})),L.linear!==x&&L.set(()=>({linear:x})),L.flat!==M&&L.set(()=>({flat:M})),u&&!nn.fun(u)&&!tP(u)&&!nn.equ(u,B,gc)&&mc(B,u),g&&!L.events.handlers&&L.set({events:g(s)});const tt=zq(n,p);return nn.equ(tt,L.size,gc)||L.setSize(tt.width,tt.height,tt.updateStyle,tt.top,tt.left),C&&L.viewport.dpr!==K3(C)&&L.setDpr(C),L.frameloop!==R&&L.setFrameloop(R),L.onPointerMissed||L.set({onPointerMissed:E}),T&&!nn.equ(T,L.performance,gc)&&L.set(K=>({performance:{...K.performance,...T}})),o=_,l=!0,this},render(h){return l||this.configure(),I0.updateContainer(X.jsx(Hq,{store:s,children:h,onCreated:o,rootElement:n}),a,null,()=>{}),s},unmount(){iP(n)}}}function Hq({store:n,children:t,onCreated:e,rootElement:i}){return td(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),e&&e(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),X.jsx(eP.Provider,{value:n,children:t})}function iP(n,t){const e=ih.get(n),i=e==null?void 0:e.fiber;if(i){const r=e==null?void 0:e.store.getState();r&&(r.internal.active=!1),I0.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,a,o,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),Tq(r),ih.delete(n)}catch{}},500)})}}I0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Q.version});const T_={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 Gq(n){const{handlePointer:t}=Lq(n);return{priority:1,enabled:!0,compute(e,i,r){i.pointer.set(e.offsetX/i.size.width*2-1,-(e.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(T_).reduce((e,i)=>({...e,[i]:t(i)}),{}),update:()=>{var e;const{events:i,internal:r}=n.getState();(e=r.lastEvent)!=null&&e.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:e=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(a=>({events:{...a.events,connected:e}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([a,o])=>{const[l,c]=T_[a];e.addEventListener(l,o,{passive:c})})},disconnect:()=>{const{set:e,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,a])=>{if(i&&i.connected instanceof HTMLElement){const[o]=T_[s];i.connected.removeEventListener(o,a)}}),e(s=>({events:{...s.events,connected:void 0}}))}}}}function bv(n,t,e){var i,r,s,a,o;t==null&&(t=100);function l(){var h=Date.now()-a;h=0?i=setTimeout(l,t-h):(i=null,e||(o=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,a=Date.now();var h=e&&!i;return i||(i=setTimeout(l,t)),h&&(o=n.apply(s,r),s=r=null),o};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(o=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}bv.debounce=bv;var Vq=bv;const iT=vf(Vq);var Wq=Object.defineProperty,jq=Object.defineProperties,Xq=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,qq=Object.prototype.hasOwnProperty,$q=Object.prototype.propertyIsEnumerable,sT=(n,t,e)=>t in n?Wq(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,aT=(n,t)=>{for(var e in t||(t={}))qq.call(t,e)&&sT(n,e,t[e]);if(rT)for(var e of rT(t))$q.call(t,e)&&sT(n,e,t[e]);return n},Yq=(n,t)=>jq(n,Xq(t)),oT,lT;typeof window<"u"&&((oT=window.document)!=null&&oT.createElement||((lT=window.navigator)==null?void 0:lT.product)==="ReactNative")?Q.useLayoutEffect:Q.useEffect;function rP(n,t,e){if(!n)return;if(e(n)===!0)return n;let i=n.child;for(;i;){const r=rP(i,t,e);if(r)return r;i=i.sibling}}function sP(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const cT=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=cT;return}return cT.apply(this,arguments)};const gM=sP(Q.createContext(null));class aP extends Q.Component{render(){return Q.createElement(gM.Provider,{value:this._reactInternals},this.props.children)}}function Zq(){const n=Q.useContext(gM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const t=Q.useId();return Q.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=rP(i,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===t)return!0;a=a.next}});if(r)return r}},[n,t])}function Kq(){const n=Zq(),[t]=Q.useState(()=>new Map);t.clear();let e=n;for(;e;){if(e.type&&typeof e.type=="object"){const r=e.type._context===void 0&&e.type.Provider===e.type?e.type:e.type._context;r&&r!==gM&&!t.has(r)&&t.set(r,Q.useContext(sP(r)))}e=e.return}return t}function Jq(){const n=Kq();return Q.useMemo(()=>Array.from(n.keys()).reduce((t,e)=>i=>Q.createElement(t,null,Q.createElement(e.Provider,Yq(aT({},i),{value:n.get(e)}))),t=>Q.createElement(aP,aT({},t))),[n])}function Qq({debounce:n,scroll:t,polyfill:e,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=e||typeof window<"u"&&window.ResizeObserver,[s,a]=Q.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const o=Q.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,h=Q.useRef(!1);Q.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[u,p,m]=Q.useMemo(()=>{const x=()=>{if(!o.current.element)return;const{left:M,top:b,width:S,height:R,bottom:C,right:T,x:N,y:P}=o.current.element.getBoundingClientRect(),E={left:M,top:b,width:S,height:R,bottom:C,right:T,x:N,y:P};o.current.element instanceof HTMLElement&&i&&(E.height=o.current.element.offsetHeight,E.width=o.current.element.offsetWidth),Object.freeze(E),h.current&&!i$(o.current.lastBounds,E)&&a(o.current.lastBounds=E)};return[x,c?iT(x,c):x,l?iT(x,l):x]},[a,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(x=>x.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null)}function _(){o.current.element&&(o.current.resizeObserver=new r(m),o.current.resizeObserver.observe(o.current.element),t&&o.current.scrollContainers&&o.current.scrollContainers.forEach(x=>x.addEventListener("scroll",m,{capture:!0,passive:!0})))}const y=x=>{!x||x===o.current.element||(g(),o.current.element=x,o.current.scrollContainers=oP(x),_())};return e$(m,!!t),t$(p),Q.useEffect(()=>{g(),_()},[t,m,p]),Q.useEffect(()=>g,[]),[y,s,u]}function t$(n){Q.useEffect(()=>{const t=n;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[n])}function e$(n,t){Q.useEffect(()=>{if(t){const e=n;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",e,!0)}},[n,t])}function oP(n){const t=[];if(!n||n===document.body)return t;const{overflow:e,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[e,i,r].some(s=>s==="auto"||s==="scroll")&&t.push(n),[...t,...oP(n.parentElement)]}const n$=["x","y","top","bottom","left","right","width","height"],i$=(n,t)=>n$.every(e=>n[e]===t[e]),r$=Q.forwardRef(function({children:t,fallback:e,resize:i,style:r,gl:s,events:a=Gq,eventSource:o,eventPrefix:l,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:_,performance:y,raycaster:x,camera:M,scene:b,onPointerMissed:S,onCreated:R,...C},T){Q.useMemo(()=>wq(m5),[]);const N=Jq(),[P,E]=Qq({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=Q.useRef(null),B=Q.useRef(null);Q.useImperativeHandle(T,()=>L.current);const V=$3(S),[j,Y]=Q.useState(!1),[q,at]=Q.useState(!1);if(j)throw j;if(q)throw q;const G=Q.useRef(null);td(()=>{const K=L.current;E.width>0&&E.height>0&&K&&(G.current||(G.current=Bq(K)),G.current.configure({gl:s,events:a,shadows:c,linear:h,flat:u,legacy:p,orthographic:m,frameloop:g,dpr:_,performance:y,raycaster:x,camera:M,scene:b,size:E,onPointerMissed:(...$)=>V.current==null?void 0:V.current(...$),onCreated:$=>{$.events.connect==null||$.events.connect(o?Sq(o)?o.current:o:B.current),l&&$.setEvents({compute:(ht,vt)=>{const Z=ht[l+"X"],rt=ht[l+"Y"];vt.pointer.set(Z/vt.size.width*2-1,-(rt/vt.size.height)*2+1),vt.raycaster.setFromCamera(vt.pointer,vt.camera)}}),R==null||R($)}}),G.current.render(X.jsx(N,{children:X.jsx(Y3,{set:at,children:X.jsx(Q.Suspense,{fallback:X.jsx(Eq,{set:Y}),children:t})})})))}),Q.useEffect(()=>{const K=L.current;if(K)return()=>iP(K)},[]);const tt=o?"none":"auto";return X.jsx("div",{ref:B,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:tt,...r},...C,children:X.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:X.jsx("canvas",{ref:L,style:{display:"block"},children:e})})})}),s$=Q.forwardRef(function(t,e){return X.jsx(aP,{children:X.jsx(r$,{...t,ref:e})})}),a$=({text:n,position:t})=>{const e=Q.useRef();return Q.useEffect(()=>{const i=document.createElement("canvas"),r=i.getContext("2d"),s=7;i.width=128*s,i.height=128,r.font="55px Arial",r.fillStyle="rgba(0, 0, 0, 0.3)",r.fillRect(0,0,i.width,i.height);const a=n.split(` +`);r.font="55px Arial",r.fillStyle="white",a.forEach((c,h)=>{r.fillText(c,10,60+h*60)});const o=new xC(i),l=new eg({map:o,depthTest:!1});e.current.material=l,e.current.position.copy(t),e.current.scale.set(s,1,1),e.current.renderOrder=999},[n,t]),X.jsx("sprite",{ref:e})},o$=({pvSystems:n})=>X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx(c$,{geometry:t.geometry,annualYield:t.annualYield,area:t.area},e))});function l$({setPVSystems:n,pvPoints:t,setPVPoints:e,simulationMeshes:i}){const r=t.map(T=>T.point);if(t.length<3){console.log("Not enough points to create a polygon");return}const s=new ve,a=[];r.forEach(T=>{a.push(T.x,T.y,T.z)});const o=[],l=[],c=.1;for(let T=1;T({x:Y.point.x+Y.normal.x*c,y:Y.point.y+Y.normal.y*c,z:Y.point.z+Y.normal.z*c}),B=L(N),V=L(P),j=L(E);o.push({a:N.point,b:P.point,c:E.point}),l.push(B.x,B.y,B.z,V.x,V.y,V.z,j.x,j.y,j.z)}s.setAttribute("position",new ae(l,3));let h=[];const u=.8;o.forEach(T=>{h=h.concat(gu(T,u))});const p=[];i.forEach(T=>{const N=T.geometry.clone();N.applyMatrix4(T.matrixWorld),p.push(N)});const m=IR(p,!0),g=10,_=d$(m,r,g),y=[],x=[],M=[];h.forEach(T=>{y.push(T.a.x,T.a.y,T.a.z),y.push(T.b.x,T.b.y,T.b.z),y.push(T.c.x,T.c.y,T.c.z)});for(let T=0;T[...T,C]),e([])}const c$=({geometry:n,annualYield:t,area:e})=>{const i=Q.useRef(),r=h$(n.attributes.position.array);return Tg(({camera:s})=>{i.current&&i.current.quaternion.copy(s.quaternion)}),X.jsxs(X.Fragment,{children:[X.jsx("mesh",{geometry:n,material:new uh({color:"#2b2c40",transparent:!0,opacity:.5,metalness:1,side:hi})}),X.jsx(a$,{text:`Jahresertrag: ${Math.round(t).toLocaleString("de")} kWh pro Jahr +Fläche: ${e.toPrecision(3)}m²`,position:r})]})},h$=n=>{const t=n.length/3,e=n.reduce((i,r,s)=>(i[s%3]+=r,i),[0,0,0]);return new U(e[0]/t,e[1]/t,e[2]/t)};function gu(n,t){const e=(l,c)=>Math.sqrt((c.x-l.x)**2+(c.y-l.y)**2+(c.z-l.z)**2),i=(l,c)=>({x:(l.x+c.x)/2,y:(l.y+c.y)/2,z:(l.z+c.z)/2});if(e(n.a,n.b),e(n.b,n.c),e(n.c,n.a),yM(n){t+=yM(e)}),t}function yM(n){const{a:t,b:e,c:i}=n,r=new U().subVectors(e,t),s=new U().subVectors(i,t);return .5*new U().crossVectors(r,s).length()}function f$(n,t,e){let i=null,r=1/0;return t.forEach(s=>{const[a,o,l]=s.vertices,c=n.distanceTo(a)+n.distanceTo(o)+n.distanceTo(l);c=e&&console.error(`Error: Trying to create a polygon with a distance longer than the threshold (${r})`),i}function d$(n,t,e){const i=[];if(!n.isBufferGeometry)return;const r=n.attributes.position.array,s=n.attributes.color?n.attributes.color.array:null,a=n.attributes.intensities?n.attributes.intensities.array:null;for(let o=0;o{const b=Math.min(M.distanceTo(l),M.distanceTo(c),M.distanceTo(h));b{l$({setPVSystems:c,pvPoints:h,setPVPoints:u,simulationMeshes:p}),t("Results")},T=()=>{t("Results")};return X.jsxs(X.Fragment,{children:[X.jsxs(v$,{children:[n=="Results"&&X.jsx(X.Fragment,{children:X.jsx($s,{ref:R,colorScheme:"teal",onClick:_,variant:"link",zIndex:100,children:S("button.options")})}),X.jsx($s,{onClick:M,colorScheme:"teal",variant:"link",children:S("mapControlHelp.button")}),X.jsx(b$,{isOpen:x,onClose:b}),X.jsx(w$,{isOpen:g,onClose:y,showTerrain:e,setShowTerrain:i})]}),X.jsxs(M$,{children:[n=="Results"&&X.jsx(dq,{buttonLabel:S("button.drawPVSystem"),onClick:()=>{t("DrawPV"),y()},className:l.length==0?"button-high-prio":"",hoverText:S("button.drawPVSystemHover")}),X.jsx(fq,{pvSystems:l}),r.length>0&&X.jsx($s,{className:"button-high-prio",onClick:async()=>await uq({selectedMesh:r,setSelectedMesh:s,simulationMeshes:p,setSimulationMeshes:m,geometries:a,geoLocation:o}),children:S("button.simulateBuilding")}),n=="DrawPV"&&X.jsxs(X.Fragment,{children:[h.length>0&&X.jsxs(X.Fragment,{children:[X.jsx($s,{className:"button-high-prio",onClick:C,children:S("button.createPVSystem")}),X.jsx($s,{onClick:()=>{u(h.slice(0,-1))},children:S("button.deleteLastPoint")})]}),X.jsx($s,{onClick:T,children:S("button.cancel")})]})]})]})}const v$=({children:n})=>X.jsx(X.Fragment,{children:X.jsx(zu,{display:"flex",flexDirection:"row",justifyContent:"flex-start",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:X.jsx(zu,{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"20px",padding:"10px",height:"fit-content",maxHeight:"100%",flexWrap:"nowrap",minWidth:0,minHeight:0,overflow:"hidden",children:n})})}),M$=({children:n})=>X.jsx(X.Fragment,{children:X.jsx(zu,{display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none",zIndex:100,minWidth:0,minHeight:0,overflow:"hidden",sx:{"> *":{pointerEvents:"auto"}},children:X.jsx(zu,{display:"flex",flexDirection:"row",gap:"20px",padding:"10px",width:"fit-content",maxWidth:"100%",flexWrap:"wrap",minWidth:0,minHeight:0,overflow:"hidden",marginLeft:"auto",children:n})})}),w$=({isOpen:n,onClose:t,showTerrain:e,setShowTerrain:i})=>{const{t:r}=sh(),[s,a]=N0.useState(window.numSimulations);return X.jsx(SI,{spacing:"24px",children:X.jsxs(TD,{isOpen:n,placement:"left",onClose:t,size:"xs",children:[X.jsx(Pv,{}),X.jsxs(zT,{height:"100%",children:[X.jsx(Lv,{}),X.jsx(Iv,{children:r("button.options")}),X.jsx(Dv,{children:X.jsxs(X.Fragment,{children:[X.jsx(Lo,{as:"b",children:r("sidebar.header")}),X.jsx(Lo,{children:r("sidebar.mainText")}),X.jsxs(yu,{children:[r("button.showMap"),X.jsx($T,{isChecked:e,onChange:()=>i(o=>!o),colorScheme:"teal",margin:"5px"})]}),X.jsx(mq,{sliderProps:{min:1,max:200},label:r("sidebar.numberSimulations"),hoverHelpLabel:r("sidebar.numberSimulationsHover"),sliderValue:s,setSliderValue:o=>{a(o),window.numSimulations=o}})]})})]})]})})},b$=({isOpen:n,onClose:t})=>{const{t:e}=sh(),i=window.isTouchDevice?"touch.":"";return X.jsxs(Rv,{isOpen:n,onClose:t,children:[X.jsx(Pv,{}),X.jsxs(vT,{children:[X.jsx(Iv,{children:e("mapControlHelp.title")}),X.jsx(Lv,{}),X.jsx(Dv,{children:X.jsxs(MT,{children:[X.jsx(No,{children:e(`mapControlHelp.${i}leftMouse`)}),X.jsx(No,{children:e(`mapControlHelp.${i}rightMouse`)}),X.jsx(No,{children:e(`mapControlHelp.${i}wheel`)}),X.jsx(No,{children:e(`mapControlHelp.${i}doubleClick`)})]})})]})]})};var S$=Object.defineProperty,E$=(n,t,e)=>t in n?S$(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,_e=(n,t,e)=>(E$(n,typeof t!="symbol"?t+"":t,e),e);const Mm=new Za,hT=new ds,A$=Math.cos(70*(Math.PI/180)),uT=(n,t)=>(n%t+t)%t;let T$=class extends qr{constructor(t,e){super(),_e(this,"object"),_e(this,"domElement"),_e(this,"enabled",!0),_e(this,"target",new U),_e(this,"minDistance",0),_e(this,"maxDistance",1/0),_e(this,"minZoom",0),_e(this,"maxZoom",1/0),_e(this,"minPolarAngle",0),_e(this,"maxPolarAngle",Math.PI),_e(this,"minAzimuthAngle",-1/0),_e(this,"maxAzimuthAngle",1/0),_e(this,"enableDamping",!1),_e(this,"dampingFactor",.05),_e(this,"enableZoom",!0),_e(this,"zoomSpeed",1),_e(this,"enableRotate",!0),_e(this,"rotateSpeed",1),_e(this,"enablePan",!0),_e(this,"panSpeed",1),_e(this,"screenSpacePanning",!0),_e(this,"keyPanSpeed",7),_e(this,"zoomToCursor",!1),_e(this,"autoRotate",!1),_e(this,"autoRotateSpeed",2),_e(this,"reverseOrbit",!1),_e(this,"reverseHorizontalOrbit",!1),_e(this,"reverseVerticalOrbit",!1),_e(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),_e(this,"mouseButtons",{LEFT:Wn.ROTATE,MIDDLE:Wn.DOLLY,RIGHT:Wn.PAN}),_e(this,"touches",{ONE:Zi.ROTATE,TWO:Zi.DOLLY_PAN}),_e(this,"target0"),_e(this,"position0"),_e(this,"zoom0"),_e(this,"_domElementKeyEvents",null),_e(this,"getPolarAngle"),_e(this,"getAzimuthalAngle"),_e(this,"setPolarAngle"),_e(this,"setAzimuthalAngle"),_e(this,"getDistance"),_e(this,"listenToKeyEvents"),_e(this,"stopListenToKeyEvents"),_e(this,"saveState"),_e(this,"reset"),_e(this,"update"),_e(this,"connect"),_e(this,"dispose"),this.object=t,this.domElement=e,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=W=>{let gt=uT(W,2*Math.PI),jt=h.phi;jt<0&&(jt+=2*Math.PI),gt<0&&(gt+=2*Math.PI);let D=Math.abs(gt-jt);2*Math.PI-D{let gt=uT(W,2*Math.PI),jt=h.theta;jt<0&&(jt+=2*Math.PI),gt<0&&(gt+=2*Math.PI);let D=Math.abs(gt-jt);2*Math.PI-Di.object.position.distanceTo(i.target),this.listenToKeyEvents=W=>{W.addEventListener("keydown",Ft),this._domElementKeyEvents=W},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ft),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=o.NONE},this.update=(()=>{const W=new U,gt=new U(0,1,0),jt=new Cn().setFromUnitVectors(t.up,gt),D=jt.clone().invert(),it=new U,lt=new Cn,ut=2*Math.PI;return function(){const oe=i.object.position;jt.setFromUnitVectors(t.up,gt),D.copy(jt).invert(),W.copy(oe).sub(i.target),W.applyQuaternion(jt),h.setFromVector3(W),i.autoRotate&&l===o.NONE&&j(B()),i.enableDamping?(h.theta+=u.theta*i.dampingFactor,h.phi+=u.phi*i.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);let le=i.minAzimuthAngle,Ne=i.maxAzimuthAngle;isFinite(le)&&isFinite(Ne)&&(le<-Math.PI?le+=ut:le>Math.PI&&(le-=ut),Ne<-Math.PI?Ne+=ut:Ne>Math.PI&&(Ne-=ut),le<=Ne?h.theta=Math.max(le,Math.min(Ne,h.theta)):h.theta=h.theta>(le+Ne)/2?Math.max(le,h.theta):Math.min(Ne,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&P||i.object.isOrthographicCamera?h.radius=ht(h.radius):h.radius=ht(h.radius*p),W.setFromSpherical(h),W.applyQuaternion(D),oe.copy(i.target).add(W),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(u.theta*=1-i.dampingFactor,u.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(u.set(0,0,0),m.set(0,0,0));let Ye=!1;if(i.zoomToCursor&&P){let Se=null;if(i.object instanceof cn&&i.object.isPerspectiveCamera){const qe=W.length();Se=ht(qe*p);const $e=qe-Se;i.object.position.addScaledVector(T,$e),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const qe=new U(N.x,N.y,0);qe.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Ye=!0;const $e=new U(N.x,N.y,0);$e.unproject(i.object),i.object.position.sub($e).add(qe),i.object.updateMatrixWorld(),Se=W.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Se!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Se).add(i.object.position):(Mm.origin.copy(i.object.position),Mm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Mm.direction))c||8*(1-lt.dot(i.object.quaternion))>c?(i.dispatchEvent(r),it.copy(i.object.position),lt.copy(i.object.quaternion),Ye=!1,!0):!1}})(),this.connect=W=>{i.domElement=W,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Dt),i.domElement.addEventListener("pointerdown",O),i.domElement.addEventListener("pointercancel",At),i.domElement.addEventListener("wheel",ne)},this.dispose=()=>{var W,gt,jt,D,it,lt;i.domElement&&(i.domElement.style.touchAction="auto"),(W=i.domElement)==null||W.removeEventListener("contextmenu",Dt),(gt=i.domElement)==null||gt.removeEventListener("pointerdown",O),(jt=i.domElement)==null||jt.removeEventListener("pointercancel",At),(D=i.domElement)==null||D.removeEventListener("wheel",ne),(it=i.domElement)==null||it.ownerDocument.removeEventListener("pointermove",ot),(lt=i.domElement)==null||lt.ownerDocument.removeEventListener("pointerup",At),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",Ft)};const i=this,r={type:"change"},s={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const c=1e-6,h=new sf,u=new sf;let p=1;const m=new U,g=new xt,_=new xt,y=new xt,x=new xt,M=new xt,b=new xt,S=new xt,R=new xt,C=new xt,T=new U,N=new xt;let P=!1;const E=[],L={};function B(){return 2*Math.PI/60/60*i.autoRotateSpeed}function V(){return Math.pow(.95,i.zoomSpeed)}function j(W){i.reverseOrbit||i.reverseHorizontalOrbit?u.theta+=W:u.theta-=W}function Y(W){i.reverseOrbit||i.reverseVerticalOrbit?u.phi+=W:u.phi-=W}const q=(()=>{const W=new U;return function(jt,D){W.setFromMatrixColumn(D,0),W.multiplyScalar(-jt),m.add(W)}})(),at=(()=>{const W=new U;return function(jt,D){i.screenSpacePanning===!0?W.setFromMatrixColumn(D,1):(W.setFromMatrixColumn(D,0),W.crossVectors(i.object.up,W)),W.multiplyScalar(jt),m.add(W)}})(),G=(()=>{const W=new U;return function(jt,D){const it=i.domElement;if(it&&i.object instanceof cn&&i.object.isPerspectiveCamera){const lt=i.object.position;W.copy(lt).sub(i.target);let ut=W.length();ut*=Math.tan(i.object.fov/2*Math.PI/180),q(2*jt*ut/it.clientHeight,i.object.matrix),at(2*D*ut/it.clientHeight,i.object.matrix)}else it&&i.object instanceof ys&&i.object.isOrthographicCamera?(q(jt*(i.object.right-i.object.left)/i.object.zoom/it.clientWidth,i.object.matrix),at(D*(i.object.top-i.object.bottom)/i.object.zoom/it.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function tt(W){i.object instanceof cn&&i.object.isPerspectiveCamera||i.object instanceof ys&&i.object.isOrthographicCamera?p/=W:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function K(W){i.object instanceof cn&&i.object.isPerspectiveCamera||i.object instanceof ys&&i.object.isOrthographicCamera?p*=W:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function $(W){if(!i.zoomToCursor||!i.domElement)return;P=!0;const gt=i.domElement.getBoundingClientRect(),jt=W.clientX-gt.left,D=W.clientY-gt.top,it=gt.width,lt=gt.height;N.x=jt/it*2-1,N.y=-(D/lt)*2+1,T.set(N.x,N.y,1).unproject(i.object).sub(i.object.position).normalize()}function ht(W){return Math.max(i.minDistance,Math.min(i.maxDistance,W))}function vt(W){g.set(W.clientX,W.clientY)}function Z(W){$(W),S.set(W.clientX,W.clientY)}function rt(W){x.set(W.clientX,W.clientY)}function St(W){_.set(W.clientX,W.clientY),y.subVectors(_,g).multiplyScalar(i.rotateSpeed);const gt=i.domElement;gt&&(j(2*Math.PI*y.x/gt.clientHeight),Y(2*Math.PI*y.y/gt.clientHeight)),g.copy(_),i.update()}function _t(W){R.set(W.clientX,W.clientY),C.subVectors(R,S),C.y>0?tt(V()):C.y<0&&K(V()),S.copy(R),i.update()}function Ot(W){M.set(W.clientX,W.clientY),b.subVectors(M,x).multiplyScalar(i.panSpeed),G(b.x,b.y),x.copy(M),i.update()}function Xt(W){$(W),W.deltaY<0?K(V()):W.deltaY>0&&tt(V()),i.update()}function Gt(W){let gt=!1;switch(W.code){case i.keys.UP:G(0,i.keyPanSpeed),gt=!0;break;case i.keys.BOTTOM:G(0,-i.keyPanSpeed),gt=!0;break;case i.keys.LEFT:G(i.keyPanSpeed,0),gt=!0;break;case i.keys.RIGHT:G(-i.keyPanSpeed,0),gt=!0;break}gt&&(W.preventDefault(),i.update())}function Qt(){if(E.length==1)g.set(E[0].pageX,E[0].pageY);else{const W=.5*(E[0].pageX+E[1].pageX),gt=.5*(E[0].pageY+E[1].pageY);g.set(W,gt)}}function F(){if(E.length==1)x.set(E[0].pageX,E[0].pageY);else{const W=.5*(E[0].pageX+E[1].pageX),gt=.5*(E[0].pageY+E[1].pageY);x.set(W,gt)}}function wt(){const W=E[0].pageX-E[1].pageX,gt=E[0].pageY-E[1].pageY,jt=Math.sqrt(W*W+gt*gt);S.set(0,jt)}function bt(){i.enableZoom&&wt(),i.enablePan&&F()}function mt(){i.enableZoom&&wt(),i.enableRotate&&Qt()}function dt(W){if(E.length==1)_.set(W.pageX,W.pageY);else{const jt=qt(W),D=.5*(W.pageX+jt.x),it=.5*(W.pageY+jt.y);_.set(D,it)}y.subVectors(_,g).multiplyScalar(i.rotateSpeed);const gt=i.domElement;gt&&(j(2*Math.PI*y.x/gt.clientHeight),Y(2*Math.PI*y.y/gt.clientHeight)),g.copy(_)}function kt(W){if(E.length==1)M.set(W.pageX,W.pageY);else{const gt=qt(W),jt=.5*(W.pageX+gt.x),D=.5*(W.pageY+gt.y);M.set(jt,D)}b.subVectors(M,x).multiplyScalar(i.panSpeed),G(b.x,b.y),x.copy(M)}function Rt(W){const gt=qt(W),jt=W.pageX-gt.x,D=W.pageY-gt.y,it=Math.sqrt(jt*jt+D*D);R.set(0,it),C.set(0,Math.pow(R.y/S.y,i.zoomSpeed)),tt(C.y),S.copy(R)}function zt(W){i.enableZoom&&Rt(W),i.enablePan&&kt(W)}function z(W){i.enableZoom&&Rt(W),i.enableRotate&&dt(W)}function O(W){var gt,jt;i.enabled!==!1&&(E.length===0&&((gt=i.domElement)==null||gt.ownerDocument.addEventListener("pointermove",ot),(jt=i.domElement)==null||jt.ownerDocument.addEventListener("pointerup",At)),$t(W),W.pointerType==="touch"?Wt(W):Et(W))}function ot(W){i.enabled!==!1&&(W.pointerType==="touch"?ge(W):Tt(W))}function At(W){var gt,jt,D;It(W),E.length===0&&((gt=i.domElement)==null||gt.releasePointerCapture(W.pointerId),(jt=i.domElement)==null||jt.ownerDocument.removeEventListener("pointermove",ot),(D=i.domElement)==null||D.ownerDocument.removeEventListener("pointerup",At)),i.dispatchEvent(a),l=o.NONE}function Et(W){let gt;switch(W.button){case 0:gt=i.mouseButtons.LEFT;break;case 1:gt=i.mouseButtons.MIDDLE;break;case 2:gt=i.mouseButtons.RIGHT;break;default:gt=-1}switch(gt){case Wn.DOLLY:if(i.enableZoom===!1)return;Z(W),l=o.DOLLY;break;case Wn.ROTATE:if(W.ctrlKey||W.metaKey||W.shiftKey){if(i.enablePan===!1)return;rt(W),l=o.PAN}else{if(i.enableRotate===!1)return;vt(W),l=o.ROTATE}break;case Wn.PAN:if(W.ctrlKey||W.metaKey||W.shiftKey){if(i.enableRotate===!1)return;vt(W),l=o.ROTATE}else{if(i.enablePan===!1)return;rt(W),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(s)}function Tt(W){if(i.enabled!==!1)switch(l){case o.ROTATE:if(i.enableRotate===!1)return;St(W);break;case o.DOLLY:if(i.enableZoom===!1)return;_t(W);break;case o.PAN:if(i.enablePan===!1)return;Ot(W);break}}function ne(W){i.enabled===!1||i.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(W.preventDefault(),i.dispatchEvent(s),Xt(W),i.dispatchEvent(a))}function Ft(W){i.enabled===!1||i.enablePan===!1||Gt(W)}function Wt(W){switch(Nt(W),E.length){case 1:switch(i.touches.ONE){case Zi.ROTATE:if(i.enableRotate===!1)return;Qt(),l=o.TOUCH_ROTATE;break;case Zi.PAN:if(i.enablePan===!1)return;F(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(i.touches.TWO){case Zi.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;bt(),l=o.TOUCH_DOLLY_PAN;break;case Zi.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;mt(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&i.dispatchEvent(s)}function ge(W){switch(Nt(W),l){case o.TOUCH_ROTATE:if(i.enableRotate===!1)return;dt(W),i.update();break;case o.TOUCH_PAN:if(i.enablePan===!1)return;kt(W),i.update();break;case o.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;zt(W),i.update();break;case o.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;z(W),i.update();break;default:l=o.NONE}}function Dt(W){i.enabled!==!1&&W.preventDefault()}function $t(W){E.push(W)}function It(W){delete L[W.pointerId];for(let gt=0;gt{const u=fs(C=>C.invalidate),p=fs(C=>C.camera),m=fs(C=>C.gl),g=fs(C=>C.events),_=fs(C=>C.setEvents),y=fs(C=>C.set),x=fs(C=>C.get),M=fs(C=>C.performance),b=t||p,S=i||g.connected||m.domElement,R=Q.useMemo(()=>new T$(b),[b]);return Tg(()=>{R.enabled&&R.update()},-1),Q.useEffect(()=>(s&&R.connect(s===!0?S:s),R.connect(S),()=>void R.dispose()),[s,S,e,R,u]),Q.useEffect(()=>{const C=P=>{u(),e&&M.regress(),a&&a(P)},T=P=>{o&&o(P)},N=P=>{l&&l(P)};return R.addEventListener("change",C),R.addEventListener("start",T),R.addEventListener("end",N),()=>{R.removeEventListener("start",T),R.removeEventListener("end",N),R.removeEventListener("change",C)}},[a,o,l,R,u,_]),Q.useEffect(()=>{if(n){const C=x().controls;return y({controls:R}),()=>y({controls:C})}},[n,R]),Q.createElement("primitive",rI({ref:h,object:R,enableDamping:r},c))});function R$(n){const t=Q.useRef(),e=Q.useRef(new _g),i=Q.useRef(new xt),{gl:r,camera:s,scene:a}=fs();let o=0;const l=u=>{u.preventDefault();const p=u.type.startsWith("touch"),m=p?u.touches[0].clientX:u.clientX,g=p?u.touches[0].clientY:u.clientY,_=u.target.getBoundingClientRect();i.current.x=(m-_.left)/_.width*2-1,i.current.y=-(g-_.top)/_.height*2+1,e.current.setFromCamera(i.current,s);const y=e.current.intersectObjects(a.children,!0);if(y.length>0){const x=y[0].object;if(console.log("Intersected Mesh",x),!x)return;if(x.geometry.name&&(x.geometry.name.includes("surrounding")||x.geometry.name.includes("background"))){const M=n.selectedMesh.findIndex(b=>b.geometry.name===x.geometry.name);M>-1?n.setSelectedMesh([...n.selectedMesh.slice(0,M),...n.selectedMesh.slice(M+1)]):n.setSelectedMesh([...n.selectedMesh,{geometry:x.geometry,material:x.material}])}}else console.log("No children in the intersected mesh.")},c=u=>{l(u)},h=u=>{const p=new Date().getTime(),m=p-o;m<300&&m>0&&l(u),o=p};return Q.useEffect(()=>{const u=r.domElement;return u.addEventListener("dblclick",c),u.addEventListener("touchstart",h),()=>{u.removeEventListener("dblclick",c),u.removeEventListener("touchstart",h)}},[s,a]),Tg(()=>{t.current&&t.current.update()}),X.jsx(C$,{ref:t,args:[s,r.domElement],target:n.middle,mouseButtons:{LEFT:Wn.PAN,MIDDLE:Wn.DOLLY,RIGHT:Wn.ROTATE},screenSpacePanning:!1,dampingFactor:1,maxPolarAngle:Math.PI/2})}const fT={type:"change"},C_={type:"start"},dT={type:"end"},wm=new Za,pT=new ds,P$=Math.cos(70*n1.DEG2RAD);class I$ extends qr{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new U,this.cursor=new U,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Wn.ROTATE,MIDDLE:Wn.DOLLY,RIGHT:Wn.PAN},this.touches={ONE:Zi.ROTATE,TWO:Zi.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(D){D.addEventListener("keydown",Wt),this._domElementKeyEvents=D},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Wt),this._domElementKeyEvents=null},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(fT),i.update(),s=r.NONE},this.update=function(){const D=new U,it=new Cn().setFromUnitVectors(t.up,new U(0,1,0)),lt=it.clone().invert(),ut=new U,Ct=new Cn,oe=new U,le=2*Math.PI;return function(Ye=null){const Se=i.object.position;D.copy(Se).sub(i.target),D.applyQuaternion(it),o.setFromVector3(D),i.autoRotate&&s===r.NONE&&B(E(Ye)),i.enableDamping?(o.theta+=l.theta*i.dampingFactor,o.phi+=l.phi*i.dampingFactor):(o.theta+=l.theta,o.phi+=l.phi);let qe=i.minAzimuthAngle,$e=i.maxAzimuthAngle;isFinite(qe)&&isFinite($e)&&(qe<-Math.PI?qe+=le:qe>Math.PI&&(qe-=le),$e<-Math.PI?$e+=le:$e>Math.PI&&($e-=le),qe<=$e?o.theta=Math.max(qe,Math.min($e,o.theta)):o.theta=o.theta>(qe+$e)/2?Math.max(qe,o.theta):Math.min($e,o.theta)),o.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,o.phi)),o.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(h,i.dampingFactor):i.target.add(h),i.target.sub(i.cursor),i.target.clampLength(i.minTargetRadius,i.maxTargetRadius),i.target.add(i.cursor);let Kr=!1;if(i.zoomToCursor&&C||i.object.isOrthographicCamera)o.radius=K(o.radius);else{const Pn=o.radius;o.radius=K(o.radius*c),Kr=Pn!=o.radius}if(D.setFromSpherical(o),D.applyQuaternion(lt),Se.copy(i.target).add(D),i.object.lookAt(i.target),i.enableDamping===!0?(l.theta*=1-i.dampingFactor,l.phi*=1-i.dampingFactor,h.multiplyScalar(1-i.dampingFactor)):(l.set(0,0,0),h.set(0,0,0)),i.zoomToCursor&&C){let Pn=null;if(i.object.isPerspectiveCamera){const Er=D.length();Pn=K(Er*c);const Jr=Er-Pn;i.object.position.addScaledVector(S,Jr),i.object.updateMatrixWorld(),Kr=!!Jr}else if(i.object.isOrthographicCamera){const Er=new U(R.x,R.y,0);Er.unproject(i.object);const Jr=i.object.zoom;i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),Kr=Jr!==i.object.zoom;const Cs=new U(R.x,R.y,0);Cs.unproject(i.object),i.object.position.sub(Cs).add(Er),i.object.updateMatrixWorld(),Pn=D.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Pn!==null&&(this.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Pn).add(i.object.position):(wm.origin.copy(i.object.position),wm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(wm.direction))a||8*(1-Ct.dot(i.object.quaternion))>a||oe.distanceToSquared(i.target)>a?(i.dispatchEvent(fT),ut.copy(i.object.position),Ct.copy(i.object.quaternion),oe.copy(i.target),!0):!1}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",$t),i.domElement.removeEventListener("pointerdown",zt),i.domElement.removeEventListener("pointercancel",O),i.domElement.removeEventListener("wheel",Et),i.domElement.removeEventListener("pointermove",z),i.domElement.removeEventListener("pointerup",O),i.domElement.getRootNode().removeEventListener("keydown",ne,{capture:!0}),i._domElementKeyEvents!==null&&(i._domElementKeyEvents.removeEventListener("keydown",Wt),i._domElementKeyEvents=null)};const i=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=r.NONE;const a=1e-6,o=new sf,l=new sf;let c=1;const h=new U,u=new xt,p=new xt,m=new xt,g=new xt,_=new xt,y=new xt,x=new xt,M=new xt,b=new xt,S=new U,R=new xt;let C=!1;const T=[],N={};let P=!1;function E(D){return D!==null?2*Math.PI/60*i.autoRotateSpeed*D:2*Math.PI/60/60*i.autoRotateSpeed}function L(D){const it=Math.abs(D*.01);return Math.pow(.95,i.zoomSpeed*it)}function B(D){l.theta-=D}function V(D){l.phi-=D}const j=function(){const D=new U;return function(lt,ut){D.setFromMatrixColumn(ut,0),D.multiplyScalar(-lt),h.add(D)}}(),Y=function(){const D=new U;return function(lt,ut){i.screenSpacePanning===!0?D.setFromMatrixColumn(ut,1):(D.setFromMatrixColumn(ut,0),D.crossVectors(i.object.up,D)),D.multiplyScalar(lt),h.add(D)}}(),q=function(){const D=new U;return function(lt,ut){const Ct=i.domElement;if(i.object.isPerspectiveCamera){const oe=i.object.position;D.copy(oe).sub(i.target);let le=D.length();le*=Math.tan(i.object.fov/2*Math.PI/180),j(2*lt*le/Ct.clientHeight,i.object.matrix),Y(2*ut*le/Ct.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(j(lt*(i.object.right-i.object.left)/i.object.zoom/Ct.clientWidth,i.object.matrix),Y(ut*(i.object.top-i.object.bottom)/i.object.zoom/Ct.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function at(D){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c/=D:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function G(D){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c*=D:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function tt(D,it){if(!i.zoomToCursor)return;C=!0;const lt=i.domElement.getBoundingClientRect(),ut=D-lt.left,Ct=it-lt.top,oe=lt.width,le=lt.height;R.x=ut/oe*2-1,R.y=-(Ct/le)*2+1,S.set(R.x,R.y,1).unproject(i.object).sub(i.object.position).normalize()}function K(D){return Math.max(i.minDistance,Math.min(i.maxDistance,D))}function $(D){u.set(D.clientX,D.clientY)}function ht(D){tt(D.clientX,D.clientX),x.set(D.clientX,D.clientY)}function vt(D){g.set(D.clientX,D.clientY)}function Z(D){p.set(D.clientX,D.clientY),m.subVectors(p,u).multiplyScalar(i.rotateSpeed);const it=i.domElement;B(2*Math.PI*m.x/it.clientHeight),V(2*Math.PI*m.y/it.clientHeight),u.copy(p),i.update()}function rt(D){M.set(D.clientX,D.clientY),b.subVectors(M,x),b.y>0?at(L(b.y)):b.y<0&&G(L(b.y)),x.copy(M),i.update()}function St(D){_.set(D.clientX,D.clientY),y.subVectors(_,g).multiplyScalar(i.panSpeed),q(y.x,y.y),g.copy(_),i.update()}function _t(D){tt(D.clientX,D.clientY),D.deltaY<0?G(L(D.deltaY)):D.deltaY>0&&at(L(D.deltaY)),i.update()}function Ot(D){let it=!1;switch(D.code){case i.keys.UP:D.ctrlKey||D.metaKey||D.shiftKey?V(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(0,i.keyPanSpeed),it=!0;break;case i.keys.BOTTOM:D.ctrlKey||D.metaKey||D.shiftKey?V(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(0,-i.keyPanSpeed),it=!0;break;case i.keys.LEFT:D.ctrlKey||D.metaKey||D.shiftKey?B(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(i.keyPanSpeed,0),it=!0;break;case i.keys.RIGHT:D.ctrlKey||D.metaKey||D.shiftKey?B(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):q(-i.keyPanSpeed,0),it=!0;break}it&&(D.preventDefault(),i.update())}function Xt(D){if(T.length===1)u.set(D.pageX,D.pageY);else{const it=gt(D),lt=.5*(D.pageX+it.x),ut=.5*(D.pageY+it.y);u.set(lt,ut)}}function Gt(D){if(T.length===1)g.set(D.pageX,D.pageY);else{const it=gt(D),lt=.5*(D.pageX+it.x),ut=.5*(D.pageY+it.y);g.set(lt,ut)}}function Qt(D){const it=gt(D),lt=D.pageX-it.x,ut=D.pageY-it.y,Ct=Math.sqrt(lt*lt+ut*ut);x.set(0,Ct)}function F(D){i.enableZoom&&Qt(D),i.enablePan&&Gt(D)}function wt(D){i.enableZoom&&Qt(D),i.enableRotate&&Xt(D)}function bt(D){if(T.length==1)p.set(D.pageX,D.pageY);else{const lt=gt(D),ut=.5*(D.pageX+lt.x),Ct=.5*(D.pageY+lt.y);p.set(ut,Ct)}m.subVectors(p,u).multiplyScalar(i.rotateSpeed);const it=i.domElement;B(2*Math.PI*m.x/it.clientHeight),V(2*Math.PI*m.y/it.clientHeight),u.copy(p)}function mt(D){if(T.length===1)_.set(D.pageX,D.pageY);else{const it=gt(D),lt=.5*(D.pageX+it.x),ut=.5*(D.pageY+it.y);_.set(lt,ut)}y.subVectors(_,g).multiplyScalar(i.panSpeed),q(y.x,y.y),g.copy(_)}function dt(D){const it=gt(D),lt=D.pageX-it.x,ut=D.pageY-it.y,Ct=Math.sqrt(lt*lt+ut*ut);M.set(0,Ct),b.set(0,Math.pow(M.y/x.y,i.zoomSpeed)),at(b.y),x.copy(M);const oe=(D.pageX+it.x)*.5,le=(D.pageY+it.y)*.5;tt(oe,le)}function kt(D){i.enableZoom&&dt(D),i.enablePan&&mt(D)}function Rt(D){i.enableZoom&&dt(D),i.enableRotate&&bt(D)}function zt(D){i.enabled!==!1&&(T.length===0&&(i.domElement.setPointerCapture(D.pointerId),i.domElement.addEventListener("pointermove",z),i.domElement.addEventListener("pointerup",O)),!qt(D)&&(It(D),D.pointerType==="touch"?ge(D):ot(D)))}function z(D){i.enabled!==!1&&(D.pointerType==="touch"?Dt(D):At(D))}function O(D){switch(Nt(D),T.length){case 0:i.domElement.releasePointerCapture(D.pointerId),i.domElement.removeEventListener("pointermove",z),i.domElement.removeEventListener("pointerup",O),i.dispatchEvent(dT),s=r.NONE;break;case 1:const it=T[0],lt=N[it];ge({pointerId:it,pageX:lt.x,pageY:lt.y});break}}function ot(D){let it;switch(D.button){case 0:it=i.mouseButtons.LEFT;break;case 1:it=i.mouseButtons.MIDDLE;break;case 2:it=i.mouseButtons.RIGHT;break;default:it=-1}switch(it){case Wn.DOLLY:if(i.enableZoom===!1)return;ht(D),s=r.DOLLY;break;case Wn.ROTATE:if(D.ctrlKey||D.metaKey||D.shiftKey){if(i.enablePan===!1)return;vt(D),s=r.PAN}else{if(i.enableRotate===!1)return;$(D),s=r.ROTATE}break;case Wn.PAN:if(D.ctrlKey||D.metaKey||D.shiftKey){if(i.enableRotate===!1)return;$(D),s=r.ROTATE}else{if(i.enablePan===!1)return;vt(D),s=r.PAN}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(C_)}function At(D){switch(s){case r.ROTATE:if(i.enableRotate===!1)return;Z(D);break;case r.DOLLY:if(i.enableZoom===!1)return;rt(D);break;case r.PAN:if(i.enablePan===!1)return;St(D);break}}function Et(D){i.enabled===!1||i.enableZoom===!1||s!==r.NONE||(D.preventDefault(),i.dispatchEvent(C_),_t(Tt(D)),i.dispatchEvent(dT))}function Tt(D){const it=D.deltaMode,lt={clientX:D.clientX,clientY:D.clientY,deltaY:D.deltaY};switch(it){case 1:lt.deltaY*=16;break;case 2:lt.deltaY*=100;break}return D.ctrlKey&&!P&&(lt.deltaY*=10),lt}function ne(D){D.key==="Control"&&(P=!0,i.domElement.getRootNode().addEventListener("keyup",Ft,{passive:!0,capture:!0}))}function Ft(D){D.key==="Control"&&(P=!1,i.domElement.getRootNode().removeEventListener("keyup",Ft,{passive:!0,capture:!0}))}function Wt(D){i.enabled===!1||i.enablePan===!1||Ot(D)}function ge(D){switch(W(D),T.length){case 1:switch(i.touches.ONE){case Zi.ROTATE:if(i.enableRotate===!1)return;Xt(D),s=r.TOUCH_ROTATE;break;case Zi.PAN:if(i.enablePan===!1)return;Gt(D),s=r.TOUCH_PAN;break;default:s=r.NONE}break;case 2:switch(i.touches.TWO){case Zi.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;F(D),s=r.TOUCH_DOLLY_PAN;break;case Zi.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;wt(D),s=r.TOUCH_DOLLY_ROTATE;break;default:s=r.NONE}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(C_)}function Dt(D){switch(W(D),s){case r.TOUCH_ROTATE:if(i.enableRotate===!1)return;bt(D),i.update();break;case r.TOUCH_PAN:if(i.enablePan===!1)return;mt(D),i.update();break;case r.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;kt(D),i.update();break;case r.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Rt(D),i.update();break;default:s=r.NONE}}function $t(D){i.enabled!==!1&&D.preventDefault()}function It(D){T.push(D.pointerId)}function Nt(D){delete N[D.pointerId];for(let it=0;it{const{camera:e,gl:i,scene:r}=fs(),s=Q.useRef(new _g),a=Q.useRef(new xt),o=Q.useRef();Q.useEffect(()=>(o.current=new I$(e,i.domElement),o.current.target=n,o.current.mouseButtons={MIDDLE:Wn.DOLLY,RIGHT:Wn.ROTATE},o.current.screenSpacePanning=!1,o.current.maxPolarAngle=Math.PI/2,o.current.update(),()=>{o.current.dispose()}),[e,i,n]);const l=c=>{if(c.button!==0)return;const h=c.target.getBoundingClientRect();a.current.x=(c.clientX-h.left)/h.width*2-1,a.current.y=-(c.clientY-h.top)/h.height*2+1,s.current.setFromCamera(a.current,e);const u=s.current.intersectObjects(r.children,!0);if(u.length>0){const p=u[0],m=p.point;if(!p.face){console.log("Intersaction.face was null.");return}const g=p.face.normal.clone().transformDirection(p.object.matrixWorld);t(_=>[..._,{point:m,normal:g}])}};return Q.useEffect(()=>(i.domElement.addEventListener("pointerdown",l),()=>{i.domElement.removeEventListener("pointerdown",l)}),[i]),Tg(()=>{o.current&&o.current.update()}),null};function D$({meshes:n}){return X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx("mesh",{geometry:t.geometry,material:new zf({color:"#2b2c40",transparent:!1})},e))})}const N$=({meshes:n})=>X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx("mesh",{geometry:t.geometry,children:X.jsx("meshLambertMaterial",{vertexColors:!0,side:hi})},e))}),mT=({geometries:n})=>X.jsx(X.Fragment,{children:n.map((t,e)=>X.jsx("mesh",{geometry:t,children:X.jsx("meshLambertMaterial",{vertexColors:!1,color:11245952,side:hi})},e))}),gT=["#27AD6B","#2DBE76","#33CC80"],yT=({geometries:n})=>{const t=Q.useMemo(()=>n.map(()=>gT[Math.floor(Math.random()*gT.length)]),[n]);return X.jsx(X.Fragment,{children:n.map((e,i)=>X.jsx("mesh",{geometry:e,children:X.jsx("meshLambertMaterial",{vertexColors:!1,color:t[i],side:hi})},i))})},O$=({points:n})=>{const t=Q.useMemo(()=>{const e=n.map((o,l)=>{const c=new ve().setFromPoints([o.point]),h=new Of({color:"#333333",size:10,sizeAttenuation:!1});return X.jsx("points",{geometry:c,material:h},`point-${l}`)}),i=new ve,r=[];for(let o=0;o{const t=n.zoom,e=n.x,i=n.y,r=n.divisions,s=`https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_farbe/default/GLOBAL_WEBMERCATOR/${t}/${i}/${e}.png`;let[a,o]=Q.useState(null),[l,c]=Q.useState(null),[h,u]=Q.useState(!1),p=X.jsx(X.Fragment,{children:h&&X.jsx("mesh",{geometry:a,material:l})});return Q.useEffect(()=>{async function m(){const g=new S1().loadAsync(s),[_,y,x,M]=bI(e,i,t);let b=[],S=[],R=[],C=0;const T=r+1;for(let j=0;j<=r;j++)for(let Y=0;Y<=r;Y++){const q=_+Y/r*(x-_),at=y+j/r*(M-y);b.push(Sv.toPoint3D(q,at)),S=S.concat([Y/r,1-j/r]),Y>0&&j>0&&(R=R.concat([C-T-1,C-1,C-T,C-T,C-1,C])),C+=1}b=await Promise.all(b);const N=new Float32Array(b.flatMap(j=>j.point)),P=new Float32Array(b.flatMap(j=>j.normal)),E=new Float32Array(S),L=new Uint32Array(R),B=new ve;B.setAttribute("position",new Pe(N,3)),B.setAttribute("normal",new Pe(P,3)),B.setAttribute("uv",new Pe(E,2)),B.setIndex(new Pe(L,1)),o(B);const V=await g;V.colorSpace=Tn,c(new zf({flatShading:!1,map:await g,side:Gr})),u(!0)}m()},[]),p},U$=({visible:n})=>{const[t,e]=wI,[i,r]=Q.useState([]),s=Math.floor(t*16),a=Math.floor(e*16);let o=[];for(let l=-11;l<=11;l++)for(let c=-11;c<=11;c++)o.push({dx:l,dy:c,divisions:2});return o.sort((l,c)=>l.dx*l.dx+l.dy*l.dy-(c.dx*c.dx+c.dy*c.dy)),Q.useEffect(()=>{let l=[];const c=h=>{if(hc(h+1),0)}};return c(0),()=>{r([])}},[s,a]),X.jsx("group",{visible:n,children:i})},k$=({geometries:n,simulationMeshes:t,showTerrain:e,frontendState:i,pvSystems:r,selectedMesh:s,setSelectedMesh:a,pvPoints:o,setPVPoints:l,vegetationGeometries:c})=>{window.setPVPoints=l;const h=[t[0].middle.x,t[0].middle.y-40,t[0].middle.z+80],u=Q.useRef();return X.jsxs(s$,{camera:{fov:45,near:1,far:2e4,position:h,up:[0,0,1],ref:u},children:[X.jsx("ambientLight",{intensity:2}),X.jsx("directionalLight",{intensity:1,position:[0,-1,-2]}),X.jsx("directionalLight",{intensity:.5,position:[1,0,-2]}),X.jsx("directionalLight",{intensity:.5,position:[-1,0,-2]}),n.surrounding.length>0&&X.jsx(mT,{geometries:n.surrounding}),n.background.length>0&&X.jsx(mT,{geometries:n.background}),t.length>0&&X.jsx(N$,{meshes:t}),s&&X.jsx(D$,{meshes:s}),t.length>0&&i=="Results"&&X.jsx(R$,{middle:t[0].middle,selectedMesh:s,setSelectedMesh:a}),i=="DrawPV"&&X.jsx(L$,{middle:t[0].middle,setPVPoints:l}),i=="DrawPV"&&X.jsx(O$,{points:o}),r.length>0&&X.jsx(o$,{pvSystems:r}),c&&X.jsxs(X.Fragment,{children:[c.background&&c.background.length>0&&X.jsx(yT,{geometries:c.background}),c.surrounding&&c.surrounding.length>0&&X.jsx(yT,{geometries:c.surrounding})]}),t.length>0&&X.jsx(U$,{visible:e})]})};function z$(){const n=sI(),[t,e]=Q.useState("Loading"),[i,r]=Q.useState(!0),[s,a]=Q.useState(0),[o,l]=Q.useState([]),[c,h]=Q.useState([]),[u,p]=Q.useState(!1);window.setFederalState=p;const[m,g]=Q.useState({simulation:[],surrounding:[],background:[]}),[_,y]=Q.useState([]),[x,M]=Q.useState([]);window.setGeometries=g,window.setFrontendState=e,window.setSimulationProgress=a;const[b,S]=Q.useState([]);window.setVegetationGeometries=S;const R=async()=>{const{simulationMesh:C}=await hq(n);C&&(M([...x,C]),e("Results"))};return Q.useEffect(()=>{R()},[]),X.jsx(aI,{description:"Berechne das Potential deiner Solaranlage.",children:X.jsxs("div",{className:"content",children:[(t=="Results"||t=="DrawPV")&&X.jsx(_$,{frontendState:t,setFrontendState:e,showTerrain:i,setShowTerrain:r,selectedMesh:_,setSelectedMesh:y,geometries:m,geoLocation:n,setPVSystems:l,pvSystems:o,pvPoints:c,setPVPoints:h,simulationMeshes:x,setSimulationMeshes:M}),t=="ErrorAdress"&&X.jsx(g5,{}),(t=="Results"||t=="DrawPV")&&X.jsx(k$,{geometries:m,simulationMeshes:x,showTerrain:i,frontendState:t,pvSystems:o,setPVSystems:l,selectedMesh:_,setSelectedMesh:y,pvPoints:c,setPVPoints:h,vegetationGeometries:b}),t=="Loading"&&X.jsx(y5,{progress:s}),X.jsx(gI,{federalState:u,frontendState:t})]})})}const RY=Object.freeze(Object.defineProperty({__proto__:null,default:z$},Symbol.toStringTag,{value:"Module"}));export{MY as L,RY as S,wY as a,TY as i}; diff --git a/assets/chunk-7OLJDQMT-DRboIhh9.js b/assets/chunk-7OLJDQMT-E6ec7czU.js similarity index 93% rename from assets/chunk-7OLJDQMT-DRboIhh9.js rename to assets/chunk-7OLJDQMT-E6ec7czU.js index 803f88c..30c2d6b 100644 --- a/assets/chunk-7OLJDQMT-DRboIhh9.js +++ b/assets/chunk-7OLJDQMT-E6ec7czU.js @@ -1 +1 @@ -import{Q as h,f as c,j as n,b as d,i,o as m,x,k as _}from"./index-C4jKHMt0.js";var[v,u]=h("Card"),j=c(function(a,s){const{className:e,...t}=a,r=u();return n.jsx(d.div,{ref:s,className:i("chakra-card__body",e),__css:r.body,...t})}),k=c(function(a,s){const{className:e,...t}=a,r=u();return n.jsx(d.div,{ref:s,className:i("chakra-card__header",e),__css:r.header,...t})}),H=c(function(a,s){const{className:e,children:t,direction:r="column",justify:y,align:C,...f}=m(a),l=x("Card",a);return n.jsx(d.div,{ref:s,className:i("chakra-card",e),__css:{display:"flex",flexDirection:r,justifyContent:y,alignItems:C,position:"relative",minWidth:0,wordWrap:"break-word",...l.container},...f,children:n.jsx(v,{value:l,children:t})})}),g=c(function(a,s){const e=_("Heading",a),{className:t,...r}=m(a);return n.jsx(d.h2,{ref:s,className:i("chakra-heading",a.className),...r,__css:e})});g.displayName="Heading";export{H as C,g as H,k as a,j as b}; +import{Q as h,f as c,j as n,b as d,i,o as m,x,k as _}from"./index-oAnJD5lr.js";var[v,u]=h("Card"),j=c(function(a,s){const{className:e,...t}=a,r=u();return n.jsx(d.div,{ref:s,className:i("chakra-card__body",e),__css:r.body,...t})}),k=c(function(a,s){const{className:e,...t}=a,r=u();return n.jsx(d.div,{ref:s,className:i("chakra-card__header",e),__css:r.header,...t})}),H=c(function(a,s){const{className:e,children:t,direction:r="column",justify:y,align:C,...f}=m(a),l=x("Card",a);return n.jsx(d.div,{ref:s,className:i("chakra-card",e),__css:{display:"flex",flexDirection:r,justifyContent:y,alignItems:C,position:"relative",minWidth:0,wordWrap:"break-word",...l.container},...f,children:n.jsx(v,{value:l,children:t})})}),g=c(function(a,s){const e=_("Heading",a),{className:t,...r}=m(a);return n.jsx(d.h2,{ref:s,className:i("chakra-heading",a.className),...r,__css:e})});g.displayName="Heading";export{H as C,g as H,k as a,j as b}; diff --git a/assets/chunk-QINAG4RG-7Gste7mX.js b/assets/chunk-QINAG4RG-B3RP3bKW.js similarity index 95% rename from assets/chunk-QINAG4RG-7Gste7mX.js rename to assets/chunk-QINAG4RG-B3RP3bKW.js index c8081d9..11a58e5 100644 --- a/assets/chunk-QINAG4RG-7Gste7mX.js +++ b/assets/chunk-QINAG4RG-B3RP3bKW.js @@ -1 +1 @@ -import{f as p,j as k,r as b,l as N,b as j}from"./index-C4jKHMt0.js";var I=p(function(r,e){const{htmlWidth:a,htmlHeight:n,alt:i,...l}=r;return k.jsx("img",{width:a,height:n,ref:e,alt:i,...l})});I.displayName="NativeImage";function S(s){const{loading:r,src:e,srcSet:a,onLoad:n,onError:i,crossOrigin:l,sizes:f,ignoreFallback:u}=s,[c,g]=b.useState("pending");b.useEffect(()=>{g(e?"loading":"pending")},[e]);const t=b.useRef(),h=b.useCallback(()=>{if(!e)return;d();const o=new Image;o.src=e,l&&(o.crossOrigin=l),a&&(o.srcset=a),f&&(o.sizes=f),r&&(o.loading=r),o.onload=m=>{d(),g("loaded"),n==null||n(m)},o.onerror=m=>{d(),g("failed"),i==null||i(m)},t.current=o},[e,l,a,f,n,i,r]),d=()=>{t.current&&(t.current.onload=null,t.current.onerror=null,t.current=null)};return N(()=>{if(!u)return c==="loading"&&h(),()=>{d()}},[c,h,u]),u?"loaded":c}var O=(s,r)=>s!=="loaded"&&r==="beforeLoadOrError"||s==="failed"&&r==="onError";function w(s,r=[]){const e=Object.assign({},s);for(const a of r)a in e&&delete e[a];return e}var y=p(function(r,e){const{fallbackSrc:a,fallback:n,src:i,srcSet:l,align:f,fit:u,loading:c,ignoreFallback:g,crossOrigin:t,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:d,...o}=r,m=a!==void 0||n!==void 0,v=c!=null||g||!m,F=S({...r,crossOrigin:t,ignoreFallback:v}),x=O(F,h),E={ref:e,objectFit:u,objectPosition:f,...v?o:w(o,["onError","onLoad"])};return x?n||k.jsx(j.img,{as:I,className:"chakra-image__placeholder",src:a,...E}):k.jsx(j.img,{as:I,src:i,srcSet:l,crossOrigin:t,loading:c,referrerPolicy:d,className:"chakra-image",...E})});y.displayName="Image";export{y as I}; +import{f as p,j as k,r as b,l as N,b as j}from"./index-oAnJD5lr.js";var I=p(function(r,e){const{htmlWidth:a,htmlHeight:n,alt:i,...l}=r;return k.jsx("img",{width:a,height:n,ref:e,alt:i,...l})});I.displayName="NativeImage";function S(s){const{loading:r,src:e,srcSet:a,onLoad:n,onError:i,crossOrigin:l,sizes:f,ignoreFallback:u}=s,[c,g]=b.useState("pending");b.useEffect(()=>{g(e?"loading":"pending")},[e]);const t=b.useRef(),h=b.useCallback(()=>{if(!e)return;d();const o=new Image;o.src=e,l&&(o.crossOrigin=l),a&&(o.srcset=a),f&&(o.sizes=f),r&&(o.loading=r),o.onload=m=>{d(),g("loaded"),n==null||n(m)},o.onerror=m=>{d(),g("failed"),i==null||i(m)},t.current=o},[e,l,a,f,n,i,r]),d=()=>{t.current&&(t.current.onload=null,t.current.onerror=null,t.current=null)};return N(()=>{if(!u)return c==="loading"&&h(),()=>{d()}},[c,h,u]),u?"loaded":c}var O=(s,r)=>s!=="loaded"&&r==="beforeLoadOrError"||s==="failed"&&r==="onError";function w(s,r=[]){const e=Object.assign({},s);for(const a of r)a in e&&delete e[a];return e}var y=p(function(r,e){const{fallbackSrc:a,fallback:n,src:i,srcSet:l,align:f,fit:u,loading:c,ignoreFallback:g,crossOrigin:t,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:d,...o}=r,m=a!==void 0||n!==void 0,v=c!=null||g||!m,F=S({...r,crossOrigin:t,ignoreFallback:v}),x=O(F,h),E={ref:e,objectFit:u,objectPosition:f,...v?o:w(o,["onError","onLoad"])};return x?n||k.jsx(j.img,{as:I,className:"chakra-image__placeholder",src:a,...E}):k.jsx(j.img,{as:I,src:i,srcSet:l,crossOrigin:t,loading:c,referrerPolicy:d,className:"chakra-image",...E})});y.displayName="Image";export{y as I}; diff --git a/assets/chunk-ZHMYA64R-FVqXPkJW.js b/assets/chunk-ZHMYA64R-n90-wtrP.js similarity index 91% rename from assets/chunk-ZHMYA64R-FVqXPkJW.js rename to assets/chunk-ZHMYA64R-n90-wtrP.js index 70f694d..3a2b9e9 100644 --- a/assets/chunk-ZHMYA64R-FVqXPkJW.js +++ b/assets/chunk-ZHMYA64R-n90-wtrP.js @@ -1 +1 @@ -import{G as D,j as a,b as p,f as I,r as o,i as E}from"./index-C4jKHMt0.js";import{p as R}from"./Footer-Cdi5kbhN.js";function A(e,t){return Array.isArray(e)?e.map(r=>r===null?null:t(r)):D(e)?Object.keys(e).reduce((r,s)=>(r[s]=t(e[s]),r),{}):e!=null?t(e):null}var W=e=>a.jsx(p.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});W.displayName="StackItem";function M(e){const{spacing:t,direction:r}=e,s={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":A(r,d=>s[d])}}var O=I((e,t)=>{const{isInline:r,direction:s,align:d,justify:_,spacing:c="0.5rem",wrap:j,children:f,divider:l,className:g,shouldWrapChildren:m,...S}=e,u=r?"row":s??"column",x=o.useMemo(()=>M({spacing:c,direction:u}),[c,u]),i=!!l,y=!m&&!i,w=o.useMemo(()=>{const h=R(f);return y?h:h.map((n,v)=>{const k=typeof n.key<"u"?n.key:v,N=v+1===h.length,b=m?a.jsx(W,{children:n},k):n;if(!i)return b;const L=o.cloneElement(l,{__css:x}),B=N?null:L;return a.jsxs(o.Fragment,{children:[b,B]},k)})},[l,x,i,y,m,f]),C=E("chakra-stack",g);return a.jsx(p.div,{ref:t,display:"flex",alignItems:d,justifyContent:_,flexDirection:u,flexWrap:j,gap:i?void 0:c,className:C,...S,children:w})});O.displayName="Stack";export{O as S,A as m}; +import{G as D,j as a,b as p,f as I,r as o,i as E}from"./index-oAnJD5lr.js";import{p as R}from"./Footer-CN0UQ_Me.js";function A(e,t){return Array.isArray(e)?e.map(r=>r===null?null:t(r)):D(e)?Object.keys(e).reduce((r,s)=>(r[s]=t(e[s]),r),{}):e!=null?t(e):null}var W=e=>a.jsx(p.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});W.displayName="StackItem";function M(e){const{spacing:t,direction:r}=e,s={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":A(r,d=>s[d])}}var O=I((e,t)=>{const{isInline:r,direction:s,align:d,justify:_,spacing:c="0.5rem",wrap:j,children:f,divider:l,className:g,shouldWrapChildren:m,...S}=e,u=r?"row":s??"column",x=o.useMemo(()=>M({spacing:c,direction:u}),[c,u]),i=!!l,y=!m&&!i,w=o.useMemo(()=>{const h=R(f);return y?h:h.map((n,v)=>{const k=typeof n.key<"u"?n.key:v,N=v+1===h.length,b=m?a.jsx(W,{children:n},k):n;if(!i)return b;const L=o.cloneElement(l,{__css:x}),B=N?null:L;return a.jsxs(o.Fragment,{children:[b,B]},k)})},[l,x,i,y,m,f]),C=E("chakra-stack",g);return a.jsx(p.div,{ref:t,display:"flex",alignItems:d,justifyContent:_,flexDirection:u,flexWrap:j,gap:i?void 0:c,className:C,...S,children:w})});O.displayName="Stack";export{O as S,A as m}; diff --git a/assets/deflate-B1g-JsHt.js b/assets/deflate-B1g-JsHt.js new file mode 100644 index 0000000..7db1a99 --- /dev/null +++ b/assets/deflate-B1g-JsHt.js @@ -0,0 +1 @@ +import{i as r}from"./Simulation-C4ya-gKI.js";import{B as o}from"./basedecoder-DvumDe3Y.js";import"./index-oAnJD5lr.js";import"./chunk-7OLJDQMT-E6ec7czU.js";import"./Footer-CN0UQ_Me.js";import"./location-BLLHg7ZW.js";import"./chunk-ZHMYA64R-n90-wtrP.js";class c extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{c as default}; diff --git a/assets/deflate-C_ni00X0.js b/assets/deflate-C_ni00X0.js deleted file mode 100644 index 8fef823..0000000 --- a/assets/deflate-C_ni00X0.js +++ /dev/null @@ -1 +0,0 @@ -import{i as r}from"./Simulation-C3BVol_5.js";import{B as o}from"./basedecoder-DvumDe3Y.js";import"./index-C4jKHMt0.js";import"./chunk-7OLJDQMT-DRboIhh9.js";import"./Footer-Cdi5kbhN.js";import"./location-qV39J3P0.js";import"./chunk-ZHMYA64R-FVqXPkJW.js";class c extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{c as default}; diff --git a/assets/index-C4jKHMt0.js b/assets/index-oAnJD5lr.js similarity index 99% rename from assets/index-C4jKHMt0.js rename to assets/index-oAnJD5lr.js index ab41500..459c42a 100644 --- a/assets/index-C4jKHMt0.js +++ b/assets/index-oAnJD5lr.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Map-Bdq5r1vl.js","assets/Footer-Cdi5kbhN.js","assets/location-qV39J3P0.js","assets/chunk-QINAG4RG-7Gste7mX.js","assets/Map-k4G4I0uA.css","assets/Simulation-C3BVol_5.js","assets/chunk-7OLJDQMT-DRboIhh9.js","assets/chunk-ZHMYA64R-FVqXPkJW.js","assets/Impressum-mtZspX0T.js","assets/Datenschutz-BvJtWswR.js","assets/About-hHljlKAu.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Map-Dk16L0g4.js","assets/Footer-CN0UQ_Me.js","assets/location-BLLHg7ZW.js","assets/chunk-QINAG4RG-B3RP3bKW.js","assets/Map-k4G4I0uA.css","assets/Simulation-C4ya-gKI.js","assets/chunk-7OLJDQMT-E6ec7czU.js","assets/chunk-ZHMYA64R-n90-wtrP.js","assets/Impressum-0nu2Idu7.js","assets/Datenschutz-D4rOodQl.js","assets/About-DxBDVk_Y.js"])))=>i.map(i=>d[i]); var EC=Object.defineProperty;var $C=(e,t,r)=>t in e?EC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var fr=(e,t,r)=>$C(e,typeof t!="symbol"?t+"":t,r);function B0(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();const RC="modulepreload",AC=function(e){return"/"+e},Em={},Yn=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(r.map(a=>{if(a=AC(a),a in Em)return;Em[a]=!0;const l=a.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":RC,l||(c.as="script",c.crossOrigin=""),c.href=a,s&&c.setAttribute("nonce",s),document.head.appendChild(c),l)return new Promise((d,f)=>{c.addEventListener("load",d),c.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V0={exports:{}},hu={},U0={exports:{}},G={};/** * @license React * react.production.min.js @@ -374,4 +374,4 @@ Error generating stack: `+o.message+` * * @license MIT */function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function TI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function PI(e,t){return e.button===0&&(!t||t==="_self")&&!TI(e)}const _I=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],EI="6";try{window.__reactRouterVersion=EI}catch{}const $I="startTransition",c0=Rd[$I];function RI(e){let{basename:t,children:r,future:n,window:i}=e,o=x.useRef();o.current==null&&(o.current=zD({window:i,v5Compat:!0}));let s=o.current,[a,l]=x.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},c=x.useCallback(d=>{u&&c0?c0(()=>l(d)):l(d)},[l,u]);return x.useLayoutEffect(()=>s.listen(c),[s,c]),x.createElement(wI,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:s,future:n})}const AI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eh=x.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,unstable_viewTransition:d}=t,f=CI(t,_I),{basename:p}=x.useContext(ei),y,v=!1;if(typeof u=="string"&&OI.test(u)&&(y=u,AI))try{let g=new URL(window.location.href),w=u.startsWith("//")?new URL(g.protocol+u):new URL(u),P=nm(w.pathname,p);w.origin===g.origin&&P!=null?u=P+w.search+w.hash:v=!0}catch{}let S=aI(u,{relative:i}),m=LI(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:i,unstable_viewTransition:d});function h(g){n&&n(g),g.defaultPrevented||m(g)}return x.createElement("a",Jf({},f,{href:y||S,onClick:v||o?n:h,ref:r,target:l}))});var d0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(d0||(d0={}));var f0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(f0||(f0={}));function LI(e,t){let{target:r,replace:n,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,l=lI(),u=nc(),c=Gw(e,{relative:s});return x.useCallback(d=>{if(PI(d,r)){d.preventDefault();let f=n!==void 0?n:su(u)===su(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[u,l,c,n,i,r,e,o,s,a])}const MI={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class lu{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||MI,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i{let[a,l]=s;for(let u=0;u{let[a,l]=s;for(let u=0;u{let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r},h0=e=>e==null?"":""+e,zI=(e,t,r)=>{e.forEach(n=>{t[n]&&(r[n]=t[n])})},jI=/###/g,p0=e=>e&&e.indexOf("###")>-1?e.replace(jI,"."):e,m0=e=>!e||typeof e=="string",us=(e,t,r)=>{const n=typeof t!="string"?t:t.split(".");let i=0;for(;i{const{obj:n,k:i}=us(e,t,Object);if(n!==void 0||t.length===1){n[i]=r;return}let o=t[t.length-1],s=t.slice(0,t.length-1),a=us(e,s,Object);for(;a.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=us(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=r},DI=(e,t,r,n)=>{const{obj:i,k:o}=us(e,t,Object);i[o]=i[o]||[],i[o].push(r)},uu=(e,t)=>{const{obj:r,k:n}=us(e,t);if(r)return r[n]},II=(e,t,r)=>{const n=uu(e,r);return n!==void 0?n:uu(t,r)},Yw=(e,t,r)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):Yw(e[n],t[n],r):e[n]=t[n]);return e},oi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var FI={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const NI=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>FI[t]):e;class BI{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const VI=[" ",",","?","!",";"],UI=new BI(20),WI=(e,t,r)=>{t=t||"",r=r||"";const n=VI.filter(s=>t.indexOf(s)<0&&r.indexOf(s)<0);if(n.length===0)return!0;const i=UI.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(r);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},th=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let i=e;for(let o=0;o-1&&le&&e.indexOf("_")>0?e.replace("_","-"):e;class y0 extends ic{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,r],n&&(Array.isArray(n)?a.push(...n):typeof n=="string"&&o?a.push(...n.split(o)):a.push(n)));const l=uu(this.data,a);return!l&&!r&&!n&&t.indexOf(".")>-1&&(t=a[0],r=a[1],n=a.slice(2).join(".")),l||!s||typeof n!="string"?l:th(this.data&&this.data[t]&&this.data[t][r],n,o)}addResource(t,r,n,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,r];n&&(a=a.concat(s?n.split(s):n)),t.indexOf(".")>-1&&(a=t.split("."),i=r,r=a[1]),this.addNamespaces(r),g0(this.data,a,i),o.silent||this.emit("added",t,r,n,i)}addResources(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in n)(typeof n[o]=="string"||Array.isArray(n[o]))&&this.addResource(t,r,o,n[o],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,r];t.indexOf(".")>-1&&(a=t.split("."),i=n,n=r,r=a[1]),this.addNamespaces(r);let l=uu(this.data,a)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Yw(l,n,o):l={...l,...n},g0(this.data,a,l),s.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,r)}:this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var Qw={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,r,n,i))}),t}};const v0={};class du extends ic{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),zI(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ir.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=r.ns||this.options.defaultNS||[];const s=n&&t.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!WI(t,n,i);if(s&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],r),l=a[a.length-1],u=r.lng||this.language,c=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const w=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${w}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${w}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:s}const d=this.resolve(t,r);let f=d&&d.res;const p=d&&d.usedKey||s,y=d&&d.exactUsedKey||s,v=Object.prototype.toString.apply(f),S=["[object Number]","[object Function]","[object RegExp]"],m=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,h=!this.i18nFormat||this.i18nFormat.handleAsObject;if(h&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&S.indexOf(v)<0&&!(typeof m=="string"&&Array.isArray(f))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=w,d.usedParams=this.getUsedParamsDetails(r),d):w}if(o){const w=Array.isArray(f),P=w?[]:{},R=w?y:p;for(const $ in f)if(Object.prototype.hasOwnProperty.call(f,$)){const A=`${R}${o}${$}`;P[$]=this.translate(A,{...r,joinArrays:!1,ns:a}),P[$]===A&&(P[$]=f[$])}f=P}}else if(h&&typeof m=="string"&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,r,n));else{let w=!1,P=!1;const R=r.count!==void 0&&typeof r.count!="string",$=du.hasDefaultValue(r),A=R?this.pluralResolver.getSuffix(u,r.count,r):"",F=r.ordinal&&R?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",D=R&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),K=D&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${A}`]||r[`defaultValue${F}`]||r.defaultValue;!this.isValidLookup(f)&&$&&(w=!0,f=K),this.isValidLookup(f)||(P=!0,f=s);const dt=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:f,ze=$&&K!==f&&this.options.updateMissing;if(P||w||ze){if(this.logger.log(ze?"updateKey":"missingKey",u,l,s,ze?K:f),o){const O=this.resolve(s,{...r,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let T=[];const L=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&L&&L[0])for(let O=0;O{const Q=$&&z!==f?z:dt;this.options.missingKeyHandler?this.options.missingKeyHandler(O,l,j,Q,ze,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(O,l,j,Q,ze,r),this.emit("missingKey",O,l,j,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?T.forEach(O=>{const j=this.pluralResolver.getSuffixes(O,r);D&&r[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(z=>{U([O],s+z,r[`defaultValue${z}`]||K)})}):U(T,s,K))}f=this.extendTranslation(f,t,r,d,n),P&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(P||w)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,w?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(r),d):f}extendTranslation(t,r,n,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,n.lng||this.language||i.usedLng,n),u){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;c1&&arguments[1]!==void 0?arguments[1]:{},n,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=r.count!==void 0&&typeof r.count!="string",p=f&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),y=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",v=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);d.forEach(S=>{this.isValidLookup(n)||(a=S,!v0[`${v[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(v0[`${v[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(m=>{if(this.isValidLookup(n))return;s=m;const h=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(h,c,m,S,r);else{let w;f&&(w=this.pluralResolver.getSuffix(m,r.count,r));const P=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(h.push(c+w),r.ordinal&&w.indexOf(R)===0&&h.push(c+w.replace(R,this.options.pluralSeparator)),p&&h.push(c+P)),y){const $=`${c}${this.options.contextSeparator}${r.context}`;h.push($),f&&(h.push($+w),r.ordinal&&w.indexOf(R)===0&&h.push($+w.replace(R,this.options.pluralSeparator)),p&&h.push($+P))}}let g;for(;g=h.pop();)this.isValidLookup(n)||(o=g,n=this.getResource(m,S,g,r))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&typeof t.replace!="string";let i=n?t.replace:t;if(n&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const o of r)delete i[o]}return i}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}const wd=e=>e.charAt(0).toUpperCase()+e.slice(1);class b0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ir.create("languageUtils")}getScriptPartFromCode(t){if(t=cu(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=cu(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=wd(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=wd(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=wd(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),n.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let HI=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],KI={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const GI=["v1","v2","v3"],qI=["v4"],S0={zero:0,one:1,two:2,few:3,many:4,other:5},XI=()=>{const e={};return HI.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:KI[t.fc]}})}),e};class YI{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=ir.create("pluralResolver"),(!this.options.compatibilityJSON||qI.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=XI(),this.pluralRulesCache={}}addRule(t,r){this.rules[t]=r}clearCache(){this.pluralRulesCache={}}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const n=cu(t==="dev"?"en":t),i=r.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const s=new Intl.PluralRules(n,{type:i});return this.pluralRulesCache[o]=s,s}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,o)=>S0[i]-S0[o]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(t,i,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let i=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!GI.includes(this.options.compatibilityJSON)}}const x0=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=II(e,t,r);return!o&&i&&typeof r=="string"&&(o=th(e,r,n),o===void 0&&(o=th(t,r,n))),o},kd=e=>e.replace(/\$/g,"$$$$");class QI{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ir.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:y,nestingSuffixEscaped:v,nestingOptionsSeparator:S,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=r!==void 0?r:NI,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?oi(o):s||"{{",this.suffix=a?oi(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=f?oi(f):p||oi("$t("),this.nestingSuffix=y?oi(y):v||oi(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=m||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,n)=>r&&r.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,r,n,i){let o,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const m=x0(r,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,n,{...i,...r,interpolationkey:p}):m}const y=p.split(this.formatSeparator),v=y.shift().trim(),S=y.join(this.formatSeparator).trim();return this.format(x0(r,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,{...i,...r,interpolationkey:v})};this.resetRegExp();const c=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>kd(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?kd(this.escape(p)):kd(p)}].forEach(p=>{for(a=0;o=p.regex.exec(t);){const y=o[1].trim();if(s=u(y),s===void 0)if(typeof c=="function"){const S=c(t,o,i);s=typeof S=="string"?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,y))s="";else if(d){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=h0(s));const v=p.safeValue(s);if(t=t.replace(o[0],v),d?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,s;const a=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,s);const p=f.match(/'/g),y=f.match(/"/g);(p&&p.length%2===0&&!y||y.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${c}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];s={...n},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=r(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=h0(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,n.lng,{...n,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const ZI=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(s=>{if(s){const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();r[c]||(r[c]=u),u==="false"&&(r[c]=!1),u==="true"&&(r[c]=!0),isNaN(u)||(r[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:r}},si=e=>{const t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=n+JSON.stringify(o);let a=t[s];return a||(a=e(cu(n),i),t[s]=a),a(r)}};class JI{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ir.create("formatter"),this.options=t,this.formats={number:si((r,n)=>{const i=new Intl.NumberFormat(r,{...n});return o=>i.format(o)}),currency:si((r,n)=>{const i=new Intl.NumberFormat(r,{...n,style:"currency"});return o=>i.format(o)}),datetime:si((r,n)=>{const i=new Intl.DateTimeFormat(r,{...n});return o=>i.format(o)}),relativetime:si((r,n)=>{const i=new Intl.RelativeTimeFormat(r,{...n});return o=>i.format(o,n.range||"day")}),list:si((r,n)=>{const i=new Intl.ListFormat(r,{...n});return o=>i.format(o)})},this.init(t)}init(t){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=si(r)}format(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=r.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(a=>a.indexOf(")")>-1)){const a=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,a)].join(this.formatSeparator)}return o.reduce((a,l)=>{const{formatName:u,formatOptions:c}=ZI(l);if(this.formats[u]){let d=a;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},p=f.locale||f.lng||i.locale||i.lng||n;d=this.formats[u](a,p,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const eF=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class tF extends ic{constructor(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=ir.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(t,r,n,i){const o={},s={},a={},l={};return t.forEach(u=>{let c=!0;r.forEach(d=>{const f=`${u}|${d}`;!n.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,c=!1,s[f]===void 0&&(s[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(a[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const i=t.split("|"),o=i[0],s=i[1];r&&this.emit("failedLoading",o,s,r),!r&&n&&this.store.addResourceBundle(o,s,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);const a={};this.queue.forEach(l=>{DI(l.loaded,[o],s),eF(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{a[u][d]===void 0&&(a[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:o,callback:s});return}this.readingCalls++;const a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i{this.read.call(this,t,r,n,i+1,o*2,s)},o);return}s(u,c)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(t,r);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(t,r,a)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof r=="string"&&(r=[r]);const o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${r}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${r}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,r,n,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const l={...s,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,r,n,i,l):c=u(t,r,n,i),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(t,r,n,i,a,l)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}const w0=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),k0=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Ua=()=>{},rF=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class Vs extends ic{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=k0(t),this.services={},this.logger=ir,this.modules={external:[]},rF(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=w0();this.options={...i,...this.options,...k0(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?ir.init(o(this.modules.logger),this.options):ir.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=JI);const d=new b0(this.options);this.store=new y0(this.options.resources,this.options);const f=this.services;f.logger=ir,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new YI(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new QI(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new tF(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var y=arguments.length,v=new Array(y>1?y-1:0),S=1;S1?y-1:0),S=1;S{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Ua),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=Ro(),u=()=>{const c=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ua;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(a)})}else n(null)}reloadResources(t,r,n){const i=Ro();return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),n||(n=Ua),this.services.backendConnector.reload(t,r,o=>{i.resolve(),n(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Qw.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const i=Ro();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{s(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,r,n){var i=this;const o=function(s,a){let l;if(typeof a!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d`${l.keyPrefix}${f}${y}`):p=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s,i.t(p,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const a=r.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,t)&&(!i||s(o,t)))}loadNamespaces(t,r){const n=Ro();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=Ro();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{n.resolve(),r&&r(s)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new b0(w0());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Vs(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ua;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Vs(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new y0(this.store.data,i),o.services.resourceStore=o.store),o.translator=new du(o.services,i),o.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c{console!=null&&console.warn&&(Un(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},C0={},rh=(...e)=>{Un(e[0])&&C0[e[0]]||(Un(e[0])&&(C0[e[0]]=new Date),nF(...e))},Zw=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},T0=(e,t,r)=>{e.loadNamespaces(t,Zw(e,r))},P0=(e,t,r,n)=>{Un(r)&&(r=[r]),r.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Zw(e,n))},iF=(e,t,r={})=>!t.languages||!t.languages.length?(rh("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(n,i)=>{var o;if(((o=r.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,e))return!1}}),Un=e=>typeof e=="string",oF=e=>typeof e=="object"&&e!==null,sF=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,aF={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},lF=e=>aF[e],uF=e=>e.replace(sF,lF);let nh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uF};const cF=(e={})=>{nh={...nh,...e}},dF=()=>nh;let Jw;const fF=e=>{Jw=e},hF=()=>Jw,pF={type:"3rdParty",init(e){cF(e.options.react),fF(e)}},mF=x.createContext();class gF{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{var n;(n=this.usedNamespaces)[r]??(n[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const yF=(e,t)=>{const r=x.useRef();return x.useEffect(()=>{r.current=e},[e,t]),r.current},ek=(e,t,r,n)=>e.getFixedT(t,r,n),vF=(e,t,r,n)=>x.useCallback(ek(e,t,r,n),[e,t,r,n]),tk=(e,t={})=>{var w,P,R,$;const{i18n:r}=t,{i18n:n,defaultNS:i}=x.useContext(mF)||{},o=r||n||hF();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new gF),!o){rh("You will need to pass in an i18next instance by using initReactI18next");const A=(D,K)=>Un(K)?K:oF(K)&&Un(K.defaultValue)?K.defaultValue:Array.isArray(D)?D[D.length-1]:D,F=[A,{},!1];return F.t=A,F.i18n={},F.ready=!1,F}(w=o.options.react)!=null&&w.wait&&rh("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...dF(),...o.options.react,...t},{useSuspense:a,keyPrefix:l}=s;let u=i||((P=o.options)==null?void 0:P.defaultNS);u=Un(u)?[u]:u||["translation"],($=(R=o.reportNamespaces).addUsedNamespaces)==null||$.call(R,u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(A=>iF(A,o,s)),d=vF(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),f=()=>d,p=()=>ek(o,t.lng||null,s.nsMode==="fallback"?u:u[0],l),[y,v]=x.useState(f);let S=u.join();t.lng&&(S=`${t.lng}${S}`);const m=yF(S),h=x.useRef(!0);x.useEffect(()=>{const{bindI18n:A,bindI18nStore:F}=s;h.current=!0,!c&&!a&&(t.lng?P0(o,t.lng,u,()=>{h.current&&v(p)}):T0(o,u,()=>{h.current&&v(p)})),c&&m&&m!==S&&h.current&&v(p);const D=()=>{h.current&&v(p)};return A&&(o==null||o.on(A,D)),F&&(o==null||o.store.on(F,D)),()=>{h.current=!1,o&&(A==null||A.split(" ").forEach(K=>o.off(K,D))),F&&o&&F.split(" ").forEach(K=>o.store.off(K,D))}},[o,S]),x.useEffect(()=>{h.current&&c&&v(f)},[o,l,c]);const g=[y,o,c];if(g.t=y,g.i18n=o,g.ready=c,c||!c&&!a)return g;throw new Promise(A=>{t.lng?P0(o,t.lng,u,()=>A()):T0(o,u,()=>A())})};function ih(e){"@babel/helpers - typeof";return ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ih(e)}function rk(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":ih(XMLHttpRequest))==="object"}function bF(e){return!!e&&typeof e.then=="function"}function SF(e){return bF(e)?e:Promise.resolve(e)}function xF(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var oh={exports:{}},Wa={exports:{}},_0;function wF(){return _0||(_0=1,function(e,t){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof vr<"u"&&vr,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}();(function(o){(function(s){var a=typeof o<"u"&&o||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(T){return T&&DataView.prototype.isPrototypeOf(T)}if(l.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(T){return T&&c.indexOf(Object.prototype.toString.call(T))>-1};function f(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError('Invalid character in header field name: "'+T+'"');return T.toLowerCase()}function p(T){return typeof T!="string"&&(T=String(T)),T}function y(T){var L={next:function(){var U=T.shift();return{done:U===void 0,value:U}}};return l.iterable&&(L[Symbol.iterator]=function(){return L}),L}function v(T){this.map={},T instanceof v?T.forEach(function(L,U){this.append(U,L)},this):Array.isArray(T)?T.forEach(function(L){this.append(L[0],L[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(L){this.append(L,T[L])},this)}v.prototype.append=function(T,L){T=f(T),L=p(L);var U=this.map[T];this.map[T]=U?U+", "+L:L},v.prototype.delete=function(T){delete this.map[f(T)]},v.prototype.get=function(T){return T=f(T),this.has(T)?this.map[T]:null},v.prototype.has=function(T){return this.map.hasOwnProperty(f(T))},v.prototype.set=function(T,L){this.map[f(T)]=p(L)},v.prototype.forEach=function(T,L){for(var U in this.map)this.map.hasOwnProperty(U)&&T.call(L,this.map[U],U,this)},v.prototype.keys=function(){var T=[];return this.forEach(function(L,U){T.push(U)}),y(T)},v.prototype.values=function(){var T=[];return this.forEach(function(L){T.push(L)}),y(T)},v.prototype.entries=function(){var T=[];return this.forEach(function(L,U){T.push([U,L])}),y(T)},l.iterable&&(v.prototype[Symbol.iterator]=v.prototype.entries);function S(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}function m(T){return new Promise(function(L,U){T.onload=function(){L(T.result)},T.onerror=function(){U(T.error)}})}function h(T){var L=new FileReader,U=m(L);return L.readAsArrayBuffer(T),U}function g(T){var L=new FileReader,U=m(L);return L.readAsText(T),U}function w(T){for(var L=new Uint8Array(T),U=new Array(L.length),O=0;O-1?L:T}function F(T,L){if(!(this instanceof F))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L=L||{};var U=L.body;if(T instanceof F){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,L.headers||(this.headers=new v(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!U&&T._bodyInit!=null&&(U=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new v(L.headers)),this.method=A(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var O=/([?&])_=[^&]*/;if(O.test(this.url))this.url=this.url.replace(O,"$1_="+new Date().getTime());else{var j=/\?/;this.url+=(j.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function D(T){var L=new FormData;return T.trim().split("&").forEach(function(U){if(U){var O=U.split("="),j=O.shift().replace(/\+/g," "),z=O.join("=").replace(/\+/g," ");L.append(decodeURIComponent(j),decodeURIComponent(z))}}),L}function K(T){var L=new v,U=T.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(O){return O.indexOf(` -`)===0?O.substr(1,O.length):O}).forEach(function(O){var j=O.split(":"),z=j.shift().trim();if(z){var Q=j.join(":").trim();L.append(z,Q)}}),L}R.call(F.prototype);function ge(T,L){if(!(this instanceof ge))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new v(L.headers),this.url=L.url||"",this._initBody(T)}R.call(ge.prototype),ge.prototype.clone=function(){return new ge(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},ge.error=function(){var T=new ge(null,{status:0,statusText:""});return T.type="error",T};var dt=[301,302,303,307,308];ge.redirect=function(T,L){if(dt.indexOf(L)===-1)throw new RangeError("Invalid status code");return new ge(null,{status:L,headers:{location:T}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,U){this.message=L,this.name=U;var O=Error(L);this.stack=O.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function ze(T,L){return new Promise(function(U,O){var j=new F(T,L);if(j.signal&&j.signal.aborted)return O(new s.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function Q(){z.abort()}z.onload=function(){var H={status:z.status,statusText:z.statusText,headers:K(z.getAllResponseHeaders()||"")};H.url="responseURL"in z?z.responseURL:H.headers.get("X-Request-URL");var Qe="response"in z?z.response:z.responseText;setTimeout(function(){U(new ge(Qe,H))},0)},z.onerror=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},z.onabort=function(){setTimeout(function(){O(new s.DOMException("Aborted","AbortError"))},0)};function xe(H){try{return H===""&&a.location.href?a.location.href:H}catch{return H}}z.open(j.method,xe(j.url),!0),j.credentials==="include"?z.withCredentials=!0:j.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(l.blob?z.responseType="blob":l.arrayBuffer&&j.headers.get("Content-Type")&&j.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(z.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof v)?Object.getOwnPropertyNames(L.headers).forEach(function(H){z.setRequestHeader(H,p(L.headers[H]))}):j.headers.forEach(function(H,Qe){z.setRequestHeader(Qe,H)}),j.signal&&(j.signal.addEventListener("abort",Q),z.onreadystatechange=function(){z.readyState===4&&j.signal.removeEventListener("abort",Q)}),z.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return ze.polyfill=!0,a.fetch||(a.fetch=ze,a.Headers=v,a.Request=F,a.Response=ge),s.Headers=v,s.Request=F,s.Response=ge,s.fetch=ze,s})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Wa,Wa.exports)),Wa.exports}(function(e,t){var r;if(typeof fetch=="function"&&(typeof vr<"u"&&vr.fetch?r=vr.fetch:typeof window<"u"&&window.fetch?r=window.fetch:r=fetch),typeof xF<"u"&&typeof window>"u"){var n=r||wF();n.default&&(n=n.default),t.default=n,e.exports=t.default}})(oh,oh.exports);var nk=oh.exports;const ik=Qn(nk),E0=B0({__proto__:null,default:ik},[nk]);function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function R0(e){for(var t=1;t"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(n):t.requestOptions,a=R0({method:n?"POST":"GET",body:n?t.stringify(n):void 0,headers:o},O0?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{A0(r,a,i,l)}catch(u){if(!s||Object.keys(s).length===0||!u.message||u.message.indexOf("not implemented")<0)return i(u);try{Object.keys(s).forEach(function(c){delete a[c]}),A0(r,a,i,l),O0=!0}catch(c){i(c)}}},_F=function(t,r,n,i){n&&Xn(n)==="object"&&(n=sh("",n).slice(1)),t.queryStringParams&&(r=sh(r,t.queryStringParams));try{var o;Us?o=new Us:o=new fu("MSXML2.XMLHTTP.3.0"),o.open(n?"POST":"GET",r,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(l){console&&console.log(l)}},EF=function(t,r,n,i){if(typeof n=="function"&&(i=n,n=void 0),i=i||function(){},Rr&&r.indexOf("file:")!==0)return PF(t,r,n,i);if(rk()||typeof ActiveXObject=="function")return _F(t,r,n,i);i(new Error("No fetch and no xhr implementation found!"))};function ro(e){"@babel/helpers - typeof";return ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ro(e)}function L0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Cd(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$F(this,e),this.services=t,this.options=r,this.allOptions=n,this.type="backend",this.init(t,r,n)}return AF(e,[{key:"init",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=r,this.options=Cd(Cd(Cd({},LF()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var s=setInterval(function(){return n.reload()},this.options.reloadInterval);ro(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(r,n,i){this._readAny(r,r,n,n,i)}},{key:"read",value:function(r,n,i){this._readAny([r],r,[n],n,i)}},{key:"_readAny",value:function(r,n,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(r,i)),l=SF(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:r.join("+"),ns:i.join("+")});a.loadUrl(c,s,n,o)})}},{key:"loadUrl",value:function(r,n,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,r,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return n("failed loading "+r+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return n("failed loading "+r+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.toLowerCase().indexOf("failed")>-1&&(c.message.indexOf("fetch")>-1||c.message.toLowerCase().indexOf("network")>-1))return n("failed loading "+r+": "+c.message,!0);if(c)return n(c,!1);var f,p;try{typeof d.data=="string"?f=s.options.parse(d.data,i,o):f=d.data}catch{p="failed parsing "+r+" to json"}if(p)return n(p,!1);n(null,f)})}},{key:"create",value:function(r,n,i,o,s){var a=this;if(this.options.addPath){typeof r=="string"&&(r=[r]);var l=this.options.parsePayload(n,i,o),u=0,c=[],d=[];r.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,n));var y=a.services.interpolator.interpolate(p,{lng:f,ns:n});a.options.request(a.options,y,l,function(v,S){u+=1,c.push(v),d.push(S),u===r.length&&typeof s=="function"&&s(c,d)})})}}},{key:"reload",value:function(){var r=this,n=this.services,i=n.backendConnector,o=n.languageUtils,s=n.logger,a=i.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){r.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,p){f&&s.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&p&&s.log("loaded namespace ".concat(d," for language ").concat(c),p),i.loaded("".concat(c,"|").concat(d),f,p)})})})}}}])}();ak.type="backend";Ye.use(ak).use(pF).init({fallbackLng:"de"});var MF=function(e,t,r,n,i,o,s,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,o,s,a],c=0;l=new Error(t.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},zF=MF;const M0=Qn(zF);var jF=function(t,r,n,i){var o=n?n.call(i,t,r):void 0;if(o!==void 0)return!!o;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var s=Object.keys(t),a=Object.keys(r);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(lk||{}),Td={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},z0=Object.values(lk),om={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},IF=Object.entries(om).reduce((e,[t,r])=>(e[r]=t,e),{}),Ut="data-rh",Vi={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Ui=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},FF=e=>{let t=Ui(e,"title");const r=Ui(e,Vi.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Ui(e,Vi.DEFAULT_TITLE);return t||n||void 0},NF=e=>Ui(e,Vi.ON_CHANGE_CLIENT_STATE)||(()=>{}),Pd=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),BF=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const i=Object.keys(n);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),Ao=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&VF(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,o)=>{const s={};o.filter(l=>{let u;const c=Object.keys(l);for(let f=0;fi.push(l));const a=Object.keys(s);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:BF(["href"],e),bodyAttributes:Pd("bodyAttributes",e),defer:Ui(e,Vi.DEFER),encode:Ui(e,Vi.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Pd("htmlAttributes",e),linkTags:Ao("link",["rel","href"],e),metaTags:Ao("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Ao("noscript",["innerHTML"],e),onChangeClientState:NF(e),scriptTags:Ao("script",["src","innerHTML"],e),styleTags:Ao("style",["cssText"],e),title:FF(e),titleAttributes:Pd("titleAttributes",e),prioritizeSeoTags:UF(e,Vi.PRIORITIZE_SEO_TAGS)}),uk=e=>Array.isArray(e)?e.join(""):e,HF=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(HF(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},j0=(e,t)=>({...e,[t]:void 0}),KF=["noscript","script","style"],ah=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),ck=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),GF=(e,t,r,n)=>{const i=ck(r),o=uk(t);return i?`<${e} ${Ut}="true" ${i}>${ah(o,n)}`:`<${e} ${Ut}="true">${ah(o,n)}`},qF=(e,t,r=!0)=>t.reduce((n,i)=>{const o=i,s=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,c)=>{const d=typeof o[c]>"u"?c:`${c}="${ah(o[c],r)}"`;return u?`${u} ${d}`:d},""),a=o.innerHTML||o.cssText||"",l=KF.indexOf(e)===-1;return`${n}<${e} ${Ut}="true" ${s}${l?"/>":`>${a}`}`},""),dk=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=om[n];return r[i||n]=e[n],r},t),XF=(e,t,r)=>{const n={key:t,[Ut]:!0},i=dk(r,n);return[At.createElement("title",i,t)]},Sl=(e,t)=>t.map((r,n)=>{const i={key:n,[Ut]:!0};return Object.keys(r).forEach(o=>{const a=om[o]||o;if(a==="innerHTML"||a==="cssText"){const l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=r[o]}),At.createElement(e,i)}),Et=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>XF(e,t.title,t.titleAttributes),toString:()=>GF(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>dk(t),toString:()=>ck(t)};default:return{toComponent:()=>Sl(e,t),toString:()=>qF(e,t,r)}}},YF=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=_d(e,Td.meta),o=_d(t,Td.link),s=_d(r,Td.script);return{priorityMethods:{toComponent:()=>[...Sl("meta",i.priority),...Sl("link",o.priority),...Sl("script",s.priority)],toString:()=>`${Et("meta",i.priority,n)} ${Et("link",o.priority,n)} ${Et("script",s.priority,n)}`},metaTags:i.default,linkTags:o.default,scriptTags:s.default}},QF=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:o,styleTags:s,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:d,scriptTags:f}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:c,metaTags:d,scriptTags:f}=YF(e)),{priority:p,base:Et("base",t,n),bodyAttributes:Et("bodyAttributes",r,n),htmlAttributes:Et("htmlAttributes",i,n),link:Et("link",c,n),meta:Et("meta",d,n),noscript:Et("noscript",o,n),script:Et("script",f,n),style:Et("style",s,n),title:Et("title",{title:a,titleAttributes:l},n)}},lh=QF,Ha=[],fk=!!(typeof window<"u"&&window.document&&window.document.createElement),uh=class{constructor(e,t){fr(this,"instances",[]);fr(this,"canUseDOM",fk);fr(this,"context");fr(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ha:this.instances,add:e=>{(this.canUseDOM?Ha:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ha:this.instances).indexOf(e);(this.canUseDOM?Ha:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=lh({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ZF={},hk=At.createContext(ZF),jn,pk=(jn=class extends x.Component{constructor(r){super(r);fr(this,"helmetData");this.helmetData=new uh(this.props.context||{},jn.canUseDOM)}render(){return At.createElement(hk.Provider,{value:this.helmetData.value},this.props.children)}},fr(jn,"canUseDOM",fk),jn),ai=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Ut}]`),i=[].slice.call(n),o=[];let s;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const c=u,d=typeof a[c]>"u"?"":a[c];l.setAttribute(u,d)}l.setAttribute(Ut,"true"),i.some((u,c)=>(s=c,l.isEqualNode(u)))?i.splice(s,1):o.push(l)}),i.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),o.forEach(a=>r.appendChild(a)),{oldTags:i,newTags:o}},ch=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Ut),i=n?n.split(","):[],o=[...i],s=Object.keys(t);for(const a of s){const l=t[a]||"";r.getAttribute(a)!==l&&r.setAttribute(a,l),i.indexOf(a)===-1&&i.push(a);const u=o.indexOf(a);u!==-1&&o.splice(u,1)}for(let a=o.length-1;a>=0;a-=1)r.removeAttribute(o[a]);i.length===o.length?r.removeAttribute(Ut):r.getAttribute(Ut)!==s.join(",")&&r.setAttribute(Ut,s.join(","))},JF=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=uk(e)),ch("title",t)},D0=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:o,metaTags:s,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;ch("body",n),ch("html",i),JF(d,f);const p={baseTag:ai("base",r),linkTags:ai("link",o),metaTags:ai("meta",s),noscriptTags:ai("noscript",a),scriptTags:ai("script",u),styleTags:ai("style",c)},y={},v={};Object.keys(p).forEach(S=>{const{newTags:m,oldTags:h}=p[S];m.length&&(y[S]=m),h.length&&(v[S]=p[S].oldTags)}),t&&t(),l(e,y,v)},Oo=null,eN=e=>{Oo&&cancelAnimationFrame(Oo),e.defer?Oo=requestAnimationFrame(()=>{D0(e,()=>{Oo=null})}):(D0(e),Oo=null)},tN=eN,I0=class extends x.Component{constructor(){super(...arguments);fr(this,"rendered",!1)}shouldComponentUpdate(t){return!DF(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const i=WF(t.get().map(o=>{const s={...o.props};return delete s.context,s}));pk.canUseDOM?tN(i):lh&&(n=lh(i)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},$d,rN=($d=class extends x.Component{shouldComponentUpdate(e){return!GS(j0(this.props,"helmetData"),j0(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return M0(z0.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${z0.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),M0(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return At.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...o}=n.props,s=Object.keys(o).reduce((l,u)=>(l[IF[u]||u]=o[u],l),{});let{type:a}=n;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(n,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,s,i);break;default:t=this.mapObjectTypeChildren(n,t,s,i);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof uh)){const i=n;n=new uh(i.context,!0),delete r.helmetData}return n?At.createElement(I0,{...r,context:n.value}):At.createElement(hk.Consumer,null,i=>At.createElement(I0,{...r,context:i}))}},fr($d,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),$d);const dh=[{index:!0,label:"OpenPV",path:"/"},{labelKey:"about.title",label:"about",path:"/about"}],nN=x.lazy(()=>Yn(()=>import("./slide-CC9QbIzB.js").then(e=>e.s),[])),iN=()=>{const[e,t]=x.useState(!1),{t:r,i18n:n}=tk();return E.jsxs("div",{className:"hamburger-container",children:[E.jsx("nav",{className:"main",id:"hambuger-nav",children:E.jsx("ul",{children:e?E.jsx("li",{className:"menu close-menu",children:E.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"✕"})}):E.jsx("li",{className:"menu open-menu",children:E.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"☰"})})})}),E.jsx(x.Suspense,{fallback:E.jsx(E.Fragment,{}),children:E.jsx(nN,{right:!0,isOpen:e,children:E.jsx("ul",{className:"hamburger-ul",children:dh.map(i=>E.jsx("li",{children:E.jsx(eh,{to:i.path,onClick:()=>t(!e),children:E.jsx("h3",{className:i.index&&"index-li",children:i.labelKey==null?i.label:r(i.labelKey)})})},i.label))})})})]})},oN=()=>{const{t:e,i18n:t}=tk();return E.jsxs("header",{id:"header",children:[E.jsx("h1",{className:"index-link",children:dh.filter(r=>r.index).map(r=>E.jsx(eh,{to:r.path,children:r.label},r.label))}),E.jsx("nav",{className:"links",children:E.jsx("ul",{children:dh.filter(r=>!r.index).map(r=>E.jsx("li",{children:E.jsx(eh,{to:r.path,children:r.labelKey==null?r.label:e(r.labelKey)})},r.label))})}),E.jsx(iN,{})]})},sm=e=>E.jsxs(pk,{children:[E.jsxs(rN,{titleTemplate:"%s | OpenPV",defaultTitle:"OpenPV",defer:!1,children:[e.title&&E.jsx("title",{children:e.title}),E.jsx("meta",{name:"description",content:e.description})]}),E.jsxs("div",{id:"wrapper",children:[E.jsx(oN,{}),E.jsx("div",{id:"main",children:e.children})]})]});sm.propTypes={children:Cn.oneOfType([Cn.arrayOf(Cn.node),Cn.node]),fullPage:Cn.bool,title:Cn.string,description:Cn.string};sm.defaultProps={children:null,fullPage:!1,title:null,description:"Ermittle das Potential für eine Solaranlage."};var sN={};const{PUBLIC_URL:aN}=sN,lN=x.lazy(()=>Yn(()=>import("./Map-Bdq5r1vl.js"),__vite__mapDeps([0,1,2,3,4]))),uN=x.lazy(()=>Yn(()=>import("./Simulation-C3BVol_5.js").then(e=>e.S),__vite__mapDeps([5,6,1,2,7]))),cN=x.lazy(()=>Yn(()=>import("./NotFound-DicV6AYF.js"),[])),dN=x.lazy(()=>Yn(()=>import("./Impressum-mtZspX0T.js"),__vite__mapDeps([8,6]))),fN=x.lazy(()=>Yn(()=>import("./Datenschutz-BvJtWswR.js"),__vite__mapDeps([9,6]))),F0=x.lazy(()=>Yn(()=>import("./About-hHljlKAu.js"),__vite__mapDeps([10,1,7,6,3])));window.isTouchDevice=hN();const N0=()=>E.jsx($D,{children:E.jsx(At.StrictMode,{children:E.jsx(RI,{basename:aN,children:E.jsx(x.Suspense,{fallback:E.jsx(sm,{}),children:E.jsxs(kI,{children:[E.jsx(Wr,{path:"/",element:E.jsx(lN,{})}),E.jsx(Wr,{path:"/simulation/:lon/:lat",element:E.jsx(uN,{})}),E.jsx(Wr,{path:"/anleitung",element:E.jsx(F0,{})}),E.jsx(Wr,{path:"/about",element:E.jsx(F0,{})}),E.jsx(Wr,{path:"/impressum",element:E.jsx(dN,{})}),E.jsx(Wr,{path:"/datenschutz",element:E.jsx(fN,{})}),E.jsx(Wr,{path:"*",element:E.jsx(cN,{})})]})})})})}),Ed=document.getElementById("root");Ed.hasChildNodes()?Dw(Ed,E.jsx(N0,{})):Iw(Ed).render(E.jsx(N0,{}));function hN(){const e="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,t=window.matchMedia("(pointer: coarse)").matches;return console.log(e&&t?"The device is of type touch.":"The device is a laptop."),e&&t}export{dD as A,wl as B,_N as C,vN as D,rN as E,mN as F,lr as G,pk as H,na as I,xN as J,aj as K,eh as L,sm as M,Ow as N,Ye as O,Uu as P,wN as Q,At as R,Pw as S,MD as T,vr as U,Yn as _,PN as a,Gt as b,TN as c,hp as d,tk as e,lo as f,lI as g,j3 as h,ao as i,E as j,Pp as k,kl as l,sD as m,Fy as n,Sp as o,yN as p,bN as q,x as r,Ks as s,h2 as t,v2 as u,ZT as v,gN as w,h3 as x,SN as y,Qn as z}; +`)===0?O.substr(1,O.length):O}).forEach(function(O){var j=O.split(":"),z=j.shift().trim();if(z){var Q=j.join(":").trim();L.append(z,Q)}}),L}R.call(F.prototype);function ge(T,L){if(!(this instanceof ge))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new v(L.headers),this.url=L.url||"",this._initBody(T)}R.call(ge.prototype),ge.prototype.clone=function(){return new ge(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},ge.error=function(){var T=new ge(null,{status:0,statusText:""});return T.type="error",T};var dt=[301,302,303,307,308];ge.redirect=function(T,L){if(dt.indexOf(L)===-1)throw new RangeError("Invalid status code");return new ge(null,{status:L,headers:{location:T}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,U){this.message=L,this.name=U;var O=Error(L);this.stack=O.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function ze(T,L){return new Promise(function(U,O){var j=new F(T,L);if(j.signal&&j.signal.aborted)return O(new s.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function Q(){z.abort()}z.onload=function(){var H={status:z.status,statusText:z.statusText,headers:K(z.getAllResponseHeaders()||"")};H.url="responseURL"in z?z.responseURL:H.headers.get("X-Request-URL");var Qe="response"in z?z.response:z.responseText;setTimeout(function(){U(new ge(Qe,H))},0)},z.onerror=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},z.onabort=function(){setTimeout(function(){O(new s.DOMException("Aborted","AbortError"))},0)};function xe(H){try{return H===""&&a.location.href?a.location.href:H}catch{return H}}z.open(j.method,xe(j.url),!0),j.credentials==="include"?z.withCredentials=!0:j.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(l.blob?z.responseType="blob":l.arrayBuffer&&j.headers.get("Content-Type")&&j.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(z.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof v)?Object.getOwnPropertyNames(L.headers).forEach(function(H){z.setRequestHeader(H,p(L.headers[H]))}):j.headers.forEach(function(H,Qe){z.setRequestHeader(Qe,H)}),j.signal&&(j.signal.addEventListener("abort",Q),z.onreadystatechange=function(){z.readyState===4&&j.signal.removeEventListener("abort",Q)}),z.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return ze.polyfill=!0,a.fetch||(a.fetch=ze,a.Headers=v,a.Request=F,a.Response=ge),s.Headers=v,s.Request=F,s.Response=ge,s.fetch=ze,s})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Wa,Wa.exports)),Wa.exports}(function(e,t){var r;if(typeof fetch=="function"&&(typeof vr<"u"&&vr.fetch?r=vr.fetch:typeof window<"u"&&window.fetch?r=window.fetch:r=fetch),typeof xF<"u"&&typeof window>"u"){var n=r||wF();n.default&&(n=n.default),t.default=n,e.exports=t.default}})(oh,oh.exports);var nk=oh.exports;const ik=Qn(nk),E0=B0({__proto__:null,default:ik},[nk]);function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function R0(e){for(var t=1;t"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(n):t.requestOptions,a=R0({method:n?"POST":"GET",body:n?t.stringify(n):void 0,headers:o},O0?{}:s),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{A0(r,a,i,l)}catch(u){if(!s||Object.keys(s).length===0||!u.message||u.message.indexOf("not implemented")<0)return i(u);try{Object.keys(s).forEach(function(c){delete a[c]}),A0(r,a,i,l),O0=!0}catch(c){i(c)}}},_F=function(t,r,n,i){n&&Xn(n)==="object"&&(n=sh("",n).slice(1)),t.queryStringParams&&(r=sh(r,t.queryStringParams));try{var o;Us?o=new Us:o=new fu("MSXML2.XMLHTTP.3.0"),o.open(n?"POST":"GET",r,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(l){console&&console.log(l)}},EF=function(t,r,n,i){if(typeof n=="function"&&(i=n,n=void 0),i=i||function(){},Rr&&r.indexOf("file:")!==0)return PF(t,r,n,i);if(rk()||typeof ActiveXObject=="function")return _F(t,r,n,i);i(new Error("No fetch and no xhr implementation found!"))};function ro(e){"@babel/helpers - typeof";return ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ro(e)}function L0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Cd(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$F(this,e),this.services=t,this.options=r,this.allOptions=n,this.type="backend",this.init(t,r,n)}return AF(e,[{key:"init",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=r,this.options=Cd(Cd(Cd({},LF()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var s=setInterval(function(){return n.reload()},this.options.reloadInterval);ro(s)==="object"&&typeof s.unref=="function"&&s.unref()}}},{key:"readMulti",value:function(r,n,i){this._readAny(r,r,n,n,i)}},{key:"read",value:function(r,n,i){this._readAny([r],r,[n],n,i)}},{key:"_readAny",value:function(r,n,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(r,i)),l=SF(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:r.join("+"),ns:i.join("+")});a.loadUrl(c,s,n,o)})}},{key:"loadUrl",value:function(r,n,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,r,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return n("failed loading "+r+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return n("failed loading "+r+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.toLowerCase().indexOf("failed")>-1&&(c.message.indexOf("fetch")>-1||c.message.toLowerCase().indexOf("network")>-1))return n("failed loading "+r+": "+c.message,!0);if(c)return n(c,!1);var f,p;try{typeof d.data=="string"?f=s.options.parse(d.data,i,o):f=d.data}catch{p="failed parsing "+r+" to json"}if(p)return n(p,!1);n(null,f)})}},{key:"create",value:function(r,n,i,o,s){var a=this;if(this.options.addPath){typeof r=="string"&&(r=[r]);var l=this.options.parsePayload(n,i,o),u=0,c=[],d=[];r.forEach(function(f){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(f,n));var y=a.services.interpolator.interpolate(p,{lng:f,ns:n});a.options.request(a.options,y,l,function(v,S){u+=1,c.push(v),d.push(S),u===r.length&&typeof s=="function"&&s(c,d)})})}}},{key:"reload",value:function(){var r=this,n=this.services,i=n.backendConnector,o=n.languageUtils,s=n.logger,a=i.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){r.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,p){f&&s.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&p&&s.log("loaded namespace ".concat(d," for language ").concat(c),p),i.loaded("".concat(c,"|").concat(d),f,p)})})})}}}])}();ak.type="backend";Ye.use(ak).use(pF).init({fallbackLng:"de"});var MF=function(e,t,r,n,i,o,s,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,o,s,a],c=0;l=new Error(t.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},zF=MF;const M0=Qn(zF);var jF=function(t,r,n,i){var o=n?n.call(i,t,r):void 0;if(o!==void 0)return!!o;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var s=Object.keys(t),a=Object.keys(r);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(lk||{}),Td={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},z0=Object.values(lk),om={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},IF=Object.entries(om).reduce((e,[t,r])=>(e[r]=t,e),{}),Ut="data-rh",Vi={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Ui=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},FF=e=>{let t=Ui(e,"title");const r=Ui(e,Vi.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Ui(e,Vi.DEFAULT_TITLE);return t||n||void 0},NF=e=>Ui(e,Vi.ON_CHANGE_CLIENT_STATE)||(()=>{}),Pd=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),BF=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const i=Object.keys(n);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),Ao=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&VF(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,o)=>{const s={};o.filter(l=>{let u;const c=Object.keys(l);for(let f=0;fi.push(l));const a=Object.keys(s);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:BF(["href"],e),bodyAttributes:Pd("bodyAttributes",e),defer:Ui(e,Vi.DEFER),encode:Ui(e,Vi.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Pd("htmlAttributes",e),linkTags:Ao("link",["rel","href"],e),metaTags:Ao("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Ao("noscript",["innerHTML"],e),onChangeClientState:NF(e),scriptTags:Ao("script",["src","innerHTML"],e),styleTags:Ao("style",["cssText"],e),title:FF(e),titleAttributes:Pd("titleAttributes",e),prioritizeSeoTags:UF(e,Vi.PRIORITIZE_SEO_TAGS)}),uk=e=>Array.isArray(e)?e.join(""):e,HF=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(HF(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},j0=(e,t)=>({...e,[t]:void 0}),KF=["noscript","script","style"],ah=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),ck=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),GF=(e,t,r,n)=>{const i=ck(r),o=uk(t);return i?`<${e} ${Ut}="true" ${i}>${ah(o,n)}`:`<${e} ${Ut}="true">${ah(o,n)}`},qF=(e,t,r=!0)=>t.reduce((n,i)=>{const o=i,s=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,c)=>{const d=typeof o[c]>"u"?c:`${c}="${ah(o[c],r)}"`;return u?`${u} ${d}`:d},""),a=o.innerHTML||o.cssText||"",l=KF.indexOf(e)===-1;return`${n}<${e} ${Ut}="true" ${s}${l?"/>":`>${a}`}`},""),dk=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=om[n];return r[i||n]=e[n],r},t),XF=(e,t,r)=>{const n={key:t,[Ut]:!0},i=dk(r,n);return[At.createElement("title",i,t)]},Sl=(e,t)=>t.map((r,n)=>{const i={key:n,[Ut]:!0};return Object.keys(r).forEach(o=>{const a=om[o]||o;if(a==="innerHTML"||a==="cssText"){const l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=r[o]}),At.createElement(e,i)}),Et=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>XF(e,t.title,t.titleAttributes),toString:()=>GF(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>dk(t),toString:()=>ck(t)};default:return{toComponent:()=>Sl(e,t),toString:()=>qF(e,t,r)}}},YF=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=_d(e,Td.meta),o=_d(t,Td.link),s=_d(r,Td.script);return{priorityMethods:{toComponent:()=>[...Sl("meta",i.priority),...Sl("link",o.priority),...Sl("script",s.priority)],toString:()=>`${Et("meta",i.priority,n)} ${Et("link",o.priority,n)} ${Et("script",s.priority,n)}`},metaTags:i.default,linkTags:o.default,scriptTags:s.default}},QF=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:o,styleTags:s,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:d,scriptTags:f}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:c,metaTags:d,scriptTags:f}=YF(e)),{priority:p,base:Et("base",t,n),bodyAttributes:Et("bodyAttributes",r,n),htmlAttributes:Et("htmlAttributes",i,n),link:Et("link",c,n),meta:Et("meta",d,n),noscript:Et("noscript",o,n),script:Et("script",f,n),style:Et("style",s,n),title:Et("title",{title:a,titleAttributes:l},n)}},lh=QF,Ha=[],fk=!!(typeof window<"u"&&window.document&&window.document.createElement),uh=class{constructor(e,t){fr(this,"instances",[]);fr(this,"canUseDOM",fk);fr(this,"context");fr(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Ha:this.instances,add:e=>{(this.canUseDOM?Ha:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Ha:this.instances).indexOf(e);(this.canUseDOM?Ha:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=lh({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ZF={},hk=At.createContext(ZF),jn,pk=(jn=class extends x.Component{constructor(r){super(r);fr(this,"helmetData");this.helmetData=new uh(this.props.context||{},jn.canUseDOM)}render(){return At.createElement(hk.Provider,{value:this.helmetData.value},this.props.children)}},fr(jn,"canUseDOM",fk),jn),ai=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Ut}]`),i=[].slice.call(n),o=[];let s;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const c=u,d=typeof a[c]>"u"?"":a[c];l.setAttribute(u,d)}l.setAttribute(Ut,"true"),i.some((u,c)=>(s=c,l.isEqualNode(u)))?i.splice(s,1):o.push(l)}),i.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),o.forEach(a=>r.appendChild(a)),{oldTags:i,newTags:o}},ch=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Ut),i=n?n.split(","):[],o=[...i],s=Object.keys(t);for(const a of s){const l=t[a]||"";r.getAttribute(a)!==l&&r.setAttribute(a,l),i.indexOf(a)===-1&&i.push(a);const u=o.indexOf(a);u!==-1&&o.splice(u,1)}for(let a=o.length-1;a>=0;a-=1)r.removeAttribute(o[a]);i.length===o.length?r.removeAttribute(Ut):r.getAttribute(Ut)!==s.join(",")&&r.setAttribute(Ut,s.join(","))},JF=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=uk(e)),ch("title",t)},D0=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:o,metaTags:s,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;ch("body",n),ch("html",i),JF(d,f);const p={baseTag:ai("base",r),linkTags:ai("link",o),metaTags:ai("meta",s),noscriptTags:ai("noscript",a),scriptTags:ai("script",u),styleTags:ai("style",c)},y={},v={};Object.keys(p).forEach(S=>{const{newTags:m,oldTags:h}=p[S];m.length&&(y[S]=m),h.length&&(v[S]=p[S].oldTags)}),t&&t(),l(e,y,v)},Oo=null,eN=e=>{Oo&&cancelAnimationFrame(Oo),e.defer?Oo=requestAnimationFrame(()=>{D0(e,()=>{Oo=null})}):(D0(e),Oo=null)},tN=eN,I0=class extends x.Component{constructor(){super(...arguments);fr(this,"rendered",!1)}shouldComponentUpdate(t){return!DF(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const i=WF(t.get().map(o=>{const s={...o.props};return delete s.context,s}));pk.canUseDOM?tN(i):lh&&(n=lh(i)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},$d,rN=($d=class extends x.Component{shouldComponentUpdate(e){return!GS(j0(this.props,"helmetData"),j0(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return M0(z0.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${z0.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),M0(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return At.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...o}=n.props,s=Object.keys(o).reduce((l,u)=>(l[IF[u]||u]=o[u],l),{});let{type:a}=n;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(n,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,s,i);break;default:t=this.mapObjectTypeChildren(n,t,s,i);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof uh)){const i=n;n=new uh(i.context,!0),delete r.helmetData}return n?At.createElement(I0,{...r,context:n.value}):At.createElement(hk.Consumer,null,i=>At.createElement(I0,{...r,context:i}))}},fr($d,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),$d);const dh=[{index:!0,label:"OpenPV",path:"/"},{labelKey:"about.title",label:"about",path:"/about"}],nN=x.lazy(()=>Yn(()=>import("./slide-CP0QMahr.js").then(e=>e.s),[])),iN=()=>{const[e,t]=x.useState(!1),{t:r,i18n:n}=tk();return E.jsxs("div",{className:"hamburger-container",children:[E.jsx("nav",{className:"main",id:"hambuger-nav",children:E.jsx("ul",{children:e?E.jsx("li",{className:"menu close-menu",children:E.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"✕"})}):E.jsx("li",{className:"menu open-menu",children:E.jsx("div",{onClick:()=>t(!e),className:"menu-hover",children:"☰"})})})}),E.jsx(x.Suspense,{fallback:E.jsx(E.Fragment,{}),children:E.jsx(nN,{right:!0,isOpen:e,children:E.jsx("ul",{className:"hamburger-ul",children:dh.map(i=>E.jsx("li",{children:E.jsx(eh,{to:i.path,onClick:()=>t(!e),children:E.jsx("h3",{className:i.index&&"index-li",children:i.labelKey==null?i.label:r(i.labelKey)})})},i.label))})})})]})},oN=()=>{const{t:e,i18n:t}=tk();return E.jsxs("header",{id:"header",children:[E.jsx("h1",{className:"index-link",children:dh.filter(r=>r.index).map(r=>E.jsx(eh,{to:r.path,children:r.label},r.label))}),E.jsx("nav",{className:"links",children:E.jsx("ul",{children:dh.filter(r=>!r.index).map(r=>E.jsx("li",{children:E.jsx(eh,{to:r.path,children:r.labelKey==null?r.label:e(r.labelKey)})},r.label))})}),E.jsx(iN,{})]})},sm=e=>E.jsxs(pk,{children:[E.jsxs(rN,{titleTemplate:"%s | OpenPV",defaultTitle:"OpenPV",defer:!1,children:[e.title&&E.jsx("title",{children:e.title}),E.jsx("meta",{name:"description",content:e.description})]}),E.jsxs("div",{id:"wrapper",children:[E.jsx(oN,{}),E.jsx("div",{id:"main",children:e.children})]})]});sm.propTypes={children:Cn.oneOfType([Cn.arrayOf(Cn.node),Cn.node]),fullPage:Cn.bool,title:Cn.string,description:Cn.string};sm.defaultProps={children:null,fullPage:!1,title:null,description:"Ermittle das Potential für eine Solaranlage."};var sN={};const{PUBLIC_URL:aN}=sN,lN=x.lazy(()=>Yn(()=>import("./Map-Dk16L0g4.js"),__vite__mapDeps([0,1,2,3,4]))),uN=x.lazy(()=>Yn(()=>import("./Simulation-C4ya-gKI.js").then(e=>e.S),__vite__mapDeps([5,6,1,2,7]))),cN=x.lazy(()=>Yn(()=>import("./NotFound-VorW0SAJ.js"),[])),dN=x.lazy(()=>Yn(()=>import("./Impressum-0nu2Idu7.js"),__vite__mapDeps([8,6]))),fN=x.lazy(()=>Yn(()=>import("./Datenschutz-D4rOodQl.js"),__vite__mapDeps([9,6]))),F0=x.lazy(()=>Yn(()=>import("./About-DxBDVk_Y.js"),__vite__mapDeps([10,1,7,6,3])));window.isTouchDevice=hN();const N0=()=>E.jsx($D,{children:E.jsx(At.StrictMode,{children:E.jsx(RI,{basename:aN,children:E.jsx(x.Suspense,{fallback:E.jsx(sm,{}),children:E.jsxs(kI,{children:[E.jsx(Wr,{path:"/",element:E.jsx(lN,{})}),E.jsx(Wr,{path:"/simulation/:lon/:lat",element:E.jsx(uN,{})}),E.jsx(Wr,{path:"/anleitung",element:E.jsx(F0,{})}),E.jsx(Wr,{path:"/about",element:E.jsx(F0,{})}),E.jsx(Wr,{path:"/impressum",element:E.jsx(dN,{})}),E.jsx(Wr,{path:"/datenschutz",element:E.jsx(fN,{})}),E.jsx(Wr,{path:"*",element:E.jsx(cN,{})})]})})})})}),Ed=document.getElementById("root");Ed.hasChildNodes()?Dw(Ed,E.jsx(N0,{})):Iw(Ed).render(E.jsx(N0,{}));function hN(){const e="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,t=window.matchMedia("(pointer: coarse)").matches;return console.log(e&&t?"The device is of type touch.":"The device is a laptop."),e&&t}export{dD as A,wl as B,_N as C,vN as D,rN as E,mN as F,lr as G,pk as H,na as I,xN as J,aj as K,eh as L,sm as M,Ow as N,Ye as O,Uu as P,wN as Q,At as R,Pw as S,MD as T,vr as U,Yn as _,PN as a,Gt as b,TN as c,hp as d,tk as e,lo as f,lI as g,j3 as h,ao as i,E as j,Pp as k,kl as l,sD as m,Fy as n,Sp as o,yN as p,bN as q,x as r,Ks as s,h2 as t,v2 as u,ZT as v,gN as w,h3 as x,SN as y,Qn as z}; diff --git a/assets/lerc-D-WbCUY3.js b/assets/lerc-DxCAHPKn.js similarity index 99% rename from assets/lerc-D-WbCUY3.js rename to assets/lerc-DxCAHPKn.js index f99bef4..623c0b1 100644 --- a/assets/lerc-D-WbCUY3.js +++ b/assets/lerc-DxCAHPKn.js @@ -1 +1 @@ -import{L as oA,a as gA,i as sA}from"./Simulation-C3BVol_5.js";import{z as DA}from"./index-C4jKHMt0.js";import{B as nA}from"./basedecoder-DvumDe3Y.js";import"./chunk-7OLJDQMT-DRboIhh9.js";import"./Footer-Cdi5kbhN.js";import"./location-qV39J3P0.js";import"./chunk-ZHMYA64R-FVqXPkJW.js";var iA={exports:{}};(function(j){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var J=function(){var u={};u.defaultNoDataValue=-34027999387901484e22,u.decode=function(I,a){a=a||{};var Q=a.encodedMaskData||a.encodedMaskData===null,g=E(I,a.inputOffset||0,Q),D=a.noDataValue!==null?a.noDataValue:u.defaultNoDataValue,B=L(g,a.pixelType||Float32Array,a.encodedMaskData,D,a.returnMask),C={width:g.width,height:g.height,pixelData:B.resultPixels,minValue:B.minValue,maxValue:g.pixels.maxValue,noDataValue:D};return B.resultMask&&(C.maskData=B.resultMask),a.returnEncodedMask&&g.mask&&(C.encodedMaskData=g.mask.bitset?g.mask.bitset:null),a.returnFileInfo&&(C.fileInfo=d(g),a.computeUsedBitDepths&&(C.fileInfo.bitDepths=z(g))),C};var L=function(I,a,Q,g,D){var B=0,C=I.pixels.numBlocksX,o=I.pixels.numBlocksY,r=Math.floor(I.width/C),s=Math.floor(I.height/o),f=2*I.maxZError,e=Number.MAX_VALUE,i;Q=Q||(I.mask?I.mask.bitset:null);var t,F;t=new a(I.width*I.height),D&&Q&&(F=new Uint8Array(I.width*I.height));for(var S=new Float32Array(r*s),h,U,G=0;G<=o;G++){var R=G!==o?s:I.height%o;if(R!==0)for(var w=0;w<=C;w++){var n=w!==C?r:I.width%C;if(n!==0){var l=G*I.width*s+w*r,y=I.width-n,k=I.pixels.blocks[B],M,c,N;k.encoding<2?(k.encoding===0?M=k.rawData:(A(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,f,S,I.pixels.maxValue),M=S),c=0):k.encoding===2?N=0:N=k.offset;var q;if(Q)for(U=0;U>3],q<<=l&7),h=0;h>3]),q&128?(F&&(F[l]=1),i=k.encoding<2?M[c++]:N,e=e>i?i:e,t[l++]=i):(F&&(F[l]=0),t[l++]=g),q<<=1;l+=y}else if(k.encoding<2)for(U=0;Ui?i:e,t[l++]=i;l+=y}else for(e=e>N?N:e,U=0;U0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));B=new DataView(I,a,g.mask.numBytes);var o=B.getInt16(0,!0),r=2,s=0;do{if(o>0)for(;o--;)C[s++]=B.getUint8(r++);else{var f=B.getUint8(r++);for(o=-o;o--;)C[s++]=f}o=B.getInt16(r,!0),r+=2}while(r0?1:0),F=i+(g.height%i>0?1:0);g.pixels.blocks=new Array(t*F);for(var S=0,h=0;h3)throw"Invalid block encoding ("+w.encoding+")";if(w.encoding===2){a++;continue}if(n!==0&&n!==2){if(n>>=6,w.offsetType=n,n===2)w.offset=B.getInt8(1),G++;else if(n===1)w.offset=B.getInt16(1,!0),G+=2;else if(n===0)w.offset=B.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(w.encoding===1)if(n=B.getUint8(G),G++,w.bitsPerPixel=n&63,n>>=6,w.numValidPixelsType=n,n===2)w.numValidPixels=B.getUint8(G),G++;else if(n===1)w.numValidPixels=B.getUint16(G,!0),G+=2;else if(n===0)w.numValidPixels=B.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(a+=G,w.encoding!==3){var l,y;if(w.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";l=new ArrayBuffer(k*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,k*4));var M=new Float32Array(l);w.rawData=M,a+=k*4}else if(w.encoding===1){var c=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),N=Math.ceil(c/4);l=new ArrayBuffer(N*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,c)),w.stuffedData=new Uint32Array(l),a+=c}}}return g.eofOffset=a,g},A=function(I,a,Q,g,D,B,C){var o=(1<=a)e=i>>>f-a&o,f-=a;else{var S=a-f;e=(i&o)<>>f}B[s]=e=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=Q[f];else for(t=Math.ceil((B-g)/D),r=0;r=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=f=A?(s=f>>>r-A&D,r-=A):(o=A-r,s=(f&D)<>>r),e[C]=s=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=A?(s=e>>>f&D,r-=A,f+=A):(o=A-r,s=e>>>f&D,e=E[B++],r=32-o,s|=(e&(1<=I?(C=o>>>B-I&Q,B-=I):(r=I-B,C=(o&Q)<>>B),A[D]=C;return A},originalUnstuff2:function(E,A,I,a){var Q=(1<=I?(o=r>>>C&Q,B-=I,C+=I):(s=I-B,o=r>>>C&Q,r=E[g++],B=32-s,o|=(r&(1<=359?359:Q;Q-=D;do A+=E[g++]<<8,I+=A+=E[g++];while(--D);A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16)}return a&1&&(I+=A+=E[g]<<8),A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16),(I<<16|A)>>>0},readHeaderInfo:function(E,A){var I=A.ptr,a=new Uint8Array(E,I,6),Q={};if(Q.fileIdentifierString=String.fromCharCode.apply(null,a),Q.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+Q.fileIdentifierString;I+=6;var g=new DataView(E,I,8),D=g.getInt32(0,!0);Q.fileVersion=D,I+=4,D>=3&&(Q.checksum=g.getUint32(4,!0),I+=4),g=new DataView(E,I,12),Q.height=g.getUint32(0,!0),Q.width=g.getUint32(4,!0),I+=8,D>=4?(Q.numDims=g.getUint32(8,!0),I+=4):Q.numDims=1,g=new DataView(E,I,40),Q.numValidPixel=g.getUint32(0,!0),Q.microBlockSize=g.getInt32(4,!0),Q.blobSize=g.getInt32(8,!0),Q.imageType=g.getInt32(12,!0),Q.maxZError=g.getFloat64(16,!0),Q.zMin=g.getFloat64(24,!0),Q.zMax=g.getFloat64(32,!0),I+=40,A.headerInfo=Q,A.ptr=I;var B,C;if(D>=3&&(C=D>=4?52:48,B=this.computeChecksumFletcher32(new Uint8Array(E,I-C,Q.blobSize-14)),B!==Q.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(E,A){var I=A.headerInfo,a=this.getDataTypeArray(I.imageType),Q=I.numDims*this.getDataTypeSize(I.imageType),g=this.readSubArray(E,A.ptr,a,Q),D=this.readSubArray(E,A.ptr+Q,a,Q);A.ptr+=2*Q;var B,C=!0;for(B=0;B0){C=new Uint8Array(Math.ceil(Q/8)),D=new DataView(E,I,B.numBytes);var r=D.getInt16(0,!0),s=2,f=0,e=0;do{if(r>0)for(;r--;)C[f++]=D.getUint8(s++);else for(e=D.getUint8(s++),r=-r;r--;)C[f++]=e;r=D.getInt16(s,!0),s+=2}while(s>3],i<<=t&7):i=C[t>>3],i&128&&(o[t]=1);A.pixels.resultMask=o,B.bitset=C,I+=B.numBytes}return A.ptr=I,A.mask=B,!0},readDataOneSweep:function(E,A,I,a){var Q=A.ptr,g=A.headerInfo,D=g.numDims,B=g.width*g.height,C=g.imageType,o=g.numValidPixel*L.getDataTypeSize(C)*D,r,s=A.pixels.resultMask;if(I===Uint8Array)r=new Uint8Array(E,Q,o);else{var f=new ArrayBuffer(o),e=new Uint8Array(f);e.set(new Uint8Array(E,Q,o)),r=new I(f)}if(r.length===B*D)a?A.pixels.resultPixels=L.swapDimensionOrder(r,B,D,I,!0):A.pixels.resultPixels=r;else{A.pixels.resultPixels=new I(B*D);var i=0,t=0,F=0,S=0;if(D>1){if(a){for(t=0;t=B)return!1;var C=new Uint32Array(B-D);L.decodeBits(E,A,C);var o=[],r,s,f,e;for(r=D;r0&&(o[s].second=G<>>32-e,32-U>=e?(U+=e,U===32&&(U=0,R++,G=h[R])):(U+=e-32,R++,G=h[R],o[s].second|=G>>>32-U));var w=0,n=0,l=new d;for(r=0;r=I?n=I:n=w;var y=[],k,M,c,N,q,m;for(r=D;r0)if(k=[e,s],e<=n)for(M=o[s].second<=0;N--)q=M>>>N&1,q?(m.right||(m.right=new d),m=m.right):(m.left||(m.left=new d),m=m.left),N===0&&!m.val&&(m.val=k[1]);return{decodeLut:y,numBitsLUTQick:n,numBitsLUT:w,tree:l,stuffedData:h,srcPtr:R,bitPos:U}},readHuffman:function(E,A,I,a){var Q=A.headerInfo,g=Q.numDims,D=A.headerInfo.height,B=A.headerInfo.width,C=B*D,o=this.readHuffmanTree(E,A),r=o.decodeLut,s=o.tree,f=o.stuffedData,e=o.srcPtr,i=o.bitPos,t=o.numBitsLUTQick,F=o.numBitsLUT,S=A.headerInfo.imageType===0?128:0,h,U,G,R=A.pixels.resultMask,w,n,l,y,k,M,c,N=0;i>0&&(e++,i=0);var q=f[e],m=A.encodeMode===1,O=new I(C*g),v=O,Y;if(g<2||m){for(Y=0;Y1&&(v=new I(O.buffer,C*Y,C),N=0),A.headerInfo.numValidPixel===B*D)for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0?G+=N:y>0?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0&&R[M-1]?G+=N:y>0&&R[M-B]?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,v[M]=G}A.ptr=A.ptr+(e+1)*4+(i>0?4:0),A.pixels.resultPixels=O,g>1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(O,C,g,I))},decodeBits:function(E,A,I,a,Q){{var g=A.headerInfo,D=g.fileVersion,B=0,C=E.byteLength-A.ptr>=5?5:E.byteLength-A.ptr,o=new DataView(E,A.ptr,C),r=o.getUint8(0);B++;var s=r>>6,f=s===0?4:3-s,e=(r&32)>0,i=r&31,t=0;if(f===1)t=o.getUint8(B),B++;else if(f===2)t=o.getUint16(B,!0),B+=2;else if(f===4)t=o.getUint32(B,!0),B+=4;else throw"Invalid valid pixel count type";var F=2*g.maxZError,S,h,U,G,R,w,n,l,y,k=g.numDims>1?g.maxValues[Q]:g.zMax;if(e){for(A.counter.lut++,l=o.getUint8(B),B++,G=Math.ceil((l-1)*i/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),A.ptr+=B,U.set(new Uint8Array(E,A.ptr,G)),n=new Uint32Array(h),A.ptr+=G,y=0;l-1>>>y;)y++;G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?w=u.unstuffLUT2(n,i,l-1,a,F,k):w=u.unstuffLUT(n,i,l-1,a,F,k),D>=3?u.unstuff2(S,I,y,t,w):u.unstuff(S,I,y,t,w)}else A.counter.bitstuffer++,y=i,A.ptr+=B,y>0&&(G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?a==null?u.originalUnstuff2(S,I,y,t):u.unstuff2(S,I,y,t,!1,a,F,k):a==null?u.originalUnstuff(S,I,y,t):u.unstuff(S,I,y,t,!1,a,F,k))}},readTiles:function(E,A,I,a){var Q=A.headerInfo,g=Q.width,D=Q.height,B=g*D,C=Q.microBlockSize,o=Q.imageType,r=L.getDataTypeSize(o),s=Math.ceil(g/C),f=Math.ceil(D/C);A.pixels.numBlocksY=f,A.pixels.numBlocksX=s,A.pixels.ptr=0;var e=0,i=0,t=0,F=0,S=0,h=0,U=0,G=0,R=0,w=0,n=0,l=0,y=0,k=0,M=0,c=0,N,q,m,O,v,Y,P=new I(C*C),eA=D%C||C,aA=g%C||C,AA,b,$=Q.numDims,W,K=A.pixels.resultMask,H=A.pixels.resultPixels,rA=Q.fileVersion,CA=rA>=5?14:15,p,IA=Q.zMax,V;for(t=0;t1?(V=H,n=t*g*C+F*C,H=new I(A.pixels.resultPixels.buffer,B*W*r,B),IA=Q.maxValues[W]):V=null,U=E.byteLength-A.ptr,N=new DataView(E,A.ptr,Math.min(10,U)),q={},c=0,G=N.getUint8(0),c++,p=Q.fileVersion>=5?G&4:0,R=G>>6&255,w=G>>2&CA,w!==(F*C>>3&CA)||p&&W===0)throw"integrity issue";if(Y=G&3,Y>3)throw A.ptr+=c,"Invalid block encoding ("+Y+")";if(Y===2){if(p)if(K)for(e=0;e1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(A.pixels.resultPixels,B,$,I))},formatFileInfo:function(E){return{fileIdentifierString:E.headerInfo.fileIdentifierString,fileVersion:E.headerInfo.fileVersion,imageType:E.headerInfo.imageType,height:E.headerInfo.height,width:E.headerInfo.width,numValidPixel:E.headerInfo.numValidPixel,microBlockSize:E.headerInfo.microBlockSize,blobSize:E.headerInfo.blobSize,maxZError:E.headerInfo.maxZError,pixelType:L.getPixelType(E.headerInfo.imageType),eofOffset:E.eofOffset,mask:E.mask?{numBytes:E.mask.numBytes}:null,pixels:{numBlocksX:E.pixels.numBlocksX,numBlocksY:E.pixels.numBlocksY,maxValue:E.headerInfo.zMax,minValue:E.headerInfo.zMin,noDataValue:E.noDataValue}}},constructConstantSurface:function(E,A){var I=E.headerInfo.zMax,a=E.headerInfo.zMin,Q=E.headerInfo.maxValues,g=E.headerInfo.numDims,D=E.headerInfo.height*E.headerInfo.width,B=0,C=0,o=0,r=E.pixels.resultMask,s=E.pixels.resultPixels;if(r)if(g>1){if(A)for(B=0;B1&&a!==I)if(A)for(B=0;B=-128&&A<=127;break;case 1:I=A>=0&&A<=255;break;case 2:I=A>=-32768&&A<=32767;break;case 3:I=A>=0&&A<=65536;break;case 4:I=A>=-2147483648&&A<=2147483647;break;case 5:I=A>=0&&A<=4294967296;break;case 6:I=A>=-34027999387901484e22&&A<=34027999387901484e22;break;case 7:I=A>=-17976931348623157e292&&A<=17976931348623157e292;break;default:I=!1}return I},getDataTypeSize:function(E){var A=0;switch(E){case 0:case 1:A=1;break;case 2:case 3:A=2;break;case 4:case 5:case 6:A=4;break;case 7:A=8;break;default:A=E}return A},getDataTypeUsed:function(E,A){var I=E;switch(E){case 2:case 4:I=E-A;break;case 3:case 5:I=E-2*A;break;case 6:A===0?I=E:A===1?I=2:I=1;break;case 7:A===0?I=E:I=E-2*A+1;break;default:I=E;break}return I},getOnePixel:function(E,A,I,a){var Q=0;switch(I){case 0:Q=a.getInt8(A);break;case 1:Q=a.getUint8(A);break;case 2:Q=a.getInt16(A,!0);break;case 3:Q=a.getUint16(A,!0);break;case 4:Q=a.getInt32(A,!0);break;case 5:Q=a.getUInt32(A,!0);break;case 6:Q=a.getFloat32(A,!0);break;case 7:Q=a.getFloat64(A,!0);break;default:throw"the decoder does not understand this pixel type"}return Q},swapDimensionOrder:function(E,A,I,a,Q){var g=0,D=0,B=0,C=0,o=E;if(I>1)if(o=new a(A*I),Q)for(g=0;g5)throw"unsupported lerc version 2."+D;L.readMask(E,Q),g.numValidPixel!==g.width*g.height&&!Q.pixels.resultMask&&(Q.pixels.resultMask=A.maskData);var C=g.width*g.height;Q.pixels.resultPixels=new B(C*g.numDims),Q.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o=!A.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)L.constructConstantSurface(Q,o);else if(D>=4&&L.checkMinMaxRanges(E,Q))L.constructConstantSurface(Q,o);else{var r=new DataView(E,Q.ptr,2),s=r.getUint8(0);if(Q.ptr++,s)L.readDataOneSweep(E,Q,B,o);else if(D>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var f=r.getUint8(1);if(Q.ptr++,Q.encodeMode=f,f>2||D<4&&f>1)throw"Invalid Huffman flag "+f;f?L.readHuffman(E,Q,B,o):L.readTiles(E,Q,B,o)}else L.readTiles(E,Q,B,o)}Q.eofOffset=Q.ptr;var e;A.inputOffset?(e=Q.headerInfo.blobSize+A.inputOffset-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=A.inputOffset+Q.headerInfo.blobSize)):(e=Q.headerInfo.blobSize-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=Q.headerInfo.blobSize));var i={width:g.width,height:g.height,pixelData:Q.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:Q.pixels.resultMask};if(Q.pixels.resultMask&&L.isValidPixelValue(g.imageType,I)){var t=Q.pixels.resultMask;for(a=0;a1&&(C&&D.push(C),s.fileInfo.mask&&s.fileInfo.mask.numBytes>0&&r++),a++,o.pixels.push(s.pixelData),o.statistics.push({minValue:s.minValue,maxValue:s.maxValue,noDataValue:s.noDataValue,dimStats:s.dimStats})}var f,e,i;if(I>1&&r>1){for(i=o.width*o.height,o.bandMasks=D,C=new Uint8Array(i),C.set(D[0]),f=1;fJ.arrayBuffer()).then(J=>WebAssembly.instantiate(J,BA)).then(this._init):_=WebAssembly.instantiate(Buffer.from(EA,"base64"),BA).then(this._init),_)}_init(J){x=J.instance,BA.env.emscripten_notify_memory_growth(0)}decode(J,T=0){if(!x)throw new Error("ZSTDDecoder: Await .init() before decoding.");const Z=J.byteLength,X=x.exports.malloc(Z);QA.set(J,X),T=T||Number(x.exports.ZSTD_findDecompressedSize(X,Z));const u=x.exports.malloc(T),L=x.exports.ZSTD_decompress(u,T,X,Z),d=QA.slice(u,u+L);return x.exports.free(X),x.exports.free(u),d}}const EA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",hA=new wA;class SA extends nA{constructor(J){super(),this.planarConfiguration=typeof J.PlanarConfiguration<"u"?J.PlanarConfiguration:1,this.samplesPerPixel=typeof J.SamplesPerPixel<"u"?J.SamplesPerPixel:1,this.addCompression=J.LercParameters[oA.AddCompression]}decodeBlock(J){switch(this.addCompression){case gA.None:break;case gA.Deflate:J=sA(new Uint8Array(J)).buffer;break;case gA.Zstandard:J=hA.decode(new Uint8Array(J)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return tA.decode(J,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}export{SA as default,hA as zstd}; +import{L as oA,a as gA,i as sA}from"./Simulation-C4ya-gKI.js";import{z as DA}from"./index-oAnJD5lr.js";import{B as nA}from"./basedecoder-DvumDe3Y.js";import"./chunk-7OLJDQMT-E6ec7czU.js";import"./Footer-CN0UQ_Me.js";import"./location-BLLHg7ZW.js";import"./chunk-ZHMYA64R-n90-wtrP.js";var iA={exports:{}};(function(j){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var J=function(){var u={};u.defaultNoDataValue=-34027999387901484e22,u.decode=function(I,a){a=a||{};var Q=a.encodedMaskData||a.encodedMaskData===null,g=E(I,a.inputOffset||0,Q),D=a.noDataValue!==null?a.noDataValue:u.defaultNoDataValue,B=L(g,a.pixelType||Float32Array,a.encodedMaskData,D,a.returnMask),C={width:g.width,height:g.height,pixelData:B.resultPixels,minValue:B.minValue,maxValue:g.pixels.maxValue,noDataValue:D};return B.resultMask&&(C.maskData=B.resultMask),a.returnEncodedMask&&g.mask&&(C.encodedMaskData=g.mask.bitset?g.mask.bitset:null),a.returnFileInfo&&(C.fileInfo=d(g),a.computeUsedBitDepths&&(C.fileInfo.bitDepths=z(g))),C};var L=function(I,a,Q,g,D){var B=0,C=I.pixels.numBlocksX,o=I.pixels.numBlocksY,r=Math.floor(I.width/C),s=Math.floor(I.height/o),f=2*I.maxZError,e=Number.MAX_VALUE,i;Q=Q||(I.mask?I.mask.bitset:null);var t,F;t=new a(I.width*I.height),D&&Q&&(F=new Uint8Array(I.width*I.height));for(var S=new Float32Array(r*s),h,U,G=0;G<=o;G++){var R=G!==o?s:I.height%o;if(R!==0)for(var w=0;w<=C;w++){var n=w!==C?r:I.width%C;if(n!==0){var l=G*I.width*s+w*r,y=I.width-n,k=I.pixels.blocks[B],M,c,N;k.encoding<2?(k.encoding===0?M=k.rawData:(A(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,f,S,I.pixels.maxValue),M=S),c=0):k.encoding===2?N=0:N=k.offset;var q;if(Q)for(U=0;U>3],q<<=l&7),h=0;h>3]),q&128?(F&&(F[l]=1),i=k.encoding<2?M[c++]:N,e=e>i?i:e,t[l++]=i):(F&&(F[l]=0),t[l++]=g),q<<=1;l+=y}else if(k.encoding<2)for(U=0;Ui?i:e,t[l++]=i;l+=y}else for(e=e>N?N:e,U=0;U0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));B=new DataView(I,a,g.mask.numBytes);var o=B.getInt16(0,!0),r=2,s=0;do{if(o>0)for(;o--;)C[s++]=B.getUint8(r++);else{var f=B.getUint8(r++);for(o=-o;o--;)C[s++]=f}o=B.getInt16(r,!0),r+=2}while(r0?1:0),F=i+(g.height%i>0?1:0);g.pixels.blocks=new Array(t*F);for(var S=0,h=0;h3)throw"Invalid block encoding ("+w.encoding+")";if(w.encoding===2){a++;continue}if(n!==0&&n!==2){if(n>>=6,w.offsetType=n,n===2)w.offset=B.getInt8(1),G++;else if(n===1)w.offset=B.getInt16(1,!0),G+=2;else if(n===0)w.offset=B.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(w.encoding===1)if(n=B.getUint8(G),G++,w.bitsPerPixel=n&63,n>>=6,w.numValidPixelsType=n,n===2)w.numValidPixels=B.getUint8(G),G++;else if(n===1)w.numValidPixels=B.getUint16(G,!0),G+=2;else if(n===0)w.numValidPixels=B.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(a+=G,w.encoding!==3){var l,y;if(w.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";l=new ArrayBuffer(k*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,k*4));var M=new Float32Array(l);w.rawData=M,a+=k*4}else if(w.encoding===1){var c=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),N=Math.ceil(c/4);l=new ArrayBuffer(N*4),y=new Uint8Array(l),y.set(new Uint8Array(I,a,c)),w.stuffedData=new Uint32Array(l),a+=c}}}return g.eofOffset=a,g},A=function(I,a,Q,g,D,B,C){var o=(1<=a)e=i>>>f-a&o,f-=a;else{var S=a-f;e=(i&o)<>>f}B[s]=e=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=Q[f];else for(t=Math.ceil((B-g)/D),r=0;r=I?(f=e>>>s-I&C,s-=I):(i=I-s,f=(e&C)<>>s),A[r]=f=A?(s=f>>>r-A&D,r-=A):(o=A-r,s=(f&D)<>>r),e[C]=s=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=I?(e=i>>>f&C,s-=I,f+=I):(t=I-s,e=i>>>f&C,i=E[o++],s=32-t,e|=(i&(1<=A?(s=e>>>f&D,r-=A,f+=A):(o=A-r,s=e>>>f&D,e=E[B++],r=32-o,s|=(e&(1<=I?(C=o>>>B-I&Q,B-=I):(r=I-B,C=(o&Q)<>>B),A[D]=C;return A},originalUnstuff2:function(E,A,I,a){var Q=(1<=I?(o=r>>>C&Q,B-=I,C+=I):(s=I-B,o=r>>>C&Q,r=E[g++],B=32-s,o|=(r&(1<=359?359:Q;Q-=D;do A+=E[g++]<<8,I+=A+=E[g++];while(--D);A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16)}return a&1&&(I+=A+=E[g]<<8),A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16),(I<<16|A)>>>0},readHeaderInfo:function(E,A){var I=A.ptr,a=new Uint8Array(E,I,6),Q={};if(Q.fileIdentifierString=String.fromCharCode.apply(null,a),Q.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+Q.fileIdentifierString;I+=6;var g=new DataView(E,I,8),D=g.getInt32(0,!0);Q.fileVersion=D,I+=4,D>=3&&(Q.checksum=g.getUint32(4,!0),I+=4),g=new DataView(E,I,12),Q.height=g.getUint32(0,!0),Q.width=g.getUint32(4,!0),I+=8,D>=4?(Q.numDims=g.getUint32(8,!0),I+=4):Q.numDims=1,g=new DataView(E,I,40),Q.numValidPixel=g.getUint32(0,!0),Q.microBlockSize=g.getInt32(4,!0),Q.blobSize=g.getInt32(8,!0),Q.imageType=g.getInt32(12,!0),Q.maxZError=g.getFloat64(16,!0),Q.zMin=g.getFloat64(24,!0),Q.zMax=g.getFloat64(32,!0),I+=40,A.headerInfo=Q,A.ptr=I;var B,C;if(D>=3&&(C=D>=4?52:48,B=this.computeChecksumFletcher32(new Uint8Array(E,I-C,Q.blobSize-14)),B!==Q.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(E,A){var I=A.headerInfo,a=this.getDataTypeArray(I.imageType),Q=I.numDims*this.getDataTypeSize(I.imageType),g=this.readSubArray(E,A.ptr,a,Q),D=this.readSubArray(E,A.ptr+Q,a,Q);A.ptr+=2*Q;var B,C=!0;for(B=0;B0){C=new Uint8Array(Math.ceil(Q/8)),D=new DataView(E,I,B.numBytes);var r=D.getInt16(0,!0),s=2,f=0,e=0;do{if(r>0)for(;r--;)C[f++]=D.getUint8(s++);else for(e=D.getUint8(s++),r=-r;r--;)C[f++]=e;r=D.getInt16(s,!0),s+=2}while(s>3],i<<=t&7):i=C[t>>3],i&128&&(o[t]=1);A.pixels.resultMask=o,B.bitset=C,I+=B.numBytes}return A.ptr=I,A.mask=B,!0},readDataOneSweep:function(E,A,I,a){var Q=A.ptr,g=A.headerInfo,D=g.numDims,B=g.width*g.height,C=g.imageType,o=g.numValidPixel*L.getDataTypeSize(C)*D,r,s=A.pixels.resultMask;if(I===Uint8Array)r=new Uint8Array(E,Q,o);else{var f=new ArrayBuffer(o),e=new Uint8Array(f);e.set(new Uint8Array(E,Q,o)),r=new I(f)}if(r.length===B*D)a?A.pixels.resultPixels=L.swapDimensionOrder(r,B,D,I,!0):A.pixels.resultPixels=r;else{A.pixels.resultPixels=new I(B*D);var i=0,t=0,F=0,S=0;if(D>1){if(a){for(t=0;t=B)return!1;var C=new Uint32Array(B-D);L.decodeBits(E,A,C);var o=[],r,s,f,e;for(r=D;r0&&(o[s].second=G<>>32-e,32-U>=e?(U+=e,U===32&&(U=0,R++,G=h[R])):(U+=e-32,R++,G=h[R],o[s].second|=G>>>32-U));var w=0,n=0,l=new d;for(r=0;r=I?n=I:n=w;var y=[],k,M,c,N,q,m;for(r=D;r0)if(k=[e,s],e<=n)for(M=o[s].second<=0;N--)q=M>>>N&1,q?(m.right||(m.right=new d),m=m.right):(m.left||(m.left=new d),m=m.left),N===0&&!m.val&&(m.val=k[1]);return{decodeLut:y,numBitsLUTQick:n,numBitsLUT:w,tree:l,stuffedData:h,srcPtr:R,bitPos:U}},readHuffman:function(E,A,I,a){var Q=A.headerInfo,g=Q.numDims,D=A.headerInfo.height,B=A.headerInfo.width,C=B*D,o=this.readHuffmanTree(E,A),r=o.decodeLut,s=o.tree,f=o.stuffedData,e=o.srcPtr,i=o.bitPos,t=o.numBitsLUTQick,F=o.numBitsLUT,S=A.headerInfo.imageType===0?128:0,h,U,G,R=A.pixels.resultMask,w,n,l,y,k,M,c,N=0;i>0&&(e++,i=0);var q=f[e],m=A.encodeMode===1,O=new I(C*g),v=O,Y;if(g<2||m){for(Y=0;Y1&&(v=new I(O.buffer,C*Y,C),N=0),A.headerInfo.numValidPixel===B*D)for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0?G+=N:y>0?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,m?(k>0&&R[M-1]?G+=N:y>0&&R[M-B]?G+=v[M-B]:G+=N,G&=255,v[M]=G,N=G):v[M]=G}}else for(M=0,y=0;y>>32-t,n=w,32-i>>64-i-t,n=w),r[n])U=r[n][1],i+=r[n][0];else for(w=q<>>32-F,n=w,32-i>>64-i-F,n=w),h=s,c=0;c>>F-c-1&1,h=l?h.right:h.left,!(h.left||h.right)){U=h.val,i=i+c+1;break}i>=32&&(i-=32,e++,q=f[e]),G=U-S,v[M]=G}A.ptr=A.ptr+(e+1)*4+(i>0?4:0),A.pixels.resultPixels=O,g>1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(O,C,g,I))},decodeBits:function(E,A,I,a,Q){{var g=A.headerInfo,D=g.fileVersion,B=0,C=E.byteLength-A.ptr>=5?5:E.byteLength-A.ptr,o=new DataView(E,A.ptr,C),r=o.getUint8(0);B++;var s=r>>6,f=s===0?4:3-s,e=(r&32)>0,i=r&31,t=0;if(f===1)t=o.getUint8(B),B++;else if(f===2)t=o.getUint16(B,!0),B+=2;else if(f===4)t=o.getUint32(B,!0),B+=4;else throw"Invalid valid pixel count type";var F=2*g.maxZError,S,h,U,G,R,w,n,l,y,k=g.numDims>1?g.maxValues[Q]:g.zMax;if(e){for(A.counter.lut++,l=o.getUint8(B),B++,G=Math.ceil((l-1)*i/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),A.ptr+=B,U.set(new Uint8Array(E,A.ptr,G)),n=new Uint32Array(h),A.ptr+=G,y=0;l-1>>>y;)y++;G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?w=u.unstuffLUT2(n,i,l-1,a,F,k):w=u.unstuffLUT(n,i,l-1,a,F,k),D>=3?u.unstuff2(S,I,y,t,w):u.unstuff(S,I,y,t,w)}else A.counter.bitstuffer++,y=i,A.ptr+=B,y>0&&(G=Math.ceil(t*y/8),R=Math.ceil(G/4),h=new ArrayBuffer(R*4),U=new Uint8Array(h),U.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(h),A.ptr+=G,D>=3?a==null?u.originalUnstuff2(S,I,y,t):u.unstuff2(S,I,y,t,!1,a,F,k):a==null?u.originalUnstuff(S,I,y,t):u.unstuff(S,I,y,t,!1,a,F,k))}},readTiles:function(E,A,I,a){var Q=A.headerInfo,g=Q.width,D=Q.height,B=g*D,C=Q.microBlockSize,o=Q.imageType,r=L.getDataTypeSize(o),s=Math.ceil(g/C),f=Math.ceil(D/C);A.pixels.numBlocksY=f,A.pixels.numBlocksX=s,A.pixels.ptr=0;var e=0,i=0,t=0,F=0,S=0,h=0,U=0,G=0,R=0,w=0,n=0,l=0,y=0,k=0,M=0,c=0,N,q,m,O,v,Y,P=new I(C*C),eA=D%C||C,aA=g%C||C,AA,b,$=Q.numDims,W,K=A.pixels.resultMask,H=A.pixels.resultPixels,rA=Q.fileVersion,CA=rA>=5?14:15,p,IA=Q.zMax,V;for(t=0;t1?(V=H,n=t*g*C+F*C,H=new I(A.pixels.resultPixels.buffer,B*W*r,B),IA=Q.maxValues[W]):V=null,U=E.byteLength-A.ptr,N=new DataView(E,A.ptr,Math.min(10,U)),q={},c=0,G=N.getUint8(0),c++,p=Q.fileVersion>=5?G&4:0,R=G>>6&255,w=G>>2&CA,w!==(F*C>>3&CA)||p&&W===0)throw"integrity issue";if(Y=G&3,Y>3)throw A.ptr+=c,"Invalid block encoding ("+Y+")";if(Y===2){if(p)if(K)for(e=0;e1&&!a&&(A.pixels.resultPixels=L.swapDimensionOrder(A.pixels.resultPixels,B,$,I))},formatFileInfo:function(E){return{fileIdentifierString:E.headerInfo.fileIdentifierString,fileVersion:E.headerInfo.fileVersion,imageType:E.headerInfo.imageType,height:E.headerInfo.height,width:E.headerInfo.width,numValidPixel:E.headerInfo.numValidPixel,microBlockSize:E.headerInfo.microBlockSize,blobSize:E.headerInfo.blobSize,maxZError:E.headerInfo.maxZError,pixelType:L.getPixelType(E.headerInfo.imageType),eofOffset:E.eofOffset,mask:E.mask?{numBytes:E.mask.numBytes}:null,pixels:{numBlocksX:E.pixels.numBlocksX,numBlocksY:E.pixels.numBlocksY,maxValue:E.headerInfo.zMax,minValue:E.headerInfo.zMin,noDataValue:E.noDataValue}}},constructConstantSurface:function(E,A){var I=E.headerInfo.zMax,a=E.headerInfo.zMin,Q=E.headerInfo.maxValues,g=E.headerInfo.numDims,D=E.headerInfo.height*E.headerInfo.width,B=0,C=0,o=0,r=E.pixels.resultMask,s=E.pixels.resultPixels;if(r)if(g>1){if(A)for(B=0;B1&&a!==I)if(A)for(B=0;B=-128&&A<=127;break;case 1:I=A>=0&&A<=255;break;case 2:I=A>=-32768&&A<=32767;break;case 3:I=A>=0&&A<=65536;break;case 4:I=A>=-2147483648&&A<=2147483647;break;case 5:I=A>=0&&A<=4294967296;break;case 6:I=A>=-34027999387901484e22&&A<=34027999387901484e22;break;case 7:I=A>=-17976931348623157e292&&A<=17976931348623157e292;break;default:I=!1}return I},getDataTypeSize:function(E){var A=0;switch(E){case 0:case 1:A=1;break;case 2:case 3:A=2;break;case 4:case 5:case 6:A=4;break;case 7:A=8;break;default:A=E}return A},getDataTypeUsed:function(E,A){var I=E;switch(E){case 2:case 4:I=E-A;break;case 3:case 5:I=E-2*A;break;case 6:A===0?I=E:A===1?I=2:I=1;break;case 7:A===0?I=E:I=E-2*A+1;break;default:I=E;break}return I},getOnePixel:function(E,A,I,a){var Q=0;switch(I){case 0:Q=a.getInt8(A);break;case 1:Q=a.getUint8(A);break;case 2:Q=a.getInt16(A,!0);break;case 3:Q=a.getUint16(A,!0);break;case 4:Q=a.getInt32(A,!0);break;case 5:Q=a.getUInt32(A,!0);break;case 6:Q=a.getFloat32(A,!0);break;case 7:Q=a.getFloat64(A,!0);break;default:throw"the decoder does not understand this pixel type"}return Q},swapDimensionOrder:function(E,A,I,a,Q){var g=0,D=0,B=0,C=0,o=E;if(I>1)if(o=new a(A*I),Q)for(g=0;g5)throw"unsupported lerc version 2."+D;L.readMask(E,Q),g.numValidPixel!==g.width*g.height&&!Q.pixels.resultMask&&(Q.pixels.resultMask=A.maskData);var C=g.width*g.height;Q.pixels.resultPixels=new B(C*g.numDims),Q.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o=!A.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)L.constructConstantSurface(Q,o);else if(D>=4&&L.checkMinMaxRanges(E,Q))L.constructConstantSurface(Q,o);else{var r=new DataView(E,Q.ptr,2),s=r.getUint8(0);if(Q.ptr++,s)L.readDataOneSweep(E,Q,B,o);else if(D>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var f=r.getUint8(1);if(Q.ptr++,Q.encodeMode=f,f>2||D<4&&f>1)throw"Invalid Huffman flag "+f;f?L.readHuffman(E,Q,B,o):L.readTiles(E,Q,B,o)}else L.readTiles(E,Q,B,o)}Q.eofOffset=Q.ptr;var e;A.inputOffset?(e=Q.headerInfo.blobSize+A.inputOffset-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=A.inputOffset+Q.headerInfo.blobSize)):(e=Q.headerInfo.blobSize-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=Q.headerInfo.blobSize));var i={width:g.width,height:g.height,pixelData:Q.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:Q.pixels.resultMask};if(Q.pixels.resultMask&&L.isValidPixelValue(g.imageType,I)){var t=Q.pixels.resultMask;for(a=0;a1&&(C&&D.push(C),s.fileInfo.mask&&s.fileInfo.mask.numBytes>0&&r++),a++,o.pixels.push(s.pixelData),o.statistics.push({minValue:s.minValue,maxValue:s.maxValue,noDataValue:s.noDataValue,dimStats:s.dimStats})}var f,e,i;if(I>1&&r>1){for(i=o.width*o.height,o.bandMasks=D,C=new Uint8Array(i),C.set(D[0]),f=1;fJ.arrayBuffer()).then(J=>WebAssembly.instantiate(J,BA)).then(this._init):_=WebAssembly.instantiate(Buffer.from(EA,"base64"),BA).then(this._init),_)}_init(J){x=J.instance,BA.env.emscripten_notify_memory_growth(0)}decode(J,T=0){if(!x)throw new Error("ZSTDDecoder: Await .init() before decoding.");const Z=J.byteLength,X=x.exports.malloc(Z);QA.set(J,X),T=T||Number(x.exports.ZSTD_findDecompressedSize(X,Z));const u=x.exports.malloc(T),L=x.exports.ZSTD_decompress(u,T,X,Z),d=QA.slice(u,u+L);return x.exports.free(X),x.exports.free(u),d}}const EA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",hA=new wA;class SA extends nA{constructor(J){super(),this.planarConfiguration=typeof J.PlanarConfiguration<"u"?J.PlanarConfiguration:1,this.samplesPerPixel=typeof J.SamplesPerPixel<"u"?J.SamplesPerPixel:1,this.addCompression=J.LercParameters[oA.AddCompression]}decodeBlock(J){switch(this.addCompression){case gA.None:break;case gA.Deflate:J=sA(new Uint8Array(J)).buffer;break;case gA.Zstandard:J=hA.decode(new Uint8Array(J)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return tA.decode(J,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}export{SA as default,hA as zstd}; diff --git a/assets/location-qV39J3P0.js b/assets/location-BLLHg7ZW.js similarity index 97% rename from assets/location-qV39J3P0.js rename to assets/location-BLLHg7ZW.js index ecf98e0..36882df 100644 --- a/assets/location-qV39J3P0.js +++ b/assets/location-BLLHg7ZW.js @@ -1 +1 @@ -import{s as N,f as b,x as w,o as j,i as C,j as y,b as _,r as m,p as f,D as R,q as M}from"./index-C4jKHMt0.js";import{m as T,l as B}from"./Footer-Cdi5kbhN.js";var[E,A]=N({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W,H]=N({strict:!1,name:"FormControlContext"});function G(o){const{id:t,isRequired:a,isInvalid:s,isDisabled:e,isReadOnly:n,...i}=o,d=m.useId(),r=t||`field-${d}`,h=`${r}-label`,p=`${r}-feedback`,x=`${r}-helptext`,[I,v]=m.useState(!1),[k,F]=m.useState(!1),[c,g]=m.useState(!1),S=m.useCallback((l={},u=null)=>({id:x,...l,ref:T(u,P=>{P&&F(!0)})}),[x]),O=m.useCallback((l={},u=null)=>({...l,ref:u,"data-focus":f(c),"data-disabled":f(e),"data-invalid":f(s),"data-readonly":f(n),id:l.id!==void 0?l.id:h,htmlFor:l.htmlFor!==void 0?l.htmlFor:r}),[r,e,c,s,n,h]),$=m.useCallback((l={},u=null)=>({id:p,...l,ref:T(u,P=>{P&&v(!0)}),"aria-live":"polite"}),[p]),L=m.useCallback((l={},u=null)=>({...l,...i,ref:u,role:"group","data-focus":f(c),"data-disabled":f(e),"data-invalid":f(s),"data-readonly":f(n)}),[i,e,c,s,n]),z=m.useCallback((l={},u=null)=>({...l,ref:u,role:"presentation","aria-hidden":!0,children:l.children||"*"}),[]);return{isRequired:!!a,isInvalid:!!s,isReadOnly:!!n,isDisabled:!!e,isFocused:!!c,onFocus:()=>g(!0),onBlur:()=>g(!1),hasFeedbackText:I,setHasFeedbackText:v,hasHelpText:k,setHasHelpText:F,id:r,labelId:h,feedbackId:p,helpTextId:x,htmlProps:i,getHelpTextProps:S,getErrorMessageProps:$,getRootProps:L,getLabelProps:O,getRequiredIndicatorProps:z}}var X=b(function(t,a){const s=w("Form",t),e=j(t),{getRootProps:n,htmlProps:i,...d}=G(e),r=C("chakra-form-control",t.className);return y.jsx(W,{value:d,children:y.jsx(E,{value:s,children:y.jsx(_.div,{...n({},a),className:r,__css:s.container})})})});X.displayName="FormControl";var Y=b(function(t,a){const s=H(),e=A(),n=C("chakra-form__helper-text",t.className);return y.jsx(_.div,{...s==null?void 0:s.getHelpTextProps(t,a),__css:e.helperText,className:n})});Y.displayName="FormHelperText";function J(o){const{isDisabled:t,isInvalid:a,isReadOnly:s,isRequired:e,...n}=K(o);return{...n,disabled:t,readOnly:s,required:e,"aria-invalid":R(a),"aria-required":R(e),"aria-readonly":R(s)}}function K(o){var t,a,s;const e=H(),{id:n,disabled:i,readOnly:d,required:r,isRequired:h,isInvalid:p,isReadOnly:x,isDisabled:I,onFocus:v,onBlur:k,...F}=o,c=o["aria-describedby"]?[o["aria-describedby"]]:[];return e!=null&&e.hasFeedbackText&&(e!=null&&e.isInvalid)&&c.push(e.feedbackId),e!=null&&e.hasHelpText&&c.push(e.helpTextId),{...F,"aria-describedby":c.join(" ")||void 0,id:n??(e==null?void 0:e.id),isDisabled:(t=i??I)!=null?t:e==null?void 0:e.isDisabled,isReadOnly:(a=d??x)!=null?a:e==null?void 0:e.isReadOnly,isRequired:(s=r??h)!=null?s:e==null?void 0:e.isRequired,isInvalid:p??(e==null?void 0:e.isInvalid),onFocus:M(e==null?void 0:e.onFocus,v),onBlur:M(e==null?void 0:e.onBlur,k)}}var D=b(function(t,a){const{htmlSize:s,...e}=t,n=w("Input",e),i=j(e),d=J(i),r=C("chakra-input",t.className);return y.jsx(_.input,{size:s,...d,__css:n.field,ref:a,className:r})});D.displayName="Input";D.id="Input";var Q=b((o,t)=>{const{className:a,...s}=o,e=C("chakra-modal__footer",a),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...B().footer};return y.jsx(_.footer,{ref:t,...s,__css:i,className:e})});Q.displayName="ModalFooter";var U,V,Z;async function ne(o){let t=ee(o);return t.length==0&&(t=te(o)),t}function ee(o){if(/^[-]?(\d+(\.\d+)?),\s*[-]?(\d+(\.\d+)?)$/.test(o)){const[t,a]=o.split(",").map(s=>parseFloat(s.trim()));return[{lat:t,lon:a,display_name:`${t},${a}`,key:"coordinates"}]}else return[]}async function te(o){let t="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(o).concat("+Germany"),a=await q(t);return a||(t="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(o.split(" ").join("+")),a=await q(t)),a.map(s=>({lat:s.lat,lon:s.lon,key:s.place_id,display_name:se(s.address)}))}function se(o){return(o.road||"")+" "+(o.house_number||"")+", "+(o.postcode||"")+" "+(o.city||"")}async function q(o){try{const t=await fetch(o);if(!t.ok)throw new Error(`Request failed with status ${t.status}`);return await t.json()}catch(t){return console.error("Error:",t),[]}}function re(o,t){V=[o,t];const a=t*Math.PI/180,s=Math.pow(2,15),e=s*((o+180)/360),n=s*(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2;return U=[e,n],Z=[1222.992452*e-2003750834e-2,2003750834e-2-1222.992452*n],[e,n]}function le(o,t,a){const s=4007501668e-2,e=s/Math.pow(2,a),n=e*o-s/2,i=n+e,d=s/2-e*t,r=d-e;return[n,d,i,r]}export{X as F,D as I,Q as M,A as a,K as b,V as c,Z as d,U as e,re as p,ne as r,H as u,le as x}; +import{s as N,f as b,x as w,o as j,i as C,j as y,b as _,r as m,p as f,D as R,q as M}from"./index-oAnJD5lr.js";import{m as T,l as B}from"./Footer-CN0UQ_Me.js";var[E,A]=N({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[W,H]=N({strict:!1,name:"FormControlContext"});function G(o){const{id:t,isRequired:a,isInvalid:s,isDisabled:e,isReadOnly:n,...i}=o,d=m.useId(),r=t||`field-${d}`,h=`${r}-label`,p=`${r}-feedback`,x=`${r}-helptext`,[I,v]=m.useState(!1),[k,F]=m.useState(!1),[c,g]=m.useState(!1),S=m.useCallback((l={},u=null)=>({id:x,...l,ref:T(u,P=>{P&&F(!0)})}),[x]),O=m.useCallback((l={},u=null)=>({...l,ref:u,"data-focus":f(c),"data-disabled":f(e),"data-invalid":f(s),"data-readonly":f(n),id:l.id!==void 0?l.id:h,htmlFor:l.htmlFor!==void 0?l.htmlFor:r}),[r,e,c,s,n,h]),$=m.useCallback((l={},u=null)=>({id:p,...l,ref:T(u,P=>{P&&v(!0)}),"aria-live":"polite"}),[p]),L=m.useCallback((l={},u=null)=>({...l,...i,ref:u,role:"group","data-focus":f(c),"data-disabled":f(e),"data-invalid":f(s),"data-readonly":f(n)}),[i,e,c,s,n]),z=m.useCallback((l={},u=null)=>({...l,ref:u,role:"presentation","aria-hidden":!0,children:l.children||"*"}),[]);return{isRequired:!!a,isInvalid:!!s,isReadOnly:!!n,isDisabled:!!e,isFocused:!!c,onFocus:()=>g(!0),onBlur:()=>g(!1),hasFeedbackText:I,setHasFeedbackText:v,hasHelpText:k,setHasHelpText:F,id:r,labelId:h,feedbackId:p,helpTextId:x,htmlProps:i,getHelpTextProps:S,getErrorMessageProps:$,getRootProps:L,getLabelProps:O,getRequiredIndicatorProps:z}}var X=b(function(t,a){const s=w("Form",t),e=j(t),{getRootProps:n,htmlProps:i,...d}=G(e),r=C("chakra-form-control",t.className);return y.jsx(W,{value:d,children:y.jsx(E,{value:s,children:y.jsx(_.div,{...n({},a),className:r,__css:s.container})})})});X.displayName="FormControl";var Y=b(function(t,a){const s=H(),e=A(),n=C("chakra-form__helper-text",t.className);return y.jsx(_.div,{...s==null?void 0:s.getHelpTextProps(t,a),__css:e.helperText,className:n})});Y.displayName="FormHelperText";function J(o){const{isDisabled:t,isInvalid:a,isReadOnly:s,isRequired:e,...n}=K(o);return{...n,disabled:t,readOnly:s,required:e,"aria-invalid":R(a),"aria-required":R(e),"aria-readonly":R(s)}}function K(o){var t,a,s;const e=H(),{id:n,disabled:i,readOnly:d,required:r,isRequired:h,isInvalid:p,isReadOnly:x,isDisabled:I,onFocus:v,onBlur:k,...F}=o,c=o["aria-describedby"]?[o["aria-describedby"]]:[];return e!=null&&e.hasFeedbackText&&(e!=null&&e.isInvalid)&&c.push(e.feedbackId),e!=null&&e.hasHelpText&&c.push(e.helpTextId),{...F,"aria-describedby":c.join(" ")||void 0,id:n??(e==null?void 0:e.id),isDisabled:(t=i??I)!=null?t:e==null?void 0:e.isDisabled,isReadOnly:(a=d??x)!=null?a:e==null?void 0:e.isReadOnly,isRequired:(s=r??h)!=null?s:e==null?void 0:e.isRequired,isInvalid:p??(e==null?void 0:e.isInvalid),onFocus:M(e==null?void 0:e.onFocus,v),onBlur:M(e==null?void 0:e.onBlur,k)}}var D=b(function(t,a){const{htmlSize:s,...e}=t,n=w("Input",e),i=j(e),d=J(i),r=C("chakra-input",t.className);return y.jsx(_.input,{size:s,...d,__css:n.field,ref:a,className:r})});D.displayName="Input";D.id="Input";var Q=b((o,t)=>{const{className:a,...s}=o,e=C("chakra-modal__footer",a),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...B().footer};return y.jsx(_.footer,{ref:t,...s,__css:i,className:e})});Q.displayName="ModalFooter";var U,V,Z;async function ne(o){let t=ee(o);return t.length==0&&(t=te(o)),t}function ee(o){if(/^[-]?(\d+(\.\d+)?),\s*[-]?(\d+(\.\d+)?)$/.test(o)){const[t,a]=o.split(",").map(s=>parseFloat(s.trim()));return[{lat:t,lon:a,display_name:`${t},${a}`,key:"coordinates"}]}else return[]}async function te(o){let t="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(o).concat("+Germany"),a=await q(t);return a||(t="https://nominatim.openstreetmap.org/search?format=json&addressdetails=1&q=".concat(o.split(" ").join("+")),a=await q(t)),a.map(s=>({lat:s.lat,lon:s.lon,key:s.place_id,display_name:se(s.address)}))}function se(o){return(o.road||"")+" "+(o.house_number||"")+", "+(o.postcode||"")+" "+(o.city||"")}async function q(o){try{const t=await fetch(o);if(!t.ok)throw new Error(`Request failed with status ${t.status}`);return await t.json()}catch(t){return console.error("Error:",t),[]}}function re(o,t){V=[o,t];const a=t*Math.PI/180,s=Math.pow(2,15),e=s*((o+180)/360),n=s*(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2;return U=[e,n],Z=[1222.992452*e-2003750834e-2,2003750834e-2-1222.992452*n],[e,n]}function le(o,t,a){const s=4007501668e-2,e=s/Math.pow(2,a),n=e*o-s/2,i=n+e,d=s/2-e*t,r=d-e;return[n,d,i,r]}export{X as F,D as I,Q as M,A as a,K as b,V as c,Z as d,U as e,re as p,ne as r,H as u,le as x}; diff --git a/assets/maplibre-gl-aXS8hSAW.js b/assets/maplibre-gl-vlagFC0R.js similarity index 99% rename from assets/maplibre-gl-aXS8hSAW.js rename to assets/maplibre-gl-vlagFC0R.js index a0ba37b..2a2342c 100644 --- a/assets/maplibre-gl-aXS8hSAW.js +++ b/assets/maplibre-gl-vlagFC0R.js @@ -1,4 +1,4 @@ -import{z as kp,U as zp}from"./index-C4jKHMt0.js";function Ep(va,Bl){for(var Or=0;OrIi[Vr]})}}}return Object.freeze(Object.defineProperty(va,Symbol.toStringTag,{value:"Module"}))}var Lu={exports:{}};/** +import{z as kp,U as zp}from"./index-oAnJD5lr.js";function Ep(va,Bl){for(var Or=0;OrIi[Vr]})}}}return Object.freeze(Object.defineProperty(va,Symbol.toStringTag,{value:"Module"}))}var Lu={exports:{}};/** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.6.0/LICENSE.txt */(function(va,Bl){(function(Or,Ii){va.exports=Ii()})(zp,function(){var Or={},Ii={};function Vr(L,p,Pi){if(Ii[L]=Pi,L==="index"){var qi="var sharedModule = {}; ("+Ii.shared+")(sharedModule); ("+Ii.worker+")(sharedModule);",Gt={};return Ii.shared(Gt),Ii.index(Or,Gt),typeof window<"u"&&Or.setWorkerUrl(window.URL.createObjectURL(new Blob([qi],{type:"text/javascript"}))),Or}}Vr("shared",["exports"],function(L){function p(i,t,r,s){return new(r||(r=Promise))(function(l,c){function d(x){try{_(s.next(x))}catch(b){c(b)}}function f(x){try{_(s.throw(x))}catch(b){c(b)}}function _(x){var b;x.done?l(x.value):(b=x.value,b instanceof r?b:new r(function(w){w(b)})).then(d,f)}_((s=s.apply(i,t||[])).next())})}function Pi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var qi=Gt;function Gt(i,t){this.x=i,this.y=t}Gt.prototype={clone:function(){return new Gt(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),s=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=s,this},_rotateAround:function(i,t){var r=Math.cos(i),s=Math.sin(i),l=t.y+s*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-s*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Gt.convert=function(i){return i instanceof Gt?i:Array.isArray(i)?new Gt(i[0],i[1]):i};var _e=Pi(qi),se=Nr;function Nr(i,t,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(s-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=s}Nr.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var yr=Pi(se);let Zi,xr;function ar(){return Zi==null&&(Zi=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Zi}function Ln(){if(xr==null&&(xr=!1,ar())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let s=0;s<5*5;s++){const l=4*s;t.fillStyle=`rgb(${l},${l+1},${l+2})`,t.fillRect(s%5,Math.floor(s/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){xr=!0;break}}}return xr||!1}function oi(i,t,r,s){const l=new yr(i,t,r,s);return c=>l.solve(c)}const wa=oi(.25,.1,.25,1);function Ai(i,t,r){return Math.min(r,Math.max(t,i))}function Gi(i,t,r){const s=r-t,l=((i-t)%s+s)%s+t;return l===t?r:l}function xi(i,...t){for(const r of t)for(const s in r)i[s]=r[s];return i}let Ss=1;function Hi(i,t,r){const s={};for(const l in i)s[l]=t.call(this,i[l],l,i);return s}function Rn(i,t,r){const s={};for(const l in i)t.call(this,i[l],l,i)&&(s[l]=i[l]);return s}function tt(i){return Array.isArray(i)?i.map(tt):typeof i=="object"&&i?Hi(i,tt):i}const Is={};function Lt(i){Is[i]||(typeof console<"u"&&console.warn(i),Is[i]=!0)}function Ht(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function or(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let ln=null;function Xi(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Ps="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function jr(i,t,r,s,l){return p(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const c=new VideoFrame(i,{timestamp:0});try{const d=c==null?void 0:c.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(s*l*4);if(yield c.copyTo(_,function(x,b,w,I,M){const k=4*Math.max(-b,0),z=(Math.max(0,w)-w)*I*4+k,O=4*I,$=Math.max(0,b),Q=Math.max(0,w);return{rect:{x:$,y:Q,width:Math.min(x.width,b+I)-$,height:Math.min(x.height,w+M)-Q},layout:[{offset:z,stride:O}]}}(i,t,r,s,l)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{c.close()}})}let lr,Qt;const Mi="AbortError";function cn(){return new Error(Mi)}const vr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Wi(i){return vr.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const hn="global-dispatcher";class li extends Error{constructor(t,r,s,l){super(`AJAXError: ${r} (${t}): ${s}`),this.status=t,this.statusText=r,this.url=s,this.body=l}}const Ci=()=>or(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Ur=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const s=Wi(i.url);if(s)return s(i,t);if(or(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:hn},t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Ci())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(s,l){return p(this,void 0,void 0,function*(){const c=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Ci(),signal:l.signal});s.type!=="json"||c.headers.has("Accept")||c.headers.set("Accept","application/json");const d=yield fetch(c);if(!d.ok){const x=yield d.blob();throw new li(d.status,d.statusText,s.url,x)}let f;f=s.type==="arrayBuffer"||s.type==="image"?d.arrayBuffer():s.type==="json"?d.json():d.text();const _=yield f;if(l.signal.aborted)throw cn();return{data:_,cacheControl:d.headers.get("Cache-Control"),expires:d.headers.get("Expires")}})}(i,t);if(or(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:hn},t)}var r;return function(s,l){return new Promise((c,d)=>{var f;const _=new XMLHttpRequest;_.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(_.responseType="arraybuffer");for(const x in s.headers)_.setRequestHeader(x,s.headers[x]);s.type==="json"&&(_.responseType="text",!((f=s.headers)===null||f===void 0)&&f.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=s.credentials==="include",_.onerror=()=>{d(new Error(_.statusText))},_.onload=()=>{if(!l.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let x=_.response;if(s.type==="json")try{x=JSON.parse(_.response)}catch(b){return void d(b)}c({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});d(new li(_.status,_.statusText,s.url,x))}},l.signal.addEventListener("abort",()=>{_.abort(),d(cn())}),_.send(s.body)})}(i,t)};function $r(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Bn(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function cr(i,t,r){if(r&&r[i]){const s=r[i].indexOf(t);s!==-1&&r[i].splice(s,1)}}class br{constructor(t,r={}){xi(this,r),this.type=t}}class wr extends br{constructor(t,r={}){super("error",xi({error:t},r))}}class un{on(t,r){return this._listeners=this._listeners||{},Bn(t,r,this._listeners),this}off(t,r){return cr(t,r,this._listeners),cr(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Bn(t,r,this._oneTimeListeners),this):new Promise(s=>this.once(t,s))}fire(t,r){typeof t=="string"&&(t=new br(t,r||{}));const s=t.type;if(this.listens(s)){t.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of l)f.call(this,t);const c=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of c)cr(s,f,this._oneTimeListeners),f.call(this,t);const d=this._eventedParent;d&&(xi(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(t))}else t instanceof wr&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const qr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fn(i,t){const r={};for(const s in i)s!=="ref"&&(r[s]=i[s]);return qr.forEach(s=>{s in t&&(r[s]=t[s])}),r}function Je(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${t}>`}return i.kind}const E=[Sr,ge,Ue,Le,ei,ur,ki,A(Oe),Ir,Qi,j];function V(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!V(i.itemType,t.itemType))&&(typeof i.N!="number"||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if(i.kind==="value"){for(const r of E)if(!V(r,t))return null}}return`Expected ${P(i)} but found ${P(t)} instead.`}function H(i,t){return t.some(r=>r.kind===i.kind)}function X(i,t){return t.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function J(i,t){return i.kind==="array"&&t.kind==="array"?i.itemType.kind===t.itemType.kind&&typeof i.N=="number":i.kind===t.kind}const q=.96422,ne=.82521,le=4/29,te=6/29,fe=3*te*te,ze=te*te*te,Ee=Math.PI/180,Ne=180/Math.PI;function We(i){return(i%=360)<0&&(i+=360),i}function Ve([i,t,r,s]){let l,c;const d=_t((.2225045*(i=at(i))+.7168786*(t=at(t))+.0606169*(r=at(r)))/1);i===t&&t===r?l=c=d:(l=_t((.4360747*i+.3850649*t+.1430804*r)/q),c=_t((.0139322*i+.0971045*t+.7141733*r)/ne));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-c),s]}function at(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function _t(i){return i>ze?Math.pow(i,1/3):i/fe+le}function St([i,t,r,s]){let l=(i+16)/116,c=isNaN(t)?l:l+t/500,d=isNaN(r)?l:l-r/200;return l=1*Qe(l),c=q*Qe(c),d=ne*Qe(d),[$e(3.1338561*c-1.6168667*l-.4906146*d),$e(-.9787684*c+1.9161415*l+.033454*d),$e(.0719453*c-.2289914*l+1.4052427*d),s]}function $e(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Qe(i){return i>te?i*i*i:fe*(i-le)}function pt(i){return parseInt(i.padEnd(2,i),16)/255}function At(i,t){return Rt(t?i/100:i,0,1)}function Rt(i,t,r){return Math.min(Math.max(t,i),r)}function Bt(i){return!i.some(Number.isNaN)}const jn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class et{constructor(t,r,s,l=1,c=!0){this.r=t,this.g=r,this.b=s,this.a=l,c||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,s,l]))}static parse(t){if(t instanceof et)return t;if(typeof t!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=jn[s];if(l){const[d,f,_]=l;return[d/255,f/255,_/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const d=s.length<6?1:2;let f=1;return[pt(s.slice(f,f+=d)),pt(s.slice(f,f+=d)),pt(s.slice(f,f+=d)),pt(s.slice(f,f+d)||"ff")]}if(s.startsWith("rgb")){const d=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,b,w,I,M,k,z,O,$,Q]=d,G=[b||" ",M||" ",O].join("");if(G===" "||G===" /"||G===",,"||G===",,,"){const K=[x,I,z].join(""),re=K==="%%%"?100:K===""?255:0;if(re){const ce=[Rt(+_/re,0,1),Rt(+w/re,0,1),Rt(+k/re,0,1),$?At(+$,Q):1];if(Bt(ce))return ce}}return}}const c=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(c){const[d,f,_,x,b,w,I,M,k]=c,z=[_||" ",b||" ",I].join("");if(z===" "||z===" /"||z===",,"||z===",,,"){const O=[+f,Rt(+x,0,100),Rt(+w,0,100),M?At(+M,k):1];if(Bt(O))return function([$,Q,G,K]){function re(ce){const be=(ce+$/30)%12,De=Q*Math.min(G,1-G);return G-De*Math.max(-1,Math.min(be-3,9-be,1))}return $=We($),Q/=100,G/=100,[re(0),re(8),re(4),K]}(O)}}}(t);return r?new et(...r,!1):void 0}get rgb(){const{r:t,g:r,b:s,a:l}=this,c=l||1/0;return this.overwriteGetter("rgb",[t/c,r/c,s/c,l])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,s,l,c]=Ve(t),d=Math.sqrt(s*s+l*l);return[Math.round(1e4*d)?We(Math.atan2(l,s)*Ne):NaN,d,r,c]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ve(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,s,l]=this.rgb;return`rgba(${[t,r,s].map(c=>Math.round(255*c)).join(",")},${l})`}}et.black=new et(0,0,0,1),et.white=new et(1,1,1,1),et.transparent=new et(0,0,0,0),et.red=new et(1,0,0,1);class Ta{constructor(t,r,s){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Sa{constructor(t,r,s,l,c){this.text=t,this.image=r,this.scale=s,this.fontStack=l,this.textColor=c}}class ci{constructor(t){this.sections=t}static fromString(t){return new ci([new Sa(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof ci?t:ci.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class hi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof hi)return t;if(typeof t=="number")return new hi([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new hi(t)}}toString(){return JSON.stringify(this.values)}}const Fl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ui{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ui)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r=0&&i<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,t,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,t,r,s]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Un(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof et||i instanceof Ta||i instanceof ci||i instanceof hi||i instanceof ui||i instanceof Ft)return!0;if(Array.isArray(i)){for(const t of i)if(!Un(t))return!1;return!0}if(typeof i=="object"){for(const t in i)if(!Un(i[t]))return!1;return!0}return!1}function It(i){if(i===null)return Sr;if(typeof i=="string")return Ue;if(typeof i=="boolean")return Le;if(typeof i=="number")return ge;if(i instanceof et)return ei;if(i instanceof Ta)return Yi;if(i instanceof ci)return ur;if(i instanceof hi)return Ir;if(i instanceof ui)return j;if(i instanceof Ft)return Qi;if(Array.isArray(i)){const t=i.length;let r;for(const s of i){const l=It(s);if(r){if(r===l)continue;r=Oe;break}r=l}return A(r||Oe,t)}return ki}function dr(i){const t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof et||i instanceof ci||i instanceof hi||i instanceof ui||i instanceof Ft?i.toString():JSON.stringify(i)}class Zr{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Un(t[1]))return r.error("invalid value");const s=t[1];let l=It(s);const c=r.expectedType;return l.kind!=="array"||l.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(l=c),new Zr(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class wt{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Ms={string:Ue,number:ge,boolean:Le,object:ki};class bi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let s,l=1;const c=t[0];if(c==="array"){let f,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in Ms)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=Ms[x],l++}else f=Oe;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],l++}s=A(f,_)}else{if(!Ms[c])throw new Error(`Types doesn't contain name = ${c}`);s=Ms[c]}const d=[];for(;lt.outputDefined())}}const $n={"to-boolean":Le,"to-color":ei,"to-number":ge,"to-string":Ue};class Pr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[0];if(!$n[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&t.length!==2)return r.error("Expected one argument.");const l=$n[s],c=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:As(r[0],r[1],r[2],r[3]),!s))return new et(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new wt(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(t);const l=hi.parse(r);if(l)return l}throw new wt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(t);const l=ui.parse(r);if(l)return l}throw new wt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(t),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new wt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return ci.fromString(dr(this.args[0].evaluate(t)));case"resolvedImage":return Ft.fromString(dr(this.args[0].evaluate(t)));default:return dr(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Ia=["Unknown","Point","LineString","Polygon"];class qn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ia[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=et.parse(t)),r}}class Ar{constructor(t,r,s=[],l,c=new Ji,d=[]){this.registry=t,this.path=s,this.key=s.map(f=>`[${f}]`).join(""),this.scope=c,this.errors=d,this.expectedType=l,this._isConstant=r}parse(t,r,s,l,c={}){return r?this.concat(r,s,l)._parse(t,c):this._parse(t,c)}_parse(t,r){function s(l,c,d){return d==="assert"?new bi(c,[l]):d==="coerce"?new Pr(c,[l]):l}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=t[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[l];if(c){let d=c.parse(t,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"coerce");else d=s(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Zr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new qn;try{d=new Zr(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,s){const l=typeof t=="number"?this.path.concat(t):this.path,c=s?this.scope.concat(s):this.scope;return new Ar(this.registry,this._isConstant,l,r||null,c,this.errors)}error(t,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new Xt(s,t))}checkSubtype(t,r){const s=V(t,r);return s&&this.error(s),s}}class Ye{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const s=[];for(let c=1;c=s.length)throw new wt(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new wt(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Zn{constructor(t,r){this.type=Le,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Oe),l=r.parse(t[2],2,Oe);return s&&l?H(s.type,[Le,Ue,ge,Sr,Oe])?new Zn(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${P(s.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!s)return!1;if(!X(r,["boolean","string","number","null"]))throw new wt(`Expected first argument to be of type boolean, string, number or null, but found ${P(It(r))} instead.`);if(!X(s,["string","array"]))throw new wt(`Expected second argument to be of type array or string, but found ${P(It(s))} instead.`);return s.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ks{constructor(t,r,s){this.type=ge,this.needle=t,this.haystack=r,this.fromIndex=s}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Oe),l=r.parse(t[2],2,Oe);if(!s||!l)return null;if(!H(s.type,[Le,Ue,ge,Sr,Oe]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${P(s.type)} instead`);if(t.length===4){const c=r.parse(t[3],3,ge);return c?new ks(s,l,c):null}return new ks(s,l)}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!X(r,["boolean","string","number","null"]))throw new wt(`Expected first argument to be of type boolean, string, number or null, but found ${P(It(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),X(s,["string"])){const c=s.indexOf(r,l);return c===-1?-1:[...s.slice(0,c)].length}if(X(s,["array"]))return s.indexOf(r,l);throw new wt(`Expected second argument to be of type array or string, but found ${P(It(s))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class zs{constructor(t,r,s,l,c,d){this.inputType=t,this.type=r,this.input=s,this.cases=l,this.outputs=c,this.otherwise=d}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const c={},d=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof k=="number"&&Math.floor(k)!==k)return I.error("Numeric branch labels must be integer values.");if(s){if(I.checkSubtype(s,It(k)))return null}else s=It(k);if(c[String(k)]!==void 0)return I.error("Branch labels must be unique.");c[String(k)]=d.length}const M=r.parse(w,x,l);if(!M)return null;l=l||M.type,d.push(M)}const f=r.parse(t[1],1,Oe);if(!f)return null;const _=r.parse(t[t.length-1],t.length-1,l);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(s,f.type)?null:new zs(s,l,f,c,d,_):null}evaluate(t){const r=this.input.evaluate(t);return(It(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Es{constructor(t,r,s){this.type=t,this.branches=r,this.otherwise=s}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class Ds{constructor(t,r,s,l){this.type=t,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,Oe),l=r.parse(t[2],2,ge);if(!s||!l)return null;if(!H(s.type,[A(Oe),Ue,Oe]))return r.error(`Expected first argument to be of type array or string, but found ${P(s.type)} instead`);if(t.length===4){const c=r.parse(t[3],3,ge);return c?new Ds(s.type,s,l,c):null}return new Ds(s.type,s,l)}evaluate(t){const r=this.input.evaluate(t),s=this.beginIndex.evaluate(t);let l;if(this.endIndex&&(l=this.endIndex.evaluate(t)),X(r,["string"]))return[...r].slice(s,l).join("");if(X(r,["array"]))return r.slice(s,l);throw new wt(`Expected first argument to be of type array or string, but found ${P(It(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Gn(i,t){const r=i.length-1;let s,l,c=0,d=r,f=0;for(;c<=d;)if(f=Math.floor((c+d)/2),s=i[f],l=i[f+1],s<=t){if(f===r||tt))throw new wt("Input is not a number.");d=f-1}return 0}class pn{constructor(t,r,s){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[l,c]of s)this.labels.push(l),this.outputs.push(c)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(t[1],1,ge);if(!s)return null;const l=[];let c=null;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);for(let d=1;d=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const w=r.parse(_,b,c);if(!w)return null;c=c||w.type,l.push([f,w])}return new pn(c,s,l)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const c=r.length;return l>=r[c-1]?s[c-1].evaluate(t):s[Gn(r,l)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ol(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Vl=Do;function Do(i,t,r,s){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(s-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=s}Do.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,s=0;s<8;s++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var Nl=Ol(Vl);function Mr(i,t,r){return i+r*(t-i)}function Hn(i,t,r){return i.map((s,l)=>Mr(s,t[l],r))}const di={number:Mr,color:function(i,t,r,s="rgb"){switch(s){case"rgb":{const[l,c,d,f]=Hn(i.rgb,t.rgb,r);return new et(l,c,d,f,!1)}case"hcl":{const[l,c,d,f]=i.hcl,[_,x,b,w]=t.hcl;let I,M;if(isNaN(l)||isNaN(_))isNaN(l)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(M=x)):(I=l,b!==1&&b!==0||(M=c));else{let Q=_-l;_>l&&Q>180?Q-=360:_180&&(Q+=360),I=l+r*Q}const[k,z,O,$]=function([Q,G,K,re]){return Q=isNaN(Q)?0:Q*Ee,St([K,Math.cos(Q)*G,Math.sin(Q)*G,re])}([I,M??Mr(c,x,r),Mr(d,b,r),Mr(f,w,r)]);return new et(k,z,O,$,!1)}case"lab":{const[l,c,d,f]=St(Hn(i.lab,t.lab,r));return new et(l,c,d,f,!1)}}},array:Hn,padding:function(i,t,r){return new hi(Hn(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const s=i.values,l=t.values;if(s.length!==l.length)throw new wt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const c=[];for(let d=0;dtypeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(c=r.parse(c,2,ge),!c)return null;const f=[];let _=null;s==="interpolate-hcl"||s==="interpolate-lab"?_=ei:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);const k=r.parse(w,M,_);if(!k)return null;_=_||k.type,f.push([b,k])}return J(_,ge)||J(_,ei)||J(_,Ir)||J(_,j)||J(_,A(ge))?new pi(_,s,l,c,f):r.error(`Type ${P(_)} is not interpolatable.`)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const c=r.length;if(l>=r[c-1])return s[c-1].evaluate(t);const d=Gn(r,l),f=pi.interpolationFactor(this.interpolation,l,r[d],r[d+1]),_=s[d].evaluate(t),x=s[d+1].evaluate(t);switch(this.operator){case"interpolate":return di[this.type.kind](_,x,f);case"interpolate-hcl":return di.color(_,x,f,"hcl");case"interpolate-lab":return di.color(_,x,f,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Xn(i,t,r,s){const l=s-r,c=i-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}class Ls{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const c=[];for(const f of t.slice(1)){const _=r.parse(f,1+c.length,s,void 0,{typeAnnotation:"omit"});if(!_)return null;s=s||_.type,c.push(_)}if(!s)throw new Error("No output type");const d=l&&c.some(f=>V(l,f.type));return new Ls(d?Oe:s,c)}evaluate(t){let r,s=null,l=0;for(const c of this.args)if(l++,s=c.evaluate(t),s&&s instanceof Ft&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Lo(i,t){return i==="=="||i==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Ro(i,t,r,s){return s.compare(t,r)===0}function Gr(i,t,r){const s=i!=="=="&&i!=="!=";return class Ru{constructor(c,d,f){this.type=Le,this.lhs=c,this.rhs=d,this.collator=f,this.hasUntypedArgument=c.type.kind==="value"||d.type.kind==="value"}static parse(c,d){if(c.length!==3&&c.length!==4)return d.error("Expected two or three arguments.");const f=c[0];let _=d.parse(c[1],1,Oe);if(!_)return null;if(!Lo(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${P(_.type)}'.`);let x=d.parse(c[2],2,Oe);if(!x)return null;if(!Lo(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${P(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${P(_.type)}' and '${P(x.type)}'.`);s&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new bi(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new bi(_.type,[x])));let b=null;if(c.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(c[3],3,Yi),!b)return null}return new Ru(_,x,b)}evaluate(c){const d=this.lhs.evaluate(c),f=this.rhs.evaluate(c);if(s&&this.hasUntypedArgument){const _=It(d),x=It(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new wt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const _=It(d),x=It(f);if(_.kind!=="string"||x.kind!=="string")return t(c,d,f)}return this.collator?r(c,d,f,this.collator.evaluate(c)):t(c,d,f)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}}}const Bo=Gr("==",function(i,t,r){return t===r},Ro),jl=Gr("!=",function(i,t,r){return t!==r},function(i,t,r,s){return!Ro(0,t,r,s)}),Ul=Gr("<",function(i,t,r){return t",function(i,t,r){return t>r},function(i,t,r,s){return s.compare(t,r)>0}),Oo=Gr("<=",function(i,t,r){return t<=r},function(i,t,r,s){return s.compare(t,r)<=0}),$l=Gr(">=",function(i,t,r){return t>=r},function(i,t,r,s){return s.compare(t,r)>=0});class Rs{constructor(t,r,s){this.type=Yi,this.locale=s,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const s=t[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Le);if(!l)return null;const c=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Le);if(!c)return null;let d=null;return s.locale&&(d=r.parse(s.locale,1,Ue),!d)?null:new Rs(l,c,d)}evaluate(t){return new Ta(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Aa{constructor(t,r,s,l,c){this.type=Ue,this.number=t,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=c}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const s=r.parse(t[1],1,ge);if(!s)return null;const l=t[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let c=null;if(l.locale&&(c=r.parse(l.locale,1,Ue),!c))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,Ue),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,ge),!f))return null;let _=null;return l["max-fraction-digits"]&&(_=r.parse(l["max-fraction-digits"],1,ge),!_)?null:new Aa(s,c,d,f,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Bs{constructor(t){this.type=ur,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let c=!1;for(let d=1;d<=t.length-1;++d){const f=t[d];if(c&&typeof f=="object"&&!Array.isArray(f)){c=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,ge),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,A(Ue)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,ei),!b))return null;const w=l[l.length-1];w.scale=_,w.font=x,w.textColor=b}else{const _=r.parse(t[d],1,Oe);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,l.push({content:_,scale:null,font:null,textColor:null})}}return new Bs(l)}evaluate(t){return new ci(this.sections.map(r=>{const s=r.content.evaluate(t);return It(s)===Qi?new Sa("",s,null,null,null):new Sa(dr(s),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class Ma{constructor(t){this.type=Qi,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const s=r.parse(t[1],1,Ue);return s?new Ma(s):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),s=Ft.fromString(r);return s&&t.availableImages&&(s.available=t.availableImages.indexOf(r)>-1),s}eachChild(t){t(this.input)}outputDefined(){return!1}}class Ca{constructor(t){this.type=ge,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const s=r.parse(t[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${P(s.type)} instead.`):new Ca(s):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new wt(`Expected value to be of type string or array, but found ${P(It(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const er=8192;function ka(i,t){const r=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*er),Math.round(s*l*er)]}function fn(i,t){const r=Math.pow(2,t.z);return[(l=(i[0]/er+t.x)/r,360*l-180),(s=(i[1]/er+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,l}function Xe(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function Wn(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function ql(i,t,r){const s=i[0]-t[0],l=i[1]-t[1],c=i[0]-r[0],d=i[1]-r[1];return s*d-c*l==0&&s*c<=0&&l*d<=0}function Fs(i,t,r,s){return(l=[s[0]-r[0],s[1]-r[1]])[0]*(c=[t[0]-i[0],t[1]-i[1]])[1]-l[1]*c[0]!=0&&!(!No(i,t,r,s)||!No(r,s,i,t));var l,c}function Zl(i,t,r){for(const s of r)for(let l=0;l(l=i)[1]!=(d=f[_+1])[1]>l[1]&&l[0]<(d[0]-c[0])*(l[1]-c[1])/(d[1]-c[1])+c[0]&&(s=!s)}var l,c,d;return s}function Gl(i,t){for(const r of t)if(mn(i,r))return!0;return!1}function Vo(i,t){for(const r of i)if(!mn(r,t))return!1;for(let r=0;r0&&f<0||d<0&&f>0}function za(i,t,r){const s=[];for(let l=0;lr[2]){const l=.5*s;let c=i[0]-r[0]>l?-s:r[0]-i[0]>l?s:0;c===0&&(c=i[0]-r[2]>l?-s:r[2]-i[0]>l?s:0),i[0]+=c}Xe(t,i)}function $o(i,t,r,s){const l=Math.pow(2,s.z)*er,c=[s.x*er,s.y*er],d=[];for(const f of i)for(const _ of f){const x=[_.x+c[0],_.y+c[1]];Uo(x,t,r,l),d.push(x)}return d}function qo(i,t,r,s){const l=Math.pow(2,s.z)*er,c=[s.x*er,s.y*er],d=[];for(const _ of i){const x=[];for(const b of _){const w=[b.x+c[0],b.y+c[1]];Xe(t,w),x.push(w)}d.push(x)}if(t[2]-t[0]<=l/2){(f=t)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)Uo(x,t,r,l)}var f;return d}class Hr{constructor(t,r){this.type=Le,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Un(t[1])){const s=t[1];if(s.type==="FeatureCollection"){const l=[];for(const c of s.features){const{type:d,coordinates:f}=c.geometry;d==="Polygon"&&l.push(f),d==="MultiPolygon"&&l.push(...f)}if(l.length)return new Hr(s,{type:"MultiPolygon",coordinates:l})}else if(s.type==="Feature"){const l=s.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Hr(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new Hr(s,s)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=za(s.coordinates,c,d),_=$o(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!mn(x,f))return!1}if(s.type==="MultiPolygon"){const f=jo(s.coordinates,c,d),_=$o(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!Gl(x,f))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(s.type==="Polygon"){const f=za(s.coordinates,c,d),_=qo(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!Vo(x,f))return!1}if(s.type==="MultiPolygon"){const f=jo(s.coordinates,c,d),_=qo(r.geometry(),l,c,d);if(!Wn(l,c))return!1;for(const x of _)if(!Hl(x,f))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Zo=class{constructor(i=[],t=(r,s)=>rs?1:0){if(this.data=i,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;const i=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:t,compare:r}=this,s=t[i];for(;i>0;){const l=i-1>>1,c=t[l];if(r(s,c)>=0)break;t[i]=c,i=l}t[i]=s}_down(i){const{data:t,compare:r}=this,s=this.length>>1,l=t[i];for(;i=0)break;t[i]=t[c],i=c}t[i]=l}};function Xl(i,t,r,s,l){Go(i,t,r,s||i.length-1,l||Wl)}function Go(i,t,r,s,l){for(;s>r;){if(s-r>600){var c=s-r+1,d=t-r+1,f=Math.log(c),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(c-_)/c)*(d-c/2<0?-1:1);Go(i,t,Math.max(r,Math.floor(t-d*_/c+x)),Math.min(s,Math.floor(t+(c-d)*_/c+x)),l)}var b=i[t],w=r,I=s;for(Kn(i,r,t),l(i[s],b)>0&&Kn(i,r,s);w0;)I--}l(i[r],b)===0?Kn(i,r,I):Kn(i,++I,s),I<=t&&(r=I+1),t<=I&&(s=I-1)}}function Kn(i,t,r){var s=i[t];i[t]=i[r],i[r]=s}function Wl(i,t){return it?1:0}function Os(i,t){if(i.length<=1)return[i];const r=[];let s,l;for(const c of i){const d=Jl(c);d!==0&&(c.area=Math.abs(d),l===void 0&&(l=d<0),l===d<0?(s&&r.push(s),s=[c]):s.push(c))}if(s&&r.push(s),t>1)for(let c=0;c1?(x=t[_+1][0],b=t[_+1][1]):M>0&&(x+=w/this.kx*M,b+=I/this.ky*M)),w=this.wrap(r[0]-x)*this.kx,I=(r[1]-b)*this.ky;const k=w*w+I*I;k180;)t-=360;return t}}function Ko(i,t){return t[0]-i[0]}function Vs(i){return i[1]-i[0]+1}function pr(i,t){return i[1]>=i[0]&&i[1]i[1])return[null,null];const r=Vs(i);if(t){if(r===2)return[i,null];const l=Math.floor(r/2);return[[i[0],i[0]+l],[i[0]+l,i[1]]]}if(r===1)return[i,null];const s=Math.floor(r/2)-1;return[[i[0],i[0]+s],[i[0]+s+1,i[1]]]}function Jn(i,t){if(!pr(t,i.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let s=t[0];s<=t[1];++s)Xe(r,i[s]);return r}function La(i){const t=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const s of r)Xe(t,s);return t}function Jo(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function Ra(i,t,r){if(!Jo(i)||!Jo(t))return NaN;let s=0,l=0;return i[2]t[2]&&(s=i[0]-t[2]),i[1]>t[3]&&(l=i[1]-t[3]),i[3]=s)return s;if(Wn(l,c)){if(ot(i,t))return 0}else if(ot(t,i))return 0;let d=1/0;for(const f of i)for(let _=0,x=f.length,b=x-1;_0;){const _=d.pop();if(_[0]>=c)continue;const x=_[1],b=t?50:100;if(Vs(x)<=b){if(!pr(x,i.length))return NaN;if(t){const w=ft(i,x,r,s);if(isNaN(w)||w===0)return w;c=Math.min(c,w)}else for(let w=x[0];w<=x[1];++w){const I=Ba(i[w],r,s);if(c=Math.min(c,I),c===0)return 0}}else{const w=Da(x,t);Fa(d,c,s,i,f,w[0]),Fa(d,c,s,i,f,w[1])}}return c}function Us(i,t,r,s,l,c=1/0){let d=Math.min(c,l.distance(i[0],r[0]));if(d===0)return d;const f=new Zo([[0,[0,i.length-1],[0,r.length-1]]],Ko);for(;f.length>0;){const _=f.pop();if(_[0]>=d)continue;const x=_[1],b=_[2],w=t?50:100,I=s?50:100;if(Vs(x)<=w&&Vs(b)<=I){if(!pr(x,i.length)&&pr(b,r.length))return NaN;let M;if(t&&s)M=Yl(i,x,r,b,l),d=Math.min(d,M);else if(t&&!s){const k=i.slice(x[0],x[1]+1);for(let z=b[0];z<=b[1];++z)if(M=Xr(r[z],k,l),d=Math.min(d,M),d===0)return d}else if(!t&&s){const k=r.slice(b[0],b[1]+1);for(let z=x[0];z<=x[1];++z)if(M=Xr(i[z],k,l),d=Math.min(d,M),d===0)return d}else M=Ze(i,x,r,b,l),d=Math.min(d,M)}else{const M=Da(x,t),k=Da(b,s);Yn(f,d,l,i,r,M[0],k[0]),Yn(f,d,l,i,r,M[0],k[1]),Yn(f,d,l,i,r,M[1],k[0]),Yn(f,d,l,i,r,M[1],k[1])}}return d}function Oa(i){return i.type==="MultiPolygon"?i.coordinates.map(t=>({type:"Polygon",coordinates:t})):i.type==="MultiLineString"?i.coordinates.map(t=>({type:"LineString",coordinates:t})):i.type==="MultiPoint"?i.coordinates.map(t=>({type:"Point",coordinates:t})):[i]}class Wr{constructor(t,r){this.type=ge,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Un(t[1])){const s=t[1];if(s.type==="FeatureCollection")return new Wr(s,s.features.map(l=>Oa(l.geometry)).flat());if(s.type==="Feature")return new Wr(s,Oa(s.geometry));if("type"in s&&"coordinates"in s)return new Wr(s,Oa(s))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=r.geometry(),c=l.flat().map(_=>fn([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Ea(c[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,Us(c,!1,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,Us(c,!1,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,js(c,!1,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=r.geometry(),c=l.flat().map(_=>fn([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new Ea(c[0][1]);let f=1/0;for(const _ of s){switch(_.type){case"Point":f=Math.min(f,Us(c,!0,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,Us(c,!0,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,js(c,!0,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="Polygon")return function(r,s){const l=r.geometry();if(l.length===0||l[0].length===0)return NaN;const c=Os(l,0).map(_=>_.map(x=>x.map(b=>fn([b.x,b.y],r.canonical)))),d=new Ea(c[0][0][0][1]);let f=1/0;for(const _ of s)for(const x of c){switch(_.type){case"Point":f=Math.min(f,js([_.coordinates],!1,x,d,f));break;case"LineString":f=Math.min(f,js(_.coordinates,!0,x,d,f));break;case"Polygon":f=Math.min(f,Ns(x,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Kr={"==":Bo,"!=":jl,">":Fo,"<":Ul,">=":$l,"<=":Oo,array:bi,at:Pa,boolean:bi,case:Es,coalesce:Ls,collator:Rs,format:Bs,image:Ma,in:Zn,"index-of":ks,interpolate:pi,"interpolate-hcl":pi,"interpolate-lab":pi,length:Ca,let:Ye,literal:Zr,match:zs,number:bi,"number-format":Aa,object:bi,slice:Ds,step:pn,string:bi,"to-boolean":Pr,"to-color":Pr,"to-number":Pr,"to-string":Pr,var:Cs,within:Hr,distance:Wr};class fi{constructor(t,r,s,l){this.name=t,this.type=r,this._evaluate=s,this.args=l}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const s=t[0],l=fi.definitions[s];if(!l)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(l)?l[0]:l.type,d=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let _=null;for(const[x,b]of f){_=new Ar(r.registry,$s,r.path,null,r.scope);const w=[];let I=!1;for(let M=1;M{return I=w,Array.isArray(I)?`(${I.map(P).join(", ")})`:`(${P(I.type)}...)`;var I}).join(" | "),b=[];for(let w=1;w{r=t?r&&$s(s):r&&s instanceof Zr}),!!r&&qs(i)&&Zs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function qs(i){if(i instanceof fi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Hr||i instanceof Wr)return!1;let t=!0;return i.eachChild(r=>{t&&!qs(r)&&(t=!1)}),t}function es(i){if(i instanceof fi&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!es(r)&&(t=!1)}),t}function Zs(i,t){if(i instanceof fi&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(s=>{r&&!Zs(s,t)&&(r=!1)}),r}function Yo(i){return{result:"success",value:i}}function _n(i){return{result:"error",value:i}}function gn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function ja(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Gs(i){return!!i.expression&&i.expression.interpolated}function He(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Hs(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Qo(i){return i}function Ua(i,t){const r=t.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",l=s||!(s||i.property!==void 0),c=i.type||(Gs(t)?"exponential":"interval");if(r||t.type==="padding"){const b=r?et.parse:hi.parse;(i=Ki({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],b(w[1])])),i.default=b(i.default?i.default:t.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(c==="exponential")f=is;else if(c==="interval")f=Xs;else if(c==="categorical"){f=$a,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);f=el}if(s){const b={},w=[];for(let k=0;kk[0]),evaluate:({zoom:k},z)=>is({stops:I,base:i.base},t,k).evaluate(k,z)}}if(l){const b=c==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:pi.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>f(i,t,w,_,x)}}return{kind:"source",evaluate(b,w){const I=w&&w.properties?w.properties[i.property]:void 0;return I===void 0?ts(i.default,t.default):f(i,t,I,_,x)}}}function ts(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function $a(i,t,r,s,l){return ts(typeof r===l?s[r]:void 0,i.default,t.default)}function Xs(i,t,r){if(He(r)!=="number")return ts(i.default,t.default);const s=i.stops.length;if(s===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[s-1][0])return i.stops[s-1][1];const l=Gn(i.stops.map(c=>c[0]),r);return i.stops[l][1]}function is(i,t,r){const s=i.base!==void 0?i.base:1;if(He(r)!=="number")return ts(i.default,t.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const c=Gn(i.stops.map(b=>b[0]),r),d=function(b,w,I,M){const k=M-I,z=b-I;return k===0?0:w===1?z/k:(Math.pow(w,z)-1)/(Math.pow(w,k)-1)}(r,s,i.stops[c][0],i.stops[c+1][0]),f=i.stops[c][1],_=i.stops[c+1][1],x=di[t.type]||Qo;return typeof f.evaluate=="function"?{evaluate(...b){const w=f.evaluate.apply(void 0,b),I=_.evaluate.apply(void 0,b);if(w!==void 0&&I!==void 0)return x(w,I,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function el(i,t,r){switch(t.type){case"color":r=et.parse(r);break;case"formatted":r=ci.fromString(r.toString());break;case"resolvedImage":r=Ft.fromString(r.toString());break;case"padding":r=hi.parse(r);break;default:He(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return ts(r,i.default,t.default)}fi.register(Kr,{error:[{kind:"error"},[Ue],(i,[t])=>{throw new wt(t.evaluate(i))}],typeof:[Ue,[Oe],(i,[t])=>P(It(t.evaluate(i)))],"to-rgba":[A(ge,4),[ei],(i,[t])=>{const[r,s,l,c]=t.evaluate(i).rgb;return[255*r,255*s,255*l,c]}],rgb:[ei,[ge,ge,ge],Va],rgba:[ei,[ge,ge,ge,ge],Va],has:{type:Le,overloads:[[[Ue],(i,[t])=>Na(t.evaluate(i),i.properties())],[[Ue,ki],(i,[t,r])=>Na(t.evaluate(i),r.evaluate(i))]]},get:{type:Oe,overloads:[[[Ue],(i,[t])=>Qn(t.evaluate(i),i.properties())],[[Ue,ki],(i,[t,r])=>Qn(t.evaluate(i),r.evaluate(i))]]},"feature-state":[Oe,[Ue],(i,[t])=>Qn(t.evaluate(i),i.featureState||{})],properties:[ki,[],i=>i.properties()],"geometry-type":[Ue,[],i=>i.geometryType()],id:[Oe,[],i=>i.id()],zoom:[ge,[],i=>i.globals.zoom],"heatmap-density":[ge,[],i=>i.globals.heatmapDensity||0],"line-progress":[ge,[],i=>i.globals.lineProgress||0],accumulated:[Oe,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ge,Jr(ge),(i,t)=>{let r=0;for(const s of t)r+=s.evaluate(i);return r}],"*":[ge,Jr(ge),(i,t)=>{let r=1;for(const s of t)r*=s.evaluate(i);return r}],"-":{type:ge,overloads:[[[ge,ge],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[ge],(i,[t])=>-t.evaluate(i)]]},"/":[ge,[ge,ge],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[ge,[ge,ge],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[ge,[ge],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))],log2:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[ge,[ge],(i,[t])=>Math.sin(t.evaluate(i))],cos:[ge,[ge],(i,[t])=>Math.cos(t.evaluate(i))],tan:[ge,[ge],(i,[t])=>Math.tan(t.evaluate(i))],asin:[ge,[ge],(i,[t])=>Math.asin(t.evaluate(i))],acos:[ge,[ge],(i,[t])=>Math.acos(t.evaluate(i))],atan:[ge,[ge],(i,[t])=>Math.atan(t.evaluate(i))],min:[ge,Jr(ge),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[ge,Jr(ge),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[ge,[ge],(i,[t])=>Math.abs(t.evaluate(i))],round:[ge,[ge],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[ge,[ge],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Le,[Ue,Oe],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Le,[Oe],(i,[t])=>i.id()===t.value],"filter-type-==":[Le,[Ue],(i,[t])=>i.geometryType()===t.value],"filter-<":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s{const r=i.id(),s=t.value;return typeof r==typeof s&&r":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[Le,[Oe],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>s}],"filter-<=":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[Le,[Oe],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r<=s}],"filter->=":[Le,[Ue,Oe],(i,[t,r])=>{const s=i.properties()[t.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[Le,[Oe],(i,[t])=>{const r=i.id(),s=t.value;return typeof r==typeof s&&r>=s}],"filter-has":[Le,[Oe],(i,[t])=>t.value in i.properties()],"filter-has-id":[Le,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Le,[A(Ue)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Le,[A(Oe)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Le,[Ue,A(Oe)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Le,[Ue,A(Oe)],(i,[t,r])=>function(s,l,c,d){for(;c<=d;){const f=c+d>>1;if(l[f]===s)return!0;l[f]>s?d=f-1:c=f+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Le,overloads:[[[Le,Le],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[Jr(Le),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Le,overloads:[[[Le,Le],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[Jr(Le),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Le,[Le],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Le,[Ue],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[Ue,[Ue],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[Ue,[Ue],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[Ue,Jr(Oe),(i,t)=>t.map(r=>dr(r.evaluate(i))).join("")],"resolved-locale":[Ue,[Yi],(i,[t])=>t.evaluate(i).resolvedLocale()]});class rs{constructor(t,r){var s;this.expression=t,this._warningHistory={},this._evaluator=new qn,this._defaultValue=r?(s=r).type==="color"&&Hs(s.default)?new et(0,0,0,0):s.type==="color"?et.parse(s.default)||null:s.type==="padding"?hi.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?ui.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,s,l,c,d){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(t,r,s,l,c,d){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new wt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function ns(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Kr}function ss(i,t){const r=new Ar(Kr,$s,[],t?function(l){const c={color:ei,string:Ue,number:ge,enum:Ue,boolean:Le,formatted:ur,padding:Ir,resolvedImage:Qi,variableAnchorOffsetCollection:j};return l.type==="array"?A(c[l.value]||Oe,l.length):c[l.type]}(t):void 0),s=r.parse(i,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Yo(new rs(s,t)):_n(r.errors)}class yn{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!es(r.expression)}evaluateWithoutErrorHandling(t,r,s,l,c,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,c,d)}evaluate(t,r,s,l,c,d){return this._styleExpression.evaluate(t,r,s,l,c,d)}}class qa{constructor(t,r,s,l){this.kind=t,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!es(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,s,l,c,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,c,d)}evaluate(t,r,s,l,c,d){return this._styleExpression.evaluate(t,r,s,l,c,d)}interpolationFactor(t,r,s){return this.interpolationType?pi.interpolationFactor(this.interpolationType,t,r,s):0}}function tl(i,t){const r=ss(i,t);if(r.result==="error")return r;const s=r.value.expression,l=qs(s);if(!l&&!gn(t))return _n([new Xt("","data expressions not supported")]);const c=Zs(s,["zoom"]);if(!c&&!ja(t))return _n([new Xt("","zoom expressions not supported")]);const d=Ks(s);return d||c?d instanceof Xt?_n([d]):d instanceof pi&&!Gs(t)?_n([new Xt("",'"interpolate" expressions cannot be used with this property')]):Yo(d?new qa(l?"camera":"composite",r.value,d.labels,d instanceof pi?d.interpolation:void 0):new yn(l?"constant":"source",r.value)):_n([new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ws{constructor(t,r){this._parameters=t,this._specification=r,Ki(this,Ua(this._parameters,this._specification))}static deserialize(t){return new Ws(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ks(i){let t=null;if(i instanceof Ye)t=Ks(i.result);else if(i instanceof Ls){for(const r of i.args)if(t=Ks(r),t)break}else(i instanceof pn||i instanceof pi)&&i.input instanceof fi&&i.input.name==="zoom"&&(t=i);return t instanceof Xt||i.eachChild(r=>{const s=Ks(r);s instanceof Xt?t=s:!t&&s?t=new Xt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&s&&t!==s&&(t=new Xt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Za(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const t of i.slice(1))if(!Za(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Js={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function xn(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Za(i)||(i=as(i));const t=ss(i,Js);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>t.value.evaluate(r,s,{},l),needGeometry:vn(i)}}function mi(i,t){return it?1:0}function vn(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?Ga(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(as))):t==="all"?["all"].concat(i.slice(1).map(as)):t==="none"?["all"].concat(i.slice(1).map(as).map(os)):t==="in"?il(i[1],i.slice(2)):t==="!in"?os(il(i[1],i.slice(2))):t==="has"?bn(i[1]):t!=="!has"||os(bn(i[1]));var r}function Ga(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function il(i,t){if(t.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(mi)]]:["filter-in-small",i,["literal",t]]}}function bn(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function os(i){return["!",i]}function ls(i){const t=typeof i;if(t==="number"||t==="boolean"||t==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const c of i)l+=`${ls(c)},`;return`${l}]`}const r=Object.keys(i).sort();let s="{";for(let l=0;ls.maximum?[new pe(t,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function ea(i){const t=i.valueSpec,r=vt(i.value.type);let s,l,c,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=He(i.value.stops)==="array"&&He(i.value.stops[0])==="array"&&He(i.value.stops[0][0])==="object",b=wi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(M){if(r==="identity")return[new pe(M.key,M.value,'identity function may not have a "stops" property')];let k=[];const z=M.value;return k=k.concat(cs({key:M.key,value:z,valueSpec:M.valueSpec,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:w})),He(z)==="array"&&z.length===0&&k.push(new pe(M.key,z,"array must have at least one stop")),k},default:function(M){return M.validateSpec({key:M.key,value:M.value,valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec})}}});return r==="identity"&&f&&b.push(new pe(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new pe(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Gs(i.valueSpec)&&b.push(new pe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!gn(i.valueSpec)?b.push(new pe(i.key,i.value,"property functions not supported")):f&&!ja(i.valueSpec)&&b.push(new pe(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new pe(i.key,i.value,'"property" property is required')),b;function w(M){let k=[];const z=M.value,O=M.key;if(He(z)!=="array")return[new pe(O,z,`array expected, ${He(z)} found`)];if(z.length!==2)return[new pe(O,z,`array length 2 expected, length ${z.length} found`)];if(x){if(He(z[0])!=="object")return[new pe(O,z,`object expected, ${He(z[0])} found`)];if(z[0].zoom===void 0)return[new pe(O,z,"object stop key must have zoom")];if(z[0].value===void 0)return[new pe(O,z,"object stop key must have value")];if(c&&c>vt(z[0].zoom))return[new pe(O,z[0].zoom,"stop zoom values must appear in ascending order")];vt(z[0].zoom)!==c&&(c=vt(z[0].zoom),l=void 0,d={}),k=k.concat(wi({key:`${O}[0]`,value:z[0],valueSpec:{zoom:{}},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:Qs,value:I}}))}else k=k.concat(I({key:`${O}[0]`,value:z[0],valueSpec:{},validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec},z));return ns(zi(z[1]))?k.concat([new pe(`${O}[1]`,z[1],"expressions are not allowed in function stops.")]):k.concat(M.validateSpec({key:`${O}[1]`,value:z[1],valueSpec:t,validateSpec:M.validateSpec,style:M.style,styleSpec:M.styleSpec}))}function I(M,k){const z=He(M.value),O=vt(M.value),$=M.value!==null?M.value:k;if(s){if(z!==s)return[new pe(M.key,$,`${z} stop domain type must match previous stop domain type ${s}`)]}else s=z;if(z!=="number"&&z!=="string"&&z!=="boolean")return[new pe(M.key,$,"stop domain value must be a number, string, or boolean")];if(z!=="number"&&r!=="categorical"){let Q=`number expected, ${z} found`;return gn(t)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new pe(M.key,$,Q)]}return r!=="categorical"||z!=="number"||isFinite(O)&&Math.floor(O)===O?r!=="categorical"&&z==="number"&&l!==void 0&&Onew pe(`${i.key}${s.key}`,i.value,s.message));const r=t.value.expression||t.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new pe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!es(r))return[new pe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!es(r))return[new pe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Zs(r,["zoom","feature-state"]))return[new pe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!qs(r))return[new pe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function wn(i){const t=i.key,r=i.value,s=i.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(vt(r))===-1&&l.push(new pe(t,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(vt(r))===-1&&l.push(new pe(t,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function Ha(i){return Za(zi(i.value))?Yr(Ki({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ta(i)}function ta(i){const t=i.value,r=i.key;if(He(t)!=="array")return[new pe(r,t,`array expected, ${He(t)} found`)];const s=i.styleSpec;let l,c=[];if(t.length<1)return[new pe(r,t,"filter array must have at least 1 element")];switch(c=c.concat(wn({key:`${r}[0]`,value:t[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),vt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&vt(t[1])==="$type"&&c.push(new pe(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&c.push(new pe(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=He(t[1]),l!=="string"&&c.push(new pe(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let d=2;dd[i]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var q={exports:{}},H={exports:{}},K={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h={overlay:function(i){return{position:"fixed",zIndex:1e3,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.3)",opacity:i?1:0,MozTransform:i?"":"translate3d(100%, 0, 0)",MsTransform:i?"":"translate3d(100%, 0, 0)",OTransform:i?"":"translate3d(100%, 0, 0)",WebkitTransform:i?"":"translate3d(100%, 0, 0)",transform:i?"":"translate3d(100%, 0, 0)",transition:i?"opacity 0.3s":"opacity 0.3s, transform 0s 0.3s"}},menuWrap:function(i,C,u){return{position:"fixed",right:u?0:"inherit",zIndex:1100,width:C,height:"100%",MozTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",MsTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",OTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",WebkitTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transition:"all 0.5s"}},menu:function(){return{height:"100%",boxSizing:"border-box",overflow:"auto"}},itemList:function(){return{height:"100%"}},item:function(){return{display:"block"}}};m.default=h,f.exports=m.default})(K,K.exports);var ye=K.exports,M={};Object.defineProperty(M,"__esModule",{value:!0});M.focusOnFirstMenuItem=te;M.focusOnLastMenuItem=ne;M.focusOnCrossButton=re;M.focusOnMenuButton=ge;M.focusOnMenuItem=Q;M.focusOnNextMenuItem=he;M.focusOnPreviousMenuItem=be;function te(){var f=Array.from(document.getElementsByClassName("bm-item")).shift();f&&f.focus()}function ne(){var f=Array.from(document.getElementsByClassName("bm-item")).pop();f&&f.focus()}function re(){var f=document.getElementById("react-burger-cross-btn");f&&f.focus()}function ge(){var f=document.getElementById("react-burger-menu-btn");f&&f.focus()}function Q(f){if(document.activeElement.className.includes("bm-item")){var m=document.activeElement[f];m?m.focus():re()}else f==="previousElementSibling"?ne():te()}function he(){Q("nextElementSibling")}function be(){Q("previousElementSibling")}var $={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h=Object.assign||function(o){for(var e=1;ed[i]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var q={exports:{}},H={exports:{}},K={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h={overlay:function(i){return{position:"fixed",zIndex:1e3,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.3)",opacity:i?1:0,MozTransform:i?"":"translate3d(100%, 0, 0)",MsTransform:i?"":"translate3d(100%, 0, 0)",OTransform:i?"":"translate3d(100%, 0, 0)",WebkitTransform:i?"":"translate3d(100%, 0, 0)",transform:i?"":"translate3d(100%, 0, 0)",transition:i?"opacity 0.3s":"opacity 0.3s, transform 0s 0.3s"}},menuWrap:function(i,C,u){return{position:"fixed",right:u?0:"inherit",zIndex:1100,width:C,height:"100%",MozTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",MsTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",OTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",WebkitTransform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transform:i?"":u?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transition:"all 0.5s"}},menu:function(){return{height:"100%",boxSizing:"border-box",overflow:"auto"}},itemList:function(){return{height:"100%"}},item:function(){return{display:"block"}}};m.default=h,f.exports=m.default})(K,K.exports);var ye=K.exports,M={};Object.defineProperty(M,"__esModule",{value:!0});M.focusOnFirstMenuItem=te;M.focusOnLastMenuItem=ne;M.focusOnCrossButton=re;M.focusOnMenuButton=ge;M.focusOnMenuItem=Q;M.focusOnNextMenuItem=he;M.focusOnPreviousMenuItem=be;function te(){var f=Array.from(document.getElementsByClassName("bm-item")).shift();f&&f.focus()}function ne(){var f=Array.from(document.getElementsByClassName("bm-item")).pop();f&&f.focus()}function re(){var f=document.getElementById("react-burger-cross-btn");f&&f.focus()}function ge(){var f=document.getElementById("react-burger-menu-btn");f&&f.focus()}function Q(f){if(document.activeElement.className.includes("bm-item")){var m=document.activeElement[f];m?m.focus():re()}else f==="previousElementSibling"?ne():te()}function he(){Q("nextElementSibling")}function be(){Q("previousElementSibling")}var $={exports:{}};(function(f,m){Object.defineProperty(m,"__esModule",{value:!0});var h=Object.assign||function(o){for(var e=1;e - +